@lssm/example.versioned-knowledge-base 0.0.0-canary-20251217062943 → 0.0.0-canary-20251217072406
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$colon$bundle.log +225 -191
- package/.turbo/turbo-build.log +226 -37
- package/CHANGELOG.md +3 -3
- package/dist/contracts/index.js +3 -1
- package/dist/contracts/kb.d.ts +70 -70
- package/dist/contracts/kb.js +253 -1
- package/dist/docs/index.js +1 -1
- package/dist/docs/versioned-knowledge-base.docblock.js +29 -18
- package/dist/entities/index.js +3 -1
- package/dist/entities/models.d.ts +36 -36
- package/dist/entities/models.js +152 -1
- package/dist/events.js +106 -1
- package/dist/example.js +41 -1
- package/dist/handlers/index.js +3 -1
- package/dist/handlers/memory.handlers.js +103 -1
- package/dist/index.js +11 -1
- package/dist/libs/contracts/dist/capabilities/openbanking.js +88 -1
- package/dist/libs/contracts/dist/client/index.js +5 -1
- package/dist/libs/contracts/dist/client/react/feature-render.js +2 -1
- package/dist/libs/contracts/dist/client/react/form-render.js +4 -1
- package/dist/libs/contracts/dist/client/react/index.js +4 -1
- package/dist/libs/contracts/dist/contract-registry/index.js +1 -1
- package/dist/libs/contracts/dist/contract-registry/schemas.js +60 -1
- package/dist/libs/contracts/dist/docs/PUBLISHING.docblock.js +16 -76
- package/dist/libs/contracts/dist/docs/accessibility_wcag_compliance_specs.docblock.js +16 -350
- package/dist/libs/contracts/dist/docs/index.js +29 -1
- package/dist/libs/contracts/dist/docs/presentations.js +71 -1
- package/dist/libs/contracts/dist/docs/registry.js +44 -1
- package/dist/libs/contracts/dist/docs/tech/PHASE_1_QUICKSTART.docblock.js +16 -383
- package/dist/libs/contracts/dist/docs/tech/PHASE_2_AI_NATIVE_OPERATIONS.docblock.js +16 -68
- package/dist/libs/contracts/dist/docs/tech/PHASE_3_AUTO_EVOLUTION.docblock.js +16 -140
- package/dist/libs/contracts/dist/docs/tech/PHASE_4_PERSONALIZATION_ENGINE.docblock.js +16 -86
- package/dist/libs/contracts/dist/docs/tech/PHASE_5_ZERO_TOUCH_OPERATIONS.docblock.js +16 -1
- package/dist/libs/contracts/dist/docs/tech/auth/better-auth-nextjs.docblock.js +24 -2
- package/dist/libs/contracts/dist/docs/tech/contracts/openapi-export.docblock.js +21 -2
- package/dist/libs/contracts/dist/docs/tech/lifecycle-stage-system.docblock.js +16 -213
- package/dist/libs/contracts/dist/docs/tech/llm/llm-integration.docblock.js +73 -5
- package/dist/libs/contracts/dist/docs/tech/mcp-endpoints.docblock.js +37 -1
- package/dist/libs/contracts/dist/docs/tech/presentation-runtime.docblock.js +16 -1
- package/dist/libs/contracts/dist/docs/tech/schema/README.docblock.js +20 -262
- package/dist/libs/contracts/dist/docs/tech/studio/learning-events.docblock.js +48 -1
- package/dist/libs/contracts/dist/docs/tech/studio/learning-journeys.docblock.js +24 -2
- package/dist/libs/contracts/dist/docs/tech/studio/platform-admin-panel.docblock.js +23 -2
- package/dist/libs/contracts/dist/docs/tech/studio/project-access-teams.docblock.js +25 -16
- package/dist/libs/contracts/dist/docs/tech/studio/project-routing.docblock.js +67 -1
- package/dist/libs/contracts/dist/docs/tech/studio/sandbox-unlogged.docblock.js +22 -2
- package/dist/libs/contracts/dist/docs/tech/studio/team-invitations.docblock.js +40 -36
- package/dist/libs/contracts/dist/docs/tech/studio/workspace-ops.docblock.js +47 -1
- package/dist/libs/contracts/dist/docs/tech/studio/workspaces.docblock.js +23 -2
- package/dist/libs/contracts/dist/docs/tech/telemetry-ingest.docblock.js +36 -3
- package/dist/libs/contracts/dist/docs/tech/templates/runtime.docblock.js +20 -1
- package/dist/libs/contracts/dist/docs/tech/vscode-extension.docblock.js +36 -3
- package/dist/libs/contracts/dist/docs/tech/workflows/overview.docblock.js +20 -1
- package/dist/libs/contracts/dist/events.js +10 -1
- package/dist/libs/contracts/dist/experiments/evaluator.js +1 -1
- package/dist/libs/contracts/dist/index.js +71 -1
- package/dist/libs/contracts/dist/install.js +2 -1
- package/dist/libs/contracts/dist/integrations/contracts.js +377 -1
- package/dist/libs/contracts/dist/integrations/index.js +18 -1
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/accounts.js +228 -1
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/balances.js +159 -1
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/index.js +3 -1
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/transactions.js +210 -1
- package/dist/libs/contracts/dist/integrations/openbanking/models.js +242 -1
- package/dist/libs/contracts/dist/integrations/openbanking/telemetry.js +13 -1
- package/dist/libs/contracts/dist/integrations/providers/elevenlabs.js +52 -1
- package/dist/libs/contracts/dist/integrations/providers/gcs-storage.js +75 -1
- package/dist/libs/contracts/dist/integrations/providers/gmail.js +87 -1
- package/dist/libs/contracts/dist/integrations/providers/google-calendar.js +66 -1
- package/dist/libs/contracts/dist/integrations/providers/index.js +11 -1
- package/dist/libs/contracts/dist/integrations/providers/mistral.js +68 -1
- package/dist/libs/contracts/dist/integrations/providers/postmark.js +68 -1
- package/dist/libs/contracts/dist/integrations/providers/powens.js +116 -1
- package/dist/libs/contracts/dist/integrations/providers/qdrant.js +73 -1
- package/dist/libs/contracts/dist/integrations/providers/registry.js +10 -1
- package/dist/libs/contracts/dist/integrations/providers/stripe.js +83 -1
- package/dist/libs/contracts/dist/integrations/providers/twilio-sms.js +61 -1
- package/dist/libs/contracts/dist/jsonschema.js +1 -1
- package/dist/libs/contracts/dist/knowledge/contracts.js +306 -1
- package/dist/libs/contracts/dist/knowledge/index.js +7 -1
- package/dist/libs/contracts/dist/knowledge/spaces/email-threads.js +34 -1
- package/dist/libs/contracts/dist/knowledge/spaces/financial-docs.js +34 -1
- package/dist/libs/contracts/dist/knowledge/spaces/financial-overview.js +38 -1
- package/dist/libs/contracts/dist/knowledge/spaces/index.js +6 -1
- package/dist/libs/contracts/dist/knowledge/spaces/product-canon.js +34 -1
- package/dist/libs/contracts/dist/knowledge/spaces/support-faq.js +37 -1
- package/dist/libs/contracts/dist/knowledge/spaces/uploaded-docs.js +34 -1
- package/dist/libs/contracts/dist/llm/exporters.js +19 -1
- package/dist/libs/contracts/dist/llm/index.js +2 -1
- package/dist/libs/contracts/dist/llm/prompts.js +1 -1
- package/dist/libs/contracts/dist/onboarding-base.js +196 -1
- package/dist/libs/contracts/dist/openapi.js +1 -1
- package/dist/libs/contracts/dist/ownership.js +21 -1
- package/dist/libs/contracts/dist/presentations.js +1 -1
- package/dist/libs/contracts/dist/presentations.v2.js +11 -1
- package/dist/libs/contracts/dist/prompt.js +1 -1
- package/dist/libs/contracts/dist/promptRegistry.js +1 -1
- package/dist/libs/contracts/dist/regenerator/index.js +1 -1
- package/dist/libs/contracts/dist/regenerator/service.js +6 -1
- package/dist/libs/contracts/dist/registry.js +2 -1
- package/dist/libs/contracts/dist/resources.js +1 -1
- package/dist/libs/contracts/dist/schema/dist/EnumType.js +2 -1
- package/dist/libs/contracts/dist/schema/dist/FieldType.js +49 -1
- package/dist/libs/contracts/dist/schema/dist/ScalarTypeEnum.js +236 -1
- package/dist/libs/contracts/dist/schema/dist/SchemaModel.js +39 -1
- package/dist/libs/contracts/dist/schema/dist/entity/defineEntity.js +1 -1
- package/dist/libs/contracts/dist/schema/dist/entity/index.js +2 -1
- package/dist/libs/contracts/dist/schema/dist/entity/types.js +1 -1
- package/dist/libs/contracts/dist/schema/dist/index.js +6 -1
- package/dist/libs/contracts/dist/server/graphql-pothos.js +6 -1
- package/dist/libs/contracts/dist/server/index.js +8 -1
- package/dist/libs/contracts/dist/server/mcp/createMcpServer.js +4 -1
- package/dist/libs/contracts/dist/server/mcp/registerPresentations.js +2 -1
- package/dist/libs/contracts/dist/server/mcp/registerPrompts.js +1 -1
- package/dist/libs/contracts/dist/server/mcp/registerResources.js +2 -1
- package/dist/libs/contracts/dist/server/mcp/registerTools.js +1 -1
- package/dist/libs/contracts/dist/server/provider-mcp.js +1 -1
- package/dist/libs/contracts/dist/server/rest-elysia.js +1 -1
- package/dist/libs/contracts/dist/server/rest-express.js +1 -1
- package/dist/libs/contracts/dist/server/rest-generic.js +1 -1
- package/dist/libs/contracts/dist/server/rest-next-app.js +1 -1
- package/dist/libs/contracts/dist/server/rest-next-pages.js +1 -1
- package/dist/libs/contracts/dist/spec.js +34 -1
- package/dist/libs/contracts/dist/telemetry/index.js +1 -1
- package/dist/libs/contracts/dist/telemetry/tracker.js +1 -1
- package/dist/libs/contracts/dist/tests/index.js +1 -1
- package/dist/libs/contracts/dist/tests/runner.js +2 -1
- package/dist/libs/contracts/dist/workflow/index.js +1 -1
- package/dist/libs/contracts/dist/workflow/runner.js +1 -1
- package/dist/libs/schema/dist/EnumType.js +2 -1
- package/dist/libs/schema/dist/FieldType.js +49 -1
- package/dist/libs/schema/dist/ScalarTypeEnum.js +236 -1
- package/dist/libs/schema/dist/SchemaModel.js +39 -1
- package/dist/libs/schema/dist/entity/defineEntity.js +1 -1
- package/dist/libs/schema/dist/entity/index.js +2 -1
- package/dist/libs/schema/dist/entity/types.js +1 -1
- package/dist/libs/schema/dist/index.js +6 -1
- package/dist/versioned-knowledge-base.feature.js +66 -1
- package/package.json +5 -5
- package/tsconfig.tsbuildinfo +1 -1
package/dist/contracts/kb.d.ts
CHANGED
|
@@ -1,118 +1,118 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _lssm_lib_schema15 from "@lssm/lib.schema";
|
|
2
2
|
import * as _lssm_lib_contracts3 from "@lssm/lib.contracts";
|
|
3
3
|
|
|
4
4
|
//#region src/contracts/kb.d.ts
|
|
5
|
-
declare const KbIngestSourceContract: _lssm_lib_contracts3.ContractSpec<
|
|
5
|
+
declare const KbIngestSourceContract: _lssm_lib_contracts3.ContractSpec<_lssm_lib_schema15.SchemaModel<{
|
|
6
6
|
jurisdiction: {
|
|
7
|
-
type:
|
|
7
|
+
type: _lssm_lib_schema15.FieldType<string, string>;
|
|
8
8
|
isOptional: false;
|
|
9
9
|
};
|
|
10
10
|
authority: {
|
|
11
|
-
type:
|
|
11
|
+
type: _lssm_lib_schema15.FieldType<string, string>;
|
|
12
12
|
isOptional: false;
|
|
13
13
|
};
|
|
14
14
|
title: {
|
|
15
|
-
type:
|
|
15
|
+
type: _lssm_lib_schema15.FieldType<string, string>;
|
|
16
16
|
isOptional: false;
|
|
17
17
|
};
|
|
18
18
|
fetchedAt: {
|
|
19
|
-
type:
|
|
19
|
+
type: _lssm_lib_schema15.FieldType<Date, string>;
|
|
20
20
|
isOptional: false;
|
|
21
21
|
};
|
|
22
22
|
hash: {
|
|
23
|
-
type:
|
|
23
|
+
type: _lssm_lib_schema15.FieldType<string, string>;
|
|
24
24
|
isOptional: false;
|
|
25
25
|
};
|
|
26
26
|
fileId: {
|
|
27
|
-
type:
|
|
27
|
+
type: _lssm_lib_schema15.FieldType<string, string>;
|
|
28
28
|
isOptional: false;
|
|
29
29
|
};
|
|
30
|
-
}>,
|
|
30
|
+
}>, _lssm_lib_schema15.SchemaModel<{
|
|
31
31
|
id: {
|
|
32
|
-
type:
|
|
32
|
+
type: _lssm_lib_schema15.FieldType<string, string>;
|
|
33
33
|
isOptional: false;
|
|
34
34
|
};
|
|
35
35
|
jurisdiction: {
|
|
36
|
-
type:
|
|
36
|
+
type: _lssm_lib_schema15.FieldType<string, string>;
|
|
37
37
|
isOptional: false;
|
|
38
38
|
};
|
|
39
39
|
authority: {
|
|
40
|
-
type:
|
|
40
|
+
type: _lssm_lib_schema15.FieldType<string, string>;
|
|
41
41
|
isOptional: false;
|
|
42
42
|
};
|
|
43
43
|
title: {
|
|
44
|
-
type:
|
|
44
|
+
type: _lssm_lib_schema15.FieldType<string, string>;
|
|
45
45
|
isOptional: false;
|
|
46
46
|
};
|
|
47
47
|
fetchedAt: {
|
|
48
|
-
type:
|
|
48
|
+
type: _lssm_lib_schema15.FieldType<Date, string>;
|
|
49
49
|
isOptional: false;
|
|
50
50
|
};
|
|
51
51
|
hash: {
|
|
52
|
-
type:
|
|
52
|
+
type: _lssm_lib_schema15.FieldType<string, string>;
|
|
53
53
|
isOptional: false;
|
|
54
54
|
};
|
|
55
55
|
fileId: {
|
|
56
|
-
type:
|
|
56
|
+
type: _lssm_lib_schema15.FieldType<string, string>;
|
|
57
57
|
isOptional: false;
|
|
58
58
|
};
|
|
59
59
|
}>, undefined>;
|
|
60
|
-
declare const KbUpsertRuleVersionContract: _lssm_lib_contracts3.ContractSpec<
|
|
60
|
+
declare const KbUpsertRuleVersionContract: _lssm_lib_contracts3.ContractSpec<_lssm_lib_schema15.SchemaModel<{
|
|
61
61
|
ruleId: {
|
|
62
|
-
type:
|
|
62
|
+
type: _lssm_lib_schema15.FieldType<string, string>;
|
|
63
63
|
isOptional: false;
|
|
64
64
|
};
|
|
65
65
|
content: {
|
|
66
|
-
type:
|
|
66
|
+
type: _lssm_lib_schema15.FieldType<string, string>;
|
|
67
67
|
isOptional: false;
|
|
68
68
|
};
|
|
69
69
|
sourceRefs: {
|
|
70
|
-
type:
|
|
70
|
+
type: _lssm_lib_schema15.SchemaModel<{
|
|
71
71
|
sourceDocumentId: {
|
|
72
|
-
type:
|
|
72
|
+
type: _lssm_lib_schema15.FieldType<string, string>;
|
|
73
73
|
isOptional: false;
|
|
74
74
|
};
|
|
75
75
|
excerpt: {
|
|
76
|
-
type:
|
|
76
|
+
type: _lssm_lib_schema15.FieldType<string, string>;
|
|
77
77
|
isOptional: true;
|
|
78
78
|
};
|
|
79
79
|
}>;
|
|
80
80
|
isArray: true;
|
|
81
81
|
isOptional: false;
|
|
82
82
|
};
|
|
83
|
-
}>,
|
|
83
|
+
}>, _lssm_lib_schema15.SchemaModel<{
|
|
84
84
|
id: {
|
|
85
|
-
type:
|
|
85
|
+
type: _lssm_lib_schema15.FieldType<string, string>;
|
|
86
86
|
isOptional: false;
|
|
87
87
|
};
|
|
88
88
|
ruleId: {
|
|
89
|
-
type:
|
|
89
|
+
type: _lssm_lib_schema15.FieldType<string, string>;
|
|
90
90
|
isOptional: false;
|
|
91
91
|
};
|
|
92
92
|
jurisdiction: {
|
|
93
|
-
type:
|
|
93
|
+
type: _lssm_lib_schema15.FieldType<string, string>;
|
|
94
94
|
isOptional: false;
|
|
95
95
|
};
|
|
96
96
|
topicKey: {
|
|
97
|
-
type:
|
|
97
|
+
type: _lssm_lib_schema15.FieldType<string, string>;
|
|
98
98
|
isOptional: false;
|
|
99
99
|
};
|
|
100
100
|
version: {
|
|
101
|
-
type:
|
|
101
|
+
type: _lssm_lib_schema15.FieldType<number, number>;
|
|
102
102
|
isOptional: false;
|
|
103
103
|
};
|
|
104
104
|
content: {
|
|
105
|
-
type:
|
|
105
|
+
type: _lssm_lib_schema15.FieldType<string, string>;
|
|
106
106
|
isOptional: false;
|
|
107
107
|
};
|
|
108
108
|
sourceRefs: {
|
|
109
|
-
type:
|
|
109
|
+
type: _lssm_lib_schema15.SchemaModel<{
|
|
110
110
|
sourceDocumentId: {
|
|
111
|
-
type:
|
|
111
|
+
type: _lssm_lib_schema15.FieldType<string, string>;
|
|
112
112
|
isOptional: false;
|
|
113
113
|
};
|
|
114
114
|
excerpt: {
|
|
115
|
-
type:
|
|
115
|
+
type: _lssm_lib_schema15.FieldType<string, string>;
|
|
116
116
|
isOptional: true;
|
|
117
117
|
};
|
|
118
118
|
}>;
|
|
@@ -120,64 +120,64 @@ declare const KbUpsertRuleVersionContract: _lssm_lib_contracts3.ContractSpec<_ls
|
|
|
120
120
|
isOptional: false;
|
|
121
121
|
};
|
|
122
122
|
status: {
|
|
123
|
-
type:
|
|
123
|
+
type: _lssm_lib_schema15.FieldType<string, string>;
|
|
124
124
|
isOptional: false;
|
|
125
125
|
};
|
|
126
126
|
approvedBy: {
|
|
127
|
-
type:
|
|
127
|
+
type: _lssm_lib_schema15.FieldType<string, string>;
|
|
128
128
|
isOptional: true;
|
|
129
129
|
};
|
|
130
130
|
approvedAt: {
|
|
131
|
-
type:
|
|
131
|
+
type: _lssm_lib_schema15.FieldType<Date, string>;
|
|
132
132
|
isOptional: true;
|
|
133
133
|
};
|
|
134
134
|
createdAt: {
|
|
135
|
-
type:
|
|
135
|
+
type: _lssm_lib_schema15.FieldType<Date, string>;
|
|
136
136
|
isOptional: false;
|
|
137
137
|
};
|
|
138
138
|
}>, undefined>;
|
|
139
|
-
declare const KbApproveRuleVersionContract: _lssm_lib_contracts3.ContractSpec<
|
|
139
|
+
declare const KbApproveRuleVersionContract: _lssm_lib_contracts3.ContractSpec<_lssm_lib_schema15.SchemaModel<{
|
|
140
140
|
ruleVersionId: {
|
|
141
|
-
type:
|
|
141
|
+
type: _lssm_lib_schema15.FieldType<string, string>;
|
|
142
142
|
isOptional: false;
|
|
143
143
|
};
|
|
144
144
|
approver: {
|
|
145
|
-
type:
|
|
145
|
+
type: _lssm_lib_schema15.FieldType<string, string>;
|
|
146
146
|
isOptional: false;
|
|
147
147
|
};
|
|
148
|
-
}>,
|
|
148
|
+
}>, _lssm_lib_schema15.SchemaModel<{
|
|
149
149
|
id: {
|
|
150
|
-
type:
|
|
150
|
+
type: _lssm_lib_schema15.FieldType<string, string>;
|
|
151
151
|
isOptional: false;
|
|
152
152
|
};
|
|
153
153
|
ruleId: {
|
|
154
|
-
type:
|
|
154
|
+
type: _lssm_lib_schema15.FieldType<string, string>;
|
|
155
155
|
isOptional: false;
|
|
156
156
|
};
|
|
157
157
|
jurisdiction: {
|
|
158
|
-
type:
|
|
158
|
+
type: _lssm_lib_schema15.FieldType<string, string>;
|
|
159
159
|
isOptional: false;
|
|
160
160
|
};
|
|
161
161
|
topicKey: {
|
|
162
|
-
type:
|
|
162
|
+
type: _lssm_lib_schema15.FieldType<string, string>;
|
|
163
163
|
isOptional: false;
|
|
164
164
|
};
|
|
165
165
|
version: {
|
|
166
|
-
type:
|
|
166
|
+
type: _lssm_lib_schema15.FieldType<number, number>;
|
|
167
167
|
isOptional: false;
|
|
168
168
|
};
|
|
169
169
|
content: {
|
|
170
|
-
type:
|
|
170
|
+
type: _lssm_lib_schema15.FieldType<string, string>;
|
|
171
171
|
isOptional: false;
|
|
172
172
|
};
|
|
173
173
|
sourceRefs: {
|
|
174
|
-
type:
|
|
174
|
+
type: _lssm_lib_schema15.SchemaModel<{
|
|
175
175
|
sourceDocumentId: {
|
|
176
|
-
type:
|
|
176
|
+
type: _lssm_lib_schema15.FieldType<string, string>;
|
|
177
177
|
isOptional: false;
|
|
178
178
|
};
|
|
179
179
|
excerpt: {
|
|
180
|
-
type:
|
|
180
|
+
type: _lssm_lib_schema15.FieldType<string, string>;
|
|
181
181
|
isOptional: true;
|
|
182
182
|
};
|
|
183
183
|
}>;
|
|
@@ -185,76 +185,76 @@ declare const KbApproveRuleVersionContract: _lssm_lib_contracts3.ContractSpec<_l
|
|
|
185
185
|
isOptional: false;
|
|
186
186
|
};
|
|
187
187
|
status: {
|
|
188
|
-
type:
|
|
188
|
+
type: _lssm_lib_schema15.FieldType<string, string>;
|
|
189
189
|
isOptional: false;
|
|
190
190
|
};
|
|
191
191
|
approvedBy: {
|
|
192
|
-
type:
|
|
192
|
+
type: _lssm_lib_schema15.FieldType<string, string>;
|
|
193
193
|
isOptional: true;
|
|
194
194
|
};
|
|
195
195
|
approvedAt: {
|
|
196
|
-
type:
|
|
196
|
+
type: _lssm_lib_schema15.FieldType<Date, string>;
|
|
197
197
|
isOptional: true;
|
|
198
198
|
};
|
|
199
199
|
createdAt: {
|
|
200
|
-
type:
|
|
200
|
+
type: _lssm_lib_schema15.FieldType<Date, string>;
|
|
201
201
|
isOptional: false;
|
|
202
202
|
};
|
|
203
203
|
}>, undefined>;
|
|
204
|
-
declare const KbPublishSnapshotContract: _lssm_lib_contracts3.ContractSpec<
|
|
204
|
+
declare const KbPublishSnapshotContract: _lssm_lib_contracts3.ContractSpec<_lssm_lib_schema15.SchemaModel<{
|
|
205
205
|
jurisdiction: {
|
|
206
|
-
type:
|
|
206
|
+
type: _lssm_lib_schema15.FieldType<string, string>;
|
|
207
207
|
isOptional: false;
|
|
208
208
|
};
|
|
209
209
|
asOfDate: {
|
|
210
|
-
type:
|
|
210
|
+
type: _lssm_lib_schema15.FieldType<Date, string>;
|
|
211
211
|
isOptional: false;
|
|
212
212
|
};
|
|
213
|
-
}>,
|
|
213
|
+
}>, _lssm_lib_schema15.SchemaModel<{
|
|
214
214
|
id: {
|
|
215
|
-
type:
|
|
215
|
+
type: _lssm_lib_schema15.FieldType<string, string>;
|
|
216
216
|
isOptional: false;
|
|
217
217
|
};
|
|
218
218
|
jurisdiction: {
|
|
219
|
-
type:
|
|
219
|
+
type: _lssm_lib_schema15.FieldType<string, string>;
|
|
220
220
|
isOptional: false;
|
|
221
221
|
};
|
|
222
222
|
asOfDate: {
|
|
223
|
-
type:
|
|
223
|
+
type: _lssm_lib_schema15.FieldType<Date, string>;
|
|
224
224
|
isOptional: false;
|
|
225
225
|
};
|
|
226
226
|
includedRuleVersionIds: {
|
|
227
|
-
type:
|
|
227
|
+
type: _lssm_lib_schema15.FieldType<string, string>;
|
|
228
228
|
isArray: true;
|
|
229
229
|
isOptional: false;
|
|
230
230
|
};
|
|
231
231
|
publishedAt: {
|
|
232
|
-
type:
|
|
232
|
+
type: _lssm_lib_schema15.FieldType<Date, string>;
|
|
233
233
|
isOptional: false;
|
|
234
234
|
};
|
|
235
235
|
}>, undefined>;
|
|
236
|
-
declare const KbSearchContract: _lssm_lib_contracts3.ContractSpec<
|
|
236
|
+
declare const KbSearchContract: _lssm_lib_contracts3.ContractSpec<_lssm_lib_schema15.SchemaModel<{
|
|
237
237
|
snapshotId: {
|
|
238
|
-
type:
|
|
238
|
+
type: _lssm_lib_schema15.FieldType<string, string>;
|
|
239
239
|
isOptional: false;
|
|
240
240
|
};
|
|
241
241
|
jurisdiction: {
|
|
242
|
-
type:
|
|
242
|
+
type: _lssm_lib_schema15.FieldType<string, string>;
|
|
243
243
|
isOptional: false;
|
|
244
244
|
};
|
|
245
245
|
query: {
|
|
246
|
-
type:
|
|
246
|
+
type: _lssm_lib_schema15.FieldType<string, string>;
|
|
247
247
|
isOptional: false;
|
|
248
248
|
};
|
|
249
|
-
}>,
|
|
249
|
+
}>, _lssm_lib_schema15.SchemaModel<{
|
|
250
250
|
items: {
|
|
251
|
-
type:
|
|
251
|
+
type: _lssm_lib_schema15.SchemaModel<{
|
|
252
252
|
ruleVersionId: {
|
|
253
|
-
type:
|
|
253
|
+
type: _lssm_lib_schema15.FieldType<string, string>;
|
|
254
254
|
isOptional: false;
|
|
255
255
|
};
|
|
256
256
|
excerpt: {
|
|
257
|
-
type:
|
|
257
|
+
type: _lssm_lib_schema15.FieldType<string, string>;
|
|
258
258
|
isOptional: true;
|
|
259
259
|
};
|
|
260
260
|
}>;
|
package/dist/contracts/kb.js
CHANGED
|
@@ -1 +1,253 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import { defineCommand, defineQuery } from "../libs/contracts/dist/spec.js";
|
|
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 };
|
package/dist/docs/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./versioned-knowledge-base.docblock.js";
|
|
1
|
+
import "./versioned-knowledge-base.docblock.js";
|
|
@@ -1,20 +1,31 @@
|
|
|
1
|
-
import{
|
|
2
|
-
|
|
3
|
-
- Ensures assistant answers cite a published snapshot.
|
|
4
|
-
- Makes change review and safe regeneration possible.
|
|
1
|
+
import { registerDocBlocks } from "../libs/contracts/dist/docs/registry.js";
|
|
2
|
+
import "../libs/contracts/dist/docs/index.js";
|
|
5
3
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
-
|
|
14
|
-
|
|
4
|
+
//#region src/docs/versioned-knowledge-base.docblock.ts
|
|
5
|
+
registerDocBlocks([{
|
|
6
|
+
id: "docs.examples.versioned-knowledge-base.goal",
|
|
7
|
+
title: "Versioned Knowledge Base — Goal",
|
|
8
|
+
summary: "Curated KB with immutable sources, versioned rules, and published snapshots referenced by answers.",
|
|
9
|
+
kind: "goal",
|
|
10
|
+
visibility: "public",
|
|
11
|
+
route: "/docs/examples/versioned-knowledge-base/goal",
|
|
12
|
+
tags: [
|
|
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
|
+
}]);
|
|
15
30
|
|
|
16
|
-
|
|
17
|
-
- kb.source.ingested
|
|
18
|
-
- kb.ruleVersion.created
|
|
19
|
-
- kb.ruleVersion.approved
|
|
20
|
-
- kb.snapshot.published`}]);
|
|
31
|
+
//#endregion
|
package/dist/entities/index.js
CHANGED
|
@@ -1 +1,3 @@
|
|
|
1
|
-
import{KBSnapshotModel
|
|
1
|
+
import { KBSnapshotModel, RuleModel, RuleVersionModel, SourceDocumentModel, SourceRefModel } from "./models.js";
|
|
2
|
+
|
|
3
|
+
export { KBSnapshotModel, RuleModel, RuleVersionModel, SourceDocumentModel, SourceRefModel };
|