@lssm/example.versioned-knowledge-base 0.0.0-canary-20251216033905 → 0.0.0-canary-20251216062412

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.
@@ -6,7 +6,7 @@ $ tsdown
6
6
  ℹ target: esnext
7
7
  ℹ tsconfig: tsconfig.json
8
8
  ℹ Build start
9
- ℹ dist/contracts/kb.js 4.35 kB │ gzip: 1.33 kB
9
+ ℹ dist/contracts/kb.js 4.36 kB │ gzip: 1.33 kB
10
10
  ℹ dist/handlers/memory.handlers.js 2.16 kB │ gzip: 0.91 kB
11
11
  ℹ dist/entities/models.js 2.13 kB │ gzip: 0.59 kB
12
12
  ℹ dist/events.js 1.72 kB │ gzip: 0.49 kB
@@ -19,5 +19,5 @@ $ tsdown
19
19
  ℹ dist/handlers/index.js 0.15 kB │ gzip: 0.10 kB
20
20
  ℹ dist/docs/index.js 0.05 kB │ gzip: 0.07 kB
21
21
  ℹ 12 files, total: 15.05 kB
22
- ✔ Build complete in 63ms
22
+ ✔ Build complete in 85ms
23
23
  $ tsc --noEmit
package/CHANGELOG.md CHANGED
@@ -1,9 +1,9 @@
1
1
  # @lssm/example.versioned-knowledge-base
2
2
 
3
- ## 0.0.0-canary-20251216033905
3
+ ## 0.0.0-canary-20251216062412
4
4
 
5
5
  ### Patch Changes
6
6
 
7
7
  - Updated dependencies [3086383]
8
- - @lssm/lib.contracts@0.0.0-canary-20251216033905
9
- - @lssm/lib.schema@0.0.0-canary-20251216033905
8
+ - @lssm/lib.contracts@0.0.0-canary-20251216062412
9
+ - @lssm/lib.schema@0.0.0-canary-20251216062412
package/README.md CHANGED
@@ -27,3 +27,5 @@ bun test
27
27
 
28
28
 
29
29
 
30
+
31
+
@@ -1 +1 @@
1
- import{KBSnapshotModel as e,RuleVersionModel as t,SourceDocumentModel as n,SourceRefModel as r}from"../entities/models.js";import{defineCommand as i,defineQuery as a}from"@lssm/lib.contracts";import{ScalarTypeEnum as o,defineSchemaModel as s}from"@lssm/lib.schema";const c=s({name:`KbIngestSourceInput`,description:`Ingest immutable source metadata referencing a stored file.`,fields:{jurisdiction:{type:o.String_unsecure(),isOptional:!1},authority:{type:o.String_unsecure(),isOptional:!1},title:{type:o.String_unsecure(),isOptional:!1},fetchedAt:{type:o.DateTime(),isOptional:!1},hash:{type:o.String_unsecure(),isOptional:!1},fileId:{type:o.String_unsecure(),isOptional:!1}}}),l=s({name:`KbUpsertRuleVersionInput`,description:`Create a new draft rule version (immutable history).`,fields:{ruleId:{type:o.String_unsecure(),isOptional:!1},content:{type:o.String_unsecure(),isOptional:!1},sourceRefs:{type:r,isArray:!0,isOptional:!1}}}),u=s({name:`KbApproveRuleVersionInput`,description:`Approve a rule version (human verification).`,fields:{ruleVersionId:{type:o.String_unsecure(),isOptional:!1},approver:{type:o.String_unsecure(),isOptional:!1}}}),d=s({name:`KbPublishSnapshotInput`,description:`Publish a snapshot for a jurisdiction as-of a date.`,fields:{jurisdiction:{type:o.String_unsecure(),isOptional:!1},asOfDate:{type:o.DateTime(),isOptional:!1}}}),f=s({name:`KbSearchInput`,description:`Search within a published snapshot.`,fields:{snapshotId:{type:o.String_unsecure(),isOptional:!1},jurisdiction:{type:o.String_unsecure(),isOptional:!1},query:{type:o.String_unsecure(),isOptional:!1}}}),p=s({name:`KbSearchOutput`,description:`Search results constrained to snapshot + jurisdiction.`,fields:{items:{type:s({name:`KbSearchResultItem`,description:`Search result referencing a specific rule version.`,fields:{ruleVersionId:{type:o.String_unsecure(),isOptional:!1},excerpt:{type:o.String_unsecure(),isOptional:!0}}}),isArray:!0,isOptional:!1}}}),m=i({meta:{name:`kb.ingestSource`,version:1,stability:`experimental`,owners:[`examples`],tags:[`knowledge`,`sources`,`ingestion`],description:`Ingest immutable source document metadata.`,goal:`Store traceable source documents for curated KB.`,context:`Called when an admin uploads/records authoritative sources.`},io:{input:c,output:n},policy:{auth:`user`}}),h=i({meta:{name:`kb.upsertRuleVersion`,version:1,stability:`experimental`,owners:[`examples`],tags:[`knowledge`,`rules`,`versioning`],description:`Create a new draft rule version with source references.`,goal:`Propose curated knowledge updates with traceability.`,context:`Automation or curators propose draft rule versions.`},io:{input:l,output:t,errors:{SOURCE_REFS_REQUIRED:{description:`Rule version must cite at least one sourceRef`,http:400,gqlCode:`SOURCE_REFS_REQUIRED`,when:`sourceRefs is empty`},RULE_NOT_FOUND:{description:`Rule does not exist`,http:404,gqlCode:`RULE_NOT_FOUND`,when:`ruleId is unknown`}}},policy:{auth:`user`}}),g=i({meta:{name:`kb.approveRuleVersion`,version:1,stability:`experimental`,owners:[`examples`],tags:[`knowledge`,`rules`,`approval`],description:`Approve a draft rule version.`,goal:`Human verification step before publishing snapshots.`,context:`Curators/experts approve proposed KB changes.`},io:{input:u,output:t},policy:{auth:`user`}}),_=i({meta:{name:`kb.publishSnapshot`,version:1,stability:`experimental`,owners:[`examples`],tags:[`knowledge`,`snapshots`,`publishing`],description:`Publish a KB snapshot for a jurisdiction.`,goal:`Create a stable snapshot that assistant answers can cite.`,context:`Publishing happens after approvals; snapshot is referenced by answers.`},io:{input:d,output:e,errors:{NO_APPROVED_RULES:{description:`No approved rule versions available to publish`,http:409,gqlCode:`NO_APPROVED_RULES`,when:`jurisdiction has zero approved rule versions`}}},policy:{auth:`user`}}),v=a({meta:{name:`kb.search`,version:1,stability:`experimental`,owners:[`examples`],tags:[`knowledge`,`search`,`snapshots`],description:`Search within a published KB snapshot.`,goal:`Provide scoped retrieval for assistant answers.`,context:`Assistant queries curated rules from a specific snapshot.`},io:{input:f,output:p},policy:{auth:`user`}});export{g as KbApproveRuleVersionContract,m as KbIngestSourceContract,_ as KbPublishSnapshotContract,v as KbSearchContract,h as KbUpsertRuleVersionContract};
1
+ import{KBSnapshotModel as e,RuleVersionModel as t,SourceDocumentModel as n,SourceRefModel as r}from"../entities/models.js";import{defineCommand as i,defineQuery as a}from"@lssm/lib.contracts";import{ScalarTypeEnum as o,defineSchemaModel as s}from"@lssm/lib.schema";const c=s({name:`KbIngestSourceInput`,description:`Ingest immutable source metadata referencing a stored file.`,fields:{jurisdiction:{type:o.String_unsecure(),isOptional:!1},authority:{type:o.String_unsecure(),isOptional:!1},title:{type:o.String_unsecure(),isOptional:!1},fetchedAt:{type:o.DateTime(),isOptional:!1},hash:{type:o.String_unsecure(),isOptional:!1},fileId:{type:o.String_unsecure(),isOptional:!1}}}),l=s({name:`KbUpsertRuleVersionInput`,description:`Create a new draft rule version (immutable history).`,fields:{ruleId:{type:o.String_unsecure(),isOptional:!1},content:{type:o.String_unsecure(),isOptional:!1},sourceRefs:{type:r,isArray:!0,isOptional:!1}}}),u=s({name:`KbApproveRuleVersionInput`,description:`Approve a rule version (human verification).`,fields:{ruleVersionId:{type:o.String_unsecure(),isOptional:!1},approver:{type:o.String_unsecure(),isOptional:!1}}}),d=s({name:`KbPublishSnapshotInput`,description:`Publish a snapshot for a jurisdiction as-of a date.`,fields:{jurisdiction:{type:o.String_unsecure(),isOptional:!1},asOfDate:{type:o.DateTime(),isOptional:!1}}}),f=s({name:`KbSearchInput`,description:`Search within a published snapshot.`,fields:{snapshotId:{type:o.String_unsecure(),isOptional:!1},jurisdiction:{type:o.String_unsecure(),isOptional:!1},query:{type:o.String_unsecure(),isOptional:!1}}}),p=s({name:`KbSearchOutput`,description:`Search results constrained to snapshot + jurisdiction.`,fields:{items:{type:s({name:`KbSearchResultItem`,description:`Search result referencing a specific rule version.`,fields:{ruleVersionId:{type:o.String_unsecure(),isOptional:!1},excerpt:{type:o.String_unsecure(),isOptional:!0}}}),isArray:!0,isOptional:!1}}}),m=i({meta:{name:`kb.ingestSource`,version:1,stability:`experimental`,owners:[`@examples`],tags:[`knowledge`,`sources`,`ingestion`],description:`Ingest immutable source document metadata.`,goal:`Store traceable source documents for curated KB.`,context:`Called when an admin uploads/records authoritative sources.`},io:{input:c,output:n},policy:{auth:`user`}}),h=i({meta:{name:`kb.upsertRuleVersion`,version:1,stability:`experimental`,owners:[`@examples`],tags:[`knowledge`,`rules`,`versioning`],description:`Create a new draft rule version with source references.`,goal:`Propose curated knowledge updates with traceability.`,context:`Automation or curators propose draft rule versions.`},io:{input:l,output:t,errors:{SOURCE_REFS_REQUIRED:{description:`Rule version must cite at least one sourceRef`,http:400,gqlCode:`SOURCE_REFS_REQUIRED`,when:`sourceRefs is empty`},RULE_NOT_FOUND:{description:`Rule does not exist`,http:404,gqlCode:`RULE_NOT_FOUND`,when:`ruleId is unknown`}}},policy:{auth:`user`}}),g=i({meta:{name:`kb.approveRuleVersion`,version:1,stability:`experimental`,owners:[`@examples`],tags:[`knowledge`,`rules`,`approval`],description:`Approve a draft rule version.`,goal:`Human verification step before publishing snapshots.`,context:`Curators/experts approve proposed KB changes.`},io:{input:u,output:t},policy:{auth:`user`}}),_=i({meta:{name:`kb.publishSnapshot`,version:1,stability:`experimental`,owners:[`@examples`],tags:[`knowledge`,`snapshots`,`publishing`],description:`Publish a KB snapshot for a jurisdiction.`,goal:`Create a stable snapshot that assistant answers can cite.`,context:`Publishing happens after approvals; snapshot is referenced by answers.`},io:{input:d,output:e,errors:{NO_APPROVED_RULES:{description:`No approved rule versions available to publish`,http:409,gqlCode:`NO_APPROVED_RULES`,when:`jurisdiction has zero approved rule versions`}}},policy:{auth:`user`}}),v=a({meta:{name:`kb.search`,version:1,stability:`experimental`,owners:[`@examples`],tags:[`knowledge`,`search`,`snapshots`],description:`Search within a published KB snapshot.`,goal:`Provide scoped retrieval for assistant answers.`,context:`Assistant queries curated rules from a specific snapshot.`},io:{input:f,output:p},policy:{auth:`user`}});export{g as KbApproveRuleVersionContract,m as KbIngestSourceContract,_ as KbPublishSnapshotContract,v as KbSearchContract,h as KbUpsertRuleVersionContract};
@@ -1 +1 @@
1
- const e={meta:{key:`versioned-knowledge-base`,title:`Versioned Knowledge Base`,description:`Curated KB with immutable sources, rule versions, and published snapshots.`,domain:`knowledge`,owners:[`examples`],tags:[`knowledge`,`versioning`,`snapshots`],stability:`experimental`},operations:[{name:`kb.ingestSource`,version:1},{name:`kb.upsertRuleVersion`,version:1},{name:`kb.approveRuleVersion`,version:1},{name:`kb.publishSnapshot`,version:1},{name:`kb.search`,version:1}],events:[{name:`kb.source.ingested`,version:1},{name:`kb.ruleVersion.created`,version:1},{name:`kb.ruleVersion.approved`,version:1},{name:`kb.snapshot.published`,version:1}],presentations:[],opToPresentation:[],presentationsTargets:[],capabilities:{requires:[{key:`knowledge`,version:1}]}};export{e as VersionedKnowledgeBaseFeature};
1
+ const e={meta:{key:`versioned-knowledge-base`,title:`Versioned Knowledge Base`,description:`Curated KB with immutable sources, rule versions, and published snapshots.`,domain:`knowledge`,owners:[`@examples`],tags:[`knowledge`,`versioning`,`snapshots`],stability:`experimental`},operations:[{name:`kb.ingestSource`,version:1},{name:`kb.upsertRuleVersion`,version:1},{name:`kb.approveRuleVersion`,version:1},{name:`kb.publishSnapshot`,version:1},{name:`kb.search`,version:1}],events:[{name:`kb.source.ingested`,version:1},{name:`kb.ruleVersion.created`,version:1},{name:`kb.ruleVersion.approved`,version:1},{name:`kb.snapshot.published`,version:1}],presentations:[],opToPresentation:[],presentationsTargets:[],capabilities:{requires:[{key:`knowledge`,version:1}]}};export{e as VersionedKnowledgeBaseFeature};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lssm/example.versioned-knowledge-base",
3
- "version": "0.0.0-canary-20251216033905",
3
+ "version": "0.0.0-canary-20251216062412",
4
4
  "description": "Example: curated, versioned knowledge base with immutable sources, rule versions, and published snapshots.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -87,7 +87,7 @@ export const KbIngestSourceContract = defineCommand({
87
87
  name: 'kb.ingestSource',
88
88
  version: 1,
89
89
  stability: 'experimental',
90
- owners: ['examples'],
90
+ owners: ['@examples'],
91
91
  tags: ['knowledge', 'sources', 'ingestion'],
92
92
  description: 'Ingest immutable source document metadata.',
93
93
  goal: 'Store traceable source documents for curated KB.',
@@ -105,7 +105,7 @@ export const KbUpsertRuleVersionContract = defineCommand({
105
105
  name: 'kb.upsertRuleVersion',
106
106
  version: 1,
107
107
  stability: 'experimental',
108
- owners: ['examples'],
108
+ owners: ['@examples'],
109
109
  tags: ['knowledge', 'rules', 'versioning'],
110
110
  description: 'Create a new draft rule version with source references.',
111
111
  goal: 'Propose curated knowledge updates with traceability.',
@@ -137,7 +137,7 @@ export const KbApproveRuleVersionContract = defineCommand({
137
137
  name: 'kb.approveRuleVersion',
138
138
  version: 1,
139
139
  stability: 'experimental',
140
- owners: ['examples'],
140
+ owners: ['@examples'],
141
141
  tags: ['knowledge', 'rules', 'approval'],
142
142
  description: 'Approve a draft rule version.',
143
143
  goal: 'Human verification step before publishing snapshots.',
@@ -155,7 +155,7 @@ export const KbPublishSnapshotContract = defineCommand({
155
155
  name: 'kb.publishSnapshot',
156
156
  version: 1,
157
157
  stability: 'experimental',
158
- owners: ['examples'],
158
+ owners: ['@examples'],
159
159
  tags: ['knowledge', 'snapshots', 'publishing'],
160
160
  description: 'Publish a KB snapshot for a jurisdiction.',
161
161
  goal: 'Create a stable snapshot that assistant answers can cite.',
@@ -182,7 +182,7 @@ export const KbSearchContract = defineQuery({
182
182
  name: 'kb.search',
183
183
  version: 1,
184
184
  stability: 'experimental',
185
- owners: ['examples'],
185
+ owners: ['@examples'],
186
186
  tags: ['knowledge', 'search', 'snapshots'],
187
187
  description: 'Search within a published KB snapshot.',
188
188
  goal: 'Provide scoped retrieval for assistant answers.',
@@ -7,7 +7,7 @@ export const VersionedKnowledgeBaseFeature: FeatureModuleSpec = {
7
7
  description:
8
8
  'Curated KB with immutable sources, rule versions, and published snapshots.',
9
9
  domain: 'knowledge',
10
- owners: ['examples'],
10
+ owners: ['@examples'],
11
11
  tags: ['knowledge', 'versioning', 'snapshots'],
12
12
  stability: 'experimental',
13
13
  },
package/tsconfig.json CHANGED
@@ -14,3 +14,5 @@
14
14
 
15
15
 
16
16
 
17
+
18
+