gsd-pi 2.39.0 → 2.40.0-dev.4a93031
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/resource-loader.js +66 -2
- package/dist/resources/extensions/async-jobs/index.js +10 -0
- package/dist/resources/extensions/get-secrets-from-user.js +1 -1
- package/dist/resources/extensions/gsd/auto-dashboard.js +7 -0
- package/dist/resources/extensions/gsd/auto-loop.js +761 -673
- package/dist/resources/extensions/gsd/auto-post-unit.js +10 -2
- package/dist/resources/extensions/gsd/auto-prompts.js +3 -3
- package/dist/resources/extensions/gsd/auto-start.js +6 -1
- package/dist/resources/extensions/gsd/auto.js +6 -4
- package/dist/resources/extensions/gsd/bootstrap/agent-end-recovery.js +126 -0
- package/dist/resources/extensions/gsd/bootstrap/db-tools.js +233 -0
- package/dist/resources/extensions/gsd/bootstrap/dynamic-tools.js +59 -0
- package/dist/resources/extensions/gsd/bootstrap/register-extension.js +38 -0
- package/dist/resources/extensions/gsd/bootstrap/register-hooks.js +156 -0
- package/dist/resources/extensions/gsd/bootstrap/register-shortcuts.js +46 -0
- package/dist/resources/extensions/gsd/bootstrap/system-context.js +300 -0
- package/dist/resources/extensions/gsd/bootstrap/write-gate.js +38 -0
- package/dist/resources/extensions/gsd/commands/catalog.js +278 -0
- package/dist/resources/extensions/gsd/commands/context.js +84 -0
- package/dist/resources/extensions/gsd/commands/dispatcher.js +21 -0
- package/dist/resources/extensions/gsd/commands/handlers/auto.js +72 -0
- package/dist/resources/extensions/gsd/commands/handlers/core.js +246 -0
- package/dist/resources/extensions/gsd/commands/handlers/ops.js +166 -0
- package/dist/resources/extensions/gsd/commands/handlers/parallel.js +94 -0
- package/dist/resources/extensions/gsd/commands/handlers/workflow.js +102 -0
- package/dist/resources/extensions/gsd/commands/index.js +11 -0
- package/dist/resources/extensions/gsd/commands-handlers.js +1 -1
- package/dist/resources/extensions/gsd/commands.js +8 -1190
- package/dist/resources/extensions/gsd/dashboard-overlay.js +9 -0
- package/dist/resources/extensions/gsd/doctor-proactive.js +80 -10
- package/dist/resources/extensions/gsd/doctor.js +32 -2
- package/dist/resources/extensions/gsd/export-html.js +46 -0
- package/dist/resources/extensions/gsd/files.js +1 -1
- package/dist/resources/extensions/gsd/health-widget.js +1 -1
- package/dist/resources/extensions/gsd/index.js +4 -1115
- package/dist/resources/extensions/gsd/progress-score.js +20 -1
- package/dist/resources/extensions/gsd/prompts/forensics.md +121 -46
- package/dist/resources/extensions/gsd/visualizer-data.js +26 -1
- package/dist/resources/extensions/gsd/visualizer-views.js +52 -0
- package/dist/welcome-screen.d.ts +3 -2
- package/dist/welcome-screen.js +66 -22
- package/package.json +1 -1
- package/packages/pi-coding-agent/dist/core/agent-session.d.ts +12 -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 +107 -24
- package/packages/pi-coding-agent/dist/core/agent-session.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/skill-tool.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/skill-tool.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/skill-tool.test.js +70 -0
- package/packages/pi-coding-agent/dist/core/skill-tool.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/skills.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/skills.js +2 -1
- package/packages/pi-coding-agent/dist/core/skills.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.d.ts +17 -0
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.js +244 -0
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/extension-ui-controller.d.ts +3 -0
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/extension-ui-controller.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/extension-ui-controller.js +58 -0
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/extension-ui-controller.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/input-controller.d.ts +12 -0
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/input-controller.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/input-controller.js +54 -0
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/input-controller.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/model-controller.d.ts +6 -0
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/model-controller.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/model-controller.js +63 -0
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/model-controller.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode-state.d.ts +38 -0
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode-state.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode-state.js +2 -0
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode-state.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts +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 +15 -457
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/packages/pi-coding-agent/package.json +1 -1
- package/packages/pi-coding-agent/src/core/agent-session.ts +122 -23
- package/packages/pi-coding-agent/src/core/skill-tool.test.ts +89 -0
- package/packages/pi-coding-agent/src/core/skills.ts +2 -1
- package/packages/pi-coding-agent/src/modes/interactive/controllers/chat-controller.ts +302 -0
- package/packages/pi-coding-agent/src/modes/interactive/controllers/extension-ui-controller.ts +59 -0
- package/packages/pi-coding-agent/src/modes/interactive/controllers/input-controller.ts +68 -0
- package/packages/pi-coding-agent/src/modes/interactive/controllers/model-controller.ts +71 -0
- package/packages/pi-coding-agent/src/modes/interactive/interactive-mode-state.ts +37 -0
- package/packages/pi-coding-agent/src/modes/interactive/interactive-mode.ts +18 -510
- package/pkg/package.json +1 -1
- package/src/resources/extensions/async-jobs/index.ts +11 -0
- package/src/resources/extensions/get-secrets-from-user.ts +1 -1
- package/src/resources/extensions/gsd/auto-dashboard.ts +10 -0
- package/src/resources/extensions/gsd/auto-loop.ts +1075 -921
- package/src/resources/extensions/gsd/auto-post-unit.ts +10 -2
- package/src/resources/extensions/gsd/auto-prompts.ts +3 -3
- package/src/resources/extensions/gsd/auto-start.ts +6 -1
- package/src/resources/extensions/gsd/auto.ts +13 -10
- package/src/resources/extensions/gsd/bootstrap/agent-end-recovery.ts +142 -0
- package/src/resources/extensions/gsd/bootstrap/db-tools.ts +238 -0
- package/src/resources/extensions/gsd/bootstrap/dynamic-tools.ts +90 -0
- package/src/resources/extensions/gsd/bootstrap/register-extension.ts +46 -0
- package/src/resources/extensions/gsd/bootstrap/register-hooks.ts +167 -0
- package/src/resources/extensions/gsd/bootstrap/register-shortcuts.ts +55 -0
- package/src/resources/extensions/gsd/bootstrap/system-context.ts +340 -0
- package/src/resources/extensions/gsd/bootstrap/write-gate.ts +51 -0
- package/src/resources/extensions/gsd/commands/catalog.ts +301 -0
- package/src/resources/extensions/gsd/commands/context.ts +101 -0
- package/src/resources/extensions/gsd/commands/dispatcher.ts +32 -0
- package/src/resources/extensions/gsd/commands/handlers/auto.ts +74 -0
- package/src/resources/extensions/gsd/commands/handlers/core.ts +274 -0
- package/src/resources/extensions/gsd/commands/handlers/ops.ts +169 -0
- package/src/resources/extensions/gsd/commands/handlers/parallel.ts +118 -0
- package/src/resources/extensions/gsd/commands/handlers/workflow.ts +109 -0
- package/src/resources/extensions/gsd/commands/index.ts +14 -0
- package/src/resources/extensions/gsd/commands-handlers.ts +1 -1
- package/src/resources/extensions/gsd/commands.ts +10 -1329
- package/src/resources/extensions/gsd/dashboard-overlay.ts +10 -0
- package/src/resources/extensions/gsd/doctor-proactive.ts +106 -10
- package/src/resources/extensions/gsd/doctor.ts +47 -3
- package/src/resources/extensions/gsd/export-html.ts +51 -0
- package/src/resources/extensions/gsd/files.ts +1 -1
- package/src/resources/extensions/gsd/health-widget.ts +2 -1
- package/src/resources/extensions/gsd/index.ts +12 -1314
- package/src/resources/extensions/gsd/progress-score.ts +23 -0
- package/src/resources/extensions/gsd/prompts/forensics.md +121 -46
- package/src/resources/extensions/gsd/tests/auto-loop.test.ts +13 -9
- package/src/resources/extensions/gsd/tests/doctor-proactive.test.ts +3 -3
- package/src/resources/extensions/gsd/tests/provider-errors.test.ts +16 -16
- package/src/resources/extensions/gsd/tests/skill-activation.test.ts +4 -4
- package/src/resources/extensions/gsd/tests/visualizer-data.test.ts +10 -10
- package/src/resources/extensions/gsd/visualizer-data.ts +51 -1
- package/src/resources/extensions/gsd/visualizer-views.ts +58 -0
- /package/dist/resources/extensions/{env-utils.js → gsd/env-utils.js} +0 -0
- /package/src/resources/extensions/{env-utils.ts → gsd/env-utils.ts} +0 -0
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { dispatchSlashCommand } from "../slash-command-handlers.js";
|
|
2
|
+
import type { InteractiveModeStateHost } from "../interactive-mode-state.js";
|
|
3
|
+
|
|
4
|
+
export function setupEditorSubmitHandler(host: InteractiveModeStateHost & {
|
|
5
|
+
getSlashCommandContext: () => any;
|
|
6
|
+
handleBashCommand: (command: string, excludeFromContext?: boolean) => Promise<void>;
|
|
7
|
+
showWarning: (message: string) => void;
|
|
8
|
+
updateEditorBorderColor: () => void;
|
|
9
|
+
isExtensionCommand: (text: string) => boolean;
|
|
10
|
+
queueCompactionMessage: (text: string, mode: "steer" | "followUp") => void;
|
|
11
|
+
updatePendingMessagesDisplay: () => void;
|
|
12
|
+
flushPendingBashComponents: () => void;
|
|
13
|
+
}): void {
|
|
14
|
+
host.defaultEditor.onSubmit = async (text: string) => {
|
|
15
|
+
text = text.trim();
|
|
16
|
+
if (!text) return;
|
|
17
|
+
|
|
18
|
+
if (text.startsWith("/")) {
|
|
19
|
+
const handled = await dispatchSlashCommand(text, host.getSlashCommandContext());
|
|
20
|
+
if (handled) {
|
|
21
|
+
host.editor.setText("");
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
if (text.startsWith("!")) {
|
|
27
|
+
const isExcluded = text.startsWith("!!");
|
|
28
|
+
const command = isExcluded ? text.slice(2).trim() : text.slice(1).trim();
|
|
29
|
+
if (command) {
|
|
30
|
+
if (host.session.isBashRunning) {
|
|
31
|
+
host.showWarning("A bash command is already running. Press Esc to cancel it first.");
|
|
32
|
+
host.editor.setText(text);
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
host.editor.addToHistory?.(text);
|
|
36
|
+
await host.handleBashCommand(command, isExcluded);
|
|
37
|
+
host.isBashMode = false;
|
|
38
|
+
host.updateEditorBorderColor();
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
if (host.session.isCompacting) {
|
|
44
|
+
if (host.isExtensionCommand(text)) {
|
|
45
|
+
host.editor.addToHistory?.(text);
|
|
46
|
+
host.editor.setText("");
|
|
47
|
+
await host.session.prompt(text);
|
|
48
|
+
} else {
|
|
49
|
+
host.queueCompactionMessage(text, "steer");
|
|
50
|
+
}
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
if (host.session.isStreaming) {
|
|
55
|
+
host.editor.addToHistory?.(text);
|
|
56
|
+
host.editor.setText("");
|
|
57
|
+
await host.session.prompt(text, { streamingBehavior: "steer" });
|
|
58
|
+
host.updatePendingMessagesDisplay();
|
|
59
|
+
host.ui.requestRender();
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
host.flushPendingBashComponents();
|
|
64
|
+
host.onInputCallback?.(text);
|
|
65
|
+
host.editor.addToHistory?.(text);
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import type { Model } from "@gsd/pi-ai";
|
|
2
|
+
|
|
3
|
+
export async function handleModelCommand(host: any, searchTerm?: string): Promise<void> {
|
|
4
|
+
if (!searchTerm) {
|
|
5
|
+
host.showModelSelector();
|
|
6
|
+
return;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const model = await findExactModelMatch(host, searchTerm);
|
|
10
|
+
if (model) {
|
|
11
|
+
try {
|
|
12
|
+
await host.session.setModel(model);
|
|
13
|
+
host.footer.invalidate();
|
|
14
|
+
host.updateEditorBorderColor();
|
|
15
|
+
host.showStatus(`Model: ${model.id}`);
|
|
16
|
+
host.checkDaxnutsEasterEgg(model);
|
|
17
|
+
} catch (error) {
|
|
18
|
+
host.showError(error instanceof Error ? error.message : String(error));
|
|
19
|
+
}
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
host.showModelSelector(searchTerm);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export async function findExactModelMatch(host: any, searchTerm: string): Promise<Model<any> | undefined> {
|
|
27
|
+
const term = searchTerm.trim();
|
|
28
|
+
if (!term) return undefined;
|
|
29
|
+
|
|
30
|
+
let targetProvider: string | undefined;
|
|
31
|
+
let targetModelId = "";
|
|
32
|
+
|
|
33
|
+
if (term.includes("/")) {
|
|
34
|
+
const parts = term.split("/", 2);
|
|
35
|
+
targetProvider = parts[0]?.trim().toLowerCase();
|
|
36
|
+
targetModelId = parts[1]?.trim().toLowerCase() ?? "";
|
|
37
|
+
} else {
|
|
38
|
+
targetModelId = term.toLowerCase();
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
if (!targetModelId) return undefined;
|
|
42
|
+
|
|
43
|
+
const models = await getModelCandidates(host);
|
|
44
|
+
const exactMatches = models.filter((item) => {
|
|
45
|
+
const idMatch = item.id.toLowerCase() === targetModelId;
|
|
46
|
+
const providerMatch = !targetProvider || item.provider.toLowerCase() === targetProvider;
|
|
47
|
+
return idMatch && providerMatch;
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
return exactMatches.length === 1 ? exactMatches[0] : undefined;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export async function getModelCandidates(host: any): Promise<Model<any>[]> {
|
|
54
|
+
if (host.session.scopedModels.length > 0) {
|
|
55
|
+
return host.session.scopedModels.map((scoped: any) => scoped.model);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
host.session.modelRegistry.refresh();
|
|
59
|
+
try {
|
|
60
|
+
return await host.session.modelRegistry.getAvailable();
|
|
61
|
+
} catch {
|
|
62
|
+
return [];
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export async function updateAvailableProviderCount(host: any): Promise<void> {
|
|
67
|
+
const models = await getModelCandidates(host);
|
|
68
|
+
const uniqueProviders = new Set(models.map((m) => m.provider));
|
|
69
|
+
host.footerDataProvider.setAvailableProviderCount(uniqueProviders.size);
|
|
70
|
+
}
|
|
71
|
+
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { AgentSessionEvent } from "../../core/agent-session.js";
|
|
2
|
+
|
|
3
|
+
export interface InteractiveModeStateHost {
|
|
4
|
+
defaultEditor: any;
|
|
5
|
+
editor: any;
|
|
6
|
+
session: any;
|
|
7
|
+
ui: any;
|
|
8
|
+
footer: any;
|
|
9
|
+
keybindings: any;
|
|
10
|
+
statusContainer: any;
|
|
11
|
+
chatContainer: any;
|
|
12
|
+
settingsManager: any;
|
|
13
|
+
pendingTools: Map<string, any>;
|
|
14
|
+
toolOutputExpanded: boolean;
|
|
15
|
+
hideThinkingBlock: boolean;
|
|
16
|
+
isBashMode: boolean;
|
|
17
|
+
onInputCallback?: (text: string) => void;
|
|
18
|
+
isInitialized: boolean;
|
|
19
|
+
loadingAnimation?: any;
|
|
20
|
+
pendingWorkingMessage?: string;
|
|
21
|
+
defaultWorkingMessage: string;
|
|
22
|
+
streamingComponent?: any;
|
|
23
|
+
streamingMessage?: any;
|
|
24
|
+
retryEscapeHandler?: () => void;
|
|
25
|
+
retryLoader?: any;
|
|
26
|
+
autoCompactionLoader?: any;
|
|
27
|
+
autoCompactionEscapeHandler?: () => void;
|
|
28
|
+
compactionQueuedMessages: Array<{ text: string; mode: "steer" | "followUp" }>;
|
|
29
|
+
extensionSelector?: any;
|
|
30
|
+
extensionInput?: any;
|
|
31
|
+
extensionEditor?: any;
|
|
32
|
+
editorContainer: any;
|
|
33
|
+
keybindingsManager?: any;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export type InteractiveModeEvent = AgentSessionEvent;
|
|
37
|
+
|