@krapht/ork 0.4.0 → 1.0.0-alpha.1

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 (37) hide show
  1. package/README.md +16 -12
  2. package/dist/{__build_info__-CtSVVuZE.mjs → __build_info__-D9lSlMFy.mjs} +36 -112
  3. package/dist/bin.mjs +688 -306
  4. package/dist/{clean-Dcr807be.mjs → clean-CA_Oi2Wl.mjs} +1 -1
  5. package/dist/completion-DBGfL-gN.mjs +405 -0
  6. package/dist/{context-C_bksb0C.mjs → context-6x3kXREO.mjs} +11 -88
  7. package/dist/decide-CoIJh34e.mjs +113 -0
  8. package/dist/{find-DptmbhGd.mjs → find-rBBk7Jui.mjs} +1 -1
  9. package/dist/{format-J-a21Yvn.mjs → format-zMmhqyLE.mjs} +71 -37
  10. package/dist/help-groups-BwYoAWsh.mjs +354 -0
  11. package/dist/{in-a-run-D1Qc5Mit.mjs → in-a-run-DdAakpRR.mjs} +1 -1
  12. package/dist/{limits-BDZCmGEu.mjs → limits-BPM9wUlV.mjs} +1 -1
  13. package/dist/{list-ZvY2OcLq.mjs → list-Bv5Lxu7z.mjs} +1 -1
  14. package/dist/{mcp-CHVKKg3B.mjs → mcp-DM30MFBw.mjs} +7 -7
  15. package/dist/{output-CXSJO00X.mjs → output-TV_j7Ni0.mjs} +67 -17
  16. package/dist/{pause-BPSmg4yz.mjs → pause-C7lJkSma.mjs} +4 -4
  17. package/dist/{relay-Do-aNbSD.mjs → relay-BipJYszF.mjs} +2 -2
  18. package/dist/{remove-AwaMMaHf.mjs → remove-BDs9isB6.mjs} +3 -3
  19. package/dist/{send-DhGBkowy.mjs → send-nbkjf3sc.mjs} +3 -3
  20. package/dist/{src-CpDKIulI.mjs → src-B0TT7DBi.mjs} +28 -15
  21. package/dist/{src-BHnxpJyH.mjs → src-B9v0lDc6.mjs} +58 -10
  22. package/dist/{src-UWkk1sl9.mjs → src-BxUJPGa5.mjs} +252 -18
  23. package/dist/{src-CGqMati3.mjs → src-hrj2h0IZ.mjs} +640 -220
  24. package/dist/ui/THIRD_PARTY_LICENSES.txt +2 -2
  25. package/dist/ui/assets/app-BNT0SuIz.css +1 -0
  26. package/dist/ui/assets/app-CmkynZyW.js +67 -0
  27. package/dist/ui/assets/{index-BiO54L90.css → index-BPIbqRRb.css} +1 -1
  28. package/dist/ui/assets/{index-MQNNgsyT.js → index-CPx74lFf.js} +2 -2
  29. package/dist/ui/index.html +2 -3
  30. package/dist/{ui-DhutUMgQ.mjs → ui-B98FSboa.mjs} +5 -5
  31. package/dist/{usage-CT7Z-yjr.mjs → usage-EW7DI6Z7.mjs} +6 -6
  32. package/dist/{watch-0Qr2UfCQ.mjs → watch-BAkSGaOp.mjs} +7 -7
  33. package/dist/workflows-vsEohqa7.mjs +88 -0
  34. package/dist/{worktrees-DHl80k96.mjs → worktrees-Ahj9rdWK.mjs} +5 -5
  35. package/package.json +3 -3
  36. package/dist/ui/assets/app-BgVDC_5l.js +0 -67
  37. package/dist/ui/assets/app-DVf68fj5.css +0 -1
@@ -1,7 +1,6 @@
1
1
  <!doctype html>
2
2
  <html
3
3
  lang="en"
4
- data-theme="dark"
5
4
  data-contrast="standard"
6
5
  >
7
6
  <head>
@@ -20,9 +19,9 @@
20
19
  href="/favicon.svg"
21
20
  type="image/svg+xml"
22
21
  />
23
- <script type="module" crossorigin src="/assets/index-MQNNgsyT.js"></script>
22
+ <script type="module" crossorigin src="/assets/index-CPx74lFf.js"></script>
24
23
  <link rel="modulepreload" crossorigin href="/assets/theme-3xH5jxKs.js">
25
- <link rel="stylesheet" crossorigin href="/assets/index-BiO54L90.css">
24
+ <link rel="stylesheet" crossorigin href="/assets/index-BPIbqRRb.css">
26
25
  </head>
27
26
  <body>
28
27
  <div id="root"></div>
@@ -1,11 +1,11 @@
1
- import { n as ORK_VERSION, t as ORK_NAME } from "./__build_info__-CtSVVuZE.mjs";
2
- import { a as write, i as style, o as writeErr } from "./output-CXSJO00X.mjs";
3
- import { i as uiFilePath, l as newToken, n as startServer, r as runningServer, t as DEFAULT_PORT } from "./src-CpDKIulI.mjs";
4
- import { a as mayShowSignIn } from "./in-a-run-D1Qc5Mit.mjs";
5
- import { defineCommand } from "citty";
1
+ import { n as ORK_VERSION, t as ORK_NAME } from "./__build_info__-D9lSlMFy.mjs";
2
+ import { a as write, i as style, o as writeErr } from "./output-TV_j7Ni0.mjs";
3
+ import { i as uiFilePath, l as newToken, n as startServer, r as runningServer, t as DEFAULT_PORT } from "./src-B0TT7DBi.mjs";
4
+ import { a as mayShowSignIn } from "./in-a-run-DdAakpRR.mjs";
6
5
  import path from "node:path";
7
6
  import { constants } from "node:os";
8
7
  import { spawn } from "node:child_process";
8
+ import { defineCommand } from "citty";
9
9
  import { fileURLToPath } from "node:url";
10
10
  // src/browser/open.ts
11
11
  /**
@@ -1,11 +1,11 @@
1
- import { c as usd, fn as placeFor, lt as liveStatus, mn as runDirOf } from "./src-CGqMati3.mjs";
2
- import { a as write, c as openStore, i as style, n as cost, o as writeErr, t as confirm } from "./output-CXSJO00X.mjs";
3
- import { n as listOrkWorktrees, t as createdWorktrees } from "./list-ZvY2OcLq.mjs";
1
+ import { Cn as runDirOf, c as usd, ht as liveStatus, xn as placeFor } from "./src-hrj2h0IZ.mjs";
2
+ import { a as write, c as openStore, i as style, n as cost, o as writeErr, t as confirm } from "./output-TV_j7Ni0.mjs";
3
+ import { n as listOrkWorktrees, t as createdWorktrees } from "./list-Bv5Lxu7z.mjs";
4
4
  import { n as usageReport, t as USAGE_DIMENSIONS } from "./report-DK4LGqwF.mjs";
5
- import "./format-J-a21Yvn.mjs";
6
- import { n as limitsHere } from "./limits-BDZCmGEu.mjs";
7
- import { defineCommand } from "citty";
5
+ import "./format-zMmhqyLE.mjs";
6
+ import { n as limitsHere } from "./limits-BPM9wUlV.mjs";
8
7
  import { existsSync, rmSync } from "node:fs";
8
+ import { defineCommand } from "citty";
9
9
  // ../core/src/store/prune.ts
10
10
  /**
11
11
  * @file `ork prune` (ADR-046): which runs may lose their transcript, and doing
@@ -1,13 +1,13 @@
1
- import { C as watchingPid, Mn as CheckReportSchema, S as takeWatchLock, Un as timeoutMs, Vn as isToolNode, _ as createWatcher, b as readProjectTriggers, dn as placeFiles, g as triggersReport, ht as stillTheSameProcess, lt as liveStatus, rt as detachRun, v as triggerStanding, y as declaredTriggers } from "./src-CGqMati3.mjs";
2
- import { n as newRunId } from "./find-DptmbhGd.mjs";
3
- import { a as write, c as openStore, i as style, o as writeErr, r as plain, t as confirm } from "./output-CXSJO00X.mjs";
4
- import { i as runLimits, r as limitsRefusal } from "./limits-BDZCmGEu.mjs";
5
- import { c as toolExecutor, o as spawnTool, s as mcpCallExecutor } from "./src-UWkk1sl9.mjs";
6
- import { t as acceptRefusal } from "./in-a-run-D1Qc5Mit.mjs";
7
- import { defineCommand } from "citty";
1
+ import { $n as timeoutMs, S as readProjectTriggers, T as watchingPid, Wn as CheckReportSchema, Xn as isToolNode, b as triggerStanding, bn as placeFiles, ht as liveStatus, ot as detachRun, v as triggersReport, w as takeWatchLock, x as declaredTriggers, xt as stillTheSameProcess, y as createWatcher } from "./src-hrj2h0IZ.mjs";
2
+ import { n as newRunId } from "./find-rBBk7Jui.mjs";
3
+ import { a as write, c as openStore, i as style, o as writeErr, r as plain, t as confirm } from "./output-TV_j7Ni0.mjs";
4
+ import { i as runLimits, r as limitsRefusal } from "./limits-BPM9wUlV.mjs";
5
+ import { c as toolExecutor, o as spawnTool, s as mcpCallExecutor } from "./src-BxUJPGa5.mjs";
6
+ import { t as acceptRefusal } from "./in-a-run-DdAakpRR.mjs";
8
7
  import path from "node:path";
9
8
  import { mkdirSync } from "node:fs";
10
9
  import { homedir } from "node:os";
10
+ import { defineCommand } from "citty";
11
11
  const NO_HUMAN = {
12
12
  permit: () => Promise.resolve({
13
13
  allow: false,
@@ -0,0 +1,88 @@
1
+ import { Cn as runDirOf, En as inside, bn as placeFiles, xn as placeFor } from "./src-hrj2h0IZ.mjs";
2
+ import { i as builtinWorkflowFile, r as builtinProblem, s as isBuiltinArg } from "./decide-CoIJh34e.mjs";
3
+ import { c as openStore, l as storePath, o as writeErr } from "./output-TV_j7Ni0.mjs";
4
+ import path from "node:path";
5
+ import { existsSync, readdirSync, statSync } from "node:fs";
6
+ // src/project/place.ts
7
+ /**
8
+ * @file Which project a folder belongs to, from the projects the store has
9
+ * registered (ADR-035): an attached project's files are in
10
+ * `~/.ork/projects/<id>/`, an in-repo one's in its `.ork/`.
11
+ */
12
+ /** The registered projects; none before Ork has a store (never creates one). */
13
+ const registeredProjects = (home) => {
14
+ const file = storePath(home);
15
+ if (!existsSync(file)) return [];
16
+ const store = openStore(file);
17
+ try {
18
+ return store.projects();
19
+ } finally {
20
+ store.close();
21
+ }
22
+ };
23
+ /** The project `dir` is in: registered, or the in-repo one at its git root. */
24
+ const projectAt = (dir, home) => placeFor(dir, registeredProjects(home));
25
+ /** A path to show: relative to `cwd` when inside it, else as it is. */
26
+ const fromCwd = (target, cwd) => inside(cwd, target) ? path.relative(cwd, target) || "." : target;
27
+ // src/workflows.ts
28
+ /**
29
+ * @file Finding workflow files: the project's workflows folder by default
30
+ * (`.ork/workflows/`, or an attached project's), directories expanded, a
31
+ * workflow given by name, and one of Ork's own by its `ork:` name, written
32
+ * into the project's run folder.
33
+ */
34
+ const WORKFLOW_DIR = path.join(".ork", "workflows");
35
+ const WORKFLOW_SUFFIX = ".ork.yaml";
36
+ /**
37
+ * Expands the given paths to workflow files: a directory contributes its
38
+ * `*.ork.yaml` files, and a name one in the project's workflows folder
39
+ * (`workflows`, default `.ork/workflows/` under `cwd`). With no paths, uses
40
+ * that folder.
41
+ */
42
+ const findWorkflowFiles = (paths, cwd, workflows = path.join(cwd, WORKFLOW_DIR)) => {
43
+ return (paths.length > 0 ? paths : [fromCwd(workflows, cwd)]).flatMap((target) => {
44
+ const absolute = path.resolve(cwd, target);
45
+ if (existsSync(absolute) && statSync(absolute).isDirectory()) return readdirSync(absolute).filter((name) => name.endsWith(WORKFLOW_SUFFIX)).toSorted().map((name) => path.join(target, name));
46
+ return [resolveWorkflowArg(target, cwd, workflows)];
47
+ });
48
+ };
49
+ /**
50
+ * A workflow given by path, by name for one in the project's workflows folder
51
+ * (`hello` is `.ork/workflows/hello.ork.yaml` when no file `hello` exists), or
52
+ * by its `ork:` name for one of Ork's own. An unknown `ork:` name comes back as
53
+ * it is: commands refuse it first (`unknownBuiltin`).
54
+ */
55
+ const resolveWorkflowArg = (arg, cwd, workflows = path.join(cwd, WORKFLOW_DIR)) => {
56
+ if (isBuiltinArg(arg)) {
57
+ const file = builtinWorkflowFile(projectAt(cwd), arg);
58
+ return file === void 0 ? arg : fromCwd(file, cwd);
59
+ }
60
+ if (existsSync(path.resolve(cwd, arg)) || arg.endsWith(".ork.yaml")) return arg;
61
+ const named = path.join(workflows, `${arg}${WORKFLOW_SUFFIX}`);
62
+ return existsSync(named) ? fromCwd(named, cwd) : arg;
63
+ };
64
+ /**
65
+ * Refuses an `ork:` name that isn't one of Ork's workflows, saying which are,
66
+ * or whose file's place in the project is a link; true when it did, so the
67
+ * command stops.
68
+ */
69
+ const refusedBuiltin = (args, cwd) => {
70
+ const problems = args.filter((arg) => isBuiltinArg(arg)).flatMap((arg) => builtinProblem(projectAt(cwd), arg) ?? []);
71
+ for (const problem of problems) writeErr(problem);
72
+ if (problems.length > 0) process.exitCode = 1;
73
+ return problems.length > 0;
74
+ };
75
+ /**
76
+ * A command's workflow argument, by path or by name in the project `cwd` is in,
77
+ * with the project the file belongs to and a run's folder there.
78
+ */
79
+ const workflowArg = (arg, cwd) => {
80
+ const file = resolveWorkflowArg(arg, cwd, placeFiles(projectAt(cwd)).workflows);
81
+ const place = projectAt(path.dirname(path.resolve(cwd, file)));
82
+ return {
83
+ file,
84
+ place,
85
+ runDir: (runId) => runDirOf(place, runId)
86
+ };
87
+ };
88
+ export { resolveWorkflowArg as a, registeredProjects as c, refusedBuiltin as i, WORKFLOW_SUFFIX as n, workflowArg as o, findWorkflowFiles as r, projectAt as s, WORKFLOW_DIR as t };
@@ -1,9 +1,9 @@
1
- import { T as inspectProject } from "./src-CGqMati3.mjs";
2
- import { a as write, c as openStore, i as style, o as writeErr, t as confirm } from "./output-CXSJO00X.mjs";
3
- import { a as planClean, i as keyOf, o as stepActs, t as applyClean } from "./clean-Dcr807be.mjs";
4
- import { a as readWorktrees, c as planLine, n as lostWork, o as labelOf, r as planRemove, s as mergeStateOf, t as applyRemove, u as stateParts } from "./remove-AwaMMaHf.mjs";
5
- import { defineCommand } from "citty";
1
+ import { D as inspectProject } from "./src-hrj2h0IZ.mjs";
2
+ import { a as write, c as openStore, i as style, o as writeErr, t as confirm } from "./output-TV_j7Ni0.mjs";
3
+ import { a as planClean, i as keyOf, o as stepActs, t as applyClean } from "./clean-CA_Oi2Wl.mjs";
4
+ import { a as readWorktrees, c as planLine, n as lostWork, o as labelOf, r as planRemove, s as mergeStateOf, t as applyRemove, u as stateParts } from "./remove-BDs9isB6.mjs";
6
5
  import path from "node:path";
6
+ import { defineCommand } from "citty";
7
7
  // src/project/worktrees.ts
8
8
  /**
9
9
  * @file What `ork worktrees` prints: each worktree or branch a run left, with
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@krapht/ork",
3
- "version": "0.4.0",
3
+ "version": "1.0.0-alpha.1",
4
4
  "description": "Orchestrate Claude agents on your machine: hierarchical, serializable workflows with a CLI and a localhost UI.",
5
5
  "keywords": [
6
6
  "claude",
@@ -38,9 +38,9 @@
38
38
  "provenance": true
39
39
  },
40
40
  "dependencies": {
41
- "@anthropic-ai/claude-agent-sdk": "0.3.309",
41
+ "@anthropic-ai/claude-agent-sdk": "0.3.316",
42
42
  "@anthropic-ai/sdk": "1.3.0",
43
- "@modelcontextprotocol/sdk": "1.32.1",
43
+ "@modelcontextprotocol/sdk": "1.32.2",
44
44
  "citty": "0.2.2",
45
45
  "yaml": "2.9.1",
46
46
  "zod": "4.6.7"