quoxcli 0.2.0 → 0.3.1
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/LICENSE +1 -1
- package/README.md +2 -0
- package/bin/quox.js +99 -126
- package/lib/api/endpoints/admin.js +26 -0
- package/lib/api/endpoints/agent-schedules.js +26 -0
- package/lib/api/endpoints/agents.js +7 -0
- package/lib/api/endpoints/assistants.js +12 -0
- package/lib/api/endpoints/away.js +15 -0
- package/lib/api/endpoints/chat.js +7 -0
- package/lib/api/endpoints/contactsq.js +2 -0
- package/lib/api/endpoints/conversations.js +14 -0
- package/lib/api/endpoints/executions.js +13 -0
- package/lib/api/endpoints/fetchAllowlist.js +27 -0
- package/lib/api/endpoints/files.js +14 -0
- package/lib/api/endpoints/hat.js +30 -0
- package/lib/api/endpoints/inbox.js +20 -0
- package/lib/api/endpoints/index.js +14 -0
- package/lib/api/endpoints/memory.js +19 -0
- package/lib/api/endpoints/mind.js +13 -0
- package/lib/api/endpoints/mon.js +6 -0
- package/lib/api/endpoints/objectives.js +6 -0
- package/lib/api/endpoints/plugins.js +18 -0
- package/lib/api/endpoints/presence.js +33 -0
- package/lib/api/endpoints/quoxplan.js +7 -0
- package/lib/api/endpoints/quoxseo.js +6 -0
- package/lib/api/endpoints/router.js +17 -0
- package/lib/api/endpoints/safety.js +7 -0
- package/lib/api/endpoints/skills.js +20 -0
- package/lib/api/endpoints/stepup.js +20 -0
- package/lib/api/endpoints/teams.js +2 -2
- package/lib/api/endpoints/triggers.js +26 -0
- package/lib/api/endpoints/v1.js +86 -0
- package/lib/api/endpoints/ward.js +7 -0
- package/lib/api/endpoints/workflows.js +7 -0
- package/lib/api/endpoints/x.js +8 -0
- package/lib/commands/actions.js +61 -0
- package/lib/commands/admin.js +16 -0
- package/lib/commands/agent.js +163 -27
- package/lib/commands/agentAttach.js +94 -6
- package/lib/commands/approvals.js +73 -1
- package/lib/commands/aside.js +24 -0
- package/lib/commands/ask.js +144 -0
- package/lib/commands/assistant.js +59 -4
- package/lib/commands/auth.js +8 -2
- package/lib/commands/backup.js +8 -4
- package/lib/commands/brain.js +105 -14
- package/lib/commands/build.js +19 -5
- package/lib/commands/chat.js +57 -2
- package/lib/commands/claude.js +34 -8
- package/lib/commands/contacts.js +49 -0
- package/lib/commands/conversation.js +35 -4
- package/lib/commands/dashboard.js +43 -0
- package/lib/commands/department.js +28 -7
- package/lib/commands/devResident.js +15 -3
- package/lib/commands/devSupervisor.js +13 -1
- package/lib/commands/discord.js +75 -39
- package/lib/commands/done.js +98 -28
- package/lib/commands/engagement.js +17 -6
- package/lib/commands/fetchAllowlist.js +71 -0
- package/lib/commands/file.js +38 -1
- package/lib/commands/fleet.js +311 -4
- package/lib/commands/governance.js +12 -3
- package/lib/commands/gripe.js +44 -13
- package/lib/commands/hat.js +178 -9
- package/lib/commands/helpers.js +18 -1
- package/lib/commands/hyperion.js +58 -0
- package/lib/commands/inbox.js +74 -23
- package/lib/commands/licence.js +14 -155
- package/lib/commands/lucid.js +10 -4
- package/lib/commands/memory.js +85 -8
- package/lib/commands/mind.js +71 -0
- package/lib/commands/mon.js +69 -2
- package/lib/commands/monitoring.js +1 -1
- package/lib/commands/motion.js +2 -2
- package/lib/commands/nucleus.js +48 -17
- package/lib/commands/objective.js +11 -0
- package/lib/commands/offload.js +89 -0
- package/lib/commands/onboard.js +2 -1
- package/lib/commands/org.js +11 -1
- package/lib/commands/peek.js +28 -0
- package/lib/commands/plan.js +38 -0
- package/lib/commands/plugin.js +110 -0
- package/lib/commands/presence.js +89 -0
- package/lib/commands/provider.js +159 -0
- package/lib/commands/qlarity.js +19 -3
- package/lib/commands/quoxchat.js +13 -4
- package/lib/commands/quoxseo.js +38 -0
- package/lib/commands/reach.js +2 -1
- package/lib/commands/router.js +77 -0
- package/lib/commands/rows.js +358 -0
- package/lib/commands/run.js +64 -9
- package/lib/commands/server.js +292 -0
- package/lib/commands/setup.js +33 -7
- package/lib/commands/skills.js +48 -5
- package/lib/commands/slot.js +260 -7
- package/lib/commands/status.js +1 -1
- package/lib/commands/team.js +3 -1
- package/lib/commands/tips.js +23 -0
- package/lib/commands/tool.js +133 -45
- package/lib/commands/trace.js +12 -7
- package/lib/commands/trigger.js +95 -0
- package/lib/commands/update.js +46 -0
- package/lib/commands/vault.js +31 -8
- package/lib/commands/vm.js +237 -0
- package/lib/commands/voice.js +34 -3
- package/lib/commands/volt.js +45 -3
- package/lib/commands/walkthrough.js +32 -0
- package/lib/commands/watch.js +73 -21
- package/lib/commands/welcome.js +14 -0
- package/lib/commands/workflow.js +189 -32
- package/lib/commands/x.js +13 -4
- package/lib/core/actingAs.js +2 -2
- package/lib/core/activeSummary.js +186 -0
- package/lib/core/aside.js +54 -0
- package/lib/core/askDecision.js +60 -0
- package/lib/core/auth.js +164 -13
- package/lib/core/callerSource.js +1 -1
- package/lib/core/cliBuild.js +62 -0
- package/lib/core/client.js +144 -35
- package/lib/core/commandRegistrars.js +121 -0
- package/lib/core/config.js +142 -24
- package/lib/core/customHats.js +168 -0
- package/lib/core/doneEngineFetch.js +8 -0
- package/lib/core/errors.js +329 -20
- package/lib/core/global-flags.js +105 -5
- package/lib/core/hyperion.js +102 -0
- package/lib/core/inboxResolution.js +65 -0
- package/lib/core/lazyCommands.js +4 -1
- package/lib/core/offload.js +504 -0
- package/lib/core/org-override.js +1 -1
- package/lib/core/orgResolve.js +70 -0
- package/lib/core/output.js +4 -4
- package/lib/core/peek.js +126 -0
- package/lib/core/profileUsers.js +51 -0
- package/lib/core/promptCancel.js +18 -0
- package/lib/core/repoPath.js +11 -0
- package/lib/core/residentSeed.js +3 -1
- package/lib/core/rootOptions.js +39 -0
- package/lib/core/router.js +168 -0
- package/lib/core/selfUpdate.js +188 -0
- package/lib/core/sessionsOverview.js +64 -0
- package/lib/core/slotKeeper.js +248 -3
- package/lib/core/slotWake.js +120 -0
- package/lib/core/supervisorEngine.js +71 -2
- package/lib/core/version.js +1 -1
- package/lib/core/vm.js +361 -0
- package/lib/core/vmTui.js +86 -0
- package/lib/core/walkthrough.js +35 -0
- package/lib/hyperion/deck.js +29 -0
- package/lib/lucid/LucidCard.jsx +68 -0
- package/lib/lucid/LucidIntro.jsx +45 -58
- package/lib/lucid/cards.js +86 -0
- package/lib/lucid/markdown.js +81 -0
- package/lib/lucid/motion.js +56 -0
- package/lib/quoxon/activity.js +14 -2
- package/lib/quoxon/aocl.js +117 -0
- package/lib/quoxon/api.js +504 -25
- package/lib/quoxon/app.js +3000 -230
- package/lib/quoxon/approvalFacts.js +94 -0
- package/lib/quoxon/approvalsView.js +325 -0
- package/lib/quoxon/asideView.js +40 -0
- package/lib/quoxon/ask.js +121 -0
- package/lib/quoxon/away.js +52 -0
- package/lib/quoxon/bang.js +224 -0
- package/lib/quoxon/bulkRisk.js +17 -0
- package/lib/quoxon/capabilities.js +13 -6
- package/lib/quoxon/cells.js +53 -0
- package/lib/quoxon/commandShort.js +112 -0
- package/lib/quoxon/commands.js +363 -38
- package/lib/quoxon/connect.js +210 -23
- package/lib/quoxon/connectCard.js +19 -2
- package/lib/quoxon/consent.js +86 -0
- package/lib/quoxon/copy.js +4 -3
- package/lib/quoxon/countdownLine.js +11 -0
- package/lib/quoxon/demo.autoplay.js +29 -0
- package/lib/quoxon/demo.fixtures.js +1 -1
- package/lib/quoxon/demo.js +44 -3
- package/lib/quoxon/devObserver.js +20 -0
- package/lib/quoxon/dividerAocl.js +191 -0
- package/lib/quoxon/dividerRule.js +57 -0
- package/lib/quoxon/dragonModes.js +150 -0
- package/lib/quoxon/dragonView.js +41 -0
- package/lib/quoxon/earlyInput.js +40 -0
- package/lib/quoxon/echo.js +15 -0
- package/lib/quoxon/egg.js +2 -2
- package/lib/quoxon/events.js +244 -25
- package/lib/quoxon/feedback.js +50 -0
- package/lib/quoxon/gallery.js +21 -7
- package/lib/quoxon/handoffOffer.js +78 -0
- package/lib/quoxon/hatSwitch.js +37 -0
- package/lib/quoxon/headless.js +161 -0
- package/lib/quoxon/hostUrls.js +41 -0
- package/lib/quoxon/indicator.js +6 -2
- package/lib/quoxon/intent.js +12 -1
- package/lib/quoxon/keys.js +49 -6
- package/lib/quoxon/launcher.js +103 -0
- package/lib/quoxon/main.js +92 -160
- package/lib/quoxon/markdown.js +45 -21
- package/lib/quoxon/markdownSettle.js +19 -0
- package/lib/quoxon/matrixDomains.json +46 -0
- package/lib/quoxon/mentions.js +90 -0
- package/lib/quoxon/mind.js +103 -0
- package/lib/quoxon/mode.js +46 -0
- package/lib/quoxon/model.js +132 -26
- package/lib/quoxon/modelPrefs.js +345 -0
- package/lib/quoxon/motion/clock.js +3 -2
- package/lib/quoxon/motion/level.js +91 -0
- package/lib/quoxon/mouse.js +211 -0
- package/lib/quoxon/noai.js +57 -0
- package/lib/quoxon/objects/away.js +72 -0
- package/lib/quoxon/objects/fetch.js +17 -5
- package/lib/quoxon/objects/fleet.js +149 -0
- package/lib/quoxon/objects/health.js +186 -0
- package/lib/quoxon/objects/index.js +24 -3
- package/lib/quoxon/objects/mirror.js +137 -0
- package/lib/quoxon/objects/peek.js +17 -0
- package/lib/quoxon/objects/prove.js +130 -0
- package/lib/quoxon/objects/replay.js +125 -0
- package/lib/quoxon/objects/sitrep.js +58 -0
- package/lib/quoxon/objects/view.js +11 -0
- package/lib/quoxon/onboarding/copy.js +32 -4
- package/lib/quoxon/onboarding/credential.js +17 -4
- package/lib/quoxon/onboarding/dockerOffer.js +45 -0
- package/lib/quoxon/onboarding/failureCause.js +33 -0
- package/lib/quoxon/onboarding/finish.js +15 -0
- package/lib/quoxon/onboarding/index.js +34 -7
- package/lib/quoxon/onboarding/installRunner.js +64 -5
- package/lib/quoxon/onboarding/preflight.js +17 -3
- package/lib/quoxon/onboarding/probe.js +65 -0
- package/lib/quoxon/onboarding/view.js +76 -19
- package/lib/quoxon/orgLabel.js +10 -0
- package/lib/quoxon/orgSwitch.js +33 -0
- package/lib/quoxon/ownBroadcast.js +22 -0
- package/lib/quoxon/palette.js +43 -0
- package/lib/quoxon/print.js +9 -5
- package/lib/quoxon/profileSwitch.js +53 -0
- package/lib/quoxon/promptHistory.js +41 -0
- package/lib/quoxon/providers.js +48 -0
- package/lib/quoxon/qart.js +20 -51
- package/lib/quoxon/qdragon.js +410 -0
- package/lib/quoxon/qdragonFly.js +61 -0
- package/lib/quoxon/qdragonScenes.js +282 -0
- package/lib/quoxon/qeyes.js +213 -0
- package/lib/quoxon/qmotion.js +58 -37
- package/lib/quoxon/render.js +638 -119
- package/lib/quoxon/resend.js +72 -0
- package/lib/quoxon/roster.js +95 -9
- package/lib/quoxon/route.js +6 -5
- package/lib/quoxon/rows.js +711 -0
- package/lib/quoxon/rowsStore.js +80 -0
- package/lib/quoxon/screenContext.js +150 -0
- package/lib/quoxon/screenFrames.js +254 -0
- package/lib/quoxon/session.js +172 -2
- package/lib/quoxon/sessionDead.js +17 -0
- package/lib/quoxon/signin.js +125 -0
- package/lib/quoxon/slash/agents.js +112 -0
- package/lib/quoxon/slash/argSources.js +65 -0
- package/lib/quoxon/slash/args.js +65 -0
- package/lib/quoxon/slash/automate.js +89 -0
- package/lib/quoxon/slash/broadcast.js +140 -0
- package/lib/quoxon/slash/broadcastRun.js +108 -0
- package/lib/quoxon/slash/card.js +30 -0
- package/lib/quoxon/slash/challenge.js +114 -0
- package/lib/quoxon/slash/cliCommand.js +53 -0
- package/lib/quoxon/slash/cliLeaves.json +948 -0
- package/lib/quoxon/slash/compact.js +1 -1
- package/lib/quoxon/slash/confirm.js +30 -0
- package/lib/quoxon/slash/crystallize.js +69 -0
- package/lib/quoxon/slash/dashboard.js +136 -0
- package/lib/quoxon/slash/draft.js +54 -0
- package/lib/quoxon/slash/hatWalk.js +206 -0
- package/lib/quoxon/slash/inverses.js +77 -0
- package/lib/quoxon/slash/killer.js +24 -0
- package/lib/quoxon/slash/killerApi.js +16 -0
- package/lib/quoxon/slash/ledger.js +13 -8
- package/lib/quoxon/slash/listView.js +3 -1
- package/lib/quoxon/slash/modelCmd.js +261 -0
- package/lib/quoxon/slash/palette.js +21 -7
- package/lib/quoxon/slash/paletteController.js +117 -7
- package/lib/quoxon/slash/panels.js +21 -6
- package/lib/quoxon/slash/picker.js +20 -2
- package/lib/quoxon/slash/restart.js +71 -13
- package/lib/quoxon/slash/rowCmd.js +157 -0
- package/lib/quoxon/slash/rowWalk.js +175 -0
- package/lib/quoxon/slash/settings.js +16 -6
- package/lib/quoxon/slash/spawn.js +177 -0
- package/lib/quoxon/slash/stepUp.js +274 -0
- package/lib/quoxon/slash/stepUpCard.js +60 -0
- package/lib/quoxon/slash/stepUpCmds.js +78 -0
- package/lib/quoxon/slash/undoApi.js +38 -0
- package/lib/quoxon/slash/undoCmd.js +49 -0
- package/lib/quoxon/slash/undoWish.js +15 -0
- package/lib/quoxon/slash/watch.js +164 -0
- package/lib/quoxon/slash/wish.js +23 -0
- package/lib/quoxon/slash/wishCmd.js +32 -0
- package/lib/quoxon/slotChat.js +300 -0
- package/lib/quoxon/slotFormat.js +195 -0
- package/lib/quoxon/slotRun.js +131 -0
- package/lib/quoxon/sound/mapping.js +2 -1
- package/lib/quoxon/stray.js +22 -0
- package/lib/quoxon/suggestCommand.js +59 -0
- package/lib/quoxon/term.js +46 -11
- package/lib/quoxon/textBuffer.js +176 -2
- package/lib/quoxon/theme.js +58 -25
- package/lib/quoxon/tips.js +433 -0
- package/lib/quoxon/toolError.js +41 -0
- package/lib/quoxon/transcript.js +42 -4
- package/lib/quoxon/web/qface.js +18 -10
- package/lib/quoxon/welcome.js +1 -1
- package/lib/quoxon/whatsnew.js +136 -0
- package/lib/quoxon/whatsnew.jsonl +89 -0
- package/lib/quoxon/windowOrg.js +113 -0
- package/lib/server/diag.js +129 -0
- package/lib/server/doctor.js +71 -0
- package/lib/server/install.js +149 -0
- package/lib/server/pluginEnable.js +161 -0
- package/lib/server/skew.js +56 -0
- package/lib/server/snapshot.js +131 -0
- package/lib/server/status.js +128 -0
- package/lib/server/sys.js +65 -0
- package/lib/server/uninstall.js +63 -0
- package/lib/server/update.js +234 -0
- package/lib/toolOutputShape.js +315 -0
- package/lib/tui/views/HyperionDeck.jsx +79 -0
- package/lib/tui/views/LucidDeck.jsx +209 -217
- package/package.json +4 -1
- package/lib/core/websiteSession.js +0 -148
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* QUOXON-AOCL: one compact AOCL line per turn, and the full per-layer table on demand (/aocl).
|
|
3
|
+
*
|
|
4
|
+
* The server sends ONE `aocl.summary` per streamed turn ({ layers:[{id,outcome,ms,reason}],
|
|
5
|
+
* total, accounted, passed, bypassed, rejected, rejected_at, ms, verdict? }) and an
|
|
6
|
+
* `aocl.verdict` when L8 flags text that was already on screen. Older servers send only
|
|
7
|
+
* per-layer `trace` rows (protocol aocl, label "L1 identity complete"); those are folded
|
|
8
|
+
* into the same line so nothing is lost, and the line says how many layers were reported.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
export const LAYER_NAMES = {
|
|
12
|
+
L0: 'ingress', L1: 'identity', L2: 'router', L3: 'policy', L4: 'planner', L5: 'context',
|
|
13
|
+
L6: 'shape', L7: 'delegate', L8: 'verify', L9: 'assemble', L10: 'audit'
|
|
14
|
+
};
|
|
15
|
+
const ORDER = Object.keys(LAYER_NAMES);
|
|
16
|
+
const OUTCOME_WORD = { complete: 'passed', bypass: 'bypassed', reject: 'rejected', not_run: 'not run' };
|
|
17
|
+
const OUTCOME_GLYPH = { complete: '✔', bypass: '○', reject: '✖', not_run: '?' };
|
|
18
|
+
|
|
19
|
+
/** A per-layer AOCL trace row (folded into the one-line summary instead of a row per layer). */
|
|
20
|
+
export const isLayerTrace = (ev) => ev?.protocol === 'aocl' && /^L(?:10|[0-9])\b/.test(String(ev.label || ''));
|
|
21
|
+
|
|
22
|
+
const fmtMs = (ms) => {
|
|
23
|
+
const n = Number(ms);
|
|
24
|
+
if (!Number.isFinite(n)) return '';
|
|
25
|
+
return n < 10 ? `${Math.round(n * 10) / 10} ms` : n < 1000 ? `${Math.round(n)} ms` : `${(n / 1000).toFixed(1)} s`;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
/** Normalise a server summary (tolerant of missing fields). */
|
|
29
|
+
export function normaliseSummary(ev) {
|
|
30
|
+
const layers = Array.isArray(ev?.layers) ? ev.layers.filter(l => l && l.id).map(l => ({ id: String(l.id), outcome: String(l.outcome || 'not_run'), ms: Number(l.ms) || 0, ...(l.reason ? { reason: String(l.reason) } : {}) })) : [];
|
|
31
|
+
const count = (o) => layers.filter(l => l.outcome === o).length;
|
|
32
|
+
const rejected = layers.filter(l => l.outcome === 'reject');
|
|
33
|
+
return {
|
|
34
|
+
layers,
|
|
35
|
+
total: Number(ev?.total) || 11,
|
|
36
|
+
accounted: Number.isFinite(Number(ev?.accounted)) ? Number(ev.accounted) : layers.filter(l => l.outcome !== 'not_run').length,
|
|
37
|
+
passed: Number.isFinite(Number(ev?.passed)) ? Number(ev.passed) : count('complete'),
|
|
38
|
+
bypassed: Number.isFinite(Number(ev?.bypassed)) ? Number(ev.bypassed) : count('bypass'),
|
|
39
|
+
rejected: Number.isFinite(Number(ev?.rejected)) ? Number(ev.rejected) : rejected.length,
|
|
40
|
+
rejectedAt: ev?.rejected_at || (rejected[0] && rejected[0].id) || null,
|
|
41
|
+
ms: Number.isFinite(Number(ev?.ms)) ? Number(ev.ms) : null,
|
|
42
|
+
verdict: ev?.verdict || null,
|
|
43
|
+
legacy: Boolean(ev?.legacy)
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/** Build a summary from legacy per-layer trace rows (a server without aocl.summary). */
|
|
48
|
+
export function summaryFromTraces(traces) {
|
|
49
|
+
const layers = [];
|
|
50
|
+
for (const t of traces || []) {
|
|
51
|
+
const m = String(t.label || '').match(/^(L(?:10|[0-9]))\b.*?\b(complete|bypass|reject)\b/);
|
|
52
|
+
if (!m || layers.some(l => l.id === m[1])) continue;
|
|
53
|
+
const ms = String(t.detail || '').match(/(\d+(?:\.\d+)?)\s*ms/);
|
|
54
|
+
layers.push({ id: m[1], outcome: m[2], ms: ms ? Number(ms[1]) : 0 });
|
|
55
|
+
}
|
|
56
|
+
layers.sort((a, b) => ORDER.indexOf(a.id) - ORDER.indexOf(b.id));
|
|
57
|
+
const ms = layers.reduce((n, l) => n + l.ms, 0);
|
|
58
|
+
return normaliseSummary({ layers, total: 11, accounted: layers.length, ms, legacy: true });
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* The one line: "AOCL 11/11 ✔ · 9 passed · 2 bypassed · 34 ms" (the caller draws the ▤ icon).
|
|
63
|
+
* -> { segs: [{ t, tone }] } where tone is 'ok' | 'fail' | 'warn' | 'text'.
|
|
64
|
+
*/
|
|
65
|
+
export function aoclLineSegs(sum) {
|
|
66
|
+
const s = sum || normaliseSummary({});
|
|
67
|
+
const segs = [{ t: `${s.accounted}/${s.total} `, tone: 'text' }];
|
|
68
|
+
if (s.rejected > 0) {
|
|
69
|
+
const rl = s.layers.find(l => l.id === s.rejectedAt);
|
|
70
|
+
segs.push({ t: '✖', tone: 'fail' }, { t: ` ${[s.rejectedAt || 'a layer', LAYER_NAMES[s.rejectedAt]].filter(Boolean).join(' ')} rejected${rl && rl.reason ? `: ${rl.reason}` : ''}`, tone: 'fail' });
|
|
71
|
+
} else if (s.accounted < s.total) {
|
|
72
|
+
segs.push({ t: '⚠', tone: 'warn' }, { t: ` only ${s.accounted} of ${s.total} reported`, tone: 'warn' });
|
|
73
|
+
} else {
|
|
74
|
+
segs.push({ t: '✔', tone: 'ok' });
|
|
75
|
+
}
|
|
76
|
+
segs.push({ t: ` · ${s.passed} passed`, tone: 'text' });
|
|
77
|
+
if (s.bypassed) segs.push({ t: ` · ${s.bypassed} bypassed`, tone: 'text' });
|
|
78
|
+
if (s.verdict && s.verdict.verdict === 'warned') segs.push({ t: ` · ${s.verdict.layer || 'L8'} warned`, tone: 'warn' });
|
|
79
|
+
if (s.toolsOffered != null) segs.push({ t: ` · ${s.toolsOffered} tool${s.toolsOffered === 1 ? '' : 's'}`, tone: 'text' });
|
|
80
|
+
if (s.ms != null) segs.push({ t: ` · ${fmtMs(s.ms)}`, tone: 'text' });
|
|
81
|
+
if (s.legacy) segs.push({ t: ' · server sent no summary', tone: 'warn' });
|
|
82
|
+
return { segs };
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export const aoclLineText = (sum) => 'AOCL ' + aoclLineSegs(sum).segs.map(x => x.t).join('');
|
|
86
|
+
|
|
87
|
+
/** The /aocl table: [text, tone] rows, one per layer, for the last turn. */
|
|
88
|
+
export function aoclTableLines(sum) {
|
|
89
|
+
if (!sum) return [['No AOCL record yet. Send a message, then /aocl shows every layer of that turn.', 'warn']];
|
|
90
|
+
const out = [[`▤ AOCL last turn │ ${aoclLineText(sum).slice(5)}`, sum.rejected ? 'error' : 'accent']];
|
|
91
|
+
const byId = Object.fromEntries(sum.layers.map(l => [l.id, l]));
|
|
92
|
+
for (const id of ORDER) {
|
|
93
|
+
const l = byId[id] || { id, outcome: 'not_run', ms: 0 };
|
|
94
|
+
const word = OUTCOME_WORD[l.outcome] || l.outcome;
|
|
95
|
+
const line = `${OUTCOME_GLYPH[l.outcome] || '·'} ${id.padEnd(4)}${LAYER_NAMES[id].padEnd(10)}${word.padEnd(10)}${fmtMs(l.ms).padStart(8)}${l.reason ? ` ${l.reason}` : ''}`;
|
|
96
|
+
out.push([line, l.outcome === 'reject' ? 'error' : l.outcome === 'not_run' ? 'warn' : l.outcome === 'complete' ? 'ok' : 'accent']);
|
|
97
|
+
}
|
|
98
|
+
if (sum.toolsOffered != null) { // the VOLT "tools offered" list, on demand instead of opening every turn
|
|
99
|
+
out.push([`tools offered to the model: ${sum.toolsOffered}${sum.toolsTotal != null ? ` of ${sum.toolsTotal}` : ''}`, 'accent']);
|
|
100
|
+
let row = ' ';
|
|
101
|
+
for (const t of String(sum.toolsList || '').split(/,\s*/).filter(Boolean)) {
|
|
102
|
+
if (row.length + t.length + 2 > 76 && row.trim()) { out.push([row.replace(/,?\s*$/, ''), 'text']); row = ' '; }
|
|
103
|
+
row += t + ', ';
|
|
104
|
+
}
|
|
105
|
+
if (row.trim()) out.push([row.replace(/,?\s*$/, ''), 'text']);
|
|
106
|
+
}
|
|
107
|
+
if (sum.verdict) out.push([`${sum.verdict.layer || 'L8'} ${sum.verdict.verdict}: ${sum.verdict.reason || ''}${sum.verdict.delivered ? ' (the text was already shown)' : ''}`, sum.verdict.verdict === 'blocked' ? 'error' : 'warn']);
|
|
108
|
+
if (sum.legacy) out.push(['This server sent per-layer traces only, no aocl.summary: layers it did not report are shown as not run.', 'warn']);
|
|
109
|
+
return out;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/** The note shown when L8 flags an answer that is already on screen. */
|
|
113
|
+
export function verdictNote(v) {
|
|
114
|
+
const reason = v?.reason ? `: ${v.reason}` : '';
|
|
115
|
+
if (v?.verdict === 'blocked') return { text: `✖ AOCL ${v.layer || 'L8'} blocked this answer after it was shown${reason}. Do not act on it.`, tone: 'error' };
|
|
116
|
+
return { text: `⚠ AOCL ${v?.layer || 'L8'} flagged this answer${reason}.`, tone: 'warn' };
|
|
117
|
+
}
|