token-harness 0.1.12 → 0.1.13
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 +51 -73
- package/package.json +1 -1
- package/sbom.json +3 -3
- package/token-harness.mjs +346 -160
package/README.md
CHANGED
|
@@ -29,90 +29,67 @@ of CLI commands to memorize.
|
|
|
29
29
|
|
|
30
30
|
### First run
|
|
31
31
|
|
|
32
|
-
|
|
33
|
-
2. If setup is incomplete, choose **Open setup**.
|
|
34
|
-
3. In **Setup**, work from top to bottom:
|
|
35
|
-
- Coding agents
|
|
36
|
-
- Managed optimizers
|
|
37
|
-
- Optional agent tuning
|
|
38
|
-
- Checks and maintenance
|
|
39
|
-
4. For Claude Code or Codex, choose **Review baseline** when the RTK + HarnessTrim setup is available.
|
|
40
|
-
5. Read the exact proposed changes. **Apply reviewed setup** appears only when there is a concrete
|
|
41
|
-
safe plan to apply.
|
|
42
|
-
6. Keep using Claude Code or Codex normally.
|
|
43
|
-
7. Open **Results** when you want to see what Token Harness can actually prove.
|
|
32
|
+
The first screen is **Overview**. There is no separate Setup page to learn.
|
|
44
33
|
|
|
45
|
-
|
|
46
|
-
|
|
34
|
+
1. Token Harness detects Claude Code and Codex.
|
|
35
|
+
2. Each detected coding agent says either **Ready** or **Setup incomplete**.
|
|
36
|
+
3. If setup is incomplete, choose **Finish setup** on that agent. Token Harness prepares the
|
|
37
|
+
recommended **RTK + HarnessTrim** baseline and shows the exact safe plan before anything changes.
|
|
38
|
+
4. The **Optimizers** section keeps the recommended baseline separate from optional tools
|
|
39
|
+
(mcptoon, GitNexus and Headroom). When a tool needs an action, that action appears on the same
|
|
40
|
+
card as the status it refers to.
|
|
41
|
+
5. **Health and updates** is maintenance, not another onboarding checklist. Normal setup performs its
|
|
42
|
+
own safety checks. Use **Re-check health** for troubleshooting and **Check for updates** when you
|
|
43
|
+
want to inspect provider versions. If a reviewed update is available, the same dialog offers
|
|
44
|
+
**Install updates** after showing the versions.
|
|
45
|
+
6. Keep using Claude Code or Codex normally. Open **Results** when you want detailed evidence.
|
|
47
46
|
|
|
48
|
-
|
|
47
|
+
Opening the app does not change your configuration. A configuration or software change is always
|
|
48
|
+
previewed first and requires an explicit review and approval.
|
|
49
49
|
|
|
50
|
-
|
|
50
|
+
## The two views
|
|
51
51
|
|
|
52
|
-
|
|
52
|
+
### Overview
|
|
53
53
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
- what should I do next;
|
|
57
|
-
- what value has actually been measured;
|
|
58
|
-
- whether quality or an integration needs attention.
|
|
54
|
+
Overview is both the first-run screen and the normal status screen. It keeps the two product entities
|
|
55
|
+
separate:
|
|
59
56
|
|
|
60
|
-
|
|
61
|
-
is
|
|
57
|
+
- **Coding agents** — currently Claude Code and Codex. Detection only means Token Harness can see the
|
|
58
|
+
agent; first-run setup is complete for that agent only when both RTK and HarnessTrim are connected.
|
|
59
|
+
- **Optimizers** — RTK and HarnessTrim are the recommended baseline. mcptoon, GitNexus and Headroom
|
|
60
|
+
are optional reviewed integrations with narrower prerequisites and compatibility boundaries.
|
|
62
61
|
|
|
63
|
-
|
|
62
|
+
The status at the top always answers what to do next. States such as **Setup incomplete**,
|
|
63
|
+
**Installed · not connected**, **Needs attention**, or **Update available** have their action beside
|
|
64
|
+
the affected agent or optimizer instead of in a separate action list.
|
|
64
65
|
|
|
65
|
-
|
|
66
|
+
Overview also contains a compact **Measured impact** summary. Missing evidence is shown as unknown,
|
|
67
|
+
never as zero savings.
|
|
66
68
|
|
|
67
|
-
|
|
69
|
+
Advanced agent details and reasoning preferences are collapsed because they are not required for
|
|
70
|
+
first-run optimizer setup.
|
|
68
71
|
|
|
69
|
-
|
|
70
|
-
useful read-only allowance and connected-tool observations when available.
|
|
72
|
+
### Optimizer lifecycle and evidence
|
|
71
73
|
|
|
72
|
-
**
|
|
74
|
+
The recommended baseline remains **RTK + HarnessTrim** on individually reviewed combinations.
|
|
75
|
+
Token Harness also exposes **mcptoon**, **GitNexus** and **Headroom** as optional managed integrations
|
|
76
|
+
on exact reviewed lifecycle rows. Enabling an optional optimizer does not make it part of the
|
|
77
|
+
production baseline and does not create a savings claim.
|
|
73
78
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
from healthy individual checks. Token Harness can prepare their integration transactionally, show the
|
|
80
|
-
exact plan, apply it only after approval, verify it, and remove only configuration it owns.
|
|
79
|
+
Token Harness can prepare supported integration changes transactionally, show the exact plan, apply
|
|
80
|
+
it only after approval, verify what the declared tier can verify, and remove only configuration it
|
|
81
|
+
owns. GitNexus is never auto-indexed and its noncommercial license boundary stays visible. Headroom
|
|
82
|
+
remains config-only managed on its reviewed row; Token Harness does not bootstrap uv/Python or start
|
|
83
|
+
wrapper/proxy/deploy flows.
|
|
81
84
|
|
|
82
|
-
For maintainers
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
telemetry can be attributed by exclusion only when one harness is wired. With multiple harnesses, an
|
|
87
|
-
unattributable receipt stays **Unavailable** instead of being copied across rows. A `not-exercised`
|
|
88
|
-
result does not promise that ordinary agent use will create a receipt: the provider must record a
|
|
89
|
-
qualifying operation, and for reducers that means a real reduction. `stack-review` does not run an
|
|
90
|
-
active canary or spend a model call, and it never makes the compatibility decision itself. The
|
|
91
|
-
shipped combined-review registry stays empty until the captured configuration has enough real
|
|
92
|
-
verification evidence, has been benchmarked together, and has been deliberately reviewed; see
|
|
93
|
-
`docs/combined-stack-reviews.md`.
|
|
85
|
+
For maintainers, `token-harness stack-review --json` captures the exact configured provider versions
|
|
86
|
+
and managed harness sets for combined-stack review. Runtime evidence is credited only when it can be
|
|
87
|
+
attributed to the relevant harness; missing attribution remains unavailable rather than being copied
|
|
88
|
+
across rows.
|
|
94
89
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
not a separate novice setup product. Once a tool has a reviewed managed lifecycle, Setup presents it in
|
|
99
|
-
the same **Optimization Stack** with its exact state, version, prerequisites, harness scope and safe
|
|
100
|
-
Apply/Remove controls. Evaluation evidence never turns into a savings or compatibility claim by itself.
|
|
101
|
-
|
|
102
|
-
Headroom is config-only managed on its exact reviewed 0.37.0 row. Token Harness can own the narrow
|
|
103
|
-
Claude Code or Codex MCP registration after the pinned CLI is present; it deliberately does not
|
|
104
|
-
bootstrap `uv`/Python, start wrappers/proxies, or claim runtime compression savings. GitNexus likewise
|
|
105
|
-
does not auto-index repositories, and its noncommercial license boundary stays visible.
|
|
106
|
-
|
|
107
|
-
**4. Optional agent tuning**
|
|
108
|
-
|
|
109
|
-
Reasoning preferences are separate from optimizer installation. They are persistent agent settings,
|
|
110
|
-
not hidden per-task switches, and are changed only through the normal preview/apply flow.
|
|
111
|
-
|
|
112
|
-
**5. Checks and maintenance**
|
|
113
|
-
|
|
114
|
-
Read-only integration checks, update checks and safe removal/undo controls live here. An update
|
|
115
|
-
outside reviewed compatibility is not forced.
|
|
90
|
+
Evaluation campaigns are an advanced maintainer workflow, not a novice setup step. Normal managed
|
|
91
|
+
setup stays in the unified **Optimization Stack** and historical candidate evidence never turns into
|
|
92
|
+
a savings, compatibility or promotion claim by itself.
|
|
116
93
|
|
|
117
94
|
### Results
|
|
118
95
|
|
|
@@ -384,8 +361,9 @@ Update Token Harness itself:
|
|
|
384
361
|
npm install --global token-harness@latest
|
|
385
362
|
```
|
|
386
363
|
|
|
387
|
-
Provider checks and reviewed updates are in **
|
|
388
|
-
|
|
364
|
+
Provider checks and reviewed updates are in **Overview -> Health and updates**. The browser first
|
|
365
|
+
checks reviewed channels and, when an installable update exists, offers **Install updates** in the
|
|
366
|
+
same dialog. From the advanced CLI, the preview prints the exact confirmation command:
|
|
389
367
|
|
|
390
368
|
```sh
|
|
391
369
|
token-harness update
|
|
@@ -442,7 +420,7 @@ Node must be at least 22.13. Reopen the terminal after installation if needed.
|
|
|
442
420
|
|
|
443
421
|
### Setup or verification needs attention
|
|
444
422
|
|
|
445
|
-
Use the action shown
|
|
423
|
+
Use the action shown beside the affected agent or optimizer in Overview. For technical evidence:
|
|
446
424
|
|
|
447
425
|
```sh
|
|
448
426
|
token-harness doctor --verbose
|
package/package.json
CHANGED
package/sbom.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"bomFormat": "CycloneDX",
|
|
3
3
|
"specVersion": "1.5",
|
|
4
|
-
"serialNumber": "urn:uuid:
|
|
4
|
+
"serialNumber": "urn:uuid:f53f4600-4e02-4fbe-462d-286326adfd0b",
|
|
5
5
|
"version": 1,
|
|
6
6
|
"metadata": {
|
|
7
7
|
"component": {
|
|
8
8
|
"type": "application",
|
|
9
9
|
"bom-ref": "token-harness",
|
|
10
10
|
"name": "token-harness",
|
|
11
|
-
"version": "0.1.
|
|
11
|
+
"version": "0.1.13",
|
|
12
12
|
"description": "Quota-aware efficiency layer for Claude Code and Codex subscription limits.",
|
|
13
13
|
"licenses": [
|
|
14
14
|
{
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"hashes": [
|
|
21
21
|
{
|
|
22
22
|
"alg": "SHA-256",
|
|
23
|
-
"content": "
|
|
23
|
+
"content": "f53f46004e024fbe462d286326adfd0be1a2e5d5c2678346e1e2e7e39bce853b"
|
|
24
24
|
}
|
|
25
25
|
]
|
|
26
26
|
},
|
package/token-harness.mjs
CHANGED
|
@@ -9387,7 +9387,7 @@ var TOOL_VERSION;
|
|
|
9387
9387
|
var init_version2 = __esm({
|
|
9388
9388
|
"apps/cli/dist/src/version.js"() {
|
|
9389
9389
|
"use strict";
|
|
9390
|
-
TOOL_VERSION = "0.1.
|
|
9390
|
+
TOOL_VERSION = "0.1.13";
|
|
9391
9391
|
}
|
|
9392
9392
|
});
|
|
9393
9393
|
|
|
@@ -28522,7 +28522,7 @@ async function runUpdate(context) {
|
|
|
28522
28522
|
receiptId: null
|
|
28523
28523
|
}
|
|
28524
28524
|
};
|
|
28525
|
-
return result5(EXIT_CODES["confirmation-required"],
|
|
28525
|
+
return result5(EXIT_CODES["confirmation-required"], report2, [
|
|
28526
28526
|
...preparedDiagnostics,
|
|
28527
28527
|
adoptionConfirmationDiagnostic(plan6),
|
|
28528
28528
|
confirmationDiagnostic(report2)
|
|
@@ -32816,6 +32816,52 @@ var init_guided = __esm({
|
|
|
32816
32816
|
if (approval === null || approval.id !== data["ticket"] || this.now() >= approval.expires)
|
|
32817
32817
|
throw new GuideError(409, "This preview expired or was already used. Review a fresh preview.");
|
|
32818
32818
|
this.approval = null;
|
|
32819
|
+
if (approval.operation === "update") {
|
|
32820
|
+
this.record("Installing only the reviewed provider updates you approved.", "working");
|
|
32821
|
+
let result6;
|
|
32822
|
+
try {
|
|
32823
|
+
result6 = await this.call(["update", "--yes"]);
|
|
32824
|
+
} catch {
|
|
32825
|
+
this.invalidateObservedState();
|
|
32826
|
+
const message = "The update stopped before its final result could be read. No automatic retry was made. Refresh and inspect the installed optimizer versions before retrying.";
|
|
32827
|
+
this.record(message, "attention");
|
|
32828
|
+
return {
|
|
32829
|
+
ok: false,
|
|
32830
|
+
title: "Update result needs checking",
|
|
32831
|
+
messages: [message],
|
|
32832
|
+
appliedPlans: 0
|
|
32833
|
+
};
|
|
32834
|
+
}
|
|
32835
|
+
if (result6.exitCode !== 0 || result6.data === null) {
|
|
32836
|
+
const message = explainGuideIssue(result6.diagnostics, "The reviewed optimizer update was not applied. The installed version, update channel or compatibility evidence changed after the preview, so nothing was forced.");
|
|
32837
|
+
this.invalidateObservedState();
|
|
32838
|
+
this.record(message, "attention");
|
|
32839
|
+
return {
|
|
32840
|
+
ok: false,
|
|
32841
|
+
title: "Optimizer update was not applied",
|
|
32842
|
+
messages: [message],
|
|
32843
|
+
appliedPlans: 0
|
|
32844
|
+
};
|
|
32845
|
+
}
|
|
32846
|
+
const applied = result6.data.execution?.results.filter((row2) => row2.status === "applied") ?? [];
|
|
32847
|
+
this.lastApplied = null;
|
|
32848
|
+
this.invalidateObservedState();
|
|
32849
|
+
const messages2 = applied.length > 0 ? [
|
|
32850
|
+
"The reviewed optimizer update completed successfully.",
|
|
32851
|
+
"Token Harness re-ran the update transaction safety checks before changing software.",
|
|
32852
|
+
"Choose Refresh to read the installed versions again. Reopen a coding agent if the updated optimizer requires it."
|
|
32853
|
+
] : [
|
|
32854
|
+
"No optimizer needed an update by the time the approved action ran.",
|
|
32855
|
+
"Nothing was forced. Choose Refresh to read the current versions."
|
|
32856
|
+
];
|
|
32857
|
+
this.record(applied.length > 0 ? "Reviewed optimizer update installed." : "Optimizer update no longer needed.", "success");
|
|
32858
|
+
return {
|
|
32859
|
+
ok: true,
|
|
32860
|
+
title: applied.length > 0 ? "Optimizer updated" : "Already up to date",
|
|
32861
|
+
messages: messages2,
|
|
32862
|
+
appliedPlans: applied.length
|
|
32863
|
+
};
|
|
32864
|
+
}
|
|
32819
32865
|
if (approval.operation === "candidate-apply" || approval.operation === "candidate-uninstall") {
|
|
32820
32866
|
if (approval.candidate === void 0 || approval.candidateHarness === void 0)
|
|
32821
32867
|
throw new GuideError(409, "This experimental preview is incomplete. Review it again.");
|
|
@@ -32971,6 +33017,7 @@ var init_guided = __esm({
|
|
|
32971
33017
|
}
|
|
32972
33018
|
async checkUpdates() {
|
|
32973
33019
|
return this.exclusive(async () => {
|
|
33020
|
+
this.approval = null;
|
|
32974
33021
|
this.record("Checking provider update channels without changing software.", "working");
|
|
32975
33022
|
const updateResult = await this.call(["update"]);
|
|
32976
33023
|
const inventory = await this.call(["doctor"]);
|
|
@@ -32982,7 +33029,8 @@ var init_guided = __esm({
|
|
|
32982
33029
|
ok: false,
|
|
32983
33030
|
title: "Update check needs attention",
|
|
32984
33031
|
messages: [message],
|
|
32985
|
-
appliedPlans: 0
|
|
33032
|
+
appliedPlans: 0,
|
|
33033
|
+
ticket: null
|
|
32986
33034
|
};
|
|
32987
33035
|
}
|
|
32988
33036
|
const fingerprint = stackFingerprint(inventory.data);
|
|
@@ -33004,7 +33052,8 @@ var init_guided = __esm({
|
|
|
33004
33052
|
title: "Update check needs attention",
|
|
33005
33053
|
messages: [message],
|
|
33006
33054
|
appliedPlans: 0,
|
|
33007
|
-
stack: stack2
|
|
33055
|
+
stack: stack2,
|
|
33056
|
+
ticket: null
|
|
33008
33057
|
};
|
|
33009
33058
|
}
|
|
33010
33059
|
this.updates = { fingerprint, report: updateResult.data };
|
|
@@ -33012,19 +33061,43 @@ var init_guided = __esm({
|
|
|
33012
33061
|
const blocked = updateResult.data.providers.filter((row2) => row2.verdict === "blocked-unreviewed");
|
|
33013
33062
|
const messages = [];
|
|
33014
33063
|
if (available.length > 0) {
|
|
33015
|
-
messages.push(...available.map((row2) => `${name(row2.providerId)}: ${row2.installed ?? "installed version"} \u2192 ${row2.available ?? "new version"} is
|
|
33064
|
+
messages.push(...available.map((row2) => `${name(row2.providerId)}: ${row2.installed ?? "installed version"} \u2192 ${row2.available ?? "new version"} is reviewed and ready to install.`));
|
|
33016
33065
|
}
|
|
33017
33066
|
if (blocked.length > 0) {
|
|
33018
|
-
messages.push(...blocked.map((row2) => `${name(row2.providerId)}: ${row2.available ?? "a newer version"} exists, but Token Harness is keeping ${row2.installed ?? "the installed version"}
|
|
33067
|
+
messages.push(...blocked.map((row2) => `${name(row2.providerId)}: ${row2.available ?? "a newer version"} exists, but Token Harness is keeping ${row2.installed ?? "the installed version"} because that newer combination is not reviewed yet.`));
|
|
33019
33068
|
}
|
|
33020
33069
|
if (available.length === 0 && blocked.length === 0)
|
|
33021
|
-
messages.push("
|
|
33022
|
-
|
|
33070
|
+
messages.push("Your managed optimizers are up to date on their reviewed channels.");
|
|
33071
|
+
let ticket = null;
|
|
33072
|
+
if (available.length > 0) {
|
|
33073
|
+
ticket = this.random();
|
|
33074
|
+
const expires = this.now() + 10 * 6e4;
|
|
33075
|
+
this.approval = {
|
|
33076
|
+
id: ticket,
|
|
33077
|
+
expires,
|
|
33078
|
+
plans: [],
|
|
33079
|
+
transactionId: null,
|
|
33080
|
+
provider: null,
|
|
33081
|
+
description: "Optimizer updates",
|
|
33082
|
+
operation: "update",
|
|
33083
|
+
network: updateResult.data.network.length > 0
|
|
33084
|
+
};
|
|
33085
|
+
messages.push("Review the versions above, then choose Install updates. Token Harness will re-check the update channels and transaction safety rules before changing software.");
|
|
33086
|
+
} else {
|
|
33087
|
+
messages.push("No software was changed.");
|
|
33088
|
+
}
|
|
33023
33089
|
const stack = this.stackSnapshot();
|
|
33024
33090
|
if (this.cached !== null)
|
|
33025
33091
|
this.cached.value = { ...this.cached.value, stack };
|
|
33026
|
-
this.record("Provider update check completed. No
|
|
33027
|
-
return {
|
|
33092
|
+
this.record(available.length > 0 ? "Reviewed optimizer update available. Waiting for your approval." : "Provider update check completed. No reviewed update is pending.", "success");
|
|
33093
|
+
return {
|
|
33094
|
+
ok: true,
|
|
33095
|
+
title: available.length > 0 ? "Updates available" : "Optimizers up to date",
|
|
33096
|
+
messages,
|
|
33097
|
+
appliedPlans: 0,
|
|
33098
|
+
stack,
|
|
33099
|
+
ticket
|
|
33100
|
+
};
|
|
33028
33101
|
});
|
|
33029
33102
|
}
|
|
33030
33103
|
async verify() {
|
|
@@ -35024,9 +35097,8 @@ var init_guided_product_client = __esm({
|
|
|
35024
35097
|
const count = value => new Intl.NumberFormat(undefined, { maximumFractionDigits: 1 }).format(value);
|
|
35025
35098
|
const date = value => value ? new Date(value).toLocaleString() : 'not recorded';
|
|
35026
35099
|
const VIEWS = {
|
|
35027
|
-
dashboard: ['
|
|
35028
|
-
|
|
35029
|
-
results: ['Results', 'Measured savings, quality evidence, and recent activity.'],
|
|
35100
|
+
dashboard: ['Overview', 'Your coding agents, optimizer setup, health and measured results in one place.'],
|
|
35101
|
+
results: ['Results', 'Detailed measured savings, quality evidence, and recent activity.'],
|
|
35030
35102
|
};
|
|
35031
35103
|
const TOOL_INFO = {
|
|
35032
35104
|
rtk: {
|
|
@@ -35232,6 +35304,24 @@ var init_guided_product_client = __esm({
|
|
|
35232
35304
|
return (current?.stack?.components || []).filter(component => component.configured);
|
|
35233
35305
|
}
|
|
35234
35306
|
|
|
35307
|
+
function componentConfiguredFor(id, agentId) {
|
|
35308
|
+
const component = managedComponent(id);
|
|
35309
|
+
return Boolean(component?.configuredHarnesses?.includes(agentId));
|
|
35310
|
+
}
|
|
35311
|
+
|
|
35312
|
+
function baselineReadyFor(agentId) {
|
|
35313
|
+
return componentConfiguredFor('rtk', agentId) && componentConfiguredFor('harnesstrim', agentId);
|
|
35314
|
+
}
|
|
35315
|
+
|
|
35316
|
+
function baselineIncompleteAgents() {
|
|
35317
|
+
return activeAgents().filter(agent => !baselineReadyFor(agent.id));
|
|
35318
|
+
}
|
|
35319
|
+
|
|
35320
|
+
function providerSupportsAgent(providerId, agentId) {
|
|
35321
|
+
if (providerId === 'gitnexus') return agentId === 'claude';
|
|
35322
|
+
return agentId === 'claude' || agentId === 'codex';
|
|
35323
|
+
}
|
|
35324
|
+
|
|
35235
35325
|
function candidateObservation(id) {
|
|
35236
35326
|
return (current?.optimizationCandidates || []).find(item => item.id === id) || null;
|
|
35237
35327
|
}
|
|
@@ -35278,21 +35368,21 @@ var init_guided_product_client = __esm({
|
|
|
35278
35368
|
|
|
35279
35369
|
function setupAssessment() {
|
|
35280
35370
|
const agents = activeAgents();
|
|
35281
|
-
const
|
|
35371
|
+
const incomplete = baselineIncompleteAgents();
|
|
35282
35372
|
const stack = current?.stack;
|
|
35283
35373
|
if (!agents.length)
|
|
35284
35374
|
return {
|
|
35285
35375
|
label: 'Agent needed',
|
|
35286
35376
|
cls: 'warn',
|
|
35287
|
-
title: '
|
|
35288
|
-
detail: 'Token Harness could not find
|
|
35289
|
-
action: '
|
|
35377
|
+
title: 'Install or expose Claude Code or Codex first',
|
|
35378
|
+
detail: 'Token Harness could not find a supported coding agent in the environment that started this app.',
|
|
35379
|
+
action: 'none',
|
|
35290
35380
|
};
|
|
35291
35381
|
if (current?.value?.quality?.state === 'regressed')
|
|
35292
35382
|
return {
|
|
35293
35383
|
label: 'Needs attention',
|
|
35294
35384
|
cls: 'warn',
|
|
35295
|
-
title: '
|
|
35385
|
+
title: 'Measured quality needs attention',
|
|
35296
35386
|
detail: 'A paired benchmark favored the baseline. Token Harness is not crediting the affected savings.',
|
|
35297
35387
|
action: 'results',
|
|
35298
35388
|
};
|
|
@@ -35300,31 +35390,33 @@ var init_guided_product_client = __esm({
|
|
|
35300
35390
|
return {
|
|
35301
35391
|
label: 'Needs attention',
|
|
35302
35392
|
cls: 'warn',
|
|
35303
|
-
title: 'One
|
|
35304
|
-
detail: '
|
|
35305
|
-
action: '
|
|
35393
|
+
title: 'One configured optimizer needs attention',
|
|
35394
|
+
detail: 'Use Re-check health below to see whether the configured integration still matches its reviewed state.',
|
|
35395
|
+
action: 'verify',
|
|
35306
35396
|
};
|
|
35307
|
-
if (
|
|
35397
|
+
if (incomplete.length)
|
|
35308
35398
|
return {
|
|
35309
35399
|
label: 'Setup incomplete',
|
|
35310
35400
|
cls: 'warn',
|
|
35311
|
-
title:
|
|
35312
|
-
|
|
35313
|
-
|
|
35401
|
+
title: incomplete.length === 1
|
|
35402
|
+
? 'Finish setup for ' + incomplete[0].name
|
|
35403
|
+
: 'Finish the recommended setup for your coding agents',
|
|
35404
|
+
detail: 'The recommended baseline is RTK + HarnessTrim. Finish setup on each incomplete coding-agent card below; you will see the exact safe plan before anything changes.',
|
|
35405
|
+
action: 'configure',
|
|
35314
35406
|
};
|
|
35315
35407
|
if (!(current?.savings?.rows || []).length)
|
|
35316
35408
|
return {
|
|
35317
35409
|
label: 'Ready',
|
|
35318
35410
|
cls: 'good',
|
|
35319
|
-
title: '
|
|
35320
|
-
detail: '
|
|
35411
|
+
title: 'Recommended setup is complete',
|
|
35412
|
+
detail: 'Use your coding agents normally. Measured results will appear when Token Harness has evidence to report.',
|
|
35321
35413
|
action: 'results',
|
|
35322
35414
|
};
|
|
35323
35415
|
return {
|
|
35324
35416
|
label: 'Ready',
|
|
35325
35417
|
cls: 'good',
|
|
35326
|
-
title: 'Your
|
|
35327
|
-
detail: 'No
|
|
35418
|
+
title: 'Your recommended setup is active',
|
|
35419
|
+
detail: 'No setup action is required. The summary below shows what Token Harness can actually measure.',
|
|
35328
35420
|
action: 'results',
|
|
35329
35421
|
};
|
|
35330
35422
|
}
|
|
@@ -35342,15 +35434,14 @@ var init_guided_product_client = __esm({
|
|
|
35342
35434
|
const assessment = setupAssessment();
|
|
35343
35435
|
$('dashboard-status').replaceChildren();
|
|
35344
35436
|
const main = node('div');
|
|
35345
|
-
main.append(node('span', '
|
|
35437
|
+
main.append(node('span', 'CURRENT STATUS', 'eyebrow'), node('h2', assessment.title), node('p', assessment.detail));
|
|
35346
35438
|
const actions = node('div', undefined, 'inline-actions');
|
|
35347
|
-
|
|
35348
|
-
|
|
35349
|
-
|
|
35350
|
-
|
|
35351
|
-
|
|
35352
|
-
if (
|
|
35353
|
-
main.append(actions);
|
|
35439
|
+
if (assessment.action === 'verify') {
|
|
35440
|
+
actions.append(actionButton('Re-check health', () => readOnlyOperation('verify')));
|
|
35441
|
+
} else if (assessment.action === 'results') {
|
|
35442
|
+
actions.append(navigateButton('View detailed results', 'results'));
|
|
35443
|
+
}
|
|
35444
|
+
if (actions.children.length) main.append(actions);
|
|
35354
35445
|
$('dashboard-status').append(main, pill(assessment.label, assessment.cls));
|
|
35355
35446
|
|
|
35356
35447
|
const reduction = bestReduction();
|
|
@@ -35364,46 +35455,18 @@ var init_guided_product_client = __esm({
|
|
|
35364
35455
|
metricCard('API cost', 'Not measured yet', 'Requires billed-token evidence and a verified price basis.'),
|
|
35365
35456
|
metricCard('Quality', quality.value, quality.detail, quality.cls),
|
|
35366
35457
|
);
|
|
35367
|
-
|
|
35368
|
-
const active = $('dashboard-active');
|
|
35369
|
-
active.replaceChildren();
|
|
35370
|
-
for (const agent of activeAgents()) {
|
|
35371
|
-
const row = node('div', undefined, 'status-row');
|
|
35372
|
-
row.append(node('div', agent.name + (agent.version ? ' · v' + agent.version : '')), pill(agent.state, agent.configured ? 'good' : ''));
|
|
35373
|
-
active.append(row);
|
|
35374
|
-
}
|
|
35375
|
-
for (const component of configuredProviders()) {
|
|
35376
|
-
const row = node('div', undefined, 'status-row');
|
|
35377
|
-
const name = TOOL_INFO[component.providerId]?.name || component.displayName || component.providerId;
|
|
35378
|
-
const configuredFor = (component.configuredHarnesses || []).map(agentName).join(', ');
|
|
35379
|
-
row.append(node('div', name + (configuredFor ? ' · ' + configuredFor : '')), pill(component.health === 'healthy' ? 'Verified' : 'Configured', component.health === 'attention' ? 'warn' : 'good'));
|
|
35380
|
-
active.append(row);
|
|
35381
|
-
}
|
|
35382
|
-
if (!active.children.length) active.append(sectionEmpty('No managed optimization is active yet. Open Setup to start.'));
|
|
35383
|
-
|
|
35384
|
-
const checklist = $('dashboard-checklist');
|
|
35385
|
-
checklist.replaceChildren();
|
|
35386
|
-
const agentReady = activeAgents().length > 0;
|
|
35387
|
-
const managedReady = configuredProviders().length > 0;
|
|
35388
|
-
const evidenceReady = (current?.savings?.rows || []).length > 0;
|
|
35389
|
-
for (const item of [
|
|
35390
|
-
[agentReady, 'Coding agent detected', agentReady ? activeAgents().map(agent => agent.name).join(', ') : 'Claude Code or Codex must be visible to this process.'],
|
|
35391
|
-
[managedReady, 'Managed optimizer configured', managedReady ? configuredProviders().map(item => TOOL_INFO[item.providerId]?.name || item.providerId).join(', ') : 'RTK/HarnessTrim setup has not been completed yet.'],
|
|
35392
|
-
[evidenceReady, 'Measured result available', evidenceReady ? 'Recorded optimization evidence is available.' : 'Use your configured coding agent normally to build evidence.'],
|
|
35393
|
-
]) {
|
|
35394
|
-
const row = node('div', undefined, 'check-row');
|
|
35395
|
-
row.append(node('span', item[0] ? '✓' : '○', 'check-icon ' + (item[0] ? 'done' : '')), node('div'));
|
|
35396
|
-
row.lastChild.append(node('strong', item[1]), node('p', item[2], 'caption'));
|
|
35397
|
-
checklist.append(row);
|
|
35398
|
-
}
|
|
35399
35458
|
}
|
|
35400
35459
|
|
|
35401
35460
|
function componentState(component) {
|
|
35402
|
-
if (!component) return { label: 'Not
|
|
35461
|
+
if (!component || component.detectedState === 'absent') return { label: 'Not installed', cls: '' };
|
|
35403
35462
|
if (component.health === 'attention') return { label: 'Needs attention', cls: 'warn' };
|
|
35404
|
-
if (component.configured)
|
|
35405
|
-
|
|
35406
|
-
|
|
35463
|
+
if (component.configured)
|
|
35464
|
+
return {
|
|
35465
|
+
label: component.verification === 'verified' ? 'Connected · verified' : 'Connected',
|
|
35466
|
+
cls: 'good',
|
|
35467
|
+
};
|
|
35468
|
+
if (component.installed) return { label: 'Installed · not connected', cls: '' };
|
|
35469
|
+
return { label: 'Not installed', cls: '' };
|
|
35407
35470
|
}
|
|
35408
35471
|
|
|
35409
35472
|
function renderManagedTool(id) {
|
|
@@ -35415,29 +35478,61 @@ var init_guided_product_client = __esm({
|
|
|
35415
35478
|
const title = node('div');
|
|
35416
35479
|
title.append(
|
|
35417
35480
|
node('h3', info.name),
|
|
35418
|
-
node('span', info.optional ? 'Optional
|
|
35481
|
+
node('span', info.optional ? 'Optional optimizer' : 'Recommended baseline', 'caption'),
|
|
35419
35482
|
);
|
|
35420
35483
|
head.append(title, pill(state.label, state.cls));
|
|
35421
35484
|
card.append(head, node('p', info.role));
|
|
35485
|
+
|
|
35422
35486
|
const facts = node('div', undefined, 'tool-facts');
|
|
35487
|
+
if (component?.version) facts.append(node('span', 'Installed version'), node('strong', 'v' + component.version));
|
|
35423
35488
|
const configuredFor = component?.configuredHarnesses?.length
|
|
35424
35489
|
? component.configuredHarnesses.map(agentName).join(', ')
|
|
35425
|
-
: '
|
|
35426
|
-
facts.append(node('span', '
|
|
35427
|
-
if (component?.
|
|
35490
|
+
: 'Not connected to a coding agent';
|
|
35491
|
+
facts.append(node('span', 'Connection'), node('strong', configuredFor));
|
|
35492
|
+
if (component?.update === 'available')
|
|
35493
|
+
facts.append(
|
|
35494
|
+
node('span', 'Update'),
|
|
35495
|
+
node('strong', 'v' + (component.updateAvailableVersion || 'new version') + ' available'),
|
|
35496
|
+
);
|
|
35497
|
+
else if (component?.update === 'blocked')
|
|
35498
|
+
facts.append(node('span', 'Update'), node('strong', 'Newer version not reviewed yet'));
|
|
35428
35499
|
card.append(facts);
|
|
35500
|
+
|
|
35429
35501
|
if (component?.warnings?.length) {
|
|
35430
35502
|
const attention = component.health === 'attention';
|
|
35431
35503
|
const prerequisite = !component.installed && component.nextAction?.kind === 'install-configure';
|
|
35432
35504
|
if (attention || prerequisite)
|
|
35433
35505
|
card.append(
|
|
35434
35506
|
messageBox(
|
|
35435
|
-
attention ? 'Needs attention' : '
|
|
35507
|
+
attention ? 'Needs attention' : 'Setup requirement',
|
|
35436
35508
|
component.warnings[0].message,
|
|
35437
35509
|
attention ? 'warn' : '',
|
|
35438
35510
|
),
|
|
35439
35511
|
);
|
|
35440
35512
|
}
|
|
35513
|
+
|
|
35514
|
+
const actions = node('div', undefined, 'inline-actions');
|
|
35515
|
+
if (info.optional) {
|
|
35516
|
+
for (const agent of activeAgents()) {
|
|
35517
|
+
if (!providerSupportsAgent(id, agent.id)) continue;
|
|
35518
|
+
if (!component?.configuredHarnesses?.includes(agent.id))
|
|
35519
|
+
actions.append(
|
|
35520
|
+
actionButton(
|
|
35521
|
+
'Set up for ' + agent.name,
|
|
35522
|
+
() => reviewSetup(agent.id, id),
|
|
35523
|
+
'secondary',
|
|
35524
|
+
),
|
|
35525
|
+
);
|
|
35526
|
+
}
|
|
35527
|
+
}
|
|
35528
|
+
if (component?.update === 'available')
|
|
35529
|
+
actions.append(actionButton('Install update', () => readOnlyOperation('updates'), 'secondary'));
|
|
35530
|
+
if (
|
|
35531
|
+
component?.configured &&
|
|
35532
|
+
(component.health === 'attention' || component.verification === 'degraded')
|
|
35533
|
+
)
|
|
35534
|
+
actions.append(actionButton('Re-check health', () => readOnlyOperation('verify'), 'secondary'));
|
|
35535
|
+
if (actions.children.length) card.append(actions);
|
|
35441
35536
|
return card;
|
|
35442
35537
|
}
|
|
35443
35538
|
|
|
@@ -35445,16 +35540,47 @@ var init_guided_product_client = __esm({
|
|
|
35445
35540
|
const root = $('setup-agents');
|
|
35446
35541
|
root.replaceChildren();
|
|
35447
35542
|
if (!activeAgents().length) {
|
|
35448
|
-
root.append(
|
|
35543
|
+
root.append(
|
|
35544
|
+
messageBox(
|
|
35545
|
+
'No supported coding agent detected',
|
|
35546
|
+
'Start Token Harness from a terminal where Claude Code or Codex is installed and available on PATH, then choose Refresh.',
|
|
35547
|
+
'warn',
|
|
35548
|
+
),
|
|
35549
|
+
);
|
|
35449
35550
|
return;
|
|
35450
35551
|
}
|
|
35451
35552
|
for (const agent of activeAgents()) {
|
|
35553
|
+
const ready = baselineReadyFor(agent.id);
|
|
35452
35554
|
const card = node('article', undefined, 'tool-card compact');
|
|
35453
35555
|
const head = node('div', undefined, 'tool-head');
|
|
35454
35556
|
const title = node('div');
|
|
35455
|
-
title.append(
|
|
35456
|
-
|
|
35457
|
-
|
|
35557
|
+
title.append(
|
|
35558
|
+
node('h3', agent.name),
|
|
35559
|
+
node('span', agent.version ? 'v' + agent.version : 'Version unavailable', 'caption'),
|
|
35560
|
+
);
|
|
35561
|
+
head.append(title, pill(ready ? 'Ready' : 'Setup incomplete', ready ? 'good' : 'warn'));
|
|
35562
|
+
card.append(
|
|
35563
|
+
head,
|
|
35564
|
+
node(
|
|
35565
|
+
'p',
|
|
35566
|
+
ready
|
|
35567
|
+
? 'RTK + HarnessTrim are configured for this coding agent.'
|
|
35568
|
+
: 'The agent is detected. Finish the recommended RTK + HarnessTrim setup to complete onboarding.',
|
|
35569
|
+
),
|
|
35570
|
+
);
|
|
35571
|
+
if (agent.providers?.length)
|
|
35572
|
+
card.append(
|
|
35573
|
+
node(
|
|
35574
|
+
'p',
|
|
35575
|
+
'Connected optimizers: ' + agent.providers.join(', '),
|
|
35576
|
+
'caption',
|
|
35577
|
+
),
|
|
35578
|
+
);
|
|
35579
|
+
if (!ready) {
|
|
35580
|
+
const actions = node('div', undefined, 'inline-actions');
|
|
35581
|
+
actions.append(actionButton('Finish setup', () => reviewSetup(agent.id)));
|
|
35582
|
+
card.append(actions);
|
|
35583
|
+
}
|
|
35458
35584
|
root.append(card);
|
|
35459
35585
|
}
|
|
35460
35586
|
}
|
|
@@ -35466,16 +35592,18 @@ var init_guided_product_client = __esm({
|
|
|
35466
35592
|
const provider = providerId ? TOOL_INFO[providerId] : null;
|
|
35467
35593
|
if (providerId && !provider) return;
|
|
35468
35594
|
const run = modal(
|
|
35469
|
-
provider
|
|
35595
|
+
provider
|
|
35596
|
+
? 'Set up ' + provider.name + ' for ' + agent.name
|
|
35597
|
+
: 'Set up recommended optimizers for ' + agent.name,
|
|
35470
35598
|
);
|
|
35471
35599
|
$('modal-content').append(
|
|
35472
35600
|
messageBox(
|
|
35473
|
-
'
|
|
35601
|
+
'Safe preview first',
|
|
35474
35602
|
provider
|
|
35475
|
-
? 'Token Harness will inspect only ' + provider.name + ' for ' + agent.name + '
|
|
35476
|
-
: '
|
|
35603
|
+
? 'Token Harness will inspect only ' + provider.name + ' for ' + agent.name + '. If setup is supported, the exact change appears before you confirm it.'
|
|
35604
|
+
: 'Token Harness will prepare the recommended RTK + HarnessTrim setup for ' + agent.name + '. The exact files and changes appear before you confirm them.',
|
|
35477
35605
|
),
|
|
35478
|
-
messageBox('Nothing changes yet', 'This step
|
|
35606
|
+
messageBox('Nothing changes yet', 'This first step only prepares the safe plan. You decide whether to apply it after seeing the concrete changes.'),
|
|
35479
35607
|
progress('Checking ' + agent.name, 'Reading installed optimizer versions and current integration state.'),
|
|
35480
35608
|
);
|
|
35481
35609
|
if (providerId === 'gitnexus')
|
|
@@ -35502,13 +35630,20 @@ var init_guided_product_client = __esm({
|
|
|
35502
35630
|
$('modal-content').replaceChildren();
|
|
35503
35631
|
$('modal-content').append(
|
|
35504
35632
|
messageBox(
|
|
35505
|
-
'
|
|
35633
|
+
provider ? 'This optimizer only' : 'Recommended setup',
|
|
35506
35634
|
provider
|
|
35507
|
-
?
|
|
35508
|
-
: 'This
|
|
35635
|
+
? 'This approval changes only ' + provider.name + ' for ' + agent.name + '. Other optimizers are left unchanged.'
|
|
35636
|
+
: 'This approval covers only RTK + HarnessTrim for ' + agent.name + '. Optional optimizers stay separate.',
|
|
35509
35637
|
),
|
|
35510
35638
|
);
|
|
35511
|
-
if (!data.changes.length)
|
|
35639
|
+
if (!data.changes.length)
|
|
35640
|
+
$('modal-content').append(
|
|
35641
|
+
messageBox(
|
|
35642
|
+
'No setup change available',
|
|
35643
|
+
(data.notices || []).join(' ') ||
|
|
35644
|
+
'This setup is already complete, or a prerequisite/version prevents Token Harness from changing it safely.',
|
|
35645
|
+
),
|
|
35646
|
+
);
|
|
35512
35647
|
for (const change of data.changes) {
|
|
35513
35648
|
const item = node('article', undefined, 'preview-change');
|
|
35514
35649
|
item.append(node('h3', change.title), node('p', change.description));
|
|
@@ -35517,7 +35652,10 @@ var init_guided_product_client = __esm({
|
|
|
35517
35652
|
for (const notice of data.notices || []) $('modal-content').append(node('p', notice, 'notice-row'));
|
|
35518
35653
|
$('modal-content').append(messageBox('Safety', 'Apply uses the existing transactional engine with backups, compatibility checks, ownership checks and rollback. Unsupported versions are not forced.', 'safe'));
|
|
35519
35654
|
$('modal-actions').replaceChildren(modalClose(data.ticket ? 'Cancel' : 'Done'));
|
|
35520
|
-
if (data.ticket)
|
|
35655
|
+
if (data.ticket)
|
|
35656
|
+
$('modal-actions').append(
|
|
35657
|
+
actionButton(provider ? 'Set up ' + provider.name : 'Apply recommended setup', () => applyTicket(data.ticket), ''),
|
|
35658
|
+
);
|
|
35521
35659
|
})
|
|
35522
35660
|
.catch(error => {
|
|
35523
35661
|
if (run !== modalRun) return;
|
|
@@ -35560,45 +35698,15 @@ var init_guided_product_client = __esm({
|
|
|
35560
35698
|
$('managed-tools').replaceChildren(
|
|
35561
35699
|
renderManagedTool('rtk'),
|
|
35562
35700
|
renderManagedTool('harnesstrim'),
|
|
35563
|
-
renderManagedTool('mcptoon'),
|
|
35564
|
-
renderManagedTool('gitnexus'),
|
|
35565
|
-
renderManagedTool('headroom'),
|
|
35566
|
-
);
|
|
35567
|
-
const actions = $('managed-setup-actions');
|
|
35568
|
-
actions.replaceChildren();
|
|
35569
|
-
if (!activeAgents().length) {
|
|
35570
|
-
actions.append(sectionEmpty('A supported coding agent must be detected before managed setup can be reviewed.'));
|
|
35571
|
-
return;
|
|
35572
|
-
}
|
|
35573
|
-
actions.append(node('p', 'Choose the agent you want to configure. Review setup is read-only; Apply appears only after a concrete safe plan is shown.', 'caption'));
|
|
35574
|
-
const buttons = node('div', undefined, 'inline-actions');
|
|
35575
|
-
for (const agent of activeAgents())
|
|
35576
|
-
buttons.append(actionButton('Review baseline for ' + agent.name, () => reviewSetup(agent.id)));
|
|
35577
|
-
actions.append(buttons);
|
|
35578
|
-
|
|
35579
|
-
const optional = node('div', undefined, 'managed-optional');
|
|
35580
|
-
optional.append(
|
|
35581
|
-
node(
|
|
35582
|
-
'p',
|
|
35583
|
-
'Optional managed integrations are reviewed one at a time. Enabling one does not create a savings claim or make it part of the RTK + HarnessTrim production baseline.',
|
|
35584
|
-
'caption',
|
|
35585
|
-
),
|
|
35586
35701
|
);
|
|
35587
|
-
const
|
|
35588
|
-
|
|
35589
|
-
|
|
35590
|
-
|
|
35591
|
-
|
|
35592
|
-
|
|
35593
|
-
optionalButtons.append(
|
|
35594
|
-
actionButton('Review GitNexus for ' + agent.name, () => reviewSetup(agent.id, 'gitnexus'), 'secondary'),
|
|
35595
|
-
);
|
|
35596
|
-
optionalButtons.append(
|
|
35597
|
-
actionButton('Review Headroom for ' + agent.name, () => reviewSetup(agent.id, 'headroom'), 'secondary'),
|
|
35702
|
+
const optionalRoot = $('optional-tools');
|
|
35703
|
+
if (optionalRoot)
|
|
35704
|
+
optionalRoot.replaceChildren(
|
|
35705
|
+
renderManagedTool('mcptoon'),
|
|
35706
|
+
renderManagedTool('gitnexus'),
|
|
35707
|
+
renderManagedTool('headroom'),
|
|
35598
35708
|
);
|
|
35599
|
-
|
|
35600
|
-
optional.append(optionalButtons);
|
|
35601
|
-
actions.append(optional);
|
|
35709
|
+
|
|
35602
35710
|
}
|
|
35603
35711
|
|
|
35604
35712
|
function candidateState(observation) {
|
|
@@ -35844,19 +35952,44 @@ var init_guided_product_client = __esm({
|
|
|
35844
35952
|
function readOnlyOperation(kind) {
|
|
35845
35953
|
if (busy) return;
|
|
35846
35954
|
const isVerify = kind === 'verify';
|
|
35847
|
-
const run = modal(isVerify ? '
|
|
35955
|
+
const run = modal(isVerify ? 'Re-check optimizer health' : 'Check for optimizer updates');
|
|
35848
35956
|
$('modal-content').append(
|
|
35849
|
-
messageBox(
|
|
35850
|
-
|
|
35957
|
+
messageBox(
|
|
35958
|
+
isVerify ? 'Troubleshooting check' : 'Update preview',
|
|
35959
|
+
isVerify
|
|
35960
|
+
? 'Re-checks the configured optimizer integrations without repairing or changing them. Normal setup already performs its own safety checks.'
|
|
35961
|
+
: 'Checks reviewed update channels first. If an installable update exists, you can approve it from this window.',
|
|
35962
|
+
),
|
|
35963
|
+
progress(
|
|
35964
|
+
isVerify ? 'Checking configured optimizers' : 'Checking update channels',
|
|
35965
|
+
'Nothing changes during this check.',
|
|
35966
|
+
),
|
|
35851
35967
|
);
|
|
35852
35968
|
$('modal-actions').append(modalClose('Cancel'));
|
|
35853
35969
|
setBusy(true, false);
|
|
35854
35970
|
ensureSession()
|
|
35855
|
-
.then(() =>
|
|
35971
|
+
.then(() =>
|
|
35972
|
+
request(isVerify ? '/api/verify' : '/api/update-check', { period: $('period').value }),
|
|
35973
|
+
)
|
|
35856
35974
|
.then(result => {
|
|
35857
35975
|
if (run !== modalRun || !$('modal').open) return;
|
|
35858
|
-
|
|
35859
|
-
|
|
35976
|
+
if (result.stack && current) {
|
|
35977
|
+
current = { ...current, stack: result.stack };
|
|
35978
|
+
renderDashboard();
|
|
35979
|
+
renderSetup();
|
|
35980
|
+
}
|
|
35981
|
+
$('modal-content').replaceChildren(
|
|
35982
|
+
messageBox(
|
|
35983
|
+
result.title || (result.ok ? 'Completed' : 'Needs attention'),
|
|
35984
|
+
(result.messages || []).join(' ') || 'Check completed.',
|
|
35985
|
+
result.ok ? 'safe' : 'warn',
|
|
35986
|
+
),
|
|
35987
|
+
);
|
|
35988
|
+
$('modal-actions').replaceChildren(modalClose(result.ticket ? 'Cancel' : 'Done'));
|
|
35989
|
+
if (result.ticket)
|
|
35990
|
+
$('modal-actions').append(
|
|
35991
|
+
actionButton('Install updates', () => applyTicket(result.ticket), ''),
|
|
35992
|
+
);
|
|
35860
35993
|
})
|
|
35861
35994
|
.catch(error => {
|
|
35862
35995
|
if (run !== modalRun) return;
|
|
@@ -35902,19 +36035,57 @@ var init_guided_product_client = __esm({
|
|
|
35902
36035
|
function renderMaintenance() {
|
|
35903
36036
|
const root = $('maintenance-actions');
|
|
35904
36037
|
root.replaceChildren();
|
|
35905
|
-
|
|
35906
|
-
|
|
35907
|
-
|
|
35908
|
-
|
|
36038
|
+
|
|
36039
|
+
if (configuredProviders().length) {
|
|
36040
|
+
const verify = node('article', undefined, 'maintenance-row');
|
|
36041
|
+
const verifyText = node('div');
|
|
36042
|
+
verifyText.append(
|
|
36043
|
+
node('strong', 'Optimizer health'),
|
|
36044
|
+
node(
|
|
36045
|
+
'p',
|
|
36046
|
+
current?.stack?.state === 'attention'
|
|
36047
|
+
? 'Something changed or could not be verified. Re-check the configured integrations for details.'
|
|
36048
|
+
: 'Setup is already complete. Re-check only when troubleshooting or after external changes.',
|
|
36049
|
+
'caption',
|
|
36050
|
+
),
|
|
36051
|
+
);
|
|
36052
|
+
verify.append(
|
|
36053
|
+
verifyText,
|
|
36054
|
+
actionButton(
|
|
36055
|
+
current?.stack?.state === 'attention' ? 'Check now' : 'Re-check health',
|
|
36056
|
+
() => readOnlyOperation('verify'),
|
|
36057
|
+
'secondary',
|
|
36058
|
+
),
|
|
36059
|
+
);
|
|
36060
|
+
root.append(verify);
|
|
36061
|
+
}
|
|
36062
|
+
|
|
35909
36063
|
const updates = node('article', undefined, 'maintenance-row');
|
|
35910
36064
|
const updateText = node('div');
|
|
35911
|
-
|
|
35912
|
-
|
|
35913
|
-
|
|
36065
|
+
const available = (current?.stack?.components || []).filter(component => component.update === 'available');
|
|
36066
|
+
updateText.append(
|
|
36067
|
+
node('strong', 'Optimizer updates'),
|
|
36068
|
+
node(
|
|
36069
|
+
'p',
|
|
36070
|
+
available.length
|
|
36071
|
+
? available.map(component => (TOOL_INFO[component.providerId]?.name || component.providerId) + ' has an update ready.').join(' ')
|
|
36072
|
+
: 'Check installed optimizer versions. If a reviewed update is available, you can install it from the same dialog.',
|
|
36073
|
+
'caption',
|
|
36074
|
+
),
|
|
36075
|
+
);
|
|
36076
|
+
updates.append(
|
|
36077
|
+
updateText,
|
|
36078
|
+
actionButton(available.length ? 'Review updates' : 'Check for updates', () => readOnlyOperation('updates'), available.length ? '' : 'secondary'),
|
|
36079
|
+
);
|
|
36080
|
+
root.append(updates);
|
|
36081
|
+
|
|
35914
36082
|
if (activityState?.canUndo) {
|
|
35915
36083
|
const undo = node('article', undefined, 'maintenance-row');
|
|
35916
36084
|
const undoText = node('div');
|
|
35917
|
-
undoText.append(
|
|
36085
|
+
undoText.append(
|
|
36086
|
+
node('strong', 'Undo last change'),
|
|
36087
|
+
node('p', 'Review and restore the exact last configuration transaction from this app session.', 'caption'),
|
|
36088
|
+
);
|
|
35918
36089
|
undo.append(undoText, actionButton('Review undo', undoLastChange, 'secondary'));
|
|
35919
36090
|
root.append(undo);
|
|
35920
36091
|
}
|
|
@@ -36798,42 +36969,57 @@ ${GUIDE_CANDIDATE_READINESS_JS}`;
|
|
|
36798
36969
|
<header class="app-header"><div class="header-inner">
|
|
36799
36970
|
<div class="brand"><span class="brand-mark" aria-hidden="true">TH</span><span>Token Harness<small>Use less. Know what changed.</small></span></div>
|
|
36800
36971
|
<nav class="view-tabs" role="tablist" aria-label="Token Harness">
|
|
36801
|
-
<button id="tab-dashboard" role="tab" aria-selected="true" aria-controls="view-dashboard" data-view="dashboard" type="button">
|
|
36802
|
-
<button id="tab-setup" role="tab" aria-selected="false" aria-controls="view-setup" data-view="setup" tabindex="-1" type="button">Setup</button>
|
|
36972
|
+
<button id="tab-dashboard" role="tab" aria-selected="true" aria-controls="view-dashboard" data-view="dashboard" type="button">Overview</button>
|
|
36803
36973
|
<button id="tab-results" role="tab" aria-selected="false" aria-controls="view-results" data-view="results" tabindex="-1" type="button">Results</button>
|
|
36804
36974
|
</nav>
|
|
36805
36975
|
<div class="header-tools"><label><span class="sr-only">Appearance</span><select id="theme" aria-label="Appearance"><option value="system">System</option><option value="light">Light</option><option value="dark">Dark</option></select></label><button id="refresh" class="secondary" type="button">Refresh</button></div>
|
|
36806
36976
|
</div></header>
|
|
36807
36977
|
<main id="main">
|
|
36808
|
-
<div class="page-heading"><div><h1 id="view-title">
|
|
36978
|
+
<div class="page-heading"><div><h1 id="view-title">Overview</h1><p id="view-description">Your coding agents, optimizer setup, health and measured results in one place.</p></div></div>
|
|
36809
36979
|
<div class="status-line"><span class="read-status" role="status"><span id="reading-spinner" class="spinner" aria-hidden="true"></span><span id="updated">Checking your setup\u2026</span></span><span id="live-status" class="caption">Nothing changes without your approval</span></div>
|
|
36810
36980
|
<div id="stale-state" class="stale-state" hidden></div><div id="error" class="error" role="alert" hidden></div><div id="notices"></div>
|
|
36811
36981
|
|
|
36812
36982
|
<section id="view-dashboard" role="tabpanel" aria-labelledby="tab-dashboard" tabindex="0">
|
|
36813
|
-
<section id="dashboard-status" class="dashboard-status"><div><span class="eyebrow">
|
|
36814
|
-
|
|
36983
|
+
<section id="dashboard-status" class="dashboard-status"><div><span class="eyebrow">CURRENT STATUS</span><h2>Checking your machine\u2026</h2><p>Finding Claude Code, Codex, recommended optimizers and measured results.</p></div><span class="pill">Checking</span></section>
|
|
36984
|
+
|
|
36985
|
+
<div class="section-title"><div><h2>Measured impact</h2><p>A summary of what Token Harness can actually prove. Open Results for the detailed evidence.</p></div></div>
|
|
36815
36986
|
<div id="dashboard-metrics" class="impact-grid" aria-label="Efficiency summary">
|
|
36816
36987
|
<article class="metric-card"><span class="metric-label">Measured output</span><strong class="metric-value">Checking\u2026</strong><p class="metric-help">Recorded optimizer output.</p></article>
|
|
36817
36988
|
<article class="metric-card"><span class="metric-label">5h / 7d allowance</span><strong class="metric-value">Checking\u2026</strong><p class="metric-help">Shown only when measured.</p></article>
|
|
36818
36989
|
<article class="metric-card"><span class="metric-label">API cost</span><strong class="metric-value">Checking\u2026</strong><p class="metric-help">Shown only from billing evidence.</p></article>
|
|
36819
36990
|
<article class="metric-card"><span class="metric-label">Quality</span><strong class="metric-value">Checking\u2026</strong><p class="metric-help">Measured separately from savings.</p></article>
|
|
36820
36991
|
</div>
|
|
36821
|
-
<div class="dashboard-columns">
|
|
36822
|
-
<section class="panel"><h2>Active today</h2><p class="caption">Coding agents and managed optimization that Token Harness can actually see.</p><div id="dashboard-active" class="status-list"><p class="empty">Checking\u2026</p></div></section>
|
|
36823
|
-
<section class="panel"><h2>Getting started</h2><p class="caption">The shortest path from installation to useful measured results.</p><div id="dashboard-checklist" class="checklist"><p class="empty">Checking\u2026</p></div></section>
|
|
36824
|
-
</div>
|
|
36825
|
-
</section>
|
|
36826
36992
|
|
|
36827
|
-
<section
|
|
36828
|
-
<div class="
|
|
36993
|
+
<section class="setup-step" id="coding-agents">
|
|
36994
|
+
<div class="section-title"><div><h2>Coding agents</h2><p>These are the harnesses Token Harness can configure today. A detected agent is not considered fully set up until the recommended RTK + HarnessTrim baseline is connected to it.</p></div></div>
|
|
36995
|
+
<div id="setup-agents" class="tool-grid"><article class="tool-card"><h3>Checking agents\u2026</h3></article></div>
|
|
36996
|
+
<details class="disclosure advanced-disclosure">
|
|
36997
|
+
<summary>Agent details and optional reasoning settings</summary>
|
|
36998
|
+
<p class="caption">Allowance, connected-tool observations and reasoning preferences are advanced information. They are not required to finish optimizer setup.</p>
|
|
36999
|
+
<div id="agent-capabilities" class="tool-grid"><article class="tool-card"><h3>Checking agent details\u2026</h3></article></div>
|
|
37000
|
+
<div class="subsection-heading"><h3>Optional reasoning settings</h3><p class="caption">Persistent agent preferences are separate from optimizer setup.</p></div>
|
|
37001
|
+
<div id="agent-tuning" class="tool-grid"><article class="tool-card"><h3>Checking reasoning controls\u2026</h3></article></div>
|
|
37002
|
+
</details>
|
|
37003
|
+
</section>
|
|
36829
37004
|
|
|
36830
|
-
<section class="setup-step"
|
|
37005
|
+
<section class="setup-step" id="optimizers">
|
|
37006
|
+
<div class="section-title"><div><h2>Optimizers</h2><p>Recommended and optional tools are kept separate. Every button sits next to the tool or agent it affects, and every configuration change is previewed before approval.</p></div></div>
|
|
37007
|
+
<div class="subsection-heading"><h3>Recommended baseline</h3><p class="caption">RTK + HarnessTrim are configured together from the coding-agent card above, so first-run setup stays one action per agent.</p></div>
|
|
37008
|
+
<div id="managed-tools" class="tool-grid"><article class="tool-card"><h3>Checking recommended optimizers\u2026</h3></article></div>
|
|
36831
37009
|
|
|
36832
|
-
<
|
|
37010
|
+
<details class="disclosure optional-disclosure">
|
|
37011
|
+
<summary>Optional optimizers</summary>
|
|
37012
|
+
<p class="caption">Add these only when you want their specific capability. They are not required to complete first-run setup and are never counted as savings merely because they are configured.</p>
|
|
37013
|
+
<div id="optional-tools" class="tool-grid"><article class="tool-card"><h3>Checking optional optimizers\u2026</h3></article></div>
|
|
37014
|
+
</details>
|
|
36833
37015
|
|
|
36834
|
-
<
|
|
37016
|
+
<details class="disclosure"><summary>Remove Token Harness-managed configuration</summary><p class="caption">Removal is reviewed first. Token Harness removes only configuration it owns; installed provider software and user-owned configuration may remain.</p><div id="managed-removal-actions" class="maintenance-list"><p class="caption">Checking managed ownership\u2026</p></div></details>
|
|
37017
|
+
</section>
|
|
36835
37018
|
|
|
36836
|
-
<section class="setup-step"
|
|
37019
|
+
<section class="setup-step" id="maintenance">
|
|
37020
|
+
<div class="section-title"><div><h2>Health and updates</h2><p>These are maintenance actions, not onboarding steps. Setup already performs its own safety checks.</p></div></div>
|
|
37021
|
+
<div id="maintenance-actions" class="maintenance-list"><p class="empty">Checking\u2026</p></div>
|
|
37022
|
+
</section>
|
|
36837
37023
|
</section>
|
|
36838
37024
|
|
|
36839
37025
|
<section id="view-results" role="tabpanel" aria-labelledby="tab-results" tabindex="0" hidden>
|
|
@@ -36844,7 +37030,7 @@ ${GUIDE_CANDIDATE_READINESS_JS}`;
|
|
|
36844
37030
|
<div class="section-title"><div><h2>Recent activity</h2><p>Checks and changes from this local app session.</p></div></div><section class="panel"><div id="activity"><p class="empty">No activity yet.</p></div></section>
|
|
36845
37031
|
</section>
|
|
36846
37032
|
|
|
36847
|
-
<footer><span>Local data. No account required.</span><span>Full
|
|
37033
|
+
<footer><span>Local data. No account required.</span><span>Full overview refresh runs only when you choose Refresh.</span></footer>
|
|
36848
37034
|
</main>
|
|
36849
37035
|
<dialog id="modal" aria-labelledby="modal-title"><div class="dialog-body"><div class="dialog-heading"><h2 id="modal-title">Review</h2></div><div id="modal-content"></div><div id="modal-error" class="error" role="alert" hidden></div><div id="modal-actions" class="dialog-actions"></div></div></dialog>
|
|
36850
37036
|
<script src="/guide.js" defer></script></body></html>`;
|