@agfpd/iapeer 0.1.1 → 0.1.2

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agfpd/iapeer",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Foundation core for the IAPeer multi-agent ecosystem: identity, registry, storage, codec.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -453,8 +453,29 @@ export function ensurePeerProfile(options: EnsurePeerProfileOptions): PeerProfil
453
453
  }
454
454
  const mergedRuntimes = uniqueRuntimes([...existing.runtimes, ...discoveredRuntimes])
455
455
  ensureLocalRuntimeScopes(cwd, mergedRuntimes)
456
- if (mergedRuntimes.length !== existing.runtimes.length) {
457
- const updated = { ...existing, runtimes: mergedRuntimes }
456
+ // RE-PROVISION parity with the new-profile branch: an EXISTING infra peer (a
457
+ // migration / re-provision e.g. `iapeer create arthur --runtime telegram` to move
458
+ // a live telegram human onto the foundation) must ALSO get its always-on plist
459
+ // installed and its intelligence set to the runtime's foundation default
460
+ // (telegram→natural, notifier→absent). The old code only merged runtimes here, so
461
+ // re-provisioning an infra peer wrote NO plist (bootstrap → refused-foreign on the
462
+ // missing plist) and left a stale legacy intelligence — the arthur cutover had to
463
+ // install the plist + flip vocab by hand. Install BEFORE the write so a
464
+ // collision-guard refusal (a foreign plist still sitting at the label) fails loudly
465
+ // and leaves no half-updated profile. Idempotent for our own (sentinel) plist.
466
+ let intelligence = existing.intelligence
467
+ if (isInfraRuntime(options.runtime)) {
468
+ installAlwaysOnPlist({
469
+ personality: existing.personality,
470
+ runtime: options.runtime,
471
+ cwd,
472
+ runtimeBin: options.runtimeBin,
473
+ env: options.env,
474
+ })
475
+ intelligence = defaultIntelligenceForRuntime(options.runtime)
476
+ }
477
+ if (mergedRuntimes.length !== existing.runtimes.length || intelligence !== existing.intelligence) {
478
+ const updated = { ...existing, runtimes: mergedRuntimes, intelligence }
458
479
  writePeerProfileAtomic(cwd, updated)
459
480
  return updated
460
481
  }