@tagma/sdk 0.7.3 → 0.7.5

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 (230) hide show
  1. package/README.md +85 -57
  2. package/dist/approval.d.ts +2 -12
  3. package/dist/approval.d.ts.map +1 -1
  4. package/dist/approval.js +1 -90
  5. package/dist/approval.js.map +1 -1
  6. package/dist/bootstrap.d.ts +1 -1
  7. package/dist/bootstrap.d.ts.map +1 -1
  8. package/dist/completions/file-exists.js +1 -1
  9. package/dist/completions/file-exists.js.map +1 -1
  10. package/dist/completions/output-check.d.ts.map +1 -1
  11. package/dist/completions/output-check.js +17 -4
  12. package/dist/completions/output-check.js.map +1 -1
  13. package/dist/config.d.ts +4 -4
  14. package/dist/config.d.ts.map +1 -1
  15. package/dist/config.js +2 -2
  16. package/dist/config.js.map +1 -1
  17. package/dist/dataflow.d.ts +3 -0
  18. package/dist/dataflow.d.ts.map +1 -0
  19. package/dist/dataflow.js +2 -0
  20. package/dist/dataflow.js.map +1 -0
  21. package/dist/drivers/opencode.d.ts.map +1 -1
  22. package/dist/drivers/opencode.js +23 -71
  23. package/dist/drivers/opencode.js.map +1 -1
  24. package/dist/engine.d.ts +5 -56
  25. package/dist/engine.d.ts.map +1 -1
  26. package/dist/engine.js +7 -297
  27. package/dist/engine.js.map +1 -1
  28. package/dist/index.d.ts +4 -6
  29. package/dist/index.d.ts.map +1 -1
  30. package/dist/index.js +2 -4
  31. package/dist/index.js.map +1 -1
  32. package/dist/logger.d.ts +2 -60
  33. package/dist/logger.d.ts.map +1 -1
  34. package/dist/logger.js +1 -153
  35. package/dist/logger.js.map +1 -1
  36. package/dist/middlewares/static-context.d.ts.map +1 -1
  37. package/dist/middlewares/static-context.js +1 -2
  38. package/dist/middlewares/static-context.js.map +1 -1
  39. package/dist/pipeline-runner.d.ts.map +1 -1
  40. package/dist/pipeline-runner.js +2 -2
  41. package/dist/pipeline-runner.js.map +1 -1
  42. package/dist/plugins.d.ts +2 -2
  43. package/dist/plugins.d.ts.map +1 -1
  44. package/dist/plugins.js +1 -1
  45. package/dist/plugins.js.map +1 -1
  46. package/dist/runner.d.ts +1 -35
  47. package/dist/runner.d.ts.map +1 -1
  48. package/dist/runner.js +1 -610
  49. package/dist/runner.js.map +1 -1
  50. package/dist/runtime/adapters/stdin-approval.d.ts +2 -0
  51. package/dist/runtime/adapters/stdin-approval.d.ts.map +1 -0
  52. package/dist/runtime/adapters/stdin-approval.js +2 -0
  53. package/dist/runtime/adapters/stdin-approval.js.map +1 -0
  54. package/dist/runtime/adapters/websocket-approval.d.ts +2 -0
  55. package/dist/runtime/adapters/websocket-approval.d.ts.map +1 -0
  56. package/dist/runtime/adapters/websocket-approval.js +2 -0
  57. package/dist/runtime/adapters/websocket-approval.js.map +1 -0
  58. package/dist/runtime/bun-process-runner.d.ts +2 -0
  59. package/dist/runtime/bun-process-runner.d.ts.map +1 -0
  60. package/dist/runtime/bun-process-runner.js +2 -0
  61. package/dist/runtime/bun-process-runner.js.map +1 -0
  62. package/dist/runtime.d.ts +2 -8
  63. package/dist/runtime.d.ts.map +1 -1
  64. package/dist/runtime.js +1 -7
  65. package/dist/runtime.js.map +1 -1
  66. package/dist/schema.d.ts.map +1 -1
  67. package/dist/schema.js +3 -4
  68. package/dist/schema.js.map +1 -1
  69. package/dist/tagma.d.ts +3 -4
  70. package/dist/tagma.d.ts.map +1 -1
  71. package/dist/tagma.js +2 -3
  72. package/dist/tagma.js.map +1 -1
  73. package/dist/triggers/file.d.ts.map +1 -1
  74. package/dist/triggers/file.js +74 -108
  75. package/dist/triggers/file.js.map +1 -1
  76. package/dist/triggers/manual.d.ts.map +1 -1
  77. package/dist/triggers/manual.js +1 -2
  78. package/dist/triggers/manual.js.map +1 -1
  79. package/dist/types.d.ts +1 -2
  80. package/dist/types.d.ts.map +1 -1
  81. package/dist/types.js +1 -12
  82. package/dist/types.js.map +1 -1
  83. package/dist/utils-api.d.ts +1 -1
  84. package/dist/utils-api.d.ts.map +1 -1
  85. package/dist/utils-api.js +1 -1
  86. package/dist/utils-api.js.map +1 -1
  87. package/dist/validate-raw.d.ts.map +1 -1
  88. package/dist/validate-raw.js +5 -12
  89. package/dist/validate-raw.js.map +1 -1
  90. package/package.json +20 -22
  91. package/dist/adapters/stdin-approval.d.ts +0 -6
  92. package/dist/adapters/stdin-approval.d.ts.map +0 -1
  93. package/dist/adapters/stdin-approval.js +0 -90
  94. package/dist/adapters/stdin-approval.js.map +0 -1
  95. package/dist/adapters/websocket-approval.d.ts +0 -28
  96. package/dist/adapters/websocket-approval.d.ts.map +0 -1
  97. package/dist/adapters/websocket-approval.js +0 -147
  98. package/dist/adapters/websocket-approval.js.map +0 -1
  99. package/dist/core/dataflow.d.ts +0 -23
  100. package/dist/core/dataflow.d.ts.map +0 -1
  101. package/dist/core/dataflow.js +0 -99
  102. package/dist/core/dataflow.js.map +0 -1
  103. package/dist/core/log-prune.d.ts +0 -16
  104. package/dist/core/log-prune.d.ts.map +0 -1
  105. package/dist/core/log-prune.js +0 -34
  106. package/dist/core/log-prune.js.map +0 -1
  107. package/dist/core/preflight.d.ts +0 -13
  108. package/dist/core/preflight.d.ts.map +0 -1
  109. package/dist/core/preflight.js +0 -61
  110. package/dist/core/preflight.js.map +0 -1
  111. package/dist/core/run-context.d.ts +0 -55
  112. package/dist/core/run-context.d.ts.map +0 -1
  113. package/dist/core/run-context.js +0 -158
  114. package/dist/core/run-context.js.map +0 -1
  115. package/dist/core/run-state.d.ts +0 -25
  116. package/dist/core/run-state.d.ts.map +0 -1
  117. package/dist/core/run-state.js +0 -93
  118. package/dist/core/run-state.js.map +0 -1
  119. package/dist/core/scheduler.d.ts +0 -13
  120. package/dist/core/scheduler.d.ts.map +0 -1
  121. package/dist/core/scheduler.js +0 -35
  122. package/dist/core/scheduler.js.map +0 -1
  123. package/dist/core/task-executor.d.ts +0 -13
  124. package/dist/core/task-executor.d.ts.map +0 -1
  125. package/dist/core/task-executor.js +0 -601
  126. package/dist/core/task-executor.js.map +0 -1
  127. package/dist/core/trigger-errors.d.ts +0 -9
  128. package/dist/core/trigger-errors.d.ts.map +0 -1
  129. package/dist/core/trigger-errors.js +0 -15
  130. package/dist/core/trigger-errors.js.map +0 -1
  131. package/dist/dag.d.ts +0 -45
  132. package/dist/dag.d.ts.map +0 -1
  133. package/dist/dag.js +0 -177
  134. package/dist/dag.js.map +0 -1
  135. package/dist/hooks.d.ts +0 -73
  136. package/dist/hooks.d.ts.map +0 -1
  137. package/dist/hooks.js +0 -106
  138. package/dist/hooks.js.map +0 -1
  139. package/dist/pipeline-definition.d.ts +0 -3
  140. package/dist/pipeline-definition.d.ts.map +0 -1
  141. package/dist/pipeline-definition.js +0 -4
  142. package/dist/pipeline-definition.js.map +0 -1
  143. package/dist/ports.d.ts +0 -196
  144. package/dist/ports.d.ts.map +0 -1
  145. package/dist/ports.js +0 -688
  146. package/dist/ports.js.map +0 -1
  147. package/dist/prompt-doc.d.ts +0 -70
  148. package/dist/prompt-doc.d.ts.map +0 -1
  149. package/dist/prompt-doc.js +0 -154
  150. package/dist/prompt-doc.js.map +0 -1
  151. package/dist/registry.d.ts +0 -67
  152. package/dist/registry.d.ts.map +0 -1
  153. package/dist/registry.js +0 -293
  154. package/dist/registry.js.map +0 -1
  155. package/dist/task-ref.d.ts +0 -55
  156. package/dist/task-ref.d.ts.map +0 -1
  157. package/dist/task-ref.js +0 -103
  158. package/dist/task-ref.js.map +0 -1
  159. package/dist/utils.d.ts +0 -13
  160. package/dist/utils.d.ts.map +0 -1
  161. package/dist/utils.js +0 -177
  162. package/dist/utils.js.map +0 -1
  163. package/src/adapters/stdin-approval.ts +0 -106
  164. package/src/adapters/websocket-approval.ts +0 -224
  165. package/src/approval.ts +0 -131
  166. package/src/bootstrap.ts +0 -55
  167. package/src/completions/exit-code.ts +0 -34
  168. package/src/completions/file-exists.ts +0 -66
  169. package/src/completions/output-check.test.ts +0 -50
  170. package/src/completions/output-check.ts +0 -92
  171. package/src/config-ops.test.ts +0 -70
  172. package/src/config-ops.ts +0 -328
  173. package/src/config.ts +0 -26
  174. package/src/core/dataflow.test.ts +0 -166
  175. package/src/core/dataflow.ts +0 -161
  176. package/src/core/log-prune.test.ts +0 -58
  177. package/src/core/log-prune.ts +0 -43
  178. package/src/core/preflight.test.ts +0 -49
  179. package/src/core/preflight.ts +0 -89
  180. package/src/core/run-context.test.ts +0 -256
  181. package/src/core/run-context.ts +0 -211
  182. package/src/core/run-state.test.ts +0 -98
  183. package/src/core/run-state.ts +0 -122
  184. package/src/core/scheduler.test.ts +0 -83
  185. package/src/core/scheduler.ts +0 -42
  186. package/src/core/task-executor.ts +0 -743
  187. package/src/core/trigger-errors.ts +0 -15
  188. package/src/dag.test.ts +0 -56
  189. package/src/dag.ts +0 -245
  190. package/src/drivers/opencode.ts +0 -410
  191. package/src/engine-ports-mixed.test.ts +0 -156
  192. package/src/engine-ports.test.ts +0 -166
  193. package/src/engine-task-type.test.ts +0 -56
  194. package/src/engine.ts +0 -458
  195. package/src/hooks.ts +0 -193
  196. package/src/index.ts +0 -33
  197. package/src/logger.ts +0 -182
  198. package/src/middlewares/static-context.ts +0 -49
  199. package/src/pipeline-definition.ts +0 -5
  200. package/src/pipeline-runner.test.ts +0 -91
  201. package/src/pipeline-runner.ts +0 -194
  202. package/src/plugin-registry.test.ts +0 -382
  203. package/src/plugins.ts +0 -21
  204. package/src/ports.test.ts +0 -678
  205. package/src/ports.ts +0 -925
  206. package/src/prompt-doc.test.ts +0 -174
  207. package/src/prompt-doc.ts +0 -169
  208. package/src/registry.ts +0 -353
  209. package/src/runner.test.ts +0 -142
  210. package/src/runner.ts +0 -666
  211. package/src/runtime.ts +0 -20
  212. package/src/schema-ports.test.ts +0 -172
  213. package/src/schema.test.ts +0 -213
  214. package/src/schema.ts +0 -379
  215. package/src/tagma.test.ts +0 -155
  216. package/src/tagma.ts +0 -62
  217. package/src/task-ref.test.ts +0 -401
  218. package/src/task-ref.ts +0 -121
  219. package/src/triggers/file.ts +0 -164
  220. package/src/triggers/manual.ts +0 -86
  221. package/src/types.ts +0 -18
  222. package/src/utils-api.ts +0 -8
  223. package/src/utils.test.ts +0 -28
  224. package/src/utils.ts +0 -203
  225. package/src/validate-raw-plugin-types.test.ts +0 -60
  226. package/src/validate-raw-ports.test.ts +0 -136
  227. package/src/validate-raw.ts +0 -852
  228. package/src/yaml-compiler.test.ts +0 -108
  229. package/src/yaml-compiler.ts +0 -110
  230. package/src/yaml.ts +0 -11
package/README.md CHANGED
@@ -64,6 +64,8 @@ console.log(result.success ? 'Done' : 'Failed');
64
64
 
65
65
  The package root is intentionally small. Use explicit subpaths for YAML,
66
66
  config editing, plugin registry helpers, and low-level dataflow utilities.
67
+ The SDK composes `@tagma/core` with `@tagma/runtime-bun`; import those packages
68
+ directly only when you need lower-level package boundaries.
67
69
 
68
70
  ## Features
69
71
 
@@ -145,16 +147,16 @@ pipeline:
145
147
 
146
148
  ### Pipeline Fields
147
149
 
148
- | Field | Type | Required | Description |
149
- | --------- | --------------- | -------- | ------------------------------------------------------------------------------------------ |
150
- | `name` | `string` | Yes | Pipeline name, used in logs and run IDs |
151
- | `driver` | `string` | No | Default driver for all tracks/tasks (inherited). Built-in: `opencode` |
152
- | `model` | `string` | No | Default model for all tracks/tasks (inherited). Exact model name, e.g. `claude-sonnet-4-6` |
153
- | `permissions` | `Permissions` | No | Default permissions inherited by all tracks/tasks (see Permissions) |
154
- | `timeout` | `string` | No | Pipeline-level timeout. Format: `"30s"`, `"5m"`, `"2h"` |
155
- | `plugins` | `string[]` | No | External plugin packages to load, e.g. `["@tagma/driver-codex"]` |
156
- | `hooks` | `HooksConfig` | No | Shell commands to run at lifecycle events (see Hooks below) |
157
- | `tracks` | `TrackConfig[]` | Yes | List of parallel execution tracks |
150
+ | Field | Type | Required | Description |
151
+ | ------------- | --------------- | -------- | ------------------------------------------------------------------------------------------ |
152
+ | `name` | `string` | Yes | Pipeline name, used in logs and run IDs |
153
+ | `driver` | `string` | No | Default driver for all tracks/tasks (inherited). Built-in: `opencode` |
154
+ | `model` | `string` | No | Default model for all tracks/tasks (inherited). Exact model name, e.g. `claude-sonnet-4-6` |
155
+ | `permissions` | `Permissions` | No | Default permissions inherited by all tracks/tasks (see Permissions) |
156
+ | `timeout` | `string` | No | Pipeline-level timeout. Format: `"30s"`, `"5m"`, `"2h"` |
157
+ | `plugins` | `string[]` | No | External plugin packages to load, e.g. `["@tagma/driver-codex"]` |
158
+ | `hooks` | `HooksConfig` | No | Shell commands to run at lifecycle events (see Hooks below) |
159
+ | `tracks` | `TrackConfig[]` | Yes | List of parallel execution tracks |
158
160
 
159
161
  ### Hooks Fields
160
162
 
@@ -204,8 +206,8 @@ Each hook value can be a single command string or an array of commands.
204
206
  | `middlewares` | `MiddlewareConfig[]` | No | Inherited from track | Middleware override. Set `[]` to disable inherited middlewares |
205
207
  | `trigger` | `TriggerConfig` | No | — | Gate that must resolve before the task runs (see Triggers) |
206
208
  | `completion` | `CompletionConfig` | No | — | Post-execution check to validate task output (see Completions) |
207
- | `inputs` | `TaskInputBindings` | No | — | Task input bindings for `{{inputs.<name>}}`; optional `type` enables coercion/validation |
208
- | `outputs` | `TaskOutputBindings` | No | — | Named outputs published after success; optional `type` enables coercion/validation |
209
+ | `inputs` | `TaskInputBindings` | No | — | Task input bindings for `{{inputs.<name>}}`; optional `type` enables coercion/validation |
210
+ | `outputs` | `TaskOutputBindings` | No | — | Named outputs published after success; optional `type` enables coercion/validation |
209
211
 
210
212
  ### Permissions
211
213
 
@@ -290,15 +292,15 @@ Tasks can declare named, typed `inputs` / `outputs`. Inputs flow in from upstrea
290
292
 
291
293
  #### Binding fields
292
294
 
293
- | Field | Type | Required | Description |
294
- | ------------- | ----------------------------------------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
295
- | `value` | `unknown` | No | Literal value. For inputs, this wins over `from` |
296
- | `from` | `string` | No | Inputs: upstream source such as `taskId.outputs.name`, `taskId.stdout`, or `outputs.name`. Outputs: `json.<key>`, `stdout`, `stderr`, or `normalizedOutput` |
297
- | `default` | `unknown` | No | Fallback value when the source is missing |
298
- | `required` | `boolean` | Inputs only | When `true`, missing upstream value and no `default` blocks the task |
299
- | `type` | `'string' \| 'number' \| 'boolean' \| 'enum' \| 'json'` | No | Optional coercion type. Omit it for pass-through values |
300
- | `description` | `string` | No | Free-text description; rendered into the `[Inputs]` / `[Output Format]` blocks |
301
- | `enum` | `string[]` | When `type: enum` | Allowed values |
295
+ | Field | Type | Required | Description |
296
+ | ------------- | ------------------------------------------------------- | ----------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
297
+ | `value` | `unknown` | No | Literal value. For inputs, this wins over `from` |
298
+ | `from` | `string` | No | Inputs: upstream source such as `taskId.outputs.name`, `taskId.stdout`, or `outputs.name`. Outputs: `json.<key>`, `stdout`, `stderr`, or `normalizedOutput` |
299
+ | `default` | `unknown` | No | Fallback value when the source is missing |
300
+ | `required` | `boolean` | Inputs only | When `true`, missing upstream value and no `default` blocks the task |
301
+ | `type` | `'string' \| 'number' \| 'boolean' \| 'enum' \| 'json'` | No | Optional coercion type. Omit it for pass-through values |
302
+ | `description` | `string` | No | Free-text description; rendered into the `[Inputs]` / `[Output Format]` blocks |
303
+ | `enum` | `string[]` | When `type: enum` | Allowed values |
302
304
 
303
305
  #### Substitution and AI prompt blocks
304
306
 
@@ -306,8 +308,6 @@ Tasks can declare named, typed `inputs` / `outputs`. Inputs flow in from upstrea
306
308
  - AI tasks get `[Output Format]` and `[Inputs]` blocks when typed bindings can be inferred from neighboring command tasks.
307
309
  - Output extraction strategy: prefer `normalizedOutput` (AI tasks), fall back to stdout (command tasks). Find the last non-empty line that parses as a JSON object, then read each declared output key. Failures append a diagnostic to stderr; the binding is absent from `outputs` and downstream tasks see it as missing.
308
310
 
309
- YAML `ports` has been replaced by typed `inputs` / `outputs`. `validateRaw` reports any `ports` field as a migration error.
310
-
311
311
  ---
312
312
 
313
313
  ### Built-in Triggers
@@ -403,10 +403,21 @@ YAML `ports` has been replaced by typed `inputs` / `outputs`. `validateRaw` repo
403
403
  - raw validation helpers
404
404
  - task reference helpers
405
405
 
406
- ### Dataflow helpers: `@tagma/sdk/ports`
406
+ ### Dataflow helpers: `@tagma/sdk/dataflow`
407
407
 
408
408
  - placeholder substitution, binding resolution, output extraction, and internal prompt-contract inference
409
- - the subpath name is historical; YAML `ports` is rejected by validation
409
+ - stable public subpath for pure dataflow helpers; no runtime/process imports
410
+
411
+ ### Runtime approval adapters
412
+
413
+ - `@tagma/sdk/runtime/adapters/stdin-approval`
414
+ - `@tagma/sdk/runtime/adapters/websocket-approval`
415
+
416
+ ### Split packages
417
+
418
+ - `@tagma/core` -- runtime-independent orchestration, registry, approval, logging, event/result types, and the `TagmaRuntime` interface
419
+ - `@tagma/runtime-bun` -- Bun process execution, file watching, log storage, `bunRuntime()`, and runtime approval adapters
420
+ - `@tagma/sdk` -- convenience package that composes core + Bun runtime + built-in plugins
410
421
 
411
422
  ### `bootstrapBuiltins(registry)`
412
423
 
@@ -425,7 +436,7 @@ Options:
425
436
  - `registry` -- use an existing `PluginRegistry` instance
426
437
  - `builtins` -- register built-in plugins into the instance registry; defaults to `true`
427
438
  - `plugins` -- register package-level `TagmaPlugin` capability objects into the instance registry
428
- - `runtime` -- override command/driver process execution; defaults to `bunRuntime()`
439
+ - `runtime` -- override process execution, file watching, file existence checks, log storage, time, and sleep; defaults to `bunRuntime()`
429
440
 
430
441
  ### `createTagma().run(config, options): Promise<EngineResult>`
431
442
 
@@ -446,7 +457,7 @@ Options:
446
457
  - `maxLogRuns` -- number of per-run log directories to keep under `<workDir>/.tagma/logs/` (default: 20)
447
458
  - `skipPluginLoading` -- skip the engine's built-in `loadPlugins(config.plugins)` call. Set this when the host has already pre-loaded plugins from a custom resolution path (e.g. the editor loading from the user's workspace `node_modules`) so the engine doesn't re-resolve them via Node's default cwd-based import.
448
459
 
449
- > **stdout / stderr persistence.** The engine streams every task's stdout and stderr to disk under `<workDir>/.tagma/logs/<runId>/<taskId>.stdout` and `.stderr`. The `TaskResult.stdout` / `stderr` strings are bounded tails (8 MB / 4 MB by default) — long outputs are truncated from the head with a marker, and consumers that need the full bytes should read `TaskResult.stdoutPath` / `stderrPath`. Use `TaskResult.stdoutBytes` / `stderrBytes` to display "32 MB (truncated)" without re-stat'ing the file.
460
+ > **stdout / stderr persistence.** With the default Bun runtime, the engine streams every task's stdout and stderr to disk under `<workDir>/.tagma/logs/<runId>/<taskId>.stdout` and `.stderr`. Custom runtimes can relocate those artifacts by implementing `runtime.logStore.taskOutputPath()`. The `TaskResult.stdout` / `stderr` strings are bounded tails (8 MB / 4 MB by default) — long outputs are truncated from the head with a marker, and consumers that need the full bytes should read `TaskResult.stdoutPath` / `stderrPath`. Use `TaskResult.stdoutBytes` / `stderrBytes` to display "32 MB (truncated)" without re-stat'ing the file.
450
461
 
451
462
  ### `PipelineRunner`
452
463
 
@@ -534,6 +545,8 @@ export const HttpTrigger: TriggerPlugin = {
534
545
  },
535
546
  },
536
547
  async watch(config, ctx) {
548
+ // Trigger plugins should use ctx.runtime for file IO, watching, and
549
+ // timing so they can run under non-Bun test/runtime implementations.
537
550
  /* ... */
538
551
  },
539
552
  };
@@ -584,9 +597,7 @@ import {
584
597
  moveTask,
585
598
  transferTask,
586
599
  } from '@tagma/sdk/config';
587
- import {
588
- serializePipeline,
589
- } from '@tagma/sdk/yaml';
600
+ import { serializePipeline } from '@tagma/sdk/yaml';
590
601
 
591
602
  // Build a config programmatically
592
603
  let config = createEmptyPipeline('my-pipeline');
@@ -597,18 +608,18 @@ config = upsertTask(config, 'backend', { id: 'implement', prompt: 'Add /health e
597
608
  const yaml = serializePipeline(config);
598
609
  ```
599
610
 
600
- | Function | Description |
601
- | -------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
602
- | `createEmptyPipeline(name)` | Create a minimal pipeline config |
603
- | `setPipelineField(config, fields)` | Update top-level pipeline fields |
604
- | `upsertTrack(config, track)` | Insert or replace a track by id |
605
- | `removeTrack(config, trackId)` | Remove a track |
606
- | `moveTrack(config, trackId, toIndex)` | Reorder a track |
607
- | `updateTrack(config, trackId, fields)` | Patch track fields (not tasks) |
608
- | `upsertTask(config, trackId, task)` | Insert or replace a task |
609
- | `removeTask(config, trackId, taskId, cleanRefs?)` | Remove a task; pass `cleanRefs: true` to also strip dangling `depends_on` / `continue_from` references. Only refs that resolve to the deleted task are removed — same-named tasks in other tracks are unaffected |
610
- | `moveTask(config, trackId, taskId, toIndex)` | Reorder a task within its track |
611
- | `transferTask(config, fromTrackId, taskId, toTrackId, qualifyRefs?)` | Move a task across tracks (see invariants below) |
611
+ | Function | Description |
612
+ | -------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
613
+ | `createEmptyPipeline(name)` | Create a minimal pipeline config |
614
+ | `setPipelineField(config, fields)` | Update top-level pipeline fields |
615
+ | `upsertTrack(config, track)` | Insert or replace a track by id |
616
+ | `removeTrack(config, trackId)` | Remove a track |
617
+ | `moveTrack(config, trackId, toIndex)` | Reorder a track |
618
+ | `updateTrack(config, trackId, fields)` | Patch track fields (not tasks) |
619
+ | `upsertTask(config, trackId, task)` | Insert or replace a task |
620
+ | `removeTask(config, trackId, taskId, cleanRefs?)` | Remove a task; pass `cleanRefs: true` to also strip dangling `depends_on` / `continue_from` references. Only refs that resolve to the deleted task are removed — same-named tasks in other tracks are unaffected |
621
+ | `moveTask(config, trackId, taskId, toIndex)` | Reorder a task within its track |
622
+ | `transferTask(config, fromTrackId, taskId, toTrackId, qualifyRefs?)` | Move a task across tracks (see invariants below) |
612
623
 
613
624
  `transferTask` invariants — the call is a **no-op** (returns the input config unchanged) when:
614
625
 
@@ -656,17 +667,17 @@ Use `validateRaw` for editing raw configs in a UI; use `validateConfig` after `r
656
667
 
657
668
  Pure helpers backing typed task bindings and internal prompt-contract inference. Safe to use in editors, simulators, and custom drivers — no I/O, no side effects.
658
669
 
659
- | Function | Description |
660
- | ------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
661
- | `substituteInputs(text, inputs)` | Expand `{{inputs.<name>}}` placeholders in `text`. Returns `{ text, unresolved }`. Strings pass through, numbers/booleans coerce via `String(...)`, objects/arrays via `JSON.stringify`. Caller is responsible for shell quoting |
662
- | `extractInputReferences(text)` | Return the set of input port names referenced by `{{inputs.<name>}}` placeholders in `text`. Use at edit time to flag undeclared references |
663
- | `resolveTaskBindingInputs(task, upstreamData, dependsOn)` | Resolve lightweight task-level `inputs` from literal values, upstream outputs, stdout/stderr, normalized output, defaults, and required flags |
664
- | `resolveTaskInputs(task, upstreamOutputs, dependsOn)` | Gather the input values a task will consume from its direct upstreams. Applies `from` bindings, defaults, and type coercion. Returns `{ kind: 'ready', inputs, missingOptional }` or `{ kind: 'blocked', missingRequired, ambiguous, typeErrors, reason }` |
665
- | `extractTaskBindingOutputs(outputs, stdout, stderr, normalizedOutput)` | Publish lightweight task-level `outputs` from final-line JSON, stdout/stderr, normalized output, literal values, or defaults |
666
- | `extractTaskOutputs(ports, stdout, normalizedOutput)` | Internal helper for inferred prompt contracts. Strategy: prefer `normalizedOutput`; find the last non-empty line that parses as a JSON object; coerce each declared key. Returns `{ outputs, diagnostic }` |
667
- | `prependContext(doc, block)` | Same shape as `appendContext` but prepends; the engine uses this to place `[Output Format]` and `[Inputs]` blocks before middleware-added context |
668
- | `renderInputsBlock(inputsDecl, values)` | Build the `[Inputs]` `PromptContextBlock` rendered into AI prompts (`name: value # description` lines). Returns `null` when no inputs to render |
669
- | `renderOutputSchemaBlock(outputsDecl)` | Build the `[Output Format]` `PromptContextBlock` instructing the model to emit a final-line JSON object matching the declared outputs. Returns `null` when no outputs declared |
670
+ | Function | Description |
671
+ | ---------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
672
+ | `substituteInputs(text, inputs)` | Expand `{{inputs.<name>}}` placeholders in `text`. Returns `{ text, unresolved }`. Strings pass through, numbers/booleans coerce via `String(...)`, objects/arrays via `JSON.stringify`. Caller is responsible for shell quoting |
673
+ | `extractInputReferences(text)` | Return the set of input port names referenced by `{{inputs.<name>}}` placeholders in `text`. Use at edit time to flag undeclared references |
674
+ | `resolveTaskBindingInputs(task, upstreamData, dependsOn)` | Resolve lightweight task-level `inputs` from literal values, upstream outputs, stdout/stderr, normalized output, defaults, and required flags |
675
+ | `resolveTaskInputs(task, upstreamOutputs, dependsOn)` | Gather the input values a task will consume from its direct upstreams. Applies `from` bindings, defaults, and type coercion. Returns `{ kind: 'ready', inputs, missingOptional }` or `{ kind: 'blocked', missingRequired, ambiguous, typeErrors, reason }` |
676
+ | `extractTaskBindingOutputs(outputs, stdout, stderr, normalizedOutput)` | Publish lightweight task-level `outputs` from final-line JSON, stdout/stderr, normalized output, literal values, or defaults |
677
+ | `extractTaskOutputs(ports, stdout, normalizedOutput)` | Internal helper for inferred prompt contracts. Strategy: prefer `normalizedOutput`; find the last non-empty line that parses as a JSON object; coerce each declared key. Returns `{ outputs, diagnostic }` |
678
+ | `prependContext(doc, block)` | Same shape as `appendContext` but prepends; the engine uses this to place `[Output Format]` and `[Inputs]` blocks before middleware-added context |
679
+ | `renderInputsBlock(inputsDecl, values)` | Build the `[Inputs]` `PromptContextBlock` rendered into AI prompts (`name: value # description` lines). Returns `null` when no inputs to render |
680
+ | `renderOutputSchemaBlock(outputsDecl)` | Build the `[Output Format]` `PromptContextBlock` instructing the model to emit a final-line JSON object matching the declared outputs. Returns `null` when no outputs declared |
670
681
 
671
682
  Custom drivers that wrap the prompt in their own envelope can read `DriverContext.inputs` (resolved + coerced map keyed by port name) and call `substituteInputs` themselves — the engine has already substituted into `task.prompt` upstream, so most drivers can ignore this.
672
683
 
@@ -674,7 +685,7 @@ Custom drivers that wrap the prompt in their own envelope can read `DriverContex
674
685
 
675
686
  Validates a raw pipeline config without resolving inheritance or executing anything. Returns a flat list of `{ path, message, severity? }` objects — empty array means valid. `severity` is `'error'` (default, fatal) or `'warning'` (soft hint; non-blocking).
676
687
 
677
- Checks: required fields, `prompt`/`command` exclusivity, duplicate task IDs within a track, `depends_on`/`continue_from` reference integrity (including ambiguous bare refs that exist in multiple tracks — use `trackId.taskId` to disambiguate), circular dependency detection, binding shape (name format, valid `type`, duplicate names, `enum` requires non-empty `enum` array), `ports` migration errors, `{{inputs.<name>}}` references resolving to a declared or inferred input binding, and `permissions` shape (must be an object with boolean `read`/`write`/`execute`). Tolerant of half-built configs — non-array `tracks` or `tasks` produce a structured error instead of throwing.
688
+ Checks: required fields, `prompt`/`command` exclusivity, duplicate task IDs within a track, `depends_on`/`continue_from` reference integrity (including ambiguous bare refs that exist in multiple tracks — use `trackId.taskId` to disambiguate), circular dependency detection, binding shape (name format, valid `type`, duplicate names, `enum` requires non-empty `enum` array), `{{inputs.<name>}}` references resolving to a declared or inferred input binding, and `permissions` shape (must be an object with boolean `read`/`write`/`execute`). Tolerant of half-built configs — non-array `tracks` or `tasks` produce a structured error instead of throwing.
678
689
 
679
690
  Plugin-type checks are opt-in via `knownTypes`: when provided, references to trigger/completion/middleware/driver types that are neither built-in nor in the supplied set produce a **warning** (`severity: 'warning'`) so editors can light up uninstalled plugins without blocking save / run. Omit `knownTypes` for offline / pre-load validation — no plugin warnings are emitted in that case.
680
691
 
@@ -734,7 +745,9 @@ Use `buildDag` instead when you have a fully resolved `PipelineConfig` and need
734
745
  Dual-channel logger — console + file. Creates a per-run log file at `<workDir>/.tagma/logs/<runId>/pipeline.log`.
735
746
 
736
747
  ```ts
737
- const logger = new Logger(workDir, runId);
748
+ import { bunRuntime } from '@tagma/sdk';
749
+
750
+ const logger = new Logger(workDir, runId, bunRuntime().logStore);
738
751
  logger.info('[track]', 'message'); // console + file
739
752
  logger.warn('[track]', 'message'); // console + file
740
753
  logger.error('[track]', 'message'); // console + file
@@ -746,13 +759,14 @@ logger.dir; // run artifact directory
746
759
  logger.close(); // close the persistent file handle (called automatically when Tagma.run completes)
747
760
  ```
748
761
 
749
- Pass an optional third argument to stream every appended line out as a
762
+ Pass an optional fourth argument to stream every appended line out as a
750
763
  structured `LogRecord`; the engine uses this to emit `task_log` events:
751
764
 
752
765
  ```ts
766
+ import { bunRuntime } from '@tagma/sdk';
753
767
  import { Logger, type LogRecord } from '@tagma/sdk/logger';
754
768
 
755
- const logger = new Logger(workDir, runId, (record: LogRecord) => {
769
+ const logger = new Logger(workDir, runId, bunRuntime().logStore, (record: LogRecord) => {
756
770
  // record = { level, taskId, timestamp, text }
757
771
  // level = 'info' | 'warn' | 'error' | 'debug' | 'section' | 'quiet'
758
772
  // taskId is extracted from a '[task:<id>]' prefix, or null for untagged lines
@@ -786,11 +800,25 @@ Truncates `text` to at most `maxBytes` UTF-8 bytes (default 16 KB), appending a
786
800
  | `nowISO()` | Returns `new Date().toISOString()` |
787
801
  | `truncateForName(text, maxLen?)` | Truncates first line to `maxLen` (default 40) for display |
788
802
 
803
+ ## Release And Version Behavior
804
+
805
+ `@tagma/sdk` depends on `@tagma/core`, `@tagma/runtime-bun`, and `@tagma/types`, so those packages must exist on npm before publishing the SDK version that references them. Package versions may remain independent; only bump the packages whose public contract changed.
806
+
807
+ Release flow:
808
+
809
+ 1. Run `bun run version <package> <patch|minor|major|x.y.z>` for each package whose public contract changed, or `bun run version all patch` when a coordinated release is useful.
810
+ 2. Run `bun run build` and `bun run publish:dry` locally before pushing a release commit.
811
+ 3. Publish in dependency order: `@tagma/types`, `@tagma/core`, `@tagma/runtime-bun`, plugin packages, then `@tagma/sdk`.
812
+
813
+ Published packages include `dist/` only. Each package build cleans `dist/` before TypeScript compilation so removed entry points cannot leak into the tarball.
814
+
789
815
  ## Related Packages
790
816
 
791
817
  | Package | Description |
792
818
  | ---------------------------------------------------------------------------------------- | --------------------------------------------- |
793
819
  | [@tagma/types](https://www.npmjs.com/package/@tagma/types) | Shared TypeScript types |
820
+ | [@tagma/core](https://www.npmjs.com/package/@tagma/core) | Runtime-independent orchestration core |
821
+ | [@tagma/runtime-bun](https://www.npmjs.com/package/@tagma/runtime-bun) | Bun runtime implementation |
794
822
  | [@tagma/driver-codex](https://www.npmjs.com/package/@tagma/driver-codex) | Codex CLI driver plugin |
795
823
  | [@tagma/driver-claude-code](https://www.npmjs.com/package/@tagma/driver-claude-code) | Claude Code CLI driver plugin |
796
824
  | [@tagma/middleware-lightrag](https://www.npmjs.com/package/@tagma/middleware-lightrag) | LightRAG knowledge-graph retrieval middleware |
@@ -1,13 +1,3 @@
1
- import type { ApprovalRequest, ApprovalDecision, ApprovalListener, ApprovalGateway } from './types';
2
- export type { ApprovalRequest, ApprovalDecision, ApprovalOutcome, ApprovalEvent, ApprovalListener, ApprovalGateway, } from './types';
3
- export declare class InMemoryApprovalGateway implements ApprovalGateway {
4
- private readonly pendingMap;
5
- private readonly listeners;
6
- request(req: Omit<ApprovalRequest, 'id' | 'createdAt'>): Promise<ApprovalDecision>;
7
- resolve(approvalId: string, decision: Omit<ApprovalDecision, 'approvalId' | 'decidedAt'>): boolean;
8
- pending(): readonly ApprovalRequest[];
9
- subscribe(listener: ApprovalListener): () => void;
10
- abortAll(reason: string): void;
11
- private emit;
12
- }
1
+ export { InMemoryApprovalGateway } from '@tagma/core';
2
+ export type { ApprovalDecision, ApprovalEvent, ApprovalGateway, ApprovalListener, ApprovalOutcome, ApprovalRequest, } from '@tagma/core';
13
3
  //# sourceMappingURL=approval.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"approval.d.ts","sourceRoot":"","sources":["../src/approval.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EACV,eAAe,EACf,gBAAgB,EAEhB,gBAAgB,EAChB,eAAe,EAChB,MAAM,SAAS,CAAC;AAGjB,YAAY,EACV,eAAe,EACf,gBAAgB,EAChB,eAAe,EACf,aAAa,EACb,gBAAgB,EAChB,eAAe,GAChB,MAAM,SAAS,CAAC;AAUjB,qBAAa,uBAAwB,YAAW,eAAe;IAC7D,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAmC;IAC9D,OAAO,CAAC,QAAQ,CAAC,SAAS,CAA+B;IAEzD,OAAO,CAAC,GAAG,EAAE,IAAI,CAAC,eAAe,EAAE,IAAI,GAAG,WAAW,CAAC,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAkClF,OAAO,CACL,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,IAAI,CAAC,gBAAgB,EAAE,YAAY,GAAG,WAAW,CAAC,GAC3D,OAAO;IAkBV,OAAO,IAAI,SAAS,eAAe,EAAE;IAIrC,SAAS,CAAC,QAAQ,EAAE,gBAAgB,GAAG,MAAM,IAAI;IAOjD,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAe9B,OAAO,CAAC,IAAI;CASb"}
1
+ {"version":3,"file":"approval.d.ts","sourceRoot":"","sources":["../src/approval.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AACtD,YAAY,EACV,gBAAgB,EAChB,aAAa,EACb,eAAe,EACf,gBAAgB,EAChB,eAAe,EACf,eAAe,GAChB,MAAM,aAAa,CAAC"}
package/dist/approval.js CHANGED
@@ -1,91 +1,2 @@
1
- import { randomUUID } from 'crypto';
2
- import { nowISO } from './utils';
3
- export class InMemoryApprovalGateway {
4
- pendingMap = new Map();
5
- listeners = new Set();
6
- request(req) {
7
- const full = {
8
- id: randomUUID(),
9
- createdAt: nowISO(),
10
- taskId: req.taskId,
11
- trackId: req.trackId,
12
- message: req.message,
13
- timeoutMs: req.timeoutMs,
14
- metadata: req.metadata,
15
- };
16
- return new Promise((resolvePromise) => {
17
- let timer = null;
18
- if (full.timeoutMs > 0) {
19
- timer = setTimeout(() => {
20
- const entry = this.pendingMap.get(full.id);
21
- if (!entry)
22
- return;
23
- this.pendingMap.delete(full.id);
24
- const decision = {
25
- approvalId: full.id,
26
- outcome: 'timeout',
27
- reason: `Approval timed out after ${full.timeoutMs}ms`,
28
- decidedAt: nowISO(),
29
- };
30
- this.emit({ type: 'expired', request: full });
31
- resolvePromise(decision);
32
- }, full.timeoutMs);
33
- }
34
- this.pendingMap.set(full.id, { request: full, settle: resolvePromise, timer });
35
- this.emit({ type: 'requested', request: full });
36
- });
37
- }
38
- resolve(approvalId, decision) {
39
- const entry = this.pendingMap.get(approvalId);
40
- if (!entry)
41
- return false;
42
- this.pendingMap.delete(approvalId);
43
- if (entry.timer)
44
- clearTimeout(entry.timer);
45
- const full = {
46
- approvalId,
47
- outcome: decision.outcome,
48
- actor: decision.actor,
49
- reason: decision.reason,
50
- decidedAt: nowISO(),
51
- };
52
- this.emit({ type: 'resolved', request: entry.request, decision: full });
53
- entry.settle(full);
54
- return true;
55
- }
56
- pending() {
57
- return Array.from(this.pendingMap.values()).map((e) => e.request);
58
- }
59
- subscribe(listener) {
60
- this.listeners.add(listener);
61
- return () => {
62
- this.listeners.delete(listener);
63
- };
64
- }
65
- abortAll(reason) {
66
- const entries = Array.from(this.pendingMap.entries());
67
- this.pendingMap.clear();
68
- for (const [id, entry] of entries) {
69
- if (entry.timer)
70
- clearTimeout(entry.timer);
71
- this.emit({ type: 'aborted', request: entry.request, reason });
72
- entry.settle({
73
- approvalId: id,
74
- outcome: 'aborted',
75
- reason,
76
- decidedAt: nowISO(),
77
- });
78
- }
79
- }
80
- emit(event) {
81
- for (const listener of this.listeners) {
82
- try {
83
- listener(event);
84
- }
85
- catch (err) {
86
- console.error('[approval gateway] listener error:', err);
87
- }
88
- }
89
- }
90
- }
1
+ export { InMemoryApprovalGateway } from '@tagma/core';
91
2
  //# sourceMappingURL=approval.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"approval.js","sourceRoot":"","sources":["../src/approval.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAmCjC,MAAM,OAAO,uBAAuB;IACjB,UAAU,GAAG,IAAI,GAAG,EAAwB,CAAC;IAC7C,SAAS,GAAG,IA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IACJ,CAAC;IAED,QAAQ,CAAC,MAAc;QACrB,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,CAAC,CAAC;QACtD,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC;QACxB,KAAK,MAAM,CAAC,EAAE,EAAE,KAAK,CAAC,IAAI,OAAO,EAAE,CAAC;YAClC,IAAI,KAAK,CAAC,KAAK;gBAAE,YAAY,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;YAC3C,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC;YAC/D,KAAK,CAAC,MAAM,CAAC;gBACX,UAAU,EAAE,EAAE;gBACd,OAAO,EAAE,SAAS;gBAClB,MAAM;gBACN,SAAS,EAAE,MAAM,EAAE;aACpB,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAEO,IAAI,CAAC,KAAoB;QAC/B,KAAK,MAAM,QAAQ,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YACtC,IAAI,CAAC;gBACH,QAAQ,CAAC,KAAK,CAAC,CAAC;YAClB,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACb,OAAO,CAAC,KAAK,CAAC,oCAAoC,EAAE,GAAG,CAAC,CAAC;YAC3D,CAAC;QACH,CAAC;IACH,CAAC;CACF"}
1
+ {"version":3,"file":"approval.js","sourceRoot":"","sources":["../src/approval.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC"}
@@ -1,4 +1,4 @@
1
- import type { PluginRegistry } from './registry';
1
+ import type { PluginRegistry } from '@tagma/core';
2
2
  export declare const BuiltinTagmaPlugin: {
3
3
  name: string;
4
4
  capabilities: {
@@ -1 +1 @@
1
- {"version":3,"file":"bootstrap.d.ts","sourceRoot":"","sources":["../src/bootstrap.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAsBjD,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;CAmBR,CAAC;AAExB;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,cAAc,GAAG,IAAI,CAE9D"}
1
+ {"version":3,"file":"bootstrap.d.ts","sourceRoot":"","sources":["../src/bootstrap.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAsBlD,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;CAmBR,CAAC;AAExB;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,cAAc,GAAG,IAAI,CAE9D"}
@@ -1,5 +1,5 @@
1
1
  import { stat } from 'node:fs/promises';
2
- import { validatePath } from '../utils';
2
+ import { validatePath } from '@tagma/core';
3
3
  export const FileExistsCompletion = {
4
4
  name: 'file_exists',
5
5
  schema: {
@@ -1 +1 @@
1
- {"version":3,"file":"file-exists.js","sourceRoot":"","sources":["../../src/completions/file-exists.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAExC,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAIxC,MAAM,CAAC,MAAM,oBAAoB,GAAqB;IACpD,IAAI,EAAE,aAAa;IACnB,MAAM,EAAE;QACN,WAAW,EAAE,kEAAkE;QAC/E,MAAM,EAAE;YACN,IAAI,EAAE;gBACJ,IAAI,EAAE,MAAM;gBACZ,QAAQ,EAAE,IAAI;gBACd,WAAW,EAAE,kDAAkD;aAChE;YACD,IAAI,EAAE;gBACJ,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,CAAC,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC;gBAC5B,OAAO,EAAE,KAAK;gBACd,WAAW,EAAE,kDAAkD;aAChE;YACD,QAAQ,EAAE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AE,gBAsFnC,CAAC"}
1
+ {"version":3,"file":"output-check.d.ts","sourceRoot":"","sources":["../../src/completions/output-check.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAiC,MAAM,UAAU,CAAC;AAgBhF,eAAO,MAAM,qBAAqB,EAAE,gBA0FnC,CAAC"}
@@ -1,5 +1,14 @@
1
- import { shellArgs, parseDuration } from '../utils';
1
+ import { parseDuration, shellArgs } from '@tagma/core';
2
2
  const DEFAULT_TIMEOUT_MS = 30_000;
3
+ async function drain(stream) {
4
+ if (!stream)
5
+ return;
6
+ await stream.pipeTo(new WritableStream({
7
+ write() {
8
+ // Discard check stdout; only exit status matters.
9
+ },
10
+ }));
11
+ }
3
12
  export const OutputCheckCompletion = {
4
13
  name: 'output_check',
5
14
  schema: {
@@ -62,9 +71,13 @@ export const OutputCheckCompletion = {
62
71
  throw err;
63
72
  }
64
73
  }
65
- // Consume stderr concurrently with waiting for exit to prevent pipe-buffer
66
- // deadlock when check script emits more than ~64 KB of stderr output.
67
- const [exitCode, stderr] = await Promise.all([proc.exited, new Response(proc.stderr).text()]);
74
+ // Drain stdout and stderr concurrently so verbose check commands cannot
75
+ // block on pipe buffers while the parent waits for process exit.
76
+ const [exitCode, , stderr] = await Promise.all([
77
+ proc.exited,
78
+ drain(proc.stdout),
79
+ new Response(proc.stderr).text(),
80
+ ]);
68
81
  if (exitCode !== 0 && stderr.trim()) {
69
82
  console.warn(`[output_check] "${checkCmd}" exit=${exitCode}: ${stderr.trim()}`);
70
83
  }
@@ -1 +1 @@
1
- {"version":3,"file":"output-check.js","sourceRoot":"","sources":["../../src/completions/output-check.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEpD,MAAM,kBAAkB,GAAG,MAAM,CAAC;AAElC,MAAM,CAAC,MAAM,qBAAqB,GAAqB;IACrD,IAAI,EAAE,cAAc;IACpB,MAAM,EAAE;QACN,WAAW,EACT,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ACpB,IAAI,GAAG,CAAC,MAAM;gBAAE,GAAG,CAAC,MAAM,CAAC,mBAAmB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACnE,CAAC;IACH,CAAC;CACF,CAAC"}
1
+ {"version":3,"file":"output-check.js","sourceRoot":"","sources":["../../src/completions/output-check.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAEvD,MAAM,kBAAkB,GAAG,MAAM,CAAC;AAElC,KAAK,UAAU,KAAK,CAAC,MAAyC;IAC5D,IAAI,CAAC,MAAM;QAAE,OAAO;IACpB,MAAM,MAAM,CAAC,MAAM,CACjB,IAAI,cAAc,CAAa;QAC7B,KAAK;YACH,kDAAkD;QACpD,CAAC;KACF,CAAC,CACH,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,qBAAqB,GAAqB;IACrD,IAAI,EAAE,cAAc;IACpB,MAAM,EAAE;QACN,WAAW,EACT,sMAAsM;QACxM,MAAM,EAAE;YACN,KAAK,EAAE;gBACL,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;gBACd,WAAW,EACT,oIAAoI;gBACtI,WAAW,EAAE,gBAAgB;aAC9B;YACD,OAAO,EAAE;gBACP,IAAI,EAAE,UAAU;gBAChB,OAAO,EAAE,KAAK;gBACd,WAAW,EAAE,6CAA6C;gBAC1D,WAAW,EAAE,KAAK;aACnB;SACF;KACF;IAED,KAAK,CAAC,KAAK,CACT,MAA+B,EAC/B,MAAkB,EAClB,GAAsB;QAEtB,MAAM,QAAQ,GAAG,MAAM,CAAC,KAAe,CAAC;QACxC,IAAI,CAAC,QAAQ;YAAE,MAAM,IAAI,KAAK,CAAC,8CAA8C,CAAC,CAAC;QAE/E,MAAM,SAAS,GACb,MAAM,CAAC,OAAO,IAAI,IAAI,CAAC,CAAC,CAAC,aAAa,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,kB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AAE,IAAI,CAAC;oBAClD,IAAI,IAAI,KAAK,OAAO;wBAAE,MAAM,GAAG,CAAC;gBAClC,CAAC;YACH,CAAC;YAED,wEAAwE;YACxE,iEAAiE;YACjE,MAAM,CAAC,QAAQ,EAAE,AAAD,EAAG,MAAM,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;gBAC7C,IAAI,CAAC,MAAM;gBACX,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC;gBAClB,IAAI,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE;aACjC,CAAC,CAAC;YAEH,IAAI,QAAQ,KAAK,CAAC,IAAI,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC;gBACpC,OAAO,CAAC,IAAI,CAAC,mBAAmB,QAAQ,UAAU,QAAQ,KAAK,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;YAClF,CAAC;YAED,OAAO,QAAQ,KAAK,CAAC,CAAC;QACxB,CAAC;gBAAS,CAAC;YACT,YAAY,CAAC,KAAK,CAAC,CAAC;YACpB,IAAI,GAAG,CAAC,MAAM;gBAAE,GAAG,CAAC,MAAM,CAAC,mBAAmB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACnE,CAAC;IACH,CAAC;CACF,CAAC"}
package/dist/config.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  export { createEmptyPipeline, setPipelineField, upsertTrack, removeTrack, moveTrack, updateTrack, upsertTask, removeTask, moveTask, transferTask, } from './config-ops';
2
2
  export { validateRaw } from './validate-raw';
3
3
  export type { ValidationError, KnownPluginTypes } from './validate-raw';
4
- export { buildRawDag } from './dag';
5
- export type { RawDag, RawDagNode } from './dag';
6
- export { TASK_ID_RE, isValidTaskId, qualifyTaskId, isQualifiedRef, buildTaskIndex, resolveTaskRef, AMBIGUOUS, } from './task-ref';
7
- export type { TaskIndex, RefResolution } from './task-ref';
4
+ export { buildRawDag } from '@tagma/core';
5
+ export type { RawDag, RawDagNode } from '@tagma/core';
6
+ export { TASK_ID_RE, isValidTaskId, qualifyTaskId, isQualifiedRef, buildTaskIndex, resolveTaskRef, AMBIGUOUS, } from '@tagma/core';
7
+ export type { TaskIndex, RefResolution } from '@tagma/core';
8
8
  //# sourceMappingURL=config.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,gBAAgB,EAChB,WAAW,EACX,WAAW,EACX,SAAS,EACT,WAAW,EACX,UAAU,EACV,UAAU,EACV,QAAQ,EACR,YAAY,GACb,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,YAAY,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AACxE,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpC,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAChD,OAAO,EACL,UAAU,EACV,aAAa,EACb,aAAa,EACb,cAAc,EACd,cAAc,EACd,cAAc,EACd,SAAS,GACV,MAAM,YAAY,CAAC;AACpB,YAAY,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,gBAAgB,EAChB,WAAW,EACX,WAAW,EACX,SAAS,EACT,WAAW,EACX,UAAU,EACV,UAAU,EACV,QAAQ,EACR,YAAY,GACb,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,YAAY,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AACxE,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EACL,UAAU,EACV,aAAa,EACb,aAAa,EACb,cAAc,EACd,cAAc,EACd,cAAc,EACd,SAAS,GACV,MAAM,aAAa,CAAC;AACrB,YAAY,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC"}
package/dist/config.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export { createEmptyPipeline, setPipelineField, upsertTrack, removeTrack, moveTrack, updateTrack, upsertTask, removeTask, moveTask, transferTask, } from './config-ops';
2
2
  export { validateRaw } from './validate-raw';
3
- export { buildRawDag } from './dag';
4
- export { TASK_ID_RE, isValidTaskId, qualifyTaskId, isQualifiedRef, buildTaskIndex, resolveTaskRef, AMBIGUOUS, } from './task-ref';
3
+ export { buildRawDag } from '@tagma/core';
4
+ export { TASK_ID_RE, isValidTaskId, qualifyTaskId, isQualifiedRef, buildTaskIndex, resolveTaskRef, AMBIGUOUS, } from '@tagma/core';
5
5
  //# sourceMappingURL=config.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,gBAAgB,EAChB,WAAW,EACX,WAAW,EACX,SAAS,EACT,WAAW,EACX,UAAU,EACV,UAAU,EACV,QAAQ,EACR,YAAY,GACb,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAEpC,OAAO,EACL,UAAU,EACV,aAAa,EACb,aAAa,EACb,cAAc,EACd,cAAc,EACd,cAAc,EACd,SAAS,GACV,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,gBAAgB,EAChB,WAAW,EACX,WAAW,EACX,SAAS,EACT,WAAW,EACX,UAAU,EACV,UAAU,EACV,QAAQ,EACR,YAAY,GACb,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,OAAO,EACL,UAAU,EACV,aAAa,EACb,aAAa,EACb,cAAc,EACd,cAAc,EACd,cAAc,EACd,SAAS,GACV,MAAM,aAAa,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { extractInputReferences, extractTaskBindingOutputs, extractTaskOutputs, inferPromptPorts, resolveTaskBindingInputs, resolveTaskInputs, substituteInputs, } from '@tagma/core';
2
+ export type { BindingInputResolution, ExtractResult, InputResolution, PromptDownstreamNeighbor, PromptPortConflict, PromptPortInference, PromptUpstreamNeighbor, SubstituteResult, UpstreamBindingData, } from '@tagma/core';
3
+ //# sourceMappingURL=dataflow.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dataflow.d.ts","sourceRoot":"","sources":["../src/dataflow.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,EACtB,yBAAyB,EACzB,kBAAkB,EAClB,gBAAgB,EAChB,wBAAwB,EACxB,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,aAAa,CAAC;AAErB,YAAY,EACV,sBAAsB,EACtB,aAAa,EACb,eAAe,EACf,wBAAwB,EACxB,kBAAkB,EAClB,mBAAmB,EACnB,sBAAsB,EACtB,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,aAAa,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { extractInputReferences, extractTaskBindingOutputs, extractTaskOutputs, inferPromptPorts, resolveTaskBindingInputs, resolveTaskInputs, substituteInputs, } from '@tagma/core';
2
+ //# sourceMappingURL=dataflow.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dataflow.js","sourceRoot":"","sources":["../src/dataflow.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,EACtB,yBAAyB,EACzB,kBAAkB,EAClB,gBAAgB,EAChB,wBAAwB,EACxB,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,aAAa,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"opencode.d.ts","sourceRoot":"","sources":["../../src/drivers/opencode.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EAOb,MAAM,UAAU,CAAC;AA+NlB,eAAO,MAAM,cAAc,EAAE,YAkL5B,CAAC"}
1
+ {"version":3,"file":"opencode.d.ts","sourceRoot":"","sources":["../../src/drivers/opencode.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EAOb,MAAM,UAAU,CAAC;AA4JlB,eAAO,MAAM,cAAc,EAAE,YAiL5B,CAAC"}