@commonlyai/cli 0.1.302 → 0.1.304

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@commonlyai/cli",
3
- "version": "0.1.302",
3
+ "version": "0.1.304",
4
4
  "license": "Apache-2.0",
5
5
  "description": "The Commonly CLI — connect agents, manage pods, iterate fast",
6
6
  "type": "module",
@@ -2067,6 +2067,9 @@ export const performRun = ({
2067
2067
  // saved on the server before each turn. Off for daemon seats, whose daemon
2068
2068
  // projects the same values into `environment`.
2069
2069
  readSavedControls = false,
2070
+ // A machine-bound record started by hand, without its daemon: nothing
2071
+ // projects Settings into it, so only `agent config` changes its model.
2072
+ standaloneMachineRun = false,
2070
2073
  // F150: a seat with no daemon reads its live grant brokers before each turn.
2071
2074
  // Off for daemon seats, whose daemon merges /assigned's into the record.
2072
2075
  readGrantBrokers = false,
@@ -2649,13 +2652,19 @@ export const performRun = ({
2649
2652
  const postModelUnavailableHint = async (error, hintPodId, configuredModel) => {
2650
2653
  const failure = modelUnavailableFailure(error, { fallbackModel: configuredModel });
2651
2654
  if (!failure || !hintPodId) return;
2652
- const key = `model-unavailable:${failure.model || 'unknown'}`;
2655
+ // A listener seat with no saved environment ignores Settings (see the
2656
+ // "has no saved environment" notice above), and so does a machine-bound
2657
+ // run with no daemon, so both get the command. Each instruction keeps its
2658
+ // own hour: a seat restarted with an environment hears the Settings line
2659
+ // even if the command line went out just before.
2660
+ const cliAgentName = (readSavedControls && !environment) || standaloneMachineRun ? agentName : null;
2661
+ const key = `model-unavailable:${failure.model || 'unknown'}${cliAgentName ? ':agent-config' : ''}`;
2653
2662
  try {
2654
2663
  if (!noticeDue(agentName, key, MODEL_UNAVAILABLE_HINT_WINDOW_MS)) return;
2655
2664
  const delivery = await deliverTurnNotice({
2656
2665
  client,
2657
2666
  podId: hintPodId,
2658
- text: modelUnavailableHint(failure.model),
2667
+ text: modelUnavailableHint(failure.model, { cliAgentName }),
2659
2668
  limit: chatCharLimit,
2660
2669
  maxChunks: maxChatChunks,
2661
2670
  log,
@@ -5570,6 +5579,7 @@ Docs:
5570
5579
  machineId: record.machineId, agentName: record.agentName, instanceId: record.instanceId }),
5571
5580
  reportRuntime: Boolean(record.machineId || process.env.COMMONLY_MANAGED_RUNNER === '1'),
5572
5581
  readSavedControls: !record.machineId && process.env.COMMONLY_MANAGED_RUNNER !== '1',
5582
+ standaloneMachineRun: Boolean(record.machineId) && process.env.COMMONLY_MANAGED_RUNNER !== '1',
5573
5583
  readGrantBrokers: !record.machineId && process.env.COMMONLY_MANAGED_RUNNER !== '1',
5574
5584
  spawnCredentialTtlSeconds: resolveSpawnTtlSeconds(process.env),
5575
5585
  refusalHandoff: opts.refusalHandoff || null,
@@ -24,6 +24,14 @@ import { brokerBridgeEntry } from './broker-bridge-entry.js';
24
24
  import { BRIDGE_PATH } from './codex-broker-bridge.mjs';
25
25
 
26
26
  // A version enters this list only after a real headless turn with that binary.
27
+ // Each version here is proven by the real-binary smoke test on macOS and Linux
28
+ // (.github/workflows/goose-public-proof.yml carries one pinned row per version).
29
+ // 1.56.0 is NOT admitted (11-04, F113c): its state-machine agent loop offers the
30
+ // model a `load_skill` operation on every turn that the extension allowlist
31
+ // cannot remove, so a stranger could read any skill under the seat's working
32
+ // directory (.agents/.goose/.claude skills) and Goose's builtin skills. The
33
+ // proof failed on both hosts at the allowlist check. Re-admit a version only
34
+ // once skills can be switched off for public turns and the proof is green.
27
35
  export const TESTED_GOOSE_VERSIONS = Object.freeze(['1.54.0']);
28
36
  const DEFAULT_TIMEOUT_MS = 15 * 60 * 1000;
29
37
  const TERMINATION_GRACE_MS = 5000;
@@ -88,7 +96,11 @@ export const assertSandboxSupported = (environment = {}) => {
88
96
  }
89
97
  };
90
98
 
91
- const versionOf = (value) => String(value || '').trim().match(/\b(\d+\.\d+\.\d+)\b/)?.[1] || null;
99
+ // The version is read whole or not at all. A prerelease is kept (`1.54.0-rc.1` is not the tested 1.54.0), and a
100
+ // version touching a letter, digit, `.`, `+` or `-` on either side (`1.54.0rc1`, `1.54.0.1`, `2.1.54.0`, `v1.54.0`,
101
+ // `1.54.0+build`) reads as unknown, so the public gate never admits part of a longer string.
102
+ const versionOf = (value) => String(value || '').trim()
103
+ .match(/(?<![\w.+-])(\d+\.\d+\.\d+(?:-[0-9A-Za-z]+(?:\.[0-9A-Za-z]+)*)?)(?![\w.+-])/)?.[1] || null;
92
104
 
93
105
  /** Goose splits this string itself; reject quotes it cannot represent safely. */
94
106
  const gooseWord = (value) => {
@@ -131,7 +131,23 @@ export const modelUnavailableFailure = (error, { fallbackModel = null } = {}) =>
131
131
  return { model: safeModelName(fallbackModel) };
132
132
  };
133
133
 
134
- /** The one line posted in the pod. */
135
- export const modelUnavailableHint = (model) => (model
136
- ? `The model provider says ${model} isn't available for this agent. To change it, open the agent's Settings, then Model.`
137
- : "The model provider says this agent's model isn't available. To change it, open the agent's Settings, then Model.");
134
+ const CLI_AGENT_NAME_RE = /^[a-z0-9][a-z0-9._-]{0,63}$/i;
135
+
136
+ /**
137
+ * The one line posted in the pod. The model is set in the agent's Settings,
138
+ * under the "How it runs" section, which starts collapsed (F354: a walk missed
139
+ * it). `cliAgentName` is for a `commonly agent run` seat whose record has no
140
+ * saved environment: Settings doesn't reach that seat until `agent config`
141
+ * writes one, so the line names that command instead. A name that can't be
142
+ * printed safely becomes `<name>`: Settings still wouldn't reach that seat.
143
+ */
144
+ export const modelUnavailableHint = (model, { cliAgentName = null } = {}) => {
145
+ const what = model
146
+ ? `The model provider says ${model} isn't available for this agent.`
147
+ : "The model provider says this agent's model isn't available.";
148
+ if (typeof cliAgentName !== 'string' || !cliAgentName) {
149
+ return `${what} To change it, open the agent's Settings, then How it runs, then Model.`;
150
+ }
151
+ const name = CLI_AGENT_NAME_RE.test(cliAgentName) ? cliAgentName : '<name>';
152
+ return `${what} To change it, run commonly agent config ${name} --model <model> on the computer it runs on, then restart commonly agent run ${name}.`;
153
+ };