@agfpd/iapeer-memory 0.2.6 → 0.2.7
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 +2 -2
- package/src/commands/init.ts +11 -13
- package/src/commands/uninstall.ts +7 -12
- package/src/commands/update.ts +13 -16
- package/src/slot.ts +4 -52
- package/src/sync-versions.ts +5 -9
- package/src/templates/skills.ts +2 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agfpd/iapeer-memory",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.7",
|
|
4
4
|
"description": "iapeer-memory — peer memory for the iapeer ecosystem: vault, memoryd (index/search/MCP-http), layer-5 context fragments, role doctrines. The package IS the system; the claude/codex plugins are thin session sockets (docs/10-distribution.md, ADR-009).",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"access": "public"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@agfpd/iapeer-memory-core": "0.2.
|
|
30
|
+
"@agfpd/iapeer-memory-core": "0.2.7"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@types/bun": "^1.2.0",
|
package/src/commands/init.ts
CHANGED
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
*
|
|
15
15
|
* Step order: deps → vault → config → binary → templates → role peers +
|
|
16
16
|
* doctrines + roles manifest → fleet map → watcher registration → direct
|
|
17
|
-
* session surfaces sweep (ADR-009 v1.2) → legacy v1.1
|
|
18
|
-
*
|
|
17
|
+
* session surfaces sweep (ADR-009 v1.2) → legacy v1.1 manual hint (the
|
|
18
|
+
* plugin channel is removed, ADR-017) → slot declaration (v1.2 provision
|
|
19
19
|
* command) → native-memory sweep (core verb, soft-skip on old cores) →
|
|
20
20
|
* host-wide guide fragment. Ecosystem steps are skippable (--skip-ecosystem)
|
|
21
21
|
* for sandboxed runs; the binary compile is skippable (--skip-binary) for
|
|
@@ -36,7 +36,7 @@ import { IAPEER_BIN, type Egress } from "../egress.js";
|
|
|
36
36
|
import { memoryPaths } from "../paths.js";
|
|
37
37
|
import { provisionVault, writeDefaultConfig } from "../provision.js";
|
|
38
38
|
import { writeRolesManifest, type RoleEntry } from "../roles.js";
|
|
39
|
-
import {
|
|
39
|
+
import { readSlot, writeSlot, SLOT_PROVIDER } from "../slot.js";
|
|
40
40
|
import { readFleetMap, writeFleetMap } from "../fleet.js";
|
|
41
41
|
import { withProvisionLock } from "../surfaces/lock.js";
|
|
42
42
|
import { sweepProvision } from "../surfaces/sweep.js";
|
|
@@ -470,27 +470,25 @@ export async function cmdInit(argv: string[], egress: Egress): Promise<number> {
|
|
|
470
470
|
}
|
|
471
471
|
}
|
|
472
472
|
|
|
473
|
-
// 8c. v1.1 → v1.2 migration:
|
|
474
|
-
//
|
|
475
|
-
// the direct surfaces
|
|
473
|
+
// 8c. v1.1 → v1.2 migration: the plugin channel is REMOVED (ADR-017) —
|
|
474
|
+
// the package no longer shells the core verb; a v1.1 host gets the
|
|
475
|
+
// manual recipe and the slot migrates ONLY after the direct surfaces
|
|
476
|
+
// landed cleanly (never strand a host with neither channel).
|
|
476
477
|
let migrationBlocked = false;
|
|
477
478
|
if (!flags.skipEcosystem && existingSlot?.plugin) {
|
|
478
479
|
if (!surfacesOk) {
|
|
479
480
|
migrationBlocked = true;
|
|
480
481
|
step(
|
|
481
482
|
"plugin-off",
|
|
482
|
-
"POSTPONED: direct surfaces did not land cleanly —
|
|
483
|
+
"POSTPONED: direct surfaces did not land cleanly — v1.1 slot kept (re-run init after fixing)",
|
|
483
484
|
false,
|
|
484
485
|
);
|
|
485
486
|
} else {
|
|
486
|
-
const off = applyMemoryPlugin(egress, { mode: "off", iapeerBin: flags.iapeerBin });
|
|
487
487
|
step(
|
|
488
488
|
"plugin-off",
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
? "legacy v1.1 session plugin swept off the fleet (memory-plugin off --all)"
|
|
493
|
-
: `legacy plugin off failed (${off.detail.slice(0, 120)}) — manual: iapeer memory-plugin off --all (or per peer: claude plugin uninstall iapeer-memory@agfpd --scope project)`,
|
|
489
|
+
"legacy v1.1 session plugin is NOT auto-removed (channel removed, ADR-017) — manual, per claude peer: " +
|
|
490
|
+
"`claude plugin uninstall iapeer-memory@agfpd --scope project` from its cwd; codex (host-global): " +
|
|
491
|
+
"`codex plugin remove iapeer-memory@agfpd`. Until then it stamps in parallel (idempotent).",
|
|
494
492
|
);
|
|
495
493
|
}
|
|
496
494
|
}
|
|
@@ -21,7 +21,7 @@ import type { Egress } from "../egress.js";
|
|
|
21
21
|
import { memoryPaths } from "../paths.js";
|
|
22
22
|
import { removeBinary } from "../binary.js";
|
|
23
23
|
import { readFleetMap } from "../fleet.js";
|
|
24
|
-
import {
|
|
24
|
+
import { readSlot, removeSlot, SLOT_PROVIDER } from "../slot.js";
|
|
25
25
|
import { withProvisionLock } from "../surfaces/lock.js";
|
|
26
26
|
import { sweepUnprovision } from "../surfaces/sweep.js";
|
|
27
27
|
import { guardedUnlinkSync } from "@agfpd/iapeer-memory-core";
|
|
@@ -130,19 +130,14 @@ export function cmdUninstall(argv: string[], egress: Egress): number {
|
|
|
130
130
|
}
|
|
131
131
|
}
|
|
132
132
|
|
|
133
|
-
// Legacy v1.1 path: the slot still carries a plugin block
|
|
134
|
-
//
|
|
135
|
-
//
|
|
133
|
+
// Legacy v1.1 path: the slot still carries a plugin block. The plugin
|
|
134
|
+
// channel is REMOVED (ADR-017) — no core verb is shelled; the manual
|
|
135
|
+
// recipe works without the slot.
|
|
136
136
|
if (declared.plugin) {
|
|
137
|
-
const off = applyMemoryPlugin(egress, { mode: "off", iapeerBin });
|
|
138
137
|
console.log(
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
: off.ok
|
|
143
|
-
? "legacy session plugin removed across the fleet (memory-plugin off --all; codex side is host-global)"
|
|
144
|
-
: `off not applied (${off.detail.slice(0, 160)}) — manual fallback (works without the slot): per claude peer \`claude plugin uninstall iapeer-memory@agfpd --scope project\` from its cwd; codex (host-global): \`codex plugin remove iapeer-memory@agfpd\``
|
|
145
|
-
}`,
|
|
138
|
+
"plugin : legacy v1.1 session plugin is NOT auto-removed (channel removed, ADR-017) — manual: " +
|
|
139
|
+
"per claude peer `claude plugin uninstall iapeer-memory@agfpd --scope project` from its cwd; " +
|
|
140
|
+
"codex (host-global): `codex plugin remove iapeer-memory@agfpd`",
|
|
146
141
|
);
|
|
147
142
|
}
|
|
148
143
|
}
|
package/src/commands/update.ts
CHANGED
|
@@ -16,10 +16,10 @@
|
|
|
16
16
|
* 5. surfaces — direct per-peer session surfaces sweep over the map
|
|
17
17
|
* (ADR-009 v1.2: the «всё на местах у подключённых пиров»
|
|
18
18
|
* duty — both runtimes, idempotent, repairs drift);
|
|
19
|
-
* 6. plugin-off — v1.1→v1.2 migration:
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
19
|
+
* 6. plugin-off — v1.1→v1.2 migration: a slot still carrying a plugin
|
|
20
|
+
* block gets the MANUAL removal recipe (the plugin
|
|
21
|
+
* channel is removed, ADR-017) — the slot migrates only
|
|
22
|
+
* after surfaces landed cleanly;
|
|
23
23
|
* 7. slot — re-declare in the v1.2 form (provision command blocks,
|
|
24
24
|
* new version — contract obligation);
|
|
25
25
|
* 8. launcher + triggers + guide — regenerate;
|
|
@@ -44,7 +44,7 @@ import type { Egress } from "../egress.js";
|
|
|
44
44
|
import { readFleetMap, writeFleetMap } from "../fleet.js";
|
|
45
45
|
import { memoryPaths } from "../paths.js";
|
|
46
46
|
import { readRolesManifest } from "../roles.js";
|
|
47
|
-
import {
|
|
47
|
+
import { readSlot, writeSlot, SLOT_PROVIDER } from "../slot.js";
|
|
48
48
|
import { withProvisionLock } from "../surfaces/lock.js";
|
|
49
49
|
import { sweepProvision } from "../surfaces/sweep.js";
|
|
50
50
|
import { mcpPort } from "./provision-peer.js";
|
|
@@ -187,28 +187,25 @@ export function cmdUpdate(argv: string[], egress: Egress): number {
|
|
|
187
187
|
}
|
|
188
188
|
}
|
|
189
189
|
|
|
190
|
-
// 6. v1.1 → v1.2 migration (one-shot per host): the
|
|
191
|
-
//
|
|
192
|
-
//
|
|
193
|
-
//
|
|
190
|
+
// 6. v1.1 → v1.2 migration (one-shot per host): the plugin channel is
|
|
191
|
+
// REMOVED (ADR-017) — no core verb is shelled; a v1.1 host gets the
|
|
192
|
+
// manual recipe and the slot migrates ONLY after the direct surfaces
|
|
193
|
+
// landed cleanly (never strand a host with neither channel).
|
|
194
194
|
let migrationBlocked = false;
|
|
195
195
|
if (!slotForeign && existingSlot?.plugin) {
|
|
196
196
|
if (!surfacesOk) {
|
|
197
197
|
migrationBlocked = true;
|
|
198
198
|
step(
|
|
199
199
|
"plugin-off",
|
|
200
|
-
"POSTPONED: direct surfaces did not land cleanly —
|
|
200
|
+
"POSTPONED: direct surfaces did not land cleanly — v1.1 slot kept (fix and re-run update)",
|
|
201
201
|
false,
|
|
202
202
|
);
|
|
203
203
|
} else {
|
|
204
|
-
const off = applyMemoryPlugin(egress, { mode: "off" });
|
|
205
204
|
step(
|
|
206
205
|
"plugin-off",
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
? "legacy v1.1 session plugin swept off the fleet (memory-plugin off --all)"
|
|
211
|
-
: `legacy plugin off failed (${off.detail.slice(0, 120)}) — manual: iapeer memory-plugin off --all`,
|
|
206
|
+
"legacy v1.1 session plugin is NOT auto-removed (channel removed, ADR-017) — manual, per claude peer: " +
|
|
207
|
+
"`claude plugin uninstall iapeer-memory@agfpd --scope project` from its cwd; codex (host-global): " +
|
|
208
|
+
"`codex plugin remove iapeer-memory@agfpd`. Until then it stamps in parallel (idempotent).",
|
|
212
209
|
);
|
|
213
210
|
}
|
|
214
211
|
}
|
package/src/slot.ts
CHANGED
|
@@ -31,7 +31,6 @@
|
|
|
31
31
|
|
|
32
32
|
import fs from "node:fs";
|
|
33
33
|
import path from "node:path";
|
|
34
|
-
import { IAPEER_BIN, type Egress } from "./egress.js";
|
|
35
34
|
import {
|
|
36
35
|
guardedWriteFileSync,
|
|
37
36
|
guardedUnlinkSync,
|
|
@@ -173,54 +172,7 @@ export function removeSlot(slotPath: string): SlotRemoveResult {
|
|
|
173
172
|
return "removed";
|
|
174
173
|
}
|
|
175
174
|
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
* SKIP, not a failure (same contract as watcher.ts iapSend). */
|
|
181
|
-
suppressed?: boolean;
|
|
182
|
-
};
|
|
183
|
-
|
|
184
|
-
/**
|
|
185
|
-
* Fleet-wide install/remove of the slot-declared session plugin via the core
|
|
186
|
-
* verb `iapeer memory-plugin <on|off> --all` (iapeer ≥0.2.25; marketplace
|
|
187
|
-
* ensure + stale-cache retry live INSIDE the verb). The verb derives the
|
|
188
|
-
* plugin identity from the slot declaration — so `on` runs AFTER writeSlot
|
|
189
|
-
* and `off` runs BEFORE removeSlot (agreed order, auto-removal: a dead
|
|
190
|
-
* provider's plugin must not keep injecting).
|
|
191
|
-
*
|
|
192
|
-
* The hard fuse of incident 10.06 (`on --all` mutates the HOST fleet — no
|
|
193
|
-
* sandbox env contains it) lives in the egress constructor now
|
|
194
|
-
* (deny-by-default §4): a refusing handle blocks the spawn here.
|
|
195
|
-
*/
|
|
196
|
-
export function applyMemoryPlugin(
|
|
197
|
-
egress: Egress,
|
|
198
|
-
opts: {
|
|
199
|
-
mode: "on" | "off";
|
|
200
|
-
iapeerBin?: string;
|
|
201
|
-
},
|
|
202
|
-
): MemoryPluginApplyResult {
|
|
203
|
-
const bin = opts.iapeerBin ?? IAPEER_BIN;
|
|
204
|
-
const proc = egress.spawnSync([bin, "memory-plugin", opts.mode, "--all"], {
|
|
205
|
-
explicitBin: opts.iapeerBin !== undefined,
|
|
206
|
-
});
|
|
207
|
-
if (proc.refused) {
|
|
208
|
-
return {
|
|
209
|
-
ok: false,
|
|
210
|
-
suppressed: true,
|
|
211
|
-
detail: "memory-plugin call suppressed (test sandbox)",
|
|
212
|
-
};
|
|
213
|
-
}
|
|
214
|
-
if (proc.spawnError) {
|
|
215
|
-
return { ok: false, detail: `${bin} unavailable: ${proc.spawnError}` };
|
|
216
|
-
}
|
|
217
|
-
if (proc.exitCode !== 0) {
|
|
218
|
-
return {
|
|
219
|
-
ok: false,
|
|
220
|
-
detail:
|
|
221
|
-
(proc.stderr.trim() || proc.stdout.trim() || "").slice(0, 200) ||
|
|
222
|
-
`iapeer memory-plugin exited ${proc.exitCode}`,
|
|
223
|
-
};
|
|
224
|
-
}
|
|
225
|
-
return { ok: true, detail: proc.stdout.trim() };
|
|
226
|
-
}
|
|
175
|
+
// applyMemoryPlugin (the core verb `iapeer memory-plugin <on|off> --all`)
|
|
176
|
+
// was REMOVED with the plugin channel (ADR-017): v1.1 hosts get a manual
|
|
177
|
+
// recipe in init/update/uninstall instead of an auto-sweep. The `plugin`
|
|
178
|
+
// field on the slot type stays — it is the v1.1 READ marker.
|
package/src/sync-versions.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Manifest version sync (docs/10 §Версионная синхронизация): propagate the
|
|
3
3
|
* facade `package/package.json` version into every other manifest of the
|
|
4
|
-
* monorepo — `core/package.json`
|
|
5
|
-
*
|
|
4
|
+
* monorepo — `core/package.json` (the adapter plugin manifests left with
|
|
5
|
+
* the plugin channel, ADR-017). Wired into the npm `version` lifecycle,
|
|
6
|
+
* runnable standalone:
|
|
6
7
|
*
|
|
7
8
|
* bun src/sync-versions.ts
|
|
8
9
|
*
|
|
9
|
-
* Missing manifests are reported and skipped
|
|
10
|
-
* the script must not fail before they exist). The reference
|
|
10
|
+
* Missing manifests are reported and skipped. The reference
|
|
11
11
|
* sync-plugin-version pattern, generalised to N manifests.
|
|
12
12
|
*/
|
|
13
13
|
|
|
@@ -18,11 +18,7 @@ import { guardedWriteFileSync } from "@agfpd/iapeer-memory-core";
|
|
|
18
18
|
export type SyncOutcome = { file: string; action: "updated" | "identical" | "missing" };
|
|
19
19
|
|
|
20
20
|
/** Relative (to the monorepo root) manifests that must carry one version. */
|
|
21
|
-
export const SYNC_TARGETS = [
|
|
22
|
-
"core/package.json",
|
|
23
|
-
"adapters/claude/.claude-plugin/plugin.json",
|
|
24
|
-
"adapters/codex/.codex-plugin/plugin.json",
|
|
25
|
-
] as const;
|
|
21
|
+
export const SYNC_TARGETS = ["core/package.json"] as const;
|
|
26
22
|
|
|
27
23
|
export function syncVersions(opts: {
|
|
28
24
|
rootDir: string;
|
package/src/templates/skills.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Embedded skill files — the DIRECT-surface form of the four session skills
|
|
3
3
|
* (ADR-009 v1.2: direct per-peer surfaces instead of the plugin socket).
|
|
4
|
-
* Bodies are the boris-accepted plugin skills (
|
|
4
|
+
* Bodies are the boris-accepted plugin-era skills (historical provenance:
|
|
5
|
+
* adapters/claude/skills, removed with the plugin channel — ADR-017; spot-
|
|
5
6
|
* checked against the live CLI 10.06) with exactly two deltas:
|
|
6
7
|
*
|
|
7
8
|
* 1. names are namespaced `iapeer-memory-*` (boris design input: direct
|