@shapeshift-labs/frontier-swarm-codex 0.1.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Shapeshift Labs
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,250 @@
1
+ # @shapeshift-labs/frontier-swarm-codex
2
+
3
+ Node Codex CLI runner adapter for Frontier swarm plans.
4
+
5
+ `frontier-swarm-codex` executes `@shapeshift-labs/frontier-swarm` plans with the Codex CLI. It owns Node process spawning, prompt rendering, worktree/snapshot workspace setup, command shaping, JSONL output capture, last-message capture, optional verification commands, changed-path ownership checks, and swarm result/proof artifacts.
6
+
7
+ The default Codex compute profile is `gpt-5.5` with `model_reasoning_effort="xhigh"`. The pure `frontier-swarm` package stays runtime-neutral.
8
+
9
+
10
+ ## Related Packages
11
+
12
+ The published Frontier package family is generated from one shared package catalog so READMEs stay in sync across packages:
13
+
14
+ - [`@shapeshift-labs/frontier`](https://www.npmjs.com/package/@shapeshift-labs/frontier): Core JSON diff/apply, compact patch tuples, JSON Pointer, equality, clone, validation, Unicode helpers, and tiny dependency-free runtime budget/scheduler primitives.
15
+ - [`@shapeshift-labs/frontier-query`](https://www.npmjs.com/package/@shapeshift-labs/frontier-query): Shared query-key, selector path, condition, entity identity, and table-shape primitives.
16
+ - [`@shapeshift-labs/frontier-codec`](https://www.npmjs.com/package/@shapeshift-labs/frontier-codec): Patch serialization, binary frames, canonical JSON, and patch-history codecs.
17
+ - [`@shapeshift-labs/frontier-engine`](https://www.npmjs.com/package/@shapeshift-labs/frontier-engine): Stateful planned diff engine, adaptive profiles, schema plans, and engine-level history helpers.
18
+ - [`@shapeshift-labs/frontier-state`](https://www.npmjs.com/package/@shapeshift-labs/frontier-state): Patch-routed app-state subscriptions, owned commits, maintained views, and path mapping.
19
+ - [`@shapeshift-labs/frontier-dataflow`](https://www.npmjs.com/package/@shapeshift-labs/frontier-dataflow): Serializable incremental dataflow and materialized-view graphs for Frontier apps, including selectors, dependency DAGs, filters, joins, aggregations, stale paths, recompute budgets, output patches, provenance records, and proof of why derived views changed.
20
+ - [`@shapeshift-labs/frontier-state-cache`](https://www.npmjs.com/package/@shapeshift-labs/frontier-state-cache): Normalized query-result cache with entity/query watchers, persistence, change logs, optimistic layers, scheduled persistence, and mutation bridge.
21
+ - [`@shapeshift-labs/frontier-state-cache-idb`](https://www.npmjs.com/package/@shapeshift-labs/frontier-state-cache-idb): IndexedDB persistence adapter for Frontier state-cache snapshots and durable change logs.
22
+ - [`@shapeshift-labs/frontier-state-cache-file`](https://www.npmjs.com/package/@shapeshift-labs/frontier-state-cache-file): Structured file persistence adapter for Frontier state-cache snapshots and change logs.
23
+ - [`@shapeshift-labs/frontier-state-cache-sql`](https://www.npmjs.com/package/@shapeshift-labs/frontier-state-cache-sql): SQL persistence adapter for Frontier state-cache snapshots and change logs.
24
+ - [`@shapeshift-labs/frontier-schema`](https://www.npmjs.com/package/@shapeshift-labs/frontier-schema): JSON Schema validation, Frontier profile generation, CloudEvent envelopes, and query/table schema helpers.
25
+ - [`@shapeshift-labs/frontier-migrations`](https://www.npmjs.com/package/@shapeshift-labs/frontier-migrations): Boundary-first data migrations, import normalization, plugin/API version mapping, versioned envelopes, graph diagnostics, patch path rewrites, dry-run reports, and current-shape rehydration.
26
+ - [`@shapeshift-labs/frontier-event-log`](https://www.npmjs.com/package/@shapeshift-labs/frontier-event-log): Bounded event logs, replay cursors, consumer acknowledgements, keyed compaction, checkpoints, and Frontier patch event records.
27
+ - [`@shapeshift-labs/frontier-inspect`](https://www.npmjs.com/package/@shapeshift-labs/frontier-inspect): Cross-package inspection/evidence bundles, registry graph snapshots, feature/resource impact reports, timeline/event normalization, redaction, JSONL import/export, and AI-readable app feature maps.
28
+ - [`@shapeshift-labs/frontier-scheduler`](https://www.npmjs.com/package/@shapeshift-labs/frontier-scheduler): Deterministic work scheduling, lanes, cancellation, backpressure, frame policies, replay snapshots, and work graphs.
29
+ - [`@shapeshift-labs/frontier-logging`](https://www.npmjs.com/package/@shapeshift-labs/frontier-logging): Opt-in structured logging, browser telemetry, scheduled sinks, file sinks, exporters, benchmark traces, and Frontier patch/update summaries.
30
+ - [`@shapeshift-labs/frontier-mutation`](https://www.npmjs.com/package/@shapeshift-labs/frontier-mutation): Explicit mutation and selector plans compiled to Frontier patches or CRDT operations.
31
+ - [`@shapeshift-labs/frontier-effects`](https://www.npmjs.com/package/@shapeshift-labs/frontier-effects): Serializable effect descriptors and resource graphs for Frontier apps, including fetch, storage, timers, navigation, workers, clipboard, broadcast, WebSocket, stream, policy metadata, runtime records, redaction, JSONL, proof helpers, and registry graph output.
32
+ - [`@shapeshift-labs/frontier-auth`](https://www.npmjs.com/package/@shapeshift-labs/frontier-auth): Frontier-native auth contracts for providers, sessions, profile completeness, route and resource gates, account-linking policy, token issue/verify plans, runtime grants, audit events, registry graphs, lint resources, and auth evidence without owning app secrets, crypto, storage, or provider SDKs.
33
+ - [`@shapeshift-labs/frontier-policy`](https://www.npmjs.com/package/@shapeshift-labs/frontier-policy): Serializable policy and capability decisions for Frontier apps, effects, views, sync, routes, traces, and AI tools.
34
+ - [`@shapeshift-labs/frontier-flags`](https://www.npmjs.com/package/@shapeshift-labs/frontier-flags): Patchable policy-aware feature flag state for Frontier apps, including targeting, deterministic rollouts, experiment variants, kill switches, exposure records, audit logs, and replay evidence.
35
+ - [`@shapeshift-labs/frontier-tools`](https://www.npmjs.com/package/@shapeshift-labs/frontier-tools): Serializable app action/tool manifests for AI-operable Frontier apps, including availability, validation, dry-run plans, patch previews, effect/tool constraints, execution records, rollback links, and registry graph output.
36
+ - [`@shapeshift-labs/frontier-sandbox`](https://www.npmjs.com/package/@shapeshift-labs/frontier-sandbox): Runtime-agnostic sandbox contracts for Frontier patch-producing actions, including manifests, declared reads/writes/capabilities, host-validated patch/effect/event/log results, dynamic source modules, source event replay, and structural runtime adapters.
37
+ - [`@shapeshift-labs/frontier-sandbox-quickjs`](https://www.npmjs.com/package/@shapeshift-labs/frontier-sandbox-quickjs): QuickJS/WebAssembly runtime adapter for Frontier sandbox actions, including invocation/runtime isolation modes, deadline and memory limits, dynamic source execution, and patch/effect result normalization.
38
+ - [`@shapeshift-labs/frontier-workflow`](https://www.npmjs.com/package/@shapeshift-labs/frontier-workflow): Serializable durable workflow/process manifests for Frontier apps, including steps, waits, approvals, timers, retries, expected patches, compensation, records, timelines, and registry graph output.
39
+ - [`@shapeshift-labs/frontier-worker`](https://www.npmjs.com/package/@shapeshift-labs/frontier-worker): Serializable worker and edge task descriptors for Frontier apps, including queues, idempotency keys, retry and timeout policy, declared reads/writes/effects, snapshots, patch outputs, produced assets, execution records, logs, trace links, proof hashes, dedupe indexes, and registry graph output.
40
+ - [`@shapeshift-labs/frontier-queue`](https://www.npmjs.com/package/@shapeshift-labs/frontier-queue): Serializable durable queue state, leases, retries, dedupe keys, patch-carrying jobs, dead-letter records, replay evidence, and queue inspection for Frontier apps.
41
+ - [`@shapeshift-labs/frontier-swarm`](https://www.npmjs.com/package/@shapeshift-labs/frontier-swarm): Hierarchical swarm plans, lanes, compute profiles, ownership policy, task queues, event streams, run records, changed-path checks, and proof artifacts for Frontier agent work.
42
+ - [`@shapeshift-labs/frontier-kv`](https://www.npmjs.com/package/@shapeshift-labs/frontier-kv): Serializable in-memory key/value state for Frontier apps, including TTL, versioned compare-and-set, batched patch mutations, scans, watchers, snapshots, JSONL event evidence, and replay verification.
43
+ - [`@shapeshift-labs/frontier-kv-locks`](https://www.npmjs.com/package/@shapeshift-labs/frontier-kv-locks): Lease-style lock records on top of Frontier KV, including acquire, renew, release, fencing tokens, expiration, owner evidence, and replayable lock events.
44
+ - [`@shapeshift-labs/frontier-kv-rate-limit`](https://www.npmjs.com/package/@shapeshift-labs/frontier-kv-rate-limit): Patch-native rate limit buckets for Frontier KV, including fixed windows, sliding windows, token buckets, deterministic refill, consume evidence, and reset records.
45
+ - [`@shapeshift-labs/frontier-kv-file`](https://www.npmjs.com/package/@shapeshift-labs/frontier-kv-file): Node file persistence adapter for Frontier KV snapshots and append-only JSONL event logs, including atomic writes, compaction, replay loading, and adapter evidence.
46
+ - [`@shapeshift-labs/frontier-kv-idb`](https://www.npmjs.com/package/@shapeshift-labs/frontier-kv-idb): IndexedDB persistence adapter for Frontier KV snapshots and event logs, with structural IDB interfaces, upgrade planning, compact event storage, and replay loading.
47
+ - [`@shapeshift-labs/frontier-kv-redis`](https://www.npmjs.com/package/@shapeshift-labs/frontier-kv-redis): Redis-compatible command planning and structural client adapter for Frontier KV operations, including key mapping, TTL commands, optimistic CAS scripts, and replay evidence without bundling Redis drivers.
48
+ - [`@shapeshift-labs/frontier-kv-server`](https://www.npmjs.com/package/@shapeshift-labs/frontier-kv-server): Small Node HTTP server adapter for Frontier KV, including request planning, JSON endpoints for get/set/delete/scan/batch, optional rate-limit hooks, and replayable response evidence.
49
+ - [`@shapeshift-labs/frontier-assets`](https://www.npmjs.com/package/@shapeshift-labs/frontier-assets): Serializable asset and content provenance graphs for Frontier apps, including source files, generated variants, thumbnails, LOD chunks, shader/material dependencies, transforms, hashes, owners, runtime consumers, review plans, registry graph output, and impact queries.
50
+ - [`@shapeshift-labs/frontier-blueprint`](https://www.npmjs.com/package/@shapeshift-labs/frontier-blueprint): Serializable Blueprint/Prefab flyweight templates for Frontier apps, including parameterized instantiation, deterministic ID/path remapping, compact overrides, variants, effective-state materialization, scene/state patch emission, dependency metadata, and registry graph output.
51
+ - [`@shapeshift-labs/frontier-triggers`](https://www.npmjs.com/package/@shapeshift-labs/frontier-triggers): Capability-gated event trigger registry, scoped event envelopes, listener/reaction rules, structured rejection, deterministic event-to-action scheduling, replay/provenance records, and registry graph output.
52
+ - [`@shapeshift-labs/frontier-virtual`](https://www.npmjs.com/package/@shapeshift-labs/frontier-virtual): DOM-neutral virtualization, layout providers, range materialization, grids, spatial/frustum indexes, patch invalidation, camera anchors, and serializable layout state.
53
+ - [`@shapeshift-labs/frontier-table`](https://www.npmjs.com/package/@shapeshift-labs/frontier-table): Renderer-neutral data grid and table primitives for Frontier apps, including stable row identity, sorting, filtering, selection, virtual ranges, patch-driven edits, cache/dataflow descriptors, and CRDT-compatible row and cell operation frames.
54
+ - [`@shapeshift-labs/frontier-scene`](https://www.npmjs.com/package/@shapeshift-labs/frontier-scene): Patch-native 2D/3D scene graph, transform propagation, bounds queries, virtual/culling adapters, spatial invalidation, and camera/frustum materialization.
55
+ - [`@shapeshift-labs/frontier-pathfinding`](https://www.npmjs.com/package/@shapeshift-labs/frontier-pathfinding): Patch-native grid pathfinding, typed-array A*/Dijkstra search, flow fields, connected components, line-of-sight smoothing, dirty-cell invalidation, and scheduler-friendly path jobs.
56
+ - [`@shapeshift-labs/frontier-lod`](https://www.npmjs.com/package/@shapeshift-labs/frontier-lod): Patch-native level-of-detail and significance selection for rendering and computation workloads, compact typed hot paths, multi-observer selection, budget degradation, materialization frames, and scheduler work plans.
57
+ - [`@shapeshift-labs/frontier-route`](https://www.npmjs.com/package/@shapeshift-labs/frontier-route): DOM-neutral app/game route resources, route and scene manifests, match/resolve/transition planning, dependency metadata, sessions, registry graph output, and impact queries.
58
+ - [`@shapeshift-labs/frontier-trace`](https://www.npmjs.com/package/@shapeshift-labs/frontier-trace): Serializable traces, spans, events, causal links, W3C trace context helpers, timeline/resource/path queries, critical-path analysis, registry graph output, JSONL/proof helpers, Chrome trace export, and redaction for app-wide feature observability.
59
+ - [`@shapeshift-labs/frontier-manifest`](https://www.npmjs.com/package/@shapeshift-labs/frontier-manifest): Build/static feature manifests for owners, routes, actions, states, migrations, tests, source files, assets, resources, tasks, dependency metadata, registry graph output, feature maps, JSONL export, and impact queries.
60
+ - [`@shapeshift-labs/frontier-view`](https://www.npmjs.com/package/@shapeshift-labs/frontier-view): Renderer-neutral view manifests, type defaults, validation frames, action bindings, visual channels, virtual/LOD hints, and data-to-representation mapping for Frontier apps.
61
+ - [`@shapeshift-labs/frontier-icons`](https://www.npmjs.com/package/@shapeshift-labs/frontier-icons): Renderer-neutral icon records, icon sets, lookup aliases, SVG frames, string rendering, and registry evidence for Frontier apps.
62
+ - [`@shapeshift-labs/frontier-design`](https://www.npmjs.com/package/@shapeshift-labs/frontier-design): Renderer-neutral design-system tokens, semantic roles, recipes, target style frames, CSS variable output, and registry graph evidence for Frontier apps.
63
+ - [`@shapeshift-labs/frontier-canvas`](https://www.npmjs.com/package/@shapeshift-labs/frontier-canvas): Renderer-neutral infinite canvas surfaces for Frontier apps, including camera and viewport math, pan/zoom plans, grid materialization, snapping, hit testing, selection handles, extensible tool dispatch, frame records, registry graph output, and impact/proof helpers.
64
+ - [`@shapeshift-labs/frontier-canvas-tools`](https://www.npmjs.com/package/@shapeshift-labs/frontier-canvas-tools): Renderer-neutral editor tools, state machines, transform handles, permissions, async records, and AI action bridges for Frontier canvas surfaces.
65
+ - [`@shapeshift-labs/frontier-dnd`](https://www.npmjs.com/package/@shapeshift-labs/frontier-dnd): Renderer-neutral drag-and-drop sessions, sensor descriptors, collision ranking, drop planning, reorder patches, state partitioning, and registry evidence for Frontier apps.
66
+ - [`@shapeshift-labs/frontier-dom`](https://www.npmjs.com/package/@shapeshift-labs/frontier-dom): Patch-native DOM and host renderer bindings, manifest hydration, JSX runtime/compiler helpers, SSR, devtools, and logging bridges.
67
+ - [`@shapeshift-labs/frontier-playwright`](https://www.npmjs.com/package/@shapeshift-labs/frontier-playwright): Playwright/headless automation probes for Frontier state, DOM, devtools, marks, and timeline queries.
68
+ - [`@shapeshift-labs/frontier-test`](https://www.npmjs.com/package/@shapeshift-labs/frontier-test): Serializable test/spec evidence manifests for Frontier apps, including fixtures, commands, expected patches/effects/routes/policies, coverage declarations, run plans, run records, report adapters, replay proofs, fuzzers, benchmarks, registry graph output, and impact queries.
69
+ - [`@shapeshift-labs/frontier-fixtures`](https://www.npmjs.com/package/@shapeshift-labs/frontier-fixtures): Deterministic fixture and scenario generation for Frontier apps, including schema-valid sample state, related entity collections, actor personas, route states, replay-verified patch streams, event records, JSONL bundles, and evidence summaries.
70
+ - [`@shapeshift-labs/frontier-component-preview`](https://www.npmjs.com/package/@shapeshift-labs/frontier-component-preview): Frontier-native component preview books, generated preview manifests, stateful variants, Vite virtual modules, standalone browser preview shells, inspector bridges, and preview harness evidence for Frontier apps.
71
+ - [`@shapeshift-labs/frontier-documentation`](https://www.npmjs.com/package/@shapeshift-labs/frontier-documentation): Frontier-native documentation manifests, generated documentation books, package/API/source discovery, Vite virtual modules, standalone browser docs shells, inspector bridges, search indexes, and documentation harness evidence for Frontier apps and packages.
72
+ - [`@shapeshift-labs/frontier-ast-walk`](https://www.npmjs.com/package/@shapeshift-labs/frontier-ast-walk): Dependency-light source graph, import/export/declaration/call analysis, Frontier package-use discovery, and business-logic placement findings for Frontier tools, apps, docs, fuzzers, benchmarks, and agent evidence.
73
+ - [`@shapeshift-labs/frontier-history`](https://www.npmjs.com/package/@shapeshift-labs/frontier-history): Serializable temporal explanation and causality records for Frontier apps, including field-change explanations, action/workflow/policy/effect/trace/test provenance, audit windows, undo planning, registry/provenance graph output, JSONL replay bundles, and proof hashes.
74
+ - [`@shapeshift-labs/frontier-application`](https://www.npmjs.com/package/@shapeshift-labs/frontier-application): Serializable whole-application graph and impact queries for Frontier apps, including features, owners, packages, routes, views, actions, mutations, state paths, effects, workers, assets, tests, traces, policies, workflows, migrations, benchmarks, registry graph output, feature maps, JSONL bundles, and proof hashes.
75
+ - [`@shapeshift-labs/frontier-linter`](https://www.npmjs.com/package/@shapeshift-labs/frontier-linter): Serializable Frontier lint rules, diagnostics, fixes, reports, and fast rule execution for package catalogs, registry graphs, application maps, manifests, traces, policies, workflows, workers, assets, tests, benchmarks, and source snippets.
76
+ - [`@shapeshift-labs/frontier-framework`](https://www.npmjs.com/package/@shapeshift-labs/frontier-framework): High-level app framework package for Frontier applications, including configuration, CLI scaffolding, Vite builds, monorepo layout, TSX route builds, split frontend/backend deploy artifacts, backend-neutral Fetch handler and sync transport contracts, runtime data-source migrations, devtools, harness gates, agent MCP/tool manifests, CI evidence gates, workflow manifests, SARIF/linter output, replay scripts, and evidence manifest output.
77
+ - [`@shapeshift-labs/frontier-crdt`](https://www.npmjs.com/package/@shapeshift-labs/frontier-crdt): Native CRDT documents, update tooling, awareness, branches, conflict introspection, version frames, and undo.
78
+ - [`@shapeshift-labs/frontier-crdt-sync`](https://www.npmjs.com/package/@shapeshift-labs/frontier-crdt-sync): CRDT sync endpoints, repo/storage/provider contracts, scheduled sync work, document URLs, local networks, model checking, forensics, and text binding contracts.
79
+ - [`@shapeshift-labs/frontier-crdt-websocket`](https://www.npmjs.com/package/@shapeshift-labs/frontier-crdt-websocket): WebSocket client/server transports for Frontier CRDT sync providers.
80
+ - [`@shapeshift-labs/frontier-react`](https://www.npmjs.com/package/@shapeshift-labs/frontier-react): React external-store hooks and adapters for Frontier state, cache, and CRDT surfaces.
81
+ - [`@shapeshift-labs/frontier-richtext`](https://www.npmjs.com/package/@shapeshift-labs/frontier-richtext): Rich text Delta normalization/application, marks, embeds, ranges, and cursor/selection transforms for local editor integrations.
82
+ - [`@shapeshift-labs/frontier-realtime`](https://www.npmjs.com/package/@shapeshift-labs/frontier-realtime): Shared realtime command, tick, snapshot, prediction, reconciliation, interpolation, rollback, message, and delta primitives.
83
+ - [`@shapeshift-labs/frontier-realtime-server`](https://www.npmjs.com/package/@shapeshift-labs/frontier-realtime-server): Authoritative realtime room, tick, command validation, rate-limit, session, and snapshot-history runtime.
84
+ - [`@shapeshift-labs/frontier-realtime-websocket`](https://www.npmjs.com/package/@shapeshift-labs/frontier-realtime-websocket): WebSocket client, wire, and Node room-server transport for Frontier realtime.
85
+ - [`@shapeshift-labs/frontier-game`](https://www.npmjs.com/package/@shapeshift-labs/frontier-game): Game-facing entity, component, player, room, ownership, spatial interest, rollback, physics, and replication helpers above realtime.
86
+
87
+ Package source repositories:
88
+
89
+ - [`siliconjungle/-shapeshift-labs-frontier`](https://github.com/siliconjungle/-shapeshift-labs-frontier)
90
+ - [`siliconjungle/-shapeshift-labs-frontier-query`](https://github.com/siliconjungle/-shapeshift-labs-frontier-query)
91
+ - [`siliconjungle/-shapeshift-labs-frontier-codec`](https://github.com/siliconjungle/-shapeshift-labs-frontier-codec)
92
+ - [`siliconjungle/-shapeshift-labs-frontier-engine`](https://github.com/siliconjungle/-shapeshift-labs-frontier-engine)
93
+ - [`siliconjungle/-shapeshift-labs-frontier-state`](https://github.com/siliconjungle/-shapeshift-labs-frontier-state)
94
+ - [`siliconjungle/-shapeshift-labs-frontier-dataflow`](https://github.com/siliconjungle/-shapeshift-labs-frontier-dataflow)
95
+ - [`siliconjungle/-shapeshift-labs-frontier-state-cache`](https://github.com/siliconjungle/-shapeshift-labs-frontier-state-cache)
96
+ - [`siliconjungle/-shapeshift-labs-frontier-state-cache-idb`](https://github.com/siliconjungle/-shapeshift-labs-frontier-state-cache-idb)
97
+ - [`siliconjungle/-shapeshift-labs-frontier-state-cache-file`](https://github.com/siliconjungle/-shapeshift-labs-frontier-state-cache-file)
98
+ - [`siliconjungle/-shapeshift-labs-frontier-state-cache-sql`](https://github.com/siliconjungle/-shapeshift-labs-frontier-state-cache-sql)
99
+ - [`siliconjungle/-shapeshift-labs-frontier-schema`](https://github.com/siliconjungle/-shapeshift-labs-frontier-schema)
100
+ - [`siliconjungle/-shapeshift-labs-frontier-migrations`](https://github.com/siliconjungle/-shapeshift-labs-frontier-migrations)
101
+ - [`siliconjungle/-shapeshift-labs-frontier-event-log`](https://github.com/siliconjungle/-shapeshift-labs-frontier-event-log)
102
+ - [`siliconjungle/-shapeshift-labs-frontier-inspect`](https://github.com/siliconjungle/-shapeshift-labs-frontier-inspect)
103
+ - [`siliconjungle/-shapeshift-labs-frontier-scheduler`](https://github.com/siliconjungle/-shapeshift-labs-frontier-scheduler)
104
+ - [`siliconjungle/-shapeshift-labs-frontier-logging`](https://github.com/siliconjungle/-shapeshift-labs-frontier-logging)
105
+ - [`siliconjungle/-shapeshift-labs-frontier-mutation`](https://github.com/siliconjungle/-shapeshift-labs-frontier-mutation)
106
+ - [`siliconjungle/-shapeshift-labs-frontier-effects`](https://github.com/siliconjungle/-shapeshift-labs-frontier-effects)
107
+ - [`siliconjungle/-shapeshift-labs-frontier-auth`](https://github.com/siliconjungle/-shapeshift-labs-frontier-auth)
108
+ - [`siliconjungle/-shapeshift-labs-frontier-policy`](https://github.com/siliconjungle/-shapeshift-labs-frontier-policy)
109
+ - [`siliconjungle/-shapeshift-labs-frontier-flags`](https://github.com/siliconjungle/-shapeshift-labs-frontier-flags)
110
+ - [`siliconjungle/-shapeshift-labs-frontier-tools`](https://github.com/siliconjungle/-shapeshift-labs-frontier-tools)
111
+ - [`siliconjungle/-shapeshift-labs-frontier-sandbox`](https://github.com/siliconjungle/-shapeshift-labs-frontier-sandbox)
112
+ - [`siliconjungle/-shapeshift-labs-frontier-sandbox-quickjs`](https://github.com/siliconjungle/-shapeshift-labs-frontier-sandbox-quickjs)
113
+ - [`siliconjungle/-shapeshift-labs-frontier-workflow`](https://github.com/siliconjungle/-shapeshift-labs-frontier-workflow)
114
+ - [`siliconjungle/-shapeshift-labs-frontier-worker`](https://github.com/siliconjungle/-shapeshift-labs-frontier-worker)
115
+ - [`siliconjungle/-shapeshift-labs-frontier-queue`](https://github.com/siliconjungle/-shapeshift-labs-frontier-queue)
116
+ - [`siliconjungle/-shapeshift-labs-frontier-swarm`](https://github.com/siliconjungle/-shapeshift-labs-frontier-swarm)
117
+ - [`siliconjungle/-shapeshift-labs-frontier-swarm-codex`](https://github.com/siliconjungle/-shapeshift-labs-frontier-swarm-codex)
118
+ - [`siliconjungle/-shapeshift-labs-frontier-kv`](https://github.com/siliconjungle/-shapeshift-labs-frontier-kv)
119
+ - [`siliconjungle/-shapeshift-labs-frontier-kv-locks`](https://github.com/siliconjungle/-shapeshift-labs-frontier-kv-locks)
120
+ - [`siliconjungle/-shapeshift-labs-frontier-kv-rate-limit`](https://github.com/siliconjungle/-shapeshift-labs-frontier-kv-rate-limit)
121
+ - [`siliconjungle/-shapeshift-labs-frontier-kv-file`](https://github.com/siliconjungle/-shapeshift-labs-frontier-kv-file)
122
+ - [`siliconjungle/-shapeshift-labs-frontier-kv-idb`](https://github.com/siliconjungle/-shapeshift-labs-frontier-kv-idb)
123
+ - [`siliconjungle/-shapeshift-labs-frontier-kv-redis`](https://github.com/siliconjungle/-shapeshift-labs-frontier-kv-redis)
124
+ - [`siliconjungle/-shapeshift-labs-frontier-kv-server`](https://github.com/siliconjungle/-shapeshift-labs-frontier-kv-server)
125
+ - [`siliconjungle/-shapeshift-labs-frontier-assets`](https://github.com/siliconjungle/-shapeshift-labs-frontier-assets)
126
+ - [`siliconjungle/-shapeshift-labs-frontier-blueprint`](https://github.com/siliconjungle/-shapeshift-labs-frontier-blueprint)
127
+ - [`siliconjungle/-shapeshift-labs-frontier-triggers`](https://github.com/siliconjungle/-shapeshift-labs-frontier-triggers)
128
+ - [`siliconjungle/-shapeshift-labs-frontier-virtual`](https://github.com/siliconjungle/-shapeshift-labs-frontier-virtual)
129
+ - [`siliconjungle/-shapeshift-labs-frontier-table`](https://github.com/siliconjungle/-shapeshift-labs-frontier-table)
130
+ - [`siliconjungle/-shapeshift-labs-frontier-scene`](https://github.com/siliconjungle/-shapeshift-labs-frontier-scene)
131
+ - [`siliconjungle/-shapeshift-labs-frontier-pathfinding`](https://github.com/siliconjungle/-shapeshift-labs-frontier-pathfinding)
132
+ - [`siliconjungle/-shapeshift-labs-frontier-lod`](https://github.com/siliconjungle/-shapeshift-labs-frontier-lod)
133
+ - [`siliconjungle/-shapeshift-labs-frontier-route`](https://github.com/siliconjungle/-shapeshift-labs-frontier-route)
134
+ - [`siliconjungle/-shapeshift-labs-frontier-trace`](https://github.com/siliconjungle/-shapeshift-labs-frontier-trace)
135
+ - [`siliconjungle/-shapeshift-labs-frontier-manifest`](https://github.com/siliconjungle/-shapeshift-labs-frontier-manifest)
136
+ - [`siliconjungle/-shapeshift-labs-frontier-view`](https://github.com/siliconjungle/-shapeshift-labs-frontier-view)
137
+ - [`siliconjungle/-shapeshift-labs-frontier-icons`](https://github.com/siliconjungle/-shapeshift-labs-frontier-icons)
138
+ - [`siliconjungle/-shapeshift-labs-frontier-design`](https://github.com/siliconjungle/-shapeshift-labs-frontier-design)
139
+ - [`siliconjungle/-shapeshift-labs-frontier-canvas`](https://github.com/siliconjungle/-shapeshift-labs-frontier-canvas)
140
+ - [`siliconjungle/-shapeshift-labs-frontier-canvas-tools`](https://github.com/siliconjungle/-shapeshift-labs-frontier-canvas-tools)
141
+ - [`siliconjungle/-shapeshift-labs-frontier-dnd`](https://github.com/siliconjungle/-shapeshift-labs-frontier-dnd)
142
+ - [`siliconjungle/-shapeshift-labs-frontier-dom`](https://github.com/siliconjungle/-shapeshift-labs-frontier-dom)
143
+ - [`siliconjungle/-shapeshift-labs-frontier-playwright`](https://github.com/siliconjungle/-shapeshift-labs-frontier-playwright)
144
+ - [`siliconjungle/-shapeshift-labs-frontier-test`](https://github.com/siliconjungle/-shapeshift-labs-frontier-test)
145
+ - [`siliconjungle/-shapeshift-labs-frontier-fixtures`](https://github.com/siliconjungle/-shapeshift-labs-frontier-fixtures)
146
+ - [`siliconjungle/-shapeshift-labs-frontier-component-preview`](https://github.com/siliconjungle/-shapeshift-labs-frontier-component-preview)
147
+ - [`siliconjungle/-shapeshift-labs-frontier-documentation`](https://github.com/siliconjungle/-shapeshift-labs-frontier-documentation)
148
+ - [`siliconjungle/-shapeshift-labs-frontier-ast-walk`](https://github.com/siliconjungle/-shapeshift-labs-frontier-ast-walk)
149
+ - [`siliconjungle/-shapeshift-labs-frontier-history`](https://github.com/siliconjungle/-shapeshift-labs-frontier-history)
150
+ - [`siliconjungle/-shapeshift-labs-frontier-application`](https://github.com/siliconjungle/-shapeshift-labs-frontier-application)
151
+ - [`siliconjungle/-shapeshift-labs-frontier-linter`](https://github.com/siliconjungle/-shapeshift-labs-frontier-linter)
152
+ - [`siliconjungle/-shapeshift-labs-frontier-framework`](https://github.com/siliconjungle/-shapeshift-labs-frontier-framework)
153
+ - [`siliconjungle/-shapeshift-labs-frontier-crdt`](https://github.com/siliconjungle/-shapeshift-labs-frontier-crdt)
154
+ - [`siliconjungle/-shapeshift-labs-frontier-crdt-sync`](https://github.com/siliconjungle/-shapeshift-labs-frontier-crdt-sync)
155
+ - [`siliconjungle/-shapeshift-labs-frontier-crdt-websocket`](https://github.com/siliconjungle/-shapeshift-labs-frontier-crdt-websocket)
156
+ - [`siliconjungle/-shapeshift-labs-frontier-react`](https://github.com/siliconjungle/-shapeshift-labs-frontier-react)
157
+ - [`siliconjungle/-shapeshift-labs-frontier-richtext`](https://github.com/siliconjungle/-shapeshift-labs-frontier-richtext)
158
+ - [`siliconjungle/-shapeshift-labs-frontier-realtime`](https://github.com/siliconjungle/-shapeshift-labs-frontier-realtime)
159
+ - [`siliconjungle/-shapeshift-labs-frontier-realtime-server`](https://github.com/siliconjungle/-shapeshift-labs-frontier-realtime-server)
160
+ - [`siliconjungle/-shapeshift-labs-frontier-realtime-websocket`](https://github.com/siliconjungle/-shapeshift-labs-frontier-realtime-websocket)
161
+ - [`siliconjungle/-shapeshift-labs-frontier-game`](https://github.com/siliconjungle/-shapeshift-labs-frontier-game)
162
+
163
+ ## Install
164
+
165
+ ```sh
166
+ npm install @shapeshift-labs/frontier-swarm-codex
167
+ ```
168
+
169
+ ## CLI
170
+
171
+ ```sh
172
+ frontier-swarm-codex plan \
173
+ --manifest inkwell/agent-ownership.json \
174
+ --tasks inkwell/parity-work-queue.json \
175
+ --outDir agent-runs/codex-swarm/plan
176
+
177
+ frontier-swarm-codex run \
178
+ --manifest inkwell/agent-ownership.json \
179
+ --tasks inkwell/parity-work-queue.json \
180
+ --max-concurrency 4 \
181
+ --workspace copy \
182
+ --include AGENTS.md,package.json,inkwell \
183
+ --exclude node_modules,dist,agent-runs \
184
+ --link-path packages \
185
+ --link-node-modules true \
186
+ --sandbox workspace-write
187
+ ```
188
+
189
+ ## API
190
+
191
+ ```ts
192
+ import {
193
+ createCodexSwarmPlan,
194
+ runCodexSwarm
195
+ } from '@shapeshift-labs/frontier-swarm-codex';
196
+
197
+ const plan = createCodexSwarmPlan({ manifest, tasks });
198
+
199
+ await runCodexSwarm(plan, {
200
+ outDir: 'agent-runs/codex-swarm/run-1',
201
+ maxConcurrency: 4,
202
+ workspace: {
203
+ mode: 'copy',
204
+ root: '../agent-workspaces',
205
+ includes: ['AGENTS.md', 'package.json', 'snes'],
206
+ excludes: ['node_modules', 'dist', 'agent-runs', 'snes/test/roms'],
207
+ linkPaths: ['packages'],
208
+ linkNodeModules: true,
209
+ replace: true
210
+ }
211
+ });
212
+ ```
213
+
214
+ ## Minimal Repro Workspaces
215
+
216
+ Large monorepos do not need one full git worktree per worker. The adapter supports four workspace modes:
217
+
218
+ - `current`: run in the current checkout or lane worktree path.
219
+ - `git-worktree`: create a detached git worktree for full-repo isolation.
220
+ - `copy`: create a minimal copied workspace from declared includes, task `files`, `sourceRefs`, `targetRefs`, and task `snapshotIncludes`.
221
+ - `snapshot`: same minimal-copy mechanics with snapshot-oriented naming for legacy SNES-style task manifests.
222
+
223
+ For `copy` and `snapshot`, the runner excludes heavy paths by default (`.git`, `node_modules`, `dist`, coverage, agent-runs, ROM/test artifacts) and passes `--skip-git-repo-check` to Codex. It snapshots the copied workspace before and after execution so changed-path ownership checks still work without git metadata. Use `linkPaths` for heavy shared directories such as `packages`, corpora, ROMs, or research checkouts that should not be duplicated. Task JSON may also declare `snapshotIncludes`, `snapshotExcludes`, `snapshotArtifactIncludes`, and `snapshotLinkPaths`.
224
+
225
+ ## Surface
226
+
227
+ - `createCodexSwarmPlan`
228
+ - `coerceCodexSwarmManifestInput`
229
+ - `coerceCodexSwarmTasksInput`
230
+ - `createCodexWorkspacePlan`
231
+ - `prepareCodexWorkspace`
232
+ - `runCodexSwarm`
233
+ - `runCodexJob`
234
+ - `buildCodexArgs`
235
+ - `renderCodexPrompt`
236
+ - `spawnCodexExecutor`
237
+
238
+ ## Benchmarks
239
+
240
+ Run the package-local benchmark:
241
+
242
+ ```sh
243
+ npm run bench
244
+ ```
245
+
246
+ The benchmark writes `benchmarks/results/frontier-swarm-codex-package-bench-latest.json` when run from the monorepo. These are Frontier-only package measurements for input coercion, Codex argument construction, and prompt rendering.
247
+
248
+ ## Source Repository
249
+
250
+ This package is published from [siliconjungle/-shapeshift-labs-frontier-swarm-codex](https://github.com/siliconjungle/-shapeshift-labs-frontier-swarm-codex).
@@ -0,0 +1,109 @@
1
+ import fs from 'node:fs';
2
+ import path from 'node:path';
3
+ import { performance } from 'node:perf_hooks';
4
+ import { fileURLToPath } from 'node:url';
5
+ import {
6
+ buildCodexArgs,
7
+ createCodexSwarmPlan,
8
+ renderCodexPrompt
9
+ } from '../dist/index.js';
10
+
11
+ const __dirname = path.dirname(fileURLToPath(import.meta.url));
12
+ const packageDir = path.resolve(__dirname, '..');
13
+ const repoRoot = path.basename(path.dirname(packageDir)) === 'packages'
14
+ ? path.resolve(packageDir, '..', '..')
15
+ : packageDir;
16
+ const args = parseArgs(process.argv.slice(2));
17
+ const taskCount = readPositiveInt(args.tasks, 1000);
18
+ const rounds = readPositiveInt(args.rounds, 30);
19
+ const outPath = args.out ? path.resolve(repoRoot, args.out) : null;
20
+
21
+ const input = makeInput(taskCount);
22
+ let plan = createCodexSwarmPlan(input);
23
+ let cursor = 0;
24
+ const paths = {
25
+ jobDir: '.',
26
+ promptPath: 'prompt.md',
27
+ eventsPath: 'events.jsonl',
28
+ stderrPath: 'stderr.log',
29
+ lastMessagePath: 'last.md',
30
+ evidenceDir: 'evidence'
31
+ };
32
+
33
+ const rows = [
34
+ measure('coerce-plan-' + taskCount, 8, () => {
35
+ plan = createCodexSwarmPlan(input);
36
+ return plan.jobs.length;
37
+ }),
38
+ measure('build-args-' + taskCount, 64, () => buildCodexArgs(plan.jobs[cursor++ % plan.jobs.length], { outDir: '.', workspacePath: '.', paths }).length),
39
+ measure('render-prompt-' + taskCount, 32, () => renderCodexPrompt(plan.jobs[cursor++ % plan.jobs.length], { workspacePath: '.', paths }).length)
40
+ ];
41
+
42
+ const report = {
43
+ package: '@shapeshift-labs/frontier-swarm-codex',
44
+ version: readPackageVersion(),
45
+ generatedAt: new Date().toISOString(),
46
+ node: process.version,
47
+ platform: process.platform + ' ' + process.arch,
48
+ taskCount,
49
+ rounds,
50
+ rows
51
+ };
52
+
53
+ if (outPath) {
54
+ fs.mkdirSync(path.dirname(outPath), { recursive: true });
55
+ fs.writeFileSync(outPath, JSON.stringify(report, null, 2) + '\n');
56
+ }
57
+
58
+ console.log(report.package + ' package benchmark');
59
+ console.log('Node ' + report.node + ' on ' + report.platform + ', tasks=' + taskCount + ', rounds=' + rounds);
60
+ console.log('These are Frontier-only package measurements, not competitor comparisons.');
61
+ console.log('');
62
+ console.log('Fixture'.padEnd(28) + 'Median'.padStart(12) + 'p95'.padStart(12));
63
+ for (const row of rows) console.log(row.fixture.padEnd(28) + formatUs(row.medianUs).padStart(12) + formatUs(row.p95Us).padStart(12));
64
+ if (outPath) console.log('\nwrote ' + path.relative(repoRoot, outPath));
65
+
66
+ function makeInput(count) {
67
+ const items = [];
68
+ for (let i = 0; i < count; i += 1) items.push({ id: 'task-' + i, lane: 'runtime', ownedFiles: [`src/runtime/file-${i}.ts`] });
69
+ return {
70
+ manifest: { lanes: [{ id: 'runtime', allowedGlobs: ['src/runtime/**'], evidenceOutDirPrefix: 'evidence/runtime/' }] },
71
+ tasks: { items }
72
+ };
73
+ }
74
+
75
+ function measure(fixture, operationsPerRound, fn) {
76
+ const samples = [];
77
+ let checksum = 0;
78
+ for (let round = 0; round < rounds; round += 1) {
79
+ const start = performance.now();
80
+ for (let op = 0; op < operationsPerRound; op += 1) checksum += Number(fn()) || 0;
81
+ samples.push(((performance.now() - start) * 1000) / operationsPerRound);
82
+ }
83
+ samples.sort((a, b) => a - b);
84
+ return { fixture, operationsPerRound, medianUs: samples[Math.floor(samples.length / 2)], p95Us: samples[Math.min(samples.length - 1, Math.floor(samples.length * 0.95))], checksum };
85
+ }
86
+
87
+ function formatUs(value) {
88
+ if (value >= 1000) return (value / 1000).toFixed(2) + 'ms';
89
+ return value.toFixed(2) + 'us';
90
+ }
91
+
92
+ function parseArgs(argv) {
93
+ const out = {};
94
+ for (let i = 0; i < argv.length; i += 1) {
95
+ if (argv[i] === '--out') out.out = argv[++i];
96
+ else if (argv[i] === '--tasks') out.tasks = argv[++i];
97
+ else if (argv[i] === '--rounds') out.rounds = argv[++i];
98
+ }
99
+ return out;
100
+ }
101
+
102
+ function readPositiveInt(value, fallback) {
103
+ const parsed = Number(value);
104
+ return Number.isFinite(parsed) && parsed > 0 ? Math.floor(parsed) : fallback;
105
+ }
106
+
107
+ function readPackageVersion() {
108
+ return JSON.parse(fs.readFileSync(path.join(packageDir, 'package.json'), 'utf8')).version;
109
+ }
package/dist/cli.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export {};
3
+ //# sourceMappingURL=cli.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":""}
package/dist/cli.js ADDED
@@ -0,0 +1,137 @@
1
+ #!/usr/bin/env node
2
+ import fs from 'node:fs/promises';
3
+ import path from 'node:path';
4
+ import { coerceCodexSwarmManifestInput, coerceCodexSwarmTasksInput, createCodexSwarmPlan, runCodexSwarm } from './index.js';
5
+ const args = parseArgs(process.argv.slice(2));
6
+ const command = args._[0] ?? 'plan';
7
+ try {
8
+ if (command === 'plan') {
9
+ const plan = await loadPlan(args);
10
+ const outDir = path.resolve(String(args.outDir ?? args.out ?? `agent-runs/frontier-swarm-codex/${stamp()}`));
11
+ await fs.mkdir(outDir, { recursive: true });
12
+ await fs.writeFile(path.join(outDir, 'swarm-plan.json'), JSON.stringify(plan, null, 2) + '\n');
13
+ console.log(JSON.stringify({ ok: plan.validation.valid, outDir, plan }, null, 2));
14
+ }
15
+ else if (command === 'run') {
16
+ const plan = args.plan ? JSON.parse(await fs.readFile(String(args.plan), 'utf8')) : await loadPlan(args);
17
+ const outDir = path.resolve(String(args.outDir ?? args.out ?? `agent-runs/frontier-swarm-codex/${stamp()}`));
18
+ const result = await runCodexSwarm(plan, {
19
+ outDir,
20
+ codexPath: stringArg(args.codex),
21
+ maxConcurrency: numberArg(args.maxConcurrency ?? args['max-concurrency'], 1),
22
+ sandbox: stringArg(args.sandbox),
23
+ approval: stringArg(args.approval ?? args['ask-for-approval']),
24
+ model: stringArg(args.model),
25
+ reasoningEffort: stringArg(args.reasoningEffort ?? args['reasoning-effort']),
26
+ profile: stringArg(args.profile),
27
+ dryRun: boolArg(args.dryRun ?? args['dry-run'], false),
28
+ runVerification: boolArg(args.verify, false),
29
+ workspace: {
30
+ mode: readWorkspaceMode(args.workspace),
31
+ root: stringArg(args.worktreeRoot ?? args['worktree-root']),
32
+ create: boolArg(args.createWorktrees ?? args['create-worktrees'], false),
33
+ replace: boolArg(args.replaceWorkspace ?? args['replace-workspace'], false),
34
+ includes: listArg(args.include),
35
+ excludes: listArg(args.exclude),
36
+ artifactIncludes: listArg(args.artifact ?? args['artifact-include']),
37
+ linkPaths: listArg(args.link ?? args['link-path']),
38
+ linkNodeModules: boolArg(args.linkNodeModules ?? args['link-node-modules'], true),
39
+ skipGitRepoCheck: boolArg(args.skipGitRepoCheck ?? args['skip-git-repo-check'], readWorkspaceMode(args.workspace) !== 'git-worktree')
40
+ }
41
+ });
42
+ console.log(JSON.stringify(result, null, 2));
43
+ if (!result.ok)
44
+ process.exitCode = 1;
45
+ }
46
+ else if (command === 'verify') {
47
+ const runFile = String(args.run ?? args.results ?? '');
48
+ if (!runFile)
49
+ throw new Error('verify requires --run <swarm-results.json>');
50
+ const result = JSON.parse(await fs.readFile(runFile, 'utf8'));
51
+ const ok = Boolean(result.ok);
52
+ console.log(JSON.stringify({ ok, proof: result.proof ?? null }, null, 2));
53
+ if (!ok)
54
+ process.exitCode = 1;
55
+ }
56
+ else {
57
+ throw new Error(`unknown command: ${command}`);
58
+ }
59
+ }
60
+ catch (error) {
61
+ console.error(error instanceof Error ? error.message : String(error));
62
+ process.exitCode = 1;
63
+ }
64
+ async function loadPlan(options) {
65
+ const manifestPath = String(options.manifest ?? '');
66
+ const tasksPath = String(options.tasks ?? '');
67
+ if (!manifestPath)
68
+ throw new Error('missing --manifest <file>');
69
+ if (!tasksPath)
70
+ throw new Error('missing --tasks <file>');
71
+ const manifest = JSON.parse(await fs.readFile(manifestPath, 'utf8'));
72
+ const tasks = JSON.parse(await fs.readFile(tasksPath, 'utf8'));
73
+ return createCodexSwarmPlan({
74
+ manifest: coerceCodexSwarmManifestInput(manifest),
75
+ tasks: coerceCodexSwarmTasksInput(tasks),
76
+ plan: {
77
+ limit: numberArg(options.limit, undefined),
78
+ lanes: listArg(options.lane),
79
+ layers: listArg(options.layer),
80
+ selectors: listArg(options.selector),
81
+ statuses: listArg(options.status),
82
+ includeCompleted: boolArg(options.includeCompleted ?? options['include-completed'], false),
83
+ compute: stringArg(options.compute)
84
+ }
85
+ });
86
+ }
87
+ function parseArgs(argv) {
88
+ const out = { _: [] };
89
+ for (let index = 0; index < argv.length; index += 1) {
90
+ const token = argv[index];
91
+ if (!token.startsWith('--')) {
92
+ out._.push(token);
93
+ continue;
94
+ }
95
+ const body = token.slice(2);
96
+ const equals = body.indexOf('=');
97
+ const key = equals >= 0 ? body.slice(0, equals) : body;
98
+ const value = equals >= 0 ? body.slice(equals + 1) : argv[index + 1] && !argv[index + 1].startsWith('--') ? argv[++index] : true;
99
+ if (out[key] === undefined)
100
+ out[key] = value;
101
+ else if (Array.isArray(out[key]))
102
+ out[key].push(String(value));
103
+ else
104
+ out[key] = [String(out[key]), String(value)];
105
+ }
106
+ return out;
107
+ }
108
+ function listArg(value) {
109
+ if (value === undefined)
110
+ return undefined;
111
+ const raw = Array.isArray(value) ? value : String(value).split(',');
112
+ return raw.map((item) => String(item).trim()).filter(Boolean);
113
+ }
114
+ function numberArg(value, fallback) {
115
+ const parsed = Number(value);
116
+ return Number.isFinite(parsed) ? parsed : fallback;
117
+ }
118
+ function stringArg(value) {
119
+ return typeof value === 'string' && value.length > 0 ? value : undefined;
120
+ }
121
+ function readWorkspaceMode(value) {
122
+ const mode = stringArg(value);
123
+ if (mode === 'snapshot' || mode === 'copy' || mode === 'git-worktree')
124
+ return mode;
125
+ return 'current';
126
+ }
127
+ function boolArg(value, fallback) {
128
+ if (value === undefined)
129
+ return fallback;
130
+ if (value === true)
131
+ return true;
132
+ return /^(1|true|yes|on)$/i.test(String(value));
133
+ }
134
+ function stamp() {
135
+ return new Date().toISOString().replace(/[:.]/g, '-');
136
+ }
137
+ //# sourceMappingURL=cli.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EACL,6BAA6B,EA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