@kafca/agentdock 0.1.29 → 0.1.31

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.
Files changed (97) hide show
  1. package/README.md +4 -0
  2. package/dist/renderer/assets/{Badge-ngf0eCzI.js → Badge-DaHt-aUT.js} +1 -1
  3. package/dist/renderer/assets/{Chat-tCGY5odh.js → Chat-Dzeq3kiD.js} +1 -1
  4. package/dist/renderer/assets/{ChatMarkdown-vqDWgVNb.js → ChatMarkdown-B-L5Roai.js} +1 -1
  5. package/dist/renderer/assets/{Config-YsVDQmIs.js → Config-BI4LJ7Fw.js} +1 -1
  6. package/dist/renderer/assets/{CronList-DQN0T7Yc.js → CronList-Dic7pblj.js} +1 -1
  7. package/dist/renderer/assets/{Dashboard-C2O6Yxq3.js → Dashboard-C0_ATyGe.js} +2 -2
  8. package/dist/renderer/assets/{EmptyState-CTkA-fBQ.js → EmptyState-SQsG1DZP.js} +1 -1
  9. package/dist/renderer/assets/{KnowledgeDetail-DjLZDItQ.js → KnowledgeDetail-D4yUJzp7.js} +1 -1
  10. package/dist/renderer/assets/{KnowledgeHome-2NHeRZxW.js → KnowledgeHome-L0tsg-oo.js} +1 -1
  11. package/dist/renderer/assets/{Logs-CQ6j-Sct.js → Logs-C2Jdr3uQ.js} +1 -1
  12. package/dist/renderer/assets/{Modal-9g1uWJfC.js → Modal-GUH3iPXo.js} +1 -1
  13. package/dist/renderer/assets/{Page-B4mPLn6n.js → Page-m42FBy97.js} +1 -1
  14. package/dist/renderer/assets/{ProjectDetail-pBXOAeL4.js → ProjectDetail-RF_sagPO.js} +1 -1
  15. package/dist/renderer/assets/{ProjectList-B9PYfZaS.js → ProjectList-Cyr8RDK3.js} +1 -1
  16. package/dist/renderer/assets/{Select-BWFQJ2R8.js → Select-CRlDgI5s.js} +1 -1
  17. package/dist/renderer/assets/{SessionChat-fBrzJs3A.js → SessionChat-_HhzMwEO.js} +1 -1
  18. package/dist/renderer/assets/{SessionList-DjHOsk7X.js → SessionList-DNwZjGTv.js} +1 -1
  19. package/dist/renderer/assets/ThreadChat-DxBmdsAm.js +23 -0
  20. package/dist/renderer/assets/{Workspace-nfTcxlhw.js → Workspace-DFphG85O.js} +1 -1
  21. package/dist/renderer/assets/{arrow-left-CIWZ6JEB.js → arrow-left-bILMzse7.js} +1 -1
  22. package/dist/renderer/assets/{book-open-Ck6BgBhN.js → book-open-BNBWEEve.js} +1 -1
  23. package/dist/renderer/assets/{check-CtB2ZLVE.js → check-MGp5kvnb.js} +1 -1
  24. package/dist/renderer/assets/{chevron-down--8lODnN0.js → chevron-down-zsfoTlh7.js} +1 -1
  25. package/dist/renderer/assets/{circle-CKQOJcbh.js → circle-BX_xUSg-.js} +1 -1
  26. package/dist/renderer/assets/{desktop-Do2I28CT.js → desktop-CgrO_cdQ.js} +1 -1
  27. package/dist/renderer/assets/{desktop-BkMW-h5p.js → desktop-O8_6ZCVZ.js} +2 -2
  28. package/dist/renderer/assets/{funnel-CkZuFIwa.js → funnel-7442U1wq.js} +1 -1
  29. package/dist/renderer/assets/{heart-CAX_CqFQ.js → heart-B3d8bnSH.js} +1 -1
  30. package/dist/renderer/assets/{index--_L0Y77h.js → index-5YUqCvBf.js} +1 -1
  31. package/dist/renderer/assets/{index-DvAYflFj.js → index-BBaYsVjU.js} +2 -2
  32. package/dist/renderer/assets/{pencil-sIRhtchu.js → pencil-QzWgkmoH.js} +1 -1
  33. package/dist/renderer/assets/{play-CJNRbCL5.js → play-Bsc8hSI7.js} +1 -1
  34. package/dist/renderer/assets/{plug-DsFe9GBx.js → plug-CRY7sjvB.js} +1 -1
  35. package/dist/renderer/assets/{plus-KDwEI-Rs.js → plus-Dr5Ei8Ud.js} +1 -1
  36. package/dist/renderer/assets/projects-BDYSOFIJ.js +1 -0
  37. package/dist/renderer/assets/{save-C-p5r3K-.js → save-giJnp2Ki.js} +1 -1
  38. package/dist/renderer/assets/{search-BZxQJb2k.js → search-DcvHLmKs.js} +1 -1
  39. package/dist/renderer/assets/{server-BV-K022I.js → server-D_Qu8If5.js} +1 -1
  40. package/dist/renderer/assets/{session-utils-ClQTa8yS.js → session-utils-CsASahfU.js} +1 -1
  41. package/dist/renderer/assets/{sessions-B0FSCA9O.js → sessions-eMpPqp4P.js} +1 -1
  42. package/dist/renderer/assets/{shield-check-B6AjkXUd.js → shield-check-BpF0uIw-.js} +1 -1
  43. package/dist/renderer/assets/{trash-2-41Pv4qRx.js → trash-2-OJFmx3xk.js} +1 -1
  44. package/dist/renderer/assets/{user-NKKHCKm9.js → user-GL_ivaV6.js} +1 -1
  45. package/dist/renderer/assets/{wifi-off-E1ZNhLG5.js → wifi-off-CQT5VNQl.js} +1 -1
  46. package/dist/renderer/index.html +1 -1
  47. package/dist-electron/electron/agent-runtime-detector.test.js +30 -0
  48. package/dist-electron/electron/local-core-refactor.test.js +749 -44
  49. package/dist-electron/electron/plugin-kernel.test.js +81 -1
  50. package/dist-electron/electron/workspace-task-store.test.js +7 -1
  51. package/dist-electron/services/local-ai-core/src/acp/local-core-acp-backend.js +34 -4
  52. package/dist-electron/services/local-ai-core/src/acp/local-core-acp-progress.js +239 -7
  53. package/dist-electron/services/local-ai-core/src/acp/local-core-acp-session-coordinator.js +10 -6
  54. package/dist-electron/services/local-ai-core/src/acp/local-core-acp-transport.js +1 -0
  55. package/dist-electron/services/local-ai-core/src/acp/local-core-acp-turn-coordinator.js +169 -5
  56. package/dist-electron/services/local-ai-core/src/agents/claudecode/behavior.js +5 -0
  57. package/dist-electron/services/local-ai-core/src/agents/claudecode/definition.js +36 -0
  58. package/dist-electron/services/local-ai-core/src/agents/claudecode/index.js +15 -0
  59. package/dist-electron/services/local-ai-core/src/agents/codex/behavior.js +5 -0
  60. package/dist-electron/services/local-ai-core/src/agents/codex/definition.js +24 -0
  61. package/dist-electron/services/local-ai-core/src/agents/codex/index.js +15 -0
  62. package/dist-electron/services/local-ai-core/src/agents/hermes/behavior.js +29 -0
  63. package/dist-electron/services/local-ai-core/src/agents/hermes/definition.js +22 -0
  64. package/dist-electron/services/local-ai-core/src/agents/hermes/index.js +15 -0
  65. package/dist-electron/services/local-ai-core/src/agents/index.js +98 -0
  66. package/dist-electron/services/local-ai-core/src/agents/localcore-acp/behavior.js +5 -0
  67. package/dist-electron/services/local-ai-core/src/agents/localcore-acp/definition.js +14 -0
  68. package/dist-electron/services/local-ai-core/src/agents/localcore-acp/index.js +27 -0
  69. package/dist-electron/services/local-ai-core/src/agents/opencode/behavior.js +5 -0
  70. package/dist-electron/services/local-ai-core/src/agents/opencode/definition.js +18 -0
  71. package/dist-electron/services/local-ai-core/src/agents/opencode/index.js +15 -0
  72. package/dist-electron/services/local-ai-core/src/agents/opencode/launch.js +119 -0
  73. package/dist-electron/services/local-ai-core/src/agents/pi/behavior.js +5 -0
  74. package/dist-electron/services/local-ai-core/src/agents/pi/definition.js +23 -0
  75. package/dist-electron/services/local-ai-core/src/agents/pi/index.js +15 -0
  76. package/dist-electron/services/local-ai-core/src/agents/pi/launch.js +139 -0
  77. package/dist-electron/services/local-ai-core/src/agents/shared/acp-behavior.js +11 -0
  78. package/dist-electron/services/local-ai-core/src/agents/shared/agent-plugin.js +60 -0
  79. package/dist-electron/services/local-ai-core/src/agents/shared/definition.js +12 -0
  80. package/dist-electron/services/local-ai-core/src/agents/shared/launch-utils.js +122 -0
  81. package/dist-electron/services/local-ai-core/src/agents/shared/progress-replay.js +19 -0
  82. package/dist-electron/services/local-ai-core/src/agents/shared/replay-prefix.js +68 -0
  83. package/dist-electron/services/local-ai-core/src/channel/lark/local-core-lark-gateway.js +0 -2
  84. package/dist-electron/services/local-ai-core/src/channel/lark/runtime-state.js +1 -1
  85. package/dist-electron/services/local-ai-core/src/channel/weixin/local-core-weixin-gateway.js +13 -2
  86. package/dist-electron/services/local-ai-core/src/kernel/bootstrap.js +8 -7
  87. package/dist-electron/services/local-ai-core/src/plugins/builtin/agent-localcore-acp-plugin.js +9 -130
  88. package/dist-electron/services/local-ai-core/src/router/workspace-route-config.js +22 -397
  89. package/dist-electron/services/local-ai-core/src/runtime/agent-runtime-detector.js +9 -45
  90. package/dist-electron/services/local-ai-core/src/runtime/local-core-runtime-state.js +62 -1
  91. package/dist-electron/services/local-ai-core/src/runtime/runtime-detection-service.js +2 -12
  92. package/dist-electron/shared/desktop.js +3 -1
  93. package/dist-electron/src/pages/Threads/thread-chat-model.js +27 -18
  94. package/dist-electron/src/pages/Threads/thread-chat-permission.test.js +57 -18
  95. package/package.json +1 -1
  96. package/dist/renderer/assets/ThreadChat-MagPeJD0.js +0 -23
  97. package/dist/renderer/assets/projects-CJUs2vaq.js +0 -1
@@ -6,17 +6,26 @@ const local_core_acp_progress_js_1 = require("./local-core-acp-progress.js");
6
6
  const local_core_acp_permission_lifecycle_js_1 = require("./local-core-acp-permission-lifecycle.js");
7
7
  const workspace_acp_permissions_js_1 = require("./workspace-acp-permissions.js");
8
8
  const local_core_slash_commands_js_1 = require("./local-core-slash-commands.js");
9
+ const index_js_1 = require("../agents/index.js");
9
10
  class LocalCoreAcpTurnCoordinator {
10
11
  options;
11
12
  constructor(options) {
12
13
  this.options = options;
13
14
  }
15
+ closePendingThoughtSegment(session) {
16
+ const currentTurn = session.currentTurn;
17
+ if (currentTurn)
18
+ (0, local_core_acp_progress_js_1.closeThoughtSegment)(currentTurn);
19
+ }
14
20
  flushPendingToolCall(session) {
15
21
  const currentTurn = session.currentTurn;
16
22
  const currentRunId = session.currentRunId;
17
23
  if (!currentTurn || !currentRunId) {
18
24
  return;
19
25
  }
26
+ for (const toolCall of (0, local_core_acp_progress_js_1.getToolCallsInOrder)(currentTurn).filter((entry) => entry.suppressReplay)) {
27
+ (0, local_core_acp_progress_js_1.deletePendingToolCall)(currentTurn, toolCall.key);
28
+ }
20
29
  const pending = (0, local_core_acp_progress_js_1.getToolCallsInOrder)(currentTurn)
21
30
  .filter((toolCall) => !toolCall.emitted);
22
31
  if (pending.length === 0) {
@@ -95,8 +104,15 @@ class LocalCoreAcpTurnCoordinator {
95
104
  });
96
105
  return;
97
106
  }
98
- const options = (0, local_core_acp_permission_lifecycle_js_1.parsePermissionOptions)(payload.params?.options);
107
+ const currentTurn = session.currentTurn;
108
+ const behavior = (0, index_js_1.resolveAgentAcpBehavior)(currentTurn?.agentType);
109
+ const parsedOptions = (0, local_core_acp_permission_lifecycle_js_1.parsePermissionOptions)(payload.params?.options);
110
+ const options = behavior.normalizePermissionOptions?.({
111
+ options: parsedOptions,
112
+ params: payload.params,
113
+ }) || parsedOptions;
99
114
  const toolTitle = (0, workspace_acp_permissions_js_1.formatToolCallContent)(payload.params?.toolCall);
115
+ this.closePendingThoughtSegment(session);
100
116
  if ((this.options.getThreadAgentMode?.(session.threadId) || local_core_slash_commands_js_1.DEFAULT_AGENT_MODE) === 'bypassPermissions') {
101
117
  const selected = options.find((option) => option.normalizedAction === 'allow all')
102
118
  || options.find((option) => option.normalizedAction === 'allow')
@@ -172,7 +188,14 @@ class LocalCoreAcpTurnCoordinator {
172
188
  });
173
189
  }
174
190
  handleAgentNotification(session, payload) {
175
- if (session.loadReplayMode || payload.method !== 'session/update') {
191
+ if (session.loadReplayMode) {
192
+ return;
193
+ }
194
+ if (payload.method === '_claude/sdkMessage') {
195
+ this.handleClaudeSdkMessage(session, payload.params?.message);
196
+ return;
197
+ }
198
+ if (payload.method !== 'session/update') {
176
199
  return;
177
200
  }
178
201
  const update = payload.params?.update;
@@ -183,11 +206,42 @@ class LocalCoreAcpTurnCoordinator {
183
206
  }
184
207
  switch (String(update.sessionUpdate || '')) {
185
208
  case 'agent_message_chunk': {
209
+ this.closePendingThoughtSegment(session);
186
210
  this.flushPendingToolCall(session);
187
211
  if (update.content?.type !== 'text') {
188
212
  return;
189
213
  }
190
- const projection = (0, local_core_acp_progress_js_1.applyAssistantMessageChunk)(currentTurn, String(update.content.text || ''));
214
+ if (isToolScopedAssistantUpdate(update) || consumeRawAssistantProgressChunk(session, String(update.content.text || ''))) {
215
+ const content = String(update.content.text || '').trim();
216
+ if (content) {
217
+ if (this.shouldSuppressProgress(currentTurn, 'tool', content)) {
218
+ return;
219
+ }
220
+ this.options.appendMessage(session.threadId, 'assistant', content, 'progress', undefined, 'tool');
221
+ this.options.emitBridge({
222
+ type: 'reply',
223
+ sessionKey: session.bridgeSessionKey,
224
+ replyCtx: currentRunId,
225
+ bridgeKind: 'tool',
226
+ content,
227
+ });
228
+ }
229
+ return;
230
+ }
231
+ const chunk = String(update.content.text || '');
232
+ currentTurn.rawAssistantText = `${currentTurn.rawAssistantText || ''}${chunk}`;
233
+ const behavior = (0, index_js_1.resolveAgentAcpBehavior)(currentTurn.agentType);
234
+ const normalizedText = behavior.normalizeAssistantText({
235
+ rawText: currentTurn.rawAssistantText,
236
+ priorAssistantMessages: currentTurn.priorAssistantFinalMessages || [],
237
+ });
238
+ const nextChunk = normalizedText.startsWith(currentTurn.assistantText)
239
+ ? normalizedText.slice(currentTurn.assistantText.length)
240
+ : normalizedText;
241
+ if (!nextChunk) {
242
+ return;
243
+ }
244
+ const projection = (0, local_core_acp_progress_js_1.applyAssistantMessageChunk)(currentTurn, nextChunk);
191
245
  if (!projection) {
192
246
  return;
193
247
  }
@@ -202,7 +256,6 @@ class LocalCoreAcpTurnCoordinator {
202
256
  return;
203
257
  }
204
258
  case 'agent_thought_chunk': {
205
- this.flushPendingToolCall(session);
206
259
  if (update.content?.type !== 'text') {
207
260
  return;
208
261
  }
@@ -210,6 +263,10 @@ class LocalCoreAcpTurnCoordinator {
210
263
  if (!projection) {
211
264
  return;
212
265
  }
266
+ if (this.shouldSuppressProgress(currentTurn, 'thought', projection.content)) {
267
+ this.resetThoughtSegment(currentTurn);
268
+ return;
269
+ }
213
270
  if (this.options.upsertMessage) {
214
271
  this.options.upsertMessage(session.threadId, projection.messageId, 'assistant', projection.content, 'progress', undefined, projection.bridgeKind);
215
272
  }
@@ -224,11 +281,23 @@ class LocalCoreAcpTurnCoordinator {
224
281
  return;
225
282
  }
226
283
  case 'tool_call': {
284
+ this.closePendingThoughtSegment(session);
227
285
  const toolCall = (0, local_core_acp_progress_js_1.registerPendingToolCall)({ currentTurn, runId: currentRunId, update });
286
+ if (this.isKnownPriorToolInput(currentTurn, toolCall.title, toolCall.input)) {
287
+ toolCall.suppressReplay = true;
288
+ }
289
+ else {
290
+ (0, local_core_acp_progress_js_1.recordToolObservation)(currentTurn, {
291
+ name: toolCall.title,
292
+ title: toolCall.title,
293
+ input: toolCall.input,
294
+ });
295
+ }
228
296
  (0, local_core_acp_progress_js_1.syncLegacyPendingToolCall)(currentTurn, toolCall);
229
297
  return;
230
298
  }
231
299
  case 'tool_call_update': {
300
+ this.closePendingThoughtSegment(session);
232
301
  const title = String(update.title || 'Tool update').trim();
233
302
  const status = String(update.status || '').trim();
234
303
  const content = (0, local_core_acp_progress_js_1.extractToolUpdateContent)(update.content);
@@ -280,11 +349,23 @@ class LocalCoreAcpTurnCoordinator {
280
349
  detail: displayTitle,
281
350
  content,
282
351
  });
283
- this.emitProgress(session, currentRunId, (0, local_core_acp_progress_js_1.formatToolProgressMessage)({ toolName, title: displayTitle, status, content }), messageId, toolCallPayload);
352
+ const progressContent = (0, local_core_acp_progress_js_1.formatToolProgressMessage)({ toolName, title: displayTitle, status, content });
353
+ const suppressProgress = Boolean(toolCall?.suppressReplay) || this.shouldSuppressProgress(currentTurn, 'tool', progressContent);
354
+ if (!suppressProgress) {
355
+ (0, local_core_acp_progress_js_1.recordToolObservation)(currentTurn, {
356
+ name: toolName || displayTitle || title,
357
+ title: displayTitle || title,
358
+ status,
359
+ input: updateInput === undefined ? toolCall?.input : updateInput,
360
+ outputText: content,
361
+ });
362
+ this.emitProgress(session, currentRunId, progressContent, messageId, toolCallPayload);
363
+ }
284
364
  (0, local_core_acp_progress_js_1.syncLegacyPendingToolCall)(currentTurn, (0, local_core_acp_progress_js_1.resolveFallbackToolCall)(currentTurn));
285
365
  return;
286
366
  }
287
367
  case 'plan': {
368
+ this.closePendingThoughtSegment(session);
288
369
  this.flushPendingToolCall(session);
289
370
  const entries = Array.isArray(update.entries) ? update.entries : [];
290
371
  if (entries.length === 0) {
@@ -294,6 +375,9 @@ class LocalCoreAcpTurnCoordinator {
294
375
  if (!content) {
295
376
  return;
296
377
  }
378
+ if (this.shouldSuppressProgress(currentTurn, 'plan', content)) {
379
+ return;
380
+ }
297
381
  this.options.appendMessage(session.threadId, 'assistant', content, 'progress', undefined, 'plan');
298
382
  this.options.emitBridge({
299
383
  type: 'reply',
@@ -308,6 +392,19 @@ class LocalCoreAcpTurnCoordinator {
308
392
  return;
309
393
  }
310
394
  }
395
+ handleClaudeSdkMessage(session, message) {
396
+ if (!session.currentTurn || message?.type !== 'system' || message?.subtype !== 'local_command_output') {
397
+ return;
398
+ }
399
+ const content = typeof message.content === 'string' ? message.content : '';
400
+ if (!content) {
401
+ return;
402
+ }
403
+ session.pendingRawAssistantProgressChunks = [
404
+ ...(session.pendingRawAssistantProgressChunks || []),
405
+ content,
406
+ ];
407
+ }
311
408
  emitProgress(session, currentRunId, content, messageId, toolCall) {
312
409
  if (messageId && this.options.upsertMessage) {
313
410
  this.options.upsertMessage(session.threadId, messageId, 'assistant', content, 'progress', toolCall, toolCall ? 'tool' : undefined);
@@ -325,8 +422,75 @@ class LocalCoreAcpTurnCoordinator {
325
422
  toolCall,
326
423
  });
327
424
  }
425
+ shouldSuppressProgress(currentTurn, kind, content) {
426
+ const behavior = (0, index_js_1.resolveAgentAcpBehavior)(currentTurn.agentType);
427
+ return behavior.shouldSuppressProgress?.({
428
+ kind,
429
+ content,
430
+ priorProgressMessages: currentTurn.priorAssistantProgressMessages || [],
431
+ }) || false;
432
+ }
433
+ resetThoughtSegment(currentTurn) {
434
+ const runId = currentTurn.runId || 'thought';
435
+ const nextSequence = (currentTurn.thoughtSequence || 1) + 1;
436
+ currentTurn.thoughtSequence = nextSequence;
437
+ currentTurn.thoughtText = '';
438
+ currentTurn.thoughtPreviewStarted = false;
439
+ currentTurn.thoughtMessageId = `${runId}-thought-${nextSequence}`;
440
+ currentTurn.thoughtPreviewHandle = `${runId}-thought-preview-${nextSequence}`;
441
+ }
442
+ isKnownPriorToolInput(currentTurn, title, input) {
443
+ const compactInput = compactToolInput(input);
444
+ if (!compactInput) {
445
+ return false;
446
+ }
447
+ const needle = `${title}: ${compactInput}`.trim();
448
+ return (currentTurn.priorAssistantProgressMessages || []).some((message) => message.kind === 'tool' && message.content.includes(needle));
449
+ }
328
450
  }
329
451
  exports.LocalCoreAcpTurnCoordinator = LocalCoreAcpTurnCoordinator;
452
+ function compactToolInput(input) {
453
+ if (input === undefined || input === null) {
454
+ return '';
455
+ }
456
+ if (typeof input === 'string') {
457
+ return input.trim();
458
+ }
459
+ if (typeof input !== 'object') {
460
+ return String(input).trim();
461
+ }
462
+ const command = input.command;
463
+ if (typeof command === 'string' && command.trim()) {
464
+ return command.trim();
465
+ }
466
+ const path = input.path;
467
+ if (typeof path === 'string' && path.trim()) {
468
+ return path.trim();
469
+ }
470
+ return '';
471
+ }
472
+ function isToolScopedAssistantUpdate(update) {
473
+ const meta = update._meta;
474
+ if (!meta || typeof meta !== 'object') {
475
+ return false;
476
+ }
477
+ const claudeCode = meta.claudeCode;
478
+ if (!claudeCode || typeof claudeCode !== 'object') {
479
+ return false;
480
+ }
481
+ const parentToolUseId = claudeCode.parentToolUseId;
482
+ return typeof parentToolUseId === 'string' && parentToolUseId.trim().length > 0;
483
+ }
484
+ function consumeRawAssistantProgressChunk(session, text) {
485
+ const pending = session.pendingRawAssistantProgressChunks || [];
486
+ const index = pending.findIndex((candidate) => candidate === text);
487
+ if (index < 0) {
488
+ return false;
489
+ }
490
+ pending.splice(index, 1);
491
+ session.pendingRawAssistantProgressChunks = pending;
492
+ return true;
493
+ }
330
494
  function createToolCallPayload(input) {
331
495
  const status = input.status.trim() || 'running';
332
496
  return {
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.claudeCodeAcpBehavior = void 0;
4
+ const acp_behavior_js_1 = require("../shared/acp-behavior.js");
5
+ exports.claudeCodeAcpBehavior = acp_behavior_js_1.standardAcpBehavior;
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.claudeCodeAgentDefinition = void 0;
4
+ const desktop_js_1 = require("../../../../../shared/desktop.js");
5
+ const launch_utils_js_1 = require("../shared/launch-utils.js");
6
+ const behavior_js_1 = require("./behavior.js");
7
+ exports.claudeCodeAgentDefinition = {
8
+ agentType: 'claudecode',
9
+ displayName: 'Claude Code',
10
+ behavior: behavior_js_1.claudeCodeAcpBehavior,
11
+ detection: {
12
+ commandCandidates: ['claude-agent-acp', 'claude'],
13
+ versionArgs: ['--version'],
14
+ bundledRuntimes: [
15
+ {
16
+ packageName: desktop_js_1.DESKTOP_CLAUDECODE_ACP_PACKAGE,
17
+ candidates: [
18
+ 'dist/cli.js',
19
+ 'bin/claude-agent-acp.js',
20
+ 'cli.js',
21
+ ],
22
+ },
23
+ ],
24
+ },
25
+ buildLaunchConfig(input) {
26
+ const bundled = (0, launch_utils_js_1.resolveBundledAcpCommand)(desktop_js_1.DESKTOP_CLAUDECODE_ACP_PACKAGE, 'claude-agent-acp');
27
+ return {
28
+ ...bundled,
29
+ env: input.model
30
+ ? {
31
+ ANTHROPIC_MODEL: input.model,
32
+ }
33
+ : {},
34
+ };
35
+ },
36
+ };
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.claudeCodeAgentDefinition = exports.claudeCodeAcpBehavior = void 0;
4
+ exports.createBuiltinClaudeCodeAgentPlugin = createBuiltinClaudeCodeAgentPlugin;
5
+ const agent_plugin_js_1 = require("../shared/agent-plugin.js");
6
+ const behavior_js_1 = require("./behavior.js");
7
+ Object.defineProperty(exports, "claudeCodeAcpBehavior", { enumerable: true, get: function () { return behavior_js_1.claudeCodeAcpBehavior; } });
8
+ const definition_js_1 = require("./definition.js");
9
+ Object.defineProperty(exports, "claudeCodeAgentDefinition", { enumerable: true, get: function () { return definition_js_1.claudeCodeAgentDefinition; } });
10
+ function createBuiltinClaudeCodeAgentPlugin() {
11
+ return (0, agent_plugin_js_1.createBuiltinAgentPlugin)({
12
+ definition: definition_js_1.claudeCodeAgentDefinition,
13
+ match: (normalizedAgentType) => normalizedAgentType === 'claudecode',
14
+ });
15
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.codexAcpBehavior = void 0;
4
+ const acp_behavior_js_1 = require("../shared/acp-behavior.js");
5
+ exports.codexAcpBehavior = acp_behavior_js_1.standardAcpBehavior;
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.codexAgentDefinition = void 0;
4
+ const desktop_js_1 = require("../../../../../shared/desktop.js");
5
+ const launch_utils_js_1 = require("../shared/launch-utils.js");
6
+ const behavior_js_1 = require("./behavior.js");
7
+ exports.codexAgentDefinition = {
8
+ agentType: 'codex',
9
+ displayName: 'Codex',
10
+ behavior: behavior_js_1.codexAcpBehavior,
11
+ detection: {
12
+ commandCandidates: ['codex-acp', 'codex'],
13
+ versionArgs: ['--version'],
14
+ bundledRuntimes: [
15
+ {
16
+ packageName: desktop_js_1.DESKTOP_CODEX_ACP_PACKAGE,
17
+ candidates: ['bin/codex-acp.js'],
18
+ },
19
+ ],
20
+ },
21
+ buildLaunchConfig() {
22
+ return (0, launch_utils_js_1.resolveBundledAcpCommand)(desktop_js_1.DESKTOP_CODEX_ACP_PACKAGE, 'codex-acp');
23
+ },
24
+ };
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.codexAgentDefinition = exports.codexAcpBehavior = void 0;
4
+ exports.createBuiltinCodexAgentPlugin = createBuiltinCodexAgentPlugin;
5
+ const agent_plugin_js_1 = require("../shared/agent-plugin.js");
6
+ const behavior_js_1 = require("./behavior.js");
7
+ Object.defineProperty(exports, "codexAcpBehavior", { enumerable: true, get: function () { return behavior_js_1.codexAcpBehavior; } });
8
+ const definition_js_1 = require("./definition.js");
9
+ Object.defineProperty(exports, "codexAgentDefinition", { enumerable: true, get: function () { return definition_js_1.codexAgentDefinition; } });
10
+ function createBuiltinCodexAgentPlugin() {
11
+ return (0, agent_plugin_js_1.createBuiltinAgentPlugin)({
12
+ definition: definition_js_1.codexAgentDefinition,
13
+ match: (normalizedAgentType) => normalizedAgentType === 'codex',
14
+ });
15
+ }
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.hermesAcpBehavior = void 0;
4
+ const progress_replay_js_1 = require("../shared/progress-replay.js");
5
+ const replay_prefix_js_1 = require("../shared/replay-prefix.js");
6
+ function allowsPermanentPermission(params) {
7
+ if (!params || typeof params !== 'object') {
8
+ return true;
9
+ }
10
+ const record = params;
11
+ return record.allow_permanent !== false && record.allowPermanent !== false;
12
+ }
13
+ exports.hermesAcpBehavior = {
14
+ normalizeAssistantText(input) {
15
+ return (0, replay_prefix_js_1.stripAssistantReplayPrefix)(input.rawText, input.priorAssistantMessages);
16
+ },
17
+ normalizeFinalAssistantText(input) {
18
+ return (0, replay_prefix_js_1.stripAssistantReplayPrefix)(input.rawText, input.priorAssistantMessages);
19
+ },
20
+ shouldSuppressProgress(input) {
21
+ return (0, progress_replay_js_1.hasPriorProgressMessage)(input);
22
+ },
23
+ normalizePermissionOptions(input) {
24
+ if (allowsPermanentPermission(input.params)) {
25
+ return input.options;
26
+ }
27
+ return input.options.filter((option) => option.normalizedAction !== 'allow all');
28
+ },
29
+ };
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.hermesAgentDefinition = void 0;
4
+ const behavior_js_1 = require("./behavior.js");
5
+ exports.hermesAgentDefinition = {
6
+ agentType: 'hermes',
7
+ displayName: 'Hermes',
8
+ behavior: behavior_js_1.hermesAcpBehavior,
9
+ detection: {
10
+ commandCandidates: ['hermes'],
11
+ versionArgs: ['--version'],
12
+ },
13
+ buildLaunchConfig() {
14
+ return {
15
+ command: 'hermes',
16
+ args: ['acp'],
17
+ env: {
18
+ HERMES_YOLO_MODE: '1',
19
+ },
20
+ };
21
+ },
22
+ };
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.hermesAgentDefinition = exports.hermesAcpBehavior = void 0;
4
+ exports.createBuiltinHermesAgentPlugin = createBuiltinHermesAgentPlugin;
5
+ const agent_plugin_js_1 = require("../shared/agent-plugin.js");
6
+ const behavior_js_1 = require("./behavior.js");
7
+ Object.defineProperty(exports, "hermesAcpBehavior", { enumerable: true, get: function () { return behavior_js_1.hermesAcpBehavior; } });
8
+ const definition_js_1 = require("./definition.js");
9
+ Object.defineProperty(exports, "hermesAgentDefinition", { enumerable: true, get: function () { return definition_js_1.hermesAgentDefinition; } });
10
+ function createBuiltinHermesAgentPlugin() {
11
+ return (0, agent_plugin_js_1.createBuiltinAgentPlugin)({
12
+ definition: definition_js_1.hermesAgentDefinition,
13
+ match: (normalizedAgentType) => normalizedAgentType === 'hermes',
14
+ });
15
+ }
@@ -0,0 +1,98 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createBuiltinPiAgentPlugin = exports.createBuiltinOpencodeAgentPlugin = exports.createBuiltinLocalCoreAcpAgentPlugin = exports.createBuiltinHermesAgentPlugin = exports.createBuiltinClaudeCodeAgentPlugin = exports.createBuiltinCodexAgentPlugin = void 0;
4
+ exports.getAgentRuntimeDefinitions = getAgentRuntimeDefinitions;
5
+ exports.getStaticAgentRuntimeDefinitions = getStaticAgentRuntimeDefinitions;
6
+ exports.resolveAgentRuntimeDefinition = resolveAgentRuntimeDefinition;
7
+ exports.resolveAgentAcpBehavior = resolveAgentAcpBehavior;
8
+ exports.createBuiltinStaticAgentCapabilityPlugin = createBuiltinStaticAgentCapabilityPlugin;
9
+ const acp_behavior_js_1 = require("./shared/acp-behavior.js");
10
+ const definition_js_1 = require("./shared/definition.js");
11
+ const index_js_1 = require("./codex/index.js");
12
+ const index_js_2 = require("./claudecode/index.js");
13
+ const index_js_3 = require("./hermes/index.js");
14
+ const index_js_4 = require("./localcore-acp/index.js");
15
+ const index_js_5 = require("./opencode/index.js");
16
+ const index_js_6 = require("./pi/index.js");
17
+ const STATIC_AGENT_DEFINITIONS = [
18
+ {
19
+ agentType: 'cursor',
20
+ displayName: 'Cursor',
21
+ behavior: acp_behavior_js_1.standardAcpBehavior,
22
+ detection: { commandCandidates: ['cursor-agent', 'cursor'], versionArgs: ['--version'] },
23
+ },
24
+ {
25
+ agentType: 'gemini',
26
+ displayName: 'Gemini',
27
+ behavior: acp_behavior_js_1.standardAcpBehavior,
28
+ detection: { commandCandidates: ['gemini'], versionArgs: ['--version'] },
29
+ },
30
+ {
31
+ agentType: 'qoder',
32
+ displayName: 'Qoder',
33
+ behavior: acp_behavior_js_1.standardAcpBehavior,
34
+ detection: { commandCandidates: ['qoder'], versionArgs: ['--version'] },
35
+ },
36
+ {
37
+ agentType: 'iflow',
38
+ displayName: 'iFlow',
39
+ behavior: acp_behavior_js_1.standardAcpBehavior,
40
+ detection: { commandCandidates: ['iflow'], versionArgs: ['--version'] },
41
+ },
42
+ ];
43
+ const AGENT_RUNTIME_DEFINITIONS = [
44
+ index_js_6.piAgentDefinition,
45
+ index_js_5.opencodeAgentDefinition,
46
+ index_js_1.codexAgentDefinition,
47
+ index_js_2.claudeCodeAgentDefinition,
48
+ index_js_3.hermesAgentDefinition,
49
+ index_js_4.localCoreAcpAgentDefinition,
50
+ ...STATIC_AGENT_DEFINITIONS,
51
+ ];
52
+ const AGENT_RUNTIME_DEFINITIONS_BY_TYPE = new Map(AGENT_RUNTIME_DEFINITIONS.map((definition) => [definition.agentType, definition]));
53
+ function getAgentRuntimeDefinitions() {
54
+ return [...AGENT_RUNTIME_DEFINITIONS];
55
+ }
56
+ function getStaticAgentRuntimeDefinitions() {
57
+ return [...STATIC_AGENT_DEFINITIONS];
58
+ }
59
+ function resolveAgentRuntimeDefinition(agentType) {
60
+ const normalized = (0, definition_js_1.normalizeAgentType)(agentType);
61
+ return AGENT_RUNTIME_DEFINITIONS_BY_TYPE.get(normalized)
62
+ || AGENT_RUNTIME_DEFINITIONS.find((definition) => (0, definition_js_1.agentDefinitionMatches)(definition, normalized))
63
+ || null;
64
+ }
65
+ function resolveAgentAcpBehavior(agentType) {
66
+ return resolveAgentRuntimeDefinition(agentType)?.behavior || acp_behavior_js_1.standardAcpBehavior;
67
+ }
68
+ function createBuiltinStaticAgentCapabilityPlugin(agentType, displayName = agentType) {
69
+ return {
70
+ manifest: {
71
+ id: `builtin.agent-${agentType}`,
72
+ kind: 'agent',
73
+ version: '0.1.0',
74
+ provides: [`agent:${agentType}`],
75
+ },
76
+ capabilities: {
77
+ agents: [
78
+ {
79
+ id: `agent.${agentType}`,
80
+ agentType,
81
+ displayName,
82
+ },
83
+ ],
84
+ },
85
+ };
86
+ }
87
+ var index_js_7 = require("./codex/index.js");
88
+ Object.defineProperty(exports, "createBuiltinCodexAgentPlugin", { enumerable: true, get: function () { return index_js_7.createBuiltinCodexAgentPlugin; } });
89
+ var index_js_8 = require("./claudecode/index.js");
90
+ Object.defineProperty(exports, "createBuiltinClaudeCodeAgentPlugin", { enumerable: true, get: function () { return index_js_8.createBuiltinClaudeCodeAgentPlugin; } });
91
+ var index_js_9 = require("./hermes/index.js");
92
+ Object.defineProperty(exports, "createBuiltinHermesAgentPlugin", { enumerable: true, get: function () { return index_js_9.createBuiltinHermesAgentPlugin; } });
93
+ var index_js_10 = require("./localcore-acp/index.js");
94
+ Object.defineProperty(exports, "createBuiltinLocalCoreAcpAgentPlugin", { enumerable: true, get: function () { return index_js_10.createBuiltinLocalCoreAcpAgentPlugin; } });
95
+ var index_js_11 = require("./opencode/index.js");
96
+ Object.defineProperty(exports, "createBuiltinOpencodeAgentPlugin", { enumerable: true, get: function () { return index_js_11.createBuiltinOpencodeAgentPlugin; } });
97
+ var index_js_12 = require("./pi/index.js");
98
+ Object.defineProperty(exports, "createBuiltinPiAgentPlugin", { enumerable: true, get: function () { return index_js_12.createBuiltinPiAgentPlugin; } });
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.localCoreAcpBehavior = void 0;
4
+ const acp_behavior_js_1 = require("../shared/acp-behavior.js");
5
+ exports.localCoreAcpBehavior = acp_behavior_js_1.standardAcpBehavior;
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.localCoreAcpAgentDefinition = void 0;
4
+ const desktop_js_1 = require("../../../../../shared/desktop.js");
5
+ const behavior_js_1 = require("./behavior.js");
6
+ exports.localCoreAcpAgentDefinition = {
7
+ agentType: desktop_js_1.LOCALCORE_ACP_AGENT_TYPE,
8
+ aliases: ['acp', ''],
9
+ displayName: 'LocalCore ACP',
10
+ behavior: behavior_js_1.localCoreAcpBehavior,
11
+ detection: {
12
+ builtin: true,
13
+ },
14
+ };
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.localCoreAcpAgentDefinition = exports.localCoreAcpBehavior = void 0;
4
+ exports.createBuiltinLocalCoreAcpAgentPlugin = createBuiltinLocalCoreAcpAgentPlugin;
5
+ const desktop_js_1 = require("../../../../../shared/desktop.js");
6
+ const agent_plugin_js_1 = require("../shared/agent-plugin.js");
7
+ const behavior_js_1 = require("./behavior.js");
8
+ Object.defineProperty(exports, "localCoreAcpBehavior", { enumerable: true, get: function () { return behavior_js_1.localCoreAcpBehavior; } });
9
+ const definition_js_1 = require("./definition.js");
10
+ Object.defineProperty(exports, "localCoreAcpAgentDefinition", { enumerable: true, get: function () { return definition_js_1.localCoreAcpAgentDefinition; } });
11
+ function createBuiltinLocalCoreAcpAgentPlugin() {
12
+ const plugin = (0, agent_plugin_js_1.createBuiltinAgentPlugin)({
13
+ definition: definition_js_1.localCoreAcpAgentDefinition,
14
+ match: (normalizedAgentType) => !normalizedAgentType || normalizedAgentType === 'acp' || normalizedAgentType === desktop_js_1.LOCALCORE_ACP_AGENT_TYPE,
15
+ });
16
+ plugin.capabilities = {
17
+ ...plugin.capabilities,
18
+ channels: [
19
+ {
20
+ id: `channel.${desktop_js_1.LOCALCORE_ACP_AGENT_TYPE}`,
21
+ platform: desktop_js_1.LOCALCORE_ACP_AGENT_TYPE,
22
+ displayName: 'LocalCore ACP',
23
+ },
24
+ ],
25
+ };
26
+ return plugin;
27
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.opencodeAcpBehavior = void 0;
4
+ const acp_behavior_js_1 = require("../shared/acp-behavior.js");
5
+ exports.opencodeAcpBehavior = acp_behavior_js_1.standardAcpBehavior;
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.opencodeAgentDefinition = void 0;
4
+ const behavior_js_1 = require("./behavior.js");
5
+ const launch_js_1 = require("./launch.js");
6
+ exports.opencodeAgentDefinition = {
7
+ agentType: 'opencode',
8
+ displayName: 'OpenCode',
9
+ behavior: behavior_js_1.opencodeAcpBehavior,
10
+ detection: {
11
+ commandCandidates: ['opencode'],
12
+ versionArgs: ['--version'],
13
+ },
14
+ resolveModel: launch_js_1.resolveOpencodeModel,
15
+ buildLaunchConfig(input) {
16
+ return (0, launch_js_1.buildOpencodeLaunchConfig)(input.model, input.providers);
17
+ },
18
+ };
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.opencodeAgentDefinition = exports.opencodeAcpBehavior = void 0;
4
+ exports.createBuiltinOpencodeAgentPlugin = createBuiltinOpencodeAgentPlugin;
5
+ const agent_plugin_js_1 = require("../shared/agent-plugin.js");
6
+ const behavior_js_1 = require("./behavior.js");
7
+ Object.defineProperty(exports, "opencodeAcpBehavior", { enumerable: true, get: function () { return behavior_js_1.opencodeAcpBehavior; } });
8
+ const definition_js_1 = require("./definition.js");
9
+ Object.defineProperty(exports, "opencodeAgentDefinition", { enumerable: true, get: function () { return definition_js_1.opencodeAgentDefinition; } });
10
+ function createBuiltinOpencodeAgentPlugin() {
11
+ return (0, agent_plugin_js_1.createBuiltinAgentPlugin)({
12
+ definition: definition_js_1.opencodeAgentDefinition,
13
+ match: (normalizedAgentType) => normalizedAgentType === 'opencode',
14
+ });
15
+ }