@openrig/cli 0.4.8 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/daemon/assets/claude-statusline-context.cjs +40 -8
- package/daemon/assets/plugins/openrig-core/hooks/scripts/activity-relay.cjs +0 -0
- package/daemon/assets/plugins/openrig-core/skills/mission-slice-sop/SKILL.md +7 -4
- package/daemon/assets/plugins/openrig-core/skills/openrig-user/SKILL.md +68 -17
- package/daemon/assets/plugins/openrig-core/skills/queue-handoff/SKILL.md +2 -0
- package/daemon/assets/plugins/openrig-core/skills/seat-continuity-and-handover/SKILL.md +2 -1
- package/daemon/assets/plugins/openrig-core/skills/session-compaction-and-restore/SKILL.md +1 -0
- package/daemon/dist/adapters/claude-code-adapter.d.ts +36 -0
- package/daemon/dist/adapters/claude-code-adapter.d.ts.map +1 -1
- package/daemon/dist/adapters/claude-code-adapter.js +203 -3
- package/daemon/dist/adapters/claude-code-adapter.js.map +1 -1
- package/daemon/dist/adapters/codex-runtime-adapter.d.ts +12 -0
- package/daemon/dist/adapters/codex-runtime-adapter.d.ts.map +1 -1
- package/daemon/dist/adapters/codex-runtime-adapter.js +24 -2
- package/daemon/dist/adapters/codex-runtime-adapter.js.map +1 -1
- package/daemon/dist/build-info.js +3 -3
- package/daemon/dist/domain/agent-activity-store.d.ts +1 -0
- package/daemon/dist/domain/agent-activity-store.d.ts.map +1 -1
- package/daemon/dist/domain/agent-activity-store.js +2 -2
- package/daemon/dist/domain/agent-activity-store.js.map +1 -1
- package/daemon/dist/domain/claude-activity-hooks.d.ts +33 -0
- package/daemon/dist/domain/claude-activity-hooks.d.ts.map +1 -0
- package/daemon/dist/domain/claude-activity-hooks.js +60 -0
- package/daemon/dist/domain/claude-activity-hooks.js.map +1 -0
- package/daemon/dist/domain/context-packs/bundle-assembler.d.ts +30 -0
- package/daemon/dist/domain/context-packs/bundle-assembler.d.ts.map +1 -1
- package/daemon/dist/domain/context-packs/bundle-assembler.js +31 -1
- package/daemon/dist/domain/context-packs/bundle-assembler.js.map +1 -1
- package/daemon/dist/domain/context-packs/context-pack-library-service.d.ts +69 -14
- package/daemon/dist/domain/context-packs/context-pack-library-service.d.ts.map +1 -1
- package/daemon/dist/domain/context-packs/context-pack-library-service.js +263 -48
- package/daemon/dist/domain/context-packs/context-pack-library-service.js.map +1 -1
- package/daemon/dist/domain/context-packs/context-pack-types.d.ts +2 -2
- package/daemon/dist/domain/context-packs/context-pack-types.d.ts.map +1 -1
- package/daemon/dist/domain/context-packs/context-pack-types.js.map +1 -1
- package/daemon/dist/domain/context-packs/manifest-parser.d.ts.map +1 -1
- package/daemon/dist/domain/context-packs/manifest-parser.js +11 -0
- package/daemon/dist/domain/context-packs/manifest-parser.js.map +1 -1
- package/daemon/dist/domain/context-packs/ref-safety.d.ts +11 -0
- package/daemon/dist/domain/context-packs/ref-safety.d.ts.map +1 -0
- package/daemon/dist/domain/context-packs/ref-safety.js +46 -0
- package/daemon/dist/domain/context-packs/ref-safety.js.map +1 -0
- package/daemon/dist/domain/context-packs/token-estimate.d.ts +3 -0
- package/daemon/dist/domain/context-packs/token-estimate.d.ts.map +1 -0
- package/daemon/dist/domain/context-packs/token-estimate.js +5 -0
- package/daemon/dist/domain/context-packs/token-estimate.js.map +1 -0
- package/daemon/dist/domain/plugin-vendor-service.d.ts +14 -0
- package/daemon/dist/domain/plugin-vendor-service.d.ts.map +1 -1
- package/daemon/dist/domain/plugin-vendor-service.js +26 -2
- package/daemon/dist/domain/plugin-vendor-service.js.map +1 -1
- package/daemon/dist/domain/provider/claude-usage-reader.d.ts +44 -0
- package/daemon/dist/domain/provider/claude-usage-reader.d.ts.map +1 -0
- package/daemon/dist/domain/provider/claude-usage-reader.js +112 -0
- package/daemon/dist/domain/provider/claude-usage-reader.js.map +1 -0
- package/daemon/dist/domain/provider/codex-auth-reader.d.ts +18 -0
- package/daemon/dist/domain/provider/codex-auth-reader.d.ts.map +1 -0
- package/daemon/dist/domain/provider/codex-auth-reader.js +64 -0
- package/daemon/dist/domain/provider/codex-auth-reader.js.map +1 -0
- package/daemon/dist/domain/provider/host-usage-rollup.d.ts +51 -0
- package/daemon/dist/domain/provider/host-usage-rollup.d.ts.map +1 -0
- package/daemon/dist/domain/provider/host-usage-rollup.js +162 -0
- package/daemon/dist/domain/provider/host-usage-rollup.js.map +1 -0
- package/daemon/dist/domain/provider/provider-collect.d.ts +22 -0
- package/daemon/dist/domain/provider/provider-collect.d.ts.map +1 -0
- package/daemon/dist/domain/provider/provider-collect.js +74 -0
- package/daemon/dist/domain/provider/provider-collect.js.map +1 -0
- package/daemon/dist/domain/provider/provider-policy.d.ts +38 -0
- package/daemon/dist/domain/provider/provider-policy.d.ts.map +1 -0
- package/daemon/dist/domain/provider/provider-policy.js +76 -0
- package/daemon/dist/domain/provider/provider-policy.js.map +1 -0
- package/daemon/dist/domain/provider/provider-read-model.d.ts +28 -0
- package/daemon/dist/domain/provider/provider-read-model.d.ts.map +1 -0
- package/daemon/dist/domain/provider/provider-read-model.js +68 -0
- package/daemon/dist/domain/provider/provider-read-model.js.map +1 -0
- package/daemon/dist/domain/provider/provider-service-impl.d.ts +26 -0
- package/daemon/dist/domain/provider/provider-service-impl.d.ts.map +1 -0
- package/daemon/dist/domain/provider/provider-service-impl.js +83 -0
- package/daemon/dist/domain/provider/provider-service-impl.js.map +1 -0
- package/daemon/dist/domain/provider/provider-service.d.ts +33 -0
- package/daemon/dist/domain/provider/provider-service.d.ts.map +1 -0
- package/daemon/dist/domain/provider/provider-service.js +6 -0
- package/daemon/dist/domain/provider/provider-service.js.map +1 -0
- package/daemon/dist/domain/provider/provider-signals.d.ts +76 -0
- package/daemon/dist/domain/provider/provider-signals.d.ts.map +1 -0
- package/daemon/dist/domain/provider/provider-signals.js +144 -0
- package/daemon/dist/domain/provider/provider-signals.js.map +1 -0
- package/daemon/dist/domain/provider/provider-types.d.ts +101 -0
- package/daemon/dist/domain/provider/provider-types.d.ts.map +1 -0
- package/daemon/dist/domain/provider/provider-types.js +7 -0
- package/daemon/dist/domain/provider/provider-types.js.map +1 -0
- package/daemon/dist/domain/provider/reactive-tap.d.ts +29 -0
- package/daemon/dist/domain/provider/reactive-tap.d.ts.map +1 -0
- package/daemon/dist/domain/provider/reactive-tap.js +80 -0
- package/daemon/dist/domain/provider/reactive-tap.js.map +1 -0
- package/daemon/dist/domain/rigspec-instantiator.d.ts +7 -23
- package/daemon/dist/domain/rigspec-instantiator.d.ts.map +1 -1
- package/daemon/dist/domain/rigspec-instantiator.js +3 -61
- package/daemon/dist/domain/rigspec-instantiator.js.map +1 -1
- package/daemon/dist/domain/rigspec-preflight.d.ts +11 -0
- package/daemon/dist/domain/rigspec-preflight.d.ts.map +1 -1
- package/daemon/dist/domain/rigspec-preflight.js +43 -1
- package/daemon/dist/domain/rigspec-preflight.js.map +1 -1
- package/daemon/dist/domain/runtime-adapter.d.ts +2 -11
- package/daemon/dist/domain/runtime-adapter.d.ts.map +1 -1
- package/daemon/dist/domain/runtime-adapter.js.map +1 -1
- package/daemon/dist/domain/scope/attestation-lineage.generated.d.ts +14 -0
- package/daemon/dist/domain/scope/attestation-lineage.generated.d.ts.map +1 -0
- package/daemon/dist/domain/scope/attestation-lineage.generated.js +26 -0
- package/daemon/dist/domain/scope/attestation-lineage.generated.js.map +1 -0
- package/daemon/dist/domain/scope/scope-approve.d.ts +13 -0
- package/daemon/dist/domain/scope/scope-approve.d.ts.map +1 -1
- package/daemon/dist/domain/scope/scope-approve.js +50 -10
- package/daemon/dist/domain/scope/scope-approve.js.map +1 -1
- package/daemon/dist/domain/startup-validation.d.ts.map +1 -1
- package/daemon/dist/domain/startup-validation.js +18 -54
- package/daemon/dist/domain/startup-validation.js.map +1 -1
- package/daemon/dist/domain/stream-store.d.ts +4 -0
- package/daemon/dist/domain/stream-store.d.ts.map +1 -1
- package/daemon/dist/domain/stream-store.js +15 -2
- package/daemon/dist/domain/stream-store.js.map +1 -1
- package/daemon/dist/domain/types.d.ts +2 -9
- package/daemon/dist/domain/types.d.ts.map +1 -1
- package/daemon/dist/domain/types.js.map +1 -1
- package/daemon/dist/domain/workspace/default-workspace-scaffold.js +1 -1
- package/daemon/dist/routes/context-packs.d.ts.map +1 -1
- package/daemon/dist/routes/context-packs.js +157 -75
- package/daemon/dist/routes/context-packs.js.map +1 -1
- package/daemon/dist/routes/provider.d.ts +3 -0
- package/daemon/dist/routes/provider.d.ts.map +1 -0
- package/daemon/dist/routes/provider.js +124 -0
- package/daemon/dist/routes/provider.js.map +1 -0
- package/daemon/dist/routes/scope-approve.d.ts.map +1 -1
- package/daemon/dist/routes/scope-approve.js +6 -3
- package/daemon/dist/routes/scope-approve.js.map +1 -1
- package/daemon/dist/routes/scope-audit.d.ts.map +1 -1
- package/daemon/dist/routes/scope-audit.js +4 -1
- package/daemon/dist/routes/scope-audit.js.map +1 -1
- package/daemon/dist/routes/stream.d.ts.map +1 -1
- package/daemon/dist/routes/stream.js +71 -1
- package/daemon/dist/routes/stream.js.map +1 -1
- package/daemon/dist/server.d.ts +3 -0
- package/daemon/dist/server.d.ts.map +1 -1
- package/daemon/dist/server.js +5 -0
- package/daemon/dist/server.js.map +1 -1
- package/daemon/dist/startup.d.ts.map +1 -1
- package/daemon/dist/startup.js +21 -11
- package/daemon/dist/startup.js.map +1 -1
- package/daemon/docs/reference/developing.md +39 -0
- package/daemon/specs/agents/apps/vault-specialist/agent.yaml +1 -1
- package/daemon/specs/agents/conveyor/builder/agent.yaml +1 -1
- package/daemon/specs/agents/conveyor/lead/agent.yaml +1 -1
- package/daemon/specs/agents/conveyor/planner/agent.yaml +1 -1
- package/daemon/specs/agents/conveyor/reviewer/agent.yaml +1 -1
- package/daemon/specs/agents/design/product-designer/agent.yaml +1 -1
- package/daemon/specs/agents/development/implementer/agent.yaml +1 -1
- package/daemon/specs/agents/development/qa/agent.yaml +1 -1
- package/daemon/specs/agents/factory-rsi/dogfood/agent.yaml +1 -1
- package/daemon/specs/agents/factory-rsi/release-manager/agent.yaml +1 -1
- package/daemon/specs/agents/orchestration/orchestrator/agent.yaml +1 -1
- package/daemon/specs/agents/product-management/pm/agent.yaml +1 -0
- package/daemon/specs/agents/research/analyst/agent.yaml +1 -1
- package/daemon/specs/agents/research/synthesizer/agent.yaml +1 -1
- package/daemon/specs/agents/review/independent-reviewer/agent.yaml +1 -1
- package/daemon/specs/agents/shared/agent.yaml +6 -0
- package/daemon/specs/agents/shared/runtime/claude-activity-hooks.json +4 -0
- package/daemon/specs/agents/shared/skills/core/watchdog/SKILL.md +1 -0
- package/dist/bin-wrapper.d.ts.map +1 -1
- package/dist/bin-wrapper.js +7 -0
- package/dist/bin-wrapper.js.map +1 -1
- package/dist/build-info.js +3 -3
- package/dist/commands/agent-image.d.ts.map +1 -1
- package/dist/commands/agent-image.js +2 -1
- package/dist/commands/agent-image.js.map +1 -1
- package/dist/commands/broadcast.d.ts.map +1 -1
- package/dist/commands/broadcast.js +37 -2
- package/dist/commands/broadcast.js.map +1 -1
- package/dist/commands/context.d.ts +2 -7
- package/dist/commands/context.d.ts.map +1 -1
- package/dist/commands/context.js +391 -213
- package/dist/commands/context.js.map +1 -1
- package/dist/commands/provider.d.ts +4 -0
- package/dist/commands/provider.d.ts.map +1 -0
- package/dist/commands/provider.js +218 -0
- package/dist/commands/provider.js.map +1 -0
- package/dist/commands/ps.d.ts +7 -0
- package/dist/commands/ps.d.ts.map +1 -1
- package/dist/commands/ps.js +34 -4
- package/dist/commands/ps.js.map +1 -1
- package/dist/commands/queue.d.ts.map +1 -1
- package/dist/commands/queue.js +38 -8
- package/dist/commands/queue.js.map +1 -1
- package/dist/commands/scope.d.ts.map +1 -1
- package/dist/commands/scope.js +48 -4
- package/dist/commands/scope.js.map +1 -1
- package/dist/commands/send.d.ts.map +1 -1
- package/dist/commands/send.js +70 -11
- package/dist/commands/send.js.map +1 -1
- package/dist/commands/stream.d.ts +1 -0
- package/dist/commands/stream.d.ts.map +1 -1
- package/dist/commands/stream.js +93 -0
- package/dist/commands/stream.js.map +1 -1
- package/dist/commands/tui.d.ts +4 -0
- package/dist/commands/tui.d.ts.map +1 -0
- package/dist/commands/tui.js +29 -0
- package/dist/commands/tui.js.map +1 -0
- package/dist/commands/walk.d.ts +19 -0
- package/dist/commands/walk.d.ts.map +1 -0
- package/dist/commands/walk.js +139 -0
- package/dist/commands/walk.js.map +1 -0
- package/dist/context-resolve.d.ts +14 -0
- package/dist/context-resolve.d.ts.map +1 -0
- package/dist/context-resolve.js +40 -0
- package/dist/context-resolve.js.map +1 -0
- package/dist/front-door.d.ts +31 -0
- package/dist/front-door.d.ts.map +1 -0
- package/dist/front-door.js +114 -0
- package/dist/front-door.js.map +1 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +19 -6
- package/dist/index.js.map +1 -1
- package/dist/lib/scope/attestation-lineage.d.ts +14 -0
- package/dist/lib/scope/attestation-lineage.d.ts.map +1 -0
- package/dist/lib/scope/attestation-lineage.js +34 -0
- package/dist/lib/scope/attestation-lineage.js.map +1 -0
- package/package.json +4 -2
- package/tui/dist/daemon-client.d.ts +56 -0
- package/tui/dist/daemon-client.d.ts.map +1 -0
- package/tui/dist/daemon-client.js +99 -0
- package/tui/dist/daemon-client.js.map +1 -0
- package/tui/dist/demo-data.d.ts +3 -0
- package/tui/dist/demo-data.d.ts.map +1 -0
- package/tui/dist/demo-data.js +52 -0
- package/tui/dist/demo-data.js.map +1 -0
- package/tui/dist/detail.d.ts +34 -0
- package/tui/dist/detail.d.ts.map +1 -0
- package/tui/dist/detail.js +47 -0
- package/tui/dist/detail.js.map +1 -0
- package/tui/dist/grammar.d.ts +3 -0
- package/tui/dist/grammar.d.ts.map +1 -0
- package/tui/dist/grammar.js +66 -0
- package/tui/dist/grammar.js.map +1 -0
- package/tui/dist/hydrate.d.ts +78 -0
- package/tui/dist/hydrate.d.ts.map +1 -0
- package/tui/dist/hydrate.js +294 -0
- package/tui/dist/hydrate.js.map +1 -0
- package/tui/dist/index.d.ts +12 -0
- package/tui/dist/index.d.ts.map +1 -0
- package/tui/dist/index.js +12 -0
- package/tui/dist/index.js.map +1 -0
- package/tui/dist/input.d.ts +21 -0
- package/tui/dist/input.d.ts.map +1 -0
- package/tui/dist/input.js +128 -0
- package/tui/dist/input.js.map +1 -0
- package/tui/dist/live.d.ts +20 -0
- package/tui/dist/live.d.ts.map +1 -0
- package/tui/dist/live.js +67 -0
- package/tui/dist/live.js.map +1 -0
- package/tui/dist/main.d.ts +3 -0
- package/tui/dist/main.d.ts.map +1 -0
- package/tui/dist/main.js +184 -0
- package/tui/dist/main.js.map +1 -0
- package/tui/dist/motion.d.ts +13 -0
- package/tui/dist/motion.d.ts.map +1 -0
- package/tui/dist/motion.js +31 -0
- package/tui/dist/motion.js.map +1 -0
- package/tui/dist/navigator.d.ts +21 -0
- package/tui/dist/navigator.d.ts.map +1 -0
- package/tui/dist/navigator.js +168 -0
- package/tui/dist/navigator.js.map +1 -0
- package/tui/dist/refresh.d.ts +3 -0
- package/tui/dist/refresh.d.ts.map +1 -0
- package/tui/dist/refresh.js +9 -0
- package/tui/dist/refresh.js.map +1 -0
- package/tui/dist/render.d.ts +21 -0
- package/tui/dist/render.d.ts.map +1 -0
- package/tui/dist/render.js +807 -0
- package/tui/dist/render.js.map +1 -0
- package/tui/dist/sections.d.ts +4 -0
- package/tui/dist/sections.d.ts.map +1 -0
- package/tui/dist/sections.js +19 -0
- package/tui/dist/sections.js.map +1 -0
- package/tui/dist/socket-server.d.ts +24 -0
- package/tui/dist/socket-server.d.ts.map +1 -0
- package/tui/dist/socket-server.js +85 -0
- package/tui/dist/socket-server.js.map +1 -0
- package/tui/dist/state.d.ts +51 -0
- package/tui/dist/state.d.ts.map +1 -0
- package/tui/dist/state.js +480 -0
- package/tui/dist/state.js.map +1 -0
- package/tui/dist/stylize.d.ts +4 -0
- package/tui/dist/stylize.d.ts.map +1 -0
- package/tui/dist/stylize.js +248 -0
- package/tui/dist/stylize.js.map +1 -0
- package/tui/dist/theme.d.ts +19 -0
- package/tui/dist/theme.d.ts.map +1 -0
- package/tui/dist/theme.js +86 -0
- package/tui/dist/theme.js.map +1 -0
- package/tui/dist/topology/canvas.d.ts +43 -0
- package/tui/dist/topology/canvas.d.ts.map +1 -0
- package/tui/dist/topology/canvas.js +131 -0
- package/tui/dist/topology/canvas.js.map +1 -0
- package/tui/dist/topology/fixture.d.ts +4 -0
- package/tui/dist/topology/fixture.d.ts.map +1 -0
- package/tui/dist/topology/fixture.js +71 -0
- package/tui/dist/topology/fixture.js.map +1 -0
- package/tui/dist/topology/glyphs.d.ts +21 -0
- package/tui/dist/topology/glyphs.d.ts.map +1 -0
- package/tui/dist/topology/glyphs.js +49 -0
- package/tui/dist/topology/glyphs.js.map +1 -0
- package/tui/dist/topology/graph-types.d.ts +39 -0
- package/tui/dist/topology/graph-types.d.ts.map +1 -0
- package/tui/dist/topology/graph-types.js +2 -0
- package/tui/dist/topology/graph-types.js.map +1 -0
- package/tui/dist/topology/layout.d.ts +52 -0
- package/tui/dist/topology/layout.d.ts.map +1 -0
- package/tui/dist/topology/layout.js +118 -0
- package/tui/dist/topology/layout.js.map +1 -0
- package/tui/dist/topology/render-graph.d.ts +8 -0
- package/tui/dist/topology/render-graph.d.ts.map +1 -0
- package/tui/dist/topology/render-graph.js +20 -0
- package/tui/dist/topology/render-graph.js.map +1 -0
- package/tui/dist/topology/runtime-marks.d.ts +53 -0
- package/tui/dist/topology/runtime-marks.d.ts.map +1 -0
- package/tui/dist/topology/runtime-marks.js +185 -0
- package/tui/dist/topology/runtime-marks.js.map +1 -0
- package/tui/dist/topology/styles/braille.d.ts +5 -0
- package/tui/dist/topology/styles/braille.d.ts.map +1 -0
- package/tui/dist/topology/styles/braille.js +84 -0
- package/tui/dist/topology/styles/braille.js.map +1 -0
- package/tui/dist/topology/styles/hatchet.d.ts +41 -0
- package/tui/dist/topology/styles/hatchet.d.ts.map +1 -0
- package/tui/dist/topology/styles/hatchet.js +146 -0
- package/tui/dist/topology/styles/hatchet.js.map +1 -0
- package/tui/dist/types.d.ts +362 -0
- package/tui/dist/types.d.ts.map +1 -0
- package/tui/dist/types.js +6 -0
- package/tui/dist/types.js.map +1 -0
- package/ui/dist/assets/{index-DkNi0RT8.js → index-Dv5VaLCN.js} +135 -135
- package/ui/dist/index.html +1 -1
- package/dist/commands/context-pack.d.ts +0 -4
- package/dist/commands/context-pack.d.ts.map +0 -1
- package/dist/commands/context-pack.js +0 -357
- package/dist/commands/context-pack.js.map +0 -1
|
@@ -3,12 +3,13 @@
|
|
|
3
3
|
// Reads Claude status line JSON from stdin, extracts context window data,
|
|
4
4
|
// and writes atomically to a sidecar file.
|
|
5
5
|
//
|
|
6
|
-
// Usage: node claude-statusline-context.js <
|
|
6
|
+
// Usage: node claude-statusline-context.js <context-output-path-or-dir> [provider-usage-dir]
|
|
7
7
|
|
|
8
8
|
const fs = require("fs");
|
|
9
9
|
const path = require("path");
|
|
10
10
|
|
|
11
11
|
const outputTarget = process.argv[2];
|
|
12
|
+
const providerUsageTarget = process.argv[3];
|
|
12
13
|
if (!outputTarget) {
|
|
13
14
|
process.exit(0); // No output path — silently exit
|
|
14
15
|
}
|
|
@@ -51,14 +52,22 @@ process.stdin.on("end", () => {
|
|
|
51
52
|
process.exit(0);
|
|
52
53
|
}
|
|
53
54
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
55
|
+
writeJsonAtomic(outputPath, sample);
|
|
56
|
+
|
|
57
|
+
if (providerUsageTarget) {
|
|
58
|
+
const providerUsagePath = resolveOutputPath(providerUsageTarget, raw);
|
|
59
|
+
if (!providerUsagePath) {
|
|
60
|
+
logFailure("could not resolve provider_usage output path from Claude status line payload");
|
|
61
|
+
process.exit(0);
|
|
62
|
+
}
|
|
63
|
+
const rateLimits = normalizeRateLimits(raw.rate_limits);
|
|
64
|
+
const providerUsage = {
|
|
65
|
+
seatSession: raw.session_name || raw.session_id,
|
|
66
|
+
asOf: new Date().toISOString(),
|
|
67
|
+
...(rateLimits ? { accountKind: "subscription", rateLimits } : {}),
|
|
68
|
+
};
|
|
69
|
+
writeJsonAtomic(providerUsagePath, providerUsage);
|
|
59
70
|
}
|
|
60
|
-
fs.writeFileSync(tmpPath, JSON.stringify(sample), "utf-8");
|
|
61
|
-
fs.renameSync(tmpPath, outputPath);
|
|
62
71
|
} catch (error) {
|
|
63
72
|
logFailure("failed to collect Claude context status line", error);
|
|
64
73
|
process.exit(0);
|
|
@@ -78,3 +87,26 @@ function resolveOutputPath(target, raw) {
|
|
|
78
87
|
const safe = String(sessionKey).replace(/[^a-zA-Z0-9@._-]/g, "_");
|
|
79
88
|
return path.join(target, safe + ".json");
|
|
80
89
|
}
|
|
90
|
+
|
|
91
|
+
function normalizeRateLimits(value) {
|
|
92
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) return null;
|
|
93
|
+
const result = {};
|
|
94
|
+
for (const key of ["five_hour", "seven_day"]) {
|
|
95
|
+
const window = value[key];
|
|
96
|
+
if (!window || typeof window !== "object" || Array.isArray(window)) continue;
|
|
97
|
+
if (typeof window.used_percentage !== "number" || !Number.isFinite(window.used_percentage)
|
|
98
|
+
|| typeof window.resets_at !== "string") continue;
|
|
99
|
+
result[key] = { usedPercent: window.used_percentage, resetsAt: window.resets_at };
|
|
100
|
+
}
|
|
101
|
+
return result.five_hour || result.seven_day ? result : null;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
function writeJsonAtomic(outputPath, value) {
|
|
105
|
+
const tmpPath = outputPath + ".tmp";
|
|
106
|
+
const dir = path.dirname(outputPath);
|
|
107
|
+
if (!fs.existsSync(dir)) {
|
|
108
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
109
|
+
}
|
|
110
|
+
fs.writeFileSync(tmpPath, JSON.stringify(value), "utf-8");
|
|
111
|
+
fs.renameSync(tmpPath, outputPath);
|
|
112
|
+
}
|
|
File without changes
|
|
@@ -12,7 +12,10 @@ metadata:
|
|
|
12
12
|
|
|
13
13
|
# Mission/Slice SOP — how you work a mission & slice
|
|
14
14
|
|
|
15
|
-
Use this skill to actually **do** mission/slice work the way OpenRig expects: author the convention sections, track on the canonical files, prove on them, hand off through them, and survive compaction on them. **Do the work described here; do not merely explain the protocol.** The deterministic backstop is `rig scope audit` —
|
|
15
|
+
Use this skill to actually **do** mission/slice work the way OpenRig expects: author the convention sections, track on the canonical files, prove on them, hand off through them, and survive compaction on them. **Do the work described here; do not merely explain the protocol.** The deterministic backstop is `rig scope audit` — an **advisory, fail-open** check (it records and advises, never blocks a write; see Proportionality below), not an authority you serve. The conventions themselves live in ONE document: **`docs/reference/sdlc-conventions.md`** in the repo, materialized by the daemon at **`$OPENRIG_HOME/reference/sdlc-conventions.md`** (default `~/.openrig/reference/sdlc-conventions.md`) on an installed package — this skill teaches the flow; the SSOT defines the formats.
|
|
16
|
+
|
|
17
|
+
## Proportionality — this SOP serves shipping; it is not the work itself
|
|
18
|
+
The working product is the deliverable. This bookkeeping exists so the work survives handoff, compaction, and review — nothing more. **Match it to stakes:** OpenRig core = full ceremony; Studio Box / SDK / app slices = pragmatic — the mini-requirements may BE the whole PRD, and a couple of honest, LOOKed proof lines beat an elaborate contract. The `rig scope audit` backstop is **advisory and fail-open** (its own SSOT says so): it never blocks a build and is not a gate you clear before proceeding. If you're spending more time on the convention files or the audit than on the running product, stop and go build. Running the full apparatus on a small change is the letter-worship failure, not diligence.
|
|
16
19
|
|
|
17
20
|
## The SDLC flow (intent → proof)
|
|
18
21
|
|
|
@@ -30,7 +33,7 @@ intent → mini-requirements + proof contract → (UI slices: mockups)
|
|
|
30
33
|
- **PARSER CONTRACT (README AND IMPLEMENTATION-PRD, from first draft — a parser contract, not stylistic):** each doc carries a verbatim, **undecorated** `## Mini-requirements` heading with a **numbered list**, and a verbatim, **undecorated** `## Proof contract` heading whose checkbox (`- [ ]`) lines are **character-identical** across the two files. `rig scope audit` parses the PRD's `## Proof contract`; a prose rollup (e.g. `## Required proof …`) or any renamed/decorated heading trips **`proof_contract_missing_or_malformed`** and forces a post-lock format patch. Never rename or decorate these two headings, and keep the PRD's checkbox lines byte-for-byte equal to the README's.
|
|
31
34
|
- **REFERENCE-NOT-RESTATE (public / runnable examples — an honesty rail, from first draft):** any example that shows output or a value the referenced file/command **derives** — repo/runtime counts, current-state totals, hashes, timestamps — must **reference the source/derivation, omit the volatile value, or pin an explicitly stable fixture**; never hardcode the live count/state in a public or shipped doc. "Illustrative" derived output is a lie on a timer: `OK registry (2 manifests)` goes false the instant an entry lands. Write the invariant form (`OK registry (<N> manifests)`, N = entries in `registry.json`) or name the fixture instead of the momentary number. Restated derivable state in a public doc is a defect `rig scope audit` will not catch — the author owns it.
|
|
32
35
|
3. **Plan-lock**: `rig scope slice approve <slice> --scope spec` — "the PRD matches the intent; THIS artifact set is what gets built." One daemon-side write: frontmatter stamp + append-only audit row.
|
|
33
|
-
- **PRE-PLAN-LOCK SELF-CHECK (
|
|
36
|
+
- **PRE-PLAN-LOCK SELF-CHECK (advisory, not a gate):** before requesting `--scope spec`, it's worth running `rig scope audit --mission <mission> --json` and clearing any real **format** defect (e.g. `proof_contract_missing_or_malformed`) so the parser can read your proof contract — that's a genuine machine-parsing need, cheap to fix. But the audit is fail-open: findings do NOT block the lock or the build, and you do NOT need a zero-findings score to proceed. Fix what's real, skip what isn't, keep moving.
|
|
34
37
|
4. **Build the locked set** — look at the mockups, not just the spec text.
|
|
35
38
|
5. **QA visual compare**: for each deliverable, load the planned mockup, produce the real artifact in a test/demo environment, visually compare, and record the verdict.
|
|
36
39
|
6. **Drop proof**: `rig proof add <slice> --artifact-type qa --verdict PASS --candidate-sha <tip> --money-evidence "…" --evidences "1,3" --media "walk.webm,panel.png" --self-check "…"` — the C1 header's closed sets validate at drop time; `--evidences` joins the drop to its proof-contract items and `--media` names the curated proof/-relative media the drop stands behind (that pairing + media set is what the UI's DELIVERED section renders).
|
|
@@ -44,7 +47,7 @@ intent → mini-requirements + proof contract → (UI slices: mockups)
|
|
|
44
47
|
|
|
45
48
|
## The canonical files (the operating surface)
|
|
46
49
|
|
|
47
|
-
> The canonical files below are the **operating surface of the work** — you track on them, prove on them, hand off through them, and survive compaction on them.
|
|
50
|
+
> The canonical files below are the **operating surface of the work** — you track on them, prove on them, hand off through them, and survive compaction on them. Keep them current because that is what lets the work survive handoff, compaction, and review — but they **serve** the product, they are not the product. If you're polishing these files while the actual thing isn't shipping, you've inverted it: go build, then update them.
|
|
48
51
|
|
|
49
52
|
- **README.md** (mission + slice) — the overview, OPENING with the convention sections (`## Intent` / `## Mini-requirements` / `## Proof contract`). The **mission README carries this SOP at its bottom.**
|
|
50
53
|
- **IMPLEMENTATION-PRD.md** — the full PRD; opens with the mini-requirements; the `## Proof contract` here is what the UI's DELIVERED pairing joins proof against.
|
|
@@ -100,7 +103,7 @@ When you `rig capture` a pane, **greyed / ghost autocomplete suggestions are NOT
|
|
|
100
103
|
|
|
101
104
|
## Moment-of-truth checklist
|
|
102
105
|
|
|
103
|
-
- **Starting a slice?** → intent recorded verbatim? **PRD carries a verbatim numbered `## Mini-requirements` + a verbatim `## Proof contract` whose `- [ ]` lines are character-identical to the README's** (parser contract)? **no example restates derivable state** — counts/hashes/timestamps referenced, omitted, or pinned to a stable fixture, never hardcoded (reference-not-restate)? mockups attached (UI slices)?
|
|
106
|
+
- **Starting a slice?** → intent recorded verbatim? **PRD carries a verbatim numbered `## Mini-requirements` + a verbatim `## Proof contract` whose `- [ ]` lines are character-identical to the README's** (parser contract)? **no example restates derivable state** — counts/hashes/timestamps referenced, omitted, or pinned to a stable fixture, never hardcoded (reference-not-restate)? mockups attached (UI slices)? ran `rig scope audit` and fixed any real **format** defect so the parser reads the proof contract (advisory — a clean score is NOT required to lock)?
|
|
104
107
|
- **Finishing a slice?** → every proof-contract item has curated evidence via `rig proof add … --evidences --media` (C1 drops — never only hand-placed files)? PROGRESS updated? MISSION_NOTES `§1` refreshed? proof locked (`--scope delivery`)? Handed off via queue?
|
|
105
108
|
- **Committing?** → PROGRESS updated?
|
|
106
109
|
- **Compacting?** → filed your state in MISSION_NOTES?
|
|
@@ -311,7 +311,7 @@ The floor and YOLO are **launch flags** OpenRig sets deterministically; the Lock
|
|
|
311
311
|
## v0.3.x Starter, Workspace, And Plugin Surfaces
|
|
312
312
|
|
|
313
313
|
OpenRig v0.3.0 adds `rig agent-image`, `rig context-pack`, `rig workspace`, and
|
|
314
|
-
`rig config init-workspace`. It also shifts fresh-user starter guidance toward
|
|
314
|
+
`rig config init-workspace`. *(0.5.0: the `rig context-pack` alias is retired — the store + compose library is the single `rig context` noun; see "Context packs and paced delivery (0.5.0)".)* It also shifts fresh-user starter guidance toward
|
|
315
315
|
`product-team` for human-directed work and `conveyor` for workflow-oriented
|
|
316
316
|
work. Treat `demo` as legacy/test content unless a task specifically asks for
|
|
317
317
|
the old demo spec.
|
|
@@ -471,14 +471,14 @@ honestly and the UI exposes a one-click open-missing affordance.
|
|
|
471
471
|
|
|
472
472
|
v0.4.0 flips the five most frequently invoked read-commands from firehose-by-default to compact-by-default, and `rig queue list` adopts the docker / kubectl read-command grammar. **All defaults preserve breadth and capability — the firehose is one explicit flag away.**
|
|
473
473
|
|
|
474
|
-
### `rig ps` —
|
|
474
|
+
### `rig ps` — scope-aware: bare `rig ps` = ALL rigs; `--nodes` = your rig only
|
|
475
475
|
|
|
476
476
|
```bash
|
|
477
|
-
rig ps #
|
|
478
|
-
rig ps --
|
|
479
|
-
rig ps
|
|
480
|
-
rig ps --
|
|
481
|
-
rig ps --
|
|
477
|
+
rig ps # ALL active rigs on the host, one compact row each — RUN FIRST to know the world
|
|
478
|
+
rig ps --rig <name> # one named rig's summary
|
|
479
|
+
rig ps --nodes --rig <name> # per-node (seat) detail for a NAMED rig — the normal drill-in
|
|
480
|
+
rig ps --nodes # per-node detail — CURRENT rig ONLY (deliberately narrow; NOT the whole host)
|
|
481
|
+
rig ps --json # compact JSON (default = a bare array of ALL non-archived rigs)
|
|
482
482
|
rig ps --nodes -A # cross-rig node inventory (was v0.3.4 default)
|
|
483
483
|
rig ps --nodes --full # complete record (the v0.3.4 per-node default shape; resumeToken VALUE retained here for downstream consumers)
|
|
484
484
|
rig ps --nodes --session <sess> # narrow to one canonical session
|
|
@@ -486,12 +486,12 @@ rig ps --active # opt-in active-state filter (does NOT change the al
|
|
|
486
486
|
```
|
|
487
487
|
|
|
488
488
|
**v0.4.0 breadth + projection changes**:
|
|
489
|
-
- **
|
|
489
|
+
- **Rig-level `rig ps` lists ALL active rigs** (one row each — the cheap "know the world" view). The **`--nodes` (per-seat) view defaults to your CURRENT rig only** (from `OPENRIG_SESSION_NAME`'s `@<rig>` suffix); `--rig <name>` picks another rig, `-A` widens `--nodes` to the whole host (expensive — prefer `--fields`/`--limit`).
|
|
490
490
|
- **Per-node TL;DR projection (compact) is the default**; `--full` returns the raw byte-equivalent passthrough. Daemon-side `recoveryGuidance` relocated to a guidance-by-reference map (no longer duplicated per-node) — even `--full` benefits.
|
|
491
491
|
- **All-states stays default** (different from `rig queue list` which defaults to active-only) — for `ps`, non-running states ARE often the actionable signal.
|
|
492
492
|
- **Resume-token security**: `--full` JSON emits `resumeTokenPresent` (boolean) — the actual `resumeToken` value also remains in `--full` for downstream consumers that legitimately need it, but the compact default never carries it (an orch glance never accidentally leaks token material).
|
|
493
493
|
|
|
494
|
-
|
|
494
|
+
**⚠ SCOPE-AWARENESS — the one that bites:** `rig ps --nodes` (and `--nodes --json`) show ONLY your current rig's seats, by design — the narrow default protects your context window. **Narrow output is not the whole world.** Never conclude "my rig is the only rig on the host" from a `--nodes` read — run bare `rig ps` FIRST (cheap; it lists every rig), then `rig ps --nodes --rig <name>` for the one you need. (`-A` = the expensive whole-host node read; use sparingly. The ~77k-token status-glance incident is closed by compact + scope.)
|
|
495
495
|
|
|
496
496
|
### `rig whoami` — compact-by-default + `--full` (`--verbose` alias)
|
|
497
497
|
|
|
@@ -532,16 +532,16 @@ rig restore-check --as <session> # narrow to one seat
|
|
|
532
532
|
|
|
533
533
|
Closes the largest measured bomb (~79,000 → low thousands). Summary correctly identifies EVERY not-ready seat (no false-ready omission); detail is dropped only for ready seats.
|
|
534
534
|
|
|
535
|
-
### `rig context` —
|
|
535
|
+
### `rig context` — context-window usage viewer (0.4.x; REMOVED in 0.5.0)
|
|
536
536
|
|
|
537
537
|
```bash
|
|
538
|
-
rig context # compact summary
|
|
538
|
+
rig context # compact summary (0.4.x only)
|
|
539
539
|
rig context --full # complete current payload
|
|
540
540
|
rig context --rig <name> # narrow to one rig
|
|
541
541
|
rig context --threshold 80 # filter to seats at/above 80%
|
|
542
542
|
```
|
|
543
543
|
|
|
544
|
-
Lower leverage than the others
|
|
544
|
+
Lower leverage than the others; keeps the read-command surface compact-by-default after the 0.4.0 upgrade. **⚠ 0.5.0: this usage viewer is removed entirely and the `rig context` name is reassigned to the context library (store + compose) — see "Context packs and paced delivery (0.5.0)" below. On a 0.5.0 host, bare `rig context` is the library, not this viewer.**
|
|
545
545
|
|
|
546
546
|
### Why this matters
|
|
547
547
|
|
|
@@ -701,7 +701,7 @@ JSON form exposes `peersNote` directly for programmatic consumers.
|
|
|
701
701
|
## Inventory and Monitoring
|
|
702
702
|
|
|
703
703
|
```bash
|
|
704
|
-
rig ps #
|
|
704
|
+
rig ps # ALL active rigs on the host, one compact row each (run FIRST to know the world)
|
|
705
705
|
rig ps --nodes # compact node inventory (current rig)
|
|
706
706
|
rig ps -A # all-rigs breadth (was the pre-0.4.0 default)
|
|
707
707
|
rig ps --nodes --full # complete per-node record (the firehose — opt-in)
|
|
@@ -759,6 +759,7 @@ rig send <session> "message" --json
|
|
|
759
759
|
- `--dangerously-interact --reason "<why>"` — the ONLY override of the prompt/permission guard: deliberately drive an interactive prompt/permission block (implies `--raw`, requires `--reason`, audit-logged).
|
|
760
760
|
- `--host <id>` — send on a remote host declared in `~/.openrig/hosts.yaml` (ssh hosts shell out; http hosts go CLI-direct to the remote daemon).
|
|
761
761
|
- `--from <session>` — originating session for the envelope sender/actor (provenance; defaults to `$OPENRIG_SESSION_NAME`, and is plumbed through cross-host sends so the remote envelope names the origin, not the relay).
|
|
762
|
+
- `--context <ref>` **(0.5.0)** — attach a composed context pack/piece by ref (see "Context packs and paced delivery"). Small piece → `send --context`; a real pack → `rig walk`. The noun `rig context` composes the ref; the verb delivers it.
|
|
762
763
|
|
|
763
764
|
> **Durable work goes to the QUEUE, not `send`.** `rig send` is an *ephemeral* message to a pane — it can be missed, and its delivery status is pane-render, not receipt. If you are **assigning work, or the message is important enough that losing it would be a real bummer**, use `rig queue` (below): it's durable, owned, tracked, and survives compaction and restart. Reach for `send` for a quick conversational nudge; reach for the **queue** for anything that must not get lost. Do not default to `send` for work — that's the most common mistake.
|
|
764
765
|
|
|
@@ -905,6 +906,56 @@ rig auth seats … --runtime codex # seat -> profile registry (metadata
|
|
|
905
906
|
|
|
906
907
|
**Hard secret boundary:** no token value is ever printed, logged, queued, streamed, or committed; status/validate report presence/mode/login-state only; seat labels are metadata, not live-account proof. MVP is `--runtime codex`; other runtimes use the same surface with a different `--runtime`, never a parallel command.
|
|
907
908
|
|
|
909
|
+
## Context packs and paced delivery (0.5.0)
|
|
910
|
+
|
|
911
|
+
**Compose context once, hand it to a seat cleanly.** A library primitive plus a set of delivery flags. The rule that keeps the grammar coherent — internalize this one: **the noun stores and composes; the verbs deliver.** `rig context` never sends anything; delivery is only ever `rig send` / `rig broadcast` / `rig walk` / `rig queue`.
|
|
912
|
+
|
|
913
|
+
> Version note: this is the 0.5.0 surface, pinned to the team-locked spec — not yet on lagging hosts. In 0.4.x, bare `rig context` was a context-window usage viewer (above); in 0.5.0 that viewer is removed and the `rig context` name belongs to the library here.
|
|
914
|
+
|
|
915
|
+
### `rig context` — the store + compose library (never delivers)
|
|
916
|
+
|
|
917
|
+
Manage and compose context (any text/markdown) into reusable **packs**. Every piece and pack has a stable, **path-like ref** — you address context the way you address files (`packs/compaction-restore`, `as-built/queue-internals`).
|
|
918
|
+
|
|
919
|
+
```bash
|
|
920
|
+
rig context list # what's in the library
|
|
921
|
+
rig context show <ref> # read a piece or pack
|
|
922
|
+
rig context add <ref> --from <file> # put a piece in the store
|
|
923
|
+
rig context rm <ref>
|
|
924
|
+
rig context compose --out packs/<ref> --from <fileA> <fileB> ... # ordered pieces -> a durable pack
|
|
925
|
+
```
|
|
926
|
+
|
|
927
|
+
- Sensible default store location; works unconfigured, can be pointed elsewhere later (another folder now; a machine or URL later).
|
|
928
|
+
- `compose` (v1) is honest ordered concatenation of named files into a durable pack with a ref — "here's a file, read a file."
|
|
929
|
+
- **No delivery verb lives on the noun.** To get a pack to a seat, hand its ref to a delivery verb below.
|
|
930
|
+
|
|
931
|
+
### `rig walk` — paced delivery of a sequence
|
|
932
|
+
|
|
933
|
+
```bash
|
|
934
|
+
rig walk <seat> --through <ref | file ...> --pace 10s
|
|
935
|
+
```
|
|
936
|
+
|
|
937
|
+
Walk a seat *through* a pack: each piece is sent into the pane, spaced by `--pace`, so the agent processes between sends (the human paste → wait → paste rhythm). Its own top-level verb, push-direction — the walker leads and does not wait for replies; the spacing does the work. Reach for `walk` on onboarding, repriming, or a fleet update — anything absorbed in order rather than all at once.
|
|
938
|
+
|
|
939
|
+
### The delivery grammar — send a ref, walk a pack, or attach it to a qitem
|
|
940
|
+
|
|
941
|
+
| When | Verb |
|
|
942
|
+
|---|---|
|
|
943
|
+
| One thing, now | `rig send <seat> --context <ref>` |
|
|
944
|
+
| One thing, everyone | `rig broadcast --rig <rig> --context <ref>` |
|
|
945
|
+
| A sequence, absorbed | `rig walk <seat> --through <ref> --pace 10s` |
|
|
946
|
+
| Context riding a durable handoff | `rig queue create … --body-context <ref>` |
|
|
947
|
+
|
|
948
|
+
- **Rule of thumb:** small piece → `send --context`; real pack → `walk`. An oversized `send --context` warns "this is walk-sized" instead of blasting the pane.
|
|
949
|
+
- **`--body-context` snapshot rule:** a qitem built from a ref stores the **resolved content** in its body **plus the ref for provenance** — the handoff carries what was actually sent, and a later library edit never silently rewrites a past handoff's history.
|
|
950
|
+
- **The orchestrator habit — assign work *with* its context attached:**
|
|
951
|
+
```bash
|
|
952
|
+
rig context compose --out packs/qitem-brief --from as-built/queue.md conventions/c1-proof.md
|
|
953
|
+
rig queue create --destination dev-driver@build --body-context packs/qitem-brief --summary "…"
|
|
954
|
+
```
|
|
955
|
+
The assignee never greps for the as-built; the curated context rides the durable handoff, survives compaction, and is auditable.
|
|
956
|
+
|
|
957
|
+
**Skills tier vs context tier:** skills are the HOT tier (ambient, finite, always-visible front-matter); context packs are the COLD tier (unbounded, fetched on instruction — "walk yourself through `packs/tui-onboarding`"). Don't overrun the skill layer by using skills as context packs — that's what this primitive is for.
|
|
958
|
+
|
|
908
959
|
## Lifecycle
|
|
909
960
|
|
|
910
961
|
### Bring a rig up
|
|
@@ -1161,13 +1212,13 @@ Verification loop:
|
|
|
1161
1212
|
```bash
|
|
1162
1213
|
rig discover --json
|
|
1163
1214
|
rig adopt <fragment.yaml> --bindings-file <bindings.yaml> --target-rig <rigId>
|
|
1164
|
-
rig ps --nodes --
|
|
1215
|
+
rig ps --nodes --rig <rigId> # the target rig's nodes (--nodes alone = your current rig)
|
|
1165
1216
|
rig export <rigId> -o rig.yaml
|
|
1166
1217
|
```
|
|
1167
1218
|
|
|
1168
1219
|
Success looks like:
|
|
1169
1220
|
- the new sessions stop appearing in `rig discover`
|
|
1170
|
-
- the new logical IDs appear in `rig ps --nodes --
|
|
1221
|
+
- the new logical IDs appear in `rig ps --nodes --rig <rigId>`
|
|
1171
1222
|
- `rig export` includes the new pod
|
|
1172
1223
|
|
|
1173
1224
|
### Mixed-origin rigs are allowed
|
|
@@ -1185,7 +1236,7 @@ Current safety rule:
|
|
|
1185
1236
|
The proven operator pattern is:
|
|
1186
1237
|
- keep one OpenRig manager session outside the rig it manages
|
|
1187
1238
|
- address the target by rig name, not cached rig ID
|
|
1188
|
-
-
|
|
1239
|
+
- find the target rig with bare `rig ps` (lists all rigs), then resolve its owner from `rig ps --nodes --rig <target>` (a bare `--nodes` read is your current rig only, not the target's)
|
|
1189
1240
|
- send the manager the spec path, bindings path, and verification steps with `rig send`
|
|
1190
1241
|
|
|
1191
1242
|
This lets ordinary agents ask the manager for OpenRig help instead of every agent needing to be an OpenRig expert.
|
|
@@ -1318,7 +1369,7 @@ Design assumptions that hold in the shipped CLI:
|
|
|
1318
1369
|
|
|
1319
1370
|
1. `rig whoami --json`
|
|
1320
1371
|
2. `rig transcript <your-session> --tail 100`
|
|
1321
|
-
3. `rig ps --nodes --json`
|
|
1372
|
+
3. `rig ps` — lists ALL rigs on the host (know the world FIRST); then `rig ps --nodes --rig <your-rig>` for your seats. ⚠ `rig ps --nodes --json` alone is your CURRENT rig only — do NOT mistake it for the whole host (a freshly-compacted agent has no other context to catch the lie).
|
|
1322
1373
|
4. `rig chatroom history <rig> --limit 50`
|
|
1323
1374
|
|
|
1324
1375
|
## Commands That Do Not Exist
|
|
@@ -151,6 +151,8 @@ Every qitem carries:
|
|
|
151
151
|
- `state` — one of: `pending | in-progress | done | blocked | failed | denied | canceled | handed-off`
|
|
152
152
|
- `closure_reason` + `closure_target` — set on terminal closure per hot-potato rule
|
|
153
153
|
|
|
154
|
+
**(0.5.0) `--body-context <ref>` — context riding the handoff.** `rig queue create … --body-context <ref>` attaches a composed context pack to the qitem. The snapshot rule: the qitem stores the **resolved content** in its body **plus the ref for provenance** — the handoff carries what was actually sent, and a later edit to the library never silently rewrites a past handoff's history. (The `rig context` noun composes the ref; the queue delivers it — the noun has no send.) See `openrig-user` → "Context packs and paced delivery."
|
|
155
|
+
|
|
154
156
|
The fields are auditable across both `rigx queue` (config-layer) and
|
|
155
157
|
`rig queue` (daemon-shipped) surfaces. Watchdog policies and workflow
|
|
156
158
|
runtime project new owners off these fields.
|
|
@@ -9,6 +9,7 @@ metadata:
|
|
|
9
9
|
- mental-model-ha
|
|
10
10
|
- scope-recovery
|
|
11
11
|
- session-compaction-and-restore
|
|
12
|
+
- retiring-and-inheriting-a-seat
|
|
12
13
|
- agent-startup-and-context-ingestion
|
|
13
14
|
- agent-starters
|
|
14
15
|
- composable-priming-packs
|
|
@@ -107,7 +108,7 @@ A seat stays `Stable` even if multiple candidate-occupants were produced and dis
|
|
|
107
108
|
## Hard boundaries (do-not list; verbatim)
|
|
108
109
|
|
|
109
110
|
- **Do NOT collapse `rebuild` and `seat handover` into one primitive.** The design specifically separates them so the system can describe what actually happened.
|
|
110
|
-
- **Do NOT introduce successor-suffix seat names** (`lead2`/`lead3`). Stable seat identity is the architectural goal.
|
|
111
|
+
- **Do NOT introduce successor-suffix seat names** (`lead2`/`lead3`). Stable seat identity is the architectural goal. *(Reconciliation: this governs the **live** seat address, which stays clean — the seat name is whoever sits now. A **retired** tenure IS versioned (`<seat>-vN`) as the separately-recorded provenance trail / cold wake-target — that is the lineage, not a live successor-suffix. See `retiring-and-inheriting-a-seat` and its lineage ledger.)*
|
|
111
112
|
- **Do NOT report `seatBindingOutcome: handed_over`** if the provenance record didn't write durably.
|
|
112
113
|
- **Do NOT auto-rollback a half-completed handover** by re-attaching the old occupant unless detach completed cleanly first.
|
|
113
114
|
|
|
@@ -8,6 +8,10 @@ export interface ClaudeAdapterFsOps {
|
|
|
8
8
|
mkdirp(path: string): void;
|
|
9
9
|
copyFile(src: string, dest: string): void;
|
|
10
10
|
listFiles?(dirPath: string): string[];
|
|
11
|
+
/** Source file permission bits (for mode-preserving projection). Optional: mode preservation is a no-op if absent. */
|
|
12
|
+
statMode?(path: string): number;
|
|
13
|
+
/** Apply permission bits to a file (for mode-preserving projection). Optional: no-op if absent. */
|
|
14
|
+
chmod?(path: string, mode: number): void;
|
|
11
15
|
/** List files in a directory (for session token capture). */
|
|
12
16
|
readdir?(dirPath: string): string[];
|
|
13
17
|
/** User home directory (for session file lookup). */
|
|
@@ -26,6 +30,8 @@ export declare class ClaudeCodeAdapter implements RuntimeAdapter {
|
|
|
26
30
|
private stateDir;
|
|
27
31
|
private collectorAssetPath;
|
|
28
32
|
private autoDriveProviderPrompts;
|
|
33
|
+
private activityRelayPath;
|
|
34
|
+
private claudeHooksManifestPath;
|
|
29
35
|
constructor(deps: {
|
|
30
36
|
tmux: TmuxAdapter;
|
|
31
37
|
fsOps: ClaudeAdapterFsOps;
|
|
@@ -34,6 +40,11 @@ export declare class ClaudeCodeAdapter implements RuntimeAdapter {
|
|
|
34
40
|
stateDir?: string;
|
|
35
41
|
collectorAssetPath?: string;
|
|
36
42
|
autoDriveProviderPrompts?: boolean;
|
|
43
|
+
/** DI source of the activity-relay.cjs asset (parity with the Codex adapter). */
|
|
44
|
+
activityRelayPath?: string;
|
|
45
|
+
/** DI source of the canonical claude.json hooks manifest — the event vocabulary
|
|
46
|
+
* is derived (filtered to relay events) from it, not a parallel constant. */
|
|
47
|
+
claudeHooksManifestPath?: string;
|
|
37
48
|
});
|
|
38
49
|
listInstalled(binding: NodeBinding): Promise<InstalledResource[]>;
|
|
39
50
|
project(plan: ProjectionPlan, binding: NodeBinding): Promise<ProjectionResult>;
|
|
@@ -56,6 +67,14 @@ export declare class ClaudeCodeAdapter implements RuntimeAdapter {
|
|
|
56
67
|
}): void;
|
|
57
68
|
private verifyResumeLaunch;
|
|
58
69
|
private projectEntry;
|
|
70
|
+
/**
|
|
71
|
+
* Reapply the source file's permission bits to the projected dest. Plain
|
|
72
|
+
* readFile+writeFile (writeFileSync) creates the dest with the process default
|
|
73
|
+
* mode, dropping executable bits on nested plugin helpers (e.g. the
|
|
74
|
+
* claude-compaction-restore/scripts/*.mjs 0755 hooks). No-op when the fs adapter
|
|
75
|
+
* does not expose mode primitives (keeps existing mock-fs callers unaffected).
|
|
76
|
+
*/
|
|
77
|
+
private preserveMode;
|
|
59
78
|
private pluginAppliesToClaude;
|
|
60
79
|
private resolveTargetDir;
|
|
61
80
|
private applyRuntimeResource;
|
|
@@ -96,5 +115,22 @@ export declare class ClaudeCodeAdapter implements RuntimeAdapter {
|
|
|
96
115
|
* Idempotent: safe to call multiple times (merge preserves existing settings).
|
|
97
116
|
*/
|
|
98
117
|
private provisionContextCollector;
|
|
118
|
+
/**
|
|
119
|
+
* Reconcile the OpenRig-managed activity-relay hooks in `.claude/settings.local.json`
|
|
120
|
+
* to the desired `enabled` state, driven ONCE from the always-run `project()` seam.
|
|
121
|
+
*
|
|
122
|
+
* ENABLE (only when the relay SOURCE is readable): deliver `activity-relay.cjs` →
|
|
123
|
+
* `<cwd>/.openrig/hooks/scripts/` (mode preserved, 0755 from the source asset) and upsert
|
|
124
|
+
* the owned command for each relay event DERIVED from the canonical claude.json manifest
|
|
125
|
+
* (compaction hooks excluded). If the source is missing, deliver NOTHING (no dangling
|
|
126
|
+
* commands) and report `sourceMissing` so the caller can surface a warning + not claim
|
|
127
|
+
* projection. DISABLE: strip owned entries and prune emptied containers.
|
|
128
|
+
*
|
|
129
|
+
* Ownership is the EXACT `node <quoted relay path>` command shape, so a stale/changed
|
|
130
|
+
* absolute prefix is replaced (never duplicated) while a user command that merely CONTAINS
|
|
131
|
+
* the path is preserved. Fail-closed: a settings file we cannot parse is left byte-for-byte
|
|
132
|
+
* untouched. Not `mergeJsonFragment` (additive union-by-key can't strip on disable).
|
|
133
|
+
*/
|
|
134
|
+
private reconcileClaudeActivityHooks;
|
|
99
135
|
}
|
|
100
136
|
//# sourceMappingURL=claude-code-adapter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude-code-adapter.d.ts","sourceRoot":"","sources":["../../src/adapters/claude-code-adapter.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAE7C,OAAO,KAAK,EACV,cAAc,EAAE,WAAW,EAAE,mBAAmB,EAChD,iBAAiB,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,eAAe,EAC3E,mBAAmB,EACpB,MAAM,8BAA8B,CAAC;AAEtC,OAAO,KAAK,EAAE,cAAc,EAAmB,MAAM,iCAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"claude-code-adapter.d.ts","sourceRoot":"","sources":["../../src/adapters/claude-code-adapter.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE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