{"_id":"@aimform/spaces","_rev":"6-09e05bfdf4d513278e55ca01b276582a","name":"@aimform/spaces","dist-tags":{"latest":"0.3.2"},"versions":{"0.1.0":{"name":"@aimform/spaces","version":"0.1.0","keywords":["aimform","spaces","entities","blocks","content-model","notion"],"author":{"name":"Universal Reason LLC"},"license":"MIT","_id":"@aimform/spaces@0.1.0","maintainers":[{"name":"adamhalasz","email":"mail@adamhalasz.com"}],"homepage":"https://aimform.com","bugs":{"url":"https://github.com/aimform/spaces/issues"},"dist":{"shasum":"15786034520a001cb5ee74f8344f23a007cfdf9c","tarball":"https://registry.npmjs.org/@aimform/spaces/-/spaces-0.1.0.tgz","fileCount":3,"integrity":"sha512-vqyrtNXgA7/gqVFJZVA6RG2SvKqlz5rzxizFP8A7yMk7os1DVPk1quOipnrWScEbzcJQKTkJeOXbW0MHjuKU1w==","signatures":[{"sig":"MEYCIQDMugTfU+FIQwY5dDlf53qKQ982iUMgMfVt1HrU9pN1CAIhAKx94Exy0tGih6x1FZK+VFALKjoTJIpeI3TRcn5upmRo","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":6762},"type":"module","exports":{".":{"types":"./src/index.ts","import":"./src/index.ts"}},"gitHead":"4cd8b43c239648004faefd18d016337a666320ba","scripts":{"test":"vitest run","typecheck":"tsc --noEmit","test:coverage":"vitest run --coverage"},"_npmUser":{"name":"adamhalasz","email":"mail@adamhalasz.com"},"repository":{"url":"git+https://github.com/aimform/spaces.git","type":"git"},"_npmVersion":"11.8.0","description":"Aimform Spaces — general-purpose content model: Spaces, Entities, Blocks, Properties, Views, Files, Connections, and Conversations.","directories":{},"sideEffects":false,"_nodeVersion":"25.6.0","dependencies":{"@aimform/auth":"workspace:*","@aimform/core":"workspace:*"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^3.0.0","typescript":"^5.7.0","@vitest/coverage-istanbul":"^3.0.0"},"_npmOperationalInternal":{"tmp":"tmp/spaces_0.1.0_1785277518957_0.41838848157541686","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@aimform/spaces","version":"0.1.1","keywords":["aimform","spaces","entities","blocks","content-model","notion"],"author":{"name":"Universal Reason LLC"},"license":"MIT","_id":"@aimform/spaces@0.1.1","maintainers":[{"name":"adamhalasz","email":"mail@adamhalasz.com"}],"homepage":"https://aimform.com","bugs":{"url":"https://github.com/aimform/spaces/issues"},"dist":{"shasum":"8aadf5cc84e6aa1f2f2eb8580d9784bca0055765","tarball":"https://registry.npmjs.org/@aimform/spaces/-/spaces-0.1.1.tgz","fileCount":4,"integrity":"sha512-fGyl+jx2QXIcYoH1BY8wCGIzrwBIv292pBAGI7h/AbOwSTAH8nTqGyQcFHmx3qTH7zdQNNCb1i8GAKhU7/cpUA==","signatures":[{"sig":"MEQCIBN5U3MHEjB5CW7ADC4moq6rJLFOb6zQDm1551AZxV2mAiBJsvcsN5L0EsAHq+hfs1WkIL7qwT+3gSXYU0MYPPOf5g==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":9779},"type":"module","exports":{".":{"types":"./src/index.ts","import":"./src/index.ts"}},"gitHead":"fc67b2c773af16726735546a6335f73f85a1acf6","scripts":{"test":"vitest run","typecheck":"tsc --noEmit","test:coverage":"vitest run --coverage"},"_npmUser":{"name":"adamhalasz","email":"mail@adamhalasz.com"},"repository":{"url":"git+https://github.com/aimform/spaces.git","type":"git"},"_npmVersion":"11.8.0","description":"Aimform Spaces — general-purpose content model: Spaces, Entities, Blocks, Properties, Views, Files, Connections, and Conversations.","directories":{},"sideEffects":false,"_nodeVersion":"25.6.0","dependencies":{"@aimform/auth":"workspace:*","@aimform/core":"workspace:*"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^3.0.0","typescript":"^5.7.0","@vitest/coverage-istanbul":"^3.0.0"},"_npmOperationalInternal":{"tmp":"tmp/spaces_0.1.1_1785277688578_0.7623761500020918","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@aimform/spaces","version":"0.1.2","keywords":["aimform","spaces","entities","blocks","content-model","notion"],"author":{"name":"Universal Reason LLC"},"license":"MIT","_id":"@aimform/spaces@0.1.2","maintainers":[{"name":"adamhalasz","email":"mail@adamhalasz.com"}],"homepage":"https://aimform.com","bugs":{"url":"https://github.com/aimform/spaces/issues"},"dist":{"shasum":"e785df6eedde5950232d2f125e400121acd69e6c","tarball":"https://registry.npmjs.org/@aimform/spaces/-/spaces-0.1.2.tgz","fileCount":4,"integrity":"sha512-EL02PMS1Xg2hrdda5p3gXOJ5FjsN0H7tcJBT2o4jShvNnXO0O+CHXeP6LiyEjZItKAoLNzomdmG8jS3wmlIziQ==","signatures":[{"sig":"MEUCIQCLuOplKfPCoxyX4cfXOapH0teGMaQcf280C4WBpQ3EsQIgEjBxvFRvsTdjsEFAEDdcj/CZsl9S9YuAtfTaasq8WeM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":9776},"type":"module","exports":{".":{"types":"./src/index.ts","import":"./src/index.ts"}},"gitHead":"fc67b2c773af16726735546a6335f73f85a1acf6","scripts":{"test":"vitest run","typecheck":"tsc --noEmit","test:coverage":"vitest run --coverage"},"_npmUser":{"name":"adamhalasz","email":"mail@adamhalasz.com"},"repository":{"url":"git+https://github.com/aimform/spaces.git","type":"git"},"_npmVersion":"11.8.0","description":"Aimform Spaces — general-purpose content model: Spaces, Entities, Blocks, Properties, Views, Files, Connections, and Conversations.","directories":{},"sideEffects":false,"_nodeVersion":"25.6.0","dependencies":{"@aimform/auth":"workspace:*","@aimform/core":"workspace:*"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^3.0.0","typescript":"^5.7.0","@vitest/coverage-istanbul":"^3.0.0"},"_npmOperationalInternal":{"tmp":"tmp/spaces_0.1.2_1785277806366_0.9312832059827731","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"@aimform/spaces","version":"0.3.0","keywords":["aimform","spaces","entities","blocks","content-model","notion"],"author":{"name":"Universal Reason LLC"},"license":"MIT","_id":"@aimform/spaces@0.3.0","maintainers":[{"name":"adamhalasz","email":"mail@adamhalasz.com"}],"homepage":"https://aimform.com","bugs":{"url":"https://github.com/aimform/spaces/issues"},"dist":{"shasum":"09e305488a6791b13fd84f6cb4a3f13aa510830f","tarball":"https://registry.npmjs.org/@aimform/spaces/-/spaces-0.3.0.tgz","fileCount":4,"integrity":"sha512-FLo1Z0VMPAlKth0Ml4y5wrvotWW38aZ24WPtcSGK68cMle4y39VYeyH5Zvm/dpWKG7SxpRSGCOrH3yAUqHfpJg==","signatures":[{"sig":"MEYCIQDv6BmpQLU1Hqr4ycsV3cikfoGUUl16byhxSQXnxT2UXAIhALbqAPFOLNIEsEBOf6huRQsfTW07BksvLhO3Zh3vetOi","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":9776},"type":"module","exports":{".":{"types":"./src/index.ts","import":"./src/index.ts"}},"gitHead":"aa0843bf76abd68cf40a7d3edddc4aec51cb72ef","scripts":{"test":"vitest run","typecheck":"tsc --noEmit","test:coverage":"vitest run --coverage"},"_npmUser":{"name":"adamhalasz","email":"mail@adamhalasz.com"},"repository":{"url":"git+https://github.com/aimform/spaces.git","type":"git"},"_npmVersion":"11.8.0","description":"Aimform Spaces — general-purpose content model: Spaces, Entities, Blocks, Properties, Views, Files, Connections, and Conversations.","directories":{},"sideEffects":false,"_nodeVersion":"25.6.0","dependencies":{"@aimform/auth":"workspace:*","@aimform/core":"workspace:*"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^3.0.0","typescript":"^5.7.0","@vitest/coverage-istanbul":"^3.0.0"},"_npmOperationalInternal":{"tmp":"tmp/spaces_0.3.0_1785278543552_0.2917501323309677","host":"s3://npm-registry-packages-npm-production"}},"0.3.1":{"name":"@aimform/spaces","version":"0.3.1","keywords":["aimform","spaces","entities","blocks","content-model","notion"],"author":{"name":"Universal Reason LLC"},"license":"MIT","_id":"@aimform/spaces@0.3.1","maintainers":[{"name":"adamhalasz","email":"mail@adamhalasz.com"}],"homepage":"https://aimform.com","bugs":{"url":"https://github.com/aimform/spaces/issues"},"dist":{"shasum":"4a22dfb643c1c84173c798d62c01e302e466f9ea","tarball":"https://registry.npmjs.org/@aimform/spaces/-/spaces-0.3.1.tgz","fileCount":13,"integrity":"sha512-LQucrK7cbki0SmdzbDDvmx6b48JiHM9Vd816LcZGduOWGhgFhrAy7UuL700GaIVH+JgFI6pK0r0VnzeTaKlw4A==","signatures":[{"sig":"MEUCIGn/psP5PACjDPWW+5SuLPOBbxi3DOkLPdtl6LdPg4qGAiEA1xn7/4Si4lCH5W9+vvz8eTeB8Iwqp332KWhxVeZuKSQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":105214},"type":"module","exports":{".":{"types":"./src/index.ts","import":"./src/index.ts"},"./adapters":{"types":"./src/adapters/index.ts","import":"./src/adapters/index.ts"}},"gitHead":"8d7c51ea5cde9ddea98da8e71edbae89a7bb70b0","scripts":{"test":"vitest run","typecheck":"tsc --noEmit","test:coverage":"vitest run --coverage"},"_npmUser":{"name":"adamhalasz","email":"mail@adamhalasz.com"},"repository":{"url":"git+https://github.com/aimform/spaces.git","type":"git"},"_npmVersion":"11.8.0","description":"Aimform Spaces — general-purpose content model: Spaces, Entities, Blocks, Properties, Views, Files, Connections, and Conversations.","directories":{},"sideEffects":false,"_nodeVersion":"25.6.0","dependencies":{"@aimform/auth":"workspace:*","@aimform/core":"workspace:*"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^3.0.0","typescript":"^5.7.0","@cloudflare/workers-types":"^4.20250224.0","@vitest/coverage-istanbul":"^3.0.0"},"_npmOperationalInternal":{"tmp":"tmp/spaces_0.3.1_1785342984570_0.42046776763656024","host":"s3://npm-registry-packages-npm-production"}},"0.3.2":{"name":"@aimform/spaces","version":"0.3.2","description":"Aimform Spaces — general-purpose content model: Spaces, Entities, Blocks, Properties, Views, Files, Connections, and Conversations.","type":"module","license":"MIT","sideEffects":false,"exports":{".":{"types":"./src/index.ts","import":"./src/index.ts"},"./adapters":{"types":"./src/adapters/index.ts","import":"./src/adapters/index.ts"}},"scripts":{"typecheck":"tsc --noEmit","test":"vitest run","test:coverage":"vitest run --coverage"},"dependencies":{"@aimform/core":"workspace:*","@aimform/auth":"workspace:*"},"devDependencies":{"typescript":"^5.7.0","vitest":"^3.0.0","@vitest/coverage-istanbul":"^3.0.0","@cloudflare/workers-types":"^4.20250224.0"},"repository":{"type":"git","url":"git+https://github.com/aimform/spaces.git"},"keywords":["aimform","spaces","entities","blocks","content-model","notion"],"author":{"name":"Universal Reason LLC"},"homepage":"https://aimform.com","gitHead":"1c39fb4a2034ab6fb64d1fcb86dfb966cdeb6770","_id":"@aimform/spaces@0.3.2","bugs":{"url":"https://github.com/aimform/spaces/issues"},"_nodeVersion":"25.6.0","_npmVersion":"11.8.0","dist":{"integrity":"sha512-Eq0B9DvCik7OSpwMbL6ZFSowlG7vNGR2FXgX9Z8Bzr1ieaOgM4lvVSHVwmTJgRAw7T/+L0+RlECJWs3+EYrHZA==","shasum":"f12bdc34dcbe8f31b5f72506f3f9514ae0b0d8cc","tarball":"https://registry.npmjs.org/@aimform/spaces/-/spaces-0.3.2.tgz","fileCount":13,"unpackedSize":105557,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIGPRYtZUJsbi0Pjmly7JW2N4cEGll/8R6mU+UteofF5gAiEA88KXRKvZK+OQ8Bvx91w3VZWomHRUaOmi8nhA457oqm0="}]},"_npmUser":{"name":"adamhalasz","email":"mail@adamhalasz.com"},"directories":{},"maintainers":[{"name":"adamhalasz","email":"mail@adamhalasz.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/spaces_0.3.2_1785343279016_0.3670301599343375"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-28T22:25:18.776Z","modified":"2026-07-29T16:41:19.373Z","0.1.0":"2026-07-28T22:25:19.113Z","0.1.1":"2026-07-28T22:28:08.721Z","0.1.2":"2026-07-28T22:30:06.523Z","0.3.0":"2026-07-28T22:42:23.683Z","0.3.1":"2026-07-29T16:36:24.738Z","0.3.2":"2026-07-29T16:41:19.158Z"},"bugs":{"url":"https://github.com/aimform/spaces/issues"},"author":{"name":"Universal Reason LLC"},"license":"MIT","homepage":"https://aimform.com","keywords":["aimform","spaces","entities","blocks","content-model","notion"],"repository":{"type":"git","url":"git+https://github.com/aimform/spaces.git"},"description":"Aimform Spaces — general-purpose content model: Spaces, Entities, Blocks, Properties, Views, Files, Connections, and Conversations.","maintainers":[{"name":"adamhalasz","email":"mail@adamhalasz.com"}],"readme":"# @aimform/spaces\n\n> General-purpose content model — Spaces, Entities, Blocks, Properties, Collections, Views, Files, Connections, and Conversations.\n\n## Install\n\n```sh\nnpm install @aimform/spaces @aimform/core\n```\n\n## Usage\n\n```ts\nimport { Spaces, Entities, Blocks, Collections, Properties, Views, Files, Connections, Conversations }\n  from \"@aimform/spaces\";\n\n// D1\nconst spaces = new Spaces({ database: env.DB });\nconst blocks = new Blocks({ database: env.DB });\n\n// Platform API\nconst aimform = createAimform({ apiKey: \"af_xxx\" });\nconst spaces = new Spaces({ client: aimform.client });\nconst entities = new Entities({ client: aimform.client });\n```\n\n### Spaces\n\n```ts\nimport { Spaces } from \"@aimform/spaces\";\n\nconst spaces = new Spaces({ database: db });\nawait spaces.list(\"org_456\");\nawait spaces.get(\"spc_123\");\nawait spaces.create({ ownerType: \"organization\", ownerId: \"o1\", name: \"Project\", createdByProfileId: \"p1\" });\nawait spaces.update(\"spc_123\", { name: \"Renamed\" });\nawait spaces.delete(\"spc_123\");\nawait spaces.getIndex(\"spc_123\");\n```\n\n→ [Spaces docs](./docs/spaces.md)\n\n### Entities\n\n```ts\nimport { Entities } from \"@aimform/spaces\";\n\nconst entities = new Entities({ database: db });\nawait entities.list(\"spc_123\", { entityType: \"task\" });\nawait entities.get(\"ent_789\");\nawait entities.create({ spaceId: \"spc_123\", entityType: \"task\", properties: { title: \"Setup CI\" }, createdByProfileId: \"p1\" });\nawait entities.update(\"ent_789\", { properties: { status: \"done\" } });\nawait entities.delete(\"ent_789\");\n```\n\n→ [Entities docs](./docs/entities.md)\n\n### Blocks\n\n```ts\nimport { Blocks } from \"@aimform/spaces\";\n\nconst blocks = new Blocks({ database: db });\nawait blocks.list(\"ent_789\");\nawait blocks.add(\"ent_789\", { blockType: \"paragraph\", content: \"Hello world\" });\nawait blocks.addSource(block.id, { sourceType: \"url\", sourceUrl: \"https://...\", excerpt: \"...\", confidence: \"high\" });\nawait blocks.update(block.id, { content: \"Updated\" });\nawait blocks.delete(block.id);\nawait blocks.removeSource(block.id, source.id);\n```\n\n→ [Blocks docs](./docs/blocks.md)\n\n### Collections\n\n```ts\nimport { Collections } from \"@aimform/spaces\";\n\nconst collections = new Collections({ database: db });\nawait collections.list(\"spc_123\");\nawait collections.upsert({\n  spaceId: \"spc_123\", entityType: \"task\",\n  renderMode: \"record\", presentation: \"collection\",\n  displayName: \"Tasks\", pinned: true, position: 0,\n});\nawait collections.delete(\"spc_123\", \"task\");\n```\n\n→ [Collections docs](./docs/collections.md)\n\n### Properties\n\n```ts\nimport { Properties } from \"@aimform/spaces\";\n\nconst properties = new Properties({ database: db });\nawait properties.list(\"spc_123\", \"task\");\nawait properties.create({ spaceId: \"spc_123\", key: \"priority\", label: \"Priority\", valueType: \"select\" });\nawait properties.update(\"prop_1\", { label: \"Task Priority\" });\nawait properties.delete(\"prop_1\");\n```\n\n→ [Properties docs](./docs/properties.md)\n\n### Views\n\n```ts\nimport { Views } from \"@aimform/spaces\";\n\nconst views = new Views({ database: db });\nawait views.list(\"spc_123\");\nawait views.create({ spaceId: \"spc_123\", name: \"Active Tasks\", viewType: \"table\", entityType: \"task\" });\nawait views.update(\"view_1\", { filters: JSON.stringify([{ field: \"status\", operator: \"eq\", value: \"active\" }]) });\nawait views.delete(\"view_1\");\n```\n\n→ [Views docs](./docs/views.md)\n\n### Files\n\n```ts\nimport { Files } from \"@aimform/spaces\";\n\nconst files = new Files({ database: db });\nawait files.list(\"org_456\");\nawait files.get(\"file_1\");\nawait files.put({ orgId: \"org_456\", r2Key: \"reports/q4.pdf\", mimeType: \"application/pdf\", sizeBytes: 1024 });\nawait files.delete(\"file_1\");\nawait files.getPresignedUrl(\"reports/q4.pdf\", \"application/pdf\", 3600);\n```\n\n→ [Files docs](./docs/files.md)\n\n### Connections\n\n```ts\nimport { Connections } from \"@aimform/spaces\";\n\nconst connections = new Connections({ database: db });\nawait connections.list(\"org_456\");\nawait connections.create({ orgId: \"org_456\", provider: \"xero\", credentials: \"...\" });\nawait connections.listProviders();\nconst result = await connections.resolveCapability(\"org_456\", \"financial:transactions:read\");\nawait connections.getCanonicalData(\"conn_1\", \"financial:transactions:read\", { limit: 50 });\nawait connections.grantAccess(\"conn_1\", \"client_1\", [\"financial:transactions:read\"]);\nawait connections.revoke(\"conn_1\");\n```\n\n→ [Connections docs](./docs/connections.md)\n\n### Conversations\n\n```ts\nimport { Conversations } from \"@aimform/spaces\";\n\nconst conversations = new Conversations({ database: db });\nawait conversations.list(\"org_456\", \"prof_123\");\nawait conversations.create({ orgId: \"org_456\", profileId: \"prof_123\", contextScope: \"space:spc_123\" });\nawait conversations.appendMessage(\"conv_1\", { role: \"user\", content: \"Hello\" });\nconst conv = await conversations.get(\"conv_1\");\nawait conversations.delete(\"conv_1\");\n```\n\n→ [Conversations docs](./docs/conversations.md)\n\n→ [Creating custom adapters](./docs/custom-adapters.md)\n","readmeFilename":"README.md"}