@skaile/workspaces 4.28.2 → 4.29.1
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/CHANGELOG.md +14 -0
- package/dist/{asset-feeds-3P3XWCCZ.js → asset-feeds-46K7CTW2.js} +4 -4
- package/dist/{asset-feeds-3P3XWCCZ.js.map → asset-feeds-46K7CTW2.js.map} +1 -1
- package/dist/asset-manager/index.js +1 -1
- package/dist/{chunk-2ZFE2R7S.js → chunk-3LIUBF5P.js} +2 -2
- package/dist/{chunk-2ZFE2R7S.js.map → chunk-3LIUBF5P.js.map} +1 -1
- package/dist/{chunk-LFZEN3XG.js → chunk-6X4DHKHP.js} +3 -3
- package/dist/{chunk-LFZEN3XG.js.map → chunk-6X4DHKHP.js.map} +1 -1
- package/dist/{chunk-7P6OPPG4.js → chunk-7NC3VL6Z.js} +3 -3
- package/dist/{chunk-7P6OPPG4.js.map → chunk-7NC3VL6Z.js.map} +1 -1
- package/dist/{chunk-TFH6Z4KZ.js → chunk-7SLRVWKR.js} +3 -3
- package/dist/{chunk-TFH6Z4KZ.js.map → chunk-7SLRVWKR.js.map} +1 -1
- package/dist/{chunk-AMJSC6SU.js → chunk-C56FCYFU.js} +3 -3
- package/dist/{chunk-AMJSC6SU.js.map → chunk-C56FCYFU.js.map} +1 -1
- package/dist/{chunk-PZL6BEWG.js → chunk-DIQDYNXZ.js} +3 -3
- package/dist/{chunk-PZL6BEWG.js.map → chunk-DIQDYNXZ.js.map} +1 -1
- package/dist/{chunk-RPZ6ZE7S.js → chunk-G3YTK6UI.js} +79 -23
- package/dist/chunk-G3YTK6UI.js.map +1 -0
- package/dist/{chunk-3TZECMBB.js → chunk-GYBCW4S7.js} +6 -6
- package/dist/{chunk-3TZECMBB.js.map → chunk-GYBCW4S7.js.map} +1 -1
- package/dist/{chunk-DQ64NLMC.js → chunk-K3IBZ2UZ.js} +3 -3
- package/dist/{chunk-DQ64NLMC.js.map → chunk-K3IBZ2UZ.js.map} +1 -1
- package/dist/{chunk-FUKJ4IU6.js → chunk-LIEOC4JE.js} +34 -15
- package/dist/chunk-LIEOC4JE.js.map +1 -0
- package/dist/{chunk-Y42A2ZBB.js → chunk-NGQVRFQJ.js} +4 -4
- package/dist/{chunk-Y42A2ZBB.js.map → chunk-NGQVRFQJ.js.map} +1 -1
- package/dist/{chunk-KPRZHEEI.js → chunk-ORH2BZEM.js} +155 -85
- package/dist/chunk-ORH2BZEM.js.map +1 -0
- package/dist/{chunk-I4C4AHZB.js → chunk-PJY4J37J.js} +3 -3
- package/dist/{chunk-I4C4AHZB.js.map → chunk-PJY4J37J.js.map} +1 -1
- package/dist/{chunk-YU2CVP3M.js → chunk-SZEICOXM.js} +6 -6
- package/dist/{chunk-YU2CVP3M.js.map → chunk-SZEICOXM.js.map} +1 -1
- package/dist/{chunk-BGSM22L6.js → chunk-T57M3SST.js} +6 -6
- package/dist/{chunk-BGSM22L6.js.map → chunk-T57M3SST.js.map} +1 -1
- package/dist/{chunk-ULLMVMAN.js → chunk-UDFWBALP.js} +3 -3
- package/dist/{chunk-ULLMVMAN.js.map → chunk-UDFWBALP.js.map} +1 -1
- package/dist/{chunk-YNJRENVU.js → chunk-UQ3JFN4N.js} +2 -2
- package/dist/{chunk-YNJRENVU.js.map → chunk-UQ3JFN4N.js.map} +1 -1
- package/dist/{chunk-YO654LTQ.js → chunk-YVWUHPQW.js} +43 -66
- package/dist/chunk-YVWUHPQW.js.map +1 -0
- package/dist/{chunk-2MD6TJWZ.js → chunk-YYH5EVPM.js} +3 -3
- package/dist/{chunk-2MD6TJWZ.js.map → chunk-YYH5EVPM.js.map} +1 -1
- package/dist/{chunk-LZRA54EP.js → chunk-ZKX5KY2K.js} +2 -2
- package/dist/{chunk-LZRA54EP.js.map → chunk-ZKX5KY2K.js.map} +1 -1
- package/dist/cli/index.js +37 -37
- package/dist/connectors/index.js +7 -7
- package/dist/{ensure-sources-3NKAGEBJ.js → ensure-sources-HH4CCGY5.js} +4 -4
- package/dist/{ensure-sources-3NKAGEBJ.js.map → ensure-sources-HH4CCGY5.js.map} +1 -1
- package/dist/factory-assets/connectors/box.js +7 -7
- package/dist/factory-assets/connectors/deploy.js +7 -7
- package/dist/factory-assets/connectors/devserver.js +7 -7
- package/dist/factory-assets/connectors/flow/CONNECTOR.md +6 -2
- package/dist/factory-assets/connectors/flow/adapter.js +7 -7
- package/dist/factory-assets/connectors/flow/contract/index.d.ts +1 -1
- package/dist/factory-assets/connectors/flow/contract/index.d.ts.map +1 -1
- package/dist/factory-assets/connectors/flow/contract/output-fields.d.ts +28 -0
- package/dist/factory-assets/connectors/flow/contract/output-fields.d.ts.map +1 -0
- package/dist/factory-assets/connectors/flow/contract/schema.d.ts +5 -0
- package/dist/factory-assets/connectors/flow/contract/schema.d.ts.map +1 -1
- package/dist/factory-assets/connectors/flow/contract.js +4 -4
- package/dist/factory-assets/connectors/flow/engine/output-schema.d.ts +2 -7
- package/dist/factory-assets/connectors/flow/engine/output-schema.d.ts.map +1 -1
- package/dist/factory-assets/connectors/flow/engine.js +4 -4
- package/dist/factory-assets/connectors/flow/prompt-fragments.js +3 -3
- package/dist/factory-assets/connectors/flow/run-flow.js +8 -8
- package/dist/factory-assets/connectors/flow.js +7 -7
- package/dist/factory-assets/connectors/git/CONNECTOR.md +2 -0
- package/dist/factory-assets/connectors/git/driver.d.ts +3 -2
- package/dist/factory-assets/connectors/git/driver.d.ts.map +1 -1
- package/dist/factory-assets/connectors/git.js +7 -7
- package/dist/factory-assets/connectors/gmail.js +7 -7
- package/dist/factory-assets/connectors/googledrive.js +7 -7
- package/dist/factory-assets/connectors/local.js +7 -7
- package/dist/factory-assets/connectors/mattermost.js +7 -7
- package/dist/factory-assets/connectors/memory.js +7 -7
- package/dist/factory-assets/connectors/minio.js +7 -7
- package/dist/factory-assets/connectors/postgres.js +7 -7
- package/dist/factory-assets/connectors/s3.js +7 -7
- package/dist/factory-assets/connectors/sharepoint.js +7 -7
- package/dist/factory-assets/connectors/sqlite.js +7 -7
- package/dist/factory-assets/connectors/static-server.js +7 -7
- package/dist/factory-assets/connectors/tunnel.js +7 -7
- package/dist/factory-assets/connectors/webdav.js +7 -7
- package/dist/factory-assets/connectors/xstate-store.js +7 -7
- package/dist/factory-assets/connectors/xstate.js +7 -7
- package/dist/{flows-4X6PVPPH.js → flows-6WUQ2J4X.js} +3 -3
- package/dist/{flows-4X6PVPPH.js.map → flows-6WUQ2J4X.js.map} +1 -1
- package/dist/{helpers-WHBQSVBQ.js → helpers-BKOX66EA.js} +4 -4
- package/dist/{helpers-WHBQSVBQ.js.map → helpers-BKOX66EA.js.map} +1 -1
- package/dist/{library-publish-4APUZRJV.js → library-publish-PCY3ULAA.js} +10 -10
- package/dist/{library-publish-4APUZRJV.js.map → library-publish-PCY3ULAA.js.map} +1 -1
- package/dist/{open-library-QTC5PH7Y.js → open-library-R73XWQNW.js} +9 -9
- package/dist/{open-library-QTC5PH7Y.js.map → open-library-R73XWQNW.js.map} +1 -1
- package/dist/{project-3K6VBQIV.js → project-7RHUAYUZ.js} +5 -5
- package/dist/{project-3K6VBQIV.js.map → project-7RHUAYUZ.js.map} +1 -1
- package/dist/runner/index.js +13 -13
- package/dist/runner/src/pending-turns.d.ts +28 -0
- package/dist/runner/src/pending-turns.d.ts.map +1 -0
- package/dist/runner/src/serve.d.ts.map +1 -1
- package/dist/sdk/asset-manager.js +1 -1
- package/dist/sdk/flow.js +4 -4
- package/dist/sdk/index.js +13 -13
- package/dist/sdk/runner.js +13 -13
- package/dist/{setup-K37IWBVQ.js → setup-MYJDFOCG.js} +5 -5
- package/dist/{setup-K37IWBVQ.js.map → setup-MYJDFOCG.js.map} +1 -1
- package/dist/{source-DMSYJIY6.js → source-SKGXVE7I.js} +10 -10
- package/dist/{source-DMSYJIY6.js.map → source-SKGXVE7I.js.map} +1 -1
- package/dist/{source-manifest-publish-VJSEWCG7.js → source-manifest-publish-QSZRNMSM.js} +11 -11
- package/dist/{source-manifest-publish-VJSEWCG7.js.map → source-manifest-publish-QSZRNMSM.js.map} +1 -1
- package/dist/tui/index.js +13 -13
- package/dist/workspace-plugin/adapters/mcp.js +2 -2
- package/dist/workspace-plugin/adapters/omp.js +3 -3
- package/dist/workspace-plugin/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-FUKJ4IU6.js.map +0 -1
- package/dist/chunk-KPRZHEEI.js.map +0 -1
- package/dist/chunk-RPZ6ZE7S.js.map +0 -1
- package/dist/chunk-YO654LTQ.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../factory-assets/connectors/flow/contract/classifier.ts","../factory-assets/connectors/flow/contract/expression.ts","../factory-assets/connectors/flow/contract/output-fields.ts","../factory-assets/connectors/flow/contract/schema.ts"],"names":["number","evaluate","record","z","bindingName"],"mappings":";;;AAWO,IAAM,0BAAA,GAA6B,CAAC,YAAA,EAAc,YAAY;AAMrE,IAAM,kBAAA,GAAqB,GAAA;AAC3B,IAAM,gBAAA,GAAmB,CAAA;AACzB,IAAM,gBAAA,GAAmB,EAAA;AAqBlB,SAAS,yBAAyB,YAAA,EAAiC;AACxE,EAAA,IAAI,OAAO,YAAA,KAAiB,QAAA,IAAY,YAAA,KAAiB,IAAA,SAAa,EAAC;AACvE,EAAA,MAAM,aAAc,YAAA,CAAyC,UAAA;AAC7D,EAAA,IAAI,OAAO,UAAA,KAAe,QAAA,IAAY,UAAA,KAAe,IAAA,SAAa,EAAC;AACnE,EAAA,OAAO,MAAA,CAAO,KAAK,UAAU,CAAA;AAC/B;AAGO,SAAS,gCAAgC,YAAA,EAAgC;AAC9E,EAAA,MAAM,QAAA,GAAW,yBAAyB,YAAY,CAAA;AACtD,EAAA,OAAO,2BAA2B,IAAA,CAAK,CAAC,SAAS,QAAA,CAAS,QAAA,CAAS,IAAI,CAAC,CAAA;AAC1E;AAEA,SAAS,SAAS,KAAA,EAAkD;AAClE,EAAA,OAAO,OAAO,UAAU,QAAA,IAAY,KAAA,KAAU,QAAQ,CAAC,K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AW;AACxD,MAAA,OAAA,CAAQ,QAAA,CAAS;AAAA,QACf,IAAA,EAAM,QAAA;AAAA,QACN,IAAA,EAAM,CAAC,OAAA,EAAS,SAAA,EAAW,OAAO,QAAQ,CAAA;AAAA,QAC1C,OAAA,EAAS,CAAA,OAAA,EAAU,IAAA,CAAK,EAAE,CAAA,uNAAA;AAAA,OAC3B,CAAA;AAAA,IACH;AAAA,EACF;AACF","file":"chunk-ORH2BZEM.js","sourcesContent":["/**\n * Classifier-shaped `subprompt` nodes (classifier spec D5): a subprompt opts in by\n * declaring the reserved output properties `confidence` and `calibrated` next to\n * exactly one closed decision property. Only the runtime ever writes the two\n * reserved values, so a threshold on `confidence` can trust them.\n *\n * Pure: shared by the contract rules (`schema.ts`), the adapter, and the runner's\n * classifier decorator, so all three agree on what \"classifier-shaped\" means.\n */\n\n/** Output properties only the runtime may write on a classifier node. */\nexport const RESERVED_CLASSIFIER_FIELDS = [\"confidence\", \"calibrated\"] as const;\n\n/** One of {@link RESERVED_CLASSIFIER_FIELDS}. */\nexport type ReservedClassifierField = (typeof RESERVED_CLASSIFIER_FIELDS)[number];\n\n/** Max options Jev accepts per choice; also the port's documented ceiling. */\nconst MAX_CHOICE_OPTIONS = 255;\nconst MIN_SCORE_LEVELS = 2;\nconst MAX_SCORE_LEVELS = 10;\n\n/** The one decision a classifier node asks for, in the vocabulary of the host port. */\nexport type ClassifierDecision =\n | {\n kind: \"choice\";\n field: string;\n /** Label → rubric (null when the author gave none), in declared order. */\n options: Record<string, string | null>;\n }\n | {\n kind: \"score\";\n field: string;\n /** Levels in ascending `const` order; an answer's level index maps back through {@link values}. */\n levels: string[];\n /** The authored integer `const` for each entry of {@link levels}. */\n values: number[];\n }\n | { kind: \"binary\"; field: string; description?: string };\n\n/** Top-level output property names a contract declares, or `[]` when it declares none. */\nexport function declaredOutputProperties(outputSchema: unknown): string[] {\n if (typeof outputSchema !== \"object\" || outputSchema === null) return [];\n const properties = (outputSchema as Record<string, unknown>).properties;\n if (typeof properties !== \"object\" || properties === null) return [];\n return Object.keys(properties);\n}\n\n/** True when the contract declares either reserved name as a top-level output property. */\nexport function declaresReservedClassifierField(outputSchema: unknown): boolean {\n const declared = declaredOutputProperties(outputSchema);\n return RESERVED_CLASSIFIER_FIELDS.some((name) => declared.includes(name));\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\nfunction typeSet(schema: Record<string, unknown>): Set<string> | undefined {\n const type = schema.type;\n if (typeof type === \"string\") return new Set([type]);\n if (Array.isArray(type) && type.every((entry) => typeof entry === \"string\")) {\n return new Set(type as string[]);\n }\n return undefined;\n}\n\nfunction sameSet(actual: Set<string> | undefined, expected: string[]): boolean {\n return (\n actual !== undefined &&\n actual.size === expected.length &&\n expected.every((entry) => actual.has(entry))\n );\n}\n\nfunction decisionOf(\n field: string,\n schema: unknown,\n): { decision: ClassifierDecision } | { issue: string } {\n if (!isRecord(schema)) return { issue: `decision property ${field} must be a schema object` };\n const types = typeSet(schema);\n if (sameSet(types, [\"boolean\"]) && schema.enum === undefined && schema.oneOf === undefined) {\n return {\n decision: {\n kind: \"binary\",\n field,\n ...(typeof schema.description === \"string\" ? { description: schema.description } : {}),\n },\n };\n }\n if (Array.isArray(schema.enum)) {\n if (types !== undefined && !sameSet(types, [\"string\"])) {\n return { issue: `decision property ${field}: an enum decision must be typed string` };\n }\n const labels = schema.enum;\n if (!labels.every((label) => typeof label === \"string\" && label.length > 0)) {\n return { issue: `decision property ${field}: every enum label must be a non-empty string` };\n }\n if (new Set(labels).size !== labels.length) {\n return { issue: `decision property ${field}: enum labels must be unique` };\n }\n if (labels.length < 2 || labels.length > MAX_CHOICE_OPTIONS) {\n return {\n issue: `decision property ${field}: a choice needs 2–${MAX_CHOICE_OPTIONS} labels`,\n };\n }\n return {\n decision: {\n kind: \"choice\",\n field,\n options: Object.fromEntries((labels as string[]).map((label) => [label, null])),\n },\n };\n }\n if (Array.isArray(schema.oneOf)) {\n const entries = schema.oneOf;\n if (\n !entries.every(\n (entry) =>\n isRecord(entry) &&\n Object.keys(entry).every((key) => key === \"const\" || key === \"description\") &&\n \"const\" in entry &&\n (entry.description === undefined || typeof entry.description === \"string\"),\n )\n ) {\n return {\n issue: `decision property ${field}: every oneOf entry must be { \"const\": …, \"description\": \"…\" }`,\n };\n }\n const consts = (entries as Array<{ const: unknown; description?: string }>).map(\n (entry) => entry.const,\n );\n if (new Set(consts).size !== consts.length) {\n return { issue: `decision property ${field}: oneOf consts must be unique` };\n }\n if (consts.every((value) => typeof value === \"string\" && value.length > 0)) {\n if (types !== undefined && !sameSet(types, [\"string\"])) {\n return {\n issue: `decision property ${field}: a string-labelled choice must be typed string`,\n };\n }\n if (consts.length < 2 || consts.length > MAX_CHOICE_OPTIONS) {\n return {\n issue: `decision property ${field}: a choice needs 2–${MAX_CHOICE_OPTIONS} options`,\n };\n }\n return {\n decision: {\n kind: \"choice\",\n field,\n options: Object.fromEntries(\n (entries as Array<{ const: string; description?: string }>).map((entry) => [\n entry.const,\n entry.description ?? null,\n ]),\n ),\n },\n };\n }\n if (consts.every((value) => typeof value === \"number\" && Number.isInteger(value))) {\n if (types !== undefined && !sameSet(types, [\"integer\"])) {\n return { issue: `decision property ${field}: a score must be typed integer` };\n }\n if (consts.length < MIN_SCORE_LEVELS || consts.length > MAX_SCORE_LEVELS) {\n return {\n issue: `decision property ${field}: a score needs ${MIN_SCORE_LEVELS}–${MAX_SCORE_LEVELS} levels`,\n };\n }\n const ordered = [...(entries as Array<{ const: number; description?: string }>)].sort(\n (a, b) => a.const - b.const,\n );\n return {\n decision: {\n kind: \"score\",\n field,\n levels: ordered.map((entry) => entry.description ?? String(entry.const)),\n values: ordered.map((entry) => entry.const),\n },\n };\n }\n return {\n issue: `decision property ${field}: oneOf consts must be all non-empty strings (choice) or all integers (score)`,\n };\n }\n return {\n issue: `decision property ${field} must be a boolean, a string enum, or a oneOf of { const, description }`,\n };\n}\n\n/** Result of checking a subprompt's output contract against the classifier shape. */\nexport type ClassifierShapeCheck =\n | { classifier: false }\n | { classifier: true; decision: ClassifierDecision }\n | { classifier: true; issues: string[] };\n\n/**\n * Check an output contract against the classifier shape. Returns `classifier: false`\n * when neither reserved name is declared (no opt-in), the decision when the shape\n * holds, or the issues when the node opted in but the shape does not hold.\n */\nexport function checkClassifierShape(outputSchema: unknown): ClassifierShapeCheck {\n if (!declaresReservedClassifierField(outputSchema)) return { classifier: false };\n const schema = outputSchema as Record<string, unknown>;\n const properties = schema.properties as Record<string, unknown>;\n const issues: string[] = [];\n if (schema.type !== \"object\") issues.push('the output schema must be \"type\": \"object\"');\n if (schema.additionalProperties !== false) {\n issues.push(\"the output schema must set additionalProperties: false\");\n }\n const confidence = properties.confidence;\n if (!isRecord(confidence) || !sameSet(typeSet(confidence), [\"number\", \"null\"])) {\n issues.push('confidence must be typed [\"number\", \"null\"]');\n }\n const calibrated = properties.calibrated;\n if (!isRecord(calibrated) || !sameSet(typeSet(calibrated), [\"boolean\"])) {\n issues.push('calibrated must be typed \"boolean\"');\n }\n const decisionFields = Object.keys(properties).filter(\n (name) => !(RESERVED_CLASSIFIER_FIELDS as readonly string[]).includes(name),\n );\n let decision: ClassifierDecision | undefined;\n if (decisionFields.length !== 1) {\n issues.push(\n `a classifier node declares exactly one decision property besides confidence and calibrated (found ${decisionFields.length})`,\n );\n } else {\n const result = decisionOf(decisionFields[0], properties[decisionFields[0]]);\n if (\"issue\" in result) issues.push(result.issue);\n else decision = result.decision;\n }\n const required = Array.isArray(schema.required) ? schema.required : [];\n const expectedRequired = [...decisionFields.slice(0, 1), ...RESERVED_CLASSIFIER_FIELDS];\n if (\n required.length !== expectedRequired.length ||\n !expectedRequired.every((name) => required.includes(name))\n ) {\n issues.push(`required must be exactly [${expectedRequired.map((n) => `\"${n}\"`).join(\", \")}]`);\n }\n if (issues.length > 0 || !decision) return { classifier: true, issues };\n return { classifier: true, decision };\n}\n\n/** The decision of a well-formed classifier contract, or `undefined` for any other contract. */\nexport function classifierDecision(outputSchema: unknown): ClassifierDecision | undefined {\n const check = checkClassifierShape(outputSchema);\n return check.classifier && \"decision\" in check ? check.decision : undefined;\n}\n\n/**\n * The output schema with the reserved properties removed, for the prompt the\n * generative fallback sees: the model is asked only for the decision, never for\n * a number it would make up.\n */\nexport function withoutReservedClassifierFields(\n outputSchema: Record<string, unknown>,\n): Record<string, unknown> {\n const properties = { ...(outputSchema.properties as Record<string, unknown>) };\n for (const name of RESERVED_CLASSIFIER_FIELDS) delete properties[name];\n const required = Array.isArray(outputSchema.required)\n ? outputSchema.required.filter(\n (name) => !(RESERVED_CLASSIFIER_FIELDS as readonly string[]).includes(String(name)),\n )\n : undefined;\n return { ...outputSchema, properties, ...(required ? { required } : {}) };\n}\n","// Canonical definition lives in `@skaile/workspaces/types` — it is the wire\n// shape persisted on `CheckEvidence`/`NodeExecutionAttempt`, not a connector-\n// local concept. Re-exported here so existing in-connector imports are unaffected.\nimport type { BindingOrigin } from \"@skaile/workspaces/types\";\nexport type { BindingOrigin };\n\n/** Hard resource budgets applied to every Flow expression evaluation. */\nexport const FLOW_EXPRESSION_LIMITS = Object.freeze({\n maxLength: 4096,\n maxTokens: 256,\n maxNesting: 32,\n maxPathSegments: 32,\n maxCollectionItems: 1024,\n});\n\n/** Read-only values available to the bounded Flow expression language. */\nexport interface FlowExpressionContext {\n /** Validated input supplied to the current flow run. */\n flow: { input: unknown };\n /** Authored defaults exposed through bounded own-property reads. */\n defaults?: Record<string, unknown>;\n /** Node status and declared output fields keyed by node identifier. */\n nodes: Record<string, { status?: string; output?: { fields?: unknown } }>;\n}\n\n/** A resolved JSON value together with every source that contributed to it. */\nexport interface ResolvedBinding {\n /** Runtime value passed to the node executor. */\n value: unknown;\n /** Stable, de-duplicated provenance in authored traversal order. */\n origins: BindingOrigin[];\n}\n\n/** All named node inputs, keeping executor values separate from provenance. */\nexport interface ResolvedNodeBindings {\n /** Resolved values keyed by authored binding name. */\n values: Record<string, unknown>;\n /** Provenance keyed by authored binding name. */\n origins: Record<string, BindingOrigin[]>;\n}\n\n/** How each producer node obtained its output fields. */\nexport type NodeOutputOrigin = Record<string, \"agent\" | \"runtime\">;\n\n/** @internal Binding names excluded from both authored and direct typed inputs. */\nexport const FLOW_BINDING_NAME_PATTERN = /^(?!__proto__$)/;\n\n/** @internal Collect bounded expressions embedded in a JSON binding value. */\nexport function collectFlowBindingExpressions(value: unknown): string[] {\n if (typeof value === \"string\") {\n return Array.from(value.matchAll(/\\$\\{([^{}]+)\\}/g), (match) => match[1]);\n }\n if (Array.isArray(value)) return value.flatMap(collectFlowBindingExpressions);\n if (typeof value !== \"object\" || value === null) return [];\n return Object.values(value).flatMap(collectFlowBindingExpressions);\n}\n\n/** Deterministic syntax, budget, or path failure raised by the Flow evaluator. */\nexport class FlowExpressionError extends Error {\n /** Stable error name for callers that classify evaluator failures. */\n override readonly name = \"FlowExpressionError\";\n\n /** Runtime path that was grammar-valid but absent from the supplied context. */\n readonly missingPath?: string;\n\n /** Producer node whose `skipped` status is why {@link missingPath} is absent. */\n readonly skippedProducer?: string;\n\n constructor(message: string, missingPath?: string, skippedProducer?: string) {\n super(message);\n this.missingPath = missingPath;\n this.skippedProducer = skippedProducer;\n }\n}\n\ntype TokenKind = \"value\" | \"word\" | \"operator\" | \"punctuation\" | \"eof\";\ninterface Token {\n kind: TokenKind;\n value: unknown;\n position: number;\n}\n\nfunction expressionError(\n message: string,\n position?: number,\n missingPath?: string,\n skippedProducer?: string,\n): FlowExpressionError {\n return new FlowExpressionError(\n position === undefined\n ? `Flow expression ${message}`\n : `Flow expression ${message} at ${position}`,\n missingPath,\n skippedProducer,\n );\n}\n\nfunction parseString(source: string, start: number): { value: string; end: number } {\n const quote = source[start];\n let value = \"\";\n let index = start + 1;\n while (index < source.length) {\n const character = source[index];\n if (character === quote) return { value, end: index + 1 };\n if (character !== \"\\\\\") {\n value += character;\n index++;\n continue;\n }\n\n const escaped = source[index + 1];\n if (escaped === undefined) throw expressionError(\"has an unterminated string\", start);\n const replacements: Record<string, string> = {\n \"\\\\\": \"\\\\\",\n \"'\": \"'\",\n '\"': '\"',\n n: \"\\n\",\n r: \"\\r\",\n t: \"\\t\",\n b: \"\\b\",\n f: \"\\f\",\n };\n if (escaped === \"u\") {\n const hex = source.slice(index + 2, index + 6);\n if (!/^[0-9a-fA-F]{4}$/.test(hex)) {\n throw expressionError(\"has an invalid unicode escape\", index);\n }\n value += String.fromCharCode(Number.parseInt(hex, 16));\n index += 6;\n continue;\n }\n if (!(escaped in replacements)) throw expressionError(\"has an invalid escape\", index);\n value += replacements[escaped];\n index += 2;\n }\n throw expressionError(\"has an unterminated string\", start);\n}\n\nfunction tokenize(source: string): Token[] {\n if (source.length > FLOW_EXPRESSION_LIMITS.maxLength) {\n throw expressionError(`exceeds the length limit of ${FLOW_EXPRESSION_LIMITS.maxLength}`);\n }\n\n const tokens: Token[] = [];\n const add = (token: Token): void => {\n tokens.push(token);\n if (tokens.length > FLOW_EXPRESSION_LIMITS.maxTokens) {\n throw expressionError(`exceeds the token limit of ${FLOW_EXPRESSION_LIMITS.maxTokens}`);\n }\n };\n\n let index = 0;\n while (index < source.length) {\n const character = source[index];\n if (/\\s/.test(character)) {\n index++;\n continue;\n }\n\n const pair = source.slice(index, index + 2);\n if ([\"&&\", \"||\", \"==\", \"!=\", \"<=\", \">=\"].includes(pair)) {\n add({ kind: \"operator\", value: pair, position: index });\n index += 2;\n continue;\n }\n if ([\"!\", \"<\", \">\"].includes(character)) {\n add({ kind: \"operator\", value: character, position: index });\n index++;\n continue;\n }\n if ([\"(\", \")\", \"[\", \"]\", \",\"].includes(character)) {\n add({ kind: \"punctuation\", value: character, position: index });\n index++;\n continue;\n }\n if (character === \"'\" || character === '\"') {\n const parsed = parseString(source, index);\n add({ kind: \"value\", value: parsed.value, position: index });\n index = parsed.end;\n continue;\n }\n\n const number = source.slice(index).match(/^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?/);\n if (number) {\n add({ kind: \"value\", value: Number(number[0]), position: index });\n index += number[0].length;\n continue;\n }\n\n const word = source.slice(index).match(/^[A-Za-z_][A-Za-z0-9_.-]*/);\n if (word) {\n const raw = word[0];\n if (raw === \"true\") add({ kind: \"value\", value: true, position: index });\n else if (raw === \"false\") add({ kind: \"value\", value: false, position: index });\n else if (raw === \"null\") add({ kind: \"value\", value: null, position: index });\n else if (raw === \"in\") add({ kind: \"operator\", value: raw, position: index });\n else add({ kind: \"word\", value: raw, position: index });\n index += raw.length;\n continue;\n }\n\n throw expressionError(`contains unsupported token ${JSON.stringify(character)}`, index);\n }\n tokens.push({ kind: \"eof\", value: \"\", position: source.length });\n return tokens;\n}\n\nconst FORBIDDEN_PATH_SEGMENTS = new Set([\"__proto__\", \"prototype\", \"constructor\"]);\n\nfunction ownValue(value: unknown, segment: string, position: number, path: string): unknown {\n if ((typeof value !== \"object\" && typeof value !== \"function\") || value === null) {\n throw expressionError(\"path does not exist\", position, path);\n }\n if (!Object.hasOwn(value, segment)) {\n throw expressionError(\"path does not exist\", position, path);\n }\n return (value as Record<string, unknown>)[segment];\n}\n\nfunction resolvePath(\n raw: string,\n context: FlowExpressionContext,\n position: number,\n traverse: boolean,\n): unknown {\n const segments = raw.split(\".\");\n if (segments.length > FLOW_EXPRESSION_LIMITS.maxPathSegments) {\n throw expressionError(\n `exceeds the path traversal limit of ${FLOW_EXPRESSION_LIMITS.maxPathSegments}`,\n position,\n );\n }\n if (segments.some((segment) => segment.length === 0)) {\n throw expressionError(\"contains an empty path segment\", position);\n }\n const forbidden = segments.find((segment) => FORBIDDEN_PATH_SEGMENTS.has(segment));\n if (forbidden) throw expressionError(`contains forbidden path segment ${forbidden}`, position);\n\n let value: unknown;\n let remaining: string[];\n /** Producer id when this read is an output read over a node that was skipped. */\n let skippedProducer: string | undefined;\n if (segments[0] === \"flow\" && segments[1] === \"input\") {\n if (segments.length === 2) {\n throw expressionError(\"path requires a JSON property suffix\", position);\n }\n value = context.flow.input;\n remaining = segments.slice(2);\n } else if (segments[0] === \"defaults\" && segments.length >= 2) {\n value = context.defaults ?? {};\n remaining = segments.slice(1);\n } else if (segments[0] === \"nodes\" && segments.length === 3 && segments[2] === \"status\") {\n value = context.nodes;\n remaining = segments.slice(1);\n } else if (\n segments[0] === \"nodes\" &&\n segments.length >= 4 &&\n segments[2] === \"output\" &&\n segments[3] === \"fields\"\n ) {\n if (segments.length === 4) {\n throw expressionError(\"path requires a JSON property suffix\", position);\n }\n if (\n Object.hasOwn(context.nodes, segments[1]) &&\n context.nodes[segments[1]].status === \"skipped\"\n ) {\n skippedProducer = segments[1];\n }\n value = context.nodes;\n remaining = segments.slice(1);\n } else {\n throw expressionError(`contains unsupported path ${raw}`, position);\n }\n\n if (!traverse) return undefined;\n // Raised only on the evaluating pass so a short-circuited branch stays inert.\n // A skipped producer's output is discarded before the context is built, so\n // without this the read reports the generic \"path does not exist\".\n if (skippedProducer !== undefined) {\n throw expressionError(\n `cannot read ${raw}: producer node ${skippedProducer} was skipped and produced no output`,\n position,\n raw,\n skippedProducer,\n );\n }\n for (const segment of remaining) value = ownValue(value, segment, position, raw);\n return value;\n}\n\nfunction compare(operator: string, left: unknown, right: unknown, position: number): boolean {\n if (operator === \"==\") return Object.is(left, right);\n if (operator === \"!=\") return !Object.is(left, right);\n if (operator === \"in\") {\n if (!Array.isArray(right))\n throw expressionError(\"requires an array on the right of in\", position);\n if (right.length > FLOW_EXPRESSION_LIMITS.maxCollectionItems) {\n throw expressionError(\n `exceeds the collection item limit of ${FLOW_EXPRESSION_LIMITS.maxCollectionItems}`,\n position,\n );\n }\n return right.some((candidate) => Object.is(candidate, left));\n }\n if (\n !(\n (typeof left === \"number\" && typeof right === \"number\") ||\n (typeof left === \"string\" && typeof right === \"string\")\n )\n ) {\n throw expressionError(`requires comparable operands for ${operator}`, position);\n }\n if (operator === \"<\") return left < right;\n if (operator === \"<=\") return left <= right;\n if (operator === \">\") return left > right;\n if (operator === \">=\") return left >= right;\n throw expressionError(`contains unsupported operator ${operator}`, position);\n}\n\nconst STATIC_BOOLEAN = Symbol(\"static-boolean\");\nconst STATIC_PATH = Symbol(\"static-path\");\n\ninterface StaticPath {\n marker: typeof STATIC_PATH;\n path: string;\n}\n\nfunction isStaticPath(value: unknown): value is StaticPath {\n return (\n typeof value === \"object\" && value !== null && (value as StaticPath).marker === STATIC_PATH\n );\n}\n\nfunction isBooleanOperand(value: unknown): boolean {\n return typeof value === \"boolean\" || value === STATIC_BOOLEAN || isStaticPath(value);\n}\n\nfunction assertBooleanOperand(value: unknown, position: number): void {\n if (!isBooleanOperand(value)) throw expressionError(\"requires boolean operands\", position);\n}\n\nclass Parser {\n private index = 0;\n private nesting = 0;\n /** Literal `path == true` conjuncts already parsed, one frame per enclosing `&&` chain. */\n private readonly guardFrames: string[][] = [];\n /**\n * Guards the operand {@link parseComparison} just parsed establishes when true:\n * its own path for a literal `path == true`, or every guard of a parenthesized\n * `&&` group, which is true only when all its conjuncts are.\n */\n private lastGuards: string[] = [];\n /** Guards of the `&&` / `||` chain that just finished; empty once a `||` joined it. */\n private lastChainGuards: string[] = [];\n\n constructor(\n private readonly tokens: Token[],\n private readonly context: FlowExpressionContext,\n private readonly onPath?: (path: string) => void,\n private readonly onBooleanPath?: (path: string) => void,\n private readonly onEvaluatedPath?: (path: string) => void,\n private readonly onComparison?: (comparison: FlowExpressionComparison) => void,\n ) {}\n\n parse(evaluate = true): unknown {\n const value = this.parseOr(evaluate);\n const trailing = this.peek();\n if (trailing.kind !== \"eof\") {\n throw expressionError(\n `contains unexpected token ${String(trailing.value)}`,\n trailing.position,\n );\n }\n return value;\n }\n\n private peek(): Token {\n return this.tokens[this.index];\n }\n\n private take(): Token {\n return this.tokens[this.index++];\n }\n\n private accept(value: string): Token | undefined {\n if (this.peek().value !== value) return undefined;\n return this.take();\n }\n\n private parseOr(evaluate: boolean): unknown {\n let value = this.parseAnd(evaluate);\n let disjunction = false;\n while (this.peek().value === \"||\") {\n disjunction = true;\n const operator = this.take();\n assertBooleanOperand(value, operator.position);\n if (isStaticPath(value)) this.onBooleanPath?.(value.path);\n const evaluateRight = evaluate && value === false;\n const right = this.parseAnd(evaluateRight);\n assertBooleanOperand(right, operator.position);\n if (isStaticPath(right)) this.onBooleanPath?.(right.path);\n value = evaluate ? value === true || right === true : STATIC_BOOLEAN;\n }\n if (disjunction) this.lastChainGuards = [];\n return value;\n }\n\n private parseAnd(evaluate: boolean): unknown {\n // A conjunct's guard is pushed only after the conjunct is parsed, so a\n // comparison sees exactly the guards that short-circuit ahead of it.\n const guards: string[] = [];\n this.guardFrames.push(guards);\n try {\n let value = this.parseComparison(evaluate);\n guards.push(...this.lastGuards);\n while (this.peek().value === \"&&\") {\n const operator = this.take();\n assertBooleanOperand(value, operator.position);\n if (isStaticPath(value)) this.onBooleanPath?.(value.path);\n const evaluateRight = evaluate && value === true;\n const right = this.parseComparison(evaluateRight);\n guards.push(...this.lastGuards);\n assertBooleanOperand(right, operator.position);\n if (isStaticPath(right)) this.onBooleanPath?.(right.path);\n value = evaluate ? value === true && right === true : STATIC_BOOLEAN;\n }\n this.lastChainGuards = [...guards];\n return value;\n } finally {\n this.guardFrames.pop();\n }\n }\n\n private parseComparison(evaluate: boolean): unknown {\n // The grammar has no postfix operators, so an operand opening with `(` is exactly that group.\n const group = this.peek().value === \"(\";\n const left = this.parseUnary(evaluate);\n const token = this.peek();\n if (\n token.kind !== \"operator\" ||\n ![\"==\", \"!=\", \"<\", \"<=\", \">\", \">=\", \"in\"].includes(String(token.value))\n ) {\n this.lastGuards = group ? this.lastChainGuards : [];\n return left;\n }\n this.take();\n const right = this.parseUnary(evaluate);\n const operator = String(token.value);\n this.onComparison?.({\n operator,\n left: isStaticPath(left) ? { path: left.path } : { literal: left },\n right: isStaticPath(right) ? { path: right.path } : { literal: right },\n guards: this.guardFrames.flat(),\n });\n this.lastGuards = operator === \"==\" && isStaticPath(left) && right === true ? [left.path] : [];\n return evaluate ? compare(operator, left, right, token.position) : STATIC_BOOLEAN;\n }\n\n private parseUnary(evaluate: boolean): unknown {\n const operator = this.accept(\"!\");\n if (operator) {\n const value = this.parseUnary(evaluate);\n assertBooleanOperand(value, operator.position);\n if (isStaticPath(value)) this.onBooleanPath?.(value.path);\n return evaluate ? value === false : STATIC_BOOLEAN;\n }\n return this.parsePrimary(evaluate);\n }\n\n private parsePrimary(evaluate: boolean): unknown {\n const token = this.take();\n if (token.kind === \"value\") return token.value;\n if (token.kind === \"word\") {\n this.onPath?.(String(token.value));\n resolvePath(String(token.value), this.context, token.position, false);\n if (evaluate) this.onEvaluatedPath?.(String(token.value));\n return evaluate\n ? resolvePath(String(token.value), this.context, token.position, true)\n : { marker: STATIC_PATH, path: String(token.value) };\n }\n if (token.value === \"(\") {\n this.enterNesting(token.position);\n const value = this.parseOr(evaluate);\n if (!this.accept(\")\"))\n throw expressionError(\"is missing a closing parenthesis\", token.position);\n this.nesting--;\n return value;\n }\n if (token.value === \"[\") {\n this.enterNesting(token.position);\n const values: unknown[] = [];\n if (!this.accept(\"]\")) {\n do values.push(this.parsePrimary(evaluate));\n while (this.accept(\",\"));\n if (!this.accept(\"]\"))\n throw expressionError(\"is missing a closing bracket\", token.position);\n }\n this.nesting--;\n return values;\n }\n throw expressionError(`contains unexpected token ${String(token.value)}`, token.position);\n }\n\n private enterNesting(position: number): void {\n this.nesting++;\n if (this.nesting > FLOW_EXPRESSION_LIMITS.maxNesting) {\n throw expressionError(\n `exceeds the nesting limit of ${FLOW_EXPRESSION_LIMITS.maxNesting}`,\n position,\n );\n }\n }\n}\n\n/** Static path evidence used to reconcile safe grammar with declared producer output types. */\nexport interface FlowExpressionReference {\n /** Grammar-approved context path. */\n path: string;\n /** True when logical evaluation requires the resolved value itself to be boolean. */\n booleanOperand: boolean;\n}\n\n/** One side of a comparison: a context path, or a literal (anything that is not a bare path). */\nexport type FlowExpressionOperand = { path: string } | { literal: unknown };\n\n/** Static evidence for one comparison, with the guards that short-circuit ahead of it. */\nexport interface FlowExpressionComparison {\n /** `==`, `!=`, `<`, `<=`, `>`, `>=` or `in`. */\n operator: string;\n left: FlowExpressionOperand;\n right: FlowExpressionOperand;\n /**\n * Paths `p` of every literal `p == true` conjunct that sits strictly earlier in\n * an enclosing `&&` chain, so the comparison is evaluated only once each is\n * true. Only that literal form counts: `true == p` and `p != false` are not\n * recognized as guards.\n */\n guards: string[];\n}\n\n/** Report every comparison in an authored expression, for rules that need operators and guards. */\nexport function inspectFlowExpressionComparisons(expression: string): FlowExpressionComparison[] {\n const tokens = tokenize(expression);\n if (expression.trim() === \"default\") return [];\n const comparisons: FlowExpressionComparison[] = [];\n const context: FlowExpressionContext = { flow: { input: {} }, nodes: {} };\n new Parser(tokens, context, undefined, undefined, undefined, (comparison) =>\n comparisons.push(comparison),\n ).parse(false);\n return comparisons;\n}\n\n/** Validates authored syntax without reading runtime values; binding mode relaxes only the result type. */\nexport function inspectFlowExpression(\n expression: string,\n requireBoolean = true,\n): FlowExpressionReference[] {\n const tokens = tokenize(expression);\n if (expression.trim() === \"default\") return [];\n const references = new Map<string, boolean>();\n const record = (path: string, booleanOperand: boolean): void => {\n references.set(path, (references.get(path) ?? false) || booleanOperand);\n };\n const context: FlowExpressionContext = { flow: { input: {} }, nodes: {} };\n const result = new Parser(\n tokens,\n context,\n (path) => record(path, false),\n (path) => record(path, true),\n ).parse(false);\n if (requireBoolean && typeof result !== \"boolean\" && result !== STATIC_BOOLEAN) {\n throw expressionError(\"must evaluate to a boolean\");\n }\n return Array.from(references, ([path, booleanOperand]) => ({ path, booleanOperand }));\n}\n\n/**\n * Evaluates the bounded Flow expression subset without calls, arithmetic, or dynamic property access.\n * The `default` sentinel is valid only as the complete expression and matches unconditionally.\n */\nexport function evaluateFlowExpression(\n expression: string,\n context: FlowExpressionContext,\n): boolean {\n const tokens = tokenize(expression);\n if (expression.trim() === \"default\") return true;\n const result = new Parser(tokens, context).parse();\n if (typeof result !== \"boolean\") {\n throw expressionError(\"must evaluate to a boolean\");\n }\n return result;\n}\n\n/** Proposal-compatible short name for {@link evaluateFlowExpression}. */\nexport function evaluate(expression: string, context: FlowExpressionContext): boolean {\n return evaluateFlowExpression(expression, context);\n}\n\nfunction evaluateFlowExpressionValue(\n expression: string,\n context: FlowExpressionContext,\n): { value: unknown; paths: string[] } {\n const tokens = tokenize(expression);\n if (expression.trim() === \"default\") return { value: true, paths: [] };\n const paths: string[] = [];\n const value = new Parser(tokens, context, undefined, undefined, (path) =>\n paths.push(path),\n ).parse();\n return { value, paths };\n}\n\nfunction originsForPath(\n path: string,\n nodeOutputOrigin: NodeOutputOrigin,\n flowInputOrigins: Record<string, BindingOrigin[]>,\n): BindingOrigin[] {\n if (path.startsWith(\"flow.input.\")) {\n const inputName = path.split(\".\")[2];\n const inherited = flowInputOrigins[inputName];\n return inherited ?? [{ source: \"flow-input\", path, obtainedBy: \"runtime\" }];\n }\n if (path.startsWith(\"defaults.\")) {\n return [{ source: \"default\", path, obtainedBy: \"runtime\" }];\n }\n\n const segments = path.split(\".\");\n const nodeId = segments[1];\n if (segments.length === 3 && segments[0] === \"nodes\" && segments[2] === \"status\") {\n return [{ source: \"node-status\", nodeId, path, obtainedBy: \"runtime\" }];\n }\n if (\n segments.length >= 5 &&\n segments[0] === \"nodes\" &&\n segments[2] === \"output\" &&\n segments[3] === \"fields\"\n ) {\n const obtainedBy = nodeOutputOrigin[nodeId];\n if (!obtainedBy) {\n throw expressionError(`has no output origin for node ${nodeId}`);\n }\n return [{ source: \"node-output\", nodeId, path, obtainedBy }];\n }\n\n throw expressionError(`contains unsupported path ${path}`);\n}\n\n/** @internal Serialize a JSON-compatible value with deterministic object-key ordering. */\nexport function stableFlowJson(value: unknown): string {\n if (value === undefined) return \"null\";\n if (value === null || typeof value !== \"object\") return JSON.stringify(value) ?? \"null\";\n if (Array.isArray(value)) return `[${value.map(stableFlowJson).join(\",\")}]`;\n const object = value as Record<string, unknown>;\n return `{${Object.keys(object)\n .sort()\n .map((key) => `${JSON.stringify(key)}:${stableFlowJson(object[key])}`)\n .join(\",\")}}`;\n}\n\nfunction interpolationText(value: unknown): string {\n if (typeof value === \"string\") return value;\n return stableFlowJson(value);\n}\n\nfunction deduplicateOrigins(origins: BindingOrigin[]): BindingOrigin[] {\n const seen = new Set<string>();\n return origins.filter((origin) => {\n const key = JSON.stringify(origin);\n if (seen.has(key)) return false;\n seen.add(key);\n return true;\n });\n}\n\nfunction resolveBindingValue(\n authored: unknown,\n bindingPath: string,\n context: FlowExpressionContext,\n nodeOutputOrigin: NodeOutputOrigin,\n flowInputOrigins: Record<string, BindingOrigin[]>,\n depth: number,\n): ResolvedBinding {\n if (depth > FLOW_EXPRESSION_LIMITS.maxNesting) {\n throw expressionError(`exceeds the nesting limit of ${FLOW_EXPRESSION_LIMITS.maxNesting}`);\n }\n\n if (typeof authored === \"string\") {\n const exact = authored.match(/^\\$\\{([^{}]+)\\}$/);\n if (exact) {\n const evaluated = evaluateFlowExpressionValue(exact[1], context);\n return {\n value: evaluated.value,\n origins: deduplicateOrigins(\n evaluated.paths.flatMap((path) =>\n originsForPath(path, nodeOutputOrigin, flowInputOrigins),\n ),\n ),\n };\n }\n\n const matches = Array.from(authored.matchAll(/\\$\\{([^{}]+)\\}/g));\n if (matches.length === 0) {\n return {\n value: authored,\n origins: [{ source: \"literal\", path: bindingPath, obtainedBy: \"runtime\" }],\n };\n }\n\n const origins: BindingOrigin[] = [\n { source: \"literal\", path: bindingPath, obtainedBy: \"runtime\" },\n ];\n const value = authored.replace(/\\$\\{([^{}]+)\\}/g, (_placeholder, expression: string) => {\n const evaluated = evaluateFlowExpressionValue(expression, context);\n origins.push(\n ...evaluated.paths.flatMap((path) =>\n originsForPath(path, nodeOutputOrigin, flowInputOrigins),\n ),\n );\n return interpolationText(evaluated.value);\n });\n return { value, origins: deduplicateOrigins(origins) };\n }\n\n if (Array.isArray(authored)) {\n if (authored.length > FLOW_EXPRESSION_LIMITS.maxCollectionItems) {\n throw expressionError(\n `exceeds the collection item limit of ${FLOW_EXPRESSION_LIMITS.maxCollectionItems}`,\n );\n }\n const resolved = authored.map((value) =>\n resolveBindingValue(\n value,\n bindingPath,\n context,\n nodeOutputOrigin,\n flowInputOrigins,\n depth + 1,\n ),\n );\n return {\n value: resolved.map(({ value }) => value),\n origins: deduplicateOrigins([\n { source: \"literal\", path: bindingPath, obtainedBy: \"runtime\" },\n ...resolved.flatMap(({ origins }) => origins),\n ]),\n };\n }\n\n if (typeof authored === \"object\" && authored !== null) {\n const entries = Object.entries(authored);\n if (entries.length > FLOW_EXPRESSION_LIMITS.maxCollectionItems) {\n throw expressionError(\n `exceeds the collection item limit of ${FLOW_EXPRESSION_LIMITS.maxCollectionItems}`,\n );\n }\n const resolved = entries.map(\n ([key, value]) =>\n [\n key,\n resolveBindingValue(\n value,\n bindingPath,\n context,\n nodeOutputOrigin,\n flowInputOrigins,\n depth + 1,\n ),\n ] as const,\n );\n return {\n value: Object.fromEntries(resolved.map(([key, result]) => [key, result.value])),\n origins: deduplicateOrigins([\n { source: \"literal\", path: bindingPath, obtainedBy: \"runtime\" },\n ...resolved.flatMap(([, result]) => result.origins),\n ]),\n };\n }\n\n return {\n value: authored,\n origins: [{ source: \"literal\", path: bindingPath, obtainedBy: \"runtime\" }],\n };\n}\n\n/**\n * Resolves authored node inputs through the bounded Flow expression grammar.\n *\n * Exact `${...}` placeholders retain their JSON type. Placeholders embedded in\n * text use deterministic interpolation, while arrays and objects are traversed\n * recursively. Runtime values and provenance remain separate so executors do not\n * need to understand trust metadata.\n */\nexport function resolveFlowBindings(\n bindings: Record<string, unknown> | undefined,\n context: FlowExpressionContext,\n nodeOutputOrigin: NodeOutputOrigin = {},\n flowInputOrigins: Record<string, BindingOrigin[]> = {},\n): ResolvedNodeBindings {\n const values: Record<string, unknown> = {};\n const origins: Record<string, BindingOrigin[]> = {};\n const entries = Object.entries(bindings ?? {});\n for (const [name] of entries) {\n if (!FLOW_BINDING_NAME_PATTERN.test(name)) {\n throw expressionError(`contains reserved binding name input.${name}`);\n }\n }\n for (const [name, authored] of entries) {\n const resolved = resolveBindingValue(\n authored,\n `input.${name}`,\n context,\n nodeOutputOrigin,\n flowInputOrigins,\n 0,\n );\n values[name] = resolved.value;\n origins[name] = resolved.origins;\n }\n return { values, origins };\n}\n","import * as z from \"zod\";\nimport type { FlowNodeContract, FlowNodeRun } from \"./schema.js\";\nimport { collectFlowBindingExpressions, inspectFlowExpression } from \"./expression.js\";\n\n/** The node shape both the authored schema and the runtime engine share for consumption. */\ninterface OutputFieldsNode {\n id: string;\n run?: FlowNodeRun;\n contract?: FlowNodeContract;\n}\n\nfunction consumerExpressions(node: OutputFieldsNode): string[] {\n const expressions = (node.contract?.requires ?? []).map(({ expr }) => expr);\n expressions.push(...collectFlowBindingExpressions(node.contract?.input));\n if (node.run?.kind === \"router\") {\n expressions.push(...node.run.routes.map(({ when }) => when));\n }\n return expressions;\n}\n\nfunction readsProducerOutput(node: OutputFieldsNode, producerId: string): boolean {\n return consumerExpressions(node).some((expression) =>\n inspectFlowExpression(expression, false).some(({ path }) =>\n path.startsWith(`nodes.${producerId}.output.fields.`),\n ),\n );\n}\n\n/**\n * Return a producer's declared fields schema only when another node reads it.\n *\n * Consumption is deliberately limited to preconditions, named bindings, and\n * router conditions. Status reads and unreferenced declarations remain prose-only.\n * Throws when a consumer expression does not parse.\n */\nexport function getConsumedOutputSchema(\n flow: { nodes: readonly OutputFieldsNode[] },\n producerId: string,\n): Record<string, unknown> | undefined {\n const producer = flow.nodes.find(({ id }) => id === producerId);\n const schema = producer?.contract?.output?.fields;\n if (!schema) return undefined;\n return flow.nodes.some(\n (consumer) => consumer.id !== producerId && readsProducerOutput(consumer, producerId),\n )\n ? schema\n : undefined;\n}\n\n/**\n * Compile an authored `contract.output.fields` JSON Schema into a validator.\n * The one compile step validation and the runtime share; throws when zod\n * cannot compile the schema.\n */\nexport function compileOutputFieldsSchema(schema: Record<string, unknown>): z.ZodType {\n return z.fromJSONSchema(schema as Parameters<typeof z.fromJSONSchema>[0]);\n}\n\n/** Shared compile-failure text, so authoring-time and run-time errors read the same. */\nexport function invalidOutputFieldsSchemaMessage(error: unknown): string {\n return `invalid authored JSON Schema: ${error instanceof Error ? error.message : String(error)}`;\n}\n","import * as z from \"zod\";\nimport {\n checkClassifierShape,\n declaredOutputProperties,\n declaresReservedClassifierField,\n RESERVED_CLASSIFIER_FIELDS,\n} from \"./classifier.js\";\nimport {\n collectFlowBindingExpressions,\n FLOW_BINDING_NAME_PATTERN,\n inspectFlowExpression,\n inspectFlowExpressionComparisons,\n type FlowExpressionReference,\n} from \"./expression.js\";\nimport {\n compileOutputFieldsSchema,\n getConsumedOutputSchema,\n invalidOutputFieldsSchemaMessage,\n} from \"./output-fields.js\";\n\n/**\n * Any JSON value accepted by an authoring field (`input.example`,\n * `defaults.run_input`, node bindings, JSON Schema documents).\n *\n * Structurally identical to zod's own `util.JSONType`, and mutually assignable\n * with it — the only difference is that the array member is a **named**\n * interface instead of the anonymous `JSONType[]`.\n *\n * That difference is load-bearing for every frontend consumer. Vue's\n * `UnwrapRef<T>` maps an array member to a fresh anonymous mapped type at each\n * level (`{ [K in keyof T]: UnwrapRefSimple<T[K]> }`), so TypeScript's\n * recursion-identity check never fires on a self-recursive JSON alias and the\n * instantiation depth limit is hit instead:\n *\n * ```\n * error TS2589: Type instantiation is excessively deep and possibly infinite.\n * ```\n *\n * A consumer sees that error on their own `const d = ref<FlowDefinition>(…)`\n * line, with nothing pointing back here. Naming the array member gives the\n * recursion a stable identity, so the check fires and `ref<FlowDefinition>()`\n * resolves. Verified against both TypeScript 5.9 and 6.0.\n *\n * Do not replace `FlowJsonArray` with `FlowJsonValue[]` — that reintroduces the\n * regression. `packages/bridge-vue/test/flow-definition-vue-ref.test-d.ts`\n * guards it.\n */\nexport interface FlowJsonArray extends Array<FlowJsonValue> {}\n\n/** @see {@link FlowJsonArray} for why the array member is a named interface. */\nexport type FlowJsonValue =\n | string\n | number\n | boolean\n | null\n | FlowJsonArray\n | { [key: string]: FlowJsonValue };\n\n/**\n * `z.json()` retyped to infer {@link FlowJsonValue} instead of zod's\n * `util.JSONType`. Runtime validation is unchanged — this is a type-level\n * substitution only, and the two types are mutually assignable.\n *\n * A **factory**, not a shared constant: `z.toJSONSchema()` extracts any schema\n * instance reused across call sites into a `$defs` entry addressed by `$ref`.\n * Sharing one instance across the five uses below would therefore rewrite the\n * checked-in `flow.v2.schema.json` artifact (and its contract hash) for a purely\n * type-level change. Handing out a fresh instance per call site keeps the\n * generated schema byte-identical — `contract-json-schema.test.ts` guards it.\n */\nconst jsonValue = (): z.ZodType<FlowJsonValue, FlowJsonValue> =>\n z.json() as unknown as z.ZodType<FlowJsonValue, FlowJsonValue>;\n\n/**\n * Compile-time guard on the claim that the substitution above is type-level\n * only: `FlowJsonValue` and the type `z.json()` actually infers must stay\n * assignable **both ways**, so no caller holding either one is narrowed. Drift\n * on either side violates an `Expect<...>` constraint and fails `tsc` here,\n * rather than surfacing as a surprise at a consumer's call site. Type-only —\n * nothing is emitted.\n */\ntype ZodJsonValue = z.output<ReturnType<typeof z.json>>;\ntype ZodJsonInput = z.input<ReturnType<typeof z.json>>;\ntype AssignableTo<A, B> = [A] extends [B] ? true : false;\ntype Expect<T extends true> = T;\ntype _ZodJsonToFlowJson = Expect<AssignableTo<ZodJsonValue, FlowJsonValue>>;\ntype _FlowJsonToZodJson = Expect<AssignableTo<FlowJsonValue, ZodJsonValue>>;\n// The cast asserts both of ZodType's type params, so the input side needs the\n// same guard — otherwise drift there passes unnoticed.\ntype _ZodJsonInputToFlowJson = Expect<AssignableTo<ZodJsonInput, FlowJsonValue>>;\ntype _FlowJsonToZodJsonInput = Expect<AssignableTo<FlowJsonValue, ZodJsonInput>>;\n\nconst nonEmptyString = z.string().min(1);\nconst flowAssetIdentity = z\n .string()\n .regex(\n /^[a-z0-9]+(?:-[a-z0-9]+)*$/,\n \"Flow identity must be lowercase kebab-case without path separators\",\n );\nconst jsonSchema = z.record(z.string(), jsonValue());\nconst bindingName = z.string().regex(FLOW_BINDING_NAME_PATTERN, \"Binding name is reserved\");\nconst nodeBindings = z.preprocess(\n (value, context) => {\n if (typeof value === \"object\" && value !== null) {\n for (const key of Object.keys(value)) {\n if (!FLOW_BINDING_NAME_PATTERN.test(key)) {\n context.addIssue({ code: \"custom\", path: [key], message: \"Binding name is reserved\" });\n }\n }\n }\n return value;\n },\n z.record(bindingName, jsonValue()),\n);\n\nconst MISSING_FIELD = Symbol(\"missing-field\");\n\nfunction declaredFieldSchema(schema: unknown, path: string[]): unknown | typeof MISSING_FIELD {\n let current = schema;\n for (const segment of path) {\n if (typeof current !== \"object\" || current === null) return MISSING_FIELD;\n const properties = (current as Record<string, unknown>).properties;\n if (\n typeof properties !== \"object\" ||\n properties === null ||\n !Object.hasOwn(properties, segment)\n ) {\n return MISSING_FIELD;\n }\n current = (properties as Record<string, unknown>)[segment];\n }\n return current;\n}\n\n// `labelField` names the input property a host shows in place of a run's opaque\n// instance id. It sits beside the schema it points into so every run of the flow\n// labels the same way, and a name absent from that schema is an authoring error.\nconst FlowInputContractSchema = z\n .strictObject({\n schema: jsonSchema,\n example: jsonValue().optional(),\n labelField: nonEmptyString.optional(),\n })\n .superRefine((input, context) => {\n if (input.labelField === undefined) return;\n if (declaredFieldSchema(input.schema, [input.labelField]) === MISSING_FIELD) {\n // Looked up as one literal key, so a dotted name fails here too: a label\n // names a top-level property of the input schema, never a path into it.\n const hint = input.labelField.includes(\".\")\n ? \" (labelField names a single top-level property, not a path)\"\n : \"\";\n context.addIssue({\n code: \"custom\",\n path: [\"labelField\"],\n message: `input schema does not declare property ${input.labelField}${hint}`,\n });\n }\n });\n\nconst FlowOutputContractSchema = z.strictObject({\n schema: jsonSchema,\n});\n\nconst PreconditionSchema = z.strictObject({\n expr: nonEmptyString,\n message: nonEmptyString.optional(),\n});\n\nconst ArtifactContractSchema = z.strictObject({\n kind: nonEmptyString,\n lifetime: z.enum([\"session\", \"persistent\"]),\n});\n\nconst NodeOutputContractSchema = z.strictObject({\n fields: jsonSchema.optional(),\n artifacts: z.array(ArtifactContractSchema).optional(),\n});\n\nconst NodeContractSchema = z.strictObject({\n requires: z.array(PreconditionSchema).optional(),\n input: nodeBindings.optional(),\n output: NodeOutputContractSchema.optional(),\n});\n\nconst NodeGateSchema = z.strictObject({\n approval: z.enum([\"none\", \"optional\", \"mandatory\"]),\n});\n\nconst NodeControlSchema = z.strictObject({\n optional: z.boolean().optional(),\n retries: z.number().int().min(0).optional(),\n timeoutSec: z.number().positive().optional(),\n parallelGroup: nonEmptyString.optional(),\n});\n\nconst runAssets = { assets: z.array(nonEmptyString).optional() };\n\n// Closed vocabulary, not a free-form model id: the runtime resolves each tier to a\n// concrete model, keeping authored flows portable across model-lineup changes.\nconst modelTier = z.enum([\"small\", \"default\", \"deep\"]);\n\nconst AgentRunSchema = z.strictObject({\n kind: z.literal(\"agent\"),\n instruction: nonEmptyString,\n model: modelTier.optional(),\n ...runAssets,\n});\n\nconst SubpromptRunSchema = z.strictObject({\n kind: z.literal(\"subprompt\"),\n instruction: nonEmptyString,\n model: modelTier.optional(),\n ...runAssets,\n});\n\n/** The process streams a deterministic node can capture into its output fields. */\nexport const FLOW_CAPTURE_CHANNELS = [\"stdout\", \"stderr\"] as const;\n\n/**\n * A capture destination names exactly one direct output field. The schema and\n * the runtime both apply this one pattern, so a definition that validates can\n * never fail its capture at run time.\n */\nexport const FLOW_CAPTURE_DESTINATION_PATTERN = /^fields\\.([^.]+)$/;\n\n/** The output field a capture destination writes, or `undefined` when the destination is invalid. */\nexport function captureDestinationFieldName(destination: string): string | undefined {\n return FLOW_CAPTURE_DESTINATION_PATTERN.exec(destination)?.[1] || undefined;\n}\n\n/** Shared refusal text, so authoring-time and run-time errors read the same. */\nexport function invalidCaptureDestinationMessage(\n kind: \"function\" | \"check\",\n nodeId: string,\n channel: (typeof FLOW_CAPTURE_CHANNELS)[number],\n destination: string,\n): string {\n const kindLabel = kind === \"check\" ? \"Check\" : \"Function\";\n return `${kindLabel} node ${nodeId} run.capture.${channel} destination \"${destination}\" is invalid; expected fields.<name>`;\n}\n\n/**\n * Refusal text for stdout and stderr captured into one field: the runtime builds\n * the fields object channel by channel, so stderr would silently replace stdout.\n */\nexport function duplicateCaptureDestinationMessage(\n kind: \"function\" | \"check\",\n nodeId: string,\n fieldName: string,\n): string {\n const kindLabel = kind === \"check\" ? \"Check\" : \"Function\";\n return `${kindLabel} node ${nodeId} run.capture.stdout and run.capture.stderr both write fields.${fieldName}; stderr would overwrite stdout, so capture them into different fields`;\n}\n\nconst deterministicRun = {\n runtime: z.enum([\"shell\", \"node\", \"python\"]).optional(),\n command: nonEmptyString,\n cwd: nonEmptyString.optional(),\n successExit: z.array(z.number().int()).optional(),\n capture: z\n .strictObject({ stdout: nonEmptyString.optional(), stderr: nonEmptyString.optional() })\n .optional(),\n ...runAssets,\n};\n\nconst FunctionRunSchema = z.strictObject({\n kind: z.literal(\"function\"),\n ...deterministicRun,\n});\n\nconst CheckRunSchema = z.strictObject({\n kind: z.literal(\"check\"),\n onFail: z.enum([\"escalate\", \"fail\"]).default(\"escalate\"),\n ...deterministicRun,\n});\n\nconst InputChoiceSchema = z.strictObject({\n id: nonEmptyString,\n label: nonEmptyString,\n description: nonEmptyString.optional(),\n});\n\nconst FormFieldSchema = z.strictObject({\n id: nonEmptyString,\n label: nonEmptyString,\n type: z.enum([\"text\", \"textarea\", \"number\", \"choice\", \"file\", \"date\", \"boolean\"]),\n required: z.boolean().optional(),\n options: z.array(InputChoiceSchema).optional(),\n accept: z.array(nonEmptyString).optional(),\n});\n\n// Exported so the `request_input` write path validates against the same object a\n// flow definition does — a second, hand-rolled rule is how the two drifted.\nexport const InputSchema = z.discriminatedUnion(\"kind\", [\n z.strictObject({ kind: z.literal(\"text\"), multiline: z.boolean().optional() }),\n z.strictObject({\n kind: z.literal(\"choice\"),\n options: z.array(InputChoiceSchema).min(1),\n multiple: z.boolean().optional(),\n }),\n z.strictObject({ kind: z.literal(\"form\"), fields: z.array(FormFieldSchema) }),\n z.strictObject({\n kind: z.literal(\"file\"),\n accept: z.array(nonEmptyString).optional(),\n maxSize: z.number().positive().optional(),\n multiple: z.boolean().optional(),\n }),\n]);\n\nconst GateRunSchema = z.strictObject({\n kind: z.literal(\"gate\"),\n prompt: nonEmptyString,\n schema: InputSchema,\n ...runAssets,\n});\n\nconst RouteSchema = z.strictObject({\n when: nonEmptyString,\n target: nonEmptyString.nullable(),\n});\n\nconst RouterRunSchema = z.strictObject({\n kind: z.literal(\"router\"),\n routes: z.array(RouteSchema).min(1),\n ...runAssets,\n});\n\nconst SubFlowRunSchema = z.strictObject({\n kind: z.literal(\"sub-flow\"),\n flow: flowAssetIdentity,\n passContext: z.boolean().optional(),\n ...runAssets,\n});\n\nconst RunSchema = z.discriminatedUnion(\"kind\", [\n AgentRunSchema,\n SubpromptRunSchema,\n FunctionRunSchema,\n CheckRunSchema,\n GateRunSchema,\n RouterRunSchema,\n SubFlowRunSchema,\n]);\n\nconst NodeSchema = z.strictObject({\n id: nonEmptyString,\n label: nonEmptyString,\n description: nonEmptyString,\n phase: nonEmptyString.optional(),\n run: RunSchema,\n contract: NodeContractSchema.optional(),\n gate: NodeGateSchema.optional(),\n control: NodeControlSchema.optional(),\n});\n\nconst EdgeSchema = z.strictObject({\n id: nonEmptyString,\n source: nonEmptyString,\n target: nonEmptyString,\n type: z.enum([\"flow\", \"parallel\", \"optional\"]),\n});\n\nconst FlowDefaultsSchema = z.strictObject({\n approval: z.enum([\"checkpoint\", \"auto\", \"manual\"]).optional(),\n researchDepth: nonEmptyString.optional(),\n autoReview: z.boolean().optional(),\n verbosity: nonEmptyString.optional(),\n cliMode: z.boolean().optional(),\n run_input: jsonValue().optional(),\n parameters: z.record(z.string(), jsonValue()).optional(),\n});\n\nconst FlowMetaSchema = z.strictObject({\n icon: nonEmptyString.optional(),\n category: nonEmptyString.optional(),\n tags: z.array(nonEmptyString).optional(),\n stage: nonEmptyString.optional(),\n onboarding: z\n .strictObject({\n input_style: z.enum([\"freeform\", \"structured\", \"repo\"]),\n placeholder: nonEmptyString.optional(),\n fields: z.array(nonEmptyString).optional(),\n })\n .optional(),\n});\n\nconst FlowDefinitionObjectSchema = z.strictObject({\n $schema: nonEmptyString.optional(),\n schemaVersion: z.literal(2),\n id: nonEmptyString,\n version: nonEmptyString,\n name: nonEmptyString,\n description: nonEmptyString.optional(),\n input: FlowInputContractSchema.optional(),\n output: FlowOutputContractSchema.optional(),\n defaults: FlowDefaultsSchema.optional(),\n entry: nonEmptyString.optional(),\n nodes: z.array(NodeSchema),\n edges: z.array(EdgeSchema),\n meta: FlowMetaSchema.optional(),\n});\n\n/** Validates normalized field shapes without applying authored-v2 graph semantics. */\nexport function parseFlowDefinitionStructure(data: unknown) {\n return FlowDefinitionObjectSchema.safeParse(data);\n}\n\nfunction knownNonBooleanType(schema: unknown): string | undefined {\n if (typeof schema !== \"object\" || schema === null) return undefined;\n const type = (schema as Record<string, unknown>).type;\n if (typeof type === \"string\") return type === \"boolean\" ? undefined : type;\n if (\n Array.isArray(type) &&\n type.length > 0 &&\n type.every((candidate) => typeof candidate === \"string\") &&\n type.some((candidate) => candidate !== \"boolean\")\n ) {\n return type.join(\" | \");\n }\n return undefined;\n}\n\n/**\n * Whether the node carries a precondition that is literally `false`, so it can\n * never become available. The engine's `nodeIsInert` delegates here, so the\n * parse-time exemption and the runtime notion of \"inert\" cannot drift apart.\n */\nexport function hasConstantlyFalsePrecondition(node: {\n contract?: { requires?: readonly { expr: string }[] };\n}): boolean {\n return (\n node.contract?.requires?.some((requirement) => requirement.expr.trim() === \"false\") ?? false\n );\n}\n\n/**\n * Why `control.optional` is refused on this node, or `undefined` when it is\n * allowed. `optional` downgrades a failed node to `skipped` so the run carries\n * on — incoherent for a node whose only job is to stop one. Derived in one\n * place so the refusal condition and the message explaining it cannot drift.\n *\n * A `router` is refused only when it can run: skipping one satisfies all of its\n * outgoing edges at once, turning a branch point into a fan-out. The inert\n * placeholder the v1 normalizer emits for every non-executable legacy node\n * (`requires: [{ expr: \"false\" }]` + `optional: true`) is exempt — it never\n * becomes available, so it can neither fail nor branch, and `optional` is what\n * lets the run reach `done` past it. The runtime keeps refusing to degrade a\n * router (`resolveTerminalFailureStatus`) as defence in depth.\n */\nfunction optionalRefusalReason(node: z.infer<typeof NodeSchema>): string | undefined {\n if (node.run.kind === \"gate\") return \"a first-class gate node cannot be optional\";\n if (node.run.kind === \"router\" && !hasConstantlyFalsePrecondition(node)) {\n return `router ${node.id} cannot be optional — skipping it would satisfy every outgoing edge at once and admit every branch instead of selecting one; only an inert placeholder router (contract.requires containing { expr: \"false\" }) may carry control.optional`;\n }\n if (node.run.kind === \"check\") {\n return \"a check node cannot be optional — an optional verification either hides a false green (escalate) or hangs the run forever (fail); reject the check entirely if it should not gate the run\";\n }\n if (node.gate?.approval === \"mandatory\") {\n return \"a node cannot be both optional and a mandatory approval gate\";\n }\n return undefined;\n}\n\n/** Authoritative strict runtime schema for authored, acyclic Flow v2 definitions. */\nexport const FlowDefinitionSchema = FlowDefinitionObjectSchema.superRefine((flow, context) => {\n const nodeIds = new Set<string>();\n for (const [index, node] of flow.nodes.entries()) {\n if (nodeIds.has(node.id)) {\n context.addIssue({\n code: \"custom\",\n path: [\"nodes\", index, \"id\"],\n message: `duplicate node id: ${node.id}`,\n });\n }\n nodeIds.add(node.id);\n if (node.control?.optional === true) {\n const refusal = optionalRefusalReason(node);\n if (refusal !== undefined) {\n context.addIssue({\n code: \"custom\",\n path: [\"nodes\", index, \"control\", \"optional\"],\n message: refusal,\n });\n }\n }\n if (node.run.kind === \"function\" || node.run.kind === \"check\") {\n for (const channel of FLOW_CAPTURE_CHANNELS) {\n const destination = node.run.capture?.[channel];\n if (destination === undefined || captureDestinationFieldName(destination)) continue;\n context.addIssue({\n code: \"custom\",\n path: [\"nodes\", index, \"run\", \"capture\", channel],\n message: invalidCaptureDestinationMessage(node.run.kind, node.id, channel, destination),\n });\n }\n const { stdout, stderr } = node.run.capture ?? {};\n const stdoutField = stdout === undefined ? undefined : captureDestinationFieldName(stdout);\n if (stdoutField !== undefined && stderr !== undefined) {\n if (captureDestinationFieldName(stderr) === stdoutField) {\n context.addIssue({\n code: \"custom\",\n path: [\"nodes\", index, \"run\", \"capture\", \"stderr\"],\n message: duplicateCaptureDestinationMessage(node.run.kind, node.id, stdoutField),\n });\n }\n }\n }\n }\n\n if (flow.entry !== undefined && !nodeIds.has(flow.entry)) {\n context.addIssue({ code: \"custom\", path: [\"entry\"], message: `unknown node: ${flow.entry}` });\n }\n\n const outgoing = new Map<string, Array<{ target: string; path: PropertyKey[] }>>();\n for (const [edgeIndex, edge] of flow.edges.entries()) {\n if (!nodeIds.has(edge.source)) {\n context.addIssue({\n code: \"custom\",\n path: [\"edges\", edgeIndex, \"source\"],\n message: `unknown node: ${edge.source}`,\n });\n }\n if (!nodeIds.has(edge.target)) {\n context.addIssue({\n code: \"custom\",\n path: [\"edges\", edgeIndex, \"target\"],\n message: `unknown node: ${edge.target}`,\n });\n }\n if (edge.type === \"flow\" && nodeIds.has(edge.source) && nodeIds.has(edge.target)) {\n const edges = outgoing.get(edge.source) ?? [];\n edges.push({ target: edge.target, path: [\"edges\", edgeIndex] });\n outgoing.set(edge.source, edges);\n }\n }\n\n for (const [nodeIndex, node] of flow.nodes.entries()) {\n if (node.run.kind !== \"router\") continue;\n for (const [routeIndex, route] of node.run.routes.entries()) {\n if (route.target !== null && !nodeIds.has(route.target)) {\n context.addIssue({\n code: \"custom\",\n path: [\"nodes\", nodeIndex, \"run\", \"routes\", routeIndex, \"target\"],\n message: `unknown node: ${route.target}`,\n });\n }\n }\n }\n\n const validateExpression = (\n expression: string,\n path: PropertyKey[],\n requireBoolean = true,\n ): void => {\n let references: FlowExpressionReference[];\n try {\n references = inspectFlowExpression(expression, requireBoolean);\n } catch (error) {\n context.addIssue({\n code: \"custom\",\n path,\n message: error instanceof Error ? error.message : \"invalid Flow expression\",\n });\n return;\n }\n for (const reference of references) {\n const segments = reference.path.split(\".\");\n if (segments[0] !== \"nodes\") continue;\n const producer = flow.nodes.find((node) => node.id === segments[1]);\n if (!producer) {\n context.addIssue({\n code: \"custom\",\n path,\n message: `unknown producer node: ${segments[1]}`,\n });\n continue;\n }\n if (segments[2] === \"status\") {\n if (reference.booleanOperand) {\n context.addIssue({ code: \"custom\", path, message: \"node status is not boolean\" });\n }\n continue;\n }\n const outputSchema = producer.contract?.output?.fields;\n if (!outputSchema) {\n context.addIssue({\n code: \"custom\",\n path,\n message: `node ${producer.id} has no declared output fields`,\n });\n continue;\n }\n const fieldPath = segments.slice(4);\n const fieldSchema = declaredFieldSchema(outputSchema, fieldPath);\n if (fieldSchema === MISSING_FIELD) {\n context.addIssue({\n code: \"custom\",\n path,\n message: `node ${producer.id} does not declare output field ${fieldPath.join(\".\")}`,\n });\n continue;\n }\n const nonBooleanType = reference.booleanOperand\n ? knownNonBooleanType(fieldSchema)\n : undefined;\n if (nonBooleanType) {\n context.addIssue({\n code: \"custom\",\n path,\n message: `node ${producer.id} output field ${fieldPath.join(\".\")} is ${nonBooleanType}, not boolean`,\n });\n }\n }\n };\n\n for (const [nodeIndex, node] of flow.nodes.entries()) {\n for (const [requireIndex, requirement] of node.contract?.requires?.entries() ?? []) {\n validateExpression(requirement.expr, [\n \"nodes\",\n nodeIndex,\n \"contract\",\n \"requires\",\n requireIndex,\n \"expr\",\n ]);\n }\n for (const [bindingName, binding] of Object.entries(node.contract?.input ?? {})) {\n for (const expression of collectFlowBindingExpressions(binding)) {\n validateExpression(\n expression,\n [\"nodes\", nodeIndex, \"contract\", \"input\", bindingName],\n false,\n );\n }\n }\n if (node.run.kind === \"router\") {\n for (const [routeIndex, route] of node.run.routes.entries()) {\n validateExpression(route.when, [\"nodes\", nodeIndex, \"run\", \"routes\", routeIndex, \"when\"]);\n }\n }\n }\n\n validateClassifierRules(flow, context);\n validateConsumedOutputSchemasCompile(flow, context);\n\n const state = new Map<string, \"active\" | \"done\">();\n for (const nodeId of nodeIds) {\n if (state.has(nodeId)) continue;\n const stack: Array<{ nodeId: string; next: number }> = [{ nodeId, next: 0 }];\n state.set(nodeId, \"active\");\n while (stack.length > 0) {\n const frame = stack.at(-1);\n if (!frame) break;\n const arcs = outgoing.get(frame.nodeId) ?? [];\n if (frame.next >= arcs.length) {\n state.set(frame.nodeId, \"done\");\n stack.pop();\n continue;\n }\n const arc = arcs[frame.next++];\n if (state.get(arc.target) === \"active\") {\n context.addIssue({ code: \"custom\", path: arc.path, message: \"flow graph must be acyclic\" });\n } else if (!state.has(arc.target)) {\n state.set(arc.target, \"active\");\n stack.push({ nodeId: arc.target, next: 0 });\n }\n }\n }\n});\n\n/**\n * A fields schema another node reads is compiled at run time, the first time its\n * producer completes; one zod cannot compile fails that node then. Only consumed\n * schemas are compiled here: an unread one is prose for the model and never compiled.\n */\nfunction validateConsumedOutputSchemasCompile(\n flow: z.infer<typeof FlowDefinitionObjectSchema>,\n context: z.RefinementCtx,\n): void {\n for (const [nodeIndex, node] of flow.nodes.entries()) {\n const fields = node.contract?.output?.fields;\n if (!fields) continue;\n let compileError: unknown;\n try {\n compileOutputFieldsSchema(fields);\n continue;\n } catch (error) {\n compileError = error;\n }\n let consumed: boolean;\n try {\n consumed = getConsumedOutputSchema(flow, node.id) !== undefined;\n } catch {\n // A consumer expression that does not parse is already reported on its own path.\n continue;\n }\n if (!consumed) continue;\n context.addIssue({\n code: \"custom\",\n path: [\"nodes\", nodeIndex, \"contract\", \"output\", \"fields\"],\n message: `node ${node.id} contract.output.fields: ${invalidOutputFieldsSchemaMessage(compileError)}`,\n });\n }\n}\n\nconst ORDERING_OPERATORS = new Set([\"<\", \"<=\", \">\", \">=\"]);\n\n/**\n * The classifier rules (classifier spec D3/D5). They key only on declared\n * top-level output property names and on `nodes.<id>.output.fields.<reserved>`\n * reads of a subprompt that declares them — never on other paths, globals, node\n * ids or prose — so flows that merely mention \"confidence\" are untouched.\n */\nfunction validateClassifierRules(\n flow: z.infer<typeof FlowDefinitionObjectSchema>,\n context: z.RefinementCtx,\n): void {\n const classifierIds = new Set<string>();\n for (const [nodeIndex, node] of flow.nodes.entries()) {\n const outputSchema = node.contract?.output?.fields;\n const path = [\"nodes\", nodeIndex, \"contract\", \"output\", \"fields\"];\n if (node.run.kind === \"subprompt\") {\n const check = checkClassifierShape(outputSchema);\n if (!check.classifier) continue;\n classifierIds.add(node.id);\n if (\"issues\" in check) {\n context.addIssue({\n code: \"custom\",\n path,\n message: `subprompt ${node.id} declares a reserved classifier field but is not classifier-shaped: ${check.issues.join(\"; \")}`,\n });\n }\n continue;\n }\n // A model that fills these itself would make up a plausible confidence; only\n // the runtime writes them, and only on a classifier-shaped subprompt. A\n // sub-flow's output can come from a child agent, so it is refused too.\n if (\n (node.run.kind === \"agent\" || node.run.kind === \"sub-flow\") &&\n declaresReservedClassifierField(outputSchema)\n ) {\n const names = RESERVED_CLASSIFIER_FIELDS.filter((name) =>\n declaredOutputProperties(outputSchema).includes(name),\n );\n context.addIssue({\n code: \"custom\",\n path,\n message: `${names.join(\" and \")} ${names.length > 1 ? \"are\" : \"is\"} reserved for classifier-shaped subprompt nodes; ${node.run.kind} node ${node.id} cannot declare ${names.length > 1 ? \"them\" : \"it\"}`,\n });\n }\n }\n if (classifierIds.size === 0) return;\n\n const reservedRead = (path: string): { producer: string; field: string } | undefined => {\n const segments = path.split(\".\");\n if (\n segments.length !== 5 ||\n segments[0] !== \"nodes\" ||\n segments[2] !== \"output\" ||\n segments[3] !== \"fields\" ||\n !classifierIds.has(segments[1]) ||\n !(RESERVED_CLASSIFIER_FIELDS as readonly string[]).includes(segments[4])\n ) {\n return undefined;\n }\n return { producer: segments[1], field: segments[4] };\n };\n const readsReserved = (expression: string): boolean => {\n try {\n return inspectFlowExpression(expression, false).some(({ path }) => reservedRead(path));\n } catch {\n return false; // the syntax error is already reported by validateExpression\n }\n };\n const checkGuards = (expression: string, path: PropertyKey[]): void => {\n let comparisons: ReturnType<typeof inspectFlowExpressionComparisons>;\n try {\n comparisons = inspectFlowExpressionComparisons(expression);\n } catch {\n return;\n }\n for (const comparison of comparisons) {\n if (!ORDERING_OPERATORS.has(comparison.operator)) continue;\n for (const operand of [comparison.left, comparison.right]) {\n if (!(\"path\" in operand)) continue;\n const read = reservedRead(operand.path);\n if (read?.field !== \"confidence\") continue;\n const guard = `nodes.${read.producer}.output.fields.calibrated`;\n if (comparison.guards.includes(guard)) continue;\n context.addIssue({\n code: \"custom\",\n path,\n message: `${operand.path} is null when the classifier is uncalibrated, so an ordering comparison on it must be guarded: put the literal conjunct \\`${guard} == true\\` earlier in the same && chain, optionally parenthesized (\\`true == …\\`, \\`!= false\\` and a guard inside \\`||\\` are not accepted)`,\n });\n }\n }\n };\n\n for (const [nodeIndex, node] of flow.nodes.entries()) {\n for (const [requireIndex, requirement] of node.contract?.requires?.entries() ?? []) {\n if (!readsReserved(requirement.expr)) continue;\n // A requires guard has no fallthrough: false on the vendor-down path would\n // leave the node with no defined landing.\n context.addIssue({\n code: \"custom\",\n path: [\"nodes\", nodeIndex, \"contract\", \"requires\", requireIndex, \"expr\"],\n message:\n \"a contract.requires guard cannot read a classifier's confidence or calibrated; decide on a classifier's answer at a router, which has a default route\",\n });\n }\n for (const [bindingName, binding] of Object.entries(node.contract?.input ?? {})) {\n for (const expression of collectFlowBindingExpressions(binding)) {\n checkGuards(expression, [\"nodes\", nodeIndex, \"contract\", \"input\", bindingName]);\n }\n }\n if (node.run.kind !== \"router\") continue;\n const routes = node.run.routes;\n for (const [routeIndex, route] of routes.entries()) {\n checkGuards(route.when, [\"nodes\", nodeIndex, \"run\", \"routes\", routeIndex, \"when\"]);\n }\n const readsAny = routes.some((route) => readsReserved(route.when));\n if (readsAny && routes.at(-1)?.when.trim() !== \"default\") {\n context.addIssue({\n code: \"custom\",\n path: [\"nodes\", nodeIndex, \"run\", \"routes\"],\n message: `router ${node.id} reads a classifier's confidence or calibrated, so its last route must be the unconditional \"default\": on the uncalibrated fallback every guarded route is false, and without a default the router would settle nowhere`,\n });\n }\n }\n}\n\n/** Validated authoring content that is strict, acyclic, and always schema version 2. */\nexport type FlowDefinition = z.infer<typeof FlowDefinitionSchema>;\n\n/** Graph vertex whose execution identity comes only from its `run.kind`. */\nexport type FlowNode = FlowDefinition[\"nodes\"][number];\n\n/** Directed dependency link whose authored array position remains content-significant. */\nexport type FlowEdge = FlowDefinition[\"edges\"][number];\n\n/** Closed execution-owner declaration with no dispatch or conversation-mode switches. */\nexport type FlowNodeRun = FlowNode[\"run\"];\n\n/** Closed vocabulary of the seven supported execution-owner identities. */\nexport type FlowNodeKind = FlowNodeRun[\"kind\"];\n\n/** Validation boundary applied to values entering a Flow run. */\nexport type FlowInputContract = NonNullable<FlowDefinition[\"input\"]>;\n\n/** Validation boundary applied to values leaving a Flow run. */\nexport type FlowOutputContract = NonNullable<FlowDefinition[\"output\"]>;\n\n/** Node admission and data contract; output typing is paid only when downstream consumers need it. */\nexport type FlowNodeContract = NonNullable<FlowNode[\"contract\"]>;\n\n/** Availability and failure policy that never changes execution ownership. */\nexport type FlowNodeControl = NonNullable<FlowNode[\"control\"]>;\n\n/** Named values resolved at the consumer boundary before admission. */\nexport type FlowNodeBindings = NonNullable<FlowNode[\"contract\"]>[\"input\"];\n\n/** Bounded deterministic admission condition; arbitrary calls and property access are invalid. */\nexport type FlowNodePrecondition = NonNullable<FlowNode[\"contract\"]>[\"requires\"] extends\n | Array<infer T>\n | undefined\n ? T\n : never;\n\n/** Ordered router branch; the first matching condition owns the routing decision. */\nexport type FlowRoute = Extract<FlowNodeRun, { kind: \"router\" }>[\"routes\"][number];\n\n/** Asset requirement independent of node identity and available on every run kind. */\nexport type FlowAssetRef = NonNullable<FlowNodeRun[\"assets\"]>[number];\n\n/** Model tier for `agent` and `subprompt` runs; `default` inherits the session model\n * (`agent`) or the runtime default (`subprompt`) rather than naming a concrete model. */\nexport type FlowModelTier = z.infer<typeof modelTier>;\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { flowList, flowShow, flowListSessions, flowGetSession, flowFindFlowForSession } from './chunk-
|
|
1
|
+
import { flowList, flowShow, flowListSessions, flowGetSession, flowFindFlowForSession } from './chunk-UQ3JFN4N.js';
|
|
2
2
|
import { skillList, skillListDomains, skillShow, skillSearch, skillCheckRequirements, skillGetPreamble } from './chunk-P2DLXBZK.js';
|
|
3
3
|
import { workspaceValidate, workspaceInfo, workspaceTestSecret, workspaceReload } from './chunk-4ZTPYIBE.js';
|
|
4
4
|
import { mountList, mountSync, mountStatus, mountRead, connectorList, connectorRead, connectorWrite, connectorSearch, connectorExec, connectorLoadSkill, connectorDescribe } from './chunk-35G4M33T.js';
|
|
@@ -251,5 +251,5 @@ async function runMcpServerStdio(plugin) {
|
|
|
251
251
|
}
|
|
252
252
|
|
|
253
253
|
export { buildWorkspaceMcpServer, buildWorkspaceMcpStdioServer, buildWorkspaceToolDefs, runMcpServerStdio };
|
|
254
|
-
//# sourceMappingURL=chunk-
|
|
255
|
-
//# sourceMappingURL=chunk-
|
|
254
|
+
//# sourceMappingURL=chunk-PJY4J37J.js.map
|
|
255
|
+
//# sourceMappingURL=chunk-PJY4J37J.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../workspace-plugin/src/adapters/mcp.ts"],"names":["z"],"mappings":";;;;;;;;AA4CA,IAAM,OAAA,GAA4B,SAAkB,GAAA,CAAA,OAAA,IAAW,GAAA;AAiCxD,SAAS,uBAAuB,MAAA,EAA6C;AAClF,EAAA,MAAMA,EAAAA,GAAS,OAAA;AAEf,EAAA,MAAM,MAAA,GAAS,OAAO,MAAA,IAAU,KAAA;AAChC,EAAA,MAAM,IAAI,MAAA,CAAO,UAAA;AAEjB,EAAA,OAAO;AAAA;AAAA,IAEL;AAAA,MACE,IAAA,EAAM,YAAA;AAAA,MACN,WAAA,EAAa,kEAAA;AAAA,MACb,aAAa,EAAC;AAAA,MACd,OAAA,EAAS,YAAY,SAAA,CAAU,MAAA,CAAO,gBAAgB;AAAA,KACxD;AAAA,IACA;AAAA,MACE,IAAA,EAAM,YAAA;AAAA,MACN,WAAA,EAAa,gEAAA;AAAA,MACb,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,MAAA,CAAO,YAAA;AAAA,MACL,GAAA,CAAI,IAAA;AAAA,MACJ,EAAE,WAAA,EAAa,GAAA,CAAI,WAAA,EAAa,WAAA,EAAa,IAAI,WAAA,EAAY;AAAA,MAC7D,GAAA,CAAI;AAAA,KACN;AAAA,EACF;AACA,EAAA,OAAO,MAAA;AACT;AAaA,eAAsB,kBAAkB,MAAA,EAAwC;AAC9E,EAAA,MAAM,MAAA,GAAS,MAAM,4BAAA,CAA6B,MAAM,CAAA;AACxD,EAAA,MAAM,EAAE,oBAAA,EAAqB,GAAI,MAAM,OACrC,2CACF,CAAA;AACA,EAAA,MAAM,MAAA,CAAO,OAAA,CAAQ,IAAI,oBAAA,EAAsB,CAAA;AACjD","file":"chunk-I4C4AHZB.js","sourcesContent":["// Static namespace import so bun --compile bundles zod into the binary.\n// Dynamic import(\"zod\") via a string variable evades bun's static analysis\n// and fails at runtime inside /$bunfs/. The unwrap (zNS.z ?? zNS.default\n// ?? zNS) handles both bun's native ESM and vitest's CJS-interop resolver,\n// which return the zod namespace at different keys.\nimport * as zNS from \"zod\";\nimport { withActivityLabelDefs } from \"@skaile/workspaces/types\";\nimport type { WorkspacePlugin } from \"../plugin.js\";\nimport {\n connectorDescribe,\n connectorExec,\n connectorList,\n connectorLoadSkill,\n connectorRead,\n connectorSearch,\n connectorWrite,\n mountList,\n mountRead,\n mountStatus,\n mountSync,\n} from \"../tools/connectors.js\";\nimport {\n flowFindFlowForSession,\n flowGetSession,\n flowList,\n flowListSessions,\n flowShow,\n} from \"../tools/flows.js\";\nimport { sessionGet, sessionList } from \"../tools/sessions.js\";\nimport {\n skillCheckRequirements,\n skillGetPreamble,\n skillList,\n skillListDomains,\n skillSearch,\n skillShow,\n} from \"../tools/skills.js\";\nimport {\n workspaceInfo,\n workspaceReload,\n workspaceTestSecret,\n workspaceValidate,\n} from \"../tools/validator.js\";\n\nconst zStatic: any = (zNS as any).z ?? (zNS as any).default ?? zNS;\n\n/**\n * One workspace plugin tool — name, description, a zod raw-shape input schema,\n * and an async handler returning a `ToolResult`.\n *\n * Carries **zero MCP/SDK dependency**: the same definitions feed both the\n * in-process Claude Agent SDK server ({@link buildWorkspaceMcpServer}) and the\n * raw stdio MCP server ({@link buildWorkspaceMcpStdioServer}).\n */\nexport interface WorkspaceToolDef {\n name: string;\n description: string;\n inputSchema: Record<string, unknown>;\n handler: (args: any) => Promise<unknown>;\n}\n\n/**\n * Build the 28 workspace plugin tool definitions.\n *\n * Tool groups:\n * - 4 mount tools (`mount_list`, `mount_sync`, `mount_status`, `mount_read`)\n * - 5 flow tools (`flow_list`, `flow_show`, `flow_list_sessions`, `flow_get_session`, `flow_find_flow_for_session`)\n * - 6 skill tools (`skill_list`, `skill_list_domains`, `skill_show`, `skill_search`, `skill_check_requirements`, `skill_get_preamble`)\n * - 2 session tools (`session_list`, `session_get`)\n * - 7 connector tools (`connector_list`, `connector_read`, `connector_write`, `connector_search`, `connector_exec`, `connector_load_skill`, `connector_describe`)\n * - 4 workspace tools (`workspace_validate`, `workspace_info`, `workspace_test_secret`, `workspace_reload`)\n *\n * @param plugin - A booted `WorkspacePlugin` instance.\n * @returns The 28 tool definitions, free of any MCP/SDK coupling.\n *\n * @docLink packages/workspace-plugin/concepts#adapters\n */\nexport function buildWorkspaceToolDefs(plugin: WorkspacePlugin): WorkspaceToolDef[] {\n const z: any = zStatic;\n\n const driver = plugin.driver ?? \"omp\";\n const p = plugin.projectDir;\n\n return [\n // Mount tools\n {\n name: \"mount_list\",\n description: \"List all mounts declared in skaile.yaml with their mount status.\",\n inputSchema: {},\n handler: async () => mountList(plugin.connectorManager),\n },\n {\n name: \"mount_sync\",\n description: \"Sync a mount — pull latest from remote (git, S3, WebDAV).\",\n inputSchema: { mount_id: z.string().describe(\"Mount ID from mount_list\") },\n handler: async ({ mount_id }: { mount_id: string }) =>\n mountSync(plugin.connectorManager, mount_id),\n },\n {\n name: \"mount_status\",\n description: \"Get the mount status and last sync time for a mount.\",\n inputSchema: { mount_id: z.string() },\n handler: async ({ mount_id }: { mount_id: string }) =>\n mountStatus(plugin.connectorManager, mount_id),\n },\n {\n name: \"mount_read\",\n description: \"Read a file from a mounted mount by path.\",\n inputSchema: {\n mount_id: z.string(),\n path: z.string().describe(\"Relative path within the mount\"),\n },\n handler: async ({ mount_id, path }: { mount_id: string; path: string }) =>\n mountRead(plugin.connectorManager, mount_id, path),\n },\n // Flow tools\n {\n name: \"flow_list\",\n description: \"List all available flow definitions from ai-assets.\",\n inputSchema: {},\n handler: async () => flowList(p),\n },\n {\n name: \"flow_show\",\n description: \"Show full flow definition (nodes + edges) for a flow ID.\",\n inputSchema: { flow_id: z.string().describe(\"Flow ID from flow_list\") },\n handler: async ({ flow_id }: { flow_id: string }) => flowShow(p, flow_id),\n },\n {\n name: \"flow_list_sessions\",\n description: \"List past and active flow run sessions for this workspace.\",\n inputSchema: {},\n handler: async () => flowListSessions(p),\n },\n {\n name: \"flow_get_session\",\n description: \"Get driver metadata for a specific flow run session.\",\n inputSchema: { run_id: z.string().describe(\"Run ID from flow_list_sessions\") },\n handler: async ({ run_id }: { run_id: string }) => flowGetSession(p, run_id),\n },\n {\n name: \"flow_find_flow_for_session\",\n description: \"Resolve and return the flow definition used in a past session.\",\n inputSchema: { run_id: z.string() },\n handler: async ({ run_id }: { run_id: string }) => flowFindFlowForSession(p, run_id),\n },\n // Skill tools\n {\n name: \"skill_list\",\n description: \"List all skills in the ai-assets catalog, optionally filtered by domain.\",\n inputSchema: { domain: z.string().optional().describe(\"Domain name filter\") },\n handler: async ({ domain }: { domain?: string }) => skillList(p, domain),\n },\n {\n name: \"skill_list_domains\",\n description: \"List all skill domains (top-level ai-assets directories with skills).\",\n inputSchema: {},\n handler: async () => skillListDomains(p),\n },\n {\n name: \"skill_show\",\n description: \"Show the full SKILL.md content for a skill ID.\",\n inputSchema: { skill_id: z.string().describe(\"Skill ID from skill_list\") },\n handler: async ({ skill_id }: { skill_id: string }) => skillShow(p, skill_id),\n },\n {\n name: \"skill_search\",\n description: \"Search skills by name, description, or keywords.\",\n inputSchema: { query: z.string() },\n handler: async ({ query }: { query: string }) => skillSearch(p, query),\n },\n {\n name: \"skill_check_requirements\",\n description: \"Validate that all skill prerequisites are met in the target directory.\",\n inputSchema: {\n skill_id: z.string(),\n target_dir: z\n .string()\n .optional()\n .describe(\"Directory to check against (default: projectDir)\"),\n },\n handler: async ({ skill_id, target_dir }: { skill_id: string; target_dir?: string }) =>\n skillCheckRequirements(p, skill_id, target_dir ?? p),\n },\n {\n name: \"skill_get_preamble\",\n description: \"Get the REQUIRES/INPUT/READS/WRITES DSL preamble for a skill.\",\n inputSchema: { skill_id: z.string() },\n handler: async ({ skill_id }: { skill_id: string }) => skillGetPreamble(p, skill_id),\n },\n // Session tools\n {\n name: \"session_list\",\n description: \"List all past agent run sessions for this workspace, sorted newest first.\",\n inputSchema: {},\n handler: async () => sessionList(p),\n },\n {\n name: \"session_get\",\n description: \"Get full metadata for a specific session by run ID.\",\n inputSchema: { run_id: z.string() },\n handler: async ({ run_id }: { run_id: string }) => sessionGet(p, run_id),\n },\n // Connector tools\n {\n name: \"connector_list\",\n description:\n \"List connectors declared in skaile.yaml as {connected, failed}. `failed` holds connectors that did not connect this session, with the failure reason — their mount paths are dead directories, not synced workspaces.\",\n inputSchema: {},\n handler: async () => connectorList(plugin.connectorManager),\n },\n {\n name: \"connector_read\",\n description: \"Read content from a connector by path.\",\n inputSchema: {\n connector_id: z.string().describe(\"Connector ID from connector_list\"),\n path: z.string().describe(\"Path within the connector\"),\n },\n handler: async ({ connector_id, path }: { connector_id: string; path: string }) =>\n connectorRead(plugin.connectorManager, connector_id, path),\n },\n {\n name: \"connector_write\",\n description: \"Write content to a connector by path.\",\n inputSchema: {\n connector_id: z.string(),\n path: z.string(),\n content: z.string().describe(\"Content to write\"),\n },\n handler: async ({\n connector_id,\n path,\n content,\n }: {\n connector_id: string;\n path: string;\n content: string;\n }) => connectorWrite(plugin.connectorManager, connector_id, path, content),\n },\n {\n name: \"connector_search\",\n description: \"Search within a connector by query string.\",\n inputSchema: {\n connector_id: z.string(),\n query: z.string().describe(\"Search query\"),\n },\n handler: async ({ connector_id, query }: { connector_id: string; query: string }) =>\n connectorSearch(plugin.connectorManager, connector_id, query),\n },\n {\n name: \"connector_exec\",\n description: \"Execute a custom operation on a connector.\",\n inputSchema: {\n connector_id: z.string(),\n operation: z.string().describe(\"Operation name from connector_describe\"),\n args: z.record(z.string(), z.unknown()).describe(\"Operation arguments\"),\n },\n handler: async ({\n connector_id,\n operation,\n args,\n }: {\n connector_id: string;\n operation: string;\n args: Record<string, unknown>;\n }) => connectorExec(plugin.connectorManager, connector_id, operation, args),\n },\n {\n name: \"connector_load_skill\",\n description: \"Load the rendered skill body for a connector (operations + usage).\",\n inputSchema: {\n connector_id: z.string(),\n },\n handler: async ({ connector_id }: { connector_id: string }) =>\n connectorLoadSkill(plugin.connectorManager, connector_id),\n },\n {\n name: \"connector_describe\",\n description: \"Describe a connector's capabilities via its RuntimeSkillDescriptor.\",\n inputSchema: {\n connector_id: z.string(),\n },\n handler: async ({ connector_id }: { connector_id: string }) =>\n connectorDescribe(plugin.connectorManager, connector_id),\n },\n // Validator tools\n {\n name: \"workspace_validate\",\n description: \"Run a full health check: connectors, mounts, secrets, driver binary.\",\n inputSchema: {},\n handler: async () => workspaceValidate(plugin, driver),\n },\n {\n name: \"workspace_info\",\n description: \"Show workspace configuration: driver, model, provider, resource counts.\",\n inputSchema: {},\n handler: async () => workspaceInfo(plugin, driver, plugin.model),\n },\n {\n name: \"workspace_test_secret\",\n description: \"Test resolution of one secret reference (env:VAR, forge:key).\",\n inputSchema: { ref: z.string().describe(\"Secret ref e.g. env:ANTHROPIC_API_KEY\") },\n handler: async ({ ref }: { ref: string }) => workspaceTestSecret(ref),\n },\n {\n name: \"workspace_reload\",\n description: \"Re-read skaile.yaml and re-sync the plugin state.\",\n inputSchema: {},\n handler: async () => workspaceReload(plugin),\n },\n ];\n}\n\n/**\n * Build the **in-process** workspace MCP server via the Claude Agent SDK's\n * `createSdkMcpServer`. This shape is what the runner embeds into a Claude\n * Agent SDK `query()` call — the runner *is* the Claude Agent SDK host.\n *\n * Returns `null` when `@anthropic-ai/claude-agent-sdk` is not installed\n * (graceful degradation for non-Claude-Code environments).\n *\n * For the standalone `skaile mcp-server` stdio subprocess use\n * {@link buildWorkspaceMcpStdioServer} / {@link runMcpServerStdio} instead —\n * those carry no Claude Agent SDK dependency.\n *\n * @param plugin - A booted `WorkspacePlugin` instance.\n * @returns The SDK MCP server object or `null` if the SDK is unavailable.\n *\n * @docLink packages/workspace-plugin/concepts#adapters\n */\nexport async function buildWorkspaceMcpServer(plugin: WorkspacePlugin): Promise<unknown | null> {\n let sdk: any;\n try {\n sdk = await import(\"@anthropic-ai/claude-agent-sdk\");\n } catch {\n return null;\n }\n return sdk.createSdkMcpServer({\n name: \"skaile-workspace\",\n tools: withActivityLabelDefs(buildWorkspaceToolDefs(plugin), zStatic),\n });\n}\n\n/**\n * Build a **raw stdio** workspace MCP server on `@modelcontextprotocol/sdk` —\n * no Claude Agent SDK. This is the correct shape for the `skaile mcp-server`\n * stdio subprocess that MCP-client agents (Claude Code, Codex, …) spawn.\n * Runs on plain Node.\n *\n * The returned server is not yet connected — call `.connect(transport)` (or\n * use {@link runMcpServerStdio}).\n *\n * @param plugin - A booted `WorkspacePlugin` instance.\n * @returns A `McpServer` with all 28 workspace tools registered.\n *\n * @docLink packages/workspace-plugin/concepts#adapters\n */\nexport async function buildWorkspaceMcpStdioServer(plugin: WorkspacePlugin): Promise<any> {\n const { McpServer } = await import(\"@modelcontextprotocol/sdk/server/mcp.js\" as string);\n const server = new McpServer({ name: \"skaile-workspace\", version: \"1.0.0\" });\n for (const def of buildWorkspaceToolDefs(plugin)) {\n server.registerTool(\n def.name,\n { description: def.description, inputSchema: def.inputSchema },\n def.handler,\n );\n }\n return server;\n}\n\n/**\n * Start the workspace MCP server over stdio transport.\n *\n * Builds the raw `@modelcontextprotocol/sdk` server via\n * {@link buildWorkspaceMcpStdioServer} and connects a `StdioServerTransport`.\n * No `@anthropic-ai/claude-agent-sdk` dependency anywhere on this path.\n *\n * @param plugin - A booted `WorkspacePlugin` instance.\n *\n * @docLink packages/workspace-plugin/concepts#adapters\n */\nexport async function runMcpServerStdio(plugin: WorkspacePlugin): Promise<void> {\n const server = await buildWorkspaceMcpStdioServer(plugin);\n const { StdioServerTransport } = await import(\n \"@modelcontextprotocol/sdk/server/stdio.js\" as string\n );\n await server.connect(new StdioServerTransport());\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../workspace-plugin/src/adapters/mcp.ts"],"names":["z"],"mappings":";;;;;;;;AA4CA,IAAM,OAAA,GAA4B,SAAkB,GAAA,CAAA,OAAA,IAAW,GAAA;AAiCxD,SAAS,uBAAuB,MAAA,EAA6C;AAClF,EAAA,MAAMA,EAAAA,GAAS,OAAA;AAEf,EAAA,MAAM,MAAA,GAAS,OAAO,MAAA,IAAU,KAAA;AAChC,EAAA,MAAM,IAAI,MAAA,CAAO,UAAA;AAEjB,EAAA,OAAO;AAAA;AAAA,IAEL;AAAA,MACE,IAAA,EAAM,YAAA;AAAA,MACN,WAAA,EAAa,kEAAA;AAAA,MACb,aAAa,EAAC;AAAA,MACd,OAAA,EAAS,YAAY,SAAA,CAAU,MAAA,CAAO,gBAAgB;AAAA,KACxD;AAAA,IACA;AAAA,MACE,IAAA,EAAM,YAAA;AAAA,MACN,WAAA,EAAa,gEAAA;AAAA,MACb,WAAA,EAAa,EAAE,QAAA,EAAUA,EAAAA,CAAE,QAAO,CAAE,QAAA,CAAS,0BAA0B,CAAA,EAAE;AAAA,MACzE,OAAA,EAAS,OAAO,EAAE,QAAA,OAChB,SAAA,CAAU,MAAA,CAAO,kBAAkB,QAAQ;AAAA,KAC/C;AAAA,IACA;AAAA,MACE,IAAA,EAAM,cAAA;AAAA,MACN,WAAA,EAAa,sDAAA;AAAA,MACb,WAAA,EAAa,EAAE,QAAA,EAAUA,EAAAA,CAAE,QAAO,EAAE;AAAA,M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A,EAAqB,GAAI,MAAM,OACrC,2CACF,CAAA;AACA,EAAA,MAAM,MAAA,CAAO,OAAA,CAAQ,IAAI,oBAAA,EAAsB,CAAA;AACjD","file":"chunk-PJY4J37J.js","sourcesContent":["// Static namespace import so bun --compile bundles zod into the binary.\n// Dynamic import(\"zod\") via a string variable evades bun's static analysis\n// and fails at runtime inside /$bunfs/. The unwrap (zNS.z ?? zNS.default\n// ?? zNS) handles both bun's native ESM and vitest's CJS-interop resolver,\n// which return the zod namespace at different keys.\nimport * as zNS from \"zod\";\nimport { withActivityLabelDefs } from \"@skaile/workspaces/types\";\nimport type { WorkspacePlugin } from \"../plugin.js\";\nimport {\n connectorDescribe,\n connectorExec,\n connectorList,\n connectorLoadSkill,\n connectorRead,\n connectorSearch,\n connectorWrite,\n mountList,\n mountRead,\n mountStatus,\n mountSync,\n} from \"../tools/connectors.js\";\nimport {\n flowFindFlowForSession,\n flowGetSession,\n flowList,\n flowListSessions,\n flowShow,\n} from \"../tools/flows.js\";\nimport { sessionGet, sessionList } from \"../tools/sessions.js\";\nimport {\n skillCheckRequirements,\n skillGetPreamble,\n skillList,\n skillListDomains,\n skillSearch,\n skillShow,\n} from \"../tools/skills.js\";\nimport {\n workspaceInfo,\n workspaceReload,\n workspaceTestSecret,\n workspaceValidate,\n} from \"../tools/validator.js\";\n\nconst zStatic: any = (zNS as any).z ?? (zNS as any).default ?? zNS;\n\n/**\n * One workspace plugin tool — name, description, a zod raw-shape input schema,\n * and an async handler returning a `ToolResult`.\n *\n * Carries **zero MCP/SDK dependency**: the same definitions feed both the\n * in-process Claude Agent SDK server ({@link buildWorkspaceMcpServer}) and the\n * raw stdio MCP server ({@link buildWorkspaceMcpStdioServer}).\n */\nexport interface WorkspaceToolDef {\n name: string;\n description: string;\n inputSchema: Record<string, unknown>;\n handler: (args: any) => Promise<unknown>;\n}\n\n/**\n * Build the 28 workspace plugin tool definitions.\n *\n * Tool groups:\n * - 4 mount tools (`mount_list`, `mount_sync`, `mount_status`, `mount_read`)\n * - 5 flow tools (`flow_list`, `flow_show`, `flow_list_sessions`, `flow_get_session`, `flow_find_flow_for_session`)\n * - 6 skill tools (`skill_list`, `skill_list_domains`, `skill_show`, `skill_search`, `skill_check_requirements`, `skill_get_preamble`)\n * - 2 session tools (`session_list`, `session_get`)\n * - 7 connector tools (`connector_list`, `connector_read`, `connector_write`, `connector_search`, `connector_exec`, `connector_load_skill`, `connector_describe`)\n * - 4 workspace tools (`workspace_validate`, `workspace_info`, `workspace_test_secret`, `workspace_reload`)\n *\n * @param plugin - A booted `WorkspacePlugin` instance.\n * @returns The 28 tool definitions, free of any MCP/SDK coupling.\n *\n * @docLink packages/workspace-plugin/concepts#adapters\n */\nexport function buildWorkspaceToolDefs(plugin: WorkspacePlugin): WorkspaceToolDef[] {\n const z: any = zStatic;\n\n const driver = plugin.driver ?? \"omp\";\n const p = plugin.projectDir;\n\n return [\n // Mount tools\n {\n name: \"mount_list\",\n description: \"List all mounts declared in skaile.yaml with their mount status.\",\n inputSchema: {},\n handler: async () => mountList(plugin.connectorManager),\n },\n {\n name: \"mount_sync\",\n description: \"Sync a mount — pull latest from remote (git, S3, WebDAV).\",\n inputSchema: { mount_id: z.string().describe(\"Mount ID from mount_list\") },\n handler: async ({ mount_id }: { mount_id: string }) =>\n mountSync(plugin.connectorManager, mount_id),\n },\n {\n name: \"mount_status\",\n description: \"Get the mount status and last sync time for a mount.\",\n inputSchema: { mount_id: z.string() },\n handler: async ({ mount_id }: { mount_id: string }) =>\n mountStatus(plugin.connectorManager, mount_id),\n },\n {\n name: \"mount_read\",\n description: \"Read a file from a mounted mount by path.\",\n inputSchema: {\n mount_id: z.string(),\n path: z.string().describe(\"Relative path within the mount\"),\n },\n handler: async ({ mount_id, path }: { mount_id: string; path: string }) =>\n mountRead(plugin.connectorManager, mount_id, path),\n },\n // Flow tools\n {\n name: \"flow_list\",\n description: \"List all available flow definitions from ai-assets.\",\n inputSchema: {},\n handler: async () => flowList(p),\n },\n {\n name: \"flow_show\",\n description: \"Show full flow definition (nodes + edges) for a flow ID.\",\n inputSchema: { flow_id: z.string().describe(\"Flow ID from flow_list\") },\n handler: async ({ flow_id }: { flow_id: string }) => flowShow(p, flow_id),\n },\n {\n name: \"flow_list_sessions\",\n description: \"List past and active flow run sessions for this workspace.\",\n inputSchema: {},\n handler: async () => flowListSessions(p),\n },\n {\n name: \"flow_get_session\",\n description: \"Get driver metadata for a specific flow run session.\",\n inputSchema: { run_id: z.string().describe(\"Run ID from flow_list_sessions\") },\n handler: async ({ run_id }: { run_id: string }) => flowGetSession(p, run_id),\n },\n {\n name: \"flow_find_flow_for_session\",\n description: \"Resolve and return the flow definition used in a past session.\",\n inputSchema: { run_id: z.string() },\n handler: async ({ run_id }: { run_id: string }) => flowFindFlowForSession(p, run_id),\n },\n // Skill tools\n {\n name: \"skill_list\",\n description: \"List all skills in the ai-assets catalog, optionally filtered by domain.\",\n inputSchema: { domain: z.string().optional().describe(\"Domain name filter\") },\n handler: async ({ domain }: { domain?: string }) => skillList(p, domain),\n },\n {\n name: \"skill_list_domains\",\n description: \"List all skill domains (top-level ai-assets directories with skills).\",\n inputSchema: {},\n handler: async () => skillListDomains(p),\n },\n {\n name: \"skill_show\",\n description: \"Show the full SKILL.md content for a skill ID.\",\n inputSchema: { skill_id: z.string().describe(\"Skill ID from skill_list\") },\n handler: async ({ skill_id }: { skill_id: string }) => skillShow(p, skill_id),\n },\n {\n name: \"skill_search\",\n description: \"Search skills by name, description, or keywords.\",\n inputSchema: { query: z.string() },\n handler: async ({ query }: { query: string }) => skillSearch(p, query),\n },\n {\n name: \"skill_check_requirements\",\n description: \"Validate that all skill prerequisites are met in the target directory.\",\n inputSchema: {\n skill_id: z.string(),\n target_dir: z\n .string()\n .optional()\n .describe(\"Directory to check against (default: projectDir)\"),\n },\n handler: async ({ skill_id, target_dir }: { skill_id: string; target_dir?: string }) =>\n skillCheckRequirements(p, skill_id, target_dir ?? p),\n },\n {\n name: \"skill_get_preamble\",\n description: \"Get the REQUIRES/INPUT/READS/WRITES DSL preamble for a skill.\",\n inputSchema: { skill_id: z.string() },\n handler: async ({ skill_id }: { skill_id: string }) => skillGetPreamble(p, skill_id),\n },\n // Session tools\n {\n name: \"session_list\",\n description: \"List all past agent run sessions for this workspace, sorted newest first.\",\n inputSchema: {},\n handler: async () => sessionList(p),\n },\n {\n name: \"session_get\",\n description: \"Get full metadata for a specific session by run ID.\",\n inputSchema: { run_id: z.string() },\n handler: async ({ run_id }: { run_id: string }) => sessionGet(p, run_id),\n },\n // Connector tools\n {\n name: \"connector_list\",\n description:\n \"List connectors declared in skaile.yaml as {connected, failed}. `failed` holds connectors that did not connect this session, with the failure reason — their mount paths are dead directories, not synced workspaces.\",\n inputSchema: {},\n handler: async () => connectorList(plugin.connectorManager),\n },\n {\n name: \"connector_read\",\n description: \"Read content from a connector by path.\",\n inputSchema: {\n connector_id: z.string().describe(\"Connector ID from connector_list\"),\n path: z.string().describe(\"Path within the connector\"),\n },\n handler: async ({ connector_id, path }: { connector_id: string; path: string }) =>\n connectorRead(plugin.connectorManager, connector_id, path),\n },\n {\n name: \"connector_write\",\n description: \"Write content to a connector by path.\",\n inputSchema: {\n connector_id: z.string(),\n path: z.string(),\n content: z.string().describe(\"Content to write\"),\n },\n handler: async ({\n connector_id,\n path,\n content,\n }: {\n connector_id: string;\n path: string;\n content: string;\n }) => connectorWrite(plugin.connectorManager, connector_id, path, content),\n },\n {\n name: \"connector_search\",\n description: \"Search within a connector by query string.\",\n inputSchema: {\n connector_id: z.string(),\n query: z.string().describe(\"Search query\"),\n },\n handler: async ({ connector_id, query }: { connector_id: string; query: string }) =>\n connectorSearch(plugin.connectorManager, connector_id, query),\n },\n {\n name: \"connector_exec\",\n description: \"Execute a custom operation on a connector.\",\n inputSchema: {\n connector_id: z.string(),\n operation: z.string().describe(\"Operation name from connector_describe\"),\n args: z.record(z.string(), z.unknown()).describe(\"Operation arguments\"),\n },\n handler: async ({\n connector_id,\n operation,\n args,\n }: {\n connector_id: string;\n operation: string;\n args: Record<string, unknown>;\n }) => connectorExec(plugin.connectorManager, connector_id, operation, args),\n },\n {\n name: \"connector_load_skill\",\n description: \"Load the rendered skill body for a connector (operations + usage).\",\n inputSchema: {\n connector_id: z.string(),\n },\n handler: async ({ connector_id }: { connector_id: string }) =>\n connectorLoadSkill(plugin.connectorManager, connector_id),\n },\n {\n name: \"connector_describe\",\n description: \"Describe a connector's capabilities via its RuntimeSkillDescriptor.\",\n inputSchema: {\n connector_id: z.string(),\n },\n handler: async ({ connector_id }: { connector_id: string }) =>\n connectorDescribe(plugin.connectorManager, connector_id),\n },\n // Validator tools\n {\n name: \"workspace_validate\",\n description: \"Run a full health check: connectors, mounts, secrets, driver binary.\",\n inputSchema: {},\n handler: async () => workspaceValidate(plugin, driver),\n },\n {\n name: \"workspace_info\",\n description: \"Show workspace configuration: driver, model, provider, resource counts.\",\n inputSchema: {},\n handler: async () => workspaceInfo(plugin, driver, plugin.model),\n },\n {\n name: \"workspace_test_secret\",\n description: \"Test resolution of one secret reference (env:VAR, forge:key).\",\n inputSchema: { ref: z.string().describe(\"Secret ref e.g. env:ANTHROPIC_API_KEY\") },\n handler: async ({ ref }: { ref: string }) => workspaceTestSecret(ref),\n },\n {\n name: \"workspace_reload\",\n description: \"Re-read skaile.yaml and re-sync the plugin state.\",\n inputSchema: {},\n handler: async () => workspaceReload(plugin),\n },\n ];\n}\n\n/**\n * Build the **in-process** workspace MCP server via the Claude Agent SDK's\n * `createSdkMcpServer`. This shape is what the runner embeds into a Claude\n * Agent SDK `query()` call — the runner *is* the Claude Agent SDK host.\n *\n * Returns `null` when `@anthropic-ai/claude-agent-sdk` is not installed\n * (graceful degradation for non-Claude-Code environments).\n *\n * For the standalone `skaile mcp-server` stdio subprocess use\n * {@link buildWorkspaceMcpStdioServer} / {@link runMcpServerStdio} instead —\n * those carry no Claude Agent SDK dependency.\n *\n * @param plugin - A booted `WorkspacePlugin` instance.\n * @returns The SDK MCP server object or `null` if the SDK is unavailable.\n *\n * @docLink packages/workspace-plugin/concepts#adapters\n */\nexport async function buildWorkspaceMcpServer(plugin: WorkspacePlugin): Promise<unknown | null> {\n let sdk: any;\n try {\n sdk = await import(\"@anthropic-ai/claude-agent-sdk\");\n } catch {\n return null;\n }\n return sdk.createSdkMcpServer({\n name: \"skaile-workspace\",\n tools: withActivityLabelDefs(buildWorkspaceToolDefs(plugin), zStatic),\n });\n}\n\n/**\n * Build a **raw stdio** workspace MCP server on `@modelcontextprotocol/sdk` —\n * no Claude Agent SDK. This is the correct shape for the `skaile mcp-server`\n * stdio subprocess that MCP-client agents (Claude Code, Codex, …) spawn.\n * Runs on plain Node.\n *\n * The returned server is not yet connected — call `.connect(transport)` (or\n * use {@link runMcpServerStdio}).\n *\n * @param plugin - A booted `WorkspacePlugin` instance.\n * @returns A `McpServer` with all 28 workspace tools registered.\n *\n * @docLink packages/workspace-plugin/concepts#adapters\n */\nexport async function buildWorkspaceMcpStdioServer(plugin: WorkspacePlugin): Promise<any> {\n const { McpServer } = await import(\"@modelcontextprotocol/sdk/server/mcp.js\" as string);\n const server = new McpServer({ name: \"skaile-workspace\", version: \"1.0.0\" });\n for (const def of buildWorkspaceToolDefs(plugin)) {\n server.registerTool(\n def.name,\n { description: def.description, inputSchema: def.inputSchema },\n def.handler,\n );\n }\n return server;\n}\n\n/**\n * Start the workspace MCP server over stdio transport.\n *\n * Builds the raw `@modelcontextprotocol/sdk` server via\n * {@link buildWorkspaceMcpStdioServer} and connects a `StdioServerTransport`.\n * No `@anthropic-ai/claude-agent-sdk` dependency anywhere on this path.\n *\n * @param plugin - A booted `WorkspacePlugin` instance.\n *\n * @docLink packages/workspace-plugin/concepts#adapters\n */\nexport async function runMcpServerStdio(plugin: WorkspacePlugin): Promise<void> {\n const server = await buildWorkspaceMcpStdioServer(plugin);\n const { StdioServerTransport } = await import(\n \"@modelcontextprotocol/sdk/server/stdio.js\" as string\n );\n await server.connect(new StdioServerTransport());\n}\n"]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { initTelemetry } from './chunk-4R6DROGN.js';
|
|
2
2
|
import { parseSkillFrontmatter, validateFlowVersions } from './chunk-T3YUSWVK.js';
|
|
3
|
-
import { FlowAdapter, SessionNodeExecutor, SessionSubpromptRunner, SessionInlineSubFlowRunner, driveOrchestratorTurn } from './chunk-
|
|
4
|
-
import { loadFlow, flowLookupRoots, findFlowFileInRoots, FLOW_FILE_EXTENSIONS } from './chunk-
|
|
5
|
-
import { renderStimulusPrompt } from './chunk-
|
|
6
|
-
import { flowSkillVersionPins } from './chunk-
|
|
3
|
+
import { FlowAdapter, SessionNodeExecutor, SessionSubpromptRunner, SessionInlineSubFlowRunner, driveOrchestratorTurn } from './chunk-LIEOC4JE.js';
|
|
4
|
+
import { loadFlow, flowLookupRoots, findFlowFileInRoots, FLOW_FILE_EXTENSIONS } from './chunk-YVWUHPQW.js';
|
|
5
|
+
import { renderStimulusPrompt } from './chunk-K3IBZ2UZ.js';
|
|
6
|
+
import { flowSkillVersionPins } from './chunk-UDFWBALP.js';
|
|
7
7
|
import { resolveSettings } from './chunk-UWU572Q6.js';
|
|
8
8
|
import { resolveAgentDir, resolveSkWorkspaceConfig } from './chunk-DF7C3KZK.js';
|
|
9
9
|
import { isValidAssetName } from './chunk-GEEW6SY2.js';
|
|
@@ -518,5 +518,5 @@ function walkForSkill(dir, skillId) {
|
|
|
518
518
|
}
|
|
519
519
|
|
|
520
520
|
export { resolveFlowPath, resumeFlow, runFlow };
|
|
521
|
-
//# sourceMappingURL=chunk-
|
|
522
|
-
//# sourceMappingURL=chunk-
|
|
521
|
+
//# sourceMappingURL=chunk-SZEICOXM.js.map
|
|
522
|
+
//# sourceMappingURL=chunk-SZEICOXM.js.map
|