@lssm/example.kb-update-pipeline 0.0.0-canary-20251217060834 → 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 +220 -29
- package/.turbo/turbo-build.log +219 -28
- package/CHANGELOG.md +5 -5
- package/dist/contracts/index.js +3 -1
- package/dist/contracts/pipeline.d.ts +39 -39
- package/dist/contracts/pipeline.js +185 -1
- package/dist/docs/index.js +1 -1
- package/dist/docs/kb-update-pipeline.docblock.js +29 -17
- package/dist/entities/index.js +3 -1
- package/dist/entities/models.js +76 -1
- package/dist/events.d.ts +21 -21
- package/dist/events.js +127 -1
- package/dist/example.js +42 -1
- package/dist/feature.js +78 -1
- package/dist/handlers/index.js +3 -1
- package/dist/handlers/memory.handlers.js +92 -1
- package/dist/index.d.ts +0 -2
- package/dist/index.js +11 -1
- package/dist/kb-update-pipeline.feature.js +78 -1
- package/dist/libs/contracts/dist/capabilities/openbanking.js +88 -0
- package/dist/libs/contracts/dist/client/index.js +5 -0
- package/dist/libs/contracts/dist/client/react/feature-render.js +2 -0
- package/dist/libs/contracts/dist/client/react/form-render.js +4 -0
- package/dist/libs/contracts/dist/client/react/index.js +4 -0
- package/dist/libs/contracts/dist/contract-registry/index.js +1 -0
- package/dist/libs/contracts/dist/contract-registry/schemas.js +60 -0
- package/dist/libs/contracts/dist/docs/PUBLISHING.docblock.js +16 -0
- package/dist/libs/contracts/dist/docs/accessibility_wcag_compliance_specs.docblock.js +16 -0
- package/dist/libs/contracts/dist/docs/index.js +29 -0
- package/dist/libs/contracts/dist/docs/presentations.js +71 -0
- package/dist/libs/contracts/dist/docs/registry.js +44 -0
- package/dist/libs/contracts/dist/docs/tech/PHASE_1_QUICKSTART.docblock.js +16 -0
- package/dist/libs/contracts/dist/docs/tech/PHASE_2_AI_NATIVE_OPERATIONS.docblock.js +16 -0
- package/dist/libs/contracts/dist/docs/tech/PHASE_3_AUTO_EVOLUTION.docblock.js +16 -0
- package/dist/libs/contracts/dist/docs/tech/PHASE_4_PERSONALIZATION_ENGINE.docblock.js +16 -0
- package/dist/libs/contracts/dist/docs/tech/PHASE_5_ZERO_TOUCH_OPERATIONS.docblock.js +16 -0
- package/dist/libs/contracts/dist/docs/tech/auth/better-auth-nextjs.docblock.js +80 -0
- package/dist/libs/contracts/dist/docs/tech/contracts/openapi-export.docblock.js +57 -0
- package/dist/libs/contracts/dist/docs/tech/lifecycle-stage-system.docblock.js +16 -0
- package/dist/libs/contracts/dist/docs/tech/llm/llm-integration.docblock.js +357 -0
- package/dist/libs/contracts/dist/docs/tech/mcp-endpoints.docblock.js +37 -0
- package/dist/libs/contracts/dist/docs/tech/presentation-runtime.docblock.js +16 -0
- package/dist/libs/contracts/dist/docs/tech/schema/README.docblock.js +20 -0
- package/dist/libs/contracts/dist/docs/tech/studio/learning-events.docblock.js +48 -0
- package/dist/libs/contracts/dist/docs/tech/studio/learning-journeys.docblock.js +79 -0
- package/dist/libs/contracts/dist/docs/tech/studio/platform-admin-panel.docblock.js +84 -0
- package/dist/libs/contracts/dist/docs/tech/studio/project-access-teams.docblock.js +45 -0
- package/dist/libs/contracts/dist/docs/tech/studio/project-routing.docblock.js +67 -0
- package/dist/libs/contracts/dist/docs/tech/studio/sandbox-unlogged.docblock.js +40 -0
- package/dist/libs/contracts/dist/docs/tech/studio/team-invitations.docblock.js +69 -0
- package/dist/libs/contracts/dist/docs/tech/studio/workspace-ops.docblock.js +47 -0
- package/dist/libs/contracts/dist/docs/tech/studio/workspaces.docblock.js +62 -0
- package/dist/libs/contracts/dist/docs/tech/telemetry-ingest.docblock.js +155 -0
- package/dist/libs/contracts/dist/docs/tech/templates/runtime.docblock.js +20 -0
- package/dist/libs/contracts/dist/docs/tech/vscode-extension.docblock.js +101 -0
- package/dist/libs/contracts/dist/docs/tech/workflows/overview.docblock.js +20 -0
- package/dist/libs/contracts/dist/events.js +10 -0
- package/dist/libs/contracts/dist/experiments/evaluator.js +1 -0
- package/dist/libs/contracts/dist/index.js +71 -0
- package/dist/libs/contracts/dist/install.js +2 -0
- package/dist/libs/contracts/dist/integrations/contracts.js +377 -0
- package/dist/libs/contracts/dist/integrations/index.js +18 -0
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/accounts.js +228 -0
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/balances.js +159 -0
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/index.js +3 -0
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/transactions.js +210 -0
- package/dist/libs/contracts/dist/integrations/openbanking/models.js +242 -0
- package/dist/libs/contracts/dist/integrations/openbanking/telemetry.js +13 -0
- package/dist/libs/contracts/dist/integrations/providers/elevenlabs.js +52 -0
- package/dist/libs/contracts/dist/integrations/providers/gcs-storage.js +75 -0
- package/dist/libs/contracts/dist/integrations/providers/gmail.js +87 -0
- package/dist/libs/contracts/dist/integrations/providers/google-calendar.js +66 -0
- package/dist/libs/contracts/dist/integrations/providers/index.js +11 -0
- package/dist/libs/contracts/dist/integrations/providers/mistral.js +68 -0
- package/dist/libs/contracts/dist/integrations/providers/postmark.js +68 -0
- package/dist/libs/contracts/dist/integrations/providers/powens.js +116 -0
- package/dist/libs/contracts/dist/integrations/providers/qdrant.js +73 -0
- package/dist/libs/contracts/dist/integrations/providers/registry.js +10 -0
- package/dist/libs/contracts/dist/integrations/providers/stripe.js +83 -0
- package/dist/libs/contracts/dist/integrations/providers/twilio-sms.js +61 -0
- package/dist/libs/contracts/dist/jsonschema.js +1 -0
- package/dist/libs/contracts/dist/knowledge/contracts.js +306 -0
- package/dist/libs/contracts/dist/knowledge/index.js +7 -0
- package/dist/libs/contracts/dist/knowledge/spaces/email-threads.js +34 -0
- package/dist/libs/contracts/dist/knowledge/spaces/financial-docs.js +34 -0
- package/dist/libs/contracts/dist/knowledge/spaces/financial-overview.js +38 -0
- package/dist/libs/contracts/dist/knowledge/spaces/index.js +6 -0
- package/dist/libs/contracts/dist/knowledge/spaces/product-canon.js +34 -0
- package/dist/libs/contracts/dist/knowledge/spaces/support-faq.js +37 -0
- package/dist/libs/contracts/dist/knowledge/spaces/uploaded-docs.js +34 -0
- package/dist/libs/contracts/dist/llm/exporters.js +19 -0
- package/dist/libs/contracts/dist/llm/index.js +2 -0
- package/dist/libs/contracts/dist/llm/prompts.js +1 -0
- package/dist/libs/contracts/dist/onboarding-base.js +196 -0
- package/dist/libs/contracts/dist/openapi.js +1 -0
- package/dist/libs/contracts/dist/ownership.js +21 -0
- package/dist/libs/contracts/dist/presentations.js +1 -0
- package/dist/libs/contracts/dist/presentations.v2.js +11 -0
- package/dist/libs/contracts/dist/prompt.js +1 -0
- package/dist/libs/contracts/dist/promptRegistry.js +1 -0
- package/dist/libs/contracts/dist/regenerator/index.js +1 -0
- package/dist/libs/contracts/dist/regenerator/service.js +6 -0
- package/dist/libs/contracts/dist/registry.js +2 -0
- package/dist/libs/contracts/dist/resources.js +1 -0
- package/dist/libs/contracts/dist/schema/dist/EnumType.js +2 -0
- package/dist/libs/contracts/dist/schema/dist/FieldType.js +49 -0
- package/dist/libs/contracts/dist/schema/dist/ScalarTypeEnum.js +236 -0
- package/dist/libs/contracts/dist/schema/dist/SchemaModel.js +39 -0
- package/dist/libs/contracts/dist/schema/dist/entity/defineEntity.js +1 -0
- package/dist/libs/contracts/dist/schema/dist/entity/index.js +2 -0
- package/dist/libs/contracts/dist/schema/dist/entity/types.js +1 -0
- package/dist/libs/contracts/dist/schema/dist/index.js +6 -0
- package/dist/libs/contracts/dist/server/graphql-pothos.js +6 -0
- package/dist/libs/contracts/dist/server/index.js +8 -0
- package/dist/libs/contracts/dist/server/mcp/createMcpServer.js +4 -0
- package/dist/libs/contracts/dist/server/mcp/registerPresentations.js +2 -0
- package/dist/libs/contracts/dist/server/mcp/registerPrompts.js +1 -0
- package/dist/libs/contracts/dist/server/mcp/registerResources.js +2 -0
- package/dist/libs/contracts/dist/server/mcp/registerTools.js +1 -0
- package/dist/libs/contracts/dist/server/provider-mcp.js +1 -0
- package/dist/libs/contracts/dist/server/rest-elysia.js +1 -0
- package/dist/libs/contracts/dist/server/rest-express.js +1 -0
- package/dist/libs/contracts/dist/server/rest-generic.js +1 -0
- package/dist/libs/contracts/dist/server/rest-next-app.js +1 -0
- package/dist/libs/contracts/dist/server/rest-next-pages.js +1 -0
- package/dist/libs/contracts/dist/spec.js +34 -0
- package/dist/libs/contracts/dist/telemetry/index.js +1 -0
- package/dist/libs/contracts/dist/telemetry/tracker.js +1 -0
- package/dist/libs/contracts/dist/tests/index.js +1 -0
- package/dist/libs/contracts/dist/tests/runner.js +2 -0
- package/dist/libs/contracts/dist/workflow/index.js +1 -0
- package/dist/libs/contracts/dist/workflow/runner.js +1 -0
- package/dist/libs/schema/dist/EnumType.js +56 -0
- package/dist/libs/schema/dist/FieldType.js +49 -0
- package/dist/libs/schema/dist/ScalarTypeEnum.js +236 -0
- package/dist/libs/schema/dist/SchemaModel.js +39 -0
- package/dist/libs/schema/dist/entity/defineEntity.js +1 -0
- package/dist/libs/schema/dist/entity/index.js +2 -0
- package/dist/libs/schema/dist/entity/types.js +1 -0
- package/dist/libs/schema/dist/index.js +6 -0
- package/package.json +7 -7
- package/tsconfig.tsbuildinfo +1 -1
package/dist/contracts/index.js
CHANGED
|
@@ -1 +1,3 @@
|
|
|
1
|
-
import{KbPipelineCreateReviewTaskContract
|
|
1
|
+
import { KbPipelineCreateReviewTaskContract, KbPipelinePublishIfReadyContract, KbPipelineRunWatchContract, KbPipelineSubmitDecisionContract } from "./pipeline.js";
|
|
2
|
+
|
|
3
|
+
export { KbPipelineCreateReviewTaskContract, KbPipelinePublishIfReadyContract, KbPipelineRunWatchContract, KbPipelineSubmitDecisionContract };
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import * as
|
|
1
|
+
import * as _lssm_lib_schema18 from "@lssm/lib.schema";
|
|
2
|
+
import * as _lssm_lib_contracts4 from "@lssm/lib.contracts";
|
|
3
3
|
|
|
4
4
|
//#region src/contracts/pipeline.d.ts
|
|
5
|
-
declare const KbPipelineRunWatchContract:
|
|
5
|
+
declare const KbPipelineRunWatchContract: _lssm_lib_contracts4.ContractSpec<_lssm_lib_schema18.SchemaModel<{
|
|
6
6
|
jurisdiction: {
|
|
7
|
-
type:
|
|
7
|
+
type: _lssm_lib_schema18.FieldType<string, string>;
|
|
8
8
|
isOptional: false;
|
|
9
9
|
};
|
|
10
|
-
}>,
|
|
10
|
+
}>, _lssm_lib_schema18.SchemaModel<{
|
|
11
11
|
candidates: {
|
|
12
|
-
type:
|
|
12
|
+
type: _lssm_lib_schema18.SchemaModel<{
|
|
13
13
|
id: {
|
|
14
|
-
type:
|
|
14
|
+
type: _lssm_lib_schema18.FieldType<string, string>;
|
|
15
15
|
isOptional: false;
|
|
16
16
|
};
|
|
17
17
|
sourceDocumentId: {
|
|
18
|
-
type:
|
|
18
|
+
type: _lssm_lib_schema18.FieldType<string, string>;
|
|
19
19
|
isOptional: false;
|
|
20
20
|
};
|
|
21
21
|
detectedAt: {
|
|
22
|
-
type:
|
|
22
|
+
type: _lssm_lib_schema18.FieldType<Date, string>;
|
|
23
23
|
isOptional: false;
|
|
24
24
|
};
|
|
25
25
|
diffSummary: {
|
|
26
|
-
type:
|
|
26
|
+
type: _lssm_lib_schema18.FieldType<string, string>;
|
|
27
27
|
isOptional: false;
|
|
28
28
|
};
|
|
29
29
|
riskLevel: {
|
|
30
|
-
type:
|
|
30
|
+
type: _lssm_lib_schema18.EnumType<[string, string, string]>;
|
|
31
31
|
isOptional: false;
|
|
32
32
|
};
|
|
33
33
|
}>;
|
|
@@ -35,100 +35,100 @@ declare const KbPipelineRunWatchContract: _lssm_lib_contracts0.ContractSpec<_lss
|
|
|
35
35
|
isOptional: false;
|
|
36
36
|
};
|
|
37
37
|
}>, undefined>;
|
|
38
|
-
declare const KbPipelineCreateReviewTaskContract:
|
|
38
|
+
declare const KbPipelineCreateReviewTaskContract: _lssm_lib_contracts4.ContractSpec<_lssm_lib_schema18.SchemaModel<{
|
|
39
39
|
changeCandidateId: {
|
|
40
|
-
type:
|
|
40
|
+
type: _lssm_lib_schema18.FieldType<string, string>;
|
|
41
41
|
isOptional: false;
|
|
42
42
|
};
|
|
43
|
-
}>,
|
|
43
|
+
}>, _lssm_lib_schema18.SchemaModel<{
|
|
44
44
|
id: {
|
|
45
|
-
type:
|
|
45
|
+
type: _lssm_lib_schema18.FieldType<string, string>;
|
|
46
46
|
isOptional: false;
|
|
47
47
|
};
|
|
48
48
|
changeCandidateId: {
|
|
49
|
-
type:
|
|
49
|
+
type: _lssm_lib_schema18.FieldType<string, string>;
|
|
50
50
|
isOptional: false;
|
|
51
51
|
};
|
|
52
52
|
status: {
|
|
53
|
-
type:
|
|
53
|
+
type: _lssm_lib_schema18.FieldType<string, string>;
|
|
54
54
|
isOptional: false;
|
|
55
55
|
};
|
|
56
56
|
assignedRole: {
|
|
57
|
-
type:
|
|
57
|
+
type: _lssm_lib_schema18.EnumType<[string, string]>;
|
|
58
58
|
isOptional: false;
|
|
59
59
|
};
|
|
60
60
|
decision: {
|
|
61
|
-
type:
|
|
61
|
+
type: _lssm_lib_schema18.EnumType<[string, string]>;
|
|
62
62
|
isOptional: true;
|
|
63
63
|
};
|
|
64
64
|
decidedAt: {
|
|
65
|
-
type:
|
|
65
|
+
type: _lssm_lib_schema18.FieldType<Date, string>;
|
|
66
66
|
isOptional: true;
|
|
67
67
|
};
|
|
68
68
|
decidedBy: {
|
|
69
|
-
type:
|
|
69
|
+
type: _lssm_lib_schema18.FieldType<string, string>;
|
|
70
70
|
isOptional: true;
|
|
71
71
|
};
|
|
72
72
|
}>, undefined>;
|
|
73
|
-
declare const KbPipelineSubmitDecisionContract:
|
|
73
|
+
declare const KbPipelineSubmitDecisionContract: _lssm_lib_contracts4.ContractSpec<_lssm_lib_schema18.SchemaModel<{
|
|
74
74
|
reviewTaskId: {
|
|
75
|
-
type:
|
|
75
|
+
type: _lssm_lib_schema18.FieldType<string, string>;
|
|
76
76
|
isOptional: false;
|
|
77
77
|
};
|
|
78
78
|
decision: {
|
|
79
|
-
type:
|
|
79
|
+
type: _lssm_lib_schema18.EnumType<[string, string]>;
|
|
80
80
|
isOptional: false;
|
|
81
81
|
};
|
|
82
82
|
decidedBy: {
|
|
83
|
-
type:
|
|
83
|
+
type: _lssm_lib_schema18.FieldType<string, string>;
|
|
84
84
|
isOptional: false;
|
|
85
85
|
};
|
|
86
86
|
decidedByRole: {
|
|
87
|
-
type:
|
|
87
|
+
type: _lssm_lib_schema18.FieldType<string, string>;
|
|
88
88
|
isOptional: false;
|
|
89
89
|
};
|
|
90
|
-
}>,
|
|
90
|
+
}>, _lssm_lib_schema18.SchemaModel<{
|
|
91
91
|
id: {
|
|
92
|
-
type:
|
|
92
|
+
type: _lssm_lib_schema18.FieldType<string, string>;
|
|
93
93
|
isOptional: false;
|
|
94
94
|
};
|
|
95
95
|
changeCandidateId: {
|
|
96
|
-
type:
|
|
96
|
+
type: _lssm_lib_schema18.FieldType<string, string>;
|
|
97
97
|
isOptional: false;
|
|
98
98
|
};
|
|
99
99
|
status: {
|
|
100
|
-
type:
|
|
100
|
+
type: _lssm_lib_schema18.FieldType<string, string>;
|
|
101
101
|
isOptional: false;
|
|
102
102
|
};
|
|
103
103
|
assignedRole: {
|
|
104
|
-
type:
|
|
104
|
+
type: _lssm_lib_schema18.EnumType<[string, string]>;
|
|
105
105
|
isOptional: false;
|
|
106
106
|
};
|
|
107
107
|
decision: {
|
|
108
|
-
type:
|
|
108
|
+
type: _lssm_lib_schema18.EnumType<[string, string]>;
|
|
109
109
|
isOptional: true;
|
|
110
110
|
};
|
|
111
111
|
decidedAt: {
|
|
112
|
-
type:
|
|
112
|
+
type: _lssm_lib_schema18.FieldType<Date, string>;
|
|
113
113
|
isOptional: true;
|
|
114
114
|
};
|
|
115
115
|
decidedBy: {
|
|
116
|
-
type:
|
|
116
|
+
type: _lssm_lib_schema18.FieldType<string, string>;
|
|
117
117
|
isOptional: true;
|
|
118
118
|
};
|
|
119
119
|
}>, undefined>;
|
|
120
|
-
declare const KbPipelinePublishIfReadyContract:
|
|
120
|
+
declare const KbPipelinePublishIfReadyContract: _lssm_lib_contracts4.ContractSpec<_lssm_lib_schema18.SchemaModel<{
|
|
121
121
|
jurisdiction: {
|
|
122
|
-
type:
|
|
122
|
+
type: _lssm_lib_schema18.FieldType<string, string>;
|
|
123
123
|
isOptional: false;
|
|
124
124
|
};
|
|
125
|
-
}>,
|
|
125
|
+
}>, _lssm_lib_schema18.SchemaModel<{
|
|
126
126
|
published: {
|
|
127
|
-
type:
|
|
127
|
+
type: _lssm_lib_schema18.FieldType<boolean, boolean>;
|
|
128
128
|
isOptional: false;
|
|
129
129
|
};
|
|
130
130
|
reason: {
|
|
131
|
-
type:
|
|
131
|
+
type: _lssm_lib_schema18.FieldType<string, string>;
|
|
132
132
|
isOptional: true;
|
|
133
133
|
};
|
|
134
134
|
}>, undefined>;
|
|
@@ -1 +1,185 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import { defineCommand } 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 { ChangeCandidateModel, ReviewDecisionEnum, ReviewTaskModel } from "../entities/models.js";
|
|
7
|
+
|
|
8
|
+
//#region src/contracts/pipeline.ts
|
|
9
|
+
const RunWatchInput = defineSchemaModel({
|
|
10
|
+
name: "KbPipelineRunWatchInput",
|
|
11
|
+
description: "Trigger a watch cycle for KB sources (demo).",
|
|
12
|
+
fields: { jurisdiction: {
|
|
13
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
14
|
+
isOptional: false
|
|
15
|
+
} }
|
|
16
|
+
});
|
|
17
|
+
const RunWatchOutput = defineSchemaModel({
|
|
18
|
+
name: "KbPipelineRunWatchOutput",
|
|
19
|
+
description: "Output containing detected changes.",
|
|
20
|
+
fields: { candidates: {
|
|
21
|
+
type: ChangeCandidateModel,
|
|
22
|
+
isArray: true,
|
|
23
|
+
isOptional: false
|
|
24
|
+
} }
|
|
25
|
+
});
|
|
26
|
+
const CreateReviewTaskInput = defineSchemaModel({
|
|
27
|
+
name: "KbPipelineCreateReviewTaskInput",
|
|
28
|
+
description: "Create a review task for a change candidate.",
|
|
29
|
+
fields: { changeCandidateId: {
|
|
30
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
31
|
+
isOptional: false
|
|
32
|
+
} }
|
|
33
|
+
});
|
|
34
|
+
const SubmitDecisionInput = defineSchemaModel({
|
|
35
|
+
name: "KbPipelineSubmitDecisionInput",
|
|
36
|
+
description: "Submit a decision for a review task.",
|
|
37
|
+
fields: {
|
|
38
|
+
reviewTaskId: {
|
|
39
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
40
|
+
isOptional: false
|
|
41
|
+
},
|
|
42
|
+
decision: {
|
|
43
|
+
type: ReviewDecisionEnum,
|
|
44
|
+
isOptional: false
|
|
45
|
+
},
|
|
46
|
+
decidedBy: {
|
|
47
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
48
|
+
isOptional: false
|
|
49
|
+
},
|
|
50
|
+
decidedByRole: {
|
|
51
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
52
|
+
isOptional: false
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
const PublishIfReadyInput = defineSchemaModel({
|
|
57
|
+
name: "KbPipelinePublishIfReadyInput",
|
|
58
|
+
description: "Publish snapshot if approvals are satisfied for a jurisdiction.",
|
|
59
|
+
fields: { jurisdiction: {
|
|
60
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
61
|
+
isOptional: false
|
|
62
|
+
} }
|
|
63
|
+
});
|
|
64
|
+
const PublishIfReadyOutput = defineSchemaModel({
|
|
65
|
+
name: "KbPipelinePublishIfReadyOutput",
|
|
66
|
+
description: "Output for publish-if-ready operation.",
|
|
67
|
+
fields: {
|
|
68
|
+
published: {
|
|
69
|
+
type: ScalarTypeEnum.Boolean(),
|
|
70
|
+
isOptional: false
|
|
71
|
+
},
|
|
72
|
+
reason: {
|
|
73
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
74
|
+
isOptional: true
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
const KbPipelineRunWatchContract = defineCommand({
|
|
79
|
+
meta: {
|
|
80
|
+
name: "kbPipeline.runWatch",
|
|
81
|
+
version: 1,
|
|
82
|
+
stability: "experimental",
|
|
83
|
+
owners: ["examples"],
|
|
84
|
+
tags: [
|
|
85
|
+
"knowledge",
|
|
86
|
+
"pipeline",
|
|
87
|
+
"jobs"
|
|
88
|
+
],
|
|
89
|
+
description: "Detect source changes and create change candidates.",
|
|
90
|
+
goal: "Automate discovery of updates needing review.",
|
|
91
|
+
context: "Scheduled job or manual trigger in demos."
|
|
92
|
+
},
|
|
93
|
+
io: {
|
|
94
|
+
input: RunWatchInput,
|
|
95
|
+
output: RunWatchOutput
|
|
96
|
+
},
|
|
97
|
+
policy: { auth: "user" }
|
|
98
|
+
});
|
|
99
|
+
const KbPipelineCreateReviewTaskContract = defineCommand({
|
|
100
|
+
meta: {
|
|
101
|
+
name: "kbPipeline.createReviewTask",
|
|
102
|
+
version: 1,
|
|
103
|
+
stability: "experimental",
|
|
104
|
+
owners: ["examples"],
|
|
105
|
+
tags: [
|
|
106
|
+
"knowledge",
|
|
107
|
+
"pipeline",
|
|
108
|
+
"hitl"
|
|
109
|
+
],
|
|
110
|
+
description: "Create a review task for a detected change.",
|
|
111
|
+
goal: "Route work to human verifiers.",
|
|
112
|
+
context: "Called after change detection or manual selection."
|
|
113
|
+
},
|
|
114
|
+
io: {
|
|
115
|
+
input: CreateReviewTaskInput,
|
|
116
|
+
output: ReviewTaskModel
|
|
117
|
+
},
|
|
118
|
+
policy: { auth: "user" }
|
|
119
|
+
});
|
|
120
|
+
const KbPipelineSubmitDecisionContract = defineCommand({
|
|
121
|
+
meta: {
|
|
122
|
+
name: "kbPipeline.submitDecision",
|
|
123
|
+
version: 1,
|
|
124
|
+
stability: "experimental",
|
|
125
|
+
owners: ["examples"],
|
|
126
|
+
tags: [
|
|
127
|
+
"knowledge",
|
|
128
|
+
"pipeline",
|
|
129
|
+
"hitl",
|
|
130
|
+
"rbac"
|
|
131
|
+
],
|
|
132
|
+
description: "Submit approve/reject decision for a review task.",
|
|
133
|
+
goal: "Ensure humans verify before publishing.",
|
|
134
|
+
context: "Curator/expert reviews and decides."
|
|
135
|
+
},
|
|
136
|
+
io: {
|
|
137
|
+
input: SubmitDecisionInput,
|
|
138
|
+
output: ReviewTaskModel,
|
|
139
|
+
errors: {
|
|
140
|
+
FORBIDDEN_ROLE: {
|
|
141
|
+
description: "Role not allowed to approve the given risk level",
|
|
142
|
+
http: 403,
|
|
143
|
+
gqlCode: "FORBIDDEN_ROLE",
|
|
144
|
+
when: "curator attempts to approve a high-risk change"
|
|
145
|
+
},
|
|
146
|
+
REVIEW_TASK_NOT_FOUND: {
|
|
147
|
+
description: "Review task not found",
|
|
148
|
+
http: 404,
|
|
149
|
+
gqlCode: "REVIEW_TASK_NOT_FOUND",
|
|
150
|
+
when: "reviewTaskId is invalid"
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
policy: { auth: "user" }
|
|
155
|
+
});
|
|
156
|
+
const KbPipelinePublishIfReadyContract = defineCommand({
|
|
157
|
+
meta: {
|
|
158
|
+
name: "kbPipeline.publishIfReady",
|
|
159
|
+
version: 1,
|
|
160
|
+
stability: "experimental",
|
|
161
|
+
owners: ["examples"],
|
|
162
|
+
tags: [
|
|
163
|
+
"knowledge",
|
|
164
|
+
"pipeline",
|
|
165
|
+
"publishing"
|
|
166
|
+
],
|
|
167
|
+
description: "Publish snapshot if ready (all approvals satisfied).",
|
|
168
|
+
goal: "Prevent publishing until all required approvals exist.",
|
|
169
|
+
context: "Called by job or UI to attempt publish."
|
|
170
|
+
},
|
|
171
|
+
io: {
|
|
172
|
+
input: PublishIfReadyInput,
|
|
173
|
+
output: PublishIfReadyOutput,
|
|
174
|
+
errors: { NOT_READY: {
|
|
175
|
+
description: "Publishing is blocked because approvals are incomplete",
|
|
176
|
+
http: 409,
|
|
177
|
+
gqlCode: "NOT_READY",
|
|
178
|
+
when: "there are open review tasks or unapproved rule versions"
|
|
179
|
+
} }
|
|
180
|
+
},
|
|
181
|
+
policy: { auth: "user" }
|
|
182
|
+
});
|
|
183
|
+
|
|
184
|
+
//#endregion
|
|
185
|
+
export { KbPipelineCreateReviewTaskContract, KbPipelinePublishIfReadyContract, KbPipelineRunWatchContract, KbPipelineSubmitDecisionContract };
|
package/dist/docs/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./kb-update-pipeline.docblock.js";
|
|
1
|
+
import "./kb-update-pipeline.docblock.js";
|
|
@@ -1,19 +1,31 @@
|
|
|
1
|
-
import{registerDocBlocks
|
|
2
|
-
|
|
3
|
-
- Produces an auditable chain: source change -> diff -> proposal -> review -> publish.
|
|
1
|
+
import { registerDocBlocks } from "../libs/contracts/dist/docs/registry.js";
|
|
2
|
+
import "../libs/contracts/dist/docs/index.js";
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
-
|
|
4
|
+
//#region src/docs/kb-update-pipeline.docblock.ts
|
|
5
|
+
registerDocBlocks([{
|
|
6
|
+
id: "docs.examples.kb-update-pipeline.goal",
|
|
7
|
+
title: "KB Update Pipeline — Goal",
|
|
8
|
+
summary: "Automation proposes KB patches; humans verify; publishing is blocked until approvals are complete.",
|
|
9
|
+
kind: "goal",
|
|
10
|
+
visibility: "public",
|
|
11
|
+
route: "/docs/examples/kb-update-pipeline/goal",
|
|
12
|
+
tags: [
|
|
13
|
+
"knowledge",
|
|
14
|
+
"pipeline",
|
|
15
|
+
"hitl",
|
|
16
|
+
"audit"
|
|
17
|
+
],
|
|
18
|
+
body: `## Why it matters
|
|
19
|
+
- Keeps humans as the verifiers (HITL) while automation does the busywork.\n- Produces an auditable chain: source change -> diff -> proposal -> review -> publish.\n\n## Guardrails\n- High-risk changes require expert approval.\n- Publishing fails if any included rule versions are not approved.\n- Review requests emit notifications/events.`
|
|
20
|
+
}, {
|
|
21
|
+
id: "docs.examples.kb-update-pipeline.reference",
|
|
22
|
+
title: "KB Update Pipeline — Reference",
|
|
23
|
+
summary: "Entities, contracts, and events for the KB update pipeline example.",
|
|
24
|
+
kind: "reference",
|
|
25
|
+
visibility: "public",
|
|
26
|
+
route: "/docs/examples/kb-update-pipeline",
|
|
27
|
+
tags: ["knowledge", "reference"],
|
|
28
|
+
body: `## Contracts\n- kbPipeline.runWatch\n- kbPipeline.createReviewTask\n- kbPipeline.submitDecision\n- kbPipeline.publishIfReady\n\n## Events\n- kb.change.detected\n- kb.change.summarized\n- kb.patch.proposed\n- kb.review.requested\n- kb.review.decided`
|
|
29
|
+
}]);
|
|
13
30
|
|
|
14
|
-
|
|
15
|
-
- kb.change.detected
|
|
16
|
-
- kb.change.summarized
|
|
17
|
-
- kb.patch.proposed
|
|
18
|
-
- kb.review.requested
|
|
19
|
-
- kb.review.decided`}]);
|
|
31
|
+
//#endregion
|
package/dist/entities/index.js
CHANGED
|
@@ -1 +1,3 @@
|
|
|
1
|
-
import{ChangeCandidateModel
|
|
1
|
+
import { ChangeCandidateModel, ChangeRiskLevelEnum, ReviewAssignedRoleEnum, ReviewDecisionEnum, ReviewTaskModel } from "./models.js";
|
|
2
|
+
|
|
3
|
+
export { ChangeCandidateModel, ChangeRiskLevelEnum, ReviewAssignedRoleEnum, ReviewDecisionEnum, ReviewTaskModel };
|
package/dist/entities/models.js
CHANGED
|
@@ -1 +1,76 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import { defineEnum } from "../libs/schema/dist/EnumType.js";
|
|
2
|
+
import { ScalarTypeEnum } from "../libs/schema/dist/ScalarTypeEnum.js";
|
|
3
|
+
import { defineSchemaModel } from "../libs/schema/dist/SchemaModel.js";
|
|
4
|
+
import "../libs/schema/dist/index.js";
|
|
5
|
+
|
|
6
|
+
//#region src/entities/models.ts
|
|
7
|
+
const ChangeRiskLevelEnum = defineEnum("ChangeRiskLevel", [
|
|
8
|
+
"low",
|
|
9
|
+
"medium",
|
|
10
|
+
"high"
|
|
11
|
+
]);
|
|
12
|
+
const ReviewAssignedRoleEnum = defineEnum("ReviewAssignedRole", ["curator", "expert"]);
|
|
13
|
+
const ReviewDecisionEnum = defineEnum("ReviewDecision", ["approve", "reject"]);
|
|
14
|
+
const ChangeCandidateModel = defineSchemaModel({
|
|
15
|
+
name: "ChangeCandidate",
|
|
16
|
+
description: "Candidate change detected in a source document.",
|
|
17
|
+
fields: {
|
|
18
|
+
id: {
|
|
19
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
20
|
+
isOptional: false
|
|
21
|
+
},
|
|
22
|
+
sourceDocumentId: {
|
|
23
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
24
|
+
isOptional: false
|
|
25
|
+
},
|
|
26
|
+
detectedAt: {
|
|
27
|
+
type: ScalarTypeEnum.DateTime(),
|
|
28
|
+
isOptional: false
|
|
29
|
+
},
|
|
30
|
+
diffSummary: {
|
|
31
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
32
|
+
isOptional: false
|
|
33
|
+
},
|
|
34
|
+
riskLevel: {
|
|
35
|
+
type: ChangeRiskLevelEnum,
|
|
36
|
+
isOptional: false
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
const ReviewTaskModel = defineSchemaModel({
|
|
41
|
+
name: "ReviewTask",
|
|
42
|
+
description: "Human verification task for a change candidate.",
|
|
43
|
+
fields: {
|
|
44
|
+
id: {
|
|
45
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
46
|
+
isOptional: false
|
|
47
|
+
},
|
|
48
|
+
changeCandidateId: {
|
|
49
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
50
|
+
isOptional: false
|
|
51
|
+
},
|
|
52
|
+
status: {
|
|
53
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
54
|
+
isOptional: false
|
|
55
|
+
},
|
|
56
|
+
assignedRole: {
|
|
57
|
+
type: ReviewAssignedRoleEnum,
|
|
58
|
+
isOptional: false
|
|
59
|
+
},
|
|
60
|
+
decision: {
|
|
61
|
+
type: ReviewDecisionEnum,
|
|
62
|
+
isOptional: true
|
|
63
|
+
},
|
|
64
|
+
decidedAt: {
|
|
65
|
+
type: ScalarTypeEnum.DateTime(),
|
|
66
|
+
isOptional: true
|
|
67
|
+
},
|
|
68
|
+
decidedBy: {
|
|
69
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
70
|
+
isOptional: true
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
//#endregion
|
|
76
|
+
export { ChangeCandidateModel, ChangeRiskLevelEnum, ReviewAssignedRoleEnum, ReviewDecisionEnum, ReviewTaskModel };
|
package/dist/events.d.ts
CHANGED
|
@@ -1,71 +1,71 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import * as
|
|
1
|
+
import * as _lssm_lib_schema0 from "@lssm/lib.schema";
|
|
2
|
+
import * as _lssm_lib_contracts0 from "@lssm/lib.contracts";
|
|
3
3
|
|
|
4
4
|
//#region src/events.d.ts
|
|
5
|
-
declare const KbChangeDetectedEvent:
|
|
5
|
+
declare const KbChangeDetectedEvent: _lssm_lib_contracts0.EventSpec<_lssm_lib_schema0.SchemaModel<{
|
|
6
6
|
changeCandidateId: {
|
|
7
|
-
type:
|
|
7
|
+
type: _lssm_lib_schema0.FieldType<string, string>;
|
|
8
8
|
isOptional: false;
|
|
9
9
|
};
|
|
10
10
|
sourceDocumentId: {
|
|
11
|
-
type:
|
|
11
|
+
type: _lssm_lib_schema0.FieldType<string, string>;
|
|
12
12
|
isOptional: false;
|
|
13
13
|
};
|
|
14
14
|
riskLevel: {
|
|
15
|
-
type:
|
|
15
|
+
type: _lssm_lib_schema0.FieldType<string, string>;
|
|
16
16
|
isOptional: false;
|
|
17
17
|
};
|
|
18
18
|
}>>;
|
|
19
|
-
declare const KbChangeSummarizedEvent:
|
|
19
|
+
declare const KbChangeSummarizedEvent: _lssm_lib_contracts0.EventSpec<_lssm_lib_schema0.SchemaModel<{
|
|
20
20
|
changeCandidateId: {
|
|
21
|
-
type:
|
|
21
|
+
type: _lssm_lib_schema0.FieldType<string, string>;
|
|
22
22
|
isOptional: false;
|
|
23
23
|
};
|
|
24
24
|
summary: {
|
|
25
|
-
type:
|
|
25
|
+
type: _lssm_lib_schema0.FieldType<string, string>;
|
|
26
26
|
isOptional: false;
|
|
27
27
|
};
|
|
28
28
|
riskLevel: {
|
|
29
|
-
type:
|
|
29
|
+
type: _lssm_lib_schema0.FieldType<string, string>;
|
|
30
30
|
isOptional: false;
|
|
31
31
|
};
|
|
32
32
|
}>>;
|
|
33
|
-
declare const KbPatchProposedEvent:
|
|
33
|
+
declare const KbPatchProposedEvent: _lssm_lib_contracts0.EventSpec<_lssm_lib_schema0.SchemaModel<{
|
|
34
34
|
changeCandidateId: {
|
|
35
|
-
type:
|
|
35
|
+
type: _lssm_lib_schema0.FieldType<string, string>;
|
|
36
36
|
isOptional: false;
|
|
37
37
|
};
|
|
38
38
|
proposedRuleVersionIds: {
|
|
39
|
-
type:
|
|
39
|
+
type: _lssm_lib_schema0.FieldType<string, string>;
|
|
40
40
|
isArray: true;
|
|
41
41
|
isOptional: false;
|
|
42
42
|
};
|
|
43
43
|
}>>;
|
|
44
|
-
declare const KbReviewRequestedEvent:
|
|
44
|
+
declare const KbReviewRequestedEvent: _lssm_lib_contracts0.EventSpec<_lssm_lib_schema0.SchemaModel<{
|
|
45
45
|
reviewTaskId: {
|
|
46
|
-
type:
|
|
46
|
+
type: _lssm_lib_schema0.FieldType<string, string>;
|
|
47
47
|
isOptional: false;
|
|
48
48
|
};
|
|
49
49
|
changeCandidateId: {
|
|
50
|
-
type:
|
|
50
|
+
type: _lssm_lib_schema0.FieldType<string, string>;
|
|
51
51
|
isOptional: false;
|
|
52
52
|
};
|
|
53
53
|
assignedRole: {
|
|
54
|
-
type:
|
|
54
|
+
type: _lssm_lib_schema0.FieldType<string, string>;
|
|
55
55
|
isOptional: false;
|
|
56
56
|
};
|
|
57
57
|
}>>;
|
|
58
|
-
declare const KbReviewDecidedEvent:
|
|
58
|
+
declare const KbReviewDecidedEvent: _lssm_lib_contracts0.EventSpec<_lssm_lib_schema0.SchemaModel<{
|
|
59
59
|
reviewTaskId: {
|
|
60
|
-
type:
|
|
60
|
+
type: _lssm_lib_schema0.FieldType<string, string>;
|
|
61
61
|
isOptional: false;
|
|
62
62
|
};
|
|
63
63
|
decision: {
|
|
64
|
-
type:
|
|
64
|
+
type: _lssm_lib_schema0.FieldType<string, string>;
|
|
65
65
|
isOptional: false;
|
|
66
66
|
};
|
|
67
67
|
decidedBy: {
|
|
68
|
-
type:
|
|
68
|
+
type: _lssm_lib_schema0.FieldType<string, string>;
|
|
69
69
|
isOptional: false;
|
|
70
70
|
};
|
|
71
71
|
}>>;
|