owenloop 0.4.1 → 0.5.1
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 +71 -0
- package/README.md +182 -53
- package/bin/owenloop.mjs +50 -2
- package/dist/packages/work/src/agent/brief.d.ts +176 -0
- package/dist/packages/work/src/agent/brief.js +197 -0
- package/dist/packages/work/src/agent/loop.d.ts +141 -0
- package/dist/packages/work/src/agent/loop.js +669 -0
- package/dist/packages/work/src/agent/model-policy.d.ts +49 -0
- package/dist/packages/work/src/agent/model-policy.js +138 -0
- package/dist/packages/work/src/agent/workdir.d.ts +210 -0
- package/dist/packages/work/src/agent/workdir.js +319 -0
- package/dist/packages/work/src/bundle/cache.d.ts +92 -0
- package/dist/packages/work/src/bundle/cache.js +338 -0
- package/dist/packages/work/src/bundle/fetch.d.ts +87 -0
- package/dist/packages/work/src/bundle/fetch.js +345 -0
- package/dist/packages/work/src/bundle/types.d.ts +164 -0
- package/dist/packages/work/src/bundle/types.js +1 -0
- 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/credentials/owenloop.d.ts +11 -0
- package/dist/packages/work/src/credentials/owenloop.js +28 -0
- package/dist/packages/work/src/credentials/reader.d.ts +36 -0
- package/dist/packages/work/src/credentials/reader.js +32 -0
- package/dist/packages/work/src/credentials/resolve.d.ts +19 -0
- package/dist/packages/work/src/credentials/resolve.js +56 -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 +40 -0
- package/dist/packages/work/src/exec/loop.js +332 -0
- 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 +41 -0
- package/dist/packages/work/src/exec/receipt.js +32 -0
- package/dist/packages/work/src/exec/runner.d.ts +71 -0
- package/dist/packages/work/src/exec/runner.js +256 -0
- package/dist/packages/work/src/harness/child-env.d.ts +100 -0
- package/dist/packages/work/src/harness/child-env.js +134 -0
- package/dist/packages/work/src/harness/claude.d.ts +140 -0
- package/dist/packages/work/src/harness/claude.js +837 -0
- package/dist/packages/work/src/harness/codex.d.ts +111 -0
- package/dist/packages/work/src/harness/codex.js +1024 -0
- package/dist/packages/work/src/harness/contract.d.ts +308 -0
- package/dist/packages/work/src/harness/contract.js +32 -0
- package/dist/packages/work/src/harness/fake.d.ts +59 -0
- package/dist/packages/work/src/harness/fake.js +91 -0
- package/dist/packages/work/src/harness/jsonrpc-stdio.d.ts +108 -0
- package/dist/packages/work/src/harness/jsonrpc-stdio.js +351 -0
- package/dist/packages/work/src/harness/permissions.d.ts +75 -0
- package/dist/packages/work/src/harness/permissions.js +182 -0
- package/dist/packages/work/src/harness/registry.d.ts +47 -0
- package/dist/packages/work/src/harness/registry.js +45 -0
- package/dist/packages/work/src/harness/session-store.d.ts +181 -0
- package/dist/packages/work/src/harness/session-store.js +523 -0
- package/dist/packages/work/src/harness/types.d.ts +29 -0
- package/dist/packages/work/src/harness/types.js +14 -0
- package/dist/packages/work/src/harnesses.d.ts +38 -0
- package/dist/packages/work/src/harnesses.js +38 -0
- package/dist/packages/work/src/hold/loop.d.ts +36 -0
- package/dist/packages/work/src/hold/loop.js +23 -0
- package/dist/packages/work/src/hold/mcp.d.ts +75 -0
- package/dist/packages/work/src/hold/mcp.js +264 -0
- package/dist/packages/work/src/hub/client.d.ts +23 -0
- package/dist/packages/work/src/hub/client.js +91 -0
- package/dist/packages/work/src/hub/types.d.ts +326 -0
- package/dist/packages/work/src/hub/types.js +26 -0
- package/dist/packages/work/src/lease/loop.d.ts +94 -0
- package/dist/packages/work/src/lease/loop.js +277 -0
- package/dist/packages/work/src/main.d.ts +1 -0
- package/dist/packages/work/src/main.js +48 -0
- package/dist/packages/work/src/mcp/server.d.ts +125 -0
- package/dist/packages/work/src/mcp/server.js +320 -0
- 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 +124 -0
- package/dist/packages/work/src/roles/agent-run.js +529 -0
- package/dist/packages/work/src/roles/exec.d.ts +48 -0
- package/dist/packages/work/src/roles/exec.js +228 -0
- package/dist/packages/work/src/roles/hold.d.ts +72 -0
- package/dist/packages/work/src/roles/hold.js +363 -0
- package/dist/packages/work/src/roles/join.d.ts +18 -0
- package/dist/packages/work/src/roles/join.js +204 -0
- package/dist/packages/work/src/roles/lint.d.ts +58 -0
- package/dist/packages/work/src/roles/lint.js +234 -0
- package/dist/packages/work/src/roles/prepare.d.ts +1 -0
- package/dist/packages/work/src/roles/prepare.js +249 -0
- package/dist/packages/work/src/roles/release.d.ts +48 -0
- package/dist/packages/work/src/roles/release.js +137 -0
- package/dist/packages/work/src/roles/sessions.d.ts +61 -0
- package/dist/packages/work/src/roles/sessions.js +180 -0
- package/dist/packages/work/src/roles/settings.d.ts +6 -0
- package/dist/packages/work/src/roles/settings.js +71 -0
- package/dist/packages/work/src/roles/shift.d.ts +13 -0
- package/dist/packages/work/src/roles/shift.js +250 -0
- package/dist/packages/work/src/roles/signals.d.ts +55 -0
- package/dist/packages/work/src/roles/signals.js +62 -0
- package/dist/packages/work/src/settings/provision.d.ts +21 -0
- package/dist/packages/work/src/settings/provision.js +47 -0
- package/dist/packages/work/src/settings/settings.d.ts +136 -0
- package/dist/packages/work/src/settings/settings.js +155 -0
- package/dist/packages/work/src/shift/client.d.ts +24 -0
- package/dist/packages/work/src/shift/client.js +124 -0
- package/dist/packages/work/src/shift/loop.d.ts +131 -0
- package/dist/packages/work/src/shift/loop.js +751 -0
- package/dist/packages/work/src/shift/protocol.d.ts +95 -0
- package/dist/packages/work/src/shift/protocol.js +24 -0
- package/dist/packages/work/src/shift/routing.d.ts +35 -0
- package/dist/packages/work/src/shift/routing.js +50 -0
- package/dist/packages/work/src/shift/runtime.d.ts +45 -0
- package/dist/packages/work/src/shift/runtime.js +337 -0
- package/dist/packages/work/src/shift/server.d.ts +23 -0
- package/dist/packages/work/src/shift/server.js +716 -0
- package/dist/packages/work/src/shift/spawn.d.ts +109 -0
- package/dist/packages/work/src/shift/spawn.js +158 -0
- package/dist/packages/work/src/shift/state.d.ts +79 -0
- package/dist/packages/work/src/shift/state.js +385 -0
- package/dist/packages/work/src/submit-proof.d.ts +36 -0
- package/dist/packages/work/src/submit-proof.js +93 -0
- package/dist/packages/work/src/usage.d.ts +6 -0
- package/dist/packages/work/src/usage.js +175 -0
- package/dist/src/add.d.ts +189 -0
- package/dist/src/add.js +300 -0
- 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/{cli.d.ts → src/cli.d.ts} +92 -7
- package/dist/src/cli.js +5968 -0
- package/dist/{credentials.d.ts → src/credentials.d.ts} +22 -15
- package/dist/{credentials.js → src/credentials.js} +35 -31
- 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 +316 -0
- package/dist/src/crypto/records.js +157 -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/{defs.d.ts → src/defs.d.ts} +24 -1
- package/dist/{defs.js → src/defs.js} +181 -61
- package/dist/{engine.d.ts → src/engine.d.ts} +105 -9
- package/dist/{engine.js → src/engine.js} +251 -47
- package/dist/{factory.d.ts → src/factory.d.ts} +16 -0
- package/dist/{factory.js → src/factory.js} +16 -4
- package/dist/src/global-config.d.ts +59 -0
- package/dist/src/global-config.js +84 -0
- package/dist/{hub.d.ts → src/hub.d.ts} +280 -31
- package/dist/{hub.js → src/hub.js} +493 -52
- package/dist/src/index.d.ts +47 -0
- package/dist/src/index.js +41 -0
- package/dist/src/install.d.ts +538 -0
- package/dist/src/install.js +1981 -0
- package/dist/src/lock.d.ts +38 -0
- package/dist/src/lock.js +325 -0
- package/dist/src/mcp/serve.d.ts +109 -0
- package/dist/{mcp → src/mcp}/serve.js +335 -75
- package/dist/{mcp → src/mcp}/server.d.ts +6 -9
- package/dist/{mcp → src/mcp}/server.js +18 -10
- package/dist/{model.d.ts → src/model.d.ts} +15 -0
- package/dist/{model.js → src/model.js} +112 -2
- 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/{paths.d.ts → src/paths.d.ts} +14 -1
- package/dist/{paths.js → src/paths.js} +18 -0
- package/dist/src/schemas/enrollment-grant.v1.schema.json +90 -0
- package/dist/src/schemas/index.d.ts +1416 -0
- package/dist/src/schemas/index.js +31 -0
- package/dist/src/schemas/order.v1.schema.json +106 -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/{types.d.ts → src/types.d.ts} +58 -24
- package/dist/{untar.d.ts → src/untar.d.ts} +8 -23
- package/dist/src/untar.js +38 -0
- package/dist/{util.d.ts → src/util.d.ts} +3 -2
- package/dist/{util.js → src/util.js} +3 -2
- package/dist/{owenwork.d.ts → src/work-settings.d.ts} +22 -22
- package/dist/{owenwork.js → src/work-settings.js} +27 -27
- package/docs/agent-runner.md +86 -0
- package/docs/authoring.md +150 -59
- package/docs/bundles.md +250 -0
- package/docs/cli.md +1758 -163
- package/docs/crypto.md +816 -0
- package/docs/design.md +374 -52
- package/docs/embedding.md +135 -27
- package/docs/wire-contracts.md +380 -0
- package/examples/workflows/{command-worker.yaml → command-executor.yaml} +15 -15
- package/examples/workflows/compile-dev-playbook.yaml +338 -0
- package/examples/workflows/judges/gate-sharpness.md +39 -0
- package/examples/workflows/judges/security.md +34 -0
- package/package.json +22 -8
- 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
- package/dist/add.d.ts +0 -384
- package/dist/add.js +0 -834
- package/dist/cli.js +0 -3270
- package/dist/index.d.ts +0 -32
- package/dist/index.js +0 -23
- package/dist/lock.d.ts +0 -80
- package/dist/lock.js +0 -217
- package/dist/mcp/serve.d.ts +0 -84
- package/dist/untar.js +0 -164
- /package/dist/{schema.d.ts → src/schema.d.ts} +0 -0
- /package/dist/{schema.js → src/schema.js} +0 -0
- /package/dist/{store.d.ts → src/store.d.ts} +0 -0
- /package/dist/{store.js → src/store.js} +0 -0
- /package/dist/{types.js → src/types.js} +0 -0
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `~/.owenloop/config.json` — the CONTROL plane's non-secret configuration file.
|
|
3
|
+
*
|
|
4
|
+
* Sole writer: `owenloop login` (`dispatchLogin` in `src/cli.ts`), which records
|
|
5
|
+
* the hub origin it just authenticated against here, best-effort, after the
|
|
6
|
+
* credential itself has already been stored. Sole reader: `owenloop mcp`'s
|
|
7
|
+
* origin ladder (`resolveMcpOrigin` in `src/mcp/serve.ts`), which needs to know
|
|
8
|
+
* which hub the operator is using WITHOUT enumerating the credential store —
|
|
9
|
+
* the store's `keychain` and `external` backends cannot be listed at all (see
|
|
10
|
+
* `listStoredHubOrigins` in `src/hub.ts`), so a value that lived only inside
|
|
11
|
+
* the credential vault would be unreadable to the server on the majority of
|
|
12
|
+
* real installs (macOS defaults to the keychain backend).
|
|
13
|
+
*
|
|
14
|
+
* This is deliberately a SEPARATE file from `src/work-settings.ts`'s
|
|
15
|
+
* `~/.config/owenloop/settings.json` (or `$XDG_CONFIG_HOME/owenloop/settings.json`
|
|
16
|
+
* when set). That file belongs to the EXECUTION plane: `owenloop setup` is its
|
|
17
|
+
* sole writer, and `owenloop work` role resolution and pre-commit verification
|
|
18
|
+
* are its readers. This file belongs to the CONTROL plane: `owenloop login`
|
|
19
|
+
* writes it, `owenloop mcp` reads it. Nothing reconciles the two if they
|
|
20
|
+
* disagree — e.g. after `owenloop login --hub A` followed by
|
|
21
|
+
* `owenloop setup --hub B` — and that is an accepted cost, not an oversight:
|
|
22
|
+
* the two files answer different questions ("what hub does an agent shift run
|
|
23
|
+
* against" vs. "what hub does the human's MCP session talk to") for two
|
|
24
|
+
* independently-evolving call paths, and forcing one file to answer both would
|
|
25
|
+
* couple them for no benefit. This file is also HOME-rooted, not XDG-aware,
|
|
26
|
+
* unlike `settings.json`: `owenloop mcp` is a human-facing control-plane
|
|
27
|
+
* process, and there is no separate "XDG vs. HOME" precedence to resolve here
|
|
28
|
+
* — the caller supplies `home` directly (see `globalConfigPath`), mirroring
|
|
29
|
+
* how `src/cli.ts`'s `workflowHome` resolves the same value.
|
|
30
|
+
*
|
|
31
|
+
* Never holds a secret: `hub` is an origin URL, nothing else. A read failure
|
|
32
|
+
* of any kind (file absent, invalid JSON, wrong shape, blank `hub`, or a
|
|
33
|
+
* `hub` value that does not normalize to a valid http(s) origin) is reported
|
|
34
|
+
* as `null`, never thrown — this file is one rung of a fallback ladder
|
|
35
|
+
* (`resolveMcpOrigin`), and a corrupt or half-written config must not be able
|
|
36
|
+
* to crash `owenloop mcp` at startup; the ladder simply falls through to the
|
|
37
|
+
* next rung instead.
|
|
38
|
+
*/
|
|
39
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
40
|
+
import { dirname, join } from 'node:path';
|
|
41
|
+
import { mkdirRefusingSymlink } from "./util.js";
|
|
42
|
+
import { normalizeOrigin, writeFileAtomic } from "./hub.js";
|
|
43
|
+
/** `<home>/.owenloop/config.json` — `home` is the caller-resolved `HOME`/`USERPROFILE` value. */
|
|
44
|
+
export function globalConfigPath(home) {
|
|
45
|
+
return join(home, '.owenloop', 'config.json');
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Read and validate `path`. Returns `null` — never throws — when the file is
|
|
49
|
+
* absent, is not valid JSON, is not a JSON object, its `hub` field is
|
|
50
|
+
* missing, non-string, or blank, or `hub` does not normalize to a valid
|
|
51
|
+
* http(s) origin (`normalizeOrigin`, `src/hub.ts` — e.g. `"not a url"` or a
|
|
52
|
+
* bare hostname with no scheme). Callers treat `null` as "this rung has
|
|
53
|
+
* nothing to offer" and fall through to the next one. The `hub` on a non-null
|
|
54
|
+
* return is always normalized (scheme required, trailing slash/path
|
|
55
|
+
* stripped) — the same guarantee every other rung of `resolveMcpOrigin`
|
|
56
|
+
* provides, so callers never need to re-normalize what this returns.
|
|
57
|
+
*/
|
|
58
|
+
export function readGlobalConfig(path) {
|
|
59
|
+
if (!existsSync(path))
|
|
60
|
+
return null;
|
|
61
|
+
let parsed;
|
|
62
|
+
try {
|
|
63
|
+
parsed = JSON.parse(readFileSync(path, 'utf8'));
|
|
64
|
+
}
|
|
65
|
+
catch {
|
|
66
|
+
return null;
|
|
67
|
+
}
|
|
68
|
+
if (parsed === null || typeof parsed !== 'object')
|
|
69
|
+
return null;
|
|
70
|
+
const hub = parsed.hub;
|
|
71
|
+
if (typeof hub !== 'string' || hub.trim() === '')
|
|
72
|
+
return null;
|
|
73
|
+
try {
|
|
74
|
+
return { version: 1, hub: normalizeOrigin(hub) };
|
|
75
|
+
}
|
|
76
|
+
catch {
|
|
77
|
+
return null;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
/** Write `config` to `path`, creating its parent directory if needed. Atomic (see `writeFileAtomic`). */
|
|
81
|
+
export function writeGlobalConfig(path, config) {
|
|
82
|
+
mkdirRefusingSymlink(dirname(path));
|
|
83
|
+
writeFileAtomic(path, `${JSON.stringify(config, null, 2)}\n`);
|
|
84
|
+
}
|
|
@@ -87,6 +87,16 @@
|
|
|
87
87
|
* still recognizes byte-identical content and replies `unchanged: true`.
|
|
88
88
|
*/
|
|
89
89
|
export declare function hashDefForHub(yaml: string): string;
|
|
90
|
+
/**
|
|
91
|
+
* The production hub. The sole fallback rung for every hub-resolution ladder
|
|
92
|
+
* in this package that has one (`src/cli.ts`'s `resolveHub` and
|
|
93
|
+
* `resolveSetupHub`, `src/mcp/serve.ts`'s `resolveMcpOrigin`) — there must be
|
|
94
|
+
* exactly one literal `'https://api.owenloop.com'` in `src/`, and this is it.
|
|
95
|
+
* `resolveAgentHub` (`src/cli.ts`) deliberately has NO fallback to this
|
|
96
|
+
* constant: it mints credentials, and silently minting on the wrong org is
|
|
97
|
+
* not undone by a retry.
|
|
98
|
+
*/
|
|
99
|
+
export declare const DEFAULT_HUB = "https://api.owenloop.com";
|
|
90
100
|
/**
|
|
91
101
|
* Normalize a hub URL to a bare origin (`scheme://host[:port]`), stripping any
|
|
92
102
|
* path, query, trailing slash, and fragment. Requires an http(s) scheme. This
|
|
@@ -163,7 +173,7 @@ export type Credential = {
|
|
|
163
173
|
* distinct entries that never collide, and neither does `agent:ci` with
|
|
164
174
|
* `agent:release`.
|
|
165
175
|
*
|
|
166
|
-
* The discriminator is an **account**, never a "
|
|
176
|
+
* The discriminator is an **account**, never a "capability" — capabilities are a different
|
|
167
177
|
* axis of the system and the word is reserved.
|
|
168
178
|
*/
|
|
169
179
|
export type CredentialSlotSelector = {
|
|
@@ -276,12 +286,32 @@ export interface Keychain {
|
|
|
276
286
|
set(service: string, account: string, value: string): void;
|
|
277
287
|
delete(service: string, account: string): void;
|
|
278
288
|
}
|
|
289
|
+
/** Minimal command seam for the macOS `security` adapter. */
|
|
290
|
+
export interface MacosSecurityCommand {
|
|
291
|
+
args: string[];
|
|
292
|
+
/** Secret-bearing command input. Never include this value in an error. */
|
|
293
|
+
input?: string;
|
|
294
|
+
captureStdout?: boolean;
|
|
295
|
+
}
|
|
296
|
+
export type MacosSecurityRunner = (command: MacosSecurityCommand) => string;
|
|
279
297
|
/**
|
|
280
|
-
*
|
|
281
|
-
*
|
|
282
|
-
*
|
|
283
|
-
|
|
284
|
-
|
|
298
|
+
* Build the macOS generic-password backend around an injectable `security`
|
|
299
|
+
* command runner. Status 44 (`errSecItemNotFound`) alone means absence. Every
|
|
300
|
+
* other exit, signal, or start failure is a stable, secret-free error.
|
|
301
|
+
*/
|
|
302
|
+
export declare function macosKeychain(runner?: MacosSecurityRunner): Keychain;
|
|
303
|
+
/**
|
|
304
|
+
* Every locally available Keychain backend, independent of the ordinary-store
|
|
305
|
+
* override. Defensive logout uses this resolver so `OWENLOOP_NO_KEYCHAIN=1`
|
|
306
|
+
* cannot hide a credential that would become authoritative again when the
|
|
307
|
+
* override is removed. An injected backend remains available on every platform;
|
|
308
|
+
* otherwise only macOS has a platform backend.
|
|
309
|
+
*/
|
|
310
|
+
export declare function resolveLocalKeychain(injected?: Keychain): Keychain | undefined;
|
|
311
|
+
/**
|
|
312
|
+
* The default Keychain selected for ordinary reads and writes. Returns
|
|
313
|
+
* `undefined` off macOS or when `OWENLOOP_NO_KEYCHAIN=1` selects the 0600 file
|
|
314
|
+
* store. Logout deliberately uses `resolveLocalKeychain` instead.
|
|
285
315
|
*/
|
|
286
316
|
export declare function defaultKeychain(env: Record<string, string | undefined>): Keychain | undefined;
|
|
287
317
|
/**
|
|
@@ -348,7 +378,7 @@ export type ReadStoredCredentialOpts = CredentialSlotSelector & {
|
|
|
348
378
|
/**
|
|
349
379
|
* Read the stored hub credential for `origin` **in the named slot** from the
|
|
350
380
|
* chosen backend ONLY — the supported, read-only programmatic surface
|
|
351
|
-
* (
|
|
381
|
+
* (owenloop's CredentialReader seam wires to this once released). Secret hygiene
|
|
352
382
|
* is unchanged: this function never logs or echoes the returned credential, and
|
|
353
383
|
* there is deliberately no write/delete companion on the public surface —
|
|
354
384
|
* `login` / `logout` remain the only way to store or remove a credential.
|
|
@@ -380,24 +410,48 @@ export type ReadStoredCredentialOpts = CredentialSlotSelector & {
|
|
|
380
410
|
* never `process.env` directly, so a caller passing `opts.env` stays hermetic;
|
|
381
411
|
* only the top-level default falls back to `process.env`.
|
|
382
412
|
*
|
|
383
|
-
* **
|
|
384
|
-
*
|
|
385
|
-
*
|
|
386
|
-
*
|
|
387
|
-
*
|
|
388
|
-
* `runCredentialCommand`. When it is NOT configured, behaviour is exactly what
|
|
389
|
-
* it has always been.
|
|
413
|
+
* **An authoritative backend failure throws instead of returning `null`.** For
|
|
414
|
+
* `OWENLOOP_CREDENTIAL_COMMAND`, a nonzero exit, timeout, empty output, or
|
|
415
|
+
* malformed credential is a loud error naming the origin and slot. For the
|
|
416
|
+
* macOS Keychain, every `security` failure except status 44 is a stable,
|
|
417
|
+
* secret-free error. Neither backend falls through to a stale file entry.
|
|
390
418
|
*/
|
|
391
419
|
export declare function readStoredCredential(origin: string, opts: ReadStoredCredentialOpts): Credential | null;
|
|
392
420
|
/**
|
|
393
421
|
* Enumerate the hub origins that have a usable `human` credential stored, or
|
|
394
422
|
* `null` when the active backend cannot be enumerated.
|
|
395
423
|
*
|
|
396
|
-
*
|
|
397
|
-
* `src/mcp/serve.ts`
|
|
398
|
-
*
|
|
399
|
-
*
|
|
400
|
-
*
|
|
424
|
+
* Callers in `src/cli.ts` share a backend-aware discovery layer, while
|
|
425
|
+
* `src/mcp/serve.ts` consumes this fact directly. Their policies deliberately
|
|
426
|
+
* differ, turning the same three possible results (`null`, `[]`, length>1)
|
|
427
|
+
* into different outcomes:
|
|
428
|
+
*
|
|
429
|
+
* - `resolveAgentHub` (`agent new`, `capability bind|unbind|list`, and
|
|
430
|
+
* `crew`'s subcommands) — mutating, mint-like commands. Every non-single
|
|
431
|
+
* result (`null`, `[]`, or length>1) is an immediate `CliError` (exit 2)
|
|
432
|
+
* naming `--hub <origin>` as the fix. There is no `DEFAULT_HUB` fallback
|
|
433
|
+
* here at all: silently minting against the production hub while the
|
|
434
|
+
* operator is logged into a dev hub would mint on the wrong org, and a mint
|
|
435
|
+
* is not undone by a retry.
|
|
436
|
+
* - `resolveSetupHub` (`setup`, `doctor`) — `null` or `[]` fall back to
|
|
437
|
+
* `DEFAULT_HUB` with a printed notice so the operator can see what
|
|
438
|
+
* happened; length>1 is still a `CliError` (exit 2) naming the origins,
|
|
439
|
+
* because guessing among several logged-in hubs would be silently wrong for
|
|
440
|
+
* someone who has more than one.
|
|
441
|
+
* - `resolvePublishingHub` (`connect`, `push`, `publish`) — one file-backed
|
|
442
|
+
* origin is the global fallback; more than one or none is an exit-2 error.
|
|
443
|
+
* For `null`, and only for `null`, this policy may use the validated
|
|
444
|
+
* execution-settings `hubOrigin` after checking the requested credential
|
|
445
|
+
* slot. It never guesses `DEFAULT_HUB`.
|
|
446
|
+
* - `resolveMcpOrigin` (`owenloop mcp`'s origin ladder) — the most lenient:
|
|
447
|
+
* this is rung 4 of 5, tried only after `--hub`, `OWENLOOP_HUB`, and
|
|
448
|
+
* `~/.owenloop/config.json` have all had nothing to offer. `null`, `[]`,
|
|
449
|
+
* and length>1 are ALL just "this rung has nothing to offer either" and
|
|
450
|
+
* fall through silently to rung 5 (`DEFAULT_HUB`) — there is no error path
|
|
451
|
+
* left to reach from here.
|
|
452
|
+
*
|
|
453
|
+
* The backend determines whether enumeration is even possible in the first
|
|
454
|
+
* place, independent of which of the three callers is asking:
|
|
401
455
|
*
|
|
402
456
|
* - **file** → the origins in `readCredentialFile(credentialFilePath(env)).hubs`
|
|
403
457
|
* whose `human` slot parses as a well-formed `Credential` (`parseCredential`).
|
|
@@ -412,10 +466,10 @@ export declare function readStoredCredential(origin: string, opts: ReadStoredCre
|
|
|
412
466
|
* - **external** → `null`, for the same reason: the command answers a single
|
|
413
467
|
* `(origin, slot)` query; it has no listing contract.
|
|
414
468
|
*
|
|
415
|
-
*
|
|
416
|
-
*
|
|
417
|
-
*
|
|
418
|
-
*
|
|
469
|
+
* This function only reports the fact (and the backend-level reason behind
|
|
470
|
+
* it); it never decides the outcome — that is each caller's job, per the list
|
|
471
|
+
* above. It never logs or echoes any credential; only the origin KEYS (never
|
|
472
|
+
* secrets) are returned.
|
|
419
473
|
*
|
|
420
474
|
* `env`/`keychain` are threaded exactly as `readStoredCredential` threads them,
|
|
421
475
|
* so a caller passing a fixture `env` stays hermetic.
|
|
@@ -557,8 +611,8 @@ export interface MintAgentTokenOk {
|
|
|
557
611
|
token: string;
|
|
558
612
|
/** The minted agent's id — a non-secret handle, safe to print. */
|
|
559
613
|
agentId: string;
|
|
560
|
-
/** Resolved
|
|
561
|
-
|
|
614
|
+
/** Resolved crew NAMES the token was granted on — non-secret. */
|
|
615
|
+
crews: string[];
|
|
562
616
|
}
|
|
563
617
|
/**
|
|
564
618
|
* Narrow a `POST /api/mint_agent_token` 200 body to its typed success shape,
|
|
@@ -571,15 +625,15 @@ export interface MintAgentTokenOk {
|
|
|
571
625
|
* FIELD only — it never echoes a field VALUE. A malformed body could still carry
|
|
572
626
|
* the `olp_` plaintext (in `text`, or in a mistyped `token`), so echoing values
|
|
573
627
|
* here would be the exact leak §6 forbids. `id`/`agentId` must be non-empty
|
|
574
|
-
* strings; `token` a non-empty string starting `olp_`; `
|
|
628
|
+
* strings; `token` a non-empty string starting `olp_`; `crews` an array of
|
|
575
629
|
* strings (empty allowed defensively — the server always resolves at least one,
|
|
576
630
|
* but the client does not depend on that to stay leak-safe).
|
|
577
631
|
*/
|
|
578
632
|
export declare function asMintAgentTokenOk(body: unknown): MintAgentTokenOk;
|
|
579
633
|
/**
|
|
580
|
-
* One
|
|
634
|
+
* One Scoped Identity as `GET /api/agent_identities` reports it — the fields the
|
|
581
635
|
* setup converger and the doctor probe consult. The row is non-secret: it names
|
|
582
|
-
* agents and their
|
|
636
|
+
* agents and their crews, never a token.
|
|
583
637
|
*
|
|
584
638
|
* `lastContactAt` is identity-level (overwritten on EVERY authenticated contact,
|
|
585
639
|
* `olp_` or `mcpat_`). `lastUsedAt` is the edge-computed max over the identity's
|
|
@@ -592,7 +646,7 @@ export interface AgentIdentitySummary {
|
|
|
592
646
|
id: string;
|
|
593
647
|
name: string;
|
|
594
648
|
disabled: boolean;
|
|
595
|
-
|
|
649
|
+
crews: string[];
|
|
596
650
|
lastContactAt: number | null;
|
|
597
651
|
lastUsedAt: number | null;
|
|
598
652
|
}
|
|
@@ -601,18 +655,213 @@ export interface AgentIdentitySummary {
|
|
|
601
655
|
* typed array. Throws on a malformed body (missing `identities` array, or a row
|
|
602
656
|
* missing `id`/`name`). Non-secret shape — the rows carry no token — so errors
|
|
603
657
|
* may name indices/fields freely. `lastContactAt`/`lastUsedAt` tolerate `null`
|
|
604
|
-
* or absence (→ `null`) but reject a present non-number; `
|
|
658
|
+
* or absence (→ `null`) but reject a present non-number; `crews` defaults to an
|
|
605
659
|
* empty array when absent, rejects a present non-array-of-strings; `disabled`
|
|
606
660
|
* defaults to `false`.
|
|
607
661
|
*/
|
|
608
662
|
export declare function asAgentIdentities(body: unknown): AgentIdentitySummary[];
|
|
663
|
+
/**
|
|
664
|
+
* One **capability route** as the hub reports it — an org-scoped row mapping a
|
|
665
|
+
* workflow-def `capabilities:` entry to a crew. Unrelated to `HubBinding` above, which
|
|
666
|
+
* is this project directory's route to a hub (`owenloop connect`); every
|
|
667
|
+
* symbol in this family is `CapabilityRoute`-prefixed to keep the two apart.
|
|
668
|
+
*
|
|
669
|
+
* One row is ONE `(capability, crew)` PAIR, and a capability may bind MANY crews — so a
|
|
670
|
+
* single capability appears as MANY rows and nothing may key a collection on `capability`.
|
|
671
|
+
*
|
|
672
|
+
* `crewName` is `string | null`. A `null` name IS the **dangling route** case:
|
|
673
|
+
* the bound crew row was deleted, so the hub has no name left to resolve
|
|
674
|
+
* (`manage-capability-routes.ts`'s `toWire`). A dangling route routes nothing and
|
|
675
|
+
* never widens access, and it is deliberately SURFACED rather than filtered out —
|
|
676
|
+
* seeing the row is exactly what tells an operator there is something to clean up.
|
|
677
|
+
*
|
|
678
|
+
* Non-secret: the row names a capability, a crew, and who created it — never a token.
|
|
679
|
+
*/
|
|
680
|
+
export interface CapabilityRouteWire {
|
|
681
|
+
capability: string;
|
|
682
|
+
crewId: string;
|
|
683
|
+
crewName: string | null;
|
|
684
|
+
createdBy: string;
|
|
685
|
+
createdAt: number;
|
|
686
|
+
}
|
|
687
|
+
/**
|
|
688
|
+
* `POST /api/add_capability_route`'s 200 body, narrowed.
|
|
689
|
+
*
|
|
690
|
+
* NESTED exactly as the wire nests it: the row lives under `route`, while
|
|
691
|
+
* `alreadyRouted` and `routedCrewCount` live at the BODY's top level. A flat
|
|
692
|
+
* interface would blur where each field actually sits.
|
|
693
|
+
*
|
|
694
|
+
* - `alreadyRouted` — was this exact `(capability, crew)` pair already present? The add
|
|
695
|
+
* is ADDITIVE and idempotent per pair, so a repeat is a 200 no-op, not an
|
|
696
|
+
* error, and `route.createdBy`/`createdAt` then echo the ORIGINAL row.
|
|
697
|
+
* - `routedCrewCount` — how many **LIVE** crews the capability binds AFTER the write. A
|
|
698
|
+
* route whose crew row was deleted routes nothing and is not counted.
|
|
699
|
+
*/
|
|
700
|
+
export interface CapabilityRouteAddedWire {
|
|
701
|
+
route: CapabilityRouteWire;
|
|
702
|
+
alreadyRouted: boolean;
|
|
703
|
+
routedCrewCount: number;
|
|
704
|
+
}
|
|
705
|
+
/**
|
|
706
|
+
* Narrow `POST /api/add_capability_route`'s 200 body
|
|
707
|
+
* (`{ text, route, alreadyRouted, routedCrewCount }`). Throws on anything
|
|
708
|
+
* malformed, naming the offending FIELD only — same discipline as
|
|
709
|
+
* `asAgentIdentities`, so no body value is echoed.
|
|
710
|
+
*
|
|
711
|
+
* `route.crewName` is required to be a NON-NULL non-empty string here, on top
|
|
712
|
+
* of `asCapabilityRouteRow`'s lenient check. That is not a contradiction: an add
|
|
713
|
+
* resolves its crew BY NAME, so the crew is live by construction and a `null`
|
|
714
|
+
* name in THIS response is genuinely malformed — whereas a `null` name in a
|
|
715
|
+
* `capability_routes` row is the legitimate dangling-route case. Layering a
|
|
716
|
+
* call-site-specific check on top of the shared row call is the established
|
|
717
|
+
* shape in this family, not a new pattern.
|
|
718
|
+
*/
|
|
719
|
+
export declare function asCapabilityRouteAdded(body: unknown): CapabilityRouteAddedWire;
|
|
720
|
+
/**
|
|
721
|
+
* Narrow `POST /api/remove_capability_route`'s 200 body
|
|
722
|
+
* (`{ text, capability, crewId, removed, remainingCrewIds }`).
|
|
723
|
+
*
|
|
724
|
+
* `removed` must be a BOOLEAN — this guard is how the CLI proves the 2xx really
|
|
725
|
+
* was the remove verb's answer. BOTH boolean values are valid, deliberate hub
|
|
726
|
+
* responses:
|
|
727
|
+
* - `true` — the `(capability, crew)` pair was bound and is now removed;
|
|
728
|
+
* - `false` — the pair was never bound, so there was nothing to do. The hub
|
|
729
|
+
* answers this with a 200, never a 404 (the `removeCrewMember` `{existed}`
|
|
730
|
+
* house pattern), and that tolerance is what makes `capability unbind` idempotent.
|
|
731
|
+
*
|
|
732
|
+
* `crewId` is LENIENT (absent or `null` both yield `null`) because `null` is a
|
|
733
|
+
* real hub output, not a defect: `manage-capability-routes.ts` resolves it as
|
|
734
|
+
* `namedCrew?.id ?? thisCapabilityRows.find(...)?.crewId ?? null`, so it is `null`
|
|
735
|
+
* on exactly the tolerant `removed: false` path where the argument matched
|
|
736
|
+
* neither a live crew name nor one of this capability's own route rows. Requiring a
|
|
737
|
+
* non-empty string here would throw on a normal success.
|
|
738
|
+
*
|
|
739
|
+
* `remainingCrewIds` is deliberately NOT lenient — it must be PRESENT and an
|
|
740
|
+
* array of non-empty strings. The asymmetry is the point: for a nullable name,
|
|
741
|
+
* the lenient default (`null`) is the SAFE reading, but defaulting an absent
|
|
742
|
+
* `remainingCrewIds` to `[]` would assert "this capability is now PARKED" — the
|
|
743
|
+
* alarming reading, and exactly the signal an operator acts on — off a malformed
|
|
744
|
+
* body. It lists LIVE crews only, so `[]` genuinely means zero live routes
|
|
745
|
+
* remain (which can happen while a dangling row survives, since such a row routes
|
|
746
|
+
* nothing).
|
|
747
|
+
*
|
|
748
|
+
* The stdout shape built from this is documented in `docs/cli.md`'s
|
|
749
|
+
* "Printed JSON" table under capability routes.
|
|
750
|
+
*/
|
|
751
|
+
export declare function asCapabilityRouteRemoved(body: unknown): {
|
|
752
|
+
capability: string;
|
|
753
|
+
crewId: string | null;
|
|
754
|
+
removed: boolean;
|
|
755
|
+
remainingCrewIds: string[];
|
|
756
|
+
};
|
|
757
|
+
/**
|
|
758
|
+
* Narrow `GET /api/capability_routes`'s 200 body (`{ text, routes: [...] }`) to a
|
|
759
|
+
* typed array. An EMPTY array is valid — that is the "this org has no routes
|
|
760
|
+
* yet" case, not an error.
|
|
761
|
+
*
|
|
762
|
+
* Rows are plain `CapabilityRouteWire`, ONE per `(capability, crew)` pair ordered by
|
|
763
|
+
* `capability, crew_id`, so a capability bound to many crews yields MANY rows — the array
|
|
764
|
+
* is forwarded as-is and must never be collapsed into a per-capability map. A row
|
|
765
|
+
* whose `crewName` is `null` is a dangling route and is kept, not dropped.
|
|
766
|
+
*/
|
|
767
|
+
export declare function asCapabilityRoutes(body: unknown): CapabilityRouteWire[];
|
|
768
|
+
/**
|
|
769
|
+
* A **crew** as the hub reports it — an org-scoped queue that agent work is
|
|
770
|
+
* stamped to. `kind` is `'personal' | 'shared' | 'orphan'` on the wire, but is
|
|
771
|
+
* deliberately NOT narrowed to that union here: `'orphan'` is a real value
|
|
772
|
+
* `GET /api/crews` returns, and the hub verbs (`packages/hub-core/src/verbs/
|
|
773
|
+
* manage-crews.ts`) are the enforcement of record for the other two — the same
|
|
774
|
+
* stance `agent new` takes for `--crews`.
|
|
775
|
+
*/
|
|
776
|
+
export interface CrewWire {
|
|
777
|
+
id: string;
|
|
778
|
+
name: string;
|
|
779
|
+
kind: string;
|
|
780
|
+
ownerMemberId: string | null;
|
|
781
|
+
createdBy: string;
|
|
782
|
+
createdAt: number;
|
|
783
|
+
}
|
|
784
|
+
/** One membership row on a `CrewListingWire` — `principalKind` is `'member' | 'agent'` on the wire, forwarded verbatim. */
|
|
785
|
+
export interface CrewMemberWire {
|
|
786
|
+
principalKind: string;
|
|
787
|
+
principalId: string;
|
|
788
|
+
addedBy: string;
|
|
789
|
+
addedAt: number;
|
|
790
|
+
}
|
|
791
|
+
/**
|
|
792
|
+
* `GET /api/crews`' per-crew listing — a `CrewWire` plus its members inline
|
|
793
|
+
* (one hop, no per-crew fan-out) plus a CLIENT-DERIVED `orphan` boolean. `orphan`
|
|
794
|
+
* never appears on the wire; `asCrews` computes it with the same rule as the
|
|
795
|
+
* hub's own `isOrphanCrew` (`manage-crews.ts:170-172`) so the CLI can mark the
|
|
796
|
+
* org's reserved `orphan:unrouted` crew instead of filtering it out — an
|
|
797
|
+
* operator has to be able to see where a deleted crew's work went.
|
|
798
|
+
*/
|
|
799
|
+
export interface CrewListingWire extends CrewWire {
|
|
800
|
+
orphan: boolean;
|
|
801
|
+
members: CrewMemberWire[];
|
|
802
|
+
}
|
|
803
|
+
/**
|
|
804
|
+
* `POST /api/delete_crew`'s 200 body. `deleted` is always present; the six
|
|
805
|
+
* transfer fields are OPTIONAL and, deliberately, absent (not `null`, not `0`)
|
|
806
|
+
* when nothing moved — see `asCrewDeleted`.
|
|
807
|
+
*/
|
|
808
|
+
export interface CrewDeletedWire {
|
|
809
|
+
crewId: string;
|
|
810
|
+
deleted: boolean;
|
|
811
|
+
membersRemoved?: number;
|
|
812
|
+
orphanCrewId?: string;
|
|
813
|
+
orphanCrewName?: string;
|
|
814
|
+
stampsTransferred?: number;
|
|
815
|
+
runsTransferred?: string[];
|
|
816
|
+
runningRunsTransferred?: string[];
|
|
817
|
+
}
|
|
818
|
+
/** `POST /api/remove_crew_member`'s 200 body — tolerant of a non-member, exactly like `asCapabilityRouteRemoved`'s `removed`. */
|
|
819
|
+
export interface CrewMemberRemovedWire {
|
|
820
|
+
crewId: string;
|
|
821
|
+
principalId: string;
|
|
822
|
+
removed: boolean;
|
|
823
|
+
}
|
|
824
|
+
/**
|
|
825
|
+
* Narrow `GET /api/crews`'s 200 body (`{ text, crews: [...] }`) to a typed
|
|
826
|
+
* array. An EMPTY array is valid (a brand-new org). `GET /api/crews`
|
|
827
|
+
* deliberately returns the org's reserved orphan crew when it exists — this
|
|
828
|
+
* never filters it out; instead every row gets a derived `orphan` boolean,
|
|
829
|
+
* always present (`true` or `false`), so a scripted consumer never branches on
|
|
830
|
+
* the key's existence.
|
|
831
|
+
*/
|
|
832
|
+
export declare function asCrews(body: unknown): CrewListingWire[];
|
|
833
|
+
/**
|
|
834
|
+
* Narrow `POST /api/create_crew`'s 200 body (`{ text, crew }`) to the typed
|
|
835
|
+
* row.
|
|
836
|
+
*/
|
|
837
|
+
export declare function asCrewCreated(body: unknown): CrewWire;
|
|
838
|
+
/**
|
|
839
|
+
* Narrow `POST /api/delete_crew`'s 200 body. `crewId` and `deleted` are always
|
|
840
|
+
* present (`deleted` is a genuine boolean — both values are valid, deliberate
|
|
841
|
+
* hub answers, exactly like `asCapabilityRouteRemoved`). Each of the six transfer
|
|
842
|
+
* fields is validated ONLY IF PRESENT and OMITTED from the returned object when
|
|
843
|
+
* absent — never defaulted to `0`, `null`, or `[]`. Absence is the hub's way of
|
|
844
|
+
* saying "nothing moved"; default-filling would assert a transfer that never
|
|
845
|
+
* happened. `runsTransferred`/`runningRunsTransferred` are ARRAYS OF IDS, not
|
|
846
|
+
* counts — `stampsTransferred`/`membersRemoved` are the counts.
|
|
847
|
+
*/
|
|
848
|
+
export declare function asCrewDeleted(body: unknown): CrewDeletedWire;
|
|
849
|
+
/** Narrow `POST /api/add_crew_member`'s 200 body (`{ text, member }`) to the typed row. */
|
|
850
|
+
export declare function asCrewMemberAdded(body: unknown): CrewMemberWire;
|
|
851
|
+
/**
|
|
852
|
+
* Narrow `POST /api/remove_crew_member`'s 200 body (`{ text, crewId,
|
|
853
|
+
* principalId, removed }`). `removed` must be a genuine boolean — both values
|
|
854
|
+
* are valid, deliberate hub answers: `false` means the principal was never a
|
|
855
|
+
* member (tolerant, a normal success), exactly like `asCapabilityRouteRemoved`.
|
|
856
|
+
*/
|
|
857
|
+
export declare function asCrewMemberRemoved(body: unknown): CrewMemberRemovedWire;
|
|
609
858
|
/**
|
|
610
859
|
* Success shape of `POST /api/rekey_agent_token` — the whitelist a caller may
|
|
611
860
|
* keep. Sibling of `MintAgentTokenOk`, and MUST stay a whitelist for the same
|
|
612
861
|
* reason: the real 200 body carries a `text` field whose value CONTAINS the new
|
|
613
862
|
* one-time `olp_` plaintext, so a caller must never spread the raw body.
|
|
614
863
|
*
|
|
615
|
-
* Rekey has NO `
|
|
864
|
+
* Rekey has NO `crews` field (re-keying preserves the agent's existing crew
|
|
616
865
|
* membership — the verb changes none), so `MintAgentTokenOk`/`asMintAgentTokenOk`
|
|
617
866
|
* cannot be reused. `scopes` and `revokedTokenIds` are non-secret handles.
|
|
618
867
|
*/
|