@datename/fastcode-termux 0.1.6-beta → 0.1.8-beta.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/LICENSE +4 -0
- package/README.md +50 -17
- package/dist/agent/approval-json.d.ts +43 -0
- package/dist/agent/approval-json.js +69 -0
- package/dist/agent/approval-native.d.ts +3 -0
- package/dist/agent/approval-native.js +165 -0
- package/dist/agent/approval-store.d.ts +16 -0
- package/dist/agent/approval-store.js +21 -0
- package/dist/agent/approval.d.ts +33 -0
- package/dist/agent/approval.js +40 -5
- package/dist/agent/compaction.d.ts +2 -0
- package/dist/agent/compaction.js +60 -17
- package/dist/agent/guards.d.ts +16 -16
- package/dist/agent/guards.js +978 -24
- package/dist/agent/policy/defaults.d.ts +16 -0
- package/dist/agent/policy/defaults.js +17 -0
- package/dist/agent/policy/egress.d.ts +32 -0
- package/dist/agent/policy/egress.js +280 -0
- package/dist/agent/process-tree.d.ts +20 -0
- package/dist/agent/process-tree.js +81 -10
- package/dist/agent/protocol.d.ts +20 -1
- package/dist/agent/protocol.js +165 -38
- package/dist/agent/registry.d.ts +3 -1
- package/dist/agent/registry.js +168 -11
- package/dist/agent/runner.d.ts +21 -0
- package/dist/agent/runner.js +44 -5
- package/dist/agent/shell-ast.d.ts +11 -0
- package/dist/agent/shell-ast.js +204 -0
- package/dist/agent/shell-session.d.ts +14 -0
- package/dist/agent/shell-session.js +251 -40
- package/dist/agent/tool-schemas.js +26 -7
- package/dist/agent/tools/append_file.js +3 -1
- package/dist/agent/tools/apply_patch.js +44 -4
- package/dist/agent/tools/copy_file.js +26 -3
- package/dist/agent/tools/delete_file.js +22 -3
- package/dist/agent/tools/grep.js +35 -4
- package/dist/agent/tools/make_dir.js +3 -1
- package/dist/agent/tools/move_path.d.ts +7 -0
- package/dist/agent/tools/move_path.js +31 -5
- package/dist/agent/tools/read_file.js +63 -3
- package/dist/agent/tools/read_many.js +21 -3
- package/dist/agent/tools/readers.d.ts +53 -1
- package/dist/agent/tools/readers.js +236 -26
- package/dist/agent/tools/replace_in_file.js +38 -5
- package/dist/agent/tools/shell.js +2 -2
- package/dist/agent/tools/types.d.ts +26 -0
- package/dist/agent/tools/validate.d.ts +15 -2
- package/dist/agent/tools/validate.js +66 -3
- package/dist/agent/tools/write_file.js +3 -1
- package/dist/app.d.ts +2 -1
- package/dist/app.js +526 -85
- package/dist/cli-main.js +363 -0
- package/dist/cli.js +397 -337
- package/dist/commands/about.js +1 -1
- package/dist/commands/clear.d.ts +1 -0
- package/dist/commands/clear.js +1 -1
- package/dist/commands/compact.d.ts +12 -0
- package/dist/commands/compact.js +14 -2
- package/dist/commands/context.js +5 -4
- package/dist/commands/index.js +2 -0
- package/dist/commands/jobs.js +3 -2
- package/dist/commands/kill.js +3 -1
- package/dist/commands/login.d.ts +2 -2
- package/dist/commands/login.js +15 -15
- package/dist/commands/model.d.ts +1 -13
- package/dist/commands/model.js +6 -38
- package/dist/commands/provider.d.ts +1 -15
- package/dist/commands/provider.js +4 -22
- package/dist/commands/skills.js +34 -4
- package/dist/commands/threads.d.ts +9 -0
- package/dist/commands/threads.js +26 -0
- package/dist/config/store.d.ts +21 -0
- package/dist/config/store.js +47 -9
- package/dist/config/trust.d.ts +9 -0
- package/dist/config/trust.js +41 -2
- package/dist/headless.d.ts +7 -0
- package/dist/headless.js +213 -0
- package/dist/index.js +19 -3
- package/dist/lib/debug.d.ts +2 -0
- package/dist/lib/debug.js +22 -0
- package/dist/lib/diagnostics.d.ts +19 -0
- package/dist/lib/diagnostics.js +32 -6
- package/dist/lib/highlight-subset.d.ts +21 -0
- package/dist/lib/highlight-subset.js +88 -0
- package/dist/lib/lifecycle.d.ts +5 -0
- package/dist/lib/lifecycle.js +62 -0
- package/dist/lib/markdown.js +22 -4
- package/dist/providers/deepseek.js +1 -1
- package/dist/providers/openaiCompatible.d.ts +24 -2
- package/dist/providers/openaiCompatible.js +20 -6
- package/dist/providers/spec.d.ts +12 -0
- package/dist/providers/spec.js +29 -0
- package/dist/session/log.d.ts +14 -2
- package/dist/session/log.js +56 -27
- package/dist/session/projection.d.ts +34 -1
- package/dist/session/projection.js +315 -46
- package/dist/skills/manager.d.ts +15 -0
- package/dist/skills/manager.js +135 -18
- package/dist/types.d.ts +15 -0
- package/dist/ui/StatusBar.js +1 -1
- package/package.json +3 -2
- package/src/agent/approval-json.ts +103 -0
- package/src/agent/approval-native.ts +168 -0
- package/src/agent/approval-store.ts +38 -0
- package/src/agent/approval.ts +58 -11
- package/src/agent/compaction.ts +62 -17
- package/src/agent/guards.ts +1049 -25
- package/src/agent/policy/defaults.ts +34 -0
- package/src/agent/policy/egress.ts +335 -0
- package/src/agent/process-tree.ts +105 -23
- package/src/agent/protocol.ts +187 -39
- package/src/agent/registry.ts +186 -14
- package/src/agent/runner.ts +50 -7
- package/src/agent/shell-ast.ts +227 -0
- package/src/agent/shell-session.ts +265 -41
- package/src/agent/tool-schemas.ts +26 -7
- package/src/agent/tools/append_file.ts +3 -1
- package/src/agent/tools/apply_patch.ts +45 -4
- package/src/agent/tools/copy_file.ts +27 -3
- package/src/agent/tools/delete_file.ts +22 -3
- package/src/agent/tools/grep.ts +36 -4
- package/src/agent/tools/make_dir.ts +3 -1
- package/src/agent/tools/move_path.ts +38 -5
- package/src/agent/tools/read_file.ts +64 -3
- package/src/agent/tools/read_many.ts +21 -3
- package/src/agent/tools/readers.ts +289 -26
- package/src/agent/tools/replace_in_file.ts +39 -5
- package/src/agent/tools/shell.ts +2 -2
- package/src/agent/tools/types.ts +43 -1
- package/src/agent/tools/validate.ts +73 -4
- package/src/agent/tools/write_file.ts +3 -1
- package/src/app.ts +533 -82
- package/src/{cli.ts → cli-main.ts} +34 -6
- package/src/commands/about.ts +1 -1
- package/src/commands/clear.ts +1 -1
- package/src/commands/compact.ts +14 -2
- package/src/commands/context.ts +5 -4
- package/src/commands/index.ts +2 -0
- package/src/commands/jobs.ts +3 -2
- package/src/commands/kill.ts +3 -1
- package/src/commands/login.ts +15 -15
- package/src/commands/model.ts +6 -38
- package/src/commands/provider.ts +4 -22
- package/src/commands/skills.ts +34 -4
- package/src/commands/threads.ts +28 -0
- package/src/config/store.ts +47 -9
- package/src/config/trust.ts +45 -2
- package/src/headless.ts +225 -0
- package/src/index.ts +19 -3
- package/src/lib/debug.ts +24 -0
- package/src/lib/diagnostics.ts +32 -6
- package/src/lib/highlight-subset.ts +93 -0
- package/src/lib/lifecycle.ts +69 -0
- package/src/lib/markdown.ts +22 -4
- package/src/providers/deepseek.ts +1 -1
- package/src/providers/openaiCompatible.ts +47 -10
- package/src/providers/spec.ts +42 -0
- package/src/session/log.ts +70 -27
- package/src/session/projection.ts +360 -47
- package/src/skills/manager.ts +140 -18
- package/src/types/highlight-shims.d.ts +14 -0
- package/src/types.ts +16 -1
- package/src/ui/StatusBar.ts +1 -1
- package/tsconfig.json +1 -0
- /package/dist/{cli.d.ts → cli-main.d.ts} +0 -0
package/src/skills/manager.ts
CHANGED
|
@@ -5,21 +5,127 @@
|
|
|
5
5
|
* a SKILL.md file plus optional resource files. FastCode supports three
|
|
6
6
|
* install sources:
|
|
7
7
|
*
|
|
8
|
-
* 1.
|
|
9
|
-
* `/skills install pdf` → resolves via the registry
|
|
10
|
-
* `/skills install owner/repo/skill` → fetches raw SKILL.md
|
|
11
|
-
* 2. Direct https URLs ending in SKILL.md.
|
|
8
|
+
* 1. A registry configured via FASTCODE_SKILLS_REGISTRY or skillsRegistry
|
|
9
|
+
* `/skills install pdf` → resolves via the configured registry
|
|
10
|
+
* `/skills install owner/repo/skill` → fetches raw SKILL.md from the registry
|
|
11
|
+
* 2. Direct https URLs ending in SKILL.md (no registry required).
|
|
12
12
|
* 3. Local paths (just symlinks into ~/.fastcode/skills/).
|
|
13
13
|
*
|
|
14
14
|
* Installed skills can be enabled per-session and are then stitched into
|
|
15
15
|
* the system prompt at chat time, exactly like Claude does internally.
|
|
16
16
|
*/
|
|
17
|
+
import { createHash } from "node:crypto";
|
|
17
18
|
import { readFileSync, writeFileSync, existsSync, readdirSync, rmSync, mkdirSync, } from "node:fs";
|
|
18
19
|
import { join } from "node:path";
|
|
19
20
|
import { getPaths } from "../config/paths.js";
|
|
21
|
+
import { invalidateConfigCache } from "../config/store.js";
|
|
20
22
|
import { fetchJson } from "../lib/http.js";
|
|
21
23
|
import { parseSkill } from "./parser.js";
|
|
22
|
-
const
|
|
24
|
+
const SOURCE_FILE = ".fastcode-source";
|
|
25
|
+
const INTEGRITY_VERSION = 1;
|
|
26
|
+
|
|
27
|
+
export type SkillIntegrity = "ok" | "drift" | "unverified";
|
|
28
|
+
|
|
29
|
+
const REGISTRY_REQUIRED = "No skills registry configured. Set one with `/skills registry <url>` or FASTCODE_SKILLS_REGISTRY.";
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Pick the skills registry without treating an empty environment variable as
|
|
33
|
+
* "configured". `??` would keep `""` and make env overrides silently break;
|
|
34
|
+
* explicit null/empty checks keep `""` and `" "` on the config path. There is
|
|
35
|
+
* intentionally no built-in default registry.
|
|
36
|
+
*/
|
|
37
|
+
export function resolveRegistry(envValue?: string | null, configValue?: string | null): string {
|
|
38
|
+
const env = typeof envValue === "string" && envValue.trim() ? envValue.trim() : "";
|
|
39
|
+
const configured = typeof configValue === "string" && configValue.trim() ? configValue.trim() : "";
|
|
40
|
+
return (env || configured).replace(/\/+$/, "");
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function requireRegistry(registry: string): string {
|
|
44
|
+
if (!registry)
|
|
45
|
+
throw new Error(REGISTRY_REQUIRED);
|
|
46
|
+
return registry;
|
|
47
|
+
}
|
|
48
|
+
export function hashSkillDirectory(folder: string): string {
|
|
49
|
+
const entries = skillFiles(folder).sort();
|
|
50
|
+
return createHash("sha256").update(entries.join("\n")).digest("hex");
|
|
51
|
+
}
|
|
52
|
+
function skillFiles(folder: string, prefix = ""): string[] {
|
|
53
|
+
const out: string[] = [];
|
|
54
|
+
let items;
|
|
55
|
+
try {
|
|
56
|
+
items = readdirSync(folder, { withFileTypes: true });
|
|
57
|
+
}
|
|
58
|
+
catch {
|
|
59
|
+
return out;
|
|
60
|
+
}
|
|
61
|
+
for (const item of items) {
|
|
62
|
+
if (item.name === SOURCE_FILE)
|
|
63
|
+
continue;
|
|
64
|
+
const full = join(folder, item.name);
|
|
65
|
+
const rel = prefix ? prefix + "/" + item.name : item.name;
|
|
66
|
+
if (item.isDirectory()) {
|
|
67
|
+
out.push(...skillFiles(full, rel));
|
|
68
|
+
continue;
|
|
69
|
+
}
|
|
70
|
+
if (!item.isFile())
|
|
71
|
+
continue;
|
|
72
|
+
const digest = createHash("sha256").update(readFileSync(full)).digest("hex");
|
|
73
|
+
out.push(rel + "\0" + digest);
|
|
74
|
+
}
|
|
75
|
+
return out;
|
|
76
|
+
}
|
|
77
|
+
function readSourceMeta(folder: string): { source: string; sha256?: string; legacy: boolean } {
|
|
78
|
+
const sourcePath = join(folder, SOURCE_FILE);
|
|
79
|
+
if (!existsSync(sourcePath))
|
|
80
|
+
return { source: "local", legacy: true };
|
|
81
|
+
const raw = readFileSync(sourcePath, "utf8").trim();
|
|
82
|
+
if (raw.startsWith("{")) {
|
|
83
|
+
try {
|
|
84
|
+
const parsed = JSON.parse(raw);
|
|
85
|
+
return {
|
|
86
|
+
source: typeof parsed.source === "string" ? parsed.source : "local",
|
|
87
|
+
sha256: typeof parsed.sha256 === "string" ? parsed.sha256 : undefined,
|
|
88
|
+
legacy: typeof parsed.sha256 !== "string",
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
catch {
|
|
92
|
+
// Fall through and treat the file as a legacy plain-text source.
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
return { source: raw || "local", legacy: true };
|
|
96
|
+
}
|
|
97
|
+
function writeSourceMeta(folder: string, source: string): string {
|
|
98
|
+
const sha256 = hashSkillDirectory(folder);
|
|
99
|
+
const payload = {
|
|
100
|
+
version: INTEGRITY_VERSION,
|
|
101
|
+
algorithm: "sha256",
|
|
102
|
+
source,
|
|
103
|
+
sha256,
|
|
104
|
+
};
|
|
105
|
+
writeFileSync(join(folder, SOURCE_FILE), JSON.stringify(payload, null, 2));
|
|
106
|
+
return sha256;
|
|
107
|
+
}
|
|
108
|
+
export function rebaselineSkills(names?: string[]): Array<{ name: string; ok: boolean; warning?: string }> {
|
|
109
|
+
const installed = listInstalledSkills();
|
|
110
|
+
const wanted = names && names.length > 0 ? new Set(names) : undefined;
|
|
111
|
+
const results: Array<{ name: string; ok: boolean; warning?: string }> = [];
|
|
112
|
+
let changed = false;
|
|
113
|
+
for (const skill of installed) {
|
|
114
|
+
if (wanted && !wanted.has(skill.name) && !wanted.has(basename(skill.path)))
|
|
115
|
+
continue;
|
|
116
|
+
try {
|
|
117
|
+
writeSourceMeta(skill.path, skill.source === "local" ? "local" : skill.source);
|
|
118
|
+
results.push({ name: skill.name, ok: true });
|
|
119
|
+
changed = true;
|
|
120
|
+
}
|
|
121
|
+
catch (err: any) {
|
|
122
|
+
results.push({ name: skill.name, ok: false, warning: err?.message ?? String(err) });
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
if (changed)
|
|
126
|
+
invalidateConfigCache();
|
|
127
|
+
return results;
|
|
128
|
+
}
|
|
23
129
|
/** List skills currently installed under ~/.fastcode/skills. */
|
|
24
130
|
export function listInstalledSkills() {
|
|
25
131
|
const { skills } = getPaths();
|
|
@@ -35,16 +141,20 @@ export function listInstalledSkills() {
|
|
|
35
141
|
continue;
|
|
36
142
|
const raw = readFileSync(md, "utf8");
|
|
37
143
|
const parsed = parseSkill(raw, dir.name);
|
|
38
|
-
const
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
|
|
144
|
+
const meta = readSourceMeta(folder);
|
|
145
|
+
const actualHash = hashSkillDirectory(folder);
|
|
146
|
+
const integrity: SkillIntegrity = !meta.sha256
|
|
147
|
+
? "unverified"
|
|
148
|
+
: actualHash === meta.sha256 ? "ok" : "drift";
|
|
42
149
|
out.push({
|
|
43
150
|
name: parsed.name || dir.name,
|
|
44
151
|
description: parsed.description,
|
|
45
|
-
source,
|
|
152
|
+
source: meta.source,
|
|
46
153
|
path: folder,
|
|
47
154
|
body: parsed.body,
|
|
155
|
+
integrity,
|
|
156
|
+
sha256: actualHash,
|
|
157
|
+
lockedHash: meta.sha256,
|
|
48
158
|
});
|
|
49
159
|
}
|
|
50
160
|
return out.sort((a, b) => a.name.localeCompare(b.name));
|
|
@@ -56,7 +166,7 @@ export function getSkill(name) {
|
|
|
56
166
|
/** Install a skill. Returns the parsed manifest on success. */
|
|
57
167
|
export async function installSkill(spec, opts: any = {}) {
|
|
58
168
|
const { skills } = getPaths();
|
|
59
|
-
const registry = (opts.registry
|
|
169
|
+
const registry = resolveRegistry(process.env["FASTCODE_SKILLS_REGISTRY"], opts.registry);
|
|
60
170
|
let parsed;
|
|
61
171
|
let source;
|
|
62
172
|
let folderName;
|
|
@@ -68,7 +178,8 @@ export async function installSkill(spec, opts: any = {}) {
|
|
|
68
178
|
}
|
|
69
179
|
else if (looksLikeRepoPath(spec)) {
|
|
70
180
|
// owner/repo or owner/repo/skill — fetch via registry's raw endpoint.
|
|
71
|
-
const
|
|
181
|
+
const base = requireRegistry(registry);
|
|
182
|
+
const url = `${base}/${spec}?format=md`;
|
|
72
183
|
const body = await fetchText(url);
|
|
73
184
|
parsed = parseSkill(body, parts(spec).pop() ?? spec);
|
|
74
185
|
source = url;
|
|
@@ -76,11 +187,12 @@ export async function installSkill(spec, opts: any = {}) {
|
|
|
76
187
|
}
|
|
77
188
|
else {
|
|
78
189
|
// Single-token name → search the registry.
|
|
79
|
-
const
|
|
190
|
+
const base = requireRegistry(registry);
|
|
191
|
+
const hits = await searchRegistry(spec, base);
|
|
80
192
|
const hit = hits[0];
|
|
81
193
|
if (!hit)
|
|
82
|
-
throw new Error(`No skill found for "${spec}" in ${
|
|
83
|
-
const url = hit.fetchUrl ?? `${
|
|
194
|
+
throw new Error(`No skill found for "${spec}" in ${base}`);
|
|
195
|
+
const url = hit.fetchUrl ?? `${base}/${hit.slug}?format=md`;
|
|
84
196
|
const body = await fetchText(url);
|
|
85
197
|
parsed = parseSkill(body, hit.name);
|
|
86
198
|
source = url;
|
|
@@ -94,13 +206,14 @@ export async function installSkill(spec, opts: any = {}) {
|
|
|
94
206
|
rmSync(targetDir, { recursive: true, force: true });
|
|
95
207
|
mkdirSync(targetDir, { recursive: true });
|
|
96
208
|
writeFileSync(join(targetDir, "SKILL.md"), reassemble(parsed));
|
|
97
|
-
|
|
209
|
+
writeSourceMeta(targetDir, source);
|
|
98
210
|
return {
|
|
99
211
|
name: parsed.name || folderName,
|
|
100
212
|
description: parsed.description,
|
|
101
213
|
source,
|
|
102
214
|
path: targetDir,
|
|
103
215
|
body: parsed.body,
|
|
216
|
+
integrity: "ok" as SkillIntegrity,
|
|
104
217
|
};
|
|
105
218
|
}
|
|
106
219
|
/** Remove an installed skill by name or folder. */
|
|
@@ -125,8 +238,10 @@ export function uninstallSkill(name) {
|
|
|
125
238
|
return false;
|
|
126
239
|
}
|
|
127
240
|
/** Search the registry for skills matching a query. */
|
|
128
|
-
export async function searchRegistry(query, registry
|
|
129
|
-
const base =
|
|
241
|
+
export async function searchRegistry(query, registry?: string) {
|
|
242
|
+
const base = resolveRegistry(process.env["FASTCODE_SKILLS_REGISTRY"], registry);
|
|
243
|
+
if (!base)
|
|
244
|
+
return [];
|
|
130
245
|
try {
|
|
131
246
|
const json = await fetchJson(`${base}/api/v1/skills/search?q=${encodeURIComponent(query)}`);
|
|
132
247
|
return json.data ?? [];
|
|
@@ -145,6 +260,13 @@ export function buildSkillsPrompt(enabled) {
|
|
|
145
260
|
const skill = installed.find((s) => s.name === name || basename(s.path) === name);
|
|
146
261
|
if (!skill)
|
|
147
262
|
continue;
|
|
263
|
+
if (skill.integrity !== "ok") {
|
|
264
|
+
const reason = skill.integrity === "drift"
|
|
265
|
+
? "content drift detected"
|
|
266
|
+
: "no integrity baseline (legacy install)";
|
|
267
|
+
process.stderr.write(`skill ${skill.name} ${reason}; disabled. Run /skills verify ${skill.name} --confirm to re-baseline.\n`);
|
|
268
|
+
continue;
|
|
269
|
+
}
|
|
148
270
|
chunks.push(`<skill name="${skill.name}">\n${skill.body.trim()}\n</skill>`);
|
|
149
271
|
}
|
|
150
272
|
if (chunks.length === 0)
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
declare module "bash-parser" {
|
|
2
|
+
const parse: (code: string, options?: any) => any;
|
|
3
|
+
export default parse;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
declare module "highlight.js/lib/core.js" {
|
|
7
|
+
const hljs: any;
|
|
8
|
+
export default hljs;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
declare module "highlight.js/lib/languages/*.js" {
|
|
12
|
+
const language: any;
|
|
13
|
+
export default language;
|
|
14
|
+
}
|
package/src/types.ts
CHANGED
|
@@ -124,6 +124,16 @@ export interface SlashCommand {
|
|
|
124
124
|
/** Execute the command. Return text to render, or undefined for no output. */
|
|
125
125
|
run(ctx: CommandContext): Promise<CommandResult> | CommandResult;
|
|
126
126
|
}
|
|
127
|
+
export interface CommandCompaction {
|
|
128
|
+
summaryRef?: string;
|
|
129
|
+
source: "local" | "server" | "none";
|
|
130
|
+
beforeTokens: number;
|
|
131
|
+
afterTokens: number;
|
|
132
|
+
droppedMessages: number;
|
|
133
|
+
keepMessages: number;
|
|
134
|
+
reason?: "threshold" | "heap" | "manual";
|
|
135
|
+
}
|
|
136
|
+
|
|
127
137
|
export interface CommandResult {
|
|
128
138
|
/** Text rendered as a system message in the transcript. */
|
|
129
139
|
message?: string;
|
|
@@ -133,6 +143,10 @@ export interface CommandResult {
|
|
|
133
143
|
quit?: boolean;
|
|
134
144
|
/** Open an interactive picker after the command runs. */
|
|
135
145
|
picker?: PickerRequest;
|
|
146
|
+
/** Manual /compact result; the app appends the matching compacted fact. */
|
|
147
|
+
compacted?: CommandCompaction;
|
|
148
|
+
/** /clear result; the app appends a cleared fact so resume does not resurrect history. */
|
|
149
|
+
cleared?: boolean;
|
|
136
150
|
}
|
|
137
151
|
export interface CommandContext {
|
|
138
152
|
args: string[];
|
|
@@ -166,6 +180,7 @@ export interface AppActions {
|
|
|
166
180
|
setSystemPrompt(prompt: string): void;
|
|
167
181
|
setSkillsRegistry(url: string): void;
|
|
168
182
|
setReasoningEffort(effort: ReasoningEffort): void;
|
|
183
|
+
setShellPoolSize(size: number): void;
|
|
169
184
|
enableSkill(name: string): void;
|
|
170
185
|
disableSkill(name: string): void;
|
|
171
186
|
enablePlugin(name: string): void;
|
|
@@ -178,7 +193,7 @@ export interface AppActions {
|
|
|
178
193
|
setInput(text: string): void;
|
|
179
194
|
pushSystemMessage(text: string): void;
|
|
180
195
|
/** Begin the guided API-key flow (choose provider → model → key). */
|
|
181
|
-
startLogin(options: { provider?: string; model?: string }): void;
|
|
196
|
+
startLogin(options: { provider?: string; model?: string; flow?: "provider" | "model" | "login" }): void;
|
|
182
197
|
}
|
|
183
198
|
export interface SkillManifest {
|
|
184
199
|
name: string;
|
package/src/ui/StatusBar.ts
CHANGED
|
@@ -9,7 +9,7 @@ export const StatusBar = ({ theme, providerId, model, inputTokens, outputTokens,
|
|
|
9
9
|
const providerModel = `${providerId}/${model}`;
|
|
10
10
|
const label = compact ? truncate(providerModel, Math.max(18, columns - 28)) : providerModel;
|
|
11
11
|
const effort = reasoningEffort && reasoningEffort !== "auto" ? `effort:${reasoningEffort}` : "";
|
|
12
|
-
return (_jsxs(Box, { flexDirection: compact ? "column" : "row", justifyContent: "space-between", borderStyle: "round", borderColor: theme.border, paddingX: 1, children: [_jsxs(Text, { color: theme.muted, children: [_jsx(Text, { color: theme.accent, children: "\u25CF" }), " ", label, _jsx(Text, { color: theme.muted, children: " \u00B7 " }), inputTokens, "\u2191 ", outputTokens, "\u2193 ", cost, effort ? (_jsxs(_Fragment, { children: [_jsx(Text, { color: theme.muted, children: " \u00B7 " }), effort] })) : null, !compact ? (_jsxs(_Fragment, { children: [_jsx(Text, { color: theme.muted, children: " \u00B7 " }), "skills: ", enabledSkillCount, _jsx(Text, { color: theme.muted, children: " \u00B7 " }), platformLabel()] })) : null] }), _jsx(Text, { color: theme.muted, children: compact
|
|
12
|
+
return (_jsxs(Box, { flexDirection: compact ? "column" : "row", justifyContent: "space-between", borderStyle: "round", borderColor: theme.border, paddingX: 1, children: [_jsxs(Text, { color: theme.muted, children: [_jsx(Text, { color: theme.accent, children: "\u25CF" }), " ", label, _jsx(Text, { color: theme.muted, children: " \u00B7 " }), inputTokens, "\u2191 ", outputTokens, "\u2193 ", cost, !compact && effort ? (_jsxs(_Fragment, { children: [_jsx(Text, { color: theme.muted, children: " \u00B7 " }), effort] })) : null, !compact ? (_jsxs(_Fragment, { children: [_jsx(Text, { color: theme.muted, children: " \u00B7 " }), "skills: ", enabledSkillCount, _jsx(Text, { color: theme.muted, children: " \u00B7 " }), platformLabel()] })) : null] }), _jsx(Text, { color: theme.muted, children: compact
|
|
13
13
|
? `${effort ? effort + " \u00B7 " : ""}${platformLabel()} \u00B7 skills:${enabledSkillCount} \u00B7 ${hint ?? "/help \u00B7 esc \u00B7 ctrl+c"}`
|
|
14
14
|
: hint ?? "/help \u00B7 esc cancel \u00B7 ctrl+c quit" })] }));
|
|
15
15
|
};
|
package/tsconfig.json
CHANGED
|
File without changes
|