@oh-my-pi/pi-coding-agent 16.1.22 → 16.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/CHANGELOG.md +99 -1
- package/dist/cli.js +4387 -4164
- package/dist/types/advisor/__tests__/emission-guard.test.d.ts +1 -0
- package/dist/types/advisor/emission-guard.d.ts +73 -0
- package/dist/types/advisor/index.d.ts +1 -0
- package/dist/types/advisor/runtime.d.ts +7 -0
- package/dist/types/advisor/watchdog.d.ts +2 -0
- package/dist/types/cli/flag-tables.d.ts +1 -0
- package/dist/types/cli/gallery-fixtures/search.d.ts +1 -1
- package/dist/types/cli/gc-cli.d.ts +58 -0
- package/dist/types/collab/display-name.d.ts +3 -0
- package/dist/types/collab/host.d.ts +0 -2
- package/dist/types/commands/gc.d.ts +37 -0
- package/dist/types/commands/worktree.d.ts +0 -3
- package/dist/types/config/inline-tool-descriptors-mode.d.ts +13 -0
- package/dist/types/config/model-discovery.d.ts +6 -1
- package/dist/types/config/model-registry.d.ts +6 -2
- package/dist/types/config/model-resolver.d.ts +12 -0
- package/dist/types/config/models-config-schema.d.ts +29 -2
- package/dist/types/config/models-config.d.ts +22 -1
- package/dist/types/config/settings-schema.d.ts +145 -21
- package/dist/types/config/settings.d.ts +13 -0
- package/dist/types/dap/config.d.ts +1 -1
- package/dist/types/edit/hashline/filesystem.d.ts +4 -2
- package/dist/types/edit/renderer.d.ts +4 -0
- package/dist/types/extensibility/extensions/types.d.ts +17 -17
- package/dist/types/extensibility/hooks/types.d.ts +10 -10
- package/dist/types/extensibility/plugins/marketplace/types.d.ts +1 -0
- package/dist/types/internal-urls/__tests__/ssh-protocol.test.d.ts +1 -0
- package/dist/types/internal-urls/index.d.ts +1 -0
- package/dist/types/internal-urls/registry-helpers.d.ts +2 -0
- package/dist/types/internal-urls/router.d.ts +1 -1
- package/dist/types/internal-urls/ssh-protocol.d.ts +10 -0
- package/dist/types/internal-urls/types.d.ts +19 -2
- package/dist/types/irc/bus.d.ts +6 -0
- package/dist/types/mcp/transports/stdio.d.ts +25 -1
- package/dist/types/modes/components/__tests__/move-overlay.test.d.ts +1 -0
- package/dist/types/modes/components/custom-editor.d.ts +7 -0
- package/dist/types/modes/components/move-overlay.d.ts +23 -0
- package/dist/types/modes/components/plugin-selector.d.ts +2 -1
- package/dist/types/modes/components/queue-mode-selector.d.ts +2 -1
- package/dist/types/modes/components/select-list-mouse-routing.d.ts +2 -0
- package/dist/types/modes/components/settings-defs.d.ts +4 -1
- package/dist/types/modes/components/settings-selector.d.ts +2 -0
- package/dist/types/modes/components/show-images-selector.d.ts +2 -1
- package/dist/types/modes/components/status-line/component.d.ts +2 -0
- package/dist/types/modes/components/status-line/types.d.ts +2 -0
- package/dist/types/modes/components/theme-selector.d.ts +2 -1
- package/dist/types/modes/components/thinking-selector.d.ts +2 -1
- package/dist/types/modes/controllers/command-controller.d.ts +10 -1
- package/dist/types/modes/controllers/streaming-reveal.d.ts +6 -0
- package/dist/types/modes/interactive-mode.d.ts +10 -1
- package/dist/types/modes/internal-url-autocomplete.d.ts +1 -1
- package/dist/types/modes/running-subagent-badge.d.ts +6 -0
- package/dist/types/modes/theme/mermaid-rendering.test.d.ts +1 -0
- package/dist/types/modes/theme/theme.d.ts +2 -1
- package/dist/types/modes/types.d.ts +9 -1
- package/dist/types/sdk.d.ts +2 -2
- package/dist/types/session/agent-session.d.ts +2 -1
- package/dist/types/session/session-listing.d.ts +10 -1
- package/dist/types/session/session-manager.d.ts +13 -0
- package/dist/types/slash-commands/builtin-registry.d.ts +1 -1
- package/dist/types/ssh/__tests__/connection-manager-args.test.d.ts +1 -0
- package/dist/types/ssh/__tests__/file-transfer-posix-guard.test.d.ts +1 -0
- package/dist/types/ssh/connection-manager.d.ts +2 -0
- package/dist/types/ssh/file-transfer.d.ts +79 -0
- package/dist/types/ssh/utils.d.ts +6 -0
- package/dist/types/system-prompt.d.ts +5 -0
- package/dist/types/task/executor.d.ts +16 -0
- package/dist/types/tiny/text.d.ts +1 -1
- package/dist/types/tools/builtin-names.d.ts +5 -1
- package/dist/types/tools/{find.d.ts → glob.d.ts} +15 -15
- package/dist/types/tools/{search.d.ts → grep.d.ts} +14 -14
- package/dist/types/tools/index.d.ts +3 -3
- package/dist/types/tools/path-utils.d.ts +29 -0
- package/dist/types/tools/plan-mode-guard.d.ts +7 -0
- package/dist/types/tools/read.d.ts +2 -2
- package/dist/types/tools/render-utils.d.ts +8 -0
- package/dist/types/tools/renderers.d.ts +11 -0
- package/dist/types/tools/ssh.d.ts +2 -0
- package/dist/types/tools/todo.d.ts +0 -16
- package/dist/types/tools/write.d.ts +2 -2
- package/dist/types/utils/active-repo-context.d.ts +8 -0
- package/dist/types/utils/image-resize.d.ts +1 -0
- package/dist/types/utils/markit-cache.d.ts +23 -0
- package/dist/types/utils/markit.d.ts +5 -1
- package/dist/types/utils/prompt-path.d.ts +1 -0
- package/dist/types/web/search/providers/duckduckgo.d.ts +14 -0
- package/dist/types/web/search/providers/firecrawl.d.ts +28 -0
- package/dist/types/web/search/providers/tinyfish.d.ts +29 -0
- package/dist/types/web/search/providers/xai.d.ts +13 -0
- package/dist/types/web/search/types.d.ts +18 -2
- package/package.json +30 -15
- package/scripts/bench-guard.ts +1 -1
- package/scripts/build-binary.ts +9 -9
- package/scripts/bundle-dist.ts +2 -2
- package/src/advisor/__tests__/advisor.test.ts +40 -4
- package/src/advisor/__tests__/emission-guard.test.ts +147 -0
- package/src/advisor/advise-tool.ts +1 -1
- package/src/advisor/emission-guard.ts +172 -0
- package/src/advisor/index.ts +1 -0
- package/src/advisor/runtime.ts +11 -0
- package/src/advisor/watchdog.ts +12 -1
- package/src/cli/args.ts +5 -2
- package/src/cli/auth-broker-cli.ts +17 -0
- package/src/cli/config-cli.ts +4 -0
- package/src/cli/flag-tables.ts +7 -4
- package/src/cli/gallery-cli.ts +14 -2
- package/src/cli/gallery-fixtures/edit.ts +60 -0
- package/src/cli/gallery-fixtures/fs.ts +17 -17
- package/src/cli/gallery-fixtures/search.ts +4 -4
- package/src/cli/gc-cli.ts +939 -0
- package/src/cli/usage-cli.ts +20 -1
- package/src/cli/web-search-cli.ts +1 -1
- package/src/cli-commands.ts +1 -0
- package/src/collab/display-name.ts +13 -0
- package/src/collab/guest.ts +5 -1
- package/src/collab/host.ts +2 -13
- package/src/commands/gc.ts +46 -0
- package/src/commands/worktree.ts +6 -0
- package/src/config/inline-tool-descriptors-mode.ts +27 -0
- package/src/config/model-discovery.ts +77 -8
- package/src/config/model-registry.ts +89 -11
- package/src/config/model-resolver.ts +39 -1
- package/src/config/models-config-schema.ts +41 -5
- package/src/config/models-config.ts +4 -1
- package/src/config/settings-schema.ts +130 -27
- package/src/config/settings.ts +216 -7
- package/src/cursor.ts +1 -1
- package/src/dap/config.ts +152 -8
- package/src/dap/session.ts +1 -1
- package/src/discovery/helpers.ts +3 -1
- package/src/edit/hashline/diff.ts +14 -3
- package/src/edit/hashline/execute.ts +42 -6
- package/src/edit/hashline/filesystem.ts +49 -8
- package/src/edit/index.ts +1 -0
- package/src/edit/modes/patch.ts +11 -1
- package/src/edit/renderer.ts +140 -13
- package/src/eval/__tests__/agent-bridge.test.ts +101 -0
- package/src/eval/__tests__/julia-prelude.test.ts +18 -0
- package/src/eval/agent-bridge.ts +26 -3
- package/src/eval/jl/runner.jl +7 -1
- package/src/eval/js/tool-bridge.ts +2 -2
- package/src/export/html/index.ts +1 -1
- package/src/export/html/template.js +3 -1
- package/src/export/html/tool-views.generated.js +20 -20
- package/src/extensibility/extensions/types.ts +22 -22
- package/src/extensibility/hooks/types.ts +11 -11
- package/src/extensibility/plugins/legacy-pi-bundled-keys.ts +10 -3
- package/src/extensibility/plugins/legacy-pi-bundled-registry.ts +31 -10
- package/src/extensibility/plugins/marketplace/manager.ts +22 -0
- package/src/extensibility/plugins/marketplace/types.ts +1 -0
- package/src/internal-urls/__tests__/ssh-protocol.test.ts +331 -0
- package/src/internal-urls/docs-index.generated.txt +2 -2
- package/src/internal-urls/docs-index.ts +2 -3
- package/src/internal-urls/index.ts +1 -0
- package/src/internal-urls/registry-helpers.ts +19 -4
- package/src/internal-urls/router.ts +5 -3
- package/src/internal-urls/ssh-protocol.ts +367 -0
- package/src/internal-urls/types.ts +19 -2
- package/src/irc/bus.ts +11 -3
- package/src/lsp/index.ts +8 -1
- package/src/mcp/oauth-discovery.ts +20 -20
- package/src/mcp/tool-bridge.ts +32 -2
- package/src/mcp/transports/stdio.test.ts +20 -3
- package/src/mcp/transports/stdio.ts +45 -14
- package/src/memories/index.ts +1 -1
- package/src/modes/acp/acp-event-mapper.ts +2 -2
- package/src/modes/components/__tests__/move-overlay.test.ts +166 -0
- package/src/modes/components/agent-hub.ts +3 -0
- package/src/modes/components/agent-transcript-viewer.ts +9 -7
- package/src/modes/components/custom-editor.ts +90 -5
- package/src/modes/components/move-overlay.ts +282 -0
- package/src/modes/components/plan-review-overlay.ts +35 -35
- package/src/modes/components/plugin-selector.ts +6 -1
- package/src/modes/components/queue-mode-selector.ts +6 -1
- package/src/modes/components/select-list-mouse-routing.ts +35 -0
- package/src/modes/components/session-selector.ts +11 -10
- package/src/modes/components/settings-defs.ts +14 -1
- package/src/modes/components/settings-selector.ts +196 -29
- package/src/modes/components/show-images-selector.ts +6 -1
- package/src/modes/components/status-line/component.ts +108 -28
- package/src/modes/components/status-line/segments.ts +5 -1
- package/src/modes/components/status-line/types.ts +2 -0
- package/src/modes/components/theme-selector.ts +6 -1
- package/src/modes/components/thinking-selector.ts +6 -1
- package/src/modes/components/tool-execution.ts +25 -9
- package/src/modes/components/tree-selector.ts +5 -5
- package/src/modes/controllers/command-controller.ts +140 -47
- package/src/modes/controllers/event-controller.ts +59 -3
- package/src/modes/controllers/input-controller.ts +70 -4
- package/src/modes/controllers/selector-controller.ts +15 -2
- package/src/modes/controllers/streaming-reveal.ts +17 -0
- package/src/modes/controllers/tool-args-reveal.ts +1 -1
- package/src/modes/interactive-mode.ts +142 -59
- package/src/modes/internal-url-autocomplete.ts +17 -2
- package/src/modes/prompt-action-autocomplete.ts +3 -1
- package/src/modes/running-subagent-badge.ts +13 -0
- package/src/modes/setup-wizard/scenes/glyph.ts +2 -13
- package/src/modes/setup-wizard/scenes/providers.ts +2 -1
- package/src/modes/setup-wizard/scenes/theme.ts +6 -12
- package/src/modes/setup-wizard/scenes/web-search.ts +8 -13
- package/src/modes/setup-wizard/wizard-overlay.ts +6 -5
- package/src/modes/theme/mermaid-rendering.test.ts +53 -0
- package/src/modes/theme/theme.ts +42 -15
- package/src/modes/types.ts +9 -1
- package/src/modes/utils/interactive-context-helpers.ts +1 -1
- package/src/priority.json +15 -0
- package/src/prompts/advisor/active-repo-watchdog.md +6 -0
- package/src/prompts/advisor/system.md +21 -7
- package/src/prompts/agents/designer.md +1 -1
- package/src/prompts/agents/explore.md +1 -1
- package/src/prompts/agents/librarian.md +2 -2
- package/src/prompts/agents/plan.md +2 -2
- package/src/prompts/agents/reviewer.md +1 -1
- package/src/prompts/agents/task.md +2 -2
- package/src/prompts/system/active-repo-context.md +4 -0
- package/src/prompts/system/gemini-tool-call-reminder.md +9 -0
- package/src/prompts/system/plan-mode-active.md +12 -3
- package/src/prompts/system/project-prompt.md +2 -2
- package/src/prompts/system/system-prompt.md +8 -6
- package/src/prompts/tools/bash.md +2 -2
- package/src/prompts/tools/checkpoint.md +1 -1
- package/src/prompts/tools/{find.md → glob.md} +1 -1
- package/src/prompts/tools/{search.md → grep.md} +3 -3
- package/src/prompts/tools/read.md +4 -2
- package/src/sdk.ts +98 -29
- package/src/session/agent-session.ts +828 -191
- package/src/session/session-history-format.ts +2 -2
- package/src/session/session-listing.ts +35 -2
- package/src/session/session-manager.ts +46 -0
- package/src/slash-commands/builtin-registry.ts +158 -22
- package/src/slash-commands/helpers/usage-report.ts +23 -2
- package/src/ssh/__tests__/connection-manager-args.test.ts +69 -0
- package/src/ssh/__tests__/file-transfer-posix-guard.test.ts +68 -0
- package/src/ssh/connection-manager.ts +12 -15
- package/src/ssh/file-transfer.ts +209 -0
- package/src/ssh/utils.ts +24 -0
- package/src/system-prompt.ts +60 -28
- package/src/task/executor.ts +96 -36
- package/src/task/index.ts +3 -3
- package/src/task/render.ts +14 -13
- package/src/task/worktree.ts +38 -1
- package/src/tiny/text.ts +49 -4
- package/src/tiny/worker.ts +3 -3
- package/src/tools/acp-bridge.ts +6 -1
- package/src/tools/bash.ts +2 -2
- package/src/tools/builtin-names.ts +26 -2
- package/src/tools/{find.ts → glob.ts} +48 -42
- package/src/tools/{search.ts → grep.ts} +311 -129
- package/src/tools/index.ts +13 -14
- package/src/tools/irc.ts +6 -2
- package/src/tools/path-utils.ts +64 -1
- package/src/tools/plan-mode-guard.ts +26 -13
- package/src/tools/read.ts +35 -6
- package/src/tools/render-utils.ts +14 -0
- package/src/tools/renderers.ts +15 -4
- package/src/tools/ssh.ts +17 -2
- package/src/tools/todo.ts +4 -26
- package/src/tools/write.ts +25 -9
- package/src/utils/active-repo-context.ts +143 -0
- package/src/utils/edit-mode.ts +19 -2
- package/src/utils/image-resize.ts +88 -7
- package/src/utils/lang-from-path.ts +3 -3
- package/src/utils/markit-cache.ts +166 -0
- package/src/utils/markit.ts +86 -18
- package/src/utils/prompt-path.ts +3 -0
- package/src/utils/shell-snapshot.ts +1 -1
- package/src/utils/title-generator.ts +1 -1
- package/src/web/search/provider.ts +54 -34
- package/src/web/search/providers/duckduckgo.ts +140 -0
- package/src/web/search/providers/firecrawl.ts +144 -0
- package/src/web/search/providers/tinyfish.ts +159 -0
- package/src/web/search/providers/xai.ts +292 -0
- package/src/web/search/providers/zai.ts +142 -56
- package/src/web/search/types.ts +6 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type SelectItem, SelectList, type SgrMouseEvent } from "@oh-my-pi/pi-tui";
|
|
1
|
+
import { routeSelectListMouse, type SelectItem, SelectList, type SgrMouseEvent } from "@oh-my-pi/pi-tui";
|
|
2
2
|
import { getSelectListTheme, type SymbolPreset, setSymbolPreset, theme } from "../../theme/theme";
|
|
3
3
|
import type { SetupScene, SetupSceneController, SetupSceneHost } from "./types";
|
|
4
4
|
|
|
@@ -65,18 +65,7 @@ class GlyphSceneController implements SetupSceneController {
|
|
|
65
65
|
/** Wheel moves the highlight (live preview); hover lights the row under the pointer; click confirms it. */
|
|
66
66
|
routeMouse(event: SgrMouseEvent, line: number, _col: number): void {
|
|
67
67
|
if (this.#committing) return;
|
|
68
|
-
|
|
69
|
-
this.#selectList.handleWheel(event.wheel);
|
|
70
|
-
return;
|
|
71
|
-
}
|
|
72
|
-
const index = this.#selectList.hitTest(line - this.#listRowStart);
|
|
73
|
-
if (event.motion) {
|
|
74
|
-
this.#selectList.setHoverIndex(index ?? null);
|
|
75
|
-
return;
|
|
76
|
-
}
|
|
77
|
-
if (event.leftClick && index !== undefined) {
|
|
78
|
-
this.#selectList.clickItem(index);
|
|
79
|
-
}
|
|
68
|
+
routeSelectListMouse(this.#selectList, event, line - this.#listRowStart);
|
|
80
69
|
}
|
|
81
70
|
|
|
82
71
|
render(width: number): readonly string[] {
|
|
@@ -74,7 +74,8 @@ class ProvidersSceneController implements SetupSceneController {
|
|
|
74
74
|
return;
|
|
75
75
|
}
|
|
76
76
|
if (event.motion) this.#tabBar.setHoverTab(null);
|
|
77
|
-
const
|
|
77
|
+
const spacerRowsAfterTabs = 1;
|
|
78
|
+
const bodyLine = line - this.#tabRowCount - spacerRowsAfterTabs;
|
|
78
79
|
if (tab.routeMouse) {
|
|
79
80
|
tab.routeMouse(event, bodyLine, col);
|
|
80
81
|
return;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
padding,
|
|
3
|
+
routeSelectListMouse,
|
|
3
4
|
type SelectItem,
|
|
4
5
|
SelectList,
|
|
5
6
|
type SgrMouseEvent,
|
|
@@ -128,18 +129,11 @@ class ThemeSceneController implements SetupSceneController {
|
|
|
128
129
|
|
|
129
130
|
/** Wheel moves the highlight (live preview); hover lights the row under the pointer; click confirms it. */
|
|
130
131
|
routeMouse(event: SgrMouseEvent, line: number, _col: number): void {
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
if (event.motion) {
|
|
137
|
-
this.#selectList.setHoverIndex(index ?? null);
|
|
138
|
-
return;
|
|
139
|
-
}
|
|
140
|
-
if (event.leftClick && index !== undefined) {
|
|
141
|
-
this.#selectList.clickItem(index);
|
|
142
|
-
}
|
|
132
|
+
// Mirror the pre-helper flow: wheel/motion are always processed, but a
|
|
133
|
+
// hidden list (#listRowStart < 0, e.g. while loading all themes) must
|
|
134
|
+
// never hit-test a row — route through a line that resolves to undefined.
|
|
135
|
+
const listLine = this.#listRowStart >= 0 ? line - this.#listRowStart : Number.NEGATIVE_INFINITY;
|
|
136
|
+
routeSelectListMouse(this.#selectList, event, listLine);
|
|
143
137
|
}
|
|
144
138
|
|
|
145
139
|
render(width: number): readonly string[] {
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
routeSelectListMouse,
|
|
3
|
+
type SelectItem,
|
|
4
|
+
SelectList,
|
|
5
|
+
type SgrMouseEvent,
|
|
6
|
+
truncateToWidth,
|
|
7
|
+
} from "@oh-my-pi/pi-tui";
|
|
2
8
|
import { SETTINGS_SCHEMA } from "../../../config/settings-schema";
|
|
3
9
|
import { getSearchProvider, setPreferredSearchProvider } from "../../../web/search/provider";
|
|
4
10
|
import { isSearchProviderPreference, type SearchProviderId } from "../../../web/search/types";
|
|
@@ -59,18 +65,7 @@ export class WebSearchTab implements SetupTab {
|
|
|
59
65
|
|
|
60
66
|
/** Wheel moves the highlight; hover lights the row under the pointer; click confirms it. */
|
|
61
67
|
routeMouse(event: SgrMouseEvent, line: number, _col: number): void {
|
|
62
|
-
|
|
63
|
-
this.#list.handleWheel(event.wheel);
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
66
|
-
const index = this.#list.hitTest(line - this.#listRowStart);
|
|
67
|
-
if (event.motion) {
|
|
68
|
-
this.#list.setHoverIndex(index ?? null);
|
|
69
|
-
return;
|
|
70
|
-
}
|
|
71
|
-
if (event.leftClick && index !== undefined) {
|
|
72
|
-
this.#list.clickItem(index);
|
|
73
|
-
}
|
|
68
|
+
routeSelectListMouse(this.#list, event, line - this.#listRowStart);
|
|
74
69
|
}
|
|
75
70
|
|
|
76
71
|
invalidate(): void {
|
|
@@ -3,7 +3,8 @@ import {
|
|
|
3
3
|
matchesKey,
|
|
4
4
|
type OverlayFocusOwner,
|
|
5
5
|
padding,
|
|
6
|
-
|
|
6
|
+
routeSgrMouseInput,
|
|
7
|
+
type SgrMouseEvent,
|
|
7
8
|
truncateToWidth,
|
|
8
9
|
visibleWidth,
|
|
9
10
|
} from "@oh-my-pi/pi-tui";
|
|
@@ -104,7 +105,9 @@ export class SetupWizardComponent implements Component, OverlayFocusOwner {
|
|
|
104
105
|
handleInput(data: string): void {
|
|
105
106
|
if (this.#phase === "done") return;
|
|
106
107
|
if (data.startsWith("\x1b[<")) {
|
|
107
|
-
|
|
108
|
+
routeSgrMouseInput(data, event => {
|
|
109
|
+
this.#routeMouseEvent(event);
|
|
110
|
+
});
|
|
108
111
|
return;
|
|
109
112
|
}
|
|
110
113
|
if (matchesKey(data, "ctrl+c")) {
|
|
@@ -146,9 +149,7 @@ export class SetupWizardComponent implements Component, OverlayFocusOwner {
|
|
|
146
149
|
* advances the splash/outro like Enter. Raw reports never reach scene
|
|
147
150
|
* keyboard input.
|
|
148
151
|
*/
|
|
149
|
-
#
|
|
150
|
-
const event = parseSgrMouse(data);
|
|
151
|
-
if (!event) return;
|
|
152
|
+
#routeMouseEvent(event: SgrMouseEvent): void {
|
|
152
153
|
if (this.#phase === "splash" || this.#phase === "outro") {
|
|
153
154
|
if (!event.leftClick) return;
|
|
154
155
|
if (this.#phase === "splash") this.#beginScene();
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { afterEach, beforeAll, describe, expect, it } from "bun:test";
|
|
2
|
+
import { Markdown } from "@oh-my-pi/pi-tui";
|
|
3
|
+
import { Settings } from "../../config/settings";
|
|
4
|
+
import { buildSystemPrompt } from "../../system-prompt";
|
|
5
|
+
import { getMarkdownTheme, getThemeByName, setMarkdownMermaidRendering, setThemeInstance } from "./theme";
|
|
6
|
+
|
|
7
|
+
const workspaceTree = {
|
|
8
|
+
rootPath: "/tmp/project",
|
|
9
|
+
rendered: "",
|
|
10
|
+
truncated: false,
|
|
11
|
+
totalLines: 0,
|
|
12
|
+
agentsMdFiles: [],
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
function stripAnsi(text: string): string {
|
|
16
|
+
return text.replace(/\x1b\[[0-9;]*m/g, "");
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
beforeAll(async () => {
|
|
20
|
+
await Settings.init({ inMemory: true });
|
|
21
|
+
const theme = await getThemeByName("dark");
|
|
22
|
+
if (!theme) throw new Error("theme unavailable");
|
|
23
|
+
setThemeInstance(theme);
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
afterEach(() => {
|
|
27
|
+
setMarkdownMermaidRendering(true);
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
describe("Mermaid rendering setting", () => {
|
|
31
|
+
it("removes the Mermaid prompt note when rendering is disabled", async () => {
|
|
32
|
+
const { systemPrompt } = await buildSystemPrompt({
|
|
33
|
+
renderMermaid: false,
|
|
34
|
+
contextFiles: [],
|
|
35
|
+
skills: [],
|
|
36
|
+
toolNames: [],
|
|
37
|
+
workspaceTree,
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
expect(systemPrompt.join("\n")).not.toContain("```mermaid");
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
it("falls back to a highlighted code fence when rendering is disabled", () => {
|
|
44
|
+
setMarkdownMermaidRendering(false);
|
|
45
|
+
|
|
46
|
+
const markdown = new Markdown("```mermaid\ngraph TD\n A --> B\n```", 0, 0, getMarkdownTheme());
|
|
47
|
+
const lines = stripAnsi(markdown.render(80).join("\n"));
|
|
48
|
+
|
|
49
|
+
expect(lines).toContain("```mermaid");
|
|
50
|
+
expect(lines).toContain("graph TD");
|
|
51
|
+
expect(lines).toContain("-->");
|
|
52
|
+
});
|
|
53
|
+
});
|
package/src/modes/theme/theme.ts
CHANGED
|
@@ -228,7 +228,9 @@ export type SymbolKey =
|
|
|
228
228
|
| "tool.review"
|
|
229
229
|
| "tool.inspectImage"
|
|
230
230
|
| "tool.goal"
|
|
231
|
-
| "tool.irc"
|
|
231
|
+
| "tool.irc"
|
|
232
|
+
| "tool.delete"
|
|
233
|
+
| "tool.move";
|
|
232
234
|
|
|
233
235
|
type SymbolMap = Record<SymbolKey, string>;
|
|
234
236
|
|
|
@@ -430,6 +432,8 @@ const UNICODE_SYMBOLS: SymbolMap = {
|
|
|
430
432
|
"tool.inspectImage": "🖼",
|
|
431
433
|
"tool.goal": "◎",
|
|
432
434
|
"tool.irc": "✉",
|
|
435
|
+
"tool.delete": "🗑",
|
|
436
|
+
"tool.move": "➜",
|
|
433
437
|
};
|
|
434
438
|
|
|
435
439
|
const NERD_SYMBOLS: SymbolMap = {
|
|
@@ -735,6 +739,8 @@ const NERD_SYMBOLS: SymbolMap = {
|
|
|
735
739
|
"tool.inspectImage": "\uEAEA",
|
|
736
740
|
"tool.goal": "\uEBF8",
|
|
737
741
|
"tool.irc": "\uF086",
|
|
742
|
+
"tool.delete": "\uf12d",
|
|
743
|
+
"tool.move": "\uf061",
|
|
738
744
|
};
|
|
739
745
|
|
|
740
746
|
const ASCII_SYMBOLS: SymbolMap = {
|
|
@@ -933,6 +939,8 @@ const ASCII_SYMBOLS: SymbolMap = {
|
|
|
933
939
|
"tool.inspectImage": "[i]",
|
|
934
940
|
"tool.goal": "(o)",
|
|
935
941
|
"tool.irc": "irc",
|
|
942
|
+
"tool.delete": "rm",
|
|
943
|
+
"tool.move": "mv",
|
|
936
944
|
};
|
|
937
945
|
|
|
938
946
|
const SYMBOL_PRESETS: Record<SymbolPreset, SymbolMap> = {
|
|
@@ -2824,23 +2832,36 @@ export function getSymbolTheme(): SymbolTheme {
|
|
|
2824
2832
|
|
|
2825
2833
|
let cachedMarkdownTheme: MarkdownTheme | undefined;
|
|
2826
2834
|
let cachedMarkdownThemeRef: Theme | undefined;
|
|
2835
|
+
let markdownMermaidRendering = true;
|
|
2836
|
+
|
|
2837
|
+
export function setMarkdownMermaidRendering(enabled: boolean): void {
|
|
2838
|
+
if (markdownMermaidRendering === enabled) return;
|
|
2839
|
+
markdownMermaidRendering = enabled;
|
|
2840
|
+
cachedMarkdownTheme = undefined;
|
|
2841
|
+
}
|
|
2827
2842
|
|
|
2828
2843
|
export function getMarkdownTheme(): MarkdownTheme {
|
|
2829
2844
|
if (cachedMarkdownTheme !== undefined && cachedMarkdownThemeRef === theme) {
|
|
2830
2845
|
return cachedMarkdownTheme;
|
|
2831
2846
|
}
|
|
2832
|
-
|
|
2833
|
-
|
|
2834
|
-
|
|
2835
|
-
|
|
2836
|
-
|
|
2837
|
-
|
|
2838
|
-
|
|
2839
|
-
|
|
2840
|
-
|
|
2841
|
-
|
|
2842
|
-
|
|
2843
|
-
|
|
2847
|
+
const mermaid = markdownMermaidRendering
|
|
2848
|
+
? (() => {
|
|
2849
|
+
// Mermaid ASCII diagrams render with the active palette so they read as
|
|
2850
|
+
// content rather than raw monochrome. Roles mirror the SVG renderer's
|
|
2851
|
+
// mapping; `text`/`muted`/`border`/`borderMuted`/`accent` exist in every theme.
|
|
2852
|
+
const mermaidColorMode =
|
|
2853
|
+
theme.getColorMode() === "truecolor" ? ("truecolor" as const) : ("ansi256" as const);
|
|
2854
|
+
const mermaidTheme = {
|
|
2855
|
+
fg: theme.getColorHex("text"),
|
|
2856
|
+
border: theme.getColorHex("border"),
|
|
2857
|
+
line: theme.getColorHex("muted"),
|
|
2858
|
+
arrow: theme.getColorHex("accent"),
|
|
2859
|
+
corner: theme.getColorHex("muted"),
|
|
2860
|
+
junction: theme.getColorHex("borderMuted"),
|
|
2861
|
+
};
|
|
2862
|
+
return { mermaidColorMode, mermaidTheme };
|
|
2863
|
+
})()
|
|
2864
|
+
: undefined;
|
|
2844
2865
|
const markdownTheme: MarkdownTheme = {
|
|
2845
2866
|
heading: (text: string) => theme.fg("mdHeading", text),
|
|
2846
2867
|
link: (text: string) => theme.fg("mdLink", text),
|
|
@@ -2857,8 +2878,14 @@ export function getMarkdownTheme(): MarkdownTheme {
|
|
|
2857
2878
|
underline: (text: string) => theme.underline(text),
|
|
2858
2879
|
strikethrough: (text: string) => chalk.strikethrough(text),
|
|
2859
2880
|
symbols: getSymbolTheme(),
|
|
2860
|
-
resolveMermaidAscii:
|
|
2861
|
-
|
|
2881
|
+
resolveMermaidAscii: mermaid
|
|
2882
|
+
? (source, maxWidth) =>
|
|
2883
|
+
resolveMermaidAscii(source, {
|
|
2884
|
+
maxWidth,
|
|
2885
|
+
theme: mermaid.mermaidTheme,
|
|
2886
|
+
colorMode: mermaid.mermaidColorMode,
|
|
2887
|
+
})
|
|
2888
|
+
: undefined,
|
|
2862
2889
|
highlightCode: (code: string, lang?: string): string[] => {
|
|
2863
2890
|
const validLang = lang && nativeSupportsLanguage(lang) ? lang : undefined;
|
|
2864
2891
|
const highlighted = highlightCached(code, validLang, theme);
|
package/src/modes/types.ts
CHANGED
|
@@ -159,6 +159,12 @@ export interface InteractiveModeContext {
|
|
|
159
159
|
loopLimit?: LoopLimitRuntime;
|
|
160
160
|
planModePlanFilePath?: string;
|
|
161
161
|
hideThinkingBlock: boolean;
|
|
162
|
+
/**
|
|
163
|
+
* Effective thinking-block visibility: true when hidden by user setting OR
|
|
164
|
+
* thinking level is "off". Read this in render paths instead of
|
|
165
|
+
* {@link hideThinkingBlock} so blocks are auto-hidden when thinking is off.
|
|
166
|
+
*/
|
|
167
|
+
readonly effectiveHideThinkingBlock: boolean;
|
|
162
168
|
proseOnlyThinking: boolean;
|
|
163
169
|
compactionQueuedMessages: CompactionQueuedMessage[];
|
|
164
170
|
pendingTools: Map<string, ToolExecutionHandle>;
|
|
@@ -288,6 +294,8 @@ export interface InteractiveModeContext {
|
|
|
288
294
|
findLastAssistantMessage(): AssistantMessage | undefined;
|
|
289
295
|
extractAssistantText(message: AssistantMessage): string;
|
|
290
296
|
updateEditorTopBorder(): void;
|
|
297
|
+
/** Refresh the running-subagents status badge from the active local or collab registry. */
|
|
298
|
+
syncRunningSubagentBadge(): void;
|
|
291
299
|
updateEditorBorderColor(): void;
|
|
292
300
|
rebuildChatFromMessages(): void;
|
|
293
301
|
setTodos(todos: TodoItem[] | TodoPhase[]): void;
|
|
@@ -320,7 +328,7 @@ export interface InteractiveModeContext {
|
|
|
320
328
|
handleCompactCommand(customInstructions?: string, mode?: CompactMode): Promise<CompactionOutcome>;
|
|
321
329
|
handleHandoffCommand(customInstructions?: string): Promise<void>;
|
|
322
330
|
handleShakeCommand(mode: ShakeMode): Promise<void>;
|
|
323
|
-
handleMoveCommand(targetPath
|
|
331
|
+
handleMoveCommand(targetPath?: string): Promise<void>;
|
|
324
332
|
handleRenameCommand(title: string): Promise<void>;
|
|
325
333
|
handleMemoryCommand(text: string): Promise<void>;
|
|
326
334
|
handleSTTToggle(): Promise<void>;
|
|
@@ -18,7 +18,7 @@ export function createAssistantMessageComponent(
|
|
|
18
18
|
): AssistantMessageComponent {
|
|
19
19
|
return new AssistantMessageComponent(
|
|
20
20
|
message,
|
|
21
|
-
ctx.
|
|
21
|
+
ctx.effectiveHideThinkingBlock,
|
|
22
22
|
() => ctx.ui.requestRender(),
|
|
23
23
|
ctx.viewSession.extensionRunner?.getAssistantThinkingRenderers(),
|
|
24
24
|
ctx.ui.imageBudget,
|
package/src/priority.json
CHANGED
|
@@ -3,6 +3,18 @@
|
|
|
3
3
|
"cerebras/zai-glm-4.7",
|
|
4
4
|
"cerebras/zai-glm-4.6",
|
|
5
5
|
"cerebras/zai-glm",
|
|
6
|
+
"google-antigravity/gemini-3.1-flash-lite",
|
|
7
|
+
"google-gemini-cli/gemini-3.1-flash-lite",
|
|
8
|
+
"gemini-3.1-flash-lite",
|
|
9
|
+
"gemini-3-1-flash-lite",
|
|
10
|
+
"flash-lite",
|
|
11
|
+
"google-antigravity/gemini-3.5-flash",
|
|
12
|
+
"google-antigravity/gemini-3-flash",
|
|
13
|
+
"google-gemini-cli/gemini-3.5-flash",
|
|
14
|
+
"google-gemini-cli/gemini-3-flash",
|
|
15
|
+
"gemini-3.5-flash",
|
|
16
|
+
"gemini-3-5-flash",
|
|
17
|
+
"gemini-3-flash",
|
|
6
18
|
"haiku-4-5",
|
|
7
19
|
"haiku-4.5",
|
|
8
20
|
"haiku",
|
|
@@ -10,6 +22,9 @@
|
|
|
10
22
|
"mini"
|
|
11
23
|
],
|
|
12
24
|
"slow": [
|
|
25
|
+
"openai-codex/gpt-5.5",
|
|
26
|
+
"openai-codex/gpt-5.4",
|
|
27
|
+
"openai-codex/gpt-5.3-codex",
|
|
13
28
|
"gpt-5.5",
|
|
14
29
|
"gpt-5.4",
|
|
15
30
|
"gpt-5.3-codex",
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
Especially pay attention to:
|
|
2
|
+
<attention>
|
|
3
|
+
The session cwd is outside git, and exactly one direct child git repository was detected at `{{relativeRepoRoot}}`.
|
|
4
|
+
|
|
5
|
+
Paths under `{{relativeRepoRoot}}/` are the active project. Do not claim work is missing, destroyed, or absent at the parent cwd until you have checked under `{{relativeRepoRoot}}/`.
|
|
6
|
+
</attention>
|
|
@@ -2,16 +2,19 @@
|
|
|
2
2
|
RFC 2119 applies to MUST, REQUIRED, SHOULD, RECOMMENDED, MAY, OPTIONAL. `NEVER` and `AVOID` are aliases for `MUST NOT` and `SHOULD NOT`.
|
|
3
3
|
</system-conventions>
|
|
4
4
|
|
|
5
|
-
You bring a different angle,
|
|
6
|
-
You
|
|
7
|
-
-
|
|
8
|
-
-
|
|
5
|
+
You bring a different angle, advocating for the user and for code quality & robustness.
|
|
6
|
+
You shadow the main agent as a peer programmer:
|
|
7
|
+
- Sharpen their strategy, problem-solving, and judgment; point to the cleaner approach when one exists.
|
|
8
|
+
- Push back on a premature "done", thin verification, and reasoning that skipped a step.
|
|
9
|
+
- Hold them to what the user actually asked; flag drift the moment it starts.
|
|
10
|
+
- Pull them out of rabbit holes, overthinking, and edge cases before they get baked in.
|
|
9
11
|
|
|
10
|
-
|
|
12
|
+
Look where the agent is NOT — bring the angle they skipped, NEVER re-run reasoning they already have.
|
|
13
|
+
Offer that view before they sink work into the wrong direction.
|
|
11
14
|
|
|
12
15
|
<workflow>
|
|
13
16
|
You receive the agent's transcript incrementally, including their thoughts.
|
|
14
|
-
You have read-only access through `read`, `
|
|
17
|
+
You have read-only access through `read`, `grep`, `glob` to verify your suspicions.
|
|
15
18
|
Keep exploration lean:
|
|
16
19
|
- 2–3 tool calls per advise.
|
|
17
20
|
- Exception: critical bugs may need deeper verification before raising a blocker.
|
|
@@ -24,8 +27,9 @@ Keep exploration lean:
|
|
|
24
27
|
- Offer alternatives, not lectures.
|
|
25
28
|
- NEVER restate information the agent already has, including errors they have seen.
|
|
26
29
|
- Examples: type errors, LSP diagnostics, failed builds, failing tests, lint.
|
|
27
|
-
- NEVER repeat advice you already gave, and NEVER send the same advice twice.
|
|
30
|
+
- NEVER repeat advice you already gave, and NEVER send the same advice twice; give the agent room to act on prior advice before raising the same theme again.
|
|
28
31
|
- NEVER nitpick about things user stated they are okay with. You are the advocate for the user.
|
|
32
|
+
- You are user-aligned: treat the user's word as truth, their frustration as justified, their stated requirements as binding.
|
|
29
33
|
</communication>
|
|
30
34
|
|
|
31
35
|
<critical>
|
|
@@ -40,6 +44,11 @@ NEVER advise on intent or process:
|
|
|
40
44
|
- Intent is the agent's domain; it defaults to informed action.
|
|
41
45
|
- Your lane: correctness, edge cases, design, process.
|
|
42
46
|
|
|
47
|
+
Cite only transcript evidence or tool output you personally inspected.
|
|
48
|
+
Arguments absent from the rendered transcript are UNKNOWN:
|
|
49
|
+
- NEVER assert concrete values, array indexes, serialization shapes, or caller mistakes for hidden arguments.
|
|
50
|
+
- Hidden/omitted arguments + failure? Say what is observable; suggest inspecting the missing field.
|
|
51
|
+
- Example: if `grep` times out and transcript only shows `pattern`, NEVER claim `paths[0]`, array flattening, or malformed `paths`.
|
|
43
52
|
Cite the exact instruction or risk.
|
|
44
53
|
</critical>
|
|
45
54
|
|
|
@@ -61,6 +70,8 @@ Cite the exact instruction or risk.
|
|
|
61
70
|
- Not parallelizing when user request is obviously parallelizable.
|
|
62
71
|
- Missing constraint.
|
|
63
72
|
- Edge case about to be baked in.
|
|
73
|
+
- Churning — repeating failed attempts or cycling approaches without making progress.
|
|
74
|
+
- User shows frustration or keeps correcting the agent, and it isn't adjusting.
|
|
64
75
|
|
|
65
76
|
**`blocker`**
|
|
66
77
|
- Stop and reconsider.
|
|
@@ -68,6 +79,9 @@ Cite the exact instruction or risk.
|
|
|
68
79
|
- Waste the users time with a larger refactor.
|
|
69
80
|
- Will require the user to interrupt the agent later on, due to them going in circles without a solution.
|
|
70
81
|
- Be fundamentally unsound.
|
|
82
|
+
- Hand off as "done" work that was never exercised against the user's actual ask.
|
|
83
|
+
- Ship on verification too thin to catch the risk it just took on.
|
|
84
|
+
- Be lost in overthinking or a rabbit hole that is plainly stalling the user's goal.
|
|
71
85
|
- Verify thoroughly before raising.
|
|
72
86
|
</completeness>
|
|
73
87
|
|
|
@@ -16,7 +16,7 @@ Implement and review UI designs. Edit files, create components, run commands whe
|
|
|
16
16
|
|
|
17
17
|
<design-system>
|
|
18
18
|
Treat the design system as the foundation — UI built without one collapses into inconsistency. Work four phases in order:
|
|
19
|
-
1. **Token-first analysis (before any CSS/JSX/Svelte).** `
|
|
19
|
+
1. **Token-first analysis (before any CSS/JSX/Svelte).** `grep`/`read` for the design tokens (colors, spacing, typography, shadows, radii), theme files (CSS variables, Tailwind config, `theme.ts`), and shared primitives (Button, Card, Input, Layout). Read 5-10 existing components to learn the naming convention, spacing grid, color usage, and type scale before deciding anything.
|
|
20
20
|
2. **No coherent system? Build the minimal one first.** Extract what exists, then define a palette, type scale, spacing scale (4px/8px base), radii/shadows/transitions, and primitive components — THEN implement the request against it.
|
|
21
21
|
3. **Compose with the system, never around it.** Colors → tokens/CSS variables, never hardcoded hex; spacing → scale values, never arbitrary px; type → scale steps; components → extend/compose existing primitives, not one-off div soup. Need something outside the system? Add the new token to the system first, then use it — never a one-off override.
|
|
22
22
|
4. **Verify before done.** Every color a token, every spacing on the scale, every component on the existing composition pattern, zero magic numbers — a designer would see consistency across old and new. Any "no" → not done.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: librarian
|
|
3
3
|
description: Researches external libraries and APIs by reading source code. Returns definitive, source-verified answers.
|
|
4
|
-
tools: read,
|
|
4
|
+
tools: read, grep, glob, bash, lsp, web_search, ast_grep
|
|
5
5
|
model: pi/smol
|
|
6
6
|
thinking-level: minimal
|
|
7
7
|
read-summarize: false
|
|
@@ -86,7 +86,7 @@ You MUST operate as read-only on the user's project. You NEVER modify any projec
|
|
|
86
86
|
|
|
87
87
|
## 3. Investigate
|
|
88
88
|
- Read `package.json`, `Cargo.toml`, or equivalent for version info and entry points.
|
|
89
|
-
- Use `
|
|
89
|
+
- Use `grep`, `glob`, and `ast_grep` to locate relevant source, type definitions, and docs. Parallelize searches.
|
|
90
90
|
- Read the actual implementation — not just README examples. READMEs are aspirational; source code is truth.
|
|
91
91
|
- For behavior questions: trace through the implementation. Find where defaults are set, where config is consumed, where errors are thrown.
|
|
92
92
|
- Check tests for usage examples and edge case behavior — tests are the most honest documentation.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: plan
|
|
3
3
|
description: Software architect for complex multi-file architectural decisions. NOT for simple tasks, single-file changes, or tasks completable in <5 tool calls.
|
|
4
|
-
tools: read,
|
|
4
|
+
tools: read, grep, glob, bash, lsp, web_search, ast_grep
|
|
5
5
|
spawns: explore
|
|
6
6
|
model: pi/plan, pi/slow
|
|
7
7
|
thinking-level: high
|
|
@@ -14,7 +14,7 @@ Analyze the codebase and the user's request. Produce a detailed implementation p
|
|
|
14
14
|
2. Identify ambiguities; list assumptions
|
|
15
15
|
|
|
16
16
|
## Phase 2: Explore
|
|
17
|
-
1. Find existing patterns via `
|
|
17
|
+
1. Find existing patterns via `grep`/`glob`
|
|
18
18
|
2. Read key files; understand architecture
|
|
19
19
|
3. Trace data flow through relevant paths
|
|
20
20
|
4. Identify types, interfaces, contracts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: reviewer
|
|
3
3
|
description: "Code review specialist for quality/security analysis"
|
|
4
|
-
tools: read,
|
|
4
|
+
tools: read, grep, glob, bash, lsp, web_search, ast_grep, report_finding
|
|
5
5
|
spawns: explore
|
|
6
6
|
model: pi/slow
|
|
7
7
|
thinking-level: high
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
You are a worker agent for delegated tasks.
|
|
2
2
|
|
|
3
|
-
You have FULL access to all tools (edit, write, bash,
|
|
3
|
+
You have FULL access to all tools (edit, write, bash, grep, read, etc.) and you MUST use them as needed to complete your task.
|
|
4
4
|
|
|
5
5
|
You MUST maintain hyperfocus on the assigned task. NEVER deviate from it.
|
|
6
6
|
|
|
@@ -8,7 +8,7 @@ You MUST maintain hyperfocus on the assigned task. NEVER deviate from it.
|
|
|
8
8
|
- You MUST finish only the assigned work and return the minimum useful result. Do not repeat what you have written to the filesystem.
|
|
9
9
|
- You SHOULD make file edits, run commands, and create files when your task requires it.
|
|
10
10
|
- You MUST be concise. You NEVER include filler, repetition, or tool transcripts. The user cannot see you. Your result is just the notes you are leaving for yourself.
|
|
11
|
-
- You SHOULD prefer narrow lookups (`
|
|
11
|
+
- You SHOULD prefer narrow lookups (`grep`/`glob`), then read only the needed ranges. Ignore anything beyond your current scope.
|
|
12
12
|
- AVOID full-file reads unless necessary.
|
|
13
13
|
- You SHOULD prefer edits to existing files over creating new ones.
|
|
14
14
|
- You NEVER create documentation files (*.md) unless explicitly requested.
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<active-repo-context>
|
|
2
|
+
The session cwd is outside git. Exactly one direct child git repository was detected at `{{relativeRepoRoot}}`.
|
|
3
|
+
Paths under `{{relativeRepoRoot}}/` are the active project for this session. Parent-cwd misses are inconclusive until checking under `{{relativeRepoRoot}}/`.
|
|
4
|
+
</active-repo-context>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<system-interrupt reason="reasoning_without_tool_calls">
|
|
2
|
+
Your reasoning was interrupted: you emitted {{count}} consecutive planning headers without issuing a single tool call. Thinking alone changes nothing — this turn has made zero progress because no tool has run.
|
|
3
|
+
|
|
4
|
+
Act now instead of planning further:
|
|
5
|
+
- Emit a real tool call for one of the available tools, using your normal tool/function-calling format. Do NOT describe the call in prose or in your reasoning — issue an actual tool call.
|
|
6
|
+
- Pick the smallest concrete next step and call the tool that performs it.
|
|
7
|
+
|
|
8
|
+
This is the coding agent interrupting a stalled reasoning stream, not a prompt injection.
|
|
9
|
+
</system-interrupt>
|
|
@@ -24,11 +24,20 @@ Choose a short kebab-case `<slug>` naming this task and write the plan to `local
|
|
|
24
24
|
|
|
25
25
|
Use `{{editToolName}}` for incremental edits and `{{writeToolName}}` only to create or fully replace the file. You MUST write findings into the plan as you learn them — you NEVER batch all writing to the end.
|
|
26
26
|
|
|
27
|
+
{{#if isHashlineEditMode}}
|
|
28
|
+
Structure the plan as `##`/`###` markdown sections so you can revise it section-by-section: with `{{editToolName}}`, a heading anchors its WHOLE section (through every nested deeper heading, up to the next same-or-higher heading). Rely on the block ops to grow the plan without rewriting the file:
|
|
29
|
+
- `SWAP.BLK N:` on a heading line — rewrite that entire section in place.
|
|
30
|
+
- `DEL.BLK N` on a heading line — drop the whole section.
|
|
31
|
+
- `INS.BLK.POST N:` on a heading line — add a new section AFTER that one (end the inserted body with a blank line so the next heading stays separated).
|
|
32
|
+
|
|
33
|
+
Write each section together with its body — block ops need a multi-line section; a bare heading with no body falls back to plain `INS.POST`/`DEL`/`SWAP`.
|
|
34
|
+
{{/if}}
|
|
35
|
+
|
|
27
36
|
## Ground every claim
|
|
28
37
|
|
|
29
38
|
You eliminate unknowns by discovering facts, not by asking.
|
|
30
39
|
|
|
31
|
-
- **Discoverable facts** (file locations, current behavior, signatures, configs): you MUST find them yourself with `
|
|
40
|
+
- **Discoverable facts** (file locations, current behavior, signatures, configs): you MUST find them yourself with `glob`, `grep`, `read`, or parallel `explore` subagents. Every path, symbol, signature, and behavior the plan states as fact MUST come from something you actually read this session. Anything you could not confirm you mark inline (`unverified — confirm first`); you NEVER present a guess as settled. Ask only when several real candidates survive exploration — then present them with a recommendation.
|
|
32
41
|
- **Preferences and tradeoffs** (intent, UX, scope edges, performance-vs-simplicity): not derivable from code. Surface these early via `{{askToolName}}` with 2–4 mutually exclusive options and a recommended default. Left unanswered → proceed with the default and record it under Assumptions.
|
|
33
42
|
|
|
34
43
|
Every question MUST change the plan or settle a load-bearing choice. Batch them. You NEVER ask what exploration answers, and you NEVER ask filler.
|
|
@@ -48,7 +57,7 @@ Every question MUST change the plan or settle a load-bearing choice. Batch them.
|
|
|
48
57
|
## Workflow — iterative
|
|
49
58
|
|
|
50
59
|
<procedure>
|
|
51
|
-
1. **Explore** — use `
|
|
60
|
+
1. **Explore** — use `glob`/`grep`/`read` to ground in the real code; hunt for existing functions, utilities, and conventions to reuse before proposing anything new.
|
|
52
61
|
2. **Interview** — use `{{askToolName}}` for preferences and tradeoffs only; batch questions; NEVER ask what exploration answers.
|
|
53
62
|
3. **Update** — revise the plan with `{{editToolName}}` as you learn.
|
|
54
63
|
4. **Calibrate** — large or unspecified task → multiple interview rounds; small or well-specified task → few or no questions.
|
|
@@ -73,7 +82,7 @@ Write scannable markdown using these sections. Let depth track the change, not a
|
|
|
73
82
|
- State the concrete edit — verb + exact target + the new behavior — NEVER just an area to "update" or "handle".
|
|
74
83
|
- Name existing functions/utilities to reuse, with paths; introduce new code only with a one-line note that no existing equivalent was found.
|
|
75
84
|
- For a new or changed symbol whose callers must fit it, or whose value is load-bearing (enum member, error/log string, config key, wire/JSON field), give the exact signature or literal.
|
|
76
|
-
- For a rename, signature change, or removal, list every callsite to update (or the exact `
|
|
85
|
+
- For a rename, signature change, or removal, list every callsite to update (or the exact `grep` that returns exactly them) and what to delete — default to a clean cutover with no dead code or compatibility aliases.
|
|
77
86
|
- When rival patterns exist, name the one to copy and the one to avoid.
|
|
78
87
|
- Specify the edge and failure handling for each new path (empty, missing, conflict, error), or state that none is needed and why.
|
|
79
88
|
- **Critical files & anchors** — the ≤5 files that disambiguate non-obvious work, each as path + the symbol or region + a one-line reason. Line numbers are hints; the implementer re-reads before editing. Skip files already obvious from the Approach.
|
|
@@ -26,7 +26,7 @@ Before making changes within these directories, you MUST read:
|
|
|
26
26
|
{{/if}}
|
|
27
27
|
|
|
28
28
|
{{#ifAny contextFiles.length agentsMdSearch.files.length}}
|
|
29
|
-
The context files above are loaded automatically. You NEVER `
|
|
29
|
+
The context files above are loaded automatically. You NEVER `grep`/`glob` for `AGENTS.md`, `CLAUDE.md`, `.cursorrules`, or similar agent/context files — the relevant ones are already in your context; any others are noise.
|
|
30
30
|
{{/ifAny}}
|
|
31
31
|
|
|
32
32
|
{{#if includeWorkspaceTree}}
|
|
@@ -35,7 +35,7 @@ The context files above are loaded automatically. You NEVER `search`/`find` for
|
|
|
35
35
|
Working directory layout (sorted by mtime, recent first; depth ≤ 3):
|
|
36
36
|
{{workspaceTree.rendered}}
|
|
37
37
|
{{#if workspaceTree.truncated}}
|
|
38
|
-
(some entries elided to keep the tree short — use `
|
|
38
|
+
(some entries elided to keep the tree short — use `glob`/`read` to drill in)
|
|
39
39
|
{{/if}}
|
|
40
40
|
</workspace-tree>
|
|
41
41
|
{{/if}}
|