@tagma/sdk 0.6.0 → 0.6.2

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 (48) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +573 -573
  3. package/dist/bootstrap.d.ts +11 -1
  4. package/dist/bootstrap.d.ts.map +1 -1
  5. package/dist/bootstrap.js +18 -9
  6. package/dist/bootstrap.js.map +1 -1
  7. package/dist/drivers/opencode.d.ts.map +1 -1
  8. package/dist/drivers/opencode.js +47 -17
  9. package/dist/drivers/opencode.js.map +1 -1
  10. package/dist/engine.d.ts +8 -0
  11. package/dist/engine.d.ts.map +1 -1
  12. package/dist/engine.js +17 -16
  13. package/dist/engine.js.map +1 -1
  14. package/dist/plugin-registry.test.d.ts +2 -0
  15. package/dist/plugin-registry.test.d.ts.map +1 -0
  16. package/dist/plugin-registry.test.js +188 -0
  17. package/dist/plugin-registry.test.js.map +1 -0
  18. package/dist/registry.d.ts +52 -28
  19. package/dist/registry.d.ts.map +1 -1
  20. package/dist/registry.js +126 -91
  21. package/dist/registry.js.map +1 -1
  22. package/dist/sdk.d.ts +1 -1
  23. package/dist/sdk.d.ts.map +1 -1
  24. package/dist/sdk.js +1 -1
  25. package/dist/sdk.js.map +1 -1
  26. package/package.json +2 -2
  27. package/src/bootstrap.ts +46 -37
  28. package/src/completions/output-check.ts +92 -92
  29. package/src/dag.ts +245 -245
  30. package/src/drivers/opencode.ts +410 -371
  31. package/src/engine.ts +1228 -1220
  32. package/src/hooks.ts +193 -193
  33. package/src/middlewares/static-context.ts +49 -49
  34. package/src/pipeline-runner.ts +173 -173
  35. package/src/plugin-registry.test.ts +230 -0
  36. package/src/prompt-doc.ts +49 -49
  37. package/src/registry.ts +316 -267
  38. package/src/runner.ts +460 -460
  39. package/src/schema.test.ts +101 -101
  40. package/src/schema.ts +338 -338
  41. package/src/sdk.ts +120 -118
  42. package/src/task-ref.test.ts +401 -401
  43. package/src/task-ref.ts +120 -120
  44. package/src/validate-raw.ts +412 -412
  45. package/dist/drivers/claude-code.d.ts +0 -3
  46. package/dist/drivers/claude-code.d.ts.map +0 -1
  47. package/dist/drivers/claude-code.js +0 -225
  48. package/dist/drivers/claude-code.js.map +0 -1
package/src/sdk.ts CHANGED
@@ -1,118 +1,120 @@
1
- // ═══ tagma-sdk public API ═══
2
- //
3
- // This is the SDK entry point. Import from here, not from internal modules.
4
- // The CLI (src/index.ts in the CLI project) also imports from here.
5
-
6
- // ── Core engine ──
7
- export { runPipeline, TriggerBlockedError, TriggerTimeoutError } from './engine';
8
- export type { EngineResult, RunPipelineOptions, RunEventPayload } from './engine';
9
-
10
- // ── Pipeline runner (multi-pipeline lifecycle management) ──
11
- export { PipelineRunner } from './pipeline-runner';
12
- export type { PipelineRunnerStatus } from './pipeline-runner';
13
-
14
- // ── Raw config CRUD (visual editor / YAML sync) ──
15
- export {
16
- createEmptyPipeline,
17
- setPipelineField,
18
- upsertTrack,
19
- removeTrack,
20
- moveTrack,
21
- updateTrack,
22
- upsertTask,
23
- removeTask,
24
- moveTask,
25
- transferTask,
26
- } from './config-ops';
27
-
28
- // ── Raw config validation (real-time feedback) ──
29
- export { validateRaw } from './validate-raw';
30
- export type { ValidationError } from './validate-raw';
31
-
32
- // ── Schema: parse / resolve / load / serialize / validate ──
33
- export {
34
- parseYaml,
35
- resolveConfig,
36
- loadPipeline,
37
- serializePipeline,
38
- deresolvePipeline,
39
- validateConfig,
40
- } from './schema';
41
-
42
- // ── DAG ──
43
- export { buildDag, buildRawDag } from './dag';
44
- export type { DagNode, Dag, RawDagNode, RawDag } from './dag';
45
-
46
- // ── Plugin registry ──
47
- export { bootstrapBuiltins } from './bootstrap';
48
- export {
49
- loadPlugins,
50
- registerPlugin,
51
- unregisterPlugin,
52
- getHandler,
53
- hasHandler,
54
- listRegistered,
55
- isValidPluginName,
56
- PLUGIN_NAME_RE,
57
- readPluginManifest,
58
- } from './registry';
59
- export type { RegisterResult } from './registry';
60
-
61
- // ── Approval gateway ──
62
- export { InMemoryApprovalGateway } from './approval';
63
- export type {
64
- ApprovalGateway,
65
- ApprovalRequest,
66
- ApprovalDecision,
67
- ApprovalOutcome,
68
- ApprovalEvent,
69
- ApprovalListener,
70
- } from './approval';
71
-
72
- // ── Approval adapters ──
73
- export { attachStdinApprovalAdapter } from './adapters/stdin-approval';
74
- export type { StdinApprovalAdapter } from './adapters/stdin-approval';
75
- export { attachWebSocketApprovalAdapter } from './adapters/websocket-approval';
76
- export type {
77
- WebSocketApprovalAdapter,
78
- WebSocketApprovalAdapterOptions,
79
- } from './adapters/websocket-approval';
80
-
81
- // ── Logger ──
82
- export { Logger, tailLines, clip } from './logger';
83
- export type { LogRecord, LogLevel, LogListener } from './logger';
84
-
85
- // ── Hook context types (useful for frontend display) ──
86
- export type { HookResult, PipelineInfo, TrackInfo, TaskInfo } from './hooks';
87
-
88
- // ── Utils (public subset) ──
89
- export {
90
- parseDuration,
91
- validatePath,
92
- generateRunId,
93
- nowISO,
94
- truncateForName,
95
- _resetShellCache,
96
- } from './utils';
97
-
98
- // ── Task reference resolution (shared id normalization) ──
99
- export {
100
- TASK_ID_RE,
101
- isValidTaskId,
102
- qualifyTaskId,
103
- isQualifiedRef,
104
- buildTaskIndex,
105
- resolveTaskRef,
106
- AMBIGUOUS,
107
- } from './task-ref';
108
- export type { TaskIndex, RefResolution } from './task-ref';
109
-
110
- // ── Prompt document helpers (middleware authors + drivers) ──
111
- export {
112
- promptDocumentFromString,
113
- serializePromptDocument,
114
- appendContext,
115
- } from './prompt-doc';
116
-
117
- // ── All types from @tagma/types + runtime constants ──
118
- export * from './types';
1
+ // ═══ tagma-sdk public API ═══
2
+ //
3
+ // This is the SDK entry point. Import from here, not from internal modules.
4
+ // The CLI (src/index.ts in the CLI project) also imports from here.
5
+
6
+ // ── Core engine ──
7
+ export { runPipeline, TriggerBlockedError, TriggerTimeoutError } from './engine';
8
+ export type { EngineResult, RunPipelineOptions, RunEventPayload } from './engine';
9
+
10
+ // ── Pipeline runner (multi-pipeline lifecycle management) ──
11
+ export { PipelineRunner } from './pipeline-runner';
12
+ export type { PipelineRunnerStatus } from './pipeline-runner';
13
+
14
+ // ── Raw config CRUD (visual editor / YAML sync) ──
15
+ export {
16
+ createEmptyPipeline,
17
+ setPipelineField,
18
+ upsertTrack,
19
+ removeTrack,
20
+ moveTrack,
21
+ updateTrack,
22
+ upsertTask,
23
+ removeTask,
24
+ moveTask,
25
+ transferTask,
26
+ } from './config-ops';
27
+
28
+ // ── Raw config validation (real-time feedback) ──
29
+ export { validateRaw } from './validate-raw';
30
+ export type { ValidationError } from './validate-raw';
31
+
32
+ // ── Schema: parse / resolve / load / serialize / validate ──
33
+ export {
34
+ parseYaml,
35
+ resolveConfig,
36
+ loadPipeline,
37
+ serializePipeline,
38
+ deresolvePipeline,
39
+ validateConfig,
40
+ } from './schema';
41
+
42
+ // ── DAG ──
43
+ export { buildDag, buildRawDag } from './dag';
44
+ export type { DagNode, Dag, RawDagNode, RawDag } from './dag';
45
+
46
+ // ── Plugin registry ──
47
+ export { bootstrapBuiltins } from './bootstrap';
48
+ export {
49
+ PluginRegistry,
50
+ defaultRegistry,
51
+ loadPlugins,
52
+ registerPlugin,
53
+ unregisterPlugin,
54
+ getHandler,
55
+ hasHandler,
56
+ listRegistered,
57
+ isValidPluginName,
58
+ PLUGIN_NAME_RE,
59
+ readPluginManifest,
60
+ } from './registry';
61
+ export type { RegisterResult } from './registry';
62
+
63
+ // ── Approval gateway ──
64
+ export { InMemoryApprovalGateway } from './approval';
65
+ export type {
66
+ ApprovalGateway,
67
+ ApprovalRequest,
68
+ ApprovalDecision,
69
+ ApprovalOutcome,
70
+ ApprovalEvent,
71
+ ApprovalListener,
72
+ } from './approval';
73
+
74
+ // ── Approval adapters ──
75
+ export { attachStdinApprovalAdapter } from './adapters/stdin-approval';
76
+ export type { StdinApprovalAdapter } from './adapters/stdin-approval';
77
+ export { attachWebSocketApprovalAdapter } from './adapters/websocket-approval';
78
+ export type {
79
+ WebSocketApprovalAdapter,
80
+ WebSocketApprovalAdapterOptions,
81
+ } from './adapters/websocket-approval';
82
+
83
+ // ── Logger ──
84
+ export { Logger, tailLines, clip } from './logger';
85
+ export type { LogRecord, LogLevel, LogListener } from './logger';
86
+
87
+ // ── Hook context types (useful for frontend display) ──
88
+ export type { HookResult, PipelineInfo, TrackInfo, TaskInfo } from './hooks';
89
+
90
+ // ── Utils (public subset) ──
91
+ export {
92
+ parseDuration,
93
+ validatePath,
94
+ generateRunId,
95
+ nowISO,
96
+ truncateForName,
97
+ _resetShellCache,
98
+ } from './utils';
99
+
100
+ // ── Task reference resolution (shared id normalization) ──
101
+ export {
102
+ TASK_ID_RE,
103
+ isValidTaskId,
104
+ qualifyTaskId,
105
+ isQualifiedRef,
106
+ buildTaskIndex,
107
+ resolveTaskRef,
108
+ AMBIGUOUS,
109
+ } from './task-ref';
110
+ export type { TaskIndex, RefResolution } from './task-ref';
111
+
112
+ // ── Prompt document helpers (middleware authors + drivers) ──
113
+ export {
114
+ promptDocumentFromString,
115
+ serializePromptDocument,
116
+ appendContext,
117
+ } from './prompt-doc';
118
+
119
+ // ── All types from @tagma/types + runtime constants ──
120
+ export * from './types';