gsd-pi 2.8.3 → 2.9.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/README.md +2 -1
- package/dist/cli.js +5 -0
- package/dist/loader.js +1 -1
- package/dist/update-check.d.ts +24 -0
- package/dist/update-check.js +93 -0
- package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/client.d.ts +46 -0
- package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/client.d.ts.map +1 -0
- package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/client.js +758 -0
- package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/client.js.map +1 -0
- package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/config.d.ts +23 -0
- package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/config.d.ts.map +1 -0
- package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/config.js +267 -0
- package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/config.js.map +1 -0
- package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/edits.d.ts +17 -0
- package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/edits.d.ts.map +1 -0
- package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/edits.js +101 -0
- package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/edits.js.map +1 -0
- package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/helpers.d.ts +15 -0
- package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/helpers.d.ts.map +1 -0
- package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/helpers.js +46 -0
- package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/helpers.js.map +1 -0
- package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/index.d.ts +35 -0
- package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/index.d.ts.map +1 -0
- package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/index.js +709 -0
- package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/index.js.map +1 -0
- package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/lsp-integration.test.d.ts +2 -0
- package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/lsp-integration.test.d.ts.map +1 -0
- package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/lsp-integration.test.js +308 -0
- package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/lsp-integration.test.js.map +1 -0
- package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/lspmux.d.ts +34 -0
- package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/lspmux.d.ts.map +1 -0
- package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/lspmux.js +136 -0
- package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/lspmux.js.map +1 -0
- package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/types.d.ts +262 -0
- package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/types.d.ts.map +1 -0
- package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/types.js +64 -0
- package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/types.js.map +1 -0
- package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/utils.d.ts +50 -0
- package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/utils.d.ts.map +1 -0
- package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/utils.js +574 -0
- package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/utils.js.map +1 -0
- package/node_modules/@gsd/pi-coding-agent/dist/core/slash-commands.d.ts.map +1 -1
- package/node_modules/@gsd/pi-coding-agent/dist/core/slash-commands.js +1 -0
- package/node_modules/@gsd/pi-coding-agent/dist/core/slash-commands.js.map +1 -1
- package/node_modules/@gsd/pi-coding-agent/dist/core/tools/index.d.ts +13 -0
- package/node_modules/@gsd/pi-coding-agent/dist/core/tools/index.d.ts.map +1 -1
- package/node_modules/@gsd/pi-coding-agent/dist/core/tools/index.js +4 -0
- package/node_modules/@gsd/pi-coding-agent/dist/core/tools/index.js.map +1 -1
- package/node_modules/@gsd/pi-coding-agent/dist/modes/interactive/components/settings-selector.d.ts +10 -1
- package/node_modules/@gsd/pi-coding-agent/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
- package/node_modules/@gsd/pi-coding-agent/dist/modes/interactive/components/settings-selector.js +2 -2
- package/node_modules/@gsd/pi-coding-agent/dist/modes/interactive/components/settings-selector.js.map +1 -1
- package/node_modules/@gsd/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts +2 -0
- package/node_modules/@gsd/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/node_modules/@gsd/pi-coding-agent/dist/modes/interactive/interactive-mode.js +46 -1
- package/node_modules/@gsd/pi-coding-agent/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/node_modules/@gsd/pi-coding-agent/src/core/lsp/client.ts +880 -0
- package/node_modules/@gsd/pi-coding-agent/src/core/lsp/config.ts +325 -0
- package/node_modules/@gsd/pi-coding-agent/src/core/lsp/defaults.json +456 -0
- package/node_modules/@gsd/pi-coding-agent/src/core/lsp/edits.ts +109 -0
- package/node_modules/@gsd/pi-coding-agent/src/core/lsp/helpers.ts +54 -0
- package/node_modules/@gsd/pi-coding-agent/src/core/lsp/index.ts +943 -0
- package/node_modules/@gsd/pi-coding-agent/src/core/lsp/lsp-integration.test.ts +407 -0
- package/node_modules/@gsd/pi-coding-agent/src/core/lsp/lsp.md +33 -0
- package/node_modules/@gsd/pi-coding-agent/src/core/lsp/lspmux.ts +199 -0
- package/node_modules/@gsd/pi-coding-agent/src/core/lsp/types.ts +421 -0
- package/node_modules/@gsd/pi-coding-agent/src/core/lsp/utils.ts +682 -0
- package/node_modules/@gsd/pi-coding-agent/src/core/slash-commands.ts +1 -0
- package/node_modules/@gsd/pi-coding-agent/src/core/tools/index.ts +10 -0
- package/node_modules/@gsd/pi-coding-agent/src/modes/interactive/components/settings-selector.ts +2 -2
- package/node_modules/@gsd/pi-coding-agent/src/modes/interactive/interactive-mode.ts +59 -2
- package/package.json +1 -1
- package/packages/pi-coding-agent/dist/core/lsp/client.d.ts +46 -0
- package/packages/pi-coding-agent/dist/core/lsp/client.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/lsp/client.js +758 -0
- package/packages/pi-coding-agent/dist/core/lsp/client.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/lsp/config.d.ts +23 -0
- package/packages/pi-coding-agent/dist/core/lsp/config.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/lsp/config.js +267 -0
- package/packages/pi-coding-agent/dist/core/lsp/config.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/lsp/edits.d.ts +17 -0
- package/packages/pi-coding-agent/dist/core/lsp/edits.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/lsp/edits.js +101 -0
- package/packages/pi-coding-agent/dist/core/lsp/edits.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/lsp/helpers.d.ts +15 -0
- package/packages/pi-coding-agent/dist/core/lsp/helpers.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/lsp/helpers.js +46 -0
- package/packages/pi-coding-agent/dist/core/lsp/helpers.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/lsp/index.d.ts +35 -0
- package/packages/pi-coding-agent/dist/core/lsp/index.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/lsp/index.js +709 -0
- package/packages/pi-coding-agent/dist/core/lsp/index.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/lsp/lsp-integration.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/lsp/lsp-integration.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/lsp/lsp-integration.test.js +308 -0
- package/packages/pi-coding-agent/dist/core/lsp/lsp-integration.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/lsp/lspmux.d.ts +34 -0
- package/packages/pi-coding-agent/dist/core/lsp/lspmux.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/lsp/lspmux.js +136 -0
- package/packages/pi-coding-agent/dist/core/lsp/lspmux.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/lsp/types.d.ts +262 -0
- package/packages/pi-coding-agent/dist/core/lsp/types.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/lsp/types.js +64 -0
- package/packages/pi-coding-agent/dist/core/lsp/types.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/lsp/utils.d.ts +50 -0
- package/packages/pi-coding-agent/dist/core/lsp/utils.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/lsp/utils.js +574 -0
- package/packages/pi-coding-agent/dist/core/lsp/utils.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/slash-commands.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/slash-commands.js +1 -0
- package/packages/pi-coding-agent/dist/core/slash-commands.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/index.d.ts +13 -0
- package/packages/pi-coding-agent/dist/core/tools/index.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/index.js +4 -0
- package/packages/pi-coding-agent/dist/core/tools/index.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/settings-selector.d.ts +10 -1
- 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 +2 -2
- package/packages/pi-coding-agent/dist/modes/interactive/components/settings-selector.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts +2 -0
- 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 +46 -1
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/packages/pi-coding-agent/src/core/lsp/client.ts +880 -0
- package/packages/pi-coding-agent/src/core/lsp/config.ts +325 -0
- package/packages/pi-coding-agent/src/core/lsp/defaults.json +456 -0
- package/packages/pi-coding-agent/src/core/lsp/edits.ts +109 -0
- package/packages/pi-coding-agent/src/core/lsp/helpers.ts +54 -0
- package/packages/pi-coding-agent/src/core/lsp/index.ts +943 -0
- package/packages/pi-coding-agent/src/core/lsp/lsp-integration.test.ts +407 -0
- package/packages/pi-coding-agent/src/core/lsp/lsp.md +33 -0
- package/packages/pi-coding-agent/src/core/lsp/lspmux.ts +199 -0
- package/packages/pi-coding-agent/src/core/lsp/types.ts +421 -0
- package/packages/pi-coding-agent/src/core/lsp/utils.ts +682 -0
- package/packages/pi-coding-agent/src/core/slash-commands.ts +1 -0
- package/packages/pi-coding-agent/src/core/tools/index.ts +10 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/settings-selector.ts +2 -2
- package/packages/pi-coding-agent/src/modes/interactive/interactive-mode.ts +59 -2
- package/src/resources/extensions/ask-user-questions.ts +2 -2
- package/src/resources/extensions/bg-shell/index.ts +34 -37
- package/src/resources/extensions/browser-tools/core.d.ts +205 -0
- package/src/resources/extensions/browser-tools/index.ts +2 -2
- package/src/resources/extensions/browser-tools/refs.ts +1 -1
- package/src/resources/extensions/browser-tools/tools/session.ts +1 -1
- package/src/resources/extensions/context7/index.ts +2 -2
- package/src/resources/extensions/get-secrets-from-user.ts +3 -2
- package/src/resources/extensions/google-search/index.ts +1 -1
- package/src/resources/extensions/gsd/auto.ts +41 -4
- package/src/resources/extensions/gsd/commands.ts +218 -3
- package/src/resources/extensions/gsd/doctor.ts +1 -1
- package/src/resources/extensions/gsd/git-service.ts +116 -4
- package/src/resources/extensions/gsd/guided-flow.ts +19 -9
- package/src/resources/extensions/gsd/index.ts +17 -7
- package/src/resources/extensions/gsd/preferences.ts +1 -1
- package/src/resources/extensions/gsd/tests/git-service.test.ts +226 -0
- package/src/resources/extensions/gsd/tests/migrate-command.test.ts +2 -2
- package/src/resources/extensions/gsd/tests/migrate-transformer.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/migrate-writer-integration.test.ts +10 -10
- package/src/resources/extensions/gsd/tests/next-milestone-id.test.ts +87 -0
- package/src/resources/extensions/gsd/tests/worktree.test.ts +352 -0
- package/src/resources/extensions/gsd/types.ts +1 -0
- package/src/resources/extensions/gsd/worktree.ts +20 -1
- package/src/resources/extensions/mac-tools/index.ts +1 -1
- package/src/resources/extensions/search-the-web/format.ts +1 -1
- package/src/resources/extensions/search-the-web/index.ts +5 -5
- package/src/resources/extensions/search-the-web/tool-fetch-page.ts +7 -7
- package/src/resources/extensions/search-the-web/tool-llm-context.ts +11 -11
- package/src/resources/extensions/search-the-web/tool-search.ts +10 -10
- package/src/resources/extensions/shared/interview-ui.ts +2 -2
|
@@ -65,6 +65,13 @@ export {
|
|
|
65
65
|
type WriteToolOptions,
|
|
66
66
|
writeTool,
|
|
67
67
|
} from "./write.js";
|
|
68
|
+
export {
|
|
69
|
+
createLspTool,
|
|
70
|
+
type LspToolDetails,
|
|
71
|
+
lspSchema,
|
|
72
|
+
lspTool,
|
|
73
|
+
} from "../lsp/index.js";
|
|
74
|
+
export type { LspServerStatus } from "../lsp/client.js";
|
|
68
75
|
|
|
69
76
|
import type { AgentTool } from "@gsd/pi-agent-core";
|
|
70
77
|
import { type BashToolOptions, bashTool, createBashTool } from "./bash.js";
|
|
@@ -74,6 +81,7 @@ import { createGrepTool, grepTool } from "./grep.js";
|
|
|
74
81
|
import { createLsTool, lsTool } from "./ls.js";
|
|
75
82
|
import { createReadTool, type ReadToolOptions, readTool } from "./read.js";
|
|
76
83
|
import { createWriteTool, writeTool } from "./write.js";
|
|
84
|
+
import { createLspTool, lspTool } from "../lsp/index.js";
|
|
77
85
|
|
|
78
86
|
/** Tool type (AgentTool from pi-ai) */
|
|
79
87
|
export type Tool = AgentTool<any>;
|
|
@@ -93,6 +101,7 @@ export const allTools = {
|
|
|
93
101
|
grep: grepTool,
|
|
94
102
|
find: findTool,
|
|
95
103
|
ls: lsTool,
|
|
104
|
+
lsp: lspTool,
|
|
96
105
|
};
|
|
97
106
|
|
|
98
107
|
export type ToolName = keyof typeof allTools;
|
|
@@ -135,5 +144,6 @@ export function createAllTools(cwd: string, options?: ToolsOptions): Record<Tool
|
|
|
135
144
|
grep: createGrepTool(cwd),
|
|
136
145
|
find: createFindTool(cwd),
|
|
137
146
|
ls: createLsTool(cwd),
|
|
147
|
+
lsp: createLspTool(cwd),
|
|
138
148
|
};
|
|
139
149
|
}
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
import { getSelectListTheme, getSettingsListTheme, theme } from "../theme/theme.js";
|
|
14
14
|
import { DynamicBorder } from "./dynamic-border.js";
|
|
15
15
|
|
|
16
|
-
const THINKING_DESCRIPTIONS: Record<ThinkingLevel, string> = {
|
|
16
|
+
export const THINKING_DESCRIPTIONS: Record<ThinkingLevel, string> = {
|
|
17
17
|
off: "No reasoning",
|
|
18
18
|
minimal: "Very brief reasoning (~1k tokens)",
|
|
19
19
|
low: "Light reasoning (~2k tokens)",
|
|
@@ -73,7 +73,7 @@ export interface SettingsCallbacks {
|
|
|
73
73
|
/**
|
|
74
74
|
* A submenu component for selecting from a list of options.
|
|
75
75
|
*/
|
|
76
|
-
class SelectSubmenu extends Container {
|
|
76
|
+
export class SelectSubmenu extends Container {
|
|
77
77
|
private selectList: SelectList;
|
|
78
78
|
|
|
79
79
|
constructor(
|
|
@@ -7,7 +7,7 @@ import * as crypto from "node:crypto";
|
|
|
7
7
|
import * as fs from "node:fs";
|
|
8
8
|
import * as os from "node:os";
|
|
9
9
|
import * as path from "node:path";
|
|
10
|
-
import type { AgentMessage } from "@gsd/pi-agent-core";
|
|
10
|
+
import type { AgentMessage, ThinkingLevel } from "@gsd/pi-agent-core";
|
|
11
11
|
import type { AssistantMessage, ImageContent, Message, Model, OAuthProviderId } from "@gsd/pi-ai";
|
|
12
12
|
import type {
|
|
13
13
|
AutocompleteItem,
|
|
@@ -85,7 +85,7 @@ import { ModelSelectorComponent } from "./components/model-selector.js";
|
|
|
85
85
|
import { OAuthSelectorComponent } from "./components/oauth-selector.js";
|
|
86
86
|
import { ScopedModelsSelectorComponent } from "./components/scoped-models-selector.js";
|
|
87
87
|
import { SessionSelectorComponent } from "./components/session-selector.js";
|
|
88
|
-
import { SettingsSelectorComponent } from "./components/settings-selector.js";
|
|
88
|
+
import { SelectSubmenu, SettingsSelectorComponent, THINKING_DESCRIPTIONS } from "./components/settings-selector.js";
|
|
89
89
|
import { SkillInvocationMessageComponent } from "./components/skill-invocation-message.js";
|
|
90
90
|
import { ToolExecutionComponent } from "./components/tool-execution.js";
|
|
91
91
|
import { TreeSelectorComponent } from "./components/tree-selector.js";
|
|
@@ -2015,6 +2015,12 @@ export class InteractiveMode {
|
|
|
2015
2015
|
await this.handleReloadCommand();
|
|
2016
2016
|
return;
|
|
2017
2017
|
}
|
|
2018
|
+
if (text === "/thinking" || text.startsWith("/thinking ")) {
|
|
2019
|
+
const arg = text.startsWith("/thinking ") ? text.slice(10).trim() : undefined;
|
|
2020
|
+
this.editor.setText("");
|
|
2021
|
+
this.handleThinkingCommand(arg);
|
|
2022
|
+
return;
|
|
2023
|
+
}
|
|
2018
2024
|
if (text === "/debug") {
|
|
2019
2025
|
this.handleDebugCommand();
|
|
2020
2026
|
this.editor.setText("");
|
|
@@ -2745,6 +2751,57 @@ export class InteractiveMode {
|
|
|
2745
2751
|
}
|
|
2746
2752
|
}
|
|
2747
2753
|
|
|
2754
|
+
private handleThinkingCommand(arg?: string): void {
|
|
2755
|
+
if (!this.session.supportsThinking()) {
|
|
2756
|
+
this.showStatus("Current model does not support thinking");
|
|
2757
|
+
return;
|
|
2758
|
+
}
|
|
2759
|
+
|
|
2760
|
+
const availableLevels = this.session.getAvailableThinkingLevels();
|
|
2761
|
+
|
|
2762
|
+
if (arg) {
|
|
2763
|
+
const level = arg.toLowerCase();
|
|
2764
|
+
if (!availableLevels.includes(level as ThinkingLevel)) {
|
|
2765
|
+
this.showStatus(`Invalid thinking level "${arg}". Available: ${availableLevels.join(", ")}`);
|
|
2766
|
+
return;
|
|
2767
|
+
}
|
|
2768
|
+
this.session.setThinkingLevel(level as ThinkingLevel);
|
|
2769
|
+
this.footer.invalidate();
|
|
2770
|
+
this.updateEditorBorderColor();
|
|
2771
|
+
this.showStatus(`Thinking level: ${level}`);
|
|
2772
|
+
return;
|
|
2773
|
+
}
|
|
2774
|
+
|
|
2775
|
+
this.showThinkingSelector();
|
|
2776
|
+
}
|
|
2777
|
+
|
|
2778
|
+
private showThinkingSelector(): void {
|
|
2779
|
+
const availableLevels = this.session.getAvailableThinkingLevels();
|
|
2780
|
+
this.showSelector((done) => {
|
|
2781
|
+
const selector = new SelectSubmenu(
|
|
2782
|
+
"Thinking Level",
|
|
2783
|
+
"Select reasoning depth for thinking-capable models",
|
|
2784
|
+
availableLevels.map((level) => ({
|
|
2785
|
+
value: level,
|
|
2786
|
+
label: level,
|
|
2787
|
+
description: THINKING_DESCRIPTIONS[level],
|
|
2788
|
+
})),
|
|
2789
|
+
this.session.thinkingLevel,
|
|
2790
|
+
(value) => {
|
|
2791
|
+
this.session.setThinkingLevel(value as ThinkingLevel);
|
|
2792
|
+
this.footer.invalidate();
|
|
2793
|
+
this.updateEditorBorderColor();
|
|
2794
|
+
done();
|
|
2795
|
+
this.showStatus(`Thinking level: ${value}`);
|
|
2796
|
+
},
|
|
2797
|
+
() => {
|
|
2798
|
+
done();
|
|
2799
|
+
},
|
|
2800
|
+
);
|
|
2801
|
+
return { component: selector, focus: selector };
|
|
2802
|
+
});
|
|
2803
|
+
}
|
|
2804
|
+
|
|
2748
2805
|
private async cycleModel(direction: "forward" | "backward"): Promise<void> {
|
|
2749
2806
|
try {
|
|
2750
2807
|
const result = await this.session.cycleModel(direction);
|
|
@@ -137,12 +137,12 @@ export default function AskUserQuestions(pi: ExtensionAPI) {
|
|
|
137
137
|
if (!ctx.hasUI) {
|
|
138
138
|
const { tryRemoteQuestions } = await import("./remote-questions/manager.js");
|
|
139
139
|
const remoteResult = await tryRemoteQuestions(params.questions, signal);
|
|
140
|
-
if (remoteResult) return remoteResult;
|
|
140
|
+
if (remoteResult) return { ...remoteResult, details: remoteResult.details as unknown };
|
|
141
141
|
return errorResult("Error: UI not available (non-interactive mode)", params.questions);
|
|
142
142
|
}
|
|
143
143
|
|
|
144
144
|
// Delegate to shared interview UI
|
|
145
|
-
const result = await showInterviewRound(params.questions, {}, ctx);
|
|
145
|
+
const result = await showInterviewRound(params.questions, {}, ctx as any);
|
|
146
146
|
|
|
147
147
|
// RPC mode fallback: custom() returns undefined, so showInterviewRound
|
|
148
148
|
// may return undefined. Fall back to sequential ctx.ui.select() calls.
|
|
@@ -1261,7 +1261,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
1261
1261
|
if (!params.command) {
|
|
1262
1262
|
return {
|
|
1263
1263
|
content: [{ type: "text" as const, text: "Error: 'command' is required for start" }],
|
|
1264
|
-
isError: true,
|
|
1264
|
+
isError: true, details: undefined as unknown,
|
|
1265
1265
|
};
|
|
1266
1266
|
}
|
|
1267
1267
|
|
|
@@ -1316,7 +1316,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
1316
1316
|
if (!bg) {
|
|
1317
1317
|
return {
|
|
1318
1318
|
content: [{ type: "text" as const, text: `Error: No process found with id '${params.id}'` }],
|
|
1319
|
-
isError: true,
|
|
1319
|
+
isError: true, details: undefined as unknown,
|
|
1320
1320
|
};
|
|
1321
1321
|
}
|
|
1322
1322
|
const digest = generateDigest(bg, true);
|
|
@@ -1356,7 +1356,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
1356
1356
|
if (!params.id) {
|
|
1357
1357
|
return {
|
|
1358
1358
|
content: [{ type: "text" as const, text: "Error: 'id' is required for highlights" }],
|
|
1359
|
-
isError: true,
|
|
1359
|
+
isError: true, details: undefined as unknown,
|
|
1360
1360
|
};
|
|
1361
1361
|
}
|
|
1362
1362
|
|
|
@@ -1364,7 +1364,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
1364
1364
|
if (!bg) {
|
|
1365
1365
|
return {
|
|
1366
1366
|
content: [{ type: "text" as const, text: `Error: No process found with id '${params.id}'` }],
|
|
1367
|
-
isError: true,
|
|
1367
|
+
isError: true, details: undefined as unknown,
|
|
1368
1368
|
};
|
|
1369
1369
|
}
|
|
1370
1370
|
|
|
@@ -1388,7 +1388,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
1388
1388
|
if (!params.id) {
|
|
1389
1389
|
return {
|
|
1390
1390
|
content: [{ type: "text" as const, text: "Error: 'id' is required for output" }],
|
|
1391
|
-
isError: true,
|
|
1391
|
+
isError: true, details: undefined as unknown,
|
|
1392
1392
|
};
|
|
1393
1393
|
}
|
|
1394
1394
|
|
|
@@ -1396,7 +1396,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
1396
1396
|
if (!bg) {
|
|
1397
1397
|
return {
|
|
1398
1398
|
content: [{ type: "text" as const, text: `Error: No process found with id '${params.id}'` }],
|
|
1399
|
-
isError: true,
|
|
1399
|
+
isError: true, details: undefined as unknown,
|
|
1400
1400
|
};
|
|
1401
1401
|
}
|
|
1402
1402
|
|
|
@@ -1429,7 +1429,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
1429
1429
|
if (!params.id) {
|
|
1430
1430
|
return {
|
|
1431
1431
|
content: [{ type: "text" as const, text: "Error: 'id' is required for wait_for_ready" }],
|
|
1432
|
-
isError: true,
|
|
1432
|
+
isError: true, details: undefined as unknown,
|
|
1433
1433
|
};
|
|
1434
1434
|
}
|
|
1435
1435
|
|
|
@@ -1437,7 +1437,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
1437
1437
|
if (!bg) {
|
|
1438
1438
|
return {
|
|
1439
1439
|
content: [{ type: "text" as const, text: `Error: No process found with id '${params.id}'` }],
|
|
1440
|
-
isError: true,
|
|
1440
|
+
isError: true, details: undefined as unknown,
|
|
1441
1441
|
};
|
|
1442
1442
|
}
|
|
1443
1443
|
|
|
@@ -1472,13 +1472,13 @@ export default function (pi: ExtensionAPI) {
|
|
|
1472
1472
|
if (!params.id) {
|
|
1473
1473
|
return {
|
|
1474
1474
|
content: [{ type: "text" as const, text: "Error: 'id' is required for send" }],
|
|
1475
|
-
isError: true,
|
|
1475
|
+
isError: true, details: undefined as unknown,
|
|
1476
1476
|
};
|
|
1477
1477
|
}
|
|
1478
1478
|
if (params.input === undefined) {
|
|
1479
1479
|
return {
|
|
1480
1480
|
content: [{ type: "text" as const, text: "Error: 'input' is required for send" }],
|
|
1481
|
-
isError: true,
|
|
1481
|
+
isError: true, details: undefined as unknown,
|
|
1482
1482
|
};
|
|
1483
1483
|
}
|
|
1484
1484
|
|
|
@@ -1486,14 +1486,14 @@ export default function (pi: ExtensionAPI) {
|
|
|
1486
1486
|
if (!bg) {
|
|
1487
1487
|
return {
|
|
1488
1488
|
content: [{ type: "text" as const, text: `Error: No process found with id '${params.id}'` }],
|
|
1489
|
-
isError: true,
|
|
1489
|
+
isError: true, details: undefined as unknown,
|
|
1490
1490
|
};
|
|
1491
1491
|
}
|
|
1492
1492
|
|
|
1493
1493
|
if (!bg.alive) {
|
|
1494
1494
|
return {
|
|
1495
1495
|
content: [{ type: "text" as const, text: `Error: Process ${params.id} has already exited` }],
|
|
1496
|
-
isError: true,
|
|
1496
|
+
isError: true, details: undefined as unknown,
|
|
1497
1497
|
};
|
|
1498
1498
|
}
|
|
1499
1499
|
|
|
@@ -1506,7 +1506,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
1506
1506
|
} catch (err) {
|
|
1507
1507
|
return {
|
|
1508
1508
|
content: [{ type: "text" as const, text: `Error writing to stdin: ${err instanceof Error ? err.message : String(err)}` }],
|
|
1509
|
-
isError: true,
|
|
1509
|
+
isError: true, details: undefined as unknown,
|
|
1510
1510
|
};
|
|
1511
1511
|
}
|
|
1512
1512
|
}
|
|
@@ -1516,19 +1516,19 @@ export default function (pi: ExtensionAPI) {
|
|
|
1516
1516
|
if (!params.id) {
|
|
1517
1517
|
return {
|
|
1518
1518
|
content: [{ type: "text" as const, text: "Error: 'id' is required for send_and_wait" }],
|
|
1519
|
-
isError: true,
|
|
1519
|
+
isError: true, details: undefined as unknown,
|
|
1520
1520
|
};
|
|
1521
1521
|
}
|
|
1522
1522
|
if (params.input === undefined) {
|
|
1523
1523
|
return {
|
|
1524
1524
|
content: [{ type: "text" as const, text: "Error: 'input' is required for send_and_wait" }],
|
|
1525
|
-
isError: true,
|
|
1525
|
+
isError: true, details: undefined as unknown,
|
|
1526
1526
|
};
|
|
1527
1527
|
}
|
|
1528
1528
|
if (!params.wait_pattern) {
|
|
1529
1529
|
return {
|
|
1530
1530
|
content: [{ type: "text" as const, text: "Error: 'wait_pattern' is required for send_and_wait" }],
|
|
1531
|
-
isError: true,
|
|
1531
|
+
isError: true, details: undefined as unknown,
|
|
1532
1532
|
};
|
|
1533
1533
|
}
|
|
1534
1534
|
|
|
@@ -1536,14 +1536,14 @@ export default function (pi: ExtensionAPI) {
|
|
|
1536
1536
|
if (!bg) {
|
|
1537
1537
|
return {
|
|
1538
1538
|
content: [{ type: "text" as const, text: `Error: No process found with id '${params.id}'` }],
|
|
1539
|
-
isError: true,
|
|
1539
|
+
isError: true, details: undefined as unknown,
|
|
1540
1540
|
};
|
|
1541
1541
|
}
|
|
1542
1542
|
|
|
1543
1543
|
if (!bg.alive) {
|
|
1544
1544
|
return {
|
|
1545
1545
|
content: [{ type: "text" as const, text: `Error: Process ${params.id} has already exited` }],
|
|
1546
|
-
isError: true,
|
|
1546
|
+
isError: true, details: undefined as unknown,
|
|
1547
1547
|
};
|
|
1548
1548
|
}
|
|
1549
1549
|
|
|
@@ -1568,7 +1568,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
1568
1568
|
if (!params.id) {
|
|
1569
1569
|
return {
|
|
1570
1570
|
content: [{ type: "text" as const, text: "Error: 'id' is required for signal" }],
|
|
1571
|
-
isError: true,
|
|
1571
|
+
isError: true, details: undefined as unknown,
|
|
1572
1572
|
};
|
|
1573
1573
|
}
|
|
1574
1574
|
|
|
@@ -1576,7 +1576,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
1576
1576
|
if (!bg) {
|
|
1577
1577
|
return {
|
|
1578
1578
|
content: [{ type: "text" as const, text: `Error: No process found with id '${params.id}'` }],
|
|
1579
|
-
isError: true,
|
|
1579
|
+
isError: true, details: undefined as unknown,
|
|
1580
1580
|
};
|
|
1581
1581
|
}
|
|
1582
1582
|
|
|
@@ -1621,7 +1621,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
1621
1621
|
if (!params.id) {
|
|
1622
1622
|
return {
|
|
1623
1623
|
content: [{ type: "text" as const, text: "Error: 'id' is required for kill" }],
|
|
1624
|
-
isError: true,
|
|
1624
|
+
isError: true, details: undefined as unknown,
|
|
1625
1625
|
};
|
|
1626
1626
|
}
|
|
1627
1627
|
|
|
@@ -1629,7 +1629,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
1629
1629
|
if (!bg) {
|
|
1630
1630
|
return {
|
|
1631
1631
|
content: [{ type: "text" as const, text: `Error: No process found with id '${params.id}'` }],
|
|
1632
|
-
isError: true,
|
|
1632
|
+
isError: true, details: undefined as unknown,
|
|
1633
1633
|
};
|
|
1634
1634
|
}
|
|
1635
1635
|
|
|
@@ -1657,7 +1657,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
1657
1657
|
if (!params.id) {
|
|
1658
1658
|
return {
|
|
1659
1659
|
content: [{ type: "text" as const, text: "Error: 'id' is required for restart" }],
|
|
1660
|
-
isError: true,
|
|
1660
|
+
isError: true, details: undefined as unknown,
|
|
1661
1661
|
};
|
|
1662
1662
|
}
|
|
1663
1663
|
|
|
@@ -1665,7 +1665,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
1665
1665
|
if (!newBg) {
|
|
1666
1666
|
return {
|
|
1667
1667
|
content: [{ type: "text" as const, text: `Error: No process found with id '${params.id}'` }],
|
|
1668
|
-
isError: true,
|
|
1668
|
+
isError: true, details: undefined as unknown,
|
|
1669
1669
|
};
|
|
1670
1670
|
}
|
|
1671
1671
|
|
|
@@ -1732,7 +1732,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
1732
1732
|
default:
|
|
1733
1733
|
return {
|
|
1734
1734
|
content: [{ type: "text" as const, text: `Unknown action: ${params.action}` }],
|
|
1735
|
-
isError: true,
|
|
1735
|
+
isError: true, details: undefined as unknown,
|
|
1736
1736
|
};
|
|
1737
1737
|
}
|
|
1738
1738
|
},
|
|
@@ -1760,7 +1760,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
1760
1760
|
|
|
1761
1761
|
const action = details.action as string;
|
|
1762
1762
|
|
|
1763
|
-
if (result.isError) {
|
|
1763
|
+
if ((result as any).isError) {
|
|
1764
1764
|
const text = result.content[0];
|
|
1765
1765
|
return new Text(
|
|
1766
1766
|
theme.fg("error", text?.type === "text" ? text.text : "Error"),
|
|
@@ -2338,17 +2338,14 @@ export default function (pi: ExtensionAPI) {
|
|
|
2338
2338
|
}, 2000);
|
|
2339
2339
|
|
|
2340
2340
|
// Refresh widget after agent actions and session events
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
refreshWidget();
|
|
2350
|
-
});
|
|
2351
|
-
}
|
|
2341
|
+
const refreshHandler = async (_event: unknown, ctx: ExtensionContext) => {
|
|
2342
|
+
latestCtx = ctx;
|
|
2343
|
+
refreshWidget();
|
|
2344
|
+
};
|
|
2345
|
+
pi.on("turn_end", refreshHandler as any);
|
|
2346
|
+
pi.on("agent_end", refreshHandler as any);
|
|
2347
|
+
pi.on("session_start", refreshHandler as any);
|
|
2348
|
+
pi.on("session_switch", refreshHandler as any);
|
|
2352
2349
|
|
|
2353
2350
|
pi.on("tool_execution_end", async (_event, ctx) => {
|
|
2354
2351
|
latestCtx = ctx;
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type declarations for core.js — runtime-neutral helper logic for browser-tools.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
export interface ActionTimeline {
|
|
6
|
+
limit: number;
|
|
7
|
+
nextId: number;
|
|
8
|
+
entries: ActionEntry[];
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface ActionEntry {
|
|
12
|
+
id: number;
|
|
13
|
+
tool: string;
|
|
14
|
+
paramsSummary: string;
|
|
15
|
+
startedAt: number;
|
|
16
|
+
finishedAt: number | null;
|
|
17
|
+
status: string;
|
|
18
|
+
beforeUrl: string;
|
|
19
|
+
afterUrl: string;
|
|
20
|
+
verificationSummary?: string;
|
|
21
|
+
warningSummary?: string;
|
|
22
|
+
diffSummary?: string;
|
|
23
|
+
changed?: boolean;
|
|
24
|
+
error?: string;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface ActionPartial {
|
|
28
|
+
tool: string;
|
|
29
|
+
paramsSummary?: string;
|
|
30
|
+
startedAt?: number;
|
|
31
|
+
beforeUrl?: string;
|
|
32
|
+
afterUrl?: string;
|
|
33
|
+
verificationSummary?: string;
|
|
34
|
+
warningSummary?: string;
|
|
35
|
+
diffSummary?: string;
|
|
36
|
+
changed?: boolean;
|
|
37
|
+
error?: string;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export interface ActionUpdates {
|
|
41
|
+
finishedAt?: number;
|
|
42
|
+
status?: string;
|
|
43
|
+
afterUrl?: string;
|
|
44
|
+
verificationSummary?: string;
|
|
45
|
+
warningSummary?: string;
|
|
46
|
+
diffSummary?: string;
|
|
47
|
+
changed?: boolean;
|
|
48
|
+
error?: string;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export interface DiffResult {
|
|
52
|
+
changed: boolean;
|
|
53
|
+
changes: Array<{ type: string; before: unknown; after: unknown }>;
|
|
54
|
+
summary: string;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export interface Threshold {
|
|
58
|
+
op: string;
|
|
59
|
+
n: number;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export interface PageRegistry {
|
|
63
|
+
pages: PageEntry[];
|
|
64
|
+
activePageId: number | null;
|
|
65
|
+
nextId: number;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export interface PageEntry {
|
|
69
|
+
id: number;
|
|
70
|
+
page: any;
|
|
71
|
+
title: string;
|
|
72
|
+
url: string;
|
|
73
|
+
opener: number | null;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export interface PageListEntry {
|
|
77
|
+
id: number;
|
|
78
|
+
title: string;
|
|
79
|
+
url: string;
|
|
80
|
+
opener: number | null;
|
|
81
|
+
isActive: boolean;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export interface SnapshotModeConfig {
|
|
85
|
+
tags: string[];
|
|
86
|
+
roles: string[];
|
|
87
|
+
selectors: string[];
|
|
88
|
+
ariaAttributes: string[];
|
|
89
|
+
useInteractiveFilter: boolean;
|
|
90
|
+
visibleOnly?: boolean;
|
|
91
|
+
containerExpand?: boolean;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export interface AssertionCheckResult {
|
|
95
|
+
name: string;
|
|
96
|
+
passed: boolean;
|
|
97
|
+
actual: unknown;
|
|
98
|
+
expected: unknown;
|
|
99
|
+
selector?: string;
|
|
100
|
+
text?: string;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export interface AssertionEvaluation {
|
|
104
|
+
verified: boolean;
|
|
105
|
+
checks: AssertionCheckResult[];
|
|
106
|
+
summary: string;
|
|
107
|
+
agentHint: string;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export interface WaitValidationError {
|
|
111
|
+
error: string;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export interface BatchStepResult {
|
|
115
|
+
ok: boolean;
|
|
116
|
+
stopReason: string | null;
|
|
117
|
+
failedStepIndex: number | null;
|
|
118
|
+
stepResults: unknown[];
|
|
119
|
+
summary: string;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export interface FormattedTimeline {
|
|
123
|
+
entries: Array<{
|
|
124
|
+
id: number | null;
|
|
125
|
+
tool: string;
|
|
126
|
+
status: string;
|
|
127
|
+
durationMs: number | null;
|
|
128
|
+
beforeUrl: string;
|
|
129
|
+
afterUrl: string;
|
|
130
|
+
line: string;
|
|
131
|
+
}>;
|
|
132
|
+
retained: number;
|
|
133
|
+
totalRecorded: number;
|
|
134
|
+
bounded: boolean;
|
|
135
|
+
summary: string;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
export interface FailureHypothesis {
|
|
139
|
+
hasFailures: boolean;
|
|
140
|
+
categories: string[];
|
|
141
|
+
summary: string;
|
|
142
|
+
signals: Array<{ category: string; source: string; detail: string }>;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
export interface SessionSummary {
|
|
146
|
+
counts: {
|
|
147
|
+
pages: number;
|
|
148
|
+
actions: { total: number; retained: number; success: number; error: number; running: number };
|
|
149
|
+
waits: { total: number; success: number; error: number; running: number };
|
|
150
|
+
assertions: { total: number; passed: number; failed: number; running: number };
|
|
151
|
+
consoleErrors: number;
|
|
152
|
+
failedRequests: number;
|
|
153
|
+
dialogs: number;
|
|
154
|
+
};
|
|
155
|
+
activePage: { id: number | null; title: string; url: string } | null;
|
|
156
|
+
caveats: string[];
|
|
157
|
+
failureHypothesis: FailureHypothesis;
|
|
158
|
+
summary: string;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
export function createActionTimeline(limit?: number): ActionTimeline;
|
|
162
|
+
export function beginAction(timeline: ActionTimeline, partial: ActionPartial): ActionEntry;
|
|
163
|
+
export function finishAction(timeline: ActionTimeline, actionId: number, updates?: ActionUpdates): ActionEntry | null;
|
|
164
|
+
export function findAction(timeline: ActionTimeline, actionId: number): ActionEntry | null;
|
|
165
|
+
export function toActionParamsSummary(params: unknown): string;
|
|
166
|
+
export function diffCompactStates(before: unknown, after: unknown): DiffResult;
|
|
167
|
+
export function includesNeedle(haystack: string, needle: string): boolean;
|
|
168
|
+
export function parseThreshold(value: string | null | undefined): Threshold | null;
|
|
169
|
+
export function meetsThreshold(count: number, threshold: Threshold): boolean;
|
|
170
|
+
export function getEntriesSince(
|
|
171
|
+
entries: Array<{ timestamp?: number }>,
|
|
172
|
+
sinceActionId: number | undefined,
|
|
173
|
+
timeline: ActionTimeline,
|
|
174
|
+
): unknown[];
|
|
175
|
+
export function evaluateAssertionChecks(args: { checks: unknown[]; state: unknown }): AssertionEvaluation;
|
|
176
|
+
export function validateWaitParams(params: { condition: string; value?: string; threshold?: string }): WaitValidationError | null;
|
|
177
|
+
export function createRegionStableScript(selector: string): string;
|
|
178
|
+
export function createPageRegistry(): PageRegistry;
|
|
179
|
+
export function registryAddPage(
|
|
180
|
+
registry: PageRegistry,
|
|
181
|
+
info: { page: unknown; title?: string; url?: string; opener?: number | null },
|
|
182
|
+
): PageEntry;
|
|
183
|
+
export function registryRemovePage(registry: PageRegistry, pageId: number): { removed: PageEntry; newActiveId: number | null };
|
|
184
|
+
export function registrySetActive(registry: PageRegistry, pageId: number): void;
|
|
185
|
+
export function registryGetActive(registry: PageRegistry): PageEntry;
|
|
186
|
+
export function registryGetPage(registry: PageRegistry, pageId: number): PageEntry | null;
|
|
187
|
+
export function registryListPages(registry: PageRegistry): PageListEntry[];
|
|
188
|
+
export function createBoundedLogPusher(maxSize: number): (array: unknown[], entry: unknown) => void;
|
|
189
|
+
export function runBatchSteps(args: {
|
|
190
|
+
steps: unknown[];
|
|
191
|
+
executeStep: (step: unknown, index: number) => Promise<{ ok: boolean; [key: string]: unknown }>;
|
|
192
|
+
stopOnFailure?: boolean;
|
|
193
|
+
}): Promise<BatchStepResult>;
|
|
194
|
+
|
|
195
|
+
export declare const SNAPSHOT_MODES: Record<string, SnapshotModeConfig>;
|
|
196
|
+
export function getSnapshotModeConfig(mode: string): SnapshotModeConfig | null;
|
|
197
|
+
export function computeContentHash(text: string): string;
|
|
198
|
+
export function computeStructuralSignature(tag: string, role: string, childTags: string[]): string;
|
|
199
|
+
export function matchFingerprint(
|
|
200
|
+
stored: { contentHash?: string; structuralSignature?: string },
|
|
201
|
+
candidate: { contentHash?: string; structuralSignature?: string },
|
|
202
|
+
): boolean;
|
|
203
|
+
export function formatTimelineEntries(entries?: unknown[], options?: Record<string, unknown>): FormattedTimeline;
|
|
204
|
+
export function buildFailureHypothesis(session?: Record<string, unknown>): FailureHypothesis;
|
|
205
|
+
export function summarizeBrowserSession(session?: Record<string, unknown>): SessionSummary;
|
|
@@ -28,11 +28,11 @@ export default function (pi: ExtensionAPI) {
|
|
|
28
28
|
parseRef: u.parseRef, formatVersionedRef: u.formatVersionedRef, staleRefGuidance: u.staleRefGuidance,
|
|
29
29
|
beginTrackedAction: u.beginTrackedAction, finishTrackedAction: u.finishTrackedAction,
|
|
30
30
|
truncateText: u.truncateText, verificationFromChecks: u.verificationFromChecks,
|
|
31
|
-
verificationLine: u.verificationLine, collectAssertionState: u.collectAssertionState,
|
|
31
|
+
verificationLine: u.verificationLine, collectAssertionState: (p, checks, target?) => u.collectAssertionState(p, checks, captureCompactPageState, target),
|
|
32
32
|
formatAssertionText: u.formatAssertionText, formatDiffText: u.formatDiffText,
|
|
33
33
|
getUrlHash: u.getUrlHash,
|
|
34
34
|
captureClickTargetState: u.captureClickTargetState, readInputLikeValue: u.readInputLikeValue,
|
|
35
|
-
firstErrorLine: u.firstErrorLine, captureAccessibilityMarkdown: u.captureAccessibilityMarkdown,
|
|
35
|
+
firstErrorLine: u.firstErrorLine, captureAccessibilityMarkdown: (selector?) => u.captureAccessibilityMarkdown(getActiveTarget(), selector),
|
|
36
36
|
resolveAccessibilityScope: u.resolveAccessibilityScope,
|
|
37
37
|
getLivePagesSnapshot: u.createGetLivePagesSnapshot(ensureBrowser),
|
|
38
38
|
getSinceTimestamp: u.getSinceTimestamp, getConsoleEntriesSince: u.getConsoleEntriesSince,
|
|
@@ -124,7 +124,7 @@ export async function buildRefSnapshot(
|
|
|
124
124
|
sib = sib.previousElementSibling;
|
|
125
125
|
}
|
|
126
126
|
// Check if the parent itself is a heading (unlikely but possible)
|
|
127
|
-
const parent = current.parentElement;
|
|
127
|
+
const parent: Element | null = current.parentElement;
|
|
128
128
|
if (parent && (headingTags.has(parent.tagName) || parent.getAttribute("role") === "heading")) {
|
|
129
129
|
return (parent.textContent || "").trim().replace(/\s+/g, " ").slice(0, 80);
|
|
130
130
|
}
|
|
@@ -379,7 +379,7 @@ export function registerSessionTools(pi: ExtensionAPI, deps: ToolDeps): void {
|
|
|
379
379
|
console: consoleLogs.length,
|
|
380
380
|
network: networkLogs.length,
|
|
381
381
|
dialog: dialogLogs.length,
|
|
382
|
-
actions: timeline.
|
|
382
|
+
actions: timeline.retained,
|
|
383
383
|
pages: pages.length,
|
|
384
384
|
},
|
|
385
385
|
elapsedMs: Date.now() - startedAt,
|
|
@@ -233,7 +233,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
233
233
|
renderResult(result, { isPartial }, theme) {
|
|
234
234
|
const d = result.details as ResolveDetails | undefined;
|
|
235
235
|
if (isPartial) return new Text(theme.fg("warning", "Searching Context7..."), 0, 0);
|
|
236
|
-
if (result.isError || d?.error) {
|
|
236
|
+
if ((result as any).isError || d?.error) {
|
|
237
237
|
return new Text(theme.fg("error", `Error: ${d?.error ?? "unknown"}`), 0, 0);
|
|
238
238
|
}
|
|
239
239
|
let text = theme.fg("success", `${d?.resultCount ?? 0} ${d?.resultCount === 1 ? "library" : "libraries"} found`);
|
|
@@ -388,7 +388,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
388
388
|
const d = result.details as DocsDetails | undefined;
|
|
389
389
|
|
|
390
390
|
if (isPartial) return new Text(theme.fg("warning", "Fetching documentation..."), 0, 0);
|
|
391
|
-
if (result.isError || d?.error) {
|
|
391
|
+
if ((result as any).isError || d?.error) {
|
|
392
392
|
return new Text(theme.fg("error", `Error: ${d?.error ?? "unknown"}`), 0, 0);
|
|
393
393
|
}
|
|
394
394
|
|