@adamancyzhang/claude-orchestrator 0.1.0 → 0.2.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 +401 -0
- package/bin/claude-orchestrator +2 -17
- package/dist/cli/commands.d.ts +20 -0
- package/dist/cli/commands.js +192 -0
- package/dist/cli/commands.js.map +1 -0
- package/dist/config.d.ts +17 -0
- package/dist/config.js +45 -0
- package/dist/config.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +344 -0
- package/dist/index.js.map +1 -0
- package/dist/models/schemas.d.ts +308 -0
- package/dist/models/schemas.js +167 -0
- package/dist/models/schemas.js.map +1 -0
- package/dist/modules/context-store.d.ts +10 -0
- package/dist/modules/context-store.js +25 -0
- package/dist/modules/context-store.js.map +1 -0
- package/dist/modules/message-router.d.ts +12 -0
- package/dist/modules/message-router.js +94 -0
- package/dist/modules/message-router.js.map +1 -0
- package/dist/modules/registry.d.ts +11 -0
- package/dist/modules/registry.js +53 -0
- package/dist/modules/registry.js.map +1 -0
- package/dist/modules/task-queue.d.ts +10 -0
- package/dist/modules/task-queue.js +103 -0
- package/dist/modules/task-queue.js.map +1 -0
- package/dist/server.d.ts +2 -0
- package/dist/server.js +425 -0
- package/dist/server.js.map +1 -0
- package/dist/utils/output.d.ts +1 -0
- package/dist/utils/output.js +10 -0
- package/dist/utils/output.js.map +1 -0
- package/dist/zk/client.d.ts +54 -0
- package/dist/zk/client.js +417 -0
- package/dist/zk/client.js.map +1 -0
- package/dist/zk/paths.d.ts +16 -0
- package/dist/zk/paths.js +40 -0
- package/dist/zk/paths.js.map +1 -0
- package/dist/zk/watcher.d.ts +11 -0
- package/dist/zk/watcher.js +16 -0
- package/dist/zk/watcher.js.map +1 -0
- package/package.json +23 -6
- package/scripts/install.js +0 -123
package/scripts/install.js
DELETED
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
const https = require("https");
|
|
4
|
-
const fs = require("fs");
|
|
5
|
-
const path = require("path");
|
|
6
|
-
|
|
7
|
-
const BIN_DIR = path.resolve(__dirname, "..", "bin");
|
|
8
|
-
const BINARY_PATH = path.join(BIN_DIR, "orchestrator-binary");
|
|
9
|
-
|
|
10
|
-
if (fs.existsSync(BINARY_PATH)) {
|
|
11
|
-
console.log("Binary already installed at", BINARY_PATH);
|
|
12
|
-
process.exit(0);
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
const platform = process.platform; // "darwin", "linux"
|
|
16
|
-
const arch = process.arch === "arm64" ? "arm64" : "x64";
|
|
17
|
-
const binaryName = `claude-orchestrator-${platform}-${arch}`;
|
|
18
|
-
|
|
19
|
-
const repo =
|
|
20
|
-
process.env.ORCHESTRATOR_REPO || "adamancyzhang/claude-orchestrator-server";
|
|
21
|
-
const version =
|
|
22
|
-
process.env.ORCHESTRATOR_VERSION || "v0.1.0";
|
|
23
|
-
|
|
24
|
-
// ── Helpers ──
|
|
25
|
-
|
|
26
|
-
function httpGetJSON(url) {
|
|
27
|
-
return new Promise((resolve, reject) => {
|
|
28
|
-
https
|
|
29
|
-
.get(url, { headers: { "User-Agent": "claude-orchestrator-installer" } }, (res) => {
|
|
30
|
-
if (res.statusCode !== 200) {
|
|
31
|
-
reject(new Error(`HTTP ${res.statusCode}`));
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
|
-
let body = "";
|
|
35
|
-
res.on("data", (chunk) => (body += chunk));
|
|
36
|
-
res.on("end", () => {
|
|
37
|
-
try {
|
|
38
|
-
resolve(JSON.parse(body));
|
|
39
|
-
} catch (e) {
|
|
40
|
-
reject(e);
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
})
|
|
44
|
-
.on("error", reject);
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
function download(url, dest) {
|
|
49
|
-
return new Promise((resolve, reject) => {
|
|
50
|
-
const file = fs.createWriteStream(dest, { mode: 0o755 });
|
|
51
|
-
https
|
|
52
|
-
.get(
|
|
53
|
-
url,
|
|
54
|
-
{ headers: { Accept: "application/octet-stream", "User-Agent": "claude-orchestrator-installer" } },
|
|
55
|
-
(response) => {
|
|
56
|
-
if (response.statusCode === 302 || response.statusCode === 301) {
|
|
57
|
-
file.close();
|
|
58
|
-
fs.unlinkSync(dest);
|
|
59
|
-
return download(response.headers.location, dest).then(resolve).catch(reject);
|
|
60
|
-
}
|
|
61
|
-
if (response.statusCode !== 200) {
|
|
62
|
-
file.close();
|
|
63
|
-
fs.unlinkSync(dest);
|
|
64
|
-
reject(new Error(`Download failed: HTTP ${response.statusCode}`));
|
|
65
|
-
return;
|
|
66
|
-
}
|
|
67
|
-
response.pipe(file);
|
|
68
|
-
file.on("finish", () => {
|
|
69
|
-
file.close();
|
|
70
|
-
resolve();
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
)
|
|
74
|
-
.on("error", (err) => {
|
|
75
|
-
file.close();
|
|
76
|
-
try { fs.unlinkSync(dest); } catch (_) {}
|
|
77
|
-
reject(err);
|
|
78
|
-
});
|
|
79
|
-
});
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
// ── Main ──
|
|
83
|
-
|
|
84
|
-
async function install() {
|
|
85
|
-
// Step 1: Get asset download URL from GitHub Releases API
|
|
86
|
-
const apiUrl = `https://api.github.com/repos/${repo}/releases/tags/${version}`;
|
|
87
|
-
console.log(`Resolving ${binaryName} via ${apiUrl}...`);
|
|
88
|
-
|
|
89
|
-
let release;
|
|
90
|
-
try {
|
|
91
|
-
release = await httpGetJSON(apiUrl);
|
|
92
|
-
} catch (e) {
|
|
93
|
-
console.error(`Failed to fetch release info: ${e.message}`);
|
|
94
|
-
console.error(`Build it locally: bash scripts/build-binary.sh`);
|
|
95
|
-
process.exit(1);
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
const asset = (release.assets || []).find((a) => a.name === binaryName);
|
|
99
|
-
if (!asset) {
|
|
100
|
-
console.error(
|
|
101
|
-
`No prebuilt binary for ${platform}-${arch}. ` +
|
|
102
|
-
`Available assets: ${(release.assets || []).map((a) => a.name).join(", ") || "none"}. ` +
|
|
103
|
-
`Build it locally: bash scripts/build-binary.sh`
|
|
104
|
-
);
|
|
105
|
-
process.exit(1);
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
console.log(`Found ${binaryName} (${(asset.size / 1024 / 1024).toFixed(1)} MB), downloading...`);
|
|
109
|
-
|
|
110
|
-
// Step 2: Download via asset API URL (requires Accept header)
|
|
111
|
-
try {
|
|
112
|
-
await download(asset.url, BINARY_PATH);
|
|
113
|
-
} catch (e) {
|
|
114
|
-
console.error(`Download failed: ${e.message}`);
|
|
115
|
-
console.error(`Build it locally: bash scripts/build-binary.sh`);
|
|
116
|
-
process.exit(1);
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
fs.chmodSync(BINARY_PATH, 0o755);
|
|
120
|
-
console.log(`Installed ${binaryName} to ${BINARY_PATH}`);
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
install();
|