@cloudagentfleet/worker 0.1.4 → 0.1.6
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/CHANGELOG.md +12 -0
- package/README.md +19 -19
- package/dist/cloudagentfleet-worker.mjs +7 -1
- package/dist/cloudagentfleet.mjs +7 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @cloudagentfleet/worker
|
|
2
2
|
|
|
3
|
+
## 0.1.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`92ee8b9`](https://github.com/hirenf14/cloudagentfleet/commit/92ee8b92b7a2d1c7934d887811eaebaad71b7735) Thanks [@hirenf14](https://github.com/hirenf14)! - Start the Worker when invoked as the cloudagentfleet-worker binary.
|
|
8
|
+
|
|
9
|
+
## 0.1.5
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`35f2a3d`](https://github.com/hirenf14/cloudagentfleet/commit/35f2a3dcb5cd656c76338454b022de3c34dedf6b) Thanks [@hirenf14](https://github.com/hirenf14)! - Fix Worker CLI exiting immediately when invoked as cloudagentfleet.mjs.
|
|
14
|
+
|
|
3
15
|
## 0.1.4
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -21,41 +21,41 @@ npx cloudagentfleet --help
|
|
|
21
21
|
|
|
22
22
|
## Quick start
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
**Same `HOSTED_AGENTS_AUTH_TOKEN` as the Hub** is required (Hub UI auth rejects
|
|
25
|
+
Worker enroll without it). Codeman should already be running (`codeman web`).
|
|
25
26
|
|
|
26
27
|
```bash
|
|
28
|
+
export HOSTED_AGENTS_AUTH_TOKEN="replace-with-a-long-shared-secret"
|
|
27
29
|
cloudagentfleet setup --run
|
|
28
30
|
```
|
|
29
31
|
|
|
30
|
-
|
|
32
|
+
Use the Hub’s reachable URL as Controller URL (not `127.0.0.1` if Hub is on
|
|
33
|
+
another machine). Note the Worker ID printed/chosen during setup.
|
|
31
34
|
|
|
32
|
-
|
|
33
|
-
cloudagentfleet setup
|
|
34
|
-
cloudagentfleet worker install
|
|
35
|
-
cloudagentfleet worker start
|
|
36
|
-
cloudagentfleet worker status
|
|
37
|
-
```
|
|
35
|
+
### Enroll so the Hub UI shows an instance
|
|
38
36
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
Connector mode (Worker-backed):
|
|
37
|
+
The dashboard lists **instances**, not raw Workers. After the Worker is online:
|
|
42
38
|
|
|
43
39
|
```bash
|
|
40
|
+
export HOSTED_AGENTS_AUTH_TOKEN="replace-with-a-long-shared-secret"
|
|
41
|
+
|
|
44
42
|
cloudagentfleet enroll connector \
|
|
45
|
-
--controller-url http
|
|
43
|
+
--controller-url http://<hub-host>:8787 \
|
|
46
44
|
--instance-id codeman-1 \
|
|
47
45
|
--name "My Codeman" \
|
|
48
|
-
--node-id worker-
|
|
46
|
+
--node-id <worker-id-from-setup> \
|
|
47
|
+
--workspace-mode folders \
|
|
48
|
+
--workspace-root "$HOME/workspaces"
|
|
49
49
|
```
|
|
50
50
|
|
|
51
|
-
|
|
51
|
+
Restart the Worker (`cloudagentfleet worker stop` / `start`, or re-run
|
|
52
|
+
`cloudagentfleet setup --run`) so it uses `CODEMAN_INSTANCE_ID=codeman-1`.
|
|
53
|
+
|
|
54
|
+
Check:
|
|
52
55
|
|
|
53
56
|
```bash
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
--instance-id codeman-1 \
|
|
57
|
-
--name "My Codeman" \
|
|
58
|
-
--url https://codeman.tailnet.ts.net
|
|
57
|
+
curl -H "Authorization: Bearer $HOSTED_AGENTS_AUTH_TOKEN" http://<hub-host>:8787/api/workers
|
|
58
|
+
curl -H "Authorization: Bearer $HOSTED_AGENTS_AUTH_TOKEN" http://<hub-host>:8787/api/instances
|
|
59
59
|
```
|
|
60
60
|
|
|
61
61
|
## Useful commands
|
|
@@ -947,7 +947,13 @@ async function runWorker() {
|
|
|
947
947
|
stopEventForwarding();
|
|
948
948
|
}
|
|
949
949
|
}
|
|
950
|
-
|
|
950
|
+
function isDirectWorkerEntrypoint() {
|
|
951
|
+
const entry = process.argv[1];
|
|
952
|
+
if (!entry) return false;
|
|
953
|
+
const normalized = entry.replaceAll("\\", "/");
|
|
954
|
+
return normalized.endsWith("/main.ts") || normalized.endsWith("/worker.mjs") || normalized.endsWith("/cloudagentfleet-worker.mjs");
|
|
955
|
+
}
|
|
956
|
+
if (isDirectWorkerEntrypoint()) {
|
|
951
957
|
runWorker().catch((error) => {
|
|
952
958
|
console.error(error instanceof Error ? error.message : error);
|
|
953
959
|
process.exitCode = 1;
|
package/dist/cloudagentfleet.mjs
CHANGED
|
@@ -903,7 +903,13 @@ function help() {
|
|
|
903
903
|
"The setup flow asks before installing Codeman and never performs provider login."
|
|
904
904
|
].join("\n"));
|
|
905
905
|
}
|
|
906
|
-
|
|
906
|
+
function isDirectCliEntrypoint() {
|
|
907
|
+
const entry = process.argv[1];
|
|
908
|
+
if (!entry) return false;
|
|
909
|
+
const normalized = entry.replaceAll("\\", "/");
|
|
910
|
+
return normalized.endsWith("/hosted-agents.mjs") || normalized.endsWith("/cloudagentfleet.mjs") || resolve(entry) === resolve(fileURLToPath(import.meta.url));
|
|
911
|
+
}
|
|
912
|
+
if (isDirectCliEntrypoint()) {
|
|
907
913
|
try {
|
|
908
914
|
const commandName = process.argv[2] ?? "help";
|
|
909
915
|
if (commandName === "setup") await setup();
|