owenloop 0.5.0 → 0.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (229) hide show
  1. package/CHANGELOG.md +67 -0
  2. package/README.md +144 -35
  3. package/bin/owenloop.mjs +49 -1
  4. package/dist/packages/work/src/agent/brief.d.ts +29 -4
  5. package/dist/packages/work/src/agent/brief.js +49 -4
  6. package/dist/packages/work/src/agent/capability-model.d.ts +123 -0
  7. package/dist/packages/work/src/agent/capability-model.js +148 -0
  8. package/dist/packages/work/src/agent/loop.d.ts +56 -7
  9. package/dist/packages/work/src/agent/loop.js +166 -9
  10. package/dist/packages/work/src/bundle/cache.d.ts +7 -5
  11. package/dist/packages/work/src/bundle/cache.js +20 -6
  12. package/dist/packages/work/src/bundle/fetch.d.ts +7 -5
  13. package/dist/packages/work/src/bundle/fetch.js +27 -7
  14. package/dist/packages/work/src/bundle/types.d.ts +8 -4
  15. package/dist/packages/work/src/consumed-verifier.d.ts +45 -0
  16. package/dist/packages/work/src/consumed-verifier.js +205 -0
  17. package/dist/packages/work/src/exec/instructions.d.ts +99 -0
  18. package/dist/packages/work/src/exec/instructions.js +323 -0
  19. package/dist/packages/work/src/exec/loop.d.ts +29 -1
  20. package/dist/packages/work/src/exec/loop.js +313 -35
  21. package/dist/packages/work/src/exec/payload.d.ts +29 -0
  22. package/dist/packages/work/src/exec/payload.js +54 -0
  23. package/dist/packages/work/src/exec/receipt.d.ts +9 -6
  24. package/dist/packages/work/src/exec/receipt.js +12 -1
  25. package/dist/packages/work/src/exec/runner.d.ts +7 -1
  26. package/dist/packages/work/src/exec/runner.js +84 -3
  27. package/dist/packages/work/src/harness/child-env.js +7 -0
  28. package/dist/packages/work/src/harness/claude.d.ts +20 -8
  29. package/dist/packages/work/src/harness/claude.js +260 -58
  30. package/dist/packages/work/src/harness/codex.d.ts +5 -4
  31. package/dist/packages/work/src/harness/codex.js +169 -41
  32. package/dist/packages/work/src/harness/contract.d.ts +36 -11
  33. package/dist/packages/work/src/harness/fake.js +1 -0
  34. package/dist/packages/work/src/harness/jsonrpc-stdio.js +7 -0
  35. package/dist/packages/work/src/harness/permissions.d.ts +16 -3
  36. package/dist/packages/work/src/harness/permissions.js +102 -13
  37. package/dist/packages/work/src/harness/session-store.d.ts +30 -10
  38. package/dist/packages/work/src/harness/session-store.js +317 -89
  39. package/dist/packages/work/src/hold/mcp.d.ts +25 -5
  40. package/dist/packages/work/src/hold/mcp.js +134 -12
  41. package/dist/packages/work/src/hub/client.d.ts +8 -1
  42. package/dist/packages/work/src/hub/client.js +15 -1
  43. package/dist/packages/work/src/hub/types.d.ts +137 -33
  44. package/dist/packages/work/src/hub/types.js +8 -10
  45. package/dist/packages/work/src/mcp/server.js +1 -1
  46. package/dist/packages/work/src/owenloop-bin.d.ts +1 -0
  47. package/dist/packages/work/src/owenloop-bin.js +18 -0
  48. package/dist/packages/work/src/roles/agent-run.d.ts +12 -6
  49. package/dist/packages/work/src/roles/agent-run.js +115 -34
  50. package/dist/packages/work/src/roles/exec.d.ts +8 -0
  51. package/dist/packages/work/src/roles/exec.js +27 -2
  52. package/dist/packages/work/src/roles/hold.d.ts +6 -0
  53. package/dist/packages/work/src/roles/hold.js +83 -13
  54. package/dist/packages/work/src/roles/lint.d.ts +3 -4
  55. package/dist/packages/work/src/roles/lint.js +41 -7
  56. package/dist/packages/work/src/roles/settings.js +19 -2
  57. package/dist/packages/work/src/roles/shift.d.ts +1 -0
  58. package/dist/packages/work/src/roles/shift.js +36 -2
  59. package/dist/packages/work/src/settings/settings.d.ts +70 -1
  60. package/dist/packages/work/src/settings/settings.js +90 -4
  61. package/dist/packages/work/src/shift/logretention.d.ts +253 -0
  62. package/dist/packages/work/src/shift/logretention.js +407 -0
  63. package/dist/packages/work/src/shift/logsink.d.ts +14 -0
  64. package/dist/packages/work/src/shift/logsink.js +98 -0
  65. package/dist/packages/work/src/shift/loop.d.ts +32 -4
  66. package/dist/packages/work/src/shift/loop.js +687 -166
  67. package/dist/packages/work/src/shift/protocol.d.ts +128 -1
  68. package/dist/packages/work/src/shift/protocol.js +14 -0
  69. package/dist/packages/work/src/shift/runtime.d.ts +16 -0
  70. package/dist/packages/work/src/shift/runtime.js +291 -5
  71. package/dist/packages/work/src/shift/server.d.ts +13 -0
  72. package/dist/packages/work/src/shift/server.js +61 -36
  73. package/dist/packages/work/src/shift/spawn.d.ts +115 -19
  74. package/dist/packages/work/src/shift/spawn.js +234 -30
  75. package/dist/packages/work/src/shift/state.d.ts +76 -49
  76. package/dist/packages/work/src/shift/state.js +350 -103
  77. package/dist/packages/work/src/shift/truncate.d.ts +35 -0
  78. package/dist/packages/work/src/shift/truncate.js +73 -0
  79. package/dist/packages/work/src/submit-proof.d.ts +61 -0
  80. package/dist/packages/work/src/submit-proof.js +119 -0
  81. package/dist/packages/work/src/submit-value.d.ts +48 -0
  82. package/dist/packages/work/src/submit-value.js +118 -0
  83. package/dist/packages/work/src/usage.d.ts +1 -1
  84. package/dist/packages/work/src/usage.js +11 -0
  85. package/dist/src/add.d.ts +64 -259
  86. package/dist/src/add.js +81 -615
  87. package/dist/src/archive.d.ts +97 -0
  88. package/dist/src/archive.js +591 -0
  89. package/dist/src/bundle/index.d.ts +64 -0
  90. package/dist/src/bundle/index.js +508 -0
  91. package/dist/src/bundle/manifest.d.ts +50 -0
  92. package/dist/src/bundle/manifest.js +435 -0
  93. package/dist/src/bundle/runtime.d.ts +26 -0
  94. package/dist/src/bundle/runtime.js +64 -0
  95. package/dist/src/bundle/tar.d.ts +62 -0
  96. package/dist/src/bundle/tar.js +238 -0
  97. package/dist/src/bundle/types.d.ts +105 -0
  98. package/dist/src/bundle/types.js +21 -0
  99. package/dist/src/capabilities.d.ts +93 -0
  100. package/dist/src/capabilities.js +101 -0
  101. package/dist/src/cli.d.ts +90 -20
  102. package/dist/src/cli.js +2421 -374
  103. package/dist/src/credentials.d.ts +4 -3
  104. package/dist/src/credentials.js +21 -19
  105. package/dist/src/crypto/allowed-signers.d.ts +68 -0
  106. package/dist/src/crypto/allowed-signers.js +307 -0
  107. package/dist/src/crypto/canonical.d.ts +8 -0
  108. package/dist/src/crypto/canonical.js +92 -0
  109. package/dist/src/crypto/chain.d.ts +65 -0
  110. package/dist/src/crypto/chain.js +377 -0
  111. package/dist/src/crypto/dsse.d.ts +209 -0
  112. package/dist/src/crypto/dsse.js +282 -0
  113. package/dist/src/crypto/enrollment.d.ts +78 -0
  114. package/dist/src/crypto/enrollment.js +186 -0
  115. package/dist/src/crypto/index.d.ts +48 -0
  116. package/dist/src/crypto/index.js +44 -0
  117. package/dist/src/crypto/keys.d.ts +258 -0
  118. package/dist/src/crypto/keys.js +908 -0
  119. package/dist/src/crypto/org-root.d.ts +33 -0
  120. package/dist/src/crypto/org-root.js +78 -0
  121. package/dist/src/crypto/origin-rules.d.ts +56 -0
  122. package/dist/src/crypto/origin-rules.js +143 -0
  123. package/dist/src/crypto/policy-floor.d.ts +98 -0
  124. package/dist/src/crypto/policy-floor.js +353 -0
  125. package/dist/src/crypto/records.d.ts +319 -0
  126. package/dist/src/crypto/records.js +168 -0
  127. package/dist/src/crypto/scope.d.ts +49 -0
  128. package/dist/src/crypto/scope.js +83 -0
  129. package/dist/src/crypto/ssh.d.ts +171 -0
  130. package/dist/src/crypto/ssh.js +396 -0
  131. package/dist/src/crypto/submission.d.ts +33 -0
  132. package/dist/src/crypto/submission.js +47 -0
  133. package/dist/src/crypto/trust-roots.d.ts +29 -0
  134. package/dist/src/crypto/trust-roots.js +39 -0
  135. package/dist/src/crypto/verify-consumed.d.ts +67 -0
  136. package/dist/src/crypto/verify-consumed.js +259 -0
  137. package/dist/src/crypto/verify-origin.d.ts +50 -0
  138. package/dist/src/crypto/verify-origin.js +151 -0
  139. package/dist/src/crypto/verify-publication.d.ts +60 -0
  140. package/dist/src/crypto/verify-publication.js +150 -0
  141. package/dist/src/defs.d.ts +24 -1
  142. package/dist/src/defs.js +335 -27
  143. package/dist/src/engine.d.ts +211 -6
  144. package/dist/src/engine.js +459 -59
  145. package/dist/src/factory.d.ts +16 -0
  146. package/dist/src/factory.js +16 -4
  147. package/dist/src/global-config.d.ts +59 -0
  148. package/dist/src/global-config.js +84 -0
  149. package/dist/src/hub.d.ts +102 -32
  150. package/dist/src/hub.js +147 -58
  151. package/dist/src/index.d.ts +19 -2
  152. package/dist/src/index.js +23 -2
  153. package/dist/src/install.d.ts +538 -0
  154. package/dist/src/install.js +1981 -0
  155. package/dist/src/lock.d.ts +15 -57
  156. package/dist/src/lock.js +251 -143
  157. package/dist/src/mcp/serve.d.ts +46 -22
  158. package/dist/src/mcp/serve.js +174 -44
  159. package/dist/src/mcp/server.js +12 -1
  160. package/dist/src/model.d.ts +51 -0
  161. package/dist/src/model.js +157 -1
  162. package/dist/src/order-resolver.d.ts +184 -0
  163. package/dist/src/order-resolver.js +252 -0
  164. package/dist/src/package-version.d.ts +10 -0
  165. package/dist/src/package-version.js +42 -0
  166. package/dist/src/paths.d.ts +14 -1
  167. package/dist/src/paths.js +18 -0
  168. package/dist/src/schemas/enrollment-grant.v1.schema.json +90 -0
  169. package/dist/src/schemas/index.d.ts +1433 -0
  170. package/dist/src/schemas/index.js +31 -0
  171. package/dist/src/schemas/order.v1.schema.json +120 -0
  172. package/dist/src/schemas/origin.v1.schema.json +68 -0
  173. package/dist/src/schemas/policy-floor.v1.schema.json +29 -0
  174. package/dist/src/schemas/publication.v1.schema.json +31 -0
  175. package/dist/src/schemas/revocation.v1.schema.json +39 -0
  176. package/dist/src/schemas/submission.v1.schema.json +61 -0
  177. package/dist/src/store/def-source.d.ts +52 -0
  178. package/dist/src/store/def-source.js +335 -0
  179. package/dist/src/store/index-file.d.ts +69 -0
  180. package/dist/src/store/index-file.js +151 -0
  181. package/dist/src/store/index.d.ts +27 -0
  182. package/dist/src/store/index.js +22 -0
  183. package/dist/src/store/ingestor.d.ts +43 -0
  184. package/dist/src/store/ingestor.js +211 -0
  185. package/dist/src/store/install.d.ts +228 -0
  186. package/dist/src/store/install.js +555 -0
  187. package/dist/src/store/instruction-source.d.ts +49 -0
  188. package/dist/src/store/instruction-source.js +298 -0
  189. package/dist/src/store/origin-evidence.d.ts +21 -0
  190. package/dist/src/store/origin-evidence.js +66 -0
  191. package/dist/src/store/pre-commit-verifier.d.ts +68 -0
  192. package/dist/src/store/pre-commit-verifier.js +418 -0
  193. package/dist/src/store/resolve.d.ts +138 -0
  194. package/dist/src/store/resolve.js +363 -0
  195. package/dist/src/store/types.d.ts +288 -0
  196. package/dist/src/store/types.js +356 -0
  197. package/dist/src/store.d.ts +33 -1
  198. package/dist/src/store.js +57 -4
  199. package/dist/src/types.d.ts +146 -12
  200. package/dist/src/untar.d.ts +8 -23
  201. package/dist/src/untar.js +10 -136
  202. package/docs/agent-runner.md +86 -0
  203. package/docs/authoring.md +64 -6
  204. package/docs/bundles.md +350 -0
  205. package/docs/cli.md +1298 -106
  206. package/docs/crypto.md +832 -0
  207. package/docs/design.md +342 -20
  208. package/docs/embedding.md +132 -25
  209. package/docs/shift-logs.md +642 -0
  210. package/docs/wire-contracts.md +395 -0
  211. package/package.json +6 -1
  212. package/plugins/claude-code/.claude-plugin/marketplace.json +14 -0
  213. package/plugins/claude-code/plugin/.claude-plugin/plugin.json +8 -0
  214. package/plugins/claude-code/plugin/.mcp.json +14 -0
  215. package/plugins/claude-code/plugin/hooks/hooks.json +26 -0
  216. package/plugins/claude-code/plugin/hooks/session-end.sh +40 -0
  217. package/plugins/claude-code/plugin/hooks/session-start.sh +52 -0
  218. package/plugins/claude-code/plugin/skills/author/SKILL.md +181 -0
  219. package/plugins/claude-code/plugin/skills/conduct/SKILL.md +106 -0
  220. package/plugins/claude-code/plugin/skills/shift/SKILL.md +105 -0
  221. package/plugins/codex/.agents/plugins/marketplace.json +21 -0
  222. package/plugins/codex/plugins/owenloop/.codex-plugin/plugin.json +7 -0
  223. package/plugins/codex/plugins/owenloop/.mcp.json +20 -0
  224. package/plugins/codex/plugins/owenloop/hooks/hooks.json +26 -0
  225. package/plugins/codex/plugins/owenloop/hooks/session-end.sh +40 -0
  226. package/plugins/codex/plugins/owenloop/hooks/session-start.sh +52 -0
  227. package/plugins/codex/plugins/owenloop/skills/author/SKILL.md +181 -0
  228. package/plugins/codex/plugins/owenloop/skills/conduct/SKILL.md +106 -0
  229. package/plugins/codex/plugins/owenloop/skills/shift/SKILL.md +105 -0
package/dist/src/cli.d.ts CHANGED
@@ -9,6 +9,7 @@
9
9
  *
10
10
  * owenloop defs list available workflow definitions
11
11
  * owenloop add <owner>/<repo>[@ref] fetch, validate, and install a repo's workflow defs (public repos)
12
+ * owenloop start <def> [--provide n=json] [--crew name] start a published hub workflow
12
13
  * owenloop create <def> [--provide n=json] [--title t] start an instance
13
14
  * owenloop provide <wf> <name> [--value json] supply an owed input
14
15
  * owenloop tick <wf> [--now ms] pull eligible orders
@@ -31,10 +32,13 @@
31
32
  *
32
33
  * Global: --db <path> (env OWENLOOP_DB), --defs <dir> (env OWENLOOP_DEFS).
33
34
  */
34
- import type { CheckReport } from './types.ts';
35
+ import { hasDefiniteCheckDefect } from './model.ts';
36
+ import { PrincipalKeyManager } from './crypto/keys.ts';
35
37
  import type { LineStream } from './mcp/server.ts';
38
+ import type { BundleIngestor, PreCommitVerifier } from './store/index.ts';
36
39
  import type { AgentIdentitySummary, Keychain } from './hub.ts';
37
40
  export type { Keychain } from './hub.ts';
41
+ export type HarnessId = 'claude-code' | 'codex';
38
42
  export interface CliIO {
39
43
  cwd: string;
40
44
  env: Record<string, string | undefined>;
@@ -42,6 +46,24 @@ export interface CliIO {
42
46
  err: (line: string) => void;
43
47
  /** Injectable for hermetic tests — the network-touching verbs (`add`, hub commands) use this. */
44
48
  fetch?: typeof globalThis.fetch;
49
+ /**
50
+ * The bundle adapter for the `.wnlp` install route (unpacking, manifest
51
+ * integrity, canonical digest, coordinate). Injectable for tests and for
52
+ * wiring layers that carry the bundle-format module. `add` with bundle
53
+ * input FAILS CLOSED when this is absent — there is no default accepting
54
+ * parser or digest algorithm. The GitHub repo route never uses it.
55
+ */
56
+ bundleIngestor?: BundleIngestor;
57
+ /**
58
+ * The pre-commit verifier for the `.wnlp` install route, called after
59
+ * content/engine validation and before any object swap or index write.
60
+ * Injectable for tests and for wiring layers that carry the verification
61
+ * module. `add` with bundle input FAILS CLOSED when this is absent — there
62
+ * is no default accepting verifier. The GitHub repo route never uses it.
63
+ */
64
+ preCommitVerifier?: PreCommitVerifier;
65
+ /** Optional test/runtime override for the external install/repair transaction marker directory. */
66
+ recoveryMarkerDir?: string;
45
67
  /** Open a URL in the user's browser (login). Default: fire-and-forget `open`/`xdg-open`/`start`. */
46
68
  openUrl?: (url: string) => void;
47
69
  /**
@@ -71,33 +93,33 @@ export interface CliIO {
71
93
  */
72
94
  prompt?: (question: string) => Promise<string>;
73
95
  /**
74
- * Run a local command and capture its result — used ONLY by `setup`/`doctor`'s
75
- * Claude Code plugin probe (`claude plugin list`). Default: a `spawnSync`
96
+ * Run a local command and capture its result — used by `setup`/`doctor`'s
97
+ * Claude Code and Codex plugin probes and convergers. Default: a `spawnSync`
76
98
  * wrapper with `shell: false` (never interpolates argv into a shell) that
77
- * never inherits stdio. Injectable so tests model the plugin state without a
78
- * real `claude` binary.
99
+ * never inherits stdio. Injectable so tests model plugin state and installs
100
+ * without real harness binaries or configuration writes.
79
101
  */
80
102
  runCommand?: (cmd: string, args: string[]) => {
81
103
  status: number | null;
82
104
  stdout: string;
83
105
  stderr: string;
84
106
  };
107
+ /** Optional resolver override for hermetic tests of a missing bundled marketplace. */
108
+ resolveBundledMarketplaceRoot?: (harness: HarnessId) => string | null;
109
+ /**
110
+ * The principal signing-key manager for `setup`'s `[4/7] signing keys` step.
111
+ * Injectable so setup tests never reach the developer's real `ssh-keygen`,
112
+ * Keychain, libsecret, SSH agent, or `$HOME` (`makeFakePrincipalKeys` in
113
+ * test/hubkit.ts). Default: a real `PrincipalKeyManager` over `io.env`.
114
+ * Structurally `Pick<PrincipalKeyManager, 'ensure' | 'inspect' | 'withSigningKey' |
115
+ * 'resolveRef'>` — the narrow surface setup and publish use — so fakes stay
116
+ * hermetic.
117
+ */
118
+ principalKeys?: Pick<PrincipalKeyManager, 'ensure' | 'inspect' | 'withSigningKey' | 'resolveRef'>;
85
119
  }
86
- export declare const USAGE = "owenloop \u2014 a dataflow workflow engine\n\nUsage: owenloop <command> [args] [--db <path>] [--defs <dir>]\n\nCommands:\n defs list available workflow definitions\n add <owner>/<repo>[@ref] fetch, validate, and install a repo's workflow defs (public repos)\n add --recover finish or undo a crash-interrupted install (offline; no network)\n login [--hub <url>] [--with-token] [--as <slot>] authenticate the CLI against a hub, verified via whoami (loopback OAuth, or --with-token from stdin)\n logout [--hub <url>] [--as <slot>] delete the stored credential for a hub in one slot\n connect [--hub <url>] [--as <slot>] bind this project to a hub and verify the stored credential (whoami)\n push [<defName>...] [--force] [--dry-run] [--as <slot>] publish local workflow defs to the bound hub (server-diffed, idempotent)\n --as names the credential slot: human (default), agent, or agent:<account>\n agent new <name> [--crews <a,b>] [--scopes <a,b>] [--shift] [--hub <url>] mint a new Scoped Identity on the hub and store its token in slot agent:<name> (the token is never printed; --shift = --scopes work,run)\n capability bind <capability> <crew> [--hub <url>] add a crew to a workflow capability on the hub org \u2014 a capability may bind many crews (admin; human credential)\n capability unbind <capability> <crew> [--hub <url>] remove one (capability, crew) route\n capability list [--hub <url>] list the hub org's capability routes\n crew list [--hub <url>] list the hub org's crews with their members (includes the orphan crew once one exists)\n crew new <name> --kind personal|shared [--owner <memberId>] [--hub <url>] create a crew on the hub org (admin, or own personal crew; human credential)\n crew rm <crewId> [--hub <url>] delete a crew; work stamped to it moves to the org's orphan crew\n crew member add <crewId> <principalKind> <principalId> [--hub <url>] add a member or agent to a crew\n crew member rm <crewId> <principalId> [--hub <url>] remove a principal from a crew\n setup [--hub <url>] [--new-agent <name> | --replace-agent <name>] [--crews <a,b>] [--scopes <a,b>] converge this machine's install: human login, agent credential, owenloop settings, plugin (idempotent)\n doctor [--hub <url>] check this machine's owenloop install and report each piece (read-only)\n mcp [--hub <url>] serve the hub control plane over stdio MCP (spawned by MCP hosts, not run by humans)\n work <subcommand> [args] run execution-side shift/hold/exec/agent-run/... commands\n shift start|next|status|end [args] run and attend a local Unix-socket shift daemon\n lint [<def-name>] check def(s) for wiring problems\n check <def> [--format text|json] [--max-depth N] [--max-states N] [--max-collection N] [--assume-provided] [--strict-inputs]\n bounded reachability check (stall states, true deadlocks, stuck, dead steps, declared invariants)\n create <def> [--title t] [--provide name=json ...] [--param k=v ...]\n provide <wf> <name> [--value json] supply an owed (seedOwed) input\n adopt <wf> re-pin an instance to the current def (\u00A728); settles new debts\n tick <wf> [--now <ms>] [--shallow] [--capability <c>]... pull eligible orders (deep: also from calls: children; --shallow for this instance only; --capability filters to matching-capability steps)\n reap <wf> [--now] run the reaper; --now forces every claim stale (TTL 0)\n runs <wf> [--open] list this instance's runs (+ claim state for open ones)\n order <wf> <run> print the order packet issued at claim time (persisted in the claim txn)\n status <wf> derive debts / eligible / blocked\n status --all every instance's status in one call (fleet read)\n wait <wf> --until eligible|done [--timeout <dur>] block until engine state matches\n show <wf> dump raw artifacts\n trace <wf> [--format text] causal timeline + artifact biographies\n graph <def-or-wf> [--format dot|mermaid|json] wiring graph (+ live overlay if wf id)\n list list workflow instances\n green <wf> <run> <path> [--value json] [--terminal]\n emit <wf> <run> --items '[{...}]' accrete collection elements\n seal <wf> <run> [--value json] signal a collection is complete\n reject <wf> <path> --by <author> --text <msg>\n retract <wf> <path> --by <author> --text <msg>\n skip <wf> <path> --by <author> --text <msg>\n retry <wf> <path> [--by <author>] [--text <guidance>] clear a \u00A76 stall\n heartbeat <wf> <run> [--now <ms>] touch liveness timestamp on an open run\n close <wf> <run> [--outcome ok|no_work|failed|skipped] [--summary s]\n delete <wf> [--recursive] refuse if children exist unless --recursive (cascades)\n\nEnvironment: OWENLOOP_DB, OWENLOOP_DEFS";
87
- /**
88
- * The single "definite defect" predicate over a modelCheck `report`, shared by
89
- * `check`, `add` (dispatchAdd) and `push` (dispatchPush) so all three
90
- * accept-or-reject a def identically. A pure function of the report object — it
91
- * does NOT read or change how any caller seeded its modelCheck (add/push seed
92
- * `assumeProvided: true`; check seeds `assumeProvided: !strictInputs`).
93
- *
94
- * invariant violations and structurally-dead steps are ALWAYS definite (sound
95
- * regardless of bounds); a true deadlock counts ONLY when the search was
96
- * exhaustive (`!bounded`) because a tight maxCollectionSize cap can manufacture
97
- * a spurious one. `unreachedSteps` is deliberately EXCLUDED — it is a bounds
98
- * artifact ("raise --max-states/--max-depth"), never a definite defect.
99
- */
100
- export declare function hasDefiniteCheckDefect(report: CheckReport): boolean;
120
+ export declare function defaultIO(): CliIO;
121
+ export declare const USAGE: string;
122
+ export { hasDefiniteCheckDefect };
101
123
  /**
102
124
  * Single source of truth for the `--options` each command accepts, consulted by
103
125
  * `preflight` before any side effect. Unknown-OPTION rejection AND
@@ -112,6 +134,40 @@ export declare function hasDefiniteCheckDefect(report: CheckReport): boolean;
112
134
  * `last/all/flag/needOpt/numOpt` call site.
113
135
  */
114
136
  export declare const COMMAND_OPTIONS: ReadonlyMap<string, ReadonlySet<string>>;
137
+ /**
138
+ * The classification of a single `add` positional. Pure and independently
139
+ * tested: no filesystem access, no network, no state.
140
+ *
141
+ * - `github`: `owner/repo[@ref]` with no URL scheme and no `.wnlp` path —
142
+ * the byte-for-byte preserved GitHub route.
143
+ * - `file`: a local path ending in `.wnlp` — a bundle FILE (origin data only,
144
+ * never identity).
145
+ * - `url`: an `http:`/`https:` URL — a bundle URL; any other scheme is
146
+ * rejected, never a silent fallback.
147
+ */
148
+ export type AddSource = {
149
+ kind: 'github';
150
+ spec: string;
151
+ } | {
152
+ kind: 'file';
153
+ path: string;
154
+ } | {
155
+ kind: 'url';
156
+ url: string;
157
+ };
158
+ /**
159
+ * Classify one `add` positional WITHOUT changing GitHub behavior: the GitHub
160
+ * shape (`owner/repo[@ref]`, no scheme, not a `.wnlp` path) returns
161
+ * `{ kind: 'github' }` for exactly the same inputs `parseRepoSpec` accepts,
162
+ * and the GitHub route keeps parsing it — so every error message for a
163
+ * malformed repo spec is unchanged. `.wnlp` file paths and http/https URLs
164
+ * take the bundle route; everything else is a specific usage refusal.
165
+ *
166
+ * The classifier never inspects the filesystem: a `.wnlp` path that does not
167
+ * exist is still classified as a file (the reader refuses it afterward with
168
+ * the reason), and a URL is classified by scheme alone.
169
+ */
170
+ export declare function classifyAddSource(spec: string): AddSource;
115
171
  /**
116
172
  * Coerce a raw string (a hostname) into a valid agent account name, or `''` when
117
173
  * nothing usable survives. Lowercase; drop every character outside the account
@@ -133,6 +189,20 @@ export declare function lastActiveMs(identity: AgentIdentitySummary): number | n
133
189
  * renders `never`. Negative deltas (clock skew) clamp to `just now`.
134
190
  */
135
191
  export declare function formatLastActive(deltaMs: number | null): string;
192
+ export interface HarnessPluginState {
193
+ id: HarnessId;
194
+ cliName: 'claude' | 'codex';
195
+ cliFound: boolean;
196
+ installed: boolean;
197
+ installedVersion: string | null;
198
+ cliVersion: string | null;
199
+ }
200
+ /**
201
+ * Resolve a bundled marketplace root from either the source tree (`src/cli.ts`)
202
+ * or the shipped tree (`dist/src/cli.js`). The manifest check prevents a partial
203
+ * package from producing a path that the harness cannot consume.
204
+ */
205
+ export declare function resolveBundledMarketplaceRoot(harness: HarnessId): string | null;
136
206
  /**
137
207
  * Async entry point that adds network I/O for `add` and the hub commands on top
138
208
  * of the otherwise fully-synchronous engine/CLI (see the doc comment on