@krapht/ork 1.0.0-alpha.1 → 1.0.0-alpha.11
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 +3 -4
- package/dist/{__build_info__-D9lSlMFy.mjs → __build_info__-CIchF6nr.mjs} +2 -2
- package/dist/bin.mjs +1479 -600
- package/dist/chips-BA7SrrH5.mjs +43 -0
- package/dist/{clean-CA_Oi2Wl.mjs → clean-Di-KT7Mf.mjs} +5 -2
- package/dist/{completion-DBGfL-gN.mjs → completion-C5D0sEs5.mjs} +23 -16
- package/dist/context-BaNshWr9.mjs +695 -0
- package/dist/{decide-CoIJh34e.mjs → decide-B6PnKeqo.mjs} +3 -3
- package/dist/{find-rBBk7Jui.mjs → find-BicBbGMg.mjs} +1 -1
- package/dist/format-lWhN-jYR.mjs +286 -0
- package/dist/{in-a-run-DdAakpRR.mjs → in-a-run-CgkVouyG.mjs} +1 -1
- package/dist/{limits-BPM9wUlV.mjs → limits-jZQp9ZJC.mjs} +1 -1
- package/dist/{list-Bv5Lxu7z.mjs → list-CEaJ07jd.mjs} +11 -4
- package/dist/{mcp-DM30MFBw.mjs → mcp-DYgVA9f5.mjs} +6 -6
- package/dist/output-CM95njYt.mjs +421 -0
- package/dist/{pause-C7lJkSma.mjs → pause-D6PuSlNl.mjs} +4 -4
- package/dist/{relay-BipJYszF.mjs → relay-DNx7be9k.mjs} +2 -2
- package/dist/{remove-BDs9isB6.mjs → remove-CpMb4NDl.mjs} +14 -7
- package/dist/{report-DK4LGqwF.mjs → report-CEN8VoUb.mjs} +31 -20
- package/dist/{send-nbkjf3sc.mjs → send-CLs_fyg7.mjs} +3 -3
- package/dist/{src-BxUJPGa5.mjs → src-9iGkjnsy.mjs} +487 -341
- package/dist/{src-B0TT7DBi.mjs → src-B6KvTm7B.mjs} +106 -90
- package/dist/src-BnZgZGrf.mjs +2697 -0
- package/dist/{src-hrj2h0IZ.mjs → src-D6_xjm-x.mjs} +6719 -3389
- package/dist/ui/THIRD_PARTY_LICENSES.txt +594 -0
- package/dist/ui/assets/app-CxURph7a.js +75 -0
- package/dist/ui/assets/app-QoHVi-mb.css +1 -0
- package/dist/ui/assets/{index-CPx74lFf.js → index-By_8KKG6.js} +3 -3
- package/dist/ui/assets/theme-CdXvqTQ6.js +1 -0
- package/dist/ui/index.html +2 -2
- package/dist/{ui-B98FSboa.mjs → ui-CIci4UBW.mjs} +4 -4
- package/dist/{usage-EW7DI6Z7.mjs → usage-GceBGMjU.mjs} +43 -32
- package/dist/{watch-BAkSGaOp.mjs → watch-BmoybMQg.mjs} +28 -16
- package/dist/{workflows-vsEohqa7.mjs → workflows-DZvW3i1e.mjs} +4 -3
- package/dist/{worktrees-Ahj9rdWK.mjs → worktrees-Be51E2rB.mjs} +84 -24
- package/package.json +2 -4
- package/dist/context-6x3kXREO.mjs +0 -274
- package/dist/format-zMmhqyLE.mjs +0 -427
- package/dist/output-TV_j7Ni0.mjs +0 -950
- package/dist/src-B9v0lDc6.mjs +0 -1204
- package/dist/ui/assets/app-BNT0SuIz.css +0 -1
- package/dist/ui/assets/app-CmkynZyW.js +0 -67
- package/dist/ui/assets/theme-3xH5jxKs.js +0 -1
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { c as CHIP, l as NODE_PALETTE, u as apply } from "./output-CM95njYt.mjs";
|
|
2
|
+
// src/term/chips.ts
|
|
3
|
+
/** The chip words the kit's commands use. */
|
|
4
|
+
const CHIP_LABELS = {
|
|
5
|
+
ask: "ASK",
|
|
6
|
+
run: "RUN",
|
|
7
|
+
ok: "OK",
|
|
8
|
+
fail: "FAIL",
|
|
9
|
+
wait: "WAIT",
|
|
10
|
+
warn: "WARN",
|
|
11
|
+
skip: "SKIP",
|
|
12
|
+
error: "ERROR"
|
|
13
|
+
};
|
|
14
|
+
/** A run's or trigger's state word as a chip: its label and role. */
|
|
15
|
+
const statusChip = (status) => {
|
|
16
|
+
const role = status === "running" ? "accent" : status === "succeeded" ? "ok" : status === "failed" || status === "crashed" ? "danger" : [
|
|
17
|
+
"paused",
|
|
18
|
+
"budget_exhausted",
|
|
19
|
+
"quota_exhausted",
|
|
20
|
+
"timed_out",
|
|
21
|
+
"interrupted"
|
|
22
|
+
].includes(status) ? "warn" : "muted";
|
|
23
|
+
return {
|
|
24
|
+
label: status === "running" ? CHIP_LABELS.run : status === "succeeded" ? CHIP_LABELS.ok : status === "failed" ? CHIP_LABELS.fail : status.replaceAll("_", " ").toUpperCase(),
|
|
25
|
+
role
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
/** A chip: ` LABEL ` on the role's background; `[LABEL]` when plain. */
|
|
29
|
+
const chip = (term, label, role) => term.rich ? apply(term, CHIP[role], ` ${label} `) : `[${label}]`;
|
|
30
|
+
/** A stable non-negative number for `text` (FNV-1a). */
|
|
31
|
+
const hash = (text) => {
|
|
32
|
+
let h = 2166136261;
|
|
33
|
+
for (const char of text) h = Math.imul(h ^ (char.codePointAt(0) ?? 0), 16777619);
|
|
34
|
+
return h >>> 0;
|
|
35
|
+
};
|
|
36
|
+
/** The palette slot of a node id, 0 to 5, the same on every call. */
|
|
37
|
+
const nodeSlot = (id) => hash(id) % NODE_PALETTE.length;
|
|
38
|
+
/** A node's chip: its id on the color its id picks; `[id]` when plain. */
|
|
39
|
+
const nodeChip = (term, id) => {
|
|
40
|
+
const format = NODE_PALETTE[nodeSlot(id)] ?? CHIP.muted;
|
|
41
|
+
return term.rich ? apply(term, format, ` ${id} `) : `[${id}]`;
|
|
42
|
+
};
|
|
43
|
+
export { statusChip as i, chip as n, nodeChip as r, CHIP_LABELS as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { D as removeWorktree, k as gitOk } from "./src-D6_xjm-x.mjs";
|
|
2
2
|
// ../core/src/worktree/clean.ts
|
|
3
3
|
/**
|
|
4
4
|
* @file What `ork worktrees clean` and `ork worktrees remove` do with what
|
|
@@ -11,6 +11,7 @@ const keyOf = (item) => item.branch ?? item.path ?? `${item.runId}/${item.nodeId
|
|
|
11
11
|
/** The reasons no `force` overrides: removing would break something. */
|
|
12
12
|
const MAIN_CHECKOUT = "checked out in the main checkout";
|
|
13
13
|
const RUN_GOING = "its run is still going";
|
|
14
|
+
const NOT_ORKS = "not created by Ork";
|
|
14
15
|
const kept = (item, skip) => ({
|
|
15
16
|
item,
|
|
16
17
|
removeWorktree: false,
|
|
@@ -19,6 +20,7 @@ const kept = (item, skip) => ({
|
|
|
19
20
|
});
|
|
20
21
|
/** What clean does with one item. */
|
|
21
22
|
const cleanStep = (item, options) => {
|
|
23
|
+
if (!item.recorded) return kept(item, NOT_ORKS);
|
|
22
24
|
if (item.inMainCheckout) return kept(item, MAIN_CHECKOUT);
|
|
23
25
|
if (item.heldBy !== void 0) return kept(item, `checked out in ${item.heldBy}`);
|
|
24
26
|
if (options.live?.has(item.runId) === true) return kept(item, RUN_GOING);
|
|
@@ -45,7 +47,8 @@ const stepActs = (step) => step.removeWorktree || step.deleteBranch || stepPrune
|
|
|
45
47
|
* What `ork worktrees clean` would do. A worktree with uncommitted changes, an
|
|
46
48
|
* unmerged branch, or a detached worktree holding commits no branch has, is
|
|
47
49
|
* kept unless `force`; one checked out in the main checkout or in a worktree
|
|
48
|
-
* Ork didn't create,
|
|
50
|
+
* Ork didn't create, whose run is still going, or an `ork/` branch no run
|
|
51
|
+
* recorded creating, is kept even then.
|
|
49
52
|
*/
|
|
50
53
|
const planClean = (items, filter, options) => items.filter((item) => filter.runId === void 0 || item.runId === filter.runId).filter((item) => filter.key === void 0 || keyOf(item) === filter.key).filter((item) => !filter.merged || item.merged).map((item) => cleanStep(item, options));
|
|
51
54
|
/**
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as builtinWorkflowNames, n as pendingDecisions, o as builtinWorkflowText, s as isBuiltinArg } from "./decide-
|
|
3
|
-
import { t as findRun } from "./find-
|
|
4
|
-
import { c as openStore, l as storePath, o as writeErr } from "./output-TV_j7Ni0.mjs";
|
|
1
|
+
import { Ar as AGENT_DRIVERS, Bn as placeFiles, C as openStore, Vn as placeFor, w as storePath, xt as liveStatus, yr as NodeIdSchema } from "./src-D6_xjm-x.mjs";
|
|
2
|
+
import { a as builtinWorkflowNames, n as pendingDecisions, o as builtinWorkflowText, s as isBuiltinArg } from "./decide-B6PnKeqo.mjs";
|
|
3
|
+
import { t as findRun } from "./find-BicBbGMg.mjs";
|
|
5
4
|
import { a as findEntry, c as subcommandsOf, d as SHELL_SCRIPTS, l as COMPLETE_COMMAND, n as groupedEntries, r as argInfoOf, t as groupOf, u as SHELLS } from "./help-groups-BwYoAWsh.mjs";
|
|
6
|
-
import {
|
|
5
|
+
import { o as writeErr } from "./output-CM95njYt.mjs";
|
|
6
|
+
import { a as resolveWorkflowArg, n as WORKFLOW_SUFFIX } from "./workflows-DZvW3i1e.mjs";
|
|
7
7
|
import path from "node:path";
|
|
8
8
|
import { parse } from "yaml";
|
|
9
9
|
import { existsSync, readFileSync, readdirSync, statSync } from "node:fs";
|
|
@@ -117,7 +117,7 @@ const decisions = {
|
|
|
117
117
|
};
|
|
118
118
|
const drivers = {
|
|
119
119
|
group: "drivers",
|
|
120
|
-
values: () =>
|
|
120
|
+
values: () => AGENT_DRIVERS.map((driver) => ({
|
|
121
121
|
value: driver.id,
|
|
122
122
|
description: driver.label
|
|
123
123
|
}))
|
|
@@ -184,16 +184,23 @@ const subcommandSections = (position) => {
|
|
|
184
184
|
};
|
|
185
185
|
const flagSection = (position) => ({
|
|
186
186
|
title: "flags",
|
|
187
|
-
candidates: [
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
187
|
+
candidates: [
|
|
188
|
+
...position.flags.flatMap((flag) => [{
|
|
189
|
+
value: `--${flag.name}`,
|
|
190
|
+
description: brief(flag.description)
|
|
191
|
+
}, ...flag.negatable ? [{
|
|
192
|
+
value: `--no-${flag.name}`,
|
|
193
|
+
description: `Turn off --${flag.name}`
|
|
194
|
+
}] : []]),
|
|
195
|
+
{
|
|
196
|
+
value: "--plain",
|
|
197
|
+
description: "Plain output, no color or redraw"
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
value: "--help",
|
|
201
|
+
description: "Show this command's help"
|
|
202
|
+
}
|
|
203
|
+
]
|
|
197
204
|
});
|
|
198
205
|
const fromProvider = (provider, context) => provider === void 0 ? NONE : {
|
|
199
206
|
sections: [{
|