eversince 0.2.10 → 0.2.12
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 +37 -25
- package/dist/auth/oauth.js +10 -6
- package/dist/bridge.js +4 -3
- package/dist/client.js +1 -1
- package/dist/commands/auth.js +23 -8
- package/dist/commands/init.js +13 -14
- package/dist/commands/tools.js +3 -2
- package/dist/commands/upload.js +62 -10
- package/dist/commands/workspace.js +1 -1
- package/dist/door.js +20 -1
- package/dist/index.js +12 -8
- package/dist/local.js +51 -3
- package/dist/output.js +9 -4
- package/dist/source.sha256 +1 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -3,11 +3,14 @@
|
|
|
3
3
|
Your Eversince workspace, from the command line — for agents and the people who run them.
|
|
4
4
|
|
|
5
5
|
```bash
|
|
6
|
-
|
|
7
|
-
eversince login
|
|
8
|
-
eversince init
|
|
6
|
+
npx -y eversince@latest init
|
|
9
7
|
```
|
|
10
8
|
|
|
9
|
+
With a global install (`npm install -g eversince`, where npm can write without sudo), the
|
|
10
|
+
commands below are `eversince …`; from npx they are `npx -y eversince@latest …`.
|
|
11
|
+
|
|
12
|
+
Without the desktop app, `eversince login` is needed only to run tools from the shell.
|
|
13
|
+
|
|
11
14
|
`init` connects the agents on this machine and installs a skill that teaches them
|
|
12
15
|
how to use this. Restart the agent and it can work in your library.
|
|
13
16
|
|
|
@@ -15,13 +18,13 @@ how to use this. Restart the agent and it can work in your library.
|
|
|
15
18
|
|
|
16
19
|
They do different jobs and neither replaces the other.
|
|
17
20
|
|
|
18
|
-
MCP gives an agent tools inside its session.
|
|
21
|
+
MCP gives an agent tools inside its session. Hosted, it cannot read your disk (through the desktop app it can), it needs a
|
|
19
22
|
session to exist, and its tool schemas ride along in context on every turn.
|
|
20
23
|
|
|
21
24
|
The CLI reaches local files, runs the same operation over hundreds of items, works
|
|
22
25
|
in a script with no agent at all, and costs nothing in context until it's used.
|
|
23
26
|
|
|
24
|
-
Both are the same account
|
|
27
|
+
Both are the same account. Their credentials are separate:
|
|
25
28
|
signing out of one leaves the other working.
|
|
26
29
|
|
|
27
30
|
## With the desktop app on this computer
|
|
@@ -29,13 +32,17 @@ signing out of one leaves the other working.
|
|
|
29
32
|
When the Eversince desktop app is installed on the same computer, commands go
|
|
30
33
|
through it rather than to eversince.ai, and what the app does is free. The app
|
|
31
34
|
opens if it is closed, the CLI connects itself the first time, and it shows in
|
|
32
|
-
the app under Settings,
|
|
35
|
+
the app under Settings, Agents, where it can be disconnected. No sign-in is
|
|
33
36
|
needed for this; the app's own is used, in the workspace the app has open.
|
|
34
37
|
|
|
35
38
|
A command stays on eversince.ai when it is run with `--cloud`, `--base-url` or
|
|
36
|
-
`--workspace`, when `ES_API_KEY` or `
|
|
37
|
-
chosen with `eversince workspace use`. `login`, `logout
|
|
38
|
-
always work against eversince.ai.
|
|
39
|
+
`--workspace`, when `ES_API_KEY`, `ES_BASE_URL` or `ES_WORKSPACE` is set, or when a
|
|
40
|
+
workspace was chosen with `eversince workspace use`. `login`, `logout` and `workspace`
|
|
41
|
+
always work against eversince.ai.
|
|
42
|
+
|
|
43
|
+
Through the app, `upload` adds images, video and audio where they sit on disk, and
|
|
44
|
+
they upload when a cloud feature first needs them; `--describe` or `--enrich` uploads
|
|
45
|
+
them now, and documents always upload. `eversince status` says whether the app is used.
|
|
39
46
|
|
|
40
47
|
## Commands
|
|
41
48
|
|
|
@@ -49,12 +56,12 @@ eversince init --agent codex connect one agent
|
|
|
49
56
|
eversince mcp --agent codex the desktop app as a stdio MCP server (init writes this)
|
|
50
57
|
|
|
51
58
|
eversince tools [name] what this workspace can do, live
|
|
52
|
-
eversince run <tool> '<json>' call any tool (--wait to follow async work)
|
|
59
|
+
eversince run <tool> '<json>' call any tool (--wait to follow async work; - reads stdin)
|
|
53
60
|
eversince upload <files|folder> local files into the library
|
|
54
61
|
eversince download <refs…> library items onto disk
|
|
55
62
|
eversince jobs <ids…> check async work (--wait to follow)
|
|
56
63
|
eversince jobs cancel <ids…>
|
|
57
|
-
eversince workspace [use <name
|
|
64
|
+
eversince workspace [use <name|id>|clear] which workspace the CLI acts in
|
|
58
65
|
```
|
|
59
66
|
|
|
60
67
|
Every command takes `--json`, on success and on failure, in the envelope the API
|
|
@@ -64,7 +71,7 @@ field to know which it got rather than inferring it from the shape.
|
|
|
64
71
|
## Examples
|
|
65
72
|
|
|
66
73
|
```bash
|
|
67
|
-
# A shoot folder into the library, described and tagged on arrival.
|
|
74
|
+
# A shoot folder into the library, its images described and tagged on arrival.
|
|
68
75
|
# Describing and tagging draws on cloud processing, so it runs only with `--enrich`.
|
|
69
76
|
eversince upload ~/Desktop/shoot --enrich
|
|
70
77
|
|
|
@@ -76,13 +83,13 @@ eversince tools generate_video
|
|
|
76
83
|
eversince run generate_video '{"prompt":"slow orbit around the bottle"}' --wait
|
|
77
84
|
|
|
78
85
|
# Pull the results down for ffmpeg
|
|
79
|
-
eversince download
|
|
86
|
+
eversince download XC4WBAX5 7HQ2MZ9P --out ./renders
|
|
80
87
|
|
|
81
88
|
# Everything the library knows about an item, piped into jq
|
|
82
|
-
eversince run get_items '{"refs":["
|
|
89
|
+
eversince run get_items '{"refs":["XC4WBAX5"]}' --json | jq '.data.items[0].tags'
|
|
83
90
|
|
|
84
91
|
# Arguments from a file or another command — `-` means read stdin
|
|
85
|
-
jq -n '{refs:["
|
|
92
|
+
jq -n '{refs:["XC4WBAX5"]}' | eversince run get_items -
|
|
86
93
|
```
|
|
87
94
|
|
|
88
95
|
## Async work
|
|
@@ -110,8 +117,8 @@ ES_API_KEY=es_live_… eversince … # this shell only, overrides the stored
|
|
|
110
117
|
A key given as `--key es_live_…` lands in your shell history and, briefly, in the
|
|
111
118
|
machine's process list. On anything shared, pipe it instead.
|
|
112
119
|
|
|
113
|
-
Credentials are kept per deployment, in the
|
|
114
|
-
|
|
120
|
+
Credentials are kept per deployment, in the macOS Keychain on a Mac and in a `0600`
|
|
121
|
+
file elsewhere.
|
|
115
122
|
|
|
116
123
|
## Workspaces
|
|
117
124
|
|
|
@@ -122,7 +129,7 @@ eversince workspace clear # back to the account default
|
|
|
122
129
|
```
|
|
123
130
|
|
|
124
131
|
The choice is the CLI's own and travels on each request. It does not move the
|
|
125
|
-
workspace that connected
|
|
132
|
+
workspace that connected agents are using. An API key is bound to one workspace by
|
|
126
133
|
the server and cannot switch.
|
|
127
134
|
|
|
128
135
|
## Options
|
|
@@ -130,7 +137,7 @@ the server and cannot switch.
|
|
|
130
137
|
```
|
|
131
138
|
--json machine-readable output, on success and failure
|
|
132
139
|
--wait follow async work to completion
|
|
133
|
-
--timeout <seconds> ceiling on a request, and on --wait
|
|
140
|
+
--timeout <seconds> ceiling on a request (default 600), and on --wait (default 1800)
|
|
134
141
|
--out <dir> where downloads land
|
|
135
142
|
--describe <text> description for an upload
|
|
136
143
|
--enrich describe and tag each image upload
|
|
@@ -138,9 +145,14 @@ the server and cannot switch.
|
|
|
138
145
|
--workspace <id> act in this workspace, this once
|
|
139
146
|
--cloud use eversince.ai even with the desktop app here
|
|
140
147
|
--base-url <url> point at another deployment
|
|
148
|
+
--idempotency-key <k> the same key on a retry, so a charged call is not charged twice
|
|
149
|
+
--name <name> name the connection in the app
|
|
141
150
|
--debug print each request and response
|
|
142
151
|
```
|
|
143
152
|
|
|
153
|
+
`init` also takes `--agent`, `--scope`, `--cloud`, `--dry-run`, `--force`, `--no-mcp`
|
|
154
|
+
and `--no-skills`; `tools` takes `--schemas` and `--annotation`.
|
|
155
|
+
|
|
144
156
|
## Environment
|
|
145
157
|
|
|
146
158
|
```
|
|
@@ -170,19 +182,19 @@ settings as a local server, by the absolute paths of Node and the CLI, so the
|
|
|
170
182
|
work it does there is free, and replaces an eversince.ai entry of the same name.
|
|
171
183
|
The agent is the one named with `--agent` (`claude-code`, `codex`, `cursor`,
|
|
172
184
|
`vscode`, `claude-desktop` or `other`), else the one running `init`, else Claude
|
|
173
|
-
Code and Codex where they are installed.
|
|
185
|
+
Code and Codex where they are installed. Cursor and VS Code open with the connection
|
|
186
|
+
to confirm, and Claude Desktop opens the Eversince extension to install. Run `init` again after moving Node or
|
|
174
187
|
the CLI. `--cloud` sets it up on eversince.ai instead.
|
|
175
188
|
|
|
176
189
|
Without the app, `init --agent` writes only that agent's settings, in your
|
|
177
190
|
user-wide files by default (`--scope project` writes `.mcp.json` for Claude Code,
|
|
178
191
|
`.cursor/mcp.json` for Cursor and `.vscode/mcp.json` for VS Code in this folder
|
|
179
192
|
instead), and prints what to add for Codex, Claude Desktop and anything else.
|
|
180
|
-
With no agent named, `init` merges an `eversince` entry into
|
|
181
|
-
|
|
193
|
+
With no agent named, `init` merges an `eversince` entry into Claude Code's and
|
|
194
|
+
Cursor's settings and prints Codex's, backing up anything it edits and keeping settings
|
|
182
195
|
that were already there. Codex keeps its
|
|
183
196
|
servers in TOML, so that one is printed for you to paste rather than parsed.
|
|
184
197
|
|
|
185
|
-
It also installs a skill at
|
|
186
|
-
agent these commands.
|
|
187
|
-
plugin skill, which covers the MCP tools. `--no-mcp` and `--no-skills` turn either
|
|
198
|
+
It also installs a skill at `~/.claude/skills/eversince-cli/SKILL.md` (this folder
|
|
199
|
+
with `--scope project`) teaching an agent these commands. `--no-mcp` and `--no-skills` turn either
|
|
188
200
|
half off; `--dry-run` shows what would change.
|
package/dist/auth/oauth.js
CHANGED
|
@@ -83,13 +83,17 @@ function openBrowser(url) {
|
|
|
83
83
|
catch {
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
|
-
|
|
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
|
-
|
|
90
|
-
|
|
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, '&').replace(/"/g, '"').replace(/</g, '<')}">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(
|
|
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/bridge.js
CHANGED
|
@@ -14,13 +14,14 @@ function rpcError(id, message, code = -32000) {
|
|
|
14
14
|
export function runBridge(options) {
|
|
15
15
|
const file = options.stateFile ?? defaultStateFile();
|
|
16
16
|
const cacheFile = cacheFileFor(file);
|
|
17
|
-
const
|
|
17
|
+
const self = options.command ?? 'eversince';
|
|
18
|
+
const reconnect = options.reconnect ?? `Run \`${self} init --agent ${options.agent}\` to connect it again.`;
|
|
18
19
|
function connectionFor(state) {
|
|
19
20
|
const found = (state?.connections ?? []).find((c) => c && (options.connectionId ? c.id === options.connectionId : c.agent === options.agent));
|
|
20
21
|
return found && typeof found.token === 'string' ? { token: found.token } : null;
|
|
21
22
|
}
|
|
22
23
|
if (!readState(file)) {
|
|
23
|
-
process.stderr.write(
|
|
24
|
+
process.stderr.write(`eversince: the Eversince app is not set up on this computer. Install it, open it and sign in, or run \`${self} init --cloud\` to connect this agent to eversince.ai instead.\n`);
|
|
24
25
|
process.exit(1);
|
|
25
26
|
}
|
|
26
27
|
let listFromCache = null;
|
|
@@ -47,7 +48,7 @@ export function runBridge(options) {
|
|
|
47
48
|
state = await open();
|
|
48
49
|
if (!state) {
|
|
49
50
|
if (before && !existsSync(before.app))
|
|
50
|
-
throw new Error(
|
|
51
|
+
throw new Error(`The Eversince app is no longer on this computer. Run \`${self} init\` to connect this agent to eversince.ai instead.`);
|
|
51
52
|
throw new Error('The Eversince app did not open. Open it and try again.');
|
|
52
53
|
}
|
|
53
54
|
}
|
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())
|
package/dist/commands/auth.js
CHANGED
|
@@ -2,9 +2,10 @@ 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
|
+
import { probe, readState } from '../door.js';
|
|
8
9
|
import { detectHostAgent } from '../host-agent.js';
|
|
9
10
|
const KEY_PREFIX = 'es_live_';
|
|
10
11
|
async function readKeyFromInput(fromStdin) {
|
|
@@ -119,7 +120,7 @@ export async function logout(connection, mode) {
|
|
|
119
120
|
note('ES_API_KEY is still set in this environment and will keep being used.');
|
|
120
121
|
}
|
|
121
122
|
if (had?.kind === 'oauth') {
|
|
122
|
-
note('The authorisation is also revocable from Settings
|
|
123
|
+
note('The authorisation is also revocable from Settings, Agents.');
|
|
123
124
|
}
|
|
124
125
|
});
|
|
125
126
|
}
|
|
@@ -129,9 +130,13 @@ export async function status(connection, mode) {
|
|
|
129
130
|
const credentials = await loadCredentials(baseUrl);
|
|
130
131
|
const workspace = await resolveWorkspace(baseUrl, connection.workspace);
|
|
131
132
|
const fromEnv = Boolean(process.env.ES_API_KEY);
|
|
132
|
-
const
|
|
133
|
+
const installed = desktopInstalled();
|
|
134
|
+
const desktop = installed && (await mayUseDesktop(connection));
|
|
135
|
+
const record = desktop ? readState() : null;
|
|
136
|
+
const answers = !desktop ? null : record ? await probe(record).catch(() => 'closed') : 'closed';
|
|
133
137
|
const payload = {
|
|
134
|
-
desktop_app: desktop ? 'used' : 'not_installed',
|
|
138
|
+
desktop_app: desktop ? 'used' : installed ? 'not_used' : 'not_installed',
|
|
139
|
+
desktop_app_state: answers === 'ours' ? 'open' : answers,
|
|
135
140
|
signed_in: credentials !== null,
|
|
136
141
|
host,
|
|
137
142
|
base_url: baseUrl,
|
|
@@ -141,13 +146,23 @@ export async function status(connection, mode) {
|
|
|
141
146
|
expires_at: credentials?.expiresAt ? new Date(credentials.expiresAt).toISOString() : null,
|
|
142
147
|
};
|
|
143
148
|
printResult(mode, payload, () => {
|
|
144
|
-
if (desktop)
|
|
145
|
-
line(
|
|
149
|
+
if (!desktop)
|
|
150
|
+
line(`Commands run in the cloud (${host}).`);
|
|
151
|
+
else if (answers === 'ours')
|
|
152
|
+
line('Commands run through the desktop app on this computer, for free. It is open.');
|
|
153
|
+
else if (answers === 'closed')
|
|
154
|
+
line('Commands run through the desktop app on this computer, for free. It is closed; the next command opens it.');
|
|
155
|
+
else if (answers === 'blocked')
|
|
156
|
+
line('Commands go to the desktop app on this computer, but this shell cannot reach it. Allow local network access, or add --cloud.');
|
|
157
|
+
else
|
|
158
|
+
line('Commands go to the desktop app on this computer, but another program answers on its port. Restart the app, or add --cloud.');
|
|
159
|
+
const how = credentials ? (credentials.kind === 'api_key' ? 'with an API key' : 'in the browser') : '';
|
|
160
|
+
const from = fromEnv ? ', from ES_API_KEY' : '';
|
|
146
161
|
if (!credentials) {
|
|
147
|
-
line(`Not signed in to ${host}.`);
|
|
162
|
+
line(desktop ? `For --cloud: not signed in to ${host}.` : `Not signed in to ${host}.`);
|
|
148
163
|
return;
|
|
149
164
|
}
|
|
150
|
-
line(
|
|
165
|
+
line(desktop ? `For --cloud: signed in to ${host} ${how}${from}.` : `Signed in to ${host} ${how}${from}.`);
|
|
151
166
|
line(`workspace: ${workspace ?? 'account default'}`);
|
|
152
167
|
if (credentials.kind === 'oauth') {
|
|
153
168
|
line(`session renews automatically${credentials.refreshToken ? '.' : '. No refresh token, sign in again when it lapses.'}`);
|
package/dist/commands/init.js
CHANGED
|
@@ -6,7 +6,7 @@ import { discoverAuthorizationServer } from '../auth/oauth.js';
|
|
|
6
6
|
import { Client } from '../client.js';
|
|
7
7
|
import { resolveBaseUrl, hostOf } from '../config.js';
|
|
8
8
|
import { line, note, printResult } from '../output.js';
|
|
9
|
-
import {
|
|
9
|
+
import { connectThroughApp, desktopInstalled, hereCommand, openApp, stableLauncher } from '../local.js';
|
|
10
10
|
import { detectHostAgent } from '../host-agent.js';
|
|
11
11
|
export const APP_AGENTS = ['claude-code', 'codex', 'cursor', 'vscode', 'claude-desktop', 'other', 'cli'];
|
|
12
12
|
function checkAgent(given) {
|
|
@@ -16,7 +16,7 @@ function checkAgent(given) {
|
|
|
16
16
|
throw new Error(`--agent is one of ${APP_AGENTS.join(', ')}.`);
|
|
17
17
|
return given;
|
|
18
18
|
}
|
|
19
|
-
const
|
|
19
|
+
const getTheApp = () => hereCommand('With the Eversince desktop app on this computer, the same work runs free. Get it at https://eversince.ai, then run eversince init again.');
|
|
20
20
|
const SERVER_KEY = 'eversince';
|
|
21
21
|
function vscodeUserDir() {
|
|
22
22
|
const home = homedir();
|
|
@@ -67,7 +67,7 @@ function skillTargets(scope) {
|
|
|
67
67
|
return [{ agent: 'Claude Code', path: join(root, '.claude', 'skills', 'eversince-cli', 'SKILL.md') }];
|
|
68
68
|
}
|
|
69
69
|
function skillBody(mcpWhere) {
|
|
70
|
-
return `---
|
|
70
|
+
return hereCommand(`---
|
|
71
71
|
name: eversince-cli
|
|
72
72
|
description: Reach an Eversince workspace from the shell: upload local files into the library, download items onto disk, call any workspace tool, and follow generation and render to completion. Use whenever the media is on this machine, the same operation runs over many items, or the work has to continue without an agent session.
|
|
73
73
|
---
|
|
@@ -82,7 +82,7 @@ A media workspace this account can reach two ways. Prefer whichever fits the ste
|
|
|
82
82
|
eversince tools # everything this workspace can do, live
|
|
83
83
|
eversince tools <name> # one tool's input schema
|
|
84
84
|
eversince run <tool> '<json>' # call any tool; add --wait for async work
|
|
85
|
-
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)
|
|
86
86
|
eversince download <refs> --out ./dir # library items onto disk
|
|
87
87
|
eversince jobs <id> --wait # follow generation, render
|
|
88
88
|
\`\`\`
|
|
@@ -107,10 +107,10 @@ files are on this machine or the work has to outlive the session.
|
|
|
107
107
|
authoritative for one tool's arguments.
|
|
108
108
|
- With the desktop app on this machine, commands go through it and work the app
|
|
109
109
|
can do runs here, free; \`--cloud\` sends a command to eversince.ai instead.
|
|
110
|
-
- \`--workspace <id>\` picks the workspace for one command
|
|
111
|
-
|
|
112
|
-
Left off, it is the workspace
|
|
113
|
-
|
|
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.
|
|
113
|
+
`);
|
|
114
114
|
}
|
|
115
115
|
async function exists(path) {
|
|
116
116
|
try {
|
|
@@ -226,15 +226,12 @@ async function initThroughApp(argv, scope, mode) {
|
|
|
226
226
|
if (agents.length === 0) {
|
|
227
227
|
throw new Error(`Name the agent to connect with --agent: ${APP_AGENTS.join(', ')}.`);
|
|
228
228
|
}
|
|
229
|
-
if (agents.some((a) => a !== 'claude-desktop') && launchedFromTemporaryCopy()) {
|
|
230
|
-
throw new Error('This CLI is a temporary copy. Install it with `npm install -g eversince`, then run `eversince init` again.');
|
|
231
|
-
}
|
|
232
229
|
const dryRun = argv.dryRun === true;
|
|
230
|
+
const cli = await stableLauncher(dryRun);
|
|
233
231
|
const connections = [];
|
|
234
232
|
if (!dryRun) {
|
|
235
233
|
await openApp(() => { if (!mode.json)
|
|
236
234
|
note('Opening the Eversince app on this computer.'); });
|
|
237
|
-
const cli = cliLauncher();
|
|
238
235
|
for (const agent of agents)
|
|
239
236
|
connections.push(await connectThroughApp(agent, { cli, ...(name ? { name } : {}) }));
|
|
240
237
|
}
|
|
@@ -250,12 +247,14 @@ async function initThroughApp(argv, scope, mode) {
|
|
|
250
247
|
venue: 'desktop',
|
|
251
248
|
dry_run: dryRun,
|
|
252
249
|
agents,
|
|
250
|
+
runs: cli,
|
|
253
251
|
connections: connections.map(({ token: _token, ...rest }) => { void _token; return rest; }),
|
|
254
252
|
changes,
|
|
255
253
|
...(shadowed ? { shadowed_by: shadowed } : {}),
|
|
256
254
|
}, () => {
|
|
257
255
|
if (dryRun) {
|
|
258
256
|
line(`Would connect ${agents.join(', ')} through the Eversince app on this computer.`);
|
|
257
|
+
line(`The agent would run ${cli.script}`);
|
|
259
258
|
}
|
|
260
259
|
for (const c of connections) {
|
|
261
260
|
line(`Connected ${c.label} through the Eversince app on this computer. Work it does there is free.`);
|
|
@@ -337,7 +336,7 @@ export async function init(argv, connection, mode) {
|
|
|
337
336
|
}
|
|
338
337
|
}
|
|
339
338
|
}
|
|
340
|
-
printResult(mode, { venue: 'cloud', scope, mcp_url: mcpUrl, dry_run: dryRun, connected, changes, manual: skipped, ...(offerApp ? { desktop_app:
|
|
339
|
+
printResult(mode, { venue: 'cloud', scope, mcp_url: mcpUrl, dry_run: dryRun, connected, changes, manual: skipped, ...(offerApp ? { desktop_app: getTheApp() } : {}) }, () => {
|
|
341
340
|
for (const change of changes) {
|
|
342
341
|
line(`${change.action.padEnd(10)}${change.path}`);
|
|
343
342
|
if (change.backup)
|
|
@@ -361,6 +360,6 @@ export async function init(argv, connection, mode) {
|
|
|
361
360
|
line(`Connected to ${hostOf(baseUrl)}. Restart any running agent to pick it up.`);
|
|
362
361
|
note('The agent authorises its own MCP connection; it does not use the CLI credential.');
|
|
363
362
|
if (offerApp)
|
|
364
|
-
line(
|
|
363
|
+
line(getTheApp());
|
|
365
364
|
});
|
|
366
365
|
}
|
package/dist/commands/tools.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Client } from '../client.js';
|
|
2
2
|
import { line, pad, printResult } from '../output.js';
|
|
3
|
+
import { hereCommand } from '../local.js';
|
|
3
4
|
export async function tools(argv, connection, mode) {
|
|
4
5
|
const client = await Client.create(connection);
|
|
5
6
|
const wantSchemas = argv.schemas === true || Boolean(argv.name) || mode.json;
|
|
@@ -26,7 +27,7 @@ export async function tools(argv, connection, mode) {
|
|
|
26
27
|
line(JSON.stringify(tool.input_schema, null, 2));
|
|
27
28
|
}
|
|
28
29
|
line();
|
|
29
|
-
line(`eversince run ${tool.name} '{ … }'`);
|
|
30
|
+
line(hereCommand(`eversince run ${tool.name} '{ … }'`));
|
|
30
31
|
return;
|
|
31
32
|
}
|
|
32
33
|
if (data.instructions) {
|
|
@@ -39,6 +40,6 @@ export async function tools(argv, connection, mode) {
|
|
|
39
40
|
for (const tool of list)
|
|
40
41
|
line(`${pad(tool.name, width)}${tool.description}`);
|
|
41
42
|
line();
|
|
42
|
-
line(`${list.length} tools. \`eversince tools <name>\` for one in full.`);
|
|
43
|
+
line(hereCommand(`${list.length} tools. \`eversince tools <name>\` for one in full.`));
|
|
43
44
|
});
|
|
44
45
|
}
|
package/dist/commands/upload.js
CHANGED
|
@@ -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
|
|
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 =
|
|
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}/${
|
|
228
|
+
note(`[${done}/${toSend.length}] ${basename(path)}`);
|
|
182
229
|
}
|
|
183
230
|
}
|
|
184
|
-
await Promise.all(Array.from({ length: Math.min(limit,
|
|
185
|
-
const
|
|
186
|
-
const
|
|
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
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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))
|
package/dist/index.js
CHANGED
|
@@ -9,6 +9,7 @@ import { download } from './commands/download.js';
|
|
|
9
9
|
import { jobs } from './commands/jobs.js';
|
|
10
10
|
import { init, APP_AGENTS } from './commands/init.js';
|
|
11
11
|
import { runBridge } from './bridge.js';
|
|
12
|
+
import { selfCommand } from './local.js';
|
|
12
13
|
import { fail, line } from './output.js';
|
|
13
14
|
import { VERSION } from './version.js';
|
|
14
15
|
const USAGE = `eversince — your workspace, from the command line
|
|
@@ -18,7 +19,7 @@ Getting set up
|
|
|
18
19
|
eversince login --key - or with an API key from stdin (CI, no browser)
|
|
19
20
|
eversince logout
|
|
20
21
|
eversince status
|
|
21
|
-
eversince init connect the agents
|
|
22
|
+
eversince init connect the agents on this machine
|
|
22
23
|
eversince init --agent codex connect one agent (claude-code, codex,
|
|
23
24
|
cursor, vscode, claude-desktop, other,
|
|
24
25
|
or cli: this terminal, after a disconnect)
|
|
@@ -29,7 +30,8 @@ Working
|
|
|
29
30
|
eversince tools [name] what this workspace can do, live
|
|
30
31
|
eversince run <tool> '<json>' call any tool (--wait to follow async work)
|
|
31
32
|
eversince run <tool> - arguments from stdin
|
|
32
|
-
eversince upload <files|folder> local files into the library
|
|
33
|
+
eversince upload <files|folder> local files into the library (through the
|
|
34
|
+
desktop app, media is added where it sits)
|
|
33
35
|
eversince download <refs…> library items onto disk
|
|
34
36
|
eversince jobs <ids…> check async work (--wait to follow)
|
|
35
37
|
eversince jobs cancel <ids…>
|
|
@@ -38,7 +40,7 @@ Working
|
|
|
38
40
|
Options
|
|
39
41
|
--json machine-readable output, on success and failure
|
|
40
42
|
--wait follow async work to completion
|
|
41
|
-
--timeout <seconds> ceiling on a request, and on --wait
|
|
43
|
+
--timeout <seconds> ceiling on a request (default 600), and on --wait (default 1800)
|
|
42
44
|
--out <dir> where downloads land, and where a tool's pictures go
|
|
43
45
|
(a temp folder otherwise)
|
|
44
46
|
--describe <text> description for an upload
|
|
@@ -50,7 +52,8 @@ Options
|
|
|
50
52
|
--annotation <kind> with tools: only read, write or destructive tools
|
|
51
53
|
--name <agent> with login or init: the agent's name, shown in Settings
|
|
52
54
|
and on the feed (otherwise the agent whose shell this
|
|
53
|
-
is: Claude Code, Cursor or Codex; else "CLI agent"
|
|
55
|
+
is: Claude Code, Cursor or Codex; else "CLI agent", or
|
|
56
|
+
"Another client" through the app)
|
|
54
57
|
--scope <where> with init: user (default, once per machine) or project
|
|
55
58
|
(written into this folder, to commit with a repo)
|
|
56
59
|
--dry-run / --force with init: preview what would be written, or overwrite what is there
|
|
@@ -69,11 +72,12 @@ Environment
|
|
|
69
72
|
With the Eversince desktop app on this computer, commands go through it and
|
|
70
73
|
the work it does is free, and init connects agents through it rather than
|
|
71
74
|
eversince.ai. The app opens if it is closed. --cloud, --base-url, --workspace,
|
|
72
|
-
ES_API_KEY
|
|
75
|
+
ES_API_KEY, ES_BASE_URL, ES_WORKSPACE or a workspace chosen with
|
|
76
|
+
eversince workspace use keep a command on the cloud, which needs
|
|
73
77
|
eversince login.
|
|
74
78
|
|
|
75
|
-
Credentials are stored per deployment, in the
|
|
76
|
-
|
|
79
|
+
Credentials are stored per deployment, in the macOS Keychain on a Mac and a
|
|
80
|
+
0600 file elsewhere. The CLI's sign-in is its own: connecting or disconnecting an agent's MCP
|
|
77
81
|
connection leaves it alone, and signing out here leaves the agent working.
|
|
78
82
|
`;
|
|
79
83
|
function toNumber(value, name) {
|
|
@@ -183,7 +187,7 @@ async function main() {
|
|
|
183
187
|
if (!agent || !APP_AGENTS.includes(agent)) {
|
|
184
188
|
throw new Error(`eversince mcp needs --agent, one of ${APP_AGENTS.join(', ')}.`);
|
|
185
189
|
}
|
|
186
|
-
runBridge({ agent, connectionId: values.connection });
|
|
190
|
+
runBridge({ agent, connectionId: values.connection, command: selfCommand() });
|
|
187
191
|
return;
|
|
188
192
|
}
|
|
189
193
|
case 'init':
|
package/dist/local.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import { existsSync, realpathSync } from 'node:fs';
|
|
2
|
-
import {
|
|
1
|
+
import { existsSync, readFileSync, realpathSync } from 'node:fs';
|
|
2
|
+
import { cp, mkdir, rename, rm } from 'node:fs/promises';
|
|
3
|
+
import { homedir } from 'node:os';
|
|
4
|
+
import { delimiter, dirname, join, sep } from 'node:path';
|
|
3
5
|
import { fileURLToPath } from 'node:url';
|
|
4
6
|
import { DoorBlocked, probe, reachApp, readState } from './door.js';
|
|
5
7
|
import { detectHostAgent, kindForName } from './host-agent.js';
|
|
@@ -31,6 +33,52 @@ export function cliLauncher() {
|
|
|
31
33
|
export function launchedFromTemporaryCopy() {
|
|
32
34
|
return /[\\/]_npx[\\/]/.test(cliLauncher().script);
|
|
33
35
|
}
|
|
36
|
+
function keptRoot() {
|
|
37
|
+
const root = join(process.env.ES_STATE_DIR || join(homedir(), '.eversince'), 'cli');
|
|
38
|
+
try {
|
|
39
|
+
return realpathSync(root);
|
|
40
|
+
}
|
|
41
|
+
catch {
|
|
42
|
+
return root;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
function runsFromKeptCopy() {
|
|
46
|
+
return cliLauncher().script.startsWith(keptRoot() + sep);
|
|
47
|
+
}
|
|
48
|
+
export function selfCommand() {
|
|
49
|
+
return launchedFromTemporaryCopy() || runsFromKeptCopy() ? 'npx -y eversince@latest' : 'eversince';
|
|
50
|
+
}
|
|
51
|
+
export function hereCommand(text) {
|
|
52
|
+
const self = selfCommand();
|
|
53
|
+
if (self === 'eversince')
|
|
54
|
+
return text;
|
|
55
|
+
return text.replace(/(^|[^\w@/.-])eversince (?=(?:init|login|logout|status|tools|run|upload|download|jobs|workspace|mcp|help)\b)/g, `$1${self} `);
|
|
56
|
+
}
|
|
57
|
+
export async function stableLauncher(dryRun) {
|
|
58
|
+
const here = cliLauncher();
|
|
59
|
+
if (!launchedFromTemporaryCopy())
|
|
60
|
+
return here;
|
|
61
|
+
const from = dirname(dirname(here.script));
|
|
62
|
+
const version = JSON.parse(readFileSync(join(from, 'package.json'), 'utf8')).version ?? '0.0.0';
|
|
63
|
+
const to = join(keptRoot(), version);
|
|
64
|
+
const script = join(to, 'dist', 'index.js');
|
|
65
|
+
if (dryRun || existsSync(script))
|
|
66
|
+
return { node: here.node, script };
|
|
67
|
+
await mkdir(keptRoot(), { recursive: true });
|
|
68
|
+
const temp = `${to}.tmp-${process.pid}`;
|
|
69
|
+
await rm(temp, { recursive: true, force: true });
|
|
70
|
+
await cp(join(from, 'dist'), join(temp, 'dist'), { recursive: true });
|
|
71
|
+
await cp(join(from, 'package.json'), join(temp, 'package.json'));
|
|
72
|
+
try {
|
|
73
|
+
await rename(temp, to);
|
|
74
|
+
}
|
|
75
|
+
catch (error) {
|
|
76
|
+
await rm(temp, { recursive: true, force: true });
|
|
77
|
+
if (!existsSync(script))
|
|
78
|
+
throw error;
|
|
79
|
+
}
|
|
80
|
+
return { node: here.node, script };
|
|
81
|
+
}
|
|
34
82
|
export async function connectThroughApp(agent, extra = {}) {
|
|
35
83
|
const state = await reachApp();
|
|
36
84
|
if (!state?.connectKey)
|
|
@@ -42,7 +90,7 @@ export async function connectThroughApp(agent, extra = {}) {
|
|
|
42
90
|
});
|
|
43
91
|
const payload = (await res.json().catch(() => null));
|
|
44
92
|
if (!res.ok || !payload?.data) {
|
|
45
|
-
throw new Error(payload?.error?.message
|
|
93
|
+
throw new Error(payload?.error?.message ? hereCommand(payload.error.message) : `The Eversince app refused to connect ${agent} (${res.status}).`);
|
|
46
94
|
}
|
|
47
95
|
return payload.data;
|
|
48
96
|
}
|
package/dist/output.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { hereCommand } from './local.js';
|
|
1
2
|
export function printResult(mode, value, human) {
|
|
2
3
|
if (mode.json) {
|
|
3
4
|
process.stdout.write(`${JSON.stringify({ ok: true, data: value })}\n`);
|
|
@@ -15,14 +16,18 @@ export function fail(mode, error) {
|
|
|
15
16
|
const asApi = error && typeof error === 'object' && 'body' in error
|
|
16
17
|
? error
|
|
17
18
|
: null;
|
|
19
|
+
const message = hereCommand(error instanceof Error ? error.message : String(error));
|
|
20
|
+
const suggested = asApi?.body.suggested_action ? hereCommand(asApi.body.suggested_action) : undefined;
|
|
18
21
|
if (mode.json) {
|
|
19
|
-
const body = asApi?.body
|
|
22
|
+
const body = asApi?.body
|
|
23
|
+
? { ...asApi.body, ...(asApi.body.message ? { message: hereCommand(asApi.body.message) } : {}), ...(suggested ? { suggested_action: suggested } : {}) }
|
|
24
|
+
: { code: 'error', message, retryable: false, suggested_action: hereCommand('Run eversince help for the commands and options.') };
|
|
20
25
|
process.stdout.write(`${JSON.stringify({ ok: false, error: body, ...(asApi?.requestId ? { request_id: asApi.requestId } : {}) })}\n`);
|
|
21
26
|
}
|
|
22
27
|
else {
|
|
23
|
-
process.stderr.write(`${
|
|
24
|
-
if (
|
|
25
|
-
process.stderr.write(`${
|
|
28
|
+
process.stderr.write(`${message}\n`);
|
|
29
|
+
if (suggested)
|
|
30
|
+
process.stderr.write(`${suggested}\n`);
|
|
26
31
|
if (asApi?.requestId)
|
|
27
32
|
process.stderr.write(`request ${asApi.requestId}\n`);
|
|
28
33
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
5295aed56e667ec559dc7386a87e7c0ea8ac334c4d29823a61042ace137cbe79
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eversince",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.12",
|
|
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",
|