singleton-pipeline 0.4.0-beta.11 → 0.4.0-beta.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/docs/reference.md CHANGED
@@ -58,8 +58,18 @@ Meaning:
58
58
  Compatibility sources:
59
59
 
60
60
  - `.claude/agents/` is scanned as a legacy or external source
61
+ - `.github/agents/*.md` is scanned as a Copilot-compatible source
62
+ - `.opencode/agents/*.md` is scanned as an OpenCode-compatible source
61
63
  - `AGENTS.md` and `AGENTS.override.md` are not agents; they are Codex project instructions
62
64
 
65
+ When duplicate agent ids exist, higher-priority sources win:
66
+
67
+ 1. `.singleton/agents/*.md`
68
+ 2. compatibility sources (`.claude/agents/*.md`, `.github/agents/*.md`, `.opencode/agents/*.md`)
69
+
70
+ For compatibility sources, Singleton infers the provider from the directory when the agent file does not set `provider` explicitly.
71
+ If the same id appears in multiple compatibility sources, the first scanned source wins in this order: `.claude`, then `.github`, then `.opencode`.
72
+
63
73
  ## Agent model
64
74
 
65
75
  Agents are Markdown files.
@@ -96,6 +106,7 @@ Your prompt here.
96
106
  - `provider`
97
107
  - `model`
98
108
  - `runner_agent`
109
+ - `opencode_agent` (legacy alias for `runner_agent`)
99
110
  - `permission_mode`
100
111
  - `estimated_tokens`
101
112
  - `security_profile`
@@ -112,7 +123,8 @@ Your prompt here.
112
123
  - `provider` — execution backend, currently `claude`, `codex`, `copilot`, or experimental `opencode`
113
124
  - `model` — provider-specific model name
114
125
  - `runner_agent` — provider-side agent name; currently used by Copilot and OpenCode `--agent` options
115
- - `permission_mode` — applies to Claude only, ignored for Codex runs
126
+ - `opencode_agent` — legacy alias accepted for OpenCode agent selection
127
+ - `permission_mode` — applies to Claude only; non-Claude providers ignore it and preflight warns
116
128
  - `estimated_tokens` — optional metadata for planning
117
129
  - `security_profile` — Singleton write policy profile
118
130
  - `allowed_paths` — comma-separated write allowlist used by `restricted-write`
@@ -135,8 +147,10 @@ Model resolution:
135
147
  Runner agent resolution (Copilot and OpenCode):
136
148
 
137
149
  1. `step.runner_agent`
138
- 2. `agent.runner_agent`
139
- 3. no explicit runner agent, so the provider uses its default agent
150
+ 2. `step.opencode_agent`
151
+ 3. `agent.runner_agent`
152
+ 4. `agent.opencode_agent`
153
+ 5. no explicit runner agent, so the provider uses its default agent
140
154
 
141
155
  Permission mode resolution (Claude only):
142
156
 
@@ -310,9 +324,9 @@ For `provider: copilot`, Singleton converts the resolved security policy to Copi
310
324
  Mapping:
311
325
 
312
326
  - `read-only` — allows `read`, denies `write`, `shell`, `url`, and `memory`.
313
- - `restricted-write` — allows `read` and `write(...)` only for each `allowed_paths` entry.
314
- - `workspace-write` — allows `read` and `write`, while still denying dangerous shell defaults such as `git push`.
315
- - `dangerous` — uses Copilot's broad tool mode and keeps explicit deny rules where possible.
327
+ - `restricted-write` — allows `read`, allows `write(...)` only for each `allowed_paths` entry, allows `shell`, denies `shell(git push)`, `url`, and `memory`.
328
+ - `workspace-write` — allows `read`, `write`, and `shell`, while still denying `shell(git push)`, `url`, and `memory`.
329
+ - `dangerous` — uses Copilot's broad tool mode, still denies `memory`, and still applies blocked-path write denies when configured.
316
330
 
317
331
  Examples:
318
332
 
@@ -321,6 +335,7 @@ restricted-write + allowed_paths: src, vite.config.ts
321
335
  → --allow-tool=read
322
336
  → --allow-tool=write(src/**)
323
337
  → --allow-tool=write(vite.config.ts)
338
+ → --allow-tool=shell
324
339
  → --deny-tool=shell(git push)
325
340
  → --deny-tool=url
326
341
  → --deny-tool=memory
@@ -388,7 +403,8 @@ Use strict policies for multi-step pipelines:
388
403
  - broad project refactors: `restricted-write` with a directory like `src`
389
404
  - avoid `dangerous` except for local experiments
390
405
 
391
- For Claude writers that need file tools, set both layers explicitly:
406
+ Claude maps `restricted-write` to `acceptEdits` when `permission_mode` is omitted, so most Claude writer steps only need a `security_profile` and `allowed_paths`.
407
+ Legacy pipelines may still set `permission_mode: bypassPermissions` explicitly:
392
408
 
393
409
  ```json
394
410
  {
@@ -410,8 +426,10 @@ Conceptually:
410
426
  - agent nodes represent executable steps
411
427
  - edges connect outputs to downstream inputs
412
428
 
413
- At runtime, Singleton executes steps in dependency order.
414
- Dependencies are derived from the serialized references used in step inputs, especially `$PIPE:...`.
429
+ At runtime, Singleton executes the serialized `steps[]` array in order.
430
+ The builder writes this array in topological order when it saves a graph, but the CLI does not reorder steps while running a hand-authored JSON file.
431
+ `$PIPE:...` references must therefore point to outputs from earlier steps.
432
+ Preflight rejects future, unknown, or missing `$PIPE` references before any provider CLI is called.
415
433
 
416
434
  A complete example is in [Full pipeline example](#full-pipeline-example).
417
435
 
@@ -517,7 +535,7 @@ Pass one step output to another.
517
535
  Behavior:
518
536
 
519
537
  - references a previous step output kept in memory during the run
520
- - drives dependency ordering `$PIPE` is what makes the graph topological
538
+ - must be ordered manually in `steps[]` for hand-authored pipelines
521
539
  - must point to an already-available upstream step output, otherwise preflight fails
522
540
 
523
541
  ### `$FILES:<dir>`
@@ -715,6 +733,10 @@ Singleton distinguishes between:
715
733
  - **deliverables** — real project files outside `.singleton`
716
734
  - **intermediates** — reports, notes, plans, debug artifacts, or output files inside `.singleton`
717
735
 
736
+ Declared `$FILE` or `$FILES` sinks under `.singleton/` are treated as internal artifacts.
737
+ When a sink targets `.singleton/<something>` outside `.singleton/runs/`, Singleton redirects it into the current step workspace inside `.singleton/runs/<run-id>/`.
738
+ This keeps project-local output aliases such as `$FILE:.singleton/output/report.md` stable while preserving per-run traceability.
739
+
718
740
  This distinction is used in:
719
741
 
720
742
  - run manifests
@@ -779,7 +801,14 @@ Singleton's core model is provider-neutral:
779
801
  - supports optional `permission_mode`
780
802
  - supports explicit `model`
781
803
 
782
- If `permission_mode` is not set, Singleton does not inject one explicitly.
804
+ If `permission_mode` is set, Singleton currently accepts `bypassPermissions` and passes it through.
805
+ If `permission_mode` is not set, Singleton maps `security_profile` to Claude CLI permissions:
806
+
807
+ - `read-only` disables `Write`, `Edit`, `Bash`, and `NotebookEdit`
808
+ - `restricted-write` and `workspace-write` use `acceptEdits`
809
+ - `dangerous` uses `bypassPermissions`
810
+
811
+ Claude does not expose a native per-path write filter, so `restricted-write` relies on Singleton's post-run snapshot diff to reject edits outside `allowed_paths`.
783
812
 
784
813
  ### Codex
785
814
 
@@ -857,6 +886,8 @@ What it does:
857
886
 
858
887
  - scans `.singleton/agents`
859
888
  - scans `.claude/agents`
889
+ - scans `.github/agents`
890
+ - scans `.opencode/agents`
860
891
  - prints id, description, source, provider, permission mode, inputs, outputs
861
892
  - writes `.singleton/agents.json`
862
893
 
@@ -871,17 +902,22 @@ singleton run --pipeline /path/to/project/.singleton/pipelines/my-pipeline.json
871
902
  Flags:
872
903
 
873
904
  - `--dry-run` — validate without calling any LLM CLI
874
- - `--verbose` — surface raw provider stdout/stderr
905
+ - `--verbose` — show prompt and output excerpts in the run log
875
906
  - `--debug` — pause before each step for inspect/edit/skip/abort controls
876
907
 
877
908
  ### `serve`
878
909
 
879
- Start the builder API server.
910
+ Start the builder API server and serve the built web UI when `packages/web/dist` is present in the installed package.
880
911
 
881
912
  ```bash
882
913
  singleton serve --root /path/to/project
883
914
  ```
884
915
 
916
+ Options:
917
+
918
+ - `--root <path>` — project root, defaults to the current directory
919
+ - `--port <port>` — server port, defaults to `4317`
920
+
885
921
  ### `new`
886
922
 
887
923
  Create a new agent interactively.
@@ -944,14 +980,16 @@ Shell features:
944
980
 
945
981
  ## Builder
946
982
 
947
- The web builder is the visual authoring interface served by `singleton serve` + `packages/web` (Vite dev server on port 5173).
983
+ The web builder is the visual authoring interface.
984
+ In an installed package, `singleton serve` serves the built UI and API from one server, usually `http://localhost:4317`.
985
+ During source development, run `singleton serve` for the API and `npm run dev -w @singleton/web` or `cd packages/web && npm run dev` for the Vite UI on port `5173`.
948
986
 
949
987
  It lets you:
950
988
 
951
989
  - browse scanned agents and drop them on a canvas as agent nodes
952
990
  - add input nodes (`text` or `file`) and bind them to step inputs
953
991
  - draw edges from agent outputs to downstream inputs — these become `$PIPE` references
954
- - bind step outputs to `$FILE` / `$FILES` sinks
992
+ - generate default `$FILE` sinks for each agent output
955
993
  - save the resulting graph as a pipeline JSON in `.singleton/pipelines/`
956
994
 
957
995
  The serialization mapping:
@@ -959,12 +997,19 @@ The serialization mapping:
959
997
  - input nodes → `$INPUT:<id>` references
960
998
  - graph edges → serialized references
961
999
  - topological order → execution order
1000
+ - saved `steps[]` order → CLI runtime order
1001
+ - agent outputs → default `$FILE:./output/<agent>.<output>.md` sinks
962
1002
 
963
1003
  Cycles are rejected at save time.
964
1004
 
1005
+ The runtime only requires `steps[]`.
1006
+ The visual `nodes[]` / `edges[]` fields are used by the builder and by runtime input collection for `$INPUT` definitions.
1007
+
965
1008
  ## Full pipeline example
966
1009
 
967
- Illustrative only — this is not a ready-to-run project. The agents `code-generator` and `code-review` are placeholders to show how the pieces fit together. For executable examples, see `examples/claude-code-review/`, `examples/codex-code-review/`, `examples/mixed-code-review/`, `examples/frontend-audit/`, and `examples/opencode-review/`.
1010
+ Illustrative only — this is not a ready-to-run project. The agents `code-generator` and `code-review` are placeholders to show how the pieces fit together. For repository examples, see `examples/claude-code-review/`, `examples/codex-code-review/`, `examples/mixed-code-review/`, `examples/frontend-audit/`, and `examples/opencode-review/`.
1011
+
1012
+ The code-review examples are templates: use their `--dry-run` commands as-is, then copy or adapt their `.singleton` folders into a real target project before running writer steps against real files.
968
1013
 
969
1014
  A two-step pipeline: a generator writes code from a spec, a reviewer reads that code and emits a report.
970
1015
 
@@ -996,7 +1041,7 @@ A two-step pipeline: a generator writes code from a spec, a reviewer reads that
996
1041
  "source_code": "$PIPE:code-generator.source_code"
997
1042
  },
998
1043
  "outputs": {
999
- "report": "$FILE:.singleton/runs/latest/review.md"
1044
+ "report": "$FILE:.singleton/output/review.md"
1000
1045
  }
1001
1046
  }
1002
1047
  ]
@@ -1009,7 +1054,7 @@ What this pipeline does at runtime:
1009
1054
  2. runs `code-generator` with the spec content injected as `<file>...</file>`
1010
1055
  3. writes the generator's output to `src/generated/output.js` (a deliverable)
1011
1056
  4. runs `code-review` with the generator's output passed via `$PIPE`
1012
- 5. writes the review to `.singleton/runs/latest/review.md` (an intermediate)
1057
+ 5. writes the review as an intermediate in the current run workspace
1013
1058
  6. emits a manifest distinguishing the deliverable from the intermediate
1014
1059
 
1015
1060
  See `examples/mixed-code-review/` for an end-to-end example using both Claude and Codex.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "singleton-pipeline",
3
- "version": "0.4.0-beta.11",
3
+ "version": "0.4.0-beta.13",
4
4
  "description": "Visual pipeline builder for multi-agent AI workflows. Orchestrates Claude Code, Codex, Copilot, and OpenCode under a unified security policy.",
5
5
  "keywords": [
6
6
  "ai",
@@ -41,6 +41,7 @@
41
41
  "packages/web/dist/**",
42
42
  "packages/web/package.json",
43
43
  "docs/reference.md",
44
+ "CHANGELOG.md",
44
45
  "README.md",
45
46
  "LICENSE"
46
47
  ],
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@singleton/cli",
3
- "version": "0.4.0-beta.11",
3
+ "version": "0.4.0-beta.12",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "singleton": "./src/index.js"