lsd-pi 1.1.9 → 1.2.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/resources/extensions/slash-commands/context.js +15 -8
- package/dist/resources/extensions/slash-commands/index.js +2 -0
- package/dist/resources/extensions/slash-commands/init.js +47 -0
- package/dist/resources/extensions/slash-commands/plan.js +241 -54
- package/dist/resources/extensions/slash-commands/tools.js +47 -21
- package/dist/resources/extensions/subagent/index.js +5 -10
- package/dist/startup-model-validation.d.ts +1 -1
- package/package.json +1 -1
- package/packages/pi-agent-core/dist/types.d.ts +2 -1
- package/packages/pi-agent-core/dist/types.d.ts.map +1 -1
- package/packages/pi-agent-core/dist/types.js.map +1 -1
- package/packages/pi-agent-core/src/types.ts +2 -1
- package/packages/pi-ai/dist/providers/amazon-bedrock.js +10 -3
- package/packages/pi-ai/dist/providers/amazon-bedrock.js.map +1 -1
- package/packages/pi-ai/dist/providers/anthropic-shared.d.ts +1 -1
- package/packages/pi-ai/dist/providers/anthropic-shared.d.ts.map +1 -1
- package/packages/pi-ai/dist/providers/anthropic-shared.js +4 -1
- package/packages/pi-ai/dist/providers/anthropic-shared.js.map +1 -1
- package/packages/pi-ai/dist/providers/anthropic.d.ts +2 -2
- package/packages/pi-ai/dist/providers/anthropic.d.ts.map +1 -1
- package/packages/pi-ai/dist/providers/anthropic.js +2 -2
- package/packages/pi-ai/dist/providers/anthropic.js.map +1 -1
- package/packages/pi-ai/dist/providers/azure-openai-responses.d.ts.map +1 -1
- package/packages/pi-ai/dist/providers/azure-openai-responses.js +2 -1
- package/packages/pi-ai/dist/providers/azure-openai-responses.js.map +1 -1
- package/packages/pi-ai/dist/providers/google-gemini-cli.js +2 -0
- package/packages/pi-ai/dist/providers/google-gemini-cli.js.map +1 -1
- package/packages/pi-ai/dist/providers/google-vertex.js +2 -0
- package/packages/pi-ai/dist/providers/google-vertex.js.map +1 -1
- package/packages/pi-ai/dist/providers/google.js +2 -0
- package/packages/pi-ai/dist/providers/google.js.map +1 -1
- package/packages/pi-ai/dist/providers/openai-codex-responses.d.ts.map +1 -1
- package/packages/pi-ai/dist/providers/openai-codex-responses.js +2 -1
- package/packages/pi-ai/dist/providers/openai-codex-responses.js.map +1 -1
- package/packages/pi-ai/dist/providers/openai-completions.d.ts.map +1 -1
- package/packages/pi-ai/dist/providers/openai-completions.js +2 -1
- package/packages/pi-ai/dist/providers/openai-completions.js.map +1 -1
- package/packages/pi-ai/dist/providers/openai-responses.d.ts.map +1 -1
- package/packages/pi-ai/dist/providers/openai-responses.js +2 -1
- package/packages/pi-ai/dist/providers/openai-responses.js.map +1 -1
- package/packages/pi-ai/dist/providers/simple-options.d.ts +1 -1
- package/packages/pi-ai/dist/providers/simple-options.d.ts.map +1 -1
- package/packages/pi-ai/dist/providers/simple-options.js +6 -2
- package/packages/pi-ai/dist/providers/simple-options.js.map +1 -1
- package/packages/pi-ai/dist/types.d.ts +1 -1
- package/packages/pi-ai/dist/types.d.ts.map +1 -1
- package/packages/pi-ai/dist/types.js.map +1 -1
- package/packages/pi-ai/src/providers/amazon-bedrock.ts +11 -4
- package/packages/pi-ai/src/providers/anthropic-shared.ts +5 -2
- package/packages/pi-ai/src/providers/anthropic.ts +2 -2
- package/packages/pi-ai/src/providers/azure-openai-responses.ts +2 -1
- package/packages/pi-ai/src/providers/google-gemini-cli.ts +3 -1
- package/packages/pi-ai/src/providers/google-vertex.ts +3 -1
- package/packages/pi-ai/src/providers/google.ts +3 -1
- package/packages/pi-ai/src/providers/openai-codex-responses.ts +2 -1
- package/packages/pi-ai/src/providers/openai-completions.ts +2 -1
- package/packages/pi-ai/src/providers/openai-responses.ts +2 -1
- package/packages/pi-ai/src/providers/simple-options.ts +5 -3
- package/packages/pi-ai/src/types.ts +1 -1
- package/packages/pi-coding-agent/dist/cli/args.js +1 -1
- package/packages/pi-coding-agent/dist/cli/args.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/agent-session.d.ts +10 -0
- package/packages/pi-coding-agent/dist/core/agent-session.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/agent-session.js +57 -20
- package/packages/pi-coding-agent/dist/core/agent-session.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/classifier-service.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/classifier-service.js +34 -61
- package/packages/pi-coding-agent/dist/core/classifier-service.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/compaction/utils.d.ts +1 -1
- package/packages/pi-coding-agent/dist/core/compaction/utils.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/compaction/utils.js +3 -1
- package/packages/pi-coding-agent/dist/core/compaction/utils.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/resource-loader-lsd-md.test.js +59 -7
- package/packages/pi-coding-agent/dist/core/resource-loader-lsd-md.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/resource-loader.js +4 -4
- package/packages/pi-coding-agent/dist/core/resource-loader.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/sdk.d.ts +1 -1
- package/packages/pi-coding-agent/dist/core/sdk.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/sdk.js +19 -20
- package/packages/pi-coding-agent/dist/core/sdk.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/sdk.test.js +80 -0
- package/packages/pi-coding-agent/dist/core/sdk.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/settings-manager.d.ts +15 -5
- package/packages/pi-coding-agent/dist/core/settings-manager.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/settings-manager.js +31 -5
- package/packages/pi-coding-agent/dist/core/settings-manager.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/system-prompt.d.ts +6 -1
- package/packages/pi-coding-agent/dist/core/system-prompt.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/system-prompt.js +28 -68
- package/packages/pi-coding-agent/dist/core/system-prompt.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/bash-interceptor.js +1 -1
- package/packages/pi-coding-agent/dist/core/tools/bash-interceptor.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/bash-interceptor.test.js +5 -0
- package/packages/pi-coding-agent/dist/core/tools/bash-interceptor.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/bash-execution.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/bash-execution.js +28 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/bash-execution.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/settings-selector.d.ts +8 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/settings-selector.js +44 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/settings-selector.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/thinking-selector.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/thinking-selector.js +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/thinking-selector.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.js +36 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js +41 -5
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/theme/theme.d.ts +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/theme/theme.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/theme/theme.js +2 -0
- package/packages/pi-coding-agent/dist/modes/interactive/theme/theme.js.map +1 -1
- package/packages/pi-coding-agent/package.json +1 -1
- package/packages/pi-coding-agent/src/cli/args.ts +1 -1
- package/packages/pi-coding-agent/src/core/agent-session.ts +62 -19
- package/packages/pi-coding-agent/src/core/classifier-service.ts +35 -63
- package/packages/pi-coding-agent/src/core/compaction/utils.ts +3 -1
- package/packages/pi-coding-agent/src/core/resource-loader-lsd-md.test.ts +67 -7
- package/packages/pi-coding-agent/src/core/resource-loader.ts +4 -4
- package/packages/pi-coding-agent/src/core/sdk.test.ts +100 -0
- package/packages/pi-coding-agent/src/core/sdk.ts +24 -21
- package/packages/pi-coding-agent/src/core/settings-manager.ts +42 -8
- package/packages/pi-coding-agent/src/core/system-prompt.ts +39 -82
- package/packages/pi-coding-agent/src/core/tools/bash-interceptor.test.ts +6 -0
- package/packages/pi-coding-agent/src/core/tools/bash-interceptor.ts +1 -1
- package/packages/pi-coding-agent/src/modes/interactive/components/bash-execution.ts +26 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/settings-selector.ts +53 -1
- package/packages/pi-coding-agent/src/modes/interactive/components/thinking-selector.ts +1 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/tool-execution.ts +41 -0
- package/packages/pi-coding-agent/src/modes/interactive/interactive-mode.ts +50 -7
- package/packages/pi-coding-agent/src/modes/interactive/theme/theme.ts +3 -1
- package/pkg/dist/modes/interactive/theme/theme.d.ts +1 -1
- package/pkg/dist/modes/interactive/theme/theme.d.ts.map +1 -1
- package/pkg/dist/modes/interactive/theme/theme.js +2 -0
- package/pkg/dist/modes/interactive/theme/theme.js.map +1 -1
- package/pkg/package.json +1 -1
- package/src/resources/extensions/slash-commands/context.ts +15 -8
- package/src/resources/extensions/slash-commands/index.ts +2 -0
- package/src/resources/extensions/slash-commands/init.ts +55 -0
- package/src/resources/extensions/slash-commands/plan.ts +277 -55
- package/src/resources/extensions/slash-commands/tools.ts +47 -21
- package/src/resources/extensions/subagent/index.ts +5 -10
|
@@ -16,16 +16,40 @@ function isHashlineMode(activeToolNames: string[]): boolean {
|
|
|
16
16
|
return activeToolNames.includes("hashline_read") || activeToolNames.includes("hashline_edit");
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
function
|
|
19
|
+
function getBalancedToolNames(activeToolNames: string[]): string[] {
|
|
20
20
|
return isHashlineMode(activeToolNames)
|
|
21
|
-
? [
|
|
22
|
-
|
|
21
|
+
? [
|
|
22
|
+
"hashline_read",
|
|
23
|
+
"bash",
|
|
24
|
+
"hashline_edit",
|
|
25
|
+
"write",
|
|
26
|
+
"lsp",
|
|
27
|
+
"bg_shell",
|
|
28
|
+
"tool_search",
|
|
29
|
+
"tool_enable",
|
|
30
|
+
"Skill",
|
|
31
|
+
"subagent",
|
|
32
|
+
"await_subagent",
|
|
33
|
+
"ask_user_questions",
|
|
34
|
+
]
|
|
35
|
+
: [
|
|
36
|
+
"read",
|
|
37
|
+
"bash",
|
|
38
|
+
"edit",
|
|
39
|
+
"write",
|
|
40
|
+
"lsp",
|
|
41
|
+
"bg_shell",
|
|
42
|
+
"tool_search",
|
|
43
|
+
"tool_enable",
|
|
44
|
+
"Skill",
|
|
45
|
+
"subagent",
|
|
46
|
+
"await_subagent",
|
|
47
|
+
"ask_user_questions",
|
|
48
|
+
];
|
|
23
49
|
}
|
|
24
50
|
|
|
25
|
-
function
|
|
26
|
-
return
|
|
27
|
-
? ["hashline_read", "bash", "hashline_edit", "write", "lsp", "pty_start", "pty_send", "pty_read", "pty_wait", "pty_resize", "pty_kill"]
|
|
28
|
-
: ["read", "bash", "edit", "write", "lsp", "pty_start", "pty_send", "pty_read", "pty_wait", "pty_resize", "pty_kill"];
|
|
51
|
+
function getFullToolNames(pi: ExtensionAPI): string[] {
|
|
52
|
+
return pi.getAllTools().map((tool) => tool.name).filter((name): name is string => Boolean(name));
|
|
29
53
|
}
|
|
30
54
|
|
|
31
55
|
function scoreTool(query: string, tool: { name?: string; description?: string }): number {
|
|
@@ -140,49 +164,51 @@ export default function toolSearchExtension(pi: ExtensionAPI) {
|
|
|
140
164
|
});
|
|
141
165
|
|
|
142
166
|
pi.registerCommand("tools", {
|
|
143
|
-
description: "
|
|
167
|
+
description: "Manage default tool profiles",
|
|
144
168
|
handler: async (args: string, _ctx: ExtensionCommandContext) => {
|
|
145
169
|
const input = args.trim();
|
|
146
170
|
const settings = getSettingsManager();
|
|
147
171
|
const currentActive = pi.getActiveTools();
|
|
148
|
-
const
|
|
172
|
+
const toolProfile = settings.getToolProfile();
|
|
149
173
|
|
|
150
174
|
if (!input) {
|
|
151
175
|
pi.sendMessage({
|
|
152
176
|
customType: "tools:status",
|
|
153
177
|
content: [
|
|
154
|
-
`Tool
|
|
178
|
+
`Tool profile: ${toolProfile}`,
|
|
155
179
|
`Active tools: ${currentActive.length}`,
|
|
156
180
|
currentActive.length > 0 ? currentActive.join(", ") : "(none)",
|
|
157
181
|
"",
|
|
158
182
|
"Usage:",
|
|
159
|
-
" /tools
|
|
160
|
-
" /tools
|
|
183
|
+
" /tools balanced Switch to the balanced tool profile",
|
|
184
|
+
" /tools full Switch to the full tool profile (all available tools)",
|
|
185
|
+
" /tools on Alias for /tools full",
|
|
186
|
+
" /tools off Alias for /tools balanced",
|
|
161
187
|
].join("\n"),
|
|
162
188
|
display: true,
|
|
163
189
|
});
|
|
164
190
|
return;
|
|
165
191
|
}
|
|
166
192
|
|
|
167
|
-
if (["
|
|
168
|
-
settings.
|
|
169
|
-
const nextActive =
|
|
193
|
+
if (["off", "disable", "mode off", "balanced", "default"].includes(input)) {
|
|
194
|
+
settings.setToolProfile("balanced");
|
|
195
|
+
const nextActive = getBalancedToolNames(currentActive);
|
|
170
196
|
pi.setActiveTools(nextActive);
|
|
171
197
|
pi.sendMessage({
|
|
172
198
|
customType: "tools:mode",
|
|
173
|
-
content: `
|
|
199
|
+
content: `Balanced tool profile active: ${pi.getActiveTools().join(", ")}`,
|
|
174
200
|
display: true,
|
|
175
201
|
});
|
|
176
202
|
return;
|
|
177
203
|
}
|
|
178
204
|
|
|
179
|
-
if (["
|
|
180
|
-
settings.
|
|
181
|
-
const nextActive =
|
|
205
|
+
if (["on", "enable", "mode on", "full", "all"].includes(input)) {
|
|
206
|
+
settings.setToolProfile("full");
|
|
207
|
+
const nextActive = getFullToolNames(pi);
|
|
182
208
|
pi.setActiveTools(nextActive);
|
|
183
209
|
pi.sendMessage({
|
|
184
210
|
customType: "tools:mode",
|
|
185
|
-
content: `
|
|
211
|
+
content: `Full tool profile active: ${pi.getActiveTools().join(", ")}`,
|
|
186
212
|
display: true,
|
|
187
213
|
});
|
|
188
214
|
return;
|
|
@@ -190,7 +216,7 @@ export default function toolSearchExtension(pi: ExtensionAPI) {
|
|
|
190
216
|
|
|
191
217
|
pi.sendMessage({
|
|
192
218
|
customType: "tools:help",
|
|
193
|
-
content: `Unknown /tools subcommand: ${input}\n\nTry /tools, /tools on, or /tools off.`,
|
|
219
|
+
content: `Unknown /tools subcommand: ${input}\n\nTry /tools, /tools balanced, /tools full, /tools on, or /tools off.`,
|
|
194
220
|
display: true,
|
|
195
221
|
});
|
|
196
222
|
},
|
|
@@ -710,7 +710,7 @@ const ChainItem = Type.Object({
|
|
|
710
710
|
});
|
|
711
711
|
|
|
712
712
|
const AgentScopeSchema = StringEnum(["user", "project", "both"] as const, {
|
|
713
|
-
description: 'Which agent directories to use. Default: "both"
|
|
713
|
+
description: 'Which agent directories to use. Default: "both".',
|
|
714
714
|
default: "both",
|
|
715
715
|
});
|
|
716
716
|
|
|
@@ -950,13 +950,11 @@ export default function(pi: ExtensionAPI) {
|
|
|
950
950
|
"Modes: single ({ agent, task }), parallel ({ tasks: [{agent, task},...] }), chain ({ chain: [{agent, task},...] } with {previous} placeholder).",
|
|
951
951
|
"Agents are defined as .md files in the configured user agent directory (for LSD this is typically ~/.lsd/agent/agents/) or project-local .lsd/agents/, with legacy support for .gsd/agents/ and .pi/agents/.",
|
|
952
952
|
"Use the /subagent command to list available agents and their descriptions.",
|
|
953
|
-
"Use chain mode to pipeline: scout finds context, planner designs, worker implements.",
|
|
954
953
|
"Set background: true (single mode only) to run detached — returns immediately with a sa_xxxx job ID. Completion is announced back into the session. Use await_subagent or /subagents to manage background jobs.",
|
|
955
954
|
].join(" "),
|
|
956
955
|
promptGuidelines: [
|
|
957
956
|
"Use subagent to delegate self-contained tasks that benefit from an isolated context window.",
|
|
958
|
-
"Use scout
|
|
959
|
-
"Use chain mode for scout→planner→worker or worker→reviewer→worker pipelines.",
|
|
957
|
+
"Use scout when a task requires reading and understanding many files to build architectural context — not for targeted lookups where LSP or a single file read is enough.",
|
|
960
958
|
"Use parallel mode when tasks are independent and don't need each other's output.",
|
|
961
959
|
"Always check available agents with /subagent before choosing one.",
|
|
962
960
|
"Use background: true when the user wants to keep chatting while a long-running agent works in parallel.",
|
|
@@ -1344,8 +1342,7 @@ export default function(pi: ExtensionAPI) {
|
|
|
1344
1342
|
if (args.chain && args.chain.length > 0) {
|
|
1345
1343
|
let text =
|
|
1346
1344
|
theme.fg("toolTitle", theme.bold("subagent ")) +
|
|
1347
|
-
theme.fg("accent", `chain (${args.chain.length} steps)`)
|
|
1348
|
-
theme.fg("muted", ` [${scope}]`);
|
|
1345
|
+
theme.fg("accent", `chain (${args.chain.length} steps)`);
|
|
1349
1346
|
for (let i = 0; i < Math.min(args.chain.length, 3); i++) {
|
|
1350
1347
|
const step = args.chain[i];
|
|
1351
1348
|
// Clean up {previous} placeholder for display
|
|
@@ -1364,8 +1361,7 @@ export default function(pi: ExtensionAPI) {
|
|
|
1364
1361
|
if (args.tasks && args.tasks.length > 0) {
|
|
1365
1362
|
let text =
|
|
1366
1363
|
theme.fg("toolTitle", theme.bold("subagent ")) +
|
|
1367
|
-
theme.fg("accent", `parallel (${args.tasks.length} tasks)`)
|
|
1368
|
-
theme.fg("muted", ` [${scope}]`);
|
|
1364
|
+
theme.fg("accent", `parallel (${args.tasks.length} tasks)`);
|
|
1369
1365
|
for (const t of args.tasks.slice(0, 3)) {
|
|
1370
1366
|
const preview = t.task.length > 40 ? `${t.task.slice(0, 40)}...` : t.task;
|
|
1371
1367
|
text += `\n ${theme.fg("accent", t.agent)}${theme.fg("dim", ` ${preview}`)}`;
|
|
@@ -1377,8 +1373,7 @@ export default function(pi: ExtensionAPI) {
|
|
|
1377
1373
|
const preview = args.task ? (args.task.length > 60 ? `${args.task.slice(0, 60)}...` : args.task) : "...";
|
|
1378
1374
|
let text =
|
|
1379
1375
|
theme.fg("toolTitle", theme.bold("subagent ")) +
|
|
1380
|
-
theme.fg("accent", agentName)
|
|
1381
|
-
theme.fg("muted", ` [${scope}]`);
|
|
1376
|
+
theme.fg("accent", agentName);
|
|
1382
1377
|
text += `\n ${theme.fg("dim", preview)}`;
|
|
1383
1378
|
return new Text(text, 0, 0);
|
|
1384
1379
|
},
|