multiclaw 0.3.2 → 0.5.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.
- package/README.md +192 -50
- package/dist/commands/doctor.d.ts +32 -0
- package/dist/commands/doctor.test.d.ts +1 -0
- package/dist/commands/init.d.ts +32 -0
- package/dist/commands/init.test.d.ts +1 -0
- package/dist/commands/resume.d.ts +32 -0
- package/dist/commands/resume.test.d.ts +1 -0
- package/dist/commands/run.d.ts +12 -0
- package/dist/commands/run.test.d.ts +1 -0
- package/dist/commands/tui.d.ts +4 -0
- package/dist/commands/upgrade.d.ts +1 -0
- package/dist/commands/upgrade.test.d.ts +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +775 -228
- package/dist/lib.d.ts +20 -1
- package/dist/lib.js +40 -2
- package/dist/lib.test.d.ts +1 -0
- package/dist/loader/loadConfig.d.ts +2 -0
- package/dist/loader/loadConfig.test.d.ts +1 -0
- package/dist/reporters/ConsoleReporter.d.ts +5 -0
- package/dist/reporters/ConsoleReporter.test.d.ts +1 -0
- package/dist/reporters/FileLogWriter.d.ts +29 -0
- package/dist/reporters/FileLogWriter.test.d.ts +1 -0
- package/package.json +15 -11
package/dist/lib.d.ts
CHANGED
|
@@ -1 +1,20 @@
|
|
|
1
|
-
|
|
1
|
+
import { detectProviders, type MultiClawConfig, presentProviders } from "@multiclawcli/core";
|
|
2
|
+
export type { AgentDefinition, MultiClawConfig } from "@multiclawcli/core";
|
|
3
|
+
export { agents, defineConfig } from "@multiclawcli/core";
|
|
4
|
+
/**
|
|
5
|
+
* Hard gate for `run`/`tui`: every runtime the config names must exist and
|
|
6
|
+
* report itself as installed, or the process exits before any work starts.
|
|
7
|
+
*
|
|
8
|
+
* Availability comes from `describe()` rather than an ad-hoc `execSync`, so
|
|
9
|
+
* "is this runtime installed?" has exactly one implementation. `describe()`
|
|
10
|
+
* receives the agent's configured command because an external-process runtime
|
|
11
|
+
* (e.g. ACP) is only as available as the binary it was told to launch.
|
|
12
|
+
*/
|
|
13
|
+
export declare function assertRuntimesAvailable(config: MultiClawConfig): Promise<void>;
|
|
14
|
+
/** Re-export for consumers that need full detection details. */
|
|
15
|
+
export { detectProviders, presentProviders };
|
|
16
|
+
/**
|
|
17
|
+
* Legacy alias: returns runtime names that have at least one provider present.
|
|
18
|
+
* Prefer `detectProviders()` for new code.
|
|
19
|
+
*/
|
|
20
|
+
export declare function availableRuntimes(): Promise<string[]>;
|
package/dist/lib.js
CHANGED
|
@@ -1,6 +1,44 @@
|
|
|
1
1
|
// src/lib.ts
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
detectProviders,
|
|
4
|
+
presentProviders,
|
|
5
|
+
resolveCommand,
|
|
6
|
+
runtimeRegistry
|
|
7
|
+
} from "@multiclawcli/core";
|
|
8
|
+
import { agents, defineConfig } from "@multiclawcli/core";
|
|
9
|
+
async function assertRuntimesAvailable(config) {
|
|
10
|
+
const checked = /* @__PURE__ */ new Set();
|
|
11
|
+
for (const agent of config.agents) {
|
|
12
|
+
const name = agent.runtime ?? "acp";
|
|
13
|
+
if (!runtimeRegistry.has(name)) {
|
|
14
|
+
const supported = runtimeRegistry.list().join(", ");
|
|
15
|
+
console.error(`\x1B[31mError: Unknown runtime "${name}". Supported: ${supported}\x1B[0m`);
|
|
16
|
+
process.exit(1);
|
|
17
|
+
}
|
|
18
|
+
const command = resolveCommand(agent, config);
|
|
19
|
+
const key = `${name}\0${command}`;
|
|
20
|
+
if (checked.has(key)) continue;
|
|
21
|
+
checked.add(key);
|
|
22
|
+
const info = await runtimeRegistry.get(name).describe({ command });
|
|
23
|
+
if (!info.available) {
|
|
24
|
+
const subject = `Command "${command}"`;
|
|
25
|
+
console.error(
|
|
26
|
+
`\x1B[31mError: ${subject} is not available. Make sure the CLI is installed.\x1B[0m`
|
|
27
|
+
);
|
|
28
|
+
process.exit(1);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
async function availableRuntimes() {
|
|
33
|
+
const detected = await detectProviders();
|
|
34
|
+
const present = presentProviders(detected);
|
|
35
|
+
return present.length > 0 ? ["acp"] : [];
|
|
36
|
+
}
|
|
3
37
|
export {
|
|
4
38
|
agents,
|
|
5
|
-
|
|
39
|
+
assertRuntimesAvailable,
|
|
40
|
+
availableRuntimes,
|
|
41
|
+
defineConfig,
|
|
42
|
+
detectProviders,
|
|
43
|
+
presentProviders
|
|
6
44
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { EventBus } from "@multiclawcli/core";
|
|
2
|
+
/**
|
|
3
|
+
* Streams each agent's output to its own log file, plus a `report.json` per turn.
|
|
4
|
+
*
|
|
5
|
+
* Logging is diagnostics, so nothing in here is allowed to take the run down: a
|
|
6
|
+
* failed log write is reported and then ignored.
|
|
7
|
+
*/
|
|
8
|
+
export declare class FileLogWriter {
|
|
9
|
+
private logDir;
|
|
10
|
+
private onError;
|
|
11
|
+
private streams;
|
|
12
|
+
/** Agent ids whose log could not be opened — never retried, so a broken
|
|
13
|
+
* directory does not produce one failing stream per output chunk. */
|
|
14
|
+
private failed;
|
|
15
|
+
private closing;
|
|
16
|
+
constructor(logDir: string, onError?: (message: string) => void);
|
|
17
|
+
attach(eventBus: EventBus): () => void;
|
|
18
|
+
/**
|
|
19
|
+
* Flush every open stream.
|
|
20
|
+
*
|
|
21
|
+
* `stream.end()` only *starts* the flush, so a caller that exits the moment
|
|
22
|
+
* `orchestration:complete` arrives can lose the tail of the last agent's log.
|
|
23
|
+
* Awaiting this is what makes that tail durable.
|
|
24
|
+
*/
|
|
25
|
+
drain(): Promise<void>;
|
|
26
|
+
private handle;
|
|
27
|
+
private getStream;
|
|
28
|
+
private flush;
|
|
29
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "multiclaw",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
6
|
"multiclaw": "dist/index.js"
|
|
@@ -27,21 +27,25 @@
|
|
|
27
27
|
"url": "https://github.com/shipengqi/multiclaw/issues"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
+
"@agentclientprotocol/claude-agent-acp": "^0.93.0",
|
|
31
|
+
"@agentclientprotocol/codex-acp": "^2.2.2",
|
|
30
32
|
"@inquirer/prompts": "^8.7.3",
|
|
31
|
-
"@multiclawcli/core": "0.
|
|
32
|
-
"@multiclawcli/dashboard": "0.
|
|
33
|
-
"commander": "^
|
|
34
|
-
"
|
|
35
|
-
"tsx": "^4.7.0",
|
|
36
|
-
"ws": "^8.16.0"
|
|
33
|
+
"@multiclawcli/core": "0.5.0",
|
|
34
|
+
"@multiclawcli/dashboard": "0.5.0",
|
|
35
|
+
"commander": "^15.0.0",
|
|
36
|
+
"jiti": "^2.7.0"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@types/node": "^
|
|
40
|
-
"
|
|
41
|
-
"typescript": "^
|
|
39
|
+
"@types/node": "^26.6.5",
|
|
40
|
+
"tsx": "^4.7.0",
|
|
41
|
+
"typescript": "^7.0.2",
|
|
42
|
+
"vitest": "^5.0.4"
|
|
42
43
|
},
|
|
43
44
|
"scripts": {
|
|
44
|
-
"build": "tsup",
|
|
45
|
+
"build": "tsup && tsc -p tsconfig.json --emitDeclarationOnly --outDir dist --composite false --incremental false",
|
|
46
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
47
|
+
"test": "vitest run",
|
|
48
|
+
"test:coverage": "vitest run --coverage",
|
|
45
49
|
"dev": "tsx src/index.ts"
|
|
46
50
|
}
|
|
47
51
|
}
|