@lssm/lib.contracts 0.0.0-canary-20251217063201 → 0.0.0-canary-20251217073102
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/dist/app-config/app-config.feature.js +53 -1
- package/dist/app-config/contracts.d.ts +50 -50
- package/dist/app-config/contracts.js +396 -1
- package/dist/app-config/docs/app-config.docblock.js +22 -220
- package/dist/app-config/events.d.ts +27 -27
- package/dist/app-config/events.js +168 -1
- package/dist/app-config/index.js +8 -1
- package/dist/app-config/lifecycle-contracts.d.ts +80 -80
- package/dist/app-config/lifecycle-contracts.js +441 -1
- package/dist/app-config/runtime.js +617 -1
- package/dist/app-config/spec.js +36 -1
- package/dist/app-config/validation.js +538 -1
- package/dist/capabilities/docs/capabilities.docblock.js +22 -1
- package/dist/capabilities/openbanking.js +92 -1
- package/dist/capabilities.js +50 -1
- package/dist/client/index.js +9 -1
- package/dist/client/react/drivers/rn-reusables.js +21 -1
- package/dist/client/react/drivers/shadcn.js +11 -1
- package/dist/client/react/feature-render.js +43 -1
- package/dist/client/react/form-render.js +298 -1
- package/dist/client/react/index.js +8 -1
- package/dist/contract-registry/index.js +3 -1
- package/dist/contract-registry/schemas.js +61 -1
- package/dist/contracts-adapter-hydration.js +41 -1
- package/dist/contracts-adapter-input.js +77 -1
- package/dist/data-views/docs/data-views.docblock.js +22 -1
- package/dist/data-views/query-generator.js +48 -1
- package/dist/data-views/runtime.js +39 -1
- package/dist/data-views.js +35 -1
- package/dist/docs/PUBLISHING.docblock.js +17 -76
- package/dist/docs/accessibility_wcag_compliance_specs.docblock.js +17 -350
- package/dist/docs/index.js +33 -1
- package/dist/docs/meta.docs.js +15 -2
- package/dist/docs/presentations.js +77 -1
- package/dist/docs/registry.js +51 -1
- package/dist/docs/tech/PHASE_1_QUICKSTART.docblock.js +17 -383
- package/dist/docs/tech/PHASE_2_AI_NATIVE_OPERATIONS.docblock.js +17 -68
- package/dist/docs/tech/PHASE_3_AUTO_EVOLUTION.docblock.js +17 -140
- package/dist/docs/tech/PHASE_4_PERSONALIZATION_ENGINE.docblock.js +17 -86
- package/dist/docs/tech/PHASE_5_ZERO_TOUCH_OPERATIONS.docblock.js +17 -1
- package/dist/docs/tech/auth/better-auth-nextjs.docblock.js +25 -2
- package/dist/docs/tech/contracts/README.docblock.js +21 -1
- package/dist/docs/tech/contracts/create-subscription.docblock.js +21 -1
- package/dist/docs/tech/contracts/graphql-typed-outputs.docblock.js +21 -180
- package/dist/docs/tech/contracts/migrations.docblock.js +21 -1
- package/dist/docs/tech/contracts/openapi-export.docblock.js +22 -2
- package/dist/docs/tech/contracts/ops-to-presentation-linking.docblock.js +19 -60
- package/dist/docs/tech/contracts/overlays.docblock.js +21 -68
- package/dist/docs/tech/contracts/tests.docblock.js +21 -132
- package/dist/docs/tech/contracts/themes.docblock.js +21 -1
- package/dist/docs/tech/contracts/vertical-pocket-family-office.docblock.js +21 -106
- package/dist/docs/tech/lifecycle-stage-system.docblock.js +17 -213
- package/dist/docs/tech/llm/llm-integration.docblock.js +74 -5
- package/dist/docs/tech/mcp-endpoints.docblock.js +38 -1
- package/dist/docs/tech/presentation-runtime.docblock.js +17 -1
- package/dist/docs/tech/schema/README.docblock.js +21 -262
- package/dist/docs/tech/studio/learning-events.docblock.js +49 -1
- package/dist/docs/tech/studio/learning-journeys.docblock.js +25 -2
- package/dist/docs/tech/studio/platform-admin-panel.docblock.js +24 -2
- package/dist/docs/tech/studio/project-access-teams.docblock.js +26 -16
- package/dist/docs/tech/studio/project-routing.docblock.js +68 -1
- package/dist/docs/tech/studio/sandbox-unlogged.docblock.js +23 -2
- package/dist/docs/tech/studio/team-invitations.docblock.js +41 -36
- package/dist/docs/tech/studio/workspace-ops.docblock.js +48 -1
- package/dist/docs/tech/studio/workspaces.docblock.js +24 -2
- package/dist/docs/tech/telemetry-ingest.docblock.js +37 -3
- package/dist/docs/tech/templates/runtime.docblock.js +21 -1
- package/dist/docs/tech/vscode-extension.docblock.js +37 -3
- package/dist/docs/tech/workflows/overview.docblock.js +21 -1
- package/dist/docs/tech-contracts.docs.js +19 -2
- package/dist/events.js +12 -1
- package/dist/experiments/docs/experiments.docblock.js +22 -128
- package/dist/experiments/evaluator.js +101 -1
- package/dist/experiments/spec.js +33 -1
- package/dist/features.js +68 -1
- package/dist/forms/docs/forms.docblock.js +22 -1
- package/dist/forms.js +119 -1
- package/dist/index.js +107 -1
- package/dist/install.js +40 -1
- package/dist/integrations/contracts.d.ts +102 -102
- package/dist/integrations/contracts.js +388 -1
- package/dist/integrations/docs/integrations.docblock.js +95 -1
- package/dist/integrations/health.js +69 -1
- package/dist/integrations/index.js +23 -1
- package/dist/integrations/openbanking/contracts/accounts.d.ts +66 -66
- package/dist/integrations/openbanking/contracts/accounts.js +237 -1
- package/dist/integrations/openbanking/contracts/balances.d.ts +34 -34
- package/dist/integrations/openbanking/contracts/balances.js +167 -1
- package/dist/integrations/openbanking/contracts/index.js +12 -1
- package/dist/integrations/openbanking/contracts/transactions.d.ts +48 -48
- package/dist/integrations/openbanking/contracts/transactions.js +218 -1
- package/dist/integrations/openbanking/guards.js +32 -1
- package/dist/integrations/openbanking/models.d.ts +55 -55
- package/dist/integrations/openbanking/models.js +242 -1
- package/dist/integrations/openbanking/openbanking.feature.js +68 -1
- package/dist/integrations/openbanking/telemetry.js +39 -1
- package/dist/integrations/providers/elevenlabs.js +56 -1
- package/dist/integrations/providers/gcs-storage.js +79 -1
- package/dist/integrations/providers/gmail.js +91 -1
- package/dist/integrations/providers/google-calendar.js +70 -1
- package/dist/integrations/providers/impls/elevenlabs-voice.js +95 -1
- package/dist/integrations/providers/impls/gcs-storage.js +88 -1
- package/dist/integrations/providers/impls/gmail-inbound.js +200 -1
- package/dist/integrations/providers/impls/gmail-outbound.js +104 -5
- package/dist/integrations/providers/impls/google-calendar.js +154 -1
- package/dist/integrations/providers/impls/index.js +16 -1
- package/dist/integrations/providers/impls/mistral-embedding.js +41 -1
- package/dist/integrations/providers/impls/mistral-llm.js +247 -1
- package/dist/integrations/providers/impls/postmark-email.js +55 -1
- package/dist/integrations/providers/impls/powens-client.js +171 -1
- package/dist/integrations/providers/impls/powens-openbanking.js +218 -1
- package/dist/integrations/providers/impls/provider-factory.js +142 -1
- package/dist/integrations/providers/impls/qdrant-vector.js +69 -1
- package/dist/integrations/providers/impls/stripe-payments.js +202 -1
- package/dist/integrations/providers/impls/twilio-sms.js +58 -1
- package/dist/integrations/providers/index.js +13 -1
- package/dist/integrations/providers/mistral.js +72 -1
- package/dist/integrations/providers/postmark.js +72 -1
- package/dist/integrations/providers/powens.js +120 -1
- package/dist/integrations/providers/qdrant.js +77 -1
- package/dist/integrations/providers/registry.js +34 -1
- package/dist/integrations/providers/stripe.js +87 -1
- package/dist/integrations/providers/twilio-sms.js +65 -1
- package/dist/integrations/runtime.js +186 -1
- package/dist/integrations/secrets/aws-secret-manager.js +231 -1
- package/dist/integrations/secrets/env-secret-provider.js +81 -1
- package/dist/integrations/secrets/gcp-secret-manager.js +229 -1
- package/dist/integrations/secrets/index.js +8 -1
- package/dist/integrations/secrets/manager.js +103 -1
- package/dist/integrations/secrets/provider.js +58 -1
- package/dist/integrations/secrets/scaleway-secret-manager.js +247 -1
- package/dist/integrations/spec.js +39 -1
- package/dist/jobs/define-job.js +16 -1
- package/dist/jobs/gcp-cloud-tasks.js +53 -1
- package/dist/jobs/gcp-pubsub.js +39 -1
- package/dist/jobs/handlers/gmail-sync-handler.js +9 -1
- package/dist/jobs/handlers/index.js +12 -1
- package/dist/jobs/handlers/ping-handler.js +15 -1
- package/dist/jobs/handlers/storage-document-handler.js +14 -1
- package/dist/jobs/index.js +4 -1
- package/dist/jobs/memory-queue.js +71 -1
- package/dist/jobs/queue.js +33 -1
- package/dist/jobs/scaleway-sqs-queue.js +153 -1
- package/dist/jsonschema.d.ts +3 -3
- package/dist/jsonschema.js +32 -1
- package/dist/knowledge/contracts.d.ts +66 -66
- package/dist/knowledge/contracts.js +317 -1
- package/dist/knowledge/docs/knowledge.docblock.js +22 -138
- package/dist/knowledge/index.js +10 -1
- package/dist/knowledge/ingestion/document-processor.js +54 -1
- package/dist/knowledge/ingestion/embedding-service.js +25 -1
- package/dist/knowledge/ingestion/gmail-adapter.js +50 -5
- package/dist/knowledge/ingestion/index.js +7 -1
- package/dist/knowledge/ingestion/storage-adapter.js +26 -1
- package/dist/knowledge/ingestion/vector-indexer.js +32 -1
- package/dist/knowledge/query/index.js +3 -1
- package/dist/knowledge/query/service.js +64 -2
- package/dist/knowledge/runtime.js +49 -1
- package/dist/knowledge/spaces/email-threads.js +38 -1
- package/dist/knowledge/spaces/financial-docs.js +38 -1
- package/dist/knowledge/spaces/financial-overview.js +42 -1
- package/dist/knowledge/spaces/index.js +8 -1
- package/dist/knowledge/spaces/product-canon.js +38 -1
- package/dist/knowledge/spaces/support-faq.js +41 -1
- package/dist/knowledge/spaces/uploaded-docs.js +38 -1
- package/dist/knowledge/spec.js +39 -1
- package/dist/llm/exporters.js +541 -8
- package/dist/llm/index.js +4 -1
- package/dist/llm/prompts.js +246 -56
- package/dist/markdown.js +116 -3
- package/dist/migrations.js +33 -1
- package/dist/onboarding-base.d.ts +29 -29
- package/dist/onboarding-base.js +196 -1
- package/dist/openapi.js +75 -1
- package/dist/openbanking/docs/openbanking.docblock.js +22 -109
- package/dist/ownership.js +40 -1
- package/dist/policy/docs/policy.docblock.js +22 -1
- package/dist/policy/engine.js +223 -1
- package/dist/policy/opa-adapter.js +71 -1
- package/dist/policy/spec.js +33 -1
- package/dist/presentations/docs/presentations-conventions.docblock.js +21 -7
- package/dist/presentations.backcompat.js +47 -1
- package/dist/presentations.d.ts +3 -3
- package/dist/presentations.js +66 -1
- package/dist/presentations.v2.js +278 -6
- package/dist/prompt.js +10 -1
- package/dist/promptRegistry.js +34 -1
- package/dist/regenerator/docs/regenerator.docblock.js +22 -184
- package/dist/regenerator/executor.js +86 -1
- package/dist/regenerator/index.js +6 -1
- package/dist/regenerator/service.js +92 -1
- package/dist/regenerator/sinks.js +32 -1
- package/dist/regenerator/utils.js +51 -1
- package/dist/registry.js +208 -1
- package/dist/resources.js +47 -1
- package/dist/schema/dist/EnumType.js +2 -1
- package/dist/schema/dist/FieldType.js +49 -1
- package/dist/schema/dist/ScalarTypeEnum.js +236 -1
- package/dist/schema/dist/SchemaModel.js +39 -1
- package/dist/schema/dist/entity/defineEntity.js +1 -1
- package/dist/schema/dist/entity/index.js +2 -1
- package/dist/schema/dist/entity/types.js +1 -1
- package/dist/schema/dist/index.js +6 -1
- package/dist/schema-to-markdown.js +214 -10
- package/dist/server/graphql-pothos.js +128 -1
- package/dist/server/index.js +10 -1
- package/dist/server/mcp/createMcpServer.js +28 -1
- package/dist/server/mcp/registerPresentations.js +151 -1
- package/dist/server/mcp/registerPrompts.js +36 -2
- package/dist/server/mcp/registerResources.js +35 -1
- package/dist/server/mcp/registerTools.js +22 -1
- package/dist/server/provider-mcp.js +3 -1
- package/dist/server/rest-elysia.js +20 -1
- package/dist/server/rest-express.js +39 -1
- package/dist/server/rest-generic.js +125 -1
- package/dist/server/rest-next-app.js +38 -1
- package/dist/server/rest-next-mcp.js +45 -1
- package/dist/server/rest-next-pages.js +25 -1
- package/dist/spec.js +35 -1
- package/dist/telemetry/anomaly.js +48 -1
- package/dist/telemetry/docs/telemetry.docblock.js +22 -139
- package/dist/telemetry/index.js +5 -1
- package/dist/telemetry/spec.js +69 -1
- package/dist/telemetry/tracker.js +76 -1
- package/dist/tests/index.js +4 -1
- package/dist/tests/runner.js +150 -1
- package/dist/tests/spec.js +33 -1
- package/dist/themes.js +39 -1
- package/dist/workflow/adapters/db-adapter.js +83 -1
- package/dist/workflow/adapters/file-adapter.js +11 -1
- package/dist/workflow/adapters/index.js +5 -1
- package/dist/workflow/adapters/memory-store.js +58 -1
- package/dist/workflow/expression.js +98 -1
- package/dist/workflow/index.js +9 -1
- package/dist/workflow/runner.js +337 -1
- package/dist/workflow/sla-monitor.js +47 -1
- package/dist/workflow/spec.js +32 -1
- package/dist/workflow/validation.js +175 -1
- package/package.json +11 -4
|
@@ -1 +1,101 @@
|
|
|
1
|
-
import{createHash
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
|
|
3
|
+
//#region src/experiments/evaluator.ts
|
|
4
|
+
var ExperimentEvaluator = class {
|
|
5
|
+
registry;
|
|
6
|
+
policyChecker;
|
|
7
|
+
expressionEvaluator;
|
|
8
|
+
constructor(config) {
|
|
9
|
+
this.registry = config.registry;
|
|
10
|
+
this.policyChecker = config.policyChecker;
|
|
11
|
+
this.expressionEvaluator = config.expressionEvaluator;
|
|
12
|
+
}
|
|
13
|
+
async chooseVariant(context) {
|
|
14
|
+
const experiment = this.registry.get(context.experiment, context.version);
|
|
15
|
+
if (!experiment) return null;
|
|
16
|
+
const control = experiment.variants.find((variant) => variant.id === experiment.controlVariant);
|
|
17
|
+
if (!control) throw new Error(`Experiment ${experiment.meta.name} missing control variant ${experiment.controlVariant}`);
|
|
18
|
+
switch (experiment.allocation.type) {
|
|
19
|
+
case "random": return {
|
|
20
|
+
variant: this.pickByWeight(experiment, this.randomSeed(context, experiment.allocation.salt)),
|
|
21
|
+
reason: "random"
|
|
22
|
+
};
|
|
23
|
+
case "sticky": return {
|
|
24
|
+
variant: this.pickByWeight(experiment, this.stickySeed(context, experiment.allocation.attribute, experiment.allocation.salt)),
|
|
25
|
+
reason: "sticky"
|
|
26
|
+
};
|
|
27
|
+
case "targeted": {
|
|
28
|
+
const targeted = await this.evaluateTargeting(experiment, context, experiment.allocation.rules);
|
|
29
|
+
if (targeted) return {
|
|
30
|
+
variant: targeted,
|
|
31
|
+
reason: "targeted"
|
|
32
|
+
};
|
|
33
|
+
if (experiment.allocation.fallback === "random") return {
|
|
34
|
+
variant: this.pickByWeight(experiment, this.randomSeed(context)),
|
|
35
|
+
reason: "random"
|
|
36
|
+
};
|
|
37
|
+
return {
|
|
38
|
+
variant: control,
|
|
39
|
+
reason: "control"
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
default: return {
|
|
43
|
+
variant: control,
|
|
44
|
+
reason: "control"
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
pickByWeight(experiment, seed) {
|
|
49
|
+
const variants = experiment.variants;
|
|
50
|
+
const target = seed * variants.reduce((sum, variant) => sum + (variant.weight ?? 1), 0);
|
|
51
|
+
let cumulative = 0;
|
|
52
|
+
for (const variant of variants) {
|
|
53
|
+
cumulative += variant.weight ?? 1;
|
|
54
|
+
if (target <= cumulative) return variant;
|
|
55
|
+
}
|
|
56
|
+
return variants[variants.length - 1];
|
|
57
|
+
}
|
|
58
|
+
randomSeed(context, salt = "") {
|
|
59
|
+
const base = context.sessionId ?? context.userId ?? context.organizationId ?? `${Date.now()}-${Math.random()}`;
|
|
60
|
+
return this.hashToUnitInterval(base + salt);
|
|
61
|
+
}
|
|
62
|
+
stickySeed(context, attribute, salt = "") {
|
|
63
|
+
const value = context[attribute];
|
|
64
|
+
if (!value) return this.randomSeed(context, salt);
|
|
65
|
+
return this.hashToUnitInterval(`${value}-${salt}`);
|
|
66
|
+
}
|
|
67
|
+
hashToUnitInterval(value) {
|
|
68
|
+
const hash = createHash("sha256").update(value).digest("hex").slice(0, 15);
|
|
69
|
+
return parseInt(hash, 16) % 1e6 / 1e6;
|
|
70
|
+
}
|
|
71
|
+
async evaluateTargeting(experiment, context, rules) {
|
|
72
|
+
for (const rule of rules) {
|
|
73
|
+
if (!await this.matchesRule(rule, context)) continue;
|
|
74
|
+
const variant = experiment.variants.find((v) => v.id === rule.variantId);
|
|
75
|
+
if (!variant) continue;
|
|
76
|
+
if (typeof rule.percentage === "number") {
|
|
77
|
+
if (this.randomSeed(context, `rule-${rule.variantId}`) > rule.percentage) continue;
|
|
78
|
+
}
|
|
79
|
+
return variant;
|
|
80
|
+
}
|
|
81
|
+
return null;
|
|
82
|
+
}
|
|
83
|
+
async matchesRule(rule, context) {
|
|
84
|
+
if (rule.policy && this.policyChecker) {
|
|
85
|
+
if (!await this.policyChecker(rule.policy, context)) return false;
|
|
86
|
+
}
|
|
87
|
+
if (rule.expression) {
|
|
88
|
+
if (this.expressionEvaluator) return Boolean(this.expressionEvaluator(rule.expression, context));
|
|
89
|
+
try {
|
|
90
|
+
const fn = new Function("context", `return (${rule.expression});`);
|
|
91
|
+
return Boolean(fn(context));
|
|
92
|
+
} catch (_error) {
|
|
93
|
+
return false;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
return true;
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
//#endregion
|
|
101
|
+
export { ExperimentEvaluator };
|
package/dist/experiments/spec.js
CHANGED
|
@@ -1 +1,33 @@
|
|
|
1
|
-
|
|
1
|
+
//#region src/experiments/spec.ts
|
|
2
|
+
const experimentKey = (meta) => `${meta.name}.v${meta.version}`;
|
|
3
|
+
var ExperimentRegistry = class {
|
|
4
|
+
items = /* @__PURE__ */ new Map();
|
|
5
|
+
register(spec) {
|
|
6
|
+
const key = experimentKey(spec.meta);
|
|
7
|
+
if (this.items.has(key)) throw new Error(`Duplicate experiment ${key}`);
|
|
8
|
+
this.items.set(key, spec);
|
|
9
|
+
return this;
|
|
10
|
+
}
|
|
11
|
+
list() {
|
|
12
|
+
return [...this.items.values()];
|
|
13
|
+
}
|
|
14
|
+
get(name, version) {
|
|
15
|
+
if (version != null) return this.items.get(`${name}.v${version}`);
|
|
16
|
+
let latest;
|
|
17
|
+
let maxVersion = -Infinity;
|
|
18
|
+
for (const spec of this.items.values()) {
|
|
19
|
+
if (spec.meta.name !== name) continue;
|
|
20
|
+
if (spec.meta.version > maxVersion) {
|
|
21
|
+
maxVersion = spec.meta.version;
|
|
22
|
+
latest = spec;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return latest;
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
function makeExperimentKey(meta) {
|
|
29
|
+
return experimentKey(meta);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
//#endregion
|
|
33
|
+
export { ExperimentRegistry, makeExperimentKey };
|
package/dist/features.js
CHANGED
|
@@ -1 +1,68 @@
|
|
|
1
|
-
|
|
1
|
+
//#region src/features.ts
|
|
2
|
+
function keyOf(f) {
|
|
3
|
+
return f.meta.key;
|
|
4
|
+
}
|
|
5
|
+
/** In-memory registry for FeatureModuleSpec. */
|
|
6
|
+
var FeatureRegistry = class {
|
|
7
|
+
items = /* @__PURE__ */ new Map();
|
|
8
|
+
/** Register a feature module. Throws when the key already exists. */
|
|
9
|
+
register(f) {
|
|
10
|
+
const key = keyOf(f);
|
|
11
|
+
if (this.items.has(key)) throw new Error(`Duplicate feature ${key}`);
|
|
12
|
+
this.items.set(key, f);
|
|
13
|
+
return this;
|
|
14
|
+
}
|
|
15
|
+
/** List all registered feature modules. */
|
|
16
|
+
list() {
|
|
17
|
+
return [...this.items.values()];
|
|
18
|
+
}
|
|
19
|
+
/** Get a feature by its key (slug). */
|
|
20
|
+
get(key) {
|
|
21
|
+
return this.items.get(key);
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
/** Validate and register a feature against optional registries/descriptors. */
|
|
25
|
+
function installFeature(feature, deps) {
|
|
26
|
+
if (deps.ops && feature.operations) {
|
|
27
|
+
for (const o of feature.operations) if (!deps.ops.getSpec(o.name, o.version)) throw new Error(`installFeature: operation not found ${o.name}.v${o.version}`);
|
|
28
|
+
}
|
|
29
|
+
if (deps.presentations && feature.presentations) {
|
|
30
|
+
for (const p of feature.presentations) if (!deps.presentations.get(p.name, p.version)) throw new Error(`installFeature: presentation not found ${p.name}.v${p.version}`);
|
|
31
|
+
}
|
|
32
|
+
if (feature.presentationsTargets && deps.descriptorsV2) for (const req of feature.presentationsTargets) {
|
|
33
|
+
const d = deps.descriptorsV2.find((x) => x.meta.name === req.name && x.meta.version === req.version);
|
|
34
|
+
if (!d) throw new Error(`installFeature: V2 descriptor not found ${req.name}.v${req.version}`);
|
|
35
|
+
for (const t of req.targets) if (!d.targets.includes(t)) throw new Error(`installFeature: descriptor ${req.name}.v${req.version} missing target ${t}`);
|
|
36
|
+
}
|
|
37
|
+
if (feature.opToPresentation && feature.opToPresentation.length > 0) for (const link of feature.opToPresentation) {
|
|
38
|
+
if (deps.ops) {
|
|
39
|
+
if (!deps.ops.getSpec(link.op.name, link.op.version)) throw new Error(`installFeature: linked op not found ${link.op.name}.v${link.op.version}`);
|
|
40
|
+
}
|
|
41
|
+
if (deps.presentations) {
|
|
42
|
+
if (!deps.presentations.get(link.pres.name, link.pres.version)) throw new Error(`installFeature: linked presentation not found ${link.pres.name}.v${link.pres.version}`);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
if (deps.capabilities && feature.capabilities?.provides) {
|
|
46
|
+
for (const cap of feature.capabilities.provides) if (!deps.capabilities.get(cap.key, cap.version)) throw new Error(`installFeature: capability not registered ${cap.key}.v${cap.version}`);
|
|
47
|
+
}
|
|
48
|
+
if (feature.capabilities?.requires?.length) {
|
|
49
|
+
if (!deps.capabilities) throw new Error(`installFeature: capability registry required to validate capability requirements for ${feature.meta.key}`);
|
|
50
|
+
const provided = feature.capabilities.provides ?? [];
|
|
51
|
+
for (const req of feature.capabilities.requires) if (!deps.capabilities.satisfies(req, provided)) throw new Error(`installFeature: capability requirement not satisfied ${req.key}${req.version ? `.v${req.version}` : ""}`);
|
|
52
|
+
}
|
|
53
|
+
deps.features.register(feature);
|
|
54
|
+
return deps.features;
|
|
55
|
+
}
|
|
56
|
+
/** Ensure declared target requirements exist on the provided descriptors. */
|
|
57
|
+
function validateFeatureTargetsV2(feature, descriptors) {
|
|
58
|
+
if (!feature.presentationsTargets || feature.presentationsTargets.length === 0) return true;
|
|
59
|
+
for (const req of feature.presentationsTargets) {
|
|
60
|
+
const d = descriptors.find((x) => x.meta.name === req.name && x.meta.version === req.version);
|
|
61
|
+
if (!d) throw new Error(`V2 descriptor not found ${req.name}.v${req.version}`);
|
|
62
|
+
for (const t of req.targets) if (!d.targets.includes(t)) throw new Error(`Descriptor ${req.name}.v${req.version} missing target ${t}`);
|
|
63
|
+
}
|
|
64
|
+
return true;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
//#endregion
|
|
68
|
+
export { FeatureRegistry, installFeature, validateFeatureTargetsV2 };
|
|
@@ -1 +1,22 @@
|
|
|
1
|
-
import{registerDocBlocks
|
|
1
|
+
import { registerDocBlocks } from "../../docs/registry.js";
|
|
2
|
+
import "../../registry.js";
|
|
3
|
+
|
|
4
|
+
//#region src/forms/docs/forms.docblock.ts
|
|
5
|
+
const tech_contracts_forms_DocBlocks = [{
|
|
6
|
+
id: "docs.tech.contracts.forms",
|
|
7
|
+
title: "Contracts: FormSpec",
|
|
8
|
+
summary: "This document defines the canonical contracts for declarative forms.",
|
|
9
|
+
kind: "reference",
|
|
10
|
+
visibility: "public",
|
|
11
|
+
route: "/docs/tech/contracts/forms",
|
|
12
|
+
tags: [
|
|
13
|
+
"tech",
|
|
14
|
+
"contracts",
|
|
15
|
+
"forms"
|
|
16
|
+
],
|
|
17
|
+
body: "# Contracts: FormSpec\n\nThis document defines the canonical contracts for declarative forms.\n\n## Overview\n\n- `FormSpec` (in `@lssm/lib.contracts/forms`) declares:\n - `meta` (extends `OwnerShipMeta`) + `key`/`version` for stability.\n - `model` (`@lssm/lib.schema` `SchemaModel`) as the single source of truth.\n - `fields` built from `FieldSpec` kinds: `text`, `textarea`, `select`, `checkbox`, `radio`, `switch`, `group`, `array`.\n - Optional `actions`, `policy.flags`, `constraints` and `renderHints`.\n- Relations DSL provides `visibleWhen`, `enabledWhen`, `requiredWhen` based on predicates.\n- `buildZodWithRelations(spec)` augments the base zod with conditional rules and constraints.\n- React adapter renders with React Hook Form + driver API for UI components (shadcn driver provided).\n\n## Driver API (UI-agnostic)\n\nHost apps supply a driver mapping slots → components:\n\n- Required: `Field`, `FieldLabel`, `FieldDescription`, `FieldError`, `Input`, `Textarea`, `Select`, `Checkbox`, `RadioGroup`, `Switch`, `Button`.\n- Optional: `FieldGroup`, `FieldSet`, `FieldLegend` and input group helpers.\n\nUse `createFormRenderer({ driver })` to obtain a `render(spec)` function.\n\n## Arrays and Groups\n\n- `array` items are rendered with `useFieldArray`, honoring `min`/`max` and add/remove controls.\n- `group` composes nested fields and provides optional legend/description.\n\n## Feature Flags\n\n- Declare `policy.flags` on forms to signal gating. Gate usage at host boundary; avoid scattering flags across individual fields.\n\n## Example\n\nSee `packages/hcircle/apps/web-coliving/src/forms/bug-report.spec.ts` for a concrete form spec and `components/forms/BugReportFormDemo.tsx` for rendering with a minimal shadcn driver mapping.\n"
|
|
18
|
+
}];
|
|
19
|
+
registerDocBlocks(tech_contracts_forms_DocBlocks);
|
|
20
|
+
|
|
21
|
+
//#endregion
|
|
22
|
+
export { tech_contracts_forms_DocBlocks };
|
package/dist/forms.js
CHANGED
|
@@ -1 +1,119 @@
|
|
|
1
|
-
|
|
1
|
+
//#region src/forms.ts
|
|
2
|
+
function formKey(meta) {
|
|
3
|
+
return `${meta.key}.v${meta.version}`;
|
|
4
|
+
}
|
|
5
|
+
var FormRegistry = class {
|
|
6
|
+
items = /* @__PURE__ */ new Map();
|
|
7
|
+
register(spec) {
|
|
8
|
+
const key = formKey(spec.meta);
|
|
9
|
+
if (this.items.has(key)) throw new Error(`Duplicate form ${key}`);
|
|
10
|
+
this.items.set(key, spec);
|
|
11
|
+
return this;
|
|
12
|
+
}
|
|
13
|
+
list() {
|
|
14
|
+
return [...this.items.values()];
|
|
15
|
+
}
|
|
16
|
+
get(key, version) {
|
|
17
|
+
if (version != null) return this.items.get(`${key}.v${version}`);
|
|
18
|
+
let candidate;
|
|
19
|
+
let max = -Infinity;
|
|
20
|
+
for (const [k, v] of this.items.entries()) {
|
|
21
|
+
if (!k.startsWith(`${key}.v`)) continue;
|
|
22
|
+
if (v.meta.version > max) {
|
|
23
|
+
max = v.meta.version;
|
|
24
|
+
candidate = v;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return candidate;
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
function getAtPath(values, path) {
|
|
31
|
+
if (!path) return void 0;
|
|
32
|
+
const segs = path.replace(/\[(\d+)\]/g, ".$1").split(".").filter(Boolean);
|
|
33
|
+
let cur = values;
|
|
34
|
+
for (const s of segs) {
|
|
35
|
+
if (cur == null) return void 0;
|
|
36
|
+
cur = cur[s];
|
|
37
|
+
}
|
|
38
|
+
return cur;
|
|
39
|
+
}
|
|
40
|
+
function evalPredicate(values, pred) {
|
|
41
|
+
if (!pred) return true;
|
|
42
|
+
if (pred.not) return !evalPredicate(values, pred.not);
|
|
43
|
+
if (pred.all && pred.all.length) return pred.all.every((p) => evalPredicate(values, p));
|
|
44
|
+
if (pred.any && pred.any.length) return pred.any.some((p) => evalPredicate(values, p));
|
|
45
|
+
if (pred.when) {
|
|
46
|
+
const { path, op = "truthy", value } = pred.when;
|
|
47
|
+
const v = getAtPath(values, path);
|
|
48
|
+
switch (op) {
|
|
49
|
+
case "equals": return v === value;
|
|
50
|
+
case "notEquals": return v !== value;
|
|
51
|
+
case "in": return Array.isArray(value) && value.includes(v);
|
|
52
|
+
case "notIn": return Array.isArray(value) && !value.includes(v);
|
|
53
|
+
case "gt": return Number(v) > Number(value);
|
|
54
|
+
case "gte": return Number(v) >= Number(value);
|
|
55
|
+
case "lt": return Number(v) < Number(value);
|
|
56
|
+
case "lte": return Number(v) <= Number(value);
|
|
57
|
+
case "empty": return v == null || (Array.isArray(v) ? v.length === 0 : String(v).length === 0);
|
|
58
|
+
case "lengthGt": return (Array.isArray(v) || typeof v === "string") && v.length > Number(value ?? 0);
|
|
59
|
+
case "lengthGte": return (Array.isArray(v) || typeof v === "string") && v.length >= Number(value ?? 0);
|
|
60
|
+
case "lengthLt": return (Array.isArray(v) || typeof v === "string") && v.length < Number(value ?? 0);
|
|
61
|
+
case "lengthLte": return (Array.isArray(v) || typeof v === "string") && v.length <= Number(value ?? 0);
|
|
62
|
+
case "truthy":
|
|
63
|
+
default: return Boolean(v);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
return true;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Wrap the base zod schema with relation-driven refinements (requiredWhen, array min/max)
|
|
70
|
+
* and optional custom constraints. Call this when wiring RHF resolver.
|
|
71
|
+
*/
|
|
72
|
+
function buildZodWithRelations(spec, handlers) {
|
|
73
|
+
return spec.model.getZod().superRefine((values, ctx) => {
|
|
74
|
+
const visit = (field, parentPath) => {
|
|
75
|
+
const path = field.name ? parentPath ? `${parentPath}.${field.name}` : field.name : parentPath ?? "";
|
|
76
|
+
if (field.requiredWhen) {
|
|
77
|
+
if (evalPredicate(values, field.requiredWhen)) {
|
|
78
|
+
const v = getAtPath(values, path);
|
|
79
|
+
if (v == null || typeof v === "string" && v.trim().length === 0 || Array.isArray(v) && v.length === 0) ctx.addIssue({
|
|
80
|
+
code: "custom",
|
|
81
|
+
path: path.split("."),
|
|
82
|
+
message: "required"
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
if (field.kind === "array") {
|
|
87
|
+
const arr = getAtPath(values, path);
|
|
88
|
+
if (field.min != null && Array.isArray(arr) && arr.length < field.min) ctx.addIssue({
|
|
89
|
+
code: "custom",
|
|
90
|
+
path: path.split("."),
|
|
91
|
+
message: `min:${field.min}`
|
|
92
|
+
});
|
|
93
|
+
if (field.max != null && Array.isArray(arr) && arr.length > field.max) ctx.addIssue({
|
|
94
|
+
code: "custom",
|
|
95
|
+
path: path.split("."),
|
|
96
|
+
message: `max:${field.max}`
|
|
97
|
+
});
|
|
98
|
+
visit(field.of, path);
|
|
99
|
+
} else if (field.kind === "group") for (const child of field.fields) visit(child, path);
|
|
100
|
+
};
|
|
101
|
+
for (const f of spec.fields) visit(f);
|
|
102
|
+
if (spec.constraints && handlers) for (const c of spec.constraints) {
|
|
103
|
+
const fn = handlers[c.key];
|
|
104
|
+
if (!fn) continue;
|
|
105
|
+
const res = fn(values, c.paths, c.args);
|
|
106
|
+
if (!res.ok) ctx.addIssue({
|
|
107
|
+
code: "custom",
|
|
108
|
+
path: (res.path ?? c.paths[0] ?? "").split(".").filter(Boolean),
|
|
109
|
+
message: res.message ?? c.messageI18n
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
function defineFormSpec(spec) {
|
|
115
|
+
return spec;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
//#endregion
|
|
119
|
+
export { FormRegistry, buildZodWithRelations, defineFormSpec, evalPredicate };
|
package/dist/index.js
CHANGED
|
@@ -1 +1,107 @@
|
|
|
1
|
-
import{CapabilityRegistry as e,capabilityKey as t,defineCapability as n}from"./capabilities.js";import{DataViewRegistry as r,dataViewKey as i}from"./data-views.js";import{n as a}from"./schema/dist/SchemaModel.js";import"./schema/dist/index.js";import{defineEvent as o,eventKey as s}from"./events.js";import{FeatureRegistry as c,installFeature as l,validateFeatureTargetsV2 as u}from"./features.js";import{FormRegistry as d,buildZodWithRelations as f,defineFormSpec as p,evalPredicate as m}from"./forms.js";import{schemaToMarkdown as h,schemaToMarkdownDetail as g,schemaToMarkdownList as _,schemaToMarkdownSummary as v,schemaToMarkdownTable as y}from"./schema-to-markdown.js";import{TransformEngine as b,createDefaultTransformEngine as x,registerBasicValidation as S,registerDefaultReactRenderer as C,registerReactToMarkdownRenderer as w}from"./presentations.v2.js";import{createEngineWithDefaults as T,createFeatureModule as E,registerFeature as D,renderFeaturePresentation as O}from"./client/react/feature-render.js";import{createFormRenderer as k}from"./client/react/form-render.js";import{shadcnDriver as A}from"./client/react/drivers/shadcn.js";import{rnReusablesDriver as j}from"./client/react/drivers/rn-reusables.js";import"./client/index.js";import{defaultGqlField as M,defaultMcpTool as N,defaultRestPath as P,jsonSchemaForSpec as F}from"./jsonschema.js";import{registerContractsOnBuilder as I}from"./server/graphql-pothos.js";import{PresentationRegistry as L,jsonSchemaForPresentation as R}from"./presentations.js";import{createMcpServer as z}from"./server/mcp/createMcpServer.js";import{createFetchHandler as B}from"./server/rest-generic.js";import{elysiaPlugin as V}from"./server/rest-elysia.js";import{expressRouter as H}from"./server/rest-express.js";import{makeNextAppHandler as U}from"./server/rest-next-app.js";import{makeNextPagesHandler as W}from"./server/rest-next-pages.js";import"./server/index.js";import{defineCommand as G,defineQuery as K,isEmitDeclRef as q}from"./spec.js";import{docBlockToPresentationSpec as J,docBlockToPresentationV2 as Y,docBlocksToPresentationRoutes as X,docBlocksToPresentationSpecs as Z,mapDocRoutes as Q}from"./docs/presentations.js";import{DocRegistry as $,defaultDocRegistry as ee,docId as te,listRegisteredDocBlocks as ne,registerDocBlocks as re}from"./docs/registry.js";import{SpecRegistry as ie,opKey as ae}from"./registry.js";import{Owners as oe,OwnersEnum as se,StabilityEnum as ce,Tags as le,TagsEnum as ue}from"./ownership.js";import{ContractRegistryFileSchema as de,ContractRegistryItemSchema as fe,ContractRegistryItemTypeSchema as pe,ContractRegistryManifestSchema as me}from"./contract-registry/schemas.js";import"./contract-registry/index.js";import{installOp as he,makeEmit as ge,op as _e}from"./install.js";import{openApiForRegistry as ve}from"./openapi.js";import{definePrompt as ye}from"./prompt.js";import{PromptRegistry as be}from"./promptRegistry.js";import{ResourceRegistry as xe,defineResourceTemplate as Se,isResourceRef as Ce,resourceRef as we}from"./resources.js";import{toV2FromV1 as Te}from"./presentations.backcompat.js";import{CompleteOnboardingBaseInput as Ee,CompleteOnboardingBaseOutput as De,CompleteOnboardingBaseSpec as Oe,DeleteOnboardingDraftBaseSpec as ke,DeleteOnboardingDraftOutput as Ae,GetOnboardingDraftBaseSpec as je,GetOnboardingDraftOutput as Me,SaveOnboardingDraftBaseSpec as Ne,SaveOnboardingDraftInput as Pe,SaveOnboardingDraftOutput as Fe}from"./onboarding-base.js";import{openBankingAccountsReadCapability as Ie,openBankingBalancesReadCapability as Le,openBankingTransactionsReadCapability as Re,registerOpenBankingCapabilities as ze}from"./capabilities/openbanking.js";import{PolicyRegistry as Be,makePolicyKey as Ve}from"./policy/spec.js";import{PolicyEngine as He}from"./policy/engine.js";import{OPAPolicyAdapter as Ue,buildOPAInput as We}from"./policy/opa-adapter.js";import{ThemeRegistry as Ge,makeThemeRef as Ke}from"./themes.js";import{MigrationRegistry as qe}from"./migrations.js";import{TelemetryRegistry as Je,makeTelemetryKey as Ye}from"./telemetry/spec.js";import{TelemetryTracker as Xe}from"./telemetry/tracker.js";import{TelemetryAnomalyMonitor as Ze}from"./telemetry/anomaly.js";import"./telemetry/index.js";import{TestRegistry as Qe,makeTestKey as $e}from"./tests/spec.js";import{TestRunner as et}from"./tests/runner.js";import"./tests/index.js";import{ExperimentRegistry as tt,makeExperimentKey as nt}from"./experiments/spec.js";import{ExperimentEvaluator as rt}from"./experiments/evaluator.js";import{AppBlueprintRegistry as it,makeAppBlueprintKey as at}from"./app-config/spec.js";import{composeAppConfig as ot,resolveAppConfig as st}from"./app-config/runtime.js";import{IntegrationSpecRegistry as ct,makeIntegrationSpecKey as lt}from"./integrations/spec.js";import{registerStripeIntegration as ut,stripeIntegrationSpec as dt}from"./integrations/providers/stripe.js";import{postmarkIntegrationSpec as ft,registerPostmarkIntegration as pt}from"./integrations/providers/postmark.js";import{qdrantIntegrationSpec as mt,registerQdrantIntegration as ht}from"./integrations/providers/qdrant.js";import{mistralIntegrationSpec as gt,registerMistralIntegration as _t}from"./integrations/providers/mistral.js";import{elevenLabsIntegrationSpec as vt,registerElevenLabsIntegration as yt}from"./integrations/providers/elevenlabs.js";import{gmailIntegrationSpec as bt,registerGmailIntegration as xt}from"./integrations/providers/gmail.js";import{googleCalendarIntegrationSpec as St,registerGoogleCalendarIntegration as Ct}from"./integrations/providers/google-calendar.js";import{registerTwilioSmsIntegration as wt,twilioSmsIntegrationSpec as Tt}from"./integrations/providers/twilio-sms.js";import{gcsStorageIntegrationSpec as Et,registerGcsStorageIntegration as Dt}from"./integrations/providers/gcs-storage.js";import{powensIntegrationSpec as Ot,registerPowensIntegration as kt}from"./integrations/providers/powens.js";import{createDefaultIntegrationSpecRegistry as At}from"./integrations/providers/registry.js";import{AccountBalanceRecord as jt,BankAccountRecord as Mt,BankTransactionRecord as Nt}from"./integrations/openbanking/models.js";import{OPENBANKING_PII_FIELDS as Pt,OPENBANKING_TELEMETRY_EVENTS as Ft,redactOpenBankingTelemetryPayload as It}from"./integrations/openbanking/telemetry.js";import{OpenBankingGetAccount as Lt,OpenBankingListAccounts as Rt,OpenBankingSyncAccounts as zt}from"./integrations/openbanking/contracts/accounts.js";import{OpenBankingListTransactions as Bt,OpenBankingSyncTransactions as Vt}from"./integrations/openbanking/contracts/transactions.js";import{OpenBankingGetBalances as Ht,OpenBankingRefreshBalances as Ut}from"./integrations/openbanking/contracts/balances.js";import{OpenBankingFeature as Wt}from"./integrations/openbanking/openbanking.feature.js";import{registerOpenBankingContracts as Gt}from"./integrations/openbanking/contracts/index.js";import{assertPrimaryOpenBankingReady as Kt,ensurePrimaryOpenBankingIntegration as qt}from"./integrations/openbanking/guards.js";import"./integrations/index.js";import{KnowledgeSpaceRegistry as Jt,makeKnowledgeSpaceKey as Yt}from"./knowledge/spec.js";import{productCanonKnowledgeSpace as Xt,registerProductCanonKnowledgeSpace as Zt}from"./knowledge/spaces/product-canon.js";import{registerSupportFaqKnowledgeSpace as Qt,supportFaqKnowledgeSpace as $t}from"./knowledge/spaces/support-faq.js";import{emailThreadsKnowledgeSpace as en,registerEmailThreadsKnowledgeSpace as tn}from"./knowledge/spaces/email-threads.js";import{registerUploadedDocsKnowledgeSpace as nn,uploadedDocsKnowledgeSpace as rn}from"./knowledge/spaces/uploaded-docs.js";import{financialDocsKnowledgeSpace as an,registerFinancialDocsKnowledgeSpace as on}from"./knowledge/spaces/financial-docs.js";import{financialOverviewKnowledgeSpace as sn,registerFinancialOverviewKnowledgeSpace as cn}from"./knowledge/spaces/financial-overview.js";import"./knowledge/index.js";import{CreateIntegrationConnection as ln,DeleteIntegrationConnection as un,ListIntegrationConnections as dn,TestIntegrationConnection as fn,UpdateIntegrationConnection as pn,integrationContracts as mn,registerIntegrationContracts as hn}from"./integrations/contracts.js";import{CreateKnowledgeSource as gn,DeleteKnowledgeSource as _n,ListKnowledgeSources as vn,TriggerKnowledgeSourceSync as yn,UpdateKnowledgeSource as bn,knowledgeContracts as xn,registerKnowledgeContracts as Sn}from"./knowledge/contracts.js";import{behaviorToEnvelope as Cn,errorToEnvelope as wn,telemetryToEnvelope as Tn}from"./regenerator/utils.js";import{RegeneratorService as En}from"./regenerator/service.js";import{ProposalExecutor as Dn}from"./regenerator/executor.js";import{ExecutorProposalSink as On}from"./regenerator/sinks.js";import"./regenerator/index.js";import{WorkflowRegistry as kn}from"./workflow/spec.js";import{WorkflowValidationError as An,assertWorkflowSpecValid as jn,validateWorkflowSpec as Mn}from"./workflow/validation.js";import{evaluateExpression as Nn}from"./workflow/expression.js";import{WorkflowPreFlightError as Pn,WorkflowRunner as Fn}from"./workflow/runner.js";import{InMemoryStateStore as In}from"./workflow/adapters/memory-store.js";import{PrismaStateStore as Ln}from"./workflow/adapters/db-adapter.js";import{createFileStateStore as Rn}from"./workflow/adapters/file-adapter.js";import"./workflow/index.js";import{techContractsDocs as zn}from"./docs/tech-contracts.docs.js";import{metaDocs as Bn}from"./docs/meta.docs.js";import"./docs/index.js";import{docBlockToMarkdown as Vn,eventToMarkdown as Hn,exportFeature as Un,exportSpec as Wn,featureToMarkdown as Gn,presentationToMarkdown as Kn,specToAgentPrompt as qn,specToContextMarkdown as Jn,specToFullMarkdown as Yn}from"./llm/exporters.js";import{AGENT_SYSTEM_PROMPTS as Xn,formatPlanForAgent as Zn,generateFixViolationsPrompt as Qn,generateImplementationPlan as $n,generateImplementationPrompt as er,generateReviewPrompt as tr,generateTestPrompt as nr,generateVerificationPrompt as rr}from"./llm/prompts.js";import"./llm/index.js";export{Xn as AGENT_SYSTEM_PROMPTS,jt as AccountBalanceRecord,it as AppBlueprintRegistry,Mt as BankAccountRecord,Nt as BankTransactionRecord,e as CapabilityRegistry,Ee as CompleteOnboardingBaseInput,De as CompleteOnboardingBaseOutput,Oe as CompleteOnboardingBaseSpec,de as ContractRegistryFileSchema,fe as ContractRegistryItemSchema,pe as ContractRegistryItemTypeSchema,me as ContractRegistryManifestSchema,ln as CreateIntegrationConnection,gn as CreateKnowledgeSource,r as DataViewRegistry,un as DeleteIntegrationConnection,_n as DeleteKnowledgeSource,ke as DeleteOnboardingDraftBaseSpec,Ae as DeleteOnboardingDraftOutput,$ as DocRegistry,On as ExecutorProposalSink,rt as ExperimentEvaluator,tt as ExperimentRegistry,c as FeatureRegistry,d as FormRegistry,je as GetOnboardingDraftBaseSpec,Me as GetOnboardingDraftOutput,In as InMemoryStateStore,ct as IntegrationSpecRegistry,Jt as KnowledgeSpaceRegistry,dn as ListIntegrationConnections,vn as ListKnowledgeSources,qe as MigrationRegistry,Ue as OPAPolicyAdapter,Pt as OPENBANKING_PII_FIELDS,Ft as OPENBANKING_TELEMETRY_EVENTS,Wt as OpenBankingFeature,Lt as OpenBankingGetAccount,Ht as OpenBankingGetBalances,Rt as OpenBankingListAccounts,Bt as OpenBankingListTransactions,Ut as OpenBankingRefreshBalances,zt as OpenBankingSyncAccounts,Vt as OpenBankingSyncTransactions,oe as Owners,se as OwnersEnum,He as PolicyEngine,Be as PolicyRegistry,L as PresentationRegistry,Ln as PrismaStateStore,be as PromptRegistry,Dn as ProposalExecutor,En as RegeneratorService,xe as ResourceRegistry,Ne as SaveOnboardingDraftBaseSpec,Pe as SaveOnboardingDraftInput,Fe as SaveOnboardingDraftOutput,ie as SpecRegistry,ce as StabilityEnum,le as Tags,ue as TagsEnum,Ze as TelemetryAnomalyMonitor,Je as TelemetryRegistry,Xe as TelemetryTracker,fn as TestIntegrationConnection,Qe as TestRegistry,et as TestRunner,Ge as ThemeRegistry,b as TransformEngine,yn as TriggerKnowledgeSourceSync,pn as UpdateIntegrationConnection,bn as UpdateKnowledgeSource,Pn as WorkflowPreFlightError,kn as WorkflowRegistry,Fn as WorkflowRunner,An as WorkflowValidationError,Kt as assertPrimaryOpenBankingReady,jn as assertWorkflowSpecValid,Cn as behaviorToEnvelope,We as buildOPAInput,f as buildZodWithRelations,t as capabilityKey,ot as composeAppConfig,At as createDefaultIntegrationSpecRegistry,x as createDefaultTransformEngine,T as createEngineWithDefaults,E as createFeatureModule,B as createFetchHandler,Rn as createFileStateStore,k as createFormRenderer,z as createMcpServer,i as dataViewKey,ee as defaultDocRegistry,M as defaultGqlField,N as defaultMcpTool,P as defaultRestPath,n as defineCapability,G as defineCommand,o as defineEvent,p as defineFormSpec,ye as definePrompt,K as defineQuery,Se as defineResourceTemplate,a as defineSchemaModel,Vn as docBlockToMarkdown,J as docBlockToPresentationSpec,Y as docBlockToPresentationV2,X as docBlocksToPresentationRoutes,Z as docBlocksToPresentationSpecs,te as docId,vt as elevenLabsIntegrationSpec,V as elysiaPlugin,en as emailThreadsKnowledgeSpace,qt as ensurePrimaryOpenBankingIntegration,wn as errorToEnvelope,m as evalPredicate,Nn as evaluateExpression,s as eventKey,Hn as eventToMarkdown,Un as exportFeature,Wn as exportSpec,H as expressRouter,Gn as featureToMarkdown,an as financialDocsKnowledgeSpace,sn as financialOverviewKnowledgeSpace,Zn as formatPlanForAgent,Et as gcsStorageIntegrationSpec,Qn as generateFixViolationsPrompt,$n as generateImplementationPlan,er as generateImplementationPrompt,tr as generateReviewPrompt,nr as generateTestPrompt,rr as generateVerificationPrompt,bt as gmailIntegrationSpec,St as googleCalendarIntegrationSpec,l as installFeature,he as installOp,mn as integrationContracts,q as isEmitDeclRef,Ce as isResourceRef,R as jsonSchemaForPresentation,F as jsonSchemaForSpec,xn as knowledgeContracts,ne as listRegisteredDocBlocks,at as makeAppBlueprintKey,ge as makeEmit,nt as makeExperimentKey,lt as makeIntegrationSpecKey,Yt as makeKnowledgeSpaceKey,U as makeNextAppHandler,W as makeNextPagesHandler,Ve as makePolicyKey,Ye as makeTelemetryKey,$e as makeTestKey,Ke as makeThemeRef,Q as mapDocRoutes,Bn as metaDocs,gt as mistralIntegrationSpec,_e as op,ae as opKey,ve as openApiForRegistry,Ie as openBankingAccountsReadCapability,Le as openBankingBalancesReadCapability,Re as openBankingTransactionsReadCapability,ft as postmarkIntegrationSpec,Ot as powensIntegrationSpec,Kn as presentationToMarkdown,Xt as productCanonKnowledgeSpace,mt as qdrantIntegrationSpec,It as redactOpenBankingTelemetryPayload,S as registerBasicValidation,I as registerContractsOnBuilder,C as registerDefaultReactRenderer,re as registerDocBlocks,yt as registerElevenLabsIntegration,tn as registerEmailThreadsKnowledgeSpace,D as registerFeature,on as registerFinancialDocsKnowledgeSpace,cn as registerFinancialOverviewKnowledgeSpace,Dt as registerGcsStorageIntegration,xt as registerGmailIntegration,Ct as registerGoogleCalendarIntegration,hn as registerIntegrationContracts,Sn as registerKnowledgeContracts,_t as registerMistralIntegration,ze as registerOpenBankingCapabilities,Gt as registerOpenBankingContracts,pt as registerPostmarkIntegration,kt as registerPowensIntegration,Zt as registerProductCanonKnowledgeSpace,ht as registerQdrantIntegration,w as registerReactToMarkdownRenderer,ut as registerStripeIntegration,Qt as registerSupportFaqKnowledgeSpace,wt as registerTwilioSmsIntegration,nn as registerUploadedDocsKnowledgeSpace,O as renderFeaturePresentation,st as resolveAppConfig,we as resourceRef,j as rnReusablesDriver,h as schemaToMarkdown,g as schemaToMarkdownDetail,_ as schemaToMarkdownList,v as schemaToMarkdownSummary,y as schemaToMarkdownTable,A as shadcnDriver,qn as specToAgentPrompt,Jn as specToContextMarkdown,Yn as specToFullMarkdown,dt as stripeIntegrationSpec,$t as supportFaqKnowledgeSpace,zn as techContractsDocs,Tn as telemetryToEnvelope,Te as toV2FromV1,Tt as twilioSmsIntegrationSpec,rn as uploadedDocsKnowledgeSpace,u as validateFeatureTargetsV2,Mn as validateWorkflowSpec};
|
|
1
|
+
import { CapabilityRegistry, capabilityKey, defineCapability } from "./capabilities.js";
|
|
2
|
+
import { DataViewRegistry, dataViewKey } from "./data-views.js";
|
|
3
|
+
import { defineSchemaModel } from "./schema/dist/SchemaModel.js";
|
|
4
|
+
import "./schema/dist/index.js";
|
|
5
|
+
import { defineEvent, eventKey } from "./events.js";
|
|
6
|
+
import { FeatureRegistry, installFeature, validateFeatureTargetsV2 } from "./features.js";
|
|
7
|
+
import { FormRegistry, buildZodWithRelations, defineFormSpec, evalPredicate } from "./forms.js";
|
|
8
|
+
import { schemaToMarkdown, schemaToMarkdownDetail, schemaToMarkdownList, schemaToMarkdownSummary, schemaToMarkdownTable } from "./schema-to-markdown.js";
|
|
9
|
+
import { TransformEngine, createDefaultTransformEngine, registerBasicValidation, registerDefaultReactRenderer, registerReactToMarkdownRenderer } from "./presentations.v2.js";
|
|
10
|
+
import { createEngineWithDefaults, createFeatureModule, registerFeature, renderFeaturePresentation } from "./client/react/feature-render.js";
|
|
11
|
+
import { createFormRenderer } from "./client/react/form-render.js";
|
|
12
|
+
import { shadcnDriver } from "./client/react/drivers/shadcn.js";
|
|
13
|
+
import { rnReusablesDriver } from "./client/react/drivers/rn-reusables.js";
|
|
14
|
+
import "./client/index.js";
|
|
15
|
+
import { defaultGqlField, defaultMcpTool, defaultRestPath, jsonSchemaForSpec } from "./jsonschema.js";
|
|
16
|
+
import { registerContractsOnBuilder } from "./server/graphql-pothos.js";
|
|
17
|
+
import { PresentationRegistry, jsonSchemaForPresentation } from "./presentations.js";
|
|
18
|
+
import { createMcpServer } from "./server/mcp/createMcpServer.js";
|
|
19
|
+
import { createFetchHandler } from "./server/rest-generic.js";
|
|
20
|
+
import { elysiaPlugin } from "./server/rest-elysia.js";
|
|
21
|
+
import { expressRouter } from "./server/rest-express.js";
|
|
22
|
+
import { makeNextAppHandler } from "./server/rest-next-app.js";
|
|
23
|
+
import { makeNextPagesHandler } from "./server/rest-next-pages.js";
|
|
24
|
+
import "./server/index.js";
|
|
25
|
+
import { defineCommand, defineQuery, isEmitDeclRef } from "./spec.js";
|
|
26
|
+
import { docBlockToPresentationSpec, docBlockToPresentationV2, docBlocksToPresentationRoutes, docBlocksToPresentationSpecs, mapDocRoutes } from "./docs/presentations.js";
|
|
27
|
+
import { DocRegistry, defaultDocRegistry, docId, listRegisteredDocBlocks, registerDocBlocks } from "./docs/registry.js";
|
|
28
|
+
import { SpecRegistry, opKey } from "./registry.js";
|
|
29
|
+
import { Owners, OwnersEnum, StabilityEnum, Tags, TagsEnum } from "./ownership.js";
|
|
30
|
+
import { ContractRegistryFileSchema, ContractRegistryItemSchema, ContractRegistryItemTypeSchema, ContractRegistryManifestSchema } from "./contract-registry/schemas.js";
|
|
31
|
+
import "./contract-registry/index.js";
|
|
32
|
+
import { installOp, makeEmit, op } from "./install.js";
|
|
33
|
+
import { openApiForRegistry } from "./openapi.js";
|
|
34
|
+
import { definePrompt } from "./prompt.js";
|
|
35
|
+
import { PromptRegistry } from "./promptRegistry.js";
|
|
36
|
+
import { ResourceRegistry, defineResourceTemplate, isResourceRef, resourceRef } from "./resources.js";
|
|
37
|
+
import { toV2FromV1 } from "./presentations.backcompat.js";
|
|
38
|
+
import { CompleteOnboardingBaseInput, CompleteOnboardingBaseOutput, CompleteOnboardingBaseSpec, DeleteOnboardingDraftBaseSpec, DeleteOnboardingDraftOutput, GetOnboardingDraftBaseSpec, GetOnboardingDraftOutput, SaveOnboardingDraftBaseSpec, SaveOnboardingDraftInput, SaveOnboardingDraftOutput } from "./onboarding-base.js";
|
|
39
|
+
import { openBankingAccountsReadCapability, openBankingBalancesReadCapability, openBankingTransactionsReadCapability, registerOpenBankingCapabilities } from "./capabilities/openbanking.js";
|
|
40
|
+
import { PolicyRegistry, makePolicyKey } from "./policy/spec.js";
|
|
41
|
+
import { PolicyEngine } from "./policy/engine.js";
|
|
42
|
+
import { OPAPolicyAdapter, buildOPAInput } from "./policy/opa-adapter.js";
|
|
43
|
+
import { ThemeRegistry, makeThemeRef } from "./themes.js";
|
|
44
|
+
import { MigrationRegistry } from "./migrations.js";
|
|
45
|
+
import { TelemetryRegistry, makeTelemetryKey } from "./telemetry/spec.js";
|
|
46
|
+
import { TelemetryTracker } from "./telemetry/tracker.js";
|
|
47
|
+
import { TelemetryAnomalyMonitor } from "./telemetry/anomaly.js";
|
|
48
|
+
import "./telemetry/index.js";
|
|
49
|
+
import { TestRegistry, makeTestKey } from "./tests/spec.js";
|
|
50
|
+
import { TestRunner } from "./tests/runner.js";
|
|
51
|
+
import "./tests/index.js";
|
|
52
|
+
import { ExperimentRegistry, makeExperimentKey } from "./experiments/spec.js";
|
|
53
|
+
import { ExperimentEvaluator } from "./experiments/evaluator.js";
|
|
54
|
+
import { AppBlueprintRegistry, makeAppBlueprintKey } from "./app-config/spec.js";
|
|
55
|
+
import { composeAppConfig, resolveAppConfig } from "./app-config/runtime.js";
|
|
56
|
+
import { IntegrationSpecRegistry, makeIntegrationSpecKey } from "./integrations/spec.js";
|
|
57
|
+
import { registerStripeIntegration, stripeIntegrationSpec } from "./integrations/providers/stripe.js";
|
|
58
|
+
import { postmarkIntegrationSpec, registerPostmarkIntegration } from "./integrations/providers/postmark.js";
|
|
59
|
+
import { qdrantIntegrationSpec, registerQdrantIntegration } from "./integrations/providers/qdrant.js";
|
|
60
|
+
import { mistralIntegrationSpec, registerMistralIntegration } from "./integrations/providers/mistral.js";
|
|
61
|
+
import { elevenLabsIntegrationSpec, registerElevenLabsIntegration } from "./integrations/providers/elevenlabs.js";
|
|
62
|
+
import { gmailIntegrationSpec, registerGmailIntegration } from "./integrations/providers/gmail.js";
|
|
63
|
+
import { googleCalendarIntegrationSpec, registerGoogleCalendarIntegration } from "./integrations/providers/google-calendar.js";
|
|
64
|
+
import { registerTwilioSmsIntegration, twilioSmsIntegrationSpec } from "./integrations/providers/twilio-sms.js";
|
|
65
|
+
import { gcsStorageIntegrationSpec, registerGcsStorageIntegration } from "./integrations/providers/gcs-storage.js";
|
|
66
|
+
import { powensIntegrationSpec, registerPowensIntegration } from "./integrations/providers/powens.js";
|
|
67
|
+
import { createDefaultIntegrationSpecRegistry } from "./integrations/providers/registry.js";
|
|
68
|
+
import { AccountBalanceRecord, BankAccountRecord, BankTransactionRecord } from "./integrations/openbanking/models.js";
|
|
69
|
+
import { OPENBANKING_PII_FIELDS, OPENBANKING_TELEMETRY_EVENTS, redactOpenBankingTelemetryPayload } from "./integrations/openbanking/telemetry.js";
|
|
70
|
+
import { OpenBankingGetAccount, OpenBankingListAccounts, OpenBankingSyncAccounts } from "./integrations/openbanking/contracts/accounts.js";
|
|
71
|
+
import { OpenBankingListTransactions, OpenBankingSyncTransactions } from "./integrations/openbanking/contracts/transactions.js";
|
|
72
|
+
import { OpenBankingGetBalances, OpenBankingRefreshBalances } from "./integrations/openbanking/contracts/balances.js";
|
|
73
|
+
import { OpenBankingFeature } from "./integrations/openbanking/openbanking.feature.js";
|
|
74
|
+
import { registerOpenBankingContracts } from "./integrations/openbanking/contracts/index.js";
|
|
75
|
+
import { assertPrimaryOpenBankingReady, ensurePrimaryOpenBankingIntegration } from "./integrations/openbanking/guards.js";
|
|
76
|
+
import "./integrations/index.js";
|
|
77
|
+
import { KnowledgeSpaceRegistry, makeKnowledgeSpaceKey } from "./knowledge/spec.js";
|
|
78
|
+
import { productCanonKnowledgeSpace, registerProductCanonKnowledgeSpace } from "./knowledge/spaces/product-canon.js";
|
|
79
|
+
import { registerSupportFaqKnowledgeSpace, supportFaqKnowledgeSpace } from "./knowledge/spaces/support-faq.js";
|
|
80
|
+
import { emailThreadsKnowledgeSpace, registerEmailThreadsKnowledgeSpace } from "./knowledge/spaces/email-threads.js";
|
|
81
|
+
import { registerUploadedDocsKnowledgeSpace, uploadedDocsKnowledgeSpace } from "./knowledge/spaces/uploaded-docs.js";
|
|
82
|
+
import { financialDocsKnowledgeSpace, registerFinancialDocsKnowledgeSpace } from "./knowledge/spaces/financial-docs.js";
|
|
83
|
+
import { financialOverviewKnowledgeSpace, registerFinancialOverviewKnowledgeSpace } from "./knowledge/spaces/financial-overview.js";
|
|
84
|
+
import "./knowledge/index.js";
|
|
85
|
+
import { CreateIntegrationConnection, DeleteIntegrationConnection, ListIntegrationConnections, TestIntegrationConnection, UpdateIntegrationConnection, integrationContracts, registerIntegrationContracts } from "./integrations/contracts.js";
|
|
86
|
+
import { CreateKnowledgeSource, DeleteKnowledgeSource, ListKnowledgeSources, TriggerKnowledgeSourceSync, UpdateKnowledgeSource, knowledgeContracts, registerKnowledgeContracts } from "./knowledge/contracts.js";
|
|
87
|
+
import { behaviorToEnvelope, errorToEnvelope, telemetryToEnvelope } from "./regenerator/utils.js";
|
|
88
|
+
import { RegeneratorService } from "./regenerator/service.js";
|
|
89
|
+
import { ProposalExecutor } from "./regenerator/executor.js";
|
|
90
|
+
import { ExecutorProposalSink } from "./regenerator/sinks.js";
|
|
91
|
+
import "./regenerator/index.js";
|
|
92
|
+
import { WorkflowRegistry } from "./workflow/spec.js";
|
|
93
|
+
import { WorkflowValidationError, assertWorkflowSpecValid, validateWorkflowSpec } from "./workflow/validation.js";
|
|
94
|
+
import { evaluateExpression } from "./workflow/expression.js";
|
|
95
|
+
import { WorkflowPreFlightError, WorkflowRunner } from "./workflow/runner.js";
|
|
96
|
+
import { InMemoryStateStore } from "./workflow/adapters/memory-store.js";
|
|
97
|
+
import { PrismaStateStore } from "./workflow/adapters/db-adapter.js";
|
|
98
|
+
import { createFileStateStore } from "./workflow/adapters/file-adapter.js";
|
|
99
|
+
import "./workflow/index.js";
|
|
100
|
+
import { techContractsDocs } from "./docs/tech-contracts.docs.js";
|
|
101
|
+
import { metaDocs } from "./docs/meta.docs.js";
|
|
102
|
+
import "./docs/index.js";
|
|
103
|
+
import { docBlockToMarkdown, eventToMarkdown, exportFeature, exportSpec, featureToMarkdown, presentationToMarkdown, specToAgentPrompt, specToContextMarkdown, specToFullMarkdown } from "./llm/exporters.js";
|
|
104
|
+
import { AGENT_SYSTEM_PROMPTS, formatPlanForAgent, generateFixViolationsPrompt, generateImplementationPlan, generateImplementationPrompt, generateReviewPrompt, generateTestPrompt, generateVerificationPrompt } from "./llm/prompts.js";
|
|
105
|
+
import "./llm/index.js";
|
|
106
|
+
|
|
107
|
+
export { AGENT_SYSTEM_PROMPTS, AccountBalanceRecord, AppBlueprintRegistry, BankAccountRecord, BankTransactionRecord, CapabilityRegistry, CompleteOnboardingBaseInput, CompleteOnboardingBaseOutput, CompleteOnboardingBaseSpec, ContractRegistryFileSchema, ContractRegistryItemSchema, ContractRegistryItemTypeSchema, ContractRegistryManifestSchema, CreateIntegrationConnection, CreateKnowledgeSource, DataViewRegistry, DeleteIntegrationConnection, DeleteKnowledgeSource, DeleteOnboardingDraftBaseSpec, DeleteOnboardingDraftOutput, DocRegistry, ExecutorProposalSink, ExperimentEvaluator, ExperimentRegistry, FeatureRegistry, FormRegistry, GetOnboardingDraftBaseSpec, GetOnboardingDraftOutput, InMemoryStateStore, IntegrationSpecRegistry, KnowledgeSpaceRegistry, ListIntegrationConnections, ListKnowledgeSources, MigrationRegistry, OPAPolicyAdapter, OPENBANKING_PII_FIELDS, OPENBANKING_TELEMETRY_EVENTS, OpenBankingFeature, OpenBankingGetAccount, OpenBankingGetBalances, OpenBankingListAccounts, OpenBankingListTransactions, OpenBankingRefreshBalances, OpenBankingSyncAccounts, OpenBankingSyncTransactions, Owners, OwnersEnum, PolicyEngine, PolicyRegistry, PresentationRegistry, PrismaStateStore, PromptRegistry, ProposalExecutor, RegeneratorService, ResourceRegistry, SaveOnboardingDraftBaseSpec, SaveOnboardingDraftInput, SaveOnboardingDraftOutput, SpecRegistry, StabilityEnum, Tags, TagsEnum, TelemetryAnomalyMonitor, TelemetryRegistry, TelemetryTracker, TestIntegrationConnection, TestRegistry, TestRunner, ThemeRegistry, TransformEngine, TriggerKnowledgeSourceSync, UpdateIntegrationConnection, UpdateKnowledgeSource, WorkflowPreFlightError, WorkflowRegistry, WorkflowRunner, WorkflowValidationError, assertPrimaryOpenBankingReady, assertWorkflowSpecValid, behaviorToEnvelope, buildOPAInput, buildZodWithRelations, capabilityKey, composeAppConfig, createDefaultIntegrationSpecRegistry, createDefaultTransformEngine, createEngineWithDefaults, createFeatureModule, createFetchHandler, createFileStateStore, createFormRenderer, createMcpServer, dataViewKey, defaultDocRegistry, defaultGqlField, defaultMcpTool, defaultRestPath, defineCapability, defineCommand, defineEvent, defineFormSpec, definePrompt, defineQuery, defineResourceTemplate, defineSchemaModel, docBlockToMarkdown, docBlockToPresentationSpec, docBlockToPresentationV2, docBlocksToPresentationRoutes, docBlocksToPresentationSpecs, docId, elevenLabsIntegrationSpec, elysiaPlugin, emailThreadsKnowledgeSpace, ensurePrimaryOpenBankingIntegration, errorToEnvelope, evalPredicate, evaluateExpression, eventKey, eventToMarkdown, exportFeature, exportSpec, expressRouter, featureToMarkdown, financialDocsKnowledgeSpace, financialOverviewKnowledgeSpace, formatPlanForAgent, gcsStorageIntegrationSpec, generateFixViolationsPrompt, generateImplementationPlan, generateImplementationPrompt, generateReviewPrompt, generateTestPrompt, generateVerificationPrompt, gmailIntegrationSpec, googleCalendarIntegrationSpec, installFeature, installOp, integrationContracts, isEmitDeclRef, isResourceRef, jsonSchemaForPresentation, jsonSchemaForSpec, knowledgeContracts, listRegisteredDocBlocks, makeAppBlueprintKey, makeEmit, makeExperimentKey, makeIntegrationSpecKey, makeKnowledgeSpaceKey, makeNextAppHandler, makeNextPagesHandler, makePolicyKey, makeTelemetryKey, makeTestKey, makeThemeRef, mapDocRoutes, metaDocs, mistralIntegrationSpec, op, opKey, openApiForRegistry, openBankingAccountsReadCapability, openBankingBalancesReadCapability, openBankingTransactionsReadCapability, postmarkIntegrationSpec, powensIntegrationSpec, presentationToMarkdown, productCanonKnowledgeSpace, qdrantIntegrationSpec, redactOpenBankingTelemetryPayload, registerBasicValidation, registerContractsOnBuilder, registerDefaultReactRenderer, registerDocBlocks, registerElevenLabsIntegration, registerEmailThreadsKnowledgeSpace, registerFeature, registerFinancialDocsKnowledgeSpace, registerFinancialOverviewKnowledgeSpace, registerGcsStorageIntegration, registerGmailIntegration, registerGoogleCalendarIntegration, registerIntegrationContracts, registerKnowledgeContracts, registerMistralIntegration, registerOpenBankingCapabilities, registerOpenBankingContracts, registerPostmarkIntegration, registerPowensIntegration, registerProductCanonKnowledgeSpace, registerQdrantIntegration, registerReactToMarkdownRenderer, registerStripeIntegration, registerSupportFaqKnowledgeSpace, registerTwilioSmsIntegration, registerUploadedDocsKnowledgeSpace, renderFeaturePresentation, resolveAppConfig, resourceRef, rnReusablesDriver, schemaToMarkdown, schemaToMarkdownDetail, schemaToMarkdownList, schemaToMarkdownSummary, schemaToMarkdownTable, shadcnDriver, specToAgentPrompt, specToContextMarkdown, specToFullMarkdown, stripeIntegrationSpec, supportFaqKnowledgeSpace, techContractsDocs, telemetryToEnvelope, toV2FromV1, twilioSmsIntegrationSpec, uploadedDocsKnowledgeSpace, validateFeatureTargetsV2, validateWorkflowSpec };
|
package/dist/install.js
CHANGED
|
@@ -1 +1,40 @@
|
|
|
1
|
-
import"./registry.js";
|
|
1
|
+
import "./registry.js";
|
|
2
|
+
import "zod";
|
|
3
|
+
|
|
4
|
+
//#region src/install.ts
|
|
5
|
+
/** Typed emit for a given spec (validates at runtime through ctx.__emitGuard__). */
|
|
6
|
+
function makeEmit(_spec, ctx) {
|
|
7
|
+
return {
|
|
8
|
+
ref: async (ev, payload) => {
|
|
9
|
+
await ctx.__emitGuard__?.(ev.name, ev.version, payload);
|
|
10
|
+
},
|
|
11
|
+
named: async (name, version, payload) => {
|
|
12
|
+
await ctx.__emitGuard__?.(name, version, payload);
|
|
13
|
+
},
|
|
14
|
+
object: async (evt) => {
|
|
15
|
+
await ctx.__emitGuard__?.(evt.name, evt.version, evt.payload);
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Register the Spec and bind the handler in one call, with full type inference.
|
|
21
|
+
* Returns the registry for chaining.
|
|
22
|
+
*/
|
|
23
|
+
function installOp(reg, spec, handler) {
|
|
24
|
+
return reg.register(spec).bind(spec, handler);
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Curried variant if you prefer building a module installer.
|
|
28
|
+
* const install = op(BeginSignupSpec, handler);
|
|
29
|
+
* install(reg);
|
|
30
|
+
*/
|
|
31
|
+
function op(spec, handler) {
|
|
32
|
+
return {
|
|
33
|
+
spec,
|
|
34
|
+
handler,
|
|
35
|
+
install: (reg) => installOp(reg, spec, handler)
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
//#endregion
|
|
40
|
+
export { installOp, makeEmit, op };
|