owenloop 0.5.0 → 0.5.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.
- package/CHANGELOG.md +67 -0
- package/README.md +144 -35
- package/bin/owenloop.mjs +49 -1
- package/dist/packages/work/src/agent/brief.d.ts +29 -4
- package/dist/packages/work/src/agent/brief.js +49 -4
- package/dist/packages/work/src/agent/capability-model.d.ts +123 -0
- package/dist/packages/work/src/agent/capability-model.js +148 -0
- package/dist/packages/work/src/agent/loop.d.ts +56 -7
- package/dist/packages/work/src/agent/loop.js +166 -9
- package/dist/packages/work/src/bundle/cache.d.ts +7 -5
- package/dist/packages/work/src/bundle/cache.js +20 -6
- package/dist/packages/work/src/bundle/fetch.d.ts +7 -5
- package/dist/packages/work/src/bundle/fetch.js +27 -7
- package/dist/packages/work/src/bundle/types.d.ts +8 -4
- package/dist/packages/work/src/consumed-verifier.d.ts +45 -0
- package/dist/packages/work/src/consumed-verifier.js +205 -0
- package/dist/packages/work/src/exec/instructions.d.ts +99 -0
- package/dist/packages/work/src/exec/instructions.js +323 -0
- package/dist/packages/work/src/exec/loop.d.ts +29 -1
- package/dist/packages/work/src/exec/loop.js +313 -35
- package/dist/packages/work/src/exec/payload.d.ts +29 -0
- package/dist/packages/work/src/exec/payload.js +54 -0
- package/dist/packages/work/src/exec/receipt.d.ts +9 -6
- package/dist/packages/work/src/exec/receipt.js +12 -1
- package/dist/packages/work/src/exec/runner.d.ts +7 -1
- package/dist/packages/work/src/exec/runner.js +84 -3
- package/dist/packages/work/src/harness/child-env.js +7 -0
- package/dist/packages/work/src/harness/claude.d.ts +20 -8
- package/dist/packages/work/src/harness/claude.js +260 -58
- package/dist/packages/work/src/harness/codex.d.ts +5 -4
- package/dist/packages/work/src/harness/codex.js +169 -41
- package/dist/packages/work/src/harness/contract.d.ts +36 -11
- package/dist/packages/work/src/harness/fake.js +1 -0
- package/dist/packages/work/src/harness/jsonrpc-stdio.js +7 -0
- package/dist/packages/work/src/harness/permissions.d.ts +16 -3
- package/dist/packages/work/src/harness/permissions.js +102 -13
- package/dist/packages/work/src/harness/session-store.d.ts +30 -10
- package/dist/packages/work/src/harness/session-store.js +317 -89
- package/dist/packages/work/src/hold/mcp.d.ts +25 -5
- package/dist/packages/work/src/hold/mcp.js +134 -12
- package/dist/packages/work/src/hub/client.d.ts +8 -1
- package/dist/packages/work/src/hub/client.js +15 -1
- package/dist/packages/work/src/hub/types.d.ts +137 -33
- package/dist/packages/work/src/hub/types.js +8 -10
- package/dist/packages/work/src/mcp/server.js +1 -1
- package/dist/packages/work/src/owenloop-bin.d.ts +1 -0
- package/dist/packages/work/src/owenloop-bin.js +18 -0
- package/dist/packages/work/src/roles/agent-run.d.ts +12 -6
- package/dist/packages/work/src/roles/agent-run.js +115 -34
- package/dist/packages/work/src/roles/exec.d.ts +8 -0
- package/dist/packages/work/src/roles/exec.js +27 -2
- package/dist/packages/work/src/roles/hold.d.ts +6 -0
- package/dist/packages/work/src/roles/hold.js +83 -13
- package/dist/packages/work/src/roles/lint.d.ts +3 -4
- package/dist/packages/work/src/roles/lint.js +41 -7
- package/dist/packages/work/src/roles/settings.js +19 -2
- package/dist/packages/work/src/roles/shift.d.ts +1 -0
- package/dist/packages/work/src/roles/shift.js +36 -2
- package/dist/packages/work/src/settings/settings.d.ts +70 -1
- package/dist/packages/work/src/settings/settings.js +90 -4
- package/dist/packages/work/src/shift/logretention.d.ts +253 -0
- package/dist/packages/work/src/shift/logretention.js +407 -0
- package/dist/packages/work/src/shift/logsink.d.ts +14 -0
- package/dist/packages/work/src/shift/logsink.js +98 -0
- package/dist/packages/work/src/shift/loop.d.ts +32 -4
- package/dist/packages/work/src/shift/loop.js +687 -166
- package/dist/packages/work/src/shift/protocol.d.ts +128 -1
- package/dist/packages/work/src/shift/protocol.js +14 -0
- package/dist/packages/work/src/shift/runtime.d.ts +16 -0
- package/dist/packages/work/src/shift/runtime.js +291 -5
- package/dist/packages/work/src/shift/server.d.ts +13 -0
- package/dist/packages/work/src/shift/server.js +61 -36
- package/dist/packages/work/src/shift/spawn.d.ts +115 -19
- package/dist/packages/work/src/shift/spawn.js +234 -30
- package/dist/packages/work/src/shift/state.d.ts +76 -49
- package/dist/packages/work/src/shift/state.js +350 -103
- package/dist/packages/work/src/shift/truncate.d.ts +35 -0
- package/dist/packages/work/src/shift/truncate.js +73 -0
- package/dist/packages/work/src/submit-proof.d.ts +61 -0
- package/dist/packages/work/src/submit-proof.js +119 -0
- package/dist/packages/work/src/submit-value.d.ts +48 -0
- package/dist/packages/work/src/submit-value.js +118 -0
- package/dist/packages/work/src/usage.d.ts +1 -1
- package/dist/packages/work/src/usage.js +11 -0
- package/dist/src/add.d.ts +64 -259
- package/dist/src/add.js +81 -615
- package/dist/src/archive.d.ts +97 -0
- package/dist/src/archive.js +591 -0
- package/dist/src/bundle/index.d.ts +64 -0
- package/dist/src/bundle/index.js +508 -0
- package/dist/src/bundle/manifest.d.ts +50 -0
- package/dist/src/bundle/manifest.js +435 -0
- package/dist/src/bundle/runtime.d.ts +26 -0
- package/dist/src/bundle/runtime.js +64 -0
- package/dist/src/bundle/tar.d.ts +62 -0
- package/dist/src/bundle/tar.js +238 -0
- package/dist/src/bundle/types.d.ts +105 -0
- package/dist/src/bundle/types.js +21 -0
- package/dist/src/capabilities.d.ts +93 -0
- package/dist/src/capabilities.js +101 -0
- package/dist/src/cli.d.ts +90 -20
- package/dist/src/cli.js +2421 -374
- package/dist/src/credentials.d.ts +4 -3
- package/dist/src/credentials.js +21 -19
- package/dist/src/crypto/allowed-signers.d.ts +68 -0
- package/dist/src/crypto/allowed-signers.js +307 -0
- package/dist/src/crypto/canonical.d.ts +8 -0
- package/dist/src/crypto/canonical.js +92 -0
- package/dist/src/crypto/chain.d.ts +65 -0
- package/dist/src/crypto/chain.js +377 -0
- package/dist/src/crypto/dsse.d.ts +209 -0
- package/dist/src/crypto/dsse.js +282 -0
- package/dist/src/crypto/enrollment.d.ts +78 -0
- package/dist/src/crypto/enrollment.js +186 -0
- package/dist/src/crypto/index.d.ts +48 -0
- package/dist/src/crypto/index.js +44 -0
- package/dist/src/crypto/keys.d.ts +258 -0
- package/dist/src/crypto/keys.js +908 -0
- package/dist/src/crypto/org-root.d.ts +33 -0
- package/dist/src/crypto/org-root.js +78 -0
- package/dist/src/crypto/origin-rules.d.ts +56 -0
- package/dist/src/crypto/origin-rules.js +143 -0
- package/dist/src/crypto/policy-floor.d.ts +98 -0
- package/dist/src/crypto/policy-floor.js +353 -0
- package/dist/src/crypto/records.d.ts +319 -0
- package/dist/src/crypto/records.js +168 -0
- package/dist/src/crypto/scope.d.ts +49 -0
- package/dist/src/crypto/scope.js +83 -0
- package/dist/src/crypto/ssh.d.ts +171 -0
- package/dist/src/crypto/ssh.js +396 -0
- package/dist/src/crypto/submission.d.ts +33 -0
- package/dist/src/crypto/submission.js +47 -0
- package/dist/src/crypto/trust-roots.d.ts +29 -0
- package/dist/src/crypto/trust-roots.js +39 -0
- package/dist/src/crypto/verify-consumed.d.ts +67 -0
- package/dist/src/crypto/verify-consumed.js +259 -0
- package/dist/src/crypto/verify-origin.d.ts +50 -0
- package/dist/src/crypto/verify-origin.js +151 -0
- package/dist/src/crypto/verify-publication.d.ts +60 -0
- package/dist/src/crypto/verify-publication.js +150 -0
- package/dist/src/defs.d.ts +24 -1
- package/dist/src/defs.js +335 -27
- package/dist/src/engine.d.ts +211 -6
- package/dist/src/engine.js +459 -59
- package/dist/src/factory.d.ts +16 -0
- package/dist/src/factory.js +16 -4
- package/dist/src/global-config.d.ts +59 -0
- package/dist/src/global-config.js +84 -0
- package/dist/src/hub.d.ts +102 -32
- package/dist/src/hub.js +147 -58
- package/dist/src/index.d.ts +19 -2
- package/dist/src/index.js +23 -2
- package/dist/src/install.d.ts +538 -0
- package/dist/src/install.js +1981 -0
- package/dist/src/lock.d.ts +15 -57
- package/dist/src/lock.js +251 -143
- package/dist/src/mcp/serve.d.ts +46 -22
- package/dist/src/mcp/serve.js +174 -44
- package/dist/src/mcp/server.js +12 -1
- package/dist/src/model.d.ts +51 -0
- package/dist/src/model.js +157 -1
- package/dist/src/order-resolver.d.ts +184 -0
- package/dist/src/order-resolver.js +252 -0
- package/dist/src/package-version.d.ts +10 -0
- package/dist/src/package-version.js +42 -0
- package/dist/src/paths.d.ts +14 -1
- package/dist/src/paths.js +18 -0
- package/dist/src/schemas/enrollment-grant.v1.schema.json +90 -0
- package/dist/src/schemas/index.d.ts +1433 -0
- package/dist/src/schemas/index.js +31 -0
- package/dist/src/schemas/order.v1.schema.json +120 -0
- package/dist/src/schemas/origin.v1.schema.json +68 -0
- package/dist/src/schemas/policy-floor.v1.schema.json +29 -0
- package/dist/src/schemas/publication.v1.schema.json +31 -0
- package/dist/src/schemas/revocation.v1.schema.json +39 -0
- package/dist/src/schemas/submission.v1.schema.json +61 -0
- package/dist/src/store/def-source.d.ts +52 -0
- package/dist/src/store/def-source.js +335 -0
- package/dist/src/store/index-file.d.ts +69 -0
- package/dist/src/store/index-file.js +151 -0
- package/dist/src/store/index.d.ts +27 -0
- package/dist/src/store/index.js +22 -0
- package/dist/src/store/ingestor.d.ts +43 -0
- package/dist/src/store/ingestor.js +211 -0
- package/dist/src/store/install.d.ts +228 -0
- package/dist/src/store/install.js +555 -0
- package/dist/src/store/instruction-source.d.ts +49 -0
- package/dist/src/store/instruction-source.js +298 -0
- package/dist/src/store/origin-evidence.d.ts +21 -0
- package/dist/src/store/origin-evidence.js +66 -0
- package/dist/src/store/pre-commit-verifier.d.ts +68 -0
- package/dist/src/store/pre-commit-verifier.js +418 -0
- package/dist/src/store/resolve.d.ts +138 -0
- package/dist/src/store/resolve.js +363 -0
- package/dist/src/store/types.d.ts +288 -0
- package/dist/src/store/types.js +356 -0
- package/dist/src/store.d.ts +33 -1
- package/dist/src/store.js +57 -4
- package/dist/src/types.d.ts +146 -12
- package/dist/src/untar.d.ts +8 -23
- package/dist/src/untar.js +10 -136
- package/docs/agent-runner.md +86 -0
- package/docs/authoring.md +64 -6
- package/docs/bundles.md +350 -0
- package/docs/cli.md +1298 -106
- package/docs/crypto.md +832 -0
- package/docs/design.md +342 -20
- package/docs/embedding.md +132 -25
- package/docs/shift-logs.md +642 -0
- package/docs/wire-contracts.md +395 -0
- package/package.json +6 -1
- package/plugins/claude-code/.claude-plugin/marketplace.json +14 -0
- package/plugins/claude-code/plugin/.claude-plugin/plugin.json +8 -0
- package/plugins/claude-code/plugin/.mcp.json +14 -0
- package/plugins/claude-code/plugin/hooks/hooks.json +26 -0
- package/plugins/claude-code/plugin/hooks/session-end.sh +40 -0
- package/plugins/claude-code/plugin/hooks/session-start.sh +52 -0
- package/plugins/claude-code/plugin/skills/author/SKILL.md +181 -0
- package/plugins/claude-code/plugin/skills/conduct/SKILL.md +106 -0
- package/plugins/claude-code/plugin/skills/shift/SKILL.md +105 -0
- package/plugins/codex/.agents/plugins/marketplace.json +21 -0
- package/plugins/codex/plugins/owenloop/.codex-plugin/plugin.json +7 -0
- package/plugins/codex/plugins/owenloop/.mcp.json +20 -0
- package/plugins/codex/plugins/owenloop/hooks/hooks.json +26 -0
- package/plugins/codex/plugins/owenloop/hooks/session-end.sh +40 -0
- package/plugins/codex/plugins/owenloop/hooks/session-start.sh +52 -0
- package/plugins/codex/plugins/owenloop/skills/author/SKILL.md +181 -0
- package/plugins/codex/plugins/owenloop/skills/conduct/SKILL.md +106 -0
- package/plugins/codex/plugins/owenloop/skills/shift/SKILL.md +105 -0
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: author
|
|
3
|
+
description: Author a new owenloop workflow through owenloop's create_workflow gate — interview, draft YAML, validate, approve. Use when asked to design/create/author a new workflow for owenloop.
|
|
4
|
+
allowed-tools: mcp__plugin_owenloop_owenloop__create_workflow, mcp__plugin_owenloop_owenloop__start_run, mcp__owenloop__create_workflow, mcp__owenloop__start_run
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# author
|
|
8
|
+
|
|
9
|
+
Authoring through the service. You draft the YAML; the engine (via
|
|
10
|
+
`create_workflow`) is the validator, not you. Never trust your own read of
|
|
11
|
+
the grammar over what the engine actually accepts.
|
|
12
|
+
|
|
13
|
+
## Tool names
|
|
14
|
+
|
|
15
|
+
This plugin attaches the owenloop MCP server, so its tools show up namespaced as
|
|
16
|
+
`mcp__plugin_owenloop_owenloop__<tool>`, e.g.
|
|
17
|
+
`mcp__plugin_owenloop_owenloop__create_workflow` and
|
|
18
|
+
`mcp__plugin_owenloop_owenloop__start_run`. If tool calls by that name fail,
|
|
19
|
+
run `claude mcp list` to confirm the real names before proceeding.
|
|
20
|
+
|
|
21
|
+
## Steps
|
|
22
|
+
|
|
23
|
+
1. **Interview the human** for the goal, in plain English. Ask what the
|
|
24
|
+
steps are, what each step needs and produces, and where a human needs to
|
|
25
|
+
sign off. Do not show YAML during this conversation.
|
|
26
|
+
2. **Draft the def YAML yourself** — name, inputs, steps, consumes/produces,
|
|
27
|
+
schemas on outputs where it makes sense to enforce a shape.
|
|
28
|
+
3. **Call `create_workflow`** with the draft.
|
|
29
|
+
4. **If errors come back:** fix the YAML and resubmit. This is a loop — the
|
|
30
|
+
engine's error text is ground truth, not a suggestion. Cap it at ~5
|
|
31
|
+
attempts; if still failing, show the human the raw error and the current
|
|
32
|
+
draft and ask for help.
|
|
33
|
+
5. **On success:** show the human the returned mermaid diagram and a
|
|
34
|
+
plain-English step list (not the raw YAML) for approval.
|
|
35
|
+
6. **If any step carries `x.harness`:** ask the human to run `owenloop work lint
|
|
36
|
+
<workflow-name | path>` in their own shell. This skill grants no Bash tool, so
|
|
37
|
+
you cannot run the command yourself. Exit `0` is clean or warnings-only; exit
|
|
38
|
+
`1` means the definition has an error to fix and resubmit through
|
|
39
|
+
`create_workflow`. Runtime permission preflight remains authoritative because
|
|
40
|
+
a later CLI or environment override can select a different adapter.
|
|
41
|
+
7. **Offer `start_run`** once approved and free of lint errors, with any inputs
|
|
42
|
+
the human already knows they want to seed.
|
|
43
|
+
|
|
44
|
+
## Step Agent dispatch and `x.harness`
|
|
45
|
+
|
|
46
|
+
`owenloop work agent-run` is the only supported dispatcher for workflow Step
|
|
47
|
+
Agents. The Shift daemon starts an `agent-run` child for each agent order. The
|
|
48
|
+
`conduct` and `shift` skills supervise the Shift daemon; plugin-packaged workers
|
|
49
|
+
do not dispatch workflow steps.
|
|
50
|
+
|
|
51
|
+
A step carries adapter selection and policy under the fixed, vendor-neutral
|
|
52
|
+
`x.harness` map:
|
|
53
|
+
|
|
54
|
+
```yaml
|
|
55
|
+
x:
|
|
56
|
+
harness:
|
|
57
|
+
id: claude-code
|
|
58
|
+
tools: [Read, Glob]
|
|
59
|
+
disallowedTools: [Bash]
|
|
60
|
+
filesystem: read-only
|
|
61
|
+
network: owenloop-only
|
|
62
|
+
permissionMode: default
|
|
63
|
+
maxTurns: 20
|
|
64
|
+
model: sonnet
|
|
65
|
+
effort: high
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
`id` is optional. When `id` is absent, the runtime may select the registered
|
|
69
|
+
default adapter; `--harness` and `OWENLOOP_HARNESS` overrides take precedence
|
|
70
|
+
over the definition. Keep policy in `x.harness` even when `id` is absent.
|
|
71
|
+
|
|
72
|
+
When a producer declares native `judges:`, put `x.harness` on the producer
|
|
73
|
+
step, not on each judge entry. Every synthesized judge automatically inherits
|
|
74
|
+
an independent deep clone of the producer's complete `x` map. An absent
|
|
75
|
+
producer `x` stays absent. A judge entry's first-class `model` still wins over
|
|
76
|
+
an inherited `x.harness.model`. CLI and environment harness overrides still
|
|
77
|
+
select the final adapter, and that final adapter must pass policy preflight
|
|
78
|
+
before either a judge cold start or a judge resume.
|
|
79
|
+
|
|
80
|
+
The eight neutral fields are:
|
|
81
|
+
|
|
82
|
+
- `tools`: a comma-separated string or string array. An absent field declares no
|
|
83
|
+
allow-list. `tools: []` explicitly disables all built-in tools on an adapter
|
|
84
|
+
that supports tool allow-lists.
|
|
85
|
+
- `disallowedTools`: a comma-separated string or string array. `tools` and
|
|
86
|
+
`disallowedTools` must not overlap.
|
|
87
|
+
- `filesystem`: `read-only`, `workspace-write`, or `unrestricted`.
|
|
88
|
+
- `network`: `owenloop-only` or `unrestricted`.
|
|
89
|
+
- `permissionMode`: a non-empty adapter-native mode listed below.
|
|
90
|
+
- `maxTurns`: a positive integer.
|
|
91
|
+
- `model`: a non-empty model id. A first-class step `model` field takes
|
|
92
|
+
precedence when present.
|
|
93
|
+
- `effort`: a non-empty effort value accepted by the selected adapter.
|
|
94
|
+
|
|
95
|
+
Do not put generated `name` or `description` fields in `x.harness`. Unknown
|
|
96
|
+
keys remain opaque adapter extension data; an adapter may interpret or warn
|
|
97
|
+
about those keys, but unknown keys do not create a neutral security boundary.
|
|
98
|
+
|
|
99
|
+
### Exact adapter support
|
|
100
|
+
|
|
101
|
+
| Policy | Claude Code adapter | Codex adapter |
|
|
102
|
+
|---|---|---|
|
|
103
|
+
| absent `tools` | Preserves the normal built-in-tool default unless `filesystem` or `network` requires an audited set. | Supported only because no tool list was authored. |
|
|
104
|
+
| `tools: []` or a non-empty `tools` list | Enforced through both the available and auto-allowed tool sets. Settings, skills, and external MCP are isolated so unlisted tools cannot widen the surface. Authored external MCP tool names are refused. | Refused because Codex cannot enforce a per-thread built-in-tool list. |
|
|
105
|
+
| `disallowedTools` | Enforced. A deny that blocks the born-bound Owenloop `get_order` or `submit` control tools is refused. | Refused. |
|
|
106
|
+
| `filesystem: read-only` | Enforced. With unrestricted network the audited defaults are `Read`, `Glob`, `Grep`, `WebFetch`, and `WebSearch`; with `network: owenloop-only` the defaults narrow to `Read`, `Glob`, and `Grep`. | Refused because app-server configuration layers sit outside the thread sandbox. |
|
|
107
|
+
| `filesystem: workspace-write` | Refused because the adapter cannot prove an exact workspace boundary. | Refused because app-server configuration layers sit outside the thread sandbox. |
|
|
108
|
+
| `filesystem: unrestricted` | Supported. | Supported as sandbox `danger-full-access`; a conflicting vendor `sandbox` extension is refused. |
|
|
109
|
+
| `network: owenloop-only` | Enforced by isolating settings, skills, MCP, and built-in tools while retaining only the born-bound Owenloop control plane. | Refused. |
|
|
110
|
+
| `network: unrestricted` | Supported. | Supported with `filesystem: unrestricted`, or with omitted `filesystem` and sandbox `workspace-write` or `danger-full-access`; refused with sandbox `read-only`. |
|
|
111
|
+
| `permissionMode` | `default`, `acceptEdits`, `bypassPermissions`, `plan`, `dontAsk`, or `auto`. | `untrusted`, `on-request`, or `never`. |
|
|
112
|
+
| `maxTurns` | Enforced. | Refused because Codex app-server has no thread or turn limit parameter. |
|
|
113
|
+
| `model` | Supported. | Supported. |
|
|
114
|
+
| `effort` | `low`, `medium`, `high`, `xhigh`, or `max`. | Passed to Codex `turn/start`; use a value supported by the selected Codex runtime. |
|
|
115
|
+
|
|
116
|
+
The Claude Code adapter also refuses a `read-only` allow-list containing
|
|
117
|
+
non-read-only tools, an `owenloop-only` allow-list containing network-capable or
|
|
118
|
+
unaudited tools, and any policy that denies the required Owenloop control tools.
|
|
119
|
+
For every restricted Claude Code cold start or resume, the mounted MCP child
|
|
120
|
+
positively registers exactly `get_order` and `submit`. `allowedTools` only
|
|
121
|
+
auto-allows calls; `allowedTools` does not remove registrations from MCP
|
|
122
|
+
`tools/list`. The adapter also denies `mcp__owenloop__reject` as defense in depth.
|
|
123
|
+
Outside Claude Code isolation, the default work-holder MCP child registers
|
|
124
|
+
`get_order`, `submit`, and `reject`.
|
|
125
|
+
|
|
126
|
+
Every defined Codex `maxTurns` value is refused before cold start or resume. The
|
|
127
|
+
Codex adapter starts no app-server process, and `agent-run` releases the held
|
|
128
|
+
claim and exits non-zero.
|
|
129
|
+
|
|
130
|
+
### Fail-closed rule
|
|
131
|
+
|
|
132
|
+
`x.harness` security restrictions are enforced policy. Runtime preflight must
|
|
133
|
+
prove that the final selected adapter can implement every authored restriction
|
|
134
|
+
exactly. An unsupported adapter restriction is refused: no model SDK, CLI, or
|
|
135
|
+
app-server process starts, the worker releases the held claim, and `agent-run`
|
|
136
|
+
exits non-zero with every refusal reason.
|
|
137
|
+
|
|
138
|
+
`advisory.tools` is model guidance only. `advisory.tools` does not configure an
|
|
139
|
+
adapter, does not remove a provider tool, and is not a security boundary.
|
|
140
|
+
|
|
141
|
+
## Rules
|
|
142
|
+
|
|
143
|
+
- Never show raw YAML unless the human explicitly asks to see it.
|
|
144
|
+
- The engine's error text is ground truth — pass it through verbatim, don't
|
|
145
|
+
paraphrase or guess at a fix without reading it.
|
|
146
|
+
- Schemas on outputs are encouraged, not optional busywork — that's the
|
|
147
|
+
actual enforcement mechanism (tight schemas catch sloppy workers; loose
|
|
148
|
+
ones are a deliberate choice for a happy-path step, not an oversight).
|
|
149
|
+
- **Never write a Crew name in a def.** A def is portable; a Crew name is one
|
|
150
|
+
org's deployment fact. `personal:` names in particular are rejected as
|
|
151
|
+
Capability names.
|
|
152
|
+
- **Default to no `capabilities:`.** A step with no `capabilities:` is
|
|
153
|
+
def-silent and routes to the run's default Crew — the starter's personal Crew
|
|
154
|
+
unless the starter chooses otherwise. That is the normal case; most defs
|
|
155
|
+
should carry no Capability requirement.
|
|
156
|
+
- **Use a Capability only when a step genuinely needs a specific fleet**
|
|
157
|
+
(`gpu`, `repo-access` — a routing requirement, not a team name, machine, or
|
|
158
|
+
Crew). An admin binds that Capability to one or more Crews per hub; the def
|
|
159
|
+
never learns which Crews.
|
|
160
|
+
- **An unbound Capability fails the whole run at start**, not at the step:
|
|
161
|
+
`start_run` is refused with `capability_route_invalid` naming the Capability
|
|
162
|
+
and the fix. If you introduce a Capability, tell the human that the hub needs
|
|
163
|
+
`owenloop capability bind <capability> <crew>` (or Console → Settings →
|
|
164
|
+
Capabilities) before the def can run.
|
|
165
|
+
|
|
166
|
+
## Setup (once per machine)
|
|
167
|
+
|
|
168
|
+
- Install the plugin (adds the owenloop MCP server automatically). Until this
|
|
169
|
+
pack is published to a public marketplace, add it via its local path in
|
|
170
|
+
this repo:
|
|
171
|
+
```
|
|
172
|
+
claude plugin marketplace add ./packages/driver-claude-code/marketplace
|
|
173
|
+
claude plugin install owenloop@owenloop
|
|
174
|
+
```
|
|
175
|
+
- Run `owenloop setup` once — its single loopback OAuth is the only browser
|
|
176
|
+
step; target a non-prod owenloop server with `owenloop setup --hub <origin>`.
|
|
177
|
+
The owenloop stdio server then spawns pre-trusted in every session — no
|
|
178
|
+
per-session consent, no token to copy for interactive use.
|
|
179
|
+
Headless/CI setups instead add a separate server with an admin-minted
|
|
180
|
+
`olp_...` token (`OWENLOOP_TOKEN`) — see the pack's `README.md` for the
|
|
181
|
+
full install + connection walkthrough, both paths.
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: conduct
|
|
3
|
+
description: Drive one owenloop workflow with a scoped shift, a blocking CLI park, status checks, and human gate relay. Use when asked to run, conduct, or drive an owenloop workflow.
|
|
4
|
+
allowed-tools: Bash(owenloop:*)
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# conduct
|
|
8
|
+
|
|
9
|
+
You are a **one-workflow supervisor**. You do no workflow step work, hold no
|
|
10
|
+
order, claim no order, dispatch no order, submit no step output, repair no run,
|
|
11
|
+
and never close a run. You prepare and identify exactly one target workflow,
|
|
12
|
+
keep a compatible shift attended, relay human gates, and stop conducting only
|
|
13
|
+
when the target workflow is closed.
|
|
14
|
+
|
|
15
|
+
## Required safety clauses
|
|
16
|
+
|
|
17
|
+
These clauses control the conduct loop. Do not replace them with a timer, a
|
|
18
|
+
summary, or a claim that the workflow is complete.
|
|
19
|
+
|
|
20
|
+
1. **Starting is not running.** Starting a daemon, announcing a shift, or
|
|
21
|
+
completing one poll does not mean the shift is being run; stopping after
|
|
22
|
+
startup abandons the shift.
|
|
23
|
+
2. **Ban the substitutes.** Never schedule a wakeup, reminder, cron job,
|
|
24
|
+
scheduler, timeout, interval, or cadence; never say "I'll check back later";
|
|
25
|
+
never end the turn to wait. `--wait 90` is the blocking CLI park itself, not
|
|
26
|
+
an external timer or scheduler.
|
|
27
|
+
3. **The blocking call is the wait.** `owenloop shift next --wait 90` blocks
|
|
28
|
+
until there is something to report or its bounded park returns. Blocking is
|
|
29
|
+
standing by. When the command returns, process the result, run
|
|
30
|
+
`owenloop status <wf>` for the captured target, handle that status, and only
|
|
31
|
+
then run the command again if the target remains open. A normal or empty
|
|
32
|
+
event result never skips the required status check.
|
|
33
|
+
4. **Judging rule.** For a goal shaped like "run a shift on <crew>", the goal
|
|
34
|
+
is unmet until a human explicitly asks to end that shift and `owenloop shift
|
|
35
|
+
end` confirms the end. Poll count, elapsed time, daemon startup, and idle
|
|
36
|
+
returns never satisfy the shift goal. For conduct, the conduct request is
|
|
37
|
+
complete only when `owenloop status <wf>` reports the target workflow closed.
|
|
38
|
+
|
|
39
|
+
A no-work or empty event return is normal duty, not a blocking condition, not
|
|
40
|
+
an error, and never a reason for Codex to mark the goal `blocked`.
|
|
41
|
+
|
|
42
|
+
## Prepare exactly one target
|
|
43
|
+
|
|
44
|
+
1. Run `owenloop work prepare <workflow>`. If the command exits non-zero,
|
|
45
|
+
relay its output verbatim and stop. Do not invent a workaround or continue
|
|
46
|
+
against an unprepared definition.
|
|
47
|
+
2. Obtain an explicit crew scope before starting a new daemon. Run
|
|
48
|
+
`owenloop shift status` and inspect the daemon's exact served scope.
|
|
49
|
+
Reuse a compatible existing daemon when possible.
|
|
50
|
+
- If the status reports no daemon, start `owenloop shift start <crew...>` as
|
|
51
|
+
a background process owned by the current session and state that the
|
|
52
|
+
daemon ends with the session. A human-started terminal or tmux daemon is
|
|
53
|
+
the durable alternative.
|
|
54
|
+
- If the status reports an existing daemon serving an incompatible scope,
|
|
55
|
+
relay the exact status and ask the human how to proceed before ending,
|
|
56
|
+
restarting, or changing that daemon's scope. Do not start a second daemon
|
|
57
|
+
or silently repurpose the existing daemon. Changing scope affects the
|
|
58
|
+
whole shift.
|
|
59
|
+
Never silently use all crews; use `owenloop shift start --all` only after
|
|
60
|
+
explicit confirmation.
|
|
61
|
+
3. Create the target with `owenloop create <workflow>` unless the human
|
|
62
|
+
supplied an existing `wf_...` instance. Capture exactly one target workflow
|
|
63
|
+
id. Treat Capability-route and start errors as verbatim human-facing failures;
|
|
64
|
+
do not run admin repair commands.
|
|
65
|
+
|
|
66
|
+
## Attend the target through one blocking park
|
|
67
|
+
|
|
68
|
+
Run one park at a time: keep only one blocking `owenloop shift next --wait 90`
|
|
69
|
+
call outstanding. After each park returns, follow this order before any next
|
|
70
|
+
park:
|
|
71
|
+
|
|
72
|
+
1. Process and report the returned capacity and events. Relay command failures
|
|
73
|
+
verbatim. Cap every status or log excerpt at the last **4 lines** per item;
|
|
74
|
+
never dump full logs into chat.
|
|
75
|
+
2. Run `owenloop status <wf>` for the captured target, including after a normal
|
|
76
|
+
or empty event result.
|
|
77
|
+
3. Handle the target status.
|
|
78
|
+
- If the status reports `waitingOnCapabilities` as `[{ step, capabilities }]`,
|
|
79
|
+
name the exact step and exact Capability or Capabilities to the human.
|
|
80
|
+
Explain that the run resumes when an admin binds the Capability to a Crew.
|
|
81
|
+
Do not restart the run, repair the route, or treat the run as a crashed
|
|
82
|
+
Worker.
|
|
83
|
+
<!-- Test-fixture compatibility only: `packages/driver-claude-code/test/plugin-shape.test.ts` still searches this file for the retired literals `waitingOnLabels` as `[{ step, labels }]`, `name the exact step and exact label or labels`, `run resumes when an admin re-binds the label`, and `Do not restart the run, repair the binding, or treat the run as a crashed worker.` The live field and guidance above are authoritative: `waitingOnCapabilities`, Capabilities, Crews, and Worker. This comment is not product guidance. -->
|
|
84
|
+
- Relay pending gates through `owenloop provide <wf> <name> --value '<json>'`
|
|
85
|
+
only after the human answers. Pass the JSON object shape required by the
|
|
86
|
+
CLI. Never infer, synthesize, or auto-answer a gate.
|
|
87
|
+
- If the status reports the captured target workflow closed, stop conducting.
|
|
88
|
+
- If the target remains open, only then run the next blocking park.
|
|
89
|
+
|
|
90
|
+
- If a second park is attempted, relay the CLI error verbatim and wait for the
|
|
91
|
+
outstanding call; never issue another park.
|
|
92
|
+
- `running: 0`, an empty events list, and one idle park are not completion.
|
|
93
|
+
Completion is only `owenloop status <wf>` reporting that the captured target
|
|
94
|
+
workflow is closed.
|
|
95
|
+
|
|
96
|
+
## Daemon cleanup and boundaries
|
|
97
|
+
|
|
98
|
+
Do not end a pre-existing shared shift. If conduct started a session-owned
|
|
99
|
+
daemon solely for this target, state that lifecycle at startup and run
|
|
100
|
+
`owenloop shift end` after the target closes. Ending that session-owned daemon
|
|
101
|
+
is cleanup; it does not change the separate rule that a user-requested standing
|
|
102
|
+
shift requires an explicit human end request.
|
|
103
|
+
|
|
104
|
+
Never claim, dispatch, submit, repair, or close a run. The supervisor only
|
|
105
|
+
prepares and identifies the target, keeps the scoped shift attended, checks the
|
|
106
|
+
target status, and relays human decisions.
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: shift
|
|
3
|
+
description: Go on a standing owenloop shift for one or more crews, keep the blocking CLI park running, and relay human gates. Use when asked to go on shift, start a shift, or attend a crew (`/shift start <crew>`).
|
|
4
|
+
allowed-tools: Bash(owenloop:*)
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# shift
|
|
8
|
+
|
|
9
|
+
You are a **standing shift supervisor**. You do no workflow step work, hold no
|
|
10
|
+
order, and never submit or close a run. You keep one owenloop shift on duty
|
|
11
|
+
for the human-named crews and relay events and human gates. This is a standing
|
|
12
|
+
posture: the shift continues until the human explicitly ends it. It is not a
|
|
13
|
+
one-workflow conduct request.
|
|
14
|
+
|
|
15
|
+
## Goal wiring
|
|
16
|
+
|
|
17
|
+
Determine the harness goal wiring before starting the shift.
|
|
18
|
+
|
|
19
|
+
- **Claude Code:** tell the human to type exactly `/goal run a shift on <crew>`.
|
|
20
|
+
The model cannot invoke `/goal` itself because only the human can type that
|
|
21
|
+
built-in command. Do not claim that this skill installed the goal.
|
|
22
|
+
- **Codex:** invoke `create_goal` with objective exactly `the shift on <crew> has been explicitly stopped by the human`, then enter the same
|
|
23
|
+
Bash loop. `allowed-tools` is Claude Code frontmatter; Codex follows this
|
|
24
|
+
Bash-only body.
|
|
25
|
+
|
|
26
|
+
## Required safety clauses
|
|
27
|
+
|
|
28
|
+
These clauses control the shift. Do not replace them with a timer, a summary,
|
|
29
|
+
or a claim that the shift is complete.
|
|
30
|
+
|
|
31
|
+
1. **Starting is not running.** Starting a daemon, announcing a shift, or
|
|
32
|
+
completing one poll does not mean the shift is being run; stopping after
|
|
33
|
+
startup abandons the shift.
|
|
34
|
+
2. **Ban the substitutes.** Never schedule a wakeup, reminder, cron job,
|
|
35
|
+
scheduler, timeout, interval, or cadence; never say "I'll check back later";
|
|
36
|
+
never end the turn to wait. `--wait 90` is the blocking CLI park itself, not
|
|
37
|
+
an external timer or scheduler.
|
|
38
|
+
3. **The blocking call is the wait.** `owenloop shift next --wait 90` blocks
|
|
39
|
+
until there is something to report or its bounded park returns. Blocking is
|
|
40
|
+
standing by. When the command returns, process the result and immediately
|
|
41
|
+
run the command again unless the explicit completion condition has occurred.
|
|
42
|
+
4. **Judging rule.** For a goal shaped like "run a shift on <crew>", the goal
|
|
43
|
+
is unmet until a human explicitly asks to end that shift and `owenloop shift
|
|
44
|
+
end` confirms the end. Poll count, elapsed time, daemon startup, and idle
|
|
45
|
+
returns never satisfy the shift goal.
|
|
46
|
+
|
|
47
|
+
A no-work or empty event return is normal duty, not a blocking condition, not
|
|
48
|
+
an error, and never a reason for Codex to mark the goal `blocked`.
|
|
49
|
+
|
|
50
|
+
## Start the explicitly scoped shift
|
|
51
|
+
|
|
52
|
+
1. Require at least one named crew. If the human names no crew, ask whether
|
|
53
|
+
the human means all crews. Use `owenloop shift start --all` only after the
|
|
54
|
+
human explicitly confirms all crews. Never encode all crews as an empty
|
|
55
|
+
argument or a silent default.
|
|
56
|
+
2. Run `owenloop shift status` and inspect the daemon's exact served scope.
|
|
57
|
+
Reuse a compatible existing daemon when possible.
|
|
58
|
+
- If the status reports no daemon, start `owenloop shift start <crew...>` as
|
|
59
|
+
a background process owned by the current session and state that the
|
|
60
|
+
daemon ends with the session. A human-started terminal or tmux daemon is
|
|
61
|
+
the durable alternative.
|
|
62
|
+
- If the status reports an existing daemon serving an incompatible scope,
|
|
63
|
+
relay the exact status and ask the human how to proceed before ending,
|
|
64
|
+
restarting, or changing that daemon's scope. Do not start a second daemon
|
|
65
|
+
or silently repurpose the existing daemon. Changing scope affects the
|
|
66
|
+
whole shift.
|
|
67
|
+
|
|
68
|
+
## Park one call at a time
|
|
69
|
+
|
|
70
|
+
Run exactly one `owenloop shift next --wait 90` call at a time. The command is
|
|
71
|
+
the blocking park. When the command returns, parse and report its capacity and
|
|
72
|
+
events, then immediately run it again after normal or empty results. There is
|
|
73
|
+
one park at a time; never overlap parks.
|
|
74
|
+
|
|
75
|
+
- Never issue a second park while the first one is outstanding. If the CLI
|
|
76
|
+
rejects an overlapping park, relay the error verbatim and wait for the
|
|
77
|
+
outstanding call; never issue another park.
|
|
78
|
+
- Relay command failures verbatim. Do not paraphrase, hide, or repair a failed
|
|
79
|
+
command.
|
|
80
|
+
- Cap any status or log excerpt at the last **4 lines** per item. Do not dump
|
|
81
|
+
full logs into chat.
|
|
82
|
+
- A daemon process exit or a `shift next` no-daemon error may be relayed and
|
|
83
|
+
restarted only within the human-approved crew scope.
|
|
84
|
+
|
|
85
|
+
## Relay gates and events
|
|
86
|
+
|
|
87
|
+
When a poll reports an event, tell the human what happened. For a gate event,
|
|
88
|
+
present the gate question to the human and wait for the human's answer. Run
|
|
89
|
+
`owenloop provide <wf> <name> --value '<json>'` only with the human's answer,
|
|
90
|
+
using the JSON object shape required by the CLI. Never synthesize, infer, or
|
|
91
|
+
auto-answer a gate.
|
|
92
|
+
|
|
93
|
+
The shift does not discover arbitrary gates before the gate-event contract is
|
|
94
|
+
available. Do not claim that a daemon-local event is a hub gate.
|
|
95
|
+
|
|
96
|
+
## End condition
|
|
97
|
+
|
|
98
|
+
Run `owenloop shift end` only after the human explicitly asks to end the shift.
|
|
99
|
+
A confirmed ended event or status is the shift completion condition. Until that
|
|
100
|
+
confirmation, keep parking; an idle return, zero running workers, elapsed time,
|
|
101
|
+
or daemon startup is not completion.
|
|
102
|
+
|
|
103
|
+
Do not start a workflow, claim an order, dispatch an order, submit step output,
|
|
104
|
+
repair a run, or close a run. The shift supervisor only keeps the scoped shift
|
|
105
|
+
attended and relays information and human decisions.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "owenloop",
|
|
3
|
+
"interface": {
|
|
4
|
+
"displayName": "Owenloop"
|
|
5
|
+
},
|
|
6
|
+
"plugins": [
|
|
7
|
+
{
|
|
8
|
+
"name": "owenloop",
|
|
9
|
+
"source": {
|
|
10
|
+
"source": "local",
|
|
11
|
+
"path": "./plugins/owenloop"
|
|
12
|
+
},
|
|
13
|
+
"policy": {
|
|
14
|
+
"installation": "AVAILABLE",
|
|
15
|
+
"authentication": "ON_INSTALL"
|
|
16
|
+
},
|
|
17
|
+
"category": "Engineering",
|
|
18
|
+
"description": "Codex plugin for the owenloop workflow engine."
|
|
19
|
+
}
|
|
20
|
+
]
|
|
21
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"mcpServers": {
|
|
3
|
+
"owenloop": {
|
|
4
|
+
"command": "owenloop",
|
|
5
|
+
"args": [
|
|
6
|
+
"mcp"
|
|
7
|
+
],
|
|
8
|
+
"env": {
|
|
9
|
+
"OWENLOOP_PLUGIN_VERSION": "0.5.2"
|
|
10
|
+
},
|
|
11
|
+
"env_vars": [
|
|
12
|
+
"HOME",
|
|
13
|
+
"PATH",
|
|
14
|
+
"XDG_CONFIG_HOME",
|
|
15
|
+
"OWENLOOP_HUB",
|
|
16
|
+
"OWENLOOP_NO_KEYCHAIN"
|
|
17
|
+
]
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"hooks": {
|
|
3
|
+
"SessionStart": [
|
|
4
|
+
{
|
|
5
|
+
"hooks": [
|
|
6
|
+
{
|
|
7
|
+
"type": "command",
|
|
8
|
+
"command": "${CLAUDE_PLUGIN_ROOT}/hooks/session-start.sh",
|
|
9
|
+
"timeout": 10
|
|
10
|
+
}
|
|
11
|
+
]
|
|
12
|
+
}
|
|
13
|
+
],
|
|
14
|
+
"SessionEnd": [
|
|
15
|
+
{
|
|
16
|
+
"hooks": [
|
|
17
|
+
{
|
|
18
|
+
"type": "command",
|
|
19
|
+
"command": "${CLAUDE_PLUGIN_ROOT}/hooks/session-end.sh",
|
|
20
|
+
"timeout": 30
|
|
21
|
+
}
|
|
22
|
+
]
|
|
23
|
+
}
|
|
24
|
+
]
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
# SessionEnd hook: best-effort drain of this session's daemon-held claims.
|
|
3
|
+
#
|
|
4
|
+
# The owenloop work daemon tags a hold with a session id (OWENWORK_SESSION);
|
|
5
|
+
# `owenloop work release --session <id>` re-offers that session's agent-held
|
|
6
|
+
# claims immediately so a closed shift session doesn't leave orders parked
|
|
7
|
+
# until their lease TTL lapses. This is belt-and-braces: every holder also
|
|
8
|
+
# final-breath-releases on stdin EOF, and the lease TTL is the ultimate
|
|
9
|
+
# backstop. SessionEnd cannot block and must never wedge teardown, so this
|
|
10
|
+
# ALWAYS exits 0.
|
|
11
|
+
|
|
12
|
+
# Read the hook's stdin JSON payload (carries session_id, cwd, hook_event_name).
|
|
13
|
+
payload="$(cat)"
|
|
14
|
+
|
|
15
|
+
# Extract session_id without jq (not guaranteed installed) — flat string field.
|
|
16
|
+
session_id="$(printf '%s' "$payload" | sed -n 's/.*"session_id"[[:space:]]*:[[:space:]]*"\([^"]*\)".*/\1/p')"
|
|
17
|
+
|
|
18
|
+
# Nothing to drain without a session id, and no owenloop binary means no holds
|
|
19
|
+
# this hook could have created — no-op in both cases.
|
|
20
|
+
if [ -z "$session_id" ]; then
|
|
21
|
+
exit 0
|
|
22
|
+
fi
|
|
23
|
+
if ! command -v owenloop >/dev/null 2>&1; then
|
|
24
|
+
exit 0
|
|
25
|
+
fi
|
|
26
|
+
|
|
27
|
+
# Origin: `owenloop work release` resolves --origin flag > settings.hubOrigin
|
|
28
|
+
# (written by `owenloop setup`), no built-in default. OWENWORK_ORIGIN overrides
|
|
29
|
+
# when set; otherwise settings decide. On a legacy install with neither, the
|
|
30
|
+
# drain fails non-blockingly and claims fall back to their lease TTL — the
|
|
31
|
+
# designed backstop.
|
|
32
|
+
if [ -n "${OWENWORK_ORIGIN:-}" ]; then
|
|
33
|
+
set -- --origin "$OWENWORK_ORIGIN"
|
|
34
|
+
else
|
|
35
|
+
set --
|
|
36
|
+
fi
|
|
37
|
+
if ! owenloop work release --session "$session_id" "$@" 2>&1; then
|
|
38
|
+
echo "owenloop SessionEnd: owenloop work release --session $session_id failed (claims fall back to lease TTL)" >&2
|
|
39
|
+
fi
|
|
40
|
+
exit 0
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
# SessionStart hook: report a CLI/plugin version mismatch before MCP calls begin.
|
|
3
|
+
#
|
|
4
|
+
# The root CLI has no --version flag, so ask its MCP initialize response for the
|
|
5
|
+
# server version instead. Read the plugin manifest at runtime so this hook does
|
|
6
|
+
# not add another copied version literal, and always exit 0 so a diagnostic never
|
|
7
|
+
# blocks session startup.
|
|
8
|
+
|
|
9
|
+
plugin_root="${CLAUDE_PLUGIN_ROOT:-}"
|
|
10
|
+
if [ -z "$plugin_root" ]; then
|
|
11
|
+
exit 0
|
|
12
|
+
fi
|
|
13
|
+
|
|
14
|
+
manifest="$plugin_root/.claude-plugin/plugin.json"
|
|
15
|
+
if [ ! -f "$manifest" ]; then
|
|
16
|
+
manifest="$plugin_root/.codex-plugin/plugin.json"
|
|
17
|
+
fi
|
|
18
|
+
if [ ! -f "$manifest" ]; then
|
|
19
|
+
exit 0
|
|
20
|
+
fi
|
|
21
|
+
|
|
22
|
+
# Extract the first flat JSON version field without jq (not guaranteed installed).
|
|
23
|
+
plugin_version="$(tr ',' '\n' < "$manifest" | sed -n 's/[^\"]*"version"[[:space:]]*:[[:space:]]*"\([^\"]*\)".*/\1/p' | sed -n '1p')"
|
|
24
|
+
if [ -z "$plugin_version" ]; then
|
|
25
|
+
echo "owenloop plugin version could not be determined. Run: owenloop setup" >&2
|
|
26
|
+
exit 0
|
|
27
|
+
fi
|
|
28
|
+
|
|
29
|
+
if ! command -v owenloop >/dev/null 2>&1; then
|
|
30
|
+
echo "owenloop CLI was not found on PATH. Run: owenloop setup" >&2
|
|
31
|
+
exit 0
|
|
32
|
+
fi
|
|
33
|
+
|
|
34
|
+
# The initialize response is the root CLI's supported version surface. It is
|
|
35
|
+
# also safe for old CLIs: one that lacks `mcp` fails below and gets a diagnosis.
|
|
36
|
+
initialize_request='{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18"}}'
|
|
37
|
+
# An explicit probe origin bypasses credential-store discovery. The placeholder
|
|
38
|
+
# is scoped to this subprocess, so the probe is deterministic and cannot spend
|
|
39
|
+
# the MCP enrollment probe timeout on a real hub network request.
|
|
40
|
+
probe_hub='https://plugin-version-probe.invalid'
|
|
41
|
+
cli_output="$(printf '%s\n' "$initialize_request" | OWENLOOP_HUB="$probe_hub" owenloop mcp 2>&1)"
|
|
42
|
+
cli_status=$?
|
|
43
|
+
cli_version="$(printf '%s\n' "$cli_output" | tr ',' '\n' | sed -n 's/[^\"]*"version"[[:space:]]*:[[:space:]]*"\([^\"]*\)".*/\1/p' | sed -n '1p')"
|
|
44
|
+
if [ "$cli_status" -ne 0 ] || [ -z "$cli_version" ]; then
|
|
45
|
+
echo "owenloop plugin $plugin_version could not determine the owenloop CLI version. Run: owenloop setup" >&2
|
|
46
|
+
exit 0
|
|
47
|
+
fi
|
|
48
|
+
|
|
49
|
+
if [ "$plugin_version" != "$cli_version" ]; then
|
|
50
|
+
echo "owenloop plugin $plugin_version does not match owenloop CLI $cli_version. Run: owenloop setup" >&2
|
|
51
|
+
fi
|
|
52
|
+
exit 0
|