@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,161 @@
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
+ import { existsSync, readFileSync } from "node:fs";
15
+ import os from "node:os";
16
+ import path from "node:path";
17
+ // ---------------------------------------------------------------------------
18
+ // Constants
19
+ // ---------------------------------------------------------------------------
20
+ const STATE_DIRNAMES = [".openclaw", ".clawdbot", ".moltbot", ".moldbot"];
21
+ const CONFIG_FILENAMES = [
22
+ "openclaw.json",
23
+ "clawdbot.json",
24
+ "moltbot.json",
25
+ "moldbot.json",
26
+ ];
27
+ // ---------------------------------------------------------------------------
28
+ // Home directory resolution (cross-platform)
29
+ // ---------------------------------------------------------------------------
30
+ function resolveHome() {
31
+ // Match OpenClaw's home-dir.ts: OPENCLAW_HOME → HOME → USERPROFILE → os.homedir()
32
+ const explicit = process.env.OPENCLAW_HOME?.trim();
33
+ if (explicit && !explicit.startsWith("~"))
34
+ return path.resolve(explicit);
35
+ const home = process.env.HOME?.trim() ||
36
+ process.env.USERPROFILE?.trim() ||
37
+ os.homedir();
38
+ if (explicit) {
39
+ // OPENCLAW_HOME starts with ~ — expand it
40
+ return path.resolve(explicit.replace(/^~(?=$|[/\\])/, home));
41
+ }
42
+ return home;
43
+ }
44
+ function expandTilde(p) {
45
+ if (!p.startsWith("~"))
46
+ return path.resolve(p);
47
+ return path.resolve(p.replace(/^~(?=$|[/\\])/, resolveHome()));
48
+ }
49
+ // ---------------------------------------------------------------------------
50
+ // Config path resolution
51
+ // ---------------------------------------------------------------------------
52
+ /**
53
+ * Find an existing OpenClaw config file.
54
+ *
55
+ * Returns the absolute path to the first existing config file found,
56
+ * or `null` if no config file exists anywhere. The caller should prompt
57
+ * the user rather than silently creating a default file.
58
+ */
59
+ export function resolveOpenClawConfigPath(env = process.env) {
60
+ // 1. Explicit override
61
+ const explicit = env.OPENCLAW_CONFIG_PATH?.trim() || env.CLAWDBOT_CONFIG_PATH?.trim();
62
+ if (explicit) {
63
+ const resolved = expandTilde(explicit);
64
+ return existsSync(resolved) ? resolved : null;
65
+ }
66
+ // 2. State dir override
67
+ const stateDir = env.OPENCLAW_STATE_DIR?.trim() || env.CLAWDBOT_STATE_DIR?.trim();
68
+ if (stateDir) {
69
+ const resolved = expandTilde(stateDir);
70
+ for (const name of CONFIG_FILENAMES) {
71
+ const candidate = path.join(resolved, name);
72
+ if (existsSync(candidate))
73
+ return candidate;
74
+ }
75
+ return null;
76
+ }
77
+ // 3. Default dirs × config filenames
78
+ const home = resolveHome();
79
+ for (const dir of STATE_DIRNAMES) {
80
+ for (const name of CONFIG_FILENAMES) {
81
+ const candidate = path.join(home, dir, name);
82
+ if (existsSync(candidate))
83
+ return candidate;
84
+ }
85
+ }
86
+ // 4. Not found — caller should ask the user
87
+ return null;
88
+ }
89
+ /**
90
+ * Return the canonical default config path (for prompting the user).
91
+ */
92
+ export function defaultConfigPath() {
93
+ return path.join(resolveHome(), ".openclaw", "openclaw.json");
94
+ }
95
+ // ---------------------------------------------------------------------------
96
+ // Config read / merge / write helpers
97
+ // ---------------------------------------------------------------------------
98
+ /**
99
+ * Read an existing config file. Returns `{}` if the file doesn't exist.
100
+ * Throws on parse errors so the caller can warn the user.
101
+ */
102
+ export function readExistingConfig(configPath) {
103
+ if (!existsSync(configPath))
104
+ return {};
105
+ const raw = readFileSync(configPath, "utf-8").trim();
106
+ if (!raw)
107
+ return {};
108
+ // Try standard JSON first (most configs are valid JSON)
109
+ try {
110
+ return JSON.parse(raw);
111
+ }
112
+ catch {
113
+ // Try stripping single-line comments and trailing commas (light JSON5 compat)
114
+ const cleaned = raw
115
+ .replace(/\/\/.*$/gm, "") // strip // comments
116
+ .replace(/\/\*[\s\S]*?\*\//g, "") // strip /* */ comments
117
+ .replace(/,(\s*[}\]])/g, "$1"); // strip trailing commas
118
+ return JSON.parse(cleaned);
119
+ }
120
+ }
121
+ /**
122
+ * Deep-merge the AgentHiFive plugin config into an existing OpenClaw config.
123
+ *
124
+ * - Sets `plugins.enabled = true`
125
+ * - Adds `"agenthifive"` to `plugins.allow` (deduped)
126
+ * - Adds `"@agenthifive/openclaw"` to `plugins.load.paths` (deduped)
127
+ * - Replaces `plugins.entries.agenthifive` entirely
128
+ * - Preserves ALL other keys untouched
129
+ */
130
+ export function mergePluginConfig(existing, pluginBlock) {
131
+ const result = { ...existing };
132
+ // Extract our plugin config from the block buildConfigOutput() produces
133
+ const srcPlugins = pluginBlock.plugins;
134
+ const srcEntries = srcPlugins.entries ?? {};
135
+ // Build merged plugins object
136
+ const plugins = {
137
+ ...(result.plugins ?? {}),
138
+ };
139
+ plugins.enabled = true;
140
+ // Merge allow list
141
+ const allow = new Set(plugins.allow ?? []);
142
+ allow.add("agenthifive");
143
+ plugins.allow = [...allow];
144
+ // Merge load paths
145
+ const load = {
146
+ ...(plugins.load ?? {}),
147
+ };
148
+ const paths = new Set(load.paths ?? []);
149
+ paths.add("@agenthifive/openclaw");
150
+ load.paths = [...paths];
151
+ plugins.load = load;
152
+ // Replace agenthifive entry entirely (fresh bootstrap replaces old)
153
+ const entries = {
154
+ ...(plugins.entries ?? {}),
155
+ };
156
+ entries.agenthifive = srcEntries.agenthifive;
157
+ plugins.entries = entries;
158
+ result.plugins = plugins;
159
+ return result;
160
+ }
161
+ //# sourceMappingURL=config-disc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AAI,UAAU,CAAC,OAAmC,IAAI,EAAE,CAAC;IAEzE,8BAA8B;IAC9B,MAAM,OAAO,GAAG;QACd,GAAG,CAAE,MAAM,CAAC,OAAmC,IAAI,EAAE,CAAC;KACvD,CAAC;IAEF,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC;IAEvB,mBAAmB;IACnB,MAAM,KAAK,GAAG,IAAI,GAAG,CAClB,OAAO,CAAC,KAA8B,IAAI,EAAE,CAC9C,CAAC;IACF,KAAK,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;IACzB,OAAO,CAAC,KAAK,GAAG,CAAC,GAAG,KAAK,CAAC,CAAC;IAE3B,mBAAmB;IACnB,MAAM,IAAI,GAAG;QACX,GAAG,CAAE,OAAO,CAAC,IAAgC,IAAI,EAAE,CAAC;KACrD,CAAC;IACF,MAAM,KAAK,GAAG,IAAI,GAAG,CAClB,IAAI,CAAC,KAA8B,IAAI,EAAE,CAC3C,CAAC;IACF,KAAK,CAAC,GAAG,CAAC,uBAAuB,CAAC,CAAC;IACnC,IAAI,CAAC,KAAK,GAAG,CAAC,GAAG,KAAK,CAAC,CAAC;IACxB,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC;IAEpB,oEAAoE;IACpE,MAAM,OAAO,GAAG;QACd,GAAG,CAAE,OAAO,CAAC,OAAmC,IAAI,EAAE,CAAC;KACxD,CAAC;IACF,OAAO,CAAC,WAAW,GAAG,UAAU,CAAC,WAAW,CAAC;IAC7C,OAAO,CAAC,OAAO,GAAG,OAAO,CAAC;IAE1B,MAAM,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Shared JWT utilities for ES256 client assertion auth.
3
+ *
4
+ * Used by both VaultClient (on-demand token refresh) and
5
+ * VaultTokenManager (background token refresh).
6
+ */
7
+ import { type KeyLike } from "jose";
8
+ export type TokenExchangeConfig = {
9
+ baseUrl: string;
10
+ agentId: string;
11
+ tokenAudience: string;
12
+ };
13
+ export type TokenExchangeResult = {
14
+ accessToken: string;
15
+ expiresIn: number;
16
+ };
17
+ /**
18
+ * Import a JWK as a KeyLike object for ES256 signing.
19
+ */
20
+ export declare function importES256Key(jwk: JsonWebKey): Promise<KeyLike>;
21
+ /**
22
+ * Sign an ES256 client assertion JWT and exchange it for an access token.
23
+ */
24
+ export declare function exchangeToken(privateKey: KeyLike, config: TokenExchangeConfig): Promise<TokenExchangeResult>;
25
+ export declare class TokenExchangeError extends Error {
26
+ readonly statusCode: number;
27
+ constructor(message: string, statusCode: number);
28
+ }
29
+ //# sourceMappingURL=jwt-utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jwt-utils.d.ts","sourceRoot":"","sources":["../src/jwt-utils.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAsB,KAAK,OAAO,EAAY,MAAM,MAAM,CAAC;AAElE,MAAM,MAAM,mBAAmB,GAAG;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF;;GAEG;AACH,wBAAsB,cAAc,CAAC,GAAG,EAAE,UAAU,GAAG,OAAO,CAAC,OAAO,CAAC,CAEtE;AAED;;GAEG;AACH,wBAAsB,aAAa,CACjC,UAAU,EAAE,OAAO,EACnB,MAAM,EAAE,mBAAmB,GAC1B,OAAO,CAAC,mBAAmB,CAAC,CAuC9B;AAED,qBAAa,kBAAmB,SAAQ,KAAK;aAGzB,UAAU,EAAE,MAAM;gBADlC,OAAO,EAAE,MAAM,EACC,UAAU,EAAE,MAAM;CAKrC"}
@@ -0,0 +1,55 @@
1
+ /**
2
+ * Shared JWT utilities for ES256 client assertion auth.
3
+ *
4
+ * Used by both VaultClient (on-demand token refresh) and
5
+ * VaultTokenManager (background token refresh).
6
+ */
7
+ import { SignJWT, importJWK } from "jose";
8
+ /**
9
+ * Import a JWK as a KeyLike object for ES256 signing.
10
+ */
11
+ export async function importES256Key(jwk) {
12
+ return (await importJWK(jwk, "ES256"));
13
+ }
14
+ /**
15
+ * Sign an ES256 client assertion JWT and exchange it for an access token.
16
+ */
17
+ export async function exchangeToken(privateKey, config) {
18
+ const now = Math.floor(Date.now() / 1000);
19
+ const assertion = await new SignJWT({})
20
+ .setProtectedHeader({ alg: "ES256" })
21
+ .setIssuer(config.agentId)
22
+ .setSubject(config.agentId)
23
+ .setAudience(config.tokenAudience)
24
+ .setIssuedAt(now)
25
+ .setExpirationTime(now + 30)
26
+ .setJti(crypto.randomUUID())
27
+ .sign(privateKey);
28
+ const response = await fetch(`${config.baseUrl}/v1/agents/token`, {
29
+ method: "POST",
30
+ headers: { "Content-Type": "application/json" },
31
+ body: JSON.stringify({
32
+ grant_type: "client_assertion",
33
+ client_assertion_type: "urn:ietf:params:oauth:client-assertion-type:jwt-bearer",
34
+ client_assertion: assertion,
35
+ }),
36
+ });
37
+ if (!response.ok) {
38
+ const text = await response.text().catch(() => "");
39
+ throw new TokenExchangeError(`Token exchange failed: ${response.status} ${text}`, response.status);
40
+ }
41
+ const result = (await response.json());
42
+ return {
43
+ accessToken: result.access_token,
44
+ expiresIn: result.expires_in,
45
+ };
46
+ }
47
+ export class TokenExchangeError extends Error {
48
+ statusCode;
49
+ constructor(message, statusCode) {
50
+ super(message);
51
+ this.statusCode = statusCode;
52
+ this.name = "TokenExchangeError";
53
+ }
54
+ }
55
+ //# sourceMappingURL=jwt-utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jwt-utils.js","sourceRoot":"","sources":["../src/jwt-utils.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,OAAO,EAAE,SAAS,EAA0B,MAAM,MAAM,CAAC;AAalE;;GAEG;AACH,MAAM,CAAC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I,IAAI,EAAE,EACnD,QAAQ,CAAC,MAAM,CAChB,CAAC;IACJ,CAAC;IAED,MAAM,MAAM,GAAG,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAGpC,CAAC;IAEF,OAAO;QACL,WAAW,EAAE,MAAM,CAAC,YAAY;QAChC,SAAS,EAAE,MAAM,CAAC,UAAU;KAC7B,CAAC;AACJ,CAAC;AAED,MAAM,OAAO,kBAAmB,SAAQ,KAAK;IAGzB;IAFlB,YACE,OAAe,EACC,UAAkB;QAElC,KAAK,CAAC,OAAO,CAAC,CAAC;QAFC,eAAU,GAAV,UAAU,CAAQ;QAGlC,IAAI,CAAC,IAAI,GAAG,oBAAoB,CAAC;IACnC,CAAC;CACF"}
@@ -0,0 +1,34 @@
1
+ /**
2
+ * AgentHiFive standalone setup CLI.
3
+ *
4
+ * Orchestrates the full setup flow in one command:
5
+ * 1. Checks OpenClaw is installed
6
+ * 2. Runs `openclaw onboard` if needed
7
+ * 3. Installs the @agenthifive/openclaw plugin
8
+ * 4. Bootstraps agent auth (key pair + token exchange)
9
+ * 5. Fetches vault capabilities
10
+ * 6. Writes plugin config to openclaw.json
11
+ * 7. Patches OpenClaw for credential proxying
12
+ * 8. Launches `openclaw model` for default model selection
13
+ */
14
+ export interface SetupOptions {
15
+ baseUrl?: string;
16
+ bootstrapSecret?: string;
17
+ nonInteractive?: boolean;
18
+ configPath?: string;
19
+ openclawDir?: string;
20
+ skipOnboard?: boolean;
21
+ skipPluginInstall?: boolean;
22
+ skipModel?: boolean;
23
+ }
24
+ export declare function buildConfigOutput(params: {
25
+ baseUrl: string;
26
+ agentId: string;
27
+ privateKey: JsonWebKey;
28
+ connections: Record<string, string>;
29
+ connectedProviders: string[];
30
+ proxiedProviders: string[];
31
+ }): object;
32
+ export declare function runSetup(opts?: SetupOptions): Promise<void>;
33
+ export declare function parseSetupArgs(args: string[]): SetupOptions;
34
+ //# sourceMappingURL=setup-wizard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setup-wizard.d.ts","sourceRoot":"","sources":["../src/setup-wizard.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAwBH,MAAM,WAAW,YAAY;IAC3B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAiLD,wBAAgB,iBAAiB,CAAC,MAAM,EAAE;IACxC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,UAAU,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,kBAAkB,EAAE,MAAM,EAAE,CAAC;IAC7B,gBAAgB,EAAE,MAAM,EAAE,CAAC;CAC5B,GAAG,MAAM,CA4BT;AAMD,wBAAsB,QAAQ,CAAC,IAAI,GAAE,YAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CAyUrE;AAmCD,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,YAAY,CAkC3D"}