quukk-clawmessenger 0.1.0-beta.21 → 0.1.0-beta.22
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/recovering-task.d.ts +24 -0
- package/dist/go/recovering-task.js +45 -0
- package/dist/service.js +14 -1
- package/package.json +18 -4
- 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) {
|
|
@@ -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/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';
|
|
@@ -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.22",
|
|
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",
|