@oh-my-pi/pi-coding-agent 15.0.0 → 15.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +41 -0
- package/examples/extensions/plan-mode.ts +0 -1
- package/package.json +9 -9
- package/scripts/build-binary.ts +5 -0
- package/src/autoresearch/helpers.ts +17 -0
- package/src/autoresearch/tools/log-experiment.ts +9 -17
- package/src/autoresearch/tools/run-experiment.ts +2 -17
- package/src/capability/skill.ts +7 -0
- package/src/cli/list-models.ts +1 -1
- package/src/cli/shell-cli.ts +3 -13
- package/src/cli/update-cli.ts +1 -1
- package/src/cli.ts +10 -29
- package/src/commit/agentic/tools/propose-changelog.ts +8 -1
- package/src/commit/analysis/conventional.ts +8 -66
- package/src/commit/map-reduce/reduce-phase.ts +6 -65
- package/src/commit/pipeline.ts +2 -2
- package/src/commit/shared-llm.ts +89 -0
- package/src/config/config-file.ts +210 -0
- package/src/config/model-equivalence.ts +8 -11
- package/src/config/model-registry.ts +13 -2
- package/src/config/model-resolver.ts +1 -4
- package/src/config/settings-schema.ts +71 -1
- package/src/config/settings.ts +1 -1
- package/src/config.ts +3 -219
- package/src/edit/renderer.ts +7 -1
- package/src/eval/js/executor.ts +3 -0
- package/src/eval/js/shared/rewrite-imports.ts +2 -2
- package/src/eval/py/executor.ts +5 -0
- package/src/exa/factory.ts +2 -2
- package/src/exa/mcp-client.ts +74 -1
- package/src/exec/bash-executor.ts +5 -1
- package/src/export/html/template.generated.ts +1 -1
- package/src/export/html/template.js +0 -11
- package/src/extensibility/extensions/runner.ts +1 -1
- package/src/extensibility/extensions/types.ts +89 -223
- package/src/extensibility/hooks/types.ts +89 -314
- package/src/extensibility/shared-events.ts +343 -0
- package/src/extensibility/skills.ts +9 -0
- package/src/goals/index.ts +3 -0
- package/src/goals/runtime.ts +500 -0
- package/src/goals/state.ts +37 -0
- package/src/goals/tools/goal-tool.ts +237 -0
- package/src/hashline/anchors.ts +2 -2
- package/src/hindsight/mental-models.ts +1 -1
- package/src/internal-urls/agent-protocol.ts +1 -20
- package/src/internal-urls/artifact-protocol.ts +1 -19
- package/src/internal-urls/docs-index.generated.ts +5 -6
- package/src/internal-urls/registry-helpers.ts +25 -0
- package/src/main.ts +11 -2
- package/src/mcp/oauth-flow.ts +20 -0
- package/src/modes/acp/acp-agent.ts +79 -45
- package/src/modes/components/assistant-message.ts +14 -8
- package/src/modes/components/bash-execution.ts +24 -63
- package/src/modes/components/custom-message.ts +14 -40
- package/src/modes/components/eval-execution.ts +27 -57
- package/src/modes/components/execution-shared.ts +102 -0
- package/src/modes/components/hook-message.ts +17 -49
- package/src/modes/components/mcp-add-wizard.ts +26 -5
- package/src/modes/components/message-frame.ts +88 -0
- package/src/modes/components/model-selector.ts +1 -1
- package/src/modes/components/session-observer-overlay.ts +6 -2
- package/src/modes/components/session-selector.ts +1 -1
- package/src/modes/components/status-line/segments.ts +55 -4
- package/src/modes/components/status-line/types.ts +4 -0
- package/src/modes/components/status-line.ts +28 -10
- package/src/modes/components/tool-execution.ts +7 -8
- package/src/modes/controllers/command-controller-shared.ts +108 -0
- package/src/modes/controllers/command-controller.ts +13 -4
- package/src/modes/controllers/event-controller.ts +36 -7
- package/src/modes/controllers/input-controller.ts +13 -0
- package/src/modes/controllers/mcp-command-controller.ts +56 -61
- package/src/modes/controllers/ssh-command-controller.ts +18 -57
- package/src/modes/interactive-mode.ts +624 -52
- package/src/modes/print-mode.ts +16 -86
- package/src/modes/rpc/rpc-mode.ts +14 -87
- package/src/modes/runtime-init.ts +115 -0
- package/src/modes/theme/defaults/dark-poimandres.json +2 -0
- package/src/modes/theme/defaults/light-poimandres.json +2 -0
- package/src/modes/theme/theme.ts +18 -6
- package/src/modes/types.ts +14 -3
- package/src/modes/utils/context-usage.ts +13 -13
- package/src/modes/utils/ui-helpers.ts +10 -3
- package/src/plan-mode/approved-plan.ts +35 -1
- package/src/prompts/goals/goal-budget-limit.md +16 -0
- package/src/prompts/goals/goal-continuation.md +28 -0
- package/src/prompts/goals/goal-mode-active.md +23 -0
- package/src/prompts/system/plan-mode-active.md +5 -5
- package/src/prompts/system/plan-mode-tool-decision-reminder.md +1 -1
- package/src/prompts/tools/bash.md +6 -0
- package/src/prompts/tools/goal.md +13 -0
- package/src/prompts/tools/hashline.md +102 -114
- package/src/prompts/tools/read.md +1 -0
- package/src/prompts/tools/resolve.md +6 -5
- package/src/sdk.ts +12 -5
- package/src/session/agent-session.ts +428 -106
- package/src/session/blob-store.ts +36 -3
- package/src/session/messages.ts +67 -2
- package/src/session/session-manager.ts +131 -12
- package/src/session/session-storage.ts +33 -15
- package/src/session/streaming-output.ts +309 -13
- package/src/slash-commands/builtin-registry.ts +18 -0
- package/src/ssh/ssh-executor.ts +5 -0
- package/src/system-prompt.ts +4 -2
- package/src/task/executor.ts +17 -7
- package/src/task/index.ts +3 -0
- package/src/task/render.ts +21 -15
- package/src/task/types.ts +4 -0
- package/src/tools/ast-edit.ts +21 -120
- package/src/tools/ast-grep.ts +21 -119
- package/src/tools/bash-interactive.ts +9 -1
- package/src/tools/bash.ts +27 -4
- package/src/tools/browser/attach.ts +3 -3
- package/src/tools/browser/launch.ts +81 -18
- package/src/tools/browser/registry.ts +1 -5
- package/src/tools/browser/tab-supervisor.ts +51 -14
- package/src/tools/conflict-detect.ts +15 -4
- package/src/tools/eval.ts +3 -1
- package/src/tools/find.ts +20 -38
- package/src/tools/gh.ts +7 -6
- package/src/tools/index.ts +22 -11
- package/src/tools/inspect-image.ts +3 -10
- package/src/tools/output-meta.ts +176 -37
- package/src/tools/path-utils.ts +125 -2
- package/src/tools/read.ts +516 -233
- package/src/tools/render-utils.ts +92 -0
- package/src/tools/renderers.ts +2 -0
- package/src/tools/resolve.ts +72 -44
- package/src/tools/search.ts +120 -186
- package/src/tools/write.ts +44 -9
- package/src/utils/file-mentions.ts +1 -1
- package/src/utils/image-loading.ts +7 -3
- package/src/utils/image-resize.ts +32 -43
- package/src/vim/parser.ts +0 -17
- package/src/vim/render.ts +1 -1
- package/src/vim/types.ts +1 -1
- package/src/web/search/providers/gemini.ts +35 -95
- package/src/prompts/tools/exit-plan-mode.md +0 -6
- package/src/tools/exit-plan-mode.ts +0 -97
- package/src/utils/fuzzy.ts +0 -108
- package/src/utils/image-convert.ts +0 -27
|
@@ -3,18 +3,20 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Handles /ssh subcommands for managing SSH host configurations.
|
|
5
5
|
*/
|
|
6
|
-
import { Spacer, Text } from "@oh-my-pi/pi-tui";
|
|
7
6
|
import { getProjectDir, getSSHConfigPath } from "@oh-my-pi/pi-utils";
|
|
8
7
|
import { type SSHHost, sshCapability } from "../../capability/ssh";
|
|
9
8
|
import { loadCapability } from "../../discovery";
|
|
10
9
|
import { addSSHHost, readSSHConfigFile, removeSSHHost, type SSHHostConfig } from "../../ssh/config-writer";
|
|
11
|
-
import { shortenPath } from "../../tools/render-utils";
|
|
12
|
-
import { DynamicBorder } from "../components/dynamic-border";
|
|
13
10
|
import { parseCommandArgs } from "../shared";
|
|
14
11
|
import { theme } from "../theme/theme";
|
|
15
12
|
import type { InteractiveModeContext } from "../types";
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
import {
|
|
14
|
+
groupBySource,
|
|
15
|
+
parseRemoveArgs,
|
|
16
|
+
readScopeFlag,
|
|
17
|
+
type ScopeValue,
|
|
18
|
+
showCommandMessage,
|
|
19
|
+
} from "./command-controller-shared";
|
|
18
20
|
|
|
19
21
|
export class SSHCommandController {
|
|
20
22
|
constructor(private ctx: InteractiveModeContext) {}
|
|
@@ -90,7 +92,7 @@ export class SSHCommandController {
|
|
|
90
92
|
}
|
|
91
93
|
|
|
92
94
|
let name: string | undefined;
|
|
93
|
-
let scope:
|
|
95
|
+
let scope: ScopeValue = "project";
|
|
94
96
|
let host: string | undefined;
|
|
95
97
|
let username: string | undefined;
|
|
96
98
|
let port: number | undefined;
|
|
@@ -167,12 +169,12 @@ export class SSHCommandController {
|
|
|
167
169
|
continue;
|
|
168
170
|
}
|
|
169
171
|
if (argToken === "--scope") {
|
|
170
|
-
const
|
|
171
|
-
if (!
|
|
172
|
-
this.ctx.showError(
|
|
172
|
+
const r = readScopeFlag(tokens[i + 1]);
|
|
173
|
+
if (!r.ok) {
|
|
174
|
+
this.ctx.showError(r.error);
|
|
173
175
|
return;
|
|
174
176
|
}
|
|
175
|
-
scope =
|
|
177
|
+
scope = r.scope;
|
|
176
178
|
i += 2;
|
|
177
179
|
continue;
|
|
178
180
|
}
|
|
@@ -300,23 +302,7 @@ export class SSHCommandController {
|
|
|
300
302
|
|
|
301
303
|
// Show discovered hosts (from ssh.json, .ssh.json in project root, etc.)
|
|
302
304
|
if (discoveredHosts.length > 0) {
|
|
303
|
-
|
|
304
|
-
const bySource = new Map<string, SSHHost[]>();
|
|
305
|
-
for (const host of discoveredHosts) {
|
|
306
|
-
const key = `${host._source.providerName}|${host._source.path}`;
|
|
307
|
-
let group = bySource.get(key);
|
|
308
|
-
if (!group) {
|
|
309
|
-
group = [];
|
|
310
|
-
bySource.set(key, group);
|
|
311
|
-
}
|
|
312
|
-
group.push(host);
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
for (const [key, hosts] of bySource) {
|
|
316
|
-
const sepIdx = key.indexOf("|");
|
|
317
|
-
const providerName = key.slice(0, sepIdx);
|
|
318
|
-
const sourcePath = key.slice(sepIdx + 1);
|
|
319
|
-
const shortPath = shortenPath(sourcePath);
|
|
305
|
+
for (const { providerName, shortPath, items: hosts } of groupBySource(discoveredHosts, h => h._source)) {
|
|
320
306
|
lines.push(
|
|
321
307
|
theme.fg("accent", "Discovered") +
|
|
322
308
|
theme.fg("muted", ` (${providerName}: ${shortPath}):`) +
|
|
@@ -357,33 +343,12 @@ export class SSHCommandController {
|
|
|
357
343
|
async #handleRemove(text: string): Promise<void> {
|
|
358
344
|
const match = text.match(/^\/ssh\s+(?:remove|rm)\b\s*(.*)$/i);
|
|
359
345
|
const rest = match?.[1]?.trim() ?? "";
|
|
360
|
-
const
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
let scope: "project" | "user" = "project";
|
|
364
|
-
let i = 0;
|
|
365
|
-
|
|
366
|
-
if (tokens.length > 0 && !tokens[0].startsWith("-")) {
|
|
367
|
-
name = tokens[0];
|
|
368
|
-
i = 1;
|
|
369
|
-
}
|
|
370
|
-
|
|
371
|
-
while (i < tokens.length) {
|
|
372
|
-
const token = tokens[i];
|
|
373
|
-
if (token === "--scope") {
|
|
374
|
-
const value = tokens[i + 1];
|
|
375
|
-
if (!value || (value !== "project" && value !== "user")) {
|
|
376
|
-
this.ctx.showError("Invalid --scope value. Use project or user.");
|
|
377
|
-
return;
|
|
378
|
-
}
|
|
379
|
-
scope = value;
|
|
380
|
-
i += 2;
|
|
381
|
-
continue;
|
|
382
|
-
}
|
|
383
|
-
this.ctx.showError(`Unknown option: ${token}`);
|
|
346
|
+
const parsed = parseRemoveArgs(rest);
|
|
347
|
+
if (!parsed.ok) {
|
|
348
|
+
this.ctx.showError(parsed.error);
|
|
384
349
|
return;
|
|
385
350
|
}
|
|
386
|
-
|
|
351
|
+
const { name, scope } = parsed.value;
|
|
387
352
|
if (!name) {
|
|
388
353
|
this.ctx.showError("Host name required. Usage: /ssh remove <name> [--scope project|user]");
|
|
389
354
|
return;
|
|
@@ -412,10 +377,6 @@ export class SSHCommandController {
|
|
|
412
377
|
* Show a message in the chat
|
|
413
378
|
*/
|
|
414
379
|
#showMessage(text: string): void {
|
|
415
|
-
this.ctx
|
|
416
|
-
this.ctx.chatContainer.addChild(new DynamicBorder());
|
|
417
|
-
this.ctx.chatContainer.addChild(new Text(text, 1, 1));
|
|
418
|
-
this.ctx.chatContainer.addChild(new DynamicBorder());
|
|
419
|
-
this.ctx.ui.requestRender();
|
|
380
|
+
showCommandMessage(this.ctx, text);
|
|
420
381
|
}
|
|
421
382
|
}
|