@krapht/ork 1.0.0-alpha.16 → 1.0.0-alpha.18

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 (46) hide show
  1. package/dist/{__build_info__-DcRdK0Du.mjs → __build_info__-B8TNbFtN.mjs} +2 -2
  2. package/dist/{attach-7lB5_jpr.mjs → attach-CU4Pk42S.mjs} +5 -5
  3. package/dist/{attach-B-FeE1dJ.mjs → attach-qvfyaQXC.mjs} +1 -1
  4. package/dist/bin.mjs +35 -35
  5. package/dist/brief-Bh1FnAHv.mjs +100 -0
  6. package/dist/{builtin-files-BRSOObAv.mjs → builtin-files-dnTP2GaX.mjs} +1 -1
  7. package/dist/{completion-Cgb2qPPh.mjs → completion-CzXUGSVn.mjs} +46 -4
  8. package/dist/{context-BN9A2Nnu.mjs → context-b4_gPlv3.mjs} +3 -3
  9. package/dist/{find-mLYsR0uC.mjs → find-P-VV4B47.mjs} +1 -1
  10. package/dist/{flags-CdgIH1L6.mjs → flags-CqjJ44uW.mjs} +3 -108
  11. package/dist/{follow-ups-DxCsOby1.mjs → follow-ups-B_c1DSpA.mjs} +8 -8
  12. package/dist/{format-hiDvtNGM.mjs → format-BS1qzpkf.mjs} +1 -1
  13. package/dist/in-a-run-DKoMGTNE.mjs +27 -0
  14. package/dist/{install-23g_1ngs.mjs → install-B743Bwzz.mjs} +1 -1
  15. package/dist/{limits-C_Xz_t3C.mjs → limits-DrsKCqaN.mjs} +1 -1
  16. package/dist/{mcp-CWng9I9n.mjs → mcp-BMwekw38.mjs} +6 -6
  17. package/dist/{once-lvwcWfVf.mjs → once-6L8gciJV.mjs} +3 -3
  18. package/dist/parse-BzWpMN-a.mjs +107 -0
  19. package/dist/{pause-Cy11KrXK.mjs → pause-8gnVgICR.mjs} +3 -3
  20. package/dist/{post-C9soCx7i.mjs → post-y1qL1Fnj.mjs} +2 -2
  21. package/dist/{print-BaWiWf4v.mjs → print-DLe4MHn-.mjs} +1 -1
  22. package/dist/{project-records-BRiyQzUo.mjs → project-records-CsILxwfI.mjs} +1 -1
  23. package/dist/{relay-C0M1TWMB.mjs → relay-Bvm9JEoN.mjs} +1 -1
  24. package/dist/{run-B-j3Qxqc.mjs → run-D4yuTmmJ.mjs} +17 -17
  25. package/dist/{run-D_u9V_Ve.mjs → run-y8jI7bAI.mjs} +1 -1
  26. package/dist/{send-qBxj0JbJ.mjs → send-BV9eIxQ7.mjs} +2 -2
  27. package/dist/{src-DHDQ0itC.mjs → src-CVeA4tAw.mjs} +73 -18
  28. package/dist/{src-nXLIwDrt.mjs → src-DWAcd3Sy.mjs} +235 -73
  29. package/dist/{src-DN-RPsil.mjs → src-Frwpx3WF.mjs} +49 -6
  30. package/dist/{src-CXBmaGwS.mjs → src-ygFMh2eP.mjs} +391 -233
  31. package/dist/{store-Dyr1mP8K.mjs → store-B0nGqnPq.mjs} +1 -1
  32. package/dist/ui/assets/app-9Q-62Ywz.css +1 -0
  33. package/dist/ui/assets/app-C4yxmYQR.js +111 -0
  34. package/dist/ui/assets/{index-CVzwYlz3.js → index-CcbJWo5C.js} +2 -2
  35. package/dist/ui/index.html +1 -1
  36. package/dist/{ui-DLrSt5ny.mjs → ui-BZ9BhFw8.mjs} +3 -3
  37. package/dist/{usage-CxmpYYO4.mjs → usage-BIs4j5Rw.mjs} +5 -4
  38. package/dist/{validate-BVrT43GO.mjs → validate-Xn2ZbJQC.mjs} +3 -3
  39. package/dist/{watch-mkLm4t9D.mjs → watch-9VM3DFTp.mjs} +5 -5
  40. package/dist/{workflows-Bvl2Fquu.mjs → workflows-CBYtycIy.mjs} +2 -2
  41. package/dist/{worktrees-DOOCoS2w.mjs → worktrees-C7vfh7y5.mjs} +4 -4
  42. package/package.json +1 -1
  43. package/dist/brief-BvMtIFio.mjs +0 -58
  44. package/dist/in-a-run-a447hxq8.mjs +0 -24
  45. package/dist/ui/assets/app-BPSCxb_l.css +0 -1
  46. package/dist/ui/assets/app-CnNRowFn.js +0 -111
@@ -19,7 +19,7 @@
19
19
  href="/favicon.svg"
20
20
  type="image/svg+xml"
21
21
  />
22
- <script type="module" crossorigin src="/assets/index-CVzwYlz3.js"></script>
22
+ <script type="module" crossorigin src="/assets/index-CcbJWo5C.js"></script>
23
23
  <link rel="modulepreload" crossorigin href="/assets/theme-CdXvqTQ6.js">
24
24
  <link rel="stylesheet" crossorigin href="/assets/index-BPIbqRRb.css">
25
25
  </head>
@@ -1,7 +1,7 @@
1
- import { n as ORK_VERSION, t as ORK_NAME } from "./__build_info__-DcRdK0Du.mjs";
1
+ import { n as ORK_VERSION, t as ORK_NAME } from "./__build_info__-B8TNbFtN.mjs";
2
2
  import { c as write, l as writeErr, s as style } from "./output-B1kwo0YU.mjs";
3
- import { o as mayShowSignIn } from "./in-a-run-a447hxq8.mjs";
4
- import { i as uiFilePath, l as newToken, n as startServer, r as runningServer, t as DEFAULT_PORT } from "./src-nXLIwDrt.mjs";
3
+ import { o as mayShowSignIn } from "./in-a-run-DKoMGTNE.mjs";
4
+ import { i as uiFilePath, l as newToken, n as startServer, r as runningServer, t as DEFAULT_PORT } from "./src-DWAcd3Sy.mjs";
5
5
  import path from "node:path";
6
6
  import { constants } from "node:os";
7
7
  import { spawn } from "node:child_process";
@@ -1,9 +1,10 @@
1
- import { B as planPrune, L as openStore, Pr as placeFor, Ut as usageListTable, g as usageReport, h as USAGE_DIMENSIONS, z as applyPrune } from "./src-DN-RPsil.mjs";
2
- import { i as readListArgs, n as filterArgs, o as allAlias, r as projectScope, s as agoTime } from "./flags-CdgIH1L6.mjs";
1
+ import { B as planPrune, Fr as placeFor, L as openStore, Wt as usageListTable, g as usageReport, h as USAGE_DIMENSIONS, z as applyPrune } from "./src-Frwpx3WF.mjs";
2
+ import { r as agoTime } from "./parse-BzWpMN-a.mjs";
3
3
  import { C as termOf, c as write, l as writeErr, n as cost, o as shortCount, r as costOf, s as style, t as confirm } from "./output-B1kwo0YU.mjs";
4
4
  import { n as chip, t as CHIP_LABELS } from "./chips-BqcT58qr.mjs";
5
- import { n as limitsHere } from "./limits-C_Xz_t3C.mjs";
6
- import { a as header, o as table } from "./format-hiDvtNGM.mjs";
5
+ import { n as limitsHere } from "./limits-DrsKCqaN.mjs";
6
+ import { i as readListArgs, n as filterArgs, o as allAlias, r as projectScope } from "./flags-CqjJ44uW.mjs";
7
+ import { a as header, o as table } from "./format-BS1qzpkf.mjs";
7
8
  import { defineCommand } from "citty";
8
9
  // src/runs/usage.ts
9
10
  /** `950`, `12.3k`, `4.5M`. */
@@ -1,8 +1,8 @@
1
- import { D as triggersReport, Di as EXPERIMENTS, E as lateTriggers, Ei as firstLine, Hn as loadProject, J as driverRefusals, L as openStore, M as workflowTextHash, Nr as placeFiles, Oi as experimentsOn, Pr as placeFor, R as storePath, Rr as workflowDirOf, St as walkSummary, Ti as DRIVER_IDS, X as driverQueues, bi as driverChecks, bt as checkWorkflowText, fi as DriverSchema, gi as INTEGRATIONS, hr as socketRoom, j as readProjectTriggers, ki as knownExperiments, mi as retiredDriverHint, q as budgetWarnings, rn as namingNoDriver, wi as AGENT_DRIVERS, xi as readyDriver, xt as walkChecks } from "./src-DN-RPsil.mjs";
2
- import { d as readUpdateCache, f as refreshUpdateCache, i as registryOf, l as newerVersion, m as writeUpdateCache, n as ORK_VERSION, o as updateSwitchOff, p as updateCachePath, r as isSwitchedOn, s as checkDue, t as ORK_NAME, u as pendingNotice } from "./__build_info__-DcRdK0Du.mjs";
1
+ import { Ai as knownExperiments, D as triggersReport, Di as firstLine, E as lateTriggers, Ei as DRIVER_IDS, Fr as placeFor, J as driverRefusals, L as openStore, M as workflowTextHash, Oi as EXPERIMENTS, Pr as placeFiles, R as storePath, Si as readyDriver, St as walkSummary, Ti as AGENT_DRIVERS, Un as loadProject, X as driverQueues, _i as INTEGRATIONS, bt as checkWorkflowText, gr as socketRoom, hi as retiredDriverHint, in as namingNoDriver, j as readProjectTriggers, ki as experimentsOn, pi as DriverSchema, q as budgetWarnings, xi as driverChecks, xt as walkChecks, zr as workflowDirOf } from "./src-Frwpx3WF.mjs";
2
+ import { d as readUpdateCache, f as refreshUpdateCache, i as registryOf, l as newerVersion, m as writeUpdateCache, n as ORK_VERSION, o as updateSwitchOff, p as updateCachePath, r as isSwitchedOn, s as checkDue, t as ORK_NAME, u as pendingNotice } from "./__build_info__-B8TNbFtN.mjs";
3
3
  import { C as termOf, D as wrap, E as widthOf, a as plain, c as write, h as paint, l as writeErr, s as style, w as cut, x as plainEnv } from "./output-B1kwo0YU.mjs";
4
4
  import { n as chip, t as CHIP_LABELS } from "./chips-BqcT58qr.mjs";
5
- import { c as registeredProjects, i as refusedBuiltin, r as findWorkflowFiles, s as projectAt } from "./workflows-Bvl2Fquu.mjs";
5
+ import { c as registeredProjects, i as refusedBuiltin, r as findWorkflowFiles, s as projectAt } from "./workflows-CBYtycIy.mjs";
6
6
  import path from "node:path";
7
7
  import { readFileSync } from "node:fs";
8
8
  import { execFile, spawn } from "node:child_process";
@@ -1,10 +1,10 @@
1
- import { A as declaredTriggers, D as triggersReport, In as stillTheSameProcess, L as openStore, N as takeWatchLock, Nr as placeFiles, O as createWatcher, P as watchingPid, di as isToolNode, hi as timeoutMs, hn as startFollowUpChecks, j as readProjectTriggers, k as triggerStanding, kn as liveStatus, lt as detachRun, oi as CheckReportSchema, tr as runGh } from "./src-DN-RPsil.mjs";
2
- import { n as newRunId } from "./find-mLYsR0uC.mjs";
1
+ import { A as declaredTriggers, An as liveStatus, D as triggersReport, L as openStore, Ln as stillTheSameProcess, N as takeWatchLock, O as createWatcher, P as watchingPid, Pr as placeFiles, fi as isToolNode, gi as timeoutMs, gn as startFollowUpChecks, j as readProjectTriggers, k as triggerStanding, lt as detachRun, nr as runGh, si as CheckReportSchema } from "./src-Frwpx3WF.mjs";
2
+ import { n as newRunId } from "./find-P-VV4B47.mjs";
3
3
  import { C as termOf, E as widthOf, a as plain, c as write, l as writeErr, s as style, t as confirm, w as cut } from "./output-B1kwo0YU.mjs";
4
4
  import { n as chip, t as CHIP_LABELS } from "./chips-BqcT58qr.mjs";
5
- import { c as toolExecutor, o as spawnTool, s as mcpCallExecutor } from "./src-DHDQ0itC.mjs";
6
- import { i as runLimits, r as limitsRefusal } from "./limits-C_Xz_t3C.mjs";
7
- import { t as acceptRefusal } from "./in-a-run-a447hxq8.mjs";
5
+ import { c as toolExecutor, o as spawnTool, s as mcpCallExecutor } from "./src-CVeA4tAw.mjs";
6
+ import { i as runLimits, r as limitsRefusal } from "./limits-DrsKCqaN.mjs";
7
+ import { t as acceptRefusal } from "./in-a-run-DKoMGTNE.mjs";
8
8
  import path from "node:path";
9
9
  import { mkdirSync } from "node:fs";
10
10
  import { homedir } from "node:os";
@@ -1,5 +1,5 @@
1
- import { Ir as runDirOf, L as openStore, Nr as placeFiles, Pr as placeFor, R as storePath, zr as inside } from "./src-DN-RPsil.mjs";
2
- import { a as isBuiltinArg, n as builtinWorkflowFile, t as builtinProblem } from "./builtin-files-BRSOObAv.mjs";
1
+ import { Br as inside, Fr as placeFor, L as openStore, Lr as runDirOf, Pr as placeFiles, R as storePath } from "./src-Frwpx3WF.mjs";
2
+ import { a as isBuiltinArg, n as builtinWorkflowFile, t as builtinProblem } from "./builtin-files-dnTP2GaX.mjs";
3
3
  import { l as writeErr } from "./output-B1kwo0YU.mjs";
4
4
  import path from "node:path";
5
5
  import { existsSync, readdirSync, statSync } from "node:fs";
@@ -1,10 +1,10 @@
1
- import { Gt as applyClean, Jt as planClean, L as openStore, Wt as worktreeListTable, Yt as stepActs, Zt as inspectProject, a as planRemove, c as repoRoot, d as planLine, i as lostWork, l as labelOf, p as stateParts, qt as keyOf, r as applyRemove, s as readWorktrees, u as mergeStateOf } from "./src-DN-RPsil.mjs";
1
+ import { Gt as worktreeListTable, Jt as keyOf, Kt as applyClean, L as openStore, Qt as inspectProject, Xt as stepActs, Yt as planClean, a as planRemove, c as repoRoot, d as planLine, i as lostWork, l as labelOf, p as stateParts, r as applyRemove, s as readWorktrees, u as mergeStateOf } from "./src-Frwpx3WF.mjs";
2
2
  import { t as applyFilters } from "./apply-Mb0fNpCX.mjs";
3
- import { i as readListArgs, n as filterArgs, r as projectScope } from "./flags-CdgIH1L6.mjs";
4
3
  import { C as termOf, c as write, h as paint, l as writeErr, s as style, t as confirm, w as cut } from "./output-B1kwo0YU.mjs";
5
4
  import { n as chip } from "./chips-BqcT58qr.mjs";
6
- import { t as printList } from "./print-BaWiWf4v.mjs";
7
- import { r as withStore } from "./project-records-BRiyQzUo.mjs";
5
+ import { i as readListArgs, n as filterArgs, r as projectScope } from "./flags-CqjJ44uW.mjs";
6
+ import { t as printList } from "./print-DLe4MHn-.mjs";
7
+ import { r as withStore } from "./project-records-CsILxwfI.mjs";
8
8
  import path from "node:path";
9
9
  import { existsSync, realpathSync } from "node:fs";
10
10
  import { defineCommand } from "citty";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@krapht/ork",
3
- "version": "1.0.0-alpha.16",
3
+ "version": "1.0.0-alpha.18",
4
4
  "description": "Orchestrate coding agents (Claude Code, OpenCode, Command Code) on your machine: hierarchical, serializable workflows with a CLI and a localhost UI.",
5
5
  "keywords": [
6
6
  "agents",
@@ -1,58 +0,0 @@
1
- import { gn as takeFollowUps } from "./src-DN-RPsil.mjs";
2
- import { l as briefOf, n as flagValues, u as checkTakeable } from "./run-B-j3Qxqc.mjs";
3
- import { n as newRunId } from "./find-mLYsR0uC.mjs";
4
- import { l as writeErr } from "./output-B1kwo0YU.mjs";
5
- import { t as loadWorkflow } from "./validate-BVrT43GO.mjs";
6
- // src/follow-ups/brief.ts
7
- /**
8
- * @file `ork run --follow-ups <ids>`: the `agent` follow-ups become the run's
9
- * `brief` input, and are marked taken by the run, which finishes them when it
10
- * publishes (`ork follow-ups published`). Everything that could refuse them
11
- * (an unknown id, one for someone else, a workflow with no `brief` input) is
12
- * checked before any is marked, so a run that doesn't start leaves them be.
13
- */
14
- /** The ids `--follow-ups` was given, one per comma or repeat. */
15
- const idsOf = (rawArgs) => flagValues(rawArgs, "--follow-ups").flatMap((value) => value.split(",")).map((id) => id.trim()).filter((id) => id !== "");
16
- /**
17
- * What stops `--follow-ups` from starting a run, one line each; none when
18
- * nothing does.
19
- */
20
- const problemsOf = (loaded, inputs) => {
21
- const name = loaded.workflow?.name ?? "";
22
- if (loaded.workflow?.inputs?.["brief"] === void 0) return [`--follow-ups fills a workflow's \`brief\` input, and ${name} has none.`];
23
- return inputs.some((input) => input.startsWith("brief=")) ? ["--follow-ups and --input brief=… both set the brief."] : [];
24
- };
25
- /**
26
- * The inputs and run id `ork run` starts with: those it was given and, for
27
- * `--follow-ups`, a `brief` made of the follow-ups with the id of the run that
28
- * takes them. `undefined` after saying why it can't start.
29
- */
30
- const prepareFollowUps = (store, rawArgs, runId, target) => {
31
- const inputs = flagValues(rawArgs, "--input");
32
- const ids = idsOf(rawArgs);
33
- const plain = {
34
- inputs,
35
- ...runId === void 0 ? {} : { runId }
36
- };
37
- if (ids.length === 0) return plain;
38
- const loaded = loadWorkflow(target.file, process.cwd(), void 0, store.projects());
39
- if (loaded.workflow === null) return plain;
40
- const takeable = checkTakeable(store, loaded.place.root, ids);
41
- const problems = [...problemsOf(loaded, inputs), ...takeable.ok ? [] : takeable.lines];
42
- if (!takeable.ok || problems.length > 0) {
43
- for (const line of problems) writeErr(line);
44
- process.exitCode = 1;
45
- return;
46
- }
47
- const taker = runId ?? newRunId(store);
48
- takeFollowUps(store, {
49
- project: loaded.place.root,
50
- run: taker,
51
- ids: takeable.followUps.map((f) => f.id)
52
- });
53
- return {
54
- inputs: [...inputs, `brief=${briefOf(takeable.followUps)}`],
55
- runId: taker
56
- };
57
- };
58
- export { prepareFollowUps };
@@ -1,24 +0,0 @@
1
- import { p as runMarkerIn } from "./src-DHDQ0itC.mjs";
2
- // src/commands/in-a-run.ts
3
- /**
4
- * @file The commands that act as the user refuse a program or an agent in a run
5
- * (ADR-047). The refusal names the variable it saw, for someone at their own
6
- * terminal who inherited it. It stops accidents; it is not a boundary.
7
- */
8
- const refusal = (why, env) => {
9
- const marker = runMarkerIn(env);
10
- return marker === null ? null : `${why} ${marker} is set here. If this is your own terminal, it inherited that from a program in a run (a tmux server started by one, say); open a shell without it.`;
11
- };
12
- /** Why `ork watch --accept` refuses here, or `null` when it may run. */
13
- const acceptRefusal = (env = process.env) => refusal("`ork watch --accept` approves code to run with nobody there, so a program or an agent in a run cannot use it.", env);
14
- /** Why `ork chat` refuses here, or `null` when it may run. */
15
- const chatRefusal = (env = process.env) => refusal("`ork chat` speaks as you, so a program or an agent in a run cannot use it. A program writes to a session with `ork send`.", env);
16
- /** Why `ork decide` will not answer here, or `null` when it may. */
17
- const decideRefusal = (env = process.env) => refusal("`ork decide` answers as you, so a program or an agent in a run cannot answer with it; `ork decide --list` still shows what is open.", env);
18
- /** Why `ork continue` refuses here, or `null` when it may run. */
19
- const continueRefusal = (env = process.env) => refusal("`ork continue` undoes a pause you set, so a program or an agent in a run cannot use it.", env);
20
- /** Whether `ork ui` may print its sign-in link, which acts as the user. */
21
- const mayShowSignIn = (env = process.env) => runMarkerIn(env) === null;
22
- /** Why `ork attach` will not answer here, or `null` when it may. */
23
- const attachRefusal = (env = process.env) => refusal("`ork attach` answers as you, so a program or an agent in a run cannot use it; `ork logs` still shows the run.", env);
24
- export { decideRefusal as a, continueRefusal as i, attachRefusal as n, mayShowSignIn as o, chatRefusal as r, acceptRefusal as t };