@adhdev/daemon-core 0.9.76-rc.7 → 0.9.76-rc.70

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 (65) hide show
  1. package/dist/cli-adapters/provider-cli-adapter.d.ts +5 -2
  2. package/dist/cli-adapters/provider-cli-runtime.d.ts +1 -0
  3. package/dist/cli-adapters/provider-cli-shared.d.ts +24 -0
  4. package/dist/commands/chat-commands.d.ts +2 -0
  5. package/dist/commands/cli-manager.d.ts +17 -4
  6. package/dist/commands/mesh-coordinator.d.ts +2 -0
  7. package/dist/commands/router.d.ts +11 -0
  8. package/dist/config/mesh-config.d.ts +3 -0
  9. package/dist/git/git-types.d.ts +1 -1
  10. package/dist/git/git-worktree.d.ts +64 -0
  11. package/dist/git/index.d.ts +2 -0
  12. package/dist/index.d.ts +4 -4
  13. package/dist/index.js +2442 -575
  14. package/dist/index.js.map +1 -1
  15. package/dist/index.mjs +2446 -597
  16. package/dist/index.mjs.map +1 -1
  17. package/dist/mesh/coordinator-prompt.d.ts +1 -0
  18. package/dist/mesh/mesh-events.d.ts +18 -0
  19. package/dist/providers/chat-message-normalization.d.ts +40 -0
  20. package/dist/providers/cli-provider-instance.d.ts +7 -1
  21. package/dist/providers/contracts.d.ts +20 -1
  22. package/dist/providers/io-contracts.d.ts +17 -1
  23. package/dist/providers/provider-input-support.d.ts +18 -2
  24. package/dist/providers/provider-instance-manager.d.ts +1 -0
  25. package/dist/providers/provider-instance.d.ts +4 -0
  26. package/dist/repo-mesh-types.d.ts +34 -0
  27. package/dist/session-host/runtime-support.d.ts +2 -1
  28. package/dist/shared-types.d.ts +8 -0
  29. package/dist/types.d.ts +9 -0
  30. package/package.json +4 -5
  31. package/src/chat/subscription-updates.ts +3 -1
  32. package/src/cli-adapters/provider-cli-adapter.ts +46 -14
  33. package/src/cli-adapters/provider-cli-runtime.ts +3 -2
  34. package/src/cli-adapters/provider-cli-shared.ts +201 -15
  35. package/src/commands/chat-commands.ts +166 -16
  36. package/src/commands/cli-manager.ts +78 -5
  37. package/src/commands/handler.ts +13 -4
  38. package/src/commands/mesh-coordinator.ts +155 -5
  39. package/src/commands/router.d.ts +1 -0
  40. package/src/commands/router.ts +606 -32
  41. package/src/config/mesh-config.ts +27 -2
  42. package/src/git/git-commands.ts +5 -1
  43. package/src/git/git-types.ts +1 -0
  44. package/src/git/git-worktree.ts +214 -0
  45. package/src/git/index.ts +14 -0
  46. package/src/index.ts +20 -1
  47. package/src/mesh/coordinator-prompt.ts +36 -14
  48. package/src/mesh/mesh-events.ts +173 -42
  49. package/src/providers/acp-provider-instance.ts +118 -30
  50. package/src/providers/chat-message-normalization.ts +241 -0
  51. package/src/providers/cli-provider-instance.d.ts +2 -0
  52. package/src/providers/cli-provider-instance.ts +219 -13
  53. package/src/providers/contracts.ts +25 -1
  54. package/src/providers/io-contracts.ts +63 -5
  55. package/src/providers/provider-input-support.ts +125 -1
  56. package/src/providers/provider-instance-manager.ts +20 -1
  57. package/src/providers/provider-instance.ts +4 -0
  58. package/src/providers/provider-schema.ts +38 -8
  59. package/src/providers/read-chat-contract.ts +8 -0
  60. package/src/repo-mesh-types.ts +38 -0
  61. package/src/session-host/runtime-support.ts +55 -7
  62. package/src/shared-types.ts +8 -0
  63. package/src/status/builders.ts +22 -15
  64. package/src/status/reporter.ts +6 -0
  65. package/src/types.ts +9 -0
@@ -30,6 +30,7 @@ import {
30
30
  IDE_PROVIDER_SESSION_CAPABILITIES_BASE,
31
31
  EXTENSION_PROVIDER_SESSION_CAPABILITIES_BASE,
32
32
  } from '../providers/open-panel-support.js';
33
+ import { TEXT_ONLY_MESSAGE_INPUT_SUPPORT } from '../providers/provider-input-support.js';
33
34
 
34
35
  export type SessionEntryProfile = 'full' | 'live' | 'metadata';
35
36
 
@@ -43,6 +44,19 @@ function getActiveChatOptions(profile: SessionEntryProfile): NormalizeActiveChat
43
44
  return LIVE_STATUS_ACTIVE_CHAT_OPTIONS;
44
45
  }
45
46
 
47
+ function resolveSessionStatus(
48
+ activeChat: { status?: string | null; activeModal?: { buttons?: unknown[] | null } | null } | null | undefined,
49
+ providerStatus?: string | null,
50
+ ) {
51
+ const chatStatus = normalizeManagedStatus(activeChat?.status, { activeModal: activeChat?.activeModal || null });
52
+ const topLevelStatus = normalizeManagedStatus(providerStatus, { activeModal: activeChat?.activeModal || null });
53
+
54
+ if (chatStatus === 'waiting_approval' || topLevelStatus === 'waiting_approval') return 'waiting_approval';
55
+ if (chatStatus === 'generating' || topLevelStatus === 'generating') return 'generating';
56
+ if (topLevelStatus !== 'idle') return topLevelStatus;
57
+ return chatStatus;
58
+ }
59
+
46
60
  function shouldIncludeSessionControls(profile: SessionEntryProfile): boolean {
47
61
  return profile !== 'live';
48
62
  }
@@ -170,15 +184,13 @@ function buildIdeWorkspaceSession(
170
184
  providerName: state.name,
171
185
  kind: 'workspace',
172
186
  transport: 'cdp-page',
173
- status: normalizeManagedStatus(activeChat?.status || state.status, {
174
- activeModal: activeChat?.activeModal || null,
175
- }),
187
+ status: resolveSessionStatus(activeChat, state.status),
176
188
  title,
177
189
  workspace,
178
190
  ...(git && { git }),
179
191
  activeChat,
180
192
  ...(summaryMetadata && { summaryMetadata }),
181
- ...(includeSessionMetadata && { capabilities: state.sessionCapabilities || IDE_SESSION_CAPABILITIES }),
193
+ ...(includeSessionMetadata && { capabilities: state.sessionCapabilities || IDE_SESSION_CAPABILITIES, messageInput: state.messageInput || TEXT_ONLY_MESSAGE_INPUT_SUPPORT }),
182
194
  cdpConnected: state.cdpConnected ?? isCdpConnected(cdpManagers, state.type),
183
195
  ...(includeSessionControls && {
184
196
  ...(controlValues && { controlValues }),
@@ -212,15 +224,13 @@ function buildExtensionAgentSession(
212
224
  providerSessionId: ext.providerSessionId,
213
225
  kind: 'agent',
214
226
  transport: 'cdp-webview',
215
- status: normalizeManagedStatus(activeChat?.status || ext.status, {
216
- activeModal: activeChat?.activeModal || null,
217
- }),
227
+ status: resolveSessionStatus(activeChat, ext.status),
218
228
  title: activeChat?.title || ext.name,
219
229
  workspace,
220
230
  ...(git && { git }),
221
231
  activeChat,
222
232
  ...(summaryMetadata && { summaryMetadata }),
223
- ...(includeSessionMetadata && { capabilities: ext.sessionCapabilities || EXTENSION_SESSION_CAPABILITIES }),
233
+ ...(includeSessionMetadata && { capabilities: ext.sessionCapabilities || EXTENSION_SESSION_CAPABILITIES, messageInput: ext.messageInput || TEXT_ONLY_MESSAGE_INPUT_SUPPORT }),
224
234
  ...(includeSessionControls && {
225
235
  ...(controlValues && { controlValues }),
226
236
  providerControls: ext.providerControls,
@@ -277,9 +287,7 @@ function buildCliSession(state: CliProviderState, options: SessionEntryBuildOpti
277
287
  providerSessionId: state.providerSessionId,
278
288
  kind: 'agent',
279
289
  transport: 'pty',
280
- status: normalizeManagedStatus(activeChat?.status || state.status, {
281
- activeModal: activeChat?.activeModal || null,
282
- }),
290
+ status: resolveSessionStatus(activeChat, state.status),
283
291
  title: activeChat?.title || state.name,
284
292
  workspace,
285
293
  ...(git && { git }),
@@ -300,6 +308,7 @@ function buildCliSession(state: CliProviderState, options: SessionEntryBuildOpti
300
308
  ...(summaryMetadata && { summaryMetadata }),
301
309
  ...(includeSessionMetadata && {
302
310
  capabilities: state.mode === 'terminal' ? PTY_SESSION_CAPABILITIES : CLI_CHAT_SESSION_CAPABILITIES,
311
+ messageInput: state.messageInput || TEXT_ONLY_MESSAGE_INPUT_SUPPORT,
303
312
  }),
304
313
  ...(includeSessionControls && {
305
314
  ...(controlValues && { controlValues }),
@@ -328,15 +337,13 @@ function buildAcpSession(state: AcpProviderState, options: SessionEntryBuildOpti
328
337
  providerName: state.name,
329
338
  kind: 'agent',
330
339
  transport: 'acp',
331
- status: normalizeManagedStatus(activeChat?.status || state.status, {
332
- activeModal: activeChat?.activeModal || null,
333
- }),
340
+ status: resolveSessionStatus(activeChat, state.status),
334
341
  title: activeChat?.title || state.name,
335
342
  workspace,
336
343
  ...(git && { git }),
337
344
  activeChat,
338
345
  ...(summaryMetadata && { summaryMetadata }),
339
- ...(includeSessionMetadata && { capabilities: ACP_SESSION_CAPABILITIES }),
346
+ ...(includeSessionMetadata && { capabilities: ACP_SESSION_CAPABILITIES, messageInput: state.messageInput || TEXT_ONLY_MESSAGE_INPUT_SUPPORT }),
340
347
  ...(includeSessionControls && {
341
348
  ...(controlValues && { controlValues }),
342
349
  providerControls: state.providerControls,
@@ -151,6 +151,12 @@ export class DaemonStatusReporter {
151
151
  if (providerType) {
152
152
  payload.providerType = providerType;
153
153
  }
154
+ if (typeof event.providerSessionId === 'string' && event.providerSessionId.trim()) {
155
+ payload.providerSessionId = event.providerSessionId.trim();
156
+ }
157
+ if (typeof event.workspaceName === 'string' && event.workspaceName.trim()) {
158
+ payload.workspaceName = event.workspaceName.trim();
159
+ }
154
160
  if (typeof event.duration === 'number' && Number.isFinite(event.duration)) {
155
161
  payload.duration = event.duration;
156
162
  }
package/src/types.ts CHANGED
@@ -49,6 +49,15 @@ export interface ChatMessage {
49
49
  /** Optional: fiber metadata */
50
50
  _type?: string;
51
51
  _sub?: string;
52
+ /** Transcript visibility/audience contract for separating chat-visible content from internal/debug runtime rows. */
53
+ visibility?: 'visible' | 'user' | 'chat' | 'hidden' | 'debug' | 'internal' | (string & {});
54
+ transcriptVisibility?: 'visible' | 'user' | 'chat' | 'hidden' | 'debug' | 'internal' | (string & {});
55
+ audience?: 'chat' | 'debug' | 'trace' | 'internal' | (string & {});
56
+ source?: 'assistant_text' | 'tool_call' | 'terminal_command' | 'runtime_activity' | 'runtime_status' | 'provider_chrome' | 'control' | (string & {});
57
+ userFacing?: boolean;
58
+ internal?: boolean;
59
+ isInternal?: boolean;
60
+ debug?: boolean;
52
61
  /** Meta information for thought/terminal logs etc */
53
62
  meta?: { label?: string; isRunning?: boolean } | Record<string, any>;
54
63
  /** Sender name for shared sessions */