@adhdev/daemon-core 0.9.82-rc.377 → 0.9.82-rc.379
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-adapter.d.ts +5 -0
- package/dist/cli-adapters/pty-write-chunking.d.ts +34 -0
- package/dist/commands/router.d.ts +3 -470
- package/dist/index.js +298 -218
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +299 -219
- package/dist/index.mjs.map +1 -1
- package/dist/mesh/mesh-coordinator-config.d.ts +21 -0
- package/dist/mesh/mesh-node-identity.d.ts +289 -0
- package/dist/mesh/mesh-refine-gates.d.ts +428 -0
- package/dist/providers/spec/fsm-driver.d.ts +6 -4
- package/package.json +2 -2
- package/src/cli-adapters/provider-cli-adapter.ts +62 -1
- package/src/cli-adapters/pty-write-chunking.ts +106 -0
- package/src/commands/med-family/mesh-crud.ts +28 -1
- package/src/commands/router.ts +104 -3650
- package/src/mesh/mesh-coordinator-config.ts +97 -0
- package/src/mesh/mesh-node-identity.ts +1887 -0
- package/src/mesh/mesh-queue-assignment.ts +34 -0
- package/src/mesh/mesh-refine-gates.ts +1652 -0
- package/src/providers/spec/fsm-driver.ts +13 -26
|
@@ -38,6 +38,11 @@ import { loadFsmSpec } from './fsm-loader.js';
|
|
|
38
38
|
import { applyPreLaunchTrust } from './pre-launch-trust.js';
|
|
39
39
|
import type { Control, DelegateTrigger } from './types.js';
|
|
40
40
|
import { LOG } from '../../logging/logger.js';
|
|
41
|
+
import {
|
|
42
|
+
WIN32_PTY_WRITE_CHUNK_CHARS,
|
|
43
|
+
WIN32_PTY_WRITE_CHUNK_GAP_MS,
|
|
44
|
+
chunkPreservingSurrogates as chunkPreservingSurrogatesShared,
|
|
45
|
+
} from '../../cli-adapters/pty-write-chunking.js';
|
|
41
46
|
|
|
42
47
|
// ── Shared driver types (formerly in driver.ts) ───────────────────────────
|
|
43
48
|
|
|
@@ -169,12 +174,9 @@ const WIN32_SUBMIT_MAX_RESENDS = 14;
|
|
|
169
174
|
// cadence while it waits for the body to echo.
|
|
170
175
|
const WIN32_SUBMIT_SETTLE_MS = 500;
|
|
171
176
|
const WIN32_SUBMIT_SETTLE_POLL_MS = 120;
|
|
172
|
-
// Defensive paced PTY write
|
|
173
|
-
//
|
|
174
|
-
//
|
|
175
|
-
// write in one shot.
|
|
176
|
-
const WIN32_PTY_WRITE_CHUNK_CHARS = 1024;
|
|
177
|
-
const WIN32_PTY_WRITE_CHUNK_GAP_MS = 8;
|
|
177
|
+
// Defensive paced PTY write tuning (WIN32_PTY_WRITE_CHUNK_CHARS / _GAP_MS) and the
|
|
178
|
+
// surrogate-safe splitter now live in the shared pty-write-chunking module so this
|
|
179
|
+
// driver and the legacy ProviderCliAdapter cannot drift apart — see the import above.
|
|
178
180
|
// Echo-gate for the win32 FIRST submit CR (supersedes the bare output-quiet settle).
|
|
179
181
|
// The body write can race claude-cli's boot — its stdin reader is not wired until the
|
|
180
182
|
// composer renders (~5–7s in, later under load), so a too-early write is buffered and
|
|
@@ -202,26 +204,11 @@ export function resolveSubmitDelayMs(specBeforeSubmit: number | undefined, text:
|
|
|
202
204
|
return Math.max(spec, SUBMIT_DELAY_FLOOR_MS + linesBonus);
|
|
203
205
|
}
|
|
204
206
|
|
|
205
|
-
/**
|
|
206
|
-
*
|
|
207
|
-
*
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
let offset = 0;
|
|
211
|
-
while (offset < text.length) {
|
|
212
|
-
let end = Math.min(text.length, offset + size);
|
|
213
|
-
if (end < text.length) {
|
|
214
|
-
const code = text.charCodeAt(end - 1);
|
|
215
|
-
// Boundary lands on a high surrogate → pull back one so the pair stays
|
|
216
|
-
// together in the next chunk.
|
|
217
|
-
if (code >= 0xd800 && code <= 0xdbff) end -= 1;
|
|
218
|
-
}
|
|
219
|
-
if (end <= offset) end = Math.min(text.length, offset + size); // size 1 on a lone surrogate
|
|
220
|
-
chunks.push(text.slice(offset, end));
|
|
221
|
-
offset = end;
|
|
222
|
-
}
|
|
223
|
-
return chunks;
|
|
224
|
-
}
|
|
207
|
+
/** Re-export of the shared surrogate-safe splitter so existing imports of
|
|
208
|
+
* `chunkPreservingSurrogates` from this module keep working. The implementation
|
|
209
|
+
* lives in ../../cli-adapters/pty-write-chunking so the spec driver and the
|
|
210
|
+
* legacy adapter share one definition. */
|
|
211
|
+
export const chunkPreservingSurrogates = chunkPreservingSurrogatesShared;
|
|
225
212
|
|
|
226
213
|
export function guessExt(mime: string): string {
|
|
227
214
|
if (/png/i.test(mime)) return '.png';
|