@krapht/ork 0.2.0 → 0.3.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/THIRD_PARTY_NOTICES.md +7 -0
- package/dist/__build_info__-CXXMLvjt.mjs +104 -0
- package/dist/bin.mjs +859 -3037
- package/dist/context-BFGC_C02.mjs +435 -0
- package/dist/find-BcvhT6UN.mjs +47 -0
- package/dist/format-DqpObyMl.mjs +553 -0
- package/dist/in-a-run-BbLhZOFW.mjs +22 -0
- package/dist/limits-BKYAmqCR.mjs +44 -0
- package/dist/mcp-BWsdQyri.mjs +91 -0
- package/dist/output-Q2EdeVUt.mjs +856 -0
- package/dist/pause-DKACDfV1.mjs +65 -0
- package/dist/relay-CbK-Wme9.mjs +122 -0
- package/dist/report-DK4LGqwF.mjs +129 -0
- package/dist/send-C6yr04Fe.mjs +163 -0
- package/dist/{src-DAsOYtoR.mjs → src-CZOVF2yU.mjs} +496 -193
- package/dist/src-Cz1yOUTg.mjs +11841 -0
- package/dist/src-D5ruZFgD.mjs +1973 -0
- package/dist/src-DtN1k-B3.mjs +1899 -0
- package/dist/ui/THIRD_PARTY_LICENSES.txt +631 -0
- package/dist/ui/assets/app-BlDdP396.js +61 -0
- package/dist/ui/assets/app-C722xNZ3.css +1 -0
- package/dist/ui/assets/geist-mono-cyrillic-400-normal-C51Di1Mf.woff2 +0 -0
- package/dist/ui/assets/geist-mono-cyrillic-400-normal-CPJFfJgk.woff +0 -0
- package/dist/ui/assets/geist-mono-cyrillic-500-normal-D2cXvDHF.woff2 +0 -0
- package/dist/ui/assets/geist-mono-cyrillic-500-normal-DfuvdVgn.woff +0 -0
- package/dist/ui/assets/geist-mono-cyrillic-ext-400-normal-CkxHOdCb.woff +0 -0
- package/dist/ui/assets/geist-mono-cyrillic-ext-400-normal-XB2BPmDK.woff2 +0 -0
- package/dist/ui/assets/geist-mono-cyrillic-ext-500-normal-BY1KTvO5.woff +0 -0
- package/dist/ui/assets/geist-mono-cyrillic-ext-500-normal-C7aYOB1D.woff2 +0 -0
- package/dist/ui/assets/geist-mono-latin-400-normal-B2yvC1Cq.woff +0 -0
- package/dist/ui/assets/geist-mono-latin-400-normal-DTRLJnHl.woff2 +0 -0
- package/dist/ui/assets/geist-mono-latin-500-normal-D-GG86Jb.woff +0 -0
- package/dist/ui/assets/geist-mono-latin-500-normal-YINYabwD.woff2 +0 -0
- package/dist/ui/assets/geist-mono-latin-ext-400-normal-CfzLURNc.woff +0 -0
- package/dist/ui/assets/geist-mono-latin-ext-400-normal-DI-rJ0UV.woff2 +0 -0
- package/dist/ui/assets/geist-mono-latin-ext-500-normal-Buglb9-a.woff2 +0 -0
- package/dist/ui/assets/geist-mono-latin-ext-500-normal-CrWEgvU_.woff +0 -0
- package/dist/ui/assets/geist-mono-symbols2-400-normal-BS9BGVxz.woff2 +0 -0
- package/dist/ui/assets/geist-mono-symbols2-400-normal-DjbiTEEA.woff +0 -0
- package/dist/ui/assets/geist-mono-symbols2-500-normal-CmnCPGa0.woff +0 -0
- package/dist/ui/assets/geist-mono-symbols2-500-normal-Q_ksOahU.woff2 +0 -0
- package/dist/ui/assets/geist-mono-vietnamese-400-normal-CKEaXIlx.woff2 +0 -0
- package/dist/ui/assets/geist-mono-vietnamese-400-normal-CZEPLOgu.woff +0 -0
- package/dist/ui/assets/geist-mono-vietnamese-500-normal-Bs29RrUZ.woff2 +0 -0
- package/dist/ui/assets/geist-mono-vietnamese-500-normal-Dx9-epDo.woff +0 -0
- package/dist/ui/assets/geist-sans-latin-400-normal-BOaIZNA2.woff +0 -0
- package/dist/ui/assets/geist-sans-latin-400-normal-gapTbOY8.woff2 +0 -0
- package/dist/ui/assets/geist-sans-latin-500-normal-CN2lyvyL.woff +0 -0
- package/dist/ui/assets/geist-sans-latin-500-normal-uokXdC-Q.woff2 +0 -0
- package/dist/ui/assets/geist-sans-latin-600-normal-CA1yjETN.woff +0 -0
- package/dist/ui/assets/geist-sans-latin-600-normal-DFOURf8L.woff2 +0 -0
- package/dist/ui/assets/index-BiO54L90.css +1 -0
- package/dist/ui/assets/index-BoG6O-Lp.js +10 -0
- package/dist/ui/assets/theme-3xH5jxKs.js +1 -0
- package/dist/ui/favicon.ico +0 -0
- package/dist/ui/favicon.svg +4 -0
- package/dist/ui/index.html +30 -0
- package/dist/ui/ork-wordmark-small-on-light.svg +4 -0
- package/dist/ui/ork-wordmark-small.svg +4 -0
- package/dist/ui-CZS1XKla.mjs +160 -0
- package/dist/usage-BIjf9Xdt.mjs +418 -0
- package/dist/watch-B8o4Szd_.mjs +394 -0
- package/package.json +4 -2
- package/dist/src-CJ_zF0Zj.mjs +0 -5433
package/THIRD_PARTY_NOTICES.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
Ork includes text adapted from the projects below. Their licenses follow.
|
|
4
4
|
|
|
5
|
+
The browser UI that `ork ui` serves bundles third-party packages (React, Base
|
|
6
|
+
UI, dockview, containerized-state, zod, Material Design Icons and the Geist
|
|
7
|
+
fonts among them). Their names, versions and license texts are generated from
|
|
8
|
+
the bundle at build time, in `dist/ui/THIRD_PARTY_LICENSES.txt` of the published
|
|
9
|
+
package, and served at `/THIRD_PARTY_LICENSES.txt` by `ork ui`
|
|
10
|
+
([ADR-040](https://github.com/mimshins/ork/blob/main/decisions/ADR-040-ui-stack.md)).
|
|
11
|
+
|
|
5
12
|
## Caveman
|
|
6
13
|
|
|
7
14
|
Ork's `caveman` practice
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { Ft as socketPath, It as wakeRun, rt as liveStatus } from "./src-Cz1yOUTg.mjs";
|
|
2
|
+
// ../core/src/remote/decide.ts
|
|
3
|
+
/**
|
|
4
|
+
* @file The open decisions of live runs, and answering one from another process
|
|
5
|
+
* (`ork decide`, the local server). An answer goes to the store (the first
|
|
6
|
+
* one wins), then the run is woken on its socket so it picks the answer up at
|
|
7
|
+
* once (specs/messaging.md).
|
|
8
|
+
*/
|
|
9
|
+
/** Open decisions whose run is still live, oldest first. */
|
|
10
|
+
const pendingDecisions = (store, filter) => {
|
|
11
|
+
const live = /* @__PURE__ */ new Map();
|
|
12
|
+
return store.decisions({
|
|
13
|
+
...filter,
|
|
14
|
+
status: "open"
|
|
15
|
+
}).filter((decision) => {
|
|
16
|
+
if (!live.has(decision.runId)) {
|
|
17
|
+
const [run] = store.lookup(decision.runId);
|
|
18
|
+
live.set(decision.runId, run !== void 0 && liveStatus(run) === "running");
|
|
19
|
+
}
|
|
20
|
+
return live.get(decision.runId) === true;
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Answers an open decision with one of its options, and wakes its run. `home`
|
|
25
|
+
* is `~`, where the sockets are (tests pass a folder); `by` says who answered.
|
|
26
|
+
*/
|
|
27
|
+
const answerDecision = async (store, id, choice, home, by = "decide") => {
|
|
28
|
+
const decision = store.decision(id);
|
|
29
|
+
if (decision === void 0) return {
|
|
30
|
+
ok: false,
|
|
31
|
+
error: `No decision \`${id}\`.`
|
|
32
|
+
};
|
|
33
|
+
if (!decision.options.some((o) => o.id === choice)) return {
|
|
34
|
+
ok: false,
|
|
35
|
+
error: `\`${choice}\` is not an option of \`${id}\`: \`${decision.options.map((o) => o.id).join("`, `")}\``
|
|
36
|
+
};
|
|
37
|
+
if (!store.answerDecision(id, choice, by)) {
|
|
38
|
+
const now = store.decision(id);
|
|
39
|
+
return {
|
|
40
|
+
ok: false,
|
|
41
|
+
error: now?.status === "answered" ? `${id} was already answered: ${now.answer ?? ""} (${now.answeredBy ?? ""})` : `${id} was withdrawn`
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
return {
|
|
45
|
+
ok: true,
|
|
46
|
+
woke: await wakeRun(socketPath(decision.runId, home))
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
// ../core/src/remote/session.ts
|
|
50
|
+
const chattable = (type) => type === "claude.leader" || type === "claude.worker";
|
|
51
|
+
/** Reads `node`'s session from a run's events, and every node's last output. */
|
|
52
|
+
const nodeSession = (events, node) => {
|
|
53
|
+
const session = {
|
|
54
|
+
known: false,
|
|
55
|
+
chattable: false,
|
|
56
|
+
running: false
|
|
57
|
+
};
|
|
58
|
+
const outputs = {};
|
|
59
|
+
for (const { event } of events) {
|
|
60
|
+
if (event.type === "run.started") {
|
|
61
|
+
const declared = event.nodes.find((n) => n.id === node);
|
|
62
|
+
if (declared !== void 0) {
|
|
63
|
+
session.known = true;
|
|
64
|
+
session.chattable = chattable(declared.type);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
if (event.type === "node.finished") outputs[event.id] = event.output;
|
|
68
|
+
if (!("id" in event) || event.id !== node) continue;
|
|
69
|
+
if (event.type === "node.started") {
|
|
70
|
+
session.known = true;
|
|
71
|
+
session.chattable = chattable(event.nodeType);
|
|
72
|
+
session.running = true;
|
|
73
|
+
}
|
|
74
|
+
if (event.type === "node.finished") session.running = false;
|
|
75
|
+
if (event.type === "worktree" && event.action === "created") session.checkout = {
|
|
76
|
+
path: event.path,
|
|
77
|
+
...event.branch === void 0 ? {} : { branch: event.branch },
|
|
78
|
+
own: true,
|
|
79
|
+
owner: node
|
|
80
|
+
};
|
|
81
|
+
if (event.type !== "node.event") continue;
|
|
82
|
+
const inner = event.event;
|
|
83
|
+
if (inner.type === "session.started") {
|
|
84
|
+
session.sessionId = inner.sessionId;
|
|
85
|
+
if (inner.cwd !== void 0) session.cwd = inner.cwd;
|
|
86
|
+
if (inner.driver !== void 0) session.driver = inner.driver;
|
|
87
|
+
}
|
|
88
|
+
if (inner.type === "session.finished" && inner.outcome.sessionId !== "") session.sessionId = inner.outcome.sessionId;
|
|
89
|
+
}
|
|
90
|
+
return {
|
|
91
|
+
session,
|
|
92
|
+
outputs
|
|
93
|
+
};
|
|
94
|
+
};
|
|
95
|
+
// src/__build_info__.ts
|
|
96
|
+
/**
|
|
97
|
+
* @file The published package's name and version, bound to
|
|
98
|
+
* `packages/cli/package.json`. Do not edit by hand: `pnpm changesets:version`
|
|
99
|
+
* and `pnpm build` rewrite it (`tools/release/build-info.ts`), and a test
|
|
100
|
+
* fails when it is stale.
|
|
101
|
+
*/
|
|
102
|
+
const ORK_NAME = "@krapht/ork";
|
|
103
|
+
const ORK_VERSION = "0.3.0";
|
|
104
|
+
export { pendingDecisions as a, answerDecision as i, ORK_VERSION as n, nodeSession as r, ORK_NAME as t };
|