owenloop 0.5.7 → 0.5.9
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 +41 -0
- package/README.md +7 -8
- package/dist/packages/work/src/agent/capability-model.d.ts +64 -82
- package/dist/packages/work/src/agent/capability-model.js +94 -91
- package/dist/packages/work/src/agent/loop.d.ts +55 -26
- package/dist/packages/work/src/agent/loop.js +144 -50
- package/dist/packages/work/src/bundle/types.d.ts +3 -3
- package/dist/packages/work/src/consumed-verifier.js +6 -17
- package/dist/packages/work/src/exec/loop.d.ts +1 -1
- package/dist/packages/work/src/exec/loop.js +206 -35
- package/dist/packages/work/src/exec/receipt.d.ts +7 -7
- package/dist/packages/work/src/exec/receipt.js +6 -6
- package/dist/packages/work/src/harness/child-env.js +4 -5
- package/dist/packages/work/src/harness/claude.js +100 -0
- package/dist/packages/work/src/harness/codex.js +3 -4
- package/dist/packages/work/src/harness/session-store.d.ts +63 -3
- package/dist/packages/work/src/harness/session-store.js +104 -9
- package/dist/packages/work/src/hub/client.d.ts +19 -4
- package/dist/packages/work/src/hub/client.js +7 -3
- package/dist/packages/work/src/hub/types.d.ts +87 -3
- package/dist/packages/work/src/main.js +1 -0
- package/dist/packages/work/src/roles/agent-run.js +46 -43
- package/dist/packages/work/src/roles/exec.js +2 -0
- package/dist/packages/work/src/roles/sessions.d.ts +3 -2
- package/dist/packages/work/src/roles/sessions.js +9 -2
- package/dist/packages/work/src/roles/settings.js +3 -1
- package/dist/packages/work/src/roles/shift.js +14 -2
- package/dist/packages/work/src/roles/util.d.ts +1 -0
- package/dist/packages/work/src/roles/util.js +10 -0
- package/dist/packages/work/src/settings/hub-roster-cache.d.ts +68 -0
- package/dist/packages/work/src/settings/hub-roster-cache.js +370 -0
- package/dist/packages/work/src/settings/roster.d.ts +105 -0
- package/dist/packages/work/src/settings/roster.js +439 -0
- package/dist/packages/work/src/settings/serving.d.ts +17 -0
- package/dist/packages/work/src/settings/serving.js +79 -0
- package/dist/packages/work/src/settings/settings.d.ts +25 -24
- package/dist/packages/work/src/settings/settings.js +29 -33
- package/dist/packages/work/src/shift/loop.d.ts +108 -5
- package/dist/packages/work/src/shift/loop.js +299 -51
- package/dist/packages/work/src/shift/protocol.d.ts +7 -5
- package/dist/packages/work/src/shift/runtime.d.ts +15 -0
- package/dist/packages/work/src/shift/runtime.js +95 -13
- package/dist/packages/work/src/shift/server.js +2 -0
- package/dist/packages/work/src/shift/spawn.d.ts +18 -50
- package/dist/packages/work/src/shift/spawn.js +30 -65
- package/dist/packages/work/src/shift/state.d.ts +29 -2
- package/dist/packages/work/src/shift/state.js +45 -15
- package/dist/packages/work/src/usage.d.ts +1 -1
- package/dist/packages/work/src/usage.js +10 -5
- package/dist/packages/work/src/util/modifier-init.d.ts +7 -0
- package/dist/packages/work/src/util/modifier-init.js +73 -0
- package/dist/src/bundle/tar.d.ts +9 -4
- package/dist/src/bundle/tar.js +9 -4
- package/dist/src/capabilities.d.ts +50 -0
- package/dist/src/capabilities.js +38 -0
- package/dist/src/cli.d.ts +15 -1
- package/dist/src/cli.js +1099 -32
- package/dist/src/config-dir.d.ts +14 -19
- package/dist/src/config-dir.js +16 -24
- package/dist/src/credentials.d.ts +1 -1
- package/dist/src/credentials.js +1 -1
- package/dist/src/crypto/index.d.ts +1 -1
- package/dist/src/crypto/index.js +1 -1
- package/dist/src/crypto/org-root.d.ts +30 -12
- package/dist/src/crypto/org-root.js +162 -14
- package/dist/src/crypto/records.d.ts +3 -0
- package/dist/src/crypto/records.js +8 -0
- package/dist/src/crypto/trust-roots.d.ts +2 -2
- package/dist/src/crypto/trust-roots.js +2 -2
- package/dist/src/defs.d.ts +6 -1
- package/dist/src/defs.js +203 -8
- package/dist/src/engine.d.ts +55 -6
- package/dist/src/engine.js +172 -22
- package/dist/src/global-config.d.ts +4 -7
- package/dist/src/global-config.js +4 -7
- package/dist/src/hub.d.ts +207 -5
- package/dist/src/hub.js +263 -3
- package/dist/src/index.d.ts +5 -5
- package/dist/src/index.js +3 -3
- package/dist/src/mcp/serve.d.ts +22 -0
- package/dist/src/mcp/serve.js +88 -8
- package/dist/src/model.d.ts +2 -0
- package/dist/src/model.js +32 -25
- package/dist/src/order-resolver.d.ts +1 -0
- package/dist/src/order-resolver.js +8 -1
- package/dist/src/schemas/index.d.ts +19 -0
- package/dist/src/schemas/order.v1.schema.json +13 -2
- package/dist/src/store/pre-commit-verifier.js +1 -1
- package/dist/src/store.d.ts +5 -0
- package/dist/src/store.js +43 -8
- package/dist/src/types.d.ts +64 -7
- package/dist/src/work-settings.d.ts +2 -4
- package/dist/src/work-settings.js +2 -4
- package/docs/agent-runner.md +2 -2
- package/docs/authoring.md +90 -2
- package/docs/bundles.md +29 -3
- package/docs/cli.md +456 -120
- package/docs/crypto.md +32 -16
- package/docs/design.md +70 -1
- package/docs/routing.md +762 -0
- package/docs/shift-logs.md +37 -10
- package/docs/wire-contracts.md +50 -7
- package/examples/workflows/delivery.yaml +31 -14
- package/examples/workflows/ship.yaml +10 -2
- package/package.json +1 -1
- package/plugins/claude-code/plugin/.claude-plugin/plugin.json +1 -1
- package/plugins/claude-code/plugin/.mcp.json +1 -1
- package/plugins/claude-code/plugin/skills/author/SKILL.md +1 -2
- package/plugins/codex/plugins/owenloop/.codex-plugin/plugin.json +1 -1
- package/plugins/codex/plugins/owenloop/.mcp.json +1 -1
- package/plugins/codex/plugins/owenloop/skills/author/SKILL.md +1 -2
package/dist/src/hub.d.ts
CHANGED
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
* Secret hygiene is a hard rule here: credentials never land in the repo or a
|
|
49
49
|
* plaintext `.env`. The 0600 file backend below (dir 0700) lives under the
|
|
50
50
|
* user's config dir, never the project; all paths derive from the
|
|
51
|
-
* caller-supplied `env` (HOME
|
|
51
|
+
* caller-supplied `env` (HOME), never `process.env` directly,
|
|
52
52
|
* so tests fixture `$HOME` and never touch ambient machine state. Both this
|
|
53
53
|
* file and `.owenloop/hub.json` are written via `writeFileAtomic` — temp file
|
|
54
54
|
* in the same dir + rename, refusing a symlinked destination (SEC-3). The
|
|
@@ -183,7 +183,7 @@ export type CredentialSlotSelector = {
|
|
|
183
183
|
account?: string;
|
|
184
184
|
};
|
|
185
185
|
/**
|
|
186
|
-
* The credential file (`~/.
|
|
186
|
+
* The credential file (`~/.owenloop/credentials.json`), v2: origin →
|
|
187
187
|
* slot → credential. `version` is `2`; a file carrying any other version reads
|
|
188
188
|
* as an EMPTY store (see `readCredentialFile`) — that is how entries under the
|
|
189
189
|
* older one-slot-per-origin keying become invisible without any migration code.
|
|
@@ -225,7 +225,7 @@ export declare function parseCredential(raw: unknown): Credential | null;
|
|
|
225
225
|
/**
|
|
226
226
|
* The user-level config dir (never the project dir). Derives from the caller's
|
|
227
227
|
* env via the one shared ladder in `config-dir.ts`:
|
|
228
|
-
* `OWENLOOP_CONFIG_DIR` > `$
|
|
228
|
+
* `OWENLOOP_CONFIG_DIR` > `$HOME/.owenloop`.
|
|
229
229
|
*/
|
|
230
230
|
export declare function configDir(env: Record<string, string | undefined>): string;
|
|
231
231
|
export declare function credentialFilePath(env: Record<string, string | undefined>): string;
|
|
@@ -374,7 +374,7 @@ export declare function credentialBackend(env: Record<string, string | undefined
|
|
|
374
374
|
* credential it wants.
|
|
375
375
|
*/
|
|
376
376
|
export type ReadStoredCredentialOpts = CredentialSlotSelector & {
|
|
377
|
-
/** Environment to consult (OWENLOOP_NO_KEYCHAIN, HOME
|
|
377
|
+
/** Environment to consult (OWENLOOP_NO_KEYCHAIN, HOME). Default: `process.env`. */
|
|
378
378
|
env?: Record<string, string | undefined>;
|
|
379
379
|
/** Injectable keychain backend (tests / embedding hosts). Ignored when OWENLOOP_NO_KEYCHAIN=1. */
|
|
380
380
|
keychain?: Keychain;
|
|
@@ -410,7 +410,7 @@ export type ReadStoredCredentialOpts = CredentialSlotSelector & {
|
|
|
410
410
|
* keychain → file. A keychain-backed read NEVER falls through to the file (that
|
|
411
411
|
* fallback was the REL-6 shadowing bug), and a corrupt entry reads as absent
|
|
412
412
|
* (`null`) on either store — never as a reason to consult the other. The file
|
|
413
|
-
* backend derives its path from the supplied `env` (HOME
|
|
413
|
+
* backend derives its path from the supplied `env` (HOME),
|
|
414
414
|
* never `process.env` directly, so a caller passing `opts.env` stays hermetic;
|
|
415
415
|
* only the top-level default falls back to `process.env`.
|
|
416
416
|
*
|
|
@@ -785,6 +785,208 @@ export declare function asCapabilityRouteRemoved(body: unknown): {
|
|
|
785
785
|
* whose `crewName` is `null` is a dangling route and is kept, not dropped.
|
|
786
786
|
*/
|
|
787
787
|
export declare function asCapabilityRoutes(body: unknown): CapabilityRouteWire[];
|
|
788
|
+
/**
|
|
789
|
+
* One **routing alert** as the hub reports it — an org-scoped record that the
|
|
790
|
+
* hub made a routing decision an operator needs to know about.
|
|
791
|
+
*
|
|
792
|
+
* A routing alert is NOT a capability route and NOT a capability reroute rule:
|
|
793
|
+
* a route and a reroute are both operator-owned CONFIGURATION rows, while an
|
|
794
|
+
* alert is an immutable EVENT the hub wrote about one offer at one instant. The
|
|
795
|
+
* three families share the word "routing" and nothing else.
|
|
796
|
+
*
|
|
797
|
+
* The alert that matters most is `kind: 'binding-gap'`: a step's composed
|
|
798
|
+
* capability (e.g. `build:express`) had no LIVE crew binding, so the hub HELD
|
|
799
|
+
* the offer instead of falling back to name matching. Holding is the intended
|
|
800
|
+
* behavior; this row is how a human learns it happened.
|
|
801
|
+
*
|
|
802
|
+
* `kind` is `'binding-gap' | 'wait-start' | 'fallback' | 'reroute'` on the wire
|
|
803
|
+
* today, but is deliberately NOT narrowed to that union — the same stance
|
|
804
|
+
* `CrewWire.kind` takes. The hub verbs are the enforcement of record, and a kind
|
|
805
|
+
* added there later must widen what the CLI PRINTS, never break the command.
|
|
806
|
+
*
|
|
807
|
+
* `capability` is always the COMPOUND the offer used (`build:express`), not the
|
|
808
|
+
* bare authored capability.
|
|
809
|
+
*
|
|
810
|
+
* `detail` is a JSON metadata string the hub composed for the console. It is
|
|
811
|
+
* forwarded VERBATIM as a string and never parsed here: parsing it would make
|
|
812
|
+
* this CLI a second consumer of an internal shape that no contract pins.
|
|
813
|
+
*
|
|
814
|
+
* `modifier`, `step` and `detail` are `string | null` — a `null` is the hub's
|
|
815
|
+
* own answer ("this alert has no step", "this run carries no modifier"), not a
|
|
816
|
+
* defect, so all three are validated leniently exactly like
|
|
817
|
+
* `CapabilityRouteWire.crewName`.
|
|
818
|
+
*
|
|
819
|
+
* Non-secret: the row names a workflow, a capability and a step — never a token.
|
|
820
|
+
*/
|
|
821
|
+
export interface RoutingAlertWire {
|
|
822
|
+
id: string;
|
|
823
|
+
at: number;
|
|
824
|
+
workflow: string;
|
|
825
|
+
kind: string;
|
|
826
|
+
capability: string;
|
|
827
|
+
modifier: string | null;
|
|
828
|
+
step: string | null;
|
|
829
|
+
detail: string | null;
|
|
830
|
+
}
|
|
831
|
+
/**
|
|
832
|
+
* Narrow `GET /api/routing_alerts`' 200 body (`{ text, alerts: [...] }`) to a
|
|
833
|
+
* typed array. An EMPTY array is valid — "this org has recorded no routing
|
|
834
|
+
* alerts" is a normal, and in fact the desirable, answer.
|
|
835
|
+
*
|
|
836
|
+
* **The array is forwarded IN WIRE ORDER and must never be re-sorted.** The
|
|
837
|
+
* order is meaningful and it is not the same order in both modes: unscoped the
|
|
838
|
+
* hub returns the org's alerts NEWEST-FIRST (an inbox), while `?workflow=`
|
|
839
|
+
* scopes to one run AND flips to OLDEST-FIRST (a timeline). A client-side sort
|
|
840
|
+
* would destroy whichever of the two the operator asked for.
|
|
841
|
+
*/
|
|
842
|
+
export declare function asRoutingAlerts(body: unknown): RoutingAlertWire[];
|
|
843
|
+
/**
|
|
844
|
+
* `GET /api/run_routing/:wf`'s 200 body, narrowed — one run's routing state with
|
|
845
|
+
* the three adjacent subsystems that explain it joined in at read time.
|
|
846
|
+
*
|
|
847
|
+
* `modifier` is OPTIONAL and its ABSENCE is the signal: a run started without
|
|
848
|
+
* `--modifier` carries no modifier at all, and the hub omits the key rather than
|
|
849
|
+
* sending `''` or `null`. The key is therefore omitted from the narrowed value
|
|
850
|
+
* too, never defaulted — an empty string here would read as "a modifier named
|
|
851
|
+
* nothing", which is not a state the system has.
|
|
852
|
+
*
|
|
853
|
+
* **Validation depth is deliberately uneven, and the split is the point:**
|
|
854
|
+
*
|
|
855
|
+
* - `workflow`, `defName`, `modifier`, `waitPolicy.wait` and every `alerts[]`
|
|
856
|
+
* row are THIS feature's own vocabulary, so they are validated in full.
|
|
857
|
+
* - `resolutionReports[]` and `escalations[]` are rows belonging to the shift
|
|
858
|
+
* -resolution and engine-escalation subsystems, joined here for reading only.
|
|
859
|
+
* Each entry is object-checked and then forwarded VERBATIM (the same stance
|
|
860
|
+
* `instance show` takes for its joined arrays), so an additive change to
|
|
861
|
+
* either subsystem widens what this command prints instead of breaking it.
|
|
862
|
+
*
|
|
863
|
+
* All three arrays must nonetheless be PRESENT. That is the
|
|
864
|
+
* `asCapabilityRouteRemoved.remainingCrewIds` lesson applied again: defaulting
|
|
865
|
+
* an absent array to `[]` would assert "nothing is degraded on this run" — the
|
|
866
|
+
* reassuring reading — off a malformed body, and reassurance is exactly the
|
|
867
|
+
* answer a reader must not be given by accident.
|
|
868
|
+
*
|
|
869
|
+
* `waitPolicy.then` is forwarded verbatim when present for the same reason the
|
|
870
|
+
* joined rows are: its shape is the wait subsystem's to define.
|
|
871
|
+
*/
|
|
872
|
+
export interface RunRoutingWire {
|
|
873
|
+
workflow: string;
|
|
874
|
+
defName: string;
|
|
875
|
+
modifier?: string;
|
|
876
|
+
waitPolicy: {
|
|
877
|
+
wait: string;
|
|
878
|
+
then?: unknown;
|
|
879
|
+
};
|
|
880
|
+
alerts: RoutingAlertWire[];
|
|
881
|
+
resolutionReports: unknown[];
|
|
882
|
+
escalations: unknown[];
|
|
883
|
+
}
|
|
884
|
+
/**
|
|
885
|
+
* Narrow `GET /api/run_routing/:wf`'s 200 body. Throws on anything malformed,
|
|
886
|
+
* naming the offending FIELD or INDEX only — no body value is ever echoed.
|
|
887
|
+
*
|
|
888
|
+
* Uses the `malformed success response` wording rather than `malformed
|
|
889
|
+
* response`, matching `get_status`, the other single-resource GET: a body that
|
|
890
|
+
* fails here arrived with a 2xx, and saying so distinguishes it from the hub
|
|
891
|
+
* having refused the request outright.
|
|
892
|
+
*/
|
|
893
|
+
export declare function asRunRouting(body: unknown): RunRoutingWire;
|
|
894
|
+
/**
|
|
895
|
+
* One **capability reroute rule** as the hub reports it — an operator-defined,
|
|
896
|
+
* ORDERED statement that reads "when `<capability>` has no LIVE crew binding,
|
|
897
|
+
* offer the work as `<target>` instead".
|
|
898
|
+
*
|
|
899
|
+
* **A reroute is NOT a binding.** It names no crew, grants nobody access, and
|
|
900
|
+
* certifies nothing. It only renames the capability an already-unbound offer
|
|
901
|
+
* goes out under, so the claiming shift resolves the TARGET's model rather than
|
|
902
|
+
* silently falling back to a bare-name row. Whether the target can actually be
|
|
903
|
+
* served is a separate, `capability_routes` question, and there is deliberately
|
|
904
|
+
* no liveness column on this row to imply otherwise.
|
|
905
|
+
*
|
|
906
|
+
* `position` is the rule's rank WITHIN its source capability: the hub walks a
|
|
907
|
+
* source's rules in ascending `position` and takes the first target that has a
|
|
908
|
+
* live binding.
|
|
909
|
+
*
|
|
910
|
+
* Non-secret: the row names two capability strings and when the rule was written.
|
|
911
|
+
*/
|
|
912
|
+
export interface CapabilityRerouteWire {
|
|
913
|
+
capability: string;
|
|
914
|
+
target: string;
|
|
915
|
+
position: number;
|
|
916
|
+
createdAt: number;
|
|
917
|
+
}
|
|
918
|
+
/**
|
|
919
|
+
* Narrow `GET /api/capability_reroutes`' 200 body (`{ text, reroutes: [...] }`)
|
|
920
|
+
* to a typed array. An EMPTY array is valid — "this org has configured no
|
|
921
|
+
* reroute rules", which is the default and correct state for most orgs.
|
|
922
|
+
*
|
|
923
|
+
* THE ARRAY KEY IS `reroutes`. It is neither `bindings` (what the sibling
|
|
924
|
+
* `capability_routes` endpoint uses) nor `rules` (what the feature is called in
|
|
925
|
+
* prose). Guessing that key is precisely how `capability list` shipped broken
|
|
926
|
+
* TWICE — see `asCapabilityRoutes` — so it is copied from
|
|
927
|
+
* `hub-core/src/verbs/list-capability-reroutes.ts` rather than inferred.
|
|
928
|
+
*
|
|
929
|
+
* **Rows arrive in the order the hub TRIES them** (`capability`, then
|
|
930
|
+
* `position`, then `target`) and are forwarded exactly as received. The order is
|
|
931
|
+
* SEMANTIC: it is the sequence in which a source's targets are attempted.
|
|
932
|
+
* Re-sorting it — in this function, in a caller, or in a test fixture — would
|
|
933
|
+
* silently misreport which substitution happens first.
|
|
934
|
+
*/
|
|
935
|
+
export declare function asCapabilityReroutes(body: unknown): CapabilityRerouteWire[];
|
|
936
|
+
/**
|
|
937
|
+
* `POST /api/add_capability_reroute`'s 200 body, narrowed.
|
|
938
|
+
*
|
|
939
|
+
* NESTED exactly as the wire nests it: the row lives under `reroute`, while
|
|
940
|
+
* `alreadyPresent` and `ruleCount` live at the BODY's top level — the same shape
|
|
941
|
+
* (and the same reason for mirroring it literally) as `CapabilityRouteAddedWire`.
|
|
942
|
+
*
|
|
943
|
+
* - `alreadyPresent` — was this exact `(capability, target)` pair already a
|
|
944
|
+
* rule? The add is idempotent per pair, so a repeat is a 200 no-op rather than
|
|
945
|
+
* an error, and `reroute.createdAt` then echoes the ORIGINAL row.
|
|
946
|
+
* - `ruleCount` — how many rules the SOURCE capability has after the write.
|
|
947
|
+
*/
|
|
948
|
+
export interface CapabilityRerouteAddedWire {
|
|
949
|
+
reroute: CapabilityRerouteWire;
|
|
950
|
+
alreadyPresent: boolean;
|
|
951
|
+
ruleCount: number;
|
|
952
|
+
}
|
|
953
|
+
/**
|
|
954
|
+
* Narrow `POST /api/add_capability_reroute`'s 200 body
|
|
955
|
+
* (`{ text, reroute, alreadyPresent, ruleCount }`), naming the offending field
|
|
956
|
+
* only — the same discipline as `asCapabilityRouteAdded`.
|
|
957
|
+
*
|
|
958
|
+
* There is no layered non-null check here of the kind `asCapabilityRouteAdded`
|
|
959
|
+
* applies to `binding.crewName`: a reroute row has no nullable field, because it
|
|
960
|
+
* resolves no crew.
|
|
961
|
+
*/
|
|
962
|
+
export declare function asCapabilityRerouteAdded(body: unknown): CapabilityRerouteAddedWire;
|
|
963
|
+
/**
|
|
964
|
+
* Narrow `POST /api/remove_capability_reroute`'s 200 body
|
|
965
|
+
* (`{ text, capability, target, removed, remainingTargets }`).
|
|
966
|
+
*
|
|
967
|
+
* `removed` must be a BOOLEAN — this guard is how the CLI proves the 2xx really
|
|
968
|
+
* was the remove verb's answer. BOTH values are deliberate hub responses:
|
|
969
|
+
* - `true` — the `(capability, target)` rule existed and is now gone;
|
|
970
|
+
* - `false` — there was no such rule, so there was nothing to do. The hub
|
|
971
|
+
* answers 200, never a 404 (the same tolerance `remove_capability_route`
|
|
972
|
+
* has), and that is what makes `routing rule rm` idempotent.
|
|
973
|
+
*
|
|
974
|
+
* `remainingTargets` is deliberately STRICT — PRESENT, an array, and every
|
|
975
|
+
* element a non-empty string. This is the identical asymmetry argued at
|
|
976
|
+
* `asCapabilityRouteRemoved`: defaulting an absent array to `[]` would assert
|
|
977
|
+
* "this capability now HOLDS whenever it is unbound" — the alarming reading, and
|
|
978
|
+
* exactly the signal an operator acts on — off a malformed body. Unlike the
|
|
979
|
+
* capability-route family there is no nullable field to balance it against, so
|
|
980
|
+
* every field here is strict.
|
|
981
|
+
*
|
|
982
|
+
* The stdout shape built from this is documented in `docs/cli.md` under Routing.
|
|
983
|
+
*/
|
|
984
|
+
export declare function asCapabilityRerouteRemoved(body: unknown): {
|
|
985
|
+
capability: string;
|
|
986
|
+
target: string;
|
|
987
|
+
removed: boolean;
|
|
988
|
+
remainingTargets: string[];
|
|
989
|
+
};
|
|
788
990
|
/**
|
|
789
991
|
* A **crew** as the hub reports it — an org-scoped queue that agent work is
|
|
790
992
|
* stamped to. `kind` is `'personal' | 'shared' | 'orphan'` on the wire, but is
|
package/dist/src/hub.js
CHANGED
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
* Secret hygiene is a hard rule here: credentials never land in the repo or a
|
|
49
49
|
* plaintext `.env`. The 0600 file backend below (dir 0700) lives under the
|
|
50
50
|
* user's config dir, never the project; all paths derive from the
|
|
51
|
-
* caller-supplied `env` (HOME
|
|
51
|
+
* caller-supplied `env` (HOME), never `process.env` directly,
|
|
52
52
|
* so tests fixture `$HOME` and never touch ambient machine state. Both this
|
|
53
53
|
* file and `.owenloop/hub.json` are written via `writeFileAtomic` — temp file
|
|
54
54
|
* in the same dir + rename, refusing a symlinked destination (SEC-3). The
|
|
@@ -281,7 +281,7 @@ export function parseCredential(raw) {
|
|
|
281
281
|
/**
|
|
282
282
|
* The user-level config dir (never the project dir). Derives from the caller's
|
|
283
283
|
* env via the one shared ladder in `config-dir.ts`:
|
|
284
|
-
* `OWENLOOP_CONFIG_DIR` > `$
|
|
284
|
+
* `OWENLOOP_CONFIG_DIR` > `$HOME/.owenloop`.
|
|
285
285
|
*/
|
|
286
286
|
export function configDir(env) {
|
|
287
287
|
return owenloopConfigDir(env);
|
|
@@ -629,7 +629,7 @@ export function credentialBackend(env, injected) {
|
|
|
629
629
|
* keychain → file. A keychain-backed read NEVER falls through to the file (that
|
|
630
630
|
* fallback was the REL-6 shadowing bug), and a corrupt entry reads as absent
|
|
631
631
|
* (`null`) on either store — never as a reason to consult the other. The file
|
|
632
|
-
* backend derives its path from the supplied `env` (HOME
|
|
632
|
+
* backend derives its path from the supplied `env` (HOME),
|
|
633
633
|
* never `process.env` directly, so a caller passing `opts.env` stays hermetic;
|
|
634
634
|
* only the top-level default falls back to `process.env`.
|
|
635
635
|
*
|
|
@@ -1124,6 +1124,266 @@ export function asCapabilityRoutes(body) {
|
|
|
1124
1124
|
const list = body.bindings;
|
|
1125
1125
|
return list.map((entry, i) => asCapabilityRouteRow(entry, 'capability_routes: malformed response', `bindings[${i}]`));
|
|
1126
1126
|
}
|
|
1127
|
+
/**
|
|
1128
|
+
* Validate the eight `RoutingAlertWire` fields on one row. `prefix` is the
|
|
1129
|
+
* endpoint-qualified lead-in the caller wants (e.g.
|
|
1130
|
+
* `routing_alerts: malformed response`) and `where` names the offending
|
|
1131
|
+
* position (`alerts[2]`) — a FIELD/INDEX name only, never a value.
|
|
1132
|
+
*
|
|
1133
|
+
* Shared by BOTH endpoints that carry alert rows (`GET /api/routing_alerts` and
|
|
1134
|
+
* `GET /api/run_routing/:wf`), so the two can never drift apart in what they
|
|
1135
|
+
* accept — the same reason `asCapabilityRouteRow` is shared by its three
|
|
1136
|
+
* callers.
|
|
1137
|
+
*/
|
|
1138
|
+
function asRoutingAlertRow(entry, prefix, where) {
|
|
1139
|
+
if (typeof entry !== 'object' || entry === null) {
|
|
1140
|
+
throw new Error(`${prefix} — ${where} is not an object`);
|
|
1141
|
+
}
|
|
1142
|
+
const e = entry;
|
|
1143
|
+
for (const field of ['id', 'workflow', 'kind', 'capability']) {
|
|
1144
|
+
if (typeof e[field] !== 'string' || e[field] === '') {
|
|
1145
|
+
throw new Error(`${prefix} — ${where} missing non-empty string ${field}`);
|
|
1146
|
+
}
|
|
1147
|
+
}
|
|
1148
|
+
if (typeof e.at !== 'number') {
|
|
1149
|
+
throw new Error(`${prefix} — ${where} missing number at`);
|
|
1150
|
+
}
|
|
1151
|
+
// Lenient exactly like `asCapabilityRouteRow`'s `crewName`: absent or `null`
|
|
1152
|
+
// both mean "the hub has nothing to report here", which is a normal answer for
|
|
1153
|
+
// all three of these fields.
|
|
1154
|
+
const nullableString = (field) => {
|
|
1155
|
+
const value = e[field];
|
|
1156
|
+
if (value === undefined || value === null)
|
|
1157
|
+
return null;
|
|
1158
|
+
if (typeof value !== 'string' || value === '') {
|
|
1159
|
+
throw new Error(`${prefix} — ${where} ${field} must be a non-empty string or null`);
|
|
1160
|
+
}
|
|
1161
|
+
return value;
|
|
1162
|
+
};
|
|
1163
|
+
return {
|
|
1164
|
+
id: e.id,
|
|
1165
|
+
at: e.at,
|
|
1166
|
+
workflow: e.workflow,
|
|
1167
|
+
kind: e.kind,
|
|
1168
|
+
capability: e.capability,
|
|
1169
|
+
modifier: nullableString('modifier'),
|
|
1170
|
+
step: nullableString('step'),
|
|
1171
|
+
detail: nullableString('detail'),
|
|
1172
|
+
};
|
|
1173
|
+
}
|
|
1174
|
+
/**
|
|
1175
|
+
* Narrow `GET /api/routing_alerts`' 200 body (`{ text, alerts: [...] }`) to a
|
|
1176
|
+
* typed array. An EMPTY array is valid — "this org has recorded no routing
|
|
1177
|
+
* alerts" is a normal, and in fact the desirable, answer.
|
|
1178
|
+
*
|
|
1179
|
+
* **The array is forwarded IN WIRE ORDER and must never be re-sorted.** The
|
|
1180
|
+
* order is meaningful and it is not the same order in both modes: unscoped the
|
|
1181
|
+
* hub returns the org's alerts NEWEST-FIRST (an inbox), while `?workflow=`
|
|
1182
|
+
* scopes to one run AND flips to OLDEST-FIRST (a timeline). A client-side sort
|
|
1183
|
+
* would destroy whichever of the two the operator asked for.
|
|
1184
|
+
*/
|
|
1185
|
+
export function asRoutingAlerts(body) {
|
|
1186
|
+
if (typeof body !== 'object' || body === null || !Array.isArray(body.alerts)) {
|
|
1187
|
+
throw new Error('routing_alerts: malformed response — expected an `alerts` array');
|
|
1188
|
+
}
|
|
1189
|
+
const list = body.alerts;
|
|
1190
|
+
return list.map((entry, i) => asRoutingAlertRow(entry, 'routing_alerts: malformed response', `alerts[${i}]`));
|
|
1191
|
+
}
|
|
1192
|
+
/**
|
|
1193
|
+
* Narrow `GET /api/run_routing/:wf`'s 200 body. Throws on anything malformed,
|
|
1194
|
+
* naming the offending FIELD or INDEX only — no body value is ever echoed.
|
|
1195
|
+
*
|
|
1196
|
+
* Uses the `malformed success response` wording rather than `malformed
|
|
1197
|
+
* response`, matching `get_status`, the other single-resource GET: a body that
|
|
1198
|
+
* fails here arrived with a 2xx, and saying so distinguishes it from the hub
|
|
1199
|
+
* having refused the request outright.
|
|
1200
|
+
*/
|
|
1201
|
+
export function asRunRouting(body) {
|
|
1202
|
+
const prefix = 'run_routing: malformed success response';
|
|
1203
|
+
if (typeof body !== 'object' || body === null || Array.isArray(body)) {
|
|
1204
|
+
throw new Error(`${prefix} — not an object`);
|
|
1205
|
+
}
|
|
1206
|
+
const b = body;
|
|
1207
|
+
for (const field of ['workflow', 'defName']) {
|
|
1208
|
+
if (typeof b[field] !== 'string' || b[field] === '') {
|
|
1209
|
+
throw new Error(`${prefix} — missing non-empty string ${field}`);
|
|
1210
|
+
}
|
|
1211
|
+
}
|
|
1212
|
+
// ABSENT is legitimate (an unmodified run) and is preserved as absent. `''` is
|
|
1213
|
+
// NOT legitimate — the hub omits the key instead — so it is malformed here
|
|
1214
|
+
// rather than silently normalized to "no modifier".
|
|
1215
|
+
let modifier;
|
|
1216
|
+
if (b.modifier !== undefined) {
|
|
1217
|
+
if (typeof b.modifier !== 'string' || b.modifier === '') {
|
|
1218
|
+
throw new Error(`${prefix} — modifier must be a non-empty string when present`);
|
|
1219
|
+
}
|
|
1220
|
+
modifier = b.modifier;
|
|
1221
|
+
}
|
|
1222
|
+
if (typeof b.waitPolicy !== 'object' || b.waitPolicy === null || Array.isArray(b.waitPolicy)) {
|
|
1223
|
+
throw new Error(`${prefix} — waitPolicy is not an object`);
|
|
1224
|
+
}
|
|
1225
|
+
const waitPolicyWire = b.waitPolicy;
|
|
1226
|
+
if (typeof waitPolicyWire.wait !== 'string' || waitPolicyWire.wait === '') {
|
|
1227
|
+
throw new Error(`${prefix} — waitPolicy missing non-empty string wait`);
|
|
1228
|
+
}
|
|
1229
|
+
const waitPolicy = { wait: waitPolicyWire.wait };
|
|
1230
|
+
if (waitPolicyWire.then !== undefined)
|
|
1231
|
+
waitPolicy.then = waitPolicyWire.then;
|
|
1232
|
+
if (!Array.isArray(b.alerts)) {
|
|
1233
|
+
throw new Error(`${prefix} — missing array alerts`);
|
|
1234
|
+
}
|
|
1235
|
+
const alerts = b.alerts.map((entry, i) => asRoutingAlertRow(entry, prefix, `alerts[${i}]`));
|
|
1236
|
+
// Object-checked and forwarded verbatim — see the interface's doc comment for
|
|
1237
|
+
// why these two are not deep-validated and why their PRESENCE is still required.
|
|
1238
|
+
const joined = (field) => {
|
|
1239
|
+
const value = b[field];
|
|
1240
|
+
if (!Array.isArray(value)) {
|
|
1241
|
+
throw new Error(`${prefix} — missing array ${field}`);
|
|
1242
|
+
}
|
|
1243
|
+
return value.map((entry, i) => {
|
|
1244
|
+
if (typeof entry !== 'object' || entry === null || Array.isArray(entry)) {
|
|
1245
|
+
throw new Error(`${prefix} — ${field}[${i}] is not an object`);
|
|
1246
|
+
}
|
|
1247
|
+
return entry;
|
|
1248
|
+
});
|
|
1249
|
+
};
|
|
1250
|
+
return {
|
|
1251
|
+
workflow: b.workflow,
|
|
1252
|
+
defName: b.defName,
|
|
1253
|
+
...(modifier === undefined ? {} : { modifier }),
|
|
1254
|
+
waitPolicy,
|
|
1255
|
+
alerts,
|
|
1256
|
+
resolutionReports: joined('resolutionReports'),
|
|
1257
|
+
escalations: joined('escalations'),
|
|
1258
|
+
};
|
|
1259
|
+
}
|
|
1260
|
+
/**
|
|
1261
|
+
* Validate the four common `CapabilityRerouteWire` fields on one row. `prefix`
|
|
1262
|
+
* is the endpoint-qualified lead-in and `where` names the offending position
|
|
1263
|
+
* (`reroute`, or `reroutes[2]`) — a FIELD/INDEX name only, never a value.
|
|
1264
|
+
*
|
|
1265
|
+
* No field here is nullable: unlike a capability route, a reroute rule names no
|
|
1266
|
+
* crew, so it has no dangling case to represent.
|
|
1267
|
+
*/
|
|
1268
|
+
function asCapabilityRerouteRow(entry, prefix, where) {
|
|
1269
|
+
if (typeof entry !== 'object' || entry === null) {
|
|
1270
|
+
throw new Error(`${prefix} — ${where} is not an object`);
|
|
1271
|
+
}
|
|
1272
|
+
const e = entry;
|
|
1273
|
+
for (const field of ['capability', 'target']) {
|
|
1274
|
+
if (typeof e[field] !== 'string' || e[field] === '') {
|
|
1275
|
+
throw new Error(`${prefix} — ${where} missing non-empty string ${field}`);
|
|
1276
|
+
}
|
|
1277
|
+
}
|
|
1278
|
+
for (const field of ['position', 'createdAt']) {
|
|
1279
|
+
if (typeof e[field] !== 'number') {
|
|
1280
|
+
throw new Error(`${prefix} — ${where} missing number ${field}`);
|
|
1281
|
+
}
|
|
1282
|
+
}
|
|
1283
|
+
return {
|
|
1284
|
+
capability: e.capability,
|
|
1285
|
+
target: e.target,
|
|
1286
|
+
position: e.position,
|
|
1287
|
+
createdAt: e.createdAt,
|
|
1288
|
+
};
|
|
1289
|
+
}
|
|
1290
|
+
/**
|
|
1291
|
+
* Narrow `GET /api/capability_reroutes`' 200 body (`{ text, reroutes: [...] }`)
|
|
1292
|
+
* to a typed array. An EMPTY array is valid — "this org has configured no
|
|
1293
|
+
* reroute rules", which is the default and correct state for most orgs.
|
|
1294
|
+
*
|
|
1295
|
+
* THE ARRAY KEY IS `reroutes`. It is neither `bindings` (what the sibling
|
|
1296
|
+
* `capability_routes` endpoint uses) nor `rules` (what the feature is called in
|
|
1297
|
+
* prose). Guessing that key is precisely how `capability list` shipped broken
|
|
1298
|
+
* TWICE — see `asCapabilityRoutes` — so it is copied from
|
|
1299
|
+
* `hub-core/src/verbs/list-capability-reroutes.ts` rather than inferred.
|
|
1300
|
+
*
|
|
1301
|
+
* **Rows arrive in the order the hub TRIES them** (`capability`, then
|
|
1302
|
+
* `position`, then `target`) and are forwarded exactly as received. The order is
|
|
1303
|
+
* SEMANTIC: it is the sequence in which a source's targets are attempted.
|
|
1304
|
+
* Re-sorting it — in this function, in a caller, or in a test fixture — would
|
|
1305
|
+
* silently misreport which substitution happens first.
|
|
1306
|
+
*/
|
|
1307
|
+
export function asCapabilityReroutes(body) {
|
|
1308
|
+
if (typeof body !== 'object' || body === null || !Array.isArray(body.reroutes)) {
|
|
1309
|
+
throw new Error('capability_reroutes: malformed response — expected a `reroutes` array');
|
|
1310
|
+
}
|
|
1311
|
+
const list = body.reroutes;
|
|
1312
|
+
return list.map((entry, i) => asCapabilityRerouteRow(entry, 'capability_reroutes: malformed response', `reroutes[${i}]`));
|
|
1313
|
+
}
|
|
1314
|
+
/**
|
|
1315
|
+
* Narrow `POST /api/add_capability_reroute`'s 200 body
|
|
1316
|
+
* (`{ text, reroute, alreadyPresent, ruleCount }`), naming the offending field
|
|
1317
|
+
* only — the same discipline as `asCapabilityRouteAdded`.
|
|
1318
|
+
*
|
|
1319
|
+
* There is no layered non-null check here of the kind `asCapabilityRouteAdded`
|
|
1320
|
+
* applies to `binding.crewName`: a reroute row has no nullable field, because it
|
|
1321
|
+
* resolves no crew.
|
|
1322
|
+
*/
|
|
1323
|
+
export function asCapabilityRerouteAdded(body) {
|
|
1324
|
+
const prefix = 'add_capability_reroute: malformed success response';
|
|
1325
|
+
if (typeof body !== 'object' || body === null) {
|
|
1326
|
+
throw new Error(`${prefix} — not an object`);
|
|
1327
|
+
}
|
|
1328
|
+
const b = body;
|
|
1329
|
+
if (b.reroute === undefined) {
|
|
1330
|
+
throw new Error(`${prefix} — missing reroute`);
|
|
1331
|
+
}
|
|
1332
|
+
const reroute = asCapabilityRerouteRow(b.reroute, prefix, 'reroute');
|
|
1333
|
+
if (typeof b.alreadyPresent !== 'boolean') {
|
|
1334
|
+
throw new Error(`${prefix} — missing boolean alreadyPresent`);
|
|
1335
|
+
}
|
|
1336
|
+
if (typeof b.ruleCount !== 'number') {
|
|
1337
|
+
throw new Error(`${prefix} — missing number ruleCount`);
|
|
1338
|
+
}
|
|
1339
|
+
return { reroute, alreadyPresent: b.alreadyPresent, ruleCount: b.ruleCount };
|
|
1340
|
+
}
|
|
1341
|
+
/**
|
|
1342
|
+
* Narrow `POST /api/remove_capability_reroute`'s 200 body
|
|
1343
|
+
* (`{ text, capability, target, removed, remainingTargets }`).
|
|
1344
|
+
*
|
|
1345
|
+
* `removed` must be a BOOLEAN — this guard is how the CLI proves the 2xx really
|
|
1346
|
+
* was the remove verb's answer. BOTH values are deliberate hub responses:
|
|
1347
|
+
* - `true` — the `(capability, target)` rule existed and is now gone;
|
|
1348
|
+
* - `false` — there was no such rule, so there was nothing to do. The hub
|
|
1349
|
+
* answers 200, never a 404 (the same tolerance `remove_capability_route`
|
|
1350
|
+
* has), and that is what makes `routing rule rm` idempotent.
|
|
1351
|
+
*
|
|
1352
|
+
* `remainingTargets` is deliberately STRICT — PRESENT, an array, and every
|
|
1353
|
+
* element a non-empty string. This is the identical asymmetry argued at
|
|
1354
|
+
* `asCapabilityRouteRemoved`: defaulting an absent array to `[]` would assert
|
|
1355
|
+
* "this capability now HOLDS whenever it is unbound" — the alarming reading, and
|
|
1356
|
+
* exactly the signal an operator acts on — off a malformed body. Unlike the
|
|
1357
|
+
* capability-route family there is no nullable field to balance it against, so
|
|
1358
|
+
* every field here is strict.
|
|
1359
|
+
*
|
|
1360
|
+
* The stdout shape built from this is documented in `docs/cli.md` under Routing.
|
|
1361
|
+
*/
|
|
1362
|
+
export function asCapabilityRerouteRemoved(body) {
|
|
1363
|
+
const prefix = 'remove_capability_reroute: malformed success response';
|
|
1364
|
+
if (typeof body !== 'object' || body === null) {
|
|
1365
|
+
throw new Error(`${prefix} — not an object`);
|
|
1366
|
+
}
|
|
1367
|
+
const b = body;
|
|
1368
|
+
if (typeof b.removed !== 'boolean') {
|
|
1369
|
+
throw new Error(`${prefix} — missing boolean removed`);
|
|
1370
|
+
}
|
|
1371
|
+
for (const field of ['capability', 'target']) {
|
|
1372
|
+
if (typeof b[field] !== 'string' || b[field] === '') {
|
|
1373
|
+
throw new Error(`${prefix} — missing non-empty string ${field}`);
|
|
1374
|
+
}
|
|
1375
|
+
}
|
|
1376
|
+
if (!Array.isArray(b.remainingTargets)) {
|
|
1377
|
+
throw new Error(`${prefix} — missing array remainingTargets`);
|
|
1378
|
+
}
|
|
1379
|
+
const remainingTargets = b.remainingTargets.map((entry, i) => {
|
|
1380
|
+
if (typeof entry !== 'string' || entry === '') {
|
|
1381
|
+
throw new Error(`${prefix} — remainingTargets[${i}] is not a non-empty string`);
|
|
1382
|
+
}
|
|
1383
|
+
return entry;
|
|
1384
|
+
});
|
|
1385
|
+
return { capability: b.capability, target: b.target, removed: b.removed, remainingTargets };
|
|
1386
|
+
}
|
|
1127
1387
|
/**
|
|
1128
1388
|
* The `orphan:` prefix the hub uses to name its reserved orphan crew
|
|
1129
1389
|
* (`packages/hub-core/src/crews-table.ts` / `verbs/manage-crews.ts`). Mirrored
|
package/dist/src/index.d.ts
CHANGED
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
*/
|
|
14
14
|
export { CallsPinError, Engine, ModifierRefusalError } from './engine.ts';
|
|
15
15
|
export type { CommitResult, CreateOpts, DefResolver, DeferredFiring, DeferredReason, EmitResult, EngineEvent, EngineListener, EngineWorkflowStatus, Order, ReapDetail, ReapReason, TickResult, } from './engine.ts';
|
|
16
|
-
export { capabilityName, claimMatches, composeCapabilities, DEFAULT_MATCH_MODE, MODIFIER_SEPARATOR, } from './capabilities.ts';
|
|
17
|
-
export type { MatchMode } from './capabilities.ts';
|
|
16
|
+
export { applyCapabilityRewrites, capabilityName, claimMatches, composeCapabilities, DEFAULT_MATCH_MODE, MODIFIER_SEPARATOR, } from './capabilities.ts';
|
|
17
|
+
export type { CapabilityRewrites, CrewStamps, MatchMode } from './capabilities.ts';
|
|
18
18
|
export { createEngine } from './factory.ts';
|
|
19
19
|
export type { CreateEngineOpts, CreatedEngine } from './factory.ts';
|
|
20
20
|
export { createDefInstructionSource, defInstructionDigest, OrderResolver, substituteOrderVars, UnknownDefDigestError, UnknownInstructionError, } from './order-resolver.ts';
|
|
@@ -23,13 +23,13 @@ export { Store, openStore, StoreVersionError } from './store.ts';
|
|
|
23
23
|
export type { ArtifactRow, RunRow, TaskRow, WorkflowRow } from './store.ts';
|
|
24
24
|
export { defDigest, emptyWorkflowStoreIndex, globalStoreRoot, hardenObjectModes, installWorkflowBundle, inspectCasDefs, isDefDigest, loadCasDefs, objectDestRelPath, objectDirForDigest, parseWorkflowCoordinate, parseWorkflowStoreIndex, projectStoreRoot, probeObjectDir, probeStoreRoot, readWorkflowStoreIndex, recoverWorkflowStore, resolveWorkflowCoordinate, resolveWorkflowDigest, serializeWorkflowStoreIndex, storeIndexPath, workflowCoordinate, workflowStoreStatePaths, WORKFLOW_STORE_INDEX_VERSION, WorkflowStoreError, StoreIndexError, StoreDigestError, StoreCoordinateError, StoreAmbiguityError, StoreNotFoundError, StoreIntegrityError, StoreConflictError, StoreDefinitionVerificationError, StoreOriginPolicyError, StorePathError, BundleIngestorUnavailableError, PreCommitVerifierUnavailableError, createExecutionOriginVerifier, originEvidencePath, persistOriginEvidence, readOriginEvidence, } from './store/index.ts';
|
|
25
25
|
export type { BundleInstallResult, BundleIngestor, BundleSource, CasDefInspectionResult, CasDefRegistration, DefDigest, LoadCasDefsArgs, InstallWorkflowBundleArgs, PreCommitVerifier, ExecutionOriginVerifierInput, RecoverWorkflowStoreArgs, ResolvedWorkflowObject, ResolveWorkflowCoordinateArgs, ResolveWorkflowDigestArgs, ResolutionLevel, StoreLevel, WorkflowCoordinate, WorkflowStoreIndex, WorkflowStoreIndexEntry, WorkflowStoreStatePaths, } from './store/index.ts';
|
|
26
|
-
export { buildDef, DefError, expandIncludes, finalizeDefs, hashDef, lintDef, loadDefFile, loadDefs, loadDefsRaw, parseDef, resolveCallsTarget, SUPPORTED_ENGINE_VERSION, validateDef } from './defs.ts';
|
|
26
|
+
export { buildDef, cancelCleanupSteps, DefError, expandIncludes, finalizeDefs, hashDef, lintDef, loadDefFile, loadDefs, loadDefsRaw, parseDef, resolveCallsTarget, SUPPORTED_ENGINE_VERSION, validateDef } from './defs.ts';
|
|
27
27
|
export { credentialSlot, hashDefForHub, keychainServiceFor, normalizeOrigin, readStoredCredential } from './hub.ts';
|
|
28
28
|
export type { Credential, CredentialSlotSelector, Keychain, ReadStoredCredentialOpts } from './hub.ts';
|
|
29
29
|
export type { DefLoadFailure } from './defs.ts';
|
|
30
30
|
export { deleteCredential, ensureFreshOAuth, storeCredential } from './credentials.ts';
|
|
31
31
|
export type { CredentialIO } from './credentials.ts';
|
|
32
|
-
export { DSSE_SSH_NAMESPACE, DSSE_VERSION, DSSE_RECORD_PAYLOAD_TYPES, DsseEnvelopeError, isDsseRecordPayloadType, PAYLOAD_TYPE_ENROLLMENT_GRANT, PAYLOAD_TYPE_ORIGIN, PAYLOAD_TYPE_POLICY_FLOOR, PAYLOAD_TYPE_PUBLICATION, PAYLOAD_TYPE_REVOCATION, PAYLOAD_TYPE_SUBMISSION, PrincipalKeyManager, SshSigner, SshSignerError, assertEd25519PubText, assertKeyRef, canonicalKeyRef, createSshSigner, decodeBase64Strict, dsseSignEnrollmentGrant, dsseSignEnvelope, dsseSignOrigin, dsseSignPolicyFloor, dsseSignPublication, dsseSignRecord, dsseSignRevocation, dsseSignSubmission, dsseVerifyEnrollmentGrant, dsseVerifyEnvelope, dsseVerifyOrigin, dsseVerifyPolicyFloor, dsseVerifyPublication, dsseVerifyRecord, dsseVerifyRevocation, dsseVerifySubmission, encodeBase64, keyidFromBlob, keyRefHash, parseAllowedSigners, preAuthEncode, publicKeyDescriptor, allowedSignersPath, resolveAllowedSigners, resolveAllowedSignersFile, isDefPolicy, verifyOrigin, verifyOriginSidecar, verifyPublication, verifyPublicationSidecar, verifyConsumed, verifyConsumedArtifact, DEFAULT_MACHINE_SCOPE, buildEnrollmentGrant, verifyRosterEntry, validateEnrollmentChain, validateProducer, revocationTemporalConsistency, attenuate, axisPermits, delegationPermits, ORG_ROOT_SCOPE, scopePermits,
|
|
32
|
+
export { DSSE_SSH_NAMESPACE, DSSE_VERSION, DSSE_RECORD_PAYLOAD_TYPES, DsseEnvelopeError, isDsseRecordPayloadType, PAYLOAD_TYPE_ENROLLMENT_GRANT, PAYLOAD_TYPE_ORIGIN, PAYLOAD_TYPE_POLICY_FLOOR, PAYLOAD_TYPE_PUBLICATION, PAYLOAD_TYPE_REVOCATION, PAYLOAD_TYPE_SUBMISSION, PrincipalKeyManager, SshSigner, SshSignerError, assertEd25519PubText, assertKeyRef, canonicalKeyRef, createSshSigner, decodeBase64Strict, dsseSignEnrollmentGrant, dsseSignEnvelope, dsseSignOrigin, dsseSignPolicyFloor, dsseSignPublication, dsseSignRecord, dsseSignRevocation, dsseSignSubmission, dsseVerifyEnrollmentGrant, dsseVerifyEnvelope, dsseVerifyOrigin, dsseVerifyPolicyFloor, dsseVerifyPublication, dsseVerifyRecord, dsseVerifyRevocation, dsseVerifySubmission, encodeBase64, keyidFromBlob, keyRefHash, parseAllowedSigners, preAuthEncode, publicKeyDescriptor, allowedSignersPath, resolveAllowedSigners, resolveAllowedSignersFile, isDefPolicy, verifyOrigin, verifyOriginSidecar, verifyPublication, verifyPublicationSidecar, verifyConsumed, verifyConsumedArtifact, DEFAULT_MACHINE_SCOPE, buildEnrollmentGrant, verifyRosterEntry, validateEnrollmentChain, validateProducer, revocationTemporalConsistency, attenuate, axisPermits, delegationPermits, ORG_ROOT_SCOPE, scopePermits, loadGrants, loadRevocations, orgRootPrivateKeyPath, orgRootPublicKeyPath, resolveOrgRoot, revocationsDir, grantsDir, StrandedLegacyGrantsError, ENROLLMENT_GRANT_FIELDS, ENROLLMENT_KEY_FIELDS, GRANT_DELEGATION_ALLOWED_FIELDS, GRANT_DELEGATION_DENIED_FIELDS, GRANT_SCOPE_FIELDS, ORDER_FIELDS, ORDER_OWED_FIELDS, ORDER_REASON_FIELDS, ORIGIN_FIELDS, ORIGIN_SOURCE_AGENT_FIELDS, ORIGIN_SOURCE_CONSOLE_FIELDS, ORIGIN_SOURCE_GIT_FIELDS, POLICY_FLOOR_FIELDS, POLICY_FLOOR_RECORD_FIELDS, PRINCIPAL_REFERENCE_FIELDS, PUBLICATION_FIELDS, RECORD_PAYLOAD_TYPES, REVOCATION_FIELDS, SUBMISSION_FIELDS, SUBMISSION_PRODUCED_FIELDS, } from './crypto/index.ts';
|
|
33
33
|
export type { AllowedSignerEntry, AllowedSignerOptions, AllowedSignersFile, AllowedSignersParseError, AllowedSignersResolution, AllowedSignersPresent, AllowedSignersAbsent, DefPolicy, DefVerdict, OriginVerdict, VerifyOriginInput, VerifyOriginOptions, ConsumedVerdict, VerifyConsumedInput, VerifyConsumedOptions, VerifyPublicationInput, VerifyPublicationOptions, BuildEnrollmentGrantArgs, EnrollmentChainValidator, RosterVerdict, VerifyRosterEntryInput, VerifyRosterEntryOptions, ChainInput, ChainOptions, ChainVerdict, ScopeAxis, OrgRootAbsent, OrgRootPresent, OrgRootResolution, DetachedSignature, DsseEnvelope, DsseRecordPayloadType, DsseSignature, DsseVerifyResult, EnsureKeyResult, InspectKeyResult, KeyStorageBackendKind, PrincipalKeyRef, PrincipalKind, PublicKeyDescriptor, EnrollmentGrantRecord, EnrollmentKeyDescriptor, FieldManifest, GrantDelegation, GrantDelegationAllowed, GrantDelegationDenied, GrantScope, OptionalKeys, OriginRecord, OriginSource, OriginSourceAgent, OriginSourceConsole, OriginSourceGit, PolicyFloor, PolicyFloorRecord, PrincipalReference, PublicationRecord, RequiredKeys, RevocationRecord, SubmissionProducedArtifact, SubmissionRecord, Signer, SshProcessAdapter, SshSignerConfig, VerifiedSignature, } from './crypto/index.ts';
|
|
34
34
|
export { DEF_POLICY_RANK, POLICY_FLOOR_PRESETS, artifactPolicyMinimum, floorDefPolicyMinimum, mergePolicyFloorWithLocal, originRulesMinimum, policyFloorGaps, stricterDefPolicy, verifyPolicyFloorRecord, } from './crypto/index.ts';
|
|
35
35
|
export type { PolicyFloorGap, PolicyFloorMergeResult, PolicyFloorVerdict, VerifyPolicyFloorInput, VerifyPolicyFloorOptions, } from './crypto/index.ts';
|
|
@@ -44,6 +44,6 @@ export { enrollmentGrantSchema, orderSchema, originSchema, policyFloorSchema, pu
|
|
|
44
44
|
export { BundleError, DEFAULT_BUNDLE_LIMITS, digestBundle, inspectBundle, packBundle, unpackBundle } from './bundle/index.ts';
|
|
45
45
|
export type { BundleEntryInfo, BundleErrorCode, BundleLimits, BundleManifest, BundleRuntimeRequirements, InspectOptions, InspectResult, PackOptions, PackResult, } from './bundle/index.ts';
|
|
46
46
|
export { DEBT_STATES, SETTLED_STATES } from './types.ts';
|
|
47
|
-
export type { Acceptance, ArtifactBiography, ArtifactData, Author, CheckFinding, CheckOptions, CheckReport, CheckStep, ConsumePattern, FiringTrigger, Fingerprint, GraphEdge, GraphNode, GraphNodeState, InputDef, InvariantDef, InvariantPredicate, InvariantViolation, JsonSchema, StepDef, ProducePattern, ReasonEntry, RejectKind, RunData, TaskData, TimelineEvent, WorkflowDef, WorkflowGraph, WorkflowTrace, } from './types.ts';
|
|
47
|
+
export type { Acceptance, ArtifactBiography, ArtifactData, Author, CheckFinding, CheckOptions, CheckReport, CheckStep, ConsumePattern, FiringTrigger, Fingerprint, GraphEdge, GraphNode, GraphNodeState, InputDef, InvariantDef, InvariantPredicate, InvariantViolation, JsonSchema, OnCancelDef, StepDef, ProducePattern, ReasonEntry, RejectKind, RunData, TaskData, TimelineEvent, WorkflowDef, WorkflowGraph, WorkflowTrace, } from './types.ts';
|
|
48
48
|
export { canonicalValueBytes, valueDigestHex, buildSubmissionRecord, signSubmission } from './crypto/index.ts';
|
|
49
49
|
export type { BuildSubmissionRecordInput, SubmissionProducedInput } from './crypto/index.ts';
|
package/dist/src/index.js
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
export { CallsPinError, Engine, ModifierRefusalError } from "./engine.js";
|
|
15
15
|
// Routing capabilities: offer-time composition and the claim-side match. The
|
|
16
16
|
// hub imports these to reason about the same compounds the engine composes.
|
|
17
|
-
export { capabilityName, claimMatches, composeCapabilities, DEFAULT_MATCH_MODE, MODIFIER_SEPARATOR, } from "./capabilities.js";
|
|
17
|
+
export { applyCapabilityRewrites, capabilityName, claimMatches, composeCapabilities, DEFAULT_MATCH_MODE, MODIFIER_SEPARATOR, } from "./capabilities.js";
|
|
18
18
|
export { createEngine } from "./factory.js";
|
|
19
19
|
export { createDefInstructionSource, defInstructionDigest, OrderResolver, substituteOrderVars, UnknownDefDigestError, UnknownInstructionError, } from "./order-resolver.js";
|
|
20
20
|
export { Store, openStore, StoreVersionError } from "./store.js";
|
|
@@ -22,10 +22,10 @@ export { Store, openStore, StoreVersionError } from "./store.js";
|
|
|
22
22
|
// store above): two-level digest-addressed workflow objects + coordinate
|
|
23
23
|
// index, `.wnlp` bundle installation, and fail-closed resolution.
|
|
24
24
|
export { defDigest, emptyWorkflowStoreIndex, globalStoreRoot, hardenObjectModes, installWorkflowBundle, inspectCasDefs, isDefDigest, loadCasDefs, objectDestRelPath, objectDirForDigest, parseWorkflowCoordinate, parseWorkflowStoreIndex, projectStoreRoot, probeObjectDir, probeStoreRoot, readWorkflowStoreIndex, recoverWorkflowStore, resolveWorkflowCoordinate, resolveWorkflowDigest, serializeWorkflowStoreIndex, storeIndexPath, workflowCoordinate, workflowStoreStatePaths, WORKFLOW_STORE_INDEX_VERSION, WorkflowStoreError, StoreIndexError, StoreDigestError, StoreCoordinateError, StoreAmbiguityError, StoreNotFoundError, StoreIntegrityError, StoreConflictError, StoreDefinitionVerificationError, StoreOriginPolicyError, StorePathError, BundleIngestorUnavailableError, PreCommitVerifierUnavailableError, createExecutionOriginVerifier, originEvidencePath, persistOriginEvidence, readOriginEvidence, } from "./store/index.js";
|
|
25
|
-
export { buildDef, DefError, expandIncludes, finalizeDefs, hashDef, lintDef, loadDefFile, loadDefs, loadDefsRaw, parseDef, resolveCallsTarget, SUPPORTED_ENGINE_VERSION, validateDef } from "./defs.js";
|
|
25
|
+
export { buildDef, cancelCleanupSteps, DefError, expandIncludes, finalizeDefs, hashDef, lintDef, loadDefFile, loadDefs, loadDefsRaw, parseDef, resolveCallsTarget, SUPPORTED_ENGINE_VERSION, validateDef } from "./defs.js";
|
|
26
26
|
export { credentialSlot, hashDefForHub, keychainServiceFor, normalizeOrigin, readStoredCredential } from "./hub.js";
|
|
27
27
|
export { deleteCredential, ensureFreshOAuth, storeCredential } from "./credentials.js";
|
|
28
|
-
export { DSSE_SSH_NAMESPACE, DSSE_VERSION, DSSE_RECORD_PAYLOAD_TYPES, DsseEnvelopeError, isDsseRecordPayloadType, PAYLOAD_TYPE_ENROLLMENT_GRANT, PAYLOAD_TYPE_ORIGIN, PAYLOAD_TYPE_POLICY_FLOOR, PAYLOAD_TYPE_PUBLICATION, PAYLOAD_TYPE_REVOCATION, PAYLOAD_TYPE_SUBMISSION, PrincipalKeyManager, SshSigner, SshSignerError, assertEd25519PubText, assertKeyRef, canonicalKeyRef, createSshSigner, decodeBase64Strict, dsseSignEnrollmentGrant, dsseSignEnvelope, dsseSignOrigin, dsseSignPolicyFloor, dsseSignPublication, dsseSignRecord, dsseSignRevocation, dsseSignSubmission, dsseVerifyEnrollmentGrant, dsseVerifyEnvelope, dsseVerifyOrigin, dsseVerifyPolicyFloor, dsseVerifyPublication, dsseVerifyRecord, dsseVerifyRevocation, dsseVerifySubmission, encodeBase64, keyidFromBlob, keyRefHash, parseAllowedSigners, preAuthEncode, publicKeyDescriptor, allowedSignersPath, resolveAllowedSigners, resolveAllowedSignersFile, isDefPolicy, verifyOrigin, verifyOriginSidecar, verifyPublication, verifyPublicationSidecar, verifyConsumed, verifyConsumedArtifact, DEFAULT_MACHINE_SCOPE, buildEnrollmentGrant, verifyRosterEntry, validateEnrollmentChain, validateProducer, revocationTemporalConsistency, attenuate, axisPermits, delegationPermits, ORG_ROOT_SCOPE, scopePermits,
|
|
28
|
+
export { DSSE_SSH_NAMESPACE, DSSE_VERSION, DSSE_RECORD_PAYLOAD_TYPES, DsseEnvelopeError, isDsseRecordPayloadType, PAYLOAD_TYPE_ENROLLMENT_GRANT, PAYLOAD_TYPE_ORIGIN, PAYLOAD_TYPE_POLICY_FLOOR, PAYLOAD_TYPE_PUBLICATION, PAYLOAD_TYPE_REVOCATION, PAYLOAD_TYPE_SUBMISSION, PrincipalKeyManager, SshSigner, SshSignerError, assertEd25519PubText, assertKeyRef, canonicalKeyRef, createSshSigner, decodeBase64Strict, dsseSignEnrollmentGrant, dsseSignEnvelope, dsseSignOrigin, dsseSignPolicyFloor, dsseSignPublication, dsseSignRecord, dsseSignRevocation, dsseSignSubmission, dsseVerifyEnrollmentGrant, dsseVerifyEnvelope, dsseVerifyOrigin, dsseVerifyPolicyFloor, dsseVerifyPublication, dsseVerifyRecord, dsseVerifyRevocation, dsseVerifySubmission, encodeBase64, keyidFromBlob, keyRefHash, parseAllowedSigners, preAuthEncode, publicKeyDescriptor, allowedSignersPath, resolveAllowedSigners, resolveAllowedSignersFile, isDefPolicy, verifyOrigin, verifyOriginSidecar, verifyPublication, verifyPublicationSidecar, verifyConsumed, verifyConsumedArtifact, DEFAULT_MACHINE_SCOPE, buildEnrollmentGrant, verifyRosterEntry, validateEnrollmentChain, validateProducer, revocationTemporalConsistency, attenuate, axisPermits, delegationPermits, ORG_ROOT_SCOPE, scopePermits, loadGrants, loadRevocations, orgRootPrivateKeyPath, orgRootPublicKeyPath, resolveOrgRoot, revocationsDir, grantsDir, StrandedLegacyGrantsError, ENROLLMENT_GRANT_FIELDS, ENROLLMENT_KEY_FIELDS, GRANT_DELEGATION_ALLOWED_FIELDS, GRANT_DELEGATION_DENIED_FIELDS, GRANT_SCOPE_FIELDS, ORDER_FIELDS, ORDER_OWED_FIELDS, ORDER_REASON_FIELDS, ORIGIN_FIELDS, ORIGIN_SOURCE_AGENT_FIELDS, ORIGIN_SOURCE_CONSOLE_FIELDS, ORIGIN_SOURCE_GIT_FIELDS, POLICY_FLOOR_FIELDS, POLICY_FLOOR_RECORD_FIELDS, PRINCIPAL_REFERENCE_FIELDS, PUBLICATION_FIELDS, RECORD_PAYLOAD_TYPES, REVOCATION_FIELDS, SUBMISSION_FIELDS, SUBMISSION_PRODUCED_FIELDS, } from "./crypto/index.js";
|
|
29
29
|
// ---- policy floors ----
|
|
30
30
|
export { DEF_POLICY_RANK, POLICY_FLOOR_PRESETS, artifactPolicyMinimum, floorDefPolicyMinimum, mergePolicyFloorWithLocal, originRulesMinimum, policyFloorGaps, stricterDefPolicy, verifyPolicyFloorRecord, } from "./crypto/index.js";
|
|
31
31
|
// ---- WP-E2a origin execution policy ----
|