agent-sh 0.15.0 → 0.15.2
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/dist/agent/agent-loop.js +11 -8
- package/dist/agent/events.d.ts +4 -0
- package/docs/README.md +14 -0
- package/docs/agent.md +398 -0
- package/docs/architecture.md +196 -0
- package/docs/context-management.md +200 -0
- package/docs/extensions.md +951 -0
- package/docs/library.md +84 -0
- package/docs/troubleshooting.md +65 -0
- package/docs/tui-composition.md +294 -0
- package/docs/usage.md +306 -0
- package/examples/extensions/ash-scheme/package.json +1 -1
- package/examples/extensions/ashi/EXTENDING.md +2 -2
- package/examples/extensions/ashi/README.md +2 -2
- package/examples/extensions/ashi/docs/ui-surface-protocol.md +1 -1
- package/examples/extensions/ashi/package.json +5 -3
- package/examples/extensions/ashi/src/chat/tool-group.ts +3 -2
- package/examples/extensions/ashi/src/cli.ts +9 -8
- package/examples/extensions/ashi/src/dialogs.ts +16 -1
- package/examples/extensions/ashi/src/events.ts +1 -0
- package/examples/extensions/ashi/src/frontend.ts +26 -6
- package/examples/extensions/ashi/src/renderer.ts +24 -4
- package/examples/extensions/ashi/src/renderers/pi-tui/schema-mount.ts +4 -3
- package/examples/extensions/ashi/src/renderers/pi-tui/tool-group.ts +5 -8
- package/examples/extensions/ashi/src/ui.ts +11 -0
- package/examples/extensions/ashi-ink/package.json +2 -2
- package/examples/extensions/claude-code-bridge/package.json +1 -1
- package/examples/extensions/opencode-bridge/package.json +1 -1
- package/package.json +3 -1
- package/src/agent/agent-loop.ts +1566 -0
- package/src/agent/entry-format.ts +19 -0
- package/src/agent/events.ts +153 -0
- package/src/agent/extensions/rolling-history/constants.ts +1 -0
- package/src/agent/extensions/rolling-history/index.ts +202 -0
- package/src/agent/extensions/rolling-history/recall.ts +131 -0
- package/src/agent/extensions/rolling-history/strategy.ts +404 -0
- package/src/agent/host-types.ts +192 -0
- package/src/agent/index.ts +591 -0
- package/src/agent/live-view.ts +279 -0
- package/src/agent/llm-client.ts +111 -0
- package/src/agent/llm-facade.ts +43 -0
- package/src/agent/normalize-args.ts +61 -0
- package/src/agent/nuclear-form.ts +382 -0
- package/src/agent/providers/deepseek.ts +39 -0
- package/src/agent/providers/ollama.ts +92 -0
- package/src/agent/providers/openai-compatible.ts +36 -0
- package/src/agent/providers/openai.ts +52 -0
- package/src/agent/providers/opencode.ts +142 -0
- package/src/agent/providers/openrouter.ts +105 -0
- package/src/agent/providers/zai-coding-plan.ts +33 -0
- package/src/agent/session-store.ts +336 -0
- package/src/agent/skills.ts +228 -0
- package/src/agent/store.ts +310 -0
- package/src/agent/subagent.ts +305 -0
- package/src/agent/system-prompt.ts +151 -0
- package/src/agent/token-budget.ts +12 -0
- package/src/agent/tool-protocol.ts +722 -0
- package/src/agent/tool-registry.ts +66 -0
- package/src/agent/tools/bash.ts +95 -0
- package/src/agent/tools/edit-file.ts +154 -0
- package/src/agent/tools/expand-home.ts +7 -0
- package/src/agent/tools/glob.ts +108 -0
- package/src/agent/tools/grep.ts +228 -0
- package/src/agent/tools/list-skills.ts +37 -0
- package/src/agent/tools/ls.ts +81 -0
- package/src/agent/tools/pwsh.ts +140 -0
- package/src/agent/tools/read-file.ts +164 -0
- package/src/agent/tools/write-file.ts +72 -0
- package/src/agent/types.ts +149 -0
- package/src/cli/args.ts +91 -0
- package/src/cli/auth/cli.ts +244 -0
- package/src/cli/auth/discover.ts +52 -0
- package/src/cli/auth/keys.ts +143 -0
- package/src/cli/index.ts +295 -0
- package/src/cli/init.ts +74 -0
- package/src/cli/install.ts +439 -0
- package/src/cli/shell-env.ts +68 -0
- package/src/cli/subcommands.ts +24 -0
- package/src/core/event-bus.ts +252 -0
- package/src/core/extension-loader.ts +347 -0
- package/src/core/index.ts +152 -0
- package/src/core/settings.ts +398 -0
- package/src/core/types.ts +61 -0
- package/src/extensions/file-autocomplete.ts +71 -0
- package/src/extensions/index.ts +38 -0
- package/src/extensions/slash-commands/events.ts +14 -0
- package/src/extensions/slash-commands/index.ts +269 -0
- package/src/shell/events.ts +73 -0
- package/src/shell/host-types.ts +150 -0
- package/src/shell/index.ts +159 -0
- package/src/shell/input-handler.ts +505 -0
- package/src/shell/output-parser.ts +156 -0
- package/src/shell/shell-context.ts +193 -0
- package/src/shell/shell.ts +414 -0
- package/src/shell/strategies/bash.ts +83 -0
- package/src/shell/strategies/fish.ts +77 -0
- package/src/shell/strategies/index.ts +24 -0
- package/src/shell/strategies/types.ts +64 -0
- package/src/shell/strategies/zsh.ts +92 -0
- package/src/shell/terminal.ts +124 -0
- package/src/shell/tui-input-view.ts +222 -0
- package/src/shell/tui-renderer.ts +1126 -0
- package/src/utils/ansi.ts +140 -0
- package/src/utils/box-frame.ts +138 -0
- package/src/utils/compositor.ts +157 -0
- package/src/utils/diff-renderer.ts +829 -0
- package/src/utils/diff.ts +244 -0
- package/src/utils/executor.ts +305 -0
- package/src/utils/file-watcher.ts +110 -0
- package/src/utils/floating-panel.ts +1160 -0
- package/src/utils/handler-registry.ts +110 -0
- package/src/utils/line-editor.ts +636 -0
- package/src/utils/markdown.ts +437 -0
- package/src/utils/message-utils.ts +113 -0
- package/src/utils/package-version.ts +12 -0
- package/src/utils/palette.ts +64 -0
- package/src/utils/ref-counter.ts +9 -0
- package/src/utils/ripgrep-path.ts +17 -0
- package/src/utils/shell-output-spill.ts +76 -0
- package/src/utils/stream-transform.ts +292 -0
- package/src/utils/terminal-buffer.ts +213 -0
- package/src/utils/tool-display.ts +315 -0
- package/src/utils/tool-interactive.ts +71 -0
- package/src/utils/tty.ts +14 -0
|
@@ -136,8 +136,9 @@ class SchemaResultComponent extends Container {
|
|
|
136
136
|
this.handle.dispatch("status", { ...opts, elapsedMs: 0 });
|
|
137
137
|
HANDLES.delete(this.handle.toolCallId);
|
|
138
138
|
}
|
|
139
|
-
|
|
140
|
-
this.handle.cell.env
|
|
139
|
+
setExpanded(expanded: boolean): void {
|
|
140
|
+
if (this.handle.cell.env.expanded === expanded) return;
|
|
141
|
+
this.handle.cell.env = { ...this.handle.cell.env, expanded };
|
|
141
142
|
this.repaint();
|
|
142
143
|
this.handle.cell.callView?.repaint();
|
|
143
144
|
}
|
|
@@ -198,6 +199,6 @@ export function mountResult<S>(model: RenderModel<S>, args: MountArgs, env: Moun
|
|
|
198
199
|
appendChunk: (chunk) => comp.appendChunk(chunk),
|
|
199
200
|
setDiffRenderer: (fn) => comp.setDiffRenderer(fn),
|
|
200
201
|
finalize: (opts) => comp.finalize(opts),
|
|
201
|
-
|
|
202
|
+
setExpanded: (expanded) => comp.setExpanded(expanded),
|
|
202
203
|
};
|
|
203
204
|
}
|
|
@@ -3,18 +3,15 @@ import { createNodes } from "./nodes.js";
|
|
|
3
3
|
|
|
4
4
|
export function createPiTuiToolGroup(): ToolGroupView {
|
|
5
5
|
const nodes = createNodes();
|
|
6
|
-
const rows = nodes.container();
|
|
7
6
|
const container = nodes.container();
|
|
8
7
|
container.addChild(nodes.spacer(1));
|
|
9
|
-
|
|
8
|
+
const text = nodes.text({ paddingX: 1 });
|
|
9
|
+
container.addChild(text.node);
|
|
10
10
|
|
|
11
11
|
const update = (model: ToolGroupModel): void => {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
t.setText(line);
|
|
16
|
-
rows.addChild(t.node);
|
|
17
|
-
}
|
|
12
|
+
// paddingX:1 on both sides → content area is width-2; render width-aware so
|
|
13
|
+
// long paths truncate to fit rather than wrap.
|
|
14
|
+
text.setRenderFn((width) => renderToolGroupLines(model, Math.max(1, width - 2)));
|
|
18
15
|
};
|
|
19
16
|
|
|
20
17
|
return { node: container.node, update };
|
|
@@ -10,6 +10,13 @@ export type { StatusSegment } from "./status-footer.js";
|
|
|
10
10
|
|
|
11
11
|
export type NoticeLevel = "info" | "warn" | "error" | "success";
|
|
12
12
|
|
|
13
|
+
export interface DiffOpts {
|
|
14
|
+
before?: string | null;
|
|
15
|
+
after?: string;
|
|
16
|
+
filePath?: string;
|
|
17
|
+
boxed?: boolean;
|
|
18
|
+
}
|
|
19
|
+
|
|
13
20
|
export interface Contribution {
|
|
14
21
|
/** Re-pull this surface (call after the content it depends on changes). */
|
|
15
22
|
refresh(): void;
|
|
@@ -26,6 +33,7 @@ export interface Ui {
|
|
|
26
33
|
notify(message: string, level?: NoticeLevel): void;
|
|
27
34
|
select(opts: SelectOpts): Promise<string | undefined>;
|
|
28
35
|
confirm(opts: ConfirmOpts): Promise<boolean>;
|
|
36
|
+
diff(opts: DiffOpts): (width: number) => string[];
|
|
29
37
|
input(opts?: InputOpts): Promise<string | undefined>;
|
|
30
38
|
getEditorText(): string;
|
|
31
39
|
setEditorText(text: string): void;
|
|
@@ -50,6 +58,9 @@ export function createUi(ctx: ExtensionContext): Ui {
|
|
|
50
58
|
if (!has("ui:confirm")) return Promise.resolve(false);
|
|
51
59
|
return ctx.call("ui:confirm", opts) as Promise<boolean>;
|
|
52
60
|
},
|
|
61
|
+
diff(opts) {
|
|
62
|
+
return has("ui:diff") ? (ctx.call("ui:diff", opts) as (width: number) => string[]) : (() => []);
|
|
63
|
+
},
|
|
53
64
|
input(opts = {}) {
|
|
54
65
|
if (!has("ui:input")) return Promise.resolve(undefined);
|
|
55
66
|
return ctx.call("ui:input", opts) as Promise<string | undefined>;
|
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"@earendil-works/pi-tui": "^0.74.0",
|
|
14
|
-
"@guanyilun/ashi": "^0.
|
|
15
|
-
"agent-sh": "^0.
|
|
14
|
+
"@guanyilun/ashi": "^0.3.0",
|
|
15
|
+
"agent-sh": "^0.15.0",
|
|
16
16
|
"cli-table3": "^0.6.0",
|
|
17
17
|
"ink": "^5.0.0",
|
|
18
18
|
"ink-spinner": "^5.0.0",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agent-sh",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.2",
|
|
4
4
|
"description": "A composable agent runtime — pair any frontend with any agent backend over one shared extension layer",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"workspaces": [
|
|
@@ -140,6 +140,8 @@
|
|
|
140
140
|
},
|
|
141
141
|
"files": [
|
|
142
142
|
"dist",
|
|
143
|
+
"src",
|
|
144
|
+
"docs",
|
|
143
145
|
"examples/extensions"
|
|
144
146
|
],
|
|
145
147
|
"scripts": {
|