eversince 0.2.9 → 0.2.11

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/README.md CHANGED
@@ -4,10 +4,11 @@ Your Eversince workspace, from the command line — for agents and the people wh
4
4
 
5
5
  ```bash
6
6
  npm install -g eversince
7
- eversince login
8
7
  eversince init
9
8
  ```
10
9
 
10
+ Without the desktop app, `eversince login` is needed only to run tools from the shell.
11
+
11
12
  `init` connects the agents on this machine and installs a skill that teaches them
12
13
  how to use this. Restart the agent and it can work in your library.
13
14
 
@@ -15,13 +16,13 @@ how to use this. Restart the agent and it can work in your library.
15
16
 
16
17
  They do different jobs and neither replaces the other.
17
18
 
18
- MCP gives an agent tools inside its session. It cannot read your disk, it needs a
19
+ MCP gives an agent tools inside its session. Hosted, it cannot read your disk (through the desktop app it can), it needs a
19
20
  session to exist, and its tool schemas ride along in context on every turn.
20
21
 
21
22
  The CLI reaches local files, runs the same operation over hundreds of items, works
22
23
  in a script with no agent at all, and costs nothing in context until it's used.
23
24
 
24
- Both are the same account and the same workspace. Their credentials are separate:
25
+ Both are the same account. Their credentials are separate:
25
26
  signing out of one leaves the other working.
26
27
 
27
28
  ## With the desktop app on this computer
@@ -29,13 +30,17 @@ signing out of one leaves the other working.
29
30
  When the Eversince desktop app is installed on the same computer, commands go
30
31
  through it rather than to eversince.ai, and what the app does is free. The app
31
32
  opens if it is closed, the CLI connects itself the first time, and it shows in
32
- the app under Settings, Your agents, where it can be disconnected. No sign-in is
33
+ the app under Settings, Agents, where it can be disconnected. No sign-in is
33
34
  needed for this; the app's own is used, in the workspace the app has open.
34
35
 
35
36
  A command stays on eversince.ai when it is run with `--cloud`, `--base-url` or
36
- `--workspace`, when `ES_API_KEY` or `ES_BASE_URL` is set, or when a workspace was
37
- chosen with `eversince workspace use`. `login`, `logout`, `workspace` and `init`
38
- always work against eversince.ai. `eversince status` says whether the app is used.
37
+ `--workspace`, when `ES_API_KEY`, `ES_BASE_URL` or `ES_WORKSPACE` is set, or when a
38
+ workspace was chosen with `eversince workspace use`. `login`, `logout` and `workspace`
39
+ always work against eversince.ai.
40
+
41
+ Through the app, `upload` adds images, video and audio where they sit on disk, and
42
+ they upload when a cloud feature first needs them; `--describe` or `--enrich` uploads
43
+ them now, and documents always upload. `eversince status` says whether the app is used.
39
44
 
40
45
  ## Commands
41
46
 
@@ -49,12 +54,12 @@ eversince init --agent codex connect one agent
49
54
  eversince mcp --agent codex the desktop app as a stdio MCP server (init writes this)
50
55
 
51
56
  eversince tools [name] what this workspace can do, live
52
- eversince run <tool> '<json>' call any tool (--wait to follow async work)
57
+ eversince run <tool> '<json>' call any tool (--wait to follow async work; - reads stdin)
53
58
  eversince upload <files|folder> local files into the library
54
59
  eversince download <refs…> library items onto disk
55
60
  eversince jobs <ids…> check async work (--wait to follow)
56
61
  eversince jobs cancel <ids…>
57
- eversince workspace [use <name>] which workspace the CLI acts in
62
+ eversince workspace [use <name|id>|clear] which workspace the CLI acts in
58
63
  ```
59
64
 
60
65
  Every command takes `--json`, on success and on failure, in the envelope the API
@@ -64,7 +69,7 @@ field to know which it got rather than inferring it from the shape.
64
69
  ## Examples
65
70
 
66
71
  ```bash
67
- # A shoot folder into the library, described and tagged on arrival.
72
+ # A shoot folder into the library, its images described and tagged on arrival.
68
73
  # Describing and tagging draws on cloud processing, so it runs only with `--enrich`.
69
74
  eversince upload ~/Desktop/shoot --enrich
70
75
 
@@ -76,13 +81,13 @@ eversince tools generate_video
76
81
  eversince run generate_video '{"prompt":"slow orbit around the bottle"}' --wait
77
82
 
78
83
  # Pull the results down for ffmpeg
79
- eversince download ab12cd ef34gh --out ./renders
84
+ eversince download XC4WBAX5 7HQ2MZ9P --out ./renders
80
85
 
81
86
  # Everything the library knows about an item, piped into jq
82
- eversince run get_items '{"refs":["ab12cd"]}' --json | jq '.data.items[0].tags'
87
+ eversince run get_items '{"refs":["XC4WBAX5"]}' --json | jq '.data.items[0].tags'
83
88
 
84
89
  # Arguments from a file or another command — `-` means read stdin
85
- jq -n '{refs:["ab12cd"]}' | eversince run get_items -
90
+ jq -n '{refs:["XC4WBAX5"]}' | eversince run get_items -
86
91
  ```
87
92
 
88
93
  ## Async work
@@ -110,8 +115,8 @@ ES_API_KEY=es_live_… eversince … # this shell only, overrides the stored
110
115
  A key given as `--key es_live_…` lands in your shell history and, briefly, in the
111
116
  machine's process list. On anything shared, pipe it instead.
112
117
 
113
- Credentials are kept per deployment, in the system keychain where there is one and
114
- in a `0600` file otherwise.
118
+ Credentials are kept per deployment, in the macOS Keychain on a Mac and in a `0600`
119
+ file elsewhere.
115
120
 
116
121
  ## Workspaces
117
122
 
@@ -122,7 +127,7 @@ eversince workspace clear # back to the account default
122
127
  ```
123
128
 
124
129
  The choice is the CLI's own and travels on each request. It does not move the
125
- workspace that connected apps are using. An API key is bound to one workspace by
130
+ workspace that connected agents are using. An API key is bound to one workspace by
126
131
  the server and cannot switch.
127
132
 
128
133
  ## Options
@@ -130,7 +135,7 @@ the server and cannot switch.
130
135
  ```
131
136
  --json machine-readable output, on success and failure
132
137
  --wait follow async work to completion
133
- --timeout <seconds> ceiling on a request, and on --wait (default 1800)
138
+ --timeout <seconds> ceiling on a request (default 600), and on --wait (default 1800)
134
139
  --out <dir> where downloads land
135
140
  --describe <text> description for an upload
136
141
  --enrich describe and tag each image upload
@@ -138,9 +143,14 @@ the server and cannot switch.
138
143
  --workspace <id> act in this workspace, this once
139
144
  --cloud use eversince.ai even with the desktop app here
140
145
  --base-url <url> point at another deployment
146
+ --idempotency-key <k> the same key on a retry, so a charged call is not charged twice
147
+ --name <name> name the connection in the app
141
148
  --debug print each request and response
142
149
  ```
143
150
 
151
+ `init` also takes `--agent`, `--scope`, `--cloud`, `--dry-run`, `--force`, `--no-mcp`
152
+ and `--no-skills`; `tools` takes `--schemas` and `--annotation`.
153
+
144
154
  ## Environment
145
155
 
146
156
  ```
@@ -170,18 +180,19 @@ settings as a local server, by the absolute paths of Node and the CLI, so the
170
180
  work it does there is free, and replaces an eversince.ai entry of the same name.
171
181
  The agent is the one named with `--agent` (`claude-code`, `codex`, `cursor`,
172
182
  `vscode`, `claude-desktop` or `other`), else the one running `init`, else Claude
173
- Code and Codex where they are installed. Run `init` again after moving Node or
183
+ Code and Codex where they are installed. Cursor and VS Code open with the connection
184
+ to confirm, and Claude Desktop opens the Eversince extension to install. Run `init` again after moving Node or
174
185
  the CLI. `--cloud` sets it up on eversince.ai instead.
175
186
 
176
- Without the app, `init --agent` writes only that agent's settings: `.mcp.json`
177
- for Claude Code, `.cursor/mcp.json` for Cursor, `.vscode/mcp.json` for VS Code
178
- (the user-wide files with `--scope user`), and prints what to add for Codex,
179
- Claude Desktop and anything else. With no agent named, `init` merges an `eversince` entry into the MCP config of the agents on this
180
- machine — `.mcp.json` for Claude Code, `.cursor/mcp.json` for Cursor — backing up
181
- anything it edits and keeping settings that were already there. Codex keeps its
187
+ Without the app, `init --agent` writes only that agent's settings, in your
188
+ user-wide files by default (`--scope project` writes `.mcp.json` for Claude Code,
189
+ `.cursor/mcp.json` for Cursor and `.vscode/mcp.json` for VS Code in this folder
190
+ instead), and prints what to add for Codex, Claude Desktop and anything else.
191
+ With no agent named, `init` merges an `eversince` entry into Claude Code's and
192
+ Cursor's settings and prints Codex's, backing up anything it edits and keeping settings
193
+ that were already there. Codex keeps its
182
194
  servers in TOML, so that one is printed for you to paste rather than parsed.
183
195
 
184
- It also installs a skill at `.claude/skills/eversince-cli/SKILL.md` teaching an
185
- agent these commands. That is the CLI's skill and is separate from the Eversince
186
- plugin skill, which covers the MCP tools. `--no-mcp` and `--no-skills` turn either
196
+ It also installs a skill at `~/.claude/skills/eversince-cli/SKILL.md` (this folder
197
+ with `--scope project`) teaching an agent these commands. `--no-mcp` and `--no-skills` turn either
187
198
  half off; `--dry-run` shows what would change.
@@ -83,13 +83,17 @@ function openBrowser(url) {
83
83
  catch {
84
84
  }
85
85
  }
86
- const DONE_PAGE = `<!doctype html><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Signed in to Eversince</title>
86
+ function donePage(signedIn, feed) {
87
+ const title = signedIn ? 'Signed in to Eversince' : 'Not signed in';
88
+ return `<!doctype html><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>${title}</title>
87
89
  <style>body{font-family:Inter,-apple-system,system-ui,sans-serif;display:grid;place-items:center;height:100vh;margin:0;padding:0 16px;background:#fff;color:#18181b;text-align:center;-webkit-font-smoothing:antialiased}
88
90
  h1{font-size:14px;font-weight:440;margin:0}p{font-size:14px;color:#71717a;margin:6px 0 0}
89
- @media(prefers-color-scheme:dark){body{background:#161616;color:#f4f4f5}p{color:#a1a1aa}}</style>
90
- <body><div><h1>Signed in to Eversince</h1><p>You can close this tab.</p></div>`;
91
+ a{display:inline-flex;align-items:center;height:32px;margin-top:16px;padding:0 14px;border-radius:999px;background:#f4f4f5;color:#18181b;font-size:12px;font-weight:440;text-decoration:none}a:hover{background:#e4e4e7}
92
+ @media(prefers-color-scheme:dark){body{background:#161616;color:#f4f4f5}p{color:#a1a1aa}a{background:rgba(255,255,255,.06);color:#f4f4f5}a:hover{background:rgba(255,255,255,.1)}}</style>
93
+ <body><div><h1>${title}</h1><p>You can close this tab.</p><a href="${feed.replace(/&/g, '&amp;').replace(/"/g, '&quot;').replace(/</g, '&lt;')}">Open Eversince</a></div>`;
94
+ }
91
95
  const PREFERRED_PORTS = [51703, 51704, 51705, 0];
92
- async function awaitCallback(timeoutMs) {
96
+ async function awaitCallback(timeoutMs, feed) {
93
97
  let settle = null;
94
98
  const received = new Promise((resolve) => {
95
99
  settle = resolve;
@@ -100,7 +104,7 @@ async function awaitCallback(timeoutMs) {
100
104
  res.writeHead(404).end();
101
105
  return;
102
106
  }
103
- res.writeHead(200, { 'content-type': 'text/html; charset=utf-8' }).end(DONE_PAGE);
107
+ res.writeHead(200, { 'content-type': 'text/html; charset=utf-8' }).end(donePage(!url.searchParams.get('error'), feed));
104
108
  settle?.({
105
109
  code: url.searchParams.get('code') ?? undefined,
106
110
  state: url.searchParams.get('state') ?? undefined,
@@ -144,7 +148,7 @@ export async function browserLogin(baseUrl, opts) {
144
148
  if (methods.length && !methods.includes('S256')) {
145
149
  throw new Error('Authorization server does not support PKCE S256; refusing to sign in without it.');
146
150
  }
147
- const callback = await awaitCallback(opts.timeoutMs ?? 5 * 60_000);
151
+ const callback = await awaitCallback(opts.timeoutMs ?? 5 * 60_000, new URL('/app', baseUrl).toString());
148
152
  const redirectUri = `http://127.0.0.1:${callback.port}/callback`;
149
153
  try {
150
154
  const clientId = opts.existingClientId && opts.existingRedirectUri === redirectUri
package/dist/client.js CHANGED
@@ -276,7 +276,7 @@ export class Client {
276
276
  throw lastError ?? new ApiError(0, { code: 'unknown', message: 'Request failed' });
277
277
  }
278
278
  }
279
- async function mayUseDesktop(opts) {
279
+ export async function mayUseDesktop(opts) {
280
280
  if (opts.cloud || opts.baseUrl || opts.credentials || opts.workspace)
281
281
  return false;
282
282
  if (process.env.ES_BASE_URL?.trim() || process.env.ES_API_KEY?.trim())
@@ -2,7 +2,7 @@ import { createInterface } from 'node:readline/promises';
2
2
  import { browserLogin } from '../auth/oauth.js';
3
3
  import { readCredentials, writeCredentials, deleteCredentials, storageKind, withRenewalLock } from '../auth/store.js';
4
4
  import { resolveBaseUrl, resolveWorkspace, writeSettings, hostOf } from '../config.js';
5
- import { Client, ApiError, loadCredentials } from '../client.js';
5
+ import { Client, ApiError, loadCredentials, mayUseDesktop } from '../client.js';
6
6
  import { line, note, printResult } from '../output.js';
7
7
  import { desktopInstalled } from '../local.js';
8
8
  import { detectHostAgent } from '../host-agent.js';
@@ -119,7 +119,7 @@ export async function logout(connection, mode) {
119
119
  note('ES_API_KEY is still set in this environment and will keep being used.');
120
120
  }
121
121
  if (had?.kind === 'oauth') {
122
- note('The authorisation is also revocable from Settings → Connected apps.');
122
+ note('The authorisation is also revocable from Settings, Agents.');
123
123
  }
124
124
  });
125
125
  }
@@ -129,9 +129,10 @@ export async function status(connection, mode) {
129
129
  const credentials = await loadCredentials(baseUrl);
130
130
  const workspace = await resolveWorkspace(baseUrl, connection.workspace);
131
131
  const fromEnv = Boolean(process.env.ES_API_KEY);
132
- const desktop = desktopInstalled();
132
+ const installed = desktopInstalled();
133
+ const desktop = installed && (await mayUseDesktop(connection));
133
134
  const payload = {
134
- desktop_app: desktop ? 'used' : 'not_installed',
135
+ desktop_app: desktop ? 'used' : installed ? 'not_used' : 'not_installed',
135
136
  signed_in: credentials !== null,
136
137
  host,
137
138
  base_url: baseUrl,
@@ -141,13 +142,14 @@ export async function status(connection, mode) {
141
142
  expires_at: credentials?.expiresAt ? new Date(credentials.expiresAt).toISOString() : null,
142
143
  };
143
144
  printResult(mode, payload, () => {
144
- if (desktop)
145
- line('Desktop app: commands go through it, unless run with --cloud.');
145
+ line(desktop ? 'Commands run through the desktop app on this computer, for free.' : `Commands run in the cloud (${host}).`);
146
+ const how = credentials ? (credentials.kind === 'api_key' ? 'with an API key' : 'in the browser') : '';
147
+ const from = fromEnv ? ', from ES_API_KEY' : '';
146
148
  if (!credentials) {
147
- line(`Not signed in to ${host}.`);
149
+ line(desktop ? `For --cloud: not signed in to ${host}.` : `Not signed in to ${host}.`);
148
150
  return;
149
151
  }
150
- line(`${host}: signed in (${credentials.kind === 'api_key' ? 'API key' : 'browser sign-in'}${fromEnv ? ', from ES_API_KEY' : ''})`);
152
+ line(desktop ? `For --cloud: signed in to ${host} ${how}${from}.` : `Signed in to ${host} ${how}${from}.`);
151
153
  line(`workspace: ${workspace ?? 'account default'}`);
152
154
  if (credentials.kind === 'oauth') {
153
155
  line(`session renews automatically${credentials.refreshToken ? '.' : '. No refresh token, sign in again when it lapses.'}`);
@@ -7,7 +7,8 @@ import { Client } from '../client.js';
7
7
  import { resolveBaseUrl, hostOf } from '../config.js';
8
8
  import { line, note, printResult } from '../output.js';
9
9
  import { cliLauncher, connectThroughApp, desktopInstalled, launchedFromTemporaryCopy, openApp } from '../local.js';
10
- export const APP_AGENTS = ['claude-code', 'codex', 'cursor', 'vscode', 'claude-desktop', 'other'];
10
+ import { detectHostAgent } from '../host-agent.js';
11
+ export const APP_AGENTS = ['claude-code', 'codex', 'cursor', 'vscode', 'claude-desktop', 'other', 'cli'];
11
12
  function checkAgent(given) {
12
13
  if (given === undefined)
13
14
  return undefined;
@@ -81,7 +82,7 @@ A media workspace this account can reach two ways. Prefer whichever fits the ste
81
82
  eversince tools # everything this workspace can do, live
82
83
  eversince tools <name> # one tool's input schema
83
84
  eversince run <tool> '<json>' # call any tool; add --wait for async work
84
- eversince upload <files|folder> # local files into the library
85
+ eversince upload <files|folder> # local files into the library (through the desktop app, media is added where it sits)
85
86
  eversince download <refs> --out ./dir # library items onto disk
86
87
  eversince jobs <id> --wait # follow generation, render
87
88
  \`\`\`
@@ -106,9 +107,9 @@ files are on this machine or the work has to outlive the session.
106
107
  authoritative for one tool's arguments.
107
108
  - With the desktop app on this machine, commands go through it and work the app
108
109
  can do runs here, free; \`--cloud\` sends a command to eversince.ai instead.
109
- - \`--workspace <id>\` picks the workspace for one command and changes nothing
110
- for anyone else, so several agents can run at once against different ones.
111
- Left off, it is the workspace this connection was signed in to.
110
+ - \`--workspace <id>\` picks the workspace for one command, on eversince.ai (it needs
111
+ \`eversince login\`; an API key keeps its own workspace), and changes nothing for anyone
112
+ else. Left off, it is the workspace the desktop app has open, or the one this sign-in uses.
112
113
  `;
113
114
  }
114
115
  async function exists(path) {
@@ -220,6 +221,8 @@ async function projectEntryShadows() {
220
221
  }
221
222
  async function initThroughApp(argv, scope, mode) {
222
223
  const agents = agentsToConnect(argv.agent);
224
+ const host = detectHostAgent();
225
+ const name = argv.name ?? (argv.agent === 'cli' ? host?.name : undefined);
223
226
  if (agents.length === 0) {
224
227
  throw new Error(`Name the agent to connect with --agent: ${APP_AGENTS.join(', ')}.`);
225
228
  }
@@ -233,10 +236,10 @@ async function initThroughApp(argv, scope, mode) {
233
236
  note('Opening the Eversince app on this computer.'); });
234
237
  const cli = cliLauncher();
235
238
  for (const agent of agents)
236
- connections.push(await connectThroughApp(agent, { cli }));
239
+ connections.push(await connectThroughApp(agent, { cli, ...(name ? { name } : {}) }));
237
240
  }
238
241
  const changes = [];
239
- if (argv.skills !== false) {
242
+ if (argv.skills !== false && !agents.every((a) => a === 'cli')) {
240
243
  const body = skillBody('through the Eversince desktop app on this computer');
241
244
  for (const target of skillTargets(scope)) {
242
245
  changes.push(await writeSkill(target, body, argv.force === true, dryRun));
@@ -144,6 +144,49 @@ async function uploadOne(client, path, opts) {
144
144
  }));
145
145
  return { file: path, ok: true, item: confirmed.upload_id, type: confirmed.type };
146
146
  }
147
+ const IN_PLACE = new Set([
148
+ '.jpg', '.jpeg', '.png', '.gif', '.webp', '.bmp',
149
+ '.mp4', '.avi', '.mov', '.wmv', '.flv', '.webm', '.mkv',
150
+ '.mp3', '.wav', '.flac', '.aac', '.ogg', '.m4a', '.aiff', '.au',
151
+ ]);
152
+ function kindOfExtension(path) {
153
+ const ext = extname(path).toLowerCase();
154
+ if (['.mp3', '.wav', '.flac', '.aac', '.ogg', '.m4a', '.aiff', '.au'].includes(ext))
155
+ return 'audio';
156
+ if (['.mp4', '.avi', '.mov', '.wmv', '.flv', '.webm', '.mkv'].includes(ext))
157
+ return 'video';
158
+ return 'image';
159
+ }
160
+ async function addInPlace(client, files, mode) {
161
+ const results = [];
162
+ const upload = [];
163
+ const PER_CALL = 8;
164
+ for (let i = 0; i < files.length; i += PER_CALL) {
165
+ const batch = files.slice(i, i + PER_CALL);
166
+ try {
167
+ const data = (await client.tool('import_media', { mode: 'local', paths: batch }));
168
+ const byPath = new Map((data.results ?? []).map((r) => [r.path, r]));
169
+ for (const path of batch) {
170
+ const r = byPath.get(path);
171
+ results.push(r && r.status !== 'failed' && r.item_id
172
+ ? { file: path, ok: true, item: r.item_id, type: kindOfExtension(path), in_place: true, ...(r.status === 'duplicate' ? { duplicate: true } : {}) }
173
+ : { file: path, ok: false, error: r?.error ?? 'Not added' });
174
+ }
175
+ }
176
+ catch (error) {
177
+ if (error instanceof ApiError && ((error.status === 400 && error.body.code === 'validation_error') || (error.status === 503 && error.body.code === 'unavailable'))) {
178
+ upload.push(...batch);
179
+ continue;
180
+ }
181
+ const message = error instanceof ApiError ? error.body.message : error instanceof Error ? error.message : String(error);
182
+ for (const path of batch)
183
+ results.push({ file: path, ok: false, error: message });
184
+ }
185
+ if (!mode.json)
186
+ note(`[${Math.min(i + PER_CALL, files.length)}/${files.length}] added from this computer`);
187
+ }
188
+ return { results, upload };
189
+ }
147
190
  export async function upload(argv, connection, mode) {
148
191
  if (argv.paths.length === 0)
149
192
  throw new Error('Which files? `eversince upload ./shot.png` or a folder.');
@@ -154,15 +197,19 @@ export async function upload(argv, connection, mode) {
154
197
  note(`Left ${skipped.length} nested folder${skipped.length === 1 ? '' : 's'} alone. Name one to upload it.`);
155
198
  }
156
199
  const client = await Client.create(connection);
157
- const limits = await fetchLimits(client);
200
+ const inPlace = client.local && !argv.enrich && !argv.describe;
201
+ const here = inPlace ? files.filter((f) => IN_PLACE.has(extname(f).toLowerCase())) : [];
202
+ const { results: added, upload: refusedHere } = here.length ? await addInPlace(client, here, mode) : { results: [], upload: [] };
203
+ const toSend = inPlace ? [...files.filter((f) => !IN_PLACE.has(extname(f).toLowerCase())), ...refusedHere] : files;
158
204
  const results = [];
205
+ const limits = toSend.length ? await fetchLimits(client) : FALLBACK_LIMITS;
159
206
  const limit = Math.max(1, Math.min(argv.concurrency ?? 3, 8));
160
207
  let cursor = 0;
161
208
  let done = 0;
162
209
  async function worker() {
163
210
  for (;;) {
164
211
  const index = cursor++;
165
- const path = files[index];
212
+ const path = toSend[index];
166
213
  if (!path)
167
214
  return;
168
215
  try {
@@ -178,22 +225,27 @@ export async function upload(argv, connection, mode) {
178
225
  }
179
226
  done += 1;
180
227
  if (!mode.json)
181
- note(`[${done}/${files.length}] ${basename(path)}`);
228
+ note(`[${done}/${toSend.length}] ${basename(path)}`);
182
229
  }
183
230
  }
184
- await Promise.all(Array.from({ length: Math.min(limit, files.length) }, worker));
185
- const uploaded = results.filter((r) => r?.ok);
186
- const failed = results.filter((r) => r && !r.ok);
231
+ await Promise.all(Array.from({ length: Math.min(limit, toSend.length) }, worker));
232
+ const all = [...added, ...results.filter(Boolean)];
233
+ const uploaded = all.filter((r) => r.ok);
234
+ const failed = all.filter((r) => !r.ok);
235
+ const local = uploaded.filter((r) => r.in_place).length;
187
236
  printResult(mode, { uploaded, failed, skipped_folders: skipped }, () => {
188
- for (const result of results) {
189
- if (!result)
190
- continue;
237
+ for (const result of all) {
191
238
  line(result.ok
192
239
  ? `${result.item} ${result.type} ${basename(result.file)}`
193
240
  : `failed ${basename(result.file)}: ${result.error}`);
194
241
  }
195
242
  line();
196
- line(`${uploaded.length} uploaded${failed.length ? `, ${failed.length} failed` : ''}.`);
243
+ const counts = [
244
+ ...(local ? [`${local} added from this computer`] : []),
245
+ ...(uploaded.length - local || !local ? [`${uploaded.length - local} uploaded`] : []),
246
+ ...(failed.length ? [`${failed.length} failed`] : []),
247
+ ];
248
+ line(`${counts.join(', ')}.`);
197
249
  });
198
250
  if (failed.length)
199
251
  process.exitCode = 1;
@@ -30,7 +30,7 @@ export async function workspace(argv, connection, mode) {
30
30
  await setWorkspaceFor(baseUrl, match.id);
31
31
  printResult(mode, { workspace: match }, () => {
32
32
  line(`Now working in ${match.name}.`);
33
- note('This applies to the CLI only. Connected apps keep the workspace they were on.');
33
+ note('This applies to the CLI only. Connected agents keep the workspace they were on.');
34
34
  });
35
35
  return;
36
36
  }
package/dist/door.js CHANGED
@@ -3,6 +3,7 @@ import { createHmac, randomBytes, timingSafeEqual } from 'node:crypto';
3
3
  import { existsSync, readFileSync } from 'node:fs';
4
4
  import { homedir } from 'node:os';
5
5
  import { dirname, join } from 'node:path';
6
+ import { fileURLToPath } from 'node:url';
6
7
  export const START_WAIT_MS = 45_000;
7
8
  function stateCandidates() {
8
9
  const home = homedir();
@@ -12,7 +13,17 @@ function stateCandidates() {
12
13
  ? process.env.APPDATA || join(home, 'AppData', 'Roaming')
13
14
  : process.env.XDG_CONFIG_HOME || join(home, '.config');
14
15
  const record = (...parts) => join(root, ...parts, 'agent-door.json');
15
- return [record('Eversince'), record('@eversince', 'desktop-dev'), record('@eversince', 'desktop')];
16
+ const installed = [record('Eversince'), record('@eversince', 'desktop')];
17
+ const dev = record('@eversince', 'desktop-dev');
18
+ return fromSource() ? [dev, ...installed] : [...installed, dev];
19
+ }
20
+ function fromSource() {
21
+ try {
22
+ return existsSync(join(dirname(fileURLToPath(import.meta.url)), '..', 'src', 'door.ts'));
23
+ }
24
+ catch {
25
+ return false;
26
+ }
16
27
  }
17
28
  export function stateFile() {
18
29
  if (process.env.ES_DESKTOP_STATE)
@@ -105,6 +116,14 @@ export async function reachApp(file = stateFile(), onStart) {
105
116
  return state;
106
117
  if (first === 'blocked')
107
118
  throw new DoorBlocked();
119
+ const devUrl = state.launch && typeof state.launch === 'object' && state.launch.env && typeof state.launch.env === 'object'
120
+ ? state.launch.env.EVERSINCE_DEV_URL
121
+ : undefined;
122
+ if (typeof devUrl === 'string') {
123
+ const up = await fetch(devUrl, { signal: AbortSignal.timeout(1500) }).then(() => true, () => false);
124
+ if (!up)
125
+ return null;
126
+ }
108
127
  onStart?.();
109
128
  try {
110
129
  if (!launch(state))
@@ -1,14 +1,16 @@
1
+ const KNOWN = { 'Claude Code': 'claude-code', Cursor: 'cursor', 'VS Code': 'vscode', Codex: 'codex', 'Claude Desktop': 'claude-desktop' };
2
+ export function kindForName(name) {
3
+ return (name && KNOWN[name]) || 'cli';
4
+ }
1
5
  export function detectHostAgent(env = process.env) {
2
6
  const named = env.ES_AGENT_NAME?.trim();
3
7
  if (named)
4
- return { kind: 'other', name: named };
8
+ return { kind: kindForName(named) === 'cli' ? 'other' : kindForName(named), name: named };
5
9
  if (env.CLAUDECODE)
6
10
  return { kind: 'claude-code', name: 'Claude Code' };
7
11
  if (env.CURSOR_TRACE_ID)
8
12
  return { kind: 'cursor', name: 'Cursor' };
9
- if (env.CODEX_SANDBOX || env.CODEX_THREAD_ID)
13
+ if (Object.keys(env).some((key) => key.startsWith('CODEX_') && key !== 'CODEX_HOME'))
10
14
  return { kind: 'codex', name: 'Codex' };
11
- if (env.TERM_PROGRAM === 'vscode')
12
- return { kind: 'vscode', name: 'VS Code' };
13
15
  return null;
14
16
  }
package/dist/index.js CHANGED
@@ -18,9 +18,10 @@ Getting set up
18
18
  eversince login --key - or with an API key from stdin (CI, no browser)
19
19
  eversince logout
20
20
  eversince status
21
- eversince init connect the agents found on this machine
21
+ eversince init connect the agents on this machine
22
22
  eversince init --agent codex connect one agent (claude-code, codex,
23
- cursor, vscode, claude-desktop, other)
23
+ cursor, vscode, claude-desktop, other,
24
+ or cli: this terminal, after a disconnect)
24
25
  eversince mcp --agent <agent> the desktop app as a stdio MCP server;
25
26
  init writes this into the agent's settings
26
27
 
@@ -28,7 +29,8 @@ Working
28
29
  eversince tools [name] what this workspace can do, live
29
30
  eversince run <tool> '<json>' call any tool (--wait to follow async work)
30
31
  eversince run <tool> - arguments from stdin
31
- eversince upload <files|folder> local files into the library
32
+ eversince upload <files|folder> local files into the library (through the
33
+ desktop app, media is added where it sits)
32
34
  eversince download <refs…> library items onto disk
33
35
  eversince jobs <ids…> check async work (--wait to follow)
34
36
  eversince jobs cancel <ids…>
@@ -37,7 +39,7 @@ Working
37
39
  Options
38
40
  --json machine-readable output, on success and failure
39
41
  --wait follow async work to completion
40
- --timeout <seconds> ceiling on a request, and on --wait (default 1800)
42
+ --timeout <seconds> ceiling on a request (default 600), and on --wait (default 1800)
41
43
  --out <dir> where downloads land, and where a tool's pictures go
42
44
  (a temp folder otherwise)
43
45
  --describe <text> description for an upload
@@ -49,7 +51,8 @@ Options
49
51
  --annotation <kind> with tools: only read, write or destructive tools
50
52
  --name <agent> with login or init: the agent's name, shown in Settings
51
53
  and on the feed (otherwise the agent whose shell this
52
- is: Claude Code, Cursor, Codex or VS Code; else "CLI agent")
54
+ is: Claude Code, Cursor or Codex; else "CLI agent", or
55
+ "Another client" through the app)
53
56
  --scope <where> with init: user (default, once per machine) or project
54
57
  (written into this folder, to commit with a repo)
55
58
  --dry-run / --force with init: preview what would be written, or overwrite what is there
@@ -68,11 +71,12 @@ Environment
68
71
  With the Eversince desktop app on this computer, commands go through it and
69
72
  the work it does is free, and init connects agents through it rather than
70
73
  eversince.ai. The app opens if it is closed. --cloud, --base-url, --workspace,
71
- ES_API_KEY or ES_BASE_URL keep a command on the cloud, which needs
74
+ ES_API_KEY, ES_BASE_URL, ES_WORKSPACE or a workspace chosen with
75
+ eversince workspace use keep a command on the cloud, which needs
72
76
  eversince login.
73
77
 
74
- Credentials are stored per deployment, in the system keychain where there is
75
- one. The CLI's sign-in is its own: connecting or disconnecting an agent's MCP
78
+ Credentials are stored per deployment, in the macOS Keychain on a Mac and a
79
+ 0600 file elsewhere. The CLI's sign-in is its own: connecting or disconnecting an agent's MCP
76
80
  connection leaves it alone, and signing out here leaves the agent working.
77
81
  `;
78
82
  function toNumber(value, name) {
package/dist/local.js CHANGED
@@ -2,7 +2,7 @@ import { existsSync, realpathSync } from 'node:fs';
2
2
  import { delimiter, join } from 'node:path';
3
3
  import { fileURLToPath } from 'node:url';
4
4
  import { DoorBlocked, probe, reachApp, readState } from './door.js';
5
- import { detectHostAgent } from './host-agent.js';
5
+ import { detectHostAgent, kindForName } from './host-agent.js';
6
6
  export function desktopInstalled() {
7
7
  const state = readState();
8
8
  return !!state && existsSync(state.app) && typeof state.connectKey === 'string';
@@ -69,8 +69,9 @@ export async function localDoor(onStart) {
69
69
  const state = await reachApp(undefined, onStart);
70
70
  if (!state)
71
71
  throw new Error('The Eversince app on this computer did not open. Open it and try again, or run with --cloud.');
72
- const label = detectHostAgent()?.name ?? 'CLI agent';
73
- const existing = state.connections?.find((c) => c?.label === label && typeof c.token === 'string');
72
+ const host = detectHostAgent();
73
+ const label = host?.name ?? 'CLI agent';
74
+ const existing = state.connections?.find((c) => c?.label === label && c?.agent === kindForName(host?.name) && typeof c.token === 'string');
74
75
  const token = typeof existing?.token === 'string' ? existing.token : await connect();
75
76
  return {
76
77
  baseUrl: `http://127.0.0.1:${state.port}`,
@@ -0,0 +1 @@
1
+ 5b62425149cfdaa3b4aefedfe3ed59d39a73c09039e147f2e98b90a0f92de43b
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eversince",
3
- "version": "0.2.9",
3
+ "version": "0.2.11",
4
4
  "description": "The Eversince CLI. Eversince is the media workspace for agents: connect an agent, call any tool, move files and follow jobs from a shell.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -16,7 +16,7 @@
16
16
  "node": ">=20"
17
17
  },
18
18
  "scripts": {
19
- "build": "rm -rf dist && tsc -p tsconfig.json",
19
+ "build": "rm -rf dist && tsc -p tsconfig.json && node ../scripts/source-fingerprint.mjs cli > dist/source.sha256",
20
20
  "dev": "tsc -p tsconfig.json --watch",
21
21
  "typecheck": "tsc -p tsconfig.json --noEmit",
22
22
  "test": "npm run build && node --test test/*.test.js",