@krapht/ork 1.0.0-alpha.11 → 1.0.0-alpha.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{__build_info__-CIchF6nr.mjs → __build_info__-Da73_nBs.mjs} +4 -3
- package/dist/attach-E6NNyA3T.mjs +89 -0
- package/dist/bin.mjs +213 -1230
- package/dist/{decide-B6PnKeqo.mjs → builtin-files-n6o6oWpB.mjs} +3 -51
- package/dist/{chips-BA7SrrH5.mjs → chips-CyeB_rhR.mjs} +1 -1
- package/dist/{clean-Di-KT7Mf.mjs → clean-Bh4KZgzc.mjs} +1 -1
- package/dist/{completion-C5D0sEs5.mjs → completion-SNNNxnv9.mjs} +7 -6
- package/dist/{context-BaNshWr9.mjs → context-DHudLA5e.mjs} +6 -6
- package/dist/decide-DuIHACvH.mjs +50 -0
- package/dist/{find-BicBbGMg.mjs → find-CjsNYAAf.mjs} +1 -1
- package/dist/{format-lWhN-jYR.mjs → format-C60TFpRe.mjs} +5 -85
- package/dist/{help-groups-BwYoAWsh.mjs → help-groups-CyfPWlST.mjs} +8 -0
- package/dist/{in-a-run-CgkVouyG.mjs → in-a-run-BYjTXaST.mjs} +4 -2
- package/dist/{limits-jZQp9ZJC.mjs → limits-C5QKZNLT.mjs} +2 -2
- package/dist/{list-CEaJ07jd.mjs → list-BUb5Uc3H.mjs} +1 -1
- package/dist/{mcp-DYgVA9f5.mjs → mcp-bcctR-wc.mjs} +6 -6
- package/dist/once-DPQu5Q3H.mjs +76 -0
- package/dist/{output-CM95njYt.mjs → output-CnRzrbUM.mjs} +3 -1
- package/dist/{pause-D6PuSlNl.mjs → pause-BPvlDIvz.mjs} +4 -4
- package/dist/{relay-DNx7be9k.mjs → relay-C8W0t_zc.mjs} +2 -2
- package/dist/{remove-CpMb4NDl.mjs → remove-BkFWGVYo.mjs} +3 -3
- package/dist/run-CQIfq918.mjs +192 -0
- package/dist/{send-CLs_fyg7.mjs → send-CaZlGG5a.mjs} +3 -3
- package/dist/{src-D6_xjm-x.mjs → src-BeR6f70A.mjs} +595 -228
- package/dist/{src-B6KvTm7B.mjs → src-CGJGL1sZ.mjs} +7 -6
- package/dist/{src-BnZgZGrf.mjs → src-CqRqsb2t.mjs} +44 -7
- package/dist/{src-9iGkjnsy.mjs → src-D93tHZ5B.mjs} +110 -35
- package/dist/store-CM3cERGl.mjs +1365 -0
- package/dist/ui/THIRD_PARTY_LICENSES.txt +18 -0
- package/dist/ui/assets/app-DYRC0V4p.js +111 -0
- package/dist/ui/assets/{index-By_8KKG6.js → index-CWwm8HTG.js} +2 -2
- package/dist/ui/index.html +1 -1
- package/dist/{ui-CIci4UBW.mjs → ui-D2Ydofq0.mjs} +4 -4
- package/dist/{usage-GceBGMjU.mjs → usage-6WIowblz.mjs} +6 -6
- package/dist/verdict-CIy8tAyX.mjs +84 -0
- package/dist/{watch-BmoybMQg.mjs → watch-uOU_WeBI.mjs} +7 -7
- package/dist/{workflows-DZvW3i1e.mjs → workflows-7tQdMnrA.mjs} +3 -3
- package/dist/{worktrees-Be51E2rB.mjs → worktrees-ZCII298F.mjs} +5 -5
- package/package.json +1 -1
- package/dist/ui/assets/app-CxURph7a.js +0 -75
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { $n as plainPathInside, Hn as placeFiles, Jn as inside, On as maskSecrets, Qn as guardedBase, Un as placeFor, Xn as LESSON_CAP_TOKENS, Zn as estimateTokens, _n as targetOf, d as isNewer, er as writePlainFile, f as parseVersion, hn as fingerprint, on as FEEDBACK_KINDS, pn as publishPost, sn as FEEDBACK_SEVERITIES, u as compareVersions } from "./src-BeR6f70A.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";
|
|
@@ -364,7 +364,7 @@ const previewPost = (store, item, ask) => {
|
|
|
364
364
|
};
|
|
365
365
|
};
|
|
366
366
|
// ../core/src/remote/session.ts
|
|
367
|
-
const chattable = (type) => type === "
|
|
367
|
+
const chattable = (type) => type === "agent.leader" || type === "agent.worker";
|
|
368
368
|
/** Reads `node`'s session from a run's events, and every node's last output. */
|
|
369
369
|
const nodeSession = (events, node) => {
|
|
370
370
|
const session = {
|
|
@@ -402,6 +402,7 @@ const nodeSession = (events, node) => {
|
|
|
402
402
|
session.sessionId = inner.sessionId;
|
|
403
403
|
if (inner.cwd !== void 0) session.cwd = inner.cwd;
|
|
404
404
|
if (inner.driver !== void 0) session.driver = inner.driver;
|
|
405
|
+
if (inner.model !== "") session.model = inner.model;
|
|
405
406
|
}
|
|
406
407
|
if (inner.type === "session.finished" && inner.outcome.sessionId !== "") session.sessionId = inner.outcome.sessionId;
|
|
407
408
|
}
|
|
@@ -611,5 +612,5 @@ const registryShown = (registry) => {
|
|
|
611
612
|
* fails when it is stale.
|
|
612
613
|
*/
|
|
613
614
|
const ORK_NAME = "@krapht/ork";
|
|
614
|
-
const ORK_VERSION = "1.0.0-alpha.
|
|
615
|
+
const ORK_VERSION = "1.0.0-alpha.13";
|
|
615
616
|
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 };
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import "./src-BeR6f70A.mjs";
|
|
2
|
+
import { l as createTerminalHuman, n as attachRun, t as withStore } from "./store-CM3cERGl.mjs";
|
|
3
|
+
import { t as findRun } from "./find-CjsNYAAf.mjs";
|
|
4
|
+
import { a as style, o as write, s as writeErr } from "./output-CnRzrbUM.mjs";
|
|
5
|
+
import { n as attachRefusal } from "./in-a-run-BYjTXaST.mjs";
|
|
6
|
+
import { defineCommand } from "citty";
|
|
7
|
+
// src/commands/attach.ts
|
|
8
|
+
/**
|
|
9
|
+
* @file `ork attach`: follow a run and the runs it called on this terminal, and
|
|
10
|
+
* answer their open decisions here (specs/cli.md). Ctrl-C detaches: the run
|
|
11
|
+
* keeps going and its decisions stay open (specs/run-control.md).
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* Follows `runId` and what it called until it ends or the person detaches, and
|
|
15
|
+
* returns the exit code: 0 when the run succeeded or they detached, else 1.
|
|
16
|
+
*/
|
|
17
|
+
const attachSession = async (store, runId, session) => {
|
|
18
|
+
const detach = new AbortController();
|
|
19
|
+
session.signal?.addEventListener("abort", () => {
|
|
20
|
+
detach.abort();
|
|
21
|
+
});
|
|
22
|
+
const interactive = session.terminal?.interactive === true;
|
|
23
|
+
const human = session.terminal === void 0 || !interactive ? void 0 : createTerminalHuman({
|
|
24
|
+
...session.terminal,
|
|
25
|
+
interrupt: () => {
|
|
26
|
+
detach.abort();
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
try {
|
|
30
|
+
const attached = await attachRun(store, runId, session.out, {
|
|
31
|
+
signal: detach.signal,
|
|
32
|
+
hintNoTerminal: human === void 0,
|
|
33
|
+
...human === void 0 ? {} : { human },
|
|
34
|
+
...session.home === void 0 ? {} : { home: session.home },
|
|
35
|
+
...session.intervalMs === void 0 ? {} : { intervalMs: session.intervalMs }
|
|
36
|
+
});
|
|
37
|
+
if (detach.signal.aborted) {
|
|
38
|
+
session.out(style("dim", `detached; run ${runId} keeps going · ork attach ${runId} · ork stop ${runId}`));
|
|
39
|
+
return 0;
|
|
40
|
+
}
|
|
41
|
+
return attached.exitCode;
|
|
42
|
+
} finally {
|
|
43
|
+
human?.close();
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
const attach = defineCommand({
|
|
47
|
+
meta: {
|
|
48
|
+
name: "attach",
|
|
49
|
+
description: "Follow a run and the runs it called, and answer their questions here; Ctrl-C detaches"
|
|
50
|
+
},
|
|
51
|
+
args: { run: {
|
|
52
|
+
type: "positional",
|
|
53
|
+
description: "A run id or a prefix of one",
|
|
54
|
+
required: true
|
|
55
|
+
} },
|
|
56
|
+
run: ({ args }) => withStore(async (store) => {
|
|
57
|
+
const refusal = process.stdin.isTTY ? attachRefusal() : null;
|
|
58
|
+
if (refusal !== null) {
|
|
59
|
+
writeErr(refusal);
|
|
60
|
+
process.exitCode = 1;
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
const found = findRun(store, args.run, process.cwd());
|
|
64
|
+
if (!found.ok) {
|
|
65
|
+
writeErr(found.error);
|
|
66
|
+
process.exitCode = 1;
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
const abort = new AbortController();
|
|
70
|
+
const onSigint = () => {
|
|
71
|
+
abort.abort();
|
|
72
|
+
};
|
|
73
|
+
process.once("SIGINT", onSigint);
|
|
74
|
+
try {
|
|
75
|
+
process.exitCode = await attachSession(store, found.run.id, {
|
|
76
|
+
out: write,
|
|
77
|
+
signal: abort.signal,
|
|
78
|
+
terminal: {
|
|
79
|
+
input: process.stdin,
|
|
80
|
+
output: process.stdout,
|
|
81
|
+
interactive: process.stdin.isTTY
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
} finally {
|
|
85
|
+
process.off("SIGINT", onSigint);
|
|
86
|
+
}
|
|
87
|
+
})
|
|
88
|
+
});
|
|
89
|
+
export { attach };
|