@agenthifive/openclaw-setup 0.1.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.
@@ -0,0 +1,56 @@
1
+ /**
2
+ * Auto-patching for OpenClaw's credential resolution.
3
+ *
4
+ * Finds the OpenClaw installation and injects vault credential resolution
5
+ * into resolveApiKeyForProvider(). Supports both source installs (TypeScript)
6
+ * and npm installs (compiled JS chunks with hashed filenames).
7
+ *
8
+ * The patch adds two tiers before local profile resolution:
9
+ * - Tier 0: Proxied providers (vault bearer token used directly)
10
+ * - Tier 0.5: Credential provider chain (query vault before local profiles)
11
+ */
12
+ export interface OpenClawInstall {
13
+ dir: string;
14
+ kind: "source" | "dist";
15
+ }
16
+ export interface PatchResult {
17
+ applied: boolean;
18
+ alreadyPatched: boolean;
19
+ message: string;
20
+ }
21
+ /**
22
+ * Locate the OpenClaw installation directory.
23
+ *
24
+ * Strategy (cascading, first match wins):
25
+ * 1. `which`/`where` openclaw → resolve symlink → walk up to package.json
26
+ * 2. `npm root -g` → check for openclaw package
27
+ * 3. Well-known paths (Linux, macOS, Windows)
28
+ * 4. `find` as last resort (Linux/macOS only, with timeout)
29
+ *
30
+ * Returns null if not found — caller should ask the user.
31
+ */
32
+ export declare function findOpenClawInstallDir(): OpenClawInstall | null;
33
+ /**
34
+ * Find all OpenClaw installations (for disambiguation when multiple exist).
35
+ */
36
+ export declare function findAllOpenClawInstalls(): OpenClawInstall[];
37
+ /**
38
+ * Validate a user-provided OpenClaw installation path.
39
+ */
40
+ export declare function validateOpenClawDir(dir: string): OpenClawInstall | null;
41
+ /**
42
+ * Find the chunk file containing resolveApiKeyForProvider in dist/.
43
+ */
44
+ export declare function findDistChunk(distDir: string): string | null;
45
+ export declare function applyDistPatch(openclawDir: string): PatchResult;
46
+ export declare function applySourcePatch(openclawDir: string): PatchResult;
47
+ /**
48
+ * Apply the credential resolution patch to an OpenClaw installation.
49
+ * Automatically detects source vs dist installs.
50
+ */
51
+ export declare function applyPatch(install: OpenClawInstall): PatchResult;
52
+ /**
53
+ * Check if the credential resolution patch is applied in an OpenClaw installation.
54
+ */
55
+ export declare function isPatchApplied(install: OpenClawInstall): boolean;
56
+ //# sourceMappingURL=auto-patch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auto-patch.d.ts","sourceRoot":"","sources":["../src/auto-patch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAgBH,MAAM,WAAW,eAAe;IAC9B,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,QAAQ,GAAG,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,OAAO,CAAC;IACjB,cAAc,EAAE,OAAO,CAAC;IACxB,OAAO,EAAE,MAAM,CAAC;CACjB;AA+DD;;;;;;;;;;GAUG;AACH,wBAAgB,sBAAsB,IAAI,eAAe,GAAG,IAAI,CAkB/D;AAoKD;;GAEG;AACH,wBAAgB,uBAAuB,IAAI,eAAe,EAAE,CAiB3D;AAMD;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,eAAe,GAAG,IAAI,CAIvE;AAMD;;GAEG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CA6B5D;AAED,wBAAgB,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,WAAW,CAqD/D;AAMD,wBAAgB,gBAAgB,CAAC,WAAW,EAAE,MAAM,GAAG,WAAW,CAqDjE;AAMD;;;GAGG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,eAAe,GAAG,WAAW,CAIhE;AAMD;;GAEG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAUhE"}
@@ -0,0 +1,422 @@
1
+ /**
2
+ * Auto-patching for OpenClaw's credential resolution.
3
+ *
4
+ * Finds the OpenClaw installation and injects vault credential resolution
5
+ * into resolveApiKeyForProvider(). Supports both source installs (TypeScript)
6
+ * and npm installs (compiled JS chunks with hashed filenames).
7
+ *
8
+ * The patch adds two tiers before local profile resolution:
9
+ * - Tier 0: Proxied providers (vault bearer token used directly)
10
+ * - Tier 0.5: Credential provider chain (query vault before local profiles)
11
+ */
12
+ import { existsSync, readdirSync, readFileSync, realpathSync, writeFileSync, } from "node:fs";
13
+ import os from "node:os";
14
+ import path from "node:path";
15
+ // ---------------------------------------------------------------------------
16
+ // Marker used to detect if the patch is already applied
17
+ // ---------------------------------------------------------------------------
18
+ const PATCH_MARKER = "@agenthifive/openclaw/runtime";
19
+ // ---------------------------------------------------------------------------
20
+ // Code injected into compiled dist files
21
+ // ---------------------------------------------------------------------------
22
+ const INJECTED_CODE = `
23
+ \t// -- AgentHiFive: Tier 0 + Tier 0.5 vault credential resolution --
24
+ \t// @agenthifive/openclaw/runtime
25
+ \ttry {
26
+ \t\tconst runtime = await import("@agenthifive/openclaw/runtime");
27
+ \t\tif (runtime.isInitialized()) {
28
+ \t\t\tconst proxiedProviders = runtime.getProxiedProviders();
29
+ \t\t\tif (proxiedProviders.includes(provider)) {
30
+ \t\t\t\tconst vaultToken = runtime.getVaultBearerToken();
31
+ \t\t\t\tif (vaultToken) {
32
+ \t\t\t\t\treturn { apiKey: vaultToken, source: "vault:agent-token", mode: "api-key" };
33
+ \t\t\t\t}
34
+ \t\t\t}
35
+ \t\t\tconst vaultResult = await runtime.resolveCredential({
36
+ \t\t\t\tkind: "model_provider",
37
+ \t\t\t\tprovider,
38
+ \t\t\t\tprofileId: preferredProfile,
39
+ \t\t\t});
40
+ \t\t\tif (vaultResult?.apiKey) {
41
+ \t\t\t\treturn {
42
+ \t\t\t\t\tapiKey: vaultResult.apiKey,
43
+ \t\t\t\t\tsource: "credential-provider:vault",
44
+ \t\t\t\t\tmode: vaultResult.mode ?? "api-key",
45
+ \t\t\t\t};
46
+ \t\t\t}
47
+ \t\t}
48
+ \t} catch {
49
+ \t\t// Plugin not installed -- skip vault credential resolution
50
+ \t}
51
+ `;
52
+ // ---------------------------------------------------------------------------
53
+ // Anchor patterns
54
+ // ---------------------------------------------------------------------------
55
+ /**
56
+ * Regex matching the store assignment line in resolveApiKeyForProvider.
57
+ * This is stable across upstream versions — it's the first line after
58
+ * the destructuring of params.
59
+ *
60
+ * Upstream dist (2026.3.13):
61
+ * const store = params.store ?? ensureAuthProfileStore(params.agentDir);
62
+ * if (profileId) {
63
+ */
64
+ const DIST_ANCHOR = /const store\s*=\s*params\.store\s*\?\?\s*ensureAuthProfileStore\(params\.agentDir\);\n/;
65
+ // ---------------------------------------------------------------------------
66
+ // Find OpenClaw installation
67
+ // ---------------------------------------------------------------------------
68
+ /**
69
+ * Locate the OpenClaw installation directory.
70
+ *
71
+ * Strategy (cascading, first match wins):
72
+ * 1. `which`/`where` openclaw → resolve symlink → walk up to package.json
73
+ * 2. `npm root -g` → check for openclaw package
74
+ * 3. Well-known paths (Linux, macOS, Windows)
75
+ * 4. `find` as last resort (Linux/macOS only, with timeout)
76
+ *
77
+ * Returns null if not found — caller should ask the user.
78
+ */
79
+ export function findOpenClawInstallDir() {
80
+ // Strategy 1: scan PATH for openclaw binary → resolve symlink
81
+ const result = findViaPath();
82
+ if (result)
83
+ return result;
84
+ // Strategy 2: derive global node_modules from Node.js binary location
85
+ const npmResult = findViaNpmPrefix();
86
+ if (npmResult)
87
+ return npmResult;
88
+ // Strategy 3: well-known paths
89
+ const wellKnown = findViaWellKnownPaths();
90
+ if (wellKnown)
91
+ return wellKnown;
92
+ // Strategy 4: recursive directory scan (last resort)
93
+ const found = findViaRecursiveScan();
94
+ if (found)
95
+ return found;
96
+ return null;
97
+ }
98
+ function classifyInstall(dir) {
99
+ const hasSrc = existsSync(path.join(dir, "src", "agents", "model-auth.ts"));
100
+ return { dir, kind: hasSrc ? "source" : "dist" };
101
+ }
102
+ function isOpenClawDir(dir) {
103
+ const pkgPath = path.join(dir, "package.json");
104
+ if (!existsSync(pkgPath))
105
+ return false;
106
+ try {
107
+ const pkg = JSON.parse(readFileSync(pkgPath, "utf-8"));
108
+ return pkg.name === "openclaw";
109
+ }
110
+ catch {
111
+ return false;
112
+ }
113
+ }
114
+ function walkUpToPackageRoot(startDir) {
115
+ let dir = startDir;
116
+ for (let i = 0; i < 10; i++) {
117
+ if (isOpenClawDir(dir))
118
+ return dir;
119
+ const parent = path.dirname(dir);
120
+ if (parent === dir)
121
+ break;
122
+ dir = parent;
123
+ }
124
+ return null;
125
+ }
126
+ function findViaPath() {
127
+ const pathEnv = process.env.PATH ?? "";
128
+ const sep = process.platform === "win32" ? ";" : ":";
129
+ const exts = process.platform === "win32" ? [".cmd", ".bat", ".exe", ""] : [""];
130
+ for (const dir of pathEnv.split(sep).filter(Boolean)) {
131
+ for (const ext of exts) {
132
+ const candidate = path.join(dir, `openclaw${ext}`);
133
+ if (!existsSync(candidate))
134
+ continue;
135
+ // Resolve symlinks to find the real binary location
136
+ let realBin;
137
+ try {
138
+ realBin = realpathSync(candidate);
139
+ }
140
+ catch {
141
+ realBin = candidate;
142
+ }
143
+ // Walk up from binary to find package root
144
+ const root = walkUpToPackageRoot(path.dirname(realBin));
145
+ if (root)
146
+ return classifyInstall(root);
147
+ // Binary might be a wrapper script — check if it references a node_modules path
148
+ try {
149
+ const content = readFileSync(realBin, "utf-8");
150
+ const match = /["']([^"']+openclaw[^"']*)['"]/i.exec(content);
151
+ if (match?.[1]) {
152
+ const resolved = path.resolve(path.dirname(realBin), match[1]);
153
+ const root2 = walkUpToPackageRoot(path.dirname(resolved));
154
+ if (root2)
155
+ return classifyInstall(root2);
156
+ }
157
+ }
158
+ catch {
159
+ // Not readable as text
160
+ }
161
+ }
162
+ }
163
+ return null;
164
+ }
165
+ function findViaNpmPrefix() {
166
+ // Derive global node_modules from the running Node.js binary location
167
+ // e.g. /usr/lib/node_modules/openclaw or /home/user/.nvm/versions/node/v24/lib/node_modules/openclaw
168
+ const nodeDir = path.dirname(process.execPath); // e.g. /usr/bin or .../bin
169
+ const prefixDir = path.dirname(nodeDir); // e.g. /usr or .../v24
170
+ const candidate = path.join(prefixDir, "lib", "node_modules", "openclaw");
171
+ if (isOpenClawDir(candidate))
172
+ return classifyInstall(candidate);
173
+ // Also check directly under prefix (some setups)
174
+ const candidate2 = path.join(prefixDir, "node_modules", "openclaw");
175
+ if (isOpenClawDir(candidate2))
176
+ return classifyInstall(candidate2);
177
+ return null;
178
+ }
179
+ function findViaWellKnownPaths() {
180
+ const home = os.homedir();
181
+ const candidates = [];
182
+ if (process.platform === "win32") {
183
+ // Windows: AppData paths derived from home directory
184
+ candidates.push(path.join(home, "AppData", "Roaming", "npm", "node_modules", "openclaw"), path.join(home, "AppData", "Local", "pnpm", "global", "5", "node_modules", "openclaw"));
185
+ }
186
+ else {
187
+ candidates.push("/usr/lib/node_modules/openclaw", "/usr/local/lib/node_modules/openclaw", path.join(home, ".local/share/pnpm/global/5/node_modules/openclaw"));
188
+ if (process.platform === "darwin") {
189
+ candidates.push("/opt/homebrew/lib/node_modules/openclaw");
190
+ }
191
+ }
192
+ for (const candidate of candidates) {
193
+ if (isOpenClawDir(candidate))
194
+ return classifyInstall(candidate);
195
+ }
196
+ return null;
197
+ }
198
+ function findViaRecursiveScan() {
199
+ const home = os.homedir();
200
+ const searchDirs = ["/usr", "/opt", home].filter((d) => d && existsSync(d));
201
+ const matches = [];
202
+ const maxDepth = 8;
203
+ function scan(dir, depth) {
204
+ if (depth > maxDepth || matches.length > 1)
205
+ return;
206
+ try {
207
+ const entries = readdirSync(dir, { withFileTypes: true });
208
+ for (const entry of entries) {
209
+ if (!entry.isDirectory())
210
+ continue;
211
+ // Skip hidden dirs, node_modules internals, and proc/sys
212
+ if (entry.name.startsWith(".") && entry.name !== ".nvm" && entry.name !== ".local")
213
+ continue;
214
+ if (entry.name === "node_modules" && depth > 0) {
215
+ // Check for openclaw directly inside node_modules
216
+ const candidate = path.join(dir, entry.name, "openclaw");
217
+ if (isOpenClawDir(candidate))
218
+ matches.push(candidate);
219
+ continue;
220
+ }
221
+ if (entry.name === "openclaw") {
222
+ const candidate = path.join(dir, entry.name);
223
+ if (isOpenClawDir(candidate)) {
224
+ matches.push(candidate);
225
+ continue;
226
+ }
227
+ }
228
+ scan(path.join(dir, entry.name), depth + 1);
229
+ }
230
+ }
231
+ catch {
232
+ // Permission denied or other error
233
+ }
234
+ }
235
+ for (const searchDir of searchDirs) {
236
+ scan(searchDir, 0);
237
+ if (matches.length > 1)
238
+ return null; // Multiple — caller should ask user
239
+ }
240
+ if (matches.length === 1)
241
+ return classifyInstall(matches[0]);
242
+ return null;
243
+ }
244
+ /**
245
+ * Find all OpenClaw installations (for disambiguation when multiple exist).
246
+ */
247
+ export function findAllOpenClawInstalls() {
248
+ const results = [];
249
+ const seen = new Set();
250
+ const add = (install) => {
251
+ if (!install)
252
+ return;
253
+ const resolved = path.resolve(install.dir);
254
+ if (seen.has(resolved))
255
+ return;
256
+ seen.add(resolved);
257
+ results.push({ ...install, dir: resolved });
258
+ };
259
+ add(findViaPath());
260
+ add(findViaNpmPrefix());
261
+ add(findViaWellKnownPaths());
262
+ return results;
263
+ }
264
+ // ---------------------------------------------------------------------------
265
+ // Validate user-provided path
266
+ // ---------------------------------------------------------------------------
267
+ /**
268
+ * Validate a user-provided OpenClaw installation path.
269
+ */
270
+ export function validateOpenClawDir(dir) {
271
+ const resolved = path.resolve(dir);
272
+ if (!isOpenClawDir(resolved))
273
+ return null;
274
+ return classifyInstall(resolved);
275
+ }
276
+ // ---------------------------------------------------------------------------
277
+ // Apply patch to dist (compiled JS)
278
+ // ---------------------------------------------------------------------------
279
+ /**
280
+ * Find the chunk file containing resolveApiKeyForProvider in dist/.
281
+ */
282
+ export function findDistChunk(distDir) {
283
+ if (!existsSync(distDir))
284
+ return null;
285
+ const files = readdirSync(distDir).filter((f) => f.endsWith(".js"));
286
+ // Primary: look for auth-profiles-*.js (upstream chunk name)
287
+ const authChunk = files.find((f) => f.startsWith("auth-profiles") || f.startsWith("model-auth"));
288
+ if (authChunk) {
289
+ const content = readFileSync(path.join(distDir, authChunk), "utf-8");
290
+ if (content.includes("resolveApiKeyForProvider")) {
291
+ return path.join(distDir, authChunk);
292
+ }
293
+ }
294
+ // Fallback: search all JS files
295
+ for (const file of files) {
296
+ const filePath = path.join(distDir, file);
297
+ const content = readFileSync(filePath, "utf-8");
298
+ if (content.includes("async function resolveApiKeyForProvider") &&
299
+ content.includes("ensureAuthProfileStore")) {
300
+ return filePath;
301
+ }
302
+ }
303
+ return null;
304
+ }
305
+ export function applyDistPatch(openclawDir) {
306
+ const distDir = path.join(openclawDir, "dist");
307
+ const chunkPath = findDistChunk(distDir);
308
+ if (!chunkPath) {
309
+ return {
310
+ applied: false,
311
+ alreadyPatched: false,
312
+ message: "Could not find resolveApiKeyForProvider in OpenClaw dist/. " +
313
+ "The OpenClaw version may be incompatible.",
314
+ };
315
+ }
316
+ const source = readFileSync(chunkPath, "utf-8");
317
+ // Already patched?
318
+ if (source.includes(PATCH_MARKER)) {
319
+ return {
320
+ applied: true,
321
+ alreadyPatched: true,
322
+ message: `Already patched: ${path.basename(chunkPath)}`,
323
+ };
324
+ }
325
+ // Find anchor
326
+ const match = DIST_ANCHOR.exec(source);
327
+ if (!match) {
328
+ return {
329
+ applied: false,
330
+ alreadyPatched: false,
331
+ message: `Found ${path.basename(chunkPath)} but could not locate the anchor point. ` +
332
+ "The OpenClaw version may be incompatible.",
333
+ };
334
+ }
335
+ // Create backup
336
+ const backupPath = chunkPath + ".bak";
337
+ writeFileSync(backupPath, source);
338
+ // Inject code after the anchor line
339
+ const insertPos = match.index + match[0].length;
340
+ const patched = source.slice(0, insertPos) + INJECTED_CODE + source.slice(insertPos);
341
+ writeFileSync(chunkPath, patched);
342
+ return {
343
+ applied: true,
344
+ alreadyPatched: false,
345
+ message: `Patched ${path.basename(chunkPath)} (backup: ${path.basename(backupPath)})`,
346
+ };
347
+ }
348
+ // ---------------------------------------------------------------------------
349
+ // Apply patch to source install
350
+ // ---------------------------------------------------------------------------
351
+ export function applySourcePatch(openclawDir) {
352
+ const targetFile = path.join(openclawDir, "src", "agents", "model-auth.ts");
353
+ if (!existsSync(targetFile)) {
354
+ return {
355
+ applied: false,
356
+ alreadyPatched: false,
357
+ message: "src/agents/model-auth.ts not found",
358
+ };
359
+ }
360
+ const source = readFileSync(targetFile, "utf-8");
361
+ if (source.includes(PATCH_MARKER)) {
362
+ return {
363
+ applied: true,
364
+ alreadyPatched: true,
365
+ message: "Source already patched",
366
+ };
367
+ }
368
+ // Text injection (same approach as dist patching, with spaces instead of tabs)
369
+ const match = DIST_ANCHOR.exec(source);
370
+ if (match) {
371
+ const backupPath = targetFile + ".bak";
372
+ writeFileSync(backupPath, source);
373
+ const insertPos = match.index + match[0].length;
374
+ const patched = source.slice(0, insertPos) +
375
+ "\n" +
376
+ INJECTED_CODE.replace(/\t/g, " ") +
377
+ "\n" +
378
+ source.slice(insertPos);
379
+ writeFileSync(targetFile, patched);
380
+ return {
381
+ applied: true,
382
+ alreadyPatched: false,
383
+ message: `Source patched (backup: ${path.basename(backupPath)})`,
384
+ };
385
+ }
386
+ return {
387
+ applied: false,
388
+ alreadyPatched: false,
389
+ message: "Could not locate anchor point in source file",
390
+ };
391
+ }
392
+ // ---------------------------------------------------------------------------
393
+ // Unified apply
394
+ // ---------------------------------------------------------------------------
395
+ /**
396
+ * Apply the credential resolution patch to an OpenClaw installation.
397
+ * Automatically detects source vs dist installs.
398
+ */
399
+ export function applyPatch(install) {
400
+ return install.kind === "source"
401
+ ? applySourcePatch(install.dir)
402
+ : applyDistPatch(install.dir);
403
+ }
404
+ // ---------------------------------------------------------------------------
405
+ // Check if patch is applied
406
+ // ---------------------------------------------------------------------------
407
+ /**
408
+ * Check if the credential resolution patch is applied in an OpenClaw installation.
409
+ */
410
+ export function isPatchApplied(install) {
411
+ if (install.kind === "source") {
412
+ const file = path.join(install.dir, "src", "agents", "model-auth.ts");
413
+ if (!existsSync(file))
414
+ return false;
415
+ return readFileSync(file, "utf-8").includes(PATCH_MARKER);
416
+ }
417
+ const chunkPath = findDistChunk(path.join(install.dir, "dist"));
418
+ if (!chunkPath)
419
+ return false;
420
+ return readFileSync(chunkPath, "utf-8").includes(PATCH_MARKER);
421
+ }
422
+ //# sourceMappingURL=auto-patch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auto-patch.js","sourceRoot":"","sources":["../src/auto-patch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EACL,UAAU,EACV,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,aAAa,GACd,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAiB7B,8EAA8E;AAC9E,wDAAwD;AACxD,8EAA8E;AAE9E,MAAM,YAAY,GAAG,+BAA+B,CAAC;AAErD,8EAA8E;AAC9E,yCAAyC;AACzC,8EAA8E;AAE9E,MAAM,aAAa,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6BrB,CAAC;AAEF,8EAA8E;AAC9E,kBAAkB;AAClB,8EAA8E;AAE9E;;;;;;;;GAQG;AACH,MAAM,WAAW,GACf,wFAAwF,CAAC;AAE3F,8EAA8E;AAC9E,6BAA6B;AAC7B,8EAA8E;AAE9E;;;;;;;;;;GAUG;AACH,MAAM,UAAU,sBAAsB;IACpC,8DAA8D;IAC9D,MAAM,MAAM,GAAG,WAAW,EAAE,CAAC;IAC7B,IAAI,MAAM;QAAE,OAAO,MAAM,CAAC;IAE1B,sEAAsE;IACtE,MAAM,SAAS,GAAG,gBAAgB,EAAE,CAAC;IACrC,IAAI,SAAS;QAAE,OAAO,SAAS,CAAC;IAEhC,+BAA+B;IAC/B,MAAM,SAAS,GAAG,qBAAqB,EAAE,CAAC;IAC1C,IAAI,SAAS;QAAE,OAAO,SAAS,CAAC;IAEhC,qDAAqD;IACrD,MAAM,KAAK,GAAG,oBAAoB,EAAE,CAAC;IACrC,IAAI,KAAK;QAAE,OAAO,KAAK,CAA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I that orchestrates the full setup flow:
6
+ * 1. Ensures OpenClaw is installed and onboarded
7
+ * 2. Installs the @agenthifive/openclaw plugin
8
+ * 3. Bootstraps agent auth with the vault
9
+ * 4. Writes plugin config to openclaw.json
10
+ * 5. Patches OpenClaw for credential proxying
11
+ * 6. Launches OpenClaw's model picker for default model selection
12
+ *
13
+ * Usage:
14
+ * npx @agenthifive/openclaw-setup --base-url https://app.agenthifive.com --bootstrap-secret ah5b_...
15
+ * ah5-setup --base-url https://app.agenthifive.com --bootstrap-secret ah5b_...
16
+ */
17
+ export {};
18
+ //# sourceMappingURL=cli.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAEA;;;;;;;;;;;;;;GAcG"}
package/dist/cli.js ADDED
@@ -0,0 +1,51 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * AgentHiFive Setup CLI
4
+ *
5
+ * Standalone CLI that orchestrates the full setup flow:
6
+ * 1. Ensures OpenClaw is installed and onboarded
7
+ * 2. Installs the @agenthifive/openclaw plugin
8
+ * 3. Bootstraps agent auth with the vault
9
+ * 4. Writes plugin config to openclaw.json
10
+ * 5. Patches OpenClaw for credential proxying
11
+ * 6. Launches OpenClaw's model picker for default model selection
12
+ *
13
+ * Usage:
14
+ * npx @agenthifive/openclaw-setup --base-url https://app.agenthifive.com --bootstrap-secret ah5b_...
15
+ * ah5-setup --base-url https://app.agenthifive.com --bootstrap-secret ah5b_...
16
+ */
17
+ import { runSetup, parseSetupArgs } from "./setup-wizard.js";
18
+ const args = process.argv.slice(2);
19
+ if (args.includes("--help") || args.includes("-h")) {
20
+ process.stdout.write(`
21
+ AgentHiFive Setup CLI
22
+
23
+ Sets up OpenClaw with AgentHiFive vault integration in one command.
24
+ Handles onboarding, plugin installation, auth bootstrap, patching,
25
+ and model selection.
26
+
27
+ Usage:
28
+ ah5-setup --base-url <url> --bootstrap-secret <secret>
29
+ npx @agenthifive/openclaw-setup --base-url <url> --bootstrap-secret <secret>
30
+
31
+ Options:
32
+ --base-url <url> AgentHiFive API base URL
33
+ --bootstrap-secret <secret> Bootstrap secret from dashboard (ah5b_...)
34
+ --config-path <path> Explicit OpenClaw config file path
35
+ --openclaw-dir <path> Explicit OpenClaw installation directory
36
+ --non-interactive Run without prompts (requires --base-url and --bootstrap-secret)
37
+ --skip-onboard Skip OpenClaw onboard step
38
+ --skip-plugin-install Skip plugin installation step
39
+ --skip-model Skip model selection step
40
+ -h, --help Show this help message
41
+
42
+ `);
43
+ process.exit(0);
44
+ }
45
+ const opts = parseSetupArgs(args);
46
+ runSetup(opts).catch((err) => {
47
+ const message = err instanceof Error ? err.message : String(err);
48
+ process.stderr.write(`\n ERROR: ${message}\n\n`);
49
+ process.exit(1);
50
+ });
51
+ //# sourceMappingURL=cli.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAEA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAE7D,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAEnC,IAAI,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;IACnD,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC;;;;;;;;;;;;;;;;;;;;;;CAsBtB,CAAC,CAAC;IACD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC;AAED,MAAM,IAAI,GAAG,cAAc,CAAC,IAAI,CAAC,CAAC;AAElC,QAAQ,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,GAAY,EAAE,EAAE;IACpC,MAAM,OAAO,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IACjE,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,cAAc,OAAO,MAAM,CAAC,CAAC;IAClD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
@@ -0,0 +1,41 @@
1
+ /**
2
+ * OpenClaw config file discovery and merge utilities.
3
+ *
4
+ * Reimplements OpenClaw's config path resolution logic since we can't
5
+ * import from the openclaw package (we're a plugin, not a dependency).
6
+ *
7
+ * Resolution order (matches OpenClaw's src/config/paths.ts):
8
+ * 1. $OPENCLAW_CONFIG_PATH / $CLAWDBOT_CONFIG_PATH (explicit override)
9
+ * 2. $OPENCLAW_STATE_DIR/openclaw.json
10
+ * 3. ~/.openclaw/openclaw.json (preferred)
11
+ * 4. Legacy: ~/.openclaw/clawdbot.json, ~/.clawdbot/, ~/.moltbot/, ~/.moldbot/
12
+ * 5. Return null — caller must ask the user
13
+ */
14
+ /**
15
+ * Find an existing OpenClaw config file.
16
+ *
17
+ * Returns the absolute path to the first existing config file found,
18
+ * or `null` if no config file exists anywhere. The caller should prompt
19
+ * the user rather than silently creating a default file.
20
+ */
21
+ export declare function resolveOpenClawConfigPath(env?: NodeJS.ProcessEnv): string | null;
22
+ /**
23
+ * Return the canonical default config path (for prompting the user).
24
+ */
25
+ export declare function defaultConfigPath(): string;
26
+ /**
27
+ * Read an existing config file. Returns `{}` if the file doesn't exist.
28
+ * Throws on parse errors so the caller can warn the user.
29
+ */
30
+ export declare function readExistingConfig(configPath: string): Record<string, unknown>;
31
+ /**
32
+ * Deep-merge the AgentHiFive plugin config into an existing OpenClaw config.
33
+ *
34
+ * - Sets `plugins.enabled = true`
35
+ * - Adds `"agenthifive"` to `plugins.allow` (deduped)
36
+ * - Adds `"@agenthifive/openclaw"` to `plugins.load.paths` (deduped)
37
+ * - Replaces `plugins.entries.agenthifive` entirely
38
+ * - Preserves ALL other keys untouched
39
+ */
40
+ export declare function mergePluginConfig(existing: Record<string, unknown>, pluginBlock: Record<string, unknown>): Record<string, unknown>;
41
+ //# sourceMappingURL=config-discovery.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config-discovery.d.ts","sourceRoot":"","sources":["../src/config-discovery.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAiDH;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CACvC,GAAG,GAAE,MAAM,CAAC,UAAwB,GACnC,MAAM,GAAG,IAAI,CAgCf;AAED;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,CAE1C;AAMD;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,UAAU,EAAE,MAAM,GACjB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAiBzB;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACjC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACnC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAyCzB"}