@adhdev/daemon-core 0.9.64 → 0.9.66

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 (35) hide show
  1. package/dist/chat/chat-signatures.d.ts +0 -4
  2. package/dist/chat/chat-signatures.js +0 -4
  3. package/dist/chat/chat-signatures.js.map +1 -1
  4. package/dist/chat/chat-signatures.mjs +0 -4
  5. package/dist/chat/chat-signatures.mjs.map +1 -1
  6. package/dist/chat/subscription-updates.d.ts +0 -2
  7. package/dist/cli-adapters/provider-cli-adapter.d.ts +2 -30
  8. package/dist/cli-adapters/provider-cli-parse.d.ts +1 -8
  9. package/dist/cli-adapters/provider-cli-shared.d.ts +8 -3
  10. package/dist/commands/chat-commands.d.ts +0 -2
  11. package/dist/index.d.ts +1 -1
  12. package/dist/index.js +646 -1712
  13. package/dist/index.js.map +1 -1
  14. package/dist/index.mjs +646 -1712
  15. package/dist/index.mjs.map +1 -1
  16. package/dist/shared-types.d.ts +0 -7
  17. package/node_modules/@adhdev/session-host-core/package.json +1 -1
  18. package/package.json +1 -1
  19. package/src/chat/chat-signatures.ts +0 -8
  20. package/src/chat/subscription-updates.ts +7 -46
  21. package/src/cli-adapters/provider-cli-adapter.d.ts +2 -10
  22. package/src/cli-adapters/provider-cli-adapter.ts +66 -692
  23. package/src/cli-adapters/provider-cli-parse.d.ts +0 -7
  24. package/src/cli-adapters/provider-cli-parse.ts +2 -226
  25. package/src/cli-adapters/provider-cli-shared.d.ts +0 -1
  26. package/src/cli-adapters/provider-cli-shared.ts +8 -3
  27. package/src/commands/chat-commands.ts +54 -366
  28. package/src/daemon/dev-auto-implement.ts +3 -3
  29. package/src/daemon/dev-server.ts +3 -3
  30. package/src/index.d.ts +1 -1
  31. package/src/index.ts +0 -1
  32. package/src/launch.ts +10 -3
  33. package/src/providers/cli-provider-instance.ts +2 -39
  34. package/src/shared-types.d.ts +0 -7
  35. package/src/shared-types.ts +0 -8
@@ -38,10 +38,7 @@ export interface AgentSessionStream {
38
38
  buttons: string[];
39
39
  } | null;
40
40
  }
41
- export type ReadChatSyncMode = 'full' | 'append' | 'replace_tail' | 'noop';
42
41
  export interface ReadChatCursor {
43
- knownMessageCount?: number;
44
- lastMessageSignature?: string;
45
42
  tailLimit?: number;
46
43
  }
47
44
  export interface ReadChatSyncResult {
@@ -52,10 +49,6 @@ export interface ReadChatSyncResult {
52
49
  message: string;
53
50
  buttons: string[];
54
51
  } | null;
55
- syncMode: ReadChatSyncMode;
56
- replaceFrom: number;
57
- totalMessages: number;
58
- lastMessageSignature: string;
59
52
  }
60
53
  export interface ProviderSummaryItem {
61
54
  id: string;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adhdev/session-host-core",
3
- "version": "0.9.64",
3
+ "version": "0.9.66",
4
4
  "description": "ADHDev local session host core \u2014 session registry, protocol, buffers",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adhdev/daemon-core",
3
- "version": "0.9.64",
3
+ "version": "0.9.66",
4
4
  "description": "ADHDev daemon core \u2014 CDP, IDE detection, providers, command execution",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -14,10 +14,6 @@ export interface ChatTailDeliverySignatureInput {
14
14
  status: string
15
15
  title?: string
16
16
  activeModal?: { message: string; buttons: string[] } | null
17
- syncMode: string
18
- replaceFrom: number
19
- totalMessages: number
20
- lastMessageSignature: string
21
17
  }
22
18
 
23
19
  export interface SessionModalDeliverySignatureInput {
@@ -75,10 +71,6 @@ export function buildChatTailDeliverySignature(payload: ChatTailDeliverySignatur
75
71
  payload.historySessionId || '',
76
72
  payload.status,
77
73
  payload.title || '',
78
- payload.syncMode,
79
- String(payload.replaceFrom),
80
- String(payload.totalMessages),
81
- payload.lastMessageSignature,
82
74
  payload.activeModal ? `${payload.activeModal.message}|${payload.activeModal.buttons.join('\u001f')}` : '',
83
75
  stringifySignatureMessages(payload.messages),
84
76
  ])
@@ -1,6 +1,4 @@
1
1
  import type {
2
- ReadChatCursor,
3
- ReadChatSyncMode,
4
2
  ReadChatSyncResult,
5
3
  SessionChatTailUpdate,
6
4
  SessionModalUpdate,
@@ -12,8 +10,6 @@ import {
12
10
  import { normalizeManagedStatus } from '../status/normalize.js'
13
11
 
14
12
  export interface ChatTailSubscriptionCursor {
15
- knownMessageCount: number
16
- lastMessageSignature: string
17
13
  tailLimit: number
18
14
  }
19
15
 
@@ -59,15 +55,6 @@ export interface PreparedSessionModalUpdate {
59
55
  update: SessionModalUpdate | null
60
56
  }
61
57
 
62
- function normalizeSyncMode(syncMode: string | undefined): ReadChatSyncMode {
63
- return syncMode === 'append'
64
- || syncMode === 'replace_tail'
65
- || syncMode === 'noop'
66
- || syncMode === 'full'
67
- ? syncMode
68
- : 'full'
69
- }
70
-
71
58
  function normalizeModalButtons(value: unknown): string[] {
72
59
  return Array.isArray(value)
73
60
  ? value.filter((button): button is string => typeof button === 'string')
@@ -101,58 +88,36 @@ export function normalizeSessionModalFields(activeModal: unknown): { modalMessag
101
88
  }
102
89
  }
103
90
 
104
- function buildNextChatCursor(
105
- cursor: ChatTailSubscriptionCursor,
106
- result: SessionChatTailCommandResult,
107
- ): ChatTailSubscriptionCursor {
108
- return {
109
- knownMessageCount: Math.max(0, Number(result.totalMessages || cursor.knownMessageCount)),
110
- lastMessageSignature: typeof result.lastMessageSignature === 'string'
111
- ? result.lastMessageSignature
112
- : cursor.lastMessageSignature,
113
- tailLimit: cursor.tailLimit,
114
- }
115
- }
116
-
117
91
  export function prepareSessionChatTailUpdate(
118
92
  input: PrepareSessionChatTailUpdateInput,
119
93
  ): PreparedSessionChatTailUpdate {
120
94
  const result = input.result
121
- if (!result?.success || result.syncMode === 'noop') {
95
+ if (!result?.success) {
122
96
  return {
123
- cursor: result?.success ? buildNextChatCursor(input.cursor, result) : input.cursor,
97
+ cursor: input.cursor,
124
98
  seq: input.seq,
125
99
  lastDeliveredSignature: input.lastDeliveredSignature,
126
100
  update: null,
127
101
  }
128
102
  }
129
103
 
130
- const syncMode = normalizeSyncMode(result.syncMode)
131
- const cursor = {
132
- knownMessageCount: Math.max(0, Number(result.totalMessages || 0)),
133
- lastMessageSignature: typeof result.lastMessageSignature === 'string' ? result.lastMessageSignature : '',
134
- tailLimit: input.cursor.tailLimit,
135
- }
104
+ const messages = Array.isArray(result.messages) ? result.messages : []
136
105
  const title = typeof result.title === 'string' ? result.title : undefined
137
106
  const activeModal = normalizeChatTailActiveModal(result.activeModal)
138
107
  const status = typeof result.status === 'string' ? result.status : 'idle'
139
108
  const deliverySignature = buildChatTailDeliverySignature({
140
109
  sessionId: input.sessionId,
141
110
  ...(input.historySessionId ? { historySessionId: input.historySessionId } : {}),
142
- messages: Array.isArray(result.messages) ? result.messages : [],
111
+ messages,
143
112
  status,
144
113
  ...(title ? { title } : {}),
145
114
  ...(activeModal ? { activeModal } : {}),
146
- syncMode,
147
- replaceFrom: Number(result.replaceFrom || 0),
148
- totalMessages: Number(result.totalMessages || 0),
149
- lastMessageSignature: typeof result.lastMessageSignature === 'string' ? result.lastMessageSignature : '',
150
115
  })
151
116
  const seq = input.seq + 1
152
117
 
153
118
  if (deliverySignature === input.lastDeliveredSignature) {
154
119
  return {
155
- cursor,
120
+ cursor: input.cursor,
156
121
  seq,
157
122
  lastDeliveredSignature: input.lastDeliveredSignature,
158
123
  update: null,
@@ -160,7 +125,7 @@ export function prepareSessionChatTailUpdate(
160
125
  }
161
126
 
162
127
  return {
163
- cursor,
128
+ cursor: input.cursor,
164
129
  seq,
165
130
  lastDeliveredSignature: deliverySignature,
166
131
  update: {
@@ -171,14 +136,10 @@ export function prepareSessionChatTailUpdate(
171
136
  ...(input.interactionId ? { interactionId: input.interactionId } : {}),
172
137
  seq,
173
138
  timestamp: input.timestamp,
174
- messages: Array.isArray(result.messages) ? result.messages : [],
139
+ messages,
175
140
  status,
176
141
  ...(title ? { title } : {}),
177
142
  ...(activeModal ? { activeModal } : {}),
178
- syncMode,
179
- replaceFrom: Number(result.replaceFrom || 0),
180
- totalMessages: Number(result.totalMessages || 0),
181
- lastMessageSignature: typeof result.lastMessageSignature === 'string' ? result.lastMessageSignature : '',
182
143
  },
183
144
  }
184
145
  }
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * Required scripts in scripts/{version}/scripts.js:
8
8
  * - detectStatus(input) → AgentStatus string ('idle' | 'generating' | 'waiting_approval')
9
- * - parseOutput(input) → ReadChatResult { messages, status, activeModal, ... }
9
+ * - parseSession(input) → ReadChatResult { messages, status, activeModal, ... }
10
10
  * - parseApproval(input) → ModalInfo | null
11
11
  *
12
12
  * provider.json contract:
@@ -15,13 +15,9 @@
15
15
  */
16
16
  import type { CliAdapter } from '../cli-adapter-types.js';
17
17
  import { type PtyRuntimeMetadata, type PtyTransportFactory } from './pty-transport.js';
18
- import { type CliChatMessage, type CliProviderModule, type CliScripts, type CliSessionStatus } from './provider-cli-shared.js';
18
+ import { type CliProviderModule, type CliScripts, type CliSessionStatus } from './provider-cli-shared.js';
19
19
  import { type ProviderResolutionMeta } from './provider-cli-config.js';
20
20
  export { normalizeCliProviderForRuntime, type CliApprovalInput, type CliChatMessage, type CliProviderModule, type CliScreenLine, type CliScreenSnapshot, type CliScriptInput, type CliScripts, type CliSessionStatus, type CliStatusInput, type CliTraceEntry, } from './provider-cli-shared.js';
21
- type SeedCliChatMessage = Omit<Partial<CliChatMessage>, 'role'> & {
22
- role?: string;
23
- content?: string;
24
- };
25
21
  export declare class ProviderCliAdapter implements CliAdapter {
26
22
  private extraArgs;
27
23
  readonly cliType: string;
@@ -30,9 +26,6 @@ export declare class ProviderCliAdapter implements CliAdapter {
30
26
  private provider;
31
27
  private ptyProcess;
32
28
  private transportFactory;
33
- private messages;
34
- private committedMessages;
35
- private structuredMessages;
36
29
  private currentStatus;
37
30
  private onStatusChange;
38
31
  private responseBuffer;
@@ -141,7 +134,6 @@ export declare class ProviderCliAdapter implements CliAdapter {
141
134
  private runDetectStatus;
142
135
  private runParseApproval;
143
136
  getStatus(): CliSessionStatus;
144
- seedCommittedMessages(messages: SeedCliChatMessage[]): void;
145
137
  /**
146
138
  * Script-based full parse — returns ReadChatResult.
147
139
  * Called by command handler / dashboard for rich content rendering.