@wildo-ai/saas-specifications 1.1.14 → 1.1.16
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/esm/_core/build-plan/build-plan-task-graph.schemas.d.ts +2 -2
- package/dist/esm/_core/build-plan/build-plan-task-graph.schemas.d.ts.map +1 -1
- package/dist/esm/_core/build-plan/build-plan-task-graph.schemas.js +13 -8
- package/dist/esm/_core/build-plan/build-plan-task-graph.schemas.js.map +1 -1
- package/dist/esm/_core/build-plan/build-plan.family-aspects.d.ts.map +1 -1
- package/dist/esm/_core/build-plan/build-plan.family-aspects.js +13 -7
- package/dist/esm/_core/build-plan/build-plan.family-aspects.js.map +1 -1
- package/dist/esm/_core/integration-plan/integration-execution-surface-refs.schemas.d.ts +32 -0
- package/dist/esm/_core/integration-plan/integration-execution-surface-refs.schemas.d.ts.map +1 -0
- package/dist/esm/_core/integration-plan/integration-execution-surface-refs.schemas.js +47 -0
- package/dist/esm/_core/integration-plan/integration-execution-surface-refs.schemas.js.map +1 -0
- package/dist/esm/_core/integration-plan/integration-plan-generation.schemas.d.ts +7 -0
- package/dist/esm/_core/integration-plan/integration-plan-generation.schemas.d.ts.map +1 -1
- package/dist/esm/_core/integration-plan/integration-plan-generation.schemas.js +4 -1
- package/dist/esm/_core/integration-plan/integration-plan-generation.schemas.js.map +1 -1
- package/dist/esm/_core/integration-plan/integration-plan-validation.d.ts +114 -1
- package/dist/esm/_core/integration-plan/integration-plan-validation.d.ts.map +1 -1
- package/dist/esm/_core/integration-plan/integration-plan-validation.js +176 -0
- package/dist/esm/_core/integration-plan/integration-plan-validation.js.map +1 -1
- package/dist/esm/_core/integration-plan/integration-plan.family-aspects.d.ts.map +1 -1
- package/dist/esm/_core/integration-plan/integration-plan.family-aspects.js +17 -1
- package/dist/esm/_core/integration-plan/integration-plan.family-aspects.js.map +1 -1
- package/dist/esm/_core/integration-plan/integration-plan.schemas.d.ts +43 -5
- package/dist/esm/_core/integration-plan/integration-plan.schemas.d.ts.map +1 -1
- package/dist/esm/_core/integration-plan/integration-plan.schemas.js +75 -7
- package/dist/esm/_core/integration-plan/integration-plan.schemas.js.map +1 -1
- package/dist/esm/_core/provider-specification.schemas.d.ts +16 -1
- package/dist/esm/_core/provider-specification.schemas.d.ts.map +1 -1
- package/dist/esm/_core/provider-specification.schemas.js +21 -0
- package/dist/esm/_core/provider-specification.schemas.js.map +1 -1
- package/dist/esm/application-creation/playbooks.application-creation.schemas.d.ts +5 -4
- package/dist/esm/application-creation/playbooks.application-creation.schemas.d.ts.map +1 -1
- package/dist/esm/application-creation/playbooks.application-creation.schemas.js +5 -4
- package/dist/esm/application-creation/playbooks.application-creation.schemas.js.map +1 -1
- package/dist/esm/application-creation.exports.d.ts +1 -0
- package/dist/esm/application-creation.exports.d.ts.map +1 -1
- package/dist/esm/application-creation.exports.js +1 -0
- package/dist/esm/application-creation.exports.js.map +1 -1
- package/dist/esm/assurance/assurance-authority-basis.definitions.d.ts +1 -1
- package/dist/esm/assurance/assurance-authority-basis.definitions.js +1 -1
- package/dist/esm/assurance/assurance-authority-basis.definitions.js.map +1 -1
- package/dist/esm/assurance/assurance-evidence-requirement-bodies.definitions.d.ts.map +1 -1
- package/dist/esm/assurance/assurance-evidence-requirement-bodies.definitions.js +18 -8
- package/dist/esm/assurance/assurance-evidence-requirement-bodies.definitions.js.map +1 -1
- package/dist/esm/assurance/assurance-objective-catalog.definitions.d.ts.map +1 -1
- package/dist/esm/assurance/assurance-objective-catalog.definitions.js +9 -2
- package/dist/esm/assurance/assurance-objective-catalog.definitions.js.map +1 -1
- package/dist/esm/assurance/assurance-verification-requirement-bodies.definitions.d.ts.map +1 -1
- package/dist/esm/assurance/assurance-verification-requirement-bodies.definitions.js +8 -4
- package/dist/esm/assurance/assurance-verification-requirement-bodies.definitions.js.map +1 -1
- package/dist/esm/engine/compliance/resources/signature-requests.resource.specification.d.ts +2 -2
- package/dist/esm/engine/compliance/resources/signature-requests.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/compliance/resources/signature-requests.resource.specification.js +29 -6
- package/dist/esm/engine/compliance/resources/signature-requests.resource.specification.js.map +1 -1
- package/dist/esm/engine/engine-resource-specifications.registry.d.ts.map +1 -1
- package/dist/esm/engine/engine-resource-specifications.registry.js +4 -0
- package/dist/esm/engine/engine-resource-specifications.registry.js.map +1 -1
- package/dist/esm/engine/flows-actors/resources/actor-system-executions.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/flows-actors/resources/actor-system-executions.resource.specification.js +4 -1
- package/dist/esm/engine/flows-actors/resources/actor-system-executions.resource.specification.js.map +1 -1
- package/dist/esm/engine/flows-actors/resources/actor-tasks.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/flows-actors/resources/actor-tasks.resource.specification.js +3 -0
- package/dist/esm/engine/flows-actors/resources/actor-tasks.resource.specification.js.map +1 -1
- package/dist/esm/engine/flows-actors/resources/flow-actor-tasks.resource.specification.js +3 -3
- package/dist/esm/engine/flows-actors/resources/flow-actor-tasks.resource.specification.js.map +1 -1
- package/dist/esm/engine/flows-actors/resources/organization-chat-settings.resource.specification.js +1 -1
- package/dist/esm/engine/flows-actors/resources/organization-chat-settings.resource.specification.js.map +1 -1
- package/dist/esm/engine/flows-actors/resources/remote-agent-task-updates.resource.specification.d.ts +3 -0
- package/dist/esm/engine/flows-actors/resources/remote-agent-task-updates.resource.specification.d.ts.map +1 -0
- package/dist/esm/engine/flows-actors/resources/remote-agent-task-updates.resource.specification.js +98 -0
- package/dist/esm/engine/flows-actors/resources/remote-agent-task-updates.resource.specification.js.map +1 -0
- package/dist/esm/engine/flows-actors/resources/remote-agent-tasks.resource.specification.d.ts +3 -0
- package/dist/esm/engine/flows-actors/resources/remote-agent-tasks.resource.specification.d.ts.map +1 -0
- package/dist/esm/engine/flows-actors/resources/remote-agent-tasks.resource.specification.js +132 -0
- package/dist/esm/engine/flows-actors/resources/remote-agent-tasks.resource.specification.js.map +1 -0
- package/dist/esm/engine/frontend-components/app/app-layout-agent-activity-settings.frontend-component.specification.d.ts +5 -0
- package/dist/esm/engine/frontend-components/app/app-layout-agent-activity-settings.frontend-component.specification.d.ts.map +1 -0
- package/dist/esm/engine/frontend-components/app/app-layout-agent-activity-settings.frontend-component.specification.js +79 -0
- package/dist/esm/engine/frontend-components/app/app-layout-agent-activity-settings.frontend-component.specification.js.map +1 -0
- package/dist/esm/engine/frontend-components/index.d.ts +1 -0
- package/dist/esm/engine/frontend-components/index.d.ts.map +1 -1
- package/dist/esm/engine/frontend-components/index.js +3 -0
- package/dist/esm/engine/frontend-components/index.js.map +1 -1
- package/dist/esm/engine/infrastructure/resources/external-data-pipeline-states.resource.specification.js +2 -2
- package/dist/esm/engine/infrastructure/resources/external-data-pipeline-states.resource.specification.js.map +1 -1
- package/dist/esm/engine/notifications/system-emails/delegated-work.system-emails.specification.d.ts +8 -0
- package/dist/esm/engine/notifications/system-emails/delegated-work.system-emails.specification.d.ts.map +1 -0
- package/dist/esm/engine/notifications/system-emails/delegated-work.system-emails.specification.js +65 -0
- package/dist/esm/engine/notifications/system-emails/delegated-work.system-emails.specification.js.map +1 -0
- package/dist/esm/engine/notifications/system-emails/index.d.ts +1 -0
- package/dist/esm/engine/notifications/system-emails/index.d.ts.map +1 -1
- package/dist/esm/engine/notifications/system-emails/index.js +3 -1
- package/dist/esm/engine/notifications/system-emails/index.js.map +1 -1
- package/dist/esm/engine/organizations/resources/organization-units.resource.specification.js +1 -1
- package/dist/esm/engine/organizations/resources/organization-units.resource.specification.js.map +1 -1
- package/dist/esm/engine/providers/_engine-provider-shared.d.ts +5 -0
- package/dist/esm/engine/providers/_engine-provider-shared.d.ts.map +1 -1
- package/dist/esm/engine/providers/_engine-provider-shared.js +5 -0
- package/dist/esm/engine/providers/_engine-provider-shared.js.map +1 -1
- package/dist/esm/engine/providers/dropbox.provider.specification.d.ts +14 -0
- package/dist/esm/engine/providers/dropbox.provider.specification.d.ts.map +1 -0
- package/dist/esm/engine/providers/dropbox.provider.specification.js +76 -0
- package/dist/esm/engine/providers/dropbox.provider.specification.js.map +1 -0
- package/dist/esm/engine/providers/index.d.ts +3 -1
- package/dist/esm/engine/providers/index.d.ts.map +1 -1
- package/dist/esm/engine/providers/index.js +5 -2
- package/dist/esm/engine/providers/index.js.map +1 -1
- package/dist/esm/engine/users/resources/user-preferences-api-reference.examples.d.ts +1 -0
- package/dist/esm/engine/users/resources/user-preferences-api-reference.examples.d.ts.map +1 -1
- package/dist/esm/engine/users/resources/user-preferences-api-reference.examples.js +2 -0
- package/dist/esm/engine/users/resources/user-preferences-api-reference.examples.js.map +1 -1
- package/dist/esm/engine/users/resources/user-preferences.resource.specification.d.ts +1 -0
- package/dist/esm/engine/users/resources/user-preferences.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/users/resources/user-self-preferences.resource.specification.d.ts +1 -0
- package/dist/esm/engine/users/resources/user-self-preferences.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/users/resources/user-self-preferences.resource.specification.js +1 -1
- package/dist/esm/engine/users/resources/user-self-preferences.resource.specification.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +8 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"integration-plan-validation.js","sourceRoot":"","sources":["../../../../src/_core/integration-plan/integration-plan-validation.ts"],"names":[],"mappings":"AAEA,sGAAsG;AACtG,MAAM,CAAN,IAAY,0BAOX;AAPD,WAAY,0BAA0B;IACpC,+FAA+F;IAC/F,uGAAyE,CAAA;IACzE,8GAA8G;IAC9G,mGAAqE,CAAA;IACrE,qGAAqG;IACrG,+FAAiE,CAAA;AACnE,CAAC,EAPW,0BAA0B,KAA1B,0BAA0B,QAOrC;AAQD;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,iCAAiC,GAA0C,EAAE,CAAC;AAE3F,MAAM,UAAU,uBAAuB,CAAC,IAAqB;IAC3D,MAAM,QAAQ,GAA6B,EAAE,CAAC;IAC9C,KAAK,MAAM,MAAM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A8B;gBAC/D,UAAU,EAAE,MAAM,CAAC,SAAS;gBAC5B,OAAO,EAAE,GAAG,MAAM,CAAC,SAAS,mGAAmG;aAChI,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC","sourcesContent":["import type { IntegrationPlan } from './integration-plan.schemas';\n\n/** Deterministic finding over an integration plan; authoring coherence beyond structural validity. */\nexport enum IntegrationPlanFindingCode {\n /** A minion that names no resource it touches — its containment whitelist would be guessed. */\n MINION_DECLARES_NO_RESOURCE_ACCESS = 'MINION_DECLARES_NO_RESOURCE_ACCESS',\n /** A worker or minion accountable to nothing: no requirement, feature draft or roadmap phase asked for it. */\n EXECUTION_SURFACE_SERVES_NOTHING = 'EXECUTION_SURFACE_SERVES_NOTHING',\n /** A worker whose only job shares its own name — the starter route, planned rather than designed. */\n WORKER_JOB_RESTATES_ITS_WORKER = 'WORKER_JOB_RESTATES_ITS_WORKER',\n}\n\nexport interface IntegrationPlanFinding {\n readonly code: IntegrationPlanFindingCode;\n readonly surfaceRef: string | null;\n readonly message: string;\n}\n\n/**\n * The finding codes that must block a landing — NONE, and that is a decision rather than an omission.\n *\n * Every finding here is about a plan that is thin, and a thin plan still composes a package that\n * runs: a minion with no declared access lands with the DENY-ALL starter whitelist, which is the\n * safe direction. Refusing would stop the lane over authoring judgement, which\n * `application-creation-directive.md` forbids — mark, never gate. A plan in this lane has a floor\n * only when it has a state that cannot be USED (a site with no landing page); this family has none.\n */\nexport const INTEGRATION_PLAN_HARD_FLOOR_CODES: readonly IntegrationPlanFindingCode[] = [];\n\nexport function validateIntegrationPlan(plan: IntegrationPlan): readonly IntegrationPlanFinding[] {\n const findings: IntegrationPlanFinding[] = [];\n for (const minion of plan.minions) {\n if (minion.readsResourceRefs.length === 0 && minion.writesResourceRefs.length === 0) {\n findings.push({\n code: IntegrationPlanFindingCode.MINION_DECLARES_NO_RESOURCE_ACCESS,\n surfaceRef: minion.minionRef,\n message: `${minion.minionRef} names no resource it reads or writes, so its containment whitelist would be guessed — and an empty whitelist logs a soft warning and keeps running, so the minion would appear healthy while touching nothing.`,\n });\n }\n if (minion.servesRefs.length === 0) {\n findings.push({\n code: IntegrationPlanFindingCode.EXECUTION_SURFACE_SERVES_NOTHING,\n surfaceRef: minion.minionRef,\n message: `${minion.minionRef} is accountable to nothing: no requirement, feature draft or roadmap phase asked for this schedule.`,\n });\n }\n }\n for (const worker of plan.workers) {\n if (worker.servesRefs.length === 0) {\n findings.push({\n code: IntegrationPlanFindingCode.EXECUTION_SURFACE_SERVES_NOTHING,\n surfaceRef: worker.workerRef,\n message: `${worker.workerRef} is accountable to nothing: no requirement, feature draft or roadmap phase asked for this process.`,\n });\n }\n /*\n * `worker-imports` exposing only `imports` is the scenario's starter shape carried into the plan:\n * the route says nothing the worker's own name did not, so nobody has decided what the backend\n * actually delegates.\n */\n const bareName = worker.workerRef.replace(/^worker-/u, '');\n if (worker.jobRefs.length === 1 && worker.jobRefs[0] === bareName) {\n findings.push({\n code: IntegrationPlanFindingCode.WORKER_JOB_RESTATES_ITS_WORKER,\n surfaceRef: worker.workerRef,\n message: `${worker.workerRef} exposes one route named after itself, which says nothing about what the backend delegates to it.`,\n });\n }\n }\n return findings;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"integration-plan-validation.js","sourceRoot":"","sources":["../../../../src/_core/integration-plan/integration-plan-validation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,6CAA6C,CAAC;AACnF,OAAO,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAC;AAG/E,sGAAsG;AACtG,MAAM,CAAN,IAAY,0BAcX;AAdD,WAAY,0BAA0B;IACpC,+FAA+F;IAC/F,uGAAyE,CAAA;IACzE,8GAA8G;IAC9G,mGAAqE,CAAA;IACrE,qGAAqG;IACrG,+FAAiE,CAAA;IACjE;;;OAGG;IACH,yFAA2D,CAAA;IAC3D,2HAA2H;IAC3H,+FAAiE,CAAA;AACnE,C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SACvG;QACD,OAAO;KACR,CAAC;AACJ,CAAC","sourcesContent":["import { ProviderBindingScope } from '../build-plan/build-plan-task-graph.schemas';\nimport { ProviderSpecificationFacet } from '../provider-specification.schemas';\nimport type { IntegrationPlan } from './integration-plan.schemas';\n\n/** Deterministic finding over an integration plan; authoring coherence beyond structural validity. */\nexport enum IntegrationPlanFindingCode {\n /** A minion that names no resource it touches — its containment whitelist would be guessed. */\n MINION_DECLARES_NO_RESOURCE_ACCESS = 'MINION_DECLARES_NO_RESOURCE_ACCESS',\n /** A worker or minion accountable to nothing: no requirement, feature draft or roadmap phase asked for it. */\n EXECUTION_SURFACE_SERVES_NOTHING = 'EXECUTION_SURFACE_SERVES_NOTHING',\n /** A worker whose only job shares its own name — the starter route, planned rather than designed. */\n WORKER_JOB_RESTATES_ITS_WORKER = 'WORKER_JOB_RESTATES_ITS_WORKER',\n /**\n * A need recorded as unprovided (#3992) that no provider binding wires and no planned worker or minion wires for itself\n * (`wiredByRef`, #3995 item 6): a provider would be authored for nothing.\n */\n UNPROVIDED_NEED_NEVER_BOUND = 'UNPROVIDED_NEED_NEVER_BOUND',\n /** A need recorded as unprovided that serves no requirement: a provider would be authored for nothing anyone asked for. */\n UNPROVIDED_NEED_SERVES_NOTHING = 'UNPROVIDED_NEED_SERVES_NOTHING',\n}\n\nexport interface IntegrationPlanFinding {\n readonly code: IntegrationPlanFindingCode;\n readonly surfaceRef: string | null;\n readonly message: string;\n}\n\n/**\n * The finding codes that must block a landing — NONE, and that is a decision rather than an omission.\n *\n * Every finding here is about a plan that is thin, and a thin plan still composes a package that\n * runs: a minion with no declared access lands with the DENY-ALL starter whitelist, which is the\n * safe direction. Refusing would stop the lane over authoring judgement, which\n * `application-creation-directive.md` forbids — mark, never gate. A plan in this lane has a floor\n * only when it has a state that cannot be USED (a site with no landing page); this family has none.\n */\nexport const INTEGRATION_PLAN_HARD_FLOOR_CODES: readonly IntegrationPlanFindingCode[] = [];\n\nexport function validateIntegrationPlan(plan: IntegrationPlan): readonly IntegrationPlanFinding[] {\n const findings: IntegrationPlanFinding[] = [];\n for (const minion of plan.minions) {\n if (minion.readsResourceRefs.length === 0 && minion.writesResourceRefs.length === 0) {\n findings.push({\n code: IntegrationPlanFindingCode.MINION_DECLARES_NO_RESOURCE_ACCESS,\n surfaceRef: minion.minionRef,\n message: `${minion.minionRef} names no resource it reads or writes, so its containment whitelist would be guessed — and an empty whitelist logs a soft warning and keeps running, so the minion would appear healthy while touching nothing.`,\n });\n }\n if (minion.servesRefs.length === 0) {\n findings.push({\n code: IntegrationPlanFindingCode.EXECUTION_SURFACE_SERVES_NOTHING,\n surfaceRef: minion.minionRef,\n message: `${minion.minionRef} is accountable to nothing: no requirement, feature draft or roadmap phase asked for this schedule.`,\n });\n }\n }\n for (const worker of plan.workers) {\n if (worker.servesRefs.length === 0) {\n findings.push({\n code: IntegrationPlanFindingCode.EXECUTION_SURFACE_SERVES_NOTHING,\n surfaceRef: worker.workerRef,\n message: `${worker.workerRef} is accountable to nothing: no requirement, feature draft or roadmap phase asked for this process.`,\n });\n }\n /*\n * `worker-imports` exposing only `imports` is the scenario's starter shape carried into the plan:\n * the route says nothing the worker's own name did not, so nobody has decided what the backend\n * actually delegates.\n */\n const bareName = worker.workerRef.replace(/^worker-/u, '');\n if (worker.jobRefs.length === 1 && worker.jobRefs[0] === bareName) {\n findings.push({\n code: IntegrationPlanFindingCode.WORKER_JOB_RESTATES_ITS_WORKER,\n surfaceRef: worker.workerRef,\n message: `${worker.workerRef} exposes one route named after itself, which says nothing about what the backend delegates to it.`,\n });\n }\n }\n const boundRefs = new Set(plan.providerBindings.map((binding) => binding.providerRef));\n // The schema refuses a `wiredByRef` naming no planned surface, so a present one wires the need.\n const plannedSurfaceRefs = new Set([...plan.workers.map((worker) => worker.workerRef), ...plan.minions.map((minion) => minion.minionRef)]);\n for (const need of plan.unprovidedNeeds) {\n const wiredBySurface = need.wiredByRef !== undefined && plannedSurfaceRefs.has(need.wiredByRef);\n if (!boundRefs.has(need.providerRef) && !wiredBySurface) {\n findings.push({\n code: IntegrationPlanFindingCode.UNPROVIDED_NEED_NEVER_BOUND,\n surfaceRef: need.providerRef,\n message: `${need.providerRef} is recorded as a need no existing provider fills, but nothing wires it: bind it on the scope that needs it, name the worker or minion that alone uses it in wiredByRef, or drop the entry.`,\n });\n }\n if (need.servesRefs.length === 0) {\n findings.push({\n code: IntegrationPlanFindingCode.UNPROVIDED_NEED_SERVES_NOTHING,\n surfaceRef: need.providerRef,\n message: `${need.providerRef} is recorded as a need no existing provider fills, but it serves no requirement: a new provider is authored only for something the product was asked to do.`,\n });\n }\n }\n return findings;\n}\n\n/** Why a provider reference in an integration plan names no provider it may (#3995). */\nexport enum IntegrationPlanProviderRefFindingCode {\n /** A binding names a provider that is no engine provider, no registry module, nothing installed, and no recorded need. */\n BINDING_NAMES_NO_KNOWN_PROVIDER = 'BINDING_NAMES_NO_KNOWN_PROVIDER',\n /** An unprovided need names a provider that EXISTS: authoring it would fork a provider the framework already has. */\n UNPROVIDED_NEED_NAMES_EXISTING_PROVIDER = 'UNPROVIDED_NEED_NAMES_EXISTING_PROVIDER',\n /**\n * A binding puts a provider on a scope whose facet it does not ship (a `BACKEND` binding to the browser-only Dropbox\n * Chooser): a task with nothing to load there, refused like an unknown provider. Checked only for a provider whose\n * facets are known (`IntegrationPlanKnownProviders.facetsByProvider`).\n */\n BINDING_SCOPE_NOT_SHIPPED_BY_PROVIDER = 'BINDING_SCOPE_NOT_SHIPPED_BY_PROVIDER',\n}\n\n/**\n * The facet a provider must ship for a binding on each scope to load (#3995): total over {@link ProviderBindingScope}, so a\n * scope added tomorrow names its facet or does not compile. The backend and the companion both load backend modules.\n */\nexport const PROVIDER_BINDING_SCOPE_FACET: Readonly<Record<ProviderBindingScope, ProviderSpecificationFacet>> = {\n [ProviderBindingScope.BACKEND]: ProviderSpecificationFacet.BACKEND,\n [ProviderBindingScope.COMPANION]: ProviderSpecificationFacet.BACKEND,\n [ProviderBindingScope.FRONTEND_APP]: ProviderSpecificationFacet.FRONTEND_APP,\n [ProviderBindingScope.WEBSITE]: ProviderSpecificationFacet.FRONTEND_WEBSITE,\n};\n\nexport interface IntegrationPlanProviderRefFinding {\n readonly code: IntegrationPlanProviderRefFindingCode;\n readonly providerRef: string;\n /**\n * The element's path in the plan (`providerBindings.0.providerRef`). A correction that changes a binding's provider\n * changes that element's identity, and the retry's drop guard (#3363) lets a correction remove or re-identify an\n * element only when a finding names it by its position: without the path the model could never fix what it is told.\n */\n readonly path: string;\n readonly message: string;\n}\n\n/**\n * The providers an integration plan is checked against (#3995), as two sets because the two checks ask different things.\n * `existing` is what the FRAMEWORK already has (the engine's providers and the registry's modules): a recorded need naming\n * one would fork it. `bindable` adds what THIS application has (installed or authored packages, refs its scopes declare):\n * a binding may name any of them. An authored provider is bindable but not existing, so a plan rerun after authoring it\n * keeps the need that records why.\n */\nexport interface IntegrationPlanKnownProviders {\n readonly existing: ReadonlySet<string>;\n readonly bindable: ReadonlySet<string>;\n /**\n * The facets each provider ships a module for, ONLY for a provider whose every source is known: an engine provider\n * specification that no registry module, application package or non-engine contribution shares the ref with. A provider\n * absent here has unknown facets (an installed, authored or registry one), and its binding's scope is not checked:\n * unknown is not wrong. Absent as a whole, no scope is checked.\n */\n readonly facetsByProvider?: ReadonlyMap<string, ReadonlySet<string>>;\n}\n\n/**\n * The binding scopes whose providers the known set describes COMPLETELY (#3995 review R1): every scope, since #3995 item 5.\n *\n * The set's framework half comes from the registered provider specifications, so a scope may be checked only when every\n * engine provider that scope can bind has one. For the backend side that was always true (every MAIN backend module is\n * described). For the frontend side it was not: the Dropbox picker had no specification, and discovery finds an engine\n * browser module only when an application's frontend scope already declares a provider, so FRONTEND_APP and WEBSITE were\n * left unchecked rather than refuse a real engine provider and steer the model into recording it as unprovided (a fork).\n * Dropbox now has its specification, and the CLI's provider-specification reconciliation (#328, facet-aware since #3995)\n * fails when any engine browser module lacks one, so the frontend scopes are as completely described as the backend.\n * Enumerated when widened: `frontend-app` dropbox, google-drive, google-places, microsoft-onedrive; `frontend-website`\n * recaptcha; `frontend-techdoc` none. The application's own browser providers are in `bindable` through discovery and the\n * refs its frontend scopes declare; a host that cannot read any discovery owner, frontend included, reports no set (the\n * companion's `readKnownProviderRefsFor`).\n *\n * Kept as a named set rather than deleted, so a scope added to {@link ProviderBindingScope} without a complete source is a\n * decision written here, not a check that silently starts refusing.\n */\nexport const PROVIDER_BINDING_SCOPES_CHECKED_FOR_EXISTENCE: ReadonlySet<ProviderBindingScope> = new Set([\n ProviderBindingScope.BACKEND,\n ProviderBindingScope.COMPANION,\n ProviderBindingScope.FRONTEND_APP,\n ProviderBindingScope.WEBSITE,\n]);\n\n/**\n * The provider references of an integration plan, against the providers that exist (#3995). Kept out of\n * {@link validateIntegrationPlan} on purpose: that one reads the plan alone, and this needs the application around it, so\n * a host calls it only when it could read the whole set (an unreadable source means no set, and no check, since unknown is\n * not wrong).\n *\n * Every finding makes the plan UNTRUE, not thin (`application-creation-directive.md`): a binding to a provider nothing\n * provides, or on a scope whose facet its provider does not ship, is a task with nothing to wire, and a recorded need for\n * a provider that exists is a decision to fork it, which is what Paul's rule (#3992) forbids. So a host rejects the\n * candidate into the model's retry with these findings.\n * Bindings are checked only on {@link PROVIDER_BINDING_SCOPES_CHECKED_FOR_EXISTENCE}. `augments` is not checked: it names\n * the provider an augmentation extends, which configuration sync already resolves.\n */\nexport function validateIntegrationPlanProviderRefs(plan: IntegrationPlan, known: IntegrationPlanKnownProviders): readonly IntegrationPlanProviderRefFinding[] {\n const findings: IntegrationPlanProviderRefFinding[] = [];\n const recordedNeeds = new Set(plan.unprovidedNeeds.map((need) => need.providerRef));\n plan.unprovidedNeeds.forEach((need, index) => {\n if (known.existing.has(need.providerRef)) {\n findings.push({\n code: IntegrationPlanProviderRefFindingCode.UNPROVIDED_NEED_NAMES_EXISTING_PROVIDER,\n providerRef: need.providerRef,\n path: `unprovidedNeeds.${index}.providerRef`,\n message: `${need.providerRef} is recorded as a need no existing provider fills, but ${need.providerRef} EXISTS (an engine provider or a registry module): bind it instead, and drop the entry.`,\n });\n }\n });\n plan.providerBindings.forEach((binding, index) => {\n if (!PROVIDER_BINDING_SCOPES_CHECKED_FOR_EXISTENCE.has(binding.scope)) return;\n if (known.bindable.has(binding.providerRef) || recordedNeeds.has(binding.providerRef)) return;\n findings.push({\n code: IntegrationPlanProviderRefFindingCode.BINDING_NAMES_NO_KNOWN_PROVIDER,\n providerRef: binding.providerRef,\n path: `providerBindings.${index}.providerRef`,\n message: `${binding.providerRef} is bound, but it is no engine provider, no registry module and nothing this application has. Bind one the brief lists, or, if none fills the need, record ${binding.providerRef} in unprovidedNeeds with why.`,\n });\n });\n plan.providerBindings.forEach((binding, index) => {\n if (!PROVIDER_BINDING_SCOPES_CHECKED_FOR_EXISTENCE.has(binding.scope)) return;\n const facets = known.facetsByProvider?.get(binding.providerRef);\n const needed = PROVIDER_BINDING_SCOPE_FACET[binding.scope];\n if (facets === undefined || facets.has(needed)) return;\n findings.push({\n code: IntegrationPlanProviderRefFindingCode.BINDING_SCOPE_NOT_SHIPPED_BY_PROVIDER,\n providerRef: binding.providerRef,\n path: `providerBindings.${index}.scope`,\n message: `${binding.providerRef} is bound on ${binding.scope}, which loads a \\`${needed}\\` module, but ${binding.providerRef} ships only [${[...facets].sort().join(', ')}]. Bind it on a scope its facets serve, or bind a provider that ships \\`${needed}\\`.`,\n });\n });\n return findings;\n}\n\n/** What {@link repairIntegrationPlanProviderRefs} removed from a plan, each with the finding that removed it. */\nexport interface IntegrationPlanProviderRefRepair {\n readonly plan: IntegrationPlan;\n /** The findings whose elements were removed, paths as they stood BEFORE the removal. Empty when nothing was. */\n readonly removed: readonly IntegrationPlanProviderRefFinding[];\n}\n\n/**\n * The plan with every provider reference {@link validateIntegrationPlanProviderRefs} refuses REMOVED, for the generation's\n * LAST attempt (#3995 review follow-up): the same mechanical repair `skipDroppableRefs` makes for an optional dangling ref\n * (#2556, #3074), so one wrong ref costs that element rather than the whole plan, and with it the run.\n *\n * - An `unprovidedNeeds` entry naming an EXISTING provider is dropped. Its binding stays: it now wires the provider that\n * exists, which is exactly what Paul's rule (#3992) asks for. Nothing is authored, nothing is forked.\n * - A binding to a provider that is neither bindable nor a remaining recorded need is dropped, and so is a binding on a\n * scope whose facet its provider does not ship: a task with nothing to wire is not one the build can do. The\n * requirement it served is then served by no binding, which the host reports as an advisory (in the generation's trace\n * and attempt record, and the companion's log); the landing record does not carry it. A binding refused for two reasons\n * is removed once, and recorded once, with its first finding.\n *\n * Needs first, then bindings, against the needs that remain. A dropped need names a provider in `existing`, which the\n * host keeps inside `bindable`, so dropping it never orphans a binding. Pure; the caller decides whether to use it, and\n * uses it only when the model has no attempt left to correct the refs itself.\n */\nexport function repairIntegrationPlanProviderRefs(plan: IntegrationPlan, known: IntegrationPlanKnownProviders): IntegrationPlanProviderRefRepair {\n // The needs first: each refused one names a provider that exists, and its binding (if any) wires that provider instead.\n const refusedNeeds = validateIntegrationPlanProviderRefs(plan, known)\n .filter((finding) => finding.code === IntegrationPlanProviderRefFindingCode.UNPROVIDED_NEED_NAMES_EXISTING_PROVIDER);\n const refusedNeedPaths = new Set(refusedNeeds.map((finding) => finding.path));\n const withKeptNeeds: IntegrationPlan = {\n ...plan,\n unprovidedNeeds: plan.unprovidedNeeds.filter((_need, index) => !refusedNeedPaths.has(`unprovidedNeeds.${index}.providerRef`)),\n };\n // Then the bindings, judged against the needs that remain; the binding list is unchanged, so their paths still hold.\n const refusedBindings = validateIntegrationPlanProviderRefs(withKeptNeeds, known)\n .filter((finding) => finding.code === IntegrationPlanProviderRefFindingCode.BINDING_NAMES_NO_KNOWN_PROVIDER\n || finding.code === IntegrationPlanProviderRefFindingCode.BINDING_SCOPE_NOT_SHIPPED_BY_PROVIDER);\n // A binding is named by `providerBindings.<index>.<field>`, whichever field its finding is about; one removal per binding.\n const bindingIndexOf = (finding: IntegrationPlanProviderRefFinding): number => Number(finding.path.split('.')[1]);\n const refusedBindingIndexes = new Set(refusedBindings.map(bindingIndexOf));\n const firstFindingPerBinding = refusedBindings.filter((finding, position) => refusedBindings.findIndex((other) => bindingIndexOf(other) === bindingIndexOf(finding)) === position);\n const removed = [...refusedNeeds, ...firstFindingPerBinding];\n if (removed.length === 0) return { plan, removed };\n return {\n plan: {\n ...withKeptNeeds,\n providerBindings: plan.providerBindings.filter((_binding, index) => !refusedBindingIndexes.has(index)),\n },\n removed,\n };\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"integration-plan.family-aspects.d.ts","sourceRoot":"","sources":["../../../../src/_core/integration-plan/integration-plan.family-aspects.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"integration-plan.family-aspects.d.ts","sourceRoot":"","sources":["../../../../src/_core/integration-plan/integration-plan.family-aspects.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AAiB1E,eAAO,MAAM,+BAA+B,EAAE,wBAwE7C,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ApplicationSpecificationFamilySemanticSchemaRef } from '../application-specification-family-identity.schemas.js';
|
|
2
2
|
import { FamilyAspectKind } from '../family-aspects.schemas.js';
|
|
3
|
-
import { IntegrationInboundChannelPlanSchema, IntegrationMinionPlanSchema, IntegrationProviderBindingPlanSchema, IntegrationWorkerPlanSchema, } from './integration-plan.schemas.js';
|
|
3
|
+
import { IntegrationInboundChannelPlanSchema, IntegrationUnprovidedNeedSchema, IntegrationMinionPlanSchema, IntegrationProviderBindingPlanSchema, IntegrationWorkerPlanSchema, } from './integration-plan.schemas.js';
|
|
4
4
|
/**
|
|
5
5
|
* The five targets a background surface's `servesRefs` addresses. A build task's `servesRefs` addresses these and
|
|
6
6
|
* more (vision constraints, pricing plans and the brand, #629 #1835 #2221): a background surface serves product
|
|
@@ -52,6 +52,22 @@ export const INTEGRATION_PLAN_FAMILY_ASPECTS = {
|
|
|
52
52
|
augments: 'the provider an augmentation module adds operations to — a provider ref, not a decided element',
|
|
53
53
|
},
|
|
54
54
|
},
|
|
55
|
+
{
|
|
56
|
+
key: 'integration-plan.unprovided-need',
|
|
57
|
+
snapshotPath: 'unprovidedNeeds',
|
|
58
|
+
kind: FamilyAspectKind.COLLECTION,
|
|
59
|
+
itemSchema: IntegrationUnprovidedNeedSchema,
|
|
60
|
+
businessKey: 'providerRef',
|
|
61
|
+
headlineField: 'need',
|
|
62
|
+
edges: [
|
|
63
|
+
{ field: 'servesRefs', targetAspects: SERVES_TARGETS },
|
|
64
|
+
/* The worker or minion that wires the provider for itself (#3995 item 6); its prefix says which. */
|
|
65
|
+
{ field: 'wiredByRef', targetAspects: ['integration-plan.worker', 'integration-plan.minion'] },
|
|
66
|
+
],
|
|
67
|
+
nonEdgeRefFields: {
|
|
68
|
+
providerRef: 'the ref the provider to author will have — a provider ref, not a decided element',
|
|
69
|
+
},
|
|
70
|
+
},
|
|
55
71
|
{
|
|
56
72
|
key: 'integration-plan.inbound-channel',
|
|
57
73
|
snapshotPath: 'inboundChannels',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"integration-plan.family-aspects.js","sourceRoot":"","sources":["../../../../src/_core/integration-plan/integration-plan.family-aspects.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,+CAA+C,EAAE,MAAM,sDAAsD,CAAC;AAEvH,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EACL,mCAAmC,EACnC,2BAA2B,EAC3B,oCAAoC,EACpC,2BAA2B,GAC5B,MAAM,4BAA4B,CAAC;AAEpC;;;;GAIG;AACH,MAAM,cAAc,GAAG,CAAC,yBAAyB,EAAE,6BAA6B,EAAE,eAAe,EAAE,sBAAsB,EAAE,0BAA0B,CAAU,CAAC;AAEhK,MAAM,CAAC,MAAM,+BAA+B,GAA6B;IACvE,SAAS,EAAE,+CAA+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mCAAmC;YAC/C,WAAW,EAAE,SAAS;YACtB,aAAa,EAAE,SAAS;YACxB,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,CAAC;YAC/D,gBAAgB,EAAE,EAAE;SACrB;KACF;CACF,CAAC","sourcesContent":["import { ApplicationSpecificationFamilySemanticSchemaRef } from '../application-specification-family-identity.schemas';\nimport type { FamilyAspectsDeclaration } from '../family-aspects.schemas';\nimport { FamilyAspectKind } from '../family-aspects.schemas';\nimport {\n IntegrationInboundChannelPlanSchema,\n IntegrationMinionPlanSchema,\n IntegrationProviderBindingPlanSchema,\n IntegrationWorkerPlanSchema,\n} from './integration-plan.schemas';\n\n/**\n * The five targets a background surface's `servesRefs` addresses. A build task's `servesRefs` addresses these and\n * more (vision constraints, pricing plans and the brand, #629 #1835 #2221): a background surface serves product\n * scope, never a pricing plan or a brand element.\n */\nconst SERVES_TARGETS = ['requirements.functional', 'requirements.non-functional', 'roadmap.phase', 'feature-drafts.draft', 'vision.success-criterion'] as const;\n\nexport const INTEGRATION_PLAN_FAMILY_ASPECTS: FamilyAspectsDeclaration = {\n schemaRef: ApplicationSpecificationFamilySemanticSchemaRef.INTEGRATION_PLAN,\n aspects: [\n {\n key: 'integration-plan.worker',\n snapshotPath: 'workers',\n kind: FamilyAspectKind.COLLECTION,\n itemSchema: IntegrationWorkerPlanSchema,\n businessKey: 'workerRef',\n headlineField: 'purpose',\n edges: [{ field: 'servesRefs', targetAspects: SERVES_TARGETS }],\n nonEdgeRefFields: {\n jobRefs: 'the routes the worker registers — units of work of the BUILT package, not decided elements',\n },\n },\n {\n key: 'integration-plan.minion',\n snapshotPath: 'minions',\n kind: FamilyAspectKind.COLLECTION,\n itemSchema: IntegrationMinionPlanSchema,\n businessKey: 'minionRef',\n headlineField: 'purpose',\n edges: [\n /* The containment decision, as a link: which decided resources this tick may touch. */\n { field: 'readsResourceRefs', targetAspects: ['domain-plan.resource'] },\n { field: 'writesResourceRefs', targetAspects: ['domain-plan.resource'] },\n { field: 'servesRefs', targetAspects: SERVES_TARGETS },\n ],\n nonEdgeRefFields: {\n behaviorRefs: \"the tick's named behaviours — work of the BUILT package, not decided elements\",\n },\n },\n {\n key: 'integration-plan.provider-binding',\n snapshotPath: 'providerBindings',\n kind: FamilyAspectKind.COLLECTION,\n itemSchema: IntegrationProviderBindingPlanSchema,\n businessKey: 'providerRef',\n headlineField: 'providerRef',\n edges: [],\n nonEdgeRefFields: {\n providerRef: \"a provider ref — an engine provider's or a registry provider module's, not a decided element\",\n augments: 'the provider an augmentation module adds operations to — a provider ref, not a decided element',\n },\n },\n {\n key: 'integration-plan.inbound-channel',\n snapshotPath: 'inboundChannels',\n kind: FamilyAspectKind.COLLECTION,\n itemSchema: IntegrationInboundChannelPlanSchema,\n businessKey: 'channel',\n headlineField: 'purpose',\n edges: [{ field: 'servesRefs', targetAspects: SERVES_TARGETS }],\n nonEdgeRefFields: {},\n },\n ],\n};\n"]}
|
|
1
|
+
{"version":3,"file":"integration-plan.family-aspects.js","sourceRoot":"","sources":["../../../../src/_core/integration-plan/integration-plan.family-aspects.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,+CAA+C,EAAE,MAAM,sDAAsD,CAAC;AAEvH,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EACL,mCAAmC,EACnC,+BAA+B,EAC/B,2BAA2B,EAC3B,oCAAoC,EACpC,2BAA2B,GAC5B,MAAM,4BAA4B,CAAC;AAEpC;;;;GAIG;AACH,MAAM,cAAc,GAAG,CAAC,yBAAyB,EAAE,6BAA6B,EAAE,eAAe,EAAE,sBAAsB,EAAE,0BAA0B,CAAU,CAAC;AAEhK,MAAM,CAAC,MAAM,+BAA+B,GAA6B;IACvE,SAAS,EAAE,+CAA+C,CAAC,gBAAgB;IAC3E,OAAO,EAAE;QACP;YACE,GAAG,EAAE,yBAAyB;YAC9B,YAAY,EAAE,SAAS;YACvB,IAAI,EA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,EAAE,aAAa,EAAE,cAAc,EAAE;gBACtD,oGAAoG;gBACpG,EAAE,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,CAAC,yBAAyB,EAAE,yBAAyB,CAAC,EAAE;aAC/F;YACD,gBAAgB,EAAE;gBAChB,WAAW,EAAE,kFAAkF;aAChG;SACF;QACD;YACE,GAAG,EAAE,kCAAkC;YACvC,YAAY,EAAE,iBAAiB;YAC/B,IAAI,EAAE,gBAAgB,CAAC,UAAU;YACjC,UAAU,EAAE,mCAAmC;YAC/C,WAAW,EAAE,SAAS;YACtB,aAAa,EAAE,SAAS;YACxB,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,CAAC;YAC/D,gBAAgB,EAAE,EAAE;SACrB;KACF;CACF,CAAC","sourcesContent":["import { ApplicationSpecificationFamilySemanticSchemaRef } from '../application-specification-family-identity.schemas';\nimport type { FamilyAspectsDeclaration } from '../family-aspects.schemas';\nimport { FamilyAspectKind } from '../family-aspects.schemas';\nimport {\n IntegrationInboundChannelPlanSchema,\n IntegrationUnprovidedNeedSchema,\n IntegrationMinionPlanSchema,\n IntegrationProviderBindingPlanSchema,\n IntegrationWorkerPlanSchema,\n} from './integration-plan.schemas';\n\n/**\n * The five targets a background surface's `servesRefs` addresses. A build task's `servesRefs` addresses these and\n * more (vision constraints, pricing plans and the brand, #629 #1835 #2221): a background surface serves product\n * scope, never a pricing plan or a brand element.\n */\nconst SERVES_TARGETS = ['requirements.functional', 'requirements.non-functional', 'roadmap.phase', 'feature-drafts.draft', 'vision.success-criterion'] as const;\n\nexport const INTEGRATION_PLAN_FAMILY_ASPECTS: FamilyAspectsDeclaration = {\n schemaRef: ApplicationSpecificationFamilySemanticSchemaRef.INTEGRATION_PLAN,\n aspects: [\n {\n key: 'integration-plan.worker',\n snapshotPath: 'workers',\n kind: FamilyAspectKind.COLLECTION,\n itemSchema: IntegrationWorkerPlanSchema,\n businessKey: 'workerRef',\n headlineField: 'purpose',\n edges: [{ field: 'servesRefs', targetAspects: SERVES_TARGETS }],\n nonEdgeRefFields: {\n jobRefs: 'the routes the worker registers — units of work of the BUILT package, not decided elements',\n },\n },\n {\n key: 'integration-plan.minion',\n snapshotPath: 'minions',\n kind: FamilyAspectKind.COLLECTION,\n itemSchema: IntegrationMinionPlanSchema,\n businessKey: 'minionRef',\n headlineField: 'purpose',\n edges: [\n /* The containment decision, as a link: which decided resources this tick may touch. */\n { field: 'readsResourceRefs', targetAspects: ['domain-plan.resource'] },\n { field: 'writesResourceRefs', targetAspects: ['domain-plan.resource'] },\n { field: 'servesRefs', targetAspects: SERVES_TARGETS },\n ],\n nonEdgeRefFields: {\n behaviorRefs: \"the tick's named behaviours — work of the BUILT package, not decided elements\",\n },\n },\n {\n key: 'integration-plan.provider-binding',\n snapshotPath: 'providerBindings',\n kind: FamilyAspectKind.COLLECTION,\n itemSchema: IntegrationProviderBindingPlanSchema,\n businessKey: 'providerRef',\n headlineField: 'providerRef',\n edges: [],\n nonEdgeRefFields: {\n providerRef: \"a provider ref — an engine provider's or a registry provider module's, not a decided element\",\n augments: 'the provider an augmentation module adds operations to — a provider ref, not a decided element',\n },\n },\n {\n key: 'integration-plan.unprovided-need',\n snapshotPath: 'unprovidedNeeds',\n kind: FamilyAspectKind.COLLECTION,\n itemSchema: IntegrationUnprovidedNeedSchema,\n businessKey: 'providerRef',\n headlineField: 'need',\n edges: [\n { field: 'servesRefs', targetAspects: SERVES_TARGETS },\n /* The worker or minion that wires the provider for itself (#3995 item 6); its prefix says which. */\n { field: 'wiredByRef', targetAspects: ['integration-plan.worker', 'integration-plan.minion'] },\n ],\n nonEdgeRefFields: {\n providerRef: 'the ref the provider to author will have — a provider ref, not a decided element',\n },\n },\n {\n key: 'integration-plan.inbound-channel',\n snapshotPath: 'inboundChannels',\n kind: FamilyAspectKind.COLLECTION,\n itemSchema: IntegrationInboundChannelPlanSchema,\n businessKey: 'channel',\n headlineField: 'purpose',\n edges: [{ field: 'servesRefs', targetAspects: SERVES_TARGETS }],\n nonEdgeRefFields: {},\n },\n ],\n};\n"]}
|
|
@@ -6,7 +6,8 @@ import { BuildPlanWorkerRuntime, ProviderBindingScope } from '../build-plan/buil
|
|
|
6
6
|
* @wildo_source:part:start integration-plan.config facet:layer:specification facet:family:integration-plan
|
|
7
7
|
*
|
|
8
8
|
* WHAT RUNS BESIDE THE BACKEND, and what the application reaches out to (#1495) — its workers, its
|
|
9
|
-
* minions, the providers it binds,
|
|
9
|
+
* minions, the providers it binds, the channels work arrives on (#1630), and the needs no existing
|
|
10
|
+
* provider fills, each with why (#3992): the only door to authoring a new provider.
|
|
10
11
|
*
|
|
11
12
|
* ## Why this family exists
|
|
12
13
|
*
|
|
@@ -66,9 +67,6 @@ export declare const INTEGRATION_PROVIDER_BINDING_SKILL_REF: Readonly<Record<Pro
|
|
|
66
67
|
* the sender assurance it requires, and whether it answers (#1630).
|
|
67
68
|
*/
|
|
68
69
|
export declare const INTEGRATION_INBOUND_CHANNEL_SKILL_REF = "inbound-channels";
|
|
69
|
-
/** Stable prefixes the trusted runtime stamps; a provider supplies only the slug. */
|
|
70
|
-
export declare const INTEGRATION_WORKER_REF_PREFIX = "worker-";
|
|
71
|
-
export declare const INTEGRATION_MINION_REF_PREFIX = "minion-";
|
|
72
70
|
/** One worker: an HTTP-only subprocess the backend delegates to. */
|
|
73
71
|
export declare const IntegrationWorkerPlanSchema: z.ZodObject<{
|
|
74
72
|
workerRef: z.ZodString;
|
|
@@ -96,6 +94,37 @@ export declare const IntegrationProviderBindingPlanSchema: z.ZodObject<{
|
|
|
96
94
|
rationale: z.ZodString;
|
|
97
95
|
}, z.core.$strict>;
|
|
98
96
|
export type IntegrationProviderBindingPlan = z.infer<typeof IntegrationProviderBindingPlanSchema>;
|
|
97
|
+
/**
|
|
98
|
+
* A need NO provider the framework already has fills (#3992), recorded so that a provider is authored only for a reason
|
|
99
|
+
* someone wrote down. App creation USES the engine's providers and the registry's modules; authoring a new one is the last
|
|
100
|
+
* resort (Paul, 2026-11-16), and only an entry here may become a build task that authors a provider package. A binding may
|
|
101
|
+
* name a provider that does not exist yet only when an entry here names it.
|
|
102
|
+
*
|
|
103
|
+
* ## Who wires it: a provider binding, or the worker or minion named by `wiredByRef` (#3995 item 6)
|
|
104
|
+
*
|
|
105
|
+
* A need reaches the build in one of two ways. Either a {@link IntegrationProviderBindingPlanSchema binding} names its
|
|
106
|
+
* `providerRef` on the runtime owner that needs it (backend, companion, application frontend, website), and that binding's
|
|
107
|
+
* task authors the provider; or {@link wiredByRef} names the planned worker or minion that alone uses it, and THAT
|
|
108
|
+
* surface's task authors the provider and declares it in the surface's own scope
|
|
109
|
+
* (`providers.scopes.workers.<key>` / `providers.scopes.minions.<key>`, which the worker and minion tasks already write).
|
|
110
|
+
*
|
|
111
|
+
* Decided by what the framework already does: a worker's or minion's provider is declared on that surface's own
|
|
112
|
+
* `providers` block and belongs to the task that builds it (see {@link ProviderBindingScope}), so the plan names the
|
|
113
|
+
* surface rather than inventing a scope for it. Rejected: adding `WORKER` and `MINION` members to `ProviderBindingScope`.
|
|
114
|
+
* The scope is a closed set of SINGLE owners, each with one declaration file a landing probe reads and one skill; a
|
|
115
|
+
* worker or minion scope is keyed per surface (`scopes.workers.<key>`), so a bare `WORKER` member would name no file and
|
|
116
|
+
* no surface, and carrying the key would turn every binding into a second worker-or-minion reference beside the one
|
|
117
|
+
* this field already is. It would also give a minion's provider a task of its own, apart from the minion that holds its
|
|
118
|
+
* whitelist and its schedule, which the scope's own contract forbids.
|
|
119
|
+
*/
|
|
120
|
+
export declare const IntegrationUnprovidedNeedSchema: z.ZodObject<{
|
|
121
|
+
providerRef: z.ZodString;
|
|
122
|
+
need: z.ZodString;
|
|
123
|
+
whyNoExistingProvider: z.ZodString;
|
|
124
|
+
wiredByRef: z.ZodOptional<z.ZodString>;
|
|
125
|
+
servesRefs: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
126
|
+
}, z.core.$strict>;
|
|
127
|
+
export type IntegrationUnprovidedNeed = z.infer<typeof IntegrationUnprovidedNeedSchema>;
|
|
99
128
|
/**
|
|
100
129
|
* One channel work ARRIVES on (#1630, #3394): the application declares that messages on this channel are
|
|
101
130
|
* work it acts on, which is what makes the foundation enable the channel's engine capability
|
|
@@ -118,7 +147,9 @@ export type IntegrationInboundChannelPlan = z.infer<typeof IntegrationInboundCha
|
|
|
118
147
|
* THE integration-plan payload.
|
|
119
148
|
*
|
|
120
149
|
* **Artifact-family id: `integration-plan`.** Produced by `bottom_up.integration-plan`, consumed by
|
|
121
|
-
* `bottom_up.build-decompose`, which emits one task per worker, minion, provider binding and inbound channel.
|
|
150
|
+
* `bottom_up.build-decompose`, which emits one task per worker, minion, provider binding and inbound channel. A binding
|
|
151
|
+
* whose provider is an {@link IntegrationUnprovidedNeedSchema unprovided need}, or the worker or minion such a need names
|
|
152
|
+
* as `wiredByRef`, is the one task that AUTHORS the provider; every other binding wires a provider that exists.
|
|
122
153
|
*
|
|
123
154
|
* Every collection may be EMPTY and the whole plan is still meaningful: most applications need no
|
|
124
155
|
* worker and no minion, and saying so is an answer. There is no `min(1)` anywhere here, and that is
|
|
@@ -158,6 +189,13 @@ export declare const IntegrationPlanSchema: z.ZodObject<{
|
|
|
158
189
|
purpose: z.ZodString;
|
|
159
190
|
servesRefs: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
160
191
|
}, z.core.$strict>>>;
|
|
192
|
+
unprovidedNeeds: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
193
|
+
providerRef: z.ZodString;
|
|
194
|
+
need: z.ZodString;
|
|
195
|
+
whyNoExistingProvider: z.ZodString;
|
|
196
|
+
wiredByRef: z.ZodOptional<z.ZodString>;
|
|
197
|
+
servesRefs: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
198
|
+
}, z.core.$strict>>>;
|
|
161
199
|
}, z.core.$strip>;
|
|
162
200
|
export type IntegrationPlan = z.infer<typeof IntegrationPlanSchema>;
|
|
163
201
|
/** @wildo_source:part:end integration-plan.config */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"integration-plan.schemas.d.ts","sourceRoot":"","sources":["../../../../src/_core/integration-plan/integration-plan.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,0BAA0B,CAAC;AAElC,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,EAAE,sBAAsB,EAA+B,oBAAoB,EAAE,MAAM,6CAA6C,CAAC;
|
|
1
|
+
{"version":3,"file":"integration-plan.schemas.d.ts","sourceRoot":"","sources":["../../../../src/_core/integration-plan/integration-plan.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,0BAA0B,CAAC;AAElC,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,EAAE,sBAAsB,EAA+B,oBAAoB,EAAE,MAAM,6CAA6C,CAAC;AAQxI;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,oBAAY,sBAAsB;IAChC,EAAE,OAAO;CACV;AAED;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,4BAA4B,EAAE,QAAQ,CAAC,MAAM,CAAC,sBAAsB,EAAE,MAAM,CAAC,CAGzF,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,4BAA4B,qBAAqB,CAAC;AAE/D;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,sCAAsC,EAAE,QAAQ,CAAC,MAAM,CAAC,oBAAoB,EAAE,MAAM,CAAC,CAKjG,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,qCAAqC,qBAAqB,CAAC;AAKxE,oEAAoE;AACpE,eAAO,MAAM,2BAA2B;;;;;;kBAYtC,CAAC;AACH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAEhF,iDAAiD;AACjD,eAAO,MAAM,2BAA2B;;;;;;;kBAkBtC,CAAC;AACH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAEhF,yDAAyD;AACzD,eAAO,MAAM,oCAAoC;;;;;kBAkB/C,CAAC;AACH,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oCAAoC,CAAC,CAAC;AAUlG;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,+BAA+B;;;;;;kBAuB1C,CAAC;AACH,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAC;AAExF;;;;;;;;GAQG;AACH,eAAO,MAAM,mCAAmC;;;;;;;kBAK9C,CAAC;AACH,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mCAAmC,CAAC,CAAC;AAEhG;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAkEhC,CAAC;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AACpE,qDAAqD"}
|
|
@@ -3,11 +3,13 @@ import { z } from 'zod';
|
|
|
3
3
|
// never by the importer's luck (#966). A named import used only as a type would be elided and install nothing.
|
|
4
4
|
import '@wildo-ai/zod-decorators';
|
|
5
5
|
import { BuildPlanWorkerRuntime, PlannableInboundChannelKind, ProviderBindingScope } from '../build-plan/build-plan-task-graph.schemas.js';
|
|
6
|
+
import { INTEGRATION_MINION_REF_PREFIX, INTEGRATION_WORKER_REF_PREFIX, IntegrationMinionRefSchema, IntegrationWorkerRefSchema, } from './integration-execution-surface-refs.schemas.js';
|
|
6
7
|
/**
|
|
7
8
|
* @wildo_source:part:start integration-plan.config facet:layer:specification facet:family:integration-plan
|
|
8
9
|
*
|
|
9
10
|
* WHAT RUNS BESIDE THE BACKEND, and what the application reaches out to (#1495) — its workers, its
|
|
10
|
-
* minions, the providers it binds,
|
|
11
|
+
* minions, the providers it binds, the channels work arrives on (#1630), and the needs no existing
|
|
12
|
+
* provider fills, each with why (#3992): the only door to authoring a new provider.
|
|
11
13
|
*
|
|
12
14
|
* ## Why this family exists
|
|
13
15
|
*
|
|
@@ -76,14 +78,11 @@ export const INTEGRATION_PROVIDER_BINDING_SKILL_REF = {
|
|
|
76
78
|
* the sender assurance it requires, and whether it answers (#1630).
|
|
77
79
|
*/
|
|
78
80
|
export const INTEGRATION_INBOUND_CHANNEL_SKILL_REF = 'inbound-channels';
|
|
79
|
-
/** Stable prefixes the trusted runtime stamps; a provider supplies only the slug. */
|
|
80
|
-
export const INTEGRATION_WORKER_REF_PREFIX = 'worker-';
|
|
81
|
-
export const INTEGRATION_MINION_REF_PREFIX = 'minion-';
|
|
82
81
|
const SlugSchema = z.string().regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/);
|
|
83
82
|
const NonEmptyStringSchema = z.string().trim().min(1);
|
|
84
83
|
/** One worker: an HTTP-only subprocess the backend delegates to. */
|
|
85
84
|
export const IntegrationWorkerPlanSchema = z.strictObject({
|
|
86
|
-
workerRef:
|
|
85
|
+
workerRef: IntegrationWorkerRefSchema,
|
|
87
86
|
runtime: z.enum(BuildPlanWorkerRuntime).systemEnum('BuildPlanWorkerRuntime'),
|
|
88
87
|
/** What the backend delegates to it, and why that cannot happen inside a request. */
|
|
89
88
|
purpose: NonEmptyStringSchema,
|
|
@@ -97,7 +96,7 @@ export const IntegrationWorkerPlanSchema = z.strictObject({
|
|
|
97
96
|
});
|
|
98
97
|
/** One minion: a cron unit that wakes itself. */
|
|
99
98
|
export const IntegrationMinionPlanSchema = z.strictObject({
|
|
100
|
-
minionRef:
|
|
99
|
+
minionRef: IntegrationMinionRefSchema,
|
|
101
100
|
/** What happens because time passed, and why it is not a request. */
|
|
102
101
|
purpose: NonEmptyStringSchema,
|
|
103
102
|
/** The named behaviours its tick performs. At least one: a minion that does nothing is a schedule with no work. */
|
|
@@ -135,6 +134,58 @@ export const IntegrationProviderBindingPlanSchema = z.strictObject({
|
|
|
135
134
|
/** Why this application reaches this provider from this scope. */
|
|
136
135
|
rationale: NonEmptyStringSchema,
|
|
137
136
|
});
|
|
137
|
+
/**
|
|
138
|
+
* The ref of a planned WORKER or MINION (`worker-<slug>`, `minion-<slug>`): the surface that wires an unprovided need for
|
|
139
|
+
* itself (#3995 item 6). The prefix says which collection it names, so a worker and a minion sharing a slug stay distinct.
|
|
140
|
+
*/
|
|
141
|
+
const IntegrationExecutionSurfaceRefSchema = z.string().regex(new RegExp(`^(?:${INTEGRATION_WORKER_REF_PREFIX}|${INTEGRATION_MINION_REF_PREFIX})[a-z0-9]+(?:-[a-z0-9]+)*$`));
|
|
142
|
+
/**
|
|
143
|
+
* A need NO provider the framework already has fills (#3992), recorded so that a provider is authored only for a reason
|
|
144
|
+
* someone wrote down. App creation USES the engine's providers and the registry's modules; authoring a new one is the last
|
|
145
|
+
* resort (Paul, 2026-11-16), and only an entry here may become a build task that authors a provider package. A binding may
|
|
146
|
+
* name a provider that does not exist yet only when an entry here names it.
|
|
147
|
+
*
|
|
148
|
+
* ## Who wires it: a provider binding, or the worker or minion named by `wiredByRef` (#3995 item 6)
|
|
149
|
+
*
|
|
150
|
+
* A need reaches the build in one of two ways. Either a {@link IntegrationProviderBindingPlanSchema binding} names its
|
|
151
|
+
* `providerRef` on the runtime owner that needs it (backend, companion, application frontend, website), and that binding's
|
|
152
|
+
* task authors the provider; or {@link wiredByRef} names the planned worker or minion that alone uses it, and THAT
|
|
153
|
+
* surface's task authors the provider and declares it in the surface's own scope
|
|
154
|
+
* (`providers.scopes.workers.<key>` / `providers.scopes.minions.<key>`, which the worker and minion tasks already write).
|
|
155
|
+
*
|
|
156
|
+
* Decided by what the framework already does: a worker's or minion's provider is declared on that surface's own
|
|
157
|
+
* `providers` block and belongs to the task that builds it (see {@link ProviderBindingScope}), so the plan names the
|
|
158
|
+
* surface rather than inventing a scope for it. Rejected: adding `WORKER` and `MINION` members to `ProviderBindingScope`.
|
|
159
|
+
* The scope is a closed set of SINGLE owners, each with one declaration file a landing probe reads and one skill; a
|
|
160
|
+
* worker or minion scope is keyed per surface (`scopes.workers.<key>`), so a bare `WORKER` member would name no file and
|
|
161
|
+
* no surface, and carrying the key would turn every binding into a second worker-or-minion reference beside the one
|
|
162
|
+
* this field already is. It would also give a minion's provider a task of its own, apart from the minion that holds its
|
|
163
|
+
* whitelist and its schedule, which the scope's own contract forbids.
|
|
164
|
+
*/
|
|
165
|
+
export const IntegrationUnprovidedNeedSchema = z.strictObject({
|
|
166
|
+
/**
|
|
167
|
+
* The ref the provider to author will have: what the binding that wires it names as its `providerRef`. The entry's
|
|
168
|
+
* business key, on its OWN schema instance: the workbench takes an entry's own key out of its reading, and a key sharing
|
|
169
|
+
* an instance with another aspect's headline (a binding is headed by its `providerRef`) would either stay printed or
|
|
170
|
+
* blank that headline.
|
|
171
|
+
*/
|
|
172
|
+
providerRef: z.string().regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/),
|
|
173
|
+
/** What the application needs from outside, in its own words — "send invoices through the client's Fortnox ledger". */
|
|
174
|
+
need: NonEmptyStringSchema,
|
|
175
|
+
/**
|
|
176
|
+
* Why no engine provider and no registry module fills it: a vendor none of them offers, a behaviour they lack, or a
|
|
177
|
+
* business obligation that names a vendor. Checked against the lists the planner was shown; "it seemed simpler" is not one.
|
|
178
|
+
*/
|
|
179
|
+
whyNoExistingProvider: NonEmptyStringSchema,
|
|
180
|
+
/**
|
|
181
|
+
* The planned worker or minion that wires this provider for itself (`worker-<slug>`, `minion-<slug>`), when no other
|
|
182
|
+
* runtime owner uses it. Its build task then authors the provider and declares it in that surface's own scope. Absent
|
|
183
|
+
* when a provider binding wires it; both may be present when the surface and a runtime owner both use it.
|
|
184
|
+
*/
|
|
185
|
+
wiredByRef: IntegrationExecutionSurfaceRefSchema.optional(),
|
|
186
|
+
/** The requirements it is accountable to. */
|
|
187
|
+
servesRefs: z.array(NonEmptyStringSchema).default([]),
|
|
188
|
+
});
|
|
138
189
|
/**
|
|
139
190
|
* One channel work ARRIVES on (#1630, #3394): the application declares that messages on this channel are
|
|
140
191
|
* work it acts on, which is what makes the foundation enable the channel's engine capability
|
|
@@ -154,7 +205,9 @@ export const IntegrationInboundChannelPlanSchema = z.strictObject({
|
|
|
154
205
|
* THE integration-plan payload.
|
|
155
206
|
*
|
|
156
207
|
* **Artifact-family id: `integration-plan`.** Produced by `bottom_up.integration-plan`, consumed by
|
|
157
|
-
* `bottom_up.build-decompose`, which emits one task per worker, minion, provider binding and inbound channel.
|
|
208
|
+
* `bottom_up.build-decompose`, which emits one task per worker, minion, provider binding and inbound channel. A binding
|
|
209
|
+
* whose provider is an {@link IntegrationUnprovidedNeedSchema unprovided need}, or the worker or minion such a need names
|
|
210
|
+
* as `wiredByRef`, is the one task that AUTHORS the provider; every other binding wires a provider that exists.
|
|
158
211
|
*
|
|
159
212
|
* Every collection may be EMPTY and the whole plan is still meaningful: most applications need no
|
|
160
213
|
* worker and no minion, and saying so is an answer. There is no `min(1)` anywhere here, and that is
|
|
@@ -171,7 +224,16 @@ export const IntegrationPlanSchema = z.object({
|
|
|
171
224
|
providerBindings: z.array(IntegrationProviderBindingPlanSchema).default([]),
|
|
172
225
|
/** Channels work arrives on. Empty for an application no message ever reaches, which is most of them. */
|
|
173
226
|
inboundChannels: z.array(IntegrationInboundChannelPlanSchema).default([]),
|
|
227
|
+
/** Needs no existing provider fills, each with why (#3992). Empty for nearly every application, and that is the point. */
|
|
228
|
+
unprovidedNeeds: z.array(IntegrationUnprovidedNeedSchema).default([]),
|
|
174
229
|
}).superRefine((plan, context) => {
|
|
230
|
+
const unprovided = new Set();
|
|
231
|
+
plan.unprovidedNeeds.forEach((need, index) => {
|
|
232
|
+
if (unprovided.has(need.providerRef)) {
|
|
233
|
+
context.addIssue({ code: 'custom', message: `the unprovided need ${need.providerRef} is recorded twice; one entry says why it is authored`, path: ['unprovidedNeeds', index, 'providerRef'] });
|
|
234
|
+
}
|
|
235
|
+
unprovided.add(need.providerRef);
|
|
236
|
+
});
|
|
175
237
|
const workerRefs = new Set();
|
|
176
238
|
plan.workers.forEach((worker, index) => {
|
|
177
239
|
if (workerRefs.has(worker.workerRef)) {
|
|
@@ -186,6 +248,12 @@ export const IntegrationPlanSchema = z.object({
|
|
|
186
248
|
}
|
|
187
249
|
minionRefs.add(minion.minionRef);
|
|
188
250
|
});
|
|
251
|
+
// A need wired by a surface the plan does not run would be authored for nothing (#3995 item 6).
|
|
252
|
+
plan.unprovidedNeeds.forEach((need, index) => {
|
|
253
|
+
if (need.wiredByRef === undefined || workerRefs.has(need.wiredByRef) || minionRefs.has(need.wiredByRef))
|
|
254
|
+
return;
|
|
255
|
+
context.addIssue({ code: 'custom', message: `the unprovided need ${need.providerRef} is wired by ${need.wiredByRef}, which this plan neither runs as a worker nor as a minion`, path: ['unprovidedNeeds', index, 'wiredByRef'] });
|
|
256
|
+
});
|
|
189
257
|
/*
|
|
190
258
|
* One provider bound TWICE on one scope is one declaration written twice — the config carries a
|
|
191
259
|
* single entry per ref per scope, so the second is either a duplicate or a disagreement, and
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"integration-plan.schemas.js","sourceRoot":"","sources":["../../../../src/_core/integration-plan/integration-plan.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,6GAA6G;AAC7G,+GAA+G;AAC/G,OAAO,0BAA0B,CAAC;AAIlC,OAAO,EAAE,sBAAsB,EAAE,2BAA2B,EAAE,oBAAoB,EAAE,MAAM,6CAA6C,CAAC;AAExI;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,CAAN,IAAY,sBAEX;AAFD,WAAY,sBAAsB;IAChC,mCAAS,CAAA;AACX,CAAC,EAFW,s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AC,CAAC;AAEH,qDAAqD","sourcesContent":["import { z } from 'zod';\n// Side-effect import: this module calls `.systemEnum()` at load, so the decorators must be installed first —\n// never by the importer's luck (#966). A named import used only as a type would be elided and install nothing.\nimport '@wildo-ai/zod-decorators';\n\nimport { InboundChannelKind } from '@wildo-ai/saas-models';\n\nimport { BuildPlanWorkerRuntime, PlannableInboundChannelKind, ProviderBindingScope } from '../build-plan/build-plan-task-graph.schemas';\n\n/**\n * @wildo_source:part:start integration-plan.config facet:layer:specification facet:family:integration-plan\n *\n * WHAT RUNS BESIDE THE BACKEND, and what the application reaches out to (#1495) — its workers, its\n * minions, the providers it binds, and the channels work arrives on (#1630).\n *\n * ## Why this family exists\n *\n * `add-minion`, `add-worker-node`, `add-worker-rust`, `add-provider` and `add-file-picker-provider`\n * all shipped as scenarios, and the decomposer was told to plan \"workers / minions and other\n * auxiliary execution surfaces\" and \"providers, external connectors, billing wiring\" — with no\n * product kind for any of them and, measured 2026-09-22, **zero worker or minion skills in the\n * catalog**. Nothing in the journey could give an application a background worker, a minion or a\n * provider binding. The skills now exist (`worker-authoring`, `minion-authoring`); this family is\n * the decision that reaches them.\n *\n * ## The one distinction that decides everything here\n *\n * A WORKER answers a call: the backend reaches it over its declared HTTP surface, so it exists\n * because something asks. A MINION wakes on its own schedule and answers to nobody, which is why it\n * carries a containment whitelist rather than a caller's authority. Planning one as the other\n * produces a package that never runs, or one that runs with nothing to contain it.\n */\nexport enum IntegrationPlanVersion {\n V1 = 'v1',\n}\n\n/**\n * The skill that authors a WORKER, total over {@link BuildPlanWorkerRuntime}.\n *\n * Both runtimes share one skill deliberately: `worker-authoring` covers the Node and the Rust\n * package, because the decision a builder makes — the routes it registers, the `wildo-jwt` surface\n * the backend calls, the provider runtime it may load — is the same in both, and only the scenario\n * that composes the package differs. Inventing a second skill for the same knowledge would be the\n * drift these maps exist to prevent.\n *\n * Total rather than hand-kept for the sibling reason: a runtime added tomorrow must name the skill\n * that builds it or fail to compile. Held to the authored catalog by a test in the\n * framework-knowledge package — this layer cannot import the skills, and a ref naming no folder is\n * a task the router cannot answer.\n */\nexport const INTEGRATION_WORKER_SKILL_REF: Readonly<Record<BuildPlanWorkerRuntime, string>> = {\n [BuildPlanWorkerRuntime.NODE]: 'worker-authoring',\n [BuildPlanWorkerRuntime.RUST]: 'worker-authoring',\n};\n\n/**\n * The skill that authors a MINION — a constant rather than a map, because a minion has no\n * vocabulary to branch on: there is one cron unit shape, and `add-minion` composes it.\n */\nexport const INTEGRATION_MINION_SKILL_REF = 'minion-authoring';\n\n/**\n * The skill that declares a PROVIDER BINDING, total over {@link ProviderBindingScope}.\n *\n * The scope decides the SIDE, and the side decides the act. A backend-side binding installs a\n * package in a runtime owner and scopes it — `provider-backend-package` names the companion in its\n * own description, so both members share it honestly. A frontend-side binding authors a provider\n * MODULE, exports it through the providers barrel, appends the companion contribution and declares\n * the scope entry; `provider-frontend-file-picker` is where that mechanism is written down, with\n * the file picker as its worked instance because it is the only frontend provider module this\n * framework ships today. A general frontend-provider skill would take those two rows; until one\n * exists, pointing at the skill that carries the mechanism beats pointing at nothing.\n */\nexport const INTEGRATION_PROVIDER_BINDING_SKILL_REF: Readonly<Record<ProviderBindingScope, string>> = {\n [ProviderBindingScope.BACKEND]: 'provider-backend-package',\n [ProviderBindingScope.COMPANION]: 'provider-backend-package',\n [ProviderBindingScope.FRONTEND_APP]: 'provider-frontend-file-picker',\n [ProviderBindingScope.WEBSITE]: 'provider-frontend-file-picker',\n};\n\n/**\n * The skill that authors an inbound CHANNEL handler — what a message arriving on the channel causes,\n * the sender assurance it requires, and whether it answers (#1630).\n */\nexport const INTEGRATION_INBOUND_CHANNEL_SKILL_REF = 'inbound-channels';\n\n/** Stable prefixes the trusted runtime stamps; a provider supplies only the slug. */\nexport const INTEGRATION_WORKER_REF_PREFIX = 'worker-';\nexport const INTEGRATION_MINION_REF_PREFIX = 'minion-';\n\nconst SlugSchema = z.string().regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/);\nconst NonEmptyStringSchema = z.string().trim().min(1);\n\n/** One worker: an HTTP-only subprocess the backend delegates to. */\nexport const IntegrationWorkerPlanSchema = z.strictObject({\n workerRef: z.string().regex(new RegExp(`^${INTEGRATION_WORKER_REF_PREFIX}[a-z0-9]+(?:-[a-z0-9]+)*$`)),\n runtime: z.enum(BuildPlanWorkerRuntime).systemEnum('BuildPlanWorkerRuntime'),\n /** What the backend delegates to it, and why that cannot happen inside a request. */\n purpose: NonEmptyStringSchema,\n /**\n * The units of work it exposes — the ROUTES its entry registers, which is what the backend calls.\n * At least one: a worker exposing nothing is a process nothing can reach.\n */\n jobRefs: z.array(SlugSchema).min(1),\n /** What this worker is accountable to — requirement, feature-draft or roadmap refs. Traceability, never scope. */\n servesRefs: z.array(NonEmptyStringSchema).default([]),\n});\nexport type IntegrationWorkerPlan = z.infer<typeof IntegrationWorkerPlanSchema>;\n\n/** One minion: a cron unit that wakes itself. */\nexport const IntegrationMinionPlanSchema = z.strictObject({\n minionRef: z.string().regex(new RegExp(`^${INTEGRATION_MINION_REF_PREFIX}[a-z0-9]+(?:-[a-z0-9]+)*$`)),\n /** What happens because time passed, and why it is not a request. */\n purpose: NonEmptyStringSchema,\n /** The named behaviours its tick performs. At least one: a minion that does nothing is a schedule with no work. */\n behaviorRefs: z.array(SlugSchema).min(1),\n /**\n * The resources its tick reads and writes, by their domain-plan refs.\n *\n * Planned rather than left to the coding agent because they are the CONTAINMENT decision: a\n * minion's `resourceAccess` whitelist is DENY-ALL until somebody widens it, and each named\n * resource must separately opt in with `systemAccessPolicy`. A minion planned without saying what\n * it touches is one whose whitelist an agent has to guess — and the failure is silent, because an\n * empty whitelist logs a soft warning and keeps running.\n */\n readsResourceRefs: z.array(SlugSchema).default([]),\n writesResourceRefs: z.array(SlugSchema).default([]),\n servesRefs: z.array(NonEmptyStringSchema).default([]),\n});\nexport type IntegrationMinionPlan = z.infer<typeof IntegrationMinionPlanSchema>;\n\n/** One provider bound into one runtime owner's scope. */\nexport const IntegrationProviderBindingPlanSchema = z.strictObject({\n /**\n * The provider's own ref: an engine provider's, or a registry provider module's (#2012). For a module that ADDS\n * operations to another provider (an augmentation, #1672), it is still the module's own ref (`microsoft-teams`), and\n * {@link augments} names the provider it adds them to.\n */\n providerRef: SlugSchema,\n scope: z.enum(ProviderBindingScope).systemEnum('ProviderBindingScope'),\n /**\n * The provider this module adds operations to, when it is an augmentation (#1672, #2025): `microsoft` for\n * `microsoft-teams`. What lands such a binding is not a scope entry (an augmentation owns no ref and writes none) but\n * the application's opt-in, `providers.augmentations.<augments>` listing the module's package, which configuration\n * sync refuses unless a scope declares `<augments>`. Absent for every other provider. Only on a backend-side scope\n * (BACKEND, COMPANION): an augmentation is backend code.\n */\n augments: SlugSchema.optional(),\n /** Why this application reaches this provider from this scope. */\n rationale: NonEmptyStringSchema,\n});\nexport type IntegrationProviderBindingPlan = z.infer<typeof IntegrationProviderBindingPlanSchema>;\n\n/**\n * One channel work ARRIVES on (#1630, #3394): the application declares that messages on this channel are\n * work it acts on, which is what makes the foundation enable the channel's engine capability\n * (`EMAIL_INBOUND` for email, `SMS` for texts) rather than ask anyone.\n *\n * `EMAIL` and `SMS` are declarable ({@link PlannableInboundChannelKind}). `WEBHOOK` is the channel every\n * signed delivery from another system arrives on, derived for those deliveries and never declared; chat joins\n * when a person's chat message can reach a channel handler.\n */\nexport const IntegrationInboundChannelPlanSchema = z.strictObject({\n channel: z.enum(PlannableInboundChannelKind).systemEnum('InboundChannelKind'),\n /** What arrives on it, and what the application does with it — \"clients send case documents to their matter\", \"patients text to move an appointment\". */\n purpose: NonEmptyStringSchema,\n servesRefs: z.array(NonEmptyStringSchema).default([]),\n});\nexport type IntegrationInboundChannelPlan = z.infer<typeof IntegrationInboundChannelPlanSchema>;\n\n/**\n * THE integration-plan payload.\n *\n * **Artifact-family id: `integration-plan`.** Produced by `bottom_up.integration-plan`, consumed by\n * `bottom_up.build-decompose`, which emits one task per worker, minion, provider binding and inbound channel.\n *\n * Every collection may be EMPTY and the whole plan is still meaningful: most applications need no\n * worker and no minion, and saying so is an answer. There is no `min(1)` anywhere here, and that is\n * the difference between this family and the website or documentation plans — those carry a\n * disposition because a website either exists or does not, while \"no worker, one minion, no extra\n * provider\" is an ordinary shape rather than a declined capability.\n */\nexport const IntegrationPlanSchema = z.object({\n version: z.enum(IntegrationPlanVersion).default(IntegrationPlanVersion.V1),\n /** Why this application runs what it runs beside the backend — including \"nothing\", said once. */\n rationale: NonEmptyStringSchema,\n workers: z.array(IntegrationWorkerPlanSchema).default([]),\n minions: z.array(IntegrationMinionPlanSchema).default([]),\n providerBindings: z.array(IntegrationProviderBindingPlanSchema).default([]),\n /** Channels work arrives on. Empty for an application no message ever reaches, which is most of them. */\n inboundChannels: z.array(IntegrationInboundChannelPlanSchema).default([]),\n}).superRefine((plan, context) => {\n const workerRefs = new Set<string>();\n plan.workers.forEach((worker, index) => {\n if (workerRefs.has(worker.workerRef)) {\n context.addIssue({ code: 'custom', message: `duplicate worker ref ${worker.workerRef}`, path: ['workers', index, 'workerRef'] });\n }\n workerRefs.add(worker.workerRef);\n });\n const minionRefs = new Set<string>();\n plan.minions.forEach((minion, index) => {\n if (minionRefs.has(minion.minionRef)) {\n context.addIssue({ code: 'custom', message: `duplicate minion ref ${minion.minionRef}`, path: ['minions', index, 'minionRef'] });\n }\n minionRefs.add(minion.minionRef);\n });\n /*\n * One provider bound TWICE on one scope is one declaration written twice — the config carries a\n * single entry per ref per scope, so the second is either a duplicate or a disagreement, and\n * neither can be applied. The same provider on two DIFFERENT scopes is legitimate and common.\n */\n const bindings = new Set<string>();\n plan.providerBindings.forEach((binding, index) => {\n if (binding.augments !== undefined) {\n if (binding.augments === binding.providerRef) {\n context.addIssue({ code: 'custom', message: `provider ${binding.providerRef} cannot augment itself`, path: ['providerBindings', index, 'augments'] });\n }\n if (binding.scope !== ProviderBindingScope.BACKEND && binding.scope !== ProviderBindingScope.COMPANION) {\n context.addIssue({ code: 'custom', message: `an augmentation is backend code, so ${binding.providerRef} is bound on BACKEND or COMPANION, not ${binding.scope}`, path: ['providerBindings', index, 'scope'] });\n }\n }\n const identity = `${binding.scope}:${binding.providerRef}`;\n if (bindings.has(identity)) {\n context.addIssue({ code: 'custom', message: `provider ${binding.providerRef} is bound twice on the ${binding.scope} scope`, path: ['providerBindings', index, 'providerRef'] });\n }\n bindings.add(identity);\n });\n const channels = new Set<InboundChannelKind>();\n plan.inboundChannels.forEach((declared, index) => {\n if (channels.has(declared.channel)) {\n context.addIssue({ code: 'custom', message: `the ${declared.channel} channel is declared twice; one declaration says what arrives on it`, path: ['inboundChannels', index, 'channel'] });\n }\n channels.add(declared.channel);\n });\n});\nexport type IntegrationPlan = z.infer<typeof IntegrationPlanSchema>;\n/** @wildo_source:part:end integration-plan.config */\n"]}
|
|
1
|
+
{"version":3,"file":"integration-plan.schemas.js","sourceRoot":"","sources":["../../../../src/_core/integration-plan/integration-plan.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,6GAA6G;AAC7G,+GAA+G;AAC/G,OAAO,0BAA0B,CAAC;AAIlC,OAAO,EAAE,sBAAsB,EAAE,2BAA2B,EAAE,oBAAoB,EAAE,MAAM,6CAA6C,CAAC;AACxI,OAAO,EACL,6BAA6B,EAC7B,6BAA6B,EAC7B,0BAA0B,EAC1B,0BAA0B,GAC3B,MAAM,8CAA8C,CAAC;AAEtD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,CAAN,IAAY,sBAEX;AAFD,WAAY,sBAAsB;IAChC,mCAAS,CAAA;AACX,CAAC,EAFW,sBAAsB,KAAtB,sBAAsB,QAEjC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAqD;IAC5F,CAAC,sBAAsB,CAAC,IAAI,CAAC,EAAE,kBAAkB;IACjD,CAAC,sBAAsB,CAAC,IAAI,CAAC,EAAE,kBAAkB;CAClD,CAAC;AAEF;;;GAGG;AACH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effect import: this module calls `.systemEnum()` at load, so the decorators must be installed first —\n// never by the importer's luck (#966). A named import used only as a type would be elided and install nothing.\nimport '@wildo-ai/zod-decorators';\n\nimport { InboundChannelKind } from '@wildo-ai/saas-models';\n\nimport { BuildPlanWorkerRuntime, PlannableInboundChannelKind, ProviderBindingScope } from '../build-plan/build-plan-task-graph.schemas';\nimport {\n INTEGRATION_MINION_REF_PREFIX,\n INTEGRATION_WORKER_REF_PREFIX,\n IntegrationMinionRefSchema,\n IntegrationWorkerRefSchema,\n} from './integration-execution-surface-refs.schemas';\n\n/**\n * @wildo_source:part:start integration-plan.config facet:layer:specification facet:family:integration-plan\n *\n * WHAT RUNS BESIDE THE BACKEND, and what the application reaches out to (#1495) — its workers, its\n * minions, the providers it binds, the channels work arrives on (#1630), and the needs no existing\n * provider fills, each with why (#3992): the only door to authoring a new provider.\n *\n * ## Why this family exists\n *\n * `add-minion`, `add-worker-node`, `add-worker-rust`, `add-provider` and `add-file-picker-provider`\n * all shipped as scenarios, and the decomposer was told to plan \"workers / minions and other\n * auxiliary execution surfaces\" and \"providers, external connectors, billing wiring\" — with no\n * product kind for any of them and, measured 2026-09-22, **zero worker or minion skills in the\n * catalog**. Nothing in the journey could give an application a background worker, a minion or a\n * provider binding. The skills now exist (`worker-authoring`, `minion-authoring`); this family is\n * the decision that reaches them.\n *\n * ## The one distinction that decides everything here\n *\n * A WORKER answers a call: the backend reaches it over its declared HTTP surface, so it exists\n * because something asks. A MINION wakes on its own schedule and answers to nobody, which is why it\n * carries a containment whitelist rather than a caller's authority. Planning one as the other\n * produces a package that never runs, or one that runs with nothing to contain it.\n */\nexport enum IntegrationPlanVersion {\n V1 = 'v1',\n}\n\n/**\n * The skill that authors a WORKER, total over {@link BuildPlanWorkerRuntime}.\n *\n * Both runtimes share one skill deliberately: `worker-authoring` covers the Node and the Rust\n * package, because the decision a builder makes — the routes it registers, the `wildo-jwt` surface\n * the backend calls, the provider runtime it may load — is the same in both, and only the scenario\n * that composes the package differs. Inventing a second skill for the same knowledge would be the\n * drift these maps exist to prevent.\n *\n * Total rather than hand-kept for the sibling reason: a runtime added tomorrow must name the skill\n * that builds it or fail to compile. Held to the authored catalog by a test in the\n * framework-knowledge package — this layer cannot import the skills, and a ref naming no folder is\n * a task the router cannot answer.\n */\nexport const INTEGRATION_WORKER_SKILL_REF: Readonly<Record<BuildPlanWorkerRuntime, string>> = {\n [BuildPlanWorkerRuntime.NODE]: 'worker-authoring',\n [BuildPlanWorkerRuntime.RUST]: 'worker-authoring',\n};\n\n/**\n * The skill that authors a MINION — a constant rather than a map, because a minion has no\n * vocabulary to branch on: there is one cron unit shape, and `add-minion` composes it.\n */\nexport const INTEGRATION_MINION_SKILL_REF = 'minion-authoring';\n\n/**\n * The skill that declares a PROVIDER BINDING, total over {@link ProviderBindingScope}.\n *\n * The scope decides the SIDE, and the side decides the act. A backend-side binding installs a\n * package in a runtime owner and scopes it — `provider-backend-package` names the companion in its\n * own description, so both members share it honestly. A frontend-side binding authors a provider\n * MODULE, exports it through the providers barrel, appends the companion contribution and declares\n * the scope entry; `provider-frontend-file-picker` is where that mechanism is written down, with\n * the file picker as its worked instance because it is the only frontend provider module this\n * framework ships today. A general frontend-provider skill would take those two rows; until one\n * exists, pointing at the skill that carries the mechanism beats pointing at nothing.\n */\nexport const INTEGRATION_PROVIDER_BINDING_SKILL_REF: Readonly<Record<ProviderBindingScope, string>> = {\n [ProviderBindingScope.BACKEND]: 'provider-backend-package',\n [ProviderBindingScope.COMPANION]: 'provider-backend-package',\n [ProviderBindingScope.FRONTEND_APP]: 'provider-frontend-file-picker',\n [ProviderBindingScope.WEBSITE]: 'provider-frontend-file-picker',\n};\n\n/**\n * The skill that authors an inbound CHANNEL handler — what a message arriving on the channel causes,\n * the sender assurance it requires, and whether it answers (#1630).\n */\nexport const INTEGRATION_INBOUND_CHANNEL_SKILL_REF = 'inbound-channels';\n\nconst SlugSchema = z.string().regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/);\nconst NonEmptyStringSchema = z.string().trim().min(1);\n\n/** One worker: an HTTP-only subprocess the backend delegates to. */\nexport const IntegrationWorkerPlanSchema = z.strictObject({\n workerRef: IntegrationWorkerRefSchema,\n runtime: z.enum(BuildPlanWorkerRuntime).systemEnum('BuildPlanWorkerRuntime'),\n /** What the backend delegates to it, and why that cannot happen inside a request. */\n purpose: NonEmptyStringSchema,\n /**\n * The units of work it exposes — the ROUTES its entry registers, which is what the backend calls.\n * At least one: a worker exposing nothing is a process nothing can reach.\n */\n jobRefs: z.array(SlugSchema).min(1),\n /** What this worker is accountable to — requirement, feature-draft or roadmap refs. Traceability, never scope. */\n servesRefs: z.array(NonEmptyStringSchema).default([]),\n});\nexport type IntegrationWorkerPlan = z.infer<typeof IntegrationWorkerPlanSchema>;\n\n/** One minion: a cron unit that wakes itself. */\nexport const IntegrationMinionPlanSchema = z.strictObject({\n minionRef: IntegrationMinionRefSchema,\n /** What happens because time passed, and why it is not a request. */\n purpose: NonEmptyStringSchema,\n /** The named behaviours its tick performs. At least one: a minion that does nothing is a schedule with no work. */\n behaviorRefs: z.array(SlugSchema).min(1),\n /**\n * The resources its tick reads and writes, by their domain-plan refs.\n *\n * Planned rather than left to the coding agent because they are the CONTAINMENT decision: a\n * minion's `resourceAccess` whitelist is DENY-ALL until somebody widens it, and each named\n * resource must separately opt in with `systemAccessPolicy`. A minion planned without saying what\n * it touches is one whose whitelist an agent has to guess — and the failure is silent, because an\n * empty whitelist logs a soft warning and keeps running.\n */\n readsResourceRefs: z.array(SlugSchema).default([]),\n writesResourceRefs: z.array(SlugSchema).default([]),\n servesRefs: z.array(NonEmptyStringSchema).default([]),\n});\nexport type IntegrationMinionPlan = z.infer<typeof IntegrationMinionPlanSchema>;\n\n/** One provider bound into one runtime owner's scope. */\nexport const IntegrationProviderBindingPlanSchema = z.strictObject({\n /**\n * The provider's own ref: an engine provider's, or a registry provider module's (#2012). For a module that ADDS\n * operations to another provider (an augmentation, #1672), it is still the module's own ref (`microsoft-teams`), and\n * {@link augments} names the provider it adds them to.\n */\n providerRef: SlugSchema,\n scope: z.enum(ProviderBindingScope).systemEnum('ProviderBindingScope'),\n /**\n * The provider this module adds operations to, when it is an augmentation (#1672, #2025): `microsoft` for\n * `microsoft-teams`. What lands such a binding is not a scope entry (an augmentation owns no ref and writes none) but\n * the application's opt-in, `providers.augmentations.<augments>` listing the module's package, which configuration\n * sync refuses unless a scope declares `<augments>`. Absent for every other provider. Only on a backend-side scope\n * (BACKEND, COMPANION): an augmentation is backend code.\n */\n augments: SlugSchema.optional(),\n /** Why this application reaches this provider from this scope. */\n rationale: NonEmptyStringSchema,\n});\nexport type IntegrationProviderBindingPlan = z.infer<typeof IntegrationProviderBindingPlanSchema>;\n\n/**\n * The ref of a planned WORKER or MINION (`worker-<slug>`, `minion-<slug>`): the surface that wires an unprovided need for\n * itself (#3995 item 6). The prefix says which collection it names, so a worker and a minion sharing a slug stay distinct.\n */\nconst IntegrationExecutionSurfaceRefSchema = z.string().regex(\n new RegExp(`^(?:${INTEGRATION_WORKER_REF_PREFIX}|${INTEGRATION_MINION_REF_PREFIX})[a-z0-9]+(?:-[a-z0-9]+)*$`),\n);\n\n/**\n * A need NO provider the framework already has fills (#3992), recorded so that a provider is authored only for a reason\n * someone wrote down. App creation USES the engine's providers and the registry's modules; authoring a new one is the last\n * resort (Paul, 2026-11-16), and only an entry here may become a build task that authors a provider package. A binding may\n * name a provider that does not exist yet only when an entry here names it.\n *\n * ## Who wires it: a provider binding, or the worker or minion named by `wiredByRef` (#3995 item 6)\n *\n * A need reaches the build in one of two ways. Either a {@link IntegrationProviderBindingPlanSchema binding} names its\n * `providerRef` on the runtime owner that needs it (backend, companion, application frontend, website), and that binding's\n * task authors the provider; or {@link wiredByRef} names the planned worker or minion that alone uses it, and THAT\n * surface's task authors the provider and declares it in the surface's own scope\n * (`providers.scopes.workers.<key>` / `providers.scopes.minions.<key>`, which the worker and minion tasks already write).\n *\n * Decided by what the framework already does: a worker's or minion's provider is declared on that surface's own\n * `providers` block and belongs to the task that builds it (see {@link ProviderBindingScope}), so the plan names the\n * surface rather than inventing a scope for it. Rejected: adding `WORKER` and `MINION` members to `ProviderBindingScope`.\n * The scope is a closed set of SINGLE owners, each with one declaration file a landing probe reads and one skill; a\n * worker or minion scope is keyed per surface (`scopes.workers.<key>`), so a bare `WORKER` member would name no file and\n * no surface, and carrying the key would turn every binding into a second worker-or-minion reference beside the one\n * this field already is. It would also give a minion's provider a task of its own, apart from the minion that holds its\n * whitelist and its schedule, which the scope's own contract forbids.\n */\nexport const IntegrationUnprovidedNeedSchema = z.strictObject({\n /**\n * The ref the provider to author will have: what the binding that wires it names as its `providerRef`. The entry's\n * business key, on its OWN schema instance: the workbench takes an entry's own key out of its reading, and a key sharing\n * an instance with another aspect's headline (a binding is headed by its `providerRef`) would either stay printed or\n * blank that headline.\n */\n providerRef: z.string().regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/),\n /** What the application needs from outside, in its own words — \"send invoices through the client's Fortnox ledger\". */\n need: NonEmptyStringSchema,\n /**\n * Why no engine provider and no registry module fills it: a vendor none of them offers, a behaviour they lack, or a\n * business obligation that names a vendor. Checked against the lists the planner was shown; \"it seemed simpler\" is not one.\n */\n whyNoExistingProvider: NonEmptyStringSchema,\n /**\n * The planned worker or minion that wires this provider for itself (`worker-<slug>`, `minion-<slug>`), when no other\n * runtime owner uses it. Its build task then authors the provider and declares it in that surface's own scope. Absent\n * when a provider binding wires it; both may be present when the surface and a runtime owner both use it.\n */\n wiredByRef: IntegrationExecutionSurfaceRefSchema.optional(),\n /** The requirements it is accountable to. */\n servesRefs: z.array(NonEmptyStringSchema).default([]),\n});\nexport type IntegrationUnprovidedNeed = z.infer<typeof IntegrationUnprovidedNeedSchema>;\n\n/**\n * One channel work ARRIVES on (#1630, #3394): the application declares that messages on this channel are\n * work it acts on, which is what makes the foundation enable the channel's engine capability\n * (`EMAIL_INBOUND` for email, `SMS` for texts) rather than ask anyone.\n *\n * `EMAIL` and `SMS` are declarable ({@link PlannableInboundChannelKind}). `WEBHOOK` is the channel every\n * signed delivery from another system arrives on, derived for those deliveries and never declared; chat joins\n * when a person's chat message can reach a channel handler.\n */\nexport const IntegrationInboundChannelPlanSchema = z.strictObject({\n channel: z.enum(PlannableInboundChannelKind).systemEnum('InboundChannelKind'),\n /** What arrives on it, and what the application does with it — \"clients send case documents to their matter\", \"patients text to move an appointment\". */\n purpose: NonEmptyStringSchema,\n servesRefs: z.array(NonEmptyStringSchema).default([]),\n});\nexport type IntegrationInboundChannelPlan = z.infer<typeof IntegrationInboundChannelPlanSchema>;\n\n/**\n * THE integration-plan payload.\n *\n * **Artifact-family id: `integration-plan`.** Produced by `bottom_up.integration-plan`, consumed by\n * `bottom_up.build-decompose`, which emits one task per worker, minion, provider binding and inbound channel. A binding\n * whose provider is an {@link IntegrationUnprovidedNeedSchema unprovided need}, or the worker or minion such a need names\n * as `wiredByRef`, is the one task that AUTHORS the provider; every other binding wires a provider that exists.\n *\n * Every collection may be EMPTY and the whole plan is still meaningful: most applications need no\n * worker and no minion, and saying so is an answer. There is no `min(1)` anywhere here, and that is\n * the difference between this family and the website or documentation plans — those carry a\n * disposition because a website either exists or does not, while \"no worker, one minion, no extra\n * provider\" is an ordinary shape rather than a declined capability.\n */\nexport const IntegrationPlanSchema = z.object({\n version: z.enum(IntegrationPlanVersion).default(IntegrationPlanVersion.V1),\n /** Why this application runs what it runs beside the backend — including \"nothing\", said once. */\n rationale: NonEmptyStringSchema,\n workers: z.array(IntegrationWorkerPlanSchema).default([]),\n minions: z.array(IntegrationMinionPlanSchema).default([]),\n providerBindings: z.array(IntegrationProviderBindingPlanSchema).default([]),\n /** Channels work arrives on. Empty for an application no message ever reaches, which is most of them. */\n inboundChannels: z.array(IntegrationInboundChannelPlanSchema).default([]),\n /** Needs no existing provider fills, each with why (#3992). Empty for nearly every application, and that is the point. */\n unprovidedNeeds: z.array(IntegrationUnprovidedNeedSchema).default([]),\n}).superRefine((plan, context) => {\n const unprovided = new Set<string>();\n plan.unprovidedNeeds.forEach((need, index) => {\n if (unprovided.has(need.providerRef)) {\n context.addIssue({ code: 'custom', message: `the unprovided need ${need.providerRef} is recorded twice; one entry says why it is authored`, path: ['unprovidedNeeds', index, 'providerRef'] });\n }\n unprovided.add(need.providerRef);\n });\n const workerRefs = new Set<string>();\n plan.workers.forEach((worker, index) => {\n if (workerRefs.has(worker.workerRef)) {\n context.addIssue({ code: 'custom', message: `duplicate worker ref ${worker.workerRef}`, path: ['workers', index, 'workerRef'] });\n }\n workerRefs.add(worker.workerRef);\n });\n const minionRefs = new Set<string>();\n plan.minions.forEach((minion, index) => {\n if (minionRefs.has(minion.minionRef)) {\n context.addIssue({ code: 'custom', message: `duplicate minion ref ${minion.minionRef}`, path: ['minions', index, 'minionRef'] });\n }\n minionRefs.add(minion.minionRef);\n });\n // A need wired by a surface the plan does not run would be authored for nothing (#3995 item 6).\n plan.unprovidedNeeds.forEach((need, index) => {\n if (need.wiredByRef === undefined || workerRefs.has(need.wiredByRef) || minionRefs.has(need.wiredByRef)) return;\n context.addIssue({ code: 'custom', message: `the unprovided need ${need.providerRef} is wired by ${need.wiredByRef}, which this plan neither runs as a worker nor as a minion`, path: ['unprovidedNeeds', index, 'wiredByRef'] });\n });\n /*\n * One provider bound TWICE on one scope is one declaration written twice — the config carries a\n * single entry per ref per scope, so the second is either a duplicate or a disagreement, and\n * neither can be applied. The same provider on two DIFFERENT scopes is legitimate and common.\n */\n const bindings = new Set<string>();\n plan.providerBindings.forEach((binding, index) => {\n if (binding.augments !== undefined) {\n if (binding.augments === binding.providerRef) {\n context.addIssue({ code: 'custom', message: `provider ${binding.providerRef} cannot augment itself`, path: ['providerBindings', index, 'augments'] });\n }\n if (binding.scope !== ProviderBindingScope.BACKEND && binding.scope !== ProviderBindingScope.COMPANION) {\n context.addIssue({ code: 'custom', message: `an augmentation is backend code, so ${binding.providerRef} is bound on BACKEND or COMPANION, not ${binding.scope}`, path: ['providerBindings', index, 'scope'] });\n }\n }\n const identity = `${binding.scope}:${binding.providerRef}`;\n if (bindings.has(identity)) {\n context.addIssue({ code: 'custom', message: `provider ${binding.providerRef} is bound twice on the ${binding.scope} scope`, path: ['providerBindings', index, 'providerRef'] });\n }\n bindings.add(identity);\n });\n const channels = new Set<InboundChannelKind>();\n plan.inboundChannels.forEach((declared, index) => {\n if (channels.has(declared.channel)) {\n context.addIssue({ code: 'custom', message: `the ${declared.channel} channel is declared twice; one declaration says what arrives on it`, path: ['inboundChannels', index, 'channel'] });\n }\n channels.add(declared.channel);\n });\n});\nexport type IntegrationPlan = z.infer<typeof IntegrationPlanSchema>;\n/** @wildo_source:part:end integration-plan.config */\n"]}
|
|
@@ -23,6 +23,21 @@ import type { ProviderComplianceProfile } from '@wildo-ai/saas-models';
|
|
|
23
23
|
import type { CodeSymbolRef } from '@wildo-ai/zod-decorators';
|
|
24
24
|
import { ProviderTier, type EngineCapability, type ProviderOrigin } from '@wildo-ai/saas-models';
|
|
25
25
|
import type { DefinitionSpecificationBaseConfig, DefinitionSpecificationCodeHandling } from './definition-specification.schemas';
|
|
26
|
+
/**
|
|
27
|
+
* The facets a provider ships a module for: which runtime owner can load it. One named source for the strings a
|
|
28
|
+
* specification's `facets` holds, read by the integration plan's scope check (#3995) and refused here when a
|
|
29
|
+
* specification names anything else.
|
|
30
|
+
*/
|
|
31
|
+
export declare enum ProviderSpecificationFacet {
|
|
32
|
+
/** A backend provider module: loaded by the backend, the companion, a worker or a minion. */
|
|
33
|
+
BACKEND = "backend",
|
|
34
|
+
/** A browser module of the application frontend (`@wildo-ai/external-connectors-public/app`). */
|
|
35
|
+
FRONTEND_APP = "frontend-app",
|
|
36
|
+
/** A browser module of the marketing website (`…/website`). */
|
|
37
|
+
FRONTEND_WEBSITE = "frontend-website",
|
|
38
|
+
/** A browser module of the documentation site (`…/techdoc`). */
|
|
39
|
+
FRONTEND_TECHDOC = "frontend-techdoc"
|
|
40
|
+
}
|
|
26
41
|
/** One secret the operator supplies, mirrored from the module's `secretsContract`. */
|
|
27
42
|
export interface ProviderSpecificationSecret {
|
|
28
43
|
/** The contract slug (`apiKey`, `webhookSecret`, …). */
|
|
@@ -43,7 +58,7 @@ export interface ProviderSpecificationConfig extends DefinitionSpecificationBase
|
|
|
43
58
|
vendor: string;
|
|
44
59
|
/** Where the provider's code comes from, with catalogue provenance when generated. */
|
|
45
60
|
origin: ProviderOrigin;
|
|
46
|
-
/** Facets the provider ships a module for
|
|
61
|
+
/** Facets the provider ships a module for: {@link ProviderSpecificationFacet} members, refused otherwise. */
|
|
47
62
|
facets: string[];
|
|
48
63
|
/** Authoring keys of the protocols the backend module binds (`BUILTIN_PROVIDER_PROTOCOL` members). */
|
|
49
64
|
protocols: string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider-specification.schemas.d.ts","sourceRoot":"","sources":["../../../src/_core/provider-specification.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,sCAAsC,CAAC;AAC5F,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AACvE;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAEL,YAAY,EACZ,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACpB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,EACV,iCAAiC,EACjC,mCAAmC,EACpC,MAAM,oCAAoC,CAAC;AAS5C,sFAAsF;AACtF,MAAM,WAAW,2BAA2B;IAC1C,wDAAwD;IACxD,IAAI,EAAE,MAAM,CAAC;IACb,2DAA2D;IAC3D,UAAU,EAAE,MAAM,CAAC;IACnB,oDAAoD;IACpD,QAAQ,EAAE,OAAO,CAAC;IAClB,iEAAiE;IACjE,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,2BAA4B,SAAQ,iCAAiC;IACpF,gFAAgF;IAChF,WAAW,EAAE,MAAM,CAAC;IACpB,uEAAuE;IACvE,IAAI,EAAE,YAAY,CAAC;IACnB,iEAAiE;IACjE,MAAM,EAAE,MAAM,CAAC;IACf,sFAAsF;IACtF,MAAM,EAAE,cAAc,CAAC;IACvB,
|
|
1
|
+
{"version":3,"file":"provider-specification.schemas.d.ts","sourceRoot":"","sources":["../../../src/_core/provider-specification.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,sCAAsC,CAAC;AAC5F,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AACvE;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAEL,YAAY,EACZ,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACpB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,EACV,iCAAiC,EACjC,mCAAmC,EACpC,MAAM,oCAAoC,CAAC;AAS5C;;;;GAIG;AACH,oBAAY,0BAA0B;IACpC,6FAA6F;IAC7F,OAAO,YAAY;IACnB,iGAAiG;IACjG,YAAY,iBAAiB;IAC7B,+DAA+D;IAC/D,gBAAgB,qBAAqB;IACrC,gEAAgE;IAChE,gBAAgB,qBAAqB;CACtC;AAID,sFAAsF;AACtF,MAAM,WAAW,2BAA2B;IAC1C,wDAAwD;IACxD,IAAI,EAAE,MAAM,CAAC;IACb,2DAA2D;IAC3D,UAAU,EAAE,MAAM,CAAC;IACnB,oDAAoD;IACpD,QAAQ,EAAE,OAAO,CAAC;IAClB,iEAAiE;IACjE,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,2BAA4B,SAAQ,iCAAiC;IACpF,gFAAgF;IAChF,WAAW,EAAE,MAAM,CAAC;IACpB,uEAAuE;IACvE,IAAI,EAAE,YAAY,CAAC;IACnB,iEAAiE;IACjE,MAAM,EAAE,MAAM,CAAC;IACf,sFAAsF;IACtF,MA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AAG,EAAE,qBAAqB,GAAG,IAAI,CAa/E;AAED,wBAAgB,2BAA2B,CAAC,WAAW,EAAE,MAAM,GAAG,2BAA2B,GAAG,SAAS,CAExG;AAED,wBAAgB,mCAAmC,IAAI,OAAO,CAE7D;AAED,wBAAgB,oCAAoC,IAAI,2BAA2B,EAAE,CAEpF;AAED,sBAAsB;AACtB,wBAAgB,qCAAqC,IAAI,IAAI,CAE5D"}
|
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
import { ProviderOriginKind, ProviderTier, } from '@wildo-ai/saas-models';
|
|
2
2
|
import { assertDefinitionSpecificationBaseConfig, assertNonEmptyTrimmedString, assertOptionalCodeSymbolRef, assertOptionalDefinitionSpecificationCodeHandling, assertOptionalNonEmptyProseSlot, } from './definition-specification-validators.js';
|
|
3
|
+
/**
|
|
4
|
+
* The facets a provider ships a module for: which runtime owner can load it. One named source for the strings a
|
|
5
|
+
* specification's `facets` holds, read by the integration plan's scope check (#3995) and refused here when a
|
|
6
|
+
* specification names anything else.
|
|
7
|
+
*/
|
|
8
|
+
export var ProviderSpecificationFacet;
|
|
9
|
+
(function (ProviderSpecificationFacet) {
|
|
10
|
+
/** A backend provider module: loaded by the backend, the companion, a worker or a minion. */
|
|
11
|
+
ProviderSpecificationFacet["BACKEND"] = "backend";
|
|
12
|
+
/** A browser module of the application frontend (`@wildo-ai/external-connectors-public/app`). */
|
|
13
|
+
ProviderSpecificationFacet["FRONTEND_APP"] = "frontend-app";
|
|
14
|
+
/** A browser module of the marketing website (`…/website`). */
|
|
15
|
+
ProviderSpecificationFacet["FRONTEND_WEBSITE"] = "frontend-website";
|
|
16
|
+
/** A browser module of the documentation site (`…/techdoc`). */
|
|
17
|
+
ProviderSpecificationFacet["FRONTEND_TECHDOC"] = "frontend-techdoc";
|
|
18
|
+
})(ProviderSpecificationFacet || (ProviderSpecificationFacet = {}));
|
|
19
|
+
const PROVIDER_SPECIFICATION_FACETS = new Set(Object.values(ProviderSpecificationFacet));
|
|
3
20
|
// ── Keys ───────────────────────────────────────────────────────────────────
|
|
4
21
|
export const PROVIDER_SPECIFICATION_KEY_PREFIX = 'providers';
|
|
5
22
|
export function providerSpecificationKeyFor(providerRef) {
|
|
@@ -44,6 +61,10 @@ export function validateProviderSpecification(specificationKey, specification) {
|
|
|
44
61
|
if (specification.facets.length === 0) {
|
|
45
62
|
throw new Error(`${errorPrefix} "facets" must name at least one facet the provider ships a module for.`);
|
|
46
63
|
}
|
|
64
|
+
const unknownFacets = specification.facets.filter((facet) => !PROVIDER_SPECIFICATION_FACETS.has(facet));
|
|
65
|
+
if (unknownFacets.length > 0) {
|
|
66
|
+
throw new Error(`${errorPrefix} "facets" names [${unknownFacets.join(', ')}], which are no ProviderSpecificationFacet members.`);
|
|
67
|
+
}
|
|
47
68
|
assertNonEmptyStringList(errorPrefix, 'protocols', specification.protocols);
|
|
48
69
|
assertNonEmptyStringList(errorPrefix, 'providerCapabilities', specification.providerCapabilities);
|
|
49
70
|
assertNonEmptyStringList(errorPrefix, 'engineCapabilities', specification.engineCapabilities);
|