@eminent337/aery 0.67.68
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 +3768 -0
- package/README.md +623 -0
- package/docs/compaction.md +394 -0
- package/docs/custom-provider.md +637 -0
- package/docs/development.md +71 -0
- package/docs/extensions.md +2368 -0
- package/docs/images/doom-extension.png +0 -0
- package/docs/images/exy.png +0 -0
- package/docs/images/interactive-mode.png +0 -0
- package/docs/images/tree-view.png +0 -0
- package/docs/json.md +82 -0
- package/docs/keybindings.md +197 -0
- package/docs/models.md +395 -0
- package/docs/packages.md +218 -0
- package/docs/prompt-templates.md +88 -0
- package/docs/providers.md +195 -0
- package/docs/rpc.md +1407 -0
- package/docs/sdk.md +1149 -0
- package/docs/session.md +412 -0
- package/docs/settings.md +247 -0
- package/docs/shell-aliases.md +13 -0
- package/docs/skills.md +232 -0
- package/docs/terminal-setup.md +106 -0
- package/docs/termux.md +127 -0
- package/docs/themes.md +295 -0
- package/docs/tmux.md +61 -0
- package/docs/tree.md +233 -0
- package/docs/tui.md +918 -0
- package/docs/windows.md +17 -0
- package/examples/README.md +25 -0
- package/examples/extensions/README.md +208 -0
- package/examples/extensions/antigravity-image-gen.ts +418 -0
- package/examples/extensions/auto-commit-on-exit.ts +49 -0
- package/examples/extensions/bash-spawn-hook.ts +30 -0
- package/examples/extensions/bookmark.ts +50 -0
- package/examples/extensions/built-in-tool-renderer.ts +249 -0
- package/examples/extensions/claude-rules.ts +86 -0
- package/examples/extensions/commands.ts +72 -0
- package/examples/extensions/confirm-destructive.ts +59 -0
- package/examples/extensions/custom-compaction.ts +127 -0
- package/examples/extensions/custom-footer.ts +64 -0
- package/examples/extensions/custom-header.ts +73 -0
- package/examples/extensions/custom-provider-anthropic/index.ts +604 -0
- package/examples/extensions/custom-provider-anthropic/package-lock.json +24 -0
- package/examples/extensions/custom-provider-anthropic/package.json +19 -0
- package/examples/extensions/custom-provider-gitlab-duo/index.ts +349 -0
- package/examples/extensions/custom-provider-gitlab-duo/package.json +16 -0
- package/examples/extensions/custom-provider-gitlab-duo/test.ts +82 -0
- package/examples/extensions/custom-provider-qwen-cli/index.ts +345 -0
- package/examples/extensions/custom-provider-qwen-cli/package.json +16 -0
- package/examples/extensions/dirty-repo-guard.ts +56 -0
- package/examples/extensions/doom-overlay/README.md +46 -0
- package/examples/extensions/doom-overlay/doom/build/doom.js +21 -0
- package/examples/extensions/doom-overlay/doom/build/doom.wasm +0 -0
- package/examples/extensions/doom-overlay/doom/build.sh +152 -0
- package/examples/extensions/doom-overlay/doom/doomgeneric_pi.c +72 -0
- package/examples/extensions/doom-overlay/doom-component.ts +132 -0
- package/examples/extensions/doom-overlay/doom-engine.ts +173 -0
- package/examples/extensions/doom-overlay/doom-keys.ts +104 -0
- package/examples/extensions/doom-overlay/index.ts +74 -0
- package/examples/extensions/doom-overlay/wad-finder.ts +51 -0
- package/examples/extensions/dynamic-resources/SKILL.md +8 -0
- package/examples/extensions/dynamic-resources/dynamic.json +79 -0
- package/examples/extensions/dynamic-resources/dynamic.md +5 -0
- package/examples/extensions/dynamic-resources/index.ts +15 -0
- package/examples/extensions/dynamic-tools.ts +74 -0
- package/examples/extensions/event-bus.ts +43 -0
- package/examples/extensions/file-trigger.ts +41 -0
- package/examples/extensions/git-checkpoint.ts +53 -0
- package/examples/extensions/handoff.ts +153 -0
- package/examples/extensions/hello.ts +26 -0
- package/examples/extensions/hidden-thinking-label.ts +53 -0
- package/examples/extensions/inline-bash.ts +94 -0
- package/examples/extensions/input-transform.ts +43 -0
- package/examples/extensions/interactive-shell.ts +196 -0
- package/examples/extensions/mac-system-theme.ts +47 -0
- package/examples/extensions/message-renderer.ts +59 -0
- package/examples/extensions/minimal-mode.ts +426 -0
- package/examples/extensions/modal-editor.ts +85 -0
- package/examples/extensions/model-status.ts +31 -0
- package/examples/extensions/notify.ts +55 -0
- package/examples/extensions/overlay-qa-tests.ts +1348 -0
- package/examples/extensions/overlay-test.ts +150 -0
- package/examples/extensions/permission-gate.ts +34 -0
- package/examples/extensions/pirate.ts +47 -0
- package/examples/extensions/plan-mode/README.md +65 -0
- package/examples/extensions/plan-mode/index.ts +340 -0
- package/examples/extensions/plan-mode/utils.ts +168 -0
- package/examples/extensions/preset.ts +430 -0
- package/examples/extensions/protected-paths.ts +30 -0
- package/examples/extensions/provider-payload.ts +18 -0
- package/examples/extensions/qna.ts +122 -0
- package/examples/extensions/question.ts +264 -0
- package/examples/extensions/questionnaire.ts +427 -0
- package/examples/extensions/rainbow-editor.ts +88 -0
- package/examples/extensions/reload-runtime.ts +37 -0
- package/examples/extensions/rpc-demo.ts +118 -0
- package/examples/extensions/sandbox/index.ts +321 -0
- package/examples/extensions/sandbox/package-lock.json +92 -0
- package/examples/extensions/sandbox/package.json +19 -0
- package/examples/extensions/send-user-message.ts +97 -0
- package/examples/extensions/session-name.ts +27 -0
- package/examples/extensions/shutdown-command.ts +63 -0
- package/examples/extensions/snake.ts +343 -0
- package/examples/extensions/space-invaders.ts +560 -0
- package/examples/extensions/ssh.ts +220 -0
- package/examples/extensions/status-line.ts +32 -0
- package/examples/extensions/subagent/README.md +172 -0
- package/examples/extensions/subagent/agents/planner.md +37 -0
- package/examples/extensions/subagent/agents/reviewer.md +35 -0
- package/examples/extensions/subagent/agents/scout.md +50 -0
- package/examples/extensions/subagent/agents/worker.md +24 -0
- package/examples/extensions/subagent/agents.ts +126 -0
- package/examples/extensions/subagent/index.ts +987 -0
- package/examples/extensions/subagent/prompts/implement-and-review.md +10 -0
- package/examples/extensions/subagent/prompts/implement.md +10 -0
- package/examples/extensions/subagent/prompts/scout-and-plan.md +9 -0
- package/examples/extensions/summarize.ts +206 -0
- package/examples/extensions/system-prompt-header.ts +17 -0
- package/examples/extensions/tic-tac-toe.ts +1008 -0
- package/examples/extensions/timed-confirm.ts +70 -0
- package/examples/extensions/titlebar-spinner.ts +58 -0
- package/examples/extensions/todo.ts +297 -0
- package/examples/extensions/tool-override.ts +144 -0
- package/examples/extensions/tools.ts +141 -0
- package/examples/extensions/trigger-compact.ts +50 -0
- package/examples/extensions/truncated-tool.ts +195 -0
- package/examples/extensions/widget-placement.ts +9 -0
- package/examples/extensions/with-deps/index.ts +32 -0
- package/examples/extensions/with-deps/package-lock.json +31 -0
- package/examples/extensions/with-deps/package.json +22 -0
- package/examples/extensions/working-indicator.ts +123 -0
- package/examples/rpc-extension-ui.ts +632 -0
- package/examples/sdk/01-minimal.ts +22 -0
- package/examples/sdk/02-custom-model.ts +49 -0
- package/examples/sdk/03-custom-prompt.ts +62 -0
- package/examples/sdk/04-skills.ts +55 -0
- package/examples/sdk/05-tools.ts +44 -0
- package/examples/sdk/06-extensions.ts +90 -0
- package/examples/sdk/07-context-files.ts +42 -0
- package/examples/sdk/08-prompt-templates.ts +51 -0
- package/examples/sdk/09-api-keys-and-oauth.ts +48 -0
- package/examples/sdk/10-settings.ts +53 -0
- package/examples/sdk/11-sessions.ts +48 -0
- package/examples/sdk/12-full-control.ts +73 -0
- package/examples/sdk/13-session-runtime.ts +67 -0
- package/examples/sdk/README.md +147 -0
- package/package.json +102 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Worker implements, reviewer reviews, worker applies feedback
|
|
3
|
+
---
|
|
4
|
+
Use the subagent tool with the chain parameter to execute this workflow:
|
|
5
|
+
|
|
6
|
+
1. First, use the "worker" agent to implement: $@
|
|
7
|
+
2. Then, use the "reviewer" agent to review the implementation from the previous step (use {previous} placeholder)
|
|
8
|
+
3. Finally, use the "worker" agent to apply the feedback from the review (use {previous} placeholder)
|
|
9
|
+
|
|
10
|
+
Execute this as a chain, passing output between steps via {previous}.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Full implementation workflow - scout gathers context, planner creates plan, worker implements
|
|
3
|
+
---
|
|
4
|
+
Use the subagent tool with the chain parameter to execute this workflow:
|
|
5
|
+
|
|
6
|
+
1. First, use the "scout" agent to find all code relevant to: $@
|
|
7
|
+
2. Then, use the "planner" agent to create an implementation plan for "$@" using the context from the previous step (use {previous} placeholder)
|
|
8
|
+
3. Finally, use the "worker" agent to implement the plan from the previous step (use {previous} placeholder)
|
|
9
|
+
|
|
10
|
+
Execute this as a chain, passing output between steps via {previous}.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Scout gathers context, planner creates implementation plan (no implementation)
|
|
3
|
+
---
|
|
4
|
+
Use the subagent tool with the chain parameter to execute this workflow:
|
|
5
|
+
|
|
6
|
+
1. First, use the "scout" agent to find all code relevant to: $@
|
|
7
|
+
2. Then, use the "planner" agent to create an implementation plan for "$@" using the context from the previous step (use {previous} placeholder)
|
|
8
|
+
|
|
9
|
+
Execute this as a chain, passing output between steps via {previous}. Do NOT implement - just return the plan.
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
import { complete, getModel } from "@aryee/aery-ai";
|
|
2
|
+
import type { ExtensionAPI, ExtensionCommandContext } from "@aryee/aery";
|
|
3
|
+
import { DynamicBorder, getMarkdownTheme } from "@aryee/aery";
|
|
4
|
+
import { Container, Markdown, matchesKey, Text } from "@aryee/aery-tui";
|
|
5
|
+
|
|
6
|
+
type ContentBlock = {
|
|
7
|
+
type?: string;
|
|
8
|
+
text?: string;
|
|
9
|
+
name?: string;
|
|
10
|
+
arguments?: Record<string, unknown>;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
type SessionEntry = {
|
|
14
|
+
type: string;
|
|
15
|
+
message?: {
|
|
16
|
+
role?: string;
|
|
17
|
+
content?: unknown;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const extractTextParts = (content: unknown): string[] => {
|
|
22
|
+
if (typeof content === "string") {
|
|
23
|
+
return [content];
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
if (!Array.isArray(content)) {
|
|
27
|
+
return [];
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const textParts: string[] = [];
|
|
31
|
+
for (const part of content) {
|
|
32
|
+
if (!part || typeof part !== "object") {
|
|
33
|
+
continue;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const block = part as ContentBlock;
|
|
37
|
+
if (block.type === "text" && typeof block.text === "string") {
|
|
38
|
+
textParts.push(block.text);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return textParts;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
const extractToolCallLines = (content: unknown): string[] => {
|
|
46
|
+
if (!Array.isArray(content)) {
|
|
47
|
+
return [];
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const toolCalls: string[] = [];
|
|
51
|
+
for (const part of content) {
|
|
52
|
+
if (!part || typeof part !== "object") {
|
|
53
|
+
continue;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const block = part as ContentBlock;
|
|
57
|
+
if (block.type !== "toolCall" || typeof block.name !== "string") {
|
|
58
|
+
continue;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const args = block.arguments ?? {};
|
|
62
|
+
toolCalls.push(`Tool ${block.name} was called with args ${JSON.stringify(args)}`);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
return toolCalls;
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
const buildConversationText = (entries: SessionEntry[]): string => {
|
|
69
|
+
const sections: string[] = [];
|
|
70
|
+
|
|
71
|
+
for (const entry of entries) {
|
|
72
|
+
if (entry.type !== "message" || !entry.message?.role) {
|
|
73
|
+
continue;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
const role = entry.message.role;
|
|
77
|
+
const isUser = role === "user";
|
|
78
|
+
const isAssistant = role === "assistant";
|
|
79
|
+
|
|
80
|
+
if (!isUser && !isAssistant) {
|
|
81
|
+
continue;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
const entryLines: string[] = [];
|
|
85
|
+
const textParts = extractTextParts(entry.message.content);
|
|
86
|
+
if (textParts.length > 0) {
|
|
87
|
+
const roleLabel = isUser ? "User" : "Assistant";
|
|
88
|
+
const messageText = textParts.join("\n").trim();
|
|
89
|
+
if (messageText.length > 0) {
|
|
90
|
+
entryLines.push(`${roleLabel}: ${messageText}`);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
if (isAssistant) {
|
|
95
|
+
entryLines.push(...extractToolCallLines(entry.message.content));
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
if (entryLines.length > 0) {
|
|
99
|
+
sections.push(entryLines.join("\n"));
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
return sections.join("\n\n");
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
const buildSummaryPrompt = (conversationText: string): string =>
|
|
107
|
+
[
|
|
108
|
+
"Summarize this conversation so I can resume it later.",
|
|
109
|
+
"Include goals, key decisions, progress, open questions, and next steps.",
|
|
110
|
+
"Keep it concise and structured with headings.",
|
|
111
|
+
"",
|
|
112
|
+
"<conversation>",
|
|
113
|
+
conversationText,
|
|
114
|
+
"</conversation>",
|
|
115
|
+
].join("\n");
|
|
116
|
+
|
|
117
|
+
const showSummaryUi = async (summary: string, ctx: ExtensionCommandContext) => {
|
|
118
|
+
if (!ctx.hasUI) {
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
await ctx.ui.custom((_tui, theme, _kb, done) => {
|
|
123
|
+
const container = new Container();
|
|
124
|
+
const border = new DynamicBorder((s: string) => theme.fg("accent", s));
|
|
125
|
+
const mdTheme = getMarkdownTheme();
|
|
126
|
+
|
|
127
|
+
container.addChild(border);
|
|
128
|
+
container.addChild(new Text(theme.fg("accent", theme.bold("Conversation Summary")), 1, 0));
|
|
129
|
+
container.addChild(new Markdown(summary, 1, 1, mdTheme));
|
|
130
|
+
container.addChild(new Text(theme.fg("dim", "Press Enter or Esc to close"), 1, 0));
|
|
131
|
+
container.addChild(border);
|
|
132
|
+
|
|
133
|
+
return {
|
|
134
|
+
render: (width: number) => container.render(width),
|
|
135
|
+
invalidate: () => container.invalidate(),
|
|
136
|
+
handleInput: (data: string) => {
|
|
137
|
+
if (matchesKey(data, "enter") || matchesKey(data, "escape")) {
|
|
138
|
+
done(undefined);
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
};
|
|
142
|
+
});
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
export default function (pi: ExtensionAPI) {
|
|
146
|
+
pi.registerCommand("summarize", {
|
|
147
|
+
description: "Summarize the current conversation in a custom UI",
|
|
148
|
+
handler: async (_args, ctx) => {
|
|
149
|
+
const branch = ctx.sessionManager.getBranch();
|
|
150
|
+
const conversationText = buildConversationText(branch);
|
|
151
|
+
|
|
152
|
+
if (!conversationText.trim()) {
|
|
153
|
+
if (ctx.hasUI) {
|
|
154
|
+
ctx.ui.notify("No conversation text found", "warning");
|
|
155
|
+
}
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
if (ctx.hasUI) {
|
|
160
|
+
ctx.ui.notify("Preparing summary...", "info");
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
const model = getModel("openai", "gpt-5.2");
|
|
164
|
+
if (!model && ctx.hasUI) {
|
|
165
|
+
ctx.ui.notify("Model openai/gpt-5.2 not found", "warning");
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
const auth = model ? await ctx.modelRegistry.getApiKeyAndHeaders(model) : undefined;
|
|
169
|
+
if (auth && !auth.ok && ctx.hasUI) {
|
|
170
|
+
ctx.ui.notify(auth.error, "warning");
|
|
171
|
+
}
|
|
172
|
+
if (auth?.ok && !auth.apiKey && ctx.hasUI) {
|
|
173
|
+
ctx.ui.notify("No API key for openai/gpt-5.2", "warning");
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
if (!model || !auth?.ok || !auth.apiKey) {
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
const summaryMessages = [
|
|
181
|
+
{
|
|
182
|
+
role: "user" as const,
|
|
183
|
+
content: [{ type: "text" as const, text: buildSummaryPrompt(conversationText) }],
|
|
184
|
+
timestamp: Date.now(),
|
|
185
|
+
},
|
|
186
|
+
];
|
|
187
|
+
|
|
188
|
+
const response = await complete(
|
|
189
|
+
model,
|
|
190
|
+
{ messages: summaryMessages },
|
|
191
|
+
{
|
|
192
|
+
apiKey: auth.apiKey,
|
|
193
|
+
headers: auth.headers,
|
|
194
|
+
reasoningEffort: "high",
|
|
195
|
+
},
|
|
196
|
+
);
|
|
197
|
+
|
|
198
|
+
const summary = response.content
|
|
199
|
+
.filter((c): c is { type: "text"; text: string } => c.type === "text")
|
|
200
|
+
.map((c) => c.text)
|
|
201
|
+
.join("\n");
|
|
202
|
+
|
|
203
|
+
await showSummaryUi(summary, ctx);
|
|
204
|
+
},
|
|
205
|
+
});
|
|
206
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Displays a status widget showing the system prompt length.
|
|
3
|
+
*
|
|
4
|
+
* Demonstrates ctx.getSystemPrompt() for accessing the effective system prompt.
|
|
5
|
+
*/
|
|
6
|
+
import type { ExtensionAPI } from "@aryee/aery";
|
|
7
|
+
|
|
8
|
+
export default function (pi: ExtensionAPI) {
|
|
9
|
+
pi.on("agent_start", (_event, ctx) => {
|
|
10
|
+
const prompt = ctx.getSystemPrompt();
|
|
11
|
+
ctx.ui.setStatus("system-prompt", `System: ${prompt.length} chars`);
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
pi.on("session_shutdown", (_event, ctx) => {
|
|
15
|
+
ctx.ui.setStatus("system-prompt", undefined);
|
|
16
|
+
});
|
|
17
|
+
}
|