@oh-my-pi/pi-coding-agent 16.0.4 → 16.0.6
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 +94 -0
- package/dist/cli.js +2027 -1396
- package/dist/types/advisor/advise-tool.d.ts +31 -19
- package/dist/types/autoresearch/tools/init-experiment.d.ts +13 -17
- package/dist/types/autoresearch/tools/log-experiment.d.ts +17 -19
- package/dist/types/autoresearch/tools/run-experiment.d.ts +3 -4
- package/dist/types/autoresearch/tools/update-notes.d.ts +4 -5
- package/dist/types/cli/args.d.ts +1 -0
- package/dist/types/cli/bench-cli.d.ts +6 -0
- package/dist/types/cli/ttsr-cli.d.ts +39 -0
- package/dist/types/commands/launch.d.ts +3 -0
- package/dist/types/commands/ttsr.d.ts +57 -0
- package/dist/types/commit/agentic/tools/analyze-file.d.ts +4 -5
- package/dist/types/commit/agentic/tools/git-file-diff.d.ts +4 -5
- package/dist/types/commit/agentic/tools/git-hunk.d.ts +5 -6
- package/dist/types/commit/agentic/tools/git-overview.d.ts +4 -5
- package/dist/types/commit/agentic/tools/propose-changelog.d.ts +23 -24
- package/dist/types/commit/agentic/tools/propose-commit.d.ts +11 -32
- package/dist/types/commit/agentic/tools/recent-commits.d.ts +3 -4
- package/dist/types/commit/agentic/tools/schemas.d.ts +6 -27
- package/dist/types/commit/agentic/tools/split-commit.d.ts +28 -49
- package/dist/types/commit/changelog/generate.d.ts +12 -13
- package/dist/types/commit/shared-llm.d.ts +10 -37
- package/dist/types/config/config-file.d.ts +4 -4
- package/dist/types/config/keybindings.d.ts +5 -0
- package/dist/types/config/models-config-schema.d.ts +625 -990
- package/dist/types/config/models-config.d.ts +229 -217
- package/dist/types/config/settings-schema.d.ts +144 -25
- package/dist/types/edit/hashline/params.d.ts +7 -11
- package/dist/types/edit/index.d.ts +2 -1
- package/dist/types/edit/modes/apply-patch.d.ts +4 -5
- package/dist/types/edit/modes/patch.d.ts +15 -24
- package/dist/types/edit/modes/replace.d.ts +16 -17
- package/dist/types/eval/js/index.d.ts +1 -0
- package/dist/types/extensibility/custom-commands/types.d.ts +6 -3
- package/dist/types/extensibility/custom-tools/types.d.ts +8 -5
- package/dist/types/extensibility/extensions/runner.d.ts +5 -2
- package/dist/types/extensibility/extensions/types.d.ts +14 -10
- package/dist/types/extensibility/hooks/types.d.ts +7 -4
- package/dist/types/extensibility/legacy-pi-ai-shim.d.ts +13 -5
- package/dist/types/extensibility/legacy-pi-coding-agent-shim.d.ts +17 -0
- package/dist/types/extensibility/shared-events.d.ts +22 -1
- package/dist/types/extensibility/typebox.d.ts +80 -58
- package/dist/types/goals/tools/goal-tool.d.ts +11 -24
- package/dist/types/index.d.ts +2 -0
- package/dist/types/lsp/index.d.ts +11 -26
- package/dist/types/lsp/types.d.ts +12 -28
- package/dist/types/main.d.ts +1 -0
- package/dist/types/mcp/client.d.ts +8 -0
- package/dist/types/modes/components/btw-panel.d.ts +1 -0
- package/dist/types/modes/components/custom-editor.d.ts +3 -1
- package/dist/types/modes/components/status-line/component.d.ts +1 -1
- package/dist/types/modes/components/status-line/context-thresholds.d.ts +0 -1
- package/dist/types/modes/controllers/btw-controller.d.ts +2 -0
- package/dist/types/modes/controllers/input-controller.d.ts +1 -0
- package/dist/types/modes/interactive-mode.d.ts +3 -0
- package/dist/types/modes/rpc/rpc-types.d.ts +1 -1
- package/dist/types/modes/setup-wizard/index.d.ts +1 -0
- package/dist/types/modes/setup-wizard/startup-splash.d.ts +7 -0
- package/dist/types/modes/theme/theme.d.ts +1 -1
- package/dist/types/modes/types.d.ts +3 -0
- package/dist/types/modes/utils/context-usage.d.ts +12 -0
- package/dist/types/sdk.d.ts +8 -1
- package/dist/types/session/agent-session.d.ts +24 -0
- package/dist/types/session/session-persistence.d.ts +4 -0
- package/dist/types/startup-splash.d.ts +12 -0
- package/dist/types/task/types.d.ts +47 -48
- package/dist/types/tools/ask.d.ts +26 -27
- package/dist/types/tools/ast-edit.d.ts +17 -17
- package/dist/types/tools/ast-grep.d.ts +12 -13
- package/dist/types/tools/bash.d.ts +20 -17
- package/dist/types/tools/browser.d.ts +46 -71
- package/dist/types/tools/checkpoint.d.ts +14 -15
- package/dist/types/tools/debug.d.ts +82 -145
- package/dist/types/tools/eval.d.ts +30 -40
- package/dist/types/tools/find.d.ts +17 -18
- package/dist/types/tools/gh.d.ts +49 -78
- package/dist/types/tools/image-gen.d.ts +20 -36
- package/dist/types/tools/inspect-image.d.ts +10 -11
- package/dist/types/tools/irc.d.ts +22 -33
- package/dist/types/tools/job.d.ts +11 -12
- package/dist/types/tools/learn.d.ts +21 -28
- package/dist/types/tools/manage-skill.d.ts +13 -22
- package/dist/types/tools/memory-edit.d.ts +15 -24
- package/dist/types/tools/memory-recall.d.ts +7 -8
- package/dist/types/tools/memory-reflect.d.ts +9 -10
- package/dist/types/tools/memory-retain.d.ts +13 -14
- package/dist/types/tools/read.d.ts +8 -8
- package/dist/types/tools/resolve.d.ts +11 -18
- package/dist/types/tools/review.d.ts +9 -15
- package/dist/types/tools/search-tool-bm25.d.ts +9 -10
- package/dist/types/tools/search.d.ts +16 -17
- package/dist/types/tools/ssh.d.ts +14 -15
- package/dist/types/tools/todo.d.ts +27 -43
- package/dist/types/tools/tts.d.ts +8 -9
- package/dist/types/tools/write.d.ts +9 -10
- package/dist/types/tui/code-cell.d.ts +2 -0
- package/dist/types/tui/index.d.ts +1 -0
- package/dist/types/tui/width-aware-text.d.ts +23 -0
- package/dist/types/utils/image-vision-fallback.d.ts +28 -0
- package/dist/types/utils/markit.d.ts +10 -1
- package/dist/types/web/search/index.d.ts +17 -28
- package/dist/types/web/search/providers/base.d.ts +1 -0
- package/dist/types/web/search/providers/gemini.d.ts +1 -0
- package/dist/types/web/search/providers/perplexity.d.ts +0 -2
- package/dist/types/web/search/types.d.ts +32 -26
- package/package.json +14 -13
- package/scripts/omp +1 -1
- package/src/advisor/__tests__/advisor.test.ts +103 -1
- package/src/advisor/advise-tool.ts +47 -11
- package/src/autoresearch/tools/init-experiment.ts +13 -16
- package/src/autoresearch/tools/log-experiment.ts +15 -18
- package/src/autoresearch/tools/run-experiment.ts +3 -3
- package/src/autoresearch/tools/update-notes.ts +4 -4
- package/src/cli/args.ts +1 -0
- package/src/cli/bench-cli.ts +30 -7
- package/src/cli/flag-tables.ts +8 -0
- package/src/cli/ttsr-cli.ts +995 -0
- package/src/cli-commands.ts +1 -0
- package/src/cli.ts +7 -1
- package/src/collab/host.ts +2 -2
- package/src/commands/launch.ts +3 -0
- package/src/commands/ttsr.ts +125 -0
- package/src/commit/agentic/tools/analyze-file.ts +4 -4
- package/src/commit/agentic/tools/git-file-diff.ts +4 -4
- package/src/commit/agentic/tools/git-hunk.ts +7 -5
- package/src/commit/agentic/tools/git-overview.ts +4 -4
- package/src/commit/agentic/tools/propose-changelog.ts +18 -15
- package/src/commit/agentic/tools/propose-commit.ts +6 -6
- package/src/commit/agentic/tools/recent-commits.ts +3 -3
- package/src/commit/agentic/tools/schemas.ts +8 -20
- package/src/commit/agentic/tools/split-commit.ts +19 -23
- package/src/commit/analysis/summary.ts +7 -5
- package/src/commit/changelog/generate.ts +15 -11
- package/src/commit/shared-llm.ts +17 -24
- package/src/config/config-file.ts +13 -15
- package/src/config/keybindings.ts +6 -0
- package/src/config/models-config-schema.ts +206 -179
- package/src/config/settings-schema.ts +118 -2
- package/src/discovery/builtin-rules/index.ts +2 -0
- package/src/discovery/builtin-rules/ts-import-type.md +2 -2
- package/src/discovery/builtin-rules/ts-no-any.md +11 -2
- package/src/discovery/builtin-rules/ts-no-inline-cast-access.md +55 -0
- package/src/edit/hashline/params.ts +12 -11
- package/src/edit/index.ts +5 -4
- package/src/edit/modes/apply-patch.ts +4 -4
- package/src/edit/modes/patch.ts +15 -18
- package/src/edit/modes/replace.ts +13 -17
- package/src/edit/renderer.ts +0 -1
- package/src/eval/agent-bridge.ts +11 -13
- package/src/eval/completion-bridge.ts +25 -17
- package/src/eval/js/context-manager.ts +17 -2
- package/src/eval/js/index.ts +1 -1
- package/src/eval/py/executor.ts +2 -2
- package/src/eval/py/runner.py +44 -0
- package/src/extensibility/custom-commands/loader.ts +5 -3
- package/src/extensibility/custom-commands/types.ts +6 -3
- package/src/extensibility/custom-tools/loader.ts +4 -2
- package/src/extensibility/custom-tools/types.ts +8 -5
- package/src/extensibility/extensions/loader.ts +4 -2
- package/src/extensibility/extensions/runner.ts +20 -2
- package/src/extensibility/extensions/types.ts +22 -8
- package/src/extensibility/hooks/loader.ts +5 -2
- package/src/extensibility/hooks/types.ts +7 -4
- package/src/extensibility/legacy-pi-ai-shim.ts +42 -5
- package/src/extensibility/legacy-pi-coding-agent-shim.ts +113 -0
- package/src/extensibility/plugins/legacy-pi-compat.ts +13 -13
- package/src/extensibility/shared-events.ts +24 -0
- package/src/extensibility/tool-proxy.ts +4 -1
- package/src/extensibility/typebox.ts +778 -251
- package/src/goals/guided-setup.ts +12 -3
- package/src/goals/tools/goal-tool.ts +6 -6
- package/src/index.ts +2 -0
- package/src/internal-urls/docs-index.generated.ts +15 -13
- package/src/lsp/types.ts +13 -27
- package/src/main.ts +29 -21
- package/src/mcp/client.ts +38 -13
- package/src/mcp/render.ts +102 -89
- package/src/modes/components/agent-hub.ts +11 -4
- package/src/modes/components/branch-summary-message.ts +1 -0
- package/src/modes/components/btw-panel.ts +5 -1
- package/src/modes/components/collab-prompt-message.ts +9 -7
- package/src/modes/components/compaction-summary-message.ts +1 -0
- package/src/modes/components/custom-editor.ts +18 -0
- package/src/modes/components/custom-message.ts +1 -0
- package/src/modes/components/footer.ts +6 -5
- package/src/modes/components/hook-message.ts +1 -0
- package/src/modes/components/read-tool-group.ts +9 -3
- package/src/modes/components/skill-message.ts +1 -0
- package/src/modes/components/status-line/component.ts +139 -15
- package/src/modes/components/status-line/context-thresholds.ts +0 -1
- package/src/modes/components/todo-reminder.ts +1 -0
- package/src/modes/components/tool-execution.ts +17 -10
- package/src/modes/components/ttsr-notification.ts +1 -0
- package/src/modes/components/user-message.ts +6 -6
- package/src/modes/controllers/btw-controller.ts +69 -1
- package/src/modes/controllers/event-controller.ts +2 -7
- package/src/modes/controllers/input-controller.ts +29 -0
- package/src/modes/controllers/selector-controller.ts +10 -3
- package/src/modes/interactive-mode.ts +42 -10
- package/src/modes/rpc/rpc-types.ts +1 -1
- package/src/modes/setup-wizard/index.ts +1 -0
- package/src/modes/setup-wizard/scenes/sign-in.ts +77 -5
- package/src/modes/setup-wizard/startup-splash.ts +107 -0
- package/src/modes/theme/theme.ts +133 -143
- package/src/modes/types.ts +3 -0
- package/src/modes/utils/context-usage.ts +37 -20
- package/src/modes/utils/hotkeys-markdown.ts +1 -0
- package/src/prompts/system/system-prompt.md +1 -0
- package/src/prompts/tools/image-attachment-describe-system.md +8 -0
- package/src/prompts/tools/image-attachment-describe.md +10 -0
- package/src/sdk.ts +35 -22
- package/src/session/agent-session.ts +715 -255
- package/src/session/session-history-format.ts +11 -2
- package/src/session/session-loader.ts +19 -32
- package/src/session/session-persistence.ts +27 -11
- package/src/session/snapcompact-inline.ts +1 -1
- package/src/slash-commands/builtin-registry.ts +4 -11
- package/src/ssh/connection-manager.ts +3 -2
- package/src/startup-splash.ts +19 -0
- package/src/task/executor.ts +12 -7
- package/src/task/types.ts +44 -41
- package/src/tool-discovery/tool-index.ts +17 -4
- package/src/tools/ask.ts +14 -14
- package/src/tools/ast-edit.ts +17 -14
- package/src/tools/ast-grep.ts +10 -9
- package/src/tools/bash.ts +15 -10
- package/src/tools/browser/launch.ts +13 -0
- package/src/tools/browser.ts +26 -32
- package/src/tools/checkpoint.ts +7 -7
- package/src/tools/debug.ts +72 -69
- package/src/tools/eval.ts +18 -19
- package/src/tools/find.ts +20 -13
- package/src/tools/gh.ts +29 -49
- package/src/tools/image-gen.ts +94 -57
- package/src/tools/inspect-image.ts +8 -9
- package/src/tools/irc.ts +12 -12
- package/src/tools/job.ts +6 -6
- package/src/tools/learn.ts +11 -14
- package/src/tools/manage-skill.ts +19 -23
- package/src/tools/memory-edit.ts +8 -8
- package/src/tools/memory-recall.ts +4 -4
- package/src/tools/memory-reflect.ts +5 -5
- package/src/tools/memory-retain.ts +9 -11
- package/src/tools/puppeteer/02_stealth_hairline.txt +1 -1
- package/src/tools/puppeteer/04_stealth_iframe.txt +4 -4
- package/src/tools/puppeteer/05_stealth_webgl.txt +1 -1
- package/src/tools/puppeteer/10_stealth_plugins.txt +6 -4
- package/src/tools/puppeteer/12_stealth_codecs.txt +2 -2
- package/src/tools/puppeteer/13_stealth_worker.txt +1 -1
- package/src/tools/read.ts +197 -19
- package/src/tools/report-tool-issue.ts +6 -6
- package/src/tools/resolve.ts +6 -6
- package/src/tools/review.ts +10 -12
- package/src/tools/search-tool-bm25.ts +5 -5
- package/src/tools/search.ts +20 -29
- package/src/tools/ssh.ts +8 -8
- package/src/tools/todo.ts +16 -19
- package/src/tools/tts.ts +16 -15
- package/src/tools/write.ts +5 -5
- package/src/tui/code-cell.ts +44 -3
- package/src/tui/index.ts +1 -0
- package/src/tui/width-aware-text.ts +58 -0
- package/src/utils/image-vision-fallback.ts +197 -0
- package/src/utils/markit.ts +17 -2
- package/src/web/search/index.ts +21 -9
- package/src/web/search/providers/base.ts +1 -0
- package/src/web/search/providers/gemini.ts +56 -18
- package/src/web/search/providers/perplexity.ts +373 -126
- package/src/web/search/types.ts +28 -48
|
@@ -209,10 +209,51 @@ export declare const SETTINGS_SCHEMA: {
|
|
|
209
209
|
readonly description: "Pause the main agent for up to 30 seconds if the advisor falls behind by this many turns. Off disables catch-up delays.";
|
|
210
210
|
};
|
|
211
211
|
};
|
|
212
|
+
readonly "advisor.immuneTurns": {
|
|
213
|
+
readonly type: "number";
|
|
214
|
+
readonly default: 1;
|
|
215
|
+
readonly ui: {
|
|
216
|
+
readonly tab: "model";
|
|
217
|
+
readonly group: "Advisor";
|
|
218
|
+
readonly label: "Advisor Immune Turns";
|
|
219
|
+
readonly description: "After an advisor concern or blocker interrupts, route further concerns/blockers non-interruptingly for this many primary turns.";
|
|
220
|
+
readonly options: readonly [{
|
|
221
|
+
readonly value: "0";
|
|
222
|
+
readonly label: "0 turns";
|
|
223
|
+
readonly description: "Allow every concern/blocker to interrupt.";
|
|
224
|
+
}, {
|
|
225
|
+
readonly value: "1";
|
|
226
|
+
readonly label: "1 turn";
|
|
227
|
+
readonly description: "Default.";
|
|
228
|
+
}, {
|
|
229
|
+
readonly value: "2";
|
|
230
|
+
readonly label: "2 turns";
|
|
231
|
+
}, {
|
|
232
|
+
readonly value: "3";
|
|
233
|
+
readonly label: "3 turns";
|
|
234
|
+
}, {
|
|
235
|
+
readonly value: "4";
|
|
236
|
+
readonly label: "4 turns";
|
|
237
|
+
}, {
|
|
238
|
+
readonly value: "5";
|
|
239
|
+
readonly label: "5 turns";
|
|
240
|
+
}];
|
|
241
|
+
};
|
|
242
|
+
};
|
|
212
243
|
readonly shellPath: {
|
|
213
244
|
readonly type: "string";
|
|
214
245
|
readonly default: undefined;
|
|
215
246
|
};
|
|
247
|
+
readonly "git.enabled": {
|
|
248
|
+
readonly type: "boolean";
|
|
249
|
+
readonly default: true;
|
|
250
|
+
readonly ui: {
|
|
251
|
+
readonly tab: "interaction";
|
|
252
|
+
readonly group: "Git";
|
|
253
|
+
readonly label: "Enable Git Integration";
|
|
254
|
+
readonly description: "Show git branch, status, and PR information in the TUI and watch repository metadata.";
|
|
255
|
+
};
|
|
256
|
+
};
|
|
216
257
|
readonly extensions: {
|
|
217
258
|
readonly type: "array";
|
|
218
259
|
readonly default: string[];
|
|
@@ -678,6 +719,16 @@ export declare const SETTINGS_SCHEMA: {
|
|
|
678
719
|
readonly description: "Prevent images from being sent to LLM providers";
|
|
679
720
|
};
|
|
680
721
|
};
|
|
722
|
+
readonly "images.describeForTextModels": {
|
|
723
|
+
readonly type: "boolean";
|
|
724
|
+
readonly default: true;
|
|
725
|
+
readonly ui: {
|
|
726
|
+
readonly tab: "model";
|
|
727
|
+
readonly group: "Vision";
|
|
728
|
+
readonly label: "Describe Images for Text Models";
|
|
729
|
+
readonly description: "When an image is attached to a model without vision support, save it under local:// and inject a description from a vision-capable model instead of dropping it";
|
|
730
|
+
};
|
|
731
|
+
};
|
|
681
732
|
readonly "tui.maxInlineImageColumns": {
|
|
682
733
|
readonly type: "number";
|
|
683
734
|
readonly default: 100;
|
|
@@ -714,6 +765,16 @@ export declare const SETTINGS_SCHEMA: {
|
|
|
714
765
|
readonly description: "Wrap paths and URLs in OSC 8 hyperlinks for terminal-native click-to-open (auto: detect support; off: never; always: unconditional)";
|
|
715
766
|
};
|
|
716
767
|
};
|
|
768
|
+
readonly "tui.tight": {
|
|
769
|
+
readonly type: "boolean";
|
|
770
|
+
readonly default: false;
|
|
771
|
+
readonly ui: {
|
|
772
|
+
readonly tab: "appearance";
|
|
773
|
+
readonly group: "Display";
|
|
774
|
+
readonly label: "Tight Layout";
|
|
775
|
+
readonly description: "Remove the 1-character horizontal padding from the left and right of the terminal output";
|
|
776
|
+
};
|
|
777
|
+
};
|
|
717
778
|
readonly "display.tabWidth": {
|
|
718
779
|
readonly type: "number";
|
|
719
780
|
readonly default: 3;
|
|
@@ -794,6 +855,26 @@ export declare const SETTINGS_SCHEMA: {
|
|
|
794
855
|
readonly description: "Hide thinking blocks in assistant responses";
|
|
795
856
|
};
|
|
796
857
|
};
|
|
858
|
+
readonly "model.loopGuard.enabled": {
|
|
859
|
+
readonly type: "boolean";
|
|
860
|
+
readonly default: true;
|
|
861
|
+
readonly ui: {
|
|
862
|
+
readonly tab: "model";
|
|
863
|
+
readonly group: "Thinking";
|
|
864
|
+
readonly label: "Loop Guard";
|
|
865
|
+
readonly description: "Enable automatic stream loop detection for Gemini and DeepSeek models";
|
|
866
|
+
};
|
|
867
|
+
};
|
|
868
|
+
readonly "model.loopGuard.checkAssistantContent": {
|
|
869
|
+
readonly type: "boolean";
|
|
870
|
+
readonly default: true;
|
|
871
|
+
readonly ui: {
|
|
872
|
+
readonly tab: "model";
|
|
873
|
+
readonly group: "Thinking";
|
|
874
|
+
readonly label: "Loop Guard Scan Prose";
|
|
875
|
+
readonly description: "Apply loop guard to assistant prose messages in addition to thinking logs";
|
|
876
|
+
};
|
|
877
|
+
};
|
|
797
878
|
readonly repeatToolDescriptions: {
|
|
798
879
|
readonly type: "boolean";
|
|
799
880
|
readonly default: false;
|
|
@@ -1336,6 +1417,16 @@ export declare const SETTINGS_SCHEMA: {
|
|
|
1336
1417
|
readonly description: "Skip welcome screen and startup status messages";
|
|
1337
1418
|
};
|
|
1338
1419
|
};
|
|
1420
|
+
readonly "startup.showSplash": {
|
|
1421
|
+
readonly type: "boolean";
|
|
1422
|
+
readonly default: false;
|
|
1423
|
+
readonly ui: {
|
|
1424
|
+
readonly tab: "interaction";
|
|
1425
|
+
readonly group: "Startup & Updates";
|
|
1426
|
+
readonly label: "Show Startup Splash";
|
|
1427
|
+
readonly description: "Show the full animated setup splash on normal interactive startup without rerunning setup. Quiet Startup still suppresses it.";
|
|
1428
|
+
};
|
|
1429
|
+
};
|
|
1339
1430
|
readonly "startup.setupWizard": {
|
|
1340
1431
|
readonly type: "boolean";
|
|
1341
1432
|
readonly default: true;
|
|
@@ -1550,7 +1641,7 @@ export declare const SETTINGS_SCHEMA: {
|
|
|
1550
1641
|
};
|
|
1551
1642
|
readonly "contextPromotion.enabled": {
|
|
1552
1643
|
readonly type: "boolean";
|
|
1553
|
-
readonly default:
|
|
1644
|
+
readonly default: false;
|
|
1554
1645
|
readonly ui: {
|
|
1555
1646
|
readonly tab: "context";
|
|
1556
1647
|
readonly group: "General";
|
|
@@ -1875,7 +1966,7 @@ export declare const SETTINGS_SCHEMA: {
|
|
|
1875
1966
|
};
|
|
1876
1967
|
readonly "tools.format": {
|
|
1877
1968
|
readonly type: "enum";
|
|
1878
|
-
readonly values: readonly ["auto", "native", "glm", "hermes", "kimi", "xml", "anthropic", "deepseek", "harmony", "pi", "qwen3", "gemini", "gemma"];
|
|
1969
|
+
readonly values: readonly ["auto", "native", "glm", "hermes", "kimi", "xml", "anthropic", "deepseek", "harmony", "pi", "qwen3", "gemini", "gemma", "minimax"];
|
|
1879
1970
|
readonly default: "auto";
|
|
1880
1971
|
readonly ui: {
|
|
1881
1972
|
readonly tab: "context";
|
|
@@ -1934,6 +2025,10 @@ export declare const SETTINGS_SCHEMA: {
|
|
|
1934
2025
|
readonly value: "gemma";
|
|
1935
2026
|
readonly label: "Gemma";
|
|
1936
2027
|
readonly description: "Use the Gemma owned dialect.";
|
|
2028
|
+
}, {
|
|
2029
|
+
readonly value: "minimax";
|
|
2030
|
+
readonly label: "MiniMax";
|
|
2031
|
+
readonly description: "Use the MiniMax owned dialect.";
|
|
1937
2032
|
}];
|
|
1938
2033
|
};
|
|
1939
2034
|
};
|
|
@@ -4052,7 +4147,7 @@ export declare const SETTINGS_SCHEMA: {
|
|
|
4052
4147
|
};
|
|
4053
4148
|
readonly "providers.webSearch": {
|
|
4054
4149
|
readonly type: "enum";
|
|
4055
|
-
readonly values: readonly ["auto",
|
|
4150
|
+
readonly values: readonly ["auto", ...SearchProviderId[]];
|
|
4056
4151
|
readonly default: "auto";
|
|
4057
4152
|
readonly ui: {
|
|
4058
4153
|
readonly tab: "providers";
|
|
@@ -4063,34 +4158,18 @@ export declare const SETTINGS_SCHEMA: {
|
|
|
4063
4158
|
readonly value: "auto";
|
|
4064
4159
|
readonly label: "Auto";
|
|
4065
4160
|
readonly description: "Automatically uses the first configured web-search provider";
|
|
4066
|
-
}, {
|
|
4067
|
-
readonly value: "tavily";
|
|
4068
|
-
readonly label: "Tavily";
|
|
4069
|
-
readonly description: "Requires TAVILY_API_KEY";
|
|
4070
4161
|
}, {
|
|
4071
4162
|
readonly value: "perplexity";
|
|
4072
4163
|
readonly label: "Perplexity";
|
|
4073
4164
|
readonly description: "Uses auth when configured; explicit selection falls back to anonymous search";
|
|
4074
4165
|
}, {
|
|
4075
|
-
readonly value: "
|
|
4076
|
-
readonly label: "
|
|
4077
|
-
readonly description: "
|
|
4078
|
-
}, {
|
|
4079
|
-
readonly value: "jina";
|
|
4080
|
-
readonly label: "Jina";
|
|
4081
|
-
readonly description: "Requires JINA_API_KEY";
|
|
4082
|
-
}, {
|
|
4083
|
-
readonly value: "kimi";
|
|
4084
|
-
readonly label: "Kimi";
|
|
4085
|
-
readonly description: "Requires MOONSHOT_SEARCH_API_KEY or MOONSHOT_API_KEY";
|
|
4166
|
+
readonly value: "gemini";
|
|
4167
|
+
readonly label: "Gemini";
|
|
4168
|
+
readonly description: "Google Search grounding via Gemini (uses google-gemini-cli or google-antigravity OAuth)";
|
|
4086
4169
|
}, {
|
|
4087
4170
|
readonly value: "anthropic";
|
|
4088
4171
|
readonly label: "Anthropic";
|
|
4089
4172
|
readonly description: "Claude's native web_search tool (uses Anthropic OAuth or ANTHROPIC_API_KEY)";
|
|
4090
|
-
}, {
|
|
4091
|
-
readonly value: "gemini";
|
|
4092
|
-
readonly label: "Gemini";
|
|
4093
|
-
readonly description: "Google Search grounding via Gemini (uses google-gemini-cli or google-antigravity OAuth)";
|
|
4094
4173
|
}, {
|
|
4095
4174
|
readonly value: "codex";
|
|
4096
4175
|
readonly label: "OpenAI";
|
|
@@ -4104,13 +4183,29 @@ export declare const SETTINGS_SCHEMA: {
|
|
|
4104
4183
|
readonly label: "Exa";
|
|
4105
4184
|
readonly description: "Uses Exa API when EXA_API_KEY is set; falls back to Exa MCP";
|
|
4106
4185
|
}, {
|
|
4107
|
-
readonly value: "
|
|
4108
|
-
readonly label: "
|
|
4109
|
-
readonly description: "Requires
|
|
4186
|
+
readonly value: "jina";
|
|
4187
|
+
readonly label: "Jina";
|
|
4188
|
+
readonly description: "Requires JINA_API_KEY";
|
|
4110
4189
|
}, {
|
|
4111
4190
|
readonly value: "kagi";
|
|
4112
4191
|
readonly label: "Kagi";
|
|
4113
4192
|
readonly description: "Requires KAGI_API_KEY and Kagi Search API beta access";
|
|
4193
|
+
}, {
|
|
4194
|
+
readonly value: "tavily";
|
|
4195
|
+
readonly label: "Tavily";
|
|
4196
|
+
readonly description: "Requires TAVILY_API_KEY";
|
|
4197
|
+
}, {
|
|
4198
|
+
readonly value: "brave";
|
|
4199
|
+
readonly label: "Brave";
|
|
4200
|
+
readonly description: "Requires BRAVE_API_KEY";
|
|
4201
|
+
}, {
|
|
4202
|
+
readonly value: "kimi";
|
|
4203
|
+
readonly label: "Kimi";
|
|
4204
|
+
readonly description: "Requires MOONSHOT_SEARCH_API_KEY or MOONSHOT_API_KEY";
|
|
4205
|
+
}, {
|
|
4206
|
+
readonly value: "parallel";
|
|
4207
|
+
readonly label: "Parallel";
|
|
4208
|
+
readonly description: "Requires PARALLEL_API_KEY";
|
|
4114
4209
|
}, {
|
|
4115
4210
|
readonly value: "synthetic";
|
|
4116
4211
|
readonly label: "Synthetic";
|
|
@@ -4132,6 +4227,30 @@ export declare const SETTINGS_SCHEMA: {
|
|
|
4132
4227
|
readonly description: "Providers that web_search should never use, even as fallbacks";
|
|
4133
4228
|
};
|
|
4134
4229
|
};
|
|
4230
|
+
readonly "providers.antigravityEndpoint": {
|
|
4231
|
+
readonly type: "enum";
|
|
4232
|
+
readonly values: readonly ["auto", "production", "sandbox"];
|
|
4233
|
+
readonly default: "auto";
|
|
4234
|
+
readonly ui: {
|
|
4235
|
+
readonly tab: "providers";
|
|
4236
|
+
readonly group: "Services";
|
|
4237
|
+
readonly label: "Antigravity Endpoint Mode";
|
|
4238
|
+
readonly description: "Endpoint routing strategy for google-antigravity providers (chat, search, image, discovery)";
|
|
4239
|
+
readonly options: readonly [{
|
|
4240
|
+
readonly value: "auto";
|
|
4241
|
+
readonly label: "Auto";
|
|
4242
|
+
readonly description: "Try production endpoint, fail over to sandbox on 5xx/429";
|
|
4243
|
+
}, {
|
|
4244
|
+
readonly value: "production";
|
|
4245
|
+
readonly label: "Production Only";
|
|
4246
|
+
readonly description: "Force production endpoint only";
|
|
4247
|
+
}, {
|
|
4248
|
+
readonly value: "sandbox";
|
|
4249
|
+
readonly label: "Sandbox Only";
|
|
4250
|
+
readonly description: "Force sandbox endpoint only";
|
|
4251
|
+
}];
|
|
4252
|
+
};
|
|
4253
|
+
};
|
|
4135
4254
|
readonly "providers.image": {
|
|
4136
4255
|
readonly type: "enum";
|
|
4137
4256
|
readonly values: readonly ["auto", "openai", "antigravity", "xai", "gemini", "openrouter"];
|
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export declare const hashlineEditParamsSchema: z.ZodPreprocess<z.ZodObject<{
|
|
9
|
-
input: z.ZodString;
|
|
10
|
-
}, z.core.$loose>>;
|
|
11
|
-
export type HashlineParams = z.infer<typeof hashlineEditParamsSchema>;
|
|
1
|
+
export declare const hashlineEditParamsSchema: import("arktype/internal/variants/object.ts").ObjectType<(In: {
|
|
2
|
+
input?: string | undefined;
|
|
3
|
+
_input?: string | undefined;
|
|
4
|
+
}) => import("arktype/internal/attributes.ts").To<{
|
|
5
|
+
input: string;
|
|
6
|
+
}>, {}>;
|
|
7
|
+
export type HashlineParams = Parameters<typeof hashlineEditParamsSchema.assert>[0];
|
|
@@ -2,7 +2,7 @@ import type { AgentTool, AgentToolContext, AgentToolResult, AgentToolUpdateCallb
|
|
|
2
2
|
import type { ToolExample } from "@oh-my-pi/pi-ai";
|
|
3
3
|
import type { ToolSession } from "../tools";
|
|
4
4
|
import { type EditMode } from "../utils/edit-mode";
|
|
5
|
-
import {
|
|
5
|
+
import { hashlineEditParamsSchema } from "./hashline";
|
|
6
6
|
import { type ApplyPatchParams, applyPatchSchema } from "./modes/apply-patch";
|
|
7
7
|
import { type PatchParams, patchEditSchema } from "./modes/patch";
|
|
8
8
|
import { type ReplaceParams, replaceEditSchema } from "./modes/replace";
|
|
@@ -20,6 +20,7 @@ export * from "./normalize";
|
|
|
20
20
|
export * from "./renderer";
|
|
21
21
|
export * from "./streaming";
|
|
22
22
|
type TInput = typeof replaceEditSchema | typeof patchEditSchema | typeof hashlineEditParamsSchema | typeof applyPatchSchema;
|
|
23
|
+
type HashlineParams = typeof hashlineEditParamsSchema.infer;
|
|
23
24
|
type EditParams = ReplaceParams | PatchParams | HashlineParams | ApplyPatchParams;
|
|
24
25
|
export declare class EditTool implements AgentTool<TInput> {
|
|
25
26
|
#private;
|
|
@@ -7,12 +7,11 @@
|
|
|
7
7
|
* LSP writethrough, fs-cache invalidation, diagnostics) is shared with
|
|
8
8
|
* the `patch` mode.
|
|
9
9
|
*/
|
|
10
|
-
import { z } from "zod/v4";
|
|
11
10
|
import type { PatchEditEntry } from "./patch";
|
|
12
|
-
export declare const applyPatchSchema:
|
|
13
|
-
input:
|
|
14
|
-
},
|
|
15
|
-
export type ApplyPatchParams =
|
|
11
|
+
export declare const applyPatchSchema: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
12
|
+
input: string;
|
|
13
|
+
}, {}>;
|
|
14
|
+
export type ApplyPatchParams = typeof applyPatchSchema.infer;
|
|
16
15
|
export type ApplyPatchEntry = PatchEditEntry & {
|
|
17
16
|
path: string;
|
|
18
17
|
};
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
* for robust handling of whitespace and formatting differences.
|
|
6
6
|
*/
|
|
7
7
|
import type { AgentToolResult } from "@oh-my-pi/pi-agent-core";
|
|
8
|
-
import { z } from "zod/v4";
|
|
9
8
|
import { type WritethroughCallback, type WritethroughDeferredHandle } from "../../lsp";
|
|
10
9
|
import type { ToolSession } from "../../tools";
|
|
11
10
|
import type { EditToolDetails, LspBatchRequest } from "../renderer";
|
|
@@ -61,29 +60,21 @@ export declare function computePatchDiff(input: PatchInput, cwd: string, options
|
|
|
61
60
|
} | {
|
|
62
61
|
error: string;
|
|
63
62
|
}>;
|
|
64
|
-
export declare const patchEditEntrySchema:
|
|
65
|
-
op
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
update: "update";
|
|
80
|
-
}>>;
|
|
81
|
-
rename: z.ZodOptional<z.ZodString>;
|
|
82
|
-
diff: z.ZodOptional<z.ZodString>;
|
|
83
|
-
}, z.core.$strict>>;
|
|
84
|
-
}, z.core.$strict>;
|
|
85
|
-
export type PatchEditEntry = z.infer<typeof patchEditEntrySchema>;
|
|
86
|
-
export type PatchParams = z.infer<typeof patchEditSchema>;
|
|
63
|
+
export declare const patchEditEntrySchema: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
64
|
+
op?: "create" | "delete" | "update" | undefined;
|
|
65
|
+
rename?: string | undefined;
|
|
66
|
+
diff?: string | undefined;
|
|
67
|
+
}, {}>;
|
|
68
|
+
export type PatchEditEntry = typeof patchEditEntrySchema.infer;
|
|
69
|
+
export declare const patchEditSchema: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
70
|
+
path: string;
|
|
71
|
+
edits: {
|
|
72
|
+
op?: "create" | "delete" | "update" | undefined;
|
|
73
|
+
rename?: string | undefined;
|
|
74
|
+
diff?: string | undefined;
|
|
75
|
+
}[];
|
|
76
|
+
}, {}>;
|
|
77
|
+
export type PatchParams = typeof patchEditSchema.infer;
|
|
87
78
|
export interface ExecutePatchSingleOptions {
|
|
88
79
|
session: ToolSession;
|
|
89
80
|
path: string;
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
* fallback strategies for finding text in files.
|
|
6
6
|
*/
|
|
7
7
|
import type { AgentToolResult } from "@oh-my-pi/pi-agent-core";
|
|
8
|
-
import { z } from "zod/v4";
|
|
9
8
|
import type { WritethroughCallback, WritethroughDeferredHandle } from "../../lsp";
|
|
10
9
|
import type { ToolSession } from "../../tools";
|
|
11
10
|
import type { EditToolDetails, LspBatchRequest } from "../renderer";
|
|
@@ -113,21 +112,21 @@ export declare function findContextLine(lines: string[], context: string, startF
|
|
|
113
112
|
allowFuzzy?: boolean;
|
|
114
113
|
skipFunctionFallback?: boolean;
|
|
115
114
|
}): ContextLineResult;
|
|
116
|
-
export declare const replaceEditEntrySchema:
|
|
117
|
-
old_text:
|
|
118
|
-
new_text:
|
|
119
|
-
all
|
|
120
|
-
},
|
|
121
|
-
export declare const replaceEditSchema:
|
|
122
|
-
path:
|
|
123
|
-
edits:
|
|
124
|
-
old_text:
|
|
125
|
-
new_text:
|
|
126
|
-
all
|
|
127
|
-
}
|
|
128
|
-
},
|
|
129
|
-
export type ReplaceEditEntry =
|
|
130
|
-
export type ReplaceParams =
|
|
115
|
+
export declare const replaceEditEntrySchema: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
116
|
+
old_text: string;
|
|
117
|
+
new_text: string;
|
|
118
|
+
all?: boolean | undefined;
|
|
119
|
+
}, {}>;
|
|
120
|
+
export declare const replaceEditSchema: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
121
|
+
path: string;
|
|
122
|
+
edits: {
|
|
123
|
+
old_text: string;
|
|
124
|
+
new_text: string;
|
|
125
|
+
all?: boolean | undefined;
|
|
126
|
+
}[];
|
|
127
|
+
}, {}>;
|
|
128
|
+
export type ReplaceEditEntry = typeof replaceEditEntrySchema.infer;
|
|
129
|
+
export type ReplaceParams = typeof replaceEditSchema.infer;
|
|
131
130
|
export interface ExecuteReplaceSingleOptions {
|
|
132
131
|
session: ToolSession;
|
|
133
132
|
path: string;
|
|
@@ -139,4 +138,4 @@ export interface ExecuteReplaceSingleOptions {
|
|
|
139
138
|
writethrough: WritethroughCallback;
|
|
140
139
|
beginDeferredDiagnosticsForPath: (path: string) => WritethroughDeferredHandle;
|
|
141
140
|
}
|
|
142
|
-
export declare function executeReplaceSingle(options: ExecuteReplaceSingleOptions): Promise<AgentToolResult<EditToolDetails,
|
|
141
|
+
export declare function executeReplaceSingle(options: ExecuteReplaceSingleOptions): Promise<AgentToolResult<EditToolDetails, ReplaceEditEntry>>;
|
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
* Unlike markdown commands which expand to prompts, custom commands can execute
|
|
6
6
|
* arbitrary logic with full access to the hook context.
|
|
7
7
|
*/
|
|
8
|
-
import type
|
|
8
|
+
import type * as arktype from "arktype";
|
|
9
|
+
import type * as zod from "zod/v4";
|
|
9
10
|
import type { ExecOptions, ExecResult, HookCommandContext } from "../../extensibility/hooks/types";
|
|
10
11
|
import type * as PiCodingAgent from "../../index";
|
|
11
12
|
import type * as TypeBox from "../typebox";
|
|
@@ -21,8 +22,10 @@ export interface CustomCommandAPI {
|
|
|
21
22
|
exec(command: string, args: string[], options?: ExecOptions): Promise<ExecResult>;
|
|
22
23
|
/** Injected zod-backed typebox shim (legacy/compat). */
|
|
23
24
|
typebox: typeof TypeBox;
|
|
24
|
-
/** Injected
|
|
25
|
-
|
|
25
|
+
/** Injected arktype module for validation in custom commands. */
|
|
26
|
+
arktype: typeof arktype;
|
|
27
|
+
/** Injected zod/v4 module for canonical command validation. */
|
|
28
|
+
zod: typeof zod;
|
|
26
29
|
/** Injected pi-coding-agent exports */
|
|
27
30
|
pi: typeof PiCodingAgent;
|
|
28
31
|
}
|
|
@@ -9,7 +9,8 @@ import type { CompactionResult } from "@oh-my-pi/pi-agent-core/compaction";
|
|
|
9
9
|
import type { FetchImpl, Model, Static, TSchema } from "@oh-my-pi/pi-ai";
|
|
10
10
|
import type { Component } from "@oh-my-pi/pi-tui";
|
|
11
11
|
import type { logger as PiLogger } from "@oh-my-pi/pi-utils";
|
|
12
|
-
import type {
|
|
12
|
+
import type { type as ArkType } from "arktype";
|
|
13
|
+
import type * as zod from "zod/v4";
|
|
13
14
|
import type { Rule } from "../../capability/rule";
|
|
14
15
|
import type { ModelRegistry } from "../../config/model-registry";
|
|
15
16
|
import type { Settings } from "../../config/settings";
|
|
@@ -50,10 +51,12 @@ export interface CustomToolAPI {
|
|
|
50
51
|
hasUI: boolean;
|
|
51
52
|
/** File logger for error/warning/debug messages */
|
|
52
53
|
logger: typeof PiLogger;
|
|
53
|
-
/** Injected
|
|
54
|
+
/** Injected typebox shim (legacy/compat — arktype-authored tools are preferred). */
|
|
54
55
|
typebox: typeof TypeBox;
|
|
55
|
-
/** Injected
|
|
56
|
-
|
|
56
|
+
/** Injected arktype module for arktype-authored custom tools. */
|
|
57
|
+
arktype: typeof ArkType;
|
|
58
|
+
/** Injected zod/v4 module for canonical parameter schemas. */
|
|
59
|
+
zod: typeof zod;
|
|
57
60
|
/** Injected pi-coding-agent exports */
|
|
58
61
|
pi: typeof PiCodingAgent;
|
|
59
62
|
/** Push a preview action that can later be resolved with the hidden resolve tool */
|
|
@@ -172,7 +175,7 @@ export interface CustomTool<TParams extends TSchema = TSchema, TDetails = any> {
|
|
|
172
175
|
strict?: boolean;
|
|
173
176
|
/** Description for LLM */
|
|
174
177
|
description: string;
|
|
175
|
-
/** Parameter schema (
|
|
178
|
+
/** Parameter schema (arktype, TypeBox, or legacy formats). */
|
|
176
179
|
parameters: TParams;
|
|
177
180
|
/** If true, tool is excluded unless explicitly listed in --tools or agent's tools field */
|
|
178
181
|
hidden?: boolean;
|
|
@@ -8,7 +8,7 @@ import type { ModelRegistry } from "../../config/model-registry";
|
|
|
8
8
|
import type { Settings } from "../../config/settings";
|
|
9
9
|
import type { MemoryRuntimeContext } from "../../memory-backend";
|
|
10
10
|
import type { SessionManager } from "../../session/session-manager";
|
|
11
|
-
import type { AfterProviderResponseEvent, AssistantThinkingRenderer, BeforeAgentStartEvent, BeforeAgentStartEventResult, BeforeProviderRequestEvent, BeforeProviderRequestEventResult, ContextEvent, Extension, ExtensionActions, ExtensionCommandContext, ExtensionCommandContextActions, ExtensionContext, ExtensionContextActions, ExtensionError, ExtensionEvent, ExtensionFlag, ExtensionRuntime, ExtensionShortcut, ExtensionUIContext, InputEvent, InputEventResult, MessageRenderer, RegisteredCommand, RegisteredTool, ResourcesDiscoverEvent, SessionBeforeBranchResult, SessionBeforeCompactResult, SessionBeforeSwitchResult, SessionBeforeTreeResult, SessionCompactingResult, ToolCallEvent, ToolCallEventResult, ToolResultEvent, ToolResultEventResult, UserBashEvent, UserBashEventResult, UserPythonEvent, UserPythonEventResult } from "./types";
|
|
11
|
+
import type { AfterProviderResponseEvent, AssistantThinkingRenderer, BeforeAgentStartEvent, BeforeAgentStartEventResult, BeforeProviderRequestEvent, BeforeProviderRequestEventResult, ContextEvent, Extension, ExtensionActions, ExtensionCommandContext, ExtensionCommandContextActions, ExtensionContext, ExtensionContextActions, ExtensionError, ExtensionEvent, ExtensionFlag, ExtensionRuntime, ExtensionShortcut, ExtensionUIContext, InputEvent, InputEventResult, MessageRenderer, RegisteredCommand, RegisteredTool, ResourcesDiscoverEvent, SessionBeforeBranchResult, SessionBeforeCompactResult, SessionBeforeSwitchResult, SessionBeforeTreeResult, SessionCompactingResult, SessionStopEvent, SessionStopEventResult, ToolCallEvent, ToolCallEventResult, ToolResultEvent, ToolResultEventResult, UserBashEvent, UserBashEventResult, UserPythonEvent, UserPythonEventResult } from "./types";
|
|
12
12
|
/** Combined result from all before_agent_start handlers */
|
|
13
13
|
interface BeforeAgentStartCombinedResult {
|
|
14
14
|
messages?: NonNullable<BeforeAgentStartEventResult["message"]>[];
|
|
@@ -43,7 +43,9 @@ type RunnerEmitResult<TEvent extends RunnerEmitEvent> = TEvent extends {
|
|
|
43
43
|
type: "session_before_tree";
|
|
44
44
|
} ? SessionBeforeTreeResult | undefined : TEvent extends {
|
|
45
45
|
type: "session.compacting";
|
|
46
|
-
} ? SessionCompactingResult | undefined :
|
|
46
|
+
} ? SessionCompactingResult | undefined : TEvent extends {
|
|
47
|
+
type: "session_stop";
|
|
48
|
+
} ? SessionStopEventResult | undefined : undefined;
|
|
47
49
|
export type NewSessionHandler = (options?: {
|
|
48
50
|
parentSession?: string;
|
|
49
51
|
setup?: (sessionManager: SessionManager) => Promise<void>;
|
|
@@ -92,6 +94,7 @@ export declare class ExtensionRunner {
|
|
|
92
94
|
* {@link onError} via {@link emit}'s normal isolation.
|
|
93
95
|
*/
|
|
94
96
|
emitCredentialDisabled(event: CredentialDisabledEvent): Promise<void>;
|
|
97
|
+
emitSessionStop(event: Omit<SessionStopEvent, "type">): Promise<SessionStopEventResult | undefined>;
|
|
95
98
|
getUIContext(): ExtensionUIContext;
|
|
96
99
|
hasUI(): boolean;
|
|
97
100
|
getExtensionPaths(): string[];
|
|
@@ -13,7 +13,8 @@ import type { Api, AssistantMessageEvent, AssistantMessageEventStream, Context,
|
|
|
13
13
|
import type { OAuthCredentials, OAuthLoginCallbacks } from "@oh-my-pi/pi-ai/oauth/types";
|
|
14
14
|
import type { AutocompleteItem, Component, EditorTheme, KeyId, TUI } from "@oh-my-pi/pi-tui";
|
|
15
15
|
import type { logger as PiLogger } from "@oh-my-pi/pi-utils";
|
|
16
|
-
import type {
|
|
16
|
+
import type { Type as arktype } from "arktype";
|
|
17
|
+
import type * as zod from "zod/v4";
|
|
17
18
|
import type { KeybindingsManager } from "../../config/keybindings";
|
|
18
19
|
import type { ModelRegistry } from "../../config/model-registry";
|
|
19
20
|
import type { EditToolDetails } from "../../edit";
|
|
@@ -29,7 +30,7 @@ import type { ReadonlySessionManager, SessionManager } from "../../session/sessi
|
|
|
29
30
|
import type { BashToolDetails, BashToolInput, FindToolDetails, FindToolInput, ReadToolDetails, ReadToolInput, SearchToolDetails, SearchToolInput, WriteToolInput } from "../../tools";
|
|
30
31
|
import type { ApprovalMode } from "../../tools/approval";
|
|
31
32
|
import type { EventBus } from "../../utils/event-bus";
|
|
32
|
-
import type { AgentEndEvent, AgentStartEvent, AutoCompactionEndEvent, AutoCompactionStartEvent, AutoRetryEndEvent, AutoRetryStartEvent, ContextEvent, GoalUpdatedEvent, SessionBeforeBranchEvent, SessionBeforeBranchResult, SessionBeforeCompactEvent, SessionBeforeCompactResult, SessionBeforeSwitchEvent, SessionBeforeSwitchResult, SessionBeforeTreeEvent, SessionBeforeTreeResult, SessionBranchEvent, SessionCompactEvent, SessionCompactingEvent, SessionCompactingResult, SessionEvent, SessionShutdownEvent, SessionStartEvent, SessionSwitchEvent, SessionTreeEvent, TodoReminderEvent, ToolCallEventResult, ToolResultEventResult, TtsrTriggeredEvent, TurnEndEvent, TurnStartEvent } from "../shared-events";
|
|
33
|
+
import type { AgentEndEvent, AgentStartEvent, AutoCompactionEndEvent, AutoCompactionStartEvent, AutoRetryEndEvent, AutoRetryStartEvent, ContextEvent, GoalUpdatedEvent, SessionBeforeBranchEvent, SessionBeforeBranchResult, SessionBeforeCompactEvent, SessionBeforeCompactResult, SessionBeforeSwitchEvent, SessionBeforeSwitchResult, SessionBeforeTreeEvent, SessionBeforeTreeResult, SessionBranchEvent, SessionCompactEvent, SessionCompactingEvent, SessionCompactingResult, SessionEvent, SessionShutdownEvent, SessionStartEvent, SessionStopEvent, SessionStopEventResult, SessionSwitchEvent, SessionTreeEvent, TodoReminderEvent, ToolCallEventResult, ToolResultEventResult, TtsrTriggeredEvent, TurnEndEvent, TurnStartEvent } from "../shared-events";
|
|
33
34
|
import type { SlashCommandInfo } from "../slash-commands";
|
|
34
35
|
import type * as TypeBox from "../typebox";
|
|
35
36
|
export type { AppKeybinding, KeybindingsManager } from "../../config/keybindings";
|
|
@@ -161,11 +162,11 @@ export interface ExtensionUIContext {
|
|
|
161
162
|
setToolsExpanded(expanded: boolean): void;
|
|
162
163
|
}
|
|
163
164
|
export interface ContextUsage {
|
|
164
|
-
/** Estimated context tokens
|
|
165
|
-
tokens: number
|
|
165
|
+
/** Estimated context tokens. */
|
|
166
|
+
tokens: number;
|
|
166
167
|
contextWindow: number;
|
|
167
|
-
/** Context usage as percentage of context window
|
|
168
|
-
percent: number
|
|
168
|
+
/** Context usage as percentage of context window. */
|
|
169
|
+
percent: number;
|
|
169
170
|
}
|
|
170
171
|
export interface CompactOptions {
|
|
171
172
|
onComplete?: (result: CompactionResult) => void;
|
|
@@ -347,7 +348,7 @@ export interface BeforeAgentStartEvent {
|
|
|
347
348
|
images?: ImageContent[];
|
|
348
349
|
systemPrompt: string[];
|
|
349
350
|
}
|
|
350
|
-
export type { AgentEndEvent, AgentStartEvent, TurnEndEvent, TurnStartEvent } from "../shared-events";
|
|
351
|
+
export type { AgentEndEvent, AgentStartEvent, SessionStopEvent, SessionStopEventResult, TurnEndEvent, TurnStartEvent, } from "../shared-events";
|
|
351
352
|
/** Fired when a message starts (user, assistant, or toolResult) */
|
|
352
353
|
export interface MessageStartEvent {
|
|
353
354
|
type: "message_start";
|
|
@@ -542,7 +543,7 @@ export declare function isToolCallEventType<TName extends string, TInput extends
|
|
|
542
543
|
input: TInput;
|
|
543
544
|
};
|
|
544
545
|
/** Union of all event types */
|
|
545
|
-
export type ExtensionEvent = ResourcesDiscoverEvent | SessionEvent | ContextEvent | BeforeProviderRequestEvent | AfterProviderResponseEvent | BeforeAgentStartEvent | AgentStartEvent | AgentEndEvent | TurnStartEvent | TurnEndEvent | MessageStartEvent | MessageUpdateEvent | MessageEndEvent | ToolExecutionStartEvent | ToolExecutionUpdateEvent | ToolExecutionEndEvent | AutoCompactionStartEvent | AutoCompactionEndEvent | AutoRetryStartEvent | AutoRetryEndEvent | TtsrTriggeredEvent | TodoReminderEvent | GoalUpdatedEvent | CredentialDisabledEvent | UserBashEvent | UserPythonEvent | InputEvent | ToolCallEvent | ToolResultEvent | ToolApprovalRequestedEvent | ToolApprovalResolvedEvent;
|
|
546
|
+
export type ExtensionEvent = ResourcesDiscoverEvent | SessionEvent | ContextEvent | BeforeProviderRequestEvent | AfterProviderResponseEvent | BeforeAgentStartEvent | AgentStartEvent | AgentEndEvent | SessionStopEvent | TurnStartEvent | TurnEndEvent | MessageStartEvent | MessageUpdateEvent | MessageEndEvent | ToolExecutionStartEvent | ToolExecutionUpdateEvent | ToolExecutionEndEvent | AutoCompactionStartEvent | AutoCompactionEndEvent | AutoRetryStartEvent | AutoRetryEndEvent | TtsrTriggeredEvent | TodoReminderEvent | GoalUpdatedEvent | CredentialDisabledEvent | UserBashEvent | UserPythonEvent | InputEvent | ToolCallEvent | ToolResultEvent | ToolApprovalRequestedEvent | ToolApprovalResolvedEvent;
|
|
546
547
|
export interface ContextEventResult {
|
|
547
548
|
messages?: AgentMessage[];
|
|
548
549
|
}
|
|
@@ -601,8 +602,10 @@ export interface ExtensionAPI {
|
|
|
601
602
|
logger: typeof PiLogger;
|
|
602
603
|
/** Injected zod-backed typebox shim for legacy `Type.Object(...)` parameter authoring. */
|
|
603
604
|
typebox: typeof TypeBox;
|
|
604
|
-
/** Injected
|
|
605
|
-
|
|
605
|
+
/** Injected arktype module for arktype-authored extension tools (canonical going forward). */
|
|
606
|
+
arktype: typeof arktype;
|
|
607
|
+
/** Injected zod/v4 module for canonical extension tool parameter schemas. */
|
|
608
|
+
zod: typeof zod;
|
|
606
609
|
/** Injected pi-coding-agent exports for accessing SDK utilities */
|
|
607
610
|
pi: typeof PiCodingAgent;
|
|
608
611
|
on(event: "resources_discover", handler: ExtensionHandler<ResourcesDiscoverEvent, ResourcesDiscoverResult>): void;
|
|
@@ -623,6 +626,7 @@ export interface ExtensionAPI {
|
|
|
623
626
|
on(event: "before_agent_start", handler: ExtensionHandler<BeforeAgentStartEvent, BeforeAgentStartEventResult>): void;
|
|
624
627
|
on(event: "agent_start", handler: ExtensionHandler<AgentStartEvent>): void;
|
|
625
628
|
on(event: "agent_end", handler: ExtensionHandler<AgentEndEvent>): void;
|
|
629
|
+
on(event: "session_stop", handler: ExtensionHandler<SessionStopEvent, SessionStopEventResult>): void;
|
|
626
630
|
on(event: "turn_start", handler: ExtensionHandler<TurnStartEvent>): void;
|
|
627
631
|
on(event: "turn_end", handler: ExtensionHandler<TurnEndEvent>): void;
|
|
628
632
|
on(event: "message_start", handler: ExtensionHandler<MessageStartEvent>): void;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { ImageContent, Message, Model, TextContent } from "@oh-my-pi/pi-ai";
|
|
2
2
|
import type { Component, TUI } from "@oh-my-pi/pi-tui";
|
|
3
3
|
import type { logger as PiLogger } from "@oh-my-pi/pi-utils";
|
|
4
|
-
import type {
|
|
4
|
+
import type { Type } from "arktype";
|
|
5
|
+
import type * as zod from "zod/v4";
|
|
5
6
|
import type { ModelRegistry } from "../../config/model-registry";
|
|
6
7
|
import type { EditToolDetails } from "../../edit";
|
|
7
8
|
import type { ExecOptions, ExecResult } from "../../exec/exec";
|
|
@@ -417,10 +418,12 @@ export interface HookAPI {
|
|
|
417
418
|
exec(command: string, args: string[], options?: ExecOptions): Promise<ExecResult>;
|
|
418
419
|
/** File logger for error/warning/debug messages */
|
|
419
420
|
logger: typeof PiLogger;
|
|
420
|
-
/** Injected zod-backed typebox shim (legacy/compat — prefer `
|
|
421
|
+
/** Injected zod-backed typebox shim (legacy/compat — prefer `arktype`). */
|
|
421
422
|
typebox: typeof TypeBox;
|
|
422
|
-
/** Injected
|
|
423
|
-
|
|
423
|
+
/** Injected arktype module for arktype-authored hooks. */
|
|
424
|
+
arktype: typeof Type;
|
|
425
|
+
/** Injected zod/v4 module for canonical hook validation. */
|
|
426
|
+
zod: typeof zod;
|
|
424
427
|
/** Injected pi-coding-agent exports */
|
|
425
428
|
pi: typeof PiCodingAgent;
|
|
426
429
|
}
|