@agfpd/iapeer 0.4.9 → 0.4.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/package.json
CHANGED
|
@@ -50,9 +50,6 @@ import { dirname } from 'path'
|
|
|
50
50
|
import { writeFileAtomic } from '../storage/index.ts'
|
|
51
51
|
import { codexGlobalConfigPath } from './nativeMemory.ts'
|
|
52
52
|
|
|
53
|
-
/** The codex-cli version the hash algorithm + key format were verified on. */
|
|
54
|
-
export const TRUST_HOOKS_TESTED_CODEX_VERSION = '0.138.0'
|
|
55
|
-
|
|
56
53
|
/** hooks.json event names → the snake_case labels codex keys state with
|
|
57
54
|
* (upstream `hook_event_key_label`). */
|
|
58
55
|
const EVENT_LABELS: Record<string, string> = {
|
package/src/registry/index.ts
CHANGED
|
@@ -158,9 +158,11 @@ function normalizePeer(raw: unknown): PeerRecord {
|
|
|
158
158
|
)}"`,
|
|
159
159
|
)
|
|
160
160
|
}
|
|
161
|
-
// default_runtime is the contract field
|
|
162
|
-
//
|
|
163
|
-
//
|
|
161
|
+
// default_runtime is the contract field. Phase-3 (registry): foundation no longer WRITES the legacy
|
|
162
|
+
// `runtime` mirror (see writePeersIndexAtomic), but the read-fallback is KEPT as a dormant defensive
|
|
163
|
+
// net — it tolerates a legacy-shaped entry (restored backup / hand-edit) at a 1-token cost. All real
|
|
164
|
+
// readers switched (telegram → default_runtime, notifier → cwd-only); registry is single-writer so
|
|
165
|
+
// new entries are default_runtime-only. Full fallback removal is a future final cleanup.
|
|
164
166
|
const defaultRuntime = obj.default_runtime ?? obj.runtime
|
|
165
167
|
if (!isRuntime(defaultRuntime)) {
|
|
166
168
|
throw new IapError(
|
|
@@ -315,15 +317,15 @@ function writePeersIndexAtomic(paths: PeersPaths, index: PeersIndex): void {
|
|
|
315
317
|
// Persist the RAW intelligence verbatim (legacy-safe round-trip) and DROP the
|
|
316
318
|
// intelligenceRaw shadow field from the on-disk shape — the file carries the
|
|
317
319
|
// legacy vocab the live IAP reads, never the foundation's in-memory normalization.
|
|
318
|
-
// Phase-
|
|
319
|
-
//
|
|
320
|
-
//
|
|
320
|
+
// Phase-3 (registry): the disk shape carries ONLY the contract field `default_runtime` — the legacy
|
|
321
|
+
// `runtime` mirror is removed (all registry readers switched: telegram → default_runtime, notifier →
|
|
322
|
+
// cwd-only, foundation → default_runtime). Local per-peer profiles keep their mirror until the paired
|
|
323
|
+
// telegram writePeerProfile follow-up.
|
|
321
324
|
const peersForDisk = [...index.peers]
|
|
322
325
|
.sort((a, b) => a.personality.localeCompare(b.personality))
|
|
323
326
|
.map(peer => ({
|
|
324
327
|
personality: peer.personality,
|
|
325
328
|
default_runtime: peer.runtime,
|
|
326
|
-
runtime: peer.runtime,
|
|
327
329
|
runtimes: peer.runtimes,
|
|
328
330
|
description: peer.description,
|
|
329
331
|
intelligence: peer.intelligenceRaw ?? peer.intelligence,
|
package/src/supervisor/paths.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Supervisor session paths — under a configurable run dir (NOT hardcoded). Prod resolves it to
|
|
2
2
|
// ~/.iapeer/state/supervisor via the storage layer; tests pass a temp dir, so the daemon's
|
|
3
3
|
// socket/pid files never touch a real location.
|
|
4
|
-
import { renameSync,
|
|
4
|
+
import { renameSync, writeFileSync } from 'node:fs'
|
|
5
5
|
import { readFileSync } from 'node:fs'
|
|
6
6
|
import { join } from 'node:path'
|
|
7
7
|
import { pluginStateDir } from '../storage/index.ts'
|
|
@@ -57,12 +57,3 @@ export function readGeometry(runDir: string, session: string): { cols: number; r
|
|
|
57
57
|
}
|
|
58
58
|
return null
|
|
59
59
|
}
|
|
60
|
-
|
|
61
|
-
/** Remove the geometry sidecar (shutdown cleanup); best-effort. */
|
|
62
|
-
export function clearGeometry(runDir: string, session: string): void {
|
|
63
|
-
try {
|
|
64
|
-
unlinkSync(geometryPath(runDir, session))
|
|
65
|
-
} catch {
|
|
66
|
-
/* */
|
|
67
|
-
}
|
|
68
|
-
}
|