@adhdev/daemon-core 1.0.18-rc.19 → 1.0.18-rc.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.
@@ -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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adhdev/daemon-core",
3
- "version": "1.0.18-rc.19",
3
+ "version": "1.0.18-rc.20",
4
4
  "description": "ADHDev daemon core — CDP, IDE detection, providers, command execution",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -47,8 +47,8 @@
47
47
  "author": "vilmire",
48
48
  "license": "AGPL-3.0-or-later",
49
49
  "dependencies": {
50
- "@adhdev/mesh-shared": "1.0.18-rc.19",
51
- "@adhdev/session-host-core": "1.0.18-rc.19",
50
+ "@adhdev/mesh-shared": "1.0.18-rc.20",
51
+ "@adhdev/session-host-core": "1.0.18-rc.20",
52
52
  "@agentclientprotocol/sdk": "^0.16.1",
53
53
  "ajv": "^8.20.0",
54
54
  "ajv-formats": "^3.0.1",
@@ -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') {