@krapht/ork 1.0.0-alpha.12 → 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__-BJbE3Zvp.mjs → __build_info__-Da73_nBs.mjs} +3 -3
- package/dist/{attach-BmV5ckb9.mjs → attach-E6NNyA3T.mjs} +4 -4
- package/dist/bin.mjs +114 -55
- package/dist/{builtin-files-w0YULJ4c.mjs → builtin-files-n6o6oWpB.mjs} +2 -2
- package/dist/{clean-D8GI_2K-.mjs → clean-Bh4KZgzc.mjs} +1 -1
- package/dist/{completion-CzElB8nS.mjs → completion-SNNNxnv9.mjs} +6 -6
- package/dist/{context-BAwgVSX5.mjs → context-DHudLA5e.mjs} +4 -4
- package/dist/{decide-DlbyctOE.mjs → decide-DuIHACvH.mjs} +1 -1
- package/dist/{find-p05wlbmu.mjs → find-CjsNYAAf.mjs} +1 -1
- package/dist/{format-Dni98cbh.mjs → format-C60TFpRe.mjs} +1 -1
- package/dist/{help-groups-DYP_zMRP.mjs → help-groups-CyfPWlST.mjs} +4 -0
- package/dist/{in-a-run-BI-hLIl_.mjs → in-a-run-BYjTXaST.mjs} +1 -1
- package/dist/{limits-CElmhowV.mjs → limits-C5QKZNLT.mjs} +2 -2
- package/dist/{list-zW2xKuGr.mjs → list-BUb5Uc3H.mjs} +1 -1
- package/dist/{mcp-CM3b65AZ.mjs → mcp-bcctR-wc.mjs} +6 -6
- package/dist/once-DPQu5Q3H.mjs +76 -0
- package/dist/{pause-BuS83WAI.mjs → pause-BPvlDIvz.mjs} +3 -3
- package/dist/{relay-DAsJA8wF.mjs → relay-C8W0t_zc.mjs} +1 -1
- package/dist/{remove-Dh7D_hVn.mjs → remove-BkFWGVYo.mjs} +3 -3
- package/dist/run-CQIfq918.mjs +192 -0
- package/dist/{send-MFEQZH31.mjs → send-CaZlGG5a.mjs} +2 -2
- package/dist/{src-CdDTQLdQ.mjs → src-BeR6f70A.mjs} +424 -206
- package/dist/{src-S9yK2OHU.mjs → src-CGJGL1sZ.mjs} +7 -7
- package/dist/{src-D1QedD5y.mjs → src-CqRqsb2t.mjs} +44 -7
- package/dist/{src-BfxkJOYm.mjs → src-D93tHZ5B.mjs} +110 -35
- package/dist/{store-B2OaE4ID.mjs → store-CM3cERGl.mjs} +14 -5
- package/dist/ui/THIRD_PARTY_LICENSES.txt +18 -0
- package/dist/ui/assets/app-DYRC0V4p.js +111 -0
- package/dist/ui/assets/{index-BL7Ad0OA.js → index-CWwm8HTG.js} +2 -2
- package/dist/ui/index.html +1 -1
- package/dist/{ui-C4Ys26oO.mjs → ui-D2Ydofq0.mjs} +3 -3
- package/dist/{usage-C2zx-X6q.mjs → usage-6WIowblz.mjs} +4 -4
- package/dist/{watch-DzCeqM05.mjs → watch-uOU_WeBI.mjs} +5 -5
- package/dist/{workflows-Rr5w90A0.mjs → workflows-7tQdMnrA.mjs} +2 -2
- package/dist/{worktrees-f6SAbum5.mjs → worktrees-ZCII298F.mjs} +3 -3
- package/package.json +1 -1
- package/dist/ui/assets/app-CAoZtku5.js +0 -75
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { $
|
|
2
|
-
import { C as feedbackActions, S as placeOf$1, _ as previewPost, a as registryShown, b as acceptItem, c as checkDue, f as readUpdateCache, g as nodeSession, h as writeUpdateCache, i as registryOf, l as fetchLatest, m as updateCachePath, o as updateSwitchOff, p as refreshUpdateCache, s as runInstall, u as newerVersion, w as openFixRun, x as lessonPlaceOf, y as recordNote } from "./__build_info__-
|
|
3
|
-
import { t as builtinProblem } from "./builtin-files-
|
|
4
|
-
import { n as pendingDecisions, t as answerDecision } from "./decide-
|
|
5
|
-
import { n as newRunId, t as findRun } from "./find-
|
|
1
|
+
import { $ as followEvents, C as isNodeEvent, Ct as processAlive, Et as nestItems, G as requestStop, Gn as runDirOf, Gt as nodeSays, Hn as placeFiles, J as detachResume, Jn as inside, K as tellLiveRun, Q as detachRun, R as linkNodes, Rn as loadAgents, S as activeTree, T as storePath, U as requestContinue, Un as placeFor, V as unlinkNodes, W as requestPause, Xn as LESSON_CAP_TOKENS, Y as resumable, _t as liveStatus, a as planUpgrade, ar as readDocument, at as explainWorkflowText, c as runningScript, dn as runGh, dt as walkChecks, fn as sendPost, ft as walkSummary, gr as expandEdge, i as capsHere, in as END_KINDS, ir as newWorkflowText, l as detectInstaller, ln as DISCUSSIONS, lr as renderJsonSchema, m as triggersReport, nr as WorkflowEditSchema, nt as limitsReport, o as releaseNotes, pr as EdgeInputSchema, qn as workflowDirOf, rr as applyEdits, s as runningRunIds, tn as endOf, tr as skillsIn, un as planPost, ur as parseWorkflow, ut as checkWorkflowText, vr as NodeSchema, vt as pausedOf, w as openStore, xn as readCondition, yt as runStatus } from "./src-BeR6f70A.mjs";
|
|
2
|
+
import { C as feedbackActions, S as placeOf$1, _ as previewPost, a as registryShown, b as acceptItem, c as checkDue, f as readUpdateCache, g as nodeSession, h as writeUpdateCache, i as registryOf, l as fetchLatest, m as updateCachePath, o as updateSwitchOff, p as refreshUpdateCache, s as runInstall, u as newerVersion, w as openFixRun, x as lessonPlaceOf, y as recordNote } from "./__build_info__-Da73_nBs.mjs";
|
|
3
|
+
import { t as builtinProblem } from "./builtin-files-n6o6oWpB.mjs";
|
|
4
|
+
import { n as pendingDecisions, t as answerDecision } from "./decide-DuIHACvH.mjs";
|
|
5
|
+
import { n as newRunId, t as findRun } from "./find-CjsNYAAf.mjs";
|
|
6
6
|
import { n as usageReport } from "./report-CEN8VoUb.mjs";
|
|
7
|
-
import { a as planClean, i as keyOf, o as stepActs, r as cleanStep, s as stepPrunes, t as applyClean } from "./clean-
|
|
8
|
-
import { a as readWorktrees, c as mergeStateOf, d as stateParts, i as projectHead, l as planLine, n as lostWork, r as planRemove, s as labelOf, t as applyRemove, u as removeRefusal } from "./remove-
|
|
7
|
+
import { a as planClean, i as keyOf, o as stepActs, r as cleanStep, s as stepPrunes, t as applyClean } from "./clean-Bh4KZgzc.mjs";
|
|
8
|
+
import { a as readWorktrees, c as mergeStateOf, d as stateParts, i as projectHead, l as planLine, n as lostWork, r as planRemove, s as labelOf, t as applyRemove, u as removeRefusal } from "./remove-BkFWGVYo.mjs";
|
|
9
9
|
import path from "node:path";
|
|
10
10
|
import { z } from "zod";
|
|
11
11
|
import { chmodSync, existsSync, lstatSync, mkdirSync, readFileSync, readdirSync, realpathSync, renameSync, rmSync, statSync, writeFileSync } from "node:fs";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { En as MASK, It as lowerChild, Lt as startAt, Nr as AGENT_DRIVERS, On as maskSecrets, an as endFor, cn as FEEDBACK_TARGETS, ct as parseReport, in as END_KINDS, nn as outcomeEnd, on as FEEDBACK_KINDS, sn as FEEDBACK_SEVERITIES } from "./src-BeR6f70A.mjs";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { existsSync, linkSync, mkdirSync, mkdtempSync, readFileSync, readdirSync, realpathSync, renameSync, rmSync, writeFileSync } from "node:fs";
|
|
@@ -969,7 +969,7 @@ const permissionTool = defineTool({
|
|
|
969
969
|
* kept as the session's report, and the session runner ends the session with
|
|
970
970
|
* it instead of what the tool's last line says.
|
|
971
971
|
*/
|
|
972
|
-
const REPORT_TOOL = "report";
|
|
972
|
+
const REPORT_TOOL$1 = "report";
|
|
973
973
|
/** Whether the driver holds a session's final answer to its schema itself. */
|
|
974
974
|
const checksItsReport = (driver) => AGENT_DRIVERS.find((d) => d.id === driver)?.capabilities.reportSchema ?? true;
|
|
975
975
|
/**
|
|
@@ -985,13 +985,13 @@ const reportValidator = (schema) => {
|
|
|
985
985
|
}
|
|
986
986
|
};
|
|
987
987
|
const failed = (why) => ({
|
|
988
|
-
...text(`The report was not accepted; fix it and call ${REPORT_TOOL} again.\n${why}`),
|
|
988
|
+
...text(`The report was not accepted; fix it and call ${REPORT_TOOL$1} again.\n${why}`),
|
|
989
989
|
isError: true
|
|
990
990
|
});
|
|
991
991
|
const bound = (report) => {
|
|
992
992
|
const schema = reportValidator(report.schema);
|
|
993
993
|
return {
|
|
994
|
-
name: REPORT_TOOL,
|
|
994
|
+
name: REPORT_TOOL$1,
|
|
995
995
|
description: "Hand in your final report: call this once your work is done, as your last step, with the report the task asks for. A report that does not fit comes back with what to fix; call again with the fixed report. The last report accepted is the one your owner gets.",
|
|
996
996
|
shape: schema instanceof z.ZodObject ? schema.shape : {},
|
|
997
997
|
schema,
|
|
@@ -1025,7 +1025,7 @@ const ORK_TOOLS = [
|
|
|
1025
1025
|
releaseTool,
|
|
1026
1026
|
feedbackTool,
|
|
1027
1027
|
{
|
|
1028
|
-
name: REPORT_TOOL,
|
|
1028
|
+
name: REPORT_TOOL$1,
|
|
1029
1029
|
bind: (context) => context.report === void 0 || checksItsReport(context.driver) ? null : bound(context.report)
|
|
1030
1030
|
}
|
|
1031
1031
|
];
|
|
@@ -1135,7 +1135,7 @@ const createSessionRuntime = (adapter, options = {}) => ({
|
|
|
1135
1135
|
}
|
|
1136
1136
|
}
|
|
1137
1137
|
});
|
|
1138
|
-
const byTool = tools.some((tool) => tool.name === REPORT_TOOL);
|
|
1138
|
+
const byTool = tools.some((tool) => tool.name === REPORT_TOOL$1);
|
|
1139
1139
|
const mcp = await startOrkMcpHttp(tools, hold === void 0 || hook === void 0 ? void 0 : toolHook({
|
|
1140
1140
|
hold,
|
|
1141
1141
|
heavy,
|
|
@@ -1243,7 +1243,8 @@ const createSessionRuntime = (adapter, options = {}) => ({
|
|
|
1243
1243
|
/**
|
|
1244
1244
|
* @file The `claude-code` adapter's `EventDecoder` and `UsageReader`: maps the
|
|
1245
1245
|
* `claude` CLI's `stream-json` lines to Ork's runtime events, marks the
|
|
1246
|
-
* result of a turn the hold hook deferred, and adds up a session's legs.
|
|
1246
|
+
* result of a turn the hold hook deferred, and adds up a session's legs. Its
|
|
1247
|
+
* leg decoder keeps a report the session handed in and then wrote past.
|
|
1247
1248
|
*/
|
|
1248
1249
|
const isObject$2 = (value) => value !== null && typeof value === "object" && !Array.isArray(value);
|
|
1249
1250
|
const get$1 = (value, key) => isObject$2(value) ? value[key] : void 0;
|
|
@@ -1378,6 +1379,41 @@ const decodeClaudeLine = (line) => {
|
|
|
1378
1379
|
deferred: isDeferredResult(message)
|
|
1379
1380
|
};
|
|
1380
1381
|
};
|
|
1382
|
+
/** The tool `claude` hands a `--json-schema` report in with. */
|
|
1383
|
+
const REPORT_TOOL = "StructuredOutput";
|
|
1384
|
+
/**
|
|
1385
|
+
* A leg's decoder that keeps the last report `claude` accepted (a
|
|
1386
|
+
* `StructuredOutput` call whose result was not an error). When the session
|
|
1387
|
+
* writes on after it, `claude`'s result can come without `structured_output`;
|
|
1388
|
+
* the kept report is then the result's, so a session that reported is not read
|
|
1389
|
+
* as one that didn't.
|
|
1390
|
+
*/
|
|
1391
|
+
const claudeDecoder = () => {
|
|
1392
|
+
const calls = /* @__PURE__ */ new Map();
|
|
1393
|
+
let accepted;
|
|
1394
|
+
return {
|
|
1395
|
+
decode: (line) => {
|
|
1396
|
+
const message = parseLine$2(line);
|
|
1397
|
+
for (const block of blocks(message)) {
|
|
1398
|
+
if (block["type"] === "tool_use" && block["name"] === REPORT_TOOL) calls.set(str$2(block["id"]), block["input"]);
|
|
1399
|
+
const id = str$2(block["tool_use_id"]);
|
|
1400
|
+
if (block["type"] === "tool_result" && calls.has(id)) {
|
|
1401
|
+
if (block["is_error"] !== true) accepted = calls.get(id);
|
|
1402
|
+
calls.delete(id);
|
|
1403
|
+
}
|
|
1404
|
+
}
|
|
1405
|
+
const kept = isObject$2(message) && message["type"] === "result" && (message["structured_output"] ?? null) === null && accepted !== void 0 ? {
|
|
1406
|
+
...message,
|
|
1407
|
+
structured_output: accepted
|
|
1408
|
+
} : message;
|
|
1409
|
+
return {
|
|
1410
|
+
events: normalize(kept),
|
|
1411
|
+
deferred: isDeferredResult(message)
|
|
1412
|
+
};
|
|
1413
|
+
},
|
|
1414
|
+
exit: () => []
|
|
1415
|
+
};
|
|
1416
|
+
};
|
|
1381
1417
|
/**
|
|
1382
1418
|
* Two legs of one session, as one: the tokens of both, and the later leg's
|
|
1383
1419
|
* cost, which is already the session's total (ADR-046).
|
|
@@ -1540,6 +1576,7 @@ const claudeCodeAdapter = {
|
|
|
1540
1576
|
input: userLine
|
|
1541
1577
|
},
|
|
1542
1578
|
decode: decodeClaudeLine,
|
|
1579
|
+
legDecoder: claudeDecoder,
|
|
1543
1580
|
mcp: {
|
|
1544
1581
|
kind: "flag",
|
|
1545
1582
|
wire: () => Promise.resolve({
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { $t as
|
|
1
|
+
import { $t as serversIn, At as endedWith, Dr as integrationFor, Er as TOOL_PREFIX, Ht as envReadsOf, It as lowerChild, Kt as declaredOutputOf, Lt as startAt, M as sessionRefusals, Mt as stoppedEnd, Nr as AGENT_DRIVERS, Nt as calledWorkflows, Ot as runScope, Pt as slotClock, Qt as mcpNotText, Tr as INTEGRATIONS, Wt as sessionDriver, Zt as MCP_FILE, an as endFor, bn as renderTemplate, br as isToolNode, cr as programsRunBy, fr as markValue, gt as heldTimeout, jt as failedWith, kt as declaredProblem, lt as reportSchemaFor, nn as outcomeEnd, rn as END_DETAIL_LIMIT, rt as planReason, sr as beforeOf, st as planNodeSession, tn as endOf, vn as evaluate, wr as timeoutMs, yn as parseTemplate, yr as isClaudeNode } from "./src-BeR6f70A.mjs";
|
|
2
|
+
import { t as runOnce } from "./run-CQIfq918.mjs";
|
|
2
3
|
import path from "node:path";
|
|
3
4
|
import { accessSync, constants, lstatSync, mkdirSync, readFileSync, rmSync, writeFileSync } from "node:fs";
|
|
4
5
|
import { spawn } from "node:child_process";
|
|
@@ -323,7 +324,7 @@ const forkPrompt = (question, passOn) => [
|
|
|
323
324
|
/** The fork's report: one of the options or the pass-on, and a note. */
|
|
324
325
|
const forkReportSchema = (ids) => {
|
|
325
326
|
const node = {
|
|
326
|
-
type: "
|
|
327
|
+
type: "agent.worker",
|
|
327
328
|
prompt: "",
|
|
328
329
|
output: { schema: {
|
|
329
330
|
choice: [...ids],
|
|
@@ -628,6 +629,34 @@ const notStarted = (kind, reason, limited) => ({
|
|
|
628
629
|
}),
|
|
629
630
|
...limited === void 0 ? {} : { limited }
|
|
630
631
|
});
|
|
632
|
+
// ../nodes/src/session-driver.ts
|
|
633
|
+
/**
|
|
634
|
+
* @file The driver a Claude node's session starts on (core's `sessionDriver`),
|
|
635
|
+
* and, when its model names that driver (`command-code.deepseek/…`, RFC-015),
|
|
636
|
+
* the fit check on the value an item rendered: the run's own check before it
|
|
637
|
+
* started saw only the written model.
|
|
638
|
+
*/
|
|
639
|
+
/** What stops the node from running on `driver`, in one line, or nothing. */
|
|
640
|
+
const refusalOn = (context, driver, drivers) => {
|
|
641
|
+
const id = context.template ?? context.id;
|
|
642
|
+
const node = context.workflow.nodes[id];
|
|
643
|
+
const descriptor = drivers.find((d) => d.id === driver);
|
|
644
|
+
if (node === void 0 || descriptor === void 0) return void 0;
|
|
645
|
+
const refusals = sessionRefusals(id, node, context.workflow, descriptor);
|
|
646
|
+
return refusals.length === 0 ? void 0 : refusals.map((r) => r.message).join("; ");
|
|
647
|
+
};
|
|
648
|
+
/** The session's driver, or the node's result when none fits. */
|
|
649
|
+
const sessionDriverOf = (context, plan, options) => {
|
|
650
|
+
const driver = sessionDriver({
|
|
651
|
+
pinned: plan.pinned,
|
|
652
|
+
override: options.driver,
|
|
653
|
+
named: plan.driver,
|
|
654
|
+
ready: options.readyDriver
|
|
655
|
+
});
|
|
656
|
+
if (driver === void 0) return notStarted("tool_missing", "no agent driver is ready; see `ork doctor`");
|
|
657
|
+
const unfit = plan.pinned === void 0 ? void 0 : refusalOn(context, driver, options.drivers ?? AGENT_DRIVERS);
|
|
658
|
+
return unfit === void 0 ? driver : notStarted("invalid_node", unfit);
|
|
659
|
+
};
|
|
631
660
|
// ../nodes/src/tool-output.ts
|
|
632
661
|
/**
|
|
633
662
|
* @file A tool node's structured result (`output: { format: json }`): the file
|
|
@@ -870,6 +899,28 @@ const tokenize = (command) => {
|
|
|
870
899
|
args
|
|
871
900
|
};
|
|
872
901
|
};
|
|
902
|
+
/**
|
|
903
|
+
* Runs `execute`, or, with `once: true`, skips it after a pass on these files:
|
|
904
|
+
* `null` then, and `verify.skipped` is recorded. `shown` is the scrubbed
|
|
905
|
+
* command.
|
|
906
|
+
*/
|
|
907
|
+
const runUnlessPassed = async ({ node, context, cwd, shown, environ, execute }) => {
|
|
908
|
+
if (node.once !== true) return execute();
|
|
909
|
+
const done = {};
|
|
910
|
+
const once = await runOnce({
|
|
911
|
+
cwd,
|
|
912
|
+
name: node.script === void 0 ? shown : `${shown}\n${node.script}`,
|
|
913
|
+
who: `${context.runId}/${context.id}`,
|
|
914
|
+
env: environ,
|
|
915
|
+
run: async () => {
|
|
916
|
+
done.run = await execute();
|
|
917
|
+
return done.run.exitCode;
|
|
918
|
+
}
|
|
919
|
+
});
|
|
920
|
+
if (!once.skipped) return done.run ?? execute();
|
|
921
|
+
context.skipped?.(shown, once.pass);
|
|
922
|
+
return null;
|
|
923
|
+
};
|
|
873
924
|
// ../nodes/src/tool-ends.ts
|
|
874
925
|
/**
|
|
875
926
|
* @file How a tool node ended (specs/runtime/session-ends.md): a node that
|
|
@@ -915,6 +966,18 @@ const exitEnd = (output, run, context, program, signedOut) => {
|
|
|
915
966
|
output
|
|
916
967
|
}, end);
|
|
917
968
|
};
|
|
969
|
+
/** The result of a skipped check: it passed, and printed nothing this time. */
|
|
970
|
+
const skippedCheck = (outputFile) => {
|
|
971
|
+
if (outputFile !== void 0) removeOutputFile(outputFile);
|
|
972
|
+
return endedWith({
|
|
973
|
+
ok: true,
|
|
974
|
+
output: {
|
|
975
|
+
exitCode: 0,
|
|
976
|
+
stdout: "",
|
|
977
|
+
stderr: ""
|
|
978
|
+
}
|
|
979
|
+
}, endFor("done"));
|
|
980
|
+
};
|
|
918
981
|
// ../nodes/src/tool-scrub.ts
|
|
919
982
|
/**
|
|
920
983
|
* @file Masking a secret in what a program prints. A plain search, so a value
|
|
@@ -1245,7 +1308,8 @@ const clearStateFiles = (runDir, warn) => {
|
|
|
1245
1308
|
* without a shell, checked against `allow` (or the integration's default),
|
|
1246
1309
|
* its arguments and observed output fields from the integration's adapter,
|
|
1247
1310
|
* long output kept in run files. It sees who it is and the node's `env:`
|
|
1248
|
-
* (`tool-env.ts`),
|
|
1311
|
+
* (`tool-env.ts`), may return JSON (`tool-output.ts`), and may run once per
|
|
1312
|
+
* set of files (`runUnlessPassed` in `tool-command.ts`).
|
|
1249
1313
|
*/
|
|
1250
1314
|
/** How much of stdout and stderr a node's output keeps. */
|
|
1251
1315
|
const OUTPUT_LIMIT = 65536;
|
|
@@ -1346,29 +1410,43 @@ const toolExecutor = (given, options = {}) => async (context) => {
|
|
|
1346
1410
|
...node.watch === void 0 ? {} : { [STATE_ENV]: prepareStateFile(context.runDir, context.id) }
|
|
1347
1411
|
};
|
|
1348
1412
|
const names = Object.keys(nodeEnv.values);
|
|
1349
|
-
const
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1413
|
+
const shown = scrub([
|
|
1414
|
+
command.program,
|
|
1415
|
+
...command.args,
|
|
1416
|
+
...node.script === void 0 ? [] : ["<script>"]
|
|
1417
|
+
].join(" "));
|
|
1418
|
+
const execute = async () => {
|
|
1419
|
+
const release = await context.machine?.slot([command.program, ...command.args].join(" "), context.signal);
|
|
1420
|
+
context.emit({
|
|
1421
|
+
type: "tool.called",
|
|
1422
|
+
id: context.id,
|
|
1423
|
+
name: scrub(command.program),
|
|
1424
|
+
input: {
|
|
1425
|
+
command: shown,
|
|
1426
|
+
...names.length === 0 ? {} : { env: names }
|
|
1427
|
+
}
|
|
1428
|
+
});
|
|
1429
|
+
const scriptFile = node.script === void 0 ? void 0 : writeScriptFile(context.runDir, context.id, context.round, node.script);
|
|
1430
|
+
const priority = context.machine?.priority;
|
|
1431
|
+
return runner(command.program, scriptFile === void 0 ? command.args : [...command.args, scriptFile], {
|
|
1432
|
+
cwd,
|
|
1433
|
+
signal: context.signal,
|
|
1434
|
+
env,
|
|
1435
|
+
...priority === void 0 ? {} : { priority }
|
|
1436
|
+
}).finally(() => {
|
|
1437
|
+
release?.();
|
|
1438
|
+
if (scriptFile !== void 0) removeOutputFile(scriptFile);
|
|
1439
|
+
});
|
|
1440
|
+
};
|
|
1441
|
+
const raw = await runUnlessPassed({
|
|
1442
|
+
node,
|
|
1443
|
+
context,
|
|
1366
1444
|
cwd,
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
})
|
|
1371
|
-
if (
|
|
1445
|
+
shown,
|
|
1446
|
+
environ,
|
|
1447
|
+
execute
|
|
1448
|
+
});
|
|
1449
|
+
if (raw === null) return skippedCheck(outputFile);
|
|
1372
1450
|
const run = {
|
|
1373
1451
|
exitCode: raw.exitCode,
|
|
1374
1452
|
stdout: scrub(raw.stdout),
|
|
@@ -1597,7 +1675,7 @@ const checkedResult = (result, { check, resumes }) => {
|
|
|
1597
1675
|
};
|
|
1598
1676
|
// ../nodes/src/claude.ts
|
|
1599
1677
|
/**
|
|
1600
|
-
* @file The Claude node type: runs
|
|
1678
|
+
* @file The Claude node type: runs an `agent.leader` or `agent.worker` as one
|
|
1601
1679
|
* session, planned with the run's outputs (and the brief its owner gave it),
|
|
1602
1680
|
* and turns its report into the node's output. A leader gets its children
|
|
1603
1681
|
* through the session's ports, and resumes its session on re-entry
|
|
@@ -1640,7 +1718,7 @@ const specFor = (spec, context) => {
|
|
|
1640
1718
|
};
|
|
1641
1719
|
return spec;
|
|
1642
1720
|
};
|
|
1643
|
-
/** Runs
|
|
1721
|
+
/** Runs an `agent.leader` or `agent.worker` as one session. */
|
|
1644
1722
|
const claudeExecutor = (options) => async (context) => {
|
|
1645
1723
|
const planOptions = planOptionsOf(context, options.inPlace);
|
|
1646
1724
|
const before = beforeOf(context.node, context.workflow.defaults);
|
|
@@ -1676,12 +1754,8 @@ const claudeExecutor = (options) => async (context) => {
|
|
|
1676
1754
|
...servers.value
|
|
1677
1755
|
};
|
|
1678
1756
|
if (options.machineClaude === true) spec.machineClaude = true;
|
|
1679
|
-
const driver =
|
|
1680
|
-
|
|
1681
|
-
named: plan.driver,
|
|
1682
|
-
ready: options.readyDriver
|
|
1683
|
-
});
|
|
1684
|
-
if (driver === void 0) return notStarted("tool_missing", "no agent driver is ready; see `ork doctor`");
|
|
1757
|
+
const driver = sessionDriverOf(context, plan, options);
|
|
1758
|
+
if (typeof driver !== "string") return driver;
|
|
1685
1759
|
const runtime = await options.runtimeFor(driver);
|
|
1686
1760
|
const ports = { human: context.owner === void 0 ? withdrawnOnStop(context) : ownerFirst(context, context.owner, {
|
|
1687
1761
|
runtimeFor: options.runtimeFor,
|
|
@@ -1824,6 +1898,7 @@ const gateExecutor = async (context) => {
|
|
|
1824
1898
|
nodeId: context.id,
|
|
1825
1899
|
question,
|
|
1826
1900
|
options,
|
|
1901
|
+
waits: true,
|
|
1827
1902
|
signal: withdraw.signal,
|
|
1828
1903
|
onNote: (given) => {
|
|
1829
1904
|
note = given;
|
|
@@ -2143,8 +2218,8 @@ const builtinExecutors = (options) => {
|
|
|
2143
2218
|
steps: tool
|
|
2144
2219
|
});
|
|
2145
2220
|
const executors = {
|
|
2146
|
-
"
|
|
2147
|
-
"
|
|
2221
|
+
"agent.leader": claude,
|
|
2222
|
+
"agent.worker": claude,
|
|
2148
2223
|
"human.gate": gateExecutor,
|
|
2149
2224
|
"workflow.call": callExecutor,
|
|
2150
2225
|
"mcp.call": mcpCallExecutor(options.maskedNames === void 0 ? {} : { maskedNames: options.maskedNames })
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { $
|
|
2
|
-
import { n as pendingDecisions, t as answerDecision } from "./decide-
|
|
1
|
+
import { $ as followEvents, C as isNodeEvent, Ft as slotWaitLine, On as maskSecrets, _t as liveStatus, in as END_KINDS, nn as outcomeEnd, tn as endOf, w as openStore } from "./src-BeR6f70A.mjs";
|
|
2
|
+
import { n as pendingDecisions, t as answerDecision } from "./decide-DuIHACvH.mjs";
|
|
3
3
|
import { E as readKeys, S as cut, T as wrap, _ as withdrawn, a as style, c as confirmOrStop, d as apply, f as bold, g as readLine, h as interrupt, i as plain, m as createRegion, n as cost, p as paint, v as canKey, w as widthOf, x as termOf, y as plainEnv } from "./output-CnRzrbUM.mjs";
|
|
4
4
|
import { n as chip, r as nodeChip, t as CHIP_LABELS } from "./chips-CyeB_rhR.mjs";
|
|
5
5
|
import { a as createView, i as formatBusEvent, n as nodeVerdict, o as styler, r as firstLine, t as hasConflict } from "./verdict-CIy8tAyX.mjs";
|
|
@@ -696,8 +696,9 @@ const parked = (signal) => new Promise((_, reject) => {
|
|
|
696
696
|
});
|
|
697
697
|
/**
|
|
698
698
|
* Answers permission prompts and `ask_user` questions on the terminal, one at a
|
|
699
|
-
* time. Without a terminal it denies tools and leaves questions to the node
|
|
700
|
-
*
|
|
699
|
+
* time. Without a terminal it denies tools and leaves questions to the node,
|
|
700
|
+
* but a gate's question (`waits`) waits for `ork decide` or the UI. A withdrawn
|
|
701
|
+
* prompt (answered elsewhere) rejects, which frees the turn.
|
|
701
702
|
*/
|
|
702
703
|
const createTerminalHuman = (io) => {
|
|
703
704
|
let rl;
|
|
@@ -743,12 +744,17 @@ const createTerminalHuman = (io) => {
|
|
|
743
744
|
if (noted.kind === "interrupted") await parked(signal);
|
|
744
745
|
if (noted.kind === "text" && noted.value !== "") onNote(noted.value);
|
|
745
746
|
};
|
|
747
|
+
/** Says where a waiting question is answered, and waits until withdrawn. */
|
|
748
|
+
const waitElsewhere = (q) => {
|
|
749
|
+
say(paint(term(), "muted", ` no terminal; ${plain(q.nodeId)} waits for ork decide or ork ui`));
|
|
750
|
+
return parked(q.signal);
|
|
751
|
+
};
|
|
746
752
|
const oneAtATime = (work) => {
|
|
747
753
|
const result = turn.then(work);
|
|
748
754
|
turn = result.catch(() => null);
|
|
749
755
|
return result;
|
|
750
756
|
};
|
|
751
|
-
const asking = (q, place) => oneAtATime(async () => {
|
|
757
|
+
const asking = (q, place) => !io.interactive && q.waits === true ? waitElsewhere(q) : oneAtATime(async () => {
|
|
752
758
|
const { signal } = q;
|
|
753
759
|
if (signal?.aborted === true) throw new Error("the question was withdrawn");
|
|
754
760
|
const t = term();
|
|
@@ -1052,6 +1058,8 @@ const formatEvent = (nodeId, event, tools, verbose = false, view = createView(),
|
|
|
1052
1058
|
return formatOutcome(nodeId, event.outcome, verbose, term);
|
|
1053
1059
|
};
|
|
1054
1060
|
const items = (count) => `${String(count)} ${count === 1 ? "item" : "items"}`;
|
|
1061
|
+
/** A `once: true` check that did not run, and the pass it stands on. */
|
|
1062
|
+
const skippedLine = ({ check, at, who }) => `${check}: already passed on these files · ${at} · ${who}`;
|
|
1055
1063
|
/** Transcript lines for one run event, prefixed with the node they are from. */
|
|
1056
1064
|
const formatRunEvent = (event, width, tools, terminal = false, verbose = false, view = createView()) => {
|
|
1057
1065
|
const { term } = view;
|
|
@@ -1120,6 +1128,7 @@ const formatRunEvent = (event, width, tools, terminal = false, verbose = false,
|
|
|
1120
1128
|
if (event.type === "node.released") return [`${tag(event.id)} ${style("dim", "▸ continues")}`];
|
|
1121
1129
|
if (event.type === "slot.waiting") return [`${tag(event.id)} ${style("yellow", `‖ ${slotWaitLine(event.holders)}`)}`];
|
|
1122
1130
|
if (event.type === "slot.taken") return [`${tag(event.id)} ${style("dim", "▸ got a check slot")}`];
|
|
1131
|
+
if (event.type === "verify.skipped") return [`${tag(event.id)} ${style("dim", `✓ ${skippedLine(event)}`)}`];
|
|
1123
1132
|
if (event.type === "each.listed") {
|
|
1124
1133
|
const round = event.round > 1 ? ` (round ${String(event.round)})` : "";
|
|
1125
1134
|
return [`${tag(event.node)} ${style("dim", `${items(event.count)}${round}`)}`];
|
|
@@ -1200,6 +1200,24 @@ SOFTWARE.
|
|
|
1200
1200
|
|
|
1201
1201
|
------------------------------------------------------------------------
|
|
1202
1202
|
|
|
1203
|
+
yaml 2.9.1 (ISC)
|
|
1204
|
+
|
|
1205
|
+
Copyright Eemeli Aro <eemeli@gmail.com>
|
|
1206
|
+
|
|
1207
|
+
Permission to use, copy, modify, and/or distribute this software for any purpose
|
|
1208
|
+
with or without fee is hereby granted, provided that the above copyright notice
|
|
1209
|
+
and this permission notice appear in all copies.
|
|
1210
|
+
|
|
1211
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
1212
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
|
1213
|
+
FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
1214
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
|
|
1215
|
+
OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
|
1216
|
+
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
|
|
1217
|
+
THIS SOFTWARE.
|
|
1218
|
+
|
|
1219
|
+
------------------------------------------------------------------------
|
|
1220
|
+
|
|
1203
1221
|
zod 4.6.7 (MIT)
|
|
1204
1222
|
|
|
1205
1223
|
MIT License
|