@lssm/example.versioned-knowledge-base 0.0.0-canary-20251217080011 → 1.41.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.
- package/.turbo/turbo-build.log +23 -37
- package/dist/contracts/index.js +1 -3
- package/dist/contracts/kb.js +1 -253
- package/dist/docs/index.js +1 -1
- package/dist/docs/versioned-knowledge-base.docblock.js +18 -29
- package/dist/entities/index.js +1 -3
- package/dist/entities/models.js +1 -152
- package/dist/events.js +1 -106
- package/dist/example.js +1 -41
- package/dist/handlers/index.js +1 -3
- package/dist/handlers/memory.handlers.js +1 -103
- package/dist/index.js +1 -11
- package/dist/versioned-knowledge-base.feature.js +1 -66
- package/package.json +17 -19
- package/tsconfig.tsbuildinfo +1 -1
- package/.turbo/turbo-build$colon$bundle.log +0 -226
- package/CHANGELOG.md +0 -13
- package/dist/contracts/index.d.ts +0 -2
- package/dist/contracts/kb.d.ts +0 -266
- package/dist/docs/index.d.ts +0 -1
- package/dist/docs/versioned-knowledge-base.docblock.d.ts +0 -1
- package/dist/entities/index.d.ts +0 -2
- package/dist/entities/models.d.ts +0 -138
- package/dist/events.d.ts +0 -62
- package/dist/example.d.ts +0 -35
- package/dist/handlers/index.d.ts +0 -2
- package/dist/handlers/memory.handlers.d.ts +0 -77
- package/dist/index.d.ts +0 -7
- package/dist/libs/contracts/dist/capabilities/openbanking.js +0 -88
- package/dist/libs/contracts/dist/client/index.js +0 -5
- package/dist/libs/contracts/dist/client/react/feature-render.js +0 -2
- package/dist/libs/contracts/dist/client/react/form-render.js +0 -4
- package/dist/libs/contracts/dist/client/react/index.js +0 -4
- package/dist/libs/contracts/dist/contract-registry/index.js +0 -1
- package/dist/libs/contracts/dist/contract-registry/schemas.js +0 -60
- package/dist/libs/contracts/dist/docs/PUBLISHING.docblock.js +0 -16
- package/dist/libs/contracts/dist/docs/accessibility_wcag_compliance_specs.docblock.js +0 -16
- package/dist/libs/contracts/dist/docs/index.js +0 -29
- package/dist/libs/contracts/dist/docs/presentations.js +0 -71
- package/dist/libs/contracts/dist/docs/registry.js +0 -44
- package/dist/libs/contracts/dist/docs/tech/PHASE_1_QUICKSTART.docblock.js +0 -16
- package/dist/libs/contracts/dist/docs/tech/PHASE_2_AI_NATIVE_OPERATIONS.docblock.js +0 -16
- package/dist/libs/contracts/dist/docs/tech/PHASE_3_AUTO_EVOLUTION.docblock.js +0 -16
- package/dist/libs/contracts/dist/docs/tech/PHASE_4_PERSONALIZATION_ENGINE.docblock.js +0 -16
- package/dist/libs/contracts/dist/docs/tech/PHASE_5_ZERO_TOUCH_OPERATIONS.docblock.js +0 -16
- package/dist/libs/contracts/dist/docs/tech/auth/better-auth-nextjs.docblock.js +0 -80
- package/dist/libs/contracts/dist/docs/tech/contracts/openapi-export.docblock.js +0 -57
- package/dist/libs/contracts/dist/docs/tech/lifecycle-stage-system.docblock.js +0 -16
- package/dist/libs/contracts/dist/docs/tech/llm/llm-integration.docblock.js +0 -357
- package/dist/libs/contracts/dist/docs/tech/mcp-endpoints.docblock.js +0 -37
- package/dist/libs/contracts/dist/docs/tech/presentation-runtime.docblock.js +0 -16
- package/dist/libs/contracts/dist/docs/tech/schema/README.docblock.js +0 -20
- package/dist/libs/contracts/dist/docs/tech/studio/learning-events.docblock.js +0 -48
- package/dist/libs/contracts/dist/docs/tech/studio/learning-journeys.docblock.js +0 -79
- package/dist/libs/contracts/dist/docs/tech/studio/platform-admin-panel.docblock.js +0 -84
- package/dist/libs/contracts/dist/docs/tech/studio/project-access-teams.docblock.js +0 -45
- package/dist/libs/contracts/dist/docs/tech/studio/project-routing.docblock.js +0 -67
- package/dist/libs/contracts/dist/docs/tech/studio/sandbox-unlogged.docblock.js +0 -40
- package/dist/libs/contracts/dist/docs/tech/studio/team-invitations.docblock.js +0 -69
- package/dist/libs/contracts/dist/docs/tech/studio/workspace-ops.docblock.js +0 -47
- package/dist/libs/contracts/dist/docs/tech/studio/workspaces.docblock.js +0 -62
- package/dist/libs/contracts/dist/docs/tech/telemetry-ingest.docblock.js +0 -155
- package/dist/libs/contracts/dist/docs/tech/templates/runtime.docblock.js +0 -20
- package/dist/libs/contracts/dist/docs/tech/vscode-extension.docblock.js +0 -101
- package/dist/libs/contracts/dist/docs/tech/workflows/overview.docblock.js +0 -20
- package/dist/libs/contracts/dist/events.js +0 -10
- package/dist/libs/contracts/dist/experiments/evaluator.js +0 -1
- package/dist/libs/contracts/dist/index.js +0 -71
- package/dist/libs/contracts/dist/install.js +0 -2
- package/dist/libs/contracts/dist/integrations/contracts.js +0 -377
- package/dist/libs/contracts/dist/integrations/index.js +0 -18
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/accounts.js +0 -228
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/balances.js +0 -159
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/index.js +0 -3
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/transactions.js +0 -210
- package/dist/libs/contracts/dist/integrations/openbanking/models.js +0 -242
- package/dist/libs/contracts/dist/integrations/openbanking/telemetry.js +0 -13
- package/dist/libs/contracts/dist/integrations/providers/elevenlabs.js +0 -52
- package/dist/libs/contracts/dist/integrations/providers/gcs-storage.js +0 -75
- package/dist/libs/contracts/dist/integrations/providers/gmail.js +0 -87
- package/dist/libs/contracts/dist/integrations/providers/google-calendar.js +0 -66
- package/dist/libs/contracts/dist/integrations/providers/index.js +0 -11
- package/dist/libs/contracts/dist/integrations/providers/mistral.js +0 -68
- package/dist/libs/contracts/dist/integrations/providers/postmark.js +0 -68
- package/dist/libs/contracts/dist/integrations/providers/powens.js +0 -116
- package/dist/libs/contracts/dist/integrations/providers/qdrant.js +0 -73
- package/dist/libs/contracts/dist/integrations/providers/registry.js +0 -10
- package/dist/libs/contracts/dist/integrations/providers/stripe.js +0 -83
- package/dist/libs/contracts/dist/integrations/providers/twilio-sms.js +0 -61
- package/dist/libs/contracts/dist/jsonschema.js +0 -1
- package/dist/libs/contracts/dist/knowledge/contracts.js +0 -306
- package/dist/libs/contracts/dist/knowledge/index.js +0 -7
- package/dist/libs/contracts/dist/knowledge/spaces/email-threads.js +0 -34
- package/dist/libs/contracts/dist/knowledge/spaces/financial-docs.js +0 -34
- package/dist/libs/contracts/dist/knowledge/spaces/financial-overview.js +0 -38
- package/dist/libs/contracts/dist/knowledge/spaces/index.js +0 -6
- package/dist/libs/contracts/dist/knowledge/spaces/product-canon.js +0 -34
- package/dist/libs/contracts/dist/knowledge/spaces/support-faq.js +0 -37
- package/dist/libs/contracts/dist/knowledge/spaces/uploaded-docs.js +0 -34
- package/dist/libs/contracts/dist/llm/exporters.js +0 -19
- package/dist/libs/contracts/dist/llm/index.js +0 -2
- package/dist/libs/contracts/dist/llm/prompts.js +0 -1
- package/dist/libs/contracts/dist/onboarding-base.js +0 -196
- package/dist/libs/contracts/dist/openapi.js +0 -1
- package/dist/libs/contracts/dist/ownership.js +0 -21
- package/dist/libs/contracts/dist/presentations.js +0 -1
- package/dist/libs/contracts/dist/presentations.v2.js +0 -11
- package/dist/libs/contracts/dist/prompt.js +0 -1
- package/dist/libs/contracts/dist/promptRegistry.js +0 -1
- package/dist/libs/contracts/dist/regenerator/index.js +0 -1
- package/dist/libs/contracts/dist/regenerator/service.js +0 -6
- package/dist/libs/contracts/dist/registry.js +0 -2
- package/dist/libs/contracts/dist/resources.js +0 -1
- package/dist/libs/contracts/dist/schema/dist/EnumType.js +0 -2
- package/dist/libs/contracts/dist/schema/dist/FieldType.js +0 -49
- package/dist/libs/contracts/dist/schema/dist/ScalarTypeEnum.js +0 -236
- package/dist/libs/contracts/dist/schema/dist/SchemaModel.js +0 -39
- package/dist/libs/contracts/dist/schema/dist/entity/defineEntity.js +0 -1
- package/dist/libs/contracts/dist/schema/dist/entity/index.js +0 -2
- package/dist/libs/contracts/dist/schema/dist/entity/types.js +0 -1
- package/dist/libs/contracts/dist/schema/dist/index.js +0 -6
- package/dist/libs/contracts/dist/server/graphql-pothos.js +0 -6
- package/dist/libs/contracts/dist/server/index.js +0 -8
- package/dist/libs/contracts/dist/server/mcp/createMcpServer.js +0 -4
- package/dist/libs/contracts/dist/server/mcp/registerPresentations.js +0 -2
- package/dist/libs/contracts/dist/server/mcp/registerPrompts.js +0 -1
- package/dist/libs/contracts/dist/server/mcp/registerResources.js +0 -2
- package/dist/libs/contracts/dist/server/mcp/registerTools.js +0 -1
- package/dist/libs/contracts/dist/server/provider-mcp.js +0 -1
- package/dist/libs/contracts/dist/server/rest-elysia.js +0 -1
- package/dist/libs/contracts/dist/server/rest-express.js +0 -1
- package/dist/libs/contracts/dist/server/rest-generic.js +0 -1
- package/dist/libs/contracts/dist/server/rest-next-app.js +0 -1
- package/dist/libs/contracts/dist/server/rest-next-pages.js +0 -1
- package/dist/libs/contracts/dist/spec.js +0 -34
- package/dist/libs/contracts/dist/telemetry/index.js +0 -1
- package/dist/libs/contracts/dist/telemetry/tracker.js +0 -1
- package/dist/libs/contracts/dist/tests/index.js +0 -1
- package/dist/libs/contracts/dist/tests/runner.js +0 -2
- package/dist/libs/contracts/dist/workflow/index.js +0 -1
- package/dist/libs/contracts/dist/workflow/runner.js +0 -1
- package/dist/libs/schema/dist/EnumType.js +0 -2
- package/dist/libs/schema/dist/FieldType.js +0 -49
- package/dist/libs/schema/dist/ScalarTypeEnum.js +0 -236
- package/dist/libs/schema/dist/SchemaModel.js +0 -39
- package/dist/libs/schema/dist/entity/defineEntity.js +0 -1
- package/dist/libs/schema/dist/entity/index.js +0 -2
- package/dist/libs/schema/dist/entity/types.js +0 -1
- package/dist/libs/schema/dist/index.js +0 -6
- package/dist/versioned-knowledge-base.feature.d.ts +0 -6
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,37 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
[
|
|
4
|
-
[34mℹ[39m
|
|
5
|
-
[34mℹ[39m
|
|
6
|
-
[34mℹ[39m
|
|
7
|
-
[34mℹ[39m
|
|
8
|
-
[34mℹ[39m
|
|
9
|
-
[34mℹ[39m
|
|
10
|
-
[34mℹ[39m
|
|
11
|
-
[34mℹ[39m [2mdist/[22m[
|
|
12
|
-
[34mℹ[39m [2mdist/[22m[
|
|
13
|
-
[34mℹ[39m [2mdist/[22m[
|
|
14
|
-
[34mℹ[39m [2mdist/[22m[
|
|
15
|
-
[34mℹ[39m [2mdist/[22m[
|
|
16
|
-
[34mℹ[39m [2mdist/[22m[
|
|
17
|
-
[34mℹ[39m [2mdist/[22m[
|
|
18
|
-
[34mℹ[39m [2mdist/[22m[
|
|
19
|
-
[34mℹ[39m [2mdist/[22m[
|
|
20
|
-
[34mℹ[39m [2mdist/[22m[
|
|
21
|
-
[34mℹ[39m
|
|
22
|
-
[
|
|
23
|
-
|
|
24
|
-
[34mℹ[39m [2mdist/[22m[32m[1mentities/models.d.ts[22m[39m [2m3.54 kB[22m [2m│ gzip: 0.49 kB[22m
|
|
25
|
-
[34mℹ[39m [2mdist/[22m[32m[1mevents.d.ts[22m[39m [2m1.91 kB[22m [2m│ gzip: 0.36 kB[22m
|
|
26
|
-
[34mℹ[39m [2mdist/[22m[32m[1mhandlers/memory.handlers.d.ts[22m[39m [2m1.90 kB[22m [2m│ gzip: 0.59 kB[22m
|
|
27
|
-
[34mℹ[39m [2mdist/[22m[32m[1mindex.d.ts[22m[39m [2m1.17 kB[22m [2m│ gzip: 0.35 kB[22m
|
|
28
|
-
[34mℹ[39m [2mdist/[22m[32m[1mexample.d.ts[22m[39m [2m1.09 kB[22m [2m│ gzip: 0.44 kB[22m
|
|
29
|
-
[34mℹ[39m [2mdist/[22m[32m[1mcontracts/index.d.ts[22m[39m [2m0.29 kB[22m [2m│ gzip: 0.13 kB[22m
|
|
30
|
-
[34mℹ[39m [2mdist/[22m[32m[1mversioned-knowledge-base.feature.d.ts[22m[39m [2m0.23 kB[22m [2m│ gzip: 0.16 kB[22m
|
|
31
|
-
[34mℹ[39m [2mdist/[22m[32m[1mentities/index.d.ts[22m[39m [2m0.21 kB[22m [2m│ gzip: 0.11 kB[22m
|
|
32
|
-
[34mℹ[39m [2mdist/[22m[32m[1mhandlers/index.d.ts[22m[39m [2m0.20 kB[22m [2m│ gzip: 0.10 kB[22m
|
|
33
|
-
[34mℹ[39m [2mdist/[22m[32m[1mdocs/index.d.ts[22m[39m [2m0.01 kB[22m [2m│ gzip: 0.03 kB[22m
|
|
34
|
-
[34mℹ[39m [2mdist/[22m[32m[1mdocs/versioned-knowledge-base.docblock.d.ts[22m[39m [2m0.01 kB[22m [2m│ gzip: 0.03 kB[22m
|
|
35
|
-
[34mℹ[39m 24 files, total: 32.71 kB
|
|
36
|
-
[32m✔[39m Build complete in [32m8636ms[39m
|
|
37
|
-
[0m[2m[35m$[0m [2m[1mtsc --noEmit[0m
|
|
1
|
+
$ bun build:bundle && bun build:types
|
|
2
|
+
$ tsdown
|
|
3
|
+
[34mℹ[39m tsdown [2mv0.17.4[22m powered by rolldown [2mv1.0.0-beta.53[22m
|
|
4
|
+
[34mℹ[39m config file: [4m/home/runner/work/contractspec/contractspec/packages/examples/versioned-knowledge-base/tsdown.config.js[24m
|
|
5
|
+
[34mℹ[39m entry: [34msrc/events.ts, src/example.ts, src/index.ts, src/versioned-knowledge-base.feature.ts, src/contracts/index.ts, src/contracts/kb.ts, src/docs/index.ts, src/docs/versioned-knowledge-base.docblock.ts, src/entities/index.ts, src/entities/models.ts, src/handlers/index.ts, src/handlers/memory.handlers.ts[39m
|
|
6
|
+
[34mℹ[39m target: [34mesnext[39m
|
|
7
|
+
[34mℹ[39m tsconfig: [34mtsconfig.json[39m
|
|
8
|
+
[34mℹ[39m Build start
|
|
9
|
+
[34mℹ[39m [2mdist/[22m[1mcontracts/kb.js[22m [2m4.36 kB[22m [2m│ gzip: 1.33 kB[22m
|
|
10
|
+
[34mℹ[39m [2mdist/[22m[1mhandlers/memory.handlers.js[22m [2m2.16 kB[22m [2m│ gzip: 0.91 kB[22m
|
|
11
|
+
[34mℹ[39m [2mdist/[22m[1mentities/models.js[22m [2m2.13 kB[22m [2m│ gzip: 0.59 kB[22m
|
|
12
|
+
[34mℹ[39m [2mdist/[22m[1mevents.js[22m [2m1.72 kB[22m [2m│ gzip: 0.49 kB[22m
|
|
13
|
+
[34mℹ[39m [2mdist/[22m[1mdocs/versioned-knowledge-base.docblock.js[22m [2m1.28 kB[22m [2m│ gzip: 0.59 kB[22m
|
|
14
|
+
[34mℹ[39m [2mdist/[22m[1mindex.js[22m [2m1.23 kB[22m [2m│ gzip: 0.43 kB[22m
|
|
15
|
+
[34mℹ[39m [2mdist/[22m[1mversioned-knowledge-base.feature.js[22m [2m0.81 kB[22m [2m│ gzip: 0.37 kB[22m
|
|
16
|
+
[34mℹ[39m [2mdist/[22m[1mexample.js[22m [2m0.61 kB[22m [2m│ gzip: 0.36 kB[22m
|
|
17
|
+
[34mℹ[39m [2mdist/[22m[1mcontracts/index.js[22m [2m0.33 kB[22m [2m│ gzip: 0.16 kB[22m
|
|
18
|
+
[34mℹ[39m [2mdist/[22m[1mentities/index.js[22m [2m0.24 kB[22m [2m│ gzip: 0.14 kB[22m
|
|
19
|
+
[34mℹ[39m [2mdist/[22m[1mhandlers/index.js[22m [2m0.15 kB[22m [2m│ gzip: 0.10 kB[22m
|
|
20
|
+
[34mℹ[39m [2mdist/[22m[1mdocs/index.js[22m [2m0.05 kB[22m [2m│ gzip: 0.07 kB[22m
|
|
21
|
+
[34mℹ[39m 12 files, total: 15.05 kB
|
|
22
|
+
[32m✔[39m Build complete in [32m67ms[39m
|
|
23
|
+
$ tsc --noEmit
|
package/dist/contracts/index.js
CHANGED
|
@@ -1,3 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
export { KbApproveRuleVersionContract, KbIngestSourceContract, KbPublishSnapshotContract, KbSearchContract, KbUpsertRuleVersionContract };
|
|
1
|
+
import{KbApproveRuleVersionContract as e,KbIngestSourceContract as t,KbPublishSnapshotContract as n,KbSearchContract as r,KbUpsertRuleVersionContract as i}from"./kb.js";export{e as KbApproveRuleVersionContract,t as KbIngestSourceContract,n as KbPublishSnapshotContract,r as KbSearchContract,i as KbUpsertRuleVersionContract};
|
package/dist/contracts/kb.js
CHANGED
|
@@ -1,253 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import "../libs/contracts/dist/index.js";
|
|
3
|
-
import { ScalarTypeEnum } from "../libs/schema/dist/ScalarTypeEnum.js";
|
|
4
|
-
import { defineSchemaModel } from "../libs/schema/dist/SchemaModel.js";
|
|
5
|
-
import "../libs/schema/dist/index.js";
|
|
6
|
-
import { KBSnapshotModel, RuleVersionModel, SourceDocumentModel, SourceRefModel } from "../entities/models.js";
|
|
7
|
-
|
|
8
|
-
//#region src/contracts/kb.ts
|
|
9
|
-
const IngestSourceInput = defineSchemaModel({
|
|
10
|
-
name: "KbIngestSourceInput",
|
|
11
|
-
description: "Ingest immutable source metadata referencing a stored file.",
|
|
12
|
-
fields: {
|
|
13
|
-
jurisdiction: {
|
|
14
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
15
|
-
isOptional: false
|
|
16
|
-
},
|
|
17
|
-
authority: {
|
|
18
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
19
|
-
isOptional: false
|
|
20
|
-
},
|
|
21
|
-
title: {
|
|
22
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
23
|
-
isOptional: false
|
|
24
|
-
},
|
|
25
|
-
fetchedAt: {
|
|
26
|
-
type: ScalarTypeEnum.DateTime(),
|
|
27
|
-
isOptional: false
|
|
28
|
-
},
|
|
29
|
-
hash: {
|
|
30
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
31
|
-
isOptional: false
|
|
32
|
-
},
|
|
33
|
-
fileId: {
|
|
34
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
35
|
-
isOptional: false
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
const UpsertRuleVersionInput = defineSchemaModel({
|
|
40
|
-
name: "KbUpsertRuleVersionInput",
|
|
41
|
-
description: "Create a new draft rule version (immutable history).",
|
|
42
|
-
fields: {
|
|
43
|
-
ruleId: {
|
|
44
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
45
|
-
isOptional: false
|
|
46
|
-
},
|
|
47
|
-
content: {
|
|
48
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
49
|
-
isOptional: false
|
|
50
|
-
},
|
|
51
|
-
sourceRefs: {
|
|
52
|
-
type: SourceRefModel,
|
|
53
|
-
isArray: true,
|
|
54
|
-
isOptional: false
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
});
|
|
58
|
-
const ApproveRuleVersionInput = defineSchemaModel({
|
|
59
|
-
name: "KbApproveRuleVersionInput",
|
|
60
|
-
description: "Approve a rule version (human verification).",
|
|
61
|
-
fields: {
|
|
62
|
-
ruleVersionId: {
|
|
63
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
64
|
-
isOptional: false
|
|
65
|
-
},
|
|
66
|
-
approver: {
|
|
67
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
68
|
-
isOptional: false
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
});
|
|
72
|
-
const PublishSnapshotInput = defineSchemaModel({
|
|
73
|
-
name: "KbPublishSnapshotInput",
|
|
74
|
-
description: "Publish a snapshot for a jurisdiction as-of a date.",
|
|
75
|
-
fields: {
|
|
76
|
-
jurisdiction: {
|
|
77
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
78
|
-
isOptional: false
|
|
79
|
-
},
|
|
80
|
-
asOfDate: {
|
|
81
|
-
type: ScalarTypeEnum.DateTime(),
|
|
82
|
-
isOptional: false
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
});
|
|
86
|
-
const SearchKbInput = defineSchemaModel({
|
|
87
|
-
name: "KbSearchInput",
|
|
88
|
-
description: "Search within a published snapshot.",
|
|
89
|
-
fields: {
|
|
90
|
-
snapshotId: {
|
|
91
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
92
|
-
isOptional: false
|
|
93
|
-
},
|
|
94
|
-
jurisdiction: {
|
|
95
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
96
|
-
isOptional: false
|
|
97
|
-
},
|
|
98
|
-
query: {
|
|
99
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
100
|
-
isOptional: false
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
});
|
|
104
|
-
const SearchKbOutput = defineSchemaModel({
|
|
105
|
-
name: "KbSearchOutput",
|
|
106
|
-
description: "Search results constrained to snapshot + jurisdiction.",
|
|
107
|
-
fields: { items: {
|
|
108
|
-
type: defineSchemaModel({
|
|
109
|
-
name: "KbSearchResultItem",
|
|
110
|
-
description: "Search result referencing a specific rule version.",
|
|
111
|
-
fields: {
|
|
112
|
-
ruleVersionId: {
|
|
113
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
114
|
-
isOptional: false
|
|
115
|
-
},
|
|
116
|
-
excerpt: {
|
|
117
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
118
|
-
isOptional: true
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
}),
|
|
122
|
-
isArray: true,
|
|
123
|
-
isOptional: false
|
|
124
|
-
} }
|
|
125
|
-
});
|
|
126
|
-
const KbIngestSourceContract = defineCommand({
|
|
127
|
-
meta: {
|
|
128
|
-
name: "kb.ingestSource",
|
|
129
|
-
version: 1,
|
|
130
|
-
stability: "experimental",
|
|
131
|
-
owners: ["@examples"],
|
|
132
|
-
tags: [
|
|
133
|
-
"knowledge",
|
|
134
|
-
"sources",
|
|
135
|
-
"ingestion"
|
|
136
|
-
],
|
|
137
|
-
description: "Ingest immutable source document metadata.",
|
|
138
|
-
goal: "Store traceable source documents for curated KB.",
|
|
139
|
-
context: "Called when an admin uploads/records authoritative sources."
|
|
140
|
-
},
|
|
141
|
-
io: {
|
|
142
|
-
input: IngestSourceInput,
|
|
143
|
-
output: SourceDocumentModel
|
|
144
|
-
},
|
|
145
|
-
policy: { auth: "user" }
|
|
146
|
-
});
|
|
147
|
-
const KbUpsertRuleVersionContract = defineCommand({
|
|
148
|
-
meta: {
|
|
149
|
-
name: "kb.upsertRuleVersion",
|
|
150
|
-
version: 1,
|
|
151
|
-
stability: "experimental",
|
|
152
|
-
owners: ["@examples"],
|
|
153
|
-
tags: [
|
|
154
|
-
"knowledge",
|
|
155
|
-
"rules",
|
|
156
|
-
"versioning"
|
|
157
|
-
],
|
|
158
|
-
description: "Create a new draft rule version with source references.",
|
|
159
|
-
goal: "Propose curated knowledge updates with traceability.",
|
|
160
|
-
context: "Automation or curators propose draft rule versions."
|
|
161
|
-
},
|
|
162
|
-
io: {
|
|
163
|
-
input: UpsertRuleVersionInput,
|
|
164
|
-
output: RuleVersionModel,
|
|
165
|
-
errors: {
|
|
166
|
-
SOURCE_REFS_REQUIRED: {
|
|
167
|
-
description: "Rule version must cite at least one sourceRef",
|
|
168
|
-
http: 400,
|
|
169
|
-
gqlCode: "SOURCE_REFS_REQUIRED",
|
|
170
|
-
when: "sourceRefs is empty"
|
|
171
|
-
},
|
|
172
|
-
RULE_NOT_FOUND: {
|
|
173
|
-
description: "Rule does not exist",
|
|
174
|
-
http: 404,
|
|
175
|
-
gqlCode: "RULE_NOT_FOUND",
|
|
176
|
-
when: "ruleId is unknown"
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
},
|
|
180
|
-
policy: { auth: "user" }
|
|
181
|
-
});
|
|
182
|
-
const KbApproveRuleVersionContract = defineCommand({
|
|
183
|
-
meta: {
|
|
184
|
-
name: "kb.approveRuleVersion",
|
|
185
|
-
version: 1,
|
|
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" }
|
|
202
|
-
});
|
|
203
|
-
const KbPublishSnapshotContract = defineCommand({
|
|
204
|
-
meta: {
|
|
205
|
-
name: "kb.publishSnapshot",
|
|
206
|
-
version: 1,
|
|
207
|
-
stability: "experimental",
|
|
208
|
-
owners: ["@examples"],
|
|
209
|
-
tags: [
|
|
210
|
-
"knowledge",
|
|
211
|
-
"snapshots",
|
|
212
|
-
"publishing"
|
|
213
|
-
],
|
|
214
|
-
description: "Publish a KB snapshot for a jurisdiction.",
|
|
215
|
-
goal: "Create a stable snapshot that assistant answers can cite.",
|
|
216
|
-
context: "Publishing happens after approvals; snapshot is referenced by answers."
|
|
217
|
-
},
|
|
218
|
-
io: {
|
|
219
|
-
input: PublishSnapshotInput,
|
|
220
|
-
output: KBSnapshotModel,
|
|
221
|
-
errors: { NO_APPROVED_RULES: {
|
|
222
|
-
description: "No approved rule versions available to publish",
|
|
223
|
-
http: 409,
|
|
224
|
-
gqlCode: "NO_APPROVED_RULES",
|
|
225
|
-
when: "jurisdiction has zero approved rule versions"
|
|
226
|
-
} }
|
|
227
|
-
},
|
|
228
|
-
policy: { auth: "user" }
|
|
229
|
-
});
|
|
230
|
-
const KbSearchContract = defineQuery({
|
|
231
|
-
meta: {
|
|
232
|
-
name: "kb.search",
|
|
233
|
-
version: 1,
|
|
234
|
-
stability: "experimental",
|
|
235
|
-
owners: ["@examples"],
|
|
236
|
-
tags: [
|
|
237
|
-
"knowledge",
|
|
238
|
-
"search",
|
|
239
|
-
"snapshots"
|
|
240
|
-
],
|
|
241
|
-
description: "Search within a published KB snapshot.",
|
|
242
|
-
goal: "Provide scoped retrieval for assistant answers.",
|
|
243
|
-
context: "Assistant queries curated rules from a specific snapshot."
|
|
244
|
-
},
|
|
245
|
-
io: {
|
|
246
|
-
input: SearchKbInput,
|
|
247
|
-
output: SearchKbOutput
|
|
248
|
-
},
|
|
249
|
-
policy: { auth: "user" }
|
|
250
|
-
});
|
|
251
|
-
|
|
252
|
-
//#endregion
|
|
253
|
-
export { KbApproveRuleVersionContract, KbIngestSourceContract, KbPublishSnapshotContract, KbSearchContract, 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};
|
package/dist/docs/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import"./versioned-knowledge-base.docblock.js";
|
|
@@ -1,31 +1,20 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import{registerDocBlocks as e}from"@lssm/lib.contracts/docs";e([{id:`docs.examples.versioned-knowledge-base.goal`,title:`Versioned Knowledge Base — Goal`,summary:`Curated KB with immutable sources, versioned rules, and published snapshots referenced by answers.`,kind:`goal`,visibility:`public`,route:`/docs/examples/versioned-knowledge-base/goal`,tags:[`knowledge`,`versioning`,`snapshots`,`traceability`],body:`## Why it matters
|
|
2
|
+
- Separates raw sources from curated knowledge.
|
|
3
|
+
- Ensures assistant answers cite a published snapshot.
|
|
4
|
+
- Makes change review and safe regeneration possible.
|
|
3
5
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
"knowledge",
|
|
14
|
-
"versioning",
|
|
15
|
-
"snapshots",
|
|
16
|
-
"traceability"
|
|
17
|
-
],
|
|
18
|
-
body: `## Why it matters
|
|
19
|
-
- Separates raw sources from curated knowledge.\n- Ensures assistant answers cite a published snapshot.\n- Makes change review and safe regeneration possible.\n\n## Core invariants\n- Sources are immutable and content-addressed (hash).\n- Rule versions must cite at least one source.\n- Snapshots include only approved rule versions.`
|
|
20
|
-
}, {
|
|
21
|
-
id: "docs.examples.versioned-knowledge-base.reference",
|
|
22
|
-
title: "Versioned Knowledge Base — Reference",
|
|
23
|
-
summary: "Entities, contracts, and events for the versioned KB example.",
|
|
24
|
-
kind: "reference",
|
|
25
|
-
visibility: "public",
|
|
26
|
-
route: "/docs/examples/versioned-knowledge-base",
|
|
27
|
-
tags: ["knowledge", "reference"],
|
|
28
|
-
body: `## Contracts\n- kb.ingestSource\n- kb.upsertRuleVersion\n- kb.approveRuleVersion\n- kb.publishSnapshot\n- kb.search\n\n## Events\n- kb.source.ingested\n- kb.ruleVersion.created\n- kb.ruleVersion.approved\n- kb.snapshot.published`
|
|
29
|
-
}]);
|
|
6
|
+
## Core invariants
|
|
7
|
+
- Sources are immutable and content-addressed (hash).
|
|
8
|
+
- Rule versions must cite at least one source.
|
|
9
|
+
- Snapshots include only approved rule versions.`},{id:`docs.examples.versioned-knowledge-base.reference`,title:`Versioned Knowledge Base — Reference`,summary:`Entities, contracts, and events for the versioned KB example.`,kind:`reference`,visibility:`public`,route:`/docs/examples/versioned-knowledge-base`,tags:[`knowledge`,`reference`],body:`## Contracts
|
|
10
|
+
- kb.ingestSource
|
|
11
|
+
- kb.upsertRuleVersion
|
|
12
|
+
- kb.approveRuleVersion
|
|
13
|
+
- kb.publishSnapshot
|
|
14
|
+
- kb.search
|
|
30
15
|
|
|
31
|
-
|
|
16
|
+
## Events
|
|
17
|
+
- kb.source.ingested
|
|
18
|
+
- kb.ruleVersion.created
|
|
19
|
+
- kb.ruleVersion.approved
|
|
20
|
+
- kb.snapshot.published`}]);
|
package/dist/entities/index.js
CHANGED
|
@@ -1,3 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
export { KBSnapshotModel, RuleModel, RuleVersionModel, SourceDocumentModel, SourceRefModel };
|
|
1
|
+
import{KBSnapshotModel as e,RuleModel as t,RuleVersionModel as n,SourceDocumentModel as r,SourceRefModel as i}from"./models.js";export{e as KBSnapshotModel,t as RuleModel,n as RuleVersionModel,r as SourceDocumentModel,i as SourceRefModel};
|
package/dist/entities/models.js
CHANGED
|
@@ -1,152 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { defineSchemaModel } from "../libs/schema/dist/SchemaModel.js";
|
|
3
|
-
import "../libs/schema/dist/index.js";
|
|
4
|
-
|
|
5
|
-
//#region src/entities/models.ts
|
|
6
|
-
const SourceDocumentModel = defineSchemaModel({
|
|
7
|
-
name: "SourceDocument",
|
|
8
|
-
description: "Immutable raw source document metadata referencing a stored file.",
|
|
9
|
-
fields: {
|
|
10
|
-
id: {
|
|
11
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
12
|
-
isOptional: false
|
|
13
|
-
},
|
|
14
|
-
jurisdiction: {
|
|
15
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
16
|
-
isOptional: false
|
|
17
|
-
},
|
|
18
|
-
authority: {
|
|
19
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
20
|
-
isOptional: false
|
|
21
|
-
},
|
|
22
|
-
title: {
|
|
23
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
24
|
-
isOptional: false
|
|
25
|
-
},
|
|
26
|
-
fetchedAt: {
|
|
27
|
-
type: ScalarTypeEnum.DateTime(),
|
|
28
|
-
isOptional: false
|
|
29
|
-
},
|
|
30
|
-
hash: {
|
|
31
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
32
|
-
isOptional: false
|
|
33
|
-
},
|
|
34
|
-
fileId: {
|
|
35
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
36
|
-
isOptional: false
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
|
-
const SourceRefModel = defineSchemaModel({
|
|
41
|
-
name: "SourceRef",
|
|
42
|
-
description: "Reference to a source document used to justify a rule version.",
|
|
43
|
-
fields: {
|
|
44
|
-
sourceDocumentId: {
|
|
45
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
46
|
-
isOptional: false
|
|
47
|
-
},
|
|
48
|
-
excerpt: {
|
|
49
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
50
|
-
isOptional: true
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
const RuleModel = defineSchemaModel({
|
|
55
|
-
name: "Rule",
|
|
56
|
-
description: "Curated rule (stable identity) with topic + jurisdiction scope.",
|
|
57
|
-
fields: {
|
|
58
|
-
id: {
|
|
59
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
60
|
-
isOptional: false
|
|
61
|
-
},
|
|
62
|
-
jurisdiction: {
|
|
63
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
64
|
-
isOptional: false
|
|
65
|
-
},
|
|
66
|
-
topicKey: {
|
|
67
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
68
|
-
isOptional: false
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
});
|
|
72
|
-
const RuleVersionModel = defineSchemaModel({
|
|
73
|
-
name: "RuleVersion",
|
|
74
|
-
description: "A versioned rule content with source references and approval status.",
|
|
75
|
-
fields: {
|
|
76
|
-
id: {
|
|
77
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
78
|
-
isOptional: false
|
|
79
|
-
},
|
|
80
|
-
ruleId: {
|
|
81
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
82
|
-
isOptional: false
|
|
83
|
-
},
|
|
84
|
-
jurisdiction: {
|
|
85
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
86
|
-
isOptional: false
|
|
87
|
-
},
|
|
88
|
-
topicKey: {
|
|
89
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
90
|
-
isOptional: false
|
|
91
|
-
},
|
|
92
|
-
version: {
|
|
93
|
-
type: ScalarTypeEnum.Int_unsecure(),
|
|
94
|
-
isOptional: false
|
|
95
|
-
},
|
|
96
|
-
content: {
|
|
97
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
98
|
-
isOptional: false
|
|
99
|
-
},
|
|
100
|
-
sourceRefs: {
|
|
101
|
-
type: SourceRefModel,
|
|
102
|
-
isArray: true,
|
|
103
|
-
isOptional: false
|
|
104
|
-
},
|
|
105
|
-
status: {
|
|
106
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
107
|
-
isOptional: false
|
|
108
|
-
},
|
|
109
|
-
approvedBy: {
|
|
110
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
111
|
-
isOptional: true
|
|
112
|
-
},
|
|
113
|
-
approvedAt: {
|
|
114
|
-
type: ScalarTypeEnum.DateTime(),
|
|
115
|
-
isOptional: true
|
|
116
|
-
},
|
|
117
|
-
createdAt: {
|
|
118
|
-
type: ScalarTypeEnum.DateTime(),
|
|
119
|
-
isOptional: false
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
});
|
|
123
|
-
const KBSnapshotModel = defineSchemaModel({
|
|
124
|
-
name: "KBSnapshot",
|
|
125
|
-
description: "Published KB snapshot (as-of) referencing approved rule versions.",
|
|
126
|
-
fields: {
|
|
127
|
-
id: {
|
|
128
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
129
|
-
isOptional: false
|
|
130
|
-
},
|
|
131
|
-
jurisdiction: {
|
|
132
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
133
|
-
isOptional: false
|
|
134
|
-
},
|
|
135
|
-
asOfDate: {
|
|
136
|
-
type: ScalarTypeEnum.DateTime(),
|
|
137
|
-
isOptional: false
|
|
138
|
-
},
|
|
139
|
-
includedRuleVersionIds: {
|
|
140
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
141
|
-
isArray: true,
|
|
142
|
-
isOptional: false
|
|
143
|
-
},
|
|
144
|
-
publishedAt: {
|
|
145
|
-
type: ScalarTypeEnum.DateTime(),
|
|
146
|
-
isOptional: false
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
});
|
|
150
|
-
|
|
151
|
-
//#endregion
|
|
152
|
-
export { KBSnapshotModel, RuleModel, RuleVersionModel, SourceDocumentModel, SourceRefModel };
|
|
1
|
+
import{ScalarTypeEnum as e,defineSchemaModel as t}from"@lssm/lib.schema";const n=t({name:`SourceDocument`,description:`Immutable raw source document metadata referencing a stored file.`,fields:{id:{type:e.String_unsecure(),isOptional:!1},jurisdiction:{type:e.String_unsecure(),isOptional:!1},authority:{type:e.String_unsecure(),isOptional:!1},title:{type:e.String_unsecure(),isOptional:!1},fetchedAt:{type:e.DateTime(),isOptional:!1},hash:{type:e.String_unsecure(),isOptional:!1},fileId:{type:e.String_unsecure(),isOptional:!1}}}),r=t({name:`SourceRef`,description:`Reference to a source document used to justify a rule version.`,fields:{sourceDocumentId:{type:e.String_unsecure(),isOptional:!1},excerpt:{type:e.String_unsecure(),isOptional:!0}}}),i=t({name:`Rule`,description:`Curated rule (stable identity) with topic + jurisdiction scope.`,fields:{id:{type:e.String_unsecure(),isOptional:!1},jurisdiction:{type:e.String_unsecure(),isOptional:!1},topicKey:{type:e.String_unsecure(),isOptional:!1}}}),a=t({name:`RuleVersion`,description:`A versioned rule content with source references and approval status.`,fields:{id:{type:e.String_unsecure(),isOptional:!1},ruleId:{type:e.String_unsecure(),isOptional:!1},jurisdiction:{type:e.String_unsecure(),isOptional:!1},topicKey:{type:e.String_unsecure(),isOptional:!1},version:{type:e.Int_unsecure(),isOptional:!1},content:{type:e.String_unsecure(),isOptional:!1},sourceRefs:{type:r,isArray:!0,isOptional:!1},status:{type:e.String_unsecure(),isOptional:!1},approvedBy:{type:e.String_unsecure(),isOptional:!0},approvedAt:{type:e.DateTime(),isOptional:!0},createdAt:{type:e.DateTime(),isOptional:!1}}}),o=t({name:`KBSnapshot`,description:`Published KB snapshot (as-of) referencing approved rule versions.`,fields:{id:{type:e.String_unsecure(),isOptional:!1},jurisdiction:{type:e.String_unsecure(),isOptional:!1},asOfDate:{type:e.DateTime(),isOptional:!1},includedRuleVersionIds:{type:e.String_unsecure(),isArray:!0,isOptional:!1},publishedAt:{type:e.DateTime(),isOptional:!1}}});export{o as KBSnapshotModel,i as RuleModel,a as RuleVersionModel,n as SourceDocumentModel,r as SourceRefModel};
|
package/dist/events.js
CHANGED
|
@@ -1,106 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { defineEvent } from "./libs/contracts/dist/events.js";
|
|
3
|
-
import "./libs/contracts/dist/index.js";
|
|
4
|
-
import { ScalarTypeEnum } from "./libs/schema/dist/ScalarTypeEnum.js";
|
|
5
|
-
import "./libs/schema/dist/index.js";
|
|
6
|
-
|
|
7
|
-
//#region src/events.ts
|
|
8
|
-
const KbSourceIngestedPayload = defineSchemaModel({
|
|
9
|
-
name: "KbSourceIngestedPayload",
|
|
10
|
-
description: "Emitted when a source document is ingested.",
|
|
11
|
-
fields: {
|
|
12
|
-
sourceDocumentId: {
|
|
13
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
14
|
-
isOptional: false
|
|
15
|
-
},
|
|
16
|
-
jurisdiction: {
|
|
17
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
18
|
-
isOptional: false
|
|
19
|
-
},
|
|
20
|
-
hash: {
|
|
21
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
22
|
-
isOptional: false
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
const KbSourceIngestedEvent = defineEvent({
|
|
27
|
-
name: "kb.source.ingested",
|
|
28
|
-
version: 1,
|
|
29
|
-
description: "Source document ingested (immutable).",
|
|
30
|
-
payload: KbSourceIngestedPayload
|
|
31
|
-
});
|
|
32
|
-
const KbRuleVersionCreatedPayload = defineSchemaModel({
|
|
33
|
-
name: "KbRuleVersionCreatedPayload",
|
|
34
|
-
description: "Emitted when a rule version draft is created.",
|
|
35
|
-
fields: {
|
|
36
|
-
ruleVersionId: {
|
|
37
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
38
|
-
isOptional: false
|
|
39
|
-
},
|
|
40
|
-
ruleId: {
|
|
41
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
42
|
-
isOptional: false
|
|
43
|
-
},
|
|
44
|
-
jurisdiction: {
|
|
45
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
46
|
-
isOptional: false
|
|
47
|
-
},
|
|
48
|
-
status: {
|
|
49
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
50
|
-
isOptional: false
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
const KbRuleVersionCreatedEvent = defineEvent({
|
|
55
|
-
name: "kb.ruleVersion.created",
|
|
56
|
-
version: 1,
|
|
57
|
-
description: "Rule version created (draft).",
|
|
58
|
-
payload: KbRuleVersionCreatedPayload
|
|
59
|
-
});
|
|
60
|
-
const KbRuleVersionApprovedPayload = defineSchemaModel({
|
|
61
|
-
name: "KbRuleVersionApprovedPayload",
|
|
62
|
-
description: "Emitted when a rule version is approved.",
|
|
63
|
-
fields: {
|
|
64
|
-
ruleVersionId: {
|
|
65
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
66
|
-
isOptional: false
|
|
67
|
-
},
|
|
68
|
-
approver: {
|
|
69
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
70
|
-
isOptional: false
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
});
|
|
74
|
-
const KbRuleVersionApprovedEvent = defineEvent({
|
|
75
|
-
name: "kb.ruleVersion.approved",
|
|
76
|
-
version: 1,
|
|
77
|
-
description: "Rule version approved (human verified).",
|
|
78
|
-
payload: KbRuleVersionApprovedPayload
|
|
79
|
-
});
|
|
80
|
-
const KbSnapshotPublishedPayload = defineSchemaModel({
|
|
81
|
-
name: "KbSnapshotPublishedPayload",
|
|
82
|
-
description: "Emitted when a KB snapshot is published.",
|
|
83
|
-
fields: {
|
|
84
|
-
snapshotId: {
|
|
85
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
86
|
-
isOptional: false
|
|
87
|
-
},
|
|
88
|
-
jurisdiction: {
|
|
89
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
90
|
-
isOptional: false
|
|
91
|
-
},
|
|
92
|
-
includedRuleVersionsCount: {
|
|
93
|
-
type: ScalarTypeEnum.Int_unsecure(),
|
|
94
|
-
isOptional: false
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
});
|
|
98
|
-
const KbSnapshotPublishedEvent = defineEvent({
|
|
99
|
-
name: "kb.snapshot.published",
|
|
100
|
-
version: 1,
|
|
101
|
-
description: "KB snapshot published.",
|
|
102
|
-
payload: KbSnapshotPublishedPayload
|
|
103
|
-
});
|
|
104
|
-
|
|
105
|
-
//#endregion
|
|
106
|
-
export { KbRuleVersionApprovedEvent, KbRuleVersionCreatedEvent, KbSnapshotPublishedEvent, KbSourceIngestedEvent };
|
|
1
|
+
import{defineEvent as e,defineSchemaModel as t}from"@lssm/lib.contracts";import{ScalarTypeEnum as n}from"@lssm/lib.schema";const r=e({name:`kb.source.ingested`,version:1,description:`Source document ingested (immutable).`,payload:t({name:`KbSourceIngestedPayload`,description:`Emitted when a source document is ingested.`,fields:{sourceDocumentId:{type:n.String_unsecure(),isOptional:!1},jurisdiction:{type:n.String_unsecure(),isOptional:!1},hash:{type:n.String_unsecure(),isOptional:!1}}})}),i=e({name:`kb.ruleVersion.created`,version:1,description:`Rule version created (draft).`,payload:t({name:`KbRuleVersionCreatedPayload`,description:`Emitted when a rule version draft is created.`,fields:{ruleVersionId:{type:n.String_unsecure(),isOptional:!1},ruleId:{type:n.String_unsecure(),isOptional:!1},jurisdiction:{type:n.String_unsecure(),isOptional:!1},status:{type:n.String_unsecure(),isOptional:!1}}})}),a=e({name:`kb.ruleVersion.approved`,version:1,description:`Rule version approved (human verified).`,payload:t({name:`KbRuleVersionApprovedPayload`,description:`Emitted when a rule version is approved.`,fields:{ruleVersionId:{type:n.String_unsecure(),isOptional:!1},approver:{type:n.String_unsecure(),isOptional:!1}}})}),o=e({name:`kb.snapshot.published`,version:1,description:`KB snapshot published.`,payload:t({name:`KbSnapshotPublishedPayload`,description:`Emitted when a KB snapshot is published.`,fields:{snapshotId:{type:n.String_unsecure(),isOptional:!1},jurisdiction:{type:n.String_unsecure(),isOptional:!1},includedRuleVersionsCount:{type:n.Int_unsecure(),isOptional:!1}}})});export{a as KbRuleVersionApprovedEvent,i as KbRuleVersionCreatedEvent,o as KbSnapshotPublishedEvent,r as KbSourceIngestedEvent};
|