@pencil-agent/nano-pencil 1.6.7 → 1.7.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/dist/core/agent-session.d.ts +1 -1
- package/dist/core/agent-session.js +20 -20
- package/dist/core/mcp-manager.d.ts +0 -3
- package/dist/core/mcp-manager.js +6 -42
- package/dist/core/sdk.js +5 -5
- package/dist/core/soul-integration.js +3 -8
- package/dist/main.js +22 -66
- package/dist/pencil-mem-integration.js +1 -2
- package/package.json +85 -86
- package/dist/extensions/nanomem/package.json +0 -5
- package/dist/extensions/nanosoul/package.json +0 -5
- package/dist/modes/interactive/theme/dark.json +0 -85
- package/dist/modes/interactive/theme/light.json +0 -84
- package/dist/modes/interactive/theme/theme-schema.json +0 -335
- package/dist/modes/interactive/theme/warm.json +0 -81
- package/dist/packages/nanomem/package.json +0 -5
- package/dist/packages/nanosoul/package.json +0 -5
|
@@ -234,7 +234,7 @@ export declare class AgentSession {
|
|
|
234
234
|
* Also rebuilds the system prompt to reflect the new tool set.
|
|
235
235
|
* Changes take effect on the next agent turn.
|
|
236
236
|
*/
|
|
237
|
-
setActiveToolsByName(toolNames: string[]):
|
|
237
|
+
setActiveToolsByName(toolNames: string[]): void;
|
|
238
238
|
/** Whether auto-compaction is currently running */
|
|
239
239
|
get isCompacting(): boolean;
|
|
240
240
|
/** All messages including custom types like BashExecutionMessage */
|
|
@@ -428,7 +428,7 @@ export class AgentSession {
|
|
|
428
428
|
* Also rebuilds the system prompt to reflect the new tool set.
|
|
429
429
|
* Changes take effect on the next agent turn.
|
|
430
430
|
*/
|
|
431
|
-
|
|
431
|
+
setActiveToolsByName(toolNames) {
|
|
432
432
|
const tools = [];
|
|
433
433
|
const validToolNames = [];
|
|
434
434
|
for (const name of toolNames) {
|
|
@@ -440,7 +440,7 @@ export class AgentSession {
|
|
|
440
440
|
}
|
|
441
441
|
this.agent.setTools(tools);
|
|
442
442
|
// Rebuild base system prompt with new tool set
|
|
443
|
-
this._baseSystemPrompt =
|
|
443
|
+
this._baseSystemPrompt = this._rebuildSystemPrompt(validToolNames);
|
|
444
444
|
this.agent.setSystemPrompt(this._baseSystemPrompt);
|
|
445
445
|
}
|
|
446
446
|
/** Whether auto-compaction is currently running */
|
|
@@ -484,7 +484,7 @@ export class AgentSession {
|
|
|
484
484
|
get promptTemplates() {
|
|
485
485
|
return this._resourceLoader.getPrompts().prompts;
|
|
486
486
|
}
|
|
487
|
-
|
|
487
|
+
_rebuildSystemPrompt(toolNames) {
|
|
488
488
|
const validToolNames = toolNames.filter((name) => this._baseToolRegistry.has(name));
|
|
489
489
|
const loaderSystemPrompt = this._resourceLoader.getSystemPrompt();
|
|
490
490
|
const loaderAppendSystemPrompt = this._resourceLoader.getAppendSystemPrompt();
|
|
@@ -494,21 +494,21 @@ export class AgentSession {
|
|
|
494
494
|
const loadedSkills = this._resourceLoader.getSkills().skills;
|
|
495
495
|
const loadedContextFiles = this._resourceLoader.getAgentsFiles().agentsFiles;
|
|
496
496
|
// Generate Soul injection if available
|
|
497
|
-
// TEMPORARILY DISABLED for diagnosing second message delay
|
|
498
497
|
let soulInjection;
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
498
|
+
if (this._soulManager) {
|
|
499
|
+
try {
|
|
500
|
+
soulInjection = this._soulManager.generateInjection({
|
|
501
|
+
project: this._cwd.split("/").pop() || "unknown",
|
|
502
|
+
tags: [],
|
|
503
|
+
complexity: 0.5,
|
|
504
|
+
toolUsage: {},
|
|
505
|
+
timestamp: new Date(),
|
|
506
|
+
});
|
|
507
|
+
}
|
|
508
|
+
catch (error) {
|
|
509
|
+
console.warn("Failed to generate Soul injection:", error);
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
512
|
return buildSystemPrompt({
|
|
513
513
|
cwd: this._cwd,
|
|
514
514
|
skills: loadedSkills,
|
|
@@ -1530,7 +1530,7 @@ export class AgentSession {
|
|
|
1530
1530
|
themePaths: this.buildExtensionResourcePaths(themePaths),
|
|
1531
1531
|
};
|
|
1532
1532
|
this._resourceLoader.extendResources(extensionPaths);
|
|
1533
|
-
this._baseSystemPrompt =
|
|
1533
|
+
this._baseSystemPrompt = this._rebuildSystemPrompt(this.getActiveToolNames());
|
|
1534
1534
|
this.agent.setSystemPrompt(this._baseSystemPrompt);
|
|
1535
1535
|
}
|
|
1536
1536
|
buildExtensionResourcePaths(entries) {
|
|
@@ -1694,7 +1694,7 @@ export class AgentSession {
|
|
|
1694
1694
|
getSystemPrompt: () => this.systemPrompt,
|
|
1695
1695
|
});
|
|
1696
1696
|
}
|
|
1697
|
-
|
|
1697
|
+
_buildRuntime(options) {
|
|
1698
1698
|
const autoResizeImages = this.settingsManager.getImageAutoResize();
|
|
1699
1699
|
const shellCommandPrefix = this.settingsManager.getShellCommandPrefix();
|
|
1700
1700
|
const baseTools = this._baseToolsOverride
|
|
@@ -1771,7 +1771,7 @@ export class AgentSession {
|
|
|
1771
1771
|
this._toolRegistry = toolRegistry;
|
|
1772
1772
|
}
|
|
1773
1773
|
const systemPromptToolNames = Array.from(activeToolNameSet).filter((name) => this._baseToolRegistry.has(name));
|
|
1774
|
-
this._baseSystemPrompt =
|
|
1774
|
+
this._baseSystemPrompt = this._rebuildSystemPrompt(systemPromptToolNames);
|
|
1775
1775
|
this.agent.setSystemPrompt(this._baseSystemPrompt);
|
|
1776
1776
|
}
|
|
1777
1777
|
async reload() {
|
|
@@ -11,9 +11,6 @@ export declare class MCPManager {
|
|
|
11
11
|
constructor();
|
|
12
12
|
/**
|
|
13
13
|
* Initialize MCP manager and load tools
|
|
14
|
-
*
|
|
15
|
-
* Note: This only adds server configurations and creates tool definitions.
|
|
16
|
-
* Servers will be started lazily when tools are first called.
|
|
17
14
|
*/
|
|
18
15
|
initialize(): Promise<void>;
|
|
19
16
|
/**
|
package/dist/core/mcp-manager.js
CHANGED
|
@@ -4,27 +4,7 @@
|
|
|
4
4
|
* Manages MCP client lifecycle and tool integration.
|
|
5
5
|
*/
|
|
6
6
|
import { MCPClient } from "./mcp/mcp-client.js";
|
|
7
|
-
import { createMCPTool } from "./mcp/mcp-adapter.js";
|
|
8
7
|
import { listEnabledMCPServers } from "./mcp/mcp-config.js";
|
|
9
|
-
// Pre-defined MCP tool schemas for servers that don't need to be started upfront
|
|
10
|
-
// These will be available to the AI, and the server will be started on first use
|
|
11
|
-
const PREDEFINED_MCP_TOOLS = {
|
|
12
|
-
filesystem: [
|
|
13
|
-
{ name: "filesystem/read", description: "Read a file from the filesystem" },
|
|
14
|
-
{ name: "filesystem/write", description: "Write content to a file" },
|
|
15
|
-
{ name: "filesystem/list", description: "List directory contents" },
|
|
16
|
-
],
|
|
17
|
-
fetch: [{ name: "fetch/fetch", description: "Fetch a web page" }],
|
|
18
|
-
puppeteer: [
|
|
19
|
-
{ name: "puppeteer/navigate", description: "Navigate to a URL" },
|
|
20
|
-
{ name: "puppeteer/screenshot", description: "Take a screenshot" },
|
|
21
|
-
],
|
|
22
|
-
sqlite: [{ name: "sqlite/query", description: "Query SQLite database" }],
|
|
23
|
-
git: [
|
|
24
|
-
{ name: "git/clone", description: "Clone a git repository" },
|
|
25
|
-
{ name: "git/status", description: "Get git status" },
|
|
26
|
-
],
|
|
27
|
-
};
|
|
28
8
|
export class MCPManager {
|
|
29
9
|
client;
|
|
30
10
|
tools = [];
|
|
@@ -33,36 +13,20 @@ export class MCPManager {
|
|
|
33
13
|
}
|
|
34
14
|
/**
|
|
35
15
|
* Initialize MCP manager and load tools
|
|
36
|
-
*
|
|
37
|
-
* Note: This only adds server configurations and creates tool definitions.
|
|
38
|
-
* Servers will be started lazily when tools are first called.
|
|
39
16
|
*/
|
|
40
17
|
async initialize() {
|
|
41
18
|
// Load enabled servers
|
|
42
19
|
const enabledServers = listEnabledMCPServers();
|
|
43
20
|
for (const serverConfig of enabledServers) {
|
|
44
21
|
this.client.addServer(serverConfig);
|
|
45
|
-
//
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
// Create tool definitions from predefined schemas
|
|
49
|
-
// This avoids starting servers just to list their tools
|
|
50
|
-
for (const server of enabledServers) {
|
|
51
|
-
const predefinedTools = PREDEFINED_MCP_TOOLS[server.id];
|
|
52
|
-
if (predefinedTools) {
|
|
53
|
-
for (const toolDef of predefinedTools) {
|
|
54
|
-
this.tools.push(createMCPTool(this.client, {
|
|
55
|
-
name: toolDef.name,
|
|
56
|
-
description: toolDef.description,
|
|
57
|
-
inputSchema: {
|
|
58
|
-
type: "object",
|
|
59
|
-
properties: {},
|
|
60
|
-
},
|
|
61
|
-
serverId: server.id,
|
|
62
|
-
}));
|
|
63
|
-
}
|
|
22
|
+
// Start stdio-based servers
|
|
23
|
+
if (serverConfig.transport !== "sse") {
|
|
24
|
+
await this.client.startServer(serverConfig.id);
|
|
64
25
|
}
|
|
65
26
|
}
|
|
27
|
+
// Load tools from all servers
|
|
28
|
+
// TODO: MCP tool integration disabled due to type compatibility issues
|
|
29
|
+
// this.tools = await loadMCPTools(this.client);
|
|
66
30
|
}
|
|
67
31
|
/**
|
|
68
32
|
* Get all MCP tools as NanoPencil ToolDefinitions
|
package/dist/core/sdk.js
CHANGED
|
@@ -234,20 +234,20 @@ export async function createAgentSession(options = {}) {
|
|
|
234
234
|
}
|
|
235
235
|
// Initialize MCP if enabled (before creating AgentSession)
|
|
236
236
|
let mcpManager;
|
|
237
|
-
|
|
237
|
+
// TODO: MCP tool integration disabled due to type compatibility issues
|
|
238
|
+
// Will be re-enabled after refactoring tool adapter
|
|
239
|
+
// const mcpTools: ToolDefinition[] = [];
|
|
238
240
|
if (options.enableMCP) {
|
|
239
241
|
try {
|
|
240
242
|
mcpManager = new MCPManager();
|
|
241
243
|
await mcpManager.initialize();
|
|
242
|
-
mcpTools.push(...mcpManager.getTools());
|
|
244
|
+
// mcpTools.push(...mcpManager.getTools());
|
|
243
245
|
time("mcp.initialize");
|
|
244
246
|
}
|
|
245
247
|
catch (error) {
|
|
246
248
|
console.warn(`Failed to initialize MCP: ${error}`);
|
|
247
249
|
}
|
|
248
250
|
}
|
|
249
|
-
// Merge MCP tools with custom tools
|
|
250
|
-
const allCustomTools = [...(options.customTools || []), ...mcpTools];
|
|
251
251
|
// Initialize Soul if enabled (before creating AgentSession)
|
|
252
252
|
let soulManager;
|
|
253
253
|
if (isSoulEnabled(options)) {
|
|
@@ -273,7 +273,7 @@ export async function createAgentSession(options = {}) {
|
|
|
273
273
|
cwd,
|
|
274
274
|
scopedModels: options.scopedModels,
|
|
275
275
|
resourceLoader,
|
|
276
|
-
customTools:
|
|
276
|
+
customTools: options.customTools,
|
|
277
277
|
modelRegistry,
|
|
278
278
|
initialActiveToolNames,
|
|
279
279
|
extensionRunnerRef,
|
|
@@ -3,17 +3,14 @@
|
|
|
3
3
|
* [OUTPUT]: Configured SoulManager with NanoPencil defaults
|
|
4
4
|
* [POS]: Integration layer - bridges Soul and NanoPencil
|
|
5
5
|
*/
|
|
6
|
-
import { join
|
|
6
|
+
import { join } from "node:path";
|
|
7
7
|
import { getAgentDir } from "../config.js";
|
|
8
8
|
import { existsSync } from "node:fs";
|
|
9
9
|
import { fileURLToPath } from "node:url";
|
|
10
10
|
import { dirname } from "node:path";
|
|
11
|
-
import { pathToFileURL } from "node:url";
|
|
12
11
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
13
12
|
// Try to load from bundled packages first (dist/packages/nanosoul)
|
|
14
|
-
|
|
15
|
-
// Use resolve to normalize the path and avoid mixed separators on Windows
|
|
16
|
-
const BUNDLED_SOUL = resolve(__dirname, "..", "packages", "nanosoul");
|
|
13
|
+
const BUNDLED_SOUL = join(__dirname, "packages", "nanosoul");
|
|
17
14
|
/**
|
|
18
15
|
* Default Soul configuration for NanoPencil
|
|
19
16
|
*/
|
|
@@ -52,9 +49,7 @@ export async function createSoulManager() {
|
|
|
52
49
|
try {
|
|
53
50
|
// Try bundled package first (dist/packages/nanosoul)
|
|
54
51
|
if (existsSync(BUNDLED_SOUL)) {
|
|
55
|
-
const
|
|
56
|
-
const importPath = pathToFileURL(indexPath).href;
|
|
57
|
-
const { SoulManager: SM } = await import(importPath);
|
|
52
|
+
const { SoulManager: SM } = await import(join(BUNDLED_SOUL, "index.js"));
|
|
58
53
|
return new SM({
|
|
59
54
|
config: getSoulConfig(),
|
|
60
55
|
});
|
package/dist/main.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* This file handles CLI argument parsing and translates them into
|
|
5
5
|
* createAgentSession() options. The SDK does the heavy lifting.
|
|
6
6
|
*/
|
|
7
|
-
import { modelsAreEqual, supportsXhigh
|
|
7
|
+
import { modelsAreEqual, supportsXhigh } from "@mariozechner/pi-ai";
|
|
8
8
|
import chalk from "chalk";
|
|
9
9
|
import { join } from "path";
|
|
10
10
|
import { createInterface } from "readline";
|
|
@@ -19,17 +19,17 @@ import { DEFAULT_THINKING_LEVEL } from "./core/defaults.js";
|
|
|
19
19
|
import { exportFromFile } from "./core/export-html/index.js";
|
|
20
20
|
import { KeybindingsManager } from "./core/keybindings.js";
|
|
21
21
|
import { ModelRegistry } from "./core/model-registry.js";
|
|
22
|
-
import { resolveCliModel, resolveModelScope
|
|
22
|
+
import { resolveCliModel, resolveModelScope } from "./core/model-resolver.js";
|
|
23
23
|
import { DefaultPackageManager } from "./core/package-manager.js";
|
|
24
24
|
import { DefaultResourceLoader } from "./core/resource-loader.js";
|
|
25
|
-
import { createAgentSession
|
|
25
|
+
import { createAgentSession } from "./core/sdk.js";
|
|
26
26
|
import { SessionManager } from "./core/session-manager.js";
|
|
27
27
|
import { SettingsManager } from "./core/settings-manager.js";
|
|
28
28
|
import { printTimings, time } from "./core/timings.js";
|
|
29
29
|
import { allTools } from "./core/tools/index.js";
|
|
30
30
|
import { runMigrations, showDeprecationWarnings } from "./migrations.js";
|
|
31
31
|
import { InteractiveMode, runPrintMode, runRpcMode } from "./modes/index.js";
|
|
32
|
-
import { initTheme, stopThemeWatcher
|
|
32
|
+
import { initTheme, stopThemeWatcher } from "./modes/interactive/theme/theme.js";
|
|
33
33
|
import { ensureNanopencilCodingPlanAuth, ensureNanopencilDefaultConfig, NANOPENCIL_DEFAULT_PROVIDER, } from "./nanopencil-defaults.js";
|
|
34
34
|
import { getNanopencilDefaultExtensionPaths } from "./pencil-mem-integration.js";
|
|
35
35
|
/**
|
|
@@ -65,9 +65,7 @@ function reportSettingsErrors(settingsManager, context) {
|
|
|
65
65
|
function isTruthyEnvFlag(value) {
|
|
66
66
|
if (!value)
|
|
67
67
|
return false;
|
|
68
|
-
return
|
|
69
|
-
value.toLowerCase() === "true" ||
|
|
70
|
-
value.toLowerCase() === "yes");
|
|
68
|
+
return value === "1" || value.toLowerCase() === "true" || value.toLowerCase() === "yes";
|
|
71
69
|
}
|
|
72
70
|
function getPackageCommandUsage(command) {
|
|
73
71
|
switch (command) {
|
|
@@ -133,10 +131,7 @@ List installed packages from user and project settings.
|
|
|
133
131
|
}
|
|
134
132
|
function parsePackageCommand(args) {
|
|
135
133
|
const [command, ...rest] = args;
|
|
136
|
-
if (command !== "install" &&
|
|
137
|
-
command !== "remove" &&
|
|
138
|
-
command !== "update" &&
|
|
139
|
-
command !== "list") {
|
|
134
|
+
if (command !== "install" && command !== "remove" && command !== "update" && command !== "list") {
|
|
140
135
|
return undefined;
|
|
141
136
|
}
|
|
142
137
|
let local = false;
|
|
@@ -183,8 +178,7 @@ async function handlePackageCommand(args) {
|
|
|
183
178
|
return true;
|
|
184
179
|
}
|
|
185
180
|
const source = options.source;
|
|
186
|
-
if ((options.command === "install" || options.command === "remove") &&
|
|
187
|
-
!source) {
|
|
181
|
+
if ((options.command === "install" || options.command === "remove") && !source) {
|
|
188
182
|
console.error(chalk.red(`Missing ${options.command} source.`));
|
|
189
183
|
console.error(chalk.dim(`Usage: ${getPackageCommandUsage(options.command)}`));
|
|
190
184
|
process.exitCode = 1;
|
|
@@ -194,11 +188,7 @@ async function handlePackageCommand(args) {
|
|
|
194
188
|
const agentDir = getAgentDir();
|
|
195
189
|
const settingsManager = SettingsManager.create(cwd, agentDir);
|
|
196
190
|
reportSettingsErrors(settingsManager, "package command");
|
|
197
|
-
const packageManager = new DefaultPackageManager({
|
|
198
|
-
cwd,
|
|
199
|
-
agentDir,
|
|
200
|
-
settingsManager,
|
|
201
|
-
});
|
|
191
|
+
const packageManager = new DefaultPackageManager({ cwd, agentDir, settingsManager });
|
|
202
192
|
packageManager.setProgressCallback((event) => {
|
|
203
193
|
if (event.type === "start") {
|
|
204
194
|
process.stdout.write(chalk.dim(`${event.message}\n`));
|
|
@@ -213,9 +203,7 @@ async function handlePackageCommand(args) {
|
|
|
213
203
|
return true;
|
|
214
204
|
case "remove": {
|
|
215
205
|
await packageManager.remove(source, { local: options.local });
|
|
216
|
-
const removed = packageManager.removeSourceFromSettings(source, {
|
|
217
|
-
local: options.local,
|
|
218
|
-
});
|
|
206
|
+
const removed = packageManager.removeSourceFromSettings(source, { local: options.local });
|
|
219
207
|
if (!removed) {
|
|
220
208
|
console.error(chalk.red(`No matching package found for ${source}`));
|
|
221
209
|
process.exitCode = 1;
|
|
@@ -281,9 +269,7 @@ async function prepareInitialMessage(parsed, autoResizeImages) {
|
|
|
281
269
|
if (parsed.fileArgs.length === 0) {
|
|
282
270
|
return {};
|
|
283
271
|
}
|
|
284
|
-
const { text, images } = await processFileArguments(parsed.fileArgs, {
|
|
285
|
-
autoResizeImages,
|
|
286
|
-
});
|
|
272
|
+
const { text, images } = await processFileArguments(parsed.fileArgs, { autoResizeImages });
|
|
287
273
|
let initialMessage;
|
|
288
274
|
if (parsed.messages.length > 0) {
|
|
289
275
|
initialMessage = text + parsed.messages[0];
|
|
@@ -303,9 +289,7 @@ async function prepareInitialMessage(parsed, autoResizeImages) {
|
|
|
303
289
|
*/
|
|
304
290
|
async function resolveSessionPath(sessionArg, cwd, sessionDir) {
|
|
305
291
|
// If it looks like a file path, use as-is
|
|
306
|
-
if (sessionArg.includes("/") ||
|
|
307
|
-
sessionArg.includes("\\") ||
|
|
308
|
-
sessionArg.endsWith(".jsonl")) {
|
|
292
|
+
if (sessionArg.includes("/") || sessionArg.includes("\\") || sessionArg.endsWith(".jsonl")) {
|
|
309
293
|
return { type: "path", path: sessionArg };
|
|
310
294
|
}
|
|
311
295
|
// Try to match as session ID in current project first
|
|
@@ -373,7 +357,7 @@ async function createSessionManager(parsed, cwd) {
|
|
|
373
357
|
// Default case (new session) returns undefined, SDK will create one
|
|
374
358
|
return undefined;
|
|
375
359
|
}
|
|
376
|
-
|
|
360
|
+
function buildSessionOptions(parsed, scopedModels, sessionManager, modelRegistry, settingsManager) {
|
|
377
361
|
const options = {};
|
|
378
362
|
let cliThinkingFromModel = false;
|
|
379
363
|
if (sessionManager) {
|
|
@@ -405,19 +389,12 @@ async function buildSessionOptions(parsed, scopedModels, sessionManager, modelRe
|
|
|
405
389
|
}
|
|
406
390
|
}
|
|
407
391
|
}
|
|
408
|
-
if (!options.model &&
|
|
409
|
-
scopedModels.length > 0 &&
|
|
410
|
-
!parsed.continue &&
|
|
411
|
-
!parsed.resume) {
|
|
392
|
+
if (!options.model && scopedModels.length > 0 && !parsed.continue && !parsed.resume) {
|
|
412
393
|
// Check if saved default is in scoped models - use it if so, otherwise first scoped model
|
|
413
394
|
const savedProvider = settingsManager.getDefaultProvider();
|
|
414
395
|
const savedModelId = settingsManager.getDefaultModel();
|
|
415
|
-
const savedModel = savedProvider && savedModelId
|
|
416
|
-
|
|
417
|
-
: undefined;
|
|
418
|
-
const savedInScope = savedModel
|
|
419
|
-
? scopedModels.find((sm) => modelsAreEqual(sm.model, savedModel))
|
|
420
|
-
: undefined;
|
|
396
|
+
const savedModel = savedProvider && savedModelId ? modelRegistry.find(savedProvider, savedModelId) : undefined;
|
|
397
|
+
const savedInScope = savedModel ? scopedModels.find((sm) => modelsAreEqual(sm.model, savedModel)) : undefined;
|
|
421
398
|
if (savedInScope) {
|
|
422
399
|
options.model = savedInScope.model;
|
|
423
400
|
// Use thinking level from scoped model config if explicitly set
|
|
@@ -461,14 +438,6 @@ async function buildSessionOptions(parsed, scopedModels, sessionManager, modelRe
|
|
|
461
438
|
else if (parsed.tools) {
|
|
462
439
|
options.tools = parsed.tools.map((name) => allTools[name]);
|
|
463
440
|
}
|
|
464
|
-
// Enable MCP only if explicitly requested via --enable-mcp flag
|
|
465
|
-
// MCP is experimental and may have compatibility issues on some systems
|
|
466
|
-
// TODO: Re-enable by default once MCP server startup is more robust
|
|
467
|
-
// const { listEnabledMCPServers } = await import("./core/mcp/mcp-config.js");
|
|
468
|
-
// const enabledMcpServers = listEnabledMCPServers();
|
|
469
|
-
// if (enabledMcpServers.length > 0) {
|
|
470
|
-
// options.enableMCP = true;
|
|
471
|
-
// }
|
|
472
441
|
return { options, cliThinkingFromModel };
|
|
473
442
|
}
|
|
474
443
|
async function handleConfigCommand(args) {
|
|
@@ -479,11 +448,7 @@ async function handleConfigCommand(args) {
|
|
|
479
448
|
const agentDir = getAgentDir();
|
|
480
449
|
const settingsManager = SettingsManager.create(cwd, agentDir);
|
|
481
450
|
reportSettingsErrors(settingsManager, "config command");
|
|
482
|
-
const packageManager = new DefaultPackageManager({
|
|
483
|
-
cwd,
|
|
484
|
-
agentDir,
|
|
485
|
-
settingsManager,
|
|
486
|
-
});
|
|
451
|
+
const packageManager = new DefaultPackageManager({ cwd, agentDir, settingsManager });
|
|
487
452
|
const resolvedPaths = await packageManager.resolve();
|
|
488
453
|
await selectConfig({
|
|
489
454
|
resolvedPaths,
|
|
@@ -523,20 +488,14 @@ export async function main(args) {
|
|
|
523
488
|
}
|
|
524
489
|
}
|
|
525
490
|
const modelRegistry = new ModelRegistry(authStorage, getModelsPath(), APP_NAME === "nanopencil"
|
|
526
|
-
? {
|
|
527
|
-
useOnlyCustomModels: true,
|
|
528
|
-
allowOptionalApiKeyForProvider: NANOPENCIL_DEFAULT_PROVIDER,
|
|
529
|
-
}
|
|
491
|
+
? { useOnlyCustomModels: true, allowOptionalApiKeyForProvider: NANOPENCIL_DEFAULT_PROVIDER }
|
|
530
492
|
: {});
|
|
531
493
|
const defaultExtPaths = APP_NAME === "nanopencil" ? getNanopencilDefaultExtensionPaths() : [];
|
|
532
494
|
const resourceLoader = new DefaultResourceLoader({
|
|
533
495
|
cwd,
|
|
534
496
|
agentDir,
|
|
535
497
|
settingsManager,
|
|
536
|
-
additionalExtensionPaths: [
|
|
537
|
-
...defaultExtPaths,
|
|
538
|
-
...(firstPass.extensions ?? []),
|
|
539
|
-
],
|
|
498
|
+
additionalExtensionPaths: [...defaultExtPaths, ...(firstPass.extensions ?? [])],
|
|
540
499
|
additionalSkillPaths: firstPass.skills,
|
|
541
500
|
additionalPromptTemplatePaths: firstPass.promptTemplates,
|
|
542
501
|
additionalThemePaths: firstPass.themes,
|
|
@@ -566,8 +525,7 @@ export async function main(args) {
|
|
|
566
525
|
}
|
|
567
526
|
// Apply pending provider registrations from extensions immediately
|
|
568
527
|
// so they're available for model resolution before AgentSession is created
|
|
569
|
-
for (const { name, config } of extensionsResult.runtime
|
|
570
|
-
.pendingProviderRegistrations) {
|
|
528
|
+
for (const { name, config } of extensionsResult.runtime.pendingProviderRegistrations) {
|
|
571
529
|
modelRegistry.registerProvider(name, config);
|
|
572
530
|
}
|
|
573
531
|
extensionsResult.runtime.pendingProviderRegistrations = [];
|
|
@@ -634,8 +592,7 @@ export async function main(args) {
|
|
|
634
592
|
if (APP_NAME === "nanopencil" && settingsManager.getTheme() === undefined) {
|
|
635
593
|
settingsManager.setTheme("warm");
|
|
636
594
|
}
|
|
637
|
-
initTheme(settingsManager.getTheme() ??
|
|
638
|
-
(APP_NAME === "nanopencil" ? "warm" : undefined), isInteractive);
|
|
595
|
+
initTheme(settingsManager.getTheme() ?? (APP_NAME === "nanopencil" ? "warm" : undefined), isInteractive);
|
|
639
596
|
// Show deprecation warnings in interactive mode
|
|
640
597
|
if (isInteractive && deprecationWarnings.length > 0) {
|
|
641
598
|
await showDeprecationWarnings(deprecationWarnings);
|
|
@@ -659,7 +616,7 @@ export async function main(args) {
|
|
|
659
616
|
}
|
|
660
617
|
sessionManager = SessionManager.open(selectedPath);
|
|
661
618
|
}
|
|
662
|
-
const { options: sessionOptions, cliThinkingFromModel } =
|
|
619
|
+
const { options: sessionOptions, cliThinkingFromModel } = buildSessionOptions(parsed, scopedModels, sessionManager, modelRegistry, settingsManager);
|
|
663
620
|
sessionOptions.authStorage = authStorage;
|
|
664
621
|
sessionOptions.modelRegistry = modelRegistry;
|
|
665
622
|
sessionOptions.resourceLoader = resourceLoader;
|
|
@@ -698,8 +655,7 @@ export async function main(args) {
|
|
|
698
655
|
await runRpcMode(session);
|
|
699
656
|
}
|
|
700
657
|
else if (isInteractive) {
|
|
701
|
-
if (scopedModels.length > 0 &&
|
|
702
|
-
(parsed.verbose || !settingsManager.getQuietStartup())) {
|
|
658
|
+
if (scopedModels.length > 0 && (parsed.verbose || !settingsManager.getQuietStartup())) {
|
|
703
659
|
const modelList = scopedModels
|
|
704
660
|
.map((sm) => {
|
|
705
661
|
const thinkingStr = sm.thinkingLevel ? `:${sm.thinkingLevel}` : "";
|
|
@@ -23,8 +23,7 @@ function findPackageRoot(startDir) {
|
|
|
23
23
|
if (existsSync(pkgPath)) {
|
|
24
24
|
const raw = readFileSync(pkgPath, "utf-8");
|
|
25
25
|
const pkg = JSON.parse(raw);
|
|
26
|
-
if (pkg.name === "@pencil-agent/nano-pencil" ||
|
|
27
|
-
pkg.name === "nanopencil")
|
|
26
|
+
if (pkg.name === "@pencil-agent/nano-pencil" || pkg.name === "nanopencil")
|
|
28
27
|
return dir;
|
|
29
28
|
}
|
|
30
29
|
}
|
package/package.json
CHANGED
|
@@ -1,86 +1,85 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@pencil-agent/nano-pencil",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "CLI writing agent with read, bash, edit, write tools and session management. Based on pi; supports DashScope Coding Plan. Soul enabled by default for AI personality evolution.",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"bin": {
|
|
7
|
-
"nanopencil": "./dist/cli
|
|
8
|
-
},
|
|
9
|
-
"exports": {
|
|
10
|
-
".": {
|
|
11
|
-
"import": "./dist/index.js",
|
|
12
|
-
"types": "./dist/index.d.ts"
|
|
13
|
-
}
|
|
14
|
-
},
|
|
15
|
-
"files": [
|
|
16
|
-
"dist/**/*.js",
|
|
17
|
-
"dist/**/*.d.ts",
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
"
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
"@mariozechner/
|
|
49
|
-
"@mariozechner/pi-
|
|
50
|
-
"@mariozechner/pi-
|
|
51
|
-
"@
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
"
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
"@types/
|
|
72
|
-
"@types/
|
|
73
|
-
"
|
|
74
|
-
"
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
"
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
"
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@pencil-agent/nano-pencil",
|
|
3
|
+
"version": "1.7.0",
|
|
4
|
+
"description": "CLI writing agent with read, bash, edit, write tools and session management. Based on pi; supports DashScope Coding Plan. Soul enabled by default for AI personality evolution.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"nanopencil": "./dist/cli.js"
|
|
8
|
+
},
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"import": "./dist/index.js",
|
|
12
|
+
"types": "./dist/index.d.ts"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist/**/*.js",
|
|
17
|
+
"dist/**/*.d.ts",
|
|
18
|
+
"docs",
|
|
19
|
+
"LICENSE",
|
|
20
|
+
"README.md"
|
|
21
|
+
],
|
|
22
|
+
"scripts": {
|
|
23
|
+
"dev": "tsx cli.ts",
|
|
24
|
+
"build": "tsc && npm run bundle:packages",
|
|
25
|
+
"bundle:packages": "node scripts/bundle-deps.js",
|
|
26
|
+
"watch": "tsc --watch",
|
|
27
|
+
"start": "node cli.js",
|
|
28
|
+
"prepublishOnly": "npm run build"
|
|
29
|
+
},
|
|
30
|
+
"keywords": [
|
|
31
|
+
"nanopencil",
|
|
32
|
+
"writing-agent",
|
|
33
|
+
"coding-agent",
|
|
34
|
+
"ai",
|
|
35
|
+
"llm",
|
|
36
|
+
"cli",
|
|
37
|
+
"tui",
|
|
38
|
+
"agent",
|
|
39
|
+
"apikey",
|
|
40
|
+
"dashscope"
|
|
41
|
+
],
|
|
42
|
+
"license": "MIT",
|
|
43
|
+
"engines": {
|
|
44
|
+
"node": ">=20"
|
|
45
|
+
},
|
|
46
|
+
"dependencies": {
|
|
47
|
+
"@mariozechner/jiti": "^2.6.2",
|
|
48
|
+
"@mariozechner/pi-agent-core": "^0.55.3",
|
|
49
|
+
"@mariozechner/pi-ai": "^0.55.3",
|
|
50
|
+
"@mariozechner/pi-tui": "^0.55.3",
|
|
51
|
+
"@silvia-odwyer/photon-node": "^0.3.4",
|
|
52
|
+
"chalk": "^5.5.0",
|
|
53
|
+
"cli-highlight": "^2.1.11",
|
|
54
|
+
"diff": "^8.0.2",
|
|
55
|
+
"extract-zip": "^2.0.1",
|
|
56
|
+
"file-type": "^21.1.1",
|
|
57
|
+
"glob": "^13.0.1",
|
|
58
|
+
"hosted-git-info": "^9.0.2",
|
|
59
|
+
"ignore": "^7.0.5",
|
|
60
|
+
"marked": "^15.0.12",
|
|
61
|
+
"minimatch": "^10.1.1",
|
|
62
|
+
"proper-lockfile": "^4.1.2",
|
|
63
|
+
"yaml": "^2.8.2"
|
|
64
|
+
},
|
|
65
|
+
"optionalDependencies": {
|
|
66
|
+
"nanomem": "file:./packages/nanomem",
|
|
67
|
+
"nanosoul": "file:./packages/nanosoul"
|
|
68
|
+
},
|
|
69
|
+
"devDependencies": {
|
|
70
|
+
"@types/hosted-git-info": "^3.0.5",
|
|
71
|
+
"@types/node": "^20.11.0",
|
|
72
|
+
"@types/proper-lockfile": "^4.1.4",
|
|
73
|
+
"tsx": "^4.7.0",
|
|
74
|
+
"typescript": "^5.3.3"
|
|
75
|
+
},
|
|
76
|
+
"piConfig": {
|
|
77
|
+
"name": "nanopencil",
|
|
78
|
+
"configDir": ".nanopencil"
|
|
79
|
+
},
|
|
80
|
+
"repository": {
|
|
81
|
+
"type": "git",
|
|
82
|
+
"url": "https://codeup.aliyun.com/67d1a8677564dc59f36547a9/nanoPencil.git"
|
|
83
|
+
},
|
|
84
|
+
"homepage": "https://codeup.aliyun.com/67d1a8677564dc59f36547a9/nanoPencil"
|
|
85
|
+
}
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://raw.githubusercontent.com/badlogic/pi-mono/main/packages/coding-agent/src/modes/interactive/theme/theme-schema.json",
|
|
3
|
-
"name": "dark",
|
|
4
|
-
"vars": {
|
|
5
|
-
"cyan": "#00d7ff",
|
|
6
|
-
"blue": "#5f87ff",
|
|
7
|
-
"green": "#b5bd68",
|
|
8
|
-
"red": "#cc6666",
|
|
9
|
-
"yellow": "#ffff00",
|
|
10
|
-
"gray": "#808080",
|
|
11
|
-
"dimGray": "#666666",
|
|
12
|
-
"darkGray": "#505050",
|
|
13
|
-
"accent": "#8abeb7",
|
|
14
|
-
"selectedBg": "#3a3a4a",
|
|
15
|
-
"userMsgBg": "#343541",
|
|
16
|
-
"toolPendingBg": "#282832",
|
|
17
|
-
"toolSuccessBg": "#283228",
|
|
18
|
-
"toolErrorBg": "#3c2828",
|
|
19
|
-
"customMsgBg": "#2d2838"
|
|
20
|
-
},
|
|
21
|
-
"colors": {
|
|
22
|
-
"accent": "accent",
|
|
23
|
-
"border": "blue",
|
|
24
|
-
"borderAccent": "cyan",
|
|
25
|
-
"borderMuted": "darkGray",
|
|
26
|
-
"success": "green",
|
|
27
|
-
"error": "red",
|
|
28
|
-
"warning": "yellow",
|
|
29
|
-
"muted": "gray",
|
|
30
|
-
"dim": "dimGray",
|
|
31
|
-
"text": "",
|
|
32
|
-
"thinkingText": "gray",
|
|
33
|
-
|
|
34
|
-
"selectedBg": "selectedBg",
|
|
35
|
-
"userMessageBg": "userMsgBg",
|
|
36
|
-
"userMessageText": "",
|
|
37
|
-
"customMessageBg": "customMsgBg",
|
|
38
|
-
"customMessageText": "",
|
|
39
|
-
"customMessageLabel": "#9575cd",
|
|
40
|
-
"toolPendingBg": "toolPendingBg",
|
|
41
|
-
"toolSuccessBg": "toolSuccessBg",
|
|
42
|
-
"toolErrorBg": "toolErrorBg",
|
|
43
|
-
"toolTitle": "",
|
|
44
|
-
"toolOutput": "gray",
|
|
45
|
-
|
|
46
|
-
"mdHeading": "#f0c674",
|
|
47
|
-
"mdLink": "#81a2be",
|
|
48
|
-
"mdLinkUrl": "dimGray",
|
|
49
|
-
"mdCode": "accent",
|
|
50
|
-
"mdCodeBlock": "green",
|
|
51
|
-
"mdCodeBlockBorder": "gray",
|
|
52
|
-
"mdQuote": "gray",
|
|
53
|
-
"mdQuoteBorder": "gray",
|
|
54
|
-
"mdHr": "gray",
|
|
55
|
-
"mdListBullet": "accent",
|
|
56
|
-
|
|
57
|
-
"toolDiffAdded": "green",
|
|
58
|
-
"toolDiffRemoved": "red",
|
|
59
|
-
"toolDiffContext": "gray",
|
|
60
|
-
|
|
61
|
-
"syntaxComment": "#6A9955",
|
|
62
|
-
"syntaxKeyword": "#569CD6",
|
|
63
|
-
"syntaxFunction": "#DCDCAA",
|
|
64
|
-
"syntaxVariable": "#9CDCFE",
|
|
65
|
-
"syntaxString": "#CE9178",
|
|
66
|
-
"syntaxNumber": "#B5CEA8",
|
|
67
|
-
"syntaxType": "#4EC9B0",
|
|
68
|
-
"syntaxOperator": "#D4D4D4",
|
|
69
|
-
"syntaxPunctuation": "#D4D4D4",
|
|
70
|
-
|
|
71
|
-
"thinkingOff": "darkGray",
|
|
72
|
-
"thinkingMinimal": "#6e6e6e",
|
|
73
|
-
"thinkingLow": "#5f87af",
|
|
74
|
-
"thinkingMedium": "#81a2be",
|
|
75
|
-
"thinkingHigh": "#b294bb",
|
|
76
|
-
"thinkingXhigh": "#d183e8",
|
|
77
|
-
|
|
78
|
-
"bashMode": "green"
|
|
79
|
-
},
|
|
80
|
-
"export": {
|
|
81
|
-
"pageBg": "#18181e",
|
|
82
|
-
"cardBg": "#1e1e24",
|
|
83
|
-
"infoBg": "#3c3728"
|
|
84
|
-
}
|
|
85
|
-
}
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://raw.githubusercontent.com/badlogic/pi-mono/main/packages/coding-agent/src/modes/interactive/theme/theme-schema.json",
|
|
3
|
-
"name": "light",
|
|
4
|
-
"vars": {
|
|
5
|
-
"teal": "#5a8080",
|
|
6
|
-
"blue": "#547da7",
|
|
7
|
-
"green": "#588458",
|
|
8
|
-
"red": "#aa5555",
|
|
9
|
-
"yellow": "#9a7326",
|
|
10
|
-
"mediumGray": "#6c6c6c",
|
|
11
|
-
"dimGray": "#767676",
|
|
12
|
-
"lightGray": "#b0b0b0",
|
|
13
|
-
"selectedBg": "#d0d0e0",
|
|
14
|
-
"userMsgBg": "#e8e8e8",
|
|
15
|
-
"toolPendingBg": "#e8e8f0",
|
|
16
|
-
"toolSuccessBg": "#e8f0e8",
|
|
17
|
-
"toolErrorBg": "#f0e8e8",
|
|
18
|
-
"customMsgBg": "#ede7f6"
|
|
19
|
-
},
|
|
20
|
-
"colors": {
|
|
21
|
-
"accent": "teal",
|
|
22
|
-
"border": "blue",
|
|
23
|
-
"borderAccent": "teal",
|
|
24
|
-
"borderMuted": "lightGray",
|
|
25
|
-
"success": "green",
|
|
26
|
-
"error": "red",
|
|
27
|
-
"warning": "yellow",
|
|
28
|
-
"muted": "mediumGray",
|
|
29
|
-
"dim": "dimGray",
|
|
30
|
-
"text": "",
|
|
31
|
-
"thinkingText": "mediumGray",
|
|
32
|
-
|
|
33
|
-
"selectedBg": "selectedBg",
|
|
34
|
-
"userMessageBg": "userMsgBg",
|
|
35
|
-
"userMessageText": "",
|
|
36
|
-
"customMessageBg": "customMsgBg",
|
|
37
|
-
"customMessageText": "",
|
|
38
|
-
"customMessageLabel": "#7e57c2",
|
|
39
|
-
"toolPendingBg": "toolPendingBg",
|
|
40
|
-
"toolSuccessBg": "toolSuccessBg",
|
|
41
|
-
"toolErrorBg": "toolErrorBg",
|
|
42
|
-
"toolTitle": "",
|
|
43
|
-
"toolOutput": "mediumGray",
|
|
44
|
-
|
|
45
|
-
"mdHeading": "yellow",
|
|
46
|
-
"mdLink": "blue",
|
|
47
|
-
"mdLinkUrl": "dimGray",
|
|
48
|
-
"mdCode": "teal",
|
|
49
|
-
"mdCodeBlock": "green",
|
|
50
|
-
"mdCodeBlockBorder": "mediumGray",
|
|
51
|
-
"mdQuote": "mediumGray",
|
|
52
|
-
"mdQuoteBorder": "mediumGray",
|
|
53
|
-
"mdHr": "mediumGray",
|
|
54
|
-
"mdListBullet": "green",
|
|
55
|
-
|
|
56
|
-
"toolDiffAdded": "green",
|
|
57
|
-
"toolDiffRemoved": "red",
|
|
58
|
-
"toolDiffContext": "mediumGray",
|
|
59
|
-
|
|
60
|
-
"syntaxComment": "#008000",
|
|
61
|
-
"syntaxKeyword": "#0000FF",
|
|
62
|
-
"syntaxFunction": "#795E26",
|
|
63
|
-
"syntaxVariable": "#001080",
|
|
64
|
-
"syntaxString": "#A31515",
|
|
65
|
-
"syntaxNumber": "#098658",
|
|
66
|
-
"syntaxType": "#267F99",
|
|
67
|
-
"syntaxOperator": "#000000",
|
|
68
|
-
"syntaxPunctuation": "#000000",
|
|
69
|
-
|
|
70
|
-
"thinkingOff": "lightGray",
|
|
71
|
-
"thinkingMinimal": "#767676",
|
|
72
|
-
"thinkingLow": "blue",
|
|
73
|
-
"thinkingMedium": "teal",
|
|
74
|
-
"thinkingHigh": "#875f87",
|
|
75
|
-
"thinkingXhigh": "#8b008b",
|
|
76
|
-
|
|
77
|
-
"bashMode": "green"
|
|
78
|
-
},
|
|
79
|
-
"export": {
|
|
80
|
-
"pageBg": "#f8f8f8",
|
|
81
|
-
"cardBg": "#ffffff",
|
|
82
|
-
"infoBg": "#fffae6"
|
|
83
|
-
}
|
|
84
|
-
}
|
|
@@ -1,335 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
-
"title": "Pi Coding Agent Theme",
|
|
4
|
-
"description": "Theme schema for Pi coding agent",
|
|
5
|
-
"type": "object",
|
|
6
|
-
"required": ["name", "colors"],
|
|
7
|
-
"properties": {
|
|
8
|
-
"$schema": {
|
|
9
|
-
"type": "string",
|
|
10
|
-
"description": "JSON schema reference"
|
|
11
|
-
},
|
|
12
|
-
"name": {
|
|
13
|
-
"type": "string",
|
|
14
|
-
"description": "Theme name"
|
|
15
|
-
},
|
|
16
|
-
"vars": {
|
|
17
|
-
"type": "object",
|
|
18
|
-
"description": "Reusable color variables",
|
|
19
|
-
"additionalProperties": {
|
|
20
|
-
"oneOf": [
|
|
21
|
-
{
|
|
22
|
-
"type": "string",
|
|
23
|
-
"description": "Hex color (#RRGGBB), variable reference, or empty string for terminal default"
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
"type": "integer",
|
|
27
|
-
"minimum": 0,
|
|
28
|
-
"maximum": 255,
|
|
29
|
-
"description": "256-color palette index (0-255)"
|
|
30
|
-
}
|
|
31
|
-
]
|
|
32
|
-
}
|
|
33
|
-
},
|
|
34
|
-
"colors": {
|
|
35
|
-
"type": "object",
|
|
36
|
-
"description": "Theme color definitions (all required)",
|
|
37
|
-
"required": [
|
|
38
|
-
"accent",
|
|
39
|
-
"border",
|
|
40
|
-
"borderAccent",
|
|
41
|
-
"borderMuted",
|
|
42
|
-
"success",
|
|
43
|
-
"error",
|
|
44
|
-
"warning",
|
|
45
|
-
"muted",
|
|
46
|
-
"dim",
|
|
47
|
-
"text",
|
|
48
|
-
"thinkingText",
|
|
49
|
-
"selectedBg",
|
|
50
|
-
"userMessageBg",
|
|
51
|
-
"userMessageText",
|
|
52
|
-
"customMessageBg",
|
|
53
|
-
"customMessageText",
|
|
54
|
-
"customMessageLabel",
|
|
55
|
-
"toolPendingBg",
|
|
56
|
-
"toolSuccessBg",
|
|
57
|
-
"toolErrorBg",
|
|
58
|
-
"toolTitle",
|
|
59
|
-
"toolOutput",
|
|
60
|
-
"mdHeading",
|
|
61
|
-
"mdLink",
|
|
62
|
-
"mdLinkUrl",
|
|
63
|
-
"mdCode",
|
|
64
|
-
"mdCodeBlock",
|
|
65
|
-
"mdCodeBlockBorder",
|
|
66
|
-
"mdQuote",
|
|
67
|
-
"mdQuoteBorder",
|
|
68
|
-
"mdHr",
|
|
69
|
-
"mdListBullet",
|
|
70
|
-
"toolDiffAdded",
|
|
71
|
-
"toolDiffRemoved",
|
|
72
|
-
"toolDiffContext",
|
|
73
|
-
"syntaxComment",
|
|
74
|
-
"syntaxKeyword",
|
|
75
|
-
"syntaxFunction",
|
|
76
|
-
"syntaxVariable",
|
|
77
|
-
"syntaxString",
|
|
78
|
-
"syntaxNumber",
|
|
79
|
-
"syntaxType",
|
|
80
|
-
"syntaxOperator",
|
|
81
|
-
"syntaxPunctuation",
|
|
82
|
-
"thinkingOff",
|
|
83
|
-
"thinkingMinimal",
|
|
84
|
-
"thinkingLow",
|
|
85
|
-
"thinkingMedium",
|
|
86
|
-
"thinkingHigh",
|
|
87
|
-
"thinkingXhigh",
|
|
88
|
-
"bashMode"
|
|
89
|
-
],
|
|
90
|
-
"properties": {
|
|
91
|
-
"accent": {
|
|
92
|
-
"$ref": "#/$defs/colorValue",
|
|
93
|
-
"description": "Primary accent color (logo, selected items, cursor)"
|
|
94
|
-
},
|
|
95
|
-
"border": {
|
|
96
|
-
"$ref": "#/$defs/colorValue",
|
|
97
|
-
"description": "Normal borders"
|
|
98
|
-
},
|
|
99
|
-
"borderAccent": {
|
|
100
|
-
"$ref": "#/$defs/colorValue",
|
|
101
|
-
"description": "Highlighted borders"
|
|
102
|
-
},
|
|
103
|
-
"borderMuted": {
|
|
104
|
-
"$ref": "#/$defs/colorValue",
|
|
105
|
-
"description": "Subtle borders"
|
|
106
|
-
},
|
|
107
|
-
"success": {
|
|
108
|
-
"$ref": "#/$defs/colorValue",
|
|
109
|
-
"description": "Success states"
|
|
110
|
-
},
|
|
111
|
-
"error": {
|
|
112
|
-
"$ref": "#/$defs/colorValue",
|
|
113
|
-
"description": "Error states"
|
|
114
|
-
},
|
|
115
|
-
"warning": {
|
|
116
|
-
"$ref": "#/$defs/colorValue",
|
|
117
|
-
"description": "Warning states"
|
|
118
|
-
},
|
|
119
|
-
"muted": {
|
|
120
|
-
"$ref": "#/$defs/colorValue",
|
|
121
|
-
"description": "Secondary/dimmed text"
|
|
122
|
-
},
|
|
123
|
-
"dim": {
|
|
124
|
-
"$ref": "#/$defs/colorValue",
|
|
125
|
-
"description": "Very dimmed text (more subtle than muted)"
|
|
126
|
-
},
|
|
127
|
-
"text": {
|
|
128
|
-
"$ref": "#/$defs/colorValue",
|
|
129
|
-
"description": "Default text color (usually empty string)"
|
|
130
|
-
},
|
|
131
|
-
"thinkingText": {
|
|
132
|
-
"$ref": "#/$defs/colorValue",
|
|
133
|
-
"description": "Thinking block text color"
|
|
134
|
-
},
|
|
135
|
-
"selectedBg": {
|
|
136
|
-
"$ref": "#/$defs/colorValue",
|
|
137
|
-
"description": "Selected item background"
|
|
138
|
-
},
|
|
139
|
-
"userMessageBg": {
|
|
140
|
-
"$ref": "#/$defs/colorValue",
|
|
141
|
-
"description": "User message background"
|
|
142
|
-
},
|
|
143
|
-
"userMessageText": {
|
|
144
|
-
"$ref": "#/$defs/colorValue",
|
|
145
|
-
"description": "User message text color"
|
|
146
|
-
},
|
|
147
|
-
"customMessageBg": {
|
|
148
|
-
"$ref": "#/$defs/colorValue",
|
|
149
|
-
"description": "Custom message background (hook-injected messages)"
|
|
150
|
-
},
|
|
151
|
-
"customMessageText": {
|
|
152
|
-
"$ref": "#/$defs/colorValue",
|
|
153
|
-
"description": "Custom message text color"
|
|
154
|
-
},
|
|
155
|
-
"customMessageLabel": {
|
|
156
|
-
"$ref": "#/$defs/colorValue",
|
|
157
|
-
"description": "Custom message type label color"
|
|
158
|
-
},
|
|
159
|
-
"toolPendingBg": {
|
|
160
|
-
"$ref": "#/$defs/colorValue",
|
|
161
|
-
"description": "Tool execution box (pending state)"
|
|
162
|
-
},
|
|
163
|
-
"toolSuccessBg": {
|
|
164
|
-
"$ref": "#/$defs/colorValue",
|
|
165
|
-
"description": "Tool execution box (success state)"
|
|
166
|
-
},
|
|
167
|
-
"toolErrorBg": {
|
|
168
|
-
"$ref": "#/$defs/colorValue",
|
|
169
|
-
"description": "Tool execution box (error state)"
|
|
170
|
-
},
|
|
171
|
-
"toolTitle": {
|
|
172
|
-
"$ref": "#/$defs/colorValue",
|
|
173
|
-
"description": "Tool execution box title color"
|
|
174
|
-
},
|
|
175
|
-
"toolOutput": {
|
|
176
|
-
"$ref": "#/$defs/colorValue",
|
|
177
|
-
"description": "Tool execution box output text color"
|
|
178
|
-
},
|
|
179
|
-
"mdHeading": {
|
|
180
|
-
"$ref": "#/$defs/colorValue",
|
|
181
|
-
"description": "Markdown heading text"
|
|
182
|
-
},
|
|
183
|
-
"mdLink": {
|
|
184
|
-
"$ref": "#/$defs/colorValue",
|
|
185
|
-
"description": "Markdown link text"
|
|
186
|
-
},
|
|
187
|
-
"mdLinkUrl": {
|
|
188
|
-
"$ref": "#/$defs/colorValue",
|
|
189
|
-
"description": "Markdown link URL"
|
|
190
|
-
},
|
|
191
|
-
"mdCode": {
|
|
192
|
-
"$ref": "#/$defs/colorValue",
|
|
193
|
-
"description": "Markdown inline code"
|
|
194
|
-
},
|
|
195
|
-
"mdCodeBlock": {
|
|
196
|
-
"$ref": "#/$defs/colorValue",
|
|
197
|
-
"description": "Markdown code block content"
|
|
198
|
-
},
|
|
199
|
-
"mdCodeBlockBorder": {
|
|
200
|
-
"$ref": "#/$defs/colorValue",
|
|
201
|
-
"description": "Markdown code block fences"
|
|
202
|
-
},
|
|
203
|
-
"mdQuote": {
|
|
204
|
-
"$ref": "#/$defs/colorValue",
|
|
205
|
-
"description": "Markdown blockquote text"
|
|
206
|
-
},
|
|
207
|
-
"mdQuoteBorder": {
|
|
208
|
-
"$ref": "#/$defs/colorValue",
|
|
209
|
-
"description": "Markdown blockquote border"
|
|
210
|
-
},
|
|
211
|
-
"mdHr": {
|
|
212
|
-
"$ref": "#/$defs/colorValue",
|
|
213
|
-
"description": "Markdown horizontal rule"
|
|
214
|
-
},
|
|
215
|
-
"mdListBullet": {
|
|
216
|
-
"$ref": "#/$defs/colorValue",
|
|
217
|
-
"description": "Markdown list bullets/numbers"
|
|
218
|
-
},
|
|
219
|
-
"toolDiffAdded": {
|
|
220
|
-
"$ref": "#/$defs/colorValue",
|
|
221
|
-
"description": "Added lines in tool diffs"
|
|
222
|
-
},
|
|
223
|
-
"toolDiffRemoved": {
|
|
224
|
-
"$ref": "#/$defs/colorValue",
|
|
225
|
-
"description": "Removed lines in tool diffs"
|
|
226
|
-
},
|
|
227
|
-
"toolDiffContext": {
|
|
228
|
-
"$ref": "#/$defs/colorValue",
|
|
229
|
-
"description": "Context lines in tool diffs"
|
|
230
|
-
},
|
|
231
|
-
"syntaxComment": {
|
|
232
|
-
"$ref": "#/$defs/colorValue",
|
|
233
|
-
"description": "Syntax highlighting: comments"
|
|
234
|
-
},
|
|
235
|
-
"syntaxKeyword": {
|
|
236
|
-
"$ref": "#/$defs/colorValue",
|
|
237
|
-
"description": "Syntax highlighting: keywords"
|
|
238
|
-
},
|
|
239
|
-
"syntaxFunction": {
|
|
240
|
-
"$ref": "#/$defs/colorValue",
|
|
241
|
-
"description": "Syntax highlighting: function names"
|
|
242
|
-
},
|
|
243
|
-
"syntaxVariable": {
|
|
244
|
-
"$ref": "#/$defs/colorValue",
|
|
245
|
-
"description": "Syntax highlighting: variable names"
|
|
246
|
-
},
|
|
247
|
-
"syntaxString": {
|
|
248
|
-
"$ref": "#/$defs/colorValue",
|
|
249
|
-
"description": "Syntax highlighting: string literals"
|
|
250
|
-
},
|
|
251
|
-
"syntaxNumber": {
|
|
252
|
-
"$ref": "#/$defs/colorValue",
|
|
253
|
-
"description": "Syntax highlighting: number literals"
|
|
254
|
-
},
|
|
255
|
-
"syntaxType": {
|
|
256
|
-
"$ref": "#/$defs/colorValue",
|
|
257
|
-
"description": "Syntax highlighting: type names"
|
|
258
|
-
},
|
|
259
|
-
"syntaxOperator": {
|
|
260
|
-
"$ref": "#/$defs/colorValue",
|
|
261
|
-
"description": "Syntax highlighting: operators"
|
|
262
|
-
},
|
|
263
|
-
"syntaxPunctuation": {
|
|
264
|
-
"$ref": "#/$defs/colorValue",
|
|
265
|
-
"description": "Syntax highlighting: punctuation"
|
|
266
|
-
},
|
|
267
|
-
"thinkingOff": {
|
|
268
|
-
"$ref": "#/$defs/colorValue",
|
|
269
|
-
"description": "Thinking level border: off"
|
|
270
|
-
},
|
|
271
|
-
"thinkingMinimal": {
|
|
272
|
-
"$ref": "#/$defs/colorValue",
|
|
273
|
-
"description": "Thinking level border: minimal"
|
|
274
|
-
},
|
|
275
|
-
"thinkingLow": {
|
|
276
|
-
"$ref": "#/$defs/colorValue",
|
|
277
|
-
"description": "Thinking level border: low"
|
|
278
|
-
},
|
|
279
|
-
"thinkingMedium": {
|
|
280
|
-
"$ref": "#/$defs/colorValue",
|
|
281
|
-
"description": "Thinking level border: medium"
|
|
282
|
-
},
|
|
283
|
-
"thinkingHigh": {
|
|
284
|
-
"$ref": "#/$defs/colorValue",
|
|
285
|
-
"description": "Thinking level border: high"
|
|
286
|
-
},
|
|
287
|
-
"thinkingXhigh": {
|
|
288
|
-
"$ref": "#/$defs/colorValue",
|
|
289
|
-
"description": "Thinking level border: xhigh (OpenAI codex-max only)"
|
|
290
|
-
},
|
|
291
|
-
"bashMode": {
|
|
292
|
-
"$ref": "#/$defs/colorValue",
|
|
293
|
-
"description": "Editor border color in bash mode"
|
|
294
|
-
}
|
|
295
|
-
},
|
|
296
|
-
"additionalProperties": false
|
|
297
|
-
},
|
|
298
|
-
"export": {
|
|
299
|
-
"type": "object",
|
|
300
|
-
"description": "Optional colors for HTML export (defaults derived from userMessageBg if not specified)",
|
|
301
|
-
"properties": {
|
|
302
|
-
"pageBg": {
|
|
303
|
-
"$ref": "#/$defs/colorValue",
|
|
304
|
-
"description": "Page background color"
|
|
305
|
-
},
|
|
306
|
-
"cardBg": {
|
|
307
|
-
"$ref": "#/$defs/colorValue",
|
|
308
|
-
"description": "Card/container background color"
|
|
309
|
-
},
|
|
310
|
-
"infoBg": {
|
|
311
|
-
"$ref": "#/$defs/colorValue",
|
|
312
|
-
"description": "Info sections background (system prompt, notices)"
|
|
313
|
-
}
|
|
314
|
-
},
|
|
315
|
-
"additionalProperties": false
|
|
316
|
-
}
|
|
317
|
-
},
|
|
318
|
-
"additionalProperties": false,
|
|
319
|
-
"$defs": {
|
|
320
|
-
"colorValue": {
|
|
321
|
-
"oneOf": [
|
|
322
|
-
{
|
|
323
|
-
"type": "string",
|
|
324
|
-
"description": "Hex color (#RRGGBB), variable reference, or empty string for terminal default"
|
|
325
|
-
},
|
|
326
|
-
{
|
|
327
|
-
"type": "integer",
|
|
328
|
-
"minimum": 0,
|
|
329
|
-
"maximum": 255,
|
|
330
|
-
"description": "256-color palette index (0-255)"
|
|
331
|
-
}
|
|
332
|
-
]
|
|
333
|
-
}
|
|
334
|
-
}
|
|
335
|
-
}
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://raw.githubusercontent.com/badlogic/pi-mono/main/packages/coding-agent/src/modes/interactive/theme/theme-schema.json",
|
|
3
|
-
"name": "warm",
|
|
4
|
-
"vars": {
|
|
5
|
-
"warmBrown": "#c4a574",
|
|
6
|
-
"warmLight": "#d4a574",
|
|
7
|
-
"warmBorder": "#a08060",
|
|
8
|
-
"blue": "#5f87ff",
|
|
9
|
-
"green": "#b5bd68",
|
|
10
|
-
"red": "#cc6666",
|
|
11
|
-
"yellow": "#d4a84b",
|
|
12
|
-
"gray": "#808080",
|
|
13
|
-
"dimGray": "#666666",
|
|
14
|
-
"darkGray": "#505050",
|
|
15
|
-
"accent": "warmBrown",
|
|
16
|
-
"selectedBg": "#3d362a",
|
|
17
|
-
"userMsgBg": "#2e2a24",
|
|
18
|
-
"toolPendingBg": "#2a2820",
|
|
19
|
-
"toolSuccessBg": "#2a3024",
|
|
20
|
-
"toolErrorBg": "#3c2828",
|
|
21
|
-
"customMsgBg": "#2d2838"
|
|
22
|
-
},
|
|
23
|
-
"colors": {
|
|
24
|
-
"accent": "accent",
|
|
25
|
-
"border": "warmBorder",
|
|
26
|
-
"borderAccent": "warmLight",
|
|
27
|
-
"borderMuted": "darkGray",
|
|
28
|
-
"success": "green",
|
|
29
|
-
"error": "red",
|
|
30
|
-
"warning": "yellow",
|
|
31
|
-
"muted": "gray",
|
|
32
|
-
"dim": "dimGray",
|
|
33
|
-
"text": "",
|
|
34
|
-
"thinkingText": "gray",
|
|
35
|
-
"selectedBg": "selectedBg",
|
|
36
|
-
"userMessageBg": "userMsgBg",
|
|
37
|
-
"userMessageText": "warmLight",
|
|
38
|
-
"customMessageBg": "customMsgBg",
|
|
39
|
-
"customMessageText": "",
|
|
40
|
-
"customMessageLabel": "#b8956b",
|
|
41
|
-
"toolPendingBg": "toolPendingBg",
|
|
42
|
-
"toolSuccessBg": "toolSuccessBg",
|
|
43
|
-
"toolErrorBg": "toolErrorBg",
|
|
44
|
-
"toolTitle": "",
|
|
45
|
-
"toolOutput": "gray",
|
|
46
|
-
"mdHeading": "warmLight",
|
|
47
|
-
"mdLink": "#81a2be",
|
|
48
|
-
"mdLinkUrl": "dimGray",
|
|
49
|
-
"mdCode": "accent",
|
|
50
|
-
"mdCodeBlock": "green",
|
|
51
|
-
"mdCodeBlockBorder": "gray",
|
|
52
|
-
"mdQuote": "gray",
|
|
53
|
-
"mdQuoteBorder": "gray",
|
|
54
|
-
"mdHr": "gray",
|
|
55
|
-
"mdListBullet": "accent",
|
|
56
|
-
"toolDiffAdded": "green",
|
|
57
|
-
"toolDiffRemoved": "red",
|
|
58
|
-
"toolDiffContext": "gray",
|
|
59
|
-
"syntaxComment": "#6A9955",
|
|
60
|
-
"syntaxKeyword": "#569CD6",
|
|
61
|
-
"syntaxFunction": "#DCDCAA",
|
|
62
|
-
"syntaxVariable": "#9CDCFE",
|
|
63
|
-
"syntaxString": "#CE9178",
|
|
64
|
-
"syntaxNumber": "#B5CEA8",
|
|
65
|
-
"syntaxType": "#4EC9B0",
|
|
66
|
-
"syntaxOperator": "#D4D4D4",
|
|
67
|
-
"syntaxPunctuation": "#D4D4D4",
|
|
68
|
-
"thinkingOff": "darkGray",
|
|
69
|
-
"thinkingMinimal": "#6e6e6e",
|
|
70
|
-
"thinkingLow": "#5f87af",
|
|
71
|
-
"thinkingMedium": "warmBrown",
|
|
72
|
-
"thinkingHigh": "#b294bb",
|
|
73
|
-
"thinkingXhigh": "#d183e8",
|
|
74
|
-
"bashMode": "green"
|
|
75
|
-
},
|
|
76
|
-
"export": {
|
|
77
|
-
"pageBg": "#1a1814",
|
|
78
|
-
"cardBg": "#242018",
|
|
79
|
-
"infoBg": "#3c3728"
|
|
80
|
-
}
|
|
81
|
-
}
|