vibekit-agent 1.7.1 → 1.8.0

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
@@ -62,6 +62,7 @@ Do **not** use it if you just want VibeKit-hosted tasks or deployments. For that
62
62
  - **Document uploads** - Share files for the agent to work with
63
63
  - **Conversation memory** - The agent remembers context within a session
64
64
  - **Ask before actions** - Approve or deny each command and edit from the app or the lock screen
65
+ - **Continue a desk session** - Pick up a Claude Code session you started in the terminal on this computer from the app (1.8.0+). It is a handoff, not a mirror: reopen it at the desk with `claude --resume` to see what you did from your phone
65
66
 
66
67
  ## Commands
67
68
 
package/dist/agent.d.ts CHANGED
@@ -268,6 +268,13 @@ export declare class AgentClient {
268
268
  */
269
269
  private runCodex;
270
270
  private endCodexRun;
271
+ /**
272
+ * Send the local images a reply links to (local-images.ts) ahead of the
273
+ * reply, which iOS needs to attach them to it, and return the reply with
274
+ * each sent link reduced to its caption. The user's own attachments are
275
+ * never echoed back, the same rule as Claude's assistant image blocks.
276
+ */
277
+ private sendLinkedImages;
271
278
  /** Per-thread MCP tools. Read-only mode gets filesystem readers because its native shell is disabled. */
272
279
  private codexMcpServers;
273
280
  /** The tool list the phone is shown: the raw list for Claude, and for Codex the access actually in force. */
@@ -280,6 +287,18 @@ export declare class AgentClient {
280
287
  * Handle new conversation command - reset conversation memory
281
288
  */
282
289
  private handleNewConversation;
290
+ /**
291
+ * The Claude sessions saved for the current folder, for the phone's "Continue
292
+ * a session from this computer" list (claude-sessions.ts). Codex threads are
293
+ * not listed yet; the reply says which engine is active so the phone can say so.
294
+ */
295
+ private handleListSessions;
296
+ /**
297
+ * Point the next message at a session from this folder: the same --resume
298
+ * every message already uses, with an id the person picked. Refused while a
299
+ * run is in flight, so a turn never changes session halfway.
300
+ */
301
+ private handleResumeSession;
283
302
  /**
284
303
  * Explicit Stop from the app. Kill the in-flight Claude run (if any),
285
304
  * acknowledge to the chat so the transcript shows the stop, and flip
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B;;OAEG;IACH,OAAO,CAAC,cAAc;IAqBtB;;;;;;OAMG;IACH,OAAO,CAAC,eAAe;IAIvB,wEAAwE;IACxE,OAAO,CAAC,eAAe;IAyCvB;;OAEG;IACH,OAAO,CAAC,aAAa;IAcrB;;;;;;OAMG;IACH;;;;;OAKG;IACH,OAAO,CAAC,mBAAmB;IAO3B,OAAO,CAAC,sBAAsB;IAc9B;;OAEG;IACH,OAAO,CAAC,YAAY;IAwBpB;;OAEG;IACH,OAAO,CAAC,UAAU;IAalB;;OAEG;IACH,OAAO,CAAC,IAAI;IAiBZ;;;OAGG;IACH,OAAO,CAAC,kBAAkB;IAU1B;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAmBzB;;OAEG;IACH,OAAO,CAAC,UAAU;IAIlB;;;;;OAKG;IACH,OAAO,CAAC,eAAe;IAkBvB;;OAEG;IACH,OAAO,CAAC,QAAQ;IAuBhB;;;;;;OAMG;YACW,wBAAwB;IAkEtC;;;;;;OAMG;YACW,uBAAuB;IAkBrC,0EAA0E;IAC1E,OAAO,CAAC,sBAAsB;IAQ9B;;;;OAIG;YACW,4BAA4B;IAoB1C,uEAAuE;IACvE,OAAO,CAAC,0BAA0B;IAOlC;;;OAGG;YACW,uBAAuB;CAiBtC"}
package/dist/agent.js CHANGED
@@ -49,6 +49,8 @@ const dns = __importStar(require("dns"));
49
49
  const config_1 = require("./config");
50
50
  const codex_engine_1 = require("./codex-engine");
51
51
  const codex_translate_1 = require("./codex-translate");
52
+ const local_images_1 = require("./local-images");
53
+ const claude_sessions_1 = require("./claude-sessions");
52
54
  /**
53
55
  * The self-config tools, by the names claude allowlists them under.
54
56
  *
@@ -1861,6 +1863,12 @@ class AgentClient {
1861
1863
  case 'new_conversation':
1862
1864
  this.handleNewConversation();
1863
1865
  break;
1866
+ case 'list_sessions':
1867
+ this.handleListSessions(message.payload || {});
1868
+ break;
1869
+ case 'resume_session':
1870
+ this.handleResumeSession(message.payload || {});
1871
+ break;
1864
1872
  case 'cancel':
1865
1873
  // Explicit user Stop from iOS/Telegram. Before this existed the app's
1866
1874
  // Stop button was client-side only — the Claude run kept going on the
@@ -2143,7 +2151,8 @@ class AgentClient {
2143
2151
  if (this.currentChatId && this.currentTelegramId) {
2144
2152
  const narration = end.text.trim();
2145
2153
  if (end.status === 'completed') {
2146
- this.sendResponse(this.currentChatId, narration || this.noReplyFallback(0, end.toolCount), 'complete');
2154
+ const reply = this.sendLinkedImages(this.currentChatId, narration);
2155
+ this.sendResponse(this.currentChatId, reply || this.noReplyFallback(0, end.toolCount), 'complete');
2147
2156
  }
2148
2157
  else {
2149
2158
  // A normal `complete` reply, never `status: 'error'`: iOS rewrites the
@@ -2157,6 +2166,44 @@ class AgentClient {
2157
2166
  }
2158
2167
  this.activeRun = null;
2159
2168
  }
2169
+ /**
2170
+ * Send the local images a reply links to (local-images.ts) ahead of the
2171
+ * reply, which iOS needs to attach them to it, and return the reply with
2172
+ * each sent link reduced to its caption. The user's own attachments are
2173
+ * never echoed back, the same rule as Claude's assistant image blocks.
2174
+ */
2175
+ sendLinkedImages(chatId, text) {
2176
+ const canonicalPath = (target) => {
2177
+ try {
2178
+ return fs.realpathSync(target);
2179
+ }
2180
+ catch {
2181
+ return path.resolve(target);
2182
+ }
2183
+ };
2184
+ const attachmentsDir = canonicalPath(path.join(this.workingDirectory, '.vibekit-attachments')) + path.sep;
2185
+ const sent = new Set();
2186
+ let reply = text;
2187
+ for (const ref of (0, local_images_1.localImageRefs)(text)) {
2188
+ const imagePath = canonicalPath(ref.path);
2189
+ if (imagePath.startsWith(attachmentsDir))
2190
+ continue;
2191
+ if (!sent.has(imagePath)) {
2192
+ const image = (0, local_images_1.readImageForPhone)(ref.path);
2193
+ if (!image)
2194
+ continue;
2195
+ this.send({
2196
+ type: 'image_chunk',
2197
+ payload: { chatId, mimeType: image.mimeType, data: image.data, source: 'assistant' },
2198
+ timestamp: Date.now(),
2199
+ messageId: this.generateId(),
2200
+ });
2201
+ sent.add(imagePath);
2202
+ }
2203
+ reply = reply.replace(ref.markdown, () => ref.alt); // a function, so `$&` in a caption stays literal
2204
+ }
2205
+ return reply.trim();
2206
+ }
2160
2207
  /** Per-thread MCP tools. Read-only mode gets filesystem readers because its native shell is disabled. */
2161
2208
  codexMcpServers(codex, access, cwd) {
2162
2209
  const configScript = path.join(__dirname, 'config-mcp.js');
@@ -2233,6 +2280,59 @@ class AgentClient {
2233
2280
  this.codex?.resetThread();
2234
2281
  console.log('Conversation reset - next message will start fresh');
2235
2282
  }
2283
+ /**
2284
+ * The Claude sessions saved for the current folder, for the phone's "Continue
2285
+ * a session from this computer" list (claude-sessions.ts). Codex threads are
2286
+ * not listed yet; the reply says which engine is active so the phone can say so.
2287
+ */
2288
+ handleListSessions(payload) {
2289
+ let sessions = [];
2290
+ if (this.engine === 'claude') {
2291
+ try {
2292
+ sessions = (0, claude_sessions_1.listClaudeSessions)(this.workingDirectory);
2293
+ }
2294
+ catch (e) {
2295
+ console.log(`[Agent] Listing sessions failed: ${e?.message || e}`);
2296
+ }
2297
+ }
2298
+ this.send({
2299
+ type: 'sessions_list',
2300
+ payload: { requestId: payload.requestId, engine: this.engine, cwd: this.workingDirectory, currentSessionId: this.currentSessionId, sessions },
2301
+ timestamp: Date.now(),
2302
+ messageId: this.generateId(),
2303
+ });
2304
+ }
2305
+ /**
2306
+ * Point the next message at a session from this folder: the same --resume
2307
+ * every message already uses, with an id the person picked. Refused while a
2308
+ * run is in flight, so a turn never changes session halfway.
2309
+ */
2310
+ handleResumeSession(payload) {
2311
+ const reply = (body) => this.send({
2312
+ type: 'session_resumed',
2313
+ payload: { requestId: payload.requestId, ...body },
2314
+ timestamp: Date.now(),
2315
+ messageId: this.generateId(),
2316
+ });
2317
+ if (this.engine !== 'claude')
2318
+ return reply({ ok: false, error: 'not_claude' });
2319
+ if (this.activeRun)
2320
+ return reply({ ok: false, error: 'busy' });
2321
+ const file = (0, claude_sessions_1.claudeSessionFile)(this.workingDirectory, String(payload.sessionId || ''));
2322
+ if (!file)
2323
+ return reply({ ok: false, error: 'not_found' });
2324
+ let recent = [];
2325
+ try {
2326
+ recent = (0, claude_sessions_1.recentClaudeTurns)(file);
2327
+ }
2328
+ catch (e) {
2329
+ console.log(`[Agent] Reading the session's last turns failed: ${e?.message || e}`);
2330
+ }
2331
+ this.currentSessionId = String(payload.sessionId);
2332
+ this.hasActiveConversation = true;
2333
+ console.log(`Resumed session ${this.currentSessionId} from ${this.workingDirectory}`);
2334
+ reply({ ok: true, sessionId: this.currentSessionId, cwd: this.workingDirectory, recent });
2335
+ }
2236
2336
  /**
2237
2337
  * Explicit Stop from the app. Kill the in-flight Claude run (if any),
2238
2338
  * acknowledge to the chat so the transcript shows the stop, and flip