quukk-clawmessenger 0.1.0-beta.21 → 0.1.0-beta.23
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/go/binary.d.ts +1 -1
- package/dist/go/binary.js +7 -7
- package/dist/go/client.js +1 -1
- package/dist/go/recovering-task.d.ts +24 -0
- package/dist/go/recovering-task.js +45 -0
- package/dist/http/routes.d.ts +2 -2
- package/dist/http/routes.js +2 -2
- package/dist/process/supervisor.js +1 -1
- package/dist/service.js +16 -3
- package/package.json +24 -10
- package/scripts/audit-tarball.mjs +1 -0
package/dist/go/binary.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export type BridgeRuntimePackage = {
|
|
2
2
|
packageName: string;
|
|
3
|
-
binary: '
|
|
3
|
+
binary: 'clawmessenger-runtime.exe' | 'clawmessenger-runtime';
|
|
4
4
|
};
|
|
5
5
|
export type BridgeBinaryErrorCode = 'unsupported_platform' | 'runtime_package_missing' | 'package_version_mismatch' | 'manifest_too_large' | 'manifest_invalid' | 'manifest_version_mismatch' | 'binary_not_file' | 'binary_read_failed' | 'binary_hash_mismatch';
|
|
6
6
|
export declare class BridgeBinaryError extends Error {
|
package/dist/go/binary.js
CHANGED
|
@@ -22,33 +22,33 @@ const ManifestSchema = z.strictObject({
|
|
|
22
22
|
goVersion: z.string().regex(/^go1\.[1-9]\d*(?:\.(?:0|[1-9]\d*))?(?:[a-z]+\d*)?$/),
|
|
23
23
|
sourceCommit: z.string().regex(/^[0-9a-f]{40}$/),
|
|
24
24
|
sha256: z.string().regex(/^[0-9a-f]{64}$/),
|
|
25
|
-
binary: z.enum(['
|
|
25
|
+
binary: z.enum(['clawmessenger-runtime.exe', 'clawmessenger-runtime']),
|
|
26
26
|
modules: z.array(z.string().regex(/^[^\s@]+@v[^\s@]+$/)).min(1).max(256),
|
|
27
27
|
});
|
|
28
28
|
const packageMatrix = {
|
|
29
29
|
'win32/x64': {
|
|
30
30
|
packageName: '@quukk/clawmessenger-runtime-win32-x64',
|
|
31
|
-
binary: '
|
|
31
|
+
binary: 'clawmessenger-runtime.exe',
|
|
32
32
|
},
|
|
33
33
|
'win32/arm64': {
|
|
34
34
|
packageName: '@quukk/clawmessenger-runtime-win32-arm64',
|
|
35
|
-
binary: '
|
|
35
|
+
binary: 'clawmessenger-runtime.exe',
|
|
36
36
|
},
|
|
37
37
|
'darwin/x64': {
|
|
38
38
|
packageName: '@quukk/clawmessenger-runtime-darwin-x64',
|
|
39
|
-
binary: '
|
|
39
|
+
binary: 'clawmessenger-runtime',
|
|
40
40
|
},
|
|
41
41
|
'darwin/arm64': {
|
|
42
42
|
packageName: '@quukk/clawmessenger-runtime-darwin-arm64',
|
|
43
|
-
binary: '
|
|
43
|
+
binary: 'clawmessenger-runtime',
|
|
44
44
|
},
|
|
45
45
|
'linux/x64': {
|
|
46
46
|
packageName: '@quukk/clawmessenger-runtime-linux-x64',
|
|
47
|
-
binary: '
|
|
47
|
+
binary: 'clawmessenger-runtime',
|
|
48
48
|
},
|
|
49
49
|
'linux/arm64': {
|
|
50
50
|
packageName: '@quukk/clawmessenger-runtime-linux-arm64',
|
|
51
|
-
binary: '
|
|
51
|
+
binary: 'clawmessenger-runtime',
|
|
52
52
|
},
|
|
53
53
|
};
|
|
54
54
|
async function readBoundedFile(path, maximumBytes) {
|
package/dist/go/client.js
CHANGED
|
@@ -2,7 +2,7 @@ import { BridgeHealthSchema, BridgeHTTPErrorEnvelopeSchema, BridgeRuntimeListSch
|
|
|
2
2
|
import { parseSSE, SSEProtocolError } from './sse.js';
|
|
3
3
|
const JSON_LIMIT = 1 << 20;
|
|
4
4
|
const REQUEST_TIMEOUT = 10_000;
|
|
5
|
-
const REFRESH_TIMEOUT =
|
|
5
|
+
const REFRESH_TIMEOUT = 150_000;
|
|
6
6
|
const SSE_IDLE_TIMEOUT = 45_000;
|
|
7
7
|
const RECONNECT_BASE_DELAY = 100;
|
|
8
8
|
const RECONNECT_MAXIMUM_DELAY = 2_000;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { BridgeTaskEvent, BridgeTaskPort } from './types.js';
|
|
2
|
+
export interface RecoveringBridgeTaskOptions {
|
|
3
|
+
resolveTask(): BridgeTaskPort;
|
|
4
|
+
ensureBridge(): Promise<void>;
|
|
5
|
+
refreshRuntime(runtimeId: string): Promise<boolean>;
|
|
6
|
+
}
|
|
7
|
+
export declare class RecoveringBridgeTask implements BridgeTaskPort {
|
|
8
|
+
#private;
|
|
9
|
+
constructor(options: RecoveringBridgeTaskOptions);
|
|
10
|
+
startTask(input: {
|
|
11
|
+
model?: string;
|
|
12
|
+
requestId?: string;
|
|
13
|
+
runtimeId: string;
|
|
14
|
+
conversationKey: string;
|
|
15
|
+
prompt: string;
|
|
16
|
+
workdir: string;
|
|
17
|
+
resumeSessionId?: string;
|
|
18
|
+
}): Promise<{
|
|
19
|
+
taskId: string;
|
|
20
|
+
eventsUrl: string;
|
|
21
|
+
}>;
|
|
22
|
+
events(taskId: string, afterEventId?: number): AsyncIterable<BridgeTaskEvent>;
|
|
23
|
+
cancelTask(taskId: string): Promise<void>;
|
|
24
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { BridgeClientError } from './client.js';
|
|
2
|
+
export class RecoveringBridgeTask {
|
|
3
|
+
#options;
|
|
4
|
+
constructor(options) {
|
|
5
|
+
this.#options = options;
|
|
6
|
+
}
|
|
7
|
+
async startTask(input) {
|
|
8
|
+
try {
|
|
9
|
+
return await this.#options.resolveTask().startTask(input);
|
|
10
|
+
}
|
|
11
|
+
catch (error) {
|
|
12
|
+
if (!(error instanceof BridgeClientError))
|
|
13
|
+
throw error;
|
|
14
|
+
if (error.code === 'transport_error') {
|
|
15
|
+
await this.#recover(error, () => this.#options.ensureBridge());
|
|
16
|
+
return this.#options.resolveTask().startTask(input);
|
|
17
|
+
}
|
|
18
|
+
if (error.code === 'request_timeout') {
|
|
19
|
+
await this.#recover(error, () => this.#options.ensureBridge());
|
|
20
|
+
throw error;
|
|
21
|
+
}
|
|
22
|
+
if (error.code === 'remote_error' && (error.status === 409 || error.status === 404)) {
|
|
23
|
+
const ready = await this.#recover(error, () => this.#options.refreshRuntime(input.runtimeId));
|
|
24
|
+
if (!ready)
|
|
25
|
+
throw error;
|
|
26
|
+
return this.#options.resolveTask().startTask(input);
|
|
27
|
+
}
|
|
28
|
+
throw error;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
async #recover(original, action) {
|
|
32
|
+
try {
|
|
33
|
+
return await action();
|
|
34
|
+
}
|
|
35
|
+
catch {
|
|
36
|
+
throw original;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
events(taskId, afterEventId) {
|
|
40
|
+
return this.#options.resolveTask().events(taskId, afterEventId);
|
|
41
|
+
}
|
|
42
|
+
async cancelTask(taskId) {
|
|
43
|
+
await this.#options.resolveTask().cancelTask(taskId);
|
|
44
|
+
}
|
|
45
|
+
}
|
package/dist/http/routes.d.ts
CHANGED
|
@@ -477,10 +477,10 @@ export declare const ControlPairingResponseSchema: z.ZodObject<{
|
|
|
477
477
|
}, z.core.$strict>;
|
|
478
478
|
}, z.core.$strict>;
|
|
479
479
|
export type ControlPairingResponse = z.infer<typeof ControlPairingResponseSchema>;
|
|
480
|
-
export declare const RUNTIME_REFRESH_TIMEOUT_MS =
|
|
480
|
+
export declare const RUNTIME_REFRESH_TIMEOUT_MS = 150000;
|
|
481
481
|
export declare const CONTROL_OPERATION_TIMEOUT_MS: Readonly<{
|
|
482
482
|
readonly status: 5000;
|
|
483
|
-
readonly rescan:
|
|
483
|
+
readonly rescan: 150000;
|
|
484
484
|
readonly pairing_status: 10000;
|
|
485
485
|
readonly pairing_start: 45000;
|
|
486
486
|
}>;
|
package/dist/http/routes.js
CHANGED
|
@@ -171,10 +171,10 @@ export const ControlPairingResponseSchema = z.strictObject({
|
|
|
171
171
|
pairing: PairingResponseSchema,
|
|
172
172
|
});
|
|
173
173
|
// A runtime refresh probes every installed agent CLI. The interactive proof
|
|
174
|
-
// alone is allowed agent.InteractiveProbeTimeout (
|
|
174
|
+
// alone is allowed agent.InteractiveProbeTimeout (45s), and version detection
|
|
175
175
|
// spends more on top of it, so neither the browser route nor the control route
|
|
176
176
|
// may cap the operation below this.
|
|
177
|
-
export const RUNTIME_REFRESH_TIMEOUT_MS =
|
|
177
|
+
export const RUNTIME_REFRESH_TIMEOUT_MS = 150_000;
|
|
178
178
|
// Server-side budgets for the CLI control channel. The CLI's own request budget
|
|
179
179
|
// is derived from these (see CONTROL_REQUEST_TIMEOUT_MS in cli.ts) so a slow but
|
|
180
180
|
// successful operation cannot be aborted by a tighter client cap.
|
|
@@ -106,7 +106,7 @@ function defaults(overrides) {
|
|
|
106
106
|
if (!child.kill('SIGKILL'))
|
|
107
107
|
throw new BridgeSupervisorError('shutdown_failed');
|
|
108
108
|
}),
|
|
109
|
-
startupTimeoutMs: overrides.startupTimeoutMs ??
|
|
109
|
+
startupTimeoutMs: overrides.startupTimeoutMs ?? 120_000,
|
|
110
110
|
healthRetryDelayMs: overrides.healthRetryDelayMs ?? 50,
|
|
111
111
|
shutdownGraceMs: overrides.shutdownGraceMs ?? 7_000,
|
|
112
112
|
};
|
package/dist/service.js
CHANGED
|
@@ -7,6 +7,7 @@ import { BindingService, } from './bindings/service.js';
|
|
|
7
7
|
import { RUNTIME_ID_PATTERN, StoredConfigSchema, TOKEN_REF_PATTERN, } from './config/schema.js';
|
|
8
8
|
import { localPaths } from './config/paths.js';
|
|
9
9
|
import { LocalStore, authorizeWorkdir, } from './config/store.js';
|
|
10
|
+
import { RecoveringBridgeTask } from './go/recovering-task.js';
|
|
10
11
|
import { BridgeHealthSchema, BridgeRuntimeListSchema, } from './go/types.js';
|
|
11
12
|
import { ActivityResponseSchema, BindingMutationResponseSchema, DiagnosticsResponseSchema, EnableResponseSchema, LocalRoutes, RuntimesResponseSchema, SettingsResponseSchema, ControlPairingResponseSchema, PairingResponseSchema, } from './http/routes.js';
|
|
12
13
|
import { BrowserSessionStore, deriveControlCredential } from './http/security.js';
|
|
@@ -26,8 +27,8 @@ import { MessageRouter, } from './router/message-router.js';
|
|
|
26
27
|
import { RouterStateStore } from './router/session-store.js';
|
|
27
28
|
const DEFAULT_SHUTDOWN_TIMEOUT_MS = 20_000;
|
|
28
29
|
const MAX_SHUTDOWN_TIMEOUT_MS = 20_000;
|
|
29
|
-
const DEFAULT_STARTUP_TIMEOUT_MS =
|
|
30
|
-
const MAX_STARTUP_TIMEOUT_MS =
|
|
30
|
+
const DEFAULT_STARTUP_TIMEOUT_MS = 120_000;
|
|
31
|
+
const MAX_STARTUP_TIMEOUT_MS = 180_000;
|
|
31
32
|
const HTTP_CLOSE_TIMEOUT_MS = 2_000;
|
|
32
33
|
const ROUTER_DISPOSE_TIMEOUT_MS = 5_000;
|
|
33
34
|
const LOGGER_CLOSE_TIMEOUT_MS = 2_000;
|
|
@@ -1651,8 +1652,20 @@ async function composeProductionServiceWithin(options, deadline) {
|
|
|
1651
1652
|
},
|
|
1652
1653
|
});
|
|
1653
1654
|
const control = createConservativeRouterControl({ runtimes: client, bindings, workers, mutationGate });
|
|
1655
|
+
let activeClient = client;
|
|
1656
|
+
const recoveringTask = new RecoveringBridgeTask({
|
|
1657
|
+
resolveTask: () => activeClient,
|
|
1658
|
+
ensureBridge: async () => {
|
|
1659
|
+
const running = await bridge.ensureStarted({});
|
|
1660
|
+
activeClient = running.client;
|
|
1661
|
+
},
|
|
1662
|
+
refreshRuntime: async (runtimeId) => {
|
|
1663
|
+
const runtimes = await activeClient.refreshRuntimes();
|
|
1664
|
+
return runtimes.find(candidate => candidate.id === runtimeId)?.status === 'ready';
|
|
1665
|
+
},
|
|
1666
|
+
});
|
|
1654
1667
|
router = factories.createRouter({
|
|
1655
|
-
task:
|
|
1668
|
+
task: recoveringTask,
|
|
1656
1669
|
interactiveAvailable: async (identity) => {
|
|
1657
1670
|
const runtime = parseCatalog(await client.runtimes()).find(item => item.id === identity.runtimeId);
|
|
1658
1671
|
return runtime !== undefined && nodeCapabilitiesForRuntime(runtime).includes('discussion_interactive_rounds');
|
package/package.json
CHANGED
|
@@ -1,11 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "quukk-clawmessenger",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
3
|
+
"version": "0.1.0-beta.23",
|
|
4
4
|
"description": "Connect local AI agents to ClawMessenger, built on Multica",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"engines": {
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
"engines": {
|
|
7
|
+
"node": ">=22.13.0"
|
|
8
|
+
},
|
|
9
|
+
"bin": {
|
|
10
|
+
"quukk-clawmessenger": "bin/quukk-clawmessenger.js"
|
|
11
|
+
},
|
|
12
|
+
"files": [
|
|
13
|
+
"bin",
|
|
14
|
+
"dist",
|
|
15
|
+
"scripts/audit-tarball.mjs",
|
|
16
|
+
"scripts/postinstall.mjs",
|
|
17
|
+
"LICENSE",
|
|
18
|
+
"NOTICE",
|
|
19
|
+
"MODIFICATIONS.md",
|
|
20
|
+
"THIRD_PARTY_NOTICES.md",
|
|
21
|
+
"README.md"
|
|
22
|
+
],
|
|
9
23
|
"scripts": {
|
|
10
24
|
"build": "tsc -p tsconfig.json",
|
|
11
25
|
"typecheck": "tsc --noEmit",
|
|
@@ -38,12 +52,12 @@
|
|
|
38
52
|
"zod": "4.3.6"
|
|
39
53
|
},
|
|
40
54
|
"optionalDependencies": {
|
|
41
|
-
"@quukk/clawmessenger-runtime-win32-x64": "0.1.0-beta.
|
|
42
|
-
"@quukk/clawmessenger-runtime-win32-arm64": "0.1.0-beta.
|
|
43
|
-
"@quukk/clawmessenger-runtime-darwin-x64": "0.1.0-beta.
|
|
44
|
-
"@quukk/clawmessenger-runtime-darwin-arm64": "0.1.0-beta.
|
|
45
|
-
"@quukk/clawmessenger-runtime-linux-x64": "0.1.0-beta.
|
|
46
|
-
"@quukk/clawmessenger-runtime-linux-arm64": "0.1.0-beta.
|
|
55
|
+
"@quukk/clawmessenger-runtime-win32-x64": "0.1.0-beta.9",
|
|
56
|
+
"@quukk/clawmessenger-runtime-win32-arm64": "0.1.0-beta.9",
|
|
57
|
+
"@quukk/clawmessenger-runtime-darwin-x64": "0.1.0-beta.9",
|
|
58
|
+
"@quukk/clawmessenger-runtime-darwin-arm64": "0.1.0-beta.9",
|
|
59
|
+
"@quukk/clawmessenger-runtime-linux-x64": "0.1.0-beta.9",
|
|
60
|
+
"@quukk/clawmessenger-runtime-linux-arm64": "0.1.0-beta.9"
|
|
47
61
|
},
|
|
48
62
|
"devDependencies": {
|
|
49
63
|
"@multica/tsconfig": "workspace:*",
|