@azure-id/orc 1.9.2 → 2.1.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/CHANGELOG.md +722 -0
- package/README-id.md +56 -42
- package/README.md +58 -41
- package/bin/build-agents.js +125 -29
- package/bin/clear-logs.js +620 -0
- package/bin/cli.js +1873 -180
- package/bin/fix.js +459 -0
- package/bin/gotcha-import.js +1081 -0
- package/bin/gotcha.js +1566 -0
- package/bin/graph-query.js +1 -1
- package/bin/graph.js +717 -717
- package/bin/habit.js +1538 -0
- package/bin/mockrun-catalog.js +284 -276
- package/bin/onboarding-content.js +2 -1
- package/bin/pricing.json +28 -21
- package/bin/run-undo.js +398 -0
- package/bin/trace-write.js +869 -0
- package/bin/verify-contracts.js +627 -100
- package/bin/verify-package.js +68 -10
- package/bin/webui/api.js +151 -6
- package/bin/webui/app.html +239 -232
- package/bin/webui/css/00-tokens.css +110 -92
- package/bin/webui/css/04-motion.css +87 -0
- package/bin/webui/css/06-responsive.css +203 -178
- package/bin/webui/css/panels/behaviour.css +205 -0
- package/bin/webui/css/panels/hookui.css +79 -0
- package/bin/webui/fixtures/behaviour.js +562 -0
- package/bin/webui/fixtures/extra.js +9 -9
- package/bin/webui/fixtures/flow.js +81 -81
- package/bin/webui/fixtures/hookui.js +506 -431
- package/bin/webui/fixtures/index.js +66 -3
- package/bin/webui/fixtures/knowledge.js +9 -3
- package/bin/webui/fixtures/maintenance.js +123 -42
- package/bin/webui/fixtures/rules.js +1007 -1002
- package/bin/webui/fixtures/settings.js +6 -7
- package/bin/webui/fixtures/stats.js +25 -6
- package/bin/webui/fixtures/wait.js +98 -97
- package/bin/webui/i18n/en/behaviour.json +156 -0
- package/bin/webui/i18n/en/hookui.json +290 -194
- package/bin/webui/i18n/en/maintenance.json +71 -52
- package/bin/webui/i18n/en/nav.json +25 -24
- package/bin/webui/i18n/en/settings.json +60 -60
- package/bin/webui/i18n/en/tour.json +37 -35
- package/bin/webui/i18n/id/behaviour.json +156 -0
- package/bin/webui/i18n/id/hookui.json +290 -194
- package/bin/webui/i18n/id/maintenance.json +71 -52
- package/bin/webui/i18n/id/nav.json +25 -24
- package/bin/webui/i18n/id/settings.json +60 -60
- package/bin/webui/i18n/id/tour.json +37 -35
- package/bin/webui/js/01-i18n.js +155 -154
- package/bin/webui/js/05-banners.js +181 -172
- package/bin/webui/js/06-edit.js +193 -183
- package/bin/webui/js/90-tour.js +498 -494
- package/bin/webui/js/91-shortcuts.js +126 -126
- package/bin/webui/js/99-boot.js +121 -118
- package/bin/webui/js/panels/behaviour.js +1087 -0
- package/bin/webui/js/panels/hookui.js +2196 -1691
- package/bin/webui/js/panels/maintenance.js +336 -235
- package/bin/webui/js/panels/settings.js +726 -719
- package/mock-run/INDEX.md +110 -107
- package/mock-run/extra-slots.md +1 -1
- package/mock-run/gotcha-import.md +118 -0
- package/mock-run/habits.md +129 -0
- package/mock-run/orc-aftermath.md +392 -392
- package/mock-run/orc-budget.md +29 -33
- package/mock-run/orc-cli.md +200 -200
- package/mock-run/orc-explain.md +86 -86
- package/mock-run/orc-extra.md +389 -392
- package/mock-run/orc-fix.md +87 -0
- package/mock-run/orc-pattern.md +112 -112
- package/mock-run/orc-quick.md +6 -1
- package/mock-run/orc.md +157 -157
- package/package.json +1 -1
- package/templates/agents/MODEL-MAPPING.md +37 -34
- package/templates/agents/orc-advisor-opus-5-xhigh.md +1 -7
- package/templates/agents/orc-analyze-mini-opus-5-med.md +1 -6
- package/templates/agents/orc-analyze-mini-sonnet-5-high.md +2 -5
- package/templates/agents/{orc-claude-writer-opus-4-8-high.md → orc-claude-writer-opus-5-low.md} +48 -53
- package/templates/agents/orc-context-combiner-opus-5-high.md +1 -11
- package/templates/agents/orc-executor-haiku-4-5.md +14 -6
- package/templates/agents/orc-executor-opus-4-7-high.md +14 -6
- package/templates/agents/orc-executor-opus-4-7-med.md +14 -6
- package/templates/agents/orc-executor-opus-4-8-high.md +14 -6
- package/templates/agents/orc-executor-opus-5-high.md +14 -6
- package/templates/agents/orc-executor-opus-5-low.md +14 -6
- package/templates/agents/orc-executor-opus-5-med.md +14 -6
- package/templates/agents/orc-executor-sonnet-4-6-high.md +14 -6
- package/templates/agents/orc-executor-sonnet-4-6-med.md +14 -6
- package/templates/agents/orc-executor-sonnet-5-high.md +15 -7
- package/templates/agents/orc-executor-sonnet-5-low.md +155 -0
- package/templates/agents/orc-executor-sonnet-5-med.md +155 -0
- package/templates/agents/orc-graph-noter-sonnet-4-6-med.md +1 -10
- package/templates/agents/orc-judge-opus-5-xhigh.md +5 -9
- package/templates/agents/orc-learn-writer-opus-5-low.md +1 -7
- package/templates/agents/orc-pattern-codifier-opus-5-med.md +1 -8
- package/templates/agents/orc-pattern-codifier-sonnet-5-high.md +58 -63
- package/templates/agents/orc-planner-mini-opus-5-med.md +1 -4
- package/templates/agents/orc-planner-mini-sonnet-5-high.md +2 -3
- package/templates/agents/orc-planner-opus-5-med.md +1 -4
- package/templates/agents/orc-recon-opus-5-low.md +1 -8
- package/templates/agents/orc-recon-sonnet-4-6-med.md +1 -8
- package/templates/agents/orc-retro-opus-5-med.md +6 -8
- package/templates/agents/orc-retro-sonnet-5-high.md +7 -8
- package/templates/agents/orc-reviewer-opus-5-low.md +96 -0
- package/templates/agents/orc-scout-opus-5-low.md +1 -6
- package/templates/agents/orc-scout-sonnet-4-6-high.md +35 -39
- package/templates/agents/orc-system-analyst-opus-5-high.md +1 -6
- package/templates/agents/orc-test-author-opus-5-med.md +4 -5
- package/templates/agents/orc-trace-writer-haiku-4-5.md +3 -7
- package/templates/agents/orc-verifier-opus-5-med.md +16 -8
- package/templates/agents/{orc-wiki-scanner-opus-4-8-high.md → orc-wiki-scanner-opus-5-low.md} +74 -79
- package/templates/agents/orc-wiki-scanner-sonnet-5-high.md +97 -106
- package/templates/commands/orc-analyze.md +13 -21
- package/templates/commands/orc-fast.md +10 -15
- package/templates/commands/orc-fix.md +18 -0
- package/templates/commands/orc-poly.md +12 -21
- package/templates/commands/orc-pr-driver.md +11 -30
- package/templates/commands/orc-pr-setup.md +10 -31
- package/templates/commands/orc-route.md +11 -41
- package/templates/commands/orc-test.md +5 -60
- package/templates/commands/orc-wiki.md +64 -64
- package/templates/hooks/README.md +109 -7
- package/templates/hooks/orc-session-hook.js +339 -0
- package/templates/hooks/orc-statusline-render.js +317 -23
- package/templates/hooks/orc-statusline.js +165 -50
- package/templates/hooks/orc-subagent-line.js +23 -5
- package/templates/hooks/orc-weather-fetch.js +123 -0
- package/templates/skills/_shared/README.md +9 -0
- package/templates/skills/_shared/code-graph.md +47 -55
- package/templates/skills/_shared/config-precedence.md +3 -1
- package/templates/skills/_shared/extra-dispatch.md +78 -93
- package/templates/skills/_shared/gotchas.md +248 -177
- package/templates/skills/_shared/habits.md +101 -0
- package/templates/skills/_shared/lane-contract.md +84 -0
- package/templates/skills/_shared/opus5-only.md +14 -14
- package/templates/skills/_shared/phases/README.md +142 -83
- package/templates/skills/_shared/phases/analyst-gates.md +10 -21
- package/templates/skills/_shared/phases/execution.md +8 -14
- package/templates/skills/_shared/phases/house-rules.md +27 -32
- package/templates/skills/_shared/phases/intake.md +127 -133
- package/templates/skills/_shared/phases/mock-example.md +46 -56
- package/templates/skills/_shared/phases/plan-handoff.md +91 -97
- package/templates/skills/_shared/phases/planning.md +7 -17
- package/templates/skills/_shared/phases/preflight.md +19 -42
- package/templates/skills/_shared/phases/review.md +24 -28
- package/templates/skills/_shared/phases/rules.md +18 -42
- package/templates/skills/_shared/phases/scoring.md +55 -65
- package/templates/skills/_shared/phases/security-checklist.md +46 -50
- package/templates/skills/_shared/phases/security.md +45 -55
- package/templates/skills/_shared/phases/ship.md +6 -15
- package/templates/skills/_shared/phases/stop-resume.md +2 -5
- package/templates/skills/_shared/phases/summary.md +73 -48
- package/templates/skills/_shared/phases/testgen.md +41 -51
- package/templates/skills/_shared/phases/trace-verbs.md +447 -0
- package/templates/skills/_shared/phases/trace.md +66 -297
- package/templates/skills/_shared/phases/verify.md +62 -70
- package/templates/skills/_shared/phases/wave-grouping.md +128 -133
- package/templates/skills/_shared/phases/wiki-consult.md +10 -6
- package/templates/skills/_shared/read-ladder.md +2 -55
- package/templates/skills/_shared/return-validation.md +17 -70
- package/templates/skills/_shared/review-slice.md +106 -0
- package/templates/skills/_shared/smoke-gate.md +46 -28
- package/templates/skills/_shared/wait.md +1 -0
- package/templates/skills/context-combiner/SKILL.md +15 -44
- package/templates/skills/orc/README.md +2 -2
- package/templates/skills/orc/SKILL.md +35 -63
- package/templates/skills/orc/config.md +25 -27
- package/templates/skills/orc/examples/full-run-mock.md +2 -1
- package/templates/skills/orc/references/effort-and-mode.md +17 -17
- package/templates/skills/orc/references/pattern-gate.md +89 -89
- package/templates/skills/orc/references/phases/intake.md +41 -47
- package/templates/skills/orc/references/phases/integration.md +13 -19
- package/templates/skills/orc/references/preflight-report.md +11 -12
- package/templates/skills/orc/references/ultra-mode.md +9 -7
- package/templates/skills/orc/schemas/checkpoint.md +122 -122
- package/templates/skills/orc/subskills/orc-execution/SKILL.md +27 -73
- package/templates/skills/orc/subskills/orc-execution/core.md +12 -99
- package/templates/skills/orc/subskills/orc-execution/subagent.md +14 -13
- package/templates/skills/orc/subskills/orc-review-verify/SKILL.md +12 -53
- package/templates/skills/orc/subskills/orc-review-verify/core.md +52 -135
- package/templates/skills/orc/subskills/orc-review-verify/subagent.md +7 -7
- package/templates/skills/orc/subskills/orc-testgen/SKILL.md +11 -22
- package/templates/skills/orc/subskills/orc-testgen/core.md +20 -59
- package/templates/skills/orc/subskills/orc-testgen/subagent.md +7 -7
- package/templates/skills/orc-advisor/SKILL.md +56 -60
- package/templates/skills/orc-analyze/SKILL.md +33 -67
- package/templates/skills/orc-analyze/schemas/report-audit.md +2 -1
- package/templates/skills/orc-analyze/schemas/report-prose.md +2 -1
- package/templates/skills/orc-analyze-mini/SKILL.md +35 -70
- package/templates/skills/orc-claude/SKILL.md +14 -14
- package/templates/skills/orc-claude/examples/claude-run-mock.md +65 -65
- package/templates/skills/orc-diy/README.md +31 -0
- package/templates/skills/orc-diy/SKILL.md +27 -78
- package/templates/skills/orc-diy/references/blocks/pattern.md +18 -18
- package/templates/skills/orc-fast/SKILL.md +49 -75
- package/templates/skills/orc-fix/SKILL.md +110 -0
- package/templates/skills/orc-judge/SKILL.md +77 -82
- package/templates/skills/orc-mini/SKILL.md +64 -112
- package/templates/skills/orc-mini/examples/mini-run-mock.md +4 -2
- package/templates/skills/orc-pattern/SKILL.md +27 -48
- package/templates/skills/orc-poly/SKILL.md +32 -61
- package/templates/skills/orc-pr-driver/SKILL.md +25 -51
- package/templates/skills/orc-pr-driver/references/green-gate.md +113 -105
- package/templates/skills/orc-pr-setup/SKILL.md +20 -45
- package/templates/skills/orc-quick/README.md +44 -3
- package/templates/skills/orc-quick/SKILL.md +77 -108
- package/templates/skills/orc-quick/references/dispatch-gate.md +18 -6
- package/templates/skills/orc-quick/references/gh-mode.md +50 -1
- package/templates/skills/orc-quick/references/look.md +3 -1
- package/templates/skills/orc-retro/SKILL.md +20 -19
- package/templates/skills/orc-retro/examples/retro-mock.md +17 -17
- package/templates/skills/orc-route/SKILL.md +25 -45
- package/templates/skills/orc-test/SKILL.md +16 -37
- package/templates/skills/orc-verify/SKILL.md +14 -32
- package/templates/skills/orc-wait/SKILL.md +156 -163
- package/templates/skills/orc-wiki/README.md +325 -325
- package/templates/skills/orc-wiki/SKILL.md +195 -195
- package/templates/skills/orc-wiki/examples/wiki-run-mock.md +37 -37
- package/templates/skills/orc-wiki/references/extra.md +2 -2
- package/templates/skills/orc-wiki/references/partial-refresh.md +276 -271
- package/templates/skills/orc-wiki/references/phases/phase-0.md +2 -7
- package/templates/skills/orc-wiki/references/phases/phase-1.md +1 -6
- package/templates/skills/orc-wiki/references/phases/phase-2.md +4 -9
- package/templates/skills/orc-wiki/references/phases/phase-3.md +1 -6
- package/templates/skills/orc-wiki/references/phases/phase-3c.md +4 -8
- package/templates/agents/orc-claude-writer-opus-5-med.md +0 -55
- package/templates/agents/orc-reviewer-opus-5-med.md +0 -60
- package/templates/agents/orc-wiki-scanner-opus-5-med.md +0 -81
|
@@ -1,235 +1,336 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/* panels/maintenance.js — orc ui client
|
|
3
|
-
Preview-then-apply. The apply button stays disabled until a preview was
|
|
4
|
-
fetched, the exact command is always visible, and a prune names EVERY file.
|
|
5
|
-
|
|
6
|
-
Loaded by app.html in the order its numeric prefix names. Classic
|
|
7
|
-
script, no import/export: an ES module import carries no query string,
|
|
8
|
-
and every static request here needs the per-launch session token. */
|
|
9
|
-
|
|
10
|
-
PANELS.maintenance = function (host) {
|
|
11
|
-
head(host, t("maintenance.title"), t("maintenance.sub"));
|
|
12
|
-
const body = el("div", "stack");
|
|
13
|
-
host.append(body);
|
|
14
|
-
renderMaintenance(body);
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
async function renderMaintenance(body) {
|
|
18
|
-
body.replaceChildren(skeleton(5));
|
|
19
|
-
const d = (await read("/api/maintenance")).data;
|
|
20
|
-
const out = frag();
|
|
21
|
-
|
|
22
|
-
out.append(el("div", "banner", t("maintenance.banner")));
|
|
23
|
-
|
|
24
|
-
// ADVANCED is a section, not a disclaimer (v0.44.0). Everything above targets
|
|
25
|
-
// THIS project; everything in the box below reaches outside it. The global
|
|
26
|
-
// update lives there because a stale global install is a failure this panel
|
|
27
|
-
// already reports and, until now, could only tell you to fix in a terminal.
|
|
28
|
-
const advanced = card(t("maintenance.advanced"));
|
|
29
|
-
advanced.id = "maintenance-advanced";
|
|
30
|
-
advanced.append(el("div", "note", t("maintenance.advancedNote")));
|
|
31
|
-
let anyAdvanced = false;
|
|
32
|
-
|
|
33
|
-
for (const a of d.actions) {
|
|
34
|
-
const row = el("div", "action");
|
|
35
|
-
row.dataset.action = a.id; // the upgrade spotlight anchors on this
|
|
36
|
-
const left = el("div");
|
|
37
|
-
// Action id, label and command are the server's catalog — the label
|
|
38
|
-
// describes an exact CLI invocation, so it is shown as written.
|
|
39
|
-
left.append(el("div", "setting-name", a.id));
|
|
40
|
-
left.append(el("div", "setting-desc", a.label));
|
|
41
|
-
left.append(el("div", "action-cmd", a.command));
|
|
42
|
-
if (a.network) left.append(el("div", "note", t("maintenance.network")));
|
|
43
|
-
|
|
44
|
-
// `upgrade` is the one action whose whole point is a comparison, so it says
|
|
45
|
-
// what it would actually do BEFORE you preview it — and offers to check
|
|
46
|
-
// again, because "up to date" is only as old as the last check.
|
|
47
|
-
if (a.id === "upgrade") {
|
|
48
|
-
const status = el("div", "action-status");
|
|
49
|
-
status.append(el("span", "note", t("maintenance.checking")));
|
|
50
|
-
left.append(status);
|
|
51
|
-
const paint = (v) => {
|
|
52
|
-
const s = versionState(v);
|
|
53
|
-
status.replaceChildren();
|
|
54
|
-
status.append(chip(s.label, s.kind), el("span", "note", s.note));
|
|
55
|
-
const again = el("button", "btn btn-ghost btn-sm btn-allow-busy", t("maintenance.checkAgain"));
|
|
56
|
-
again.type = "button";
|
|
57
|
-
again.addEventListener("click", () => {
|
|
58
|
-
status.replaceChildren(el("span", "note", t("common.checking")));
|
|
59
|
-
refreshVersion().then(paint).catch(() => status.replaceChildren(el("span", "note", t("maintenance.checkFailed"))));
|
|
60
|
-
});
|
|
61
|
-
status.append(again);
|
|
62
|
-
};
|
|
63
|
-
versionInfo().then(paint).catch(() => status.replaceChildren(el("span", "note", t("maintenance.couldNotCheck"))));
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
out.append(
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
const
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
);
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
b.append(
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
/* panels/maintenance.js — orc ui client
|
|
3
|
+
Preview-then-apply. The apply button stays disabled until a preview was
|
|
4
|
+
fetched, the exact command is always visible, and a prune names EVERY file.
|
|
5
|
+
|
|
6
|
+
Loaded by app.html in the order its numeric prefix names. Classic
|
|
7
|
+
script, no import/export: an ES module import carries no query string,
|
|
8
|
+
and every static request here needs the per-launch session token. */
|
|
9
|
+
|
|
10
|
+
PANELS.maintenance = function (host) {
|
|
11
|
+
head(host, t("maintenance.title"), t("maintenance.sub"));
|
|
12
|
+
const body = el("div", "stack");
|
|
13
|
+
host.append(body);
|
|
14
|
+
renderMaintenance(body);
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
async function renderMaintenance(body) {
|
|
18
|
+
body.replaceChildren(skeleton(5));
|
|
19
|
+
const d = (await read("/api/maintenance")).data;
|
|
20
|
+
const out = frag();
|
|
21
|
+
|
|
22
|
+
out.append(el("div", "banner", t("maintenance.banner")));
|
|
23
|
+
|
|
24
|
+
// ADVANCED is a section, not a disclaimer (v0.44.0). Everything above targets
|
|
25
|
+
// THIS project; everything in the box below reaches outside it. The global
|
|
26
|
+
// update lives there because a stale global install is a failure this panel
|
|
27
|
+
// already reports and, until now, could only tell you to fix in a terminal.
|
|
28
|
+
const advanced = card(t("maintenance.advanced"));
|
|
29
|
+
advanced.id = "maintenance-advanced";
|
|
30
|
+
advanced.append(el("div", "note", t("maintenance.advancedNote")));
|
|
31
|
+
let anyAdvanced = false;
|
|
32
|
+
|
|
33
|
+
for (const a of d.actions) {
|
|
34
|
+
const row = el("div", "action");
|
|
35
|
+
row.dataset.action = a.id; // the upgrade spotlight anchors on this
|
|
36
|
+
const left = el("div");
|
|
37
|
+
// Action id, label and command are the server's catalog — the label
|
|
38
|
+
// describes an exact CLI invocation, so it is shown as written.
|
|
39
|
+
left.append(el("div", "setting-name", a.id));
|
|
40
|
+
left.append(el("div", "setting-desc", a.label));
|
|
41
|
+
left.append(el("div", "action-cmd", a.command));
|
|
42
|
+
if (a.network) left.append(el("div", "note", t("maintenance.network")));
|
|
43
|
+
|
|
44
|
+
// `upgrade` is the one action whose whole point is a comparison, so it says
|
|
45
|
+
// what it would actually do BEFORE you preview it — and offers to check
|
|
46
|
+
// again, because "up to date" is only as old as the last check.
|
|
47
|
+
if (a.id === "upgrade") {
|
|
48
|
+
const status = el("div", "action-status");
|
|
49
|
+
status.append(el("span", "note", t("maintenance.checking")));
|
|
50
|
+
left.append(status);
|
|
51
|
+
const paint = (v) => {
|
|
52
|
+
const s = versionState(v);
|
|
53
|
+
status.replaceChildren();
|
|
54
|
+
status.append(chip(s.label, s.kind), el("span", "note", s.note));
|
|
55
|
+
const again = el("button", "btn btn-ghost btn-sm btn-allow-busy", t("maintenance.checkAgain"));
|
|
56
|
+
again.type = "button";
|
|
57
|
+
again.addEventListener("click", () => {
|
|
58
|
+
status.replaceChildren(el("span", "note", t("common.checking")));
|
|
59
|
+
refreshVersion().then(paint).catch(() => status.replaceChildren(el("span", "note", t("maintenance.checkFailed"))));
|
|
60
|
+
});
|
|
61
|
+
status.append(again);
|
|
62
|
+
};
|
|
63
|
+
versionInfo().then(paint).catch(() => status.replaceChildren(el("span", "note", t("maintenance.couldNotCheck"))));
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// v2.1.0 W7 — the clear-logs row says WHICH age it deletes at and when the
|
|
67
|
+
// automatic sweep last ran. Every number is the CLI's (`clear logs --summary`).
|
|
68
|
+
if (a.id === "clear-logs" && a.status) left.append(clearLogsStatus(a.status));
|
|
69
|
+
|
|
70
|
+
if (a.advanced) left.append(el("div", "note", t("maintenance.globalNote")));
|
|
71
|
+
|
|
72
|
+
const btn = el("button", "btn btn-sm", t("maintenance.preview"));
|
|
73
|
+
btn.type = "button";
|
|
74
|
+
btn.addEventListener("click", () => previewAction(a.id, body));
|
|
75
|
+
row.append(left, btn);
|
|
76
|
+
if (a.advanced) {
|
|
77
|
+
anyAdvanced = true;
|
|
78
|
+
advanced.append(row);
|
|
79
|
+
} else {
|
|
80
|
+
out.append(row);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
if (anyAdvanced) out.append(advanced);
|
|
85
|
+
|
|
86
|
+
const job = card(t("maintenance.lastRun"));
|
|
87
|
+
job.id = "job-card";
|
|
88
|
+
out.append(job);
|
|
89
|
+
body.replaceChildren(out);
|
|
90
|
+
refreshJob();
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// "Older than 90 days (Settings ▸ log retention). Last automatic sweep: …" —
|
|
94
|
+
// the day value links to the Settings row that sets it.
|
|
95
|
+
function clearLogsStatus(s) {
|
|
96
|
+
const box = el("div", "note");
|
|
97
|
+
const [pre, post] = t("maintenance.clearLogs.olderThan", { days: "\u0000" }).split("\u0000");
|
|
98
|
+
const link = el("a", null, t("maintenance.clearLogs.days", { n: s.older_than_days }));
|
|
99
|
+
link.href = "#/settings?key=log_retention_days";
|
|
100
|
+
box.append(document.createTextNode(pre || ""), link, document.createTextNode(post || ""));
|
|
101
|
+
box.append(document.createTextNode(" "));
|
|
102
|
+
box.append(
|
|
103
|
+
document.createTextNode(
|
|
104
|
+
s.last_sweep
|
|
105
|
+
? t("maintenance.clearLogs.lastSweep", { date: s.last_sweep.date, files: s.last_sweep.files })
|
|
106
|
+
: s.auto === "on"
|
|
107
|
+
? t("maintenance.clearLogs.noSweepYet")
|
|
108
|
+
: t("maintenance.clearLogs.autoOff")
|
|
109
|
+
)
|
|
110
|
+
);
|
|
111
|
+
if (s.pruned_runs) box.append(document.createTextNode(" " + t("maintenance.clearLogs.pruned", { n: s.pruned_runs })));
|
|
112
|
+
return box;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
// The third preview shape (v2.1.0 W7): `orc clear logs --json`. A table of
|
|
116
|
+
// what it would delete, the kept list with its reasons (collapsed), the totals
|
|
117
|
+
// and the old default folder. Rendered as the CLI wrote it.
|
|
118
|
+
function clearLogsPreview(b, pv) {
|
|
119
|
+
b.append(
|
|
120
|
+
kvList([
|
|
121
|
+
[t("maintenance.clearLogs.cutoff"), `${pv.cutoff} (${t("maintenance.clearLogs.days", { n: pv.effective_days })})`],
|
|
122
|
+
["log_dir", pv.log_dir],
|
|
123
|
+
["run_dir", pv.run_dir],
|
|
124
|
+
[t("maintenance.clearLogs.totals"), t("maintenance.clearLogs.totalsValue", { units: (pv.totals || {}).units || 0, files: (pv.totals || {}).files || 0, bytes: (pv.totals || {}).bytes || 0 })],
|
|
125
|
+
])
|
|
126
|
+
);
|
|
127
|
+
// The CLI's own sentences (cutoff moved, the old default folder) — shown as written.
|
|
128
|
+
for (const n of pv.notes || []) b.append(el("div", "note", n));
|
|
129
|
+
const del = pv.delete || [];
|
|
130
|
+
if (!del.length) b.append(el("div", "note", t("maintenance.clearLogs.none")));
|
|
131
|
+
else {
|
|
132
|
+
b.append(el("div", "note", t("maintenance.wouldDelete", { n: (pv.totals || {}).files || 0 })));
|
|
133
|
+
const tbl = el("table", "md-table");
|
|
134
|
+
const hr = el("tr");
|
|
135
|
+
for (const h of [t("maintenance.clearLogs.colPath"), t("maintenance.clearLogs.colKind"), t("maintenance.clearLogs.colLast"), t("maintenance.clearLogs.colBytes")]) hr.append(el("th", null, h));
|
|
136
|
+
tbl.append(hr);
|
|
137
|
+
for (const d of del) {
|
|
138
|
+
const tr = el("tr");
|
|
139
|
+
const p = el("td");
|
|
140
|
+
// EVERY file is named — a unit is several files, and a count is not consent.
|
|
141
|
+
const fl = el("div", "file-list");
|
|
142
|
+
for (const f of d.files || [d.path]) fl.append(el("div", null, f));
|
|
143
|
+
if (d.ref) fl.append(el("div", null, "git ref " + d.ref));
|
|
144
|
+
p.append(fl);
|
|
145
|
+
tr.append(p, el("td", null, d.kind), el("td", null, d.last_activity), el("td", null, String(d.bytes)));
|
|
146
|
+
tbl.append(tr);
|
|
147
|
+
}
|
|
148
|
+
b.append(tbl);
|
|
149
|
+
}
|
|
150
|
+
const keep = pv.keep || [];
|
|
151
|
+
if (keep.length) {
|
|
152
|
+
const det = el("details");
|
|
153
|
+
det.append(el("summary", null, t("maintenance.clearLogs.kept", { n: keep.length })));
|
|
154
|
+
const fl = el("div", "file-list");
|
|
155
|
+
for (const k of keep) fl.append(el("div", null, `${k.path} — ${k.reason}`));
|
|
156
|
+
det.append(fl);
|
|
157
|
+
b.append(det);
|
|
158
|
+
}
|
|
159
|
+
if (pv.default_dir)
|
|
160
|
+
b.append(
|
|
161
|
+
el(
|
|
162
|
+
"div",
|
|
163
|
+
"note",
|
|
164
|
+
t(pv.default_dir.included ? "maintenance.clearLogs.defaultIncluded" : "maintenance.clearLogs.defaultDir", {
|
|
165
|
+
path: pv.default_dir.path,
|
|
166
|
+
files: pv.default_dir.files,
|
|
167
|
+
bytes: pv.default_dir.bytes,
|
|
168
|
+
})
|
|
169
|
+
)
|
|
170
|
+
);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
async function previewAction(action, body) {
|
|
174
|
+
const d = (await read("/api/maintenance/preview?action=" + encodeURIComponent(action))).data;
|
|
175
|
+
const b = el("div");
|
|
176
|
+
|
|
177
|
+
b.append(el("div", null, d.label));
|
|
178
|
+
b.append(el("div", "action-cmd", d.command));
|
|
179
|
+
b.append(el("div", "note", t("maintenance.previewFrom", { command: d.preview_command })));
|
|
180
|
+
|
|
181
|
+
// Said BEFORE the apply, not discovered after it. A panel that reloads itself
|
|
182
|
+
// with no warning reads as a crash, and the whole point of this note is that
|
|
183
|
+
// the reload is the thing the user wanted.
|
|
184
|
+
if (d.restarts_ui) b.append(el("div", "note", t("maintenance.willRestart")));
|
|
185
|
+
|
|
186
|
+
// The one action that writes outside this project says so before it runs, and
|
|
187
|
+
// the preview it is showing came from the SAME target — `orc doctor --global`,
|
|
188
|
+
// not the project doctor.
|
|
189
|
+
if (d.advanced) {
|
|
190
|
+
const g = el("div", "banner");
|
|
191
|
+
g.append(el("div", null, t("maintenance.globalWarn")));
|
|
192
|
+
b.append(g);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
// Guard 1 — a run is mid-flight. Updating changes the skills that run will
|
|
196
|
+
// resume into. The CLI has no idea you are mid-run; this panel does.
|
|
197
|
+
let ackWaiting = !d.waiting_runs.length;
|
|
198
|
+
if (d.waiting_runs.length) {
|
|
199
|
+
const warn = el("div", "banner banner-bad");
|
|
200
|
+
const inner = el("div");
|
|
201
|
+
inner.append(el("strong", null, t("maintenance.waitingRuns", { n: d.waiting_runs.length })));
|
|
202
|
+
inner.append(
|
|
203
|
+
el(
|
|
204
|
+
"div",
|
|
205
|
+
null,
|
|
206
|
+
action === "clear-logs"
|
|
207
|
+
? t("maintenance.clearLogs.waitingBody", { slugs: d.waiting_runs.join(", ") })
|
|
208
|
+
: t("maintenance.waitingBody", { slugs: d.waiting_runs.join(", ") })
|
|
209
|
+
)
|
|
210
|
+
);
|
|
211
|
+
const lbl = el("label", "note");
|
|
212
|
+
const cb = el("input");
|
|
213
|
+
cb.type = "checkbox";
|
|
214
|
+
cb.addEventListener("change", () => {
|
|
215
|
+
ackWaiting = cb.checked;
|
|
216
|
+
syncApply();
|
|
217
|
+
});
|
|
218
|
+
lbl.append(cb, document.createTextNode(" " + t("maintenance.waitingAck")));
|
|
219
|
+
inner.append(lbl);
|
|
220
|
+
warn.append(inner);
|
|
221
|
+
b.append(warn);
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
// Guard 2 — a dirty working tree before an upgrade is worth a warning
|
|
225
|
+
// BEFORE, not a surprise after.
|
|
226
|
+
if (d.dirty_tree) {
|
|
227
|
+
const warn = el("div", "banner");
|
|
228
|
+
warn.append(el("div", null, t("maintenance.dirtyTree")));
|
|
229
|
+
b.append(warn);
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
const pv = d.preview || {};
|
|
233
|
+
if (action === "clear-logs") {
|
|
234
|
+
clearLogsPreview(b, pv);
|
|
235
|
+
} else if (action === "upgrade") {
|
|
236
|
+
b.append(
|
|
237
|
+
kvList([
|
|
238
|
+
[t("maintenance.installed"), pv.version],
|
|
239
|
+
[t("maintenance.available"), pv.latest || t("maintenance.availableUnknown")],
|
|
240
|
+
[t("maintenance.source"), pv.install_spec],
|
|
241
|
+
// The install URL and the URL the version number was read from are two
|
|
242
|
+
// different things. Showing only the first is how "up to date" becomes
|
|
243
|
+
// unfalsifiable from this panel.
|
|
244
|
+
[t("maintenance.checkedAt"), pv.checked_ref || pv.checked_source || t("maintenance.availableUnknown")],
|
|
245
|
+
[t("maintenance.updateAvailable"), pv.update_available ? t("maintenance.yes") : t("maintenance.no")],
|
|
246
|
+
])
|
|
247
|
+
);
|
|
248
|
+
b.append(el("div", "note", t("maintenance.upgradeNote")));
|
|
249
|
+
} else {
|
|
250
|
+
const findings = pv.findings || [];
|
|
251
|
+
b.append(
|
|
252
|
+
kvList([
|
|
253
|
+
[t("maintenance.installedPayload"), pv.installed_version],
|
|
254
|
+
[t("maintenance.thisCli"), pv.package_version],
|
|
255
|
+
[t("maintenance.findings"), String(findings.length)],
|
|
256
|
+
])
|
|
257
|
+
);
|
|
258
|
+
if (!findings.length) b.append(el("div", "note", t("maintenance.healthy")));
|
|
259
|
+
for (const f of findings) {
|
|
260
|
+
const line = el("div", "note");
|
|
261
|
+
line.append(
|
|
262
|
+
chip(f.fixable ? t("overview.doctor.fixable") : t("overview.doctor.manual"), f.fixable ? "info" : "warn"),
|
|
263
|
+
document.createTextNode(" " + f.message)
|
|
264
|
+
);
|
|
265
|
+
b.append(line);
|
|
266
|
+
}
|
|
267
|
+
// A count is NOT consent for a deletion — name every file.
|
|
268
|
+
if (d.names_files) {
|
|
269
|
+
const paths = findings.filter((f) => f.id === "orphan" || f.id === "orphan-candidates").flatMap((f) => f.paths || []);
|
|
270
|
+
const c = el("div");
|
|
271
|
+
c.append(el("div", "note", paths.length ? t("maintenance.wouldDelete", { n: paths.length }) : t("maintenance.wouldDeleteNone")));
|
|
272
|
+
if (paths.length) {
|
|
273
|
+
const fl = el("div", "file-list");
|
|
274
|
+
for (const p of paths) fl.append(el("div", null, p));
|
|
275
|
+
c.append(fl);
|
|
276
|
+
}
|
|
277
|
+
b.append(c);
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
let applyBtn = null;
|
|
282
|
+
const syncApply = () => {
|
|
283
|
+
if (applyBtn) applyBtn.disabled = !ackWaiting;
|
|
284
|
+
};
|
|
285
|
+
|
|
286
|
+
const actions = [{ label: t("common.cancel"), onClick: (c) => c() }];
|
|
287
|
+
if (action === "upgrade")
|
|
288
|
+
actions.push({
|
|
289
|
+
label: t("maintenance.checkOnly"),
|
|
290
|
+
onClick: () => toast(t("maintenance.checkOnlyDone"), "ok"),
|
|
291
|
+
});
|
|
292
|
+
actions.push({
|
|
293
|
+
label:
|
|
294
|
+
action === "prune"
|
|
295
|
+
? t("maintenance.applyPrune")
|
|
296
|
+
: action === "upgrade"
|
|
297
|
+
? t("maintenance.applyUpgrade")
|
|
298
|
+
: action === "clear-logs"
|
|
299
|
+
? t("maintenance.clearLogs.apply")
|
|
300
|
+
: t("maintenance.apply"),
|
|
301
|
+
cls: action === "prune" || action === "upgrade" || d.danger ? "btn-danger" : "btn-primary",
|
|
302
|
+
id: "apply-btn",
|
|
303
|
+
disabled: !ackWaiting,
|
|
304
|
+
onClick: async (close) => {
|
|
305
|
+
try {
|
|
306
|
+
await post("/api/maintenance/apply", { action });
|
|
307
|
+
close();
|
|
308
|
+
toast(t("maintenance.started", { command: d.command }), "ok");
|
|
309
|
+
setBusy(true);
|
|
310
|
+
refreshJob();
|
|
311
|
+
} catch (e) {
|
|
312
|
+
toast(t("maintenance.startFail"), "bad", String(e.message));
|
|
313
|
+
}
|
|
314
|
+
},
|
|
315
|
+
});
|
|
316
|
+
|
|
317
|
+
modal({ title: t("maintenance.previewTitle", { command: d.command }), body: b, actions });
|
|
318
|
+
applyBtn = document.getElementById("apply-btn");
|
|
319
|
+
syncApply();
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
/* ============================================== PROMISES · BOUNDARY · SELF-SERVE
|
|
323
|
+
(v0.46.0)
|
|
324
|
+
|
|
325
|
+
THE LINE, restated because these three panels sit right on it: a FREE action
|
|
326
|
+
gets a button, a PAID action gets a copy-able command. `orc pact check` runs
|
|
327
|
+
the ledger's own cheap proofs and `orc handoff set` edits one graded surface —
|
|
328
|
+
both deterministic, both a button. `/orc-pact`'s reconcile conversation and
|
|
329
|
+
`/orc-boundary`'s evidence pass cost model tokens, so they are commands with
|
|
330
|
+
the reason printed next to them.
|
|
331
|
+
|
|
332
|
+
And the second rule, which these panels are the first real test of: the CLI's
|
|
333
|
+
state words are the ONLY state words. HOLDING/DRIFTED/UNCHECKABLE/BROKEN and
|
|
334
|
+
EXECUTE/ESCALATE/REFUSE are rendered verbatim, never softened into a friendlier
|
|
335
|
+
synonym — a second vocabulary is drift no lint can see. test/webui.test.js
|
|
336
|
+
greps this file for the literals that must come from the CLI instead. */
|