eversince 0.2.5 → 0.2.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/dist/bridge.js +4 -2
- package/dist/commands/auth.js +16 -1
- package/dist/commands/init.js +17 -15
- package/dist/index.js +5 -1
- package/package.json +1 -1
package/dist/bridge.js
CHANGED
|
@@ -115,8 +115,10 @@ export function runBridge(options) {
|
|
|
115
115
|
}
|
|
116
116
|
const envelope = body;
|
|
117
117
|
const said = typeof envelope?.error?.message === 'string' ? envelope.error.message : null;
|
|
118
|
-
if (res.status === 503 || res.status === 504)
|
|
119
|
-
|
|
118
|
+
if (res.status === 503 || res.status === 504) {
|
|
119
|
+
const wait = Number(res.headers.get('retry-after'));
|
|
120
|
+
return rpcError(id, said ?? `Eversince is busy right now. Retry the call in ${Number.isFinite(wait) && wait > 0 ? `${wait} seconds` : 'a few seconds'}.`);
|
|
121
|
+
}
|
|
120
122
|
return rpcError(id, said ?? `Eversince could not answer (status ${res.status}). Retry the call.`);
|
|
121
123
|
}
|
|
122
124
|
async function relay(line) {
|
package/dist/commands/auth.js
CHANGED
|
@@ -81,12 +81,27 @@ export async function login(argv, connection, mode) {
|
|
|
81
81
|
const where = await withRenewalLock(host, () => writeCredentials(stored));
|
|
82
82
|
if (connection.baseUrl)
|
|
83
83
|
await writeSettings({ baseUrl });
|
|
84
|
-
|
|
84
|
+
const name = argv.name?.trim();
|
|
85
|
+
let unnamed = false;
|
|
86
|
+
let badName = false;
|
|
87
|
+
if (name && stored.kind === 'oauth') {
|
|
88
|
+
try {
|
|
89
|
+
const client = await Client.create({ baseUrl, credentials: stored });
|
|
90
|
+
await client.post('/api/v1/connections/agent', { name });
|
|
91
|
+
}
|
|
92
|
+
catch (error) {
|
|
93
|
+
unnamed = true;
|
|
94
|
+
badName = error instanceof ApiError && error.status === 400;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
printResult(mode, { host, kind: stored.kind, storage: where, ...(unnamed ? { named: false } : {}) }, () => {
|
|
85
98
|
line(`Signed in to ${host}${stored.kind === 'api_key' ? ' with an API key' : ''}.`);
|
|
86
99
|
line(`Credential stored in the ${where === 'keychain' ? 'system keychain' : 'config file'}.`);
|
|
87
100
|
if (process.env.ES_API_KEY) {
|
|
88
101
|
note('ES_API_KEY is set in this shell and takes precedence over what was just stored.');
|
|
89
102
|
}
|
|
103
|
+
if (unnamed)
|
|
104
|
+
note(badName ? 'The name was not saved. Use letters, digits, spaces, dots and dashes.' : 'The name was not saved.');
|
|
90
105
|
});
|
|
91
106
|
}
|
|
92
107
|
export async function logout(connection, mode) {
|
package/dist/commands/init.js
CHANGED
|
@@ -308,21 +308,23 @@ export async function init(argv, connection, mode) {
|
|
|
308
308
|
const connected = !(entries.length > 0 && entries.every((entry) => entry.points_to));
|
|
309
309
|
if (!dryRun && connected) {
|
|
310
310
|
const wrote = changes.filter((c) => c.action !== 'unchanged').map((c) => c.agent);
|
|
311
|
-
const named =
|
|
312
|
-
?
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
? {
|
|
316
|
-
: agent === '
|
|
317
|
-
? { name: '
|
|
318
|
-
:
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
: wrote.includes('
|
|
322
|
-
? { agent: '
|
|
323
|
-
:
|
|
324
|
-
? { agent: '
|
|
325
|
-
:
|
|
311
|
+
const named = argv.name?.trim()
|
|
312
|
+
? { name: argv.name.trim() }
|
|
313
|
+
: agent
|
|
314
|
+
? agent === 'claude-code' || agent === 'cursor' || agent === 'codex'
|
|
315
|
+
? { agent }
|
|
316
|
+
: agent === 'vscode'
|
|
317
|
+
? { name: 'VS Code' }
|
|
318
|
+
: agent === 'claude-desktop'
|
|
319
|
+
? { name: 'Claude Desktop' }
|
|
320
|
+
: null
|
|
321
|
+
: wrote.includes('Claude Code')
|
|
322
|
+
? { agent: 'claude-code' }
|
|
323
|
+
: wrote.includes('Cursor')
|
|
324
|
+
? { agent: 'cursor' }
|
|
325
|
+
: skipped.some((item) => item.agent === 'Codex')
|
|
326
|
+
? { agent: 'codex' }
|
|
327
|
+
: null;
|
|
326
328
|
if (named) {
|
|
327
329
|
try {
|
|
328
330
|
const client = await Client.create({ ...connection, baseUrl, cloud: true });
|
package/dist/index.js
CHANGED
|
@@ -47,6 +47,8 @@ Options
|
|
|
47
47
|
--idempotency-key <k> the key for a charged call, so a retry does not charge twice
|
|
48
48
|
--schemas with tools: include each tool's input schema
|
|
49
49
|
--annotation <kind> with tools: only read, write or destructive tools
|
|
50
|
+
--name <agent> with login or init: the agent's name, shown in Settings
|
|
51
|
+
and on the feed (otherwise "CLI agent")
|
|
50
52
|
--scope <where> with init: project or user, where the agent's settings are written
|
|
51
53
|
--dry-run / --force with init: preview what would be written, or overwrite what is there
|
|
52
54
|
--cloud talk to eversince.ai instead of the desktop app; to have
|
|
@@ -82,6 +84,7 @@ function toNumber(value, name) {
|
|
|
82
84
|
const OPTIONS = {
|
|
83
85
|
json: { type: 'boolean', default: false },
|
|
84
86
|
key: { type: 'string' },
|
|
87
|
+
name: { type: 'string' },
|
|
85
88
|
'base-url': { type: 'string' },
|
|
86
89
|
cloud: { type: 'boolean', default: false },
|
|
87
90
|
workspace: { type: 'string' },
|
|
@@ -141,7 +144,7 @@ async function main() {
|
|
|
141
144
|
try {
|
|
142
145
|
switch (command) {
|
|
143
146
|
case 'login':
|
|
144
|
-
return await login({ key: values.key, noBrowser: values['no-browser'] }, connection, mode);
|
|
147
|
+
return await login({ key: values.key, noBrowser: values['no-browser'], name: values.name }, connection, mode);
|
|
145
148
|
case 'logout':
|
|
146
149
|
return await logout(connection, mode);
|
|
147
150
|
case 'status':
|
|
@@ -188,6 +191,7 @@ async function main() {
|
|
|
188
191
|
force: values.force,
|
|
189
192
|
dryRun: values['dry-run'],
|
|
190
193
|
agent: values.agent,
|
|
194
|
+
name: values.name,
|
|
191
195
|
}, connection, mode);
|
|
192
196
|
default:
|
|
193
197
|
throw new Error(`Unknown command "${command}". Run \`eversince help\`.`);
|
package/package.json
CHANGED