@krapht/ork 1.0.0-alpha.4 → 1.0.0-alpha.6

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 (36) hide show
  1. package/dist/{__build_info__-1i1IwLg7.mjs → __build_info__-CxH89h1r.mjs} +2 -2
  2. package/dist/bin.mjs +54 -224
  3. package/dist/{clean-B1zPxq6A.mjs → clean-BbrkMQQi.mjs} +1 -1
  4. package/dist/{completion-BY-frez8.mjs → completion-BeS2NCgO.mjs} +5 -5
  5. package/dist/{context-CD5TCD1D.mjs → context-CHV6aTs7.mjs} +3 -3
  6. package/dist/{decide-CBhYcjwI.mjs → decide-Cnt7o3ya.mjs} +3 -3
  7. package/dist/{find-BgZjVKhv.mjs → find-Dy2H5IvT.mjs} +1 -1
  8. package/dist/{format-Creyq4U3.mjs → format-OL0E1AjA.mjs} +223 -17
  9. package/dist/{in-a-run-CsSBQQ2q.mjs → in-a-run-emTc-kZI.mjs} +1 -1
  10. package/dist/{limits-D_HxH0CK.mjs → limits-TxTnWxix.mjs} +1 -1
  11. package/dist/{list-CzzpVEpM.mjs → list-P5CfcoWx.mjs} +1 -1
  12. package/dist/{mcp-DYmQt372.mjs → mcp-qUwFT9yi.mjs} +6 -6
  13. package/dist/{output-CuivUcDa.mjs → output-CjOPL8W0.mjs} +9 -6
  14. package/dist/{pause-W6MzQqg8.mjs → pause-CBSAxtTp.mjs} +4 -4
  15. package/dist/{relay-CsdoZUXJ.mjs → relay-UgK1Cp9a.mjs} +2 -2
  16. package/dist/{remove-DLfDjBdF.mjs → remove-ccycC3vI.mjs} +3 -3
  17. package/dist/{send-Bw2FI_Sv.mjs → send-B39-Xeo7.mjs} +3 -3
  18. package/dist/{src-CrYCkU9J.mjs → src-5-sCA7cY.mjs} +50 -19
  19. package/dist/{src-Bc9yaAiZ.mjs → src-8nec4uoe.mjs} +14 -7
  20. package/dist/{src-BRB5EQyC.mjs → src-DG4dyBqm.mjs} +61 -20
  21. package/dist/{src-CsjumY1t.mjs → src-jyCJE1kd.mjs} +26 -12
  22. package/dist/ui/THIRD_PARTY_LICENSES.txt +594 -0
  23. package/dist/ui/assets/app-C1DAgdU2.js +75 -0
  24. package/dist/ui/assets/app-Dt_tjFj6.css +1 -0
  25. package/dist/ui/assets/{index-UEC5ZLYw.js → index-BZKXPhht.js} +3 -3
  26. package/dist/ui/assets/theme-CdXvqTQ6.js +1 -0
  27. package/dist/ui/index.html +2 -2
  28. package/dist/{ui-wX050aH1.mjs → ui-DmJWLgxL.mjs} +4 -4
  29. package/dist/{usage-C96RDH-G.mjs → usage-Bh1lVioA.mjs} +5 -5
  30. package/dist/{watch-vdRobJil.mjs → watch-C_vcsn_g.mjs} +6 -6
  31. package/dist/{workflows-B28q8zMY.mjs → workflows-lpexsAYt.mjs} +3 -3
  32. package/dist/{worktrees-CKDRkl6b.mjs → worktrees-D4bVVKfY.mjs} +10 -4
  33. package/package.json +1 -1
  34. package/dist/ui/assets/app-BNT0SuIz.css +0 -1
  35. package/dist/ui/assets/app-m9Gfrg_S.js +0 -67
  36. package/dist/ui/assets/theme-3xH5jxKs.js +0 -1
@@ -1,4 +1,4 @@
1
- import { Cn as placeFiles, Fn as writePlainFile, Ht as FEEDBACK_SEVERITIES, Jt as publishPost, Mn as estimateTokens, Nn as guardedBase, Pn as plainPathInside, Qt as targetOf, Vt as FEEDBACK_KINDS, Xt as fingerprint, en as maskSecrets, g as parseVersion, h as isNewer, jn as LESSON_CAP_TOKENS, kn as inside, m as compareVersions, wn as placeFor } from "./src-BRB5EQyC.mjs";
1
+ import { Cn as placeFiles, Fn as writePlainFile, Ht as FEEDBACK_SEVERITIES, Jt as publishPost, Mn as estimateTokens, Nn as guardedBase, Pn as plainPathInside, Qt as targetOf, Vt as FEEDBACK_KINDS, Xt as fingerprint, cn as maskSecrets, g as parseVersion, h as isNewer, jn as LESSON_CAP_TOKENS, kn as inside, m as compareVersions, wn as placeFor } from "./src-DG4dyBqm.mjs";
2
2
  import path from "node:path";
3
3
  import { existsSync, mkdirSync, readFileSync, realpathSync, renameSync, writeFileSync } from "node:fs";
4
4
  import { homedir } from "node:os";
@@ -611,5 +611,5 @@ const registryShown = (registry) => {
611
611
  * fails when it is stale.
612
612
  */
613
613
  const ORK_NAME = "@krapht/ork";
614
- const ORK_VERSION = "1.0.0-alpha.4";
614
+ const ORK_VERSION = "1.0.0-alpha.6";
615
615
  export { feedbackActions as C, placeOf as S, previewPost as _, registryShown as a, acceptItem as b, checkDue as c, pendingNotice as d, readUpdateCache as f, nodeSession as g, writeUpdateCache as h, registryOf as i, fetchLatest as l, updateCachePath as m, ORK_VERSION as n, updateSwitchOff as o, refreshUpdateCache as p, isSwitchedOn as r, runInstall as s, ORK_NAME as t, newerVersion as u, checkNote as v, openFixRun as w, lessonPlaceOf as x, recordNote as y };
package/dist/bin.mjs CHANGED
@@ -1,18 +1,18 @@
1
1
  #!/usr/bin/env node
2
- import { $t as maskReplacer, An as projectRootOf, Cn as placeFiles, D as inspectProject, Dn as shownPath, Dt as userMessageText, En as runDirOf, Ft as PROJECT_FILE, Gt as planPost, H as tellNode, Ht as FEEDBACK_SEVERITIES, I as createCalls, It as gitRulesOf, J as tellLiveRun, Kn as WorkflowSchema, L as addressOf, Lt as loadProject, M as clearGitLocalEnv, N as parseInputPairs, P as resolveInputs, Qn as isClaudeNode, R as endLink, Sn as newProjectId, Tn as projectsHome, Tt as startRun, Un as serializeWorkflow, Ut as FEEDBACK_TARGETS, V as peerOf, Vt as FEEDBACK_KINDS, W as flattenTree, Xt as fingerprint, Yn as settingsOf, Yt as createFeedback, Zn as beforeOf, Zt as normalizeTitle, _ as lateTriggers, _n as catalogAgent, _t as runStatus, an as serveRun, bn as hasInRepoFiles, cn as wakeRun, cr as CLAUDE_DRIVERS, d as runningRunIds, dn as planMoveInto, dr as experimentsOn, dt as namingNoDriver, et as adoptedCalls, f as runningScript, fn as linkTools, fr as knownExperiments, ft as sessionDriver, gn as deleteAgent, h as isNewer, hn as createAgent, ht as liveStatus, i as NOT_STARTED, it as replayLoopAnswers, kn as inside, l as planUpgrade, ln as planAgentMigration, lr as firstLine, mn as toolsInUse, n as resolveBase, nt as resumable, on as socketPath, or as AGENT_TOOL_LAYOUTS, ot as detachRun, pn as toolLinks, q as requestStop, qt as sendPost, rr as INTEGRATIONS, rt as createReplay, sn as socketRoom, sr as ORK_LAYOUT, st as followEvents, t as createWorkspace, tt as detachResume, u as releaseNotes, un as applySteps, ur as EXPERIMENTS, ut as planNodeSession, v as triggersReport, vn as loadAgents, vt as runTree, wn as placeFor, wt as walkSummary, xn as inRepoPlace, z as endLinksOf } from "./src-BRB5EQyC.mjs";
3
- import { C as feedbackActions, S as placeOf, _ as previewPost, b as acceptItem, c as checkDue, d as pendingNotice, f as readUpdateCache, g as nodeSession, h as writeUpdateCache, i as registryOf, l as fetchLatest, m as updateCachePath, n as ORK_VERSION, o as updateSwitchOff, p as refreshUpdateCache, r as isSwitchedOn, s as runInstall, t as ORK_NAME, u as newerVersion$1, v as checkNote, w as openFixRun, y as recordNote } from "./__build_info__-1i1IwLg7.mjs";
4
- import { i as builtinWorkflowFile, n as pendingDecisions, r as builtinProblem, t as answerDecision } from "./decide-CBhYcjwI.mjs";
5
- import { n as newRunId, t as findRun } from "./find-BgZjVKhv.mjs";
6
- import { a as write, c as openStore, i as style, l as storePath, n as cost, o as writeErr, s as nodeOf, t as confirm } from "./output-CuivUcDa.mjs";
7
- import { n as listOrkWorktrees, t as createdWorktrees } from "./list-CzzpVEpM.mjs";
8
- import { a as planClean, t as applyClean } from "./clean-B1zPxq6A.mjs";
2
+ import { An as projectRootOf, Cn as placeFiles, D as inspectProject, Dn as shownPath, Dt as userMessageText, En as runDirOf, Ft as PROJECT_FILE, Gt as planPost, H as tellNode, Ht as FEEDBACK_SEVERITIES, I as createCalls, It as gitRulesOf, J as tellLiveRun, Kn as WorkflowSchema, L as addressOf, Lt as loadProject, M as clearGitLocalEnv, N as parseInputPairs, P as resolveInputs, Qn as isClaudeNode, R as endLink, Sn as newProjectId, Tn as projectsHome, Tt as startRun, Un as serializeWorkflow, Ut as FEEDBACK_TARGETS, V as peerOf, Vt as FEEDBACK_KINDS, W as flattenTree, Xt as fingerprint, Yn as settingsOf, Yt as createFeedback, Zn as beforeOf, Zt as normalizeTitle, _ as lateTriggers, _n as catalogAgent, _t as runStatus, an as socketRoom, bn as hasInRepoFiles, cr as CLAUDE_DRIVERS, d as runningRunIds, dn as planMoveInto, dr as experimentsOn, dt as namingNoDriver, et as adoptedCalls, f as runningScript, fn as linkTools, fr as knownExperiments, ft as sessionDriver, gn as deleteAgent, h as isNewer, hn as createAgent, ht as liveStatus, i as NOT_STARTED, in as socketPath, it as replayLoopAnswers, kn as inside, l as planUpgrade, ln as planAgentMigration, lr as firstLine, mn as toolsInUse, n as resolveBase, nt as resumable, on as wakeRun, or as AGENT_TOOL_LAYOUTS, ot as detachRun, pn as toolLinks, q as requestStop, qt as sendPost, rn as serveRun, rr as INTEGRATIONS, rt as createReplay, sn as maskReplacer, sr as ORK_LAYOUT, st as followEvents, t as createWorkspace, tt as detachResume, u as releaseNotes, un as applySteps, ur as EXPERIMENTS, ut as planNodeSession, v as triggersReport, vn as loadAgents, vt as runTree, wn as placeFor, wt as walkSummary, xn as inRepoPlace, z as endLinksOf } from "./src-DG4dyBqm.mjs";
3
+ import { a as formatRunEvent, i as formatEvent, n as formatRuns, o as createTerminalHuman, r as formatTree, s as createDecisionQueue, t as ago } from "./format-OL0E1AjA.mjs";
4
+ import { C as feedbackActions, S as placeOf, _ as previewPost, b as acceptItem, c as checkDue, d as pendingNotice, f as readUpdateCache, g as nodeSession, h as writeUpdateCache, i as registryOf, l as fetchLatest, m as updateCachePath, n as ORK_VERSION, o as updateSwitchOff, p as refreshUpdateCache, r as isSwitchedOn, s as runInstall, t as ORK_NAME, u as newerVersion$1, v as checkNote, w as openFixRun, y as recordNote } from "./__build_info__-CxH89h1r.mjs";
5
+ import { i as builtinWorkflowFile, n as pendingDecisions, r as builtinProblem, t as answerDecision } from "./decide-Cnt7o3ya.mjs";
6
+ import { n as newRunId, t as findRun } from "./find-Dy2H5IvT.mjs";
7
+ import { a as write, c as openStore, i as style, l as storePath, n as cost, o as writeErr, s as nodeOf, t as confirm } from "./output-CjOPL8W0.mjs";
8
+ import { n as listOrkWorktrees, t as createdWorktrees } from "./list-P5CfcoWx.mjs";
9
+ import { a as planClean, t as applyClean } from "./clean-BbrkMQQi.mjs";
9
10
  import { c as subcommandsOf, i as argsOf, n as groupedEntries, o as publicArgs, s as resolved, t as groupOf } from "./help-groups-BwYoAWsh.mjs";
10
- import { a as formatRunEvent, i as formatEvent, n as formatRuns, o as createTerminalHuman, r as formatTree, t as ago } from "./format-Creyq4U3.mjs";
11
- import { _ as namedMcpEntries, a as builtinExecutors, d as maskedEnv, f as maskedNamesOfRun, g as clearOutputFiles, h as sessionEnv, i as onPath, l as clearStateFiles, m as runScrubber, n as missingProgramMessage, r as missingPrograms, t as envProblems, v as resultOf } from "./src-Bc9yaAiZ.mjs";
12
- import { c as registeredProjects, i as refusedBuiltin, n as WORKFLOW_SUFFIX, o as workflowArg, s as projectAt, t as WORKFLOW_DIR } from "./workflows-B28q8zMY.mjs";
13
- import { a as validate, c as warningLines, i as loadWorkflow, o as validateFile, r as formatReport, s as walkLoaded, t as context } from "./context-CD5TCD1D.mjs";
14
- import { i as runLimits, r as limitsRefusal, t as chatNotice } from "./limits-D_HxH0CK.mjs";
15
- import { i as decideRefusal, n as chatRefusal } from "./in-a-run-CsSBQQ2q.mjs";
11
+ import { _ as namedMcpEntries, a as builtinExecutors, d as maskedEnv, f as maskedNamesOfRun, g as clearOutputFiles, h as sessionEnv, i as onPath, l as clearStateFiles, m as runScrubber, n as missingProgramMessage, r as missingPrograms, t as envProblems, v as resultOf } from "./src-8nec4uoe.mjs";
12
+ import { c as registeredProjects, i as refusedBuiltin, n as WORKFLOW_SUFFIX, o as workflowArg, s as projectAt, t as WORKFLOW_DIR } from "./workflows-lpexsAYt.mjs";
13
+ import { a as validate, c as warningLines, i as loadWorkflow, o as validateFile, r as formatReport, s as walkLoaded, t as context } from "./context-CHV6aTs7.mjs";
14
+ import { i as runLimits, r as limitsRefusal, t as chatNotice } from "./limits-TxTnWxix.mjs";
15
+ import { i as decideRefusal, n as chatRefusal } from "./in-a-run-emTc-kZI.mjs";
16
16
  import path from "node:path";
17
17
  import { stringify } from "yaml";
18
18
  import { z } from "zod";
@@ -53,198 +53,6 @@ const readyDriver = (checks) => {
53
53
  ready: ready.length
54
54
  };
55
55
  };
56
- // ../core/src/control/queue.ts
57
- const PERMISSION_OPTIONS = [{
58
- id: "allow",
59
- label: "Allow"
60
- }, {
61
- id: "deny",
62
- label: "Deny"
63
- }];
64
- const DENIED = "The user did not allow this tool.";
65
- /** The deny message a session gets, with the person's words when given. */
66
- const deniedMessage = (note) => note === void 0 ? DENIED : `${DENIED} They said: ${note}`;
67
- /** At most `max` characters of a tool's input, for the decision's context. */
68
- const inputPreview = (input, max = 400) => {
69
- const json = JSON.stringify(input);
70
- return json.length > max ? `${json.slice(0, max - 1)}…` : json;
71
- };
72
- const createDecisionQueue = (options) => {
73
- const { store, runId, emit } = options;
74
- let count = 0;
75
- /** Opens a decision and settles it with the first answer. */
76
- const decide = (open, local, withdrawn) => {
77
- count += 1;
78
- const id = `${runId}-${String(count)}`;
79
- const record = store.openDecision({
80
- ...open,
81
- id,
82
- runId
83
- });
84
- const event = {
85
- type: "decision.opened",
86
- node: record.node,
87
- decision: id,
88
- kind: record.kind,
89
- question: record.question,
90
- options: record.options
91
- };
92
- if (record.recommended !== void 0) event.recommended = record.recommended;
93
- if (record.owner !== void 0) event.owner = record.owner;
94
- emit(event);
95
- const { promise, resolve, reject } = Promise.withResolvers();
96
- const settled = new AbortController();
97
- /** `note` is the stored one: masked, and absent when blank. */
98
- const finish = (answer, by, note) => {
99
- if (settled.signal.aborted) return;
100
- settled.abort();
101
- const answered = {
102
- type: "decision.answered",
103
- node: open.node,
104
- decision: id,
105
- answer,
106
- by
107
- };
108
- if (note !== void 0) answered.note = note;
109
- emit(answered);
110
- resolve(note === void 0 ? {
111
- answer,
112
- by
113
- } : {
114
- answer,
115
- by,
116
- note
117
- });
118
- };
119
- const withdraw = () => {
120
- if (settled.signal.aborted) return;
121
- settled.abort();
122
- store.withdrawDecision(id);
123
- emit({
124
- type: "decision.withdrawn",
125
- node: open.node,
126
- decision: id
127
- });
128
- reject(/* @__PURE__ */ new Error("the question was withdrawn"));
129
- };
130
- if (withdrawn?.aborted === true) withdraw();
131
- withdrawn?.addEventListener("abort", withdraw, { once: true });
132
- const fromStore = async () => {
133
- try {
134
- const closed = await options.waitFor(id, settled.signal);
135
- if (closed.status === "answered" && closed.answer !== void 0) finish(closed.answer, closed.answeredBy ?? "decide", closed.note);
136
- } catch {}
137
- };
138
- const fromTerminal = async (ask) => {
139
- try {
140
- const { answer, note } = await ask(settled.signal);
141
- if (store.answerDecision(id, answer, "terminal", note)) finish(answer, "terminal", store.decision(id)?.note);
142
- } catch {}
143
- };
144
- fromStore();
145
- if (local !== void 0) fromTerminal(local);
146
- return promise;
147
- };
148
- return {
149
- ask: (question) => {
150
- const open = {
151
- node: question.nodeId,
152
- kind: "question",
153
- question: question.question,
154
- options: question.options
155
- };
156
- if (question.recommended !== void 0) open.recommended = question.recommended;
157
- if (question.context !== void 0) open.context = question.context;
158
- if (question.owner !== void 0) open.owner = question.owner;
159
- const { local } = options;
160
- return decide(open, local === void 0 ? void 0 : (signal) => {
161
- let note;
162
- return local.ask({
163
- ...question,
164
- signal,
165
- onNote: (given) => {
166
- note = given;
167
- }
168
- }).then((answer) => note === void 0 ? { answer } : {
169
- answer,
170
- note
171
- });
172
- }, question.signal).then(({ answer, note }) => {
173
- if (note !== void 0) question.onNote?.(note);
174
- return answer;
175
- });
176
- },
177
- settled: (question) => {
178
- count += 1;
179
- const id = `${runId}-${String(count)}`;
180
- const { owner } = question;
181
- const record = store.openDecision({
182
- id,
183
- runId,
184
- node: question.nodeId,
185
- kind: "question",
186
- question: question.question,
187
- options: question.options,
188
- owner,
189
- ...question.recommended === void 0 ? {} : { recommended: question.recommended },
190
- ...question.context === void 0 ? {} : { context: question.context }
191
- });
192
- emit({
193
- type: "decision.opened",
194
- node: record.node,
195
- decision: id,
196
- kind: "question",
197
- question: record.question,
198
- options: record.options,
199
- owner,
200
- ...record.recommended === void 0 ? {} : { recommended: record.recommended }
201
- });
202
- store.answerDecision(id, question.answer, "owner", question.note);
203
- const note = store.decision(id)?.note;
204
- emit({
205
- type: "decision.answered",
206
- node: record.node,
207
- decision: id,
208
- answer: question.answer,
209
- by: "owner",
210
- owner,
211
- ...note === void 0 ? {} : { note }
212
- });
213
- },
214
- permit: async (request) => {
215
- const { local } = options;
216
- let localMessage = DENIED;
217
- const { answer, note } = await decide({
218
- node: request.nodeId,
219
- kind: "permission",
220
- question: `Allow ${request.toolName}?`,
221
- options: PERMISSION_OPTIONS,
222
- context: inputPreview(request.input)
223
- }, local === void 0 ? void 0 : (signal) => {
224
- let said;
225
- return local.permit({
226
- ...request,
227
- signal,
228
- onNote: (given) => {
229
- said = given;
230
- }
231
- }).then((result) => {
232
- if (!result.allow) localMessage = result.message;
233
- const choice = result.allow ? "allow" : "deny";
234
- return said === void 0 ? { answer: choice } : {
235
- answer: choice,
236
- note: said
237
- };
238
- });
239
- });
240
- if (note !== void 0) request.onNote?.(note);
241
- return answer === "allow" ? { allow: true } : {
242
- allow: false,
243
- message: note === void 0 ? localMessage : deniedMessage(note)
244
- };
245
- }
246
- };
247
- };
248
56
  // ../core/src/control/control.ts
249
57
  const startControl = async (options) => {
250
58
  const { store, runId } = options;
@@ -1722,7 +1530,7 @@ const flagValues = (rawArgs, flag) => {
1722
1530
  };
1723
1531
  const isDriver = (value) => CLAUDE_DRIVERS.some((d) => d.id === value);
1724
1532
  /** Loads the drivers only when a run starts, so other commands stay fast. */
1725
- const loadRuntime = async (driver) => (await import("./src-CrYCkU9J.mjs")).createRuntime(driver, sessionEnv(process.env));
1533
+ const loadRuntime = async (driver) => (await import("./src-5-sCA7cY.mjs")).createRuntime(driver, sessionEnv(process.env));
1726
1534
  /**
1727
1535
  * Ctrl-C asks the run to stop, and so does a terminal closing or a polite kill,
1728
1536
  * so that the run ends tidily and leaves no result unscrubbed.
@@ -2053,7 +1861,8 @@ const chat = defineCommand({
2053
1861
  * writes to the store, then wakes the run on its socket; specs/messaging.md).
2054
1862
  * `--say` gives the answer a note, which goes to the run with it. With `--id`
2055
1863
  * and `--choose`, `--note` and `--rating` instead note how the decision's
2056
- * node went, as the run's feedback (specs/feedback.md).
1864
+ * node went, as the run's feedback (specs/feedback.md). `--document` prints
1865
+ * what a gate gave to read beside its question.
2057
1866
  */
2058
1867
  const failed$2 = (message) => {
2059
1868
  writeErr(message);
@@ -2092,7 +1901,7 @@ const saidLine = (store, id) => {
2092
1901
  return note === void 0 ? "" : style("dim", ` · said: ${note}`);
2093
1902
  };
2094
1903
  /** One line per open decision, for `--list`. */
2095
- const formatDecisions = (decisions) => decisions.length === 0 ? ["No open decisions."] : decisions.map((d) => `${style("bold", d.id)} ${style("cyan", d.node)}${d.owner === void 0 ? "" : style("dim", ` via ${d.owner}`)} ${d.question} ${style("dim", `[${d.options.map((o) => o.id === d.recommended ? `${o.id}*` : o.id).join(", ")}]`)}`);
1904
+ const formatDecisions = (decisions, workflow) => decisions.length === 0 ? [workflow === void 0 ? "No open decisions." : `No open decisions in workflow ${workflow}.`] : decisions.map((d) => `${style("bold", d.id)} ${style("cyan", d.node)}${d.owner === void 0 ? "" : style("dim", ` via ${d.owner}`)} ${d.question} ${d.document === void 0 ? "" : `${style("dim", "+document")} `}${style("dim", `[${d.options.map((o) => o.id === d.recommended ? `${o.id}*` : o.id).join(", ")}]`)}`);
2096
1905
  const decide = defineCommand({
2097
1906
  meta: {
2098
1907
  name: "decide",
@@ -2119,6 +1928,15 @@ const decide = defineCommand({
2119
1928
  description: "List them as JSON",
2120
1929
  default: false
2121
1930
  },
1931
+ workflow: {
1932
+ type: "string",
1933
+ description: "Only the decisions of this workflow's runs"
1934
+ },
1935
+ document: {
1936
+ type: "boolean",
1937
+ description: "Print the document of the decision --id names",
1938
+ default: false
1939
+ },
2122
1940
  id: {
2123
1941
  type: "string",
2124
1942
  description: "Answer this decision…"
@@ -2141,7 +1959,7 @@ const decide = defineCommand({
2141
1959
  }
2142
1960
  },
2143
1961
  run: async ({ args }) => {
2144
- const refusal = args.id !== void 0 || args.choose !== void 0 || process.stdin.isTTY && !args.list && !args.json ? decideRefusal() : null;
1962
+ const refusal = !args.document && (args.id !== void 0 || args.choose !== void 0 || process.stdin.isTTY && !args.list && !args.json) ? decideRefusal() : null;
2145
1963
  if (refusal !== null) {
2146
1964
  failed$2(refusal);
2147
1965
  return;
@@ -2153,6 +1971,16 @@ const decide = defineCommand({
2153
1971
  interactive: process.stdin.isTTY
2154
1972
  });
2155
1973
  try {
1974
+ if (args.document) {
1975
+ if (args.id === void 0 || args.choose !== void 0) {
1976
+ failed$2("--document goes with --id, without --choose.");
1977
+ return;
1978
+ }
1979
+ const { document } = store.decision(args.id) ?? {};
1980
+ if (document === void 0) failed$2(`${args.id} has no document.`);
1981
+ else write(document);
1982
+ return;
1983
+ }
2156
1984
  if (args.id !== void 0 || args.choose !== void 0) {
2157
1985
  if (args.id === void 0 || args.choose === void 0) {
2158
1986
  failed$2("--id and --choose go together.");
@@ -2184,6 +2012,7 @@ const decide = defineCommand({
2184
2012
  return;
2185
2013
  }
2186
2014
  const filter = {};
2015
+ if (args.workflow !== void 0) filter.workflow = args.workflow;
2187
2016
  if (args.run !== void 0 && args.run !== "") {
2188
2017
  const found = findRun(store, args.run, process.cwd());
2189
2018
  if (!found.ok) {
@@ -2198,7 +2027,7 @@ const decide = defineCommand({
2198
2027
  return;
2199
2028
  }
2200
2029
  if (args.list || !process.stdin.isTTY || open.length === 0) {
2201
- for (const line of formatDecisions(open)) write(line);
2030
+ for (const line of formatDecisions(open, args.workflow)) write(line);
2202
2031
  return;
2203
2032
  }
2204
2033
  for (const d of open) {
@@ -2210,6 +2039,7 @@ const decide = defineCommand({
2210
2039
  };
2211
2040
  if (d.recommended !== void 0) question.recommended = d.recommended;
2212
2041
  if (d.context !== void 0) question.context = d.context;
2042
+ if (d.document !== void 0) question.document = d.document;
2213
2043
  let note;
2214
2044
  question.onNote = (given) => {
2215
2045
  note = given;
@@ -4615,27 +4445,27 @@ const main = defineCommand({
4615
4445
  ps,
4616
4446
  logs,
4617
4447
  tree,
4618
- usage: () => import("./usage-C96RDH-G.mjs").then((module) => module.usage),
4619
- prune: () => import("./usage-C96RDH-G.mjs").then((module) => module.prune),
4448
+ usage: () => import("./usage-Bh1lVioA.mjs").then((module) => module.usage),
4449
+ prune: () => import("./usage-Bh1lVioA.mjs").then((module) => module.prune),
4620
4450
  decide,
4621
- relay: () => import("./relay-CsdoZUXJ.mjs").then((module) => module.relay),
4622
- pause: () => import("./pause-W6MzQqg8.mjs").then((module) => module.pause),
4623
- continue: () => import("./pause-W6MzQqg8.mjs").then((module) => module.continueRun),
4451
+ relay: () => import("./relay-UgK1Cp9a.mjs").then((module) => module.relay),
4452
+ pause: () => import("./pause-CBSAxtTp.mjs").then((module) => module.pause),
4453
+ continue: () => import("./pause-CBSAxtTp.mjs").then((module) => module.continueRun),
4624
4454
  stop,
4625
4455
  chat,
4626
- send: () => import("./send-Bw2FI_Sv.mjs").then((module) => module.send),
4456
+ send: () => import("./send-B39-Xeo7.mjs").then((module) => module.send),
4627
4457
  resume,
4628
4458
  feedback,
4629
4459
  context,
4630
- worktrees: () => import("./worktrees-CKDRkl6b.mjs").then((module) => module.worktrees),
4631
- wt: () => import("./worktrees-CKDRkl6b.mjs").then((module) => module.worktrees),
4632
- watch: () => import("./watch-vdRobJil.mjs").then((module) => module.watch),
4633
- mcp: () => import("./mcp-DYmQt372.mjs").then((module) => module.mcp),
4634
- ui: () => import("./ui-wX050aH1.mjs").then((module) => module.ui),
4460
+ worktrees: () => import("./worktrees-D4bVVKfY.mjs").then((module) => module.worktrees),
4461
+ wt: () => import("./worktrees-D4bVVKfY.mjs").then((module) => module.worktrees),
4462
+ watch: () => import("./watch-C_vcsn_g.mjs").then((module) => module.watch),
4463
+ mcp: () => import("./mcp-qUwFT9yi.mjs").then((module) => module.mcp),
4464
+ ui: () => import("./ui-DmJWLgxL.mjs").then((module) => module.ui),
4635
4465
  doctor,
4636
4466
  upgrade,
4637
- completion: () => import("./completion-BY-frez8.mjs").then((module) => module.completion),
4638
- __complete: () => import("./completion-BY-frez8.mjs").then((module) => module.completeCommand(main))
4467
+ completion: () => import("./completion-BeS2NCgO.mjs").then((module) => module.completion),
4468
+ __complete: () => import("./completion-BeS2NCgO.mjs").then((module) => module.completeCommand(main))
4639
4469
  }
4640
4470
  });
4641
4471
  // src/bin.ts
@@ -4653,7 +4483,7 @@ const main = defineCommand({
4653
4483
  clearGitLocalEnv();
4654
4484
  const argv = process.argv.slice(2);
4655
4485
  if (argv[0] === "__complete") {
4656
- const { printCompletions } = await import("./completion-BY-frez8.mjs");
4486
+ const { printCompletions } = await import("./completion-BeS2NCgO.mjs");
4657
4487
  await printCompletions(main, argv.slice(1));
4658
4488
  } else if (process.env["ORK_UPDATE_CHECK_CHILD"] === "1") await runUpdateChild();
4659
4489
  else {
@@ -1,4 +1,4 @@
1
- import { A as gitOk, O as removeWorktree } from "./src-BRB5EQyC.mjs";
1
+ import { A as gitOk, O as removeWorktree } from "./src-DG4dyBqm.mjs";
2
2
  // ../core/src/worktree/clean.ts
3
3
  /**
4
4
  * @file What `ork worktrees clean` and `ork worktrees remove` do with what
@@ -1,9 +1,9 @@
1
- import { Cn as placeFiles, cr as CLAUDE_DRIVERS, ht as liveStatus, tr as NodeIdSchema, wn as placeFor } from "./src-BRB5EQyC.mjs";
2
- import { a as builtinWorkflowNames, n as pendingDecisions, o as builtinWorkflowText, s as isBuiltinArg } from "./decide-CBhYcjwI.mjs";
3
- import { t as findRun } from "./find-BgZjVKhv.mjs";
4
- import { c as openStore, l as storePath, o as writeErr } from "./output-CuivUcDa.mjs";
1
+ import { Cn as placeFiles, cr as CLAUDE_DRIVERS, ht as liveStatus, tr as NodeIdSchema, wn as placeFor } from "./src-DG4dyBqm.mjs";
2
+ import { a as builtinWorkflowNames, n as pendingDecisions, o as builtinWorkflowText, s as isBuiltinArg } from "./decide-Cnt7o3ya.mjs";
3
+ import { t as findRun } from "./find-Dy2H5IvT.mjs";
4
+ import { c as openStore, l as storePath, o as writeErr } from "./output-CjOPL8W0.mjs";
5
5
  import { a as findEntry, c as subcommandsOf, d as SHELL_SCRIPTS, l as COMPLETE_COMMAND, n as groupedEntries, r as argInfoOf, t as groupOf, u as SHELLS } from "./help-groups-BwYoAWsh.mjs";
6
- import { a as resolveWorkflowArg, n as WORKFLOW_SUFFIX } from "./workflows-B28q8zMY.mjs";
6
+ import { a as resolveWorkflowArg, n as WORKFLOW_SUFFIX } from "./workflows-lpexsAYt.mjs";
7
7
  import path from "node:path";
8
8
  import { parse } from "yaml";
9
9
  import { existsSync, readFileSync, readdirSync, statSync } from "node:fs";
@@ -1,6 +1,6 @@
1
- import { C as workflowTextHash, Cn as placeFiles, Ct as walkChecks, On as workflowDirOf, S as readProjectTriggers, St as checkWorkflowText, jn as LESSON_CAP_TOKENS, lt as explainSession, wn as placeFor, wt as walkSummary } from "./src-BRB5EQyC.mjs";
2
- import { a as write, i as style, r as plain } from "./output-CuivUcDa.mjs";
3
- import { c as registeredProjects, i as refusedBuiltin, o as workflowArg, r as findWorkflowFiles, s as projectAt } from "./workflows-B28q8zMY.mjs";
1
+ import { C as workflowTextHash, Cn as placeFiles, Ct as walkChecks, On as workflowDirOf, S as readProjectTriggers, St as checkWorkflowText, jn as LESSON_CAP_TOKENS, lt as explainSession, wn as placeFor, wt as walkSummary } from "./src-DG4dyBqm.mjs";
2
+ import { a as write, i as style, r as plain } from "./output-CjOPL8W0.mjs";
3
+ import { c as registeredProjects, i as refusedBuiltin, o as workflowArg, r as findWorkflowFiles, s as projectAt } from "./workflows-lpexsAYt.mjs";
4
4
  import path from "node:path";
5
5
  import { readFileSync } from "node:fs";
6
6
  import { defineCommand } from "citty";
@@ -1,4 +1,4 @@
1
- import { Cn as placeFiles, Fn as writePlainFile, Nn as guardedBase, Pn as plainPathInside, cn as wakeRun, ht as liveStatus, on as socketPath } from "./src-BRB5EQyC.mjs";
1
+ import { Cn as placeFiles, Fn as writePlainFile, Nn as guardedBase, Pn as plainPathInside, ht as liveStatus, in as socketPath, on as wakeRun } from "./src-DG4dyBqm.mjs";
2
2
  import path from "node:path";
3
3
  import { existsSync, readFileSync } from "node:fs";
4
4
  import { createHash } from "node:crypto";
@@ -69,7 +69,7 @@ const builtinWorkflowFile = (place, arg) => {
69
69
  * An answer goes to the store (the first one wins), then the run is woken on
70
70
  * its socket so it picks the answer up at once (specs/messaging.md).
71
71
  */
72
- /** Open decisions whose run is still live, oldest first. */
72
+ /** Open decisions whose run is still live, oldest first, ANDing the filter. */
73
73
  const pendingDecisions = (store, filter) => {
74
74
  const live = /* @__PURE__ */ new Map();
75
75
  return store.decisions({
@@ -78,7 +78,7 @@ const pendingDecisions = (store, filter) => {
78
78
  }).filter((decision) => {
79
79
  if (!live.has(decision.runId)) {
80
80
  const [run] = store.lookup(decision.runId);
81
- live.set(decision.runId, run !== void 0 && liveStatus(run) === "running");
81
+ live.set(decision.runId, run !== void 0 && liveStatus(run) === "running" && (filter.workflow === void 0 || run.workflow === filter.workflow));
82
82
  }
83
83
  return live.get(decision.runId) === true;
84
84
  });
@@ -1,4 +1,4 @@
1
- import { wn as placeFor } from "./src-BRB5EQyC.mjs";
1
+ import { wn as placeFor } from "./src-DG4dyBqm.mjs";
2
2
  import { randomUUID } from "node:crypto";
3
3
  // ../core/src/remote/find.ts
4
4
  /**