@contractspec/example.knowledge-canon 1.56.1 → 1.58.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/.turbo/turbo-build.log +41 -38
  2. package/.turbo/turbo-prebuild.log +1 -0
  3. package/CHANGELOG.md +28 -0
  4. package/dist/agent.d.ts +8 -16
  5. package/dist/agent.d.ts.map +1 -1
  6. package/dist/agent.js +28 -31
  7. package/dist/blueprint.d.ts +2 -6
  8. package/dist/blueprint.d.ts.map +1 -1
  9. package/dist/blueprint.js +26 -28
  10. package/dist/browser/agent.js +31 -0
  11. package/dist/browser/blueprint.js +26 -0
  12. package/dist/browser/docs/index.js +42 -0
  13. package/dist/browser/docs/knowledge-canon.docblock.js +42 -0
  14. package/dist/browser/example.js +33 -0
  15. package/dist/browser/index.js +191 -0
  16. package/dist/browser/source.sample.js +29 -0
  17. package/dist/browser/tenant.js +34 -0
  18. package/dist/docs/index.d.ts +2 -1
  19. package/dist/docs/index.d.ts.map +1 -0
  20. package/dist/docs/index.js +43 -1
  21. package/dist/docs/knowledge-canon.docblock.d.ts +2 -1
  22. package/dist/docs/knowledge-canon.docblock.d.ts.map +1 -0
  23. package/dist/docs/knowledge-canon.docblock.js +40 -26
  24. package/dist/example.d.ts +2 -6
  25. package/dist/example.d.ts.map +1 -1
  26. package/dist/example.js +31 -44
  27. package/dist/index.d.ts +7 -6
  28. package/dist/index.d.ts.map +1 -0
  29. package/dist/index.js +192 -8
  30. package/dist/node/agent.js +31 -0
  31. package/dist/node/blueprint.js +26 -0
  32. package/dist/node/docs/index.js +42 -0
  33. package/dist/node/docs/knowledge-canon.docblock.js +42 -0
  34. package/dist/node/example.js +33 -0
  35. package/dist/node/index.js +191 -0
  36. package/dist/node/source.sample.js +29 -0
  37. package/dist/node/tenant.js +34 -0
  38. package/dist/source.sample.d.ts +2 -6
  39. package/dist/source.sample.d.ts.map +1 -1
  40. package/dist/source.sample.js +29 -29
  41. package/dist/tenant.d.ts +2 -6
  42. package/dist/tenant.d.ts.map +1 -1
  43. package/dist/tenant.js +34 -32
  44. package/package.json +84 -29
  45. package/tsdown.config.js +1 -2
  46. package/.turbo/turbo-build$colon$bundle.log +0 -37
  47. package/dist/agent.js.map +0 -1
  48. package/dist/blueprint.js.map +0 -1
  49. package/dist/docs/knowledge-canon.docblock.js.map +0 -1
  50. package/dist/example.js.map +0 -1
  51. package/dist/source.sample.js.map +0 -1
  52. package/dist/tenant.js.map +0 -1
  53. package/tsconfig.tsbuildinfo +0 -1
@@ -1,30 +1,30 @@
1
- //#region src/source.sample.ts
2
- const productCanonNotionSource = {
3
- meta: {
4
- id: "source-canon-notion",
5
- tenantId: "artisan-co",
6
- spaceKey: "knowledge.product-canon",
7
- spaceVersion: "1.0.0",
8
- label: "Product Canon (Notion)",
9
- sourceType: "notion",
10
- createdAt: "2026-01-01T00:00:00.000Z",
11
- updatedAt: "2026-01-01T00:00:00.000Z"
12
- },
13
- config: {
14
- notionDatabaseId: "xxxxxxxxxxxxxxxx",
15
- apiKey: "secret_notion_token"
16
- },
17
- syncSchedule: {
18
- enabled: true,
19
- cron: "0 * * * *"
20
- },
21
- lastSync: {
22
- timestamp: /* @__PURE__ */ new Date("2026-01-01T00:00:00.000Z"),
23
- success: true,
24
- itemsProcessed: 128
25
- }
1
+ // @bun
2
+ // src/source.sample.ts
3
+ var productCanonNotionSource = {
4
+ meta: {
5
+ id: "source-canon-notion",
6
+ tenantId: "artisan-co",
7
+ spaceKey: "knowledge.product-canon",
8
+ spaceVersion: "1.0.0",
9
+ label: "Product Canon (Notion)",
10
+ sourceType: "notion",
11
+ createdAt: "2026-01-01T00:00:00.000Z",
12
+ updatedAt: "2026-01-01T00:00:00.000Z"
13
+ },
14
+ config: {
15
+ notionDatabaseId: "xxxxxxxxxxxxxxxx",
16
+ apiKey: "secret_notion_token"
17
+ },
18
+ syncSchedule: {
19
+ enabled: true,
20
+ cron: "0 * * * *"
21
+ },
22
+ lastSync: {
23
+ timestamp: new Date("2026-01-01T00:00:00.000Z"),
24
+ success: true,
25
+ itemsProcessed: 128
26
+ }
27
+ };
28
+ export {
29
+ productCanonNotionSource
26
30
  };
27
-
28
- //#endregion
29
- export { productCanonNotionSource };
30
- //# sourceMappingURL=source.sample.js.map
package/dist/tenant.d.ts CHANGED
@@ -1,7 +1,3 @@
1
- import { TenantAppConfig } from "@contractspec/lib.contracts/app-config/spec";
2
-
3
- //#region src/tenant.d.ts
4
- declare const artisanKnowledgeTenantConfig: TenantAppConfig;
5
- //#endregion
6
- export { artisanKnowledgeTenantConfig };
1
+ import type { TenantAppConfig } from '@contractspec/lib.contracts/app-config/spec';
2
+ export declare const artisanKnowledgeTenantConfig: TenantAppConfig;
7
3
  //# sourceMappingURL=tenant.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tenant.d.ts","names":[],"sources":["../src/tenant.ts"],"sourcesContent":[],"mappings":";;;cAEa,8BAA8B"}
1
+ {"version":3,"file":"tenant.d.ts","sourceRoot":"","sources":["../src/tenant.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6CAA6C,CAAC;AAEnF,eAAO,MAAM,4BAA4B,EAAE,eA6B1C,CAAC"}
package/dist/tenant.js CHANGED
@@ -1,33 +1,35 @@
1
- //#region src/tenant.ts
2
- const artisanKnowledgeTenantConfig = {
3
- meta: {
4
- id: "tenant-config-artisan-knowledge",
5
- tenantId: "artisan-co",
6
- appId: "artisan",
7
- blueprintName: "artisan.knowledge.product",
8
- blueprintVersion: "1.0.0",
9
- environment: "production",
10
- version: "1.0.0",
11
- status: "published",
12
- createdAt: "2026-01-01T00:00:00.000Z",
13
- updatedAt: "2026-01-01T00:00:00.000Z"
14
- },
15
- knowledge: [{
16
- spaceKey: "knowledge.product-canon",
17
- spaceVersion: "1.0.0",
18
- scope: {
19
- workflows: ["answerFaq"],
20
- agents: ["productSupportAssistant"]
21
- },
22
- constraints: {
23
- maxTokensPerQuery: 4096,
24
- maxQueriesPerMinute: 30
25
- }
26
- }],
27
- integrations: [],
28
- notes: "Product Canon knowledge space bound for production assistants."
1
+ // @bun
2
+ // src/tenant.ts
3
+ var artisanKnowledgeTenantConfig = {
4
+ meta: {
5
+ id: "tenant-config-artisan-knowledge",
6
+ tenantId: "artisan-co",
7
+ appId: "artisan",
8
+ blueprintName: "artisan.knowledge.product",
9
+ blueprintVersion: "1.0.0",
10
+ environment: "production",
11
+ version: "1.0.0",
12
+ status: "published",
13
+ createdAt: "2026-01-01T00:00:00.000Z",
14
+ updatedAt: "2026-01-01T00:00:00.000Z"
15
+ },
16
+ knowledge: [
17
+ {
18
+ spaceKey: "knowledge.product-canon",
19
+ spaceVersion: "1.0.0",
20
+ scope: {
21
+ workflows: ["answerFaq"],
22
+ agents: ["productSupportAssistant"]
23
+ },
24
+ constraints: {
25
+ maxTokensPerQuery: 4096,
26
+ maxQueriesPerMinute: 30
27
+ }
28
+ }
29
+ ],
30
+ integrations: [],
31
+ notes: "Product Canon knowledge space bound for production assistants."
32
+ };
33
+ export {
34
+ artisanKnowledgeTenantConfig
29
35
  };
30
-
31
- //#endregion
32
- export { artisanKnowledgeTenantConfig };
33
- //# sourceMappingURL=tenant.js.map
package/package.json CHANGED
@@ -1,54 +1,109 @@
1
1
  {
2
2
  "name": "@contractspec/example.knowledge-canon",
3
- "version": "1.56.1",
3
+ "version": "1.58.0",
4
4
  "description": "Knowledge example – Product Canon space (blueprint + tenant config + source sample + runtime helper).",
5
5
  "type": "module",
6
6
  "types": "./dist/index.d.ts",
7
7
  "exports": {
8
- ".": "./dist/index.js",
9
- "./agent": "./dist/agent.js",
10
- "./blueprint": "./dist/blueprint.js",
11
- "./docs": "./dist/docs/index.js",
12
- "./docs/knowledge-canon.docblock": "./dist/docs/knowledge-canon.docblock.js",
13
- "./example": "./dist/example.js",
14
- "./source.sample": "./dist/source.sample.js",
15
- "./tenant": "./dist/tenant.js",
16
- "./*": "./*"
8
+ ".": "./src/index.ts",
9
+ "./agent": "./src/agent.ts",
10
+ "./blueprint": "./src/blueprint.ts",
11
+ "./docs": "./src/docs/index.ts",
12
+ "./docs/index": "./src/docs/index.ts",
13
+ "./docs/knowledge-canon.docblock": "./src/docs/knowledge-canon.docblock.ts",
14
+ "./example": "./src/example.ts",
15
+ "./source.sample": "./src/source.sample.ts",
16
+ "./tenant": "./src/tenant.ts"
17
17
  },
18
18
  "scripts": {
19
19
  "publish:pkg": "bun publish --tolerate-republish --ignore-scripts --verbose",
20
20
  "publish:pkg:canary": "bun publish:pkg --tag canary",
21
- "build": "bun build:types && bun build:bundle",
22
- "build:bundle": "tsdown",
23
- "build:types": "tsc --noEmit",
24
- "dev": "bun build:bundle --watch",
21
+ "build": "bun run prebuild && bun run build:bundle && bun run build:types",
22
+ "build:bundle": "contractspec-bun-build transpile",
23
+ "build:types": "contractspec-bun-build types",
24
+ "dev": "contractspec-bun-build dev",
25
25
  "clean": "rimraf dist .turbo",
26
26
  "lint": "bun lint:fix",
27
27
  "lint:fix": "eslint src --fix",
28
28
  "lint:check": "eslint src",
29
- "test": "bun test"
29
+ "test": "bun test",
30
+ "prebuild": "contractspec-bun-build prebuild",
31
+ "typecheck": "tsc --noEmit"
30
32
  },
31
33
  "dependencies": {
32
- "@contractspec/lib.contracts": "1.56.1"
34
+ "@contractspec/lib.contracts": "1.58.0"
33
35
  },
34
36
  "devDependencies": {
35
- "@contractspec/tool.tsdown": "1.56.1",
36
- "@contractspec/tool.typescript": "1.56.1",
37
- "tsdown": "^0.19.0",
38
- "typescript": "^5.9.3"
37
+ "@contractspec/tool.typescript": "1.58.0",
38
+ "typescript": "^5.9.3",
39
+ "@contractspec/tool.bun": "1.57.0"
39
40
  },
40
41
  "publishConfig": {
41
42
  "access": "public",
42
43
  "exports": {
43
- ".": "./dist/index.js",
44
- "./agent": "./dist/agent.js",
45
- "./blueprint": "./dist/blueprint.js",
46
- "./docs": "./dist/docs/index.js",
47
- "./docs/knowledge-canon.docblock": "./dist/docs/knowledge-canon.docblock.js",
48
- "./example": "./dist/example.js",
49
- "./source.sample": "./dist/source.sample.js",
50
- "./tenant": "./dist/tenant.js",
51
- "./*": "./*"
44
+ ".": {
45
+ "types": "./dist/index.d.ts",
46
+ "bun": "./dist/index.js",
47
+ "node": "./dist/node/index.mjs",
48
+ "browser": "./dist/browser/index.js",
49
+ "default": "./dist/index.js"
50
+ },
51
+ "./agent": {
52
+ "types": "./dist/agent.d.ts",
53
+ "bun": "./dist/agent.js",
54
+ "node": "./dist/node/agent.mjs",
55
+ "browser": "./dist/browser/agent.js",
56
+ "default": "./dist/agent.js"
57
+ },
58
+ "./blueprint": {
59
+ "types": "./dist/blueprint.d.ts",
60
+ "bun": "./dist/blueprint.js",
61
+ "node": "./dist/node/blueprint.mjs",
62
+ "browser": "./dist/browser/blueprint.js",
63
+ "default": "./dist/blueprint.js"
64
+ },
65
+ "./docs": {
66
+ "types": "./dist/docs/index.d.ts",
67
+ "bun": "./dist/docs/index.js",
68
+ "node": "./dist/node/docs/index.mjs",
69
+ "browser": "./dist/browser/docs/index.js",
70
+ "default": "./dist/docs/index.js"
71
+ },
72
+ "./docs/index": {
73
+ "types": "./dist/docs/index.d.ts",
74
+ "bun": "./dist/docs/index.js",
75
+ "node": "./dist/node/docs/index.mjs",
76
+ "browser": "./dist/browser/docs/index.js",
77
+ "default": "./dist/docs/index.js"
78
+ },
79
+ "./docs/knowledge-canon.docblock": {
80
+ "types": "./dist/docs/knowledge-canon.docblock.d.ts",
81
+ "bun": "./dist/docs/knowledge-canon.docblock.js",
82
+ "node": "./dist/node/docs/knowledge-canon.docblock.mjs",
83
+ "browser": "./dist/browser/docs/knowledge-canon.docblock.js",
84
+ "default": "./dist/docs/knowledge-canon.docblock.js"
85
+ },
86
+ "./example": {
87
+ "types": "./dist/example.d.ts",
88
+ "bun": "./dist/example.js",
89
+ "node": "./dist/node/example.mjs",
90
+ "browser": "./dist/browser/example.js",
91
+ "default": "./dist/example.js"
92
+ },
93
+ "./source.sample": {
94
+ "types": "./dist/source.sample.d.ts",
95
+ "bun": "./dist/source.sample.js",
96
+ "node": "./dist/node/source.sample.mjs",
97
+ "browser": "./dist/browser/source.sample.js",
98
+ "default": "./dist/source.sample.js"
99
+ },
100
+ "./tenant": {
101
+ "types": "./dist/tenant.d.ts",
102
+ "bun": "./dist/tenant.js",
103
+ "node": "./dist/node/tenant.mjs",
104
+ "browser": "./dist/browser/tenant.js",
105
+ "default": "./dist/tenant.js"
106
+ }
52
107
  },
53
108
  "registry": "https://registry.npmjs.org/"
54
109
  },
package/tsdown.config.js CHANGED
@@ -1,5 +1,4 @@
1
- import { defineConfig } from 'tsdown';
2
- import { moduleLibrary } from '@contractspec/tool.tsdown';
1
+ import { defineConfig, moduleLibrary } from '@contractspec/tool.bun';
3
2
 
4
3
  export default defineConfig(() => ({
5
4
  ...moduleLibrary,
@@ -1,37 +0,0 @@
1
- $ tsdown
2
- ℹ tsdown v0.19.0 powered by rolldown v1.0.0-beta.59
3
- ℹ config file: /home/runner/work/contractspec/contractspec/packages/examples/knowledge-canon/tsdown.config.js
4
- ℹ entry: src/agent.ts, src/blueprint.ts, src/example.ts, src/index.ts, src/source.sample.ts, src/tenant.ts, src/docs/index.ts, src/docs/knowledge-canon.docblock.ts
5
- ℹ target: esnext
6
- ℹ tsconfig: tsconfig.json
7
- ℹ Build start
8
- ℹ Cleaning 28 files
9
- ℹ dist/docs/knowledge-canon.docblock.js 1.68 kB │ gzip: 0.79 kB
10
- ℹ dist/agent.js 1.25 kB │ gzip: 0.62 kB
11
- ℹ dist/example.js 1.09 kB │ gzip: 0.56 kB
12
- ℹ dist/blueprint.js 0.85 kB │ gzip: 0.46 kB
13
- ℹ dist/tenant.js 0.82 kB │ gzip: 0.45 kB
14
- ℹ dist/source.sample.js 0.70 kB │ gzip: 0.41 kB
15
- ℹ dist/index.js 0.50 kB │ gzip: 0.21 kB
16
- ℹ dist/docs/index.js 0.04 kB │ gzip: 0.06 kB
17
- ℹ dist/docs/knowledge-canon.docblock.js.map 2.18 kB │ gzip: 0.97 kB
18
- ℹ dist/agent.js.map 2.13 kB │ gzip: 1.00 kB
19
- ℹ dist/example.js.map 1.53 kB │ gzip: 0.75 kB
20
- ℹ dist/tenant.js.map 1.35 kB │ gzip: 0.68 kB
21
- ℹ dist/blueprint.js.map 1.26 kB │ gzip: 0.64 kB
22
- ℹ dist/source.sample.js.map 1.14 kB │ gzip: 0.58 kB
23
- ℹ dist/agent.d.ts.map 0.29 kB │ gzip: 0.20 kB
24
- ℹ dist/source.sample.d.ts.map 0.14 kB │ gzip: 0.12 kB
25
- ℹ dist/example.d.ts.map 0.14 kB │ gzip: 0.13 kB
26
- ℹ dist/blueprint.d.ts.map 0.13 kB │ gzip: 0.12 kB
27
- ℹ dist/tenant.d.ts.map 0.12 kB │ gzip: 0.12 kB
28
- ℹ dist/agent.d.ts 0.91 kB │ gzip: 0.44 kB
29
- ℹ dist/index.d.ts 0.44 kB │ gzip: 0.19 kB
30
- ℹ dist/source.sample.d.ts 0.28 kB │ gzip: 0.18 kB
31
- ℹ dist/blueprint.d.ts 0.26 kB │ gzip: 0.18 kB
32
- ℹ dist/tenant.d.ts 0.26 kB │ gzip: 0.18 kB
33
- ℹ dist/example.d.ts 0.25 kB │ gzip: 0.17 kB
34
- ℹ dist/docs/index.d.ts 0.01 kB │ gzip: 0.03 kB
35
- ℹ dist/docs/knowledge-canon.docblock.d.ts 0.01 kB │ gzip: 0.03 kB
36
- ℹ 27 files, total: 19.76 kB
37
- ✔ Build complete in 20236ms
package/dist/agent.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"agent.js","names":[],"sources":["../src/agent.ts"],"sourcesContent":["import type { ResolvedAppConfig } from '@contractspec/lib.contracts/app-config/runtime';\n\n/**\n * Selects knowledge bindings that apply to a workflow or agent identifier.\n */\nexport function selectKnowledgeBindings(\n resolved: ResolvedAppConfig,\n options: { workflowId?: string; agentId?: string }\n) {\n return resolved.knowledge.filter(({ binding }) => {\n if (!binding.scope) return true;\n if (\n options.workflowId &&\n binding.scope.workflows?.includes(options.workflowId)\n )\n return true;\n if (options.agentId && binding.scope.agents?.includes(options.agentId))\n return true;\n return false;\n });\n}\n\n/**\n * Pseudo implementation of an assistant lookup that routes prompts to the appropriate\n * knowledge sources. In a real system this would call the ingestion/search services.\n */\nexport async function answerWithKnowledge(\n resolved: ResolvedAppConfig,\n question: string,\n { workflowId, agentId }: { workflowId?: string; agentId?: string }\n): Promise<string> {\n const bindings = selectKnowledgeBindings(resolved, { workflowId, agentId });\n if (bindings.length === 0) {\n return 'No knowledge space available for this request.';\n }\n\n const summaries = bindings.map(\n ({ space }) => `• ${space.meta.title || space.meta.description}`\n );\n return [\n `Q: ${question}`,\n 'Routed to knowledge spaces:',\n ...summaries,\n '',\n 'TODO: invoke knowledge search service and synthesize response.',\n ].join('\\n');\n}\n"],"mappings":";;;;AAKA,SAAgB,wBACd,UACA,SACA;AACA,QAAO,SAAS,UAAU,QAAQ,EAAE,cAAc;AAChD,MAAI,CAAC,QAAQ,MAAO,QAAO;AAC3B,MACE,QAAQ,cACR,QAAQ,MAAM,WAAW,SAAS,QAAQ,WAAW,CAErD,QAAO;AACT,MAAI,QAAQ,WAAW,QAAQ,MAAM,QAAQ,SAAS,QAAQ,QAAQ,CACpE,QAAO;AACT,SAAO;GACP;;;;;;AAOJ,eAAsB,oBACpB,UACA,UACA,EAAE,YAAY,WACG;CACjB,MAAM,WAAW,wBAAwB,UAAU;EAAE;EAAY;EAAS,CAAC;AAC3E,KAAI,SAAS,WAAW,EACtB,QAAO;CAGT,MAAM,YAAY,SAAS,KACxB,EAAE,YAAY,KAAK,MAAM,KAAK,SAAS,MAAM,KAAK,cACpD;AACD,QAAO;EACL,MAAM;EACN;EACA,GAAG;EACH;EACA;EACD,CAAC,KAAK,KAAK"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"blueprint.js","names":[],"sources":["../src/blueprint.ts"],"sourcesContent":["import type { AppBlueprintSpec } from '@contractspec/lib.contracts/app-config/spec';\nimport {\n OwnersEnum,\n StabilityEnum,\n TagsEnum,\n} from '@contractspec/lib.contracts/ownership';\n\nexport const artisanKnowledgeBlueprint: AppBlueprintSpec = {\n meta: {\n key: 'artisan.knowledge.product',\n version: '1.0.0',\n appId: 'artisan',\n title: 'ArtisanOS Knowledge – Product Canon',\n description:\n 'Blueprint that surfaces canonical product knowledge to agents and workflows.',\n domain: 'knowledge',\n owners: [OwnersEnum.PlatformContent],\n tags: ['knowledge', 'product-canon', TagsEnum.Guide],\n stability: StabilityEnum.Experimental,\n },\n workflows: {\n answerFaq: { key: 'artisan.knowledge.answerFaq', version: '1.0.0' },\n },\n notes:\n 'Workflows and assistants running on this blueprint should bind the Product Canon knowledge space.',\n};\n"],"mappings":";;;AAOA,MAAa,4BAA8C;CACzD,MAAM;EACJ,KAAK;EACL,SAAS;EACT,OAAO;EACP,OAAO;EACP,aACE;EACF,QAAQ;EACR,QAAQ,CAAC,WAAW,gBAAgB;EACpC,MAAM;GAAC;GAAa;GAAiB,SAAS;GAAM;EACpD,WAAW,cAAc;EAC1B;CACD,WAAW,EACT,WAAW;EAAE,KAAK;EAA+B,SAAS;EAAS,EACpE;CACD,OACE;CACH"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"knowledge-canon.docblock.js","names":[],"sources":["../../src/docs/knowledge-canon.docblock.ts"],"sourcesContent":["import type { DocBlock } from '@contractspec/lib.contracts/docs';\nimport { registerDocBlocks } from '@contractspec/lib.contracts/docs';\n\nconst blocks: DocBlock[] = [\n {\n id: 'docs.examples.knowledge-canon',\n title: 'Knowledge Example — Product Canon Space',\n summary:\n 'Bind the Product Canon KnowledgeSpaceSpec to a tenant and expose it to agents/workflows via ResolvedAppConfig.',\n kind: 'reference',\n visibility: 'public',\n route: '/docs/examples/knowledge-canon',\n tags: ['knowledge', 'canon', 'example'],\n body: `## Included assets\\n- Blueprint referencing a workflow depending on the Product Canon space.\\n- Tenant app config binding the space to a workflow and agent scope.\\n- Sample knowledge source configuration.\\n- Helper to pick knowledge bindings from ResolvedAppConfig.\\n\\n## Guardrails\\n- Keep sources scoped per tenant.\\n- Keep secret fields out of config (use secret providers).\\n- Enforce scope restrictions before answering.`,\n },\n {\n id: 'docs.examples.knowledge-canon.usage',\n title: 'Knowledge Canon — Usage',\n summary:\n 'How to register the space, configure sources, and route requests.',\n kind: 'usage',\n visibility: 'public',\n route: '/docs/examples/knowledge-canon/usage',\n tags: ['knowledge', 'usage'],\n body: `## Usage\\n1) Register the knowledge space spec in your KnowledgeSpaceRegistry.\\n2) Persist the source config through knowledge CRUD operations.\\n3) Compose ResolvedAppConfig and pass it to your workflow/agent runtime.\\n4) Use helpers like \\`selectKnowledgeBindings\\` before dispatching to search/embedding.\\n\\n## Notes\\n- Avoid logging PII.\\n- Keep search results auditable and cite sources.`,\n },\n];\n\nregisterDocBlocks(blocks);\n"],"mappings":";;;AA4BA,kBAzB2B,CACzB;CACE,IAAI;CACJ,OAAO;CACP,SACE;CACF,MAAM;CACN,YAAY;CACZ,OAAO;CACP,MAAM;EAAC;EAAa;EAAS;EAAU;CACvC,MAAM;CACP,EACD;CACE,IAAI;CACJ,OAAO;CACP,SACE;CACF,MAAM;CACN,YAAY;CACZ,OAAO;CACP,MAAM,CAAC,aAAa,QAAQ;CAC5B,MAAM;CACP,CACF,CAEwB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"example.js","names":[],"sources":["../src/example.ts"],"sourcesContent":["import { defineExample } from '@contractspec/lib.contracts';\n\nconst example = defineExample({\n meta: {\n key: 'knowledge-canon',\n version: '1.0.0',\n title: 'Knowledge Canon (Product Canon space)',\n description:\n 'Bind a canonical knowledge space to a tenant and route assistant/workflow requests to the right sources (blueprint + app config pattern).',\n kind: 'knowledge',\n visibility: 'public',\n stability: 'experimental',\n owners: ['@platform.core'],\n tags: ['knowledge', 'canon', 'app-config', 'agents', 'workflows'],\n },\n docs: {\n rootDocId: 'docs.examples.knowledge-canon',\n usageDocId: 'docs.examples.knowledge-canon.usage',\n },\n entrypoints: {\n packageName: '@contractspec/example.knowledge-canon',\n docs: './docs',\n },\n surfaces: {\n templates: true,\n sandbox: { enabled: true, modes: ['markdown', 'specs'] },\n studio: { enabled: true, installable: true },\n mcp: { enabled: true },\n },\n});\n\nexport default example;\n"],"mappings":";;;AAEA,MAAM,UAAU,cAAc;CAC5B,MAAM;EACJ,KAAK;EACL,SAAS;EACT,OAAO;EACP,aACE;EACF,MAAM;EACN,YAAY;EACZ,WAAW;EACX,QAAQ,CAAC,iBAAiB;EAC1B,MAAM;GAAC;GAAa;GAAS;GAAc;GAAU;GAAY;EAClE;CACD,MAAM;EACJ,WAAW;EACX,YAAY;EACb;CACD,aAAa;EACX,aAAa;EACb,MAAM;EACP;CACD,UAAU;EACR,WAAW;EACX,SAAS;GAAE,SAAS;GAAM,OAAO,CAAC,YAAY,QAAQ;GAAE;EACxD,QAAQ;GAAE,SAAS;GAAM,aAAa;GAAM;EAC5C,KAAK,EAAE,SAAS,MAAM;EACvB;CACF,CAAC;AAEF,sBAAe"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"source.sample.js","names":[],"sources":["../src/source.sample.ts"],"sourcesContent":["import type { KnowledgeSourceConfig } from '@contractspec/lib.contracts/knowledge/source';\n\nexport const productCanonNotionSource: KnowledgeSourceConfig = {\n meta: {\n id: 'source-canon-notion',\n tenantId: 'artisan-co',\n spaceKey: 'knowledge.product-canon',\n spaceVersion: '1.0.0',\n label: 'Product Canon (Notion)',\n sourceType: 'notion',\n createdAt: '2026-01-01T00:00:00.000Z',\n updatedAt: '2026-01-01T00:00:00.000Z',\n },\n config: {\n notionDatabaseId: 'xxxxxxxxxxxxxxxx',\n apiKey: 'secret_notion_token',\n },\n syncSchedule: {\n enabled: true,\n cron: '0 * * * *',\n },\n lastSync: {\n timestamp: new Date('2026-01-01T00:00:00.000Z'),\n success: true,\n itemsProcessed: 128,\n },\n};\n"],"mappings":";AAEA,MAAa,2BAAkD;CAC7D,MAAM;EACJ,IAAI;EACJ,UAAU;EACV,UAAU;EACV,cAAc;EACd,OAAO;EACP,YAAY;EACZ,WAAW;EACX,WAAW;EACZ;CACD,QAAQ;EACN,kBAAkB;EAClB,QAAQ;EACT;CACD,cAAc;EACZ,SAAS;EACT,MAAM;EACP;CACD,UAAU;EACR,2BAAW,IAAI,KAAK,2BAA2B;EAC/C,SAAS;EACT,gBAAgB;EACjB;CACF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"tenant.js","names":[],"sources":["../src/tenant.ts"],"sourcesContent":["import type { TenantAppConfig } from '@contractspec/lib.contracts/app-config/spec';\n\nexport const artisanKnowledgeTenantConfig: TenantAppConfig = {\n meta: {\n id: 'tenant-config-artisan-knowledge',\n tenantId: 'artisan-co',\n appId: 'artisan',\n blueprintName: 'artisan.knowledge.product',\n blueprintVersion: '1.0.0',\n environment: 'production',\n version: '1.0.0',\n status: 'published',\n createdAt: '2026-01-01T00:00:00.000Z',\n updatedAt: '2026-01-01T00:00:00.000Z',\n },\n knowledge: [\n {\n spaceKey: 'knowledge.product-canon',\n spaceVersion: '1.0.0',\n scope: {\n workflows: ['answerFaq'],\n agents: ['productSupportAssistant'],\n },\n constraints: {\n maxTokensPerQuery: 4096,\n maxQueriesPerMinute: 30,\n },\n },\n ],\n integrations: [],\n notes: 'Product Canon knowledge space bound for production assistants.',\n};\n"],"mappings":";AAEA,MAAa,+BAAgD;CAC3D,MAAM;EACJ,IAAI;EACJ,UAAU;EACV,OAAO;EACP,eAAe;EACf,kBAAkB;EAClB,aAAa;EACb,SAAS;EACT,QAAQ;EACR,WAAW;EACX,WAAW;EACZ;CACD,WAAW,CACT;EACE,UAAU;EACV,cAAc;EACd,OAAO;GACL,WAAW,CAAC,YAAY;GACxB,QAAQ,CAAC,0BAA0B;GACpC;EACD,aAAa;GACX,mBAAmB;GACnB,qBAAqB;GACtB;EACF,CACF;CACD,cAAc,EAAE;CAChB,OAAO;CACR"}