patchwork-os 0.2.0-beta.2 → 0.2.0-beta.3

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 (135) hide show
  1. package/README.bridge.md +5 -5
  2. package/README.md +156 -12
  3. package/dist/activityLog.d.ts +6 -0
  4. package/dist/activityLog.js +8 -0
  5. package/dist/activityLog.js.map +1 -1
  6. package/dist/analyticsPrefs.d.ts +35 -2
  7. package/dist/analyticsPrefs.js +120 -21
  8. package/dist/analyticsPrefs.js.map +1 -1
  9. package/dist/analyticsSend.js +5 -1
  10. package/dist/analyticsSend.js.map +1 -1
  11. package/dist/bridge.d.ts +2 -0
  12. package/dist/bridge.js +111 -7
  13. package/dist/bridge.js.map +1 -1
  14. package/dist/bridgeLockDiscovery.d.ts +27 -1
  15. package/dist/bridgeLockDiscovery.js +37 -11
  16. package/dist/bridgeLockDiscovery.js.map +1 -1
  17. package/dist/commands/patchworkInit.d.ts +5 -0
  18. package/dist/commands/patchworkInit.js +86 -7
  19. package/dist/commands/patchworkInit.js.map +1 -1
  20. package/dist/commands/recipe.d.ts +51 -0
  21. package/dist/commands/recipe.js +353 -2
  22. package/dist/commands/recipe.js.map +1 -1
  23. package/dist/commands/recipeInstall.js +6 -3
  24. package/dist/commands/recipeInstall.js.map +1 -1
  25. package/dist/commands/task.js +2 -2
  26. package/dist/commands/task.js.map +1 -1
  27. package/dist/config.d.ts +9 -2
  28. package/dist/config.js +35 -17
  29. package/dist/config.js.map +1 -1
  30. package/dist/connectors/tokenStorage.js +46 -10
  31. package/dist/connectors/tokenStorage.js.map +1 -1
  32. package/dist/featureFlags.d.ts +76 -0
  33. package/dist/featureFlags.js +166 -2
  34. package/dist/featureFlags.js.map +1 -1
  35. package/dist/index.js +765 -69
  36. package/dist/index.js.map +1 -1
  37. package/dist/lockfile.js +4 -1
  38. package/dist/lockfile.js.map +1 -1
  39. package/dist/patchworkConfig.js +5 -0
  40. package/dist/patchworkConfig.js.map +1 -1
  41. package/dist/recipeOrchestration.js +35 -1
  42. package/dist/recipeOrchestration.js.map +1 -1
  43. package/dist/recipeRoutes.d.ts +36 -0
  44. package/dist/recipeRoutes.js +231 -32
  45. package/dist/recipeRoutes.js.map +1 -1
  46. package/dist/recipes/agentExecutor.d.ts +25 -5
  47. package/dist/recipes/agentExecutor.js.map +1 -1
  48. package/dist/recipes/chainedRunner.js +16 -2
  49. package/dist/recipes/chainedRunner.js.map +1 -1
  50. package/dist/recipes/connectorPreflight.d.ts +53 -0
  51. package/dist/recipes/connectorPreflight.js +79 -0
  52. package/dist/recipes/connectorPreflight.js.map +1 -0
  53. package/dist/recipes/githubInstallSource.d.ts +62 -0
  54. package/dist/recipes/githubInstallSource.js +125 -0
  55. package/dist/recipes/githubInstallSource.js.map +1 -0
  56. package/dist/recipes/haltCategory.d.ts +80 -0
  57. package/dist/recipes/haltCategory.js +125 -0
  58. package/dist/recipes/haltCategory.js.map +1 -0
  59. package/dist/recipes/idempotencyKey.d.ts +126 -0
  60. package/dist/recipes/idempotencyKey.js +298 -0
  61. package/dist/recipes/idempotencyKey.js.map +1 -0
  62. package/dist/recipes/judgeSummary.d.ts +50 -0
  63. package/dist/recipes/judgeSummary.js +47 -0
  64. package/dist/recipes/judgeSummary.js.map +1 -0
  65. package/dist/recipes/judgeVerdict.d.ts +48 -0
  66. package/dist/recipes/judgeVerdict.js +174 -0
  67. package/dist/recipes/judgeVerdict.js.map +1 -0
  68. package/dist/recipes/migrations/index.d.ts +9 -0
  69. package/dist/recipes/migrations/index.js +133 -0
  70. package/dist/recipes/migrations/index.js.map +1 -1
  71. package/dist/recipes/runBudget.d.ts +70 -0
  72. package/dist/recipes/runBudget.js +109 -0
  73. package/dist/recipes/runBudget.js.map +1 -0
  74. package/dist/recipes/scheduler.js +1 -1
  75. package/dist/recipes/scheduler.js.map +1 -1
  76. package/dist/recipes/schema.d.ts +30 -0
  77. package/dist/recipes/toolRegistry.js +19 -0
  78. package/dist/recipes/toolRegistry.js.map +1 -1
  79. package/dist/recipes/tools/http.d.ts +10 -0
  80. package/dist/recipes/tools/http.js +176 -0
  81. package/dist/recipes/tools/http.js.map +1 -0
  82. package/dist/recipes/tools/index.d.ts +1 -0
  83. package/dist/recipes/tools/index.js +1 -0
  84. package/dist/recipes/tools/index.js.map +1 -1
  85. package/dist/recipes/validation.js +1 -1
  86. package/dist/recipes/validation.js.map +1 -1
  87. package/dist/recipes/yamlRunner.d.ts +71 -7
  88. package/dist/recipes/yamlRunner.js +156 -22
  89. package/dist/recipes/yamlRunner.js.map +1 -1
  90. package/dist/runLog.d.ts +28 -0
  91. package/dist/runLog.js +5 -0
  92. package/dist/runLog.js.map +1 -1
  93. package/dist/server.d.ts +65 -0
  94. package/dist/server.js +302 -3
  95. package/dist/server.js.map +1 -1
  96. package/dist/streamableHttp.js +17 -6
  97. package/dist/streamableHttp.js.map +1 -1
  98. package/dist/tools/bridgeDoctor.js +6 -2
  99. package/dist/tools/bridgeDoctor.js.map +1 -1
  100. package/dist/tools/ccRoutines.d.ts +221 -0
  101. package/dist/tools/ccRoutines.js +264 -0
  102. package/dist/tools/ccRoutines.js.map +1 -0
  103. package/dist/tools/getCodeCoverage.js +7 -3
  104. package/dist/tools/getCodeCoverage.js.map +1 -1
  105. package/dist/tools/index.js +6 -0
  106. package/dist/tools/index.js.map +1 -1
  107. package/dist/tools/recentTracesDigest.js +56 -11
  108. package/dist/tools/recentTracesDigest.js.map +1 -1
  109. package/dist/tools/testRunners/vitestJest.js +3 -1
  110. package/dist/tools/testRunners/vitestJest.js.map +1 -1
  111. package/dist/tools/utils.js +6 -3
  112. package/dist/tools/utils.js.map +1 -1
  113. package/package.json +17 -6
  114. package/scripts/postinstall.mjs +27 -0
  115. package/scripts/smoke/run-all.mjs +162 -0
  116. package/scripts/start-all.mjs +513 -0
  117. package/scripts/start-all.ps1 +209 -0
  118. package/scripts/start-all.sh +73 -17
  119. package/scripts/start-orchestrator.ps1 +158 -0
  120. package/scripts/start-remote.mjs +122 -0
  121. package/templates/automation-policies/recipe-authoring.json +1 -1
  122. package/templates/automation-policies/security-first.json +1 -1
  123. package/templates/automation-policies/strict-lint.json +1 -1
  124. package/templates/automation-policies/test-driven.json +1 -1
  125. package/templates/automation-policy.example.json +1 -1
  126. package/templates/co.patchwork-os.bridge.plist +1 -1
  127. package/templates/recipes/approval-queue-ui-test.yaml +1 -1
  128. package/templates/recipes/ctx-loop-test.yaml +1 -1
  129. package/templates/recipes/webhook/apple-watch-health-log.yaml +145 -0
  130. package/dist/commands/marketplace.d.ts +0 -16
  131. package/dist/commands/marketplace.js +0 -32
  132. package/dist/commands/marketplace.js.map +0 -1
  133. package/dist/recipes/legacyRecipeCompat.d.ts +0 -10
  134. package/dist/recipes/legacyRecipeCompat.js +0 -131
  135. package/dist/recipes/legacyRecipeCompat.js.map +0 -1
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "_comment": "Example automation policy with LSP-aware prompts. Copy to automation-policy.json and adjust as needed.",
3
- "_usage": "Start bridge with: claude-ide-bridge --automation --automation-policy ./automation-policy.json --claude-driver subprocess",
3
+ "_usage": "Start bridge with: claude-ide-bridge --automation --automation-policy ./automation-policy.json --driver subprocess",
4
4
 
5
5
  "onFileChanged": {
6
6
  "enabled": true,
@@ -8,7 +8,7 @@
8
8
  <key>ProgramArguments</key>
9
9
  <array>
10
10
  <string>__BINARY_PATH__</string>
11
- <string>--claude-driver</string>
11
+ <string>--driver</string>
12
12
  <string>subprocess</string>
13
13
  </array>
14
14
  <key>RunAtLoad</key>
@@ -19,7 +19,7 @@ description: |
19
19
  Keyboard — J / K (focus), E / X (decide)
20
20
 
21
21
  PREREQUISITES
22
- 1. Bridge running with --claude-driver subprocess so the agent has MCP
22
+ 1. Bridge running with --driver subprocess so the agent has MCP
23
23
  access to the Playwright server.
24
24
  2. Dashboard reachable at DASHBOARD_URL (defaults to localhost:3000;
25
25
  Patchwork's Next.js dev typically mounts under /dashboard, so the
@@ -5,7 +5,7 @@ description: |
5
5
  appears in the result. Output lands in ~/.patchwork/inbox/ for manual inspection.
6
6
  Run this after deploying a new bridge build to confirm the memory moat is live.
7
7
 
8
- NOTE: requires --claude-driver subprocess and a running bridge with HTTP port
8
+ NOTE: requires --driver subprocess and a running bridge with HTTP port
9
9
  so the agent subprocess has MCP access. Running via `patchwork recipe run`
10
10
  (local yamlRunner) will fail at Step 1 — the local claude -p subprocess has
11
11
  no bridge MCP context. Trigger from the dashboard Recipes page instead.
@@ -0,0 +1,145 @@
1
+ apiVersion: patchwork.sh/v1
2
+ name: apple-watch-health-log
3
+ description: |
4
+ Logs Apple Watch sleep duration, quality, and activity rings from an iOS
5
+ Shortcut. Each fire writes a daily journal entry, generates a warm AI Coach
6
+ insight (Fitbit-Gemini style) via Claude, appends the insight to the
7
+ journal, and pushes it to your phone via ntfy.sh. Two conditional nudges
8
+ fire only when the payload looks off:
9
+
10
+ - "Short night" — separate priority-5 push when sleep_hours_under_6 is set
11
+ - "Watch off your wrist" — different topic when move_percent is 0
12
+
13
+ Conditional steps are gated by `when:` and read precomputed boolean fields
14
+ from the iOS Shortcut payload (template substitution can't do arithmetic).
15
+
16
+ Suggested triggers:
17
+ - iOS Shortcut ("Log my watch" — pulls Health stats + POSTs JSON)
18
+ - Stream Deck button for manual end-of-day log
19
+ - NFC tag on your nightstand
20
+ - curl from any device that can POST HTTP
21
+
22
+ Payload conventions (all optional — missing fields render blank):
23
+ sleep_hours numeric, e.g. 7.4
24
+ sleep_quality "deep" | "restful" | "light" | "restless" | free text
25
+ sleep_hours_under_6 "1" if sleep_hours < 6 (Shortcut precomputes)
26
+ move_percent 0-100+ (rings can exceed 100%)
27
+ move_percent_zero "1" if move_percent == 0 (likely watch was off)
28
+ move_calories active kcal burned
29
+ exercise_percent 0-100+
30
+ exercise_min exercise minutes recorded
31
+ stand_percent 0-100+
32
+ notes free-form journal text
33
+
34
+ Setup:
35
+ 1. Replace NTFY_TOPIC, NTFY_NUDGE_TOPIC, and NTFY_ALERT_TOPIC with your
36
+ own unguessable ntfy topics and subscribe to all three in the app.
37
+ 2. Drop this file in ~/.patchwork/recipes/.
38
+ 3. Start the bridge with `--driver subprocess` so /hooks/* is live.
39
+
40
+ Example request:
41
+ curl -X POST http://localhost:3101/hooks/apple-watch-health \
42
+ -H 'Content-Type: application/json' \
43
+ -d '{"sleep_hours":7.4,"sleep_quality":"restful","move_percent":112,"move_calories":645,"exercise_percent":150,"exercise_min":45,"stand_percent":100,"notes":"Closed all three rings."}'
44
+
45
+ trigger:
46
+ type: webhook
47
+ path: /apple-watch-health
48
+
49
+ steps:
50
+ - id: write_journal
51
+ tool: file.append
52
+ path: ~/.patchwork/health-journal/{{date}}.md
53
+ content: |
54
+ ## {{date}} Apple Watch Summary
55
+
56
+ ```
57
+ SLEEP {{payload.sleep_hours}}h {{payload.sleep_quality}}
58
+ MOVE {{payload.move_percent}}% {{payload.move_calories}} kcal
59
+ EXER {{payload.exercise_percent}}% {{payload.exercise_min}} min
60
+ STAND {{payload.stand_percent}}%
61
+ NOTE {{payload.notes}}
62
+ ```
63
+
64
+ ---
65
+
66
+ - id: coach_insight
67
+ agent:
68
+ driver: claude-code
69
+ model: claude-haiku-4-5-20251001
70
+ into: insight
71
+ prompt: |
72
+ Read the Apple Watch numbers below and write a short, warm coaching note in the voice of a friend who knows health data well. The tone should celebrate something specific, name one pattern, and end with one small doable tip for today. No preamble, no markdown headers, no bullets, no sign-off, no emojis. Plain prose, 80-150 words, 2-3 short paragraphs.
73
+
74
+ Hard rules (response is rejected if any are broken):
75
+ - Anchor every compliment in a number from the data. No generic "great job".
76
+ - Never lecture, never list ideal ranges, never use clinical jargon.
77
+ - Never start with "Sure," "Here's," "Of course," or any preamble.
78
+ - End with one concrete tip for today, framed as a tiny win — not a lifestyle overhaul.
79
+
80
+ Tone reference (match the register, not the content):
81
+
82
+ Hey there. Your sleep performance hit 87/100 last night — solid 7 hours 45 minutes with a nice chunk of deep sleep. Recovery is looking strong at 82/100 thanks to that solid HRV of 62 ms. The pattern I notice: when you wrap exercise before 6pm your sleep lands in the high 80s pretty reliably. One small win for today: try wrapping up screens 30 minutes earlier tonight. You've got this.
83
+
84
+ Apple Watch numbers for today:
85
+ Sleep: {{payload.sleep_hours}} hours, {{payload.sleep_quality}}
86
+ Move ring: {{payload.move_percent}}% closed, {{payload.move_calories}} active calories
87
+ Exercise ring: {{payload.exercise_percent}}% closed, {{payload.exercise_min}} minutes
88
+ Stand ring: {{payload.stand_percent}}% closed
89
+ User's notes for the day: {{payload.notes}}
90
+
91
+ Write the coaching note now. Output only the prose, nothing else.
92
+ silentFailDetection: false
93
+
94
+ - id: append_insight
95
+ tool: file.append
96
+ when: "{{insight}}"
97
+ path: ~/.patchwork/health-journal/{{date}}.md
98
+ content: |
99
+ ### Coach's note
100
+
101
+ {{insight}}
102
+
103
+ ---
104
+
105
+ - id: push_to_phone
106
+ tool: http.post
107
+ when: "{{insight}}"
108
+ url: https://ntfy.sh/NTFY_TOPIC
109
+ contentType: text/plain
110
+ headers:
111
+ Title: "{{date}} - the body report"
112
+ Tags: watch,zzz,fire
113
+ body: |
114
+ {{insight}}
115
+
116
+ # Fires only when payload.sleep_hours_under_6 is truthy ("1", "true", etc.)
117
+ - id: short_night_nudge
118
+ tool: http.post
119
+ when: "{{payload.sleep_hours_under_6}}"
120
+ url: https://ntfy.sh/NTFY_NUDGE_TOPIC
121
+ contentType: text/plain
122
+ headers:
123
+ Title: Short night - go easy today
124
+ Tags: sleeping_face,warning
125
+ Priority: "5"
126
+ body: |
127
+ You logged {{payload.sleep_hours}}h ({{payload.sleep_quality}}).
128
+ No PR attempts. Hydrate. Move at half-throttle.
129
+
130
+ # Fires only when payload.move_percent_zero is truthy — likely the watch
131
+ # was off your wrist all day, not that you genuinely moved 0%.
132
+ - id: watch_off_alert
133
+ tool: http.post
134
+ when: "{{payload.move_percent_zero}}"
135
+ url: https://ntfy.sh/NTFY_ALERT_TOPIC
136
+ contentType: text/plain
137
+ headers:
138
+ Title: Watch reported 0% move
139
+ Tags: warning,watch
140
+ body: |
141
+ Move ring at 0% for {{date}}. Battery dead? Forgot the watch?
142
+ Today's journal entry may not reflect actual activity.
143
+
144
+ output:
145
+ path: ~/.patchwork/health-journal/{{date}}.md
@@ -1,16 +0,0 @@
1
- /**
2
- * `patchwork marketplace` — DEPRECATED.
3
- *
4
- * This subcommand previously fetched a hand-curated registry of "skills" and
5
- * shelled out to `npm install -g <skill-package>`. As of 0.2.0-beta.0 the
6
- * registry contained only built-in skills that already ship inside the bridge,
7
- * pointed at a stale npm package name (`claude-ide-bridge`, not
8
- * `patchwork-os`), and had zero third-party authors. See issue #279 for the
9
- * decision rationale.
10
- *
11
- * The stub is preserved (rather than removed wholesale) so anyone with tooling
12
- * that calls `patchwork marketplace …` gets a clear migration message instead
13
- * of a "unknown subcommand" error. It will be removed in a future major
14
- * release.
15
- */
16
- export declare function runMarketplace(argv: string[]): Promise<void>;
@@ -1,32 +0,0 @@
1
- /**
2
- * `patchwork marketplace` — DEPRECATED.
3
- *
4
- * This subcommand previously fetched a hand-curated registry of "skills" and
5
- * shelled out to `npm install -g <skill-package>`. As of 0.2.0-beta.0 the
6
- * registry contained only built-in skills that already ship inside the bridge,
7
- * pointed at a stale npm package name (`claude-ide-bridge`, not
8
- * `patchwork-os`), and had zero third-party authors. See issue #279 for the
9
- * decision rationale.
10
- *
11
- * The stub is preserved (rather than removed wholesale) so anyone with tooling
12
- * that calls `patchwork marketplace …` gets a clear migration message instead
13
- * of a "unknown subcommand" error. It will be removed in a future major
14
- * release.
15
- */
16
- const DEPRECATION_MESSAGE = `The 'marketplace' command is deprecated and no longer maintained.
17
-
18
- Built-in skills (tdd-loop, ide-coverage, ide-diagnostics-board, ide-explore,
19
- ide-deps) ship inside the bridge package — no installation needed.
20
-
21
- For community content, use the recipe-bundle install path instead:
22
- patchwork recipe install github:<org>/<repo>
23
-
24
- To discover plugins on npm:
25
- npm search keywords:claude-ide-bridge-plugin
26
-
27
- This subcommand will be removed in a future major release. See issue #279.`;
28
- export async function runMarketplace(argv) {
29
- void argv; // intentionally ignored — every subcommand prints the same notice
30
- console.log(DEPRECATION_MESSAGE);
31
- }
32
- //# sourceMappingURL=marketplace.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"marketplace.js","sourceRoot":"","sources":["../../src/commands/marketplace.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,MAAM,mBAAmB,GAAG;;;;;;;;;;;2EAW+C,CAAC;AAE5E,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,IAAc;IACjD,KAAK,IAAI,CAAC,CAAC,kEAAkE;IAC7E,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC;AACnC,CAAC"}
@@ -1,10 +0,0 @@
1
- export type WarnFn = (msg: string) => void;
2
- /**
3
- * Default deprecation-warning sink for the runtime/validation/fmt callers.
4
- * Forwards to `console.warn` outside of tests so users see migration
5
- * prompts in CLI output, but stays silent under vitest so the dozens of
6
- * intentional legacy-shape regression fixtures don't flood stderr. Tests
7
- * that need to assert warnings still pass their own `vi.fn()` directly.
8
- */
9
- export declare const defaultDeprecationWarn: WarnFn;
10
- export declare function normalizeRecipeForRuntime(recipe: unknown, warn?: WarnFn): unknown;
@@ -1,131 +0,0 @@
1
- import { migrateRecipeToCurrent } from "./migrations/index.js";
2
- function isRecord(value) {
3
- return typeof value === "object" && value !== null && !Array.isArray(value);
4
- }
5
- /**
6
- * Default deprecation-warning sink for the runtime/validation/fmt callers.
7
- * Forwards to `console.warn` outside of tests so users see migration
8
- * prompts in CLI output, but stays silent under vitest so the dozens of
9
- * intentional legacy-shape regression fixtures don't flood stderr. Tests
10
- * that need to assert warnings still pass their own `vi.fn()` directly.
11
- */
12
- export const defaultDeprecationWarn = (msg) => {
13
- if (process.env.VITEST || process.env.NODE_ENV === "test")
14
- return;
15
- console.warn(msg);
16
- };
17
- export function normalizeRecipeForRuntime(recipe, warn) {
18
- if (!isRecord(recipe)) {
19
- return recipe;
20
- }
21
- // Apply apiVersion migrations first so downstream field-level
22
- // legacy compat operates on a recipe stamped with the current
23
- // apiVersion (and so the deprecation warning for missing
24
- // apiVersion fires once per call).
25
- const migrated = migrateRecipeToCurrent(recipe, warn).recipe;
26
- const source = isRecord(migrated) ? migrated : recipe;
27
- const normalized = {
28
- ...source,
29
- };
30
- if (isRecord(normalized.trigger)) {
31
- normalized.trigger = normalizeLegacyTriggerForRuntime(normalized.trigger, warn);
32
- }
33
- if (Array.isArray(normalized.steps)) {
34
- normalized.steps = normalized.steps.map((step) => normalizeLegacyRuntimeStep(step, warn));
35
- }
36
- return normalized;
37
- }
38
- function normalizeLegacyTriggerForRuntime(trigger, warn) {
39
- const normalized = { ...trigger };
40
- if (normalized.type === "cron" &&
41
- typeof normalized.schedule === "string" &&
42
- typeof normalized.at !== "string") {
43
- warn?.("Deprecated recipe field: trigger.schedule — rename to trigger.at (will be removed in a future major version)");
44
- normalized.at = normalized.schedule;
45
- }
46
- delete normalized.schedule;
47
- return normalized;
48
- }
49
- function normalizeLegacyRuntimeStep(step, warn) {
50
- if (!isRecord(step)) {
51
- return step;
52
- }
53
- const normalized = {};
54
- for (const [key, value] of Object.entries(step)) {
55
- if (key === "params" || key === "output" || key === "prompt") {
56
- continue;
57
- }
58
- if (key === "agent" && typeof value === "boolean") {
59
- continue;
60
- }
61
- if (key === "parallel" && Array.isArray(value)) {
62
- normalized.parallel = value.map((entry) => normalizeLegacyRuntimeStep(entry, warn));
63
- continue;
64
- }
65
- if (key === "branch" && Array.isArray(value)) {
66
- normalized.branch = value.map((entry) => normalizeLegacyBranchEntry(entry, warn));
67
- continue;
68
- }
69
- normalized[key] = value;
70
- }
71
- if (step.agent === true || isRecord(step.agent)) {
72
- const agentConfig = isRecord(step.agent)
73
- ? { ...step.agent }
74
- : {};
75
- if (typeof step.prompt === "string" &&
76
- typeof agentConfig.prompt !== "string") {
77
- warn?.("Deprecated recipe step field: prompt at step level — move to step.agent.prompt (will be removed in a future major version)");
78
- agentConfig.prompt = step.prompt;
79
- }
80
- if (typeof step.output === "string" &&
81
- typeof agentConfig.into !== "string") {
82
- warn?.("Deprecated recipe step field: output — use step.agent.into instead (will be removed in a future major version)");
83
- agentConfig.into = step.output;
84
- }
85
- if (step.agent === true) {
86
- warn?.("Deprecated recipe step field: agent: true — use agent: { prompt, into } object instead (will be removed in a future major version)");
87
- }
88
- normalized.agent = agentConfig;
89
- return normalized;
90
- }
91
- if (isRecord(step.params)) {
92
- warn?.("Deprecated recipe step field: params — inline fields directly on the step (will be removed in a future major version)");
93
- Object.assign(normalized, step.params);
94
- }
95
- if (typeof normalized.recipe !== "string" &&
96
- typeof normalized.chain === "string") {
97
- warn?.("Deprecated recipe step field: chain — rename to recipe (will be removed in a future major version)");
98
- normalized.recipe = normalized.chain;
99
- }
100
- delete normalized.chain;
101
- if (typeof normalized.into !== "string" && typeof step.output === "string") {
102
- warn?.("Deprecated recipe step field: output — rename to into (will be removed in a future major version)");
103
- normalized.into = step.output;
104
- }
105
- if (normalized.tool === "file.append" &&
106
- typeof normalized.content !== "string" &&
107
- typeof normalized.line === "string") {
108
- warn?.("Deprecated recipe step field: line (file.append) — rename to content (will be removed in a future major version)");
109
- normalized.content = normalized.line;
110
- delete normalized.line;
111
- }
112
- return normalized;
113
- }
114
- function normalizeLegacyBranchEntry(entry, warn) {
115
- if (!isRecord(entry)) {
116
- return entry;
117
- }
118
- const normalized = {};
119
- for (const [key, value] of Object.entries(entry)) {
120
- if (key === "otherwise" && isRecord(value)) {
121
- normalized.otherwise = normalizeLegacyRuntimeStep(value, warn);
122
- continue;
123
- }
124
- normalized[key] = value;
125
- }
126
- if (Object.hasOwn(normalized, "otherwise")) {
127
- return normalized;
128
- }
129
- return normalizeLegacyRuntimeStep(entry, warn);
130
- }
131
- //# sourceMappingURL=legacyRecipeCompat.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"legacyRecipeCompat.js","sourceRoot":"","sources":["../../src/recipes/legacyRecipeCompat.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sB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