@adhdev/daemon-core 0.8.47 → 0.8.49
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 +19 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +19 -4
- package/dist/index.mjs.map +1 -1
- package/dist/providers/contracts.d.ts +6 -0
- package/dist/shared-types.d.ts +6 -0
- package/node_modules/@adhdev/session-host-core/package.json +1 -1
- package/package.json +1 -1
- package/src/providers/cli-provider-instance.ts +35 -4
- package/src/providers/contracts.ts +6 -0
- package/src/shared-types.ts +6 -0
|
@@ -591,6 +591,12 @@ export interface ProviderControlDef {
|
|
|
591
591
|
invokeScript?: string;
|
|
592
592
|
/** How to display action result: 'toast' = notification, 'inline' = show in bar, 'none' = silent */
|
|
593
593
|
resultDisplay?: 'toast' | 'inline' | 'none';
|
|
594
|
+
/** Optional confirmation title shown before invoking a destructive or disruptive action */
|
|
595
|
+
confirmTitle?: string;
|
|
596
|
+
/** Optional confirmation message shown before invoking a destructive or disruptive action */
|
|
597
|
+
confirmMessage?: string;
|
|
598
|
+
/** Optional confirmation button label */
|
|
599
|
+
confirmLabel?: string;
|
|
594
600
|
min?: number;
|
|
595
601
|
max?: number;
|
|
596
602
|
step?: number;
|
package/dist/shared-types.d.ts
CHANGED
|
@@ -330,6 +330,12 @@ export interface ProviderControlSchema {
|
|
|
330
330
|
invokeScript?: string;
|
|
331
331
|
/** How to display action result */
|
|
332
332
|
resultDisplay?: 'toast' | 'inline' | 'none';
|
|
333
|
+
/** Optional confirmation title shown before invoking the action */
|
|
334
|
+
confirmTitle?: string;
|
|
335
|
+
/** Optional confirmation message shown before invoking the action */
|
|
336
|
+
confirmMessage?: string;
|
|
337
|
+
/** Optional confirmation button label */
|
|
338
|
+
confirmLabel?: string;
|
|
333
339
|
/** Slider range */
|
|
334
340
|
min?: number;
|
|
335
341
|
max?: number;
|
package/package.json
CHANGED
|
@@ -260,14 +260,30 @@ export class CliProviderInstance implements ProviderInstance {
|
|
|
260
260
|
}
|
|
261
261
|
const runtime = this.adapter.getRuntimeMetadata();
|
|
262
262
|
this.maybeAppendRuntimeRecoveryMessage(runtime);
|
|
263
|
-
|
|
263
|
+
let parsedMessages = Array.isArray(parsedStatus?.messages) ? parsedStatus.messages : [];
|
|
264
|
+
const historyMessageCount = Number.isFinite(parsedStatus?.historyMessageCount)
|
|
265
|
+
? Math.max(0, Number(parsedStatus.historyMessageCount))
|
|
266
|
+
: null;
|
|
267
|
+
if (historyMessageCount !== null) {
|
|
268
|
+
parsedMessages = historyMessageCount > 0
|
|
269
|
+
? parsedMessages.slice(-historyMessageCount)
|
|
270
|
+
: [];
|
|
271
|
+
}
|
|
264
272
|
const controlValues = extractProviderControlValues(this.provider.controls, parsedStatus);
|
|
265
273
|
if (controlValues) {
|
|
266
|
-
this.controlValues = controlValues;
|
|
267
|
-
} else if (Object.keys(this.controlValues).length > 0) {
|
|
268
|
-
this.controlValues = {};
|
|
274
|
+
this.controlValues = { ...this.controlValues, ...controlValues };
|
|
269
275
|
}
|
|
270
276
|
const mergedMessages = this.mergeConversationMessages(parsedMessages);
|
|
277
|
+
const currentModel = typeof parsedStatus?.model === 'string' && parsedStatus.model.trim()
|
|
278
|
+
? parsedStatus.model.trim()
|
|
279
|
+
: (typeof this.controlValues.model === 'string' && this.controlValues.model.trim()
|
|
280
|
+
? this.controlValues.model.trim()
|
|
281
|
+
: undefined);
|
|
282
|
+
const currentPlan = typeof parsedStatus?.mode === 'string' && parsedStatus.mode.trim()
|
|
283
|
+
? parsedStatus.mode.trim()
|
|
284
|
+
: (typeof this.controlValues.mode === 'string' && this.controlValues.mode.trim()
|
|
285
|
+
? this.controlValues.mode.trim()
|
|
286
|
+
: undefined);
|
|
271
287
|
|
|
272
288
|
const dirName = this.workingDir.split('/').filter(Boolean).pop() || 'session';
|
|
273
289
|
|
|
@@ -313,6 +329,8 @@ export class CliProviderInstance implements ProviderInstance {
|
|
|
313
329
|
inputContent: '',
|
|
314
330
|
},
|
|
315
331
|
workspace: this.workingDir,
|
|
332
|
+
currentModel,
|
|
333
|
+
currentPlan,
|
|
316
334
|
instanceId: this.instanceId,
|
|
317
335
|
providerSessionId: this.providerSessionId,
|
|
318
336
|
lastUpdated: Date.now(),
|
|
@@ -513,6 +531,19 @@ export class CliProviderInstance implements ProviderInstance {
|
|
|
513
531
|
private applyProviderResponse(data: any, options: { phase: 'immediate' | 'turn_completed' }): void {
|
|
514
532
|
if (!data || typeof data !== 'object') return;
|
|
515
533
|
|
|
534
|
+
const patchedProviderSessionId = typeof data.providerSessionId === 'string'
|
|
535
|
+
? data.providerSessionId.trim()
|
|
536
|
+
: '';
|
|
537
|
+
if (patchedProviderSessionId) {
|
|
538
|
+
this.promoteProviderSessionId(patchedProviderSessionId);
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
if (data.sessionEvent === 'new_session') {
|
|
542
|
+
this.runtimeMessages = [];
|
|
543
|
+
this.suppressIdleHistoryReplay = false;
|
|
544
|
+
this.adapter.clearHistory();
|
|
545
|
+
}
|
|
546
|
+
|
|
516
547
|
const controlValues = extractProviderControlValues(this.provider.controls, data);
|
|
517
548
|
if (controlValues) {
|
|
518
549
|
this.controlValues = { ...this.controlValues, ...controlValues };
|
|
@@ -722,6 +722,12 @@ export interface ProviderControlDef {
|
|
|
722
722
|
invokeScript?: string;
|
|
723
723
|
/** How to display action result: 'toast' = notification, 'inline' = show in bar, 'none' = silent */
|
|
724
724
|
resultDisplay?: 'toast' | 'inline' | 'none';
|
|
725
|
+
/** Optional confirmation title shown before invoking a destructive or disruptive action */
|
|
726
|
+
confirmTitle?: string;
|
|
727
|
+
/** Optional confirmation message shown before invoking a destructive or disruptive action */
|
|
728
|
+
confirmMessage?: string;
|
|
729
|
+
/** Optional confirmation button label */
|
|
730
|
+
confirmLabel?: string;
|
|
725
731
|
|
|
726
732
|
// ─── Slider-specific ───
|
|
727
733
|
min?: number;
|
package/src/shared-types.ts
CHANGED
|
@@ -397,6 +397,12 @@ export interface ProviderControlSchema {
|
|
|
397
397
|
invokeScript?: string;
|
|
398
398
|
/** How to display action result */
|
|
399
399
|
resultDisplay?: 'toast' | 'inline' | 'none';
|
|
400
|
+
/** Optional confirmation title shown before invoking the action */
|
|
401
|
+
confirmTitle?: string;
|
|
402
|
+
/** Optional confirmation message shown before invoking the action */
|
|
403
|
+
confirmMessage?: string;
|
|
404
|
+
/** Optional confirmation button label */
|
|
405
|
+
confirmLabel?: string;
|
|
400
406
|
/** Slider range */
|
|
401
407
|
min?: number;
|
|
402
408
|
max?: number;
|