owenloop 0.4.1 → 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/CHANGELOG.md +26 -0
- package/README.md +58 -31
- package/bin/owenloop.mjs +2 -2
- package/dist/packages/work/src/agent/brief.d.ts +172 -0
- package/dist/packages/work/src/agent/brief.js +193 -0
- package/dist/packages/work/src/agent/loop.d.ts +135 -0
- package/dist/packages/work/src/agent/loop.js +542 -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 +90 -0
- package/dist/packages/work/src/bundle/cache.js +324 -0
- package/dist/packages/work/src/bundle/fetch.d.ts +85 -0
- package/dist/packages/work/src/bundle/fetch.js +325 -0
- package/dist/packages/work/src/bundle/types.d.ts +160 -0
- package/dist/packages/work/src/bundle/types.js +1 -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/loop.d.ts +29 -0
- package/dist/packages/work/src/exec/loop.js +215 -0
- package/dist/packages/work/src/exec/receipt.d.ts +38 -0
- package/dist/packages/work/src/exec/receipt.js +21 -0
- package/dist/packages/work/src/exec/runner.d.ts +65 -0
- package/dist/packages/work/src/exec/runner.js +185 -0
- package/dist/packages/work/src/harness/child-env.d.ts +100 -0
- package/dist/packages/work/src/harness/child-env.js +127 -0
- package/dist/packages/work/src/harness/claude.d.ts +128 -0
- package/dist/packages/work/src/harness/claude.js +635 -0
- package/dist/packages/work/src/harness/codex.d.ts +110 -0
- package/dist/packages/work/src/harness/codex.js +896 -0
- package/dist/packages/work/src/harness/contract.d.ts +283 -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 +90 -0
- package/dist/packages/work/src/harness/jsonrpc-stdio.d.ts +108 -0
- package/dist/packages/work/src/harness/jsonrpc-stdio.js +344 -0
- package/dist/packages/work/src/harness/permissions.d.ts +62 -0
- package/dist/packages/work/src/harness/permissions.js +93 -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 +163 -0
- package/dist/packages/work/src/harness/session-store.js +319 -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 +55 -0
- package/dist/packages/work/src/hold/mcp.js +149 -0
- package/dist/packages/work/src/hub/client.d.ts +22 -0
- package/dist/packages/work/src/hub/client.js +78 -0
- package/dist/packages/work/src/hub/types.d.ts +290 -0
- package/dist/packages/work/src/hub/types.js +28 -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/roles/agent-run.d.ts +118 -0
- package/dist/packages/work/src/roles/agent-run.js +447 -0
- package/dist/packages/work/src/roles/exec.d.ts +40 -0
- package/dist/packages/work/src/roles/exec.js +203 -0
- package/dist/packages/work/src/roles/hold.d.ts +68 -0
- package/dist/packages/work/src/roles/hold.js +324 -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 +59 -0
- package/dist/packages/work/src/roles/lint.js +200 -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 +66 -0
- package/dist/packages/work/src/roles/shift.d.ts +12 -0
- package/dist/packages/work/src/roles/shift.js +228 -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 +120 -0
- package/dist/packages/work/src/settings/settings.js +116 -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 +120 -0
- package/dist/packages/work/src/shift/loop.js +468 -0
- package/dist/packages/work/src/shift/protocol.d.ts +91 -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 +43 -0
- package/dist/packages/work/src/shift/runtime.js +274 -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 +86 -0
- package/dist/packages/work/src/shift/spawn.js +100 -0
- package/dist/packages/work/src/shift/state.d.ts +77 -0
- package/dist/packages/work/src/shift/state.js +162 -0
- package/dist/packages/work/src/usage.d.ts +6 -0
- package/dist/packages/work/src/usage.js +175 -0
- package/dist/{cli.d.ts → src/cli.d.ts} +18 -3
- package/dist/{cli.js → src/cli.js} +770 -114
- package/dist/{credentials.d.ts → src/credentials.d.ts} +18 -12
- package/dist/{credentials.js → src/credentials.js} +14 -12
- package/dist/{defs.js → src/defs.js} +36 -36
- package/dist/{engine.d.ts → src/engine.d.ts} +8 -8
- package/dist/{engine.js → src/engine.js} +14 -14
- package/dist/{hub.d.ts → src/hub.d.ts} +205 -10
- package/dist/{hub.js → src/hub.js} +370 -12
- package/dist/{index.d.ts → src/index.d.ts} +1 -1
- package/dist/{index.js → src/index.js} +1 -1
- package/dist/{mcp → src/mcp}/serve.d.ts +5 -4
- package/dist/{mcp → src/mcp}/serve.js +168 -31
- package/dist/{mcp → src/mcp}/server.d.ts +6 -9
- package/dist/{mcp → src/mcp}/server.js +6 -9
- package/dist/{model.js → src/model.js} +1 -1
- package/dist/{types.d.ts → src/types.d.ts} +18 -18
- 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/authoring.md +93 -53
- package/docs/cli.md +597 -76
- package/docs/design.md +33 -33
- package/docs/embedding.md +10 -9
- 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 +17 -8
- /package/dist/{add.d.ts → src/add.d.ts} +0 -0
- /package/dist/{add.js → src/add.js} +0 -0
- /package/dist/{defs.d.ts → src/defs.d.ts} +0 -0
- /package/dist/{factory.d.ts → src/factory.d.ts} +0 -0
- /package/dist/{factory.js → src/factory.js} +0 -0
- /package/dist/{lock.d.ts → src/lock.d.ts} +0 -0
- /package/dist/{lock.js → src/lock.js} +0 -0
- /package/dist/{model.d.ts → src/model.d.ts} +0 -0
- /package/dist/{paths.d.ts → src/paths.d.ts} +0 -0
- /package/dist/{paths.js → src/paths.js} +0 -0
- /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
- /package/dist/{untar.d.ts → src/untar.d.ts} +0 -0
- /package/dist/{untar.js → src/untar.js} +0 -0
|
@@ -163,7 +163,7 @@ export type Credential = {
|
|
|
163
163
|
* distinct entries that never collide, and neither does `agent:ci` with
|
|
164
164
|
* `agent:release`.
|
|
165
165
|
*
|
|
166
|
-
* The discriminator is an **account**, never a "
|
|
166
|
+
* The discriminator is an **account**, never a "capability" — capabilities are a different
|
|
167
167
|
* axis of the system and the word is reserved.
|
|
168
168
|
*/
|
|
169
169
|
export type CredentialSlotSelector = {
|
|
@@ -348,7 +348,7 @@ export type ReadStoredCredentialOpts = CredentialSlotSelector & {
|
|
|
348
348
|
/**
|
|
349
349
|
* Read the stored hub credential for `origin` **in the named slot** from the
|
|
350
350
|
* chosen backend ONLY — the supported, read-only programmatic surface
|
|
351
|
-
* (
|
|
351
|
+
* (owenloop's CredentialReader seam wires to this once released). Secret hygiene
|
|
352
352
|
* is unchanged: this function never logs or echoes the returned credential, and
|
|
353
353
|
* there is deliberately no write/delete companion on the public surface —
|
|
354
354
|
* `login` / `logout` remain the only way to store or remove a credential.
|
|
@@ -557,8 +557,8 @@ export interface MintAgentTokenOk {
|
|
|
557
557
|
token: string;
|
|
558
558
|
/** The minted agent's id — a non-secret handle, safe to print. */
|
|
559
559
|
agentId: string;
|
|
560
|
-
/** Resolved
|
|
561
|
-
|
|
560
|
+
/** Resolved crew NAMES the token was granted on — non-secret. */
|
|
561
|
+
crews: string[];
|
|
562
562
|
}
|
|
563
563
|
/**
|
|
564
564
|
* Narrow a `POST /api/mint_agent_token` 200 body to its typed success shape,
|
|
@@ -571,15 +571,15 @@ export interface MintAgentTokenOk {
|
|
|
571
571
|
* FIELD only — it never echoes a field VALUE. A malformed body could still carry
|
|
572
572
|
* the `olp_` plaintext (in `text`, or in a mistyped `token`), so echoing values
|
|
573
573
|
* here would be the exact leak §6 forbids. `id`/`agentId` must be non-empty
|
|
574
|
-
* strings; `token` a non-empty string starting `olp_`; `
|
|
574
|
+
* strings; `token` a non-empty string starting `olp_`; `crews` an array of
|
|
575
575
|
* strings (empty allowed defensively — the server always resolves at least one,
|
|
576
576
|
* but the client does not depend on that to stay leak-safe).
|
|
577
577
|
*/
|
|
578
578
|
export declare function asMintAgentTokenOk(body: unknown): MintAgentTokenOk;
|
|
579
579
|
/**
|
|
580
|
-
* One
|
|
580
|
+
* One Scoped Identity as `GET /api/agent_identities` reports it — the fields the
|
|
581
581
|
* setup converger and the doctor probe consult. The row is non-secret: it names
|
|
582
|
-
* agents and their
|
|
582
|
+
* agents and their crews, never a token.
|
|
583
583
|
*
|
|
584
584
|
* `lastContactAt` is identity-level (overwritten on EVERY authenticated contact,
|
|
585
585
|
* `olp_` or `mcpat_`). `lastUsedAt` is the edge-computed max over the identity's
|
|
@@ -592,7 +592,7 @@ export interface AgentIdentitySummary {
|
|
|
592
592
|
id: string;
|
|
593
593
|
name: string;
|
|
594
594
|
disabled: boolean;
|
|
595
|
-
|
|
595
|
+
crews: string[];
|
|
596
596
|
lastContactAt: number | null;
|
|
597
597
|
lastUsedAt: number | null;
|
|
598
598
|
}
|
|
@@ -601,18 +601,213 @@ export interface AgentIdentitySummary {
|
|
|
601
601
|
* typed array. Throws on a malformed body (missing `identities` array, or a row
|
|
602
602
|
* missing `id`/`name`). Non-secret shape — the rows carry no token — so errors
|
|
603
603
|
* may name indices/fields freely. `lastContactAt`/`lastUsedAt` tolerate `null`
|
|
604
|
-
* or absence (→ `null`) but reject a present non-number; `
|
|
604
|
+
* or absence (→ `null`) but reject a present non-number; `crews` defaults to an
|
|
605
605
|
* empty array when absent, rejects a present non-array-of-strings; `disabled`
|
|
606
606
|
* defaults to `false`.
|
|
607
607
|
*/
|
|
608
608
|
export declare function asAgentIdentities(body: unknown): AgentIdentitySummary[];
|
|
609
|
+
/**
|
|
610
|
+
* One **capability route** as the hub reports it — an org-scoped row mapping a
|
|
611
|
+
* workflow-def `capabilities:` entry to a crew. Unrelated to `HubBinding` above, which
|
|
612
|
+
* is this project directory's route to a hub (`owenloop connect`); every
|
|
613
|
+
* symbol in this family is `CapabilityRoute`-prefixed to keep the two apart.
|
|
614
|
+
*
|
|
615
|
+
* One row is ONE `(capability, crew)` PAIR, and a capability may bind MANY crews — so a
|
|
616
|
+
* single capability appears as MANY rows and nothing may key a collection on `capability`.
|
|
617
|
+
*
|
|
618
|
+
* `crewName` is `string | null`. A `null` name IS the **dangling route** case:
|
|
619
|
+
* the bound crew row was deleted, so the hub has no name left to resolve
|
|
620
|
+
* (`manage-capability-routes.ts`'s `toWire`). A dangling route routes nothing and
|
|
621
|
+
* never widens access, and it is deliberately SURFACED rather than filtered out —
|
|
622
|
+
* seeing the row is exactly what tells an operator there is something to clean up.
|
|
623
|
+
*
|
|
624
|
+
* Non-secret: the row names a capability, a crew, and who created it — never a token.
|
|
625
|
+
*/
|
|
626
|
+
export interface CapabilityRouteWire {
|
|
627
|
+
capability: string;
|
|
628
|
+
crewId: string;
|
|
629
|
+
crewName: string | null;
|
|
630
|
+
createdBy: string;
|
|
631
|
+
createdAt: number;
|
|
632
|
+
}
|
|
633
|
+
/**
|
|
634
|
+
* `POST /api/add_capability_route`'s 200 body, narrowed.
|
|
635
|
+
*
|
|
636
|
+
* NESTED exactly as the wire nests it: the row lives under `route`, while
|
|
637
|
+
* `alreadyRouted` and `routedCrewCount` live at the BODY's top level. A flat
|
|
638
|
+
* interface would blur where each field actually sits.
|
|
639
|
+
*
|
|
640
|
+
* - `alreadyRouted` — was this exact `(capability, crew)` pair already present? The add
|
|
641
|
+
* is ADDITIVE and idempotent per pair, so a repeat is a 200 no-op, not an
|
|
642
|
+
* error, and `route.createdBy`/`createdAt` then echo the ORIGINAL row.
|
|
643
|
+
* - `routedCrewCount` — how many **LIVE** crews the capability binds AFTER the write. A
|
|
644
|
+
* route whose crew row was deleted routes nothing and is not counted.
|
|
645
|
+
*/
|
|
646
|
+
export interface CapabilityRouteAddedWire {
|
|
647
|
+
route: CapabilityRouteWire;
|
|
648
|
+
alreadyRouted: boolean;
|
|
649
|
+
routedCrewCount: number;
|
|
650
|
+
}
|
|
651
|
+
/**
|
|
652
|
+
* Narrow `POST /api/add_capability_route`'s 200 body
|
|
653
|
+
* (`{ text, route, alreadyRouted, routedCrewCount }`). Throws on anything
|
|
654
|
+
* malformed, naming the offending FIELD only — same discipline as
|
|
655
|
+
* `asAgentIdentities`, so no body value is echoed.
|
|
656
|
+
*
|
|
657
|
+
* `route.crewName` is required to be a NON-NULL non-empty string here, on top
|
|
658
|
+
* of `asCapabilityRouteRow`'s lenient check. That is not a contradiction: an add
|
|
659
|
+
* resolves its crew BY NAME, so the crew is live by construction and a `null`
|
|
660
|
+
* name in THIS response is genuinely malformed — whereas a `null` name in a
|
|
661
|
+
* `capability_routes` row is the legitimate dangling-route case. Layering a
|
|
662
|
+
* call-site-specific check on top of the shared row call is the established
|
|
663
|
+
* shape in this family, not a new pattern.
|
|
664
|
+
*/
|
|
665
|
+
export declare function asCapabilityRouteAdded(body: unknown): CapabilityRouteAddedWire;
|
|
666
|
+
/**
|
|
667
|
+
* Narrow `POST /api/remove_capability_route`'s 200 body
|
|
668
|
+
* (`{ text, capability, crewId, removed, remainingCrewIds }`).
|
|
669
|
+
*
|
|
670
|
+
* `removed` must be a BOOLEAN — this guard is how the CLI proves the 2xx really
|
|
671
|
+
* was the remove verb's answer. BOTH boolean values are valid, deliberate hub
|
|
672
|
+
* responses:
|
|
673
|
+
* - `true` — the `(capability, crew)` pair was bound and is now removed;
|
|
674
|
+
* - `false` — the pair was never bound, so there was nothing to do. The hub
|
|
675
|
+
* answers this with a 200, never a 404 (the `removeCrewMember` `{existed}`
|
|
676
|
+
* house pattern), and that tolerance is what makes `capability unbind` idempotent.
|
|
677
|
+
*
|
|
678
|
+
* `crewId` is LENIENT (absent or `null` both yield `null`) because `null` is a
|
|
679
|
+
* real hub output, not a defect: `manage-capability-routes.ts` resolves it as
|
|
680
|
+
* `namedCrew?.id ?? thisCapabilityRows.find(...)?.crewId ?? null`, so it is `null`
|
|
681
|
+
* on exactly the tolerant `removed: false` path where the argument matched
|
|
682
|
+
* neither a live crew name nor one of this capability's own route rows. Requiring a
|
|
683
|
+
* non-empty string here would throw on a normal success.
|
|
684
|
+
*
|
|
685
|
+
* `remainingCrewIds` is deliberately NOT lenient — it must be PRESENT and an
|
|
686
|
+
* array of non-empty strings. The asymmetry is the point: for a nullable name,
|
|
687
|
+
* the lenient default (`null`) is the SAFE reading, but defaulting an absent
|
|
688
|
+
* `remainingCrewIds` to `[]` would assert "this capability is now PARKED" — the
|
|
689
|
+
* alarming reading, and exactly the signal an operator acts on — off a malformed
|
|
690
|
+
* body. It lists LIVE crews only, so `[]` genuinely means zero live routes
|
|
691
|
+
* remain (which can happen while a dangling row survives, since such a row routes
|
|
692
|
+
* nothing).
|
|
693
|
+
*
|
|
694
|
+
* The stdout shape built from this is documented in `docs/cli.md`'s
|
|
695
|
+
* "Printed JSON" table under capability routes.
|
|
696
|
+
*/
|
|
697
|
+
export declare function asCapabilityRouteRemoved(body: unknown): {
|
|
698
|
+
capability: string;
|
|
699
|
+
crewId: string | null;
|
|
700
|
+
removed: boolean;
|
|
701
|
+
remainingCrewIds: string[];
|
|
702
|
+
};
|
|
703
|
+
/**
|
|
704
|
+
* Narrow `GET /api/capability_routes`'s 200 body (`{ text, routes: [...] }`) to a
|
|
705
|
+
* typed array. An EMPTY array is valid — that is the "this org has no routes
|
|
706
|
+
* yet" case, not an error.
|
|
707
|
+
*
|
|
708
|
+
* Rows are plain `CapabilityRouteWire`, ONE per `(capability, crew)` pair ordered by
|
|
709
|
+
* `capability, crew_id`, so a capability bound to many crews yields MANY rows — the array
|
|
710
|
+
* is forwarded as-is and must never be collapsed into a per-capability map. A row
|
|
711
|
+
* whose `crewName` is `null` is a dangling route and is kept, not dropped.
|
|
712
|
+
*/
|
|
713
|
+
export declare function asCapabilityRoutes(body: unknown): CapabilityRouteWire[];
|
|
714
|
+
/**
|
|
715
|
+
* A **crew** as the hub reports it — an org-scoped queue that agent work is
|
|
716
|
+
* stamped to. `kind` is `'personal' | 'shared' | 'orphan'` on the wire, but is
|
|
717
|
+
* deliberately NOT narrowed to that union here: `'orphan'` is a real value
|
|
718
|
+
* `GET /api/crews` returns, and the hub verbs (`packages/hub-core/src/verbs/
|
|
719
|
+
* manage-crews.ts`) are the enforcement of record for the other two — the same
|
|
720
|
+
* stance `agent new` takes for `--crews`.
|
|
721
|
+
*/
|
|
722
|
+
export interface CrewWire {
|
|
723
|
+
id: string;
|
|
724
|
+
name: string;
|
|
725
|
+
kind: string;
|
|
726
|
+
ownerMemberId: string | null;
|
|
727
|
+
createdBy: string;
|
|
728
|
+
createdAt: number;
|
|
729
|
+
}
|
|
730
|
+
/** One membership row on a `CrewListingWire` — `principalKind` is `'member' | 'agent'` on the wire, forwarded verbatim. */
|
|
731
|
+
export interface CrewMemberWire {
|
|
732
|
+
principalKind: string;
|
|
733
|
+
principalId: string;
|
|
734
|
+
addedBy: string;
|
|
735
|
+
addedAt: number;
|
|
736
|
+
}
|
|
737
|
+
/**
|
|
738
|
+
* `GET /api/crews`' per-crew listing — a `CrewWire` plus its members inline
|
|
739
|
+
* (one hop, no per-crew fan-out) plus a CLIENT-DERIVED `orphan` boolean. `orphan`
|
|
740
|
+
* never appears on the wire; `asCrews` computes it with the same rule as the
|
|
741
|
+
* hub's own `isOrphanCrew` (`manage-crews.ts:170-172`) so the CLI can mark the
|
|
742
|
+
* org's reserved `orphan:unrouted` crew instead of filtering it out — an
|
|
743
|
+
* operator has to be able to see where a deleted crew's work went.
|
|
744
|
+
*/
|
|
745
|
+
export interface CrewListingWire extends CrewWire {
|
|
746
|
+
orphan: boolean;
|
|
747
|
+
members: CrewMemberWire[];
|
|
748
|
+
}
|
|
749
|
+
/**
|
|
750
|
+
* `POST /api/delete_crew`'s 200 body. `deleted` is always present; the six
|
|
751
|
+
* transfer fields are OPTIONAL and, deliberately, absent (not `null`, not `0`)
|
|
752
|
+
* when nothing moved — see `asCrewDeleted`.
|
|
753
|
+
*/
|
|
754
|
+
export interface CrewDeletedWire {
|
|
755
|
+
crewId: string;
|
|
756
|
+
deleted: boolean;
|
|
757
|
+
membersRemoved?: number;
|
|
758
|
+
orphanCrewId?: string;
|
|
759
|
+
orphanCrewName?: string;
|
|
760
|
+
stampsTransferred?: number;
|
|
761
|
+
runsTransferred?: string[];
|
|
762
|
+
runningRunsTransferred?: string[];
|
|
763
|
+
}
|
|
764
|
+
/** `POST /api/remove_crew_member`'s 200 body — tolerant of a non-member, exactly like `asCapabilityRouteRemoved`'s `removed`. */
|
|
765
|
+
export interface CrewMemberRemovedWire {
|
|
766
|
+
crewId: string;
|
|
767
|
+
principalId: string;
|
|
768
|
+
removed: boolean;
|
|
769
|
+
}
|
|
770
|
+
/**
|
|
771
|
+
* Narrow `GET /api/crews`'s 200 body (`{ text, crews: [...] }`) to a typed
|
|
772
|
+
* array. An EMPTY array is valid (a brand-new org). `GET /api/crews`
|
|
773
|
+
* deliberately returns the org's reserved orphan crew when it exists — this
|
|
774
|
+
* never filters it out; instead every row gets a derived `orphan` boolean,
|
|
775
|
+
* always present (`true` or `false`), so a scripted consumer never branches on
|
|
776
|
+
* the key's existence.
|
|
777
|
+
*/
|
|
778
|
+
export declare function asCrews(body: unknown): CrewListingWire[];
|
|
779
|
+
/**
|
|
780
|
+
* Narrow `POST /api/create_crew`'s 200 body (`{ text, crew }`) to the typed
|
|
781
|
+
* row.
|
|
782
|
+
*/
|
|
783
|
+
export declare function asCrewCreated(body: unknown): CrewWire;
|
|
784
|
+
/**
|
|
785
|
+
* Narrow `POST /api/delete_crew`'s 200 body. `crewId` and `deleted` are always
|
|
786
|
+
* present (`deleted` is a genuine boolean — both values are valid, deliberate
|
|
787
|
+
* hub answers, exactly like `asCapabilityRouteRemoved`). Each of the six transfer
|
|
788
|
+
* fields is validated ONLY IF PRESENT and OMITTED from the returned object when
|
|
789
|
+
* absent — never defaulted to `0`, `null`, or `[]`. Absence is the hub's way of
|
|
790
|
+
* saying "nothing moved"; default-filling would assert a transfer that never
|
|
791
|
+
* happened. `runsTransferred`/`runningRunsTransferred` are ARRAYS OF IDS, not
|
|
792
|
+
* counts — `stampsTransferred`/`membersRemoved` are the counts.
|
|
793
|
+
*/
|
|
794
|
+
export declare function asCrewDeleted(body: unknown): CrewDeletedWire;
|
|
795
|
+
/** Narrow `POST /api/add_crew_member`'s 200 body (`{ text, member }`) to the typed row. */
|
|
796
|
+
export declare function asCrewMemberAdded(body: unknown): CrewMemberWire;
|
|
797
|
+
/**
|
|
798
|
+
* Narrow `POST /api/remove_crew_member`'s 200 body (`{ text, crewId,
|
|
799
|
+
* principalId, removed }`). `removed` must be a genuine boolean — both values
|
|
800
|
+
* are valid, deliberate hub answers: `false` means the principal was never a
|
|
801
|
+
* member (tolerant, a normal success), exactly like `asCapabilityRouteRemoved`.
|
|
802
|
+
*/
|
|
803
|
+
export declare function asCrewMemberRemoved(body: unknown): CrewMemberRemovedWire;
|
|
609
804
|
/**
|
|
610
805
|
* Success shape of `POST /api/rekey_agent_token` — the whitelist a caller may
|
|
611
806
|
* keep. Sibling of `MintAgentTokenOk`, and MUST stay a whitelist for the same
|
|
612
807
|
* reason: the real 200 body carries a `text` field whose value CONTAINS the new
|
|
613
808
|
* one-time `olp_` plaintext, so a caller must never spread the raw body.
|
|
614
809
|
*
|
|
615
|
-
* Rekey has NO `
|
|
810
|
+
* Rekey has NO `crews` field (re-keying preserves the agent's existing crew
|
|
616
811
|
* membership — the verb changes none), so `MintAgentTokenOk`/`asMintAgentTokenOk`
|
|
617
812
|
* cannot be reused. `scopes` and `revokedTokenIds` are non-secret handles.
|
|
618
813
|
*/
|