@adhdev/daemon-core 1.0.18 → 1.0.20
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/cli-adapters/provider-cli-shared.d.ts +1 -1
- package/dist/index.js +6 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -4
- package/dist/index.mjs.map +1 -1
- package/dist/providers/auto-approve-modes.d.ts +1 -1
- package/package.json +1 -1
- package/src/cli-adapters/provider-cli-shared.ts +8 -1
- package/src/providers/auto-approve-modes.ts +7 -1
|
@@ -10,5 +10,5 @@ export declare function deriveAutoApproveModeRisk(mode: Pick<AutoApproveMode, 'r
|
|
|
10
10
|
* Resolve new mode settings before the legacy boolean. A stale/unknown explicit
|
|
11
11
|
* mode id fails closed instead of falling through to an enabled legacy setting.
|
|
12
12
|
*/
|
|
13
|
-
export declare function resolveProviderAutoApproveMode(provider: ProviderModule, settings: Record<string, unknown> | undefined): ResolvedAutoApproveMode;
|
|
13
|
+
export declare function resolveProviderAutoApproveMode(provider: ProviderModule | null | undefined, settings: Record<string, unknown> | undefined): ResolvedAutoApproveMode;
|
|
14
14
|
export declare function findProviderAutoApproveMode(provider: ProviderModule | undefined, modeId: string): AutoApproveMode | undefined;
|
package/package.json
CHANGED
|
@@ -286,7 +286,14 @@ export function isPurePtyTranscriptProvider(provider: {
|
|
|
286
286
|
transcriptAuthority?: 'provider' | 'daemon';
|
|
287
287
|
nativeHistory?: unknown;
|
|
288
288
|
tui?: Record<string, unknown>;
|
|
289
|
-
}): boolean {
|
|
289
|
+
} | null | undefined): boolean {
|
|
290
|
+
// No provider (e.g. an instance whose module isn't set when the stall watchdog
|
|
291
|
+
// ticks) ⇒ not the pure-PTY class. Guarding here protects every caller — the
|
|
292
|
+
// stall-reconcile and turn-start paths pass this.provider unguarded, and
|
|
293
|
+
// this.provider is genuinely nullable at runtime (see this.provider?.nativeHistory
|
|
294
|
+
// in cli-provider-instance.ts). Matches resolveLocalSessionPurePty's own
|
|
295
|
+
// no-provider ⇒ not-pure-PTY contract.
|
|
296
|
+
if (!provider) return false;
|
|
290
297
|
if (provider.transcriptAuthority === 'provider') return false;
|
|
291
298
|
// nativeHistory is a top-level provider field not surfaced on
|
|
292
299
|
// CliProviderModule; read it via the same structural shape the adapter uses.
|
|
@@ -61,9 +61,15 @@ function resolveConfiguredMode(
|
|
|
61
61
|
* mode id fails closed instead of falling through to an enabled legacy setting.
|
|
62
62
|
*/
|
|
63
63
|
export function resolveProviderAutoApproveMode(
|
|
64
|
-
provider: ProviderModule,
|
|
64
|
+
provider: ProviderModule | null | undefined,
|
|
65
65
|
settings: Record<string, unknown> | undefined,
|
|
66
66
|
): ResolvedAutoApproveMode {
|
|
67
|
+
// No provider (e.g. an instance whose module isn't set when a modal-park /
|
|
68
|
+
// auto-approve classification runs) ⇒ auto-approve is inactive. this.provider is
|
|
69
|
+
// genuinely nullable at runtime (the instance reads this.provider?.nativeHistory
|
|
70
|
+
// elsewhere), and the sibling helper findProviderAutoApproveMode already guards
|
|
71
|
+
// with provider?.autoApproveModes. Guard the entry so every caller is safe.
|
|
72
|
+
if (!provider) return inactiveMode();
|
|
67
73
|
const config = provider.autoApproveModes;
|
|
68
74
|
const explicitModeId = settings?.autoApproveMode;
|
|
69
75
|
if (typeof explicitModeId === 'string') {
|