@krapht/ork 1.0.0-alpha.0 → 1.0.0-alpha.10

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 (41) hide show
  1. package/README.md +5 -6
  2. package/dist/{__build_info__-DdTVd2p5.mjs → __build_info__-DFF18K8y.mjs} +72 -3
  3. package/dist/bin.mjs +603 -384
  4. package/dist/{clean-NnboOuz6.mjs → clean-DVaEH9e7.mjs} +5 -2
  5. package/dist/{completion-snnYGjgK.mjs → completion-Dv5kf598.mjs} +6 -6
  6. package/dist/context-CEaKOVmG.mjs +683 -0
  7. package/dist/{decide-B81wCZQg.mjs → decide-3l9q8UtX.mjs} +3 -3
  8. package/dist/{find-BKW-uGey.mjs → find-DEjjOlTG.mjs} +1 -1
  9. package/dist/format-Cb5_m-Qd.mjs +191 -0
  10. package/dist/{in-a-run-BPXX09Bs.mjs → in-a-run-BS9Nc-JW.mjs} +1 -1
  11. package/dist/{limits-JCve2QpI.mjs → limits-BSwEjQST.mjs} +1 -1
  12. package/dist/{list-C7UEgmtd.mjs → list-Qxr6rwsY.mjs} +11 -4
  13. package/dist/{mcp-CKPyNaKD.mjs → mcp-CslnG5wf.mjs} +6 -6
  14. package/dist/output-Bqljtmp_.mjs +40 -0
  15. package/dist/{pause-B_SL_yDz.mjs → pause-D7OVB5Ac.mjs} +4 -4
  16. package/dist/{relay-o-Luee1c.mjs → relay-EceRIebO.mjs} +2 -2
  17. package/dist/{remove-DAZ7ZCzt.mjs → remove-0IQZVWmI.mjs} +14 -7
  18. package/dist/{send-3B64fBNB.mjs → send-C0uwfUYi.mjs} +3 -3
  19. package/dist/{src-DHvWU4tX.mjs → src-Df6KOIDC.mjs} +5682 -3248
  20. package/dist/{src-C38BPzit.mjs → src-cmmXKHn1.mjs} +266 -203
  21. package/dist/{src-BJTegEzY.mjs → src-i5k2Y-kf.mjs} +40 -88
  22. package/dist/src-oaJYIddp.mjs +2255 -0
  23. package/dist/ui/THIRD_PARTY_LICENSES.txt +594 -0
  24. package/dist/ui/assets/app-C8uhHVYp.css +1 -0
  25. package/dist/ui/assets/app-qs8Lofv6.js +75 -0
  26. package/dist/ui/assets/{index-D83F2OKZ.js → index-DV1ZaOk-.js} +3 -3
  27. package/dist/ui/assets/theme-CdXvqTQ6.js +1 -0
  28. package/dist/ui/index.html +2 -2
  29. package/dist/{ui-CY4xxJUu.mjs → ui-CBkHJdqk.mjs} +4 -4
  30. package/dist/{usage-CJnytoe4.mjs → usage-Cd8pEYyK.mjs} +5 -5
  31. package/dist/{watch-BJB82ZJ7.mjs → watch-DW5R2OPO.mjs} +6 -6
  32. package/dist/{workflows-CiM7S3l0.mjs → workflows-BT1gDRIV.mjs} +4 -3
  33. package/dist/{worktrees-86ySXxR6.mjs → worktrees-g1MQMGie.mjs} +78 -19
  34. package/package.json +2 -4
  35. package/dist/context-DO3sBy9v.mjs +0 -274
  36. package/dist/format-CmTlTOjT.mjs +0 -427
  37. package/dist/output-B1V6ZJSx.mjs +0 -950
  38. package/dist/src-Dyz_Gy1q.mjs +0 -1183
  39. package/dist/ui/assets/app-C8nJ6NpT.js +0 -67
  40. package/dist/ui/assets/app-CH7YC3in.css +0 -1
  41. package/dist/ui/assets/theme-3xH5jxKs.js +0 -1
package/README.md CHANGED
@@ -3,8 +3,8 @@
3
3
  The `ork` command: orchestrate Claude agents on your machine with hierarchical,
4
4
  serializable workflows.
5
5
 
6
- > **Pre-alpha.** Workflows of Claude agents and tools, run from the terminal or
7
- > the browser (`ork ui`). Expect changes between 0.x releases. See the
6
+ > **Alpha.** Workflows of Claude agents and tools, run from the terminal or the
7
+ > browser (`ork ui`). Expect changes until 1.0.0. See the
8
8
  > [project README](https://github.com/mimshins/ork#readme), the
9
9
  > [guides](https://github.com/mimshins/ork/tree/main/docs#readme) and
10
10
  > [what's new](https://github.com/mimshins/ork/blob/main/docs/whats-new.md).
@@ -26,10 +26,9 @@ ork worktrees clean # removes the merged ones; asks first
26
26
  ork upgrade # a newer version? upgrade the way you installed Ork
27
27
  ```
28
28
 
29
- A workflow that names no Claude driver runs on the one that's ready: the CLI
30
- driver uses your own logged-in `claude`; the SDK driver needs
31
- `ANTHROPIC_API_KEY` or a cloud provider. `--driver cli` or `--driver sdk` picks
32
- one.
29
+ A workflow that names no agent driver runs on the one that's ready. Today that
30
+ is `claude-code`: your own `claude`, logged in or with `ANTHROPIC_API_KEY` or a
31
+ cloud provider set. `--driver claude-code` names it.
33
32
 
34
33
  Ork never stores or asks for credentials: it uses the tools you already have,
35
34
  signed in with your own accounts. Once a day it asks the npm registry whether a
@@ -1,4 +1,4 @@
1
- import { An as guardedBase, En as inside, Gt as publishPost, Mn as writePlainFile, On as LESSON_CAP_TOKENS, Rt as FEEDBACK_KINDS, Yt as targetOf, Zt as maskSecrets, bn as placeFiles, g as parseVersion, h as isNewer, jn as plainPathInside, kn as estimateTokens, m as compareVersions, qt as fingerprint, xn as placeFor, zt as FEEDBACK_SEVERITIES } from "./src-DHvWU4tX.mjs";
1
+ import { $t as targetOf, An as inside, Ct as runTree, Fn as plainPathInside, Ht as FEEDBACK_KINDS, In as writePlainFile, Mn as LESSON_CAP_TOKENS, Nn as estimateTokens, Pn as guardedBase, Tn as placeFor, Ut as FEEDBACK_SEVERITIES, Yt as publishPost, Zt as fingerprint, g as parseVersion, h as isNewer, m as compareVersions, un as maskSecrets, wn as placeFiles } from "./src-Df6KOIDC.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";
@@ -410,6 +410,75 @@ const nodeSession = (events, node) => {
410
410
  outputs
411
411
  };
412
412
  };
413
+ // ../core/src/store/activity.ts
414
+ const LONGEST_LINE = 120;
415
+ /**
416
+ * The fields of a tool's input that say what it's working on, best first. Only
417
+ * these are shown, so what else a tool was given stays in the logs.
418
+ */
419
+ const TARGETS = [
420
+ "file_path",
421
+ "notebook_path",
422
+ "path",
423
+ "url",
424
+ "pattern",
425
+ "query",
426
+ "command"
427
+ ];
428
+ const oneLine = (text) => {
429
+ const line = text.replaceAll(/\s+/gu, " ").trim();
430
+ return line.length > LONGEST_LINE ? `${line.slice(0, 119)}…` : line;
431
+ };
432
+ const toolLine = ({ name, input }) => {
433
+ const target = TARGETS.map((field) => input[field]).find((value) => typeof value === "string" && value.trim() !== "");
434
+ if (typeof target !== "string") return name;
435
+ return oneLine(target.startsWith(`${name} `) ? target : `${name} ${target}`);
436
+ };
437
+ /** What a finished node said, or why it failed. */
438
+ const finishedNow = (ok, error, summary) => {
439
+ if (!ok) return error === void 0 ? void 0 : oneLine(error);
440
+ return typeof summary === "string" && summary.trim() !== "" ? oneLine(summary) : void 0;
441
+ };
442
+ /** Each node's activity, by id; a node that never started has none. */
443
+ const runActivity = (stored) => {
444
+ const nodes = /* @__PURE__ */ new Map();
445
+ const of = (id) => {
446
+ const found = nodes.get(id);
447
+ if (found !== void 0) return found;
448
+ const fresh = {};
449
+ nodes.set(id, fresh);
450
+ return fresh;
451
+ };
452
+ for (const { at, event } of stored) if (event.type === "node.started") {
453
+ const node = of(event.id);
454
+ node.startedAt ??= at;
455
+ delete node.finishedAt;
456
+ delete node.now;
457
+ } else if (event.type === "node.event") {
458
+ if (event.event.type === "tool.called") of(event.id).now = toolLine(event.event);
459
+ } else if (event.type === "decision.opened") of(event.node).now = oneLine(`Asked: ${event.question}`);
460
+ else if (event.type === "decision.answered") of(event.node).now = oneLine(`Answered: ${event.answer}`);
461
+ else if (event.type === "decision.withdrawn") delete of(event.node).now;
462
+ else if (event.type === "node.finished") {
463
+ const node = of(event.id);
464
+ node.finishedAt = at;
465
+ const now = finishedNow(event.ok, event.error, event.output["summary"]);
466
+ if (now === void 0) delete node.now;
467
+ else node.now = now;
468
+ }
469
+ return nodes;
470
+ };
471
+ /** The ownership tree, with what each node is doing and when it ran. */
472
+ const activeTree = (stored) => {
473
+ const activity = runActivity(stored);
474
+ const dress = (node) => {
475
+ Object.assign(node, activity.get(node.id));
476
+ for (const child of node.children) dress(child);
477
+ };
478
+ const roots = runTree(stored.map(({ event }) => event));
479
+ for (const root of roots) dress(root);
480
+ return roots;
481
+ };
413
482
  /** The dist-tags every install follows, toward and after 1.0.0. */
414
483
  const CHANNEL_TAGS = [
415
484
  "latest",
@@ -611,5 +680,5 @@ const registryShown = (registry) => {
611
680
  * fails when it is stale.
612
681
  */
613
682
  const ORK_NAME = "@krapht/ork";
614
- const ORK_VERSION = "1.0.0-alpha.0";
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 };
683
+ const ORK_VERSION = "1.0.0-alpha.10";
684
+ export { placeOf as C, lessonPlaceOf as S, openFixRun as T, nodeSession as _, registryShown as a, recordNote as b, checkDue as c, pendingNotice as d, readUpdateCache as f, activeTree 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, previewPost as v, feedbackActions as w, acceptItem as x, checkNote as y };