@skaile/workspaces 3.9.1 → 3.10.0

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.
Files changed (106) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/{asset-feeds-TFQDBOYM.js → asset-feeds-DT4B37Z3.js} +4 -4
  3. package/dist/{asset-feeds-TFQDBOYM.js.map → asset-feeds-DT4B37Z3.js.map} +1 -1
  4. package/dist/asset-manager/index.js +1 -1
  5. package/dist/bridge/drivers/claude-sdk.js +16 -12
  6. package/dist/bridge/drivers/claude-sdk.js.map +1 -1
  7. package/dist/bridge/drivers/codex.js +1 -1
  8. package/dist/bridge/drivers/continue.js +2 -2
  9. package/dist/bridge/drivers/echo.js +1 -1
  10. package/dist/bridge/drivers/gemini.js +3 -3
  11. package/dist/bridge/drivers/goose.js +2 -2
  12. package/dist/bridge/drivers/omp.js +1 -1
  13. package/dist/bridge/drivers/opencode.js +2 -2
  14. package/dist/bridge/drivers/qwen.js +3 -3
  15. package/dist/bridge/index.js +2 -2
  16. package/dist/bridge/src/drivers/claude-sdk.d.ts.map +1 -1
  17. package/dist/{chunk-HGFKNJA5.js → chunk-2D5BYAL6.js} +23 -4
  18. package/dist/chunk-2D5BYAL6.js.map +1 -0
  19. package/dist/{chunk-R2IQAJSU.js → chunk-4D4N2VFR.js} +6 -6
  20. package/dist/{chunk-R2IQAJSU.js.map → chunk-4D4N2VFR.js.map} +1 -1
  21. package/dist/{chunk-6OVS6IAK.js → chunk-7NRZGSTY.js} +2 -2
  22. package/dist/{chunk-6OVS6IAK.js.map → chunk-7NRZGSTY.js.map} +1 -1
  23. package/dist/{chunk-WUOHDYDH.js → chunk-7WTXE6YS.js} +2 -2
  24. package/dist/{chunk-WUOHDYDH.js.map → chunk-7WTXE6YS.js.map} +1 -1
  25. package/dist/{chunk-HASPIEOD.js → chunk-A5Y2O23Y.js} +6 -6
  26. package/dist/{chunk-HASPIEOD.js.map → chunk-A5Y2O23Y.js.map} +1 -1
  27. package/dist/{chunk-DPIOHTDD.js → chunk-DQ5MUABO.js} +3 -3
  28. package/dist/{chunk-DPIOHTDD.js.map → chunk-DQ5MUABO.js.map} +1 -1
  29. package/dist/{chunk-BO4NC4G7.js → chunk-GE3EDS2M.js} +27 -12
  30. package/dist/chunk-GE3EDS2M.js.map +1 -0
  31. package/dist/{chunk-2KANBOIO.js → chunk-H6KQB6HL.js} +53 -10
  32. package/dist/chunk-H6KQB6HL.js.map +1 -0
  33. package/dist/{chunk-ZIC7S44L.js → chunk-KBAYZ6DK.js} +3 -3
  34. package/dist/{chunk-ZIC7S44L.js.map → chunk-KBAYZ6DK.js.map} +1 -1
  35. package/dist/{chunk-BIA7TJWH.js → chunk-OT6V4IE7.js} +2 -2
  36. package/dist/{chunk-BIA7TJWH.js.map → chunk-OT6V4IE7.js.map} +1 -1
  37. package/dist/{chunk-32MHUAED.js → chunk-QRL23WVA.js} +3 -3
  38. package/dist/{chunk-32MHUAED.js.map → chunk-QRL23WVA.js.map} +1 -1
  39. package/dist/{chunk-K7W7HC3C.js → chunk-SI7WZARX.js} +4 -4
  40. package/dist/{chunk-K7W7HC3C.js.map → chunk-SI7WZARX.js.map} +1 -1
  41. package/dist/{chunk-RPZAX3II.js → chunk-UQESUYDT.js} +3 -3
  42. package/dist/{chunk-RPZAX3II.js.map → chunk-UQESUYDT.js.map} +1 -1
  43. package/dist/{chunk-NXUUNPIB.js → chunk-XDAOECL4.js} +3 -3
  44. package/dist/{chunk-NXUUNPIB.js.map → chunk-XDAOECL4.js.map} +1 -1
  45. package/dist/{chunk-HNKVHE4B.js → chunk-XDX2XJTO.js} +4 -4
  46. package/dist/{chunk-HNKVHE4B.js.map → chunk-XDX2XJTO.js.map} +1 -1
  47. package/dist/cli/index.js +30 -30
  48. package/dist/connectors/index.js +4 -4
  49. package/dist/{ensure-sources-PDAH5SAV.js → ensure-sources-HS66JB6Y.js} +4 -4
  50. package/dist/{ensure-sources-PDAH5SAV.js.map → ensure-sources-HS66JB6Y.js.map} +1 -1
  51. package/dist/factory-assets/connectors/box.js +4 -4
  52. package/dist/factory-assets/connectors/deploy.js +4 -4
  53. package/dist/factory-assets/connectors/devserver.js +4 -4
  54. package/dist/factory-assets/connectors/flow/CONNECTOR.md +14 -6
  55. package/dist/factory-assets/connectors/flow/adapter.d.ts +4 -3
  56. package/dist/factory-assets/connectors/flow/adapter.d.ts.map +1 -1
  57. package/dist/factory-assets/connectors/flow/adapter.js +4 -4
  58. package/dist/factory-assets/connectors/flow/prompt-fragments.d.ts.map +1 -1
  59. package/dist/factory-assets/connectors/flow/prompt-fragments.js +1 -1
  60. package/dist/factory-assets/connectors/flow/run-flow.js +5 -5
  61. package/dist/factory-assets/connectors/flow.js +4 -4
  62. package/dist/factory-assets/connectors/git.js +4 -4
  63. package/dist/factory-assets/connectors/gmail.js +4 -4
  64. package/dist/factory-assets/connectors/googledrive.js +4 -4
  65. package/dist/factory-assets/connectors/local.js +4 -4
  66. package/dist/factory-assets/connectors/mattermost.js +4 -4
  67. package/dist/factory-assets/connectors/memory.js +4 -4
  68. package/dist/factory-assets/connectors/minio.js +4 -4
  69. package/dist/factory-assets/connectors/postgres.js +4 -4
  70. package/dist/factory-assets/connectors/s3.js +4 -4
  71. package/dist/factory-assets/connectors/sharepoint.js +4 -4
  72. package/dist/factory-assets/connectors/sqlite.js +4 -4
  73. package/dist/factory-assets/connectors/static-server.js +4 -4
  74. package/dist/factory-assets/connectors/tunnel.js +4 -4
  75. package/dist/factory-assets/connectors/webdav.js +4 -4
  76. package/dist/factory-assets/connectors/xstate-store.js +4 -4
  77. package/dist/factory-assets/connectors/xstate.js +4 -4
  78. package/dist/{helpers-5OP6O3WS.js → helpers-GPD3WJQQ.js} +4 -4
  79. package/dist/{helpers-5OP6O3WS.js.map → helpers-GPD3WJQQ.js.map} +1 -1
  80. package/dist/{library-publish-NNGVXORH.js → library-publish-T7VSMTGZ.js} +6 -6
  81. package/dist/{library-publish-NNGVXORH.js.map → library-publish-T7VSMTGZ.js.map} +1 -1
  82. package/dist/{open-library-5CEK2TSH.js → open-library-FGHDS7AZ.js} +5 -5
  83. package/dist/{open-library-5CEK2TSH.js.map → open-library-FGHDS7AZ.js.map} +1 -1
  84. package/dist/{project-QOVJ7I6I.js → project-GU7X4WO2.js} +5 -5
  85. package/dist/{project-QOVJ7I6I.js.map → project-GU7X4WO2.js.map} +1 -1
  86. package/dist/runner/index.js +7 -7
  87. package/dist/runner/src/serve-credentials.d.ts +28 -0
  88. package/dist/runner/src/serve-credentials.d.ts.map +1 -1
  89. package/dist/runner/src/serve.d.ts +2 -2
  90. package/dist/runner/src/serve.d.ts.map +1 -1
  91. package/dist/sdk/asset-manager.js +1 -1
  92. package/dist/sdk/bridge.js +2 -2
  93. package/dist/sdk/index.js +7 -7
  94. package/dist/sdk/runner.js +7 -7
  95. package/dist/{setup-ZB6U5MSS.js → setup-TF7IP2IN.js} +4 -4
  96. package/dist/{setup-ZB6U5MSS.js.map → setup-TF7IP2IN.js.map} +1 -1
  97. package/dist/{source-O34YYH3U.js → source-5GTOJ4SD.js} +6 -6
  98. package/dist/{source-O34YYH3U.js.map → source-5GTOJ4SD.js.map} +1 -1
  99. package/dist/{source-manifest-publish-5TRCSBK7.js → source-manifest-publish-KR5MXXGD.js} +7 -7
  100. package/dist/{source-manifest-publish-5TRCSBK7.js.map → source-manifest-publish-KR5MXXGD.js.map} +1 -1
  101. package/dist/tui/index.js +7 -7
  102. package/dist/workspace-plugin/index.js +1 -1
  103. package/package.json +1 -1
  104. package/dist/chunk-2KANBOIO.js.map +0 -1
  105. package/dist/chunk-BO4NC4G7.js.map +0 -1
  106. package/dist/chunk-HGFKNJA5.js.map +0 -1
@@ -1,6 +1,6 @@
1
1
  import { fetchProviderModels } from '../../chunk-V34ZEXSE.js';
2
2
  import { classifyGenericErrorMessage } from '../../chunk-GAH4YRCI.js';
3
- import { BUILTIN_DRIVER_CATALOG, AgentDriver, getBridgeLogger } from '../../chunk-BIA7TJWH.js';
3
+ import { BUILTIN_DRIVER_CATALOG, AgentDriver, getBridgeLogger } from '../../chunk-OT6V4IE7.js';
4
4
  import '../../chunk-6E6PKKAD.js';
5
5
  import '../../chunk-5Q7HA4JP.js';
6
6
  import '../../chunk-3A5IKBHQ.js';
@@ -1,6 +1,6 @@
1
- import { SubprocessCliDriver, mapApiKeysToEnv, extractText, extractCost, extractTokens } from '../../chunk-RPZAX3II.js';
1
+ import { SubprocessCliDriver, mapApiKeysToEnv, extractText, extractCost, extractTokens } from '../../chunk-UQESUYDT.js';
2
2
  import '../../chunk-GAH4YRCI.js';
3
- import { BUILTIN_DRIVER_CATALOG, getBridgeLogger } from '../../chunk-BIA7TJWH.js';
3
+ import { BUILTIN_DRIVER_CATALOG, getBridgeLogger } from '../../chunk-OT6V4IE7.js';
4
4
  import '../../chunk-6E6PKKAD.js';
5
5
  import '../../chunk-5Q7HA4JP.js';
6
6
  import '../../chunk-3A5IKBHQ.js';
@@ -1,5 +1,5 @@
1
1
  import { dispatchCapability } from '../../chunk-RRVQAE5D.js';
2
- import { BUILTIN_DRIVER_CATALOG, AgentDriver, getBridgeLogger } from '../../chunk-BIA7TJWH.js';
2
+ import { BUILTIN_DRIVER_CATALOG, AgentDriver, getBridgeLogger } from '../../chunk-OT6V4IE7.js';
3
3
  import '../../chunk-6E6PKKAD.js';
4
4
  import '../../chunk-5Q7HA4JP.js';
5
5
  import '../../chunk-3A5IKBHQ.js';
@@ -1,8 +1,8 @@
1
- export { GeminiDriver, GeminiFamilyDriver, geminiDriverTarget } from '../../chunk-HNKVHE4B.js';
2
- import '../../chunk-RPZAX3II.js';
1
+ export { GeminiDriver, GeminiFamilyDriver, geminiDriverTarget } from '../../chunk-XDX2XJTO.js';
2
+ import '../../chunk-UQESUYDT.js';
3
3
  import '../../chunk-V34ZEXSE.js';
4
4
  import '../../chunk-GAH4YRCI.js';
5
- import '../../chunk-BIA7TJWH.js';
5
+ import '../../chunk-OT6V4IE7.js';
6
6
  import '../../chunk-6E6PKKAD.js';
7
7
  import '../../chunk-5Q7HA4JP.js';
8
8
  import '../../chunk-3A5IKBHQ.js';
@@ -1,6 +1,6 @@
1
- import { SubprocessCliDriver, mapApiKeysToEnv, extractText, extractCost, extractTokens } from '../../chunk-RPZAX3II.js';
1
+ import { SubprocessCliDriver, mapApiKeysToEnv, extractText, extractCost, extractTokens } from '../../chunk-UQESUYDT.js';
2
2
  import '../../chunk-GAH4YRCI.js';
3
- import { BUILTIN_DRIVER_CATALOG, getBridgeLogger } from '../../chunk-BIA7TJWH.js';
3
+ import { BUILTIN_DRIVER_CATALOG, getBridgeLogger } from '../../chunk-OT6V4IE7.js';
4
4
  import '../../chunk-6E6PKKAD.js';
5
5
  import '../../chunk-5Q7HA4JP.js';
6
6
  import '../../chunk-3A5IKBHQ.js';
@@ -1,5 +1,5 @@
1
1
  import { classifyGenericErrorMessage } from '../../chunk-GAH4YRCI.js';
2
- import { BUILTIN_DRIVER_CATALOG, AgentDriver, getBridgeLogger } from '../../chunk-BIA7TJWH.js';
2
+ import { BUILTIN_DRIVER_CATALOG, AgentDriver, getBridgeLogger } from '../../chunk-OT6V4IE7.js';
3
3
  import '../../chunk-6E6PKKAD.js';
4
4
  import '../../chunk-5Q7HA4JP.js';
5
5
  import '../../chunk-3A5IKBHQ.js';
@@ -1,6 +1,6 @@
1
- import { SubprocessCliDriver, mapApiKeysToEnv, extractText, extractCost, extractTokens } from '../../chunk-RPZAX3II.js';
1
+ import { SubprocessCliDriver, mapApiKeysToEnv, extractText, extractCost, extractTokens } from '../../chunk-UQESUYDT.js';
2
2
  import '../../chunk-GAH4YRCI.js';
3
- import { BUILTIN_DRIVER_CATALOG, getBridgeLogger } from '../../chunk-BIA7TJWH.js';
3
+ import { BUILTIN_DRIVER_CATALOG, getBridgeLogger } from '../../chunk-OT6V4IE7.js';
4
4
  import '../../chunk-6E6PKKAD.js';
5
5
  import '../../chunk-5Q7HA4JP.js';
6
6
  import '../../chunk-3A5IKBHQ.js';
@@ -1,8 +1,8 @@
1
- import { GeminiFamilyDriver } from '../../chunk-HNKVHE4B.js';
2
- import '../../chunk-RPZAX3II.js';
1
+ import { GeminiFamilyDriver } from '../../chunk-XDX2XJTO.js';
2
+ import '../../chunk-UQESUYDT.js';
3
3
  import { fetchProviderModels } from '../../chunk-V34ZEXSE.js';
4
4
  import '../../chunk-GAH4YRCI.js';
5
- import { BUILTIN_DRIVER_CATALOG, getBridgeLogger } from '../../chunk-BIA7TJWH.js';
5
+ import { BUILTIN_DRIVER_CATALOG, getBridgeLogger } from '../../chunk-OT6V4IE7.js';
6
6
  import '../../chunk-6E6PKKAD.js';
7
7
  import '../../chunk-5Q7HA4JP.js';
8
8
  import '../../chunk-3A5IKBHQ.js';
@@ -1,9 +1,9 @@
1
- export { BridgeRuntime, EventNormalizer, createRuntime, detectFileChange, detectFileChanges, summarizeToolCall, summarizeToolResult, validateApiKey } from '../chunk-32MHUAED.js';
1
+ export { BridgeRuntime, EventNormalizer, createRuntime, detectFileChange, detectFileChanges, summarizeToolCall, summarizeToolResult, validateApiKey } from '../chunk-QRL23WVA.js';
2
2
  export { CLOUD_SECRET_ENV_KEYS, SUPPORTED_CLOUDS, buildClaudeCloudEnv, probeResumeTranscript, resolveClaudeConfigDir } from '../chunk-RUFTB7QN.js';
3
3
  export { dispatchCapability, filterRenderCapabilities, renderFallback } from '../chunk-RRVQAE5D.js';
4
4
  export { ModelTierResolutionError, PROVIDER_MODEL_TIERS, STATIC_MODELS, fetchProviderModels, getModels, getStaticModels, resolveModelTier } from '../chunk-V34ZEXSE.js';
5
5
  export { AccountUnavailableError, AuthError, classifyClaudeSdkError, reclassifyAuthAsAccountUnavailable } from '../chunk-GAH4YRCI.js';
6
- export { AgentDriver, BUILTIN_DRIVER_CATALOG, DRIVER_CATALOG, createDriver, getBridgeLogger, listDrivers, listModelsForDriver, registerBuiltinDrivers } from '../chunk-BIA7TJWH.js';
6
+ export { AgentDriver, BUILTIN_DRIVER_CATALOG, DRIVER_CATALOG, createDriver, getBridgeLogger, listDrivers, listModelsForDriver, registerBuiltinDrivers } from '../chunk-OT6V4IE7.js';
7
7
  import '../chunk-6E6PKKAD.js';
8
8
  import '../chunk-AZPXCHDK.js';
9
9
  import '../chunk-F3HNW354.js';
@@ -1 +1 @@
1
- {"version":3,"file":"claude-sdk.d.ts","sourceRoot":"","sources":["../../../../bridge/src/drivers/claude-sdk.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAU,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAUnE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAUvE,OAAO,EAAuB,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AAEpE,OAAO,EACL,KAAK,WAAW,EAChB,WAAW,EAKX,KAAK,UAAU,EAGf,KAAK,gBAAgB,EAEtB,MAAM,aAAa,CAAC;AA2VrB,qBAAa,eAAgB,SAAQ,WAAW;IAC9C,QAAQ,CAAC,UAAU,EAAE,UAAU,CAK7B;IAEF,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAyC;IAC7D,OAAO,CAAC,MAAM,CAAc;IAC5B,OAAO,CAAC,eAAe,CAAgC;IACvD,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,GAAG,CAA6C;IACxD,OAAO,CAAC,YAAY,CAA6B;IACjD,OAAO,CAAC,QAAQ,CAAM;IACtB;;;;OAIG;IACH,OAAO,CAAC,mBAAmB,CAAK;IAChC,oGAAoG;IACpG,OAAO,CAAC,qBAAqB,CAAS;IACtC;;;;;;;;OAQG;IACH,OAAO,CAAC,wBAAwB,CAAuB;IAEvD,uEAAuE;IACvE,OAAO,CAAC,KAAK,CAAyB;IACtC;;;;;OAKG;IACH,OAAO,CAAC,WAAW,CAAoC;IACvD;;;;OAIG;IACH,OAAO,CAAC,mBAAmB,CAAS;IACpC;;;OAGG;IACH,OAAO,CAAC,YAAY,CAAuB;IAC3C;;;;OAIG;IACH,OAAO,CAAC,aAAa,CAAuB;IAC5C,gDA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OAAO,CAAC,gBAAgB;IAYxB,OAAO,CAAC,mBAAmB;IAiC3B,OAAO,CAAC,cAAc;IAqBtB;;;;;;;;;;;;OAYG;IACU,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAgDnC,+DAA+D;IAC/D,IAAI,SAAS,IAAI,OAAO,CAEvB;IAED;;;;;;;;;OASG;IACI,IAAI,IAAI,IAAI;IAmBJ,UAAU,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC;IAczC,aAAa,IAAI,UAAU,GAAG,IAAI;IAIlC,gBAAgB,IAAI,MAAM,GAAG,IAAI;IAIjC,gBAAgB,IAAI,MAAM,GAAG,IAAI;IAIpC,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC;IAyBnC;;;;;;OAMG;IACH,OAAO,CAAC,qBAAqB;IA0B7B;;;OAGG;IACH,OAAO,CAAC,iBAAiB;IAazB;;;;;;;;;;OAUG;IACH,OAAO,CAAC,gBAAgB;CAezB;AAED;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,EAAE,YAAY,CAAC,WAAW,CAU3D,CAAC"}
@@ -1,4 +1,4 @@
1
- import { isAgentNode, isGateNode, nodeIsOptional, nodeRequiresApproval, nodeLabel, flowDefaults } from './chunk-ELPR5XBG.js';
1
+ import { isAgentNode, isGateNode, isCheckNode, nodeIsOptional, nodeRequiresApproval, nodeLabel, flowDefaults } from './chunk-ELPR5XBG.js';
2
2
 
3
3
  // factory-assets/connectors/flow/prompt-fragments.ts
4
4
  function renderStimulusPrompt(stimulus) {
@@ -30,6 +30,7 @@ function renderStimulusPrompt(stimulus) {
30
30
  function buildOrchestratorPrompt(flowDef, state, stimulus) {
31
31
  const agentNodes = flowDef.nodes.filter(isAgentNode);
32
32
  const gateNodes = flowDef.nodes.filter(isGateNode);
33
+ const checkNodes = flowDef.nodes.filter(isCheckNode);
33
34
  const promptNodes = flowDef.nodes.filter((node) => isAgentNode(node) || isGateNode(node));
34
35
  const agentNodeIds = new Set(agentNodes.map((node) => node.id));
35
36
  const promptNodeIds = new Set(promptNodes.map((node) => node.id));
@@ -86,6 +87,20 @@ ${rejectedGates.join("\n")}
86
87
 
87
88
  Revise the surrounding work in conversation, then re-request each gate with \`request_approval(nodeId, summary, artifacts)\`. Every gate remains parked until its new human decision; do not start, complete, skip, or fail a first-class gate.
88
89
 
90
+ ` : "";
91
+ const overriddenChecks = checkNodes.flatMap((node) => {
92
+ const record = state.nodes[node.id];
93
+ if (record?.status !== "complete" || record.approval?.decision !== "approved") return [];
94
+ return [
95
+ `- \`${node.id}\` \u2014 failed, overridden by ${record.approval.decidedBy ?? "unknown reviewer"}: ${record.approval.feedback ?? "(no reason recorded)"}`
96
+ ];
97
+ });
98
+ const overriddenCheckSection = overriddenChecks.length > 0 ? `## Checks completed by human override
99
+
100
+ ${overriddenChecks.join("\n")}
101
+
102
+ These checks did **not** pass. A human decided the run may continue anyway, so they are \`complete\` and their dependents are unblocked. Their evidence still records the failure \u2014 do not report them as passing, and say so if downstream work depends on what they were meant to verify.
103
+
89
104
  ` : "";
90
105
  const globals = flowDefaults(flowDef);
91
106
  const globalsSection = Object.keys(globals).length > 0 ? `## Flow globals
@@ -107,6 +122,10 @@ ${JSON.stringify(globals, null, 2)}
107
122
  stimulusParagraph = `Gate node \`${stimulus.nodeId}\` was **rejected** by ${stimulus.decidedBy}.${stimulus.feedback ? ` Feedback: "${stimulus.feedback}".` : ""} Revise the work in conversation and follow the rejected-gate instructions above.`;
108
123
  }
109
124
  }
125
+ if (stimulus.kind === "approval_received" && stimulusNode && isCheckNode(stimulusNode)) {
126
+ const availableSuccessors = agentNodes.filter((node) => state.nodes[node.id]?.status === "available").map((node) => `\`${node.id}\``);
127
+ stimulusParagraph = stimulus.decision === "approved" ? `Check node \`${stimulus.nodeId}\` failed, and ${stimulus.decidedBy} **overrode** the failure${stimulus.feedback ? `: "${stimulus.feedback}"` : ""}. The node is already \`complete\` and its evidence still records the failure. Do not call \`complete_node\` for it. Advance to successor work${availableSuccessors.length > 0 ? `; available agent nodes: ${availableSuccessors.join(", ")}` : ""} \u2014 call \`get_available\`, then \`build_handoff\` and \`start_node\` for the chosen agent node.` : `Check node \`${stimulus.nodeId}\` failed and ${stimulus.decidedBy} **rejected** it${stimulus.feedback ? `: "${stimulus.feedback}"` : ""}. The node is already terminally \`failed\` \u2014 it did not return to \`available\`. Do not call \`complete_node\` or \`fail_node\` for it. Report the outcome and stop unless other nodes remain available.`;
128
+ }
110
129
  return `# Flow Execution Context
111
130
 
112
131
  You are orchestrating the flow **${flowDef.name}** (${flowDef.id} v${flowDef.version}). This is a governed flow execution: your job is to run nodes through the flow tools, summarize their outputs for human review, and yield control at approval gates.
@@ -124,7 +143,7 @@ Nodes with **Gate = first-class** are runtime-owned human decisions. The runtime
124
143
 
125
144
  ${stateSummary}
126
145
 
127
- ${globalsSection}${correctionSection}${rejectedGateSection}## Why this turn is happening
146
+ ${globalsSection}${correctionSection}${rejectedGateSection}${overriddenCheckSection}## Why this turn is happening
128
147
 
129
148
  ${stimulusParagraph}
130
149
 
@@ -186,5 +205,5 @@ function describeStimulus(stimulus) {
186
205
  }
187
206
 
188
207
  export { buildOrchestratorPrompt, describeStimulus, renderStimulusPrompt, renderSubpromptPrompt };
189
- //# sourceMappingURL=chunk-HGFKNJA5.js.map
190
- //# sourceMappingURL=chunk-HGFKNJA5.js.map
208
+ //# sourceMappingURL=chunk-2D5BYAL6.js.map
209
+ //# sourceMappingURL=chunk-2D5BYAL6.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../factory-assets/connectors/flow/prompt-fragments.ts"],"names":[],"mappings":";;;AA2DO,SAAS,qBAAqB,QAAA,EAAgC;AACnE,EAAA,QAAQ,SAAS,IAAA;AAAM,IACrB,KAAK,cAAA;AACH,MAAA,OAAO,iKAAA;AAAA,IACT,KAAK,mBAAA,EAAqB;AACxB,MAAA,MAAM,EAAE,MAAA,EAAQ,QAAA,EAAU,SAAA,EAAW,UAAS,GAAI,QAAA;AAClD,MAAA,IAAI,aAAa,U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J,IAAA,CAAK,SAAA,CAAU,YAAA,EAAc,IAAA,EAAM,CAAC,CAAC;;AAAA,4JAAA,CAAA;AACjN;AAUO,SAAS,iBAAiB,QAAA,EAAgC;AAC/D,EAAA,QAAQ,SAAS,IAAA;AAAM,IACrB,KAAK,cAAA;AACH,MAAA,OAAO,cAAA;AAAA,IACT,KAAK,mBAAA;AACH,MAAA,OAAO,CAAA,kBAAA,EAAqB,QAAA,CAAS,MAAM,CAAA,CAAA,EAAI,SAAS,QAAQ,CAAA,CAAA;AAAA,IAClE,KAAK,gBAAA;AACH,MAAA,OAAO,CAAA,eAAA,EAAkB,SAAS,MAAM,CAAA,CAAA;AAAA,IAC1C,KAAK,iBAAA;AACH,MAAA,OAAO,CAAA,gBAAA,EAAmB,SAAS,MAAM,CAAA,CAAA;AAAA,IAC3C,KAAK,cAAA;AACH,MAAA,OAAO,CAAA,aAAA,EAAgB,SAAS,QAAQ,CAAA,CAAA;AAAA,IAC1C,KAAK,2BAAA;AACH,MAAA,OAAO,2BAAA;AAAA,IACT,KAAK,WAAA;AACH,MAAA,OAAO,WAAA;AAAA,IACT,KAAK,eAAA;AACH,MAAA,OAAO,eAAA;AAAA;AAEb","file":"chunk-2D5BYAL6.js","sourcesContent":["/**\n * Prompt fragments for the flow connector.\n *\n * Pure functions that translate a {@link TurnStimulus} into the strings the\n * runner's flow orchestrator splices into the per-turn agent prompt.\n * Extracted from `runner/src/flow-orchestrator.ts` in Phase 3 of the\n * flow-connector extraction (2026-05-08) so the connector owns its\n * prompt-rendering surface without a runtime dep on the orchestrator.\n *\n * The contract is byte-identical to the previous inline implementation —\n * any divergence is a regression.\n *\n * @docLink packages/factory-assets/flow#prompt-fragments\n */\n\nimport type { FlowExecution } from \"@skaile/workspaces/types\";\nimport type { FlowDefinition } from \"./engine/types.js\";\nimport {\n flowDefaults,\n isAgentNode,\n isCheckNode,\n isGateNode,\n nodeIsOptional,\n nodeLabel,\n nodeRequiresApproval,\n} from \"./engine/node-shape.js\";\n\n/**\n * Reasons why a new turn is starting. The flow orchestrator's prompt template\n * renders a stimulus-specific paragraph (via {@link renderStimulusPrompt}) so\n * the agent knows exactly why it has been invoked.\n *\n * @docLink packages/factory-assets/flow#turn-stimulus\n */\nexport type TurnStimulus =\n | { kind: \"flow_started\" }\n | {\n kind: \"approval_received\";\n nodeId: string;\n decision: \"approved\" | \"rejected\";\n feedback?: string;\n decidedBy: string;\n }\n | { kind: \"input_received\"; nodeId: string; response: unknown; providedBy: string }\n | { kind: \"retry_requested\"; nodeId: string; requestedBy: string }\n | { kind: \"user_message\"; text: string; senderId: string }\n | { kind: \"resumed_after_hibernation\" }\n | { kind: \"cancelled\" }\n | { kind: \"state_changed\" };\n\n/**\n * Render the stimulus paragraph the agent sees at turn start.\n *\n * The output is a single paragraph (one or more sentences, no surrounding\n * whitespace) describing why the runner has woken the agent. Spliced into\n * the orchestrator prompt under the `## Why this turn is happening` heading.\n *\n * @docLink packages/factory-assets/flow#render-stimulus-prompt\n */\nexport function renderStimulusPrompt(stimulus: TurnStimulus): string {\n switch (stimulus.kind) {\n case \"flow_started\":\n return \"The user just started this flow. Begin with the first available node — call `get_available`, then `build_handoff` for your chosen node, then `start_node`.\";\n case \"approval_received\": {\n const { nodeId, decision, decidedBy, feedback } = stimulus;\n if (decision === \"approved\") {\n return `Node \\`${nodeId}\\` was **approved** by ${decidedBy}. Call \\`complete_node\\` for this node with the approved output, then advance to the next available node.`;\n }\n const fb = feedback ? ` Feedback: \"${feedback}\".` : \"\";\n return `Node \\`${nodeId}\\` was **rejected** by ${decidedBy}.${fb} Decide how to proceed: retry the node (the engine returned it to \\`available\\`), ask clarifying questions via \\`request_input\\`, or call \\`fail_node(..., recoverable: false)\\` if the issue cannot be addressed.`;\n }\n case \"input_received\":\n return `The user just provided input for node \\`${stimulus.nodeId}\\` (provided by ${stimulus.providedBy}). The node has returned to its prior status. Continue executing the node with this input.`;\n case \"retry_requested\":\n return `A user requested a retry of node \\`${stimulus.nodeId}\\` (requested by ${stimulus.requestedBy}). The node has been returned to \\`available\\` with its prior error preserved in history. Start a fresh attempt — review the error context if relevant and try a different approach.`;\n case \"user_message\":\n return `A user sent a message: \"${stimulus.text}\" (from ${stimulus.senderId}). You can respond directly without touching the flow, continue flow work, or both. If the message is a question about the flow, answer it; if it signals a new direction, consider whether to pause.`;\n case \"resumed_after_hibernation\":\n return \"This session was hibernated and has just resumed. Review the current state above and continue where you left off. No state was lost.\";\n case \"cancelled\":\n return \"The user has cancelled this flow. Wrap up cleanly: do not start any new nodes. You may record a short summary if relevant, then stop.\";\n case \"state_changed\":\n return \"The flow state changed. Review the current state above and continue work accordingly.\";\n }\n}\n\n/**\n * Build the full agent-orchestrator prompt for a flow turn.\n *\n * Reassembles the five-section prompt from the current FlowExecution snapshot\n * and the supplied stimulus:\n *\n * 1. Flow definition (markdown table of nodes)\n * 2. Current state (progress, available/blocked, interaction pointers)\n * 3. Why this turn is happening (stimulus-specific paragraph)\n * 4. Flow tools available (static documentation)\n * 5. Rules\n *\n * Originally a byte-identical lift of the (since-deleted)\n * `FlowOrchestrator.buildOrchestratorPrompt`; the contract now is simply\n * this function's own output. When strict v2 defaults or legacy globals are\n * non-empty, a `## Flow globals` section exposes those run-scoped values. The\n * flow-wide active-node table stays bounded to selection metadata; `build_handoff`\n * supplies a selected agent node's execution payload. First-class gates appear\n * as runtime-owned state but never as agent-executable work.\n * Pure — depends only on its inputs.\n *\n * @docLink packages/factory-assets/flow#build-orchestrator-prompt\n * @since 2.2.0\n */\nexport function buildOrchestratorPrompt(\n flowDef: FlowDefinition,\n state: FlowExecution,\n stimulus: TurnStimulus,\n): string {\n const agentNodes = flowDef.nodes.filter(isAgentNode);\n const gateNodes = flowDef.nodes.filter(isGateNode);\n const checkNodes = flowDef.nodes.filter(isCheckNode);\n const promptNodes = flowDef.nodes.filter((node) => isAgentNode(node) || isGateNode(node));\n const agentNodeIds = new Set(agentNodes.map((node) => node.id));\n const promptNodeIds = new Set(promptNodes.map((node) => node.id));\n\n // ── Section 1: definition table ──\n const nodeRows = promptNodes\n .map((n) => {\n const deps =\n flowDef.edges\n .filter((e) => e.target === n.id && e.type === \"flow\")\n .map((e) => e.source)\n .join(\", \") || \"—\";\n const required = nodeIsOptional(n) ? \"optional\" : \"required\";\n const gate = isGateNode(n) ? \"first-class\" : nodeRequiresApproval(n) ? \"mandatory\" : \"—\";\n const nodeState = state.nodes[n.id];\n const status = nodeState?.status ?? \"not_started\";\n const description = (n.description ?? n.data?.description ?? \"—\")\n .replace(/\\s+/g, \" \")\n .replaceAll(\"|\", \"\\\\|\");\n return `| ${n.id} | ${nodeLabel(n)} | ${description} | ${required} | ${gate} | ${status} | ${deps} |`;\n })\n .join(\"\\n\");\n\n // ── Section 2: current state summary ──\n const nodesByStatus = (s: string) =>\n Object.values(state.nodes)\n .filter((n) => promptNodeIds.has(n.id) && n.status === s)\n .map((n) => n.id);\n const available = nodesByStatus(\"available\");\n const awaitingApproval = nodesByStatus(\"awaiting_approval\");\n const awaitingInput = nodesByStatus(\"awaiting_input\");\n const running = nodesByStatus(\"running\");\n const failed = nodesByStatus(\"failed\");\n const completed = nodesByStatus(\"complete\");\n const totalRequired = promptNodes.filter((n) => !nodeIsOptional(n)).length;\n\n const stateSummary = [\n `- Run ID: ${state.runId}`,\n `- Status: ${state.status}`,\n `- Autonomous mode: ${state.autonomousMode}`,\n `- Progress: ${completed.length} / ${totalRequired} required nodes complete`,\n `- Available now: ${available.join(\", \") || \"(none)\"}`,\n `- Currently running: ${running.join(\", \") || \"(none)\"}`,\n `- Awaiting approval: ${awaitingApproval.join(\", \") || \"(none)\"}`,\n `- Awaiting input: ${awaitingInput.join(\", \") || \"(none)\"}`,\n `- Failed: ${failed.join(\", \") || \"(none)\"}`,\n ].join(\"\\n\");\n\n const outputCorrections = Object.values(state.nodes)\n .filter(\n (node) =>\n agentNodeIds.has(node.id) &&\n node.outputCorrection &&\n node.status !== \"complete\" &&\n node.status !== \"failed\",\n )\n .map(\n (node) =>\n `- Node \\`${node.id}\\`: ${node.outputCorrection?.issues.join(\"; \") ?? \"unknown issue\"}`,\n );\n const correctionSection =\n outputCorrections.length > 0\n ? `## Output correction required\n\nThe following node has already used its single corrective reprompt. Submit one corrected \\`complete_node\\` call that fixes every issue; a second mismatch fails the node.\n\n${outputCorrections.join(\"\\n\")}\n\n`\n : \"\";\n\n const rejectedGates = gateNodes.flatMap((node) => {\n const approval = state.nodes[node.id]?.approval;\n if (approval?.decision !== \"rejected\") return [];\n return [\n `- \\`${node.id}\\` — rejected by ${approval.decidedBy ?? \"unknown reviewer\"}: ${\n approval.feedback ?? \"(no feedback provided)\"\n }`,\n ];\n });\n const rejectedGateSection =\n rejectedGates.length > 0\n ? `## Rejected first-class gates requiring revision\n\n${rejectedGates.join(\"\\n\")}\n\nRevise the surrounding work in conversation, then re-request each gate with \\`request_approval(nodeId, summary, artifacts)\\`. Every gate remains parked until its new human decision; do not start, complete, skip, or fail a first-class gate.\n\n`\n : \"\";\n\n // An override survives only in the approval record: the state table shows the\n // node as `complete` like any other, so without this section the failure is\n // invisible from the turn after the decision onward.\n const overriddenChecks = checkNodes.flatMap((node) => {\n const record = state.nodes[node.id];\n if (record?.status !== \"complete\" || record.approval?.decision !== \"approved\") return [];\n return [\n `- \\`${node.id}\\` — failed, overridden by ${record.approval.decidedBy ?? \"unknown reviewer\"}: ${\n record.approval.feedback ?? \"(no reason recorded)\"\n }`,\n ];\n });\n const overriddenCheckSection =\n overriddenChecks.length > 0\n ? `## Checks completed by human override\n\n${overriddenChecks.join(\"\\n\")}\n\nThese checks did **not** pass. A human decided the run may continue anyway, so they are \\`complete\\` and their dependents are unblocked. Their evidence still records the failure — do not report them as passing, and say so if downstream work depends on what they were meant to verify.\n\n`\n : \"\";\n\n // ── Section 2b: flow globals (additive — omitted entirely when empty so\n // flows without globals keep the byte-identical Phase 3 prompt) ──\n const globals = flowDefaults(flowDef);\n const globalsSection =\n Object.keys(globals).length > 0\n ? `## Flow globals\n\nRun-scoped parameters set by the flow author or by the host that started this run. When \\`run_input\\` is present it carries the payload this run was started with (e.g. a scheduled or webhook-triggered run) — treat it as the run's initial input instead of asking the user for it.\n\n\\`\\`\\`json\n${JSON.stringify(globals, null, 2)}\n\\`\\`\\`\n\n`\n : \"\";\n\n // ── Section 3: stimulus paragraph ──\n const stimulusNode =\n stimulus.kind === \"approval_received\"\n ? flowDef.nodes.find((node) => node.id === stimulus.nodeId)\n : undefined;\n let stimulusParagraph = renderStimulusPrompt(stimulus);\n if (stimulus.kind === \"approval_received\" && stimulusNode && isGateNode(stimulusNode)) {\n if (stimulus.decision === \"approved\") {\n const availableSuccessors = agentNodes\n .filter((node) => state.nodes[node.id]?.status === \"available\")\n .map((node) => `\\`${node.id}\\``);\n stimulusParagraph = `Gate node \\`${stimulus.nodeId}\\` is already \\`complete\\` after approval by ${stimulus.decidedBy}. Do not call \\`complete_node\\` for the gate. Advance to successor work${\n availableSuccessors.length > 0\n ? `; available agent nodes: ${availableSuccessors.join(\", \")}`\n : \"\"\n } — call \\`get_available\\`, then \\`build_handoff\\` and \\`start_node\\` for the chosen agent node.`;\n } else {\n stimulusParagraph = `Gate node \\`${stimulus.nodeId}\\` was **rejected** by ${stimulus.decidedBy}.${\n stimulus.feedback ? ` Feedback: \"${stimulus.feedback}\".` : \"\"\n } Revise the work in conversation and follow the rejected-gate instructions above.`;\n }\n }\n // A check is host-decided the same way a gate is: the adapter already wrote the\n // terminal status, and `complete_node` rejects any non-agent node — so the\n // generic approved/rejected wording would send the agent into a guaranteed throw.\n if (stimulus.kind === \"approval_received\" && stimulusNode && isCheckNode(stimulusNode)) {\n const availableSuccessors = agentNodes\n .filter((node) => state.nodes[node.id]?.status === \"available\")\n .map((node) => `\\`${node.id}\\``);\n stimulusParagraph =\n stimulus.decision === \"approved\"\n ? `Check node \\`${stimulus.nodeId}\\` failed, and ${stimulus.decidedBy} **overrode** the failure${\n stimulus.feedback ? `: \"${stimulus.feedback}\"` : \"\"\n }. The node is already \\`complete\\` and its evidence still records the failure. Do not call \\`complete_node\\` for it. Advance to successor work${\n availableSuccessors.length > 0\n ? `; available agent nodes: ${availableSuccessors.join(\", \")}`\n : \"\"\n } — call \\`get_available\\`, then \\`build_handoff\\` and \\`start_node\\` for the chosen agent node.`\n : `Check node \\`${stimulus.nodeId}\\` failed and ${stimulus.decidedBy} **rejected** it${\n stimulus.feedback ? `: \"${stimulus.feedback}\"` : \"\"\n }. The node is already terminally \\`failed\\` — it did not return to \\`available\\`. Do not call \\`complete_node\\` or \\`fail_node\\` for it. Report the outcome and stop unless other nodes remain available.`;\n }\n\n // ── Section 4+5: static tool surface and rules ──\n return `# Flow Execution Context\n\nYou are orchestrating the flow **${flowDef.name}** (${flowDef.id} v${flowDef.version}). This is a governed flow execution: your job is to run nodes through the flow tools, summarize their outputs for human review, and yield control at approval gates.\n\n## Flow definition\n\n| ID | Label | Description | Required | Gate | Status | Depends on |\n|----|-------|-------------|----------|------|--------|------------|\n${nodeRows}\n\nNodes with **Gate = mandatory** are hard approval gates: they always require \\`request_approval\\` and a human decision, even when autonomous mode is on. They cannot be skipped — \\`request_approval\\` → approval is their only completion path.\nNodes with **Gate = first-class** are runtime-owned human decisions. The runtime parks them automatically and completes them directly on approval; the agent never executes them.\n\n## Current state\n\n${stateSummary}\n\n${globalsSection}${correctionSection}${rejectedGateSection}${overriddenCheckSection}## Why this turn is happening\n\n${stimulusParagraph}\n\n## Flow tools available\n\nAll tools are exposed by the \\`flow\\` connector:\n\n- \\`get_available()\\` — list node IDs that are ready to start\n- \\`get_state()\\` — full current state including approvals, inputs, outputs\n- \\`get_globals()\\` — the flow's run-scoped globals (e.g. the \\`run_input\\` payload for scheduled/params-bound runs)\n- \\`build_handoff(nodeId)\\` — selected node instruction, supplied bindings, required assets, and upstream context\n- \\`start_node(nodeId)\\` — transition an agent node from \\`available\\` → \\`running\\`; call before executing it. Never start a first-class gate.\n- \\`request_approval(nodeId, summary, artifacts)\\` — transition a running agent node to \\`awaiting_approval\\`, or replace a rejected first-class gate's decision with a fresh pending request. **This ends your turn.**\n- \\`request_input(nodeId, prompt, schema)\\` — transition to \\`awaiting_input\\`. **This ends your turn.** Legal from \\`available\\`, \\`running\\`, or \\`awaiting_approval\\`.\n- \\`complete_node(nodeId, summary, fields?, artifacts?, concerns?)\\` — complete an agent node. When downstream nodes consume declared output fields, include a conforming JSON object. The first mismatch gets one corrective call; the second fails the node. Valid only if the agent node was approved, OR autonomousMode is true and it does not require mandatory approval. First-class gates are completed by the runtime on approval; never call this tool for them.\n- \\`fail_node(nodeId, message, recoverable)\\` — transition to \\`failed\\`, or to \\`skipped\\` if the node is optional. \\`recoverable=true\\` returns the node to \\`available\\` instead.\n- \\`skip_node(nodeId)\\` — transition to \\`skipped\\`. Only valid for optional nodes.\n\n## Rules\n\n1. Before executing an agent node, call \\`build_handoff(nodeId)\\` and follow its instruction with the supplied bindings, assets, and upstream context; then call \\`start_node(nodeId)\\`.\n2. After executing the node, call \\`request_approval\\` unless \\`autonomousMode\\` is true — in which case call \\`complete_node\\` directly. Exception: nodes marked **Gate = mandatory** always require \\`request_approval\\` and a human decision, even in autonomous mode.\n3. First-class nodes marked **Gate = first-class** are runtime-owned. Never start, complete, skip, fail, or request input for them. After rejection, revise in conversation and only call \\`request_approval\\` to create the next attempt.\n4. If you need information from the user before or during agent execution, call \\`request_input\\`. This ends your turn until the user responds.\n5. On unrecoverable agent failure, call \\`fail_node(..., recoverable: false)\\`; an optional node ends \\`skipped\\` rather than \\`failed\\`, so the run continues past it. On recoverable failure, call \\`fail_node(..., recoverable: true)\\` and the engine returns the node to \\`available\\`.\n6. When all required nodes are \\`complete\\` or \\`skipped\\`, stop. The runner marks the flow done automatically.\n7. Free-chat user messages do not require flow action. Respond directly, continue flow work, or both — your call.\n`;\n}\n\n/**\n * Render the full prompt sent to a subprompt node's isolated driver instance.\n *\n * `instruction` is already interpolated with the node's resolved bindings\n * (the same `interpolateNodeInstruction` step an agent handoff uses) — this\n * function only adds the typed-response directive when the node declares an\n * output contract. There is no corrective reprompt for a subprompt (it has no\n * conversation to reprompt in), so the directive is the runtime's only lever\n * for getting parseable JSON back; a malformed or non-conforming reply is an\n * ordinary node failure handled by the caller, never retried in-band here.\n *\n * The object-only constraint is therefore stated twice, before and after the\n * schema: the serialized schema is a large blob, so a directive placed only\n * ahead of it is not the last thing the model reads.\n *\n * @docLink packages/factory-assets/flow#render-subprompt-prompt\n */\nexport function renderSubpromptPrompt(\n instruction: string,\n outputSchema: Record<string, unknown> | undefined,\n): string {\n if (!outputSchema) return instruction;\n return `${instruction}\\n\\nRespond with a single JSON object matching this JSON Schema, and nothing else — no markdown code fences, no commentary before or after it:\\n\\n${JSON.stringify(outputSchema, null, 2)}\\n\\nReply with the object only. The first character of your reply must be \\`{\\` and the last must be \\`}\\` — no explanation, no restatement, no code fence.`;\n}\n\n/**\n * Single-line tag suitable for telemetry / logging. Derives a short, stable\n * summary of a stimulus that's safe to attach to spans, log entries, and\n * trace events. The kind is always included; node-specific stimuli also\n * include their `nodeId` so log queries can pivot on it.\n *\n * @docLink packages/factory-assets/flow#describe-stimulus\n */\nexport function describeStimulus(stimulus: TurnStimulus): string {\n switch (stimulus.kind) {\n case \"flow_started\":\n return \"flow_started\";\n case \"approval_received\":\n return `approval_received:${stimulus.nodeId}:${stimulus.decision}`;\n case \"input_received\":\n return `input_received:${stimulus.nodeId}`;\n case \"retry_requested\":\n return `retry_requested:${stimulus.nodeId}`;\n case \"user_message\":\n return `user_message:${stimulus.senderId}`;\n case \"resumed_after_hibernation\":\n return \"resumed_after_hibernation\";\n case \"cancelled\":\n return \"cancelled\";\n case \"state_changed\":\n return \"state_changed\";\n }\n}\n"]}
@@ -1,5 +1,5 @@
1
- import { openLibraryManager, createFullRegistry } from './chunk-ZIC7S44L.js';
2
- import { logErr, logInfo, logWarn, logOk, S } from './chunk-NXUUNPIB.js';
1
+ import { openLibraryManager, createFullRegistry } from './chunk-KBAYZ6DK.js';
2
+ import { logErr, logInfo, logWarn, logOk, S } from './chunk-XDAOECL4.js';
3
3
  import { getStoreManifestsDir, LocalCatalogSource, writeCuratedManifest } from './chunk-OCLCDB7G.js';
4
4
  import { computeDeterministicHash, discoverAssetsInTree } from './chunk-PW4SJE3X.js';
5
5
  import { WorkspaceYamlEditor } from './chunk-AZPXCHDK.js';
@@ -313,12 +313,12 @@ function addSourceManifestCommands(src) {
313
313
  ).option("-C, --project-dir <dir>", "Project directory", process.cwd()).option("--publisher <name>", "Override the publisher (--overwrite only)").option("--dev", "Include assets under the source's dev_paths", false).option("--overwrite", "Discard curation and re-scan the full inventory", false).action((arg, opts) => runRebuild(arg, opts));
314
314
  manifest.command("verify <src>").description("Verify hashes, deps, and schema (read-only)").option("-C, --project-dir <dir>", "Project directory", process.cwd()).option("--strict", "Fail on advisory checks (warnings force a nonzero exit)", false).action((arg, opts) => runVerify(arg, opts));
315
315
  manifest.command("publish <src>").description("Push the curated sidecar manifest and publish it to the store").option("-C, --project-dir <dir>", "Project directory", process.cwd()).option("--as <namespace>", "Publisher namespace (default: your store username)").option("--sidecar-repo <url>", "Public GitHub repo you own to hold the curated manifest").option("--ref <gitref>", "Foreign source ref to ingest (branch/sha; default: main)").option("--dry-run", "Print the publish plan without pushing or calling the store", false).action(async (arg, opts) => {
316
- const { runPublish } = await import('./source-manifest-publish-5TRCSBK7.js');
316
+ const { runPublish } = await import('./source-manifest-publish-KR5MXXGD.js');
317
317
  await runPublish(arg, opts);
318
318
  });
319
319
  manifest.command("propose <src>").description("Open a PR to upstream with the sidecar manifest").action(() => notWired("propose"));
320
320
  manifest.command("yank <src>").description("Retract the source's published assets from the store").option("-C, --project-dir <dir>", "Project directory", process.cwd()).option("--asset <ref>", "Yank only the asset matching this ref/name").action(async (arg, opts) => {
321
- const { runYank } = await import('./source-manifest-publish-5TRCSBK7.js');
321
+ const { runYank } = await import('./source-manifest-publish-KR5MXXGD.js');
322
322
  await runYank(arg, opts);
323
323
  });
324
324
  }
@@ -684,5 +684,5 @@ function makeSourceCommand() {
684
684
  }
685
685
 
686
686
  export { autoSyncForSearch, ensureClone, findCacheKeyCollision, indexingHadFailures, legacySourceConfigHint, makeSourceCommand, normalizeSourceUrl, readProjectSources, resolveSourceArg, sourceClonePath, sourceMatchesKey, syncProjectSources };
687
- //# sourceMappingURL=chunk-R2IQAJSU.js.map
688
- //# sourceMappingURL=chunk-R2IQAJSU.js.map
687
+ //# sourceMappingURL=chunk-4D4N2VFR.js.map
688
+ //# sourceMappingURL=chunk-4D4N2VFR.js.map