@openclaw-cloud/agent-controller 3.0.0-beta.2 → 3.0.0-beta.20
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/bin/agent-controller.js +5 -9
- package/dist/api.d.ts +16 -0
- package/dist/api.js.map +1 -1
- package/dist/commands/agent-update-cli.js +23 -38
- package/dist/commands/agent-update-cli.js.map +1 -1
- package/dist/commands/backup-cli.js +6 -4
- package/dist/commands/backup-cli.js.map +1 -1
- package/dist/commands/bootstrap.d.ts +10 -1
- package/dist/commands/bootstrap.js +33 -73
- package/dist/commands/bootstrap.js.map +1 -1
- package/dist/commands/channel-server.js +4 -3
- package/dist/commands/channel-server.js.map +1 -1
- package/dist/commands/heartbeat-cli.js +2 -6
- package/dist/commands/heartbeat-cli.js.map +1 -1
- package/dist/commands/install-deps.d.ts +10 -0
- package/dist/commands/install-deps.js +33 -43
- package/dist/commands/install-deps.js.map +1 -1
- package/dist/commands/knowledge-sync-cli.js +6 -4
- package/dist/commands/knowledge-sync-cli.js.map +1 -1
- package/dist/commands/plugin-update-cli.js +4 -8
- package/dist/commands/plugin-update-cli.js.map +1 -1
- package/dist/commands/self-update.d.ts +1 -0
- package/dist/commands/self-update.js +76 -37
- package/dist/commands/self-update.js.map +1 -1
- package/dist/commands/update-skills.js +7 -6
- package/dist/commands/update-skills.js.map +1 -1
- package/dist/config-file.d.ts +24 -0
- package/dist/config-file.js +56 -20
- package/dist/config-file.js.map +1 -1
- package/dist/config.d.ts +4 -0
- package/dist/config.js +12 -0
- package/dist/config.js.map +1 -1
- package/dist/connection.d.ts +4 -0
- package/dist/connection.js +50 -5
- package/dist/connection.js.map +1 -1
- package/dist/handlers/agent-update.d.ts +4 -0
- package/dist/handlers/agent-update.js +16 -44
- package/dist/handlers/agent-update.js.map +1 -1
- package/dist/handlers/deploy.d.ts +1 -2
- package/dist/handlers/deploy.js +4 -20
- package/dist/handlers/deploy.js.map +1 -1
- package/dist/handlers/diagnostics.js +0 -12
- package/dist/handlers/diagnostics.js.map +1 -1
- package/dist/handlers/file-delete.js +4 -5
- package/dist/handlers/file-delete.js.map +1 -1
- package/dist/handlers/file-write.js +4 -4
- package/dist/handlers/file-write.js.map +1 -1
- package/dist/handlers/knowledge-sync.js +2 -14
- package/dist/handlers/knowledge-sync.js.map +1 -1
- package/dist/handlers/memory.d.ts +11 -1
- package/dist/handlers/memory.js.map +1 -1
- package/dist/handlers/onboarding.d.ts +1 -2
- package/dist/handlers/onboarding.js +3 -20
- package/dist/handlers/onboarding.js.map +1 -1
- package/dist/handlers/package-install.js +1 -1
- package/dist/handlers/package-install.js.map +1 -1
- package/dist/handlers/pair.js +0 -12
- package/dist/handlers/pair.js.map +1 -1
- package/dist/handlers/restart.d.ts +1 -2
- package/dist/handlers/restart.js +3 -8
- package/dist/handlers/restart.js.map +1 -1
- package/dist/handlers/slack-event.d.ts +13 -0
- package/dist/handlers/slack-event.js +40 -0
- package/dist/handlers/slack-event.js.map +1 -0
- package/dist/handlers/stop.js +0 -7
- package/dist/handlers/stop.js.map +1 -1
- package/dist/handlers/telegram-webhook.js +3 -22
- package/dist/handlers/telegram-webhook.js.map +1 -1
- package/dist/handlers/update-config.js +4 -13
- package/dist/handlers/update-config.js.map +1 -1
- package/dist/heartbeat.d.ts +7 -1
- package/dist/heartbeat.js +35 -6
- package/dist/heartbeat.js.map +1 -1
- package/dist/index.d.ts +0 -8
- package/dist/index.js +87 -119
- package/dist/index.js.map +1 -1
- package/dist/lockfile.js +2 -1
- package/dist/lockfile.js.map +1 -1
- package/dist/platform/linux.js +6 -5
- package/dist/platform/linux.js.map +1 -1
- package/dist/platform/macos.js +3 -2
- package/dist/platform/macos.js.map +1 -1
- package/dist/platform/windows.js +3 -2
- package/dist/platform/windows.js.map +1 -1
- package/dist/providers/claude-code/channel-server.js +2 -1
- package/dist/providers/claude-code/channel-server.js.map +1 -1
- package/dist/providers/claude-code/settings-writer.d.ts +3 -2
- package/dist/providers/claude-code/settings-writer.js +6 -15
- package/dist/providers/claude-code/settings-writer.js.map +1 -1
- package/dist/providers/index.d.ts +13 -0
- package/dist/providers/index.js +25 -0
- package/dist/providers/index.js.map +1 -1
- package/dist/providers/openclaw/gateway-adapter.js +2 -0
- package/dist/providers/openclaw/gateway-adapter.js.map +1 -1
- package/dist/providers/openclaw/gateway-client.js +6 -1
- package/dist/providers/openclaw/gateway-client.js.map +1 -1
- package/dist/providers/openclaw/index.js +11 -13
- package/dist/providers/openclaw/index.js.map +1 -1
- package/dist/slack-relay-server.d.ts +48 -0
- package/dist/slack-relay-server.js +197 -0
- package/dist/slack-relay-server.js.map +1 -0
- package/dist/types.d.ts +16 -1
- package/dist/utils/anthropic-auth.d.ts +14 -0
- package/dist/utils/anthropic-auth.js +24 -0
- package/dist/utils/anthropic-auth.js.map +1 -1
- package/dist/utils/apply-config.d.ts +65 -12
- package/dist/utils/apply-config.js +295 -100
- package/dist/utils/apply-config.js.map +1 -1
- package/dist/utils/claude-env.d.ts +6 -0
- package/dist/utils/claude-env.js +29 -28
- package/dist/utils/claude-env.js.map +1 -1
- package/dist/utils/config-merge-paths.d.ts +15 -1
- package/dist/utils/config-merge-paths.js +17 -3
- package/dist/utils/config-merge-paths.js.map +1 -1
- package/dist/utils/deploy-type.d.ts +16 -0
- package/dist/utils/deploy-type.js +34 -0
- package/dist/utils/deploy-type.js.map +1 -0
- package/dist/utils/env.d.ts +0 -1
- package/dist/utils/env.js +0 -8
- package/dist/utils/env.js.map +1 -1
- package/dist/utils/exec.d.ts +11 -0
- package/dist/utils/exec.js +47 -1
- package/dist/utils/exec.js.map +1 -1
- package/dist/utils/gateway-restart-handler.d.ts +6 -2
- package/dist/utils/gateway-restart-handler.js +11 -2
- package/dist/utils/gateway-restart-handler.js.map +1 -1
- package/dist/utils/gateway-restart.d.ts +7 -0
- package/dist/utils/gateway-restart.js +12 -4
- package/dist/utils/gateway-restart.js.map +1 -1
- package/dist/utils/knowledge-graph.d.ts +13 -1
- package/dist/utils/knowledge-graph.js +75 -29
- package/dist/utils/knowledge-graph.js.map +1 -1
- package/dist/utils/legacy-mcp-servers.d.ts +12 -0
- package/dist/utils/legacy-mcp-servers.js +37 -0
- package/dist/utils/legacy-mcp-servers.js.map +1 -0
- package/dist/utils/log-collector.js +2 -1
- package/dist/utils/log-collector.js.map +1 -1
- package/dist/utils/openclaw-ops.d.ts +45 -3
- package/dist/utils/openclaw-ops.js +94 -15
- package/dist/utils/openclaw-ops.js.map +1 -1
- package/dist/utils/openclaw-stack-update.d.ts +31 -0
- package/dist/utils/openclaw-stack-update.js +50 -0
- package/dist/utils/openclaw-stack-update.js.map +1 -0
- package/dist/utils/package-install.js +4 -12
- package/dist/utils/package-install.js.map +1 -1
- package/dist/utils/package-version.d.ts +10 -0
- package/dist/utils/package-version.js +18 -0
- package/dist/utils/package-version.js.map +1 -0
- package/dist/utils/parse-id-at-version.d.ts +15 -0
- package/dist/utils/parse-id-at-version.js +22 -0
- package/dist/utils/parse-id-at-version.js.map +1 -0
- package/dist/utils/plugin-reconcile.d.ts +46 -0
- package/dist/utils/plugin-reconcile.js +201 -0
- package/dist/utils/plugin-reconcile.js.map +1 -0
- package/dist/utils/response.js +1 -0
- package/dist/utils/response.js.map +1 -1
- package/dist/utils/write-home-files.d.ts +27 -0
- package/dist/utils/write-home-files.js +72 -0
- package/dist/utils/write-home-files.js.map +1 -0
- package/dist/utils/write-workspace-files.d.ts +1 -1
- package/dist/utils/write-workspace-files.js +19 -7
- package/dist/utils/write-workspace-files.js.map +1 -1
- package/dist/workspace.d.ts +11 -0
- package/dist/workspace.js +20 -0
- package/dist/workspace.js.map +1 -1
- package/package.json +9 -4
|
@@ -10,4 +10,28 @@ export function classifyAnthropicAuth(input) {
|
|
|
10
10
|
return { kind: 'auth_token', value: apiKey };
|
|
11
11
|
return { kind: 'api_key', value: apiKey };
|
|
12
12
|
}
|
|
13
|
+
/** The permissions block both Claude settings writers emit, verbatim. */
|
|
14
|
+
export const CLAUDE_PERMISSIONS = {
|
|
15
|
+
allow: ['Bash(*)', 'Read(*)', 'Write(*)', 'Edit(*)', 'mcp__*'],
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* The settings.json base shared by both writers: the permissions block plus the
|
|
19
|
+
* `env` entry the auth classification implies.
|
|
20
|
+
*
|
|
21
|
+
* `providers/claude-code/settings-writer.ts` uses this as its complete output;
|
|
22
|
+
* `utils/claude-env.ts` uses it for the OAuth branch and composes its own
|
|
23
|
+
* apiKeyHelper variant for the API-key branch (that flow reads the key out of
|
|
24
|
+
* the VM `.env` at runtime instead of embedding it).
|
|
25
|
+
*/
|
|
26
|
+
export function buildClaudeSettings(auth) {
|
|
27
|
+
switch (auth.kind) {
|
|
28
|
+
case 'auth_token':
|
|
29
|
+
return { permissions: CLAUDE_PERMISSIONS, env: { ANTHROPIC_AUTH_TOKEN: auth.value } };
|
|
30
|
+
case 'api_key':
|
|
31
|
+
return { permissions: CLAUDE_PERMISSIONS, env: { ANTHROPIC_API_KEY: auth.value } };
|
|
32
|
+
case 'none':
|
|
33
|
+
// No static credentials: rely on ~/.claude/.credentials.json (subscription login).
|
|
34
|
+
return { permissions: CLAUDE_PERMISSIONS };
|
|
35
|
+
}
|
|
36
|
+
}
|
|
13
37
|
//# sourceMappingURL=anthropic-auth.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"anthropic-auth.js","sourceRoot":"","sources":["../../src/utils/anthropic-auth.ts"],"names":[],"mappings":"AAiBA,MAAM,UAAU,qBAAqB,CAAC,KAGrC;IACC,MAAM,SAAS,GAAG,KAAK,CAAC,kBAAkB,EAAE,IAAI,EAAE,CAAC;IACnD,IAAI,SAAS;QAAE,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC;IAE/D,MAAM,MAAM,GAAG,KAAK,CAAC,eAAe,EAAE,IAAI,EAAE,CAAC;IAC7C,IAAI,CAAC,MAAM;QAAE,OAAO,EAAE,IAAI,EAAE,MAA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AAI,CAAC,KAAK,EAAE,EAAE,CAAC;QACxF,KAAK,SAAS;YACZ,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,GAAG,EAAE,EAAE,iBAAiB,EAAE,IAAI,CAAC,KAAK,EAAE,EAAE,CAAC;QACrF,KAAK,MAAM;YACT,mFAAmF;YACnF,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,CAAC;IAC/C,CAAC;AACH,CAAC"}
|
|
@@ -1,14 +1,29 @@
|
|
|
1
|
-
import type { BootstrapResult } from '../api.js';
|
|
1
|
+
import type { AgentApi, BootstrapResult } from '../api.js';
|
|
2
|
+
/** Canonical openclaw.json location — `<stateDir>/openclaw.json`. */
|
|
3
|
+
export declare function getOpenclawJsonPath(): string;
|
|
2
4
|
/**
|
|
3
|
-
*
|
|
5
|
+
* The ONE writer for openclaw.json — atomic (tmp + rename) and mode 0600.
|
|
6
|
+
*
|
|
7
|
+
* Both properties are load-bearing and used to be split across three
|
|
8
|
+
* independent write sites: the full apply wrote 0600 but non-atomically (a
|
|
9
|
+
* reader could see a truncated file), the scoped merge wrote atomically but
|
|
10
|
+
* with no mode (tmp + rename RESETS a pre-existing 0600 file to 0644, leaking
|
|
11
|
+
* `models.providers[*].apiKey`), and the startup memory-MCP injection did
|
|
12
|
+
* neither. Everything goes through here now.
|
|
13
|
+
*/
|
|
14
|
+
export declare function writeOpenclawJson(data: Record<string, unknown>): Promise<void>;
|
|
15
|
+
/**
|
|
16
|
+
* FULL apply — only ever legal on a managed install (see `isManagedDeploy`).
|
|
17
|
+
* Rewrites files wholesale:
|
|
4
18
|
* 1. Write openclaw.json
|
|
5
|
-
* 2. Write
|
|
6
|
-
* 3. Write .
|
|
7
|
-
* 4.
|
|
19
|
+
* 2. Write workspace files + skills
|
|
20
|
+
* 3. Write auth-profiles.json + settings.json (from envVars)
|
|
21
|
+
* 4. MERGE .env (for VM agents) — never a wholesale replace, see step 4 below
|
|
22
|
+
* 5. Restart gateway
|
|
8
23
|
*/
|
|
9
24
|
export declare function applyBootstrapConfig(data: BootstrapResult): Promise<void>;
|
|
10
|
-
type MergeOutcome = 'added' | 'equal' | 'conflict' | 'merged';
|
|
11
|
-
interface MergeResult {
|
|
25
|
+
type MergeOutcome = 'added' | 'equal' | 'conflict' | 'merged' | 'overwritten';
|
|
26
|
+
export interface MergeResult {
|
|
12
27
|
changed: boolean;
|
|
13
28
|
outcomes: Array<{
|
|
14
29
|
path: string;
|
|
@@ -26,12 +41,50 @@ interface MergeResult {
|
|
|
26
41
|
* - Missing local value → remote is written.
|
|
27
42
|
* - Equal values → no-op.
|
|
28
43
|
* - Differing values → conflict, local wins, warn+skip logged.
|
|
29
|
-
* - For
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
44
|
+
* - For object paths: conflict detection is per-key inside the dict.
|
|
45
|
+
* - **Exception — `mcp.servers` in openclaw.json is REMOTE-wins per key.**
|
|
46
|
+
* That section is backend-managed: the URL, transport and bearer token of a
|
|
47
|
+
* backend-generated server (e.g. `openclaw-cloud`) change over time, and
|
|
48
|
+
* under local-wins an updated entry could never reach a standalone agent —
|
|
49
|
+
* a rotated token was skipped forever (observed live 2026-08-02). Every
|
|
50
|
+
* server NAME present in the payload is overwritten; names that exist only
|
|
51
|
+
* locally are left untouched.
|
|
52
|
+
* LIMITATION — no deletions. A server removed in the backend stays in the
|
|
53
|
+
* local openclaw.json: the payload cannot distinguish "removed upstream"
|
|
54
|
+
* from "never managed here", and dropping local-only entries would delete
|
|
55
|
+
* the user's own servers. Removal on standalone is a manual edit.
|
|
56
|
+
* - Restarts the gateway **iff** the `mcp.servers` subtree actually changed.
|
|
57
|
+
* This is a FALLBACK, not the primary delivery mechanism: openclaw 2026.7.1
|
|
58
|
+
* does self-reload this section (verified live 2026-08-03 — the gateway
|
|
59
|
+
* logged `[reload] config hot reload applied (mcp.servers.<name>.url,
|
|
60
|
+
* mcp.servers.<name>.headers)` on an overwrite, with no restart). The
|
|
61
|
+
* restart covers builds/paths where that self-reload does not fire, and
|
|
62
|
+
* mirrors what applyBootstrapConfig does on managed installs. It is
|
|
63
|
+
* best-effort: a failure is logged and does not fail the apply — on a
|
|
64
|
+
* launchd box where `openclaw` is not on the service PATH it never runs at
|
|
65
|
+
* all, and the merge still lands.
|
|
66
|
+
* - Settings.json (~/.claude/settings.json) keeps LOCAL-wins for
|
|
67
|
+
* `mcp.servers` ONLY — apiKeyHelper/permissions/env/etc untouched. `env` is
|
|
68
|
+
* never written here: it would redirect the user's own Claude Code sessions
|
|
69
|
+
* to the platform proxy (see MERGEABLE_SETTINGS_PATHS).
|
|
34
70
|
* - auth-profiles.json and .env are NOT touched on standalone.
|
|
35
71
|
*/
|
|
36
72
|
export declare function applyMergeableConfig(data: BootstrapResult): Promise<MergeResult>;
|
|
73
|
+
export interface ApplyConfigOutcome {
|
|
74
|
+
/** True when the full apply ran (managed install), false for scoped merge. */
|
|
75
|
+
managed: boolean;
|
|
76
|
+
/** Present only on the scoped-merge path. */
|
|
77
|
+
mergeResult?: MergeResult;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* The one owner of "fetch bootstrap and apply it". Every caller — the
|
|
81
|
+
* `update_config` WS handler, the `bootstrap` CLI, the opt-in startup refresh —
|
|
82
|
+
* goes through here so the deploy-type decision cannot drift between them.
|
|
83
|
+
*
|
|
84
|
+
* Managed installs ('vm'/'k8s') are provisioned end to end by the platform and
|
|
85
|
+
* get the full apply. Anything else — 'standalone', 'external', or a payload
|
|
86
|
+
* from an older backend that omits `deploymentType` — is a third-party machine
|
|
87
|
+
* and gets the scoped, additive merge only. Never rewrite files we don't own.
|
|
88
|
+
*/
|
|
89
|
+
export declare function fetchAndApplyConfig(api: AgentApi, agentId: string): Promise<ApplyConfigOutcome>;
|
|
37
90
|
export {};
|