@getaclaw/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/dist/setup/steps/configure.d.ts.map +1 -1
- package/dist/setup/steps/configure.js +8 -52
- package/dist/setup/steps/configure.js.map +1 -1
- package/dist/setup/steps/service.d.ts.map +1 -1
- package/dist/setup/steps/service.js +5 -13
- package/dist/setup/steps/service.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configure.d.ts","sourceRoot":"","sources":["../../../src/setup/steps/configure.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"configure.d.ts","sourceRoot":"","sources":["../../../src/setup/steps/configure.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAe,MAAM,aAAa,CAAC;AAI1D,eAAO,MAAM,aAAa,EAAE,SAoB3B,CAAC"}
|
|
@@ -1,65 +1,21 @@
|
|
|
1
|
-
import fs from 'node:fs/promises';
|
|
2
|
-
import path from 'node:path';
|
|
3
|
-
import os from 'node:os';
|
|
4
1
|
import { safeExec } from '../../utils/exec.js';
|
|
5
2
|
import { logger } from '../../utils/logger.js';
|
|
6
|
-
/** Run openclaw config set and throw on failure. */
|
|
7
|
-
async function configSet(key, value) {
|
|
8
|
-
const result = await safeExec('openclaw', ['config', 'set', key, value]);
|
|
9
|
-
if (result.exitCode !== 0) {
|
|
10
|
-
throw new Error(`openclaw config set ${key} failed (exit ${result.exitCode}): ${result.stderr.trim()}`);
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
3
|
export const configureStep = {
|
|
14
4
|
name: 'configure',
|
|
15
|
-
description: '
|
|
5
|
+
description: 'Verify OpenClaw configuration',
|
|
16
6
|
required: true,
|
|
17
7
|
shouldRun: (_config, results) => !!results.get('openclawVersion'),
|
|
18
8
|
async execute(ctx) {
|
|
19
|
-
|
|
20
|
-
const envPath = path.join(openclawDir, '.env');
|
|
21
|
-
ctx.emit('log', 'configure', 'Configuring OpenClaw via CLI...');
|
|
22
|
-
ctx.emit('step.progress', 'configure', 10);
|
|
23
|
-
await fs.mkdir(openclawDir, { recursive: true });
|
|
24
|
-
// Configure gateway settings via openclaw config set
|
|
25
|
-
// Both password and tailscale modes bind to lan — password auth or tailnet is the security layer
|
|
26
|
-
const bindMode = 'lan';
|
|
27
|
-
await configSet('gateway.mode', 'local');
|
|
28
|
-
await configSet('gateway.port', '18789');
|
|
29
|
-
await configSet('gateway.bind', bindMode);
|
|
9
|
+
ctx.emit('log', 'configure', 'Verifying OpenClaw configuration...');
|
|
30
10
|
ctx.emit('step.progress', 'configure', 30);
|
|
31
|
-
//
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
// Allow Control UI over plain HTTP as fallback
|
|
36
|
-
await configSet('gateway.controlUi.allowInsecureAuth', 'true');
|
|
11
|
+
// Verify gateway config is set (configured by cloud-init as root)
|
|
12
|
+
const result = await safeExec('openclaw', ['gateway', 'status', '--json']);
|
|
13
|
+
if (result.exitCode !== 0) {
|
|
14
|
+
throw new Error(`openclaw gateway status failed (exit ${result.exitCode}): ${result.stderr.trim()}`);
|
|
37
15
|
}
|
|
38
|
-
else if (ctx.config.securityMode === 'tailscale') {
|
|
39
|
-
await configSet('gateway.auth.mode', 'token');
|
|
40
|
-
}
|
|
41
|
-
ctx.emit('step.progress', 'configure', 50);
|
|
42
|
-
// Set the default model
|
|
43
|
-
ctx.emit('log', 'configure', 'Setting default model...');
|
|
44
|
-
const model = ctx.config.selectedModels?.[0];
|
|
45
|
-
if (model) {
|
|
46
|
-
const result = await safeExec('openclaw', ['models', 'set', model]);
|
|
47
|
-
if (result.exitCode !== 0) {
|
|
48
|
-
throw new Error(`openclaw models set failed (exit ${result.exitCode}): ${result.stderr.trim()}`);
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
ctx.emit('step.progress', 'configure', 70);
|
|
52
|
-
// Write .env file with API keys for the gateway environment
|
|
53
|
-
ctx.emit('log', 'configure', 'Writing environment file...');
|
|
54
|
-
const envContent = [
|
|
55
|
-
`OPENROUTER_API_KEY=${ctx.config.openrouterApiKey}`,
|
|
56
|
-
'',
|
|
57
|
-
].join('\n');
|
|
58
|
-
await fs.writeFile(envPath, envContent, 'utf-8');
|
|
59
|
-
await fs.chmod(envPath, 0o600);
|
|
60
16
|
ctx.emit('step.progress', 'configure', 100);
|
|
61
|
-
ctx.emit('log', 'configure', 'OpenClaw configuration
|
|
62
|
-
logger.info('OpenClaw configuration
|
|
17
|
+
ctx.emit('log', 'configure', 'OpenClaw configuration verified');
|
|
18
|
+
logger.info('OpenClaw configuration verified');
|
|
63
19
|
},
|
|
64
20
|
};
|
|
65
21
|
//# sourceMappingURL=configure.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configure.js","sourceRoot":"","sources":["../../../src/setup/steps/configure.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"configure.js","sourceRoot":"","sources":["../../../src/setup/steps/configure.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/C,MAAM,CAAC,MAAM,aAAa,GAAc;IACtC,IAAI,EAAE,WAAW;IACjB,WAAW,EAAE,+BAA+B;IAC5C,QAAQ,EAAE,IAAI;IACd,SAAS,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC;IAEjE,KAAK,CAAC,OAAO,CAAC,GAAgB;QAC5B,GAAG,CAAC,IAAI,CAAC,KAAK,EAAE,WAAW,EAAE,qCAAqC,CAAC,CAAC;QACpE,GAAG,CAAC,IAAI,CAAC,eAAe,EAAE,WAAW,EAAE,EAAE,CAAC,CAAC;QAE3C,kEAAkE;QAClE,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,UAAU,EAAE,CAAC,SAAS,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC;QAC3E,IAAI,MAAM,CAAC,QAAQ,KAAK,CAAC,EAAE,CAAC;YAC1B,MAAM,IAAI,KAAK,CAAC,wCAAwC,MAAM,CAAC,QAAQ,MAAM,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QACvG,CAAC;QAED,GAAG,CAAC,IAAI,CAAC,eAAe,EAAE,WAAW,EAAE,GAAG,CAAC,CAAC;QAC5C,GAAG,CAAC,IAAI,CAAC,KAAK,EAAE,WAAW,EAAE,iCAAiC,CAAC,CAAC;QAChE,MAAM,CAAC,IAAI,CAAC,iCAAiC,CAAC,CAAC;IACjD,CAAC;CACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../../src/setup/steps/service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAe,MAAM,aAAa,CAAC;AAI1D,eAAO,MAAM,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../../src/setup/steps/service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAe,MAAM,aAAa,CAAC;AAI1D,eAAO,MAAM,WAAW,EAAE,SA6BzB,CAAC"}
|
|
@@ -2,21 +2,13 @@ import { safeExec } from '../../utils/exec.js';
|
|
|
2
2
|
import { logger } from '../../utils/logger.js';
|
|
3
3
|
export const serviceStep = {
|
|
4
4
|
name: 'service',
|
|
5
|
-
description: '
|
|
5
|
+
description: 'Verify OpenClaw gateway service is running',
|
|
6
6
|
required: true,
|
|
7
7
|
shouldRun: (_config, results) => !!results.get('openclawVersion'),
|
|
8
8
|
async execute(ctx) {
|
|
9
|
-
ctx.emit('log', 'service', '
|
|
10
|
-
ctx.emit('step.progress', 'service',
|
|
11
|
-
//
|
|
12
|
-
await safeExec('openclaw', ['gateway', 'install', '--force', '--port', '18789']);
|
|
13
|
-
ctx.emit('step.progress', 'service', 40);
|
|
14
|
-
// Start the gateway service
|
|
15
|
-
ctx.emit('log', 'service', 'Starting OpenClaw gateway service...');
|
|
16
|
-
await safeExec('openclaw', ['gateway', 'start']);
|
|
17
|
-
ctx.emit('step.progress', 'service', 70);
|
|
18
|
-
// Verify it's running via openclaw gateway status
|
|
19
|
-
ctx.emit('log', 'service', 'Verifying service is running...');
|
|
9
|
+
ctx.emit('log', 'service', 'Checking OpenClaw gateway service...');
|
|
10
|
+
ctx.emit('step.progress', 'service', 30);
|
|
11
|
+
// Gateway is installed and started by cloud-init as root; just verify
|
|
20
12
|
const result = await safeExec('openclaw', ['gateway', 'status', '--json']);
|
|
21
13
|
let status;
|
|
22
14
|
try {
|
|
@@ -30,7 +22,7 @@ export const serviceStep = {
|
|
|
30
22
|
throw new Error(`OpenClaw gateway service is not active (state: ${state ?? 'unknown'})`);
|
|
31
23
|
}
|
|
32
24
|
ctx.emit('step.progress', 'service', 100);
|
|
33
|
-
ctx.emit('log', 'service', 'OpenClaw gateway service
|
|
25
|
+
ctx.emit('log', 'service', 'OpenClaw gateway service is active');
|
|
34
26
|
logger.info('OpenClaw gateway service is active');
|
|
35
27
|
},
|
|
36
28
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.js","sourceRoot":"","sources":["../../../src/setup/steps/service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/C,MAAM,CAAC,MAAM,WAAW,GAAc;IACpC,IAAI,EAAE,SAAS;IACf,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"service.js","sourceRoot":"","sources":["../../../src/setup/steps/service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,MAAM,E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