@apolloyh/apollo-agent 0.1.7 → 0.1.8
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/.apollo/config.example.json +2 -2
- package/dist/brand.d.ts +1 -1
- package/dist/brand.js +1 -1
- package/dist/cli-input.d.ts +1 -0
- package/dist/cli-input.d.ts.map +1 -1
- package/dist/cli-input.js +9 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +5 -3
- package/dist/index.js +14 -28
- package/dist/runtime/prompt-builder.d.ts.map +1 -1
- package/dist/runtime/prompt-builder.js +2 -0
- package/dist/runtime/tool-policy.d.ts.map +1 -1
- package/dist/runtime/tool-policy.js +2 -0
- package/package.json +1 -1
|
@@ -24,9 +24,9 @@
|
|
|
24
24
|
},
|
|
25
25
|
{
|
|
26
26
|
"name": "Explore",
|
|
27
|
-
"description": "
|
|
27
|
+
"description": "Read-only exploration with explicit quick, medium, or very-thorough coverage: find files, map trees, and answer where/how questions without edits.",
|
|
28
28
|
"tools": ["list_files", "read_file", "git_status", "git_diff", "web_search", "web_fetch", "skill_search", "skill_read"],
|
|
29
|
-
"prompt": "You are an Explore subagent (read-only).
|
|
29
|
+
"prompt": "You are an Explore subagent (read-only). Start broad and narrow down. For all, complete, inventory, or very-thorough requests, recursively traverse the full requested tree, use at least three complementary passes (tree structure, filename/content search, and summary/index/manifest files), cross-check against counts or an independent aggregate source, and report scope, evidence, exclusions, and gaps. Prefer list_files / read_file. Do not modify files."
|
|
30
30
|
},
|
|
31
31
|
{
|
|
32
32
|
"name": "Plan",
|
package/dist/brand.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** Product identity — single source of truth for display strings. */
|
|
2
2
|
export declare const PRODUCT: {
|
|
3
3
|
readonly name: "Apollo";
|
|
4
|
-
readonly version: "0.1.
|
|
4
|
+
readonly version: "0.1.8";
|
|
5
5
|
readonly tagline: "Your personal agent — answer first, act when needed.";
|
|
6
6
|
readonly packageName: "@apolloyh/apollo-agent";
|
|
7
7
|
readonly userAgent: "ApolloAgent/0.1";
|
package/dist/brand.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** Product identity — single source of truth for display strings. */
|
|
2
2
|
export const PRODUCT = {
|
|
3
3
|
name: "Apollo",
|
|
4
|
-
version: "0.1.
|
|
4
|
+
version: "0.1.8",
|
|
5
5
|
tagline: "Your personal agent — answer first, act when needed.",
|
|
6
6
|
packageName: "@apolloyh/apollo-agent",
|
|
7
7
|
userAgent: "ApolloAgent/0.1",
|
package/dist/cli-input.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export type InputView = {
|
|
|
9
9
|
cursorWidth: number;
|
|
10
10
|
lines: string[];
|
|
11
11
|
};
|
|
12
|
+
export declare function slashCommandMatches(input: string, command: string): boolean;
|
|
12
13
|
export declare function createPastedTextBlock(text: string, id: number): PastedTextBlock | undefined;
|
|
13
14
|
export declare function resolvePastedText(value: string, blocks: ReadonlyMap<string, PastedTextBlock>): string;
|
|
14
15
|
export declare function pastedTextPreview(value: string, blocks: ReadonlyMap<string, PastedTextBlock>): string;
|
package/dist/cli-input.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-input.d.ts","sourceRoot":"","sources":["../src/cli-input.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,eAAe,GAAG;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB,CAAC;
|
|
1
|
+
{"version":3,"file":"cli-input.d.ts","sourceRoot":"","sources":["../src/cli-input.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,eAAe,GAAG;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB,CAAC;AAEF,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAM3E;AAMD,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,eAAe,GAAG,SAAS,CAQ3F;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,CAAC,MAAM,EAAE,eAAe,CAAC,GAAG,MAAM,CAErG;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,CAAC,MAAM,EAAE,eAAe,CAAC,GAAG,MAAM,CAErG;AAED,wBAAgB,eAAe,CAC7B,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,WAAW,CAAC,MAAM,EAAE,eAAe,CAAC,GAC3C,SAAS,CAyCX"}
|
package/dist/cli-input.js
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
export function slashCommandMatches(input, command) {
|
|
2
|
+
if (!input.startsWith("/"))
|
|
3
|
+
return false;
|
|
4
|
+
const query = input.slice(1).toLowerCase().trim();
|
|
5
|
+
if (!query)
|
|
6
|
+
return true;
|
|
7
|
+
const name = command.slice(1).toLowerCase();
|
|
8
|
+
return name.startsWith(query) || name.split(/\s+/).some((word) => word.startsWith(query));
|
|
9
|
+
}
|
|
1
10
|
const MIN_FOLDED_PASTE_LINES = 6;
|
|
2
11
|
const MIN_FOLDED_PASTE_CHARS = 1000;
|
|
3
12
|
const FIRST_MARKER = 0xf0000;
|
package/dist/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEzE,wDAAwD;AACxD,eAAO,MAAM,cAAc,EAAE,cAAc,
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEzE,wDAAwD;AACxD,eAAO,MAAM,cAAc,EAAE,cAAc,EA8B1C,CAAC;AAsBF,eAAO,MAAM,0BAA0B,oHAC4E,CAAC;AAwBpH,wBAAgB,iBAAiB,IAAI;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,CAatE;AAED,wBAAgB,oBAAoB,IAAI;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,CAazE;AAED,wBAAgB,2BAA2B,IAAI;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,CAchF;AAED,wBAAsB,eAAe,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAkD/E;AAiBD;;;GAGG;AACH,wBAAgB,WAAW,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,OAAO,GAAE;IAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAO,GAAG,OAAO,CAwB3F;AAYD,wBAAgB,aAAa,CAAC,OAAO,GAAE;IAAE,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAAO,GAAG,SAAS,CAkCrF"}
|
package/dist/config.js
CHANGED
|
@@ -15,11 +15,13 @@ Work thoroughly but stay scoped. Use tools as needed. Return one concise final r
|
|
|
15
15
|
},
|
|
16
16
|
{
|
|
17
17
|
name: "Explore",
|
|
18
|
-
description: "
|
|
18
|
+
description: "Read-only exploration with explicit quick, medium, or very-thorough coverage: find files, map trees, and answer where/how questions without edits.",
|
|
19
19
|
tools: ["list_files", "read_file", "git_status", "git_diff", "web_search", "web_fetch", "skill_search", "skill_read"],
|
|
20
|
-
prompt: `You are an Explore subagent (read-only). Map the codebase or research a question
|
|
20
|
+
prompt: `You are an Explore subagent (read-only). Map the codebase or research a question with the thoroughness requested by the caller.
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
Start broad and narrow down. Check multiple locations, naming conventions, and related files instead of stopping at the first match. For "all", "complete", inventory, or very-thorough requests: recursively traverse the full requested tree, use at least three complementary passes (tree structure, filename/content search, and summary/index/manifest files), and cross-check detailed findings against counts or an independent aggregate source. Report the exact scope covered, evidence for completeness, exclusions, and unresolved gaps.
|
|
23
|
+
|
|
24
|
+
Prefer list_files / read_file over shell. Do not modify files, run destructive commands, or commit. Return a concise structured report: scope, search passes, key paths, findings, completeness check, and open questions.`,
|
|
23
25
|
},
|
|
24
26
|
{
|
|
25
27
|
name: "Plan",
|
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import { stdin, stdout } from "node:process";
|
|
|
3
3
|
import readline from "node:readline/promises";
|
|
4
4
|
import { ASCII_LOGO, PRODUCT } from "./brand.js";
|
|
5
5
|
import { parseArgs } from "./cli-args.js";
|
|
6
|
-
import { createPastedTextBlock, pastedTextPreview, renderInputView, resolvePastedText, } from "./cli-input.js";
|
|
6
|
+
import { createPastedTextBlock, pastedTextPreview, renderInputView, resolvePastedText, slashCommandMatches, } from "./cli-input.js";
|
|
7
7
|
import { ensureUserEnvFile, ensureUserConfigExampleFile, ensureUserConfigFile, loadAgentConfig, loadEnvFile, loadLlmConfig, MISSING_AUTH_TOKEN_MESSAGE, } from "./config.js";
|
|
8
8
|
import { pickSpinnerVerb } from "./constants/spinner-verbs.js";
|
|
9
9
|
import { QueryEngine } from "./runtime/query-engine.js";
|
|
@@ -41,19 +41,7 @@ const slashCommands = [
|
|
|
41
41
|
];
|
|
42
42
|
/** Filter slash commands by command-name prefix only (accurate search). */
|
|
43
43
|
function filterSlashCommands(buffer) {
|
|
44
|
-
|
|
45
|
-
return [];
|
|
46
|
-
const q = buffer.slice(1).toLowerCase().trim();
|
|
47
|
-
if (!q)
|
|
48
|
-
return slashCommands;
|
|
49
|
-
// /s → /status /stream /skill… NOT /help (desc has "slash")
|
|
50
|
-
return slashCommands.filter((cmd) => {
|
|
51
|
-
const name = cmd.command.slice(1).toLowerCase();
|
|
52
|
-
if (name.startsWith(q))
|
|
53
|
-
return true;
|
|
54
|
-
// multi-word: "/sk" matches "skill install"
|
|
55
|
-
return name.split(/\s+/).some((w) => w.startsWith(q));
|
|
56
|
-
});
|
|
44
|
+
return slashCommands.filter((command) => slashCommandMatches(buffer, command.command));
|
|
57
45
|
}
|
|
58
46
|
async function main() {
|
|
59
47
|
const args = parseArgs(process.argv.slice(2));
|
|
@@ -1121,6 +1109,13 @@ async function readCliLine(options) {
|
|
|
1121
1109
|
}
|
|
1122
1110
|
selected = ((selected % list.length) + list.length) % list.length;
|
|
1123
1111
|
};
|
|
1112
|
+
const syncPalette = () => {
|
|
1113
|
+
paletteOpen = filterSlashCommands(buffer).length > 0;
|
|
1114
|
+
if (paletteOpen)
|
|
1115
|
+
clampSelected();
|
|
1116
|
+
else
|
|
1117
|
+
selected = 0;
|
|
1118
|
+
};
|
|
1124
1119
|
const handleKey = (chunk) => {
|
|
1125
1120
|
if (done)
|
|
1126
1121
|
return;
|
|
@@ -1186,13 +1181,7 @@ async function readCliLine(options) {
|
|
|
1186
1181
|
buffer = characters.join("");
|
|
1187
1182
|
cursor -= 1;
|
|
1188
1183
|
}
|
|
1189
|
-
|
|
1190
|
-
paletteOpen = true;
|
|
1191
|
-
clampSelected();
|
|
1192
|
-
}
|
|
1193
|
-
else {
|
|
1194
|
-
closePalette();
|
|
1195
|
-
}
|
|
1184
|
+
syncPalette();
|
|
1196
1185
|
render();
|
|
1197
1186
|
return;
|
|
1198
1187
|
}
|
|
@@ -1217,6 +1206,7 @@ async function readCliLine(options) {
|
|
|
1217
1206
|
if (cursor < characters.length)
|
|
1218
1207
|
characters.splice(cursor, 1);
|
|
1219
1208
|
buffer = characters.join("");
|
|
1209
|
+
syncPalette();
|
|
1220
1210
|
render();
|
|
1221
1211
|
return;
|
|
1222
1212
|
}
|
|
@@ -1237,6 +1227,7 @@ async function readCliLine(options) {
|
|
|
1237
1227
|
characters.splice(start, cursor - start);
|
|
1238
1228
|
buffer = characters.join("");
|
|
1239
1229
|
cursor = start;
|
|
1230
|
+
syncPalette();
|
|
1240
1231
|
render();
|
|
1241
1232
|
return;
|
|
1242
1233
|
}
|
|
@@ -1268,13 +1259,7 @@ async function readCliLine(options) {
|
|
|
1268
1259
|
buffer = characters.join("");
|
|
1269
1260
|
cursor += 1;
|
|
1270
1261
|
}
|
|
1271
|
-
|
|
1272
|
-
paletteOpen = true;
|
|
1273
|
-
clampSelected();
|
|
1274
|
-
}
|
|
1275
|
-
else {
|
|
1276
|
-
closePalette();
|
|
1277
|
-
}
|
|
1262
|
+
syncPalette();
|
|
1278
1263
|
render();
|
|
1279
1264
|
};
|
|
1280
1265
|
const insertText = (text) => {
|
|
@@ -1316,6 +1301,7 @@ async function readCliLine(options) {
|
|
|
1316
1301
|
insertText(pasteBuffer);
|
|
1317
1302
|
pasteBuffer = undefined;
|
|
1318
1303
|
rest = rest.slice(end + pasteEnd.length);
|
|
1304
|
+
syncPalette();
|
|
1319
1305
|
render();
|
|
1320
1306
|
continue;
|
|
1321
1307
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompt-builder.d.ts","sourceRoot":"","sources":["../../src/runtime/prompt-builder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAA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IAazB,OAAO,CAAC,uBAAuB;IAO/B,OAAO,CAAC,kBAAkB;IAa1B,OAAO,CAAC,aAAa;IAOrB,OAAO,CAAC,WAAW;CAQpB"}
|
|
@@ -70,6 +70,8 @@ ${prompt}`;
|
|
|
70
70
|
return `# Doing Tasks
|
|
71
71
|
- For ordinary questions, answer directly without tools.
|
|
72
72
|
- For code or workspace tasks, read relevant files before proposing or making changes.
|
|
73
|
+
- Treat words such as "all", "every", "complete", "entire", "inventory", and "exhaustive" as coverage requirements, not requests for representative examples. Define the scope, traverse every relevant branch recursively, and do not answer after inspecting only the first few matches.
|
|
74
|
+
- For exhaustive discovery, start broad and then narrow: inspect the full directory tree, search multiple locations and naming conventions, look for summary/index/manifest/catalog files, and cross-check detailed findings against an independent source or count. If completeness cannot be proven, state the exact boundary and remaining gaps.
|
|
73
75
|
- Keep changes scoped to what the user asked. Do not add speculative features, broad refactors, or unnecessary abstractions.
|
|
74
76
|
- Prefer editing existing files over creating new files unless a new file is necessary.
|
|
75
77
|
- When calling tools, include every required input field every time. Prefer edit_file with path, old_string, and new_string for localized changes. Use write_file with both path and content only for new files or intentional full-file replacement.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-policy.d.ts","sourceRoot":"","sources":["../../src/runtime/tool-policy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAEjE,qBAAa,UAAU;IACT,OAAO,CAAC,QAAQ,CAAC,KAAK;gBAAL,KAAK,EAAE,aAAa,EAAE;IAEnD,kBAAkB,IAAI,MAAM;IAqC5B,mBAAmB,IAAI,MAAM;IAU7B;;OAEG;IACH,gBAAgB,CAAC,MAAM,EAAE,cAAc,EAAE,GAAG,MAAM;
|
|
1
|
+
{"version":3,"file":"tool-policy.d.ts","sourceRoot":"","sources":["../../src/runtime/tool-policy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAEjE,qBAAa,UAAU;IACT,OAAO,CAAC,QAAQ,CAAC,KAAK;gBAAL,KAAK,EAAE,aAAa,EAAE;IAEnD,kBAAkB,IAAI,MAAM;IAqC5B,mBAAmB,IAAI,MAAM;IAU7B;;OAEG;IACH,gBAAgB,CAAC,MAAM,EAAE,cAAc,EAAE,GAAG,MAAM;IA6ClD,MAAM,CAAC,SAAS,CAAC,IAAI,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,MAAM;CAU1D"}
|
|
@@ -83,6 +83,8 @@ You may launch a **fresh subagent** with the \`Task\` tool. This follows the Cla
|
|
|
83
83
|
Write for a capable colleague who just joined with **no context**:
|
|
84
84
|
goal · why it matters · relevant paths/facts · what you already tried · scope boundaries · whether edits are expected · expected output format.
|
|
85
85
|
|
|
86
|
+
For inventory or "find all" tasks, also specify the desired thoroughness and require coverage evidence: recursive scope traversal, multiple search strategies, summary/index files checked, and any exclusions or unresolved gaps.
|
|
87
|
+
|
|
86
88
|
Always set:
|
|
87
89
|
- \`description\`: 3–5 words, user-visible status (e.g. "find auth handlers")
|
|
88
90
|
- \`subagent_type\`: one of the types below
|