@commonlyai/cli 0.1.380 → 0.1.381
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 +1 -1
- package/src/commands/agent.js +18 -8
package/package.json
CHANGED
package/src/commands/agent.js
CHANGED
|
@@ -295,6 +295,21 @@ export const deleteAgentToken = (name) => {
|
|
|
295
295
|
export const BOOTSTRAP_ADAPTER_DETECT_ORDER = ['claude', 'codex', 'pi'];
|
|
296
296
|
export const NO_AGENT_CLI_CODE = 'no_agent_cli';
|
|
297
297
|
|
|
298
|
+
/**
|
|
299
|
+
* What `agent run` says when no token is set. On Windows the page's lines are
|
|
300
|
+
* PowerShell: pasted into Command Prompt, the `$env:` lines set nothing and the
|
|
301
|
+
* run ends here before it reaches the server (F548), so name the shell and its
|
|
302
|
+
* form rather than `export`.
|
|
303
|
+
*/
|
|
304
|
+
export const noRunTokenMessage = ({ name, agentArg = name, platform = process.platform }) => {
|
|
305
|
+
const set = platform === 'win32'
|
|
306
|
+
? 'In PowerShell, not Command Prompt, run the $env:COMMONLY_API_URL="…" and $env:COMMONLY_AGENT_TOKEN="…" lines'
|
|
307
|
+
: 'Either export COMMONLY_API_URL + COMMONLY_AGENT_TOKEN';
|
|
308
|
+
return `No token for '${name}'. ${set}`
|
|
309
|
+
+ ` (shown on the Connect your own agent page) and re-run, or:`
|
|
310
|
+
+ ` ${CLI} agent attach <adapter> --pod <podId> --name ${agentArg}`;
|
|
311
|
+
};
|
|
312
|
+
|
|
298
313
|
/**
|
|
299
314
|
* A saved seat with no enforced sandbox: an adapter that takes one, no
|
|
300
315
|
* workspace, and an environment that is absent or enforces nothing (a record
|
|
@@ -5946,14 +5961,9 @@ Docs:
|
|
|
5946
5961
|
process.exit(1);
|
|
5947
5962
|
}
|
|
5948
5963
|
if (!record) {
|
|
5949
|
-
//
|
|
5950
|
-
//
|
|
5951
|
-
console.error(
|
|
5952
|
-
? `No token for '${name}'. Run all the lines from the Connect your own agent page together, `
|
|
5953
|
-
+ 'in PowerShell (not Command Prompt): the $env: lines set the token for this window.'
|
|
5954
|
-
: `No token for '${name}'. Either export COMMONLY_API_URL + COMMONLY_AGENT_TOKEN`
|
|
5955
|
-
+ ` (shown on the Connect your own agent page) and re-run, or:`
|
|
5956
|
-
+ ` ${CLI} agent attach <adapter> --pod <podId> --name ${agentArg}`);
|
|
5964
|
+
// On Windows the page's lines are PowerShell's ($env:…), and in Command
|
|
5965
|
+
// Prompt they set nothing, so this is where that run lands.
|
|
5966
|
+
console.error(noRunTokenMessage({ name, agentArg }));
|
|
5957
5967
|
process.exit(1);
|
|
5958
5968
|
}
|
|
5959
5969
|
const instanceRefusal = named ? runInstanceRefusal({ record, instanceId }) : null;
|