@oh-my-pi/pi-coding-agent 3.15.0 → 3.20.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 +61 -1
- package/docs/extensions.md +1055 -0
- package/docs/rpc.md +69 -13
- package/docs/session-tree-plan.md +1 -1
- package/examples/extensions/README.md +141 -0
- package/examples/extensions/api-demo.ts +87 -0
- package/examples/extensions/chalk-logger.ts +26 -0
- package/examples/extensions/hello.ts +33 -0
- package/examples/extensions/pirate.ts +44 -0
- package/examples/extensions/plan-mode.ts +551 -0
- package/examples/extensions/subagent/agents/reviewer.md +35 -0
- package/examples/extensions/todo.ts +299 -0
- package/examples/extensions/tools.ts +145 -0
- package/examples/extensions/with-deps/index.ts +36 -0
- package/examples/extensions/with-deps/package-lock.json +31 -0
- package/examples/extensions/with-deps/package.json +16 -0
- package/examples/sdk/02-custom-model.ts +3 -3
- package/examples/sdk/05-tools.ts +7 -3
- package/examples/sdk/06-extensions.ts +81 -0
- package/examples/sdk/06-hooks.ts +14 -13
- package/examples/sdk/08-prompt-templates.ts +42 -0
- package/examples/sdk/08-slash-commands.ts +17 -12
- package/examples/sdk/09-api-keys-and-oauth.ts +2 -2
- package/examples/sdk/12-full-control.ts +6 -6
- package/package.json +11 -7
- package/src/capability/extension-module.ts +34 -0
- package/src/cli/args.ts +22 -7
- package/src/cli/file-processor.ts +38 -67
- package/src/cli/list-models.ts +1 -1
- package/src/config.ts +25 -14
- package/src/core/agent-session.ts +505 -242
- package/src/core/auth-storage.ts +33 -21
- package/src/core/compaction/branch-summarization.ts +4 -4
- package/src/core/compaction/compaction.ts +3 -3
- package/src/core/custom-commands/bundled/wt/index.ts +430 -0
- package/src/core/custom-commands/loader.ts +9 -0
- package/src/core/custom-tools/wrapper.ts +5 -0
- package/src/core/event-bus.ts +59 -0
- package/src/core/export-html/vendor/highlight.min.js +1213 -0
- package/src/core/export-html/vendor/marked.min.js +6 -0
- package/src/core/extensions/index.ts +100 -0
- package/src/core/extensions/loader.ts +501 -0
- package/src/core/extensions/runner.ts +477 -0
- package/src/core/extensions/types.ts +712 -0
- package/src/core/extensions/wrapper.ts +147 -0
- package/src/core/hooks/types.ts +2 -2
- package/src/core/index.ts +10 -21
- package/src/core/keybindings.ts +199 -0
- package/src/core/messages.ts +26 -7
- package/src/core/model-registry.ts +123 -46
- package/src/core/model-resolver.ts +7 -5
- package/src/core/prompt-templates.ts +242 -0
- package/src/core/sdk.ts +378 -295
- package/src/core/session-manager.ts +72 -58
- package/src/core/settings-manager.ts +118 -22
- package/src/core/system-prompt.ts +24 -1
- package/src/core/terminal-notify.ts +37 -0
- package/src/core/tools/context.ts +4 -4
- package/src/core/tools/exa/mcp-client.ts +5 -4
- package/src/core/tools/exa/render.ts +176 -131
- package/src/core/tools/gemini-image.ts +361 -0
- package/src/core/tools/git.ts +216 -0
- package/src/core/tools/index.ts +28 -15
- package/src/core/tools/lsp/config.ts +5 -4
- package/src/core/tools/lsp/index.ts +17 -12
- package/src/core/tools/lsp/render.ts +39 -47
- package/src/core/tools/read.ts +66 -29
- package/src/core/tools/render-utils.ts +268 -0
- package/src/core/tools/renderers.ts +243 -225
- package/src/core/tools/task/discovery.ts +2 -2
- package/src/core/tools/task/executor.ts +66 -58
- package/src/core/tools/task/index.ts +29 -10
- package/src/core/tools/task/model-resolver.ts +8 -13
- package/src/core/tools/task/omp-command.ts +24 -0
- package/src/core/tools/task/render.ts +35 -60
- package/src/core/tools/task/types.ts +3 -0
- package/src/core/tools/web-fetch.ts +29 -28
- package/src/core/tools/web-search/index.ts +6 -5
- package/src/core/tools/web-search/providers/exa.ts +6 -5
- package/src/core/tools/web-search/render.ts +66 -111
- package/src/core/voice-controller.ts +135 -0
- package/src/core/voice-supervisor.ts +1003 -0
- package/src/core/voice.ts +308 -0
- package/src/discovery/builtin.ts +75 -1
- package/src/discovery/claude.ts +47 -1
- package/src/discovery/codex.ts +54 -2
- package/src/discovery/gemini.ts +55 -2
- package/src/discovery/helpers.ts +100 -1
- package/src/discovery/index.ts +2 -0
- package/src/index.ts +14 -9
- package/src/lib/worktree/collapse.ts +179 -0
- package/src/lib/worktree/constants.ts +14 -0
- package/src/lib/worktree/errors.ts +23 -0
- package/src/lib/worktree/git.ts +110 -0
- package/src/lib/worktree/index.ts +23 -0
- package/src/lib/worktree/operations.ts +216 -0
- package/src/lib/worktree/session.ts +114 -0
- package/src/lib/worktree/stats.ts +67 -0
- package/src/main.ts +61 -37
- package/src/migrations.ts +37 -7
- package/src/modes/interactive/components/bash-execution.ts +6 -4
- package/src/modes/interactive/components/custom-editor.ts +55 -0
- package/src/modes/interactive/components/custom-message.ts +95 -0
- package/src/modes/interactive/components/extensions/extension-list.ts +5 -0
- package/src/modes/interactive/components/extensions/inspector-panel.ts +18 -12
- package/src/modes/interactive/components/extensions/state-manager.ts +12 -0
- package/src/modes/interactive/components/extensions/types.ts +1 -0
- package/src/modes/interactive/components/footer.ts +324 -0
- package/src/modes/interactive/components/hook-editor.ts +1 -0
- package/src/modes/interactive/components/hook-selector.ts +3 -3
- package/src/modes/interactive/components/model-selector.ts +7 -6
- package/src/modes/interactive/components/oauth-selector.ts +3 -3
- package/src/modes/interactive/components/settings-defs.ts +55 -6
- package/src/modes/interactive/components/status-line/separators.ts +4 -4
- package/src/modes/interactive/components/status-line.ts +45 -35
- package/src/modes/interactive/components/tool-execution.ts +95 -23
- package/src/modes/interactive/interactive-mode.ts +644 -113
- package/src/modes/interactive/theme/defaults/alabaster.json +99 -0
- package/src/modes/interactive/theme/defaults/amethyst.json +103 -0
- package/src/modes/interactive/theme/defaults/anthracite.json +100 -0
- package/src/modes/interactive/theme/defaults/basalt.json +90 -0
- package/src/modes/interactive/theme/defaults/birch.json +101 -0
- package/src/modes/interactive/theme/defaults/dark-abyss.json +97 -0
- package/src/modes/interactive/theme/defaults/dark-aurora.json +94 -0
- package/src/modes/interactive/theme/defaults/dark-cavern.json +97 -0
- package/src/modes/interactive/theme/defaults/dark-copper.json +94 -0
- package/src/modes/interactive/theme/defaults/dark-cosmos.json +96 -0
- package/src/modes/interactive/theme/defaults/dark-eclipse.json +97 -0
- package/src/modes/interactive/theme/defaults/dark-ember.json +94 -0
- package/src/modes/interactive/theme/defaults/dark-equinox.json +96 -0
- package/src/modes/interactive/theme/defaults/dark-lavender.json +94 -0
- package/src/modes/interactive/theme/defaults/dark-lunar.json +95 -0
- package/src/modes/interactive/theme/defaults/dark-midnight.json +94 -0
- package/src/modes/interactive/theme/defaults/dark-nebula.json +96 -0
- package/src/modes/interactive/theme/defaults/dark-rainforest.json +97 -0
- package/src/modes/interactive/theme/defaults/dark-reef.json +97 -0
- package/src/modes/interactive/theme/defaults/dark-sakura.json +94 -0
- package/src/modes/interactive/theme/defaults/dark-slate.json +94 -0
- package/src/modes/interactive/theme/defaults/dark-solstice.json +96 -0
- package/src/modes/interactive/theme/defaults/dark-starfall.json +97 -0
- package/src/modes/interactive/theme/defaults/dark-swamp.json +96 -0
- package/src/modes/interactive/theme/defaults/dark-taiga.json +97 -0
- package/src/modes/interactive/theme/defaults/dark-terminal.json +94 -0
- package/src/modes/interactive/theme/defaults/dark-tundra.json +97 -0
- package/src/modes/interactive/theme/defaults/dark-twilight.json +97 -0
- package/src/modes/interactive/theme/defaults/dark-volcanic.json +97 -0
- package/src/modes/interactive/theme/defaults/graphite.json +99 -0
- package/src/modes/interactive/theme/defaults/index.ts +128 -0
- package/src/modes/interactive/theme/defaults/light-aurora-day.json +97 -0
- package/src/modes/interactive/theme/defaults/light-canyon.json +97 -0
- package/src/modes/interactive/theme/defaults/light-cirrus.json +96 -0
- package/src/modes/interactive/theme/defaults/light-coral.json +94 -0
- package/src/modes/interactive/theme/defaults/light-dawn.json +96 -0
- package/src/modes/interactive/theme/defaults/light-dunes.json +97 -0
- package/src/modes/interactive/theme/defaults/light-eucalyptus.json +94 -0
- package/src/modes/interactive/theme/defaults/light-frost.json +94 -0
- package/src/modes/interactive/theme/defaults/light-glacier.json +97 -0
- package/src/modes/interactive/theme/defaults/light-haze.json +96 -0
- package/src/modes/interactive/theme/defaults/light-honeycomb.json +94 -0
- package/src/modes/interactive/theme/defaults/light-lagoon.json +97 -0
- package/src/modes/interactive/theme/defaults/light-lavender.json +94 -0
- package/src/modes/interactive/theme/defaults/light-meadow.json +97 -0
- package/src/modes/interactive/theme/defaults/light-mint.json +94 -0
- package/src/modes/interactive/theme/defaults/light-opal.json +97 -0
- package/src/modes/interactive/theme/defaults/light-orchard.json +97 -0
- package/src/modes/interactive/theme/defaults/light-paper.json +94 -0
- package/src/modes/interactive/theme/defaults/light-prism.json +96 -0
- package/src/modes/interactive/theme/defaults/light-sand.json +94 -0
- package/src/modes/interactive/theme/defaults/light-savanna.json +97 -0
- package/src/modes/interactive/theme/defaults/light-soleil.json +96 -0
- package/src/modes/interactive/theme/defaults/light-wetland.json +97 -0
- package/src/modes/interactive/theme/defaults/light-zenith.json +95 -0
- package/src/modes/interactive/theme/defaults/limestone.json +100 -0
- package/src/modes/interactive/theme/defaults/mahogany.json +104 -0
- package/src/modes/interactive/theme/defaults/marble.json +99 -0
- package/src/modes/interactive/theme/defaults/obsidian.json +90 -0
- package/src/modes/interactive/theme/defaults/onyx.json +90 -0
- package/src/modes/interactive/theme/defaults/pearl.json +99 -0
- package/src/modes/interactive/theme/defaults/porcelain.json +90 -0
- package/src/modes/interactive/theme/defaults/quartz.json +102 -0
- package/src/modes/interactive/theme/defaults/sandstone.json +101 -0
- package/src/modes/interactive/theme/defaults/titanium.json +89 -0
- package/src/modes/print-mode.ts +14 -72
- package/src/modes/rpc/rpc-client.ts +23 -9
- package/src/modes/rpc/rpc-mode.ts +137 -125
- package/src/modes/rpc/rpc-types.ts +46 -24
- package/src/prompts/task.md +1 -0
- package/src/prompts/tools/gemini-image.md +4 -0
- package/src/prompts/tools/git.md +9 -0
- package/src/prompts/voice-summary.md +12 -0
- package/src/utils/image-convert.ts +26 -0
- package/src/utils/image-resize.ts +215 -0
- package/src/utils/shell-snapshot.ts +22 -20
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://raw.githubusercontent.com/can1357/oh-my-pi/main/packages/coding-agent/theme-schema.json",
|
|
3
|
+
"name": "porcelain",
|
|
4
|
+
"vars": {
|
|
5
|
+
"porcelainWhite": "#f8f9fc",
|
|
6
|
+
"wedgwoodBlue": "#5070a0",
|
|
7
|
+
"goldTrim": "#b09040",
|
|
8
|
+
"delicateGray": "#d0d4e0",
|
|
9
|
+
"cobaltBlack": "#1a2030",
|
|
10
|
+
"paleBlue": "#e8eef8",
|
|
11
|
+
"deepWedgwood": "#405080",
|
|
12
|
+
"warmGold": "#c0a050",
|
|
13
|
+
"softBlue": "#708cb0",
|
|
14
|
+
"crimsonRed": "#c04040",
|
|
15
|
+
"darkGold": "#907030",
|
|
16
|
+
"mutedBlue": "#909cb0"
|
|
17
|
+
},
|
|
18
|
+
"colors": {
|
|
19
|
+
"accent": "wedgwoodBlue",
|
|
20
|
+
"border": "delicateGray",
|
|
21
|
+
"borderAccent": "wedgwoodBlue",
|
|
22
|
+
"borderMuted": "#e8eaf0",
|
|
23
|
+
"success": "#507050",
|
|
24
|
+
"error": "crimsonRed",
|
|
25
|
+
"warning": "darkGold",
|
|
26
|
+
"muted": "mutedBlue",
|
|
27
|
+
"dim": "#a0a8b8",
|
|
28
|
+
"text": "",
|
|
29
|
+
"thinkingText": "softBlue",
|
|
30
|
+
"selectedBg": "paleBlue",
|
|
31
|
+
"userMessageBg": "wedgwoodBlue",
|
|
32
|
+
"userMessageText": "",
|
|
33
|
+
"customMessageBg": "goldTrim",
|
|
34
|
+
"customMessageText": "",
|
|
35
|
+
"customMessageLabel": "warmGold",
|
|
36
|
+
"toolPendingBg": "paleBlue",
|
|
37
|
+
"toolSuccessBg": "#e8f0e8",
|
|
38
|
+
"toolErrorBg": "#f8e8e8",
|
|
39
|
+
"toolTitle": "",
|
|
40
|
+
"toolOutput": "cobaltBlack",
|
|
41
|
+
"mdHeading": "deepWedgwood",
|
|
42
|
+
"mdLink": "wedgwoodBlue",
|
|
43
|
+
"mdLinkUrl": "goldTrim",
|
|
44
|
+
"mdCode": "darkGold",
|
|
45
|
+
"mdCodeBlock": "cobaltBlack",
|
|
46
|
+
"mdCodeBlockBorder": "delicateGray",
|
|
47
|
+
"mdQuote": "softBlue",
|
|
48
|
+
"mdQuoteBorder": "wedgwoodBlue",
|
|
49
|
+
"mdHr": "delicateGray",
|
|
50
|
+
"mdListBullet": "wedgwoodBlue",
|
|
51
|
+
"toolDiffAdded": "#507050",
|
|
52
|
+
"toolDiffRemoved": "crimsonRed",
|
|
53
|
+
"toolDiffContext": "mutedBlue",
|
|
54
|
+
"syntaxComment": "mutedBlue",
|
|
55
|
+
"syntaxKeyword": "deepWedgwood",
|
|
56
|
+
"syntaxFunction": "wedgwoodBlue",
|
|
57
|
+
"syntaxVariable": "cobaltBlack",
|
|
58
|
+
"syntaxString": "darkGold",
|
|
59
|
+
"syntaxNumber": "goldTrim",
|
|
60
|
+
"syntaxType": "deepWedgwood",
|
|
61
|
+
"syntaxOperator": "softBlue",
|
|
62
|
+
"syntaxPunctuation": "#606870",
|
|
63
|
+
"thinkingOff": "#c0c4d0",
|
|
64
|
+
"thinkingMinimal": "mutedBlue",
|
|
65
|
+
"thinkingLow": "softBlue",
|
|
66
|
+
"thinkingMedium": "wedgwoodBlue",
|
|
67
|
+
"thinkingHigh": "deepWedgwood",
|
|
68
|
+
"thinkingXhigh": "cobaltBlack",
|
|
69
|
+
"bashMode": "goldTrim",
|
|
70
|
+
"statusLineBg": "porcelainWhite",
|
|
71
|
+
"statusLineSep": "delicateGray",
|
|
72
|
+
"statusLineModel": "wedgwoodBlue",
|
|
73
|
+
"statusLinePath": "cobaltBlack",
|
|
74
|
+
"statusLineGitClean": "#507050",
|
|
75
|
+
"statusLineGitDirty": "darkGold",
|
|
76
|
+
"statusLineContext": "softBlue",
|
|
77
|
+
"statusLineSpend": "goldTrim",
|
|
78
|
+
"statusLineStaged": "#507050",
|
|
79
|
+
"statusLineDirty": "darkGold",
|
|
80
|
+
"statusLineUntracked": "mutedBlue",
|
|
81
|
+
"statusLineOutput": "wedgwoodBlue",
|
|
82
|
+
"statusLineCost": "goldTrim",
|
|
83
|
+
"statusLineSubagents": "deepWedgwood"
|
|
84
|
+
},
|
|
85
|
+
"export": {
|
|
86
|
+
"pageBg": "porcelainWhite",
|
|
87
|
+
"cardBg": "#ffffff",
|
|
88
|
+
"infoBg": "paleBlue"
|
|
89
|
+
}
|
|
90
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://raw.githubusercontent.com/can1357/oh-my-pi/main/packages/coding-agent/theme-schema.json",
|
|
3
|
+
"name": "quartz",
|
|
4
|
+
"vars": {
|
|
5
|
+
"rosePink": "#c07088",
|
|
6
|
+
"quartzPurple": "#8070a0",
|
|
7
|
+
"softRose": "#e8dce0",
|
|
8
|
+
"deepRoseGray": "#3a2830",
|
|
9
|
+
"palePink": "#f5e8ed",
|
|
10
|
+
"dustyRose": "#9e6b7b",
|
|
11
|
+
"lavenderGray": "#a898b0",
|
|
12
|
+
"crystalMint": "#7fa090",
|
|
13
|
+
"warmGold": "#c09870",
|
|
14
|
+
"roseRed": "#b85860",
|
|
15
|
+
"roseGreen": "#88a088",
|
|
16
|
+
"selectedBg": "#f0e0e8",
|
|
17
|
+
"userMsgBg": "#faf5f7",
|
|
18
|
+
"toolPendingBg": "#f5eef8",
|
|
19
|
+
"toolSuccessBg": "#f0f5f0",
|
|
20
|
+
"toolErrorBg": "#f8f0f0",
|
|
21
|
+
"customMsgBg": "#f5f0f8"
|
|
22
|
+
},
|
|
23
|
+
"colors": {
|
|
24
|
+
"accent": "rosePink",
|
|
25
|
+
"border": "quartzPurple",
|
|
26
|
+
"borderAccent": "rosePink",
|
|
27
|
+
"borderMuted": "softRose",
|
|
28
|
+
"success": "roseGreen",
|
|
29
|
+
"error": "roseRed",
|
|
30
|
+
"warning": "warmGold",
|
|
31
|
+
"muted": "dustyRose",
|
|
32
|
+
"dim": "lavenderGray",
|
|
33
|
+
"text": "",
|
|
34
|
+
"thinkingText": "dustyRose",
|
|
35
|
+
|
|
36
|
+
"selectedBg": "selectedBg",
|
|
37
|
+
"userMessageBg": "userMsgBg",
|
|
38
|
+
"userMessageText": "",
|
|
39
|
+
"customMessageBg": "customMsgBg",
|
|
40
|
+
"customMessageText": "",
|
|
41
|
+
"customMessageLabel": "#8070a0",
|
|
42
|
+
"toolPendingBg": "toolPendingBg",
|
|
43
|
+
"toolSuccessBg": "toolSuccessBg",
|
|
44
|
+
"toolErrorBg": "toolErrorBg",
|
|
45
|
+
"toolTitle": "",
|
|
46
|
+
"toolOutput": "dustyRose",
|
|
47
|
+
|
|
48
|
+
"mdHeading": "warmGold",
|
|
49
|
+
"mdLink": "quartzPurple",
|
|
50
|
+
"mdLinkUrl": "lavenderGray",
|
|
51
|
+
"mdCode": "rosePink",
|
|
52
|
+
"mdCodeBlock": "crystalMint",
|
|
53
|
+
"mdCodeBlockBorder": "dustyRose",
|
|
54
|
+
"mdQuote": "dustyRose",
|
|
55
|
+
"mdQuoteBorder": "softRose",
|
|
56
|
+
"mdHr": "softRose",
|
|
57
|
+
"mdListBullet": "roseGreen",
|
|
58
|
+
|
|
59
|
+
"toolDiffAdded": "roseGreen",
|
|
60
|
+
"toolDiffRemoved": "roseRed",
|
|
61
|
+
"toolDiffContext": "dustyRose",
|
|
62
|
+
|
|
63
|
+
"syntaxComment": "#7fa090",
|
|
64
|
+
"syntaxKeyword": "#8070a0",
|
|
65
|
+
"syntaxFunction": "#c07088",
|
|
66
|
+
"syntaxVariable": "#3a2830",
|
|
67
|
+
"syntaxString": "#b85860",
|
|
68
|
+
"syntaxNumber": "#88a088",
|
|
69
|
+
"syntaxType": "#9e6b7b",
|
|
70
|
+
"syntaxOperator": "#3a2830",
|
|
71
|
+
"syntaxPunctuation": "#3a2830",
|
|
72
|
+
|
|
73
|
+
"thinkingOff": "softRose",
|
|
74
|
+
"thinkingMinimal": "#a898b0",
|
|
75
|
+
"thinkingLow": "#8070a0",
|
|
76
|
+
"thinkingMedium": "#c07088",
|
|
77
|
+
"thinkingHigh": "#9e6b7b",
|
|
78
|
+
"thinkingXhigh": "#8b4560",
|
|
79
|
+
|
|
80
|
+
"bashMode": "roseGreen",
|
|
81
|
+
|
|
82
|
+
"statusLineBg": "#f5e8ed",
|
|
83
|
+
"statusLineSep": "#9e6b7b",
|
|
84
|
+
"statusLineModel": "#8070a0",
|
|
85
|
+
"statusLinePath": "#7fa090",
|
|
86
|
+
"statusLineGitClean": "#5f875f",
|
|
87
|
+
"statusLineGitDirty": "#c09870",
|
|
88
|
+
"statusLineContext": "#8070a0",
|
|
89
|
+
"statusLineSpend": "#7fa090",
|
|
90
|
+
"statusLineStaged": 108,
|
|
91
|
+
"statusLineDirty": 180,
|
|
92
|
+
"statusLineUntracked": 139,
|
|
93
|
+
"statusLineOutput": 132,
|
|
94
|
+
"statusLineCost": 132,
|
|
95
|
+
"statusLineSubagents": "rosePink"
|
|
96
|
+
},
|
|
97
|
+
"export": {
|
|
98
|
+
"pageBg": "#fbf7f9",
|
|
99
|
+
"cardBg": "#ffffff",
|
|
100
|
+
"infoBg": "#faf5f7"
|
|
101
|
+
}
|
|
102
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://raw.githubusercontent.com/can1357/oh-my-pi/main/packages/coding-agent/theme-schema.json",
|
|
3
|
+
"name": "sandstone",
|
|
4
|
+
"vars": {
|
|
5
|
+
"rust": "#b86040",
|
|
6
|
+
"sage": "#688058",
|
|
7
|
+
"terracotta": "#c87850",
|
|
8
|
+
"olive": "#7a8a68",
|
|
9
|
+
"amber": "#d89850",
|
|
10
|
+
"shadow": "#302820",
|
|
11
|
+
"darkGray": "#544840",
|
|
12
|
+
"mediumGray": "#786858",
|
|
13
|
+
"erosion": "#d8cbb8",
|
|
14
|
+
"sand": "#f5ede3",
|
|
15
|
+
"selectedBg": "#e8dcc8",
|
|
16
|
+
"userMsgBg": "#f0e6d8",
|
|
17
|
+
"toolPendingBg": "#e8e0d0",
|
|
18
|
+
"toolSuccessBg": "#e0e8d8",
|
|
19
|
+
"toolErrorBg": "#e8d0c8",
|
|
20
|
+
"customMsgBg": "#e8dcd0"
|
|
21
|
+
},
|
|
22
|
+
"colors": {
|
|
23
|
+
"accent": "rust",
|
|
24
|
+
"border": "terracotta",
|
|
25
|
+
"borderAccent": "rust",
|
|
26
|
+
"borderMuted": "erosion",
|
|
27
|
+
"success": "sage",
|
|
28
|
+
"error": "rust",
|
|
29
|
+
"warning": "amber",
|
|
30
|
+
"muted": "mediumGray",
|
|
31
|
+
"dim": "darkGray",
|
|
32
|
+
"text": "",
|
|
33
|
+
"thinkingText": "mediumGray",
|
|
34
|
+
|
|
35
|
+
"selectedBg": "selectedBg",
|
|
36
|
+
"userMessageBg": "userMsgBg",
|
|
37
|
+
"userMessageText": "",
|
|
38
|
+
"customMessageBg": "customMsgBg",
|
|
39
|
+
"customMessageText": "",
|
|
40
|
+
"customMessageLabel": "#a05030",
|
|
41
|
+
"toolPendingBg": "toolPendingBg",
|
|
42
|
+
"toolSuccessBg": "toolSuccessBg",
|
|
43
|
+
"toolErrorBg": "toolErrorBg",
|
|
44
|
+
"toolTitle": "",
|
|
45
|
+
"toolOutput": "mediumGray",
|
|
46
|
+
|
|
47
|
+
"mdHeading": "amber",
|
|
48
|
+
"mdLink": "terracotta",
|
|
49
|
+
"mdLinkUrl": "mediumGray",
|
|
50
|
+
"mdCode": "rust",
|
|
51
|
+
"mdCodeBlock": "sage",
|
|
52
|
+
"mdCodeBlockBorder": "mediumGray",
|
|
53
|
+
"mdQuote": "mediumGray",
|
|
54
|
+
"mdQuoteBorder": "erosion",
|
|
55
|
+
"mdHr": "erosion",
|
|
56
|
+
"mdListBullet": "sage",
|
|
57
|
+
|
|
58
|
+
"toolDiffAdded": "sage",
|
|
59
|
+
"toolDiffRemoved": "rust",
|
|
60
|
+
"toolDiffContext": "mediumGray",
|
|
61
|
+
|
|
62
|
+
"syntaxComment": "#688058",
|
|
63
|
+
"syntaxKeyword": "#b86040",
|
|
64
|
+
"syntaxFunction": "#c87850",
|
|
65
|
+
"syntaxVariable": "#544840",
|
|
66
|
+
"syntaxString": "#a05030",
|
|
67
|
+
"syntaxNumber": "#7a8a68",
|
|
68
|
+
"syntaxType": "#8a6848",
|
|
69
|
+
"syntaxOperator": "#302820",
|
|
70
|
+
"syntaxPunctuation": "#302820",
|
|
71
|
+
|
|
72
|
+
"thinkingOff": "erosion",
|
|
73
|
+
"thinkingMinimal": "#a89888",
|
|
74
|
+
"thinkingLow": "#c87850",
|
|
75
|
+
"thinkingMedium": "#b86040",
|
|
76
|
+
"thinkingHigh": "#a05030",
|
|
77
|
+
"thinkingXhigh": "#903020",
|
|
78
|
+
|
|
79
|
+
"bashMode": "sage",
|
|
80
|
+
|
|
81
|
+
"statusLineBg": "#ebe0d0",
|
|
82
|
+
"statusLineSep": "#9a8878",
|
|
83
|
+
"statusLineModel": "#a05030",
|
|
84
|
+
"statusLinePath": "#8a6848",
|
|
85
|
+
"statusLineGitClean": "#588048",
|
|
86
|
+
"statusLineGitDirty": "#c87850",
|
|
87
|
+
"statusLineContext": "#786858",
|
|
88
|
+
"statusLineSpend": "#688058",
|
|
89
|
+
"statusLineStaged": 100,
|
|
90
|
+
"statusLineDirty": 173,
|
|
91
|
+
"statusLineUntracked": 95,
|
|
92
|
+
"statusLineOutput": 131,
|
|
93
|
+
"statusLineCost": 131,
|
|
94
|
+
"statusLineSubagents": "rust"
|
|
95
|
+
},
|
|
96
|
+
"export": {
|
|
97
|
+
"pageBg": "#f5ede3",
|
|
98
|
+
"cardBg": "#faf6f0",
|
|
99
|
+
"infoBg": "#f0e6d8"
|
|
100
|
+
}
|
|
101
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://raw.githubusercontent.com/can1357/oh-my-pi/main/packages/coding-agent/theme-schema.json",
|
|
3
|
+
"name": "titanium",
|
|
4
|
+
"vars": {
|
|
5
|
+
"brushedTitanium": "#151820",
|
|
6
|
+
"darkTitanium": "#0f1216",
|
|
7
|
+
"electricBlue": "#00b4ff",
|
|
8
|
+
"deepBlue": "#0082b3",
|
|
9
|
+
"titaniumGold": "#d4c090",
|
|
10
|
+
"brightAluminum": "#e8ecf4",
|
|
11
|
+
"dimAluminum": "#9ca3b0",
|
|
12
|
+
"warningAmber": "#ffb347",
|
|
13
|
+
"readoutGreen": "#00ff88",
|
|
14
|
+
"alertRed": "#ff4757",
|
|
15
|
+
"subtleGray": "#2a3038"
|
|
16
|
+
},
|
|
17
|
+
"colors": {
|
|
18
|
+
"accent": "electricBlue",
|
|
19
|
+
"border": "subtleGray",
|
|
20
|
+
"borderAccent": "electricBlue",
|
|
21
|
+
"borderMuted": "#1f252d",
|
|
22
|
+
"success": "readoutGreen",
|
|
23
|
+
"error": "alertRed",
|
|
24
|
+
"warning": "warningAmber",
|
|
25
|
+
"muted": "dimAluminum",
|
|
26
|
+
"dim": "#6b7280",
|
|
27
|
+
"text": "",
|
|
28
|
+
"thinkingText": "dimAluminum",
|
|
29
|
+
"selectedBg": "deepBlue",
|
|
30
|
+
"userMessageBg": "darkTitanium",
|
|
31
|
+
"userMessageText": "",
|
|
32
|
+
"customMessageBg": "subtleGray",
|
|
33
|
+
"customMessageText": "",
|
|
34
|
+
"customMessageLabel": "titaniumGold",
|
|
35
|
+
"toolPendingBg": "darkTitanium",
|
|
36
|
+
"toolSuccessBg": "darkTitanium",
|
|
37
|
+
"toolErrorBg": "#1a0f10",
|
|
38
|
+
"toolTitle": "",
|
|
39
|
+
"toolOutput": "dimAluminum",
|
|
40
|
+
"mdHeading": "electricBlue",
|
|
41
|
+
"mdLink": "electricBlue",
|
|
42
|
+
"mdLinkUrl": "deepBlue",
|
|
43
|
+
"mdCode": "readoutGreen",
|
|
44
|
+
"mdCodeBlock": "dimAluminum",
|
|
45
|
+
"mdCodeBlockBorder": "subtleGray",
|
|
46
|
+
"mdQuote": "dimAluminum",
|
|
47
|
+
"mdQuoteBorder": "subtleGray",
|
|
48
|
+
"mdHr": "subtleGray",
|
|
49
|
+
"mdListBullet": "electricBlue",
|
|
50
|
+
"toolDiffAdded": "readoutGreen",
|
|
51
|
+
"toolDiffRemoved": "alertRed",
|
|
52
|
+
"toolDiffContext": "dimAluminum",
|
|
53
|
+
"syntaxComment": "#6b7280",
|
|
54
|
+
"syntaxKeyword": "electricBlue",
|
|
55
|
+
"syntaxFunction": "readoutGreen",
|
|
56
|
+
"syntaxVariable": "brightAluminum",
|
|
57
|
+
"syntaxString": "titaniumGold",
|
|
58
|
+
"syntaxNumber": "warningAmber",
|
|
59
|
+
"syntaxType": "electricBlue",
|
|
60
|
+
"syntaxOperator": "electricBlue",
|
|
61
|
+
"syntaxPunctuation": "dimAluminum",
|
|
62
|
+
"thinkingOff": "#4a5058",
|
|
63
|
+
"thinkingMinimal": "#5a6068",
|
|
64
|
+
"thinkingLow": "#6a7078",
|
|
65
|
+
"thinkingMedium": "dimAluminum",
|
|
66
|
+
"thinkingHigh": "electricBlue",
|
|
67
|
+
"thinkingXhigh": "titaniumGold",
|
|
68
|
+
"bashMode": "readoutGreen",
|
|
69
|
+
"statusLineBg": "darkTitanium",
|
|
70
|
+
"statusLineSep": "subtleGray",
|
|
71
|
+
"statusLineModel": "electricBlue",
|
|
72
|
+
"statusLinePath": "brightAluminum",
|
|
73
|
+
"statusLineGitClean": "readoutGreen",
|
|
74
|
+
"statusLineGitDirty": "warningAmber",
|
|
75
|
+
"statusLineContext": "dimAluminum",
|
|
76
|
+
"statusLineSpend": "titaniumGold",
|
|
77
|
+
"statusLineStaged": "readoutGreen",
|
|
78
|
+
"statusLineDirty": "warningAmber",
|
|
79
|
+
"statusLineUntracked": "dimAluminum",
|
|
80
|
+
"statusLineOutput": "deepBlue",
|
|
81
|
+
"statusLineCost": "titaniumGold",
|
|
82
|
+
"statusLineSubagents": "electricBlue"
|
|
83
|
+
},
|
|
84
|
+
"export": {
|
|
85
|
+
"pageBg": "brushedTitanium",
|
|
86
|
+
"cardBg": "darkTitanium",
|
|
87
|
+
"infoBg": "subtleGray"
|
|
88
|
+
}
|
|
89
|
+
}
|
package/src/modes/print-mode.ts
CHANGED
|
@@ -7,34 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import type { AssistantMessage, ImageContent } from "@oh-my-pi/pi-ai";
|
|
10
|
-
import { APP_NAME, VERSION } from "../config";
|
|
11
10
|
import type { AgentSession } from "../core/agent-session";
|
|
12
|
-
import { logger } from "../core/logger";
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Print session header to stderr (text mode only).
|
|
16
|
-
*/
|
|
17
|
-
function printHeader(session: AgentSession): void {
|
|
18
|
-
const model = session.model;
|
|
19
|
-
const lines = [
|
|
20
|
-
`${APP_NAME} v${VERSION}`,
|
|
21
|
-
"--------",
|
|
22
|
-
`workdir: ${process.cwd()}`,
|
|
23
|
-
`model: ${model?.id ?? "unknown"}`,
|
|
24
|
-
`provider: ${model?.provider ?? "unknown"}`,
|
|
25
|
-
`thinking: ${session.thinkingLevel}`,
|
|
26
|
-
`session: ${session.sessionId}`,
|
|
27
|
-
"--------",
|
|
28
|
-
];
|
|
29
|
-
console.error(lines.join("\n"));
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* Print session footer to stderr (text mode only).
|
|
34
|
-
*/
|
|
35
|
-
function printFooter(): void {
|
|
36
|
-
console.error("--------");
|
|
37
|
-
}
|
|
38
11
|
|
|
39
12
|
/**
|
|
40
13
|
* Run in print (single-shot) mode.
|
|
@@ -53,61 +26,33 @@ export async function runPrintMode(
|
|
|
53
26
|
initialMessage?: string,
|
|
54
27
|
initialImages?: ImageContent[],
|
|
55
28
|
): Promise<void> {
|
|
56
|
-
//
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
// Hook runner already has no-op UI context by default (set in main.ts)
|
|
62
|
-
// Set up hooks for print mode (no UI)
|
|
63
|
-
const hookRunner = session.hookRunner;
|
|
64
|
-
if (hookRunner) {
|
|
65
|
-
hookRunner.initialize({
|
|
29
|
+
// Extension runner already has no-op UI context by default (set in loader)
|
|
30
|
+
// Set up extensions for print mode (no UI)
|
|
31
|
+
const extensionRunner = session.extensionRunner;
|
|
32
|
+
if (extensionRunner) {
|
|
33
|
+
extensionRunner.initialize({
|
|
66
34
|
getModel: () => session.model,
|
|
67
|
-
sendMessageHandler: (message,
|
|
68
|
-
session.
|
|
69
|
-
console.error(`
|
|
35
|
+
sendMessageHandler: (message, options) => {
|
|
36
|
+
session.sendCustomMessage(message, options).catch((e) => {
|
|
37
|
+
console.error(`Extension sendMessage failed: ${e instanceof Error ? e.message : String(e)}`);
|
|
70
38
|
});
|
|
71
39
|
},
|
|
72
40
|
appendEntryHandler: (customType, data) => {
|
|
73
41
|
session.sessionManager.appendCustomEntry(customType, data);
|
|
74
42
|
},
|
|
43
|
+
getActiveToolsHandler: () => session.getActiveToolNames(),
|
|
44
|
+
getAllToolsHandler: () => session.getAllToolNames(),
|
|
45
|
+
setActiveToolsHandler: (toolNames: string[]) => session.setActiveToolsByName(toolNames),
|
|
75
46
|
});
|
|
76
|
-
|
|
77
|
-
console.error(`
|
|
47
|
+
extensionRunner.onError((err) => {
|
|
48
|
+
console.error(`Extension error (${err.extensionPath}): ${err.error}`);
|
|
78
49
|
});
|
|
79
50
|
// Emit session_start event
|
|
80
|
-
await
|
|
51
|
+
await extensionRunner.emit({
|
|
81
52
|
type: "session_start",
|
|
82
53
|
});
|
|
83
54
|
}
|
|
84
55
|
|
|
85
|
-
// Emit session start event to custom tools (no UI in print mode)
|
|
86
|
-
for (const { tool } of session.customTools) {
|
|
87
|
-
if (tool.onSession) {
|
|
88
|
-
try {
|
|
89
|
-
await tool.onSession(
|
|
90
|
-
{
|
|
91
|
-
reason: "start",
|
|
92
|
-
previousSessionFile: undefined,
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
sessionManager: session.sessionManager,
|
|
96
|
-
modelRegistry: session.modelRegistry,
|
|
97
|
-
model: session.model,
|
|
98
|
-
isIdle: () => !session.isStreaming,
|
|
99
|
-
hasQueuedMessages: () => session.queuedMessageCount > 0,
|
|
100
|
-
abort: () => {
|
|
101
|
-
session.abort();
|
|
102
|
-
},
|
|
103
|
-
},
|
|
104
|
-
);
|
|
105
|
-
} catch (err) {
|
|
106
|
-
logger.warn("Tool onSession error", { error: String(err) });
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
|
|
111
56
|
// Always subscribe to enable session persistence via _handleAgentEvent
|
|
112
57
|
session.subscribe((event) => {
|
|
113
58
|
// In JSON mode, output all events
|
|
@@ -147,9 +92,6 @@ export async function runPrintMode(
|
|
|
147
92
|
}
|
|
148
93
|
}
|
|
149
94
|
}
|
|
150
|
-
|
|
151
|
-
// Print footer to stderr
|
|
152
|
-
printFooter();
|
|
153
95
|
}
|
|
154
96
|
|
|
155
97
|
// Ensure stdout is fully flushed before returning
|
|
@@ -210,10 +210,17 @@ export class RpcClient {
|
|
|
210
210
|
}
|
|
211
211
|
|
|
212
212
|
/**
|
|
213
|
-
* Queue a message
|
|
213
|
+
* Queue a steering message to interrupt the agent mid-run.
|
|
214
214
|
*/
|
|
215
|
-
async
|
|
216
|
-
await this.send({ type: "
|
|
215
|
+
async steer(message: string): Promise<void> {
|
|
216
|
+
await this.send({ type: "steer", message });
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
/**
|
|
220
|
+
* Queue a follow-up message to be processed after the agent finishes.
|
|
221
|
+
*/
|
|
222
|
+
async followUp(message: string): Promise<void> {
|
|
223
|
+
await this.send({ type: "follow_up", message });
|
|
217
224
|
}
|
|
218
225
|
|
|
219
226
|
/**
|
|
@@ -226,7 +233,7 @@ export class RpcClient {
|
|
|
226
233
|
/**
|
|
227
234
|
* Start a new session, optionally with parent tracking.
|
|
228
235
|
* @param parentSession - Optional parent session path for lineage tracking
|
|
229
|
-
* @returns Object with `cancelled: true` if
|
|
236
|
+
* @returns Object with `cancelled: true` if an extension cancelled the new session
|
|
230
237
|
*/
|
|
231
238
|
async newSession(parentSession?: string): Promise<{ cancelled: boolean }> {
|
|
232
239
|
const response = await this.send({ type: "new_session", parentSession });
|
|
@@ -285,10 +292,17 @@ export class RpcClient {
|
|
|
285
292
|
}
|
|
286
293
|
|
|
287
294
|
/**
|
|
288
|
-
* Set
|
|
295
|
+
* Set steering mode.
|
|
296
|
+
*/
|
|
297
|
+
async setSteeringMode(mode: "all" | "one-at-a-time"): Promise<void> {
|
|
298
|
+
await this.send({ type: "set_steering_mode", mode });
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
/**
|
|
302
|
+
* Set follow-up mode.
|
|
289
303
|
*/
|
|
290
|
-
async
|
|
291
|
-
await this.send({ type: "
|
|
304
|
+
async setFollowUpMode(mode: "all" | "one-at-a-time"): Promise<void> {
|
|
305
|
+
await this.send({ type: "set_follow_up_mode", mode });
|
|
292
306
|
}
|
|
293
307
|
|
|
294
308
|
/**
|
|
@@ -353,7 +367,7 @@ export class RpcClient {
|
|
|
353
367
|
|
|
354
368
|
/**
|
|
355
369
|
* Switch to a different session file.
|
|
356
|
-
* @returns Object with `cancelled: true` if
|
|
370
|
+
* @returns Object with `cancelled: true` if an extension cancelled the switch
|
|
357
371
|
*/
|
|
358
372
|
async switchSession(sessionPath: string): Promise<{ cancelled: boolean }> {
|
|
359
373
|
const response = await this.send({ type: "switch_session", sessionPath });
|
|
@@ -362,7 +376,7 @@ export class RpcClient {
|
|
|
362
376
|
|
|
363
377
|
/**
|
|
364
378
|
* Branch from a specific message.
|
|
365
|
-
* @returns Object with `text` (the message text) and `cancelled` (if
|
|
379
|
+
* @returns Object with `text` (the message text) and `cancelled` (if extension cancelled)
|
|
366
380
|
*/
|
|
367
381
|
async branch(entryId: string): Promise<{ text: string; cancelled: boolean }> {
|
|
368
382
|
const response = await this.send({ type: "branch", entryId });
|