@contractspec/example.personalization 0.0.0-canary-20260113170453
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 +319 -0
- package/.turbo/turbo-build.log +321 -0
- package/CHANGELOG.md +408 -0
- package/LICENSE +21 -0
- package/dist/behavior-tracking.d.ts +5 -0
- package/dist/behavior-tracking.d.ts.map +1 -0
- package/dist/behavior-tracking.js +48 -0
- package/dist/behavior-tracking.js.map +1 -0
- package/dist/docs/index.d.ts +1 -0
- package/dist/docs/index.js +1 -0
- package/dist/docs/personalization.docblock.d.ts +1 -0
- package/dist/docs/personalization.docblock.js +30 -0
- package/dist/docs/personalization.docblock.js.map +1 -0
- package/dist/example.d.ts +8 -0
- package/dist/example.d.ts.map +1 -0
- package/dist/example.js +46 -0
- package/dist/example.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +7 -0
- package/dist/libs/contracts/src/app-config/branding.d.ts +20 -0
- package/dist/libs/contracts/src/app-config/branding.d.ts.map +1 -0
- package/dist/libs/contracts/src/app-config/lifecycle.d.ts +1 -0
- package/dist/libs/contracts/src/app-config/runtime.d.ts +9 -0
- package/dist/libs/contracts/src/app-config/spec.d.ts +92 -0
- package/dist/libs/contracts/src/app-config/spec.d.ts.map +1 -0
- package/dist/libs/contracts/src/app-config/validation.d.ts +7 -0
- package/dist/libs/contracts/src/capabilities/capabilities.d.ts +16 -0
- package/dist/libs/contracts/src/capabilities/capabilities.d.ts.map +1 -0
- package/dist/libs/contracts/src/client/index.d.ts +1 -0
- package/dist/libs/contracts/src/client/react/drivers/rn-reusables.d.ts +1 -0
- package/dist/libs/contracts/src/client/react/drivers/shadcn.d.ts +1 -0
- package/dist/libs/contracts/src/client/react/feature-render.d.ts +3 -0
- package/dist/libs/contracts/src/client/react/form-render.d.ts +2 -0
- package/dist/libs/contracts/src/client/react/index.d.ts +4 -0
- package/dist/libs/contracts/src/contract-registry/index.d.ts +1 -0
- package/dist/libs/contracts/src/contract-registry/schemas.d.ts +1 -0
- package/dist/libs/contracts/src/data-views/index.d.ts +3 -0
- package/dist/libs/contracts/src/data-views/registry.d.ts +2 -0
- package/dist/libs/contracts/src/data-views/spec.d.ts +1 -0
- package/dist/libs/contracts/src/data-views/types.d.ts +1 -0
- package/dist/libs/contracts/src/docs/registry.d.ts +8 -0
- package/dist/libs/contracts/src/docs/registry.d.ts.map +1 -0
- package/dist/libs/contracts/src/events.d.ts +1 -0
- package/dist/libs/contracts/src/examples/index.d.ts +4 -0
- package/dist/libs/contracts/src/examples/registry.d.ts +2 -0
- package/dist/libs/contracts/src/examples/schema.d.ts +2 -0
- package/dist/libs/contracts/src/examples/types.d.ts +138 -0
- package/dist/libs/contracts/src/examples/types.d.ts.map +1 -0
- package/dist/libs/contracts/src/examples/validation.d.ts +1 -0
- package/dist/libs/contracts/src/experiments/spec-resolver.d.ts +3 -0
- package/dist/libs/contracts/src/experiments/spec.d.ts +11 -0
- package/dist/libs/contracts/src/experiments/spec.d.ts.map +1 -0
- package/dist/libs/contracts/src/features/index.d.ts +4 -0
- package/dist/libs/contracts/src/features/install.d.ts +4 -0
- package/dist/libs/contracts/src/features/registry.d.ts +1 -0
- package/dist/libs/contracts/src/features/types.d.ts +88 -0
- package/dist/libs/contracts/src/features/types.d.ts.map +1 -0
- package/dist/libs/contracts/src/features/validation.d.ts +1 -0
- package/dist/libs/contracts/src/index.d.ts +43 -0
- package/dist/libs/contracts/src/install.d.ts +6 -0
- package/dist/libs/contracts/src/integrations/connection.d.ts +1 -0
- package/dist/libs/contracts/src/integrations/index.d.ts +5 -0
- package/dist/libs/contracts/src/integrations/openbanking/contracts/accounts.d.ts +3 -0
- package/dist/libs/contracts/src/integrations/openbanking/contracts/balances.d.ts +3 -0
- package/dist/libs/contracts/src/integrations/openbanking/contracts/index.d.ts +5 -0
- package/dist/libs/contracts/src/integrations/openbanking/contracts/transactions.d.ts +3 -0
- package/dist/libs/contracts/src/integrations/openbanking/guards.d.ts +1 -0
- package/dist/libs/contracts/src/integrations/openbanking/openbanking.feature.d.ts +1 -0
- package/dist/libs/contracts/src/integrations/operations.d.ts +3 -0
- package/dist/libs/contracts/src/integrations/providers/elevenlabs.d.ts +2 -0
- package/dist/libs/contracts/src/integrations/providers/gcs-storage.d.ts +2 -0
- package/dist/libs/contracts/src/integrations/providers/gmail.d.ts +2 -0
- package/dist/libs/contracts/src/integrations/providers/google-calendar.d.ts +2 -0
- package/dist/libs/contracts/src/integrations/providers/index.d.ts +11 -0
- package/dist/libs/contracts/src/integrations/providers/mistral.d.ts +2 -0
- package/dist/libs/contracts/src/integrations/providers/postmark.d.ts +2 -0
- package/dist/libs/contracts/src/integrations/providers/powens.d.ts +2 -0
- package/dist/libs/contracts/src/integrations/providers/qdrant.d.ts +2 -0
- package/dist/libs/contracts/src/integrations/providers/registry.d.ts +1 -0
- package/dist/libs/contracts/src/integrations/providers/stripe.d.ts +2 -0
- package/dist/libs/contracts/src/integrations/providers/twilio-sms.d.ts +2 -0
- package/dist/libs/contracts/src/integrations/spec.d.ts +8 -0
- package/dist/libs/contracts/src/integrations/spec.d.ts.map +1 -0
- package/dist/libs/contracts/src/jsonschema.d.ts +2 -0
- package/dist/libs/contracts/src/knowledge/index.d.ts +2 -0
- package/dist/libs/contracts/src/knowledge/operations.d.ts +3 -0
- package/dist/libs/contracts/src/knowledge/spaces/email-threads.d.ts +1 -0
- package/dist/libs/contracts/src/knowledge/spaces/financial-docs.d.ts +1 -0
- package/dist/libs/contracts/src/knowledge/spaces/financial-overview.d.ts +1 -0
- package/dist/libs/contracts/src/knowledge/spaces/index.d.ts +6 -0
- package/dist/libs/contracts/src/knowledge/spaces/product-canon.d.ts +1 -0
- package/dist/libs/contracts/src/knowledge/spaces/support-faq.d.ts +1 -0
- package/dist/libs/contracts/src/knowledge/spaces/uploaded-docs.d.ts +1 -0
- package/dist/libs/contracts/src/knowledge/spec.d.ts +1 -0
- package/dist/libs/contracts/src/llm/exporters.d.ts +6 -0
- package/dist/libs/contracts/src/llm/index.d.ts +3 -0
- package/dist/libs/contracts/src/llm/prompts.d.ts +2 -0
- package/dist/libs/contracts/src/llm/types.d.ts +3 -0
- package/dist/libs/contracts/src/onboarding-base.d.ts +1 -0
- package/dist/libs/contracts/src/openapi.d.ts +1 -0
- package/dist/libs/contracts/src/operations/index.d.ts +2 -0
- package/dist/libs/contracts/src/operations/operation.d.ts +24 -0
- package/dist/libs/contracts/src/operations/operation.d.ts.map +1 -0
- package/dist/libs/contracts/src/operations/registry.d.ts +5 -0
- package/dist/libs/contracts/src/ownership.d.ts +60 -0
- package/dist/libs/contracts/src/ownership.d.ts.map +1 -0
- package/dist/libs/contracts/src/policy/engine.d.ts +2 -0
- package/dist/libs/contracts/src/policy/index.d.ts +4 -0
- package/dist/libs/contracts/src/policy/opa-adapter.d.ts +2 -0
- package/dist/libs/contracts/src/policy/registry.d.ts +1 -0
- package/dist/libs/contracts/src/policy/spec.d.ts +9 -0
- package/dist/libs/contracts/src/policy/spec.d.ts.map +1 -0
- package/dist/libs/contracts/src/presentations/index.d.ts +3 -0
- package/dist/libs/contracts/src/presentations/presentations.d.ts +7 -0
- package/dist/libs/contracts/src/presentations/presentations.d.ts.map +1 -0
- package/dist/libs/contracts/src/presentations/registry.d.ts +1 -0
- package/dist/libs/contracts/src/presentations/transform-engine.d.ts +1 -0
- package/dist/libs/contracts/src/prompt.d.ts +1 -0
- package/dist/libs/contracts/src/promptRegistry.d.ts +2 -0
- package/dist/libs/contracts/src/regenerator/adapters.d.ts +1 -0
- package/dist/libs/contracts/src/regenerator/executor.d.ts +1 -0
- package/dist/libs/contracts/src/regenerator/index.d.ts +6 -0
- package/dist/libs/contracts/src/regenerator/service.d.ts +2 -0
- package/dist/libs/contracts/src/regenerator/sinks.d.ts +2 -0
- package/dist/libs/contracts/src/regenerator/types.d.ts +2 -0
- package/dist/libs/contracts/src/regenerator/utils.d.ts +1 -0
- package/dist/libs/contracts/src/registry.d.ts +1 -0
- package/dist/libs/contracts/src/resources.d.ts +1 -0
- package/dist/libs/contracts/src/server/graphql-pothos.d.ts +7 -0
- package/dist/libs/contracts/src/server/index.d.ts +7 -0
- package/dist/libs/contracts/src/server/mcp/createMcpServer.d.ts +5 -0
- package/dist/libs/contracts/src/server/mcp/mcpTypes.d.ts +3 -0
- package/dist/libs/contracts/src/server/provider-mcp.d.ts +1 -0
- package/dist/libs/contracts/src/server/rest-elysia.d.ts +3 -0
- package/dist/libs/contracts/src/server/rest-express.d.ts +3 -0
- package/dist/libs/contracts/src/server/rest-generic.d.ts +2 -0
- package/dist/libs/contracts/src/server/rest-next-app.d.ts +3 -0
- package/dist/libs/contracts/src/server/rest-next-pages.d.ts +3 -0
- package/dist/libs/contracts/src/tests/index.d.ts +1 -0
- package/dist/libs/contracts/src/tests/runner.d.ts +2 -0
- package/dist/libs/contracts/src/themes.d.ts +11 -0
- package/dist/libs/contracts/src/themes.d.ts.map +1 -0
- package/dist/libs/contracts/src/types.d.ts +3 -0
- package/dist/libs/contracts/src/workflow/adapters/db-adapter.d.ts +1 -0
- package/dist/libs/contracts/src/workflow/adapters/file-adapter.d.ts +1 -0
- package/dist/libs/contracts/src/workflow/adapters/index.d.ts +3 -0
- package/dist/libs/contracts/src/workflow/adapters/memory-store.d.ts +1 -0
- package/dist/libs/contracts/src/workflow/index.d.ts +5 -0
- package/dist/libs/contracts/src/workflow/runner.d.ts +5 -0
- package/dist/libs/contracts/src/workflow/spec.d.ts +89 -0
- package/dist/libs/contracts/src/workflow/spec.d.ts.map +1 -0
- package/dist/libs/contracts/src/workflow/state.d.ts +1 -0
- package/dist/libs/contracts/src/workflow/validation.d.ts +2 -0
- package/dist/libs/contracts/src/workspace-config/contractsrc-schema.d.ts +1 -0
- package/dist/libs/contracts/src/workspace-config/index.d.ts +1 -0
- package/dist/overlay-customization.d.ts +5 -0
- package/dist/overlay-customization.d.ts.map +1 -0
- package/dist/overlay-customization.js +50 -0
- package/dist/overlay-customization.js.map +1 -0
- package/dist/workflow-extension.d.ts +8 -0
- package/dist/workflow-extension.d.ts.map +1 -0
- package/dist/workflow-extension.js +67 -0
- package/dist/workflow-extension.js.map +1 -0
- package/package.json +64 -0
- package/src/behavior-tracking.ts +47 -0
- package/src/docs/index.ts +1 -0
- package/src/docs/personalization.docblock.ts +28 -0
- package/src/example.ts +32 -0
- package/src/index.ts +5 -0
- package/src/overlay-customization.ts +57 -0
- package/src/workflow-extension.ts +63 -0
- package/tsconfig.json +17 -0
- package/tsdown.config.js +6 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import "../registry.js";
|
|
2
|
+
|
|
3
|
+
//#region ../../libs/contracts/src/integrations/spec.d.ts
|
|
4
|
+
type IntegrationCategory = 'payments' | 'email' | 'calendar' | 'sms' | 'ai-llm' | 'ai-voice' | 'speech-to-text' | 'vector-db' | 'storage' | 'accounting' | 'crm' | 'helpdesk' | 'open-banking' | 'custom';
|
|
5
|
+
type IntegrationOwnershipMode = 'managed' | 'byok';
|
|
6
|
+
//#endregion
|
|
7
|
+
export { IntegrationCategory, IntegrationOwnershipMode };
|
|
8
|
+
//# sourceMappingURL=spec.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spec.d.ts","names":[],"sources":["../../../../../../../libs/contracts/src/integrations/spec.ts"],"sourcesContent":[],"mappings":";;;AAIY,KAAA,mBAAA,GAAmB,UAAA,GAAA,OAAA,GAAA,UAAA,GAAA,KAAA,GAAA,QAAA,GAAA,UAAA,GAAA,gBAAA,GAAA,WAAA,GAAA,SAAA,GAAA,YAAA,GAAA,KAAA,GAAA,UAAA,GAAA,cAAA,GAAA,QAAA;AAgBnB,KAAA,wBAAA,GAAwB,SAAA,GAAA,MAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "../spec.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "../spec.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "../spec.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "../spec.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "../spec.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "../spec.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "../registry.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./index.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./operations/registry.js";
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import "../resources.js";
|
|
2
|
+
import "../events.js";
|
|
3
|
+
|
|
4
|
+
//#region ../../libs/contracts/src/operations/operation.d.ts
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Type of implementation artifact.
|
|
8
|
+
*/
|
|
9
|
+
type ImplementationType = 'handler' | 'component' | 'form' | 'test' | 'service' | 'hook' | 'other';
|
|
10
|
+
/**
|
|
11
|
+
* Reference to an implementation file for a spec.
|
|
12
|
+
* Used for explicit implementation mapping.
|
|
13
|
+
*/
|
|
14
|
+
interface ImplementationRef {
|
|
15
|
+
/** Path to implementation file (relative to workspace root) */
|
|
16
|
+
path: string;
|
|
17
|
+
/** Type of implementation artifact */
|
|
18
|
+
type: ImplementationType;
|
|
19
|
+
/** Optional human-readable description */
|
|
20
|
+
description?: string;
|
|
21
|
+
}
|
|
22
|
+
//#endregion
|
|
23
|
+
export { ImplementationRef, ImplementationType };
|
|
24
|
+
//# sourceMappingURL=operation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operation.d.ts","names":[],"sources":["../../../../../../../libs/contracts/src/operations/operation.ts"],"sourcesContent":[],"mappings":";;;;;;;;KAmBY,kBAAA;;;;;UAaK,iBAAA;;;;QAIT"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { DocId } from "./docs/registry.js";
|
|
2
|
+
|
|
3
|
+
//#region ../../libs/contracts/src/ownership.d.ts
|
|
4
|
+
declare const StabilityEnum: {
|
|
5
|
+
readonly Idea: "idea";
|
|
6
|
+
readonly InCreation: "in_creation";
|
|
7
|
+
readonly Experimental: "experimental";
|
|
8
|
+
readonly Beta: "beta";
|
|
9
|
+
readonly Stable: "stable";
|
|
10
|
+
readonly Deprecated: "deprecated";
|
|
11
|
+
};
|
|
12
|
+
type Stability = (typeof StabilityEnum)[keyof typeof StabilityEnum];
|
|
13
|
+
declare const OwnersEnum: {
|
|
14
|
+
readonly PlatformCore: "platform.core";
|
|
15
|
+
readonly PlatformSigil: "platform.sigil";
|
|
16
|
+
readonly PlatformMarketplace: "platform.marketplace";
|
|
17
|
+
readonly PlatformMessaging: "platform.messaging";
|
|
18
|
+
readonly PlatformContent: "platform.content";
|
|
19
|
+
readonly PlatformFeatureFlags: "platform.featureflags";
|
|
20
|
+
readonly PlatformFinance: "platform.finance";
|
|
21
|
+
};
|
|
22
|
+
type Owner = (typeof OwnersEnum)[keyof typeof OwnersEnum] | (string & {});
|
|
23
|
+
declare const TagsEnum: {
|
|
24
|
+
readonly Spots: "spots";
|
|
25
|
+
readonly Collectivity: "collectivity";
|
|
26
|
+
readonly Marketplace: "marketplace";
|
|
27
|
+
readonly Sellers: "sellers";
|
|
28
|
+
readonly Auth: "auth";
|
|
29
|
+
readonly Login: "login";
|
|
30
|
+
readonly Signup: "signup";
|
|
31
|
+
readonly Guide: "guide";
|
|
32
|
+
readonly Docs: "docs";
|
|
33
|
+
readonly I18n: "i18n";
|
|
34
|
+
readonly Incident: "incident";
|
|
35
|
+
readonly Automation: "automation";
|
|
36
|
+
readonly Hygiene: "hygiene";
|
|
37
|
+
};
|
|
38
|
+
type Tag = (typeof TagsEnum)[keyof typeof TagsEnum] | (string & {});
|
|
39
|
+
interface OwnerShipMeta {
|
|
40
|
+
/** Breaking changes => bump version */
|
|
41
|
+
version: string;
|
|
42
|
+
/** Fully-qualified spec key (e.g., "sigil.beginSignup") */
|
|
43
|
+
key: string;
|
|
44
|
+
/** Human-friendly spec title (e.g., "Signup begin") */
|
|
45
|
+
title?: string;
|
|
46
|
+
/** Short human-friendly summary */
|
|
47
|
+
description: string;
|
|
48
|
+
domain?: string;
|
|
49
|
+
/** Lifecycle marker for comms & tooling */
|
|
50
|
+
stability: Stability;
|
|
51
|
+
/** Owners for CODEOWNERS / on-call / approvals */
|
|
52
|
+
owners: Owner[];
|
|
53
|
+
/** Search tags, grouping, docs navigation */
|
|
54
|
+
tags: Tag[];
|
|
55
|
+
/** Doc block(s) for this operation. */
|
|
56
|
+
docId?: DocId[];
|
|
57
|
+
}
|
|
58
|
+
//#endregion
|
|
59
|
+
export { Owner, OwnerShipMeta, OwnersEnum, Stability, StabilityEnum, Tag, TagsEnum };
|
|
60
|
+
//# sourceMappingURL=ownership.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ownership.d.ts","names":[],"sources":["../../../../../../libs/contracts/src/ownership.ts"],"sourcesContent":[],"mappings":";;;cAIa;;EAAA,SAAA,UAOH,EAAA,aAAA;EACE,SAAA,YAAS,EAAA,cAAW;EAGnB,SAAA,IAQH,EAAA,MAAA;EACE,SAAK,MAAA,EAAA,QACL;EAMC,SAAA,UAcH,EAAA,YAAA;AACV,CAAA;AAIiB,KAtCL,SAAA,GAsCkB,CAAA,OAtCE,aAsCF,CAAA,CAAA,MAAA,OAtC8B,aAsC9B,CAAA;AAWjB,cA9CA,UA8CA,EAAA;EAEH,SAAA,YAAA,EAAA,eAAA;EAEF,SAAA,aAAA,EAAA,gBAAA;EAGE,SAAA,mBAAA,EAAA,sBAAA;EAAK,SAAA,iBAAA,EAAA,oBAAA;;;;;KA5CH,KAAA,WACA,yBAAyB;cAMxB;;;;;;;;;;;;;;;KAeD,GAAA,WAAc,uBAAuB;UAIhC,aAAA;;;;;;;;;;;aAWJ;;UAEH;;QAEF;;UAGE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "../registry.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spec.d.ts","names":[],"sources":["../../../../../../../libs/contracts/src/policy/spec.ts"],"sourcesContent":[],"mappings":";;UAmHiB,SAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
//#region ../../libs/contracts/src/presentations/presentations.d.ts
|
|
2
|
+
|
|
3
|
+
/** Supported render targets for the transform engine and descriptors. */
|
|
4
|
+
type PresentationTarget = 'react' | 'markdown' | 'application/json' | 'application/xml';
|
|
5
|
+
//#endregion
|
|
6
|
+
export { PresentationTarget };
|
|
7
|
+
//# sourceMappingURL=presentations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"presentations.d.ts","names":[],"sources":["../../../../../../../libs/contracts/src/presentations/presentations.ts"],"sourcesContent":[],"mappings":";;;KAKY,kBAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "../registry.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "react";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "zod";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./types.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./types.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./types.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./types.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "zod";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./mcp/createMcpServer.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./runner.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"themes.d.ts","names":[],"sources":["../../../../../../libs/contracts/src/themes.ts"],"sourcesContent":[],"mappings":";;;;UAgDiB,QAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "../state.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "../state.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "../state.js";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { CompensationStep, CompensationStrategy, FormRef, GuardCondition, GuardConditionKind, RetryPolicy, SLA, Step, StepAction, StepType, Transition, WorkflowDefinition, WorkflowMeta, WorkflowSpec } from "./spec.js";
|
|
2
|
+
import "./validation.js";
|
|
3
|
+
import "./state.js";
|
|
4
|
+
import "./runner.js";
|
|
5
|
+
import "./adapters/index.js";
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { OwnerShipMeta } from "../ownership.js";
|
|
2
|
+
import { CapabilityRef } from "../capabilities/capabilities.js";
|
|
3
|
+
import { ExperimentRef } from "../experiments/spec.js";
|
|
4
|
+
import { OpRef } from "../features/types.js";
|
|
5
|
+
import "../features/index.js";
|
|
6
|
+
import "../registry.js";
|
|
7
|
+
|
|
8
|
+
//#region ../../libs/contracts/src/workflow/spec.d.ts
|
|
9
|
+
/**
|
|
10
|
+
* Reference to a form spec declared in {@link FormRegistry}.
|
|
11
|
+
*/
|
|
12
|
+
interface FormRef {
|
|
13
|
+
key: string;
|
|
14
|
+
version: string;
|
|
15
|
+
}
|
|
16
|
+
type StepType = 'human' | 'automation' | 'decision';
|
|
17
|
+
type GuardConditionKind = 'policy' | 'expression';
|
|
18
|
+
interface GuardCondition {
|
|
19
|
+
type: GuardConditionKind;
|
|
20
|
+
/** Policy name or expression string depending on the type. */
|
|
21
|
+
value: string;
|
|
22
|
+
}
|
|
23
|
+
interface RetryPolicy {
|
|
24
|
+
maxAttempts: number;
|
|
25
|
+
backoff: 'linear' | 'exponential';
|
|
26
|
+
delayMs: number;
|
|
27
|
+
/** Optional max delay cap for exponential backoff. */
|
|
28
|
+
maxDelayMs?: number;
|
|
29
|
+
}
|
|
30
|
+
interface StepAction {
|
|
31
|
+
/** Operation executed for automation steps. */
|
|
32
|
+
operation?: OpRef;
|
|
33
|
+
/** Form rendered for human input steps. */
|
|
34
|
+
form?: FormRef;
|
|
35
|
+
}
|
|
36
|
+
interface Step {
|
|
37
|
+
id: string;
|
|
38
|
+
type: StepType;
|
|
39
|
+
label: string;
|
|
40
|
+
description?: string;
|
|
41
|
+
action?: StepAction;
|
|
42
|
+
guard?: GuardCondition;
|
|
43
|
+
timeoutMs?: number;
|
|
44
|
+
retry?: RetryPolicy;
|
|
45
|
+
/** Integration slot identifiers required before this step can execute. */
|
|
46
|
+
requiredIntegrations?: string[];
|
|
47
|
+
/** Capabilities that must be enabled for this step to execute. */
|
|
48
|
+
requiredCapabilities?: CapabilityRef[];
|
|
49
|
+
}
|
|
50
|
+
interface Transition {
|
|
51
|
+
from: string;
|
|
52
|
+
to: string;
|
|
53
|
+
label?: string;
|
|
54
|
+
/** Expression evaluated against workflow data (e.g., `data.approved === true`). */
|
|
55
|
+
condition?: string;
|
|
56
|
+
}
|
|
57
|
+
interface SLA {
|
|
58
|
+
totalDurationMs?: number;
|
|
59
|
+
stepDurationMs?: Record<string, number>;
|
|
60
|
+
}
|
|
61
|
+
interface CompensationStep {
|
|
62
|
+
stepId: string;
|
|
63
|
+
operation: OpRef;
|
|
64
|
+
description?: string;
|
|
65
|
+
}
|
|
66
|
+
interface CompensationStrategy {
|
|
67
|
+
trigger?: 'on_failure' | 'manual';
|
|
68
|
+
steps: CompensationStep[];
|
|
69
|
+
}
|
|
70
|
+
interface WorkflowDefinition {
|
|
71
|
+
steps: Step[];
|
|
72
|
+
transitions: Transition[];
|
|
73
|
+
/** Optional explicit entry step. Defaults to the first step when omitted. */
|
|
74
|
+
entryStepId?: string;
|
|
75
|
+
sla?: SLA;
|
|
76
|
+
compensation?: CompensationStrategy;
|
|
77
|
+
}
|
|
78
|
+
type WorkflowMeta = OwnerShipMeta;
|
|
79
|
+
interface WorkflowSpec {
|
|
80
|
+
meta: WorkflowMeta;
|
|
81
|
+
definition: WorkflowDefinition;
|
|
82
|
+
policy?: {
|
|
83
|
+
flags?: string[];
|
|
84
|
+
};
|
|
85
|
+
experiments?: ExperimentRef[];
|
|
86
|
+
}
|
|
87
|
+
//#endregion
|
|
88
|
+
export { CompensationStep, CompensationStrategy, FormRef, GuardCondition, GuardConditionKind, RetryPolicy, SLA, Step, StepAction, StepType, Transition, WorkflowDefinition, WorkflowMeta, WorkflowSpec };
|
|
89
|
+
//# sourceMappingURL=spec.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spec.d.ts","names":[],"sources":["../../../../../../../libs/contracts/src/workflow/spec.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;AASiB,UAAA,OAAA,CAAO;EAKZ,GAAA,EAAA,MAAQ;EASR,OAAA,EAAA,MAAA;AAEZ;AAMiB,KAjBL,QAAA,GAiBgB,OAAA,GAAA,YAAA,GAAA,UAAA;AAeX,KAvBL,kBAAA,GAuBS,QAAA,GAAA,YAAA;AAEb,UAvBS,cAAA,CAuBT;EAGG,IAAA,EAzBH,kBAyBG;EACD;EAEA,KAAA,EAAA,MAAA;;AAI4B,UA3BrB,WAAA,CA2BqB;EAGrB,WAAA,EAAU,MAAA;EAQV,OAAG,EAAA,QAAA,GAED,aAAM;EAGR,OAAA,EAAA,MAAA;EAMA;EAKA,UAAA,CAAA,EAAA,MAAA;;AAEF,UAhDE,UAAA,CAgDF;EAGP;EACS,SAAA,CAAA,EAlDH,KAkDG;EAAoB;EAGzB,IAAA,CAAA,EAnDH,OAmDG;AAEZ;AACQ,UAnDS,IAAA,CAmDT;EACM,EAAA,EAAA,MAAA;EAEE,IAAA,EApDR,QAoDQ;EAAa,KAAA,EAAA,MAAA;;WAjDlB;UACD;;UAEA;;;;yBAIe;;UAGR,UAAA;;;;;;;UAQA,GAAA;;mBAEE;;UAGF,gBAAA;;aAEJ;;;UAII,oBAAA;;SAER;;UAGQ,kBAAA;SACR;eACM;;;QAGP;iBACS;;KAGL,YAAA,GAAe;UAEV,YAAA;QACT;cACM;;;;gBAEE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./spec.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "zod";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./contractsrc-schema.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"overlay-customization.d.ts","names":[],"sources":["../src/overlay-customization.ts"],"sourcesContent":[],"mappings":";iBAgBsB,8BAAA,CAAA,GAAkC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { LogLevel, Logger } from "@contractspec/lib.logger";
|
|
2
|
+
import { defineOverlay } from "@contractspec/lib.overlay-engine/spec";
|
|
3
|
+
import { signOverlay } from "@contractspec/lib.overlay-engine/signer";
|
|
4
|
+
import { OverlayEngine, OverlayRegistry } from "@contractspec/lib.overlay-engine";
|
|
5
|
+
|
|
6
|
+
//#region src/overlay-customization.ts
|
|
7
|
+
const logger = new Logger({
|
|
8
|
+
level: process.env.NODE_ENV === "production" ? LogLevel.INFO : LogLevel.DEBUG,
|
|
9
|
+
environment: process.env.NODE_ENV || "development",
|
|
10
|
+
enableColors: process.env.NODE_ENV !== "production"
|
|
11
|
+
});
|
|
12
|
+
async function runOverlayCustomizationExample() {
|
|
13
|
+
const registry = new OverlayRegistry({ allowUnsigned: true });
|
|
14
|
+
const engine = new OverlayEngine({ registry });
|
|
15
|
+
const signed = await signOverlay(defineOverlay({
|
|
16
|
+
overlayId: "demo-overlay",
|
|
17
|
+
version: "1.0.0",
|
|
18
|
+
appliesTo: {
|
|
19
|
+
capability: "billing.createOrder",
|
|
20
|
+
tenantId: "demo"
|
|
21
|
+
},
|
|
22
|
+
modifications: [{
|
|
23
|
+
type: "hideField",
|
|
24
|
+
field: "internalNotes"
|
|
25
|
+
}, {
|
|
26
|
+
type: "renameLabel",
|
|
27
|
+
field: "customerReference",
|
|
28
|
+
newLabel: "PO Number"
|
|
29
|
+
}]
|
|
30
|
+
}), process.env.PRIVATE_KEY_PEM ?? "");
|
|
31
|
+
registry.register(signed);
|
|
32
|
+
const result = engine.apply({
|
|
33
|
+
target: { fields: [{
|
|
34
|
+
key: "customerReference",
|
|
35
|
+
label: "Customer Reference",
|
|
36
|
+
visible: true
|
|
37
|
+
}, {
|
|
38
|
+
key: "internalNotes",
|
|
39
|
+
label: "Internal Notes",
|
|
40
|
+
visible: true
|
|
41
|
+
}] },
|
|
42
|
+
capability: "billing.createOrder",
|
|
43
|
+
tenantId: "demo"
|
|
44
|
+
});
|
|
45
|
+
logger.info("Overlay applied", { fields: result.target.fields });
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
//#endregion
|
|
49
|
+
export { runOverlayCustomizationExample };
|
|
50
|
+
//# sourceMappingURL=overlay-customization.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"overlay-customization.js","names":[],"sources":["../src/overlay-customization.ts"],"sourcesContent":["import { defineOverlay } from '@contractspec/lib.overlay-engine/spec';\nimport { signOverlay } from '@contractspec/lib.overlay-engine/signer';\nimport {\n OverlayEngine,\n OverlayRegistry,\n} from '@contractspec/lib.overlay-engine';\nimport { Logger, LogLevel } from '@contractspec/lib.logger';\n\nconst logger = new Logger({\n level: process.env.NODE_ENV === 'production' ? LogLevel.INFO : LogLevel.DEBUG,\n environment:\n (process.env.NODE_ENV as 'production' | 'development' | 'test') ||\n 'development',\n enableColors: process.env.NODE_ENV !== 'production',\n});\n\nexport async function runOverlayCustomizationExample(): Promise<void> {\n const registry = new OverlayRegistry({ allowUnsigned: true });\n const engine = new OverlayEngine({ registry });\n\n const overlay = defineOverlay({\n overlayId: 'demo-overlay',\n version: '1.0.0',\n appliesTo: {\n capability: 'billing.createOrder',\n tenantId: 'demo',\n },\n modifications: [\n { type: 'hideField', field: 'internalNotes' },\n {\n type: 'renameLabel',\n field: 'customerReference',\n newLabel: 'PO Number',\n },\n ],\n });\n\n const signed = await signOverlay(overlay, process.env.PRIVATE_KEY_PEM ?? '');\n registry.register(signed);\n\n const result = engine.apply({\n target: {\n fields: [\n {\n key: 'customerReference',\n label: 'Customer Reference',\n visible: true,\n },\n { key: 'internalNotes', label: 'Internal Notes', visible: true },\n ],\n },\n capability: 'billing.createOrder',\n tenantId: 'demo',\n });\n\n logger.info('Overlay applied', { fields: result.target.fields });\n}\n"],"mappings":";;;;;;AAQA,MAAM,SAAS,IAAI,OAAO;CACxB,OAAO,QAAQ,IAAI,aAAa,eAAe,SAAS,OAAO,SAAS;CACxE,aACG,QAAQ,IAAI,YACb;CACF,cAAc,QAAQ,IAAI,aAAa;CACxC,CAAC;AAEF,eAAsB,iCAAgD;CACpE,MAAM,WAAW,IAAI,gBAAgB,EAAE,eAAe,MAAM,CAAC;CAC7D,MAAM,SAAS,IAAI,cAAc,EAAE,UAAU,CAAC;CAmB9C,MAAM,SAAS,MAAM,YAjBL,cAAc;EAC5B,WAAW;EACX,SAAS;EACT,WAAW;GACT,YAAY;GACZ,UAAU;GACX;EACD,eAAe,CACb;GAAE,MAAM;GAAa,OAAO;GAAiB,EAC7C;GACE,MAAM;GACN,OAAO;GACP,UAAU;GACX,CACF;EACF,CAAC,EAEwC,QAAQ,IAAI,mBAAmB,GAAG;AAC5E,UAAS,SAAS,OAAO;CAEzB,MAAM,SAAS,OAAO,MAAM;EAC1B,QAAQ,EACN,QAAQ,CACN;GACE,KAAK;GACL,OAAO;GACP,SAAS;GACV,EACD;GAAE,KAAK;GAAiB,OAAO;GAAkB,SAAS;GAAM,CACjE,EACF;EACD,YAAY;EACZ,UAAU;EACX,CAAC;AAEF,QAAO,KAAK,mBAAmB,EAAE,QAAQ,OAAO,OAAO,QAAQ,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { WorkflowSpec } from "./libs/contracts/src/workflow/spec.js";
|
|
2
|
+
|
|
3
|
+
//#region src/workflow-extension.d.ts
|
|
4
|
+
declare function composeTenantWorkflowExample(): WorkflowSpec;
|
|
5
|
+
declare function logTenantWorkflowSteps(workflow: WorkflowSpec): void;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { composeTenantWorkflowExample, logTenantWorkflowSteps };
|
|
8
|
+
//# sourceMappingURL=workflow-extension.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow-extension.d.ts","names":[],"sources":["../src/workflow-extension.ts"],"sourcesContent":[],"mappings":";;;iBAiCgB,4BAAA,CAAA,GAAgC;iBAwBhC,sBAAA,WAAiC"}
|