@krapht/ork 1.0.0-alpha.20 → 1.0.0-alpha.21

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 (52) hide show
  1. package/dist/{__build_info__-D6mXC4cD.mjs → __build_info__-0wqQ-rtf.mjs} +3 -51
  2. package/dist/{attach-C1OnxyMh.mjs → attach-C0-YyNoY.mjs} +6 -6
  3. package/dist/{attach-CEGbRg1D.mjs → attach-CAKNqnUK.mjs} +64 -35
  4. package/dist/bin.mjs +1426 -72
  5. package/dist/{brief-DH66xmj8.mjs → brief-C2hew8cS.mjs} +7 -6
  6. package/dist/{builtin-files-Cf-NZDqM.mjs → builtin-files-YYAnbZGD.mjs} +1 -1
  7. package/dist/{chips-BqcT58qr.mjs → chips-CP_pgKlj.mjs} +7 -2
  8. package/dist/{completion-DS0gCZRm.mjs → completion-K4rAVsrf.mjs} +6 -6
  9. package/dist/{context-CGPh12HV.mjs → context-B-fjPJky.mjs} +4 -4
  10. package/dist/context-DMK0U1w0.mjs +160 -0
  11. package/dist/{detached-Dakw5RZj.mjs → detached-q0AYG0Bs.mjs} +6 -5
  12. package/dist/{find-BTikxc54.mjs → find-Ct5CNl1J.mjs} +1 -1
  13. package/dist/{flags-C8yCq0j5.mjs → flags-C90N4J1i.mjs} +3 -3
  14. package/dist/{follow-ups-CtlhHbwe.mjs → follow-ups-D3HPyNYM.mjs} +14 -9
  15. package/dist/{format-BB4E-T6x.mjs → format-CiPhQqbX.mjs} +24 -13
  16. package/dist/{help-groups-BpRgBSTh.mjs → help-groups-BQvcKQ9H.mjs} +8 -3
  17. package/dist/{in-a-run-CbnKjO7t.mjs → in-a-run-D_wg4iJi.mjs} +2 -2
  18. package/dist/{install-CWcpX5g4.mjs → install-Hji6LIei.mjs} +50 -2
  19. package/dist/{limits-VQqsBoQk.mjs → limits-BD6RZRCS.mjs} +1 -1
  20. package/dist/{mcp-wGfkMCVF.mjs → mcp-CpbDmBLG.mjs} +6 -6
  21. package/dist/{once-BHxSdZz_.mjs → once-J8Qn5fTG.mjs} +4 -4
  22. package/dist/{output-B1kwo0YU.mjs → output-DXZbnFt_.mjs} +61 -42
  23. package/dist/{pause-C_Wxh-KM.mjs → pause-Cl4ZYA35.mjs} +4 -4
  24. package/dist/{print-DNYzq4Rr.mjs → print-DzugGZQB.mjs} +2 -2
  25. package/dist/{project-records-XY3ku95x.mjs → project-records-CtkmlsHN.mjs} +3 -3
  26. package/dist/{relay-BA6tsnpc.mjs → relay-CiP77vga.mjs} +2 -2
  27. package/dist/{run-Bvvg-fiF.mjs → run-CtuNY3mE.mjs} +1 -1
  28. package/dist/{send-nrKtak5F.mjs → send-DRYGks8K.mjs} +3 -4
  29. package/dist/short-flags-DkJLWVqh.mjs +1 -0
  30. package/dist/short-flags-Qf21as0E.mjs +83 -0
  31. package/dist/{src-D4JSymhK.mjs → src-BMFQKHz4.mjs} +32 -14
  32. package/dist/{src-CmEvHdju.mjs → src-BrFfDKux.mjs} +8 -7
  33. package/dist/{src-8cOPOgrT.mjs → src-BuF9Lbow.mjs} +77 -18
  34. package/dist/{src-I_RyKu6_.mjs → src-k0A_QpST.mjs} +5 -3
  35. package/dist/store-rTgRu8xy.mjs +25 -0
  36. package/dist/ui/assets/app-BYxpKJRh.css +1 -0
  37. package/dist/ui/assets/{app-BowhjEAe.js → app-SEFEJLkF.js} +8 -8
  38. package/dist/ui/assets/{index-CrMa2oHB.js → index-Cb6Voq_W.js} +2 -2
  39. package/dist/ui/index.html +1 -1
  40. package/dist/{ui-DY3Dnpho.mjs → ui-C2f37TSb.mjs} +9 -6
  41. package/dist/{usage-1VwSg_Qt.mjs → usage-BuvGcQSk.mjs} +6 -7
  42. package/dist/validate-ObP5lt29.mjs +1 -0
  43. package/dist/{validate-BxayjjkV.mjs → validate-_HjACtk9.mjs} +6 -6
  44. package/dist/{verdict-CMvPCpWC.mjs → verdict-B592j1W3.mjs} +2 -2
  45. package/dist/{watch-CT0EtLPZ.mjs → watch-DV3ixCYj.mjs} +7 -7
  46. package/dist/{workflows-DHHi-APg.mjs → workflows-QLjBhGNS.mjs} +3 -3
  47. package/dist/{worktrees-CZvbHzbN.mjs → worktrees-D3ubG_Qw.mjs} +6 -6
  48. package/dist/yolo-BSH1E_kE.mjs +33 -0
  49. package/package.json +1 -1
  50. package/dist/run-DBUAq-Uu.mjs +0 -1452
  51. package/dist/store-CDpk8Wtz.mjs +0 -16
  52. package/dist/ui/assets/app--FijEXiJ.css +0 -1
@@ -19,7 +19,7 @@
19
19
  href="/favicon.svg"
20
20
  type="image/svg+xml"
21
21
  />
22
- <script type="module" crossorigin src="/assets/index-CrMa2oHB.js"></script>
22
+ <script type="module" crossorigin src="/assets/index-Cb6Voq_W.js"></script>
23
23
  <link rel="modulepreload" crossorigin href="/assets/theme-CdXvqTQ6.js">
24
24
  <link rel="stylesheet" crossorigin href="/assets/index-BPIbqRRb.css">
25
25
  </head>
@@ -1,8 +1,8 @@
1
- import { p as scrubberOfRun } from "./src-I_RyKu6_.mjs";
2
- import { n as ORK_VERSION, t as ORK_NAME } from "./__build_info__-D6mXC4cD.mjs";
3
- import { c as write, l as writeErr, s as style } from "./output-B1kwo0YU.mjs";
4
- import { o as mayShowSignIn } from "./in-a-run-CbnKjO7t.mjs";
5
- import { i as uiFilePath, l as newToken, n as startServer, r as runningServer, t as DEFAULT_PORT, u as createClient } from "./src-CmEvHdju.mjs";
1
+ import { p as scrubberOfRun } from "./src-k0A_QpST.mjs";
2
+ import { n as ORK_VERSION, t as ORK_NAME } from "./__build_info__-0wqQ-rtf.mjs";
3
+ import { c as write, l as writeErr, s as style } from "./output-DXZbnFt_.mjs";
4
+ import { o as mayShowSignIn } from "./in-a-run-D_wg4iJi.mjs";
5
+ import { i as uiFilePath, l as newToken, n as startServer, r as runningServer, t as DEFAULT_PORT, u as createClient } from "./src-BrFfDKux.mjs";
6
6
  import path from "node:path";
7
7
  import { constants } from "node:os";
8
8
  import { spawn } from "node:child_process";
@@ -401,6 +401,8 @@ const onStopSignals = (stop) => {
401
401
  const signInLink = (port, code) => `http://127.0.0.1:${String(port)}/?code=${code}`;
402
402
  /** What `ork ui` says when it can't get a sign-in code from the server. */
403
403
  const MINT_FAILED_OLDER = "The running UI is from an older Ork; stop it and run `ork ui`.";
404
+ /** What it says when the UI's process is there but nothing answers its port. */
405
+ const MINT_FAILED_GONE = "The UI recorded as running does not answer on its port; stop its process and run `ork ui` again.";
404
406
  /**
405
407
  * Gets a single-use sign-in code from the server with the API token, and
406
408
  * returns the link for it, or the reason there is none. The token only goes in
@@ -413,7 +415,7 @@ const mintSignInLink = async (port, token, fetchFn) => {
413
415
  ...fetchFn === void 0 ? {} : { fetch: fetchFn }
414
416
  }).call("signIn");
415
417
  if (answer.ok) return { link: signInLink(port, answer.data.code) };
416
- return { failure: answer.status === 404 || answer.status === 0 ? MINT_FAILED_OLDER : `Could not get a sign-in code: ${answer.error}` };
418
+ return { failure: answer.status === 404 ? MINT_FAILED_OLDER : answer.status === 0 ? MINT_FAILED_GONE : `Could not get a sign-in code: ${answer.error}` };
417
419
  };
418
420
  /** `--port`: 0 to 65535 (0 picks a free port); `null` when invalid. */
419
421
  const portArg = (value) => {
@@ -430,6 +432,7 @@ const show = async (port, token, open) => {
430
432
  const minted = await mintSignInLink(port, token);
431
433
  if ("failure" in minted) {
432
434
  writeErr(minted.failure);
435
+ process.exitCode = 1;
433
436
  return;
434
437
  }
435
438
  const { link } = minted;
@@ -1,10 +1,10 @@
1
- import { Gr as placeFor, H as applyPrune, Jt as usageListTable, R as openStore, U as planPrune, _ as usageReport, g as USAGE_DIMENSIONS } from "./src-8cOPOgrT.mjs";
1
+ import { H as applyPrune, Jt as usageListTable, R as openStore, U as planPrune, _ as usageReport, g as USAGE_DIMENSIONS, qr as placeFor } from "./src-BuF9Lbow.mjs";
2
2
  import { a as agoTime } from "./refusals-DQQX3AIb.mjs";
3
- import { C as termOf, c as write, l as writeErr, n as cost, o as shortCount, r as costOf, s as style, t as confirm } from "./output-B1kwo0YU.mjs";
4
- import { n as chip, t as CHIP_LABELS } from "./chips-BqcT58qr.mjs";
5
- import { n as limitsHere } from "./limits-VQqsBoQk.mjs";
6
- import { c as refuseUnknownFlags, i as readListArgs, n as filterArgs, r as projectScope } from "./flags-C8yCq0j5.mjs";
7
- import { a as header, o as table } from "./format-BB4E-T6x.mjs";
3
+ import { c as write, l as writeErr, n as cost, o as shortCount, r as costOf, s as style, t as confirm, v as termOf } from "./output-DXZbnFt_.mjs";
4
+ import { r as chip, t as CHIP_LABELS } from "./chips-CP_pgKlj.mjs";
5
+ import { n as limitsHere } from "./limits-BD6RZRCS.mjs";
6
+ import { c as refuseUnknownFlags, i as readListArgs, n as filterArgs, r as projectScope } from "./flags-C90N4J1i.mjs";
7
+ import { a as header, o as table } from "./format-CiPhQqbX.mjs";
8
8
  import { defineCommand } from "citty";
9
9
  // src/runs/usage.ts
10
10
  /** `950`, `12.3k`, `4.5M`. */
@@ -217,7 +217,6 @@ const prune = defineCommand({
217
217
  },
218
218
  yes: {
219
219
  type: "boolean",
220
- alias: "y",
221
220
  description: "Do not ask",
222
221
  default: false
223
222
  }
@@ -0,0 +1 @@
1
+ export { n as validate } from "./validate-_HjACtk9.mjs";
@@ -1,8 +1,8 @@
1
- import { $ as driverQueues, Bi as knownExperiments, Ci as DriverSchema, D as lateTriggers, Di as INTEGRATIONS, Et as walkSummary, Fi as AGENT_DRIVERS, Gr as placeFor, Ii as DRIVER_IDS, Li as firstLine, M as readProjectTriggers, Mi as readyDriver, N as workflowTextHash, O as triggersReport, R as openStore, Ri as EXPERIMENTS, Ti as retiredDriverHint, Tr as socketRoom, Tt as walkChecks, Wr as placeFiles, X as budgetWarnings, Yr as workflowDirOf, Z as driverRefusals, cn as namingNoDriver, ji as driverChecks, qn as loadProject, wt as checkWorkflowText, z as storePath, zi as experimentsOn } from "./src-8cOPOgrT.mjs";
2
- import { d as readUpdateCache, f as refreshUpdateCache, i as registryOf, l as newerVersion, m as writeUpdateCache, n as ORK_VERSION, o as updateSwitchOff, p as updateCachePath, r as isSwitchedOn, s as checkDue, t as ORK_NAME, u as pendingNotice } from "./__build_info__-D6mXC4cD.mjs";
3
- import { C as termOf, D as wrap, E as widthOf, a as plain, c as write, h as paint, l as writeErr, s as style, w as cut, x as plainEnv } from "./output-B1kwo0YU.mjs";
4
- import { n as chip, t as CHIP_LABELS } from "./chips-BqcT58qr.mjs";
5
- import { a as refusedBuiltin, c as projectAt, i as missingWorkflowText, l as registeredProjects, r as findWorkflowFiles } from "./workflows-DHHi-APg.mjs";
1
+ import { $ as driverQueues, Bi as firstLine, D as lateTriggers, Di as retiredDriverHint, Dr as socketRoom, Et as walkSummary, Fi as whyReady, Hi as experimentsOn, Kr as placeFiles, M as readProjectTriggers, N as workflowTextHash, Ni as driverChecks, O as triggersReport, Pi as readyDriver, R as openStore, Ri as AGENT_DRIVERS, Ti as DriverSchema, Tt as walkChecks, Ui as knownExperiments, Vi as EXPERIMENTS, X as budgetWarnings, Yn as loadProject, Z as driverRefusals, Zr as workflowDirOf, cn as namingNoDriver, ki as INTEGRATIONS, qr as placeFor, wt as checkWorkflowText, z as storePath, zi as DRIVER_IDS } from "./src-BuF9Lbow.mjs";
2
+ import { d as readUpdateCache, f as refreshUpdateCache, i as registryOf, l as newerVersion, m as writeUpdateCache, n as ORK_VERSION, o as updateSwitchOff, p as updateCachePath, r as isSwitchedOn, s as checkDue, t as ORK_NAME, u as pendingNotice } from "./__build_info__-0wqQ-rtf.mjs";
3
+ import { S as wrap, a as plain, c as write, g as plainEnv, k as paint, l as writeErr, s as style, v as termOf, x as widthOf, y as cut } from "./output-DXZbnFt_.mjs";
4
+ import { r as chip, t as CHIP_LABELS } from "./chips-CP_pgKlj.mjs";
5
+ import { a as refusedBuiltin, c as projectAt, i as missingWorkflowText, l as registeredProjects, r as findWorkflowFiles } from "./workflows-QLjBhGNS.mjs";
6
6
  import path from "node:path";
7
7
  import { readFileSync } from "node:fs";
8
8
  import { execFile, spawn } from "node:child_process";
@@ -347,7 +347,7 @@ const chooseReadyDriver = (names, all, checks) => {
347
347
  "See `ork doctor`."
348
348
  ]
349
349
  };
350
- const why = ready.ready === 1 ? `the one ready here (${ready.detail})` : `more than one is ready, and a run takes ${ready.driver} first`;
350
+ const why = ready.ready === 1 ? `the one ready here (${ready.detail})` : whyReady(ready);
351
351
  return {
352
352
  ok: true,
353
353
  driver: ready.driver,
@@ -1,5 +1,5 @@
1
- import { C as termOf, p as apply } from "./output-B1kwo0YU.mjs";
2
- import { n as chip, t as CHIP_LABELS } from "./chips-BqcT58qr.mjs";
1
+ import { D as apply, v as termOf } from "./output-DXZbnFt_.mjs";
2
+ import { r as chip, t as CHIP_LABELS } from "./chips-CP_pgKlj.mjs";
3
3
  // src/run/view.ts
4
4
  /**
5
5
  * @file How a run's lines are drawn: the terminal kit's {@link Term} for the
@@ -1,10 +1,10 @@
1
- import { A as triggerStanding, Ei as timeoutMs, F as watchingPid, M as readProjectTriggers, O as triggersReport, P as takeWatchLock, Pn as liveStatus, R as openStore, Si as isToolNode, Vn as stillTheSameProcess, Wr as placeFiles, _i as CheckReportSchema, j as declaredTriggers, k as createWatcher, mr as runGh, pt as detachRun, xn as startFollowUpChecks } from "./src-8cOPOgrT.mjs";
2
- import { c as toolExecutor, o as spawnTool, s as mcpCallExecutor } from "./src-I_RyKu6_.mjs";
3
- import { n as newRunId } from "./find-BTikxc54.mjs";
4
- import { C as termOf, E as widthOf, a as plain, c as write, l as writeErr, s as style, t as confirm, w as cut } from "./output-B1kwo0YU.mjs";
5
- import { n as chip, t as CHIP_LABELS } from "./chips-BqcT58qr.mjs";
6
- import { i as runLimits, r as limitsRefusal } from "./limits-VQqsBoQk.mjs";
7
- import { t as acceptRefusal } from "./in-a-run-CbnKjO7t.mjs";
1
+ import { A as triggerStanding, F as watchingPid, Kr as placeFiles, M as readProjectTriggers, O as triggersReport, Oi as timeoutMs, P as takeWatchLock, Pn as liveStatus, R as openStore, Un as stillTheSameProcess, gr as runGh, j as declaredTriggers, k as createWatcher, pt as detachRun, wi as isToolNode, xn as startFollowUpChecks, yi as CheckReportSchema } from "./src-BuF9Lbow.mjs";
2
+ import { c as toolExecutor, o as spawnTool, s as mcpCallExecutor } from "./src-k0A_QpST.mjs";
3
+ import { n as newRunId } from "./find-Ct5CNl1J.mjs";
4
+ import { a as plain, c as write, l as writeErr, s as style, t as confirm, v as termOf, x as widthOf, y as cut } from "./output-DXZbnFt_.mjs";
5
+ import { r as chip, t as CHIP_LABELS } from "./chips-CP_pgKlj.mjs";
6
+ import { i as runLimits, r as limitsRefusal } from "./limits-BD6RZRCS.mjs";
7
+ import { t as acceptRefusal } from "./in-a-run-D_wg4iJi.mjs";
8
8
  import path from "node:path";
9
9
  import { mkdirSync } from "node:fs";
10
10
  import { homedir } from "node:os";
@@ -1,6 +1,6 @@
1
- import { Gr as placeFor, R as openStore, Wr as placeFiles, Xr as inside, qr as runDirOf, z as storePath } from "./src-8cOPOgrT.mjs";
2
- import { a as isBuiltinArg, n as builtinWorkflowFile, t as builtinProblem } from "./builtin-files-Cf-NZDqM.mjs";
3
- import { l as writeErr } from "./output-B1kwo0YU.mjs";
1
+ import { Kr as placeFiles, Qr as inside, R as openStore, Yr as runDirOf, qr as placeFor, z as storePath } from "./src-BuF9Lbow.mjs";
2
+ import { a as isBuiltinArg, n as builtinWorkflowFile, t as builtinProblem } from "./builtin-files-YYAnbZGD.mjs";
3
+ import { l as writeErr } from "./output-DXZbnFt_.mjs";
4
4
  import path from "node:path";
5
5
  import { existsSync, readFileSync, readdirSync, statSync } from "node:fs";
6
6
  // src/project/place.ts
@@ -1,10 +1,10 @@
1
- import { $t as planClean, Qt as keyOf, R as openStore, Xt as applyClean, Yt as worktreeListTable, a as planRemove, c as repoRoot, d as mergeStateOf, en as stepActs, f as planLine, i as lostWork, l as isDetached, m as stateParts, nn as inspectProject, r as applyRemove, s as readWorktrees, u as labelOf } from "./src-8cOPOgrT.mjs";
1
+ import { $t as planClean, Qt as keyOf, R as openStore, Xt as applyClean, Yt as worktreeListTable, a as planRemove, c as repoRoot, d as mergeStateOf, en as stepActs, f as planLine, i as lostWork, l as isDetached, m as stateParts, nn as inspectProject, r as applyRemove, s as readWorktrees, u as labelOf } from "./src-BuF9Lbow.mjs";
2
2
  import { t as applyFilters } from "./apply-Mb0fNpCX.mjs";
3
- import { C as termOf, c as write, h as paint, l as writeErr, s as style, t as confirm, w as cut } from "./output-B1kwo0YU.mjs";
4
- import { n as chip } from "./chips-BqcT58qr.mjs";
5
- import { c as refuseUnknownFlags, i as readListArgs, n as filterArgs, o as resolveRun, r as projectScope } from "./flags-C8yCq0j5.mjs";
6
- import { t as printList } from "./print-DNYzq4Rr.mjs";
7
- import { r as withStore } from "./project-records-XY3ku95x.mjs";
3
+ import { c as write, k as paint, l as writeErr, s as style, t as confirm, v as termOf, y as cut } from "./output-DXZbnFt_.mjs";
4
+ import { r as chip } from "./chips-CP_pgKlj.mjs";
5
+ import { c as refuseUnknownFlags, i as readListArgs, n as filterArgs, o as resolveRun, r as projectScope } from "./flags-C90N4J1i.mjs";
6
+ import { t as printList } from "./print-DzugGZQB.mjs";
7
+ import { r as withStore } from "./project-records-CtkmlsHN.mjs";
8
8
  import path from "node:path";
9
9
  import { existsSync, realpathSync } from "node:fs";
10
10
  import { defineCommand } from "citty";
@@ -0,0 +1,33 @@
1
+ import { l as writeErr, s as style, t as confirm } from "./output-DXZbnFt_.mjs";
2
+ // src/run/yolo.ts
3
+ /**
4
+ * @file `--yolo` on `ork run` and `ork resume` (specs/cli/running-and-runs.md):
5
+ * the warning, then a y/N on the terminal, No by default. With `--yes` it is
6
+ * agreed to without the question; with no terminal only `--yes` agrees, as
7
+ * nobody is there to answer. A detached start asks before it detaches, and
8
+ * hands its copy `--yes`, as a yolo run does to the runs it calls.
9
+ */
10
+ const YOLO_WARNING = [
11
+ "Yolo: every tool call this run's agents make runs without asking you,",
12
+ "except what a node's deny list refuses. Agents can edit, delete and run",
13
+ "anything your user can. Questions, gates and budgets still stop the run."
14
+ ].join("\n");
15
+ const YOLO_NEEDS_YES = "--yolo needs a yes: run it on a terminal, or add --yes.";
16
+ /**
17
+ * Whether the run may start yolo: prints the warning, then takes `--yes` or the
18
+ * person's answer. False means nothing starts; the caller exits 1.
19
+ */
20
+ const agreedToYolo = async (o) => {
21
+ if (!o.yes && !o.terminal) {
22
+ writeErr(YOLO_NEEDS_YES);
23
+ return false;
24
+ }
25
+ writeErr(style("yellow", YOLO_WARNING));
26
+ if (o.yes) return true;
27
+ const yes = await (o.ask ?? confirm)("Run with no permission prompts?");
28
+ if (!yes) writeErr("Not started.");
29
+ return yes;
30
+ };
31
+ /** `rawArgs` for a detached copy of an agreed yolo start: with `--yes`. */
32
+ const withYes = (rawArgs) => rawArgs.includes("--yes") || rawArgs.includes("-y") ? [...rawArgs] : [...rawArgs, "--yes"];
33
+ export { YOLO_NEEDS_YES, YOLO_WARNING, agreedToYolo, withYes };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@krapht/ork",
3
- "version": "1.0.0-alpha.20",
3
+ "version": "1.0.0-alpha.21",
4
4
  "description": "Orchestrate coding agents (Claude Code, OpenCode, Command Code) on your machine: hierarchical, serializable workflows with a CLI and a localhost UI.",
5
5
  "keywords": [
6
6
  "agents",