@lssm/example.service-business-os 0.0.0-canary-20251217083314 → 0.0.0-canary-20251219202229
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/LICENSE +21 -0
- package/dist/client/client.contracts.d.ts +19 -18
- package/dist/client/client.contracts.d.ts.map +1 -0
- package/dist/client/client.contracts.js +2 -1
- package/dist/client/client.contracts.js.map +1 -0
- package/dist/client/client.schema.d.ts +18 -17
- package/dist/client/client.schema.d.ts.map +1 -0
- package/dist/client/client.schema.js +18 -19
- package/dist/client/client.schema.js.map +1 -0
- package/dist/docs/service-business-os.docblock.js +2 -1
- package/dist/docs/service-business-os.docblock.js.map +1 -0
- package/dist/entities/index.d.ts +157 -156
- package/dist/entities/index.d.ts.map +1 -0
- package/dist/entities/index.js +98 -98
- package/dist/entities/index.js.map +1 -0
- package/dist/events.d.ts +91 -90
- package/dist/events.d.ts.map +1 -0
- package/dist/events.js +32 -33
- package/dist/events.js.map +1 -0
- package/dist/example.d.ts +2 -1
- package/dist/example.d.ts.map +1 -0
- package/dist/example.js +2 -1
- package/dist/example.js.map +1 -0
- package/dist/handlers/index.d.ts +2 -1
- package/dist/handlers/index.d.ts.map +1 -0
- package/dist/handlers/index.js +2 -1
- package/dist/handlers/index.js.map +1 -0
- package/dist/invoice/invoice.contracts.d.ts +19 -18
- package/dist/invoice/invoice.contracts.d.ts.map +1 -0
- package/dist/invoice/invoice.contracts.js +2 -1
- package/dist/invoice/invoice.contracts.js.map +1 -0
- package/dist/invoice/invoice.schema.d.ts +18 -17
- package/dist/invoice/invoice.schema.d.ts.map +1 -0
- package/dist/invoice/invoice.schema.js +18 -19
- package/dist/invoice/invoice.schema.js.map +1 -0
- package/dist/job/job.contracts.d.ts +64 -63
- package/dist/job/job.contracts.d.ts.map +1 -0
- package/dist/job/job.contracts.js +10 -11
- package/dist/job/job.contracts.js.map +1 -0
- package/dist/job/job.schema.d.ts +22 -21
- package/dist/job/job.schema.d.ts.map +1 -0
- package/dist/job/job.schema.js +22 -23
- package/dist/job/job.schema.js.map +1 -0
- package/dist/libs/contracts/dist/capabilities/openbanking.js +2 -1
- package/dist/libs/contracts/dist/capabilities/openbanking.js.map +1 -0
- package/dist/libs/contracts/dist/contract-registry/schemas.js +2 -1
- package/dist/libs/contracts/dist/contract-registry/schemas.js.map +1 -0
- package/dist/libs/contracts/dist/docs/accessibility_wcag_compliance_specs.docblock.js +2 -1
- package/dist/libs/contracts/dist/docs/accessibility_wcag_compliance_specs.docblock.js.map +1 -0
- package/dist/libs/contracts/dist/docs/index.js +2 -6
- package/dist/libs/contracts/dist/docs/meta.docs.js +30 -0
- package/dist/libs/contracts/dist/docs/meta.docs.js.map +1 -0
- package/dist/libs/contracts/dist/docs/presentations.js +2 -1
- package/dist/libs/contracts/dist/docs/presentations.js.map +1 -0
- package/dist/libs/contracts/dist/docs/registry.js +2 -1
- package/dist/libs/contracts/dist/docs/registry.js.map +1 -0
- package/dist/libs/contracts/dist/docs/tech/auth/better-auth-nextjs.docblock.js +2 -1
- package/dist/libs/contracts/dist/docs/tech/auth/better-auth-nextjs.docblock.js.map +1 -0
- package/dist/libs/contracts/dist/docs/tech/contracts/openapi-export.docblock.js +2 -1
- package/dist/libs/contracts/dist/docs/tech/contracts/openapi-export.docblock.js.map +1 -0
- package/dist/libs/contracts/dist/docs/tech/lifecycle-stage-system.docblock.js +2 -1
- package/dist/libs/contracts/dist/docs/tech/lifecycle-stage-system.docblock.js.map +1 -0
- package/dist/libs/contracts/dist/docs/tech/llm/llm-integration.docblock.js +2 -1
- package/dist/libs/contracts/dist/docs/tech/llm/llm-integration.docblock.js.map +1 -0
- package/dist/libs/contracts/dist/docs/tech/mcp-endpoints.docblock.js +2 -1
- package/dist/libs/contracts/dist/docs/tech/mcp-endpoints.docblock.js.map +1 -0
- package/dist/libs/contracts/dist/docs/tech/presentation-runtime.docblock.js +2 -1
- package/dist/libs/contracts/dist/docs/tech/presentation-runtime.docblock.js.map +1 -0
- package/dist/libs/contracts/dist/docs/tech/schema/README.docblock.js +2 -1
- package/dist/libs/contracts/dist/docs/tech/schema/README.docblock.js.map +1 -0
- package/dist/libs/contracts/dist/docs/tech/studio/learning-events.docblock.js +2 -1
- package/dist/libs/contracts/dist/docs/tech/studio/learning-events.docblock.js.map +1 -0
- package/dist/libs/contracts/dist/docs/tech/studio/learning-journeys.docblock.js +2 -1
- package/dist/libs/contracts/dist/docs/tech/studio/learning-journeys.docblock.js.map +1 -0
- package/dist/libs/contracts/dist/docs/tech/studio/platform-admin-panel.docblock.js +2 -1
- package/dist/libs/contracts/dist/docs/tech/studio/platform-admin-panel.docblock.js.map +1 -0
- package/dist/libs/contracts/dist/docs/tech/studio/project-access-teams.docblock.js +2 -1
- package/dist/libs/contracts/dist/docs/tech/studio/project-access-teams.docblock.js.map +1 -0
- package/dist/libs/contracts/dist/docs/tech/studio/project-routing.docblock.js +2 -1
- package/dist/libs/contracts/dist/docs/tech/studio/project-routing.docblock.js.map +1 -0
- package/dist/libs/contracts/dist/docs/tech/studio/sandbox-unlogged.docblock.js +2 -1
- package/dist/libs/contracts/dist/docs/tech/studio/sandbox-unlogged.docblock.js.map +1 -0
- package/dist/libs/contracts/dist/docs/tech/studio/team-invitations.docblock.js +2 -1
- package/dist/libs/contracts/dist/docs/tech/studio/team-invitations.docblock.js.map +1 -0
- package/dist/libs/contracts/dist/docs/tech/studio/workspace-ops.docblock.js +2 -1
- package/dist/libs/contracts/dist/docs/tech/studio/workspace-ops.docblock.js.map +1 -0
- package/dist/libs/contracts/dist/docs/tech/studio/workspaces.docblock.js +2 -1
- package/dist/libs/contracts/dist/docs/tech/studio/workspaces.docblock.js.map +1 -0
- package/dist/libs/contracts/dist/docs/tech/telemetry-ingest.docblock.js +2 -1
- package/dist/libs/contracts/dist/docs/tech/telemetry-ingest.docblock.js.map +1 -0
- package/dist/libs/contracts/dist/docs/tech/templates/runtime.docblock.js +2 -1
- package/dist/libs/contracts/dist/docs/tech/templates/runtime.docblock.js.map +1 -0
- package/dist/libs/contracts/dist/docs/tech/vscode-extension.docblock.js +2 -1
- package/dist/libs/contracts/dist/docs/tech/vscode-extension.docblock.js.map +1 -0
- package/dist/libs/contracts/dist/docs/tech/workflows/overview.docblock.js +2 -1
- package/dist/libs/contracts/dist/docs/tech/workflows/overview.docblock.js.map +1 -0
- package/dist/libs/contracts/dist/docs/tech-contracts.docs.js +97 -0
- package/dist/libs/contracts/dist/docs/tech-contracts.docs.js.map +1 -0
- package/dist/libs/contracts/dist/events.js +2 -1
- package/dist/libs/contracts/dist/events.js.map +1 -0
- package/dist/libs/contracts/dist/index.js +2 -1
- package/dist/libs/contracts/dist/integrations/contracts.js +65 -66
- package/dist/libs/contracts/dist/integrations/contracts.js.map +1 -0
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/accounts.js +31 -32
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/accounts.js.map +1 -0
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/balances.js +18 -19
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/balances.js.map +1 -0
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/transactions.js +32 -33
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/transactions.js.map +1 -0
- package/dist/libs/contracts/dist/integrations/openbanking/models.js +60 -61
- package/dist/libs/contracts/dist/integrations/openbanking/models.js.map +1 -0
- package/dist/libs/contracts/dist/integrations/openbanking/telemetry.js +2 -1
- package/dist/libs/contracts/dist/integrations/openbanking/telemetry.js.map +1 -0
- package/dist/libs/contracts/dist/integrations/providers/elevenlabs.js +2 -1
- package/dist/libs/contracts/dist/integrations/providers/elevenlabs.js.map +1 -0
- package/dist/libs/contracts/dist/integrations/providers/gcs-storage.js +2 -1
- package/dist/libs/contracts/dist/integrations/providers/gcs-storage.js.map +1 -0
- package/dist/libs/contracts/dist/integrations/providers/gmail.js +2 -1
- package/dist/libs/contracts/dist/integrations/providers/gmail.js.map +1 -0
- package/dist/libs/contracts/dist/integrations/providers/google-calendar.js +2 -1
- package/dist/libs/contracts/dist/integrations/providers/google-calendar.js.map +1 -0
- package/dist/libs/contracts/dist/integrations/providers/mistral.js +2 -1
- package/dist/libs/contracts/dist/integrations/providers/mistral.js.map +1 -0
- package/dist/libs/contracts/dist/integrations/providers/postmark.js +2 -1
- package/dist/libs/contracts/dist/integrations/providers/postmark.js.map +1 -0
- package/dist/libs/contracts/dist/integrations/providers/powens.js +2 -1
- package/dist/libs/contracts/dist/integrations/providers/powens.js.map +1 -0
- package/dist/libs/contracts/dist/integrations/providers/qdrant.js +2 -1
- package/dist/libs/contracts/dist/integrations/providers/qdrant.js.map +1 -0
- package/dist/libs/contracts/dist/integrations/providers/stripe.js +2 -1
- package/dist/libs/contracts/dist/integrations/providers/stripe.js.map +1 -0
- package/dist/libs/contracts/dist/integrations/providers/twilio-sms.js +2 -1
- package/dist/libs/contracts/dist/integrations/providers/twilio-sms.js.map +1 -0
- package/dist/libs/contracts/dist/knowledge/contracts.js +44 -45
- package/dist/libs/contracts/dist/knowledge/contracts.js.map +1 -0
- package/dist/libs/contracts/dist/knowledge/spaces/email-threads.js +2 -1
- package/dist/libs/contracts/dist/knowledge/spaces/email-threads.js.map +1 -0
- package/dist/libs/contracts/dist/knowledge/spaces/financial-docs.js +2 -1
- package/dist/libs/contracts/dist/knowledge/spaces/financial-docs.js.map +1 -0
- package/dist/libs/contracts/dist/knowledge/spaces/financial-overview.js +2 -1
- package/dist/libs/contracts/dist/knowledge/spaces/financial-overview.js.map +1 -0
- package/dist/libs/contracts/dist/knowledge/spaces/product-canon.js +2 -1
- package/dist/libs/contracts/dist/knowledge/spaces/product-canon.js.map +1 -0
- package/dist/libs/contracts/dist/knowledge/spaces/support-faq.js +2 -1
- package/dist/libs/contracts/dist/knowledge/spaces/support-faq.js.map +1 -0
- package/dist/libs/contracts/dist/knowledge/spaces/uploaded-docs.js +2 -1
- package/dist/libs/contracts/dist/knowledge/spaces/uploaded-docs.js.map +1 -0
- package/dist/libs/contracts/dist/llm/exporters.js +2 -1
- package/dist/libs/contracts/dist/llm/exporters.js.map +1 -0
- package/dist/libs/contracts/dist/onboarding-base.js +22 -23
- package/dist/libs/contracts/dist/onboarding-base.js.map +1 -0
- package/dist/libs/contracts/dist/ownership.js +4 -2
- package/dist/libs/contracts/dist/ownership.js.map +1 -0
- package/dist/libs/contracts/dist/presentations.v2.js +2 -1
- package/dist/libs/contracts/dist/presentations.v2.js.map +1 -0
- package/dist/libs/contracts/dist/regenerator/service.js +2 -1
- package/dist/libs/contracts/dist/regenerator/service.js.map +1 -0
- package/dist/libs/contracts/dist/schema/dist/index.js +3873 -6
- package/dist/libs/contracts/dist/schema/dist/index.js.map +1 -0
- package/dist/libs/contracts/dist/spec.js +2 -1
- package/dist/libs/contracts/dist/spec.js.map +1 -0
- package/dist/libs/schema/dist/index.js +4889 -6
- package/dist/libs/schema/dist/index.js.map +1 -0
- package/dist/payment/payment.contracts.d.ts +18 -17
- package/dist/payment/payment.contracts.d.ts.map +1 -0
- package/dist/payment/payment.contracts.js +2 -1
- package/dist/payment/payment.contracts.js.map +1 -0
- package/dist/payment/payment.schema.d.ts +17 -16
- package/dist/payment/payment.schema.d.ts.map +1 -0
- package/dist/payment/payment.schema.js +17 -18
- package/dist/payment/payment.schema.js.map +1 -0
- package/dist/presentations/index.d.ts +2 -1
- package/dist/presentations/index.d.ts.map +1 -0
- package/dist/presentations/index.js +2 -1
- package/dist/presentations/index.js.map +1 -0
- package/dist/presentations.d.ts +2 -1
- package/dist/presentations.d.ts.map +1 -0
- package/dist/presentations.js +2 -1
- package/dist/presentations.js.map +1 -0
- package/dist/quote/quote.contracts.d.ts +37 -36
- package/dist/quote/quote.contracts.d.ts.map +1 -0
- package/dist/quote/quote.contracts.js +2 -1
- package/dist/quote/quote.contracts.js.map +1 -0
- package/dist/quote/quote.schema.d.ts +26 -25
- package/dist/quote/quote.schema.d.ts.map +1 -0
- package/dist/quote/quote.schema.js +26 -27
- package/dist/quote/quote.schema.js.map +1 -0
- package/dist/service.feature.d.ts +2 -1
- package/dist/service.feature.d.ts.map +1 -0
- package/dist/service.feature.js +2 -1
- package/dist/service.feature.js.map +1 -0
- package/package.json +13 -12
- package/dist/libs/contracts/dist/docs/PUBLISHING.docblock.js +0 -16
- 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/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 -34
- 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/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 -236
- package/dist/libs/schema/dist/entity/index.js +0 -2
- package/dist/libs/schema/dist/entity/types.js +0 -1
|
@@ -1,100 +1,101 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _lssm_lib_schema0 from "@lssm/lib.schema";
|
|
2
2
|
|
|
3
3
|
//#region src/quote/quote.schema.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* Quote/proposal.
|
|
6
6
|
*/
|
|
7
|
-
declare const QuoteModel:
|
|
7
|
+
declare const QuoteModel: _lssm_lib_schema0.SchemaModel<{
|
|
8
8
|
id: {
|
|
9
|
-
type:
|
|
9
|
+
type: _lssm_lib_schema0.FieldType<string, string>;
|
|
10
10
|
isOptional: false;
|
|
11
11
|
};
|
|
12
12
|
clientId: {
|
|
13
|
-
type:
|
|
13
|
+
type: _lssm_lib_schema0.FieldType<string, string>;
|
|
14
14
|
isOptional: false;
|
|
15
15
|
};
|
|
16
16
|
title: {
|
|
17
|
-
type:
|
|
17
|
+
type: _lssm_lib_schema0.FieldType<string, string>;
|
|
18
18
|
isOptional: false;
|
|
19
19
|
};
|
|
20
20
|
description: {
|
|
21
|
-
type:
|
|
21
|
+
type: _lssm_lib_schema0.FieldType<string, string>;
|
|
22
22
|
isOptional: true;
|
|
23
23
|
};
|
|
24
24
|
amount: {
|
|
25
|
-
type:
|
|
25
|
+
type: _lssm_lib_schema0.FieldType<number, number>;
|
|
26
26
|
isOptional: false;
|
|
27
27
|
};
|
|
28
28
|
currency: {
|
|
29
|
-
type:
|
|
29
|
+
type: _lssm_lib_schema0.FieldType<string, string>;
|
|
30
30
|
isOptional: false;
|
|
31
31
|
};
|
|
32
32
|
status: {
|
|
33
|
-
type:
|
|
33
|
+
type: _lssm_lib_schema0.FieldType<string, string>;
|
|
34
34
|
isOptional: false;
|
|
35
35
|
};
|
|
36
36
|
validUntil: {
|
|
37
|
-
type:
|
|
37
|
+
type: _lssm_lib_schema0.FieldType<Date, string>;
|
|
38
38
|
isOptional: true;
|
|
39
39
|
};
|
|
40
40
|
createdAt: {
|
|
41
|
-
type:
|
|
41
|
+
type: _lssm_lib_schema0.FieldType<Date, string>;
|
|
42
42
|
isOptional: false;
|
|
43
43
|
};
|
|
44
44
|
}>;
|
|
45
45
|
/**
|
|
46
46
|
* Input for creating a quote.
|
|
47
47
|
*/
|
|
48
|
-
declare const CreateQuoteInputModel:
|
|
48
|
+
declare const CreateQuoteInputModel: _lssm_lib_schema0.SchemaModel<{
|
|
49
49
|
clientId: {
|
|
50
|
-
type:
|
|
50
|
+
type: _lssm_lib_schema0.FieldType<string, string>;
|
|
51
51
|
isOptional: false;
|
|
52
52
|
};
|
|
53
53
|
title: {
|
|
54
|
-
type:
|
|
54
|
+
type: _lssm_lib_schema0.FieldType<string, string>;
|
|
55
55
|
isOptional: false;
|
|
56
56
|
};
|
|
57
57
|
description: {
|
|
58
|
-
type:
|
|
58
|
+
type: _lssm_lib_schema0.FieldType<string, string>;
|
|
59
59
|
isOptional: true;
|
|
60
60
|
};
|
|
61
61
|
amount: {
|
|
62
|
-
type:
|
|
62
|
+
type: _lssm_lib_schema0.FieldType<number, number>;
|
|
63
63
|
isOptional: false;
|
|
64
64
|
};
|
|
65
65
|
currency: {
|
|
66
|
-
type:
|
|
66
|
+
type: _lssm_lib_schema0.FieldType<string, string>;
|
|
67
67
|
isOptional: true;
|
|
68
68
|
};
|
|
69
69
|
validUntil: {
|
|
70
|
-
type:
|
|
70
|
+
type: _lssm_lib_schema0.FieldType<Date, string>;
|
|
71
71
|
isOptional: true;
|
|
72
72
|
};
|
|
73
73
|
orgId: {
|
|
74
|
-
type:
|
|
74
|
+
type: _lssm_lib_schema0.FieldType<string, string>;
|
|
75
75
|
isOptional: false;
|
|
76
76
|
};
|
|
77
77
|
ownerId: {
|
|
78
|
-
type:
|
|
78
|
+
type: _lssm_lib_schema0.FieldType<string, string>;
|
|
79
79
|
isOptional: false;
|
|
80
80
|
};
|
|
81
81
|
}>;
|
|
82
82
|
/**
|
|
83
83
|
* Input for accepting a quote.
|
|
84
84
|
*/
|
|
85
|
-
declare const AcceptQuoteInputModel:
|
|
85
|
+
declare const AcceptQuoteInputModel: _lssm_lib_schema0.SchemaModel<{
|
|
86
86
|
quoteId: {
|
|
87
|
-
type:
|
|
87
|
+
type: _lssm_lib_schema0.FieldType<string, string>;
|
|
88
88
|
isOptional: false;
|
|
89
89
|
};
|
|
90
90
|
acceptedBy: {
|
|
91
|
-
type:
|
|
91
|
+
type: _lssm_lib_schema0.FieldType<string, string>;
|
|
92
92
|
isOptional: false;
|
|
93
93
|
};
|
|
94
94
|
notes: {
|
|
95
|
-
type:
|
|
95
|
+
type: _lssm_lib_schema0.FieldType<string, string>;
|
|
96
96
|
isOptional: true;
|
|
97
97
|
};
|
|
98
98
|
}>;
|
|
99
99
|
//#endregion
|
|
100
|
-
export { AcceptQuoteInputModel, CreateQuoteInputModel, QuoteModel };
|
|
100
|
+
export { AcceptQuoteInputModel, CreateQuoteInputModel, QuoteModel };
|
|
101
|
+
//# sourceMappingURL=quote.schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"quote.schema.d.ts","names":[],"sources":["../../src/quote/quote.schema.ts"],"sourcesContent":[],"mappings":";;;;;;AAKa,cAAA,UAcX,oBAdqB,WAcrB,CAAA;EAAA,EAAA,EAAA;UAAA,iBAAA,CAAA;;;;;;;;;;;EAdqB,WAAA,EAAA;IAmBV,IAAA,6BAaX,CAAA,MAAA,EAAA,MAAA,CAAA;IAAA,UAAA,EAAA,IAAA;;;;;;;;;;EAbgC,MAAA,EAAA;IAkBrB,IAAA,6BAQX,CAAA,MAAA,EAAA,MAAA,CAAA;IAAA,UAAA,EAAA,KAAA;;;qCARgC,KAAA,EAAA,MAAA,CAAA;IAAA,UAAA,EAAA,IAAA;;;;;;;;;;cAlBrB,yCAAqB;;UAahC,iBAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAKW,yCAAqB;;UAQhC,iBAAA,CAAA"}
|
|
@@ -1,49 +1,47 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { defineSchemaModel } from "../libs/schema/dist/SchemaModel.js";
|
|
3
|
-
import "../libs/schema/dist/index.js";
|
|
1
|
+
import { E5, K5 } from "../libs/schema/dist/index.js";
|
|
4
2
|
|
|
5
3
|
//#region src/quote/quote.schema.ts
|
|
6
4
|
/**
|
|
7
5
|
* Quote/proposal.
|
|
8
6
|
*/
|
|
9
|
-
const QuoteModel =
|
|
7
|
+
const QuoteModel = K5({
|
|
10
8
|
name: "Quote",
|
|
11
9
|
description: "Quote/proposal",
|
|
12
10
|
fields: {
|
|
13
11
|
id: {
|
|
14
|
-
type:
|
|
12
|
+
type: E5.String_unsecure(),
|
|
15
13
|
isOptional: false
|
|
16
14
|
},
|
|
17
15
|
clientId: {
|
|
18
|
-
type:
|
|
16
|
+
type: E5.String_unsecure(),
|
|
19
17
|
isOptional: false
|
|
20
18
|
},
|
|
21
19
|
title: {
|
|
22
|
-
type:
|
|
20
|
+
type: E5.String_unsecure(),
|
|
23
21
|
isOptional: false
|
|
24
22
|
},
|
|
25
23
|
description: {
|
|
26
|
-
type:
|
|
24
|
+
type: E5.String_unsecure(),
|
|
27
25
|
isOptional: true
|
|
28
26
|
},
|
|
29
27
|
amount: {
|
|
30
|
-
type:
|
|
28
|
+
type: E5.Float_unsecure(),
|
|
31
29
|
isOptional: false
|
|
32
30
|
},
|
|
33
31
|
currency: {
|
|
34
|
-
type:
|
|
32
|
+
type: E5.String_unsecure(),
|
|
35
33
|
isOptional: false
|
|
36
34
|
},
|
|
37
35
|
status: {
|
|
38
|
-
type:
|
|
36
|
+
type: E5.String_unsecure(),
|
|
39
37
|
isOptional: false
|
|
40
38
|
},
|
|
41
39
|
validUntil: {
|
|
42
|
-
type:
|
|
40
|
+
type: E5.DateTime(),
|
|
43
41
|
isOptional: true
|
|
44
42
|
},
|
|
45
43
|
createdAt: {
|
|
46
|
-
type:
|
|
44
|
+
type: E5.DateTime(),
|
|
47
45
|
isOptional: false
|
|
48
46
|
}
|
|
49
47
|
}
|
|
@@ -51,40 +49,40 @@ const QuoteModel = defineSchemaModel({
|
|
|
51
49
|
/**
|
|
52
50
|
* Input for creating a quote.
|
|
53
51
|
*/
|
|
54
|
-
const CreateQuoteInputModel =
|
|
52
|
+
const CreateQuoteInputModel = K5({
|
|
55
53
|
name: "CreateQuoteInput",
|
|
56
54
|
description: "Input for creating a quote",
|
|
57
55
|
fields: {
|
|
58
56
|
clientId: {
|
|
59
|
-
type:
|
|
57
|
+
type: E5.String_unsecure(),
|
|
60
58
|
isOptional: false
|
|
61
59
|
},
|
|
62
60
|
title: {
|
|
63
|
-
type:
|
|
61
|
+
type: E5.String_unsecure(),
|
|
64
62
|
isOptional: false
|
|
65
63
|
},
|
|
66
64
|
description: {
|
|
67
|
-
type:
|
|
65
|
+
type: E5.String_unsecure(),
|
|
68
66
|
isOptional: true
|
|
69
67
|
},
|
|
70
68
|
amount: {
|
|
71
|
-
type:
|
|
69
|
+
type: E5.Float_unsecure(),
|
|
72
70
|
isOptional: false
|
|
73
71
|
},
|
|
74
72
|
currency: {
|
|
75
|
-
type:
|
|
73
|
+
type: E5.String_unsecure(),
|
|
76
74
|
isOptional: true
|
|
77
75
|
},
|
|
78
76
|
validUntil: {
|
|
79
|
-
type:
|
|
77
|
+
type: E5.DateTime(),
|
|
80
78
|
isOptional: true
|
|
81
79
|
},
|
|
82
80
|
orgId: {
|
|
83
|
-
type:
|
|
81
|
+
type: E5.String_unsecure(),
|
|
84
82
|
isOptional: false
|
|
85
83
|
},
|
|
86
84
|
ownerId: {
|
|
87
|
-
type:
|
|
85
|
+
type: E5.String_unsecure(),
|
|
88
86
|
isOptional: false
|
|
89
87
|
}
|
|
90
88
|
}
|
|
@@ -92,24 +90,25 @@ const CreateQuoteInputModel = defineSchemaModel({
|
|
|
92
90
|
/**
|
|
93
91
|
* Input for accepting a quote.
|
|
94
92
|
*/
|
|
95
|
-
const AcceptQuoteInputModel =
|
|
93
|
+
const AcceptQuoteInputModel = K5({
|
|
96
94
|
name: "AcceptQuoteInput",
|
|
97
95
|
description: "Input for accepting a quote",
|
|
98
96
|
fields: {
|
|
99
97
|
quoteId: {
|
|
100
|
-
type:
|
|
98
|
+
type: E5.String_unsecure(),
|
|
101
99
|
isOptional: false
|
|
102
100
|
},
|
|
103
101
|
acceptedBy: {
|
|
104
|
-
type:
|
|
102
|
+
type: E5.String_unsecure(),
|
|
105
103
|
isOptional: false
|
|
106
104
|
},
|
|
107
105
|
notes: {
|
|
108
|
-
type:
|
|
106
|
+
type: E5.String_unsecure(),
|
|
109
107
|
isOptional: true
|
|
110
108
|
}
|
|
111
109
|
}
|
|
112
110
|
});
|
|
113
111
|
|
|
114
112
|
//#endregion
|
|
115
|
-
export { AcceptQuoteInputModel, CreateQuoteInputModel, QuoteModel };
|
|
113
|
+
export { AcceptQuoteInputModel, CreateQuoteInputModel, QuoteModel };
|
|
114
|
+
//# sourceMappingURL=quote.schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"quote.schema.js","names":["defineSchemaModel","ScalarTypeEnum"],"sources":["../../src/quote/quote.schema.ts"],"sourcesContent":["import { defineSchemaModel, ScalarTypeEnum } from '@lssm/lib.schema';\n\n/**\n * Quote/proposal.\n */\nexport const QuoteModel = defineSchemaModel({\n name: 'Quote',\n description: 'Quote/proposal',\n fields: {\n id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n clientId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n title: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n amount: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },\n currency: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n status: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n validUntil: { type: ScalarTypeEnum.DateTime(), isOptional: true },\n createdAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n },\n});\n\n/**\n * Input for creating a quote.\n */\nexport const CreateQuoteInputModel = defineSchemaModel({\n name: 'CreateQuoteInput',\n description: 'Input for creating a quote',\n fields: {\n clientId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n title: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n amount: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },\n currency: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n validUntil: { type: ScalarTypeEnum.DateTime(), isOptional: true },\n orgId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n ownerId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n },\n});\n\n/**\n * Input for accepting a quote.\n */\nexport const AcceptQuoteInputModel = defineSchemaModel({\n name: 'AcceptQuoteInput',\n description: 'Input for accepting a quote',\n fields: {\n quoteId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n acceptedBy: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n notes: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n },\n});\n"],"mappings":";;;;;;AAKA,MAAa,aAAaA,GAAkB;CAC1C,MAAM;CACN,aAAa;CACb,QAAQ;EACN,IAAI;GAAE,MAAMC,GAAe,iBAAiB;GAAE,YAAY;GAAO;EACjE,UAAU;GAAE,MAAMA,GAAe,iBAAiB;GAAE,YAAY;GAAO;EACvE,OAAO;GAAE,MAAMA,GAAe,iBAAiB;GAAE,YAAY;GAAO;EACpE,aAAa;GAAE,MAAMA,GAAe,iBAAiB;GAAE,YAAY;GAAM;EACzE,QAAQ;GAAE,MAAMA,GAAe,gBAAgB;GAAE,YAAY;GAAO;EACpE,UAAU;GAAE,MAAMA,GAAe,iBAAiB;GAAE,YAAY;GAAO;EACvE,QAAQ;GAAE,MAAMA,GAAe,iBAAiB;GAAE,YAAY;GAAO;EACrE,YAAY;GAAE,MAAMA,GAAe,UAAU;GAAE,YAAY;GAAM;EACjE,WAAW;GAAE,MAAMA,GAAe,UAAU;GAAE,YAAY;GAAO;EAClE;CACF,CAAC;;;;AAKF,MAAa,wBAAwBD,GAAkB;CACrD,MAAM;CACN,aAAa;CACb,QAAQ;EACN,UAAU;GAAE,MAAMC,GAAe,iBAAiB;GAAE,YAAY;GAAO;EACvE,OAAO;GAAE,MAAMA,GAAe,iBAAiB;GAAE,YAAY;GAAO;EACpE,aAAa;GAAE,MAAMA,GAAe,iBAAiB;GAAE,YAAY;GAAM;EACzE,QAAQ;GAAE,MAAMA,GAAe,gBAAgB;GAAE,YAAY;GAAO;EACpE,UAAU;GAAE,MAAMA,GAAe,iBAAiB;GAAE,YAAY;GAAM;EACtE,YAAY;GAAE,MAAMA,GAAe,UAAU;GAAE,YAAY;GAAM;EACjE,OAAO;GAAE,MAAMA,GAAe,iBAAiB;GAAE,YAAY;GAAO;EACpE,SAAS;GAAE,MAAMA,GAAe,iBAAiB;GAAE,YAAY;GAAO;EACvE;CACF,CAAC;;;;AAKF,MAAa,wBAAwBD,GAAkB;CACrD,MAAM;CACN,aAAa;CACb,QAAQ;EACN,SAAS;GAAE,MAAMC,GAAe,iBAAiB;GAAE,YAAY;GAAO;EACtE,YAAY;GAAE,MAAMA,GAAe,iBAAiB;GAAE,YAAY;GAAO;EACzE,OAAO;GAAE,MAAMA,GAAe,iBAAiB;GAAE,YAAY;GAAM;EACpE;CACF,CAAC"}
|
|
@@ -3,4 +3,5 @@ import { FeatureModuleSpec } from "@lssm/lib.contracts";
|
|
|
3
3
|
//#region src/service.feature.d.ts
|
|
4
4
|
declare const ServiceBusinessFeature: FeatureModuleSpec;
|
|
5
5
|
//#endregion
|
|
6
|
-
export { ServiceBusinessFeature };
|
|
6
|
+
export { ServiceBusinessFeature };
|
|
7
|
+
//# sourceMappingURL=service.feature.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service.feature.d.ts","names":[],"sources":["../src/service.feature.ts"],"sourcesContent":[],"mappings":";;;cAEa,wBAAwB"}
|
package/dist/service.feature.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service.feature.js","names":["ServiceBusinessFeature: FeatureModuleSpec"],"sources":["../src/service.feature.ts"],"sourcesContent":["import type { FeatureModuleSpec } from '@lssm/lib.contracts';\n\nexport const ServiceBusinessFeature: FeatureModuleSpec = {\n meta: {\n key: 'service-business-os',\n title: 'Service Business OS',\n description:\n 'Quotes → jobs → invoices → payments for field services and agencies.',\n domain: 'services',\n owners: ['@service-os'],\n tags: ['services', 'quotes', 'jobs', 'invoices', 'payments'],\n stability: 'experimental',\n },\n operations: [\n { name: 'service.client.create', version: 1 },\n { name: 'service.quote.create', version: 1 },\n { name: 'service.quote.accept', version: 1 },\n { name: 'service.job.schedule', version: 1 },\n { name: 'service.job.complete', version: 1 },\n { name: 'service.invoice.issue', version: 1 },\n { name: 'service.payment.record', version: 1 },\n { name: 'service.job.list', version: 1 },\n ],\n events: [\n { name: 'service.quote.sent', version: 1 },\n { name: 'service.quote.accepted', version: 1 },\n { name: 'service.job.scheduled', version: 1 },\n { name: 'service.job.completed', version: 1 },\n { name: 'service.invoice.issued', version: 1 },\n { name: 'service.payment.received', version: 1 },\n ],\n presentations: [\n { name: 'service-business-os.dashboard', version: 1 },\n { name: 'service-business-os.client.list', version: 1 },\n { name: 'service-business-os.quote.list', version: 1 },\n { name: 'service-business-os.quote.detail', version: 1 },\n { name: 'service-business-os.job.board', version: 1 },\n { name: 'service-business-os.invoice.list', version: 1 },\n { name: 'service-business-os.payment.list', version: 1 },\n ],\n presentationsTargets: [\n {\n name: 'service-business-os.dashboard',\n version: 1,\n targets: ['react', 'markdown'],\n },\n {\n name: 'service-business-os.quote.list',\n version: 1,\n targets: ['react', 'markdown'],\n },\n {\n name: 'service-business-os.invoice.list',\n version: 1,\n targets: ['react', 'markdown'],\n },\n ],\n capabilities: {\n requires: [\n { key: 'identity', version: 1 },\n { key: 'audit-trail', version: 1 },\n { key: 'notifications', version: 1 },\n { key: 'files', version: 1 },\n ],\n provides: [\n { key: 'quotes', version: 1 },\n { key: 'jobs', version: 1 },\n { key: 'invoices', version: 1 },\n ],\n },\n};\n"],"mappings":";AAEA,MAAaA,yBAA4C;CACvD,MAAM;EACJ,KAAK;EACL,OAAO;EACP,aACE;EACF,QAAQ;EACR,QAAQ,CAAC,cAAc;EACvB,MAAM;GAAC;GAAY;GAAU;GAAQ;GAAY;GAAW;EAC5D,WAAW;EACZ;CACD,YAAY;EACV;GAAE,MAAM;GAAyB,SAAS;GAAG;EAC7C;GAAE,MAAM;GAAwB,SAAS;GAAG;EAC5C;GAAE,MAAM;GAAwB,SAAS;GAAG;EAC5C;GAAE,MAAM;GAAwB,SAAS;GAAG;EAC5C;GAAE,MAAM;GAAwB,SAAS;GAAG;EAC5C;GAAE,MAAM;GAAyB,SAAS;GAAG;EAC7C;GAAE,MAAM;GAA0B,SAAS;GAAG;EAC9C;GAAE,MAAM;GAAoB,SAAS;GAAG;EACzC;CACD,QAAQ;EACN;GAAE,MAAM;GAAsB,SAAS;GAAG;EAC1C;GAAE,MAAM;GAA0B,SAAS;GAAG;EAC9C;GAAE,MAAM;GAAyB,SAAS;GAAG;EAC7C;GAAE,MAAM;GAAyB,SAAS;GAAG;EAC7C;GAAE,MAAM;GAA0B,SAAS;GAAG;EAC9C;GAAE,MAAM;GAA4B,SAAS;GAAG;EACjD;CACD,eAAe;EACb;GAAE,MAAM;GAAiC,SAAS;GAAG;EACrD;GAAE,MAAM;GAAmC,SAAS;GAAG;EACvD;GAAE,MAAM;GAAkC,SAAS;GAAG;EACtD;GAAE,MAAM;GAAoC,SAAS;GAAG;EACxD;GAAE,MAAM;GAAiC,SAAS;GAAG;EACrD;GAAE,MAAM;GAAoC,SAAS;GAAG;EACxD;GAAE,MAAM;GAAoC,SAAS;GAAG;EACzD;CACD,sBAAsB;EACpB;GACE,MAAM;GACN,SAAS;GACT,SAAS,CAAC,SAAS,WAAW;GAC/B;EACD;GACE,MAAM;GACN,SAAS;GACT,SAAS,CAAC,SAAS,WAAW;GAC/B;EACD;GACE,MAAM;GACN,SAAS;GACT,SAAS,CAAC,SAAS,WAAW;GAC/B;EACF;CACD,cAAc;EACZ,UAAU;GACR;IAAE,KAAK;IAAY,SAAS;IAAG;GAC/B;IAAE,KAAK;IAAe,SAAS;IAAG;GAClC;IAAE,KAAK;IAAiB,SAAS;IAAG;GACpC;IAAE,KAAK;IAAS,SAAS;IAAG;GAC7B;EACD,UAAU;GACR;IAAE,KAAK;IAAU,SAAS;IAAG;GAC7B;IAAE,KAAK;IAAQ,SAAS;IAAG;GAC3B;IAAE,KAAK;IAAY,SAAS;IAAG;GAChC;EACF;CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lssm/example.service-business-os",
|
|
3
|
-
"version": "0.0.0-canary-
|
|
3
|
+
"version": "0.0.0-canary-20251219202229",
|
|
4
4
|
"description": "Service Business OS example (clients, quotes, jobs, invoices) for ContractSpec",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -18,19 +18,19 @@
|
|
|
18
18
|
"lint:check": "eslint src"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@lssm/lib.schema": "0.0.0-canary-
|
|
22
|
-
"@lssm/lib.contracts": "0.0.0-canary-
|
|
23
|
-
"@lssm/lib.bus": "0.0.0-canary-
|
|
24
|
-
"@lssm/lib.identity-rbac": "0.0.0-canary-
|
|
25
|
-
"@lssm/lib.files": "0.0.0-canary-
|
|
26
|
-
"@lssm/lib.jobs": "0.0.0-canary-
|
|
27
|
-
"@lssm/module.audit-trail": "0.0.0-canary-
|
|
28
|
-
"@lssm/module.notifications": "0.0.0-canary-
|
|
21
|
+
"@lssm/lib.schema": "0.0.0-canary-20251219202229",
|
|
22
|
+
"@lssm/lib.contracts": "0.0.0-canary-20251219202229",
|
|
23
|
+
"@lssm/lib.bus": "0.0.0-canary-20251219202229",
|
|
24
|
+
"@lssm/lib.identity-rbac": "0.0.0-canary-20251219202229",
|
|
25
|
+
"@lssm/lib.files": "0.0.0-canary-20251219202229",
|
|
26
|
+
"@lssm/lib.jobs": "0.0.0-canary-20251219202229",
|
|
27
|
+
"@lssm/module.audit-trail": "0.0.0-canary-20251219202229",
|
|
28
|
+
"@lssm/module.notifications": "0.0.0-canary-20251219202229",
|
|
29
29
|
"zod": "^4.1.13"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@lssm/tool.typescript": "0.0.0-canary-
|
|
33
|
-
"@lssm/tool.tsdown": "0.0.0-canary-
|
|
32
|
+
"@lssm/tool.typescript": "0.0.0-canary-20251219202229",
|
|
33
|
+
"@lssm/tool.tsdown": "0.0.0-canary-20251219202229",
|
|
34
34
|
"typescript": "^5.9.3"
|
|
35
35
|
},
|
|
36
36
|
"exports": {
|
|
@@ -96,5 +96,6 @@
|
|
|
96
96
|
"./service.feature": "./dist/service.feature.js",
|
|
97
97
|
"./*": "./*"
|
|
98
98
|
}
|
|
99
|
-
}
|
|
99
|
+
},
|
|
100
|
+
"license": "MIT"
|
|
100
101
|
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { registerDocBlocks } from "./registry.js";
|
|
2
|
-
|
|
3
|
-
//#region ../../libs/contracts/dist/docs/PUBLISHING.docblock.js
|
|
4
|
-
const PUBLISHING_DocBlocks = [{
|
|
5
|
-
id: "docs.PUBLISHING",
|
|
6
|
-
title: "Publishing ContractSpec Libraries",
|
|
7
|
-
summary: "This guide describes how we release the ContractSpec libraries to npm. We use a dual-track release system: **Stable** (manual) and **Canary** (automatic).",
|
|
8
|
-
kind: "reference",
|
|
9
|
-
visibility: "public",
|
|
10
|
-
route: "/docs/PUBLISHING",
|
|
11
|
-
tags: ["PUBLISHING"],
|
|
12
|
-
body: "# Publishing ContractSpec Libraries\n\nThis guide describes how we release the ContractSpec libraries to npm. We use a dual-track release system: **Stable** (manual) and **Canary** (automatic).\n\n## Release Tracks\n\n| Track | Branch | npm Tag | Frequency | Versioning | Use Case |\n|-------|--------|---------|-----------|------------|----------|\n| **Stable** | `release` | `latest` | Manual | SemVer (e.g., `1.7.4`) | Production, external users |\n| **Canary** | `main` | `canary` | Every Push | Snapshot (e.g., `1.7.4-canary...`) | Dev, internal testing |\n\n## Prerequisites\n\n- ✅ `NPM_TOKEN` secret is configured in GitHub (owner or automation token with _publish_ scope).\n- ✅ `GITHUB_TOKEN` (built-in) has permissions to create PRs (enabled by default in new repos).\n- ✅ For stable releases: `release` branch exists and is protected.\n\n## Canary Workflow (Automatic)\n\nEvery commit pushed to `main` triggers the `.github/workflows/publish-canary.yml` workflow.\n\n1. **Trigger**: Push to `main`.\n2. **Versioning**: Runs `changeset version --snapshot canary` to generate a temporary snapshot version.\n3. **Publish**: Packages are published to npm with the `canary` tag using `changeset publish --tag canary`.\n\n### Consuming Canary Builds\n\nTo install the latest bleeding-edge version:\n\n```bash\nnpm install @lssm/lib.contracts@canary\n# or\nbun add @lssm/lib.contracts@canary\n```\n\n## Stable Release Workflow (Manual)\n\nStable releases are managed via the `release` branch using the standard [Changesets Action](https://github.com/changesets/action).\n\n1. **Develop on `main`**: Create features and fixes.\n2. **Add Changesets**: Run `bun changeset` to document changes and impact (major/minor/patch).\n3. **Merge to `release`**: When ready to ship, open a PR from `main` to `release` or merge manually.\n4. **\"Version Packages\" PR**:\n - The GitHub Action detects new changesets and automatically creates a Pull Request titled **\"Version Packages\"**.\n - This PR contains the version bumps and updated `CHANGELOG.md` files.\n5. **Merge & Publish**:\n - Review and merge the \"Version Packages\" PR.\n - The Action runs again, detects the versions have been bumped, builds the libraries, and publishes them to npm with the `latest` tag.\n\n### Publishing Steps\n\n1. Ensure all changesets are present on `main`.\n2. Merge `main` into `release`:\n ```bash\n git checkout release\n git pull origin release\n git merge main\n git push origin release\n ```\n3. Go to GitHub Pull Requests. You will see a **\"Version Packages\"** PR created by the bot.\n4. Merge that PR.\n5. The release is now live on npm!\n\n## Manual Verification (Optional)\n\nBefore publishing a new version you can run:\n\n```bash\nbun run build:not-apps\nnpx npm-packlist --json packages/libs/contracts\n```\n\n## Rollback\n\nIf a publish fails mid-way, re-run the workflow once the issue is fixed. Already published packages are skipped automatically. Use `npm deprecate <package>@<version>` if we need to warn consumers about a broken release.\n"
|
|
13
|
-
}];
|
|
14
|
-
registerDocBlocks(PUBLISHING_DocBlocks);
|
|
15
|
-
|
|
16
|
-
//#endregion
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { registerDocBlocks } from "../registry.js";
|
|
2
|
-
|
|
3
|
-
//#region ../../libs/contracts/dist/docs/tech/PHASE_1_QUICKSTART.docblock.js
|
|
4
|
-
const tech_PHASE_1_QUICKSTART_DocBlocks = [{
|
|
5
|
-
id: "docs.tech.PHASE_1_QUICKSTART",
|
|
6
|
-
title: "Phase 1: API Reference Index",
|
|
7
|
-
summary: "Quick reference for all new Phase 1 APIs.",
|
|
8
|
-
kind: "reference",
|
|
9
|
-
visibility: "public",
|
|
10
|
-
route: "/docs/tech/PHASE_1_QUICKSTART",
|
|
11
|
-
tags: ["tech", "PHASE_1_QUICKSTART"],
|
|
12
|
-
body: "# Phase 1: API Reference Index\n\nQuick reference for all new Phase 1 APIs.\n\n---\n\n## @lssm/lib.multi-tenancy\n\n### RLS\n```typescript\nimport { createRlsMiddleware, type TenantIdProvider } from '@lssm/lib.multi-tenancy/rls';\n```\n\n### Provisioning\n```typescript\nimport { \n TenantProvisioningService,\n type CreateTenantInput,\n type TenantProvisioningConfig \n} from '@lssm/lib.multi-tenancy/provisioning';\n```\n\n### Isolation\n```typescript\nimport { IsolationValidator } from '@lssm/lib.multi-tenancy/isolation';\n```\n\n---\n\n## @lssm/lib.observability\n\n### Tracing\n```typescript\nimport { \n getTracer,\n traceAsync,\n traceSync,\n createTracingMiddleware \n} from '@lssm/lib.observability/tracing';\n```\n\n### Metrics\n```typescript\nimport {\n getMeter,\n createCounter,\n createUpDownCounter,\n createHistogram,\n standardMetrics\n} from '@lssm/lib.observability/metrics';\n```\n\n### Logging\n```typescript\nimport {\n Logger,\n logger,\n type LogLevel,\n type LogEntry\n} from '@lssm/lib.observability/logging';\n```\n\n---\n\n## @lssm/lib.resilience\n\n### Circuit Breaker\n```typescript\nimport {\n CircuitBreaker,\n type CircuitState,\n type CircuitBreakerConfig\n} from '@lssm/lib.resilience/circuit-breaker';\n```\n\n### Retry\n```typescript\nimport { retry } from '@lssm/lib.resilience/retry';\n```\n\n### Timeout\n```typescript\nimport { timeout } from '@lssm/lib.resilience/timeout';\n```\n\n### Fallback\n```typescript\nimport { fallback } from '@lssm/lib.resilience/fallback';\n```\n\n---\n\n## Enhanced: @lssm/lib.contracts\n\n### DataViews\n```typescript\nimport { DataViewQueryGenerator } from '@lssm/lib.contracts/data-views/query-generator';\nimport { DataViewRuntime } from '@lssm/lib.contracts/data-views/runtime';\n```\n\n### Workflows\n```typescript\nimport { SLAMonitor, type SLABreachEvent } from '@lssm/lib.contracts/workflow/sla-monitor';\nimport { PrismaStateStore } from '@lssm/lib.contracts/workflow/adapters/db-adapter';\n```\n\n---\n\n## Enhanced: @lssm/lib.design-system\n\n### DataView Components\n```typescript\nimport { DataViewRenderer } from '@lssm/lib.design-system/components/data-view/DataViewRenderer';\n// Also available: DataViewList, DataViewTable, DataViewDetail\n```\n\n---\n\n## Usage Examples\n\n### Complete Workflow with All Features\n\n```typescript\nimport { WorkflowRunner } from '@lssm/lib.contracts/workflow/runner';\nimport { PrismaStateStore } from '@lssm/lib.contracts/workflow/adapters/db-adapter';\nimport { SLAMonitor } from '@lssm/lib.contracts/workflow/sla-monitor';\nimport { CircuitBreaker } from '@lssm/lib.resilience/circuit-breaker';\nimport { traceAsync } from '@lssm/lib.observability/tracing';\n\nconst runner = new WorkflowRunner({\n registry,\n stateStore: new PrismaStateStore(db),\n opExecutor: async (op, input, ctx) => {\n return traceAsync(`op.${op.name}`, async (span) => {\n span.setAttribute('operation', op.name);\n const breaker = getCircuitBreaker(op.name);\n return breaker.execute(() => executeOperation(op, input, ctx));\n });\n },\n eventEmitter: (event, payload) => {\n if (event.startsWith('workflow.')) {\n logger.info(event, payload);\n }\n },\n});\n\nconst monitor = new SLAMonitor((event, payload) => {\n logger.warn('SLA_BREACH', payload);\n alertOps(payload);\n});\n\n// Start workflow\nconst workflowId = await runner.start('payment.flow', 1);\n\n// Monitor SLA\nconst state = await runner.getState(workflowId);\nconst spec = registry.get('payment.flow', 1);\nmonitor.check(state, spec!);\n```\n\n### Complete DataView with Observability\n\n```typescript\nimport { DataViewRenderer } from '@lssm/lib.design-system';\nimport { DataViewQueryGenerator } from '@lssm/lib.contracts/data-views/query-generator';\nimport { traceAsync } from '@lssm/lib.observability/tracing';\nimport { MyDataView } from './specs/users.data-view';\n\nexport function UserListPage() {\n const [page, setPage] = useState(1);\n const [users, setUsers] = useState([]);\n\n const loadUsers = async () => {\n return traceAsync('load_users', async (span) => {\n const generator = new DataViewQueryGenerator(MyDataView);\n const query = generator.generate({ pagination: { page, pageSize: 20 } });\n \n span.setAttribute('page', page);\n const result = await api.execute(query);\n setUsers(result.data);\n });\n };\n\n return (\n <DataViewRenderer\n spec={MyDataView}\n items={users}\n pagination={{ page, pageSize: 20, total: users.length }}\n onPageChange={setPage}\n />\n );\n}\n```\n\n### Complete Multi-Tenant Setup\n\n```typescript\n// 1. RLS Middleware\nimport { createRlsMiddleware } from '@lssm/lib.multi-tenancy/rls';\ndb.$use(createRlsMiddleware(() => req.tenantId));\n\n// 2. Tenant Provisioning\nimport { TenantProvisioningService } from '@lssm/lib.multi-tenancy/provisioning';\nconst service = new TenantProvisioningService({ db });\n\n// 3. Create new tenant\nawait service.provision({\n id: 'acme',\n name: 'Acme Corp',\n slug: 'acme',\n ownerEmail: 'admin@acme.com',\n});\n\n// 4. Validate isolation in tests\nimport { IsolationValidator } from '@lssm/lib.multi-tenancy/isolation';\n\ntest('queries are isolated', () => {\n const isValid = IsolationValidator.validateQuery(\n 'User',\n 'findMany',\n { where: { tenantId: 'acme' } },\n 'acme'\n );\n expect(isValid).toBe(true);\n});\n```\n\n---\n\n## Testing\n\n### Test Circuit Breakers\n\n```typescript\nimport { CircuitBreaker } from '@lssm/lib.resilience/circuit-breaker';\n\ntest('circuit opens after threshold', async () => {\n const breaker = new CircuitBreaker({\n failureThreshold: 3,\n resetTimeoutMs: 5000,\n });\n\n // Trigger failures\n for (let i = 0; i < 3; i++) {\n await expect(\n breaker.execute(() => Promise.reject('error'))\n ).rejects.toThrow();\n }\n\n // Circuit should be open\n await expect(\n breaker.execute(() => Promise.resolve('ok'))\n ).rejects.toThrow('CircuitBreaker is OPEN');\n});\n```\n\n### Test Workflow Retry\n\n```typescript\ntest('workflow retries on failure', async () => {\n let attempts = 0;\n const opExecutor = async () => {\n attempts++;\n if (attempts < 3) throw new Error('fail');\n return 'success';\n };\n\n const runner = new WorkflowRunner({ /* ... */ opExecutor });\n await runner.executeStep(workflowId);\n \n expect(attempts).toBe(3);\n});\n```\n\n---\n\n## Common Patterns\n\n### Pattern: Resilient External Call\n\n```typescript\nimport { CircuitBreaker } from '@lssm/lib.resilience/circuit-breaker';\nimport { retry } from '@lssm/lib.resilience/retry';\nimport { timeout } from '@lssm/lib.resilience/timeout';\nimport { traceAsync } from '@lssm/lib.observability/tracing';\n\nconst breaker = new CircuitBreaker({ failureThreshold: 5, resetTimeoutMs: 30000 });\n\nexport async function callExternalAPI(input: any) {\n return traceAsync('external_api_call', async (span) => {\n span.setAttribute('service', 'stripe');\n \n return breaker.execute(() =>\n retry(\n () => timeout(() => stripe.api.call(input), 5000),\n 3,\n 1000,\n true\n )\n );\n });\n}\n```\n\n**Benefits**: Circuit breaker + retry + timeout + tracing in one place.\n\n---\n\n### Pattern: Tenant-Aware Operation\n\n```typescript\nimport { traceAsync } from '@lssm/lib.observability/tracing';\n\nexport async function listUsers(tenantId: string) {\n return traceAsync('list_users', async (span) => {\n span.setAttribute('tenant_id', tenantId);\n \n // RLS middleware will inject WHERE tenantId = ?\n return db.user.findMany();\n });\n}\n```\n\n---\n\n### Pattern: Monitored Workflow\n\n```typescript\nimport { WorkflowRunner } from '@lssm/lib.contracts/workflow/runner';\nimport { SLAMonitor } from '@lssm/lib.contracts/workflow/sla-monitor';\nimport { logger } from '@lssm/lib.observability/logging';\n\nconst monitor = new SLAMonitor((event, payload) => {\n logger.warn('workflow.sla_breach', payload);\n});\n\n// In workflow poller\nconst state = await runner.getState(workflowId);\nconst spec = registry.get(state.workflowName, state.workflowVersion);\nif (spec) {\n monitor.check(state, spec);\n}\n```\n\n---\n\n## Next Steps\n\n1. **Implement one quick win** (30 minutes)\n2. **Add tests for new functionality** (1 hour)\n3. **Deploy to staging and verify observability** (1 hour)\n4. **Roll out to production** (monitor closely)\n5. **Read full documentation** at https://contractspec.lssm.tech/docs\n\n---\n\n**Questions?** See `/docs/guides/phase-1-migration` or reach out via https://contractspec.lssm.tech/contact\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"
|
|
13
|
-
}];
|
|
14
|
-
registerDocBlocks(tech_PHASE_1_QUICKSTART_DocBlocks);
|
|
15
|
-
|
|
16
|
-
//#endregion
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { registerDocBlocks } from "../registry.js";
|
|
2
|
-
|
|
3
|
-
//#region ../../libs/contracts/dist/docs/tech/PHASE_2_AI_NATIVE_OPERATIONS.docblock.js
|
|
4
|
-
const tech_PHASE_2_AI_NATIVE_OPERATIONS_DocBlocks = [{
|
|
5
|
-
id: "docs.tech.PHASE_2_AI_NATIVE_OPERATIONS",
|
|
6
|
-
title: "Phase 2: AI-Native Operations",
|
|
7
|
-
summary: "_Last updated: 2025-11-20_",
|
|
8
|
-
kind: "reference",
|
|
9
|
-
visibility: "public",
|
|
10
|
-
route: "/docs/tech/PHASE_2_AI_NATIVE_OPERATIONS",
|
|
11
|
-
tags: ["tech", "PHASE_2_AI_NATIVE_OPERATIONS"],
|
|
12
|
-
body: "# Phase 2: AI-Native Operations\n\n_Last updated: 2025-11-20_\n\nPhase 2 turns ContractSpec into an AI-first operations stack. The new libraries below are the building blocks used by support bots, growth agents, and human-in-the-loop flows.\n\n## Libraries\n\n### @lssm/lib.ai-agent\n\n- **Spec + Registry**: `defineAgent`, `AgentRegistry` keep agent definitions type-safe.\n- **Runner**: `AgentRunner` drives LLM conversations, tool calls, retries, escalation, and telemetry hooks.\n- **Tools**: `ToolExecutor` standardizes schema validation + timeouts.\n- **Memory**: `InMemoryAgentMemory` + interfaces for plugging persistent stores.\n- **Approvals**: new `ApprovalWorkflow` + `InMemoryApprovalStore` capture low-confidence decisions and surface them to reviewers.\n\n### @lssm/lib.support-bot\n\nComposable support automation primitives:\n\n- `TicketClassifier` → heuristics + optional LLM validation for category, priority, sentiment.\n- `TicketResolver` → RAG pipeline backed by knowledge spaces.\n- `AutoResponder` → tone-aware drafts with citations.\n- `SupportFeedbackLoop` → tracks resolution rates.\n- `createSupportTools` → ready-made tool definitions for AgentRunner.\n\n### @lssm/lib.content-gen\n\nContent generators that consume a `ContentBrief` and output production-ready assets:\n\n- `BlogGenerator`, `LandingPageGenerator`, `EmailCampaignGenerator`, `SocialPostGenerator`.\n- `SeoOptimizer` builds metadata + schema markup.\n\n### @lssm/lib.analytics\n\nQueryless analytics helpers:\n\n- `FunnelAnalyzer` – conversion/drop-off per step.\n- `CohortTracker` – retention + LTV per cohort.\n- `ChurnPredictor` – recency/frequency/error scoring.\n- `GrowthHypothesisGenerator` – surfaces experiment ideas from metric trends.\n\n### @lssm/lib.growth\n\nA/B testing toolkit:\n\n- `ExperimentRegistry` + `ExperimentRunner` – deterministic bucketing.\n- `ExperimentTracker` – persist exposures + metrics.\n- `StatsEngine` – Welch’s t-test + improvement calculations.\n\n### Human-in-the-loop UI\n\n`@lssm/lib.design-system` now exposes:\n\n- `ApprovalQueue` – list + act on pending approvals.\n- `AgentMonitor` – live view of agent sessions with confidence + status.\n\n## Examples\n\n- `examples/ai-support-bot/setup.ts` shows ticket classification → resolution → response draft.\n- `examples/content-generation/generate.ts` produces blog, landing, email, social, SEO output from one brief.\n\n## Next Steps\n\n1. Wire these libraries into vertical apps (H-Circle, ArtisanOS, etc.).\n2. Add background workers that consume the new analytics/growth trackers.\n3. Expand web-landing to highlight these Phase 2 capabilities (see separate TODO).\n"
|
|
13
|
-
}];
|
|
14
|
-
registerDocBlocks(tech_PHASE_2_AI_NATIVE_OPERATIONS_DocBlocks);
|
|
15
|
-
|
|
16
|
-
//#endregion
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { registerDocBlocks } from "../registry.js";
|
|
2
|
-
|
|
3
|
-
//#region ../../libs/contracts/dist/docs/tech/PHASE_3_AUTO_EVOLUTION.docblock.js
|
|
4
|
-
const tech_PHASE_3_AUTO_EVOLUTION_DocBlocks = [{
|
|
5
|
-
id: "docs.tech.PHASE_3_AUTO_EVOLUTION",
|
|
6
|
-
title: "Phase 3: Auto-Evolution Technical Notes",
|
|
7
|
-
summary: "**Status**: In progress",
|
|
8
|
-
kind: "reference",
|
|
9
|
-
visibility: "public",
|
|
10
|
-
route: "/docs/tech/PHASE_3_AUTO_EVOLUTION",
|
|
11
|
-
tags: ["tech", "PHASE_3_AUTO_EVOLUTION"],
|
|
12
|
-
body: "# Phase 3: Auto-Evolution Technical Notes\n\n**Status**: In progress \n**Last updated**: 2025-11-21 \n\nPhase 3 introduces self-learning capabilities that analyze production telemetry, suggest new specs, safely roll out variants, and generate golden tests from real traffic. This document captures the main building blocks delivered in this iteration.\n\n---\n\n## 1. Libraries\n\n### @lssm/lib.evolution\n\n- `SpecAnalyzer` converts raw telemetry samples into usage stats + anomalies.\n- `SpecGenerator` produces `SpecSuggestion` objects and validates confidence thresholds.\n- `SpecSuggestionOrchestrator` routes proposals through the AI approval workflow and writes approved specs to `packages/libs/contracts/src/generated`.\n- Storage adapters:\n - `InMemorySpecSuggestionRepository` for tests.\n - `PrismaSpecSuggestionRepository` persists to the new Prisma model (see §4).\n - `FileSystemSuggestionWriter` emits JSON envelopes for git review.\n\n### @lssm/lib.observability\n\n- Added intent detection modules:\n - `IntentAggregator` batches telemetry into rolling windows.\n - `IntentDetector` surfaces latency/error/throughput regressions and sequential intents.\n- `EvolutionPipeline` orchestrates aggregation → detection → intent events and exposes hooks for downstream orchestrators.\n- `createTracingMiddleware` now accepts `resolveOperation`/`onSample` hooks to feed telemetry samples into the pipeline.\n\n### @lssm/lib.growth\n\n- New `spec-experiments` module:\n - `SpecExperimentRegistry`, `SpecExperimentRunner`, `SpecExperimentAdapter`.\n - `SpecExperimentAnalyzer` + `SpecExperimentController` handle guardrails and staged rollouts.\n - Helper `createSpecVariantResolver` plugs directly into `HandlerCtx.specVariantResolver`.\n- `SpecVariantResolver` is now a first-class concept in `@lssm/lib.contracts`. The runtime will attempt to execute variant specs before falling back to the registered handler.\n\n### @lssm/lib.testing\n\n- `TrafficRecorder` + `TrafficStore` capture production requests with sampling and sanitization hooks.\n- `GoldenTestGenerator` converts `TrafficSnapshot`s into Vitest/Jest suites.\n- `generateVitestSuite` / `generateJestSuite` output self-contained test files, and `runGoldenTests` offers a programmatic harness for CI pipelines.\n\n---\n\n## 2. Telemetry → Intent → Spec Pipeline\n\n1. `createTracingMiddleware({ onSample })` emits `TelemetrySample`s for every HTTP request.\n2. `IntentAggregator` groups samples into statistical windows (default 15 minutes).\n3. `IntentDetector` raises signals for:\n - Error spikes\n - Latency regressions\n - Throughput drops\n - Sequential workflows that hint at missing specs\n4. `EvolutionPipeline` emits `intent.detected` events and hands them to `SpecGenerator`.\n5. `SpecSuggestionOrchestrator` persists suggestions, triggers approval workflows, and—upon approval—writes JSON envelopes to `packages/.../contracts/src/generated`.\n\n---\n\n## 3. Spec Experiments & Rollouts\n\n1. Register spec experiments in `SpecExperimentRegistry` with control + variant bindings.\n2. Expose bucketed specs by attaching `createSpecVariantResolver` to `HandlerCtx.specVariantResolver` inside adapters.\n3. Record outcomes via `SpecExperimentAdapter.trackOutcome()` (latency + error metrics).\n4. `SpecExperimentController` uses guardrails from config and `SpecExperimentAnalyzer` to:\n - Auto-rollback on error/latency breaches.\n - Advance rollout stages (1% → 10% → 50% → 100%) when metrics stay green.\n\n---\n\n## 4. Data Models (Prisma)\n\nFile: `packages/libs/database/prisma/schema.prisma`\n\n- `SpecSuggestion` – stores serialized suggestion payloads + statuses.\n- `IntentSnapshot` – captured detector output for auditing/training.\n- `TrafficSnapshot` – persisted production traffic (input/output/error blobs).\n- `SpecExperiment` / `SpecExperimentMetric` – rollout state + metrics for each variant.\n\n> Run `bun database generate` after pulling to refresh the Prisma client.\n\n---\n\n## 5. Golden Test Workflow\n\n1. Capture traffic via middleware or direct `TrafficRecorder.record`.\n2. Use the new CLI command to materialize suites:\n\n```bash\ncontractspec test generate \\\n --operation billing.createInvoice \\\n --output tests/billing.createInvoice.golden.test.ts \\\n --runner-import ./tests/run-operation \\\n --runner-fn runBillingCommand \\\n --from-production \\\n --days 7 \\\n --sample-rate 0.05\n```\n\n3. Generated files import your runner and assert against recorded outputs (or expected errors for negative paths).\n\n---\n\n## 6. Operational Notes\n\n- **Approvals**: By default, every suggestion still requires human approval. `EvolutionConfig.autoApproveThreshold` can be tuned per environment but should remain conservative (<0.3) until OverlaySpec tooling lands.\n- **Sampling**: Keep `TrafficRecorder.sampleRate` ≤ 0.05 in production to avoid sensitive payload storage; scrub PII through the `sanitize` callback before persistence.\n- **Rollouts**: Guardrails default to 5% error-rate and 750ms P99 latency. Override per experiment to match SLOs.\n\n---\n\n## 7. Next Steps\n\n1. Wire `SpecExperimentAdapter.trackOutcome` into adapters (REST, GraphQL, Workers) so every execution logs metrics automatically.\n2. Add a UI for reviewing `SpecSuggestion` objects alongside approval status.\n3. Expand `TrafficRecorder` to ship directly to the Prisma-backed store (currently in-memory by default).\n4. Integrate `EvolutionPipeline` events with the Regenerator to close the loop (auto-open proposals + attach evidence).\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"
|
|
13
|
-
}];
|
|
14
|
-
registerDocBlocks(tech_PHASE_3_AUTO_EVOLUTION_DocBlocks);
|
|
15
|
-
|
|
16
|
-
//#endregion
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { registerDocBlocks } from "../registry.js";
|
|
2
|
-
|
|
3
|
-
//#region ../../libs/contracts/dist/docs/tech/PHASE_4_PERSONALIZATION_ENGINE.docblock.js
|
|
4
|
-
const tech_PHASE_4_PERSONALIZATION_ENGINE_DocBlocks = [{
|
|
5
|
-
id: "docs.tech.PHASE_4_PERSONALIZATION_ENGINE",
|
|
6
|
-
title: "Phase 4: Personalization Engine",
|
|
7
|
-
summary: "**Status**: Complete",
|
|
8
|
-
kind: "reference",
|
|
9
|
-
visibility: "public",
|
|
10
|
-
route: "/docs/tech/PHASE_4_PERSONALIZATION_ENGINE",
|
|
11
|
-
tags: ["tech", "PHASE_4_PERSONALIZATION_ENGINE"],
|
|
12
|
-
body: "# Phase 4: Personalization Engine\n\n**Status**: Complete \n**Last updated**: 2025-11-21\n\nPhase 4 unlocks tenant-scoped personalization with zero bespoke code. We shipped three new libraries, a signing-aware Overlay editor, and the persistence layer required to observe usage and apply overlays safely.\n\n---\n\n## 1. Libraries\n\n### @lssm/lib.overlay-engine\n\n- OverlaySpec types + validator mirror the public spec.\n- Cryptographic signer (`ed25519`, `rsa-pss-sha256`) with canonical JSON serialization.\n- Registry that merges tenant/role/user/device overlays with predictable specificity.\n- React hooks (`useOverlay`, `useOverlayFields`) for client-side rendering.\n- Runtime engine audits every applied overlay for traceability.\n\n### @lssm/lib.personalization\n\n- Behavior tracker buffers field/feature/workflow events and exports OTel metrics.\n- Analyzer summarizes field usage and workflow drop-offs into actionable insights.\n- Adapter translates insights into overlay suggestions or workflow tweaks.\n- In-memory store implementation + interface for plugging Prisma/ClickHouse later.\n\n### @lssm/lib.workflow-composer\n\n- `WorkflowComposer` merges base workflows with tenant/role/device extensions.\n- Step injection utilities keep transitions intact and validate anchor steps.\n- Template helpers for common tenant review/approval, plus merge helpers for multi-scope extensions.\n\n---\n\n## 2. Overlay Editor App\n\nPath: `packages/apps/overlay-editor`\n\n- Next.js App Router UI for toggling field visibility, renaming labels, and reordering lists.\n- Live JSON preview powered by `defineOverlay`.\n- Server action that signs overlays via PEM private keys (Ed25519 by default) using the overlay engine signer.\n\n---\n\n## 3. Persistence\n\nAdded Prisma models (see `packages/libs/database/prisma/schema.prisma`):\n\n- `UserBehaviorEvent` – field/feature/workflow telemetry.\n- `OverlaySigningKey` – tenant managed signing keys with revocation timestamps.\n- `Overlay` – stored overlays (tenant/user/role/device scope) plus signature metadata.\n\n---\n\n## 4. Integration Steps\n\n1. Track usage inside apps via `createBehaviorTracker`.\n2. Periodically run `BehaviorAnalyzer.analyze` to generate insights.\n3. Convert insights into OverlaySpecs or Workflow extensions.\n4. Register tenant overlays in `OverlayRegistry` and serve via presentation runtimes.\n5. Compose workflows per tenant using `WorkflowComposer`.\n\nSee the `docs/tech/personalization/*` guides for concrete examples.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"
|
|
13
|
-
}];
|
|
14
|
-
registerDocBlocks(tech_PHASE_4_PERSONALIZATION_ENGINE_DocBlocks);
|
|
15
|
-
|
|
16
|
-
//#endregion
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { registerDocBlocks } from "../registry.js";
|
|
2
|
-
|
|
3
|
-
//#region ../../libs/contracts/dist/docs/tech/PHASE_5_ZERO_TOUCH_OPERATIONS.docblock.js
|
|
4
|
-
const tech_PHASE_5_ZERO_TOUCH_OPERATIONS_DocBlocks = [{
|
|
5
|
-
id: "docs.tech.PHASE_5_ZERO_TOUCH_OPERATIONS",
|
|
6
|
-
title: "Phase 5: Zero-Touch Operations",
|
|
7
|
-
summary: "**Status**: In progress",
|
|
8
|
-
kind: "reference",
|
|
9
|
-
visibility: "public",
|
|
10
|
-
route: "/docs/tech/PHASE_5_ZERO_TOUCH_OPERATIONS",
|
|
11
|
-
tags: ["tech", "PHASE_5_ZERO_TOUCH_OPERATIONS"],
|
|
12
|
-
body: "# Phase 5: Zero-Touch Operations\n\n**Status**: In progress \n**Last updated**: 2025-11-21\n\nPhase 5 delivers progressive delivery, SLO intelligence, cost attribution, and anomaly-driven remediation so the platform can deploy continuously without pager rotations.\n\n---\n\n## 1. New Libraries\n\n### @lssm/lib.progressive-delivery\n- `DeploymentStrategy` types capture canary vs blue-green rollouts.\n- `CanaryController` + `CanaryAnalyzer` orchestrate stage evaluation against telemetry thresholds.\n- `TrafficShifter` keeps stable/candidate splits in sync with feature-flag or router state.\n- `DeploymentCoordinator` drives stage progression, emits events, and triggers rollbacks.\n- `RollbackManager` encapsulates safe revert hooks (spec version revert, traffic shift, etc.).\n\n### @lssm/lib.slo\n- Declarative `SLODefinition` with latency + availability targets per capability/spec.\n- `SLOTracker` stores rolling snapshots + error budget positions.\n- `BurnRateCalculator` implements multi-window burn computations (fast vs slow burn).\n- `SLOMonitor` pushes incidents to Ops tooling automatically when burn exceeds thresholds.\n\n### @lssm/lib.cost-tracking\n- `CostTracker` normalizes DB/API/compute metrics into per-operation cost totals.\n- `BudgetAlertManager` raises tenant budget warnings (80% default) with contextual payloads.\n- `OptimizationRecommender` suggests batching, caching, or contract tweaks to cut spend.\n\n### Observability Anomaly Toolkit\n- `BaselineCalculator` establishes rolling intent metrics (latency, error rate, throughput).\n- `AnomalyDetector` flags spikes/drops via relative deltas after 10+ samples.\n- `RootCauseAnalyzer` correlates anomalies with recent deployments.\n- `AlertManager` deduplicates notifications and feeds MCP/SRE transports.\n\n---\n\n## 2. Data Model Additions\n\nFile: `packages/libs/database/prisma/schema.prisma`\n\n| Model | Purpose |\n| --- | --- |\n| `SLODefinition`, `SLOSnapshot`, `ErrorBudget`, `SLOIncident` | Persist definitions, rolling windows, and incidents. |\n| `OperationCost`, `TenantBudget`, `CostAlert`, `OptimizationSuggestion` | Track per-operation costs, budgets, and generated recommendations. |\n| `Deployment`, `DeploymentStage`, `RollbackEvent` | Audit progressive delivery runs and automated rollbacks. |\n| `MetricBaseline`, `AnomalyEvent` | Store computed baselines and anomaly evidence for training/analytics. |\n\nRun `bun database generate` after pulling to refresh the Prisma client.\n\n---\n\n## 3. Operational Flow\n\n1. **Deploy**: Define a `DeploymentStrategy` and feed telemetry via `@lssm/lib.observability`. Canary stages run automatically.\n2. **Protect**: `CanaryAnalyzer` evaluates error rate + latency thresholds. Failures trigger `RollbackManager`.\n3. **Observe**: `SLOMonitor` consumes snapshots and opens incidents when burn rate exceeds thresholds.\n4. **Optimize**: `CostTracker` aggregates spend per tenant + capability, while `OptimizationRecommender` surfaces fixes.\n5. **Detect**: Anomaly signals route to `RootCauseAnalyzer`, which links them to specific deployments for auto-rollback.\n\n---\n\n## 4. Integration Checklist\n\n1. Instrument adapters with `createTracingMiddleware({ onSample })` to feed metric points into `AnomalyDetector`.\n2. Register SLOs per critical operation (`billing.charge`, `knowledge.search`) and wire monitors to Ops notifications.\n3. Attach `CostTracker.recordSample` to workflow runners (DB instrumentation + external call wrappers).\n4. Store deployment metadata using the new Prisma models for auditing + UI surfacing.\n5. Update `@lssm/app.ops-console` (next iteration) to list deployments, SLO status, costs, and anomalies in one timeline.\n\n---\n\n## 5. Next Steps\n\n- Wire `DeploymentCoordinator` into the Contracts CLI so `contractspec deploy` can run staged rollouts.\n- Add UI for SLO dashboards (burn rate sparkline + incident feed).\n- Ship budget suggestions into Growth Agent for automated cost optimizations.\n- Connect `AnomalyEvent` stream to MCP agents for root-cause playbooks.\n"
|
|
13
|
-
}];
|
|
14
|
-
registerDocBlocks(tech_PHASE_5_ZERO_TOUCH_OPERATIONS_DocBlocks);
|
|
15
|
-
|
|
16
|
-
//#endregion
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import "zod";
|
|
2
|
-
import { GraphQLScalarType } from "graphql";
|
|
3
|
-
|
|
4
|
-
//#region ../../libs/contracts/dist/schema/dist/FieldType.js
|
|
5
|
-
/**
|
|
6
|
-
* GraphQL scalar wrapper that carries zod and JSON Schema metadata.
|
|
7
|
-
*
|
|
8
|
-
* TInternal is the runtime representation; TExternal is the GraphQL output.
|
|
9
|
-
*/
|
|
10
|
-
var FieldType = class extends GraphQLScalarType {
|
|
11
|
-
zodSchema;
|
|
12
|
-
jsonSchemaDef;
|
|
13
|
-
constructor(config) {
|
|
14
|
-
super(config);
|
|
15
|
-
this.zodSchema = config.zod;
|
|
16
|
-
this.jsonSchemaDef = config.jsonSchema;
|
|
17
|
-
}
|
|
18
|
-
/** Return the attached zod schema for validation. */
|
|
19
|
-
getZod() {
|
|
20
|
-
return this.zodSchema;
|
|
21
|
-
}
|
|
22
|
-
/** GraphQL scalar instance usable by Pothos or vanilla GraphQL. */
|
|
23
|
-
getPothos() {
|
|
24
|
-
return this;
|
|
25
|
-
}
|
|
26
|
-
/** Return the JSON Schema (evaluates factory if provided). */
|
|
27
|
-
getJson() {
|
|
28
|
-
return typeof this.jsonSchemaDef === "function" ? this.jsonSchemaDef() : this.jsonSchemaDef;
|
|
29
|
-
}
|
|
30
|
-
getJsonSchemaDef() {
|
|
31
|
-
return this.jsonSchemaDef;
|
|
32
|
-
}
|
|
33
|
-
getJsonSchema() {
|
|
34
|
-
const deepResolve = (v) => {
|
|
35
|
-
const value = typeof v === "function" ? v() : v;
|
|
36
|
-
if (Array.isArray(value)) return value.map((item) => deepResolve(item));
|
|
37
|
-
if (value && typeof value === "object") {
|
|
38
|
-
const obj = {};
|
|
39
|
-
for (const [k, val] of Object.entries(value)) obj[k] = deepResolve(val);
|
|
40
|
-
return obj;
|
|
41
|
-
}
|
|
42
|
-
return value;
|
|
43
|
-
};
|
|
44
|
-
return deepResolve(this.getJson());
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
//#endregion
|
|
49
|
-
export { FieldType };
|