@almyty/acp-server 1.0.11 → 1.0.13

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/agent.js CHANGED
@@ -260,7 +260,6 @@ export class AlmytyAcpAgent {
260
260
  if (event.event === 'execution.error' || event.event === 'run.error') {
261
261
  return {
262
262
  stopReason: 'end_turn',
263
- content: [{ type: 'text', text: collectedText.join('') || 'Execution failed.' }],
264
263
  };
265
264
  }
266
265
  }
@@ -281,14 +280,12 @@ export class AlmytyAcpAgent {
281
280
  });
282
281
  return {
283
282
  stopReason: 'end_turn',
284
- content: [{ type: 'text', text }],
285
283
  };
286
284
  }
287
285
  catch (invokeErr) {
288
286
  const errMsg = invokeErr instanceof Error ? invokeErr.message : String(invokeErr);
289
287
  return {
290
288
  stopReason: 'end_turn',
291
- content: [{ type: 'text', text: `Error: ${errMsg}` }],
292
289
  };
293
290
  }
294
291
  }
@@ -313,11 +310,11 @@ export class AlmytyAcpAgent {
313
310
  run = await this.proxy.sendRunInput(session.agentId, session.activeRunId, { message: input });
314
311
  }
315
312
  else {
316
- // Start a new run
317
- run = await this.proxy.startRun(session.agentId, { message: input });
313
+ // Start a new run, reusing the session's conversation for history
314
+ run = await this.proxy.startRun(session.agentId, { message: input }, session.conversationId);
318
315
  this.sessions.update(session.id, {
319
316
  activeRunId: run.id,
320
- conversationId: run.conversationId,
317
+ conversationId: run.conversationId || session.conversationId,
321
318
  });
322
319
  }
323
320
  process.stderr.write(`[acp] Run started: ${run.id} (status: ${run.status})\n`);
@@ -420,7 +417,6 @@ export class AlmytyAcpAgent {
420
417
  const errMsg = err instanceof Error ? err.message : String(err);
421
418
  return {
422
419
  stopReason: 'end_turn',
423
- content: [{ type: 'text', text: `Error: ${errMsg}` }],
424
420
  };
425
421
  }
426
422
  }
package/dist/proxy.d.ts CHANGED
@@ -50,7 +50,7 @@ export declare class AlmytyProxy {
50
50
  * iterator; aborting the signal will terminate the stream.
51
51
  */
52
52
  streamAgent(id: string, input: Record<string, unknown>, signal?: AbortSignal): AsyncGenerator<StreamEvent>;
53
- startRun(id: string, input: Record<string, unknown>): Promise<AgentRun>;
53
+ startRun(id: string, input: Record<string, unknown>, conversationId?: string): Promise<AgentRun>;
54
54
  getRun(agentId: string, runId: string): Promise<AgentRun>;
55
55
  sendRunInput(agentId: string, runId: string, input: Record<string, unknown>): Promise<AgentRun>;
56
56
  cancelRun(agentId: string, runId: string): Promise<void>;
package/dist/proxy.js CHANGED
@@ -40,8 +40,11 @@ export class AlmytyProxy {
40
40
  yield* this.ssePost(`/agents/${encodeURIComponent(id)}/stream`, input, signal);
41
41
  }
42
42
  // ── Autonomous run management ──────────────────────────────────
43
- async startRun(id, input) {
44
- const data = await this.post(`/agents/${encodeURIComponent(id)}/runs`, { input }, INVOKE_TIMEOUT_MS);
43
+ async startRun(id, input, conversationId) {
44
+ const body = { input };
45
+ if (conversationId)
46
+ body.conversationId = conversationId;
47
+ const data = await this.post(`/agents/${encodeURIComponent(id)}/runs`, body, INVOKE_TIMEOUT_MS);
45
48
  return data?.data || data;
46
49
  }
47
50
  async getRun(agentId, runId) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@almyty/acp-server",
3
- "version": "1.0.11",
3
+ "version": "1.0.13",
4
4
  "description": "ACP agent server for almyty — expose any almyty agent via the Agent Client Protocol",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",