@cspeach/cli 1.1.25 → 1.1.26
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/dist/agent/loop.js +20 -8
- package/dist/agent/tool-dispatch.js +6 -0
- package/dist/auth/auth-file.js +173 -12
- package/dist/classifier/client.js +55 -30
- package/dist/cli.js +11 -0
- package/dist/commands/config-set.js +13 -0
- package/dist/commands/config-show.js +5 -1
- package/dist/commands/cost.js +24 -22
- package/dist/commands/deploy-card.js +135 -0
- package/dist/commands/login.js +31 -13
- package/dist/commands/plan-chain.js +31 -0
- package/dist/commands/plan-continue.js +1 -0
- package/dist/commands/plan-resume.js +49 -2
- package/dist/cost/cost-log.js +76 -4
- package/dist/cost/credits-wire.js +9 -0
- package/dist/cost/credits.js +24 -6
- package/dist/cost/router-spend.js +24 -0
- package/dist/cost/session-cost.js +16 -2
- package/dist/models/server-config.js +21 -1
- package/dist/one-shot.js +12 -2
- package/dist/projects/plan-lane.js +47 -0
- package/dist/projects/plan-run.js +8 -0
- package/dist/projects/plan-schema.js +2 -0
- package/dist/projects/save-command.js +3 -2
- package/dist/renderer/footer-line.js +10 -4
- package/dist/renderer/status-footer.js +5 -4
- package/dist/renderer/tool-labels.js +2 -1
- package/dist/repl.js +41 -8
- package/dist/router/byok-classifier.js +159 -0
- package/dist/router/classifier.js +130 -6
- package/dist/router/router-core.js +307 -0
- package/dist/router/router-prompt.js +121 -0
- package/dist/router/routing-failure.js +65 -3
- package/dist/skills/bundled-skills.js +45 -45
- package/dist/tools/fiori/deploy/existing-bsp.js +67 -0
- package/dist/tools/fiori/deploy/run.js +608 -0
- package/dist/tools/fiori/deploy/scope.js +8 -0
- package/dist/tools/fiori/deploy/yaml-read.js +236 -0
- package/dist/tools/fiori/deploy-config.js +24 -6
- package/dist/tools/fiori/tools.js +117 -5
- package/dist/tools/local-build.js +3 -0
- package/dist/tools/subagent/read_agent.js +4 -2
- package/dist/tools/tool-loading.js +1 -1
- package/package.json +1 -1
|
@@ -1,17 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Skill-routing failure: what happened, in true words (live fix 2026-09-26).
|
|
3
|
+
*
|
|
4
|
+
* Fix 9: the REPL used to print "Skill routing is offline · CSPeach service
|
|
5
|
+
* unreachable: This operation was aborted" when the classify call merely
|
|
6
|
+
* timed out (the proxy was healthy). The wording now comes from the
|
|
7
|
+
* classifier's machine-readable kind — never "offline"/"unreachable" for a
|
|
8
|
+
* timeout. Used by the Ink REPL, the classic REPL and one-shot.
|
|
9
|
+
*/
|
|
10
|
+
import { localRulesResult } from './classifier.js';
|
|
1
11
|
/** The failure behind an offline (fallback) classify result, or null when routing worked. */
|
|
2
12
|
export function routingFailureFromResult(c) {
|
|
3
13
|
if (!c.offline)
|
|
4
14
|
return null;
|
|
5
|
-
|
|
15
|
+
if (c.transport_kind === 'timeout')
|
|
16
|
+
return { kind: 'timeout' };
|
|
17
|
+
if (c.transport_kind === 'http' && typeof c.http_status === 'number')
|
|
18
|
+
return { kind: 'http', status: c.http_status };
|
|
19
|
+
if (c.transport_kind === 'failed')
|
|
20
|
+
return { kind: 'failed' };
|
|
21
|
+
return { kind: 'network' };
|
|
6
22
|
}
|
|
7
|
-
/** The failure behind a thrown classify error (HTTP), or null for any other error. */
|
|
23
|
+
/** The failure behind a thrown classify error (HTTP / unreadable body), or null for any other error. */
|
|
8
24
|
export function routingFailureFromError(err) {
|
|
9
25
|
// Duck-typed (not instanceof) so a re-loaded module instance still matches.
|
|
10
26
|
const e = err;
|
|
11
|
-
if (e && e.transport_kind === 'http' && typeof e.status === 'number')
|
|
27
|
+
if (e && e.transport_kind === 'http' && typeof e.status === 'number') {
|
|
12
28
|
return { kind: 'http', status: e.status };
|
|
29
|
+
}
|
|
30
|
+
if (e && e.transport_kind === 'failed')
|
|
31
|
+
return { kind: 'failed' };
|
|
13
32
|
return null;
|
|
14
33
|
}
|
|
34
|
+
/**
|
|
35
|
+
* Live fix 2026-10-02 — a classify failure (the proxy answered HTTP 500 for a
|
|
36
|
+
* prompt its router answered in prose; an unreadable body; anything else
|
|
37
|
+
* classifyPrompt throws) no longer ends the turn or escapes one-shot as
|
|
38
|
+
* "unhandled error". Every routing path (Ink REPL, classic REPL, one-shot)
|
|
39
|
+
* takes this result instead: the bundled local-rules pick at low confidence,
|
|
40
|
+
* marked offline with the failure kind, so the existing offline handling
|
|
41
|
+
* runs — the low-confidence path (picker / one-shot top-1), one notice, and
|
|
42
|
+
* fix 10's "stay in the active skill" mid-skill.
|
|
43
|
+
*
|
|
44
|
+
* Returns null (caller keeps its own handling) for a missing API key, a user
|
|
45
|
+
* cancel (AbortError), and the slash-guard CLI bug, which must stay loud.
|
|
46
|
+
*/
|
|
47
|
+
export function routingFallbackFromError(err, prompt) {
|
|
48
|
+
const e = err;
|
|
49
|
+
if (e?.message === 'no_api_key')
|
|
50
|
+
return null;
|
|
51
|
+
if (e?.name === 'AbortError')
|
|
52
|
+
return null;
|
|
53
|
+
if (typeof e?.message === 'string' && e.message.startsWith('slash command reached the classifier'))
|
|
54
|
+
return null;
|
|
55
|
+
const f = routingFailureFromError(err) ?? { kind: 'failed' };
|
|
56
|
+
return {
|
|
57
|
+
...localRulesResult(prompt),
|
|
58
|
+
offline: true,
|
|
59
|
+
transport_kind: f.kind === 'http' ? 'http' : 'failed',
|
|
60
|
+
...(f.kind === 'http' ? { http_status: f.status } : {}),
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
/** "Couldn't pick a skill automatically (HTTP 500)" — the 2026-10-02 fallback headline. */
|
|
64
|
+
function couldNotPick(f) {
|
|
65
|
+
return `Couldn't pick a skill automatically${f.kind === 'http' ? ` (HTTP ${f.status})` : ''}`;
|
|
66
|
+
}
|
|
15
67
|
/** Headline for the notice: "Skill routing timed out" etc. */
|
|
16
68
|
export function routingFailureText(f) {
|
|
17
69
|
switch (f.kind) {
|
|
@@ -20,15 +72,24 @@ export function routingFailureText(f) {
|
|
|
20
72
|
case 'timeout': return 'Skill routing timed out';
|
|
21
73
|
case 'network': return "Skill routing couldn't reach the CSPeach service";
|
|
22
74
|
case 'http': return `Skill routing failed (HTTP ${f.status})`;
|
|
75
|
+
case 'failed': return 'Skill routing failed';
|
|
23
76
|
}
|
|
24
77
|
}
|
|
25
78
|
/** The attention notice: headline, plus the real cause for network failures. */
|
|
26
79
|
export function routingFailureNotice(f, transportError) {
|
|
80
|
+
// 2026-10-02: an HTTP / other classify failure now continues on local
|
|
81
|
+
// rules (routingFallbackFromError) — say so, and how to choose.
|
|
82
|
+
if (f.kind === 'http' || f.kind === 'failed') {
|
|
83
|
+
return { text: couldNotPick(f), fact: 'routed by local rules — start with /skill to choose' };
|
|
84
|
+
}
|
|
27
85
|
const text = routingFailureText(f);
|
|
28
86
|
return f.kind === 'network' && transportError ? { text, fact: transportError } : { text };
|
|
29
87
|
}
|
|
30
88
|
/** One-shot's dim stderr line (the turn continues on the bundled local rules). */
|
|
31
89
|
export function routingFailureOneShotLine(f, transportError) {
|
|
90
|
+
if (f.kind === 'http' || f.kind === 'failed') {
|
|
91
|
+
return `[${couldNotPick(f)} — routed by local rules. Start with /skill to choose.]`;
|
|
92
|
+
}
|
|
32
93
|
const n = routingFailureNotice(f, transportError);
|
|
33
94
|
return `[${n.text}${n.fact ? `: ${n.fact}` : ''} — routed by local rules]`;
|
|
34
95
|
}
|
|
@@ -38,6 +99,7 @@ function routingFailureShort(f) {
|
|
|
38
99
|
case 'timeout': return 'Routing timed out';
|
|
39
100
|
case 'network': return "Routing couldn't reach the CSPeach service";
|
|
40
101
|
case 'http': return `Routing failed (HTTP ${f.status})`;
|
|
102
|
+
case 'failed': return 'Routing failed';
|
|
41
103
|
}
|
|
42
104
|
}
|
|
43
105
|
/**
|