@krapht/ork 1.0.0-alpha.16 → 1.0.0-alpha.17

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 (46) hide show
  1. package/dist/{__build_info__-DcRdK0Du.mjs → __build_info__-C1Nm0hlJ.mjs} +2 -2
  2. package/dist/{attach-7lB5_jpr.mjs → attach-EP374oMP.mjs} +5 -5
  3. package/dist/{attach-B-FeE1dJ.mjs → attach-RQx__RzH.mjs} +1 -1
  4. package/dist/bin.mjs +35 -35
  5. package/dist/brief-Bs3cMQU0.mjs +100 -0
  6. package/dist/{builtin-files-BRSOObAv.mjs → builtin-files-yYaNTQRU.mjs} +1 -1
  7. package/dist/{completion-Cgb2qPPh.mjs → completion-DIXWlnAl.mjs} +46 -4
  8. package/dist/{context-BN9A2Nnu.mjs → context-Dq-VM_sq.mjs} +3 -3
  9. package/dist/{find-mLYsR0uC.mjs → find-k489laBa.mjs} +1 -1
  10. package/dist/{flags-CdgIH1L6.mjs → flags-B4ZZWspN.mjs} +3 -108
  11. package/dist/{follow-ups-DxCsOby1.mjs → follow-ups-DD8NTPe6.mjs} +8 -8
  12. package/dist/{format-hiDvtNGM.mjs → format-DQc9A_ei.mjs} +1 -1
  13. package/dist/in-a-run-D_9GlAlS.mjs +27 -0
  14. package/dist/{install-23g_1ngs.mjs → install-PVlV2QPq.mjs} +1 -1
  15. package/dist/{limits-C_Xz_t3C.mjs → limits-CHqBO7wb.mjs} +1 -1
  16. package/dist/{mcp-CWng9I9n.mjs → mcp-D38Ajb0b.mjs} +6 -6
  17. package/dist/{once-lvwcWfVf.mjs → once-DuUzpzL2.mjs} +3 -3
  18. package/dist/parse-BzWpMN-a.mjs +107 -0
  19. package/dist/{pause-Cy11KrXK.mjs → pause-Bx3ePGrn.mjs} +3 -3
  20. package/dist/{post-C9soCx7i.mjs → post-2CaJz_mV.mjs} +2 -2
  21. package/dist/{print-BaWiWf4v.mjs → print-n2qetUHc.mjs} +1 -1
  22. package/dist/{project-records-BRiyQzUo.mjs → project-records-Cune1l6I.mjs} +1 -1
  23. package/dist/{relay-C0M1TWMB.mjs → relay-D7RN4m68.mjs} +1 -1
  24. package/dist/{run-D_u9V_Ve.mjs → run-BfxdsQJk.mjs} +1 -1
  25. package/dist/{run-B-j3Qxqc.mjs → run-OOWQIKMJ.mjs} +17 -17
  26. package/dist/{send-qBxj0JbJ.mjs → send-CKth_vgn.mjs} +2 -2
  27. package/dist/{src-CXBmaGwS.mjs → src-BHod38UQ.mjs} +12 -1
  28. package/dist/{src-DN-RPsil.mjs → src-DLsFsmOD.mjs} +10 -1
  29. package/dist/{src-nXLIwDrt.mjs → src-DOjTY2ET.mjs} +235 -73
  30. package/dist/{src-DHDQ0itC.mjs → src-DmmrX2_C.mjs} +73 -18
  31. package/dist/{store-Dyr1mP8K.mjs → store-DACH768X.mjs} +1 -1
  32. package/dist/ui/assets/app-9Q-62Ywz.css +1 -0
  33. package/dist/ui/assets/app-CN3acQ-1.js +111 -0
  34. package/dist/ui/assets/{index-CVzwYlz3.js → index-B2uGxA4W.js} +2 -2
  35. package/dist/ui/index.html +1 -1
  36. package/dist/{ui-DLrSt5ny.mjs → ui-CJ-BX12n.mjs} +3 -3
  37. package/dist/{usage-CxmpYYO4.mjs → usage-DxZ6JGd4.mjs} +5 -4
  38. package/dist/{validate-BVrT43GO.mjs → validate-BS0nCccW.mjs} +3 -3
  39. package/dist/{watch-mkLm4t9D.mjs → watch-Dp7IB4FR.mjs} +5 -5
  40. package/dist/{workflows-Bvl2Fquu.mjs → workflows-Djo1edlK.mjs} +2 -2
  41. package/dist/{worktrees-DOOCoS2w.mjs → worktrees-Drof_Nyx.mjs} +4 -4
  42. package/package.json +1 -1
  43. package/dist/brief-BvMtIFio.mjs +0 -58
  44. package/dist/in-a-run-a447hxq8.mjs +0 -24
  45. package/dist/ui/assets/app-BPSCxb_l.css +0 -1
  46. package/dist/ui/assets/app-CnNRowFn.js +0 -111
@@ -1,4 +1,4 @@
1
- import { C as compareVersions, T as parseVersion, w as isNewer } from "./src-DN-RPsil.mjs";
1
+ import { C as compareVersions, T as parseVersion, w as isNewer } from "./src-DLsFsmOD.mjs";
2
2
  import path from "node:path";
3
3
  import { mkdirSync, readFileSync, renameSync, writeFileSync } from "node:fs";
4
4
  import { homedir } from "node:os";
@@ -355,5 +355,5 @@ const registryShown = (registry) => {
355
355
  * fails when it is stale.
356
356
  */
357
357
  const ORK_NAME = "@krapht/ork";
358
- const ORK_VERSION = "1.0.0-alpha.16";
358
+ const ORK_VERSION = "1.0.0-alpha.17";
359
359
  export { dueCause as _, registryShown as a, githubDraftRefusal as b, fetchLatest as c, readUpdateCache as d, refreshUpdateCache as f, changeFollowUp as g, nodeSession as h, registryOf as i, newerVersion as l, writeUpdateCache as m, ORK_VERSION as n, updateSwitchOff as o, updateCachePath as p, isSwitchedOn as r, checkDue as s, ORK_NAME as t, pendingNotice as u, findFollowUp as v, isGithubIssueUrl as x, followUpActions as y };
@@ -1,9 +1,9 @@
1
- import "./src-DN-RPsil.mjs";
2
- import { l as createTerminalHuman, t as attachRun } from "./attach-B-FeE1dJ.mjs";
3
- import { t as findRun } from "./find-mLYsR0uC.mjs";
1
+ import "./src-DLsFsmOD.mjs";
2
+ import { l as createTerminalHuman, t as attachRun } from "./attach-RQx__RzH.mjs";
3
+ import { t as findRun } from "./find-k489laBa.mjs";
4
4
  import { c as write, l as writeErr, s as style } from "./output-B1kwo0YU.mjs";
5
- import { n as attachRefusal } from "./in-a-run-a447hxq8.mjs";
6
- import { t as withStore } from "./store-Dyr1mP8K.mjs";
5
+ import { n as attachRefusal } from "./in-a-run-D_9GlAlS.mjs";
6
+ import { t as withStore } from "./store-DACH768X.mjs";
7
7
  import { defineCommand } from "citty";
8
8
  // src/commands/attach.ts
9
9
  /**
@@ -1,4 +1,4 @@
1
- import { Ft as slotWaitLine, Gn as endOf, I as isNodeEvent, Jn as END_KINDS, Kn as outcomeEnd, kt as lockWaitLine, nt as answerDecision, rt as pendingDecisions, tt as followRunTree, ut as followEvents, vr as maskSecrets } from "./src-DN-RPsil.mjs";
1
+ import { Ft as slotWaitLine, I as isNodeEvent, Kn as endOf, Yn as END_KINDS, kt as lockWaitLine, nt as answerDecision, qn as outcomeEnd, rt as pendingDecisions, tt as followRunTree, ut as followEvents, yr as maskSecrets } from "./src-DLsFsmOD.mjs";
2
2
  import { t as applyFilters } from "./apply-Mb0fNpCX.mjs";
3
3
  import { C as termOf, D as wrap, E as widthOf, O as readKeys, _ as interrupt, a as plain, b as canKey, g as createRegion, h as paint, m as bold, n as cost, p as apply, r as costOf, s as style, u as confirmOrStop, v as readLine, w as cut, x as plainEnv, y as withdrawn } from "./output-B1kwo0YU.mjs";
4
4
  import { n as chip, r as nodeChip, t as CHIP_LABELS } from "./chips-BqcT58qr.mjs";
package/dist/bin.mjs CHANGED
@@ -1,25 +1,25 @@
1
1
  #!/usr/bin/env node
2
- import { Bn as PROJECT_FILE, Bt as feedbackListTable, Ci as ORK_LAYOUT, Cr as toolLinks, Dn as requestStop, Dr as AGENT_SOURCES, Er as deleteAgent, F as activeTree, Gt as applyClean, H as listOrkWorktrees, Hn as loadProject, Ht as runListTable, Jt as planClean, L as openStore, Lr as shownPath, Mn as runStatus, Nr as placeFiles, On as tellLiveRun, Or as catalogAgent, Pr as placeFor, Qn as FEEDBACK_TARGETS, Rn as nestItems, Si as AGENT_TOOL_LAYOUTS, Sr as linkTools, Ti as DRIVER_IDS, Tr as createAgent, V as createdWorktrees, Xn as FEEDBACK_KINDS, Zn as FEEDBACK_SEVERITIES, Zr as renameNodeTypes, ai as WorkflowSchema, b as runningRunIds, bi as driverChecks, br as applySteps, ci as settingsOf, en as clearGitLocalEnv, er as planPost, jr as inRepoPlace, kn as liveStatus, kr as loadAgents, ni as serializeWorkflow, nn as modelDriver, nr as sendPost, nt as answerDecision, ot as detachResume, rt as pendingDecisions, sr as normalizeTitle, st as resumable, ti as parseWorkflow, v as planUpgrade, w as isNewer, wr as toolsInUse, x as runningScript, xi as readyDriver, xr as planMoveInto, y as releaseNotes, yr as planAgentMigration, zt as decisionListTable } from "./src-DN-RPsil.mjs";
3
- import { a as unknownNode, i as logListTable, l as createTerminalHuman, n as askStored, r as followRun, u as readText } from "./attach-B-FeE1dJ.mjs";
4
- import { a as onInterrupt, c as runWorkflowFile, g as machineSlotLedger, h as sweepLocks, i as loadRuntime, m as machineLocksDir, n as flagValues, o as run, p as resumeChat, r as isDriver, s as terminalHuman, t as badDriver } from "./run-B-j3Qxqc.mjs";
5
- import { a as acceptItem, c as feedbackActions, i as recordNote, l as openFixRun, n as previewPost, r as checkNote, s as placeOf, t as runInstall } from "./install-23g_1ngs.mjs";
6
- import { c as fetchLatest, d as readUpdateCache, h as nodeSession, i as registryOf, m as writeUpdateCache, n as ORK_VERSION, p as updateCachePath, t as ORK_NAME } from "./__build_info__-DcRdK0Du.mjs";
2
+ import { $n as FEEDBACK_TARGETS, An as liveStatus, Ar as loadAgents, Bt as decisionListTable, Ci as AGENT_TOOL_LAYOUTS, Cr as linkTools, Dr as deleteAgent, Ei as DRIVER_IDS, Er as createAgent, F as activeTree, Fr as placeFor, H as listOrkWorktrees, Kt as applyClean, L as openStore, Mr as inRepoPlace, Nn as runStatus, On as requestStop, Or as AGENT_SOURCES, Pr as placeFiles, Qn as FEEDBACK_SEVERITIES, Qr as renameNodeTypes, Rr as shownPath, Si as readyDriver, Sr as planMoveInto, Tr as toolsInUse, Un as loadProject, Ut as runListTable, V as createdWorktrees, Vn as PROJECT_FILE, Vt as feedbackListTable, Yt as planClean, Zn as FEEDBACK_KINDS, b as runningRunIds, br as planAgentMigration, cr as normalizeTitle, kn as tellLiveRun, kr as catalogAgent, li as settingsOf, ni as parseWorkflow, nt as answerDecision, oi as WorkflowSchema, ot as detachResume, ri as serializeWorkflow, rn as modelDriver, rr as sendPost, rt as pendingDecisions, st as resumable, tn as clearGitLocalEnv, tr as planPost, v as planUpgrade, w as isNewer, wi as ORK_LAYOUT, wr as toolLinks, x as runningScript, xi as driverChecks, xr as applySteps, y as releaseNotes, zn as nestItems } from "./src-DLsFsmOD.mjs";
3
+ import { a as unknownNode, i as logListTable, l as createTerminalHuman, n as askStored, r as followRun, u as readText } from "./attach-RQx__RzH.mjs";
4
+ import { a as onInterrupt, c as runWorkflowFile, g as machineSlotLedger, h as sweepLocks, i as loadRuntime, m as machineLocksDir, n as flagValues, o as run, p as resumeChat, r as isDriver, s as terminalHuman, t as badDriver } from "./run-OOWQIKMJ.mjs";
5
+ import { a as acceptItem, c as feedbackActions, i as recordNote, l as openFixRun, n as previewPost, r as checkNote, s as placeOf, t as runInstall } from "./install-PVlV2QPq.mjs";
6
+ import { c as fetchLatest, d as readUpdateCache, h as nodeSession, i as registryOf, m as writeUpdateCache, n as ORK_VERSION, p as updateCachePath, t as ORK_NAME } from "./__build_info__-C1Nm0hlJ.mjs";
7
7
  import { t as applyFilters } from "./apply-Mb0fNpCX.mjs";
8
- import { i as readListArgs, n as filterArgs, o as allAlias, r as projectScope, t as fail$1 } from "./flags-CdgIH1L6.mjs";
9
- import { n as builtinWorkflowFile, t as builtinProblem } from "./builtin-files-BRSOObAv.mjs";
10
- import { t as findRun } from "./find-mLYsR0uC.mjs";
8
+ import { n as builtinWorkflowFile, t as builtinProblem } from "./builtin-files-yYaNTQRU.mjs";
9
+ import { t as findRun } from "./find-k489laBa.mjs";
11
10
  import { n as groupedEntries, t as groupOf } from "./help-groups-hB6kY34d.mjs";
12
11
  import { a as publicArgs, o as resolved, r as argsOf, s as subcommandsOf } from "./command-tree-BkSYWmYJ.mjs";
13
12
  import { C as termOf, D as wrap, E as widthOf, S as takePlainFlag, T as hang, a as plain, b as canKey, c as write, h as paint, l as writeErr, m as bold, s as style, t as confirm, w as cut } from "./output-B1kwo0YU.mjs";
14
13
  import { n as chip, r as nodeChip, t as CHIP_LABELS } from "./chips-BqcT58qr.mjs";
15
- import { c as registeredProjects, n as WORKFLOW_SUFFIX, s as projectAt, t as WORKFLOW_DIR } from "./workflows-Bvl2Fquu.mjs";
16
- import { C as startUpdateCheck, S as showUpdateNotice, _ as runChecks, a as formatReport, c as checksHere, g as orkCheck, h as headWarning, m as experimentsCheck, n as validate, p as exec, r as validateFile, v as socketCheck, w as updateCheckOff, x as runUpdateChild, y as triggerChecks } from "./validate-BVrT43GO.mjs";
17
- import { a as decideRefusal, r as chatRefusal } from "./in-a-run-a447hxq8.mjs";
18
- import { t as context } from "./context-BN9A2Nnu.mjs";
19
- import { t as printList } from "./print-BaWiWf4v.mjs";
20
- import { a as formatRegistered, i as formatProjects, n as move, o as recordInRepo, r as withStore, s as registerProject, t as forget } from "./project-records-BRiyQzUo.mjs";
21
- import { i as listedStatus, n as formatRuns, r as formatTreeView, t as ago } from "./format-hiDvtNGM.mjs";
22
- import { t as withStore$1 } from "./store-Dyr1mP8K.mjs";
14
+ import { c as registeredProjects, n as WORKFLOW_SUFFIX, s as projectAt, t as WORKFLOW_DIR } from "./workflows-Djo1edlK.mjs";
15
+ import { C as startUpdateCheck, S as showUpdateNotice, _ as runChecks, a as formatReport, c as checksHere, g as orkCheck, h as headWarning, m as experimentsCheck, n as validate, p as exec, r as validateFile, v as socketCheck, w as updateCheckOff, x as runUpdateChild, y as triggerChecks } from "./validate-BS0nCccW.mjs";
16
+ import { a as decideRefusal, r as chatRefusal } from "./in-a-run-D_9GlAlS.mjs";
17
+ import { t as context } from "./context-Dq-VM_sq.mjs";
18
+ import { i as readListArgs, n as filterArgs, o as allAlias, r as projectScope, t as fail$1 } from "./flags-B4ZZWspN.mjs";
19
+ import { t as printList } from "./print-n2qetUHc.mjs";
20
+ import { a as formatRegistered, i as formatProjects, n as move, o as recordInRepo, r as withStore, s as registerProject, t as forget } from "./project-records-Cune1l6I.mjs";
21
+ import { i as listedStatus, n as formatRuns, r as formatTreeView, t as ago } from "./format-DQc9A_ei.mjs";
22
+ import { t as withStore$1 } from "./store-DACH768X.mjs";
23
23
  import path from "node:path";
24
24
  import { stringify } from "yaml";
25
25
  import { z } from "zod";
@@ -727,7 +727,7 @@ const formatCheck = (result, term = termOf(process.stdout)) => {
727
727
  * folder. Says nothing when there were none. `bin` is the `cmd` program.
728
728
  */
729
729
  const leaseChecks = async (place, env = process.env, bin = "cmd") => {
730
- const { cleanStaleLeases, leaseLedger } = await import("./src-CXBmaGwS.mjs");
730
+ const { cleanStaleLeases, leaseLedger } = await import("./src-BHod38UQ.mjs");
731
731
  const { cleaned, failed } = await cleanStaleLeases({
732
732
  bin,
733
733
  ledger: leaseLedger(placeFiles(place).runs),
@@ -2992,31 +2992,31 @@ const main = defineCommand({
2992
2992
  run,
2993
2993
  ps,
2994
2994
  logs,
2995
- attach: () => import("./attach-7lB5_jpr.mjs").then((module) => module.attach),
2995
+ attach: () => import("./attach-EP374oMP.mjs").then((module) => module.attach),
2996
2996
  tree,
2997
- usage: () => import("./usage-CxmpYYO4.mjs").then((module) => module.usage),
2998
- prune: () => import("./usage-CxmpYYO4.mjs").then((module) => module.prune),
2997
+ usage: () => import("./usage-DxZ6JGd4.mjs").then((module) => module.usage),
2998
+ prune: () => import("./usage-DxZ6JGd4.mjs").then((module) => module.prune),
2999
2999
  decide,
3000
- relay: () => import("./relay-C0M1TWMB.mjs").then((module) => module.relay),
3001
- pause: () => import("./pause-Cy11KrXK.mjs").then((module) => module.pause),
3002
- continue: () => import("./pause-Cy11KrXK.mjs").then((module) => module.continueRun),
3000
+ relay: () => import("./relay-D7RN4m68.mjs").then((module) => module.relay),
3001
+ pause: () => import("./pause-Bx3ePGrn.mjs").then((module) => module.pause),
3002
+ continue: () => import("./pause-Bx3ePGrn.mjs").then((module) => module.continueRun),
3003
3003
  stop,
3004
3004
  chat,
3005
- once: () => import("./once-lvwcWfVf.mjs").then((module) => module.once),
3006
- send: () => import("./send-qBxj0JbJ.mjs").then((module) => module.send),
3005
+ once: () => import("./once-DuUzpzL2.mjs").then((module) => module.once),
3006
+ send: () => import("./send-CKth_vgn.mjs").then((module) => module.send),
3007
3007
  resume,
3008
3008
  feedback,
3009
- "follow-ups": () => import("./follow-ups-DxCsOby1.mjs").then((module) => module.followUps),
3009
+ "follow-ups": () => import("./follow-ups-DD8NTPe6.mjs").then((module) => module.followUps),
3010
3010
  context,
3011
- worktrees: () => import("./worktrees-DOOCoS2w.mjs").then((module) => module.worktrees),
3012
- wt: () => import("./worktrees-DOOCoS2w.mjs").then((module) => module.worktrees),
3013
- watch: () => import("./watch-mkLm4t9D.mjs").then((module) => module.watch),
3014
- mcp: () => import("./mcp-CWng9I9n.mjs").then((module) => module.mcp),
3015
- ui: () => import("./ui-DLrSt5ny.mjs").then((module) => module.ui),
3011
+ worktrees: () => import("./worktrees-Drof_Nyx.mjs").then((module) => module.worktrees),
3012
+ wt: () => import("./worktrees-Drof_Nyx.mjs").then((module) => module.worktrees),
3013
+ watch: () => import("./watch-Dp7IB4FR.mjs").then((module) => module.watch),
3014
+ mcp: () => import("./mcp-D38Ajb0b.mjs").then((module) => module.mcp),
3015
+ ui: () => import("./ui-CJ-BX12n.mjs").then((module) => module.ui),
3016
3016
  doctor,
3017
3017
  upgrade,
3018
- completion: () => import("./completion-Cgb2qPPh.mjs").then((module) => module.completion),
3019
- __complete: () => import("./completion-Cgb2qPPh.mjs").then((module) => module.completeCommand(main))
3018
+ completion: () => import("./completion-DIXWlnAl.mjs").then((module) => module.completion),
3019
+ __complete: () => import("./completion-DIXWlnAl.mjs").then((module) => module.completeCommand(main))
3020
3020
  }
3021
3021
  });
3022
3022
  // src/bin.ts
@@ -3036,7 +3036,7 @@ const main = defineCommand({
3036
3036
  clearGitLocalEnv();
3037
3037
  const argv = takePlainFlag(process.argv.slice(2));
3038
3038
  if (argv[0] === "__complete") {
3039
- const { printCompletions } = await import("./completion-Cgb2qPPh.mjs");
3039
+ const { printCompletions } = await import("./completion-DIXWlnAl.mjs");
3040
3040
  await printCompletions(main, argv.slice(1));
3041
3041
  } else if (process.env["ORK_UPDATE_CHECK_CHILD"] === "1") await runUpdateChild();
3042
3042
  else {
@@ -3049,7 +3049,7 @@ else {
3049
3049
  const dash = argv.indexOf("--");
3050
3050
  const askedHelp = argv.slice(1, dash === -1 ? 0 : dash).some((arg) => arg === "--help" || arg === "-h");
3051
3051
  if (argv[0] === "once" && dash !== -1 && !askedHelp) try {
3052
- const { once } = await import("./once-lvwcWfVf.mjs");
3052
+ const { once } = await import("./once-DuUzpzL2.mjs");
3053
3053
  await runCommand(once, { rawArgs: argv.slice(1) });
3054
3054
  } catch (error) {
3055
3055
  console.error(error);
@@ -0,0 +1,100 @@
1
+ import { _n as takeFollowUps, nr as runGh } from "./src-DLsFsmOD.mjs";
2
+ import { f as refreshDue, l as briefOf, n as flagValues, u as checkTakeable } from "./run-OOWQIKMJ.mjs";
3
+ import { n as newRunId } from "./find-k489laBa.mjs";
4
+ import { l as writeErr } from "./output-B1kwo0YU.mjs";
5
+ import { t as loadWorkflow } from "./validate-BS0nCccW.mjs";
6
+ // src/follow-ups/brief.ts
7
+ /**
8
+ * @file `ork run --follow-ups <ids>`: the `agent` follow-ups become the run's
9
+ * `brief` input, and are marked taken by the run, which finishes them when it
10
+ * publishes (`ork follow-ups published`). Everything that could refuse them
11
+ * (an unknown id, one for someone else, a workflow with no `brief` input) is
12
+ * checked before any is marked, so a run that doesn't start leaves them be.
13
+ */
14
+ const FLAG = "--follow-ups";
15
+ /** What `--follow-ups` takes besides ids: every due agent follow-up. */
16
+ const DUE = "due";
17
+ /**
18
+ * Each `--follow-ups` value as typed (one per use, still comma-joined), and
19
+ * whether one is missing: no value, an empty one, or a next argument that is
20
+ * another flag.
21
+ */
22
+ const given = (rawArgs) => {
23
+ const values = [];
24
+ let empty = false;
25
+ for (const [index, arg] of rawArgs.entries()) {
26
+ if (arg !== FLAG && !arg.startsWith(`${FLAG}=`)) continue;
27
+ const next = rawArgs[index + 1];
28
+ const parts = (arg === FLAG ? next === void 0 || next.startsWith("--") ? "" : next : arg.slice(13)).split(",").map((part) => part.trim()).filter((part) => part !== "");
29
+ if (parts.length === 0) empty = true;
30
+ values.push(...parts);
31
+ }
32
+ return {
33
+ values,
34
+ empty
35
+ };
36
+ };
37
+ /**
38
+ * Says what `--follow-ups` needs when it is given with nothing after it, and
39
+ * fails the command; true when it is fine (or not given).
40
+ */
41
+ const followUpsFlagFine = (rawArgs) => {
42
+ if (!given(rawArgs).empty) return true;
43
+ writeErr(`${FLAG} needs follow-up ids, or \`${DUE}\` for every due agent follow-up. \`ork follow-ups list\` shows them.`);
44
+ process.exitCode = 1;
45
+ return false;
46
+ };
47
+ /**
48
+ * What stops `--follow-ups` from starting a run, one line each; none when
49
+ * nothing does.
50
+ */
51
+ const problemsOf = (loaded, inputs) => {
52
+ const name = loaded.workflow?.name ?? "";
53
+ if (loaded.workflow?.inputs?.["brief"] === void 0) return [`--follow-ups fills a workflow's \`brief\` input, and ${name} has none.`];
54
+ return inputs.some((input) => input.startsWith("brief=")) ? ["--follow-ups and --input brief=… both set the brief."] : [];
55
+ };
56
+ /**
57
+ * The inputs and run id `ork run` starts with: those it was given and, for
58
+ * `--follow-ups`, a `brief` made of the follow-ups with the id of the run that
59
+ * takes them. `undefined` after saying why it can't start.
60
+ */
61
+ const prepareFollowUps = async (store, rawArgs, runId, target, gh = runGh) => {
62
+ const inputs = flagValues(rawArgs, "--input");
63
+ const plain = {
64
+ inputs,
65
+ ...runId === void 0 ? {} : { runId }
66
+ };
67
+ if (!followUpsFlagFine(rawArgs)) return void 0;
68
+ const { values } = given(rawArgs);
69
+ if (values.length === 0) return plain;
70
+ const loaded = loadWorkflow(target.file, process.cwd(), void 0, store.projects());
71
+ if (loaded.workflow === null) return plain;
72
+ const project = loaded.place.root;
73
+ const named = values.filter((value) => value !== DUE);
74
+ if (values.includes(DUE)) await refreshDue(store, project, writeErr, gh);
75
+ const due = values.includes(DUE) ? store.followUps(project).filter((f) => f.for === "agent" && f.status === "due").map((f) => f.id) : [];
76
+ if (named.length === 0 && due.length === 0) {
77
+ writeErr(`${FLAG} ${DUE}: no agent follow-ups are due. \`ork follow-ups list\` shows them.`);
78
+ process.exitCode = 1;
79
+ return;
80
+ }
81
+ const takeable = checkTakeable(store, project, [...named, ...due]);
82
+ const problems = [...problemsOf(loaded, inputs), ...takeable.ok ? [] : takeable.lines];
83
+ if (!takeable.ok || problems.length > 0) {
84
+ for (const line of problems) writeErr(line);
85
+ process.exitCode = 1;
86
+ return;
87
+ }
88
+ const followUps = [...new Map(takeable.followUps.map((f) => [f.id, f])).values()];
89
+ const taker = runId ?? newRunId(store);
90
+ takeFollowUps(store, {
91
+ project,
92
+ run: taker,
93
+ ids: followUps.map((f) => f.id)
94
+ });
95
+ return {
96
+ inputs: [...inputs, `brief=${briefOf(followUps)}`],
97
+ runId: taker
98
+ };
99
+ };
100
+ export { followUpsFlagFine, prepareFollowUps };
@@ -1,4 +1,4 @@
1
- import { Gr as writePlainFile, Nr as placeFiles, Ur as guardedBase, Wr as plainPathInside } from "./src-DN-RPsil.mjs";
1
+ import { Gr as plainPathInside, Kr as writePlainFile, Pr as placeFiles, Wr as guardedBase } from "./src-DLsFsmOD.mjs";
2
2
  import path from "node:path";
3
3
  import { existsSync, readFileSync } from "node:fs";
4
4
  import { createHash } from "node:crypto";
@@ -1,10 +1,10 @@
1
- import { L as openStore, Nr as placeFiles, Pr as placeFor, R as storePath, kn as liveStatus, pi as NodeIdSchema, rt as pendingDecisions, wi as AGENT_DRIVERS } from "./src-DN-RPsil.mjs";
2
- import { a as isBuiltinArg, i as builtinWorkflowText, r as builtinWorkflowNames } from "./builtin-files-BRSOObAv.mjs";
3
- import { t as findRun } from "./find-mLYsR0uC.mjs";
1
+ import { An as liveStatus, Fr as placeFor, L as openStore, Pr as placeFiles, R as storePath, Ti as AGENT_DRIVERS, mi as NodeIdSchema, rt as pendingDecisions } from "./src-DLsFsmOD.mjs";
2
+ import { a as isBuiltinArg, i as builtinWorkflowText, r as builtinWorkflowNames } from "./builtin-files-yYaNTQRU.mjs";
3
+ import { t as findRun } from "./find-k489laBa.mjs";
4
4
  import { a as SHELL_SCRIPTS, i as SHELLS, n as groupedEntries, r as COMPLETE_COMMAND, t as groupOf } from "./help-groups-hB6kY34d.mjs";
5
5
  import { i as findEntry, n as argInfoOf, s as subcommandsOf } from "./command-tree-BkSYWmYJ.mjs";
6
6
  import { l as writeErr } from "./output-B1kwo0YU.mjs";
7
- import { a as resolveWorkflowArg, n as WORKFLOW_SUFFIX } from "./workflows-Bvl2Fquu.mjs";
7
+ import { a as resolveWorkflowArg, n as WORKFLOW_SUFFIX } from "./workflows-Djo1edlK.mjs";
8
8
  import path from "node:path";
9
9
  import { parse } from "yaml";
10
10
  import { existsSync, readFileSync, readdirSync, statSync } from "node:fs";
@@ -142,6 +142,39 @@ const forCandidates = (store) => [
142
142
  description: p.root
143
143
  }))
144
144
  ];
145
+ /** The longest title a menu shows. */
146
+ const TITLE_LIMIT = 60;
147
+ /** A title as one short line: first line only, cut with an ellipsis. */
148
+ const shortTitle = (title) => {
149
+ const line = (title.split("\n")[0] ?? "").trim();
150
+ return line.length > TITLE_LIMIT ? `${line.slice(0, 59)}…` : line;
151
+ };
152
+ /**
153
+ * What `ork run --follow-ups` takes: `due` (every due agent follow-up), then
154
+ * the project's open agent follow-ups, due before waiting, each described by
155
+ * its title. Closed and other people's follow-ups are left out; an unreadable
156
+ * store gives `due` only.
157
+ */
158
+ const followUpCandidates = (store, place) => {
159
+ const open = (status) => {
160
+ try {
161
+ return (store?.followUps(place.root) ?? []).filter((f) => f.for === "agent" && f.status === status).map((f) => ({
162
+ value: f.id,
163
+ description: shortTitle(f.title)
164
+ }));
165
+ } catch {
166
+ return [];
167
+ }
168
+ };
169
+ return [
170
+ {
171
+ value: "due",
172
+ description: "every due agent follow-up"
173
+ },
174
+ ...open("due"),
175
+ ...open("waiting")
176
+ ];
177
+ };
145
178
  // src/completion/values.ts
146
179
  const withStore = (context, read) => {
147
180
  const store = context.store();
@@ -192,6 +225,14 @@ const forWhom = {
192
225
  group: "for",
193
226
  values: (context) => forCandidates(context.store())
194
227
  };
228
+ /** `ork run --follow-ups`: `due`, then the project's open agent follow-ups. */
229
+ const followUps = {
230
+ group: "follow-ups",
231
+ values: (context) => {
232
+ const store = context.store();
233
+ return followUpCandidates(store, placeOf(context.cwd, store));
234
+ }
235
+ };
195
236
  const drivers = {
196
237
  group: "drivers",
197
238
  values: () => AGENT_DRIVERS.map((driver) => ({
@@ -223,6 +264,7 @@ const VALUE_PROVIDERS = {
223
264
  node: nodes,
224
265
  input: inputs,
225
266
  "decide id": decisions,
267
+ "run follow-ups": followUps,
226
268
  "completion shell": shells,
227
269
  driver: drivers,
228
270
  project: projects,
@@ -1,7 +1,7 @@
1
- import { Vr as LESSON_CAP_TOKENS, gt as explainSession } from "./src-DN-RPsil.mjs";
1
+ import { Hr as LESSON_CAP_TOKENS, gt as explainSession } from "./src-DLsFsmOD.mjs";
2
2
  import { c as write, s as style } from "./output-B1kwo0YU.mjs";
3
- import { i as refusedBuiltin, o as workflowArg } from "./workflows-Bvl2Fquu.mjs";
4
- import { a as formatReport, t as loadWorkflow } from "./validate-BVrT43GO.mjs";
3
+ import { i as refusedBuiltin, o as workflowArg } from "./workflows-Djo1edlK.mjs";
4
+ import { a as formatReport, t as loadWorkflow } from "./validate-BS0nCccW.mjs";
5
5
  import { defineCommand } from "citty";
6
6
  // src/commands/context.ts
7
7
  /**
@@ -1,4 +1,4 @@
1
- import { Pr as placeFor } from "./src-DN-RPsil.mjs";
1
+ import { Fr as placeFor } from "./src-DLsFsmOD.mjs";
2
2
  import { randomUUID } from "node:crypto";
3
3
  // ../core/src/remote/find.ts
4
4
  /**
@@ -1,112 +1,7 @@
1
- import "./src-DN-RPsil.mjs";
1
+ import "./src-DLsFsmOD.mjs";
2
+ import { n as parseLimit, t as parseFilters } from "./parse-BzWpMN-a.mjs";
2
3
  import { t as INTERNAL } from "./command-tree-BkSYWmYJ.mjs";
3
4
  import { l as writeErr } from "./output-B1kwo0YU.mjs";
4
- // ../core/src/list-filters/time.ts
5
- /**
6
- * @file The times every list's `--since` and `--until` take (specs/usage.md,
7
- * RFC-017), and `ork prune --older-than`'s age: an age (`24h`, `30d`, `12w`)
8
- * or a day (`2026-11-01`, in the machine's time zone).
9
- */
10
- const UNITS = {
11
- h: 36e5,
12
- d: 864e5,
13
- w: 6048e5
14
- };
15
- /** `30d`, `12w`, `24h` before `now`, as an ISO time; `null` when it is not one. */
16
- const agoTime = (text, now) => {
17
- const match = /^(\d+)([hdw])$/u.exec(text);
18
- if (match === null) return null;
19
- const [, amount = "0", unit = "d"] = match;
20
- if (Number(amount) === 0) return null;
21
- const date = new Date(now - Number(amount) * (UNITS[unit] ?? 0));
22
- return Number.isNaN(date.getTime()) ? null : date.toISOString();
23
- };
24
- /** A `YYYY-MM-DD` day's start in the machine's time zone, `after` days on. */
25
- const dayTime = (text, after) => {
26
- const match = /^(\d{4})-(\d{2})-(\d{2})$/u.exec(text);
27
- if (match === null) return null;
28
- const [, year = "", month = "", day = ""] = match;
29
- const start = new Date(Number(year), Number(month) - 1, Number(day));
30
- if (start.getMonth() !== Number(month) - 1) return null;
31
- if (start.getDate() !== Number(day)) return null;
32
- start.setDate(start.getDate() + after);
33
- return start.toISOString();
34
- };
35
- /** The start of the day `days` whole days ago, counting today as one. */
36
- const wholeDays = (days, now) => {
37
- const today = new Date(now);
38
- return new Date(today.getFullYear(), today.getMonth(), today.getDate() - (days - 1)).toISOString();
39
- };
40
- /**
41
- * `--since`: an age or the day it starts from. Days and weeks are whole days,
42
- * today among them, as the Usage panel counts them; hours are exact.
43
- */
44
- const sinceTime = (text, now) => {
45
- const ago = agoTime(text, now);
46
- if (ago === null) return dayTime(text, 0);
47
- if (text.endsWith("h")) return ago;
48
- const amount = Number(text.slice(0, -1));
49
- return wholeDays(text.endsWith("w") ? amount * 7 : amount, now);
50
- };
51
- /** `--until`: the last day it includes. */
52
- const untilTime = (text) => dayTime(text, 1);
53
- // ../core/src/list-filters/parse.ts
54
- /**
55
- * @file Reads a list's filter flags against its field table (RFC-017): each
56
- * value checked, times turned into ISO times, and `--limit`.
57
- */
58
- const FOR = /^(agent|me|(project|person):\S+)$/u;
59
- /** The field's value, checked; `null` when the field does not take it. */
60
- const valueOf = (field, text, now) => {
61
- if (text === "all" && field.all === true) return "all";
62
- return {
63
- enum: () => field.values?.includes(text) === true ? text : null,
64
- text: () => text === "" ? null : text,
65
- for: () => FOR.test(text) ? text : null,
66
- since: () => sinceTime(text, now),
67
- until: () => untilTime(text)
68
- }[field.type]();
69
- };
70
- /** What the field takes, for the error that refuses a value. */
71
- const takes = (field) => {
72
- const all = field.all === true ? ["all"] : [];
73
- const or = all.length === 0 ? "" : " or all";
74
- return {
75
- enum: `one of ${[...field.values ?? [], ...all].join(", ")}`,
76
- text: `a value${or}`,
77
- for: "agent, me, project:<name> or person:<name>",
78
- since: `an age (30d), a day (2026-11-01)${or}`,
79
- until: "a day (2026-11-01)"
80
- }[field.type];
81
- };
82
- /**
83
- * The filter `given` (a command's parsed flags, by field name) asks for, each
84
- * value checked against `table`; `now` dates an age. The first value a field
85
- * does not take is refused, naming the flag and what it takes.
86
- */
87
- const parseFilters = (table, given, now) => {
88
- const filter = {};
89
- for (const field of table.fields) {
90
- const text = given[field.name];
91
- if (typeof text !== "string") continue;
92
- const value = valueOf(field, text, now);
93
- if (value === null) return {
94
- ok: false,
95
- error: `--${field.name} takes ${takes(field)}, not \`${text}\`.`
96
- };
97
- filter[field.name] = value;
98
- }
99
- return {
100
- ok: true,
101
- filter
102
- };
103
- };
104
- /** `--limit`: a positive whole number, else `null` (`0`, `-1`, `abc`, `2.5`). */
105
- const parseLimit = (text) => {
106
- if (!/^[1-9]\d*$/u.test(text)) return null;
107
- const limit = Number(text);
108
- return Number.isSafeInteger(limit) ? limit : null;
109
- };
110
5
  // src/list/all-alias.ts
111
6
  /**
112
7
  * @file The deprecated `--all` of `ps`, `usage`, `decide`, `follow-ups list`
@@ -227,4 +122,4 @@ const projectScope = (filter, projects) => {
227
122
  const names = projects.map((p) => p.id);
228
123
  fail(`No registered project \`${key}\`; registered: ${names.length === 0 ? "none" : names.join(", ")}.`);
229
124
  };
230
- export { refuseIdsWithJson as a, readListArgs as i, filterArgs as n, allAlias as o, projectScope as r, agoTime as s, fail as t };
125
+ export { refuseIdsWithJson as a, readListArgs as i, filterArgs as n, allAlias as o, projectScope as r, fail as t };
@@ -1,13 +1,13 @@
1
- import { Pr as placeFor, Vt as followUpListTable, _n as deliverFollowUp, mn as recordPublished, pn as markDue, tr as runGh, vn as followUpProblem } from "./src-DN-RPsil.mjs";
2
- import { d as followUpsRule, f as refreshDue, n as flagValues } from "./run-B-j3Qxqc.mjs";
3
- import { g as changeFollowUp, v as findFollowUp, x as isGithubIssueUrl, y as followUpActions } from "./__build_info__-DcRdK0Du.mjs";
4
- import { t as postFollowUpMessage } from "./post-C9soCx7i.mjs";
1
+ import { Fr as placeFor, Ht as followUpListTable, hn as recordPublished, mn as markDue, nr as runGh, vn as deliverFollowUp, yn as followUpProblem } from "./src-DLsFsmOD.mjs";
2
+ import { d as followUpsRule, f as refreshDue, n as flagValues } from "./run-OOWQIKMJ.mjs";
3
+ import { g as changeFollowUp, v as findFollowUp, x as isGithubIssueUrl, y as followUpActions } from "./__build_info__-C1Nm0hlJ.mjs";
4
+ import { t as postFollowUpMessage } from "./post-2CaJz_mV.mjs";
5
5
  import { t as applyFilters } from "./apply-Mb0fNpCX.mjs";
6
- import { i as readListArgs, n as filterArgs, o as allAlias } from "./flags-CdgIH1L6.mjs";
7
- import { t as findRun } from "./find-mLYsR0uC.mjs";
6
+ import { t as findRun } from "./find-k489laBa.mjs";
8
7
  import { a as plain, c as write, l as writeErr, s as style } from "./output-B1kwo0YU.mjs";
9
- import { t as printList } from "./print-BaWiWf4v.mjs";
10
- import { t as withStore } from "./store-Dyr1mP8K.mjs";
8
+ import { i as readListArgs, n as filterArgs, o as allAlias } from "./flags-B4ZZWspN.mjs";
9
+ import { t as printList } from "./print-n2qetUHc.mjs";
10
+ import { t as withStore } from "./store-DACH768X.mjs";
11
11
  import { homedir } from "node:os";
12
12
  import { defineCommand } from "citty";
13
13
  // src/follow-ups/command.ts
@@ -1,4 +1,4 @@
1
- import { An as lockWaitsOf, Ln as isItem, Mn as runStatus, Nn as slotWaitsOf, kn as liveStatus, kt as lockWaitLine } from "./src-DN-RPsil.mjs";
1
+ import { An as liveStatus, Nn as runStatus, Pn as slotWaitsOf, Rn as isItem, jn as lockWaitsOf, kt as lockWaitLine } from "./src-DLsFsmOD.mjs";
2
2
  import { C as termOf, E as widthOf, n as cost, o as shortCount, r as costOf, s as style, w as cut } from "./output-B1kwo0YU.mjs";
3
3
  import { i as statusChip, n as chip } from "./chips-BqcT58qr.mjs";
4
4
  import { n as nodeVerdict } from "./verdict-CMvPCpWC.mjs";
@@ -0,0 +1,27 @@
1
+ import { R as storePath } from "./src-DLsFsmOD.mjs";
2
+ import { g as storeGuarded, h as runMarkerIn } from "./src-DmmrX2_C.mjs";
3
+ // src/commands/in-a-run.ts
4
+ /**
5
+ * @file The commands that act as the user refuse a program or an agent in a run
6
+ * (ADR-047), in the stores that run guards: the store of a nested run under a
7
+ * temp HOME is not guarded unless an enclosing run lists it. The refusal
8
+ * names the variable it saw, for someone at their own terminal who inherited
9
+ * it. It stops accidents; it is not a boundary.
10
+ */
11
+ const refusal = (why, env, store) => {
12
+ const marker = runMarkerIn(env);
13
+ return marker === null || !storeGuarded(env, store) ? null : `${why} ${marker} is set here. If this is your own terminal, it inherited that from a program in a run (a tmux server started by one, say); open a shell without it.`;
14
+ };
15
+ /** Why `ork watch --accept` refuses here, or `null` when it may run. */
16
+ const acceptRefusal = (env = process.env, store = storePath()) => refusal("`ork watch --accept` approves code to run with nobody there, so a program or an agent in a run cannot use it.", env, store);
17
+ /** Why `ork chat` refuses here, or `null` when it may run. */
18
+ const chatRefusal = (env = process.env, store = storePath()) => refusal("`ork chat` speaks as you, so a program or an agent in a run cannot use it. A program writes to a session with `ork send`.", env, store);
19
+ /** Why `ork decide` will not answer here, or `null` when it may. */
20
+ const decideRefusal = (env = process.env, store = storePath()) => refusal("`ork decide` answers as you, so a program or an agent in a run cannot answer with it; `ork decide --list` still shows what is open.", env, store);
21
+ /** Why `ork continue` refuses here, or `null` when it may run. */
22
+ const continueRefusal = (env = process.env, store = storePath()) => refusal("`ork continue` undoes a pause you set, so a program or an agent in a run cannot use it.", env, store);
23
+ /** Whether `ork ui` may print its sign-in link, which acts as the user. */
24
+ const mayShowSignIn = (env = process.env, store = storePath()) => !storeGuarded(env, store);
25
+ /** Why `ork attach` will not answer here, or `null` when it may. */
26
+ const attachRefusal = (env = process.env, store = storePath()) => refusal("`ork attach` answers as you, so a program or an agent in a run cannot use it; `ork logs` still shows the run.", env, store);
27
+ export { decideRefusal as a, continueRefusal as i, attachRefusal as n, mayShowSignIn as o, chatRefusal as r, acceptRefusal as t };
@@ -1,4 +1,4 @@
1
- import { Gr as writePlainFile, Hr as estimateTokens, Nr as placeFiles, Pr as placeFor, Ur as guardedBase, Vr as LESSON_CAP_TOKENS, Wr as plainPathInside, Xn as FEEDBACK_KINDS, Zn as FEEDBACK_SEVERITIES, cr as targetOf, or as fingerprint, rr as publishPost, vr as maskSecrets, zr as inside } from "./src-DN-RPsil.mjs";
1
+ import { Br as inside, Fr as placeFor, Gr as plainPathInside, Hr as LESSON_CAP_TOKENS, Kr as writePlainFile, Pr as placeFiles, Qn as FEEDBACK_SEVERITIES, Ur as estimateTokens, Wr as guardedBase, Zn as FEEDBACK_KINDS, ir as publishPost, lr as targetOf, sr as fingerprint, yr as maskSecrets } from "./src-DLsFsmOD.mjs";
2
2
  import path from "node:path";
3
3
  import { existsSync, readFileSync, realpathSync } from "node:fs";
4
4
  import { spawn } from "node:child_process";
@@ -1,4 +1,4 @@
1
- import { _ as capsHere, dt as NOT_STARTED, ft as limitsNow, pt as limitsReport } from "./src-DN-RPsil.mjs";
1
+ import { _ as capsHere, dt as NOT_STARTED, ft as limitsNow, pt as limitsReport } from "./src-DLsFsmOD.mjs";
2
2
  // src/run/limits.ts
3
3
  /**
4
4
  * @file The limits across runs that apply here (RFC-007): the user's settings
@@ -1,8 +1,8 @@
1
- import { w as isNewer } from "./src-DN-RPsil.mjs";
2
- import { n as ORK_VERSION } from "./__build_info__-DcRdK0Du.mjs";
3
- import { p as runMarkerIn } from "./src-DHDQ0itC.mjs";
4
- import { n as explainNode } from "./context-BN9A2Nnu.mjs";
5
- import { a as openMcp, c as refused, o as tool, s as answer } from "./src-nXLIwDrt.mjs";
1
+ import { w as isNewer } from "./src-DLsFsmOD.mjs";
2
+ import { n as ORK_VERSION } from "./__build_info__-C1Nm0hlJ.mjs";
3
+ import { h as runMarkerIn } from "./src-DmmrX2_C.mjs";
4
+ import { n as explainNode } from "./context-Dq-VM_sq.mjs";
5
+ import { a as openMcp, c as refused, o as tool, s as answer } from "./src-DOjTY2ET.mjs";
6
6
  import { z } from "zod";
7
7
  import { defineCommand } from "citty";
8
8
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
@@ -43,7 +43,7 @@ const orkMcpServer = (options = {}) => {
43
43
  ...options.script === void 0 ? {} : { script: options.script }
44
44
  });
45
45
  const all = [...opened.tools, explainTool(opened, options.home)];
46
- const tools = options.expects !== void 0 && isNewer(options.expects, "1.0.0-alpha.16") ? tooOld(all, options.expects) : all;
46
+ const tools = options.expects !== void 0 && isNewer(options.expects, "1.0.0-alpha.17") ? tooOld(all, options.expects) : all;
47
47
  const server = new McpServer({
48
48
  name: "ork",
49
49
  version: ORK_VERSION
@@ -1,7 +1,7 @@
1
- import "./src-DN-RPsil.mjs";
2
- import { t as runOnce } from "./run-D_u9V_Ve.mjs";
1
+ import "./src-DLsFsmOD.mjs";
2
+ import { t as runOnce } from "./run-BfxdsQJk.mjs";
3
3
  import { c as write, l as writeErr, s as style } from "./output-B1kwo0YU.mjs";
4
- import { t as ago } from "./format-hiDvtNGM.mjs";
4
+ import { t as ago } from "./format-DQc9A_ei.mjs";
5
5
  import { spawn } from "node:child_process";
6
6
  import { defineCommand, parseArgs } from "citty";
7
7
  // src/commands/once.ts