@apolloyh/apollo-agent 0.1.6 → 0.1.7
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 +1 -0
- package/README.md +2 -1
- package/dist/brand.d.ts +1 -1
- package/dist/brand.js +1 -1
- package/dist/config.d.ts +4 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +19 -0
- package/dist/index.js +5 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -35,7 +35,8 @@ apollo -r <session-id>
|
|
|
35
35
|
|
|
36
36
|
Apollo loads project `.apollo/.env`, project `.env`, then user-level `~/.apollo/.env`; use `--env-file <path>` to override discovery.
|
|
37
37
|
|
|
38
|
-
Apollo creates global defaults at `~/.apollo/config.json
|
|
38
|
+
Apollo creates global defaults at `~/.apollo/config.json` and copies the complete option
|
|
39
|
+
reference to `~/.apollo/config.example.json`. Project overrides live at
|
|
39
40
|
`.apollo/config.json`; Apollo also reads the legacy `agent.config.json` during migration.
|
|
40
41
|
Configuration layers as built-in defaults → user config → project config → `--config`.
|
|
41
42
|
Set `systemPrompt` in either config to append stable custom system instructions; restart Apollo to reload them.
|
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.7";
|
|
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.7",
|
|
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/config.d.ts
CHANGED
|
@@ -10,6 +10,10 @@ export declare function ensureUserConfigFile(): {
|
|
|
10
10
|
path: string;
|
|
11
11
|
created: boolean;
|
|
12
12
|
};
|
|
13
|
+
export declare function ensureUserConfigExampleFile(): {
|
|
14
|
+
path: string;
|
|
15
|
+
created: boolean;
|
|
16
|
+
};
|
|
13
17
|
export declare function loadAgentConfig(configPath?: string): Promise<AgentConfig>;
|
|
14
18
|
/**
|
|
15
19
|
* Load an explicit env file, or discover project env then ~/.apollo/.env.
|
package/dist/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"
|
|
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,EA4B1C,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
|
@@ -2,6 +2,7 @@ import fsSync from "node:fs";
|
|
|
2
2
|
import fs from "node:fs/promises";
|
|
3
3
|
import os from "node:os";
|
|
4
4
|
import path from "node:path";
|
|
5
|
+
import { fileURLToPath } from "node:url";
|
|
5
6
|
/** Default subagents — Claude Code–style Task roles. */
|
|
6
7
|
export const DEFAULT_AGENTS = [
|
|
7
8
|
{
|
|
@@ -65,6 +66,7 @@ const USER_CONFIG_TEMPLATE = `${JSON.stringify({
|
|
|
65
66
|
skills: defaultConfig.skills,
|
|
66
67
|
mcpServers: defaultConfig.mcpServers,
|
|
67
68
|
}, null, 2)}\n`;
|
|
69
|
+
const BUNDLED_CONFIG_EXAMPLE_PATH = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "../.apollo/config.example.json");
|
|
68
70
|
export function ensureUserEnvFile() {
|
|
69
71
|
const directory = path.join(os.homedir(), ".apollo");
|
|
70
72
|
const envPath = path.join(directory, ".env");
|
|
@@ -97,6 +99,23 @@ export function ensureUserConfigFile() {
|
|
|
97
99
|
throw error;
|
|
98
100
|
}
|
|
99
101
|
}
|
|
102
|
+
export function ensureUserConfigExampleFile() {
|
|
103
|
+
const directory = path.join(os.homedir(), ".apollo");
|
|
104
|
+
const examplePath = path.join(directory, "config.example.json");
|
|
105
|
+
if (fsSync.existsSync(examplePath))
|
|
106
|
+
return { path: examplePath, created: false };
|
|
107
|
+
const template = fsSync.readFileSync(BUNDLED_CONFIG_EXAMPLE_PATH, "utf8");
|
|
108
|
+
fsSync.mkdirSync(directory, { recursive: true, mode: 0o700 });
|
|
109
|
+
try {
|
|
110
|
+
fsSync.writeFileSync(examplePath, template, { encoding: "utf8", flag: "wx", mode: 0o600 });
|
|
111
|
+
return { path: examplePath, created: true };
|
|
112
|
+
}
|
|
113
|
+
catch (error) {
|
|
114
|
+
if (error.code === "EEXIST")
|
|
115
|
+
return { path: examplePath, created: false };
|
|
116
|
+
throw error;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
100
119
|
export async function loadAgentConfig(configPath) {
|
|
101
120
|
const userConfigPath = path.join(os.homedir(), ".apollo", "config.json");
|
|
102
121
|
const projectConfigPath = [DEFAULT_CONFIG_PATH, LEGACY_CONFIG_PATH].find(fsSync.existsSync);
|
package/dist/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import readline from "node:readline/promises";
|
|
|
4
4
|
import { ASCII_LOGO, PRODUCT } from "./brand.js";
|
|
5
5
|
import { parseArgs } from "./cli-args.js";
|
|
6
6
|
import { createPastedTextBlock, pastedTextPreview, renderInputView, resolvePastedText, } from "./cli-input.js";
|
|
7
|
-
import { ensureUserEnvFile, ensureUserConfigFile, loadAgentConfig, loadEnvFile, loadLlmConfig, MISSING_AUTH_TOKEN_MESSAGE, } from "./config.js";
|
|
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";
|
|
10
10
|
import { createCliApprovalProvider } from "./runtime/permissions.js";
|
|
@@ -59,6 +59,7 @@ async function main() {
|
|
|
59
59
|
const args = parseArgs(process.argv.slice(2));
|
|
60
60
|
const userEnv = ensureUserEnvFile();
|
|
61
61
|
const userConfig = ensureUserConfigFile();
|
|
62
|
+
const userConfigExample = ensureUserConfigExampleFile();
|
|
62
63
|
loadEnvFile(args.envPath);
|
|
63
64
|
const task = args.task ?? (stdin.isTTY ? undefined : (await readStdin()).trim());
|
|
64
65
|
if (!task && !stdin.isTTY) {
|
|
@@ -245,6 +246,9 @@ async function main() {
|
|
|
245
246
|
if (userConfig.created) {
|
|
246
247
|
stdout.write(`Created ${shortenHome(userConfig.path)} with default settings.\n`);
|
|
247
248
|
}
|
|
249
|
+
if (userConfigExample.created) {
|
|
250
|
+
stdout.write(`Created ${shortenHome(userConfigExample.path)} with all configuration options.\n`);
|
|
251
|
+
}
|
|
248
252
|
const approvalProvider = createCliApprovalProvider(agentConfig, traceSink, () => yolo, {
|
|
249
253
|
beforePrompt: () => {
|
|
250
254
|
stopLiveStatus("none");
|