@mariozechner/pi-coding-agent 0.57.0 → 0.58.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 +59 -1
- package/README.md +3 -1
- package/dist/core/agent-session.d.ts +9 -0
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +57 -9
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/export-html/index.d.ts +5 -2
- package/dist/core/export-html/index.d.ts.map +1 -1
- package/dist/core/export-html/index.js +4 -3
- package/dist/core/export-html/index.js.map +1 -1
- package/dist/core/export-html/template.js +11 -14
- package/dist/core/export-html/tool-renderer.d.ts +5 -2
- package/dist/core/export-html/tool-renderer.d.ts.map +1 -1
- package/dist/core/export-html/tool-renderer.js +12 -5
- package/dist/core/export-html/tool-renderer.js.map +1 -1
- package/dist/core/extensions/index.d.ts +2 -2
- package/dist/core/extensions/index.d.ts.map +1 -1
- package/dist/core/extensions/index.js +1 -1
- package/dist/core/extensions/index.js.map +1 -1
- package/dist/core/extensions/types.d.ts +13 -1
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/extensions/wrapper.d.ts +4 -11
- package/dist/core/extensions/wrapper.d.ts.map +1 -1
- package/dist/core/extensions/wrapper.js +4 -78
- package/dist/core/extensions/wrapper.js.map +1 -1
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +1 -1
- package/dist/core/index.js.map +1 -1
- package/dist/core/resource-loader.d.ts.map +1 -1
- package/dist/core/resource-loader.js +1 -1
- package/dist/core/resource-loader.js.map +1 -1
- package/dist/core/session-manager.d.ts +1 -0
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +1 -1
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/system-prompt.d.ts.map +1 -1
- package/dist/core/system-prompt.js +5 -15
- package/dist/core/system-prompt.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +41 -11
- package/dist/main.js.map +1 -1
- package/dist/modes/interactive/components/extension-editor.d.ts.map +1 -1
- package/dist/modes/interactive/components/extension-editor.js +1 -0
- package/dist/modes/interactive/components/extension-editor.js.map +1 -1
- package/dist/modes/interactive/components/tree-selector.d.ts +17 -0
- package/dist/modes/interactive/components/tree-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/tree-selector.js +111 -6
- package/dist/modes/interactive/components/tree-selector.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +1 -0
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +45 -0
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/utils/exif-orientation.d.ts +5 -0
- package/dist/utils/exif-orientation.d.ts.map +1 -0
- package/dist/utils/exif-orientation.js +158 -0
- package/dist/utils/exif-orientation.js.map +1 -0
- package/dist/utils/image-convert.d.ts.map +1 -1
- package/dist/utils/image-convert.js +5 -1
- package/dist/utils/image-convert.js.map +1 -1
- package/dist/utils/image-resize.d.ts.map +1 -1
- package/dist/utils/image-resize.js +6 -1
- package/dist/utils/image-resize.js.map +1 -1
- package/docs/extensions.md +41 -7
- package/docs/keybindings.md +9 -1
- package/docs/terminal-setup.md +28 -3
- package/docs/tmux.md +30 -8
- package/docs/tree.md +9 -0
- package/examples/extensions/antigravity-image-gen.ts +5 -4
- package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
- package/examples/extensions/custom-provider-anthropic/package.json +1 -1
- package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/examples/extensions/custom-provider-gitlab-duo/test.ts +2 -2
- package/examples/extensions/custom-provider-qwen-cli/package.json +1 -1
- package/examples/extensions/preset.ts +2 -3
- package/examples/extensions/sandbox/index.ts +2 -3
- package/examples/extensions/tool-override.ts +2 -3
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- package/package.json +4 -4
package/docs/tree.md
CHANGED
|
@@ -33,16 +33,25 @@ Sessions are stored as trees where each entry has an `id` and `parentId`. The "l
|
|
|
33
33
|
| Key | Action |
|
|
34
34
|
|-----|--------|
|
|
35
35
|
| ↑/↓ | Navigate (depth-first order) |
|
|
36
|
+
| ←/→ | Page up/down |
|
|
37
|
+
| Ctrl+←/Ctrl+→ or Alt+←/Alt+→ | Fold/unfold and jump between branch segments |
|
|
36
38
|
| Enter | Select node |
|
|
37
39
|
| Escape/Ctrl+C | Cancel |
|
|
38
40
|
| Ctrl+U | Toggle: user messages only |
|
|
39
41
|
| Ctrl+O | Toggle: show all (including custom/label entries) |
|
|
40
42
|
|
|
43
|
+
`Ctrl+←` or `Alt+←` folds the current node if it is foldable. Foldable nodes are roots and branch segment starts that have visible children. If the current node is not foldable, or is already folded, the selection jumps up to the previous visible branch segment start.
|
|
44
|
+
|
|
45
|
+
`Ctrl+→` or `Alt+→` unfolds the current node if it is folded. Otherwise, the selection jumps down to the next visible branch segment start, or to the branch end when there is no further branch point.
|
|
46
|
+
|
|
41
47
|
### Display
|
|
42
48
|
|
|
43
49
|
- Height: half terminal height
|
|
44
50
|
- Current leaf marked with `← active`
|
|
45
51
|
- Labels shown inline: `[label-name]`
|
|
52
|
+
- Foldable branch starts show `⊟` in the connector. Folded branches show `⊞`
|
|
53
|
+
- Active path marker `•` appears after the fold indicator when applicable
|
|
54
|
+
- Search and filter changes reset all folds
|
|
46
55
|
- Default filter hides `label` and `custom` entries (shown in Ctrl+O mode)
|
|
47
56
|
- Children sorted by timestamp (oldest first)
|
|
48
57
|
|
|
@@ -28,10 +28,9 @@
|
|
|
28
28
|
import { randomUUID } from "node:crypto";
|
|
29
29
|
import { existsSync, readFileSync } from "node:fs";
|
|
30
30
|
import { mkdir, writeFile } from "node:fs/promises";
|
|
31
|
-
import { homedir } from "node:os";
|
|
32
31
|
import { join } from "node:path";
|
|
33
32
|
import { StringEnum } from "@mariozechner/pi-ai";
|
|
34
|
-
import type
|
|
33
|
+
import { type ExtensionAPI, getAgentDir } from "@mariozechner/pi-coding-agent";
|
|
35
34
|
import { type Static, Type } from "@sinclair/typebox";
|
|
36
35
|
|
|
37
36
|
const PROVIDER = "google-antigravity";
|
|
@@ -184,7 +183,8 @@ function readConfigFile(path: string): ExtensionConfig {
|
|
|
184
183
|
}
|
|
185
184
|
|
|
186
185
|
function loadConfig(cwd: string): ExtensionConfig {
|
|
187
|
-
const
|
|
186
|
+
const globalPath = join(getAgentDir(), "extensions", "antigravity-image-gen.json");
|
|
187
|
+
const globalConfig = readConfigFile(globalPath);
|
|
188
188
|
const projectConfig = readConfigFile(join(cwd, ".pi", "extensions", "antigravity-image-gen.json"));
|
|
189
189
|
return { ...globalConfig, ...projectConfig };
|
|
190
190
|
}
|
|
@@ -204,7 +204,8 @@ function resolveSaveConfig(params: ToolParams, cwd: string): SaveConfig {
|
|
|
204
204
|
}
|
|
205
205
|
|
|
206
206
|
if (mode === "global") {
|
|
207
|
-
|
|
207
|
+
const outputDir = join(getAgentDir(), "generated-images");
|
|
208
|
+
return { mode, outputDir };
|
|
208
209
|
}
|
|
209
210
|
|
|
210
211
|
if (mode === "custom") {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-extension-custom-provider",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.9.0",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "pi-extension-custom-provider",
|
|
9
|
-
"version": "1.
|
|
9
|
+
"version": "1.9.0",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@anthropic-ai/sdk": "^0.52.0"
|
|
12
12
|
}
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
import { type Api, type Context, type Model, registerApiProvider, streamSimple } from "@mariozechner/pi-ai";
|
|
12
12
|
import { readFileSync } from "fs";
|
|
13
|
-
import {
|
|
13
|
+
import { getAgentDir } from "packages/coding-agent/src/config.js";
|
|
14
14
|
import { join } from "path";
|
|
15
15
|
import { MODELS, streamGitLabDuo } from "./index.js";
|
|
16
16
|
|
|
@@ -28,7 +28,7 @@ async function main() {
|
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
// Read auth
|
|
31
|
-
const authPath = join(
|
|
31
|
+
const authPath = join(getAgentDir(), "extensions", "auth.json");
|
|
32
32
|
const authData = JSON.parse(readFileSync(authPath, "utf-8"));
|
|
33
33
|
const gitlabCred = authData["gitlab-duo"];
|
|
34
34
|
if (!gitlabCred?.access) {
|
|
@@ -39,10 +39,9 @@
|
|
|
39
39
|
*/
|
|
40
40
|
|
|
41
41
|
import { existsSync, readFileSync } from "node:fs";
|
|
42
|
-
import { homedir } from "node:os";
|
|
43
42
|
import { join } from "node:path";
|
|
44
43
|
import type { ExtensionAPI, ExtensionContext } from "@mariozechner/pi-coding-agent";
|
|
45
|
-
import { DynamicBorder } from "@mariozechner/pi-coding-agent";
|
|
44
|
+
import { DynamicBorder, getAgentDir } from "@mariozechner/pi-coding-agent";
|
|
46
45
|
import { Container, Key, type SelectItem, SelectList, Text } from "@mariozechner/pi-tui";
|
|
47
46
|
|
|
48
47
|
// Preset configuration
|
|
@@ -68,7 +67,7 @@ interface PresetsConfig {
|
|
|
68
67
|
* Project-local presets override global presets with the same name.
|
|
69
68
|
*/
|
|
70
69
|
function loadPresets(cwd: string): PresetsConfig {
|
|
71
|
-
const globalPath = join(
|
|
70
|
+
const globalPath = join(getAgentDir(), "presets.json");
|
|
72
71
|
const projectPath = join(cwd, ".pi", "presets.json");
|
|
73
72
|
|
|
74
73
|
let globalPresets: PresetsConfig = {};
|
|
@@ -39,11 +39,10 @@
|
|
|
39
39
|
|
|
40
40
|
import { spawn } from "node:child_process";
|
|
41
41
|
import { existsSync, readFileSync } from "node:fs";
|
|
42
|
-
import { homedir } from "node:os";
|
|
43
42
|
import { join } from "node:path";
|
|
44
43
|
import { SandboxManager, type SandboxRuntimeConfig } from "@anthropic-ai/sandbox-runtime";
|
|
45
44
|
import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
|
|
46
|
-
import { type BashOperations, createBashTool } from "@mariozechner/pi-coding-agent";
|
|
45
|
+
import { type BashOperations, createBashTool, getAgentDir } from "@mariozechner/pi-coding-agent";
|
|
47
46
|
|
|
48
47
|
interface SandboxConfig extends SandboxRuntimeConfig {
|
|
49
48
|
enabled?: boolean;
|
|
@@ -75,7 +74,7 @@ const DEFAULT_CONFIG: SandboxConfig = {
|
|
|
75
74
|
|
|
76
75
|
function loadConfig(cwd: string): SandboxConfig {
|
|
77
76
|
const projectConfigPath = join(cwd, ".pi", "sandbox.json");
|
|
78
|
-
const globalConfigPath = join(
|
|
77
|
+
const globalConfigPath = join(getAgentDir(), "extensions", "sandbox.json");
|
|
79
78
|
|
|
80
79
|
let globalConfig: Partial<SandboxConfig> = {};
|
|
81
80
|
let projectConfig: Partial<SandboxConfig> = {};
|
|
@@ -21,14 +21,13 @@
|
|
|
21
21
|
*/
|
|
22
22
|
|
|
23
23
|
import type { TextContent } from "@mariozechner/pi-ai";
|
|
24
|
-
import type
|
|
24
|
+
import { type ExtensionAPI, getAgentDir } from "@mariozechner/pi-coding-agent";
|
|
25
25
|
import { Type } from "@sinclair/typebox";
|
|
26
26
|
import { appendFileSync, constants, readFileSync } from "fs";
|
|
27
27
|
import { access, readFile } from "fs/promises";
|
|
28
|
-
import { homedir } from "os";
|
|
29
28
|
import { join, resolve } from "path";
|
|
30
29
|
|
|
31
|
-
const LOG_FILE = join(
|
|
30
|
+
const LOG_FILE = join(getAgentDir(), "read-access.log");
|
|
32
31
|
|
|
33
32
|
// Paths that are blocked from reading
|
|
34
33
|
const BLOCKED_PATTERNS = [
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-extension-with-deps",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.22.0",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "pi-extension-with-deps",
|
|
9
|
-
"version": "1.
|
|
9
|
+
"version": "1.22.0",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"ms": "^2.1.3"
|
|
12
12
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mariozechner/pi-coding-agent",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.58.0",
|
|
4
4
|
"description": "Coding agent CLI with read, bash, edit, write tools and session management",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"piConfig": {
|
|
@@ -40,9 +40,9 @@
|
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@mariozechner/jiti": "^2.6.2",
|
|
43
|
-
"@mariozechner/pi-agent-core": "^0.
|
|
44
|
-
"@mariozechner/pi-ai": "^0.
|
|
45
|
-
"@mariozechner/pi-tui": "^0.
|
|
43
|
+
"@mariozechner/pi-agent-core": "^0.58.0",
|
|
44
|
+
"@mariozechner/pi-ai": "^0.58.0",
|
|
45
|
+
"@mariozechner/pi-tui": "^0.58.0",
|
|
46
46
|
"@silvia-odwyer/photon-node": "^0.3.4",
|
|
47
47
|
"chalk": "^5.5.0",
|
|
48
48
|
"cli-highlight": "^2.1.11",
|