@cabane/cli 0.1.6 → 0.1.7

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.
Files changed (2) hide show
  1. package/dist/cli.js +5 -1
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -1063,6 +1063,10 @@ async function resolvePat(opts, base) {
1063
1063
  }
1064
1064
  throw new Error("no access token. Pass --token <cab_\u2026> (mint it in Settings \u2192 Developer).");
1065
1065
  }
1066
+ var BUILTIN_AGENT_USERNAME = "woody";
1067
+ function selectSetupAgent(workspace, agents) {
1068
+ return workspace.defaultAgentId && agents.find((a) => a.id === workspace.defaultAgentId) || agents.find((a) => a.username === BUILTIN_AGENT_USERNAME) || agents[0];
1069
+ }
1066
1070
  async function defaultAgentAssignment(client) {
1067
1071
  try {
1068
1072
  const { workspaces } = await client.get("/api/workspaces");
@@ -1071,7 +1075,7 @@ async function defaultAgentAssignment(client) {
1071
1075
  const { agents } = await client.get(
1072
1076
  `/api/workspaces/${workspace.id}/agents`
1073
1077
  );
1074
- const agent = workspace.defaultAgentId && agents.find((a) => a.id === workspace.defaultAgentId) || agents.find((a) => a.username === "cabane") || agents[0];
1078
+ const agent = selectSetupAgent(workspace, agents);
1075
1079
  if (!agent?.username || !agent.executor) return { kind: "unavailable" };
1076
1080
  if (agent.executor.deviceId && !agent.executor.deviceLabel) return { kind: "unavailable" };
1077
1081
  return { kind: "resolved", agent };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cabane/cli",
3
- "version": "0.1.6",
3
+ "version": "0.1.7",
4
4
  "type": "module",
5
5
  "description": "The cabane CLI — install, run, and update a self-hosted Cabane on your own machine (server + embedded Postgres; agents run on a companion you pair).",
6
6
  "license": "UNLICENSED",