@contractspec/example.versioned-knowledge-base 1.57.0 → 1.59.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 (76) hide show
  1. package/.turbo/turbo-build.log +52 -52
  2. package/.turbo/turbo-prebuild.log +1 -0
  3. package/CHANGELOG.md +25 -0
  4. package/dist/browser/docs/index.js +44 -0
  5. package/dist/browser/docs/versioned-knowledge-base.docblock.js +44 -0
  6. package/dist/browser/entities/index.js +74 -0
  7. package/dist/browser/entities/models.js +74 -0
  8. package/dist/browser/events.js +101 -0
  9. package/dist/browser/example.js +35 -0
  10. package/dist/browser/handlers/index.js +115 -0
  11. package/dist/browser/handlers/memory.handlers.js +115 -0
  12. package/dist/browser/index.js +586 -0
  13. package/dist/browser/operations/index.js +257 -0
  14. package/dist/browser/operations/kb.js +257 -0
  15. package/dist/browser/versioned-knowledge-base.feature.js +36 -0
  16. package/dist/docs/index.d.ts +2 -1
  17. package/dist/docs/index.d.ts.map +1 -0
  18. package/dist/docs/index.js +45 -1
  19. package/dist/docs/versioned-knowledge-base.docblock.d.ts +2 -1
  20. package/dist/docs/versioned-knowledge-base.docblock.d.ts.map +1 -0
  21. package/dist/docs/versioned-knowledge-base.docblock.js +42 -28
  22. package/dist/entities/index.d.ts +2 -2
  23. package/dist/entities/index.d.ts.map +1 -0
  24. package/dist/entities/index.js +75 -3
  25. package/dist/entities/models.d.ts +127 -132
  26. package/dist/entities/models.d.ts.map +1 -1
  27. package/dist/entities/models.js +69 -145
  28. package/dist/events.d.ts +52 -58
  29. package/dist/events.d.ts.map +1 -1
  30. package/dist/events.js +92 -114
  31. package/dist/example.d.ts +2 -6
  32. package/dist/example.d.ts.map +1 -1
  33. package/dist/example.js +34 -46
  34. package/dist/handlers/index.d.ts +2 -2
  35. package/dist/handlers/index.d.ts.map +1 -0
  36. package/dist/handlers/index.js +116 -3
  37. package/dist/handlers/memory.handlers.d.ts +62 -64
  38. package/dist/handlers/memory.handlers.d.ts.map +1 -1
  39. package/dist/handlers/memory.handlers.js +110 -97
  40. package/dist/handlers/memory.handlers.test.d.ts +2 -0
  41. package/dist/handlers/memory.handlers.test.d.ts.map +1 -0
  42. package/dist/index.d.ts +13 -9
  43. package/dist/index.d.ts.map +1 -0
  44. package/dist/index.js +587 -11
  45. package/dist/node/docs/index.js +44 -0
  46. package/dist/node/docs/versioned-knowledge-base.docblock.js +44 -0
  47. package/dist/node/entities/index.js +74 -0
  48. package/dist/node/entities/models.js +74 -0
  49. package/dist/node/events.js +101 -0
  50. package/dist/node/example.js +35 -0
  51. package/dist/node/handlers/index.js +115 -0
  52. package/dist/node/handlers/memory.handlers.js +115 -0
  53. package/dist/node/index.js +586 -0
  54. package/dist/node/operations/index.js +257 -0
  55. package/dist/node/operations/kb.js +257 -0
  56. package/dist/node/versioned-knowledge-base.feature.js +36 -0
  57. package/dist/operations/index.d.ts +2 -2
  58. package/dist/operations/index.d.ts.map +1 -0
  59. package/dist/operations/index.js +257 -2
  60. package/dist/operations/kb.d.ts +252 -258
  61. package/dist/operations/kb.d.ts.map +1 -1
  62. package/dist/operations/kb.js +246 -244
  63. package/dist/versioned-knowledge-base.feature.d.ts +1 -6
  64. package/dist/versioned-knowledge-base.feature.d.ts.map +1 -1
  65. package/dist/versioned-knowledge-base.feature.js +35 -68
  66. package/package.json +141 -38
  67. package/tsdown.config.js +1 -2
  68. package/.turbo/turbo-build$colon$bundle.log +0 -52
  69. package/dist/docs/versioned-knowledge-base.docblock.js.map +0 -1
  70. package/dist/entities/models.js.map +0 -1
  71. package/dist/events.js.map +0 -1
  72. package/dist/example.js.map +0 -1
  73. package/dist/handlers/memory.handlers.js.map +0 -1
  74. package/dist/operations/kb.js.map +0 -1
  75. package/dist/versioned-knowledge-base.feature.js.map +0 -1
  76. package/tsconfig.tsbuildinfo +0 -1
@@ -1,256 +1,258 @@
1
- import { KBSnapshotModel, RuleVersionModel, SourceDocumentModel, SourceRefModel } from "../entities/models.js";
2
- import { defineCommand, defineQuery } from "@contractspec/lib.contracts";
3
- import { ScalarTypeEnum, defineSchemaModel as defineSchemaModel$1 } from "@contractspec/lib.schema";
1
+ // @bun
2
+ // src/entities/models.ts
3
+ import { ScalarTypeEnum, defineSchemaModel } from "@contractspec/lib.schema";
4
+ var SourceDocumentModel = defineSchemaModel({
5
+ name: "SourceDocument",
6
+ description: "Immutable raw source document metadata referencing a stored file.",
7
+ fields: {
8
+ id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
9
+ jurisdiction: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
10
+ authority: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
11
+ title: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
12
+ fetchedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },
13
+ hash: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
14
+ fileId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false }
15
+ }
16
+ });
17
+ var SourceRefModel = defineSchemaModel({
18
+ name: "SourceRef",
19
+ description: "Reference to a source document used to justify a rule version.",
20
+ fields: {
21
+ sourceDocumentId: {
22
+ type: ScalarTypeEnum.String_unsecure(),
23
+ isOptional: false
24
+ },
25
+ excerpt: { type: ScalarTypeEnum.String_unsecure(), isOptional: true }
26
+ }
27
+ });
28
+ var RuleModel = defineSchemaModel({
29
+ name: "Rule",
30
+ description: "Curated rule (stable identity) with topic + jurisdiction scope.",
31
+ fields: {
32
+ id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
33
+ jurisdiction: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
34
+ topicKey: { type: ScalarTypeEnum.String_unsecure(), isOptional: false }
35
+ }
36
+ });
37
+ var RuleVersionModel = defineSchemaModel({
38
+ name: "RuleVersion",
39
+ description: "A versioned rule content with source references and approval status.",
40
+ fields: {
41
+ id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
42
+ ruleId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
43
+ jurisdiction: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
44
+ topicKey: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
45
+ version: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
46
+ content: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
47
+ sourceRefs: { type: SourceRefModel, isArray: true, isOptional: false },
48
+ status: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
49
+ approvedBy: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
50
+ approvedAt: { type: ScalarTypeEnum.DateTime(), isOptional: true },
51
+ createdAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
52
+ }
53
+ });
54
+ var KBSnapshotModel = defineSchemaModel({
55
+ name: "KBSnapshot",
56
+ description: "Published KB snapshot (as-of) referencing approved rule versions.",
57
+ fields: {
58
+ id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
59
+ jurisdiction: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
60
+ asOfDate: { type: ScalarTypeEnum.DateTime(), isOptional: false },
61
+ includedRuleVersionIds: {
62
+ type: ScalarTypeEnum.String_unsecure(),
63
+ isArray: true,
64
+ isOptional: false
65
+ },
66
+ publishedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
67
+ }
68
+ });
4
69
 
5
- //#region src/operations/kb.ts
6
- const IngestSourceInput = defineSchemaModel$1({
7
- name: "KbIngestSourceInput",
8
- description: "Ingest immutable source metadata referencing a stored file.",
9
- fields: {
10
- jurisdiction: {
11
- type: ScalarTypeEnum.String_unsecure(),
12
- isOptional: false
13
- },
14
- authority: {
15
- type: ScalarTypeEnum.String_unsecure(),
16
- isOptional: false
17
- },
18
- title: {
19
- type: ScalarTypeEnum.String_unsecure(),
20
- isOptional: false
21
- },
22
- fetchedAt: {
23
- type: ScalarTypeEnum.DateTime(),
24
- isOptional: false
25
- },
26
- hash: {
27
- type: ScalarTypeEnum.String_unsecure(),
28
- isOptional: false
29
- },
30
- fileId: {
31
- type: ScalarTypeEnum.String_unsecure(),
32
- isOptional: false
33
- }
34
- }
70
+ // src/operations/kb.ts
71
+ import { defineCommand, defineQuery } from "@contractspec/lib.contracts";
72
+ import { ScalarTypeEnum as ScalarTypeEnum2, defineSchemaModel as defineSchemaModel2 } from "@contractspec/lib.schema";
73
+ var IngestSourceInput = defineSchemaModel2({
74
+ name: "KbIngestSourceInput",
75
+ description: "Ingest immutable source metadata referencing a stored file.",
76
+ fields: {
77
+ jurisdiction: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
78
+ authority: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
79
+ title: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
80
+ fetchedAt: { type: ScalarTypeEnum2.DateTime(), isOptional: false },
81
+ hash: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
82
+ fileId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false }
83
+ }
35
84
  });
36
- const UpsertRuleVersionInput = defineSchemaModel$1({
37
- name: "KbUpsertRuleVersionInput",
38
- description: "Create a new draft rule version (immutable history).",
39
- fields: {
40
- ruleId: {
41
- type: ScalarTypeEnum.String_unsecure(),
42
- isOptional: false
43
- },
44
- content: {
45
- type: ScalarTypeEnum.String_unsecure(),
46
- isOptional: false
47
- },
48
- sourceRefs: {
49
- type: SourceRefModel,
50
- isArray: true,
51
- isOptional: false
52
- }
53
- }
85
+ var UpsertRuleVersionInput = defineSchemaModel2({
86
+ name: "KbUpsertRuleVersionInput",
87
+ description: "Create a new draft rule version (immutable history).",
88
+ fields: {
89
+ ruleId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
90
+ content: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
91
+ sourceRefs: { type: SourceRefModel, isArray: true, isOptional: false }
92
+ }
54
93
  });
55
- const ApproveRuleVersionInput = defineSchemaModel$1({
56
- name: "KbApproveRuleVersionInput",
57
- description: "Approve a rule version (human verification).",
58
- fields: {
59
- ruleVersionId: {
60
- type: ScalarTypeEnum.String_unsecure(),
61
- isOptional: false
62
- },
63
- approver: {
64
- type: ScalarTypeEnum.String_unsecure(),
65
- isOptional: false
66
- }
67
- }
94
+ var ApproveRuleVersionInput = defineSchemaModel2({
95
+ name: "KbApproveRuleVersionInput",
96
+ description: "Approve a rule version (human verification).",
97
+ fields: {
98
+ ruleVersionId: {
99
+ type: ScalarTypeEnum2.String_unsecure(),
100
+ isOptional: false
101
+ },
102
+ approver: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false }
103
+ }
68
104
  });
69
- const PublishSnapshotInput = defineSchemaModel$1({
70
- name: "KbPublishSnapshotInput",
71
- description: "Publish a snapshot for a jurisdiction as-of a date.",
72
- fields: {
73
- jurisdiction: {
74
- type: ScalarTypeEnum.String_unsecure(),
75
- isOptional: false
76
- },
77
- asOfDate: {
78
- type: ScalarTypeEnum.DateTime(),
79
- isOptional: false
80
- }
81
- }
105
+ var PublishSnapshotInput = defineSchemaModel2({
106
+ name: "KbPublishSnapshotInput",
107
+ description: "Publish a snapshot for a jurisdiction as-of a date.",
108
+ fields: {
109
+ jurisdiction: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
110
+ asOfDate: { type: ScalarTypeEnum2.DateTime(), isOptional: false }
111
+ }
82
112
  });
83
- const SearchKbInput = defineSchemaModel$1({
84
- name: "KbSearchInput",
85
- description: "Search within a published snapshot.",
86
- fields: {
87
- snapshotId: {
88
- type: ScalarTypeEnum.String_unsecure(),
89
- isOptional: false
90
- },
91
- jurisdiction: {
92
- type: ScalarTypeEnum.String_unsecure(),
93
- isOptional: false
94
- },
95
- query: {
96
- type: ScalarTypeEnum.String_unsecure(),
97
- isOptional: false
98
- }
99
- }
113
+ var SearchKbInput = defineSchemaModel2({
114
+ name: "KbSearchInput",
115
+ description: "Search within a published snapshot.",
116
+ fields: {
117
+ snapshotId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
118
+ jurisdiction: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
119
+ query: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false }
120
+ }
100
121
  });
101
- const SearchKbOutput = defineSchemaModel$1({
102
- name: "KbSearchOutput",
103
- description: "Search results constrained to snapshot + jurisdiction.",
104
- fields: { items: {
105
- type: defineSchemaModel$1({
106
- name: "KbSearchResultItem",
107
- description: "Search result referencing a specific rule version.",
108
- fields: {
109
- ruleVersionId: {
110
- type: ScalarTypeEnum.String_unsecure(),
111
- isOptional: false
112
- },
113
- excerpt: {
114
- type: ScalarTypeEnum.String_unsecure(),
115
- isOptional: true
116
- }
117
- }
118
- }),
119
- isArray: true,
120
- isOptional: false
121
- } }
122
+ var SearchKbResultItem = defineSchemaModel2({
123
+ name: "KbSearchResultItem",
124
+ description: "Search result referencing a specific rule version.",
125
+ fields: {
126
+ ruleVersionId: {
127
+ type: ScalarTypeEnum2.String_unsecure(),
128
+ isOptional: false
129
+ },
130
+ excerpt: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true }
131
+ }
122
132
  });
123
- const KbIngestSourceContract = defineCommand({
124
- meta: {
125
- key: "kb.ingestSource",
126
- title: "Ingest Source",
127
- version: "1.0.0",
128
- stability: "experimental",
129
- owners: ["@examples"],
130
- tags: [
131
- "knowledge",
132
- "sources",
133
- "ingestion"
134
- ],
135
- description: "Ingest immutable source document metadata.",
136
- goal: "Store traceable source documents for curated KB.",
137
- context: "Called when an admin uploads/records authoritative sources."
138
- },
139
- io: {
140
- input: IngestSourceInput,
141
- output: SourceDocumentModel
142
- },
143
- policy: { auth: "user" }
133
+ var SearchKbOutput = defineSchemaModel2({
134
+ name: "KbSearchOutput",
135
+ description: "Search results constrained to snapshot + jurisdiction.",
136
+ fields: {
137
+ items: { type: SearchKbResultItem, isArray: true, isOptional: false }
138
+ }
144
139
  });
145
- const KbUpsertRuleVersionContract = defineCommand({
146
- meta: {
147
- key: "kb.upsertRuleVersion",
148
- title: "Upsert Rule Version",
149
- version: "1.0.0",
150
- stability: "experimental",
151
- owners: ["@examples"],
152
- tags: [
153
- "knowledge",
154
- "rules",
155
- "versioning"
156
- ],
157
- description: "Create a new draft rule version with source references.",
158
- goal: "Propose curated knowledge updates with traceability.",
159
- context: "Automation or curators propose draft rule versions."
160
- },
161
- io: {
162
- input: UpsertRuleVersionInput,
163
- output: RuleVersionModel,
164
- errors: {
165
- SOURCE_REFS_REQUIRED: {
166
- description: "Rule version must cite at least one sourceRef",
167
- http: 400,
168
- gqlCode: "SOURCE_REFS_REQUIRED",
169
- when: "sourceRefs is empty"
170
- },
171
- RULE_NOT_FOUND: {
172
- description: "Rule does not exist",
173
- http: 404,
174
- gqlCode: "RULE_NOT_FOUND",
175
- when: "ruleId is unknown"
176
- }
177
- }
178
- },
179
- policy: { auth: "user" }
140
+ var KbIngestSourceContract = defineCommand({
141
+ meta: {
142
+ key: "kb.ingestSource",
143
+ title: "Ingest Source",
144
+ version: "1.0.0",
145
+ stability: "experimental",
146
+ owners: ["@examples"],
147
+ tags: ["knowledge", "sources", "ingestion"],
148
+ description: "Ingest immutable source document metadata.",
149
+ goal: "Store traceable source documents for curated KB.",
150
+ context: "Called when an admin uploads/records authoritative sources."
151
+ },
152
+ io: {
153
+ input: IngestSourceInput,
154
+ output: SourceDocumentModel
155
+ },
156
+ policy: { auth: "user" }
180
157
  });
181
- const KbApproveRuleVersionContract = defineCommand({
182
- meta: {
183
- key: "kb.approveRuleVersion",
184
- title: "Approve Rule Version",
185
- version: "1.0.0",
186
- stability: "experimental",
187
- owners: ["@examples"],
188
- tags: [
189
- "knowledge",
190
- "rules",
191
- "approval"
192
- ],
193
- description: "Approve a draft rule version.",
194
- goal: "Human verification step before publishing snapshots.",
195
- context: "Curators/experts approve proposed KB changes."
196
- },
197
- io: {
198
- input: ApproveRuleVersionInput,
199
- output: RuleVersionModel
200
- },
201
- policy: { auth: "user" }
158
+ var KbUpsertRuleVersionContract = defineCommand({
159
+ meta: {
160
+ key: "kb.upsertRuleVersion",
161
+ title: "Upsert Rule Version",
162
+ version: "1.0.0",
163
+ stability: "experimental",
164
+ owners: ["@examples"],
165
+ tags: ["knowledge", "rules", "versioning"],
166
+ description: "Create a new draft rule version with source references.",
167
+ goal: "Propose curated knowledge updates with traceability.",
168
+ context: "Automation or curators propose draft rule versions."
169
+ },
170
+ io: {
171
+ input: UpsertRuleVersionInput,
172
+ output: RuleVersionModel,
173
+ errors: {
174
+ SOURCE_REFS_REQUIRED: {
175
+ description: "Rule version must cite at least one sourceRef",
176
+ http: 400,
177
+ gqlCode: "SOURCE_REFS_REQUIRED",
178
+ when: "sourceRefs is empty"
179
+ },
180
+ RULE_NOT_FOUND: {
181
+ description: "Rule does not exist",
182
+ http: 404,
183
+ gqlCode: "RULE_NOT_FOUND",
184
+ when: "ruleId is unknown"
185
+ }
186
+ }
187
+ },
188
+ policy: { auth: "user" }
202
189
  });
203
- const KbPublishSnapshotContract = defineCommand({
204
- meta: {
205
- key: "kb.publishSnapshot",
206
- title: "Publish Snapshot",
207
- version: "1.0.0",
208
- stability: "experimental",
209
- owners: ["@examples"],
210
- tags: [
211
- "knowledge",
212
- "snapshots",
213
- "publishing"
214
- ],
215
- description: "Publish a KB snapshot for a jurisdiction.",
216
- goal: "Create a stable snapshot that assistant answers can cite.",
217
- context: "Publishing happens after approvals; snapshot is referenced by answers."
218
- },
219
- io: {
220
- input: PublishSnapshotInput,
221
- output: KBSnapshotModel,
222
- errors: { NO_APPROVED_RULES: {
223
- description: "No approved rule versions available to publish",
224
- http: 409,
225
- gqlCode: "NO_APPROVED_RULES",
226
- when: "jurisdiction has zero approved rule versions"
227
- } }
228
- },
229
- policy: { auth: "user" }
190
+ var KbApproveRuleVersionContract = defineCommand({
191
+ meta: {
192
+ key: "kb.approveRuleVersion",
193
+ title: "Approve Rule Version",
194
+ version: "1.0.0",
195
+ stability: "experimental",
196
+ owners: ["@examples"],
197
+ tags: ["knowledge", "rules", "approval"],
198
+ description: "Approve a draft rule version.",
199
+ goal: "Human verification step before publishing snapshots.",
200
+ context: "Curators/experts approve proposed KB changes."
201
+ },
202
+ io: {
203
+ input: ApproveRuleVersionInput,
204
+ output: RuleVersionModel
205
+ },
206
+ policy: { auth: "user" }
230
207
  });
231
- const KbSearchContract = defineQuery({
232
- meta: {
233
- key: "kb.search",
234
- title: "Search KB",
235
- version: "1.0.0",
236
- stability: "experimental",
237
- owners: ["@examples"],
238
- tags: [
239
- "knowledge",
240
- "search",
241
- "snapshots"
242
- ],
243
- description: "Search within a published KB snapshot.",
244
- goal: "Provide scoped retrieval for assistant answers.",
245
- context: "Assistant queries curated rules from a specific snapshot."
246
- },
247
- io: {
248
- input: SearchKbInput,
249
- output: SearchKbOutput
250
- },
251
- policy: { auth: "user" }
208
+ var KbPublishSnapshotContract = defineCommand({
209
+ meta: {
210
+ key: "kb.publishSnapshot",
211
+ title: "Publish Snapshot",
212
+ version: "1.0.0",
213
+ stability: "experimental",
214
+ owners: ["@examples"],
215
+ tags: ["knowledge", "snapshots", "publishing"],
216
+ description: "Publish a KB snapshot for a jurisdiction.",
217
+ goal: "Create a stable snapshot that assistant answers can cite.",
218
+ context: "Publishing happens after approvals; snapshot is referenced by answers."
219
+ },
220
+ io: {
221
+ input: PublishSnapshotInput,
222
+ output: KBSnapshotModel,
223
+ errors: {
224
+ NO_APPROVED_RULES: {
225
+ description: "No approved rule versions available to publish",
226
+ http: 409,
227
+ gqlCode: "NO_APPROVED_RULES",
228
+ when: "jurisdiction has zero approved rule versions"
229
+ }
230
+ }
231
+ },
232
+ policy: { auth: "user" }
252
233
  });
253
-
254
- //#endregion
255
- export { KbApproveRuleVersionContract, KbIngestSourceContract, KbPublishSnapshotContract, KbSearchContract, KbUpsertRuleVersionContract };
256
- //# sourceMappingURL=kb.js.map
234
+ var KbSearchContract = defineQuery({
235
+ meta: {
236
+ key: "kb.search",
237
+ title: "Search KB",
238
+ version: "1.0.0",
239
+ stability: "experimental",
240
+ owners: ["@examples"],
241
+ tags: ["knowledge", "search", "snapshots"],
242
+ description: "Search within a published KB snapshot.",
243
+ goal: "Provide scoped retrieval for assistant answers.",
244
+ context: "Assistant queries curated rules from a specific snapshot."
245
+ },
246
+ io: {
247
+ input: SearchKbInput,
248
+ output: SearchKbOutput
249
+ },
250
+ policy: { auth: "user" }
251
+ });
252
+ export {
253
+ KbUpsertRuleVersionContract,
254
+ KbSearchContract,
255
+ KbPublishSnapshotContract,
256
+ KbIngestSourceContract,
257
+ KbApproveRuleVersionContract
258
+ };
@@ -1,7 +1,2 @@
1
- import * as _contractspec_lib_contracts0 from "@contractspec/lib.contracts";
2
-
3
- //#region src/versioned-knowledge-base.feature.d.ts
4
- declare const VersionedKnowledgeBaseFeature: _contractspec_lib_contracts0.FeatureModuleSpec;
5
- //#endregion
6
- export { VersionedKnowledgeBaseFeature };
1
+ export declare const VersionedKnowledgeBaseFeature: import("@contractspec/lib.contracts").FeatureModuleSpec;
7
2
  //# sourceMappingURL=versioned-knowledge-base.feature.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"versioned-knowledge-base.feature.d.ts","names":[],"sources":["../src/versioned-knowledge-base.feature.ts"],"mappings":";;;cAEa,6BAAA,EA+BX,4BAAA,CA/BwC,iBAAA"}
1
+ {"version":3,"file":"versioned-knowledge-base.feature.d.ts","sourceRoot":"","sources":["../src/versioned-knowledge-base.feature.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,6BAA6B,yDA+BxC,CAAC"}
@@ -1,70 +1,37 @@
1
+ // @bun
2
+ // src/versioned-knowledge-base.feature.ts
1
3
  import { defineFeature } from "@contractspec/lib.contracts";
2
-
3
- //#region src/versioned-knowledge-base.feature.ts
4
- const VersionedKnowledgeBaseFeature = defineFeature({
5
- meta: {
6
- key: "versioned-knowledge-base",
7
- version: "1.0.0",
8
- title: "Versioned Knowledge Base",
9
- description: "Curated KB with immutable sources, rule versions, and published snapshots.",
10
- domain: "knowledge",
11
- owners: ["@examples"],
12
- tags: [
13
- "knowledge",
14
- "versioning",
15
- "snapshots"
16
- ],
17
- stability: "experimental"
18
- },
19
- operations: [
20
- {
21
- key: "kb.ingestSource",
22
- version: "1.0.0"
23
- },
24
- {
25
- key: "kb.upsertRuleVersion",
26
- version: "1.0.0"
27
- },
28
- {
29
- key: "kb.approveRuleVersion",
30
- version: "1.0.0"
31
- },
32
- {
33
- key: "kb.publishSnapshot",
34
- version: "1.0.0"
35
- },
36
- {
37
- key: "kb.search",
38
- version: "1.0.0"
39
- }
40
- ],
41
- events: [
42
- {
43
- key: "kb.source.ingested",
44
- version: "1.0.0"
45
- },
46
- {
47
- key: "kb.ruleVersion.created",
48
- version: "1.0.0"
49
- },
50
- {
51
- key: "kb.ruleVersion.approved",
52
- version: "1.0.0"
53
- },
54
- {
55
- key: "kb.snapshot.published",
56
- version: "1.0.0"
57
- }
58
- ],
59
- presentations: [],
60
- opToPresentation: [],
61
- presentationsTargets: [],
62
- capabilities: { requires: [{
63
- key: "knowledge",
64
- version: "1.0.0"
65
- }] }
4
+ var VersionedKnowledgeBaseFeature = defineFeature({
5
+ meta: {
6
+ key: "versioned-knowledge-base",
7
+ version: "1.0.0",
8
+ title: "Versioned Knowledge Base",
9
+ description: "Curated KB with immutable sources, rule versions, and published snapshots.",
10
+ domain: "knowledge",
11
+ owners: ["@examples"],
12
+ tags: ["knowledge", "versioning", "snapshots"],
13
+ stability: "experimental"
14
+ },
15
+ operations: [
16
+ { key: "kb.ingestSource", version: "1.0.0" },
17
+ { key: "kb.upsertRuleVersion", version: "1.0.0" },
18
+ { key: "kb.approveRuleVersion", version: "1.0.0" },
19
+ { key: "kb.publishSnapshot", version: "1.0.0" },
20
+ { key: "kb.search", version: "1.0.0" }
21
+ ],
22
+ events: [
23
+ { key: "kb.source.ingested", version: "1.0.0" },
24
+ { key: "kb.ruleVersion.created", version: "1.0.0" },
25
+ { key: "kb.ruleVersion.approved", version: "1.0.0" },
26
+ { key: "kb.snapshot.published", version: "1.0.0" }
27
+ ],
28
+ presentations: [],
29
+ opToPresentation: [],
30
+ presentationsTargets: [],
31
+ capabilities: {
32
+ requires: [{ key: "knowledge", version: "1.0.0" }]
33
+ }
66
34
  });
67
-
68
- //#endregion
69
- export { VersionedKnowledgeBaseFeature };
70
- //# sourceMappingURL=versioned-knowledge-base.feature.js.map
35
+ export {
36
+ VersionedKnowledgeBaseFeature
37
+ };