@cloudagentfleet/worker 0.1.6 → 0.1.8

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 CHANGED
@@ -1,5 +1,19 @@
1
1
  # @cloudagentfleet/worker
2
2
 
3
+ ## 0.1.8
4
+
5
+ ### Patch Changes
6
+
7
+ - [`895eaa1`](https://github.com/hirenf14/cloudagentfleet/commit/895eaa1cb81a75bc617020cc984c3b4f10ed66bb) Thanks [@hirenf14](https://github.com/hirenf14)! - Republish packages after ui@0.1.7 registry tarball was missing.
8
+
9
+ ## 0.1.7
10
+
11
+ ### Patch Changes
12
+
13
+ - [`e8300b3`](https://github.com/hirenf14/cloudagentfleet/commit/e8300b3321289b1544c1cd8026c01fb363ab666e) Thanks [@hirenf14](https://github.com/hirenf14)! - Keep Shell (raw CLI) in the agent list and clarify provider CLI labels in Start session.
14
+
15
+ - [`e8300b3`](https://github.com/hirenf14/cloudagentfleet/commit/e8300b3321289b1544c1cd8026c01fb363ab666e) Thanks [@hirenf14](https://github.com/hirenf14)! - Use cloudagentfleet consistently in CLI help and Hub branding (hosted-agents remains a compatibility alias).
16
+
3
17
  ## 0.1.6
4
18
 
5
19
  ### Patch Changes
@@ -272,24 +272,11 @@ var CodemanWorkerRuntime = class {
272
272
  return this.client.status();
273
273
  case "capabilities": {
274
274
  const status = await this.client.status();
275
- const codemanAgents = [
276
- {
277
- id: this.mode,
278
- name: this.mode === "claude" ? "Claude Code" : this.mode,
279
- mode: this.mode,
280
- ready: true
281
- },
282
- ...status.agents ?? [],
283
- ...status.capabilities ?? []
284
- ];
285
- return [
286
- ...codemanAgents,
287
- ...this.agentProfiles.filter(
288
- (agent) => !codemanAgents.some(
289
- (candidate) => (typeof candidate === "string" ? candidate : candidate.id) === agent.id
290
- )
291
- )
292
- ];
275
+ return mergeLaunchAgents({
276
+ mode: this.mode,
277
+ statusAgents: [...status.agents ?? [], ...status.capabilities ?? []],
278
+ localProfiles: this.agentProfiles
279
+ });
293
280
  }
294
281
  case "workspaces":
295
282
  return this.workspaces;
@@ -532,6 +519,86 @@ function isAgentProfile(value) {
532
519
  ];
533
520
  return typeof value.name === "string" && modes.includes(value.mode);
534
521
  }
522
+ function mergeLaunchAgents(input) {
523
+ const ordered = [
524
+ {
525
+ id: "shell",
526
+ name: "Shell (raw CLI)",
527
+ mode: "shell",
528
+ ready: true
529
+ }
530
+ ];
531
+ if (input.mode !== "shell") {
532
+ ordered.push({
533
+ id: input.mode,
534
+ name: agentDisplayName(input.mode, input.mode),
535
+ mode: input.mode,
536
+ ready: true
537
+ });
538
+ }
539
+ for (const raw of input.statusAgents ?? []) {
540
+ const agent = normalizeStatusAgent(raw);
541
+ if (agent) ordered.push(agent);
542
+ }
543
+ for (const profile of input.localProfiles ?? []) {
544
+ ordered.push(profile);
545
+ }
546
+ return dedupeAgentsById(ordered);
547
+ }
548
+ function agentDisplayName(id, mode2) {
549
+ if (id === "shell" || mode2 === "shell" && id === "shell") return "Shell (raw CLI)";
550
+ if (id === "claude" && mode2 === "claude") return "Claude Code";
551
+ if (id === "claude-code") return "Claude Code CLI";
552
+ if (id === "cursor-agent") return "Cursor Agent CLI";
553
+ if (id === mode2) {
554
+ return mode2 === "claude" ? "Claude Code" : mode2;
555
+ }
556
+ return id;
557
+ }
558
+ function normalizeStatusAgent(raw) {
559
+ const modes = [
560
+ "claude",
561
+ "shell",
562
+ "opencode",
563
+ "codex",
564
+ "gemini",
565
+ "antigravity",
566
+ "pi",
567
+ "grok",
568
+ "deepseek"
569
+ ];
570
+ if (typeof raw === "string") {
571
+ if (!modes.includes(raw)) return void 0;
572
+ const mode3 = raw;
573
+ return {
574
+ id: mode3,
575
+ name: agentDisplayName(mode3, mode3),
576
+ mode: mode3,
577
+ ready: true
578
+ };
579
+ }
580
+ if (!isRecord(raw)) return void 0;
581
+ const modeRaw = String(raw.mode ?? raw.id ?? "shell");
582
+ const mode2 = modes.includes(modeRaw) ? modeRaw : "shell";
583
+ const id = String(raw.id ?? mode2);
584
+ if (mode2 === "shell" && id !== "shell" && !String(raw.name ?? "").trim()) return void 0;
585
+ return {
586
+ id,
587
+ name: String(raw.name ?? agentDisplayName(id, mode2)),
588
+ mode: mode2,
589
+ ready: raw.ready !== false && raw.available !== false
590
+ };
591
+ }
592
+ function dedupeAgentsById(agents) {
593
+ const seen = /* @__PURE__ */ new Set();
594
+ const result = [];
595
+ for (const agent of agents) {
596
+ if (seen.has(agent.id)) continue;
597
+ seen.add(agent.id);
598
+ result.push(agent);
599
+ }
600
+ return result;
601
+ }
535
602
  function isAllowedPath(path, policy) {
536
603
  if (policy.mode === "system") return true;
537
604
  const normalizedPath = normalizePath(path);
@@ -856,13 +923,13 @@ function detectAgentProfiles(providers) {
856
923
  return [
857
924
  ...providers.cursor ? [{
858
925
  id: "cursor-agent",
859
- name: "Cursor Agent",
926
+ name: "Cursor Agent CLI",
860
927
  mode: "shell",
861
928
  ready: providers.cursor.ready
862
929
  }] : [],
863
930
  ...providers.claude ? [{
864
931
  id: "claude-code",
865
- name: "Claude Code",
932
+ name: "Claude Code CLI",
866
933
  mode: "shell",
867
934
  ready: providers.claude.ready
868
935
  }] : []
@@ -130,7 +130,7 @@ async function serveHub(args = [], dependencies = {}) {
130
130
  await checkLocalHub(config.port, env.HOSTED_AGENTS_AUTH_TOKEN, dependencies.fetchImpl ?? fetch);
131
131
  const target = `http://127.0.0.1:${config.port}`;
132
132
  runTailscale(["serve", "--bg", target], runner);
133
- console.log(`Serving the single Hosted Agents Hub privately at ${target} through Tailscale.`);
133
+ console.log(`Serving the single Cloud Agent Fleet Hub privately at ${target} through Tailscale.`);
134
134
  console.log("Codeman instances remain private; no per-instance public domains were created.");
135
135
  return config;
136
136
  }
@@ -151,7 +151,7 @@ function stopHub(args = [], dependencies = {}) {
151
151
  const runner = dependencies.runner ?? command;
152
152
  runTailscale(["version"], runner);
153
153
  runTailscale(["serve", "reset"], runner);
154
- console.log("Tailscale Serve routes reset; the Hosted Agents Hub is no longer served.");
154
+ console.log("Tailscale Serve routes reset; the Cloud Agent Fleet Hub is no longer served.");
155
155
  return config;
156
156
  }
157
157
  function wslCanRun(args = ["-e", "true"]) {
@@ -344,7 +344,7 @@ function runWorker(config) {
344
344
  }
345
345
  async function setup() {
346
346
  const environment = detectEnvironment();
347
- console.log("Hosted Agents setup\n===================\n");
347
+ console.log("Cloud Agent Fleet setup\n=======================\n");
348
348
  printEnvironment(environment);
349
349
  if (!environment.node || !environment.git) throw new Error("Node.js and Git are required");
350
350
  if (!environment.codeman) {
@@ -394,7 +394,7 @@ Saved Worker configuration: ${configPath}`);
394
394
  if (!environment.codeman) throw new Error("Cannot run Worker without Codeman");
395
395
  runWorker(config);
396
396
  } else {
397
- console.log("Run `hosted-agents run` to start the real Worker.");
397
+ console.log("Run `cloudagentfleet run` to start the Worker.");
398
398
  }
399
399
  }
400
400
  function writeSafeJson(path, value) {
@@ -691,7 +691,7 @@ function printEnrollmentHelp() {
691
691
  "Register a Codeman instance with the Controller.",
692
692
  "",
693
693
  "Usage:",
694
- " hosted-agents enroll [connector|tailscale-url] [options]",
694
+ " cloudagentfleet enroll [connector|tailscale-url] [options]",
695
695
  "",
696
696
  "Options:",
697
697
  " --mode <connector|tailscale-url>",
@@ -711,12 +711,12 @@ function printEnrollmentHelp() {
711
711
  }
712
712
  function printHubHelp() {
713
713
  console.log([
714
- "Serve the single Hosted Agents Hub privately through Tailscale Serve.",
714
+ "Serve the single Cloud Agent Fleet Hub privately through Tailscale Serve.",
715
715
  "",
716
716
  "Usage:",
717
- " hosted-agents hub serve [--port <1-65535>]",
718
- " hosted-agents hub status [--port <1-65535>]",
719
- " hosted-agents hub stop [--port <1-65535>]",
717
+ " cloudagentfleet hub serve [--port <1-65535>]",
718
+ " cloudagentfleet hub status [--port <1-65535>]",
719
+ " cloudagentfleet hub stop [--port <1-65535>]",
720
720
  "",
721
721
  "The Controller must already be running on 127.0.0.1 (default port 8787).",
722
722
  "Serve uses one tailnet origin for the Hub and never publishes Codeman instances."
@@ -761,7 +761,7 @@ function workerServicePaths() {
761
761
  name: "com.hosted-agents.worker"
762
762
  };
763
763
  }
764
- return { kind: "schtasks", path: null, name: "Hosted Agents Worker" };
764
+ return { kind: "schtasks", path: null, name: "Cloud Agent Fleet Worker" };
765
765
  }
766
766
  function workerServiceCommand() {
767
767
  return [process.execPath, fileURLToPath(import.meta.url), "run"];
@@ -774,7 +774,7 @@ function installWorkerService() {
774
774
  mkdirSync(dirname(service.path), { recursive: true });
775
775
  writeFileSync(service.path, [
776
776
  "[Unit]",
777
- "Description=Hosted Agents Worker",
777
+ "Description=Cloud Agent Fleet Worker",
778
778
  "After=network-online.target",
779
779
  "",
780
780
  "[Service]",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudagentfleet/worker",
3
- "version": "0.1.6",
3
+ "version": "0.1.8",
4
4
  "private": false,
5
5
  "description": "Cloud Agent Fleet Worker — machine companion and operator CLI.",
6
6
  "type": "module",