@adhdev/daemon-core 0.9.76-rc.6 → 0.9.76-rc.61

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 (54) hide show
  1. package/dist/cli-adapters/provider-cli-adapter.d.ts +2 -1
  2. package/dist/cli-adapters/provider-cli-runtime.d.ts +1 -0
  3. package/dist/commands/cli-manager.d.ts +17 -4
  4. package/dist/commands/mesh-coordinator.d.ts +2 -0
  5. package/dist/commands/router.d.ts +11 -0
  6. package/dist/config/mesh-config.d.ts +3 -0
  7. package/dist/git/git-types.d.ts +1 -1
  8. package/dist/git/git-worktree.d.ts +64 -0
  9. package/dist/git/index.d.ts +2 -0
  10. package/dist/index.d.ts +3 -3
  11. package/dist/index.js +1690 -447
  12. package/dist/index.js.map +1 -1
  13. package/dist/index.mjs +1703 -478
  14. package/dist/index.mjs.map +1 -1
  15. package/dist/mesh/coordinator-prompt.d.ts +1 -0
  16. package/dist/mesh/mesh-events.d.ts +9 -0
  17. package/dist/providers/chat-message-normalization.d.ts +40 -0
  18. package/dist/providers/cli-provider-instance.d.ts +3 -0
  19. package/dist/providers/provider-instance-manager.d.ts +1 -0
  20. package/dist/providers/provider-instance.d.ts +2 -0
  21. package/dist/repo-mesh-types.d.ts +27 -0
  22. package/dist/session-host/runtime-support.d.ts +2 -1
  23. package/dist/shared-types.d.ts +4 -0
  24. package/dist/types.d.ts +9 -0
  25. package/package.json +4 -5
  26. package/src/chat/subscription-updates.ts +3 -1
  27. package/src/cli-adapters/provider-cli-adapter.ts +28 -7
  28. package/src/cli-adapters/provider-cli-runtime.ts +3 -2
  29. package/src/commands/chat-commands.ts +126 -11
  30. package/src/commands/cli-manager.ts +78 -5
  31. package/src/commands/handler.ts +13 -4
  32. package/src/commands/mesh-coordinator.ts +148 -5
  33. package/src/commands/router.d.ts +1 -0
  34. package/src/commands/router.ts +553 -34
  35. package/src/config/mesh-config.ts +23 -2
  36. package/src/git/git-commands.ts +5 -1
  37. package/src/git/git-types.ts +1 -0
  38. package/src/git/git-worktree.ts +214 -0
  39. package/src/git/index.ts +14 -0
  40. package/src/index.ts +16 -1
  41. package/src/mesh/coordinator-prompt.ts +29 -14
  42. package/src/mesh/mesh-events.ts +109 -43
  43. package/src/providers/chat-message-normalization.ts +241 -0
  44. package/src/providers/cli-provider-instance.d.ts +2 -0
  45. package/src/providers/cli-provider-instance.ts +93 -8
  46. package/src/providers/provider-instance-manager.ts +20 -1
  47. package/src/providers/provider-instance.ts +2 -0
  48. package/src/providers/read-chat-contract.ts +8 -0
  49. package/src/repo-mesh-types.ts +30 -0
  50. package/src/session-host/runtime-support.ts +55 -7
  51. package/src/shared-types.ts +4 -0
  52. package/src/status/builders.ts +17 -12
  53. package/src/status/reporter.ts +6 -0
  54. package/src/types.ts +9 -0
@@ -43,6 +43,19 @@ function getActiveChatOptions(profile: SessionEntryProfile): NormalizeActiveChat
43
43
  return LIVE_STATUS_ACTIVE_CHAT_OPTIONS;
44
44
  }
45
45
 
46
+ function resolveSessionStatus(
47
+ activeChat: { status?: string | null; activeModal?: { buttons?: unknown[] | null } | null } | null | undefined,
48
+ providerStatus?: string | null,
49
+ ) {
50
+ const chatStatus = normalizeManagedStatus(activeChat?.status, { activeModal: activeChat?.activeModal || null });
51
+ const topLevelStatus = normalizeManagedStatus(providerStatus, { activeModal: activeChat?.activeModal || null });
52
+
53
+ if (chatStatus === 'waiting_approval' || topLevelStatus === 'waiting_approval') return 'waiting_approval';
54
+ if (chatStatus === 'generating' || topLevelStatus === 'generating') return 'generating';
55
+ if (topLevelStatus !== 'idle') return topLevelStatus;
56
+ return chatStatus;
57
+ }
58
+
46
59
  function shouldIncludeSessionControls(profile: SessionEntryProfile): boolean {
47
60
  return profile !== 'live';
48
61
  }
@@ -170,9 +183,7 @@ function buildIdeWorkspaceSession(
170
183
  providerName: state.name,
171
184
  kind: 'workspace',
172
185
  transport: 'cdp-page',
173
- status: normalizeManagedStatus(activeChat?.status || state.status, {
174
- activeModal: activeChat?.activeModal || null,
175
- }),
186
+ status: resolveSessionStatus(activeChat, state.status),
176
187
  title,
177
188
  workspace,
178
189
  ...(git && { git }),
@@ -212,9 +223,7 @@ function buildExtensionAgentSession(
212
223
  providerSessionId: ext.providerSessionId,
213
224
  kind: 'agent',
214
225
  transport: 'cdp-webview',
215
- status: normalizeManagedStatus(activeChat?.status || ext.status, {
216
- activeModal: activeChat?.activeModal || null,
217
- }),
226
+ status: resolveSessionStatus(activeChat, ext.status),
218
227
  title: activeChat?.title || ext.name,
219
228
  workspace,
220
229
  ...(git && { git }),
@@ -277,9 +286,7 @@ function buildCliSession(state: CliProviderState, options: SessionEntryBuildOpti
277
286
  providerSessionId: state.providerSessionId,
278
287
  kind: 'agent',
279
288
  transport: 'pty',
280
- status: normalizeManagedStatus(activeChat?.status || state.status, {
281
- activeModal: activeChat?.activeModal || null,
282
- }),
289
+ status: resolveSessionStatus(activeChat, state.status),
283
290
  title: activeChat?.title || state.name,
284
291
  workspace,
285
292
  ...(git && { git }),
@@ -328,9 +335,7 @@ function buildAcpSession(state: AcpProviderState, options: SessionEntryBuildOpti
328
335
  providerName: state.name,
329
336
  kind: 'agent',
330
337
  transport: 'acp',
331
- status: normalizeManagedStatus(activeChat?.status || state.status, {
332
- activeModal: activeChat?.activeModal || null,
333
- }),
338
+ status: resolveSessionStatus(activeChat, state.status),
334
339
  title: activeChat?.title || state.name,
335
340
  workspace,
336
341
  ...(git && { git }),
@@ -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 */