@krapht/ork 0.4.0 → 1.0.0-alpha.0
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/README.md +16 -12
- package/dist/{__build_info__-CtSVVuZE.mjs → __build_info__-DdTVd2p5.mjs} +36 -112
- package/dist/bin.mjs +663 -300
- package/dist/{clean-Dcr807be.mjs → clean-NnboOuz6.mjs} +1 -1
- package/dist/completion-snnYGjgK.mjs +405 -0
- package/dist/{context-C_bksb0C.mjs → context-DO3sBy9v.mjs} +11 -88
- package/dist/decide-B81wCZQg.mjs +113 -0
- package/dist/{find-DptmbhGd.mjs → find-BKW-uGey.mjs} +1 -1
- package/dist/{format-J-a21Yvn.mjs → format-CmTlTOjT.mjs} +71 -37
- package/dist/help-groups-BwYoAWsh.mjs +354 -0
- package/dist/{in-a-run-D1Qc5Mit.mjs → in-a-run-BPXX09Bs.mjs} +1 -1
- package/dist/{limits-BDZCmGEu.mjs → limits-JCve2QpI.mjs} +1 -1
- package/dist/{list-ZvY2OcLq.mjs → list-C7UEgmtd.mjs} +1 -1
- package/dist/{mcp-CHVKKg3B.mjs → mcp-CKPyNaKD.mjs} +7 -7
- package/dist/{output-CXSJO00X.mjs → output-B1V6ZJSx.mjs} +67 -17
- package/dist/{pause-BPSmg4yz.mjs → pause-B_SL_yDz.mjs} +4 -4
- package/dist/{relay-Do-aNbSD.mjs → relay-o-Luee1c.mjs} +2 -2
- package/dist/{remove-AwaMMaHf.mjs → remove-DAZ7ZCzt.mjs} +3 -3
- package/dist/{send-DhGBkowy.mjs → send-3B64fBNB.mjs} +3 -3
- package/dist/{src-CpDKIulI.mjs → src-BJTegEzY.mjs} +23 -13
- package/dist/{src-UWkk1sl9.mjs → src-C38BPzit.mjs} +251 -18
- package/dist/{src-CGqMati3.mjs → src-DHvWU4tX.mjs} +636 -217
- package/dist/{src-BHnxpJyH.mjs → src-Dyz_Gy1q.mjs} +35 -8
- package/dist/ui/THIRD_PARTY_LICENSES.txt +2 -2
- package/dist/ui/assets/app-C8nJ6NpT.js +67 -0
- package/dist/ui/assets/app-CH7YC3in.css +1 -0
- package/dist/ui/assets/{index-BiO54L90.css → index-BPIbqRRb.css} +1 -1
- package/dist/ui/assets/{index-MQNNgsyT.js → index-D83F2OKZ.js} +2 -2
- package/dist/ui/index.html +2 -3
- package/dist/{ui-DhutUMgQ.mjs → ui-CY4xxJUu.mjs} +5 -5
- package/dist/{usage-CT7Z-yjr.mjs → usage-CJnytoe4.mjs} +6 -6
- package/dist/{watch-0Qr2UfCQ.mjs → watch-BJB82ZJ7.mjs} +7 -7
- package/dist/workflows-CiM7S3l0.mjs +88 -0
- package/dist/{worktrees-DHl80k96.mjs → worktrees-86ySXxR6.mjs} +5 -5
- package/package.json +3 -3
- package/dist/ui/assets/app-BgVDC_5l.js +0 -67
- package/dist/ui/assets/app-DVf68fj5.css +0 -1
|
@@ -1,10 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Bt as FEEDBACK_TARGETS, Rt as FEEDBACK_KINDS, pt as parseReport, zt as FEEDBACK_SEVERITIES } from "./src-DHvWU4tX.mjs";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import { randomBytes, timingSafeEqual } from "node:crypto";
|
|
4
4
|
import { createInterface } from "node:readline";
|
|
5
5
|
import { spawn } from "node:child_process";
|
|
6
6
|
import { createServer } from "node:http";
|
|
7
7
|
import { createSdkMcpServer, query, tool } from "@anthropic-ai/claude-agent-sdk";
|
|
8
|
+
// ../runtime-claude/src/cache-env.ts
|
|
9
|
+
/** Claude Code's switch for the one-hour prompt cache. */
|
|
10
|
+
const PROMPT_CACHE_1H = "ENABLE_PROMPT_CACHING_1H";
|
|
11
|
+
/** The variables a session adds to its driver's environment. */
|
|
12
|
+
const cacheEnv = (spec) => spec.promptCache === "1h" ? { [PROMPT_CACHE_1H]: "1" } : {};
|
|
8
13
|
// ../runtime-claude/src/normalize.ts
|
|
9
14
|
/**
|
|
10
15
|
* @file Both drivers emit the same message JSON (the Agent SDK's messages are
|
|
@@ -520,8 +525,16 @@ const askUserTool = defineTool({
|
|
|
520
525
|
context: z.string().optional().describe("What the user needs to know to decide, in a few sentences.")
|
|
521
526
|
},
|
|
522
527
|
run: async ({ nodeId, ports }, args) => {
|
|
528
|
+
let note;
|
|
529
|
+
let owner;
|
|
523
530
|
const question = {
|
|
524
531
|
nodeId,
|
|
532
|
+
onNote: (given) => {
|
|
533
|
+
note = given;
|
|
534
|
+
},
|
|
535
|
+
onOwner: (given) => {
|
|
536
|
+
owner = given;
|
|
537
|
+
},
|
|
525
538
|
question: args.question,
|
|
526
539
|
options: args.options.map((o) => {
|
|
527
540
|
const choice = { id: o.id };
|
|
@@ -533,7 +546,8 @@ const askUserTool = defineTool({
|
|
|
533
546
|
if (args.recommended !== void 0) question.recommended = args.recommended;
|
|
534
547
|
if (args.context !== void 0) question.context = args.context;
|
|
535
548
|
const answer = await ports.human.ask(question);
|
|
536
|
-
|
|
549
|
+
const who = owner === void 0 ? "The user" : `Your owner, \`${owner}\`,`;
|
|
550
|
+
return text(note === void 0 ? `${who} chose: ${answer}` : `${who} chose: ${answer}\nThey said: ${note}`);
|
|
537
551
|
}
|
|
538
552
|
});
|
|
539
553
|
// ../runtime-claude/src/tools/claims.ts
|
|
@@ -707,11 +721,12 @@ const answerTool = defineTool({
|
|
|
707
721
|
description: "Answer a question Ork asked you as the owner of a node, such as a loop of yours that ran out of rounds. The question's id and options are in Ork's message.",
|
|
708
722
|
shape: {
|
|
709
723
|
question: z.string().describe("The question's id, e.g. 'q1'."),
|
|
710
|
-
choice: z.string().describe("One of its options.")
|
|
724
|
+
choice: z.string().describe("One of its options."),
|
|
725
|
+
note: z.string().optional().describe("Why, in a sentence or two; it is recorded with your answer.")
|
|
711
726
|
},
|
|
712
727
|
available: ({ ports }) => ports.mailbox !== void 0 && ports.ownership !== void 0,
|
|
713
728
|
run: ({ ports }, args) => {
|
|
714
|
-
const answered = ports.mailbox?.answer(args.question, args.choice);
|
|
729
|
+
const answered = ports.mailbox?.answer(args.question, args.choice, args.note);
|
|
715
730
|
if (answered === void 0) return Promise.resolve(text("No questions."));
|
|
716
731
|
return Promise.resolve(text(answered.ok ? `Answered ${args.question}: ${args.choice}.` : `Not answered: ${answered.error}.`));
|
|
717
732
|
}
|
|
@@ -814,6 +829,7 @@ const buildCliArgs = (spec, mcp, allowed) => {
|
|
|
814
829
|
[...spec.tools.allow, ...allowed].join(",")
|
|
815
830
|
];
|
|
816
831
|
if (spec.tools.only !== void 0) args.push("--tools", spec.tools.only.join(","));
|
|
832
|
+
if (spec.tools.strictMcp === true) args.push("--strict-mcp-config");
|
|
817
833
|
if (spec.agents !== void 0) args.push("--agents", JSON.stringify(spec.agents));
|
|
818
834
|
if (spec.tools.deny.length > 0) args.push("--disallowedTools", spec.tools.deny.join(","));
|
|
819
835
|
if (spec.model !== void 0) args.push("--model", spec.model);
|
|
@@ -821,6 +837,7 @@ const buildCliArgs = (spec, mcp, allowed) => {
|
|
|
821
837
|
if (spec.maxTurns !== void 0) args.push("--max-turns", String(spec.maxTurns));
|
|
822
838
|
if (spec.budgetUsd !== void 0) args.push("--max-budget-usd", String(spec.budgetUsd));
|
|
823
839
|
if (spec.resume !== void 0) args.push("--resume", spec.resume);
|
|
840
|
+
if (spec.resume !== void 0 && spec.fork === true) args.push("--fork-session");
|
|
824
841
|
for (const dir of spec.plugins ?? []) args.push("--plugin-dir", dir);
|
|
825
842
|
const settings = mcp.holdUrl === void 0 ? spec.settings : withHoldHook(spec.settings, mcp.holdUrl, mcp.token);
|
|
826
843
|
if (settings !== void 0) args.push("--settings", JSON.stringify(settings));
|
|
@@ -857,7 +874,10 @@ const createCliRuntime = (options = {}) => ({
|
|
|
857
874
|
} : mcp;
|
|
858
875
|
const legOf = (args, carried) => runLeg({
|
|
859
876
|
bin: options.bin ?? "claude",
|
|
860
|
-
env:
|
|
877
|
+
env: {
|
|
878
|
+
...options.env ?? process.env,
|
|
879
|
+
...cacheEnv(spec)
|
|
880
|
+
},
|
|
861
881
|
cwd: spec.cwd,
|
|
862
882
|
args,
|
|
863
883
|
carried,
|
|
@@ -886,7 +906,8 @@ const createCliRuntime = (options = {}) => ({
|
|
|
886
906
|
}
|
|
887
907
|
args = buildCliArgs({
|
|
888
908
|
...spec,
|
|
889
|
-
resume: leg.sessionId
|
|
909
|
+
resume: leg.sessionId,
|
|
910
|
+
fork: false
|
|
890
911
|
}, endpoint, allowed);
|
|
891
912
|
}
|
|
892
913
|
} finally {
|
|
@@ -1015,7 +1036,10 @@ const buildSdkOptions = (spec, ports, env, held) => {
|
|
|
1015
1036
|
});
|
|
1016
1037
|
const options = {
|
|
1017
1038
|
cwd: spec.cwd,
|
|
1018
|
-
env: definedEnv(
|
|
1039
|
+
env: definedEnv({
|
|
1040
|
+
...env,
|
|
1041
|
+
...cacheEnv(spec)
|
|
1042
|
+
}),
|
|
1019
1043
|
settingSources: spec.settingSources,
|
|
1020
1044
|
systemPrompt: {
|
|
1021
1045
|
type: "preset",
|
|
@@ -1046,12 +1070,14 @@ const buildSdkOptions = (spec, ports, env, held) => {
|
|
|
1046
1070
|
}
|
|
1047
1071
|
};
|
|
1048
1072
|
if (spec.tools.only !== void 0) options.tools = spec.tools.only;
|
|
1073
|
+
if (spec.tools.strictMcp === true) options.strictMcpConfig = true;
|
|
1049
1074
|
if (spec.agents !== void 0) options.agents = spec.agents;
|
|
1050
1075
|
if (spec.model !== void 0) options.model = spec.model;
|
|
1051
1076
|
if (spec.effort !== void 0) options.effort = spec.effort;
|
|
1052
1077
|
if (spec.maxTurns !== void 0) options.maxTurns = spec.maxTurns;
|
|
1053
1078
|
if (spec.budgetUsd !== void 0) options.maxBudgetUsd = spec.budgetUsd;
|
|
1054
1079
|
if (spec.resume !== void 0) options.resume = spec.resume;
|
|
1080
|
+
if (spec.resume !== void 0 && spec.fork === true) options.forkSession = true;
|
|
1055
1081
|
if (spec.plugins !== void 0) options.plugins = spec.plugins.map((dir) => ({
|
|
1056
1082
|
type: "local",
|
|
1057
1083
|
path: dir
|
|
@@ -1081,7 +1107,8 @@ const createSdkRuntime = (env = process.env, holdWindowMs) => ({
|
|
|
1081
1107
|
deferring = false;
|
|
1082
1108
|
const legSpec = resume === void 0 ? spec : {
|
|
1083
1109
|
...spec,
|
|
1084
|
-
resume
|
|
1110
|
+
resume,
|
|
1111
|
+
fork: false
|
|
1085
1112
|
};
|
|
1086
1113
|
current = query({
|
|
1087
1114
|
prompt: input,
|
|
@@ -424,7 +424,7 @@ SOFTWARE.
|
|
|
424
424
|
|
|
425
425
|
------------------------------------------------------------------------
|
|
426
426
|
|
|
427
|
-
dockview-core 8.
|
|
427
|
+
dockview-core 8.8.3 (MIT)
|
|
428
428
|
|
|
429
429
|
MIT License
|
|
430
430
|
|
|
@@ -450,7 +450,7 @@ SOFTWARE.
|
|
|
450
450
|
|
|
451
451
|
------------------------------------------------------------------------
|
|
452
452
|
|
|
453
|
-
dockview-react 8.
|
|
453
|
+
dockview-react 8.8.3 (MIT)
|
|
454
454
|
|
|
455
455
|
MIT License
|
|
456
456
|
|