@adhdev/daemon-core 0.9.76-rc.1 → 0.9.76-rc.10
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/index.js +23 -16
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +23 -16
- package/dist/index.mjs.map +1 -1
- package/dist/shared-types.d.ts +18 -1
- package/package.json +1 -1
- package/src/cli-adapters/provider-cli-adapter.ts +4 -3
- package/src/commands/mesh-coordinator.ts +1 -1
- package/src/commands/router.ts +6 -0
- package/src/shared-types.ts +20 -1
- package/src/status/builders.ts +17 -12
package/dist/shared-types.d.ts
CHANGED
|
@@ -328,6 +328,15 @@ export interface CompactSessionEntry {
|
|
|
328
328
|
settings?: Record<string, any>;
|
|
329
329
|
}
|
|
330
330
|
export type VersionUpdateReason = 'force_update_below' | 'major_minor_mismatch' | 'patch_mismatch' | 'daemon_ahead';
|
|
331
|
+
export type ReleaseChannel = 'stable' | 'preview';
|
|
332
|
+
export type NpmUpdateTag = 'latest' | 'next';
|
|
333
|
+
export interface VersionUpdatePolicy {
|
|
334
|
+
channel: ReleaseChannel;
|
|
335
|
+
npmTag: NpmUpdateTag;
|
|
336
|
+
targetVersion: string;
|
|
337
|
+
minVersion?: string;
|
|
338
|
+
updateCommand: string;
|
|
339
|
+
}
|
|
331
340
|
/** Available provider information */
|
|
332
341
|
export interface AvailableProviderInfo {
|
|
333
342
|
type: string;
|
|
@@ -469,6 +478,10 @@ export interface CompactDaemonEntry {
|
|
|
469
478
|
versionMismatch?: boolean;
|
|
470
479
|
versionUpdateRequired?: boolean;
|
|
471
480
|
versionUpdateReason?: VersionUpdateReason;
|
|
481
|
+
releaseChannel?: ReleaseChannel;
|
|
482
|
+
updateChannel?: ReleaseChannel;
|
|
483
|
+
updatePolicy?: VersionUpdatePolicy;
|
|
484
|
+
updateCommand?: string;
|
|
472
485
|
terminalBackend?: TerminalBackendStatus;
|
|
473
486
|
detectedIdes?: DetectedIdeInfo[];
|
|
474
487
|
availableProviders?: AvailableProviderInfo[];
|
|
@@ -490,10 +503,14 @@ export interface CloudDaemonSummaryEntry {
|
|
|
490
503
|
versionMismatch?: boolean;
|
|
491
504
|
versionUpdateRequired?: boolean;
|
|
492
505
|
versionUpdateReason?: VersionUpdateReason;
|
|
506
|
+
releaseChannel?: ReleaseChannel;
|
|
507
|
+
updateChannel?: ReleaseChannel;
|
|
508
|
+
updatePolicy?: VersionUpdatePolicy;
|
|
509
|
+
updateCommand?: string;
|
|
493
510
|
terminalBackend?: TerminalBackendStatus;
|
|
494
511
|
}
|
|
495
512
|
/** Minimal daemon bootstrap payload used by dashboard WS to initiate P2P. */
|
|
496
|
-
export interface DashboardBootstrapDaemonEntry {
|
|
513
|
+
export interface DashboardBootstrapDaemonEntry extends Partial<CloudDaemonSummaryEntry> {
|
|
497
514
|
id: string;
|
|
498
515
|
p2p?: StatusReportPayload['p2p'];
|
|
499
516
|
timestamp?: number;
|
package/package.json
CHANGED
|
@@ -266,9 +266,10 @@ export class ProviderCliAdapter implements CliAdapter {
|
|
|
266
266
|
const currentSnapshot = normalizeScreenSnapshot(screenText);
|
|
267
267
|
const lastSnapshot = this.lastScreenSnapshot;
|
|
268
268
|
if (!lastSnapshot || lastSnapshot === currentSnapshot) return screenText;
|
|
269
|
-
const
|
|
270
|
-
const
|
|
271
|
-
|
|
269
|
+
const activeScreenPattern = /\besc to (?:interrupt|stop)\b|Enter to interrupt, Ctrl\+C to cancel|Enter to confirm\s*[·•-]\s*Esc to cancel|\b(?:MCP servers?|tool calls?)\b[^\n\r]{0,160}\brequire approval\b/i;
|
|
270
|
+
const staleSnapshotLooksActive = activeScreenPattern.test(lastSnapshot);
|
|
271
|
+
const currentScreenLooksIdle = /(?:^|\n|\r)\s*[❯›>]\s*(?:Try\s+["“][^\n\r"”]+["”])?\s*(?:\n|\r|$)/.test(screenText)
|
|
272
|
+
&& !activeScreenPattern.test(screenText);
|
|
272
273
|
if (staleSnapshotLooksActive && currentScreenLooksIdle) return screenText;
|
|
273
274
|
if (currentSnapshot.length >= lastSnapshot.length) return screenText;
|
|
274
275
|
// Terminal screen reads can miss a just-rendered completed Hermes box while
|
|
@@ -127,7 +127,7 @@ function resolveAdhdevMcpServerLaunch(options: {
|
|
|
127
127
|
if (!entryPath) return null
|
|
128
128
|
return {
|
|
129
129
|
command: options.nodeExecutable?.trim() || process.execPath,
|
|
130
|
-
args: [entryPath, '--repo-mesh', options.meshId],
|
|
130
|
+
args: [entryPath, '--mode', 'ipc', '--repo-mesh', options.meshId],
|
|
131
131
|
}
|
|
132
132
|
}
|
|
133
133
|
|
package/src/commands/router.ts
CHANGED
|
@@ -41,6 +41,10 @@ import { execNpmCommandSync, resolveCurrentGlobalInstallSurface, spawnDetachedDa
|
|
|
41
41
|
|
|
42
42
|
type ReleaseChannel = 'stable' | 'preview';
|
|
43
43
|
const CHANNEL_NPM_TAG: Record<ReleaseChannel, 'latest' | 'next'> = { stable: 'latest', preview: 'next' };
|
|
44
|
+
const CHANNEL_SERVER_URL: Record<ReleaseChannel, string> = {
|
|
45
|
+
stable: 'https://api.adhf.dev',
|
|
46
|
+
preview: 'https://api-preview.adhf.dev',
|
|
47
|
+
};
|
|
44
48
|
|
|
45
49
|
function normalizeReleaseChannel(value: unknown): ReleaseChannel | null {
|
|
46
50
|
if (typeof value !== 'string') return null;
|
|
@@ -892,6 +896,7 @@ export class DaemonCommandRouter {
|
|
|
892
896
|
// Check channel-pinned dist-tag and resolve it to a concrete install version.
|
|
893
897
|
const latest = String(execNpmCommandSync(['view', `${pkgName}@${npmTag}`, 'version'], { encoding: 'utf-8', timeout: 10000 }, npmSurface)).trim();
|
|
894
898
|
LOG.info('Upgrade', `Latest ${pkgName}@${npmTag}: v${latest}`);
|
|
899
|
+
updateConfig({ updateChannel: channel, serverUrl: CHANNEL_SERVER_URL[channel] } as any);
|
|
895
900
|
let currentInstalled: string | null = null;
|
|
896
901
|
try {
|
|
897
902
|
const currentJson = String(execNpmCommandSync(['ls', '-g', pkgName, '--depth=0', '--json'], {
|
|
@@ -1131,6 +1136,7 @@ export class DaemonCommandRouter {
|
|
|
1131
1136
|
if (args?.inlineMesh) {
|
|
1132
1137
|
mcpServerEntry.env = {
|
|
1133
1138
|
ADHDEV_INLINE_MESH: JSON.stringify(mesh),
|
|
1139
|
+
ADHDEV_MCP_TRANSPORT: 'ipc',
|
|
1134
1140
|
};
|
|
1135
1141
|
}
|
|
1136
1142
|
const mcpConfig = {
|
package/src/shared-types.ts
CHANGED
|
@@ -432,6 +432,17 @@ export type VersionUpdateReason =
|
|
|
432
432
|
| 'patch_mismatch'
|
|
433
433
|
| 'daemon_ahead';
|
|
434
434
|
|
|
435
|
+
export type ReleaseChannel = 'stable' | 'preview';
|
|
436
|
+
export type NpmUpdateTag = 'latest' | 'next';
|
|
437
|
+
|
|
438
|
+
export interface VersionUpdatePolicy {
|
|
439
|
+
channel: ReleaseChannel;
|
|
440
|
+
npmTag: NpmUpdateTag;
|
|
441
|
+
targetVersion: string;
|
|
442
|
+
minVersion?: string;
|
|
443
|
+
updateCommand: string;
|
|
444
|
+
}
|
|
445
|
+
|
|
435
446
|
/** Available provider information */
|
|
436
447
|
export interface AvailableProviderInfo {
|
|
437
448
|
type: string;
|
|
@@ -577,6 +588,10 @@ export interface CompactDaemonEntry {
|
|
|
577
588
|
versionMismatch?: boolean;
|
|
578
589
|
versionUpdateRequired?: boolean;
|
|
579
590
|
versionUpdateReason?: VersionUpdateReason;
|
|
591
|
+
releaseChannel?: ReleaseChannel;
|
|
592
|
+
updateChannel?: ReleaseChannel;
|
|
593
|
+
updatePolicy?: VersionUpdatePolicy;
|
|
594
|
+
updateCommand?: string;
|
|
580
595
|
terminalBackend?: TerminalBackendStatus;
|
|
581
596
|
detectedIdes?: DetectedIdeInfo[];
|
|
582
597
|
availableProviders?: AvailableProviderInfo[];
|
|
@@ -599,11 +614,15 @@ export interface CloudDaemonSummaryEntry {
|
|
|
599
614
|
versionMismatch?: boolean;
|
|
600
615
|
versionUpdateRequired?: boolean;
|
|
601
616
|
versionUpdateReason?: VersionUpdateReason;
|
|
617
|
+
releaseChannel?: ReleaseChannel;
|
|
618
|
+
updateChannel?: ReleaseChannel;
|
|
619
|
+
updatePolicy?: VersionUpdatePolicy;
|
|
620
|
+
updateCommand?: string;
|
|
602
621
|
terminalBackend?: TerminalBackendStatus;
|
|
603
622
|
}
|
|
604
623
|
|
|
605
624
|
/** Minimal daemon bootstrap payload used by dashboard WS to initiate P2P. */
|
|
606
|
-
export interface DashboardBootstrapDaemonEntry {
|
|
625
|
+
export interface DashboardBootstrapDaemonEntry extends Partial<CloudDaemonSummaryEntry> {
|
|
607
626
|
id: string;
|
|
608
627
|
p2p?: StatusReportPayload['p2p'];
|
|
609
628
|
timestamp?: number;
|
package/src/status/builders.ts
CHANGED
|
@@ -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:
|
|
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:
|
|
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:
|
|
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:
|
|
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 }),
|