@cotal-ai/manager 0.171.1 → 0.171.3

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.
Files changed (40) hide show
  1. package/dist/command-dispatch.d.ts +206 -0
  2. package/dist/command-dispatch.d.ts.map +1 -0
  3. package/dist/command-dispatch.js +471 -0
  4. package/dist/command-dispatch.js.map +1 -0
  5. package/dist/manager.d.ts +48 -283
  6. package/dist/manager.d.ts.map +1 -1
  7. package/dist/manager.js +230 -1775
  8. package/dist/manager.js.map +1 -1
  9. package/dist/persona-catalog.d.ts +86 -0
  10. package/dist/persona-catalog.d.ts.map +1 -0
  11. package/dist/persona-catalog.js +325 -0
  12. package/dist/persona-catalog.js.map +1 -0
  13. package/dist/run-hosting.d.ts +5 -2
  14. package/dist/run-hosting.d.ts.map +1 -1
  15. package/dist/run-hosting.js +55 -16
  16. package/dist/run-hosting.js.map +1 -1
  17. package/dist/runtime/index.d.ts +2 -0
  18. package/dist/runtime/index.d.ts.map +1 -1
  19. package/dist/runtime/index.js +22 -0
  20. package/dist/runtime/index.js.map +1 -1
  21. package/dist/seat-launch.d.ts +1 -1
  22. package/dist/seat-launch.d.ts.map +1 -1
  23. package/dist/seat-launch.js +4 -2
  24. package/dist/seat-launch.js.map +1 -1
  25. package/dist/seat-stop.d.ts +232 -0
  26. package/dist/seat-stop.d.ts.map +1 -0
  27. package/dist/seat-stop.js +552 -0
  28. package/dist/seat-stop.js.map +1 -0
  29. package/dist/service-adapter.d.ts.map +1 -1
  30. package/dist/service-adapter.js +14 -5
  31. package/dist/service-adapter.js.map +1 -1
  32. package/dist/spawn-goal.d.ts +77 -0
  33. package/dist/spawn-goal.d.ts.map +1 -0
  34. package/dist/spawn-goal.js +357 -0
  35. package/dist/spawn-goal.js.map +1 -0
  36. package/dist/terminal-input.d.ts +82 -0
  37. package/dist/terminal-input.d.ts.map +1 -0
  38. package/dist/terminal-input.js +266 -0
  39. package/dist/terminal-input.js.map +1 -0
  40. package/package.json +12 -12
@@ -0,0 +1,86 @@
1
+ import type { ControlReply, EpCaller } from "@cotal-ai/core";
2
+ import type { Manager } from "./manager.js";
3
+ /** What {@link PersonaCatalog} reads from the Manager. Every entry is read at use, so a field the Manager
4
+ * assigns after construction is always current, and a Manager method a test replaces is the one that runs. */
5
+ export interface PersonaCatalogDeps {
6
+ agents: () => Manager["agents"];
7
+ execution: () => Manager["execution"];
8
+ meshMode: () => Manager["meshMode"];
9
+ remoteAuthority: () => Manager["remoteAuthority"];
10
+ space: () => Manager["space"];
11
+ userMode: () => Manager["userMode"];
12
+ workspaceRoot: () => Manager["workspaceRoot"];
13
+ executionRefusal: (...args: Parameters<Manager["executionRefusal"]>) => ReturnType<Manager["executionRefusal"]>;
14
+ managedPrincipal: (...args: Parameters<Manager["managedPrincipal"]>) => ReturnType<Manager["managedPrincipal"]>;
15
+ nameError: (...args: Parameters<Manager["nameError"]>) => ReturnType<Manager["nameError"]>;
16
+ spawnBoundRefusal: (...args: Parameters<Manager["spawnBoundRefusal"]>) => ReturnType<Manager["spawnBoundRefusal"]>;
17
+ spawnRun: (...args: Parameters<Manager["spawnRun"]>) => ReturnType<Manager["spawnRun"]>;
18
+ staticSpawnBound: (...args: Parameters<Manager["staticSpawnBound"]>) => ReturnType<Manager["staticSpawnBound"]>;
19
+ }
20
+ /** The persona catalog doors: define, remove, list and show, with the definer's grant check and read reach. */
21
+ export declare class PersonaCatalog {
22
+ private readonly deps;
23
+ constructor(deps: PersonaCatalogDeps);
24
+ private get agents();
25
+ private get execution();
26
+ private get meshMode();
27
+ private get remoteAuthority();
28
+ private get space();
29
+ private get userMode();
30
+ private get workspaceRoot();
31
+ private executionRefusal;
32
+ private managedPrincipal;
33
+ private nameError;
34
+ private spawnBoundRefusal;
35
+ private spawnRun;
36
+ private staticSpawnBound;
37
+ /** Persist a peer-defined persona as config. After this, `start name` auto-discovers
38
+ * .cotal/agents/<name>.md and the connector applies its persona/model at spawn.
39
+ *
40
+ * CONTENT vs POLICY: `owner` has no slot, so a peer cannot claim ownership, and the
41
+ * capabilities the written persona carries, a saved list a redefine keeps included, are bounded
42
+ * against the definer before the write, so a peer can put only what it holds into a persona that
43
+ * a wider spawner might later launch. Channel grants, role, and agent are content: they may
44
+ * arrive as explicit arguments or as a leading frontmatter block inside `persona`. A prompt
45
+ * that starts with `---` is parsed and merged (explicit args win) so the written file has one
46
+ * frontmatter block; a malformed block is refused by name rather than wrapped. A fresh name is
47
+ * created with the owner {@link personaOwner} records. Redefining an EXISTING file is allowed on
48
+ * the privileged tier only if `file.owner == caller`, else admin is required. Fail-closed: an
49
+ * ownerless file (legacy / operator-written) is admin-only. */
50
+ opDefinePersona(args: Record<string, unknown>, caller: string, admin: boolean, authenticated?: EpCaller): Promise<ControlReply>;
51
+ /** Resolve what a persona's definer may put into it, as a check that returns the refusal for
52
+ * capabilities or endpoint commands it does not hold, or `undefined` when it holds them all. The
53
+ * check itself does not yield. An open mesh mints no credential, so nothing is bounded there. A
54
+ * static definer is bounded by its issued evidence, as a spawner is; a user-auth definer by its
55
+ * own ledger row's scope, under the ledger's token rule, with `admin` exempt. A user-auth persona
56
+ * cannot name `endpoints` at all, `[]` included (SPEC 13.15). A hosted manager reads no ledger, so
57
+ * it refuses. A later spawn of the persona is bounded again against its own spawner. */
58
+ private definerGrantRefusal;
59
+ /** Remove one machine-local persona definition without touching any running lifecycle that was
60
+ * launched from it. Removal accepts the catalog's safe filename alphabet without applying the
61
+ * current spawn-name length or user-mode actor rules, so an obsolete invalid-name entry remains
62
+ * repairable. Ownership matches redefine: the recorded owner, or admin for an ownerless file. */
63
+ opRemovePersona(args: Record<string, unknown>, caller: string, admin: boolean): ControlReply;
64
+ /** The owner a fresh wire-defined persona records. A user-auth caller's principal is stable, and
65
+ * so is one of this manager's own seats for its life. Any other static caller, such as the CLI's
66
+ * operator instrument minted for one call, would leave an owner no later call matches, so it
67
+ * records none and the file is operator-owned, as a local `persona create` writes it. A peer
68
+ * joined with its own credential is such a caller too. */
69
+ personaOwner(caller: string): string | undefined;
70
+ /** Whether this caller may READ a catalog card's details (role/model/description/body). Same
71
+ * ownership rule as redefine: owner == caller, or admin. Ownerless / operator-written files are
72
+ * admin-only. Names of parseable files still appear on the list so a definer can see a taken
73
+ * spawn name; details stay off the wire unless this is true. */
74
+ canReadPersona(owner: string | undefined, caller: string, admin: boolean): boolean;
75
+ /** Mesh-side catalog list (#402). Every parseable name is returned so a definer can see a taken
76
+ * spawn name. Role / model / description / owner ride only when the caller could redefine the
77
+ * file (same ownership as `definePersona`); other cards are name-only, so a peer cannot read a
78
+ * prompt it does not own. Unparseable files are omitted for non-admin (no existence leak of a
79
+ * broken card). */
80
+ opListPersonas(caller: string, admin: boolean): ControlReply;
81
+ /** Mesh-side catalog show (#402). Same ownership as list. Unknown, unauthorized, or unparseable
82
+ * names are not-found (no existence or parser-diagnostic leak). The body is included so a peer can
83
+ * inspect a prompt it owns before spawn; policy fields stay off the wire. */
84
+ opShowPersona(args: Record<string, unknown>, caller: string, admin: boolean): ControlReply;
85
+ }
86
+ //# sourceMappingURL=persona-catalog.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"persona-catalog.d.ts","sourceRoot":"","sources":["../src/persona-catalog.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAY,YAAY,EAAE,QAAQ,EAAiC,MAAM,gBAAgB,CAAC;AAItG,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAG5C;+GAC+G;AAC/G,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,MAAM,OAAO,CAAC,QAAQ,CAAC,CAAC;IAChC,SAAS,EAAE,MAAM,OAAO,CAAC,WAAW,CAAC,CAAC;IACtC,QAAQ,EAAE,MAAM,OAAO,CAAC,UAAU,CAAC,CAAC;IACpC,eAAe,EAAE,MAAM,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAClD,KAAK,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;IAC9B,QAAQ,E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,KAAK,QAAQ,GAAmC;IACvD,OAAO,KAAK,aAAa,GAAwC;IACjE,OAAO,CAAC,gBAAgB;IACxB,OAAO,CAAC,gBAAgB;IACxB,OAAO,CAAC,SAAS;IACjB,OAAO,CAAC,iBAAiB;IACzB,OAAO,CAAC,QAAQ;IAChB,OAAO,CAAC,gBAAgB;IAExB;;;;;;;;;;;;oEAYgE;IAC1D,eAAe,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,aAAa,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,YAAY,CAAC;IAqGrI;;;;;;6FAMyF;YAC3E,mBAAmB;IAwBjC;;;sGAGkG;IAClG,eAAe,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,YAAY;IA0C5F;;;;+DAI2D;IAC3D,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAMhD;;;qEAGiE;IACjE,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,OAAO;IAIlF;;;;wBAIoB;IACpB,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,YAAY;IAyB5D;;kFAE8E;IAC9E,aAAa,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,YAAY;CA2B3F"}
@@ -0,0 +1,325 @@
1
+ import { agentFilePath, capabilityWithin, composeWirePersona, copyPersonaEndpoints, EpEnvelopeError, listPersonaCatalog, loadAgentFile, lowerPersonaEndpoints, parsePersonaEndpoints, parsePrincipalKey, personaCatalogDescription, personaCatalogReadable, rejectionText, resolveAuthProvider, saveAgentFile } from "@cotal-ai/core";
2
+ import { userAuthStateDir } from "@cotal-ai/workspace";
3
+ import { existsSync, readFileSync, rmSync } from "node:fs";
4
+ import { parse as parseYaml } from "yaml";
5
+ import { userMeshEndpointsRefusal } from "./seat-launch.js";
6
+ /** The persona catalog doors: define, remove, list and show, with the definer's grant check and read reach. */
7
+ export class PersonaCatalog {
8
+ deps;
9
+ constructor(deps) {
10
+ this.deps = deps;
11
+ }
12
+ // The Manager members these bodies read, under their Manager names. Each reads through its dep at
13
+ // use, so a field the Manager assigns later is current and a method a test replaces on the Manager
14
+ // is the one that runs.
15
+ get agents() { return this.deps.agents(); }
16
+ get execution() { return this.deps.execution(); }
17
+ get meshMode() { return this.deps.meshMode(); }
18
+ get remoteAuthority() { return this.deps.remoteAuthority(); }
19
+ get space() { return this.deps.space(); }
20
+ get userMode() { return this.deps.userMode(); }
21
+ get workspaceRoot() { return this.deps.workspaceRoot(); }
22
+ executionRefusal(...args) { return this.deps.executionRefusal(...args); }
23
+ managedPrincipal(...args) { return this.deps.managedPrincipal(...args); }
24
+ nameError(...args) { return this.deps.nameError(...args); }
25
+ spawnBoundRefusal(...args) { return this.deps.spawnBoundRefusal(...args); }
26
+ spawnRun(...args) { return this.deps.spawnRun(...args); }
27
+ staticSpawnBound(...args) { return this.deps.staticSpawnBound(...args); }
28
+ /** Persist a peer-defined persona as config. After this, `start name` auto-discovers
29
+ * .cotal/agents/<name>.md and the connector applies its persona/model at spawn.
30
+ *
31
+ * CONTENT vs POLICY: `owner` has no slot, so a peer cannot claim ownership, and the
32
+ * capabilities the written persona carries, a saved list a redefine keeps included, are bounded
33
+ * against the definer before the write, so a peer can put only what it holds into a persona that
34
+ * a wider spawner might later launch. Channel grants, role, and agent are content: they may
35
+ * arrive as explicit arguments or as a leading frontmatter block inside `persona`. A prompt
36
+ * that starts with `---` is parsed and merged (explicit args win) so the written file has one
37
+ * frontmatter block; a malformed block is refused by name rather than wrapped. A fresh name is
38
+ * created with the owner {@link personaOwner} records. Redefining an EXISTING file is allowed on
39
+ * the privileged tier only if `file.owner == caller`, else admin is required. Fail-closed: an
40
+ * ownerless file (legacy / operator-written) is admin-only. */
41
+ async opDefinePersona(args, caller, admin, authenticated) {
42
+ if (this.execution === "none")
43
+ throw new EpEnvelopeError("unimplemented", this.executionRefusal());
44
+ const name = String(args.name ?? "").trim();
45
+ if (!name)
46
+ return { ok: false, error: "name required" };
47
+ const nameErr = this.nameError(name);
48
+ if (nameErr)
49
+ return { ok: false, error: nameErr };
50
+ const persona = String(args.persona ?? "").trim();
51
+ if (!persona)
52
+ return { ok: false, error: "persona required" };
53
+ const path = agentFilePath(this.workspaceRoot, name);
54
+ const strList = (v) => {
55
+ if (v === undefined || v === null)
56
+ return undefined;
57
+ return (Array.isArray(v) ? v : [v]).map((x) => String(x));
58
+ };
59
+ const capabilities = strList(args.capabilities);
60
+ let endpointArg;
61
+ try {
62
+ endpointArg = parsePersonaEndpoints(args.endpoints, "define-persona");
63
+ }
64
+ catch (e) {
65
+ return { ok: false, error: rejectionText(e) };
66
+ }
67
+ // Read, authorize and compose against the catalog as it is now. Nothing yields between this and
68
+ // the write, so no other call in this manager can change the file in between. The handler does
69
+ // not serialize with other processes; their writes are outside this single-manager guarantee.
70
+ const compose = () => {
71
+ let existing;
72
+ if (existsSync(path)) {
73
+ try {
74
+ existing = loadAgentFile(path);
75
+ }
76
+ catch (e) {
77
+ return { reply: { ok: false, error: rejectionText(e) } };
78
+ }
79
+ if (!admin && existing.owner !== caller) {
80
+ const owner = existing.owner ? `owned by ${existing.owner}` : "operator-owned (legacy file - no agent owner)";
81
+ return { reply: {
82
+ ok: false, code: "permission-denied", outcome: "not-executed",
83
+ error: `not authorized to redefine ${name}: ${owner}; only its owner or an operator can`,
84
+ details: [{ kind: "ai.cotal.persona-ownership-refused", operatorOwned: existing.owner === undefined }],
85
+ } };
86
+ }
87
+ }
88
+ try {
89
+ return {
90
+ def: composeWirePersona({
91
+ name,
92
+ owner: this.personaOwner(caller),
93
+ prompt: persona,
94
+ model: args.model,
95
+ role: args.role,
96
+ agent: args.agent,
97
+ subscribe: strList(args.subscribe),
98
+ allowSubscribe: strList(args.allowSubscribe),
99
+ allowPublish: strList(args.allowPublish),
100
+ capabilities,
101
+ endpoints: copyPersonaEndpoints(endpointArg),
102
+ }, existing),
103
+ };
104
+ }
105
+ catch (e) {
106
+ return { reply: { ok: false, error: rejectionText(e) } };
107
+ }
108
+ };
109
+ let composed = compose();
110
+ if ("reply" in composed)
111
+ return composed.reply;
112
+ // The bound reads the persona as written, so a redefine that omits `capabilities` or `endpoints`
113
+ // has the list it keeps checked too. Resolving the definer's grant yields, so the catalog is read
114
+ // again after it.
115
+ if (composed.def.capabilities?.length || composed.def.endpoints !== undefined) {
116
+ const refusal = await this.definerGrantRefusal(caller, authenticated);
117
+ composed = compose();
118
+ if ("reply" in composed)
119
+ return composed.reply;
120
+ const kept = composed.def.capabilities ?? [];
121
+ const keptEndpoints = lowerPersonaEndpoints(composed.def.endpoints);
122
+ // A user-auth persona may not name the field at all; elsewhere `[]` hands on nothing to bound.
123
+ const namesEndpoints = composed.def.endpoints !== undefined;
124
+ const refused = kept.length || keptEndpoints.length || (namesEndpoints && this.meshMode === "user")
125
+ ? refusal({ capabilities: kept, endpoints: keptEndpoints, namesEndpoints })
126
+ : undefined;
127
+ if (refused) {
128
+ const fromSaved = [
129
+ ...(capabilities === undefined && kept.length ? ["capabilities"] : []),
130
+ ...(endpointArg === undefined && composed.def.endpoints?.length ? ["endpoints"] : []),
131
+ ];
132
+ return {
133
+ ok: false,
134
+ code: "permission-denied",
135
+ error: fromSaved.length
136
+ ? `${refused} ${fromSaved.map((f) => `\`${f}\``).join(" and ")} come${fromSaved.length === 1 ? "s" : ""} from the saved persona, which a redefine that omits ${fromSaved.length === 1 ? "it keeps" : "them keeps"}; pass what the definer holds, or [] to clear ${fromSaved.length === 1 ? "it" : "them"}.`
137
+ : refused,
138
+ };
139
+ }
140
+ }
141
+ try {
142
+ saveAgentFile(path, composed.def);
143
+ }
144
+ catch (e) {
145
+ return { ok: false, error: rejectionText(e) };
146
+ }
147
+ return { ok: true, data: { name, path } };
148
+ }
149
+ /** Resolve what a persona's definer may put into it, as a check that returns the refusal for
150
+ * capabilities or endpoint commands it does not hold, or `undefined` when it holds them all. The
151
+ * check itself does not yield. An open mesh mints no credential, so nothing is bounded there. A
152
+ * static definer is bounded by its issued evidence, as a spawner is; a user-auth definer by its
153
+ * own ledger row's scope, under the ledger's token rule, with `admin` exempt. A user-auth persona
154
+ * cannot name `endpoints` at all, `[]` included (SPEC 13.15). A hosted manager reads no ledger, so
155
+ * it refuses. A later spawn of the persona is bounded again against its own spawner. */
156
+ async definerGrantRefusal(caller, authenticated) {
157
+ if (this.meshMode === "open")
158
+ return () => undefined;
159
+ if (this.meshMode === "static") {
160
+ const run = await this.spawnRun(authenticated, undefined);
161
+ const bound = await this.staticSpawnBound(authenticated, run !== undefined && "admission" in run ? run : undefined);
162
+ return ({ capabilities, endpoints }) => this.spawnBoundRefusal(bound, { capabilities, ...(endpoints.length ? { endpoints } : {}) }, false, "define-persona");
163
+ }
164
+ if (this.remoteAuthority)
165
+ return ({ capabilities, namesEndpoints }) => namesEndpoints
166
+ ? userMeshEndpointsRefusal("define-persona")
167
+ : capabilities.length ? "define-persona: this manager's user authority is hosted, so it cannot read the definer's grant and its persona can grant no capabilities." : undefined;
168
+ const p = parsePrincipalKey(caller);
169
+ const scope = p ? await resolveAuthProvider().actorScope({ dir: userAuthStateDir(this.workspaceRoot, this.space), owner: p.owner, actor: p.actor }) : undefined;
170
+ return ({ capabilities, namesEndpoints }) => {
171
+ if (namesEndpoints)
172
+ return userMeshEndpointsRefusal("define-persona");
173
+ if (scope?.includes("admin"))
174
+ return undefined;
175
+ const over = capabilities.filter((c) => !capabilityWithin(scope ?? [], c));
176
+ if (!over.length)
177
+ return undefined;
178
+ return scope === undefined
179
+ ? `define-persona: the definer ${caller} has no grant in this space, so its persona can grant nothing. This persona asks for capabilities ${over.join(", ")}.`
180
+ : `define-persona: this persona grants more than the definer holds: capabilities ${over.join(", ")} beyond [${scope.join(", ") || "none"}]. Drop these from the persona, or have the operator widen the definer's grant.`;
181
+ };
182
+ }
183
+ /** Remove one machine-local persona definition without touching any running lifecycle that was
184
+ * launched from it. Removal accepts the catalog's safe filename alphabet without applying the
185
+ * current spawn-name length or user-mode actor rules, so an obsolete invalid-name entry remains
186
+ * repairable. Ownership matches redefine: the recorded owner, or admin for an ownerless file. */
187
+ opRemovePersona(args, caller, admin) {
188
+ if (this.execution === "none")
189
+ throw new EpEnvelopeError("unimplemented", this.executionRefusal());
190
+ const name = String(args.name ?? "").trim();
191
+ if (!name)
192
+ return { ok: false, code: "bad-request", error: "name required" };
193
+ if (!/^[A-Za-z0-9_-]+$/.test(name))
194
+ return { ok: false, code: "bad-request", error: `unsafe persona name ${JSON.stringify(name)} (allowed: letters, digits, _ -)` };
195
+ const path = agentFilePath(this.workspaceRoot, name);
196
+ if (!existsSync(path))
197
+ return { ok: false, code: "not-found", error: `no persona "${name}"` };
198
+ let owner;
199
+ try {
200
+ owner = loadAgentFile(path).owner;
201
+ }
202
+ catch {
203
+ // A catalog entry may be invalid for launch solely because an older release admitted a name
204
+ // above today's identity limit. Read only its frontmatter owner without asking the launch
205
+ // parser to accept the identity. This does not make the file spawnable or readable.
206
+ try {
207
+ const source = readFileSync(path, "utf8").replace(/^\uFEFF/, "").replace(/\r\n/g, "\n");
208
+ const match = /^---\n([\s\S]*?)\n---(?:\n|$)/.exec(source);
209
+ if (!match)
210
+ throw new Error("missing frontmatter");
211
+ const frontmatter = parseYaml(match[1]);
212
+ if (!frontmatter || typeof frontmatter !== "object" || Array.isArray(frontmatter))
213
+ throw new Error("frontmatter is not a mapping");
214
+ const fields = frontmatter;
215
+ if (String(fields.name ?? "") !== name)
216
+ throw new Error("frontmatter name differs from the catalog entry");
217
+ if (fields.owner !== undefined && typeof fields.owner !== "string")
218
+ throw new Error("owner is not a string");
219
+ owner = fields.owner;
220
+ }
221
+ catch {
222
+ return { ok: false, code: "not-found", error: `no persona "${name}"` };
223
+ }
224
+ }
225
+ if (!admin && owner !== caller) {
226
+ const heldBy = owner ? `owned by ${owner}` : "operator-owned (legacy file - no agent owner)";
227
+ return { ok: false, code: "permission-denied", error: `not authorized to remove ${name}: ${heldBy}; only its owner or an operator can` };
228
+ }
229
+ try {
230
+ rmSync(path);
231
+ }
232
+ catch (e) {
233
+ if (!existsSync(path))
234
+ return { ok: false, code: "not-found", error: `no persona "${name}"` };
235
+ return { ok: false, error: rejectionText(e) };
236
+ }
237
+ return { ok: true, data: { name } };
238
+ }
239
+ /** The owner a fresh wire-defined persona records. A user-auth caller's principal is stable, and
240
+ * so is one of this manager's own seats for its life. Any other static caller, such as the CLI's
241
+ * operator instrument minted for one call, would leave an owner no later call matches, so it
242
+ * records none and the file is operator-owned, as a local `persona create` writes it. A peer
243
+ * joined with its own credential is such a caller too. */
244
+ personaOwner(caller) {
245
+ if (this.userMode)
246
+ return caller;
247
+ for (const a of this.agents.values())
248
+ if (this.managedPrincipal(a) === caller)
249
+ return caller;
250
+ return undefined;
251
+ }
252
+ /** Whether this caller may READ a catalog card's details (role/model/description/body). Same
253
+ * ownership rule as redefine: owner == caller, or admin. Ownerless / operator-written files are
254
+ * admin-only. Names of parseable files still appear on the list so a definer can see a taken
255
+ * spawn name; details stay off the wire unless this is true. */
256
+ canReadPersona(owner, caller, admin) {
257
+ return personaCatalogReadable(owner, caller, admin);
258
+ }
259
+ /** Mesh-side catalog list (#402). Every parseable name is returned so a definer can see a taken
260
+ * spawn name. Role / model / description / owner ride only when the caller could redefine the
261
+ * file (same ownership as `definePersona`); other cards are name-only, so a peer cannot read a
262
+ * prompt it does not own. Unparseable files are omitted for non-admin (no existence leak of a
263
+ * broken card). */
264
+ opListPersonas(caller, admin) {
265
+ const personas = [];
266
+ for (const e of listPersonaCatalog(this.workspaceRoot)) {
267
+ if (e.error) {
268
+ if (!admin)
269
+ continue;
270
+ personas.push({ name: e.name, error: "unparseable" });
271
+ continue;
272
+ }
273
+ const def = e.def;
274
+ if (!this.canReadPersona(def.owner, caller, admin)) {
275
+ personas.push({ name: e.name });
276
+ continue;
277
+ }
278
+ const description = personaCatalogDescription(def);
279
+ personas.push({
280
+ name: e.name,
281
+ ...(def.role ? { role: def.role } : {}),
282
+ ...(def.model ? { model: def.model } : {}),
283
+ ...(description ? { description } : {}),
284
+ ...(def.owner ? { owner: def.owner } : {}),
285
+ });
286
+ }
287
+ return { ok: true, data: { personas } };
288
+ }
289
+ /** Mesh-side catalog show (#402). Same ownership as list. Unknown, unauthorized, or unparseable
290
+ * names are not-found (no existence or parser-diagnostic leak). The body is included so a peer can
291
+ * inspect a prompt it owns before spawn; policy fields stay off the wire. */
292
+ opShowPersona(args, caller, admin) {
293
+ const name = String(args.name ?? "").trim();
294
+ if (!name)
295
+ return { ok: false, error: "name required" };
296
+ const nameErr = this.nameError(name);
297
+ if (nameErr)
298
+ return { ok: false, error: nameErr };
299
+ const path = agentFilePath(this.workspaceRoot, name);
300
+ if (!existsSync(path))
301
+ return { ok: false, error: `no persona "${name}"` };
302
+ let def;
303
+ try {
304
+ def = loadAgentFile(path);
305
+ }
306
+ catch {
307
+ return { ok: false, error: `no persona "${name}"` };
308
+ }
309
+ if (!this.canReadPersona(def.owner, caller, admin))
310
+ return { ok: false, error: `no persona "${name}"` };
311
+ const description = personaCatalogDescription(def);
312
+ return {
313
+ ok: true,
314
+ data: {
315
+ name,
316
+ ...(def.role ? { role: def.role } : {}),
317
+ ...(def.model ? { model: def.model } : {}),
318
+ ...(description ? { description } : {}),
319
+ ...(def.owner ? { owner: def.owner } : {}),
320
+ ...(def.persona ? { persona: def.persona } : {}),
321
+ },
322
+ };
323
+ }
324
+ }
325
+ //# sourceMappingURL=persona-catalog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"persona-catalog.js","sourceRoot":"","sources":["../src/persona-catalog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa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EAAE,CAAC;QACtD,CAAC;QACD,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC;YAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,eAAe,IAAI,GAAG,EAAE,CAAC;QACxG,MAAM,WAAW,GAAG,yBAAyB,CAAC,GAAG,CAAC,CAAC;QACnD,OAAO;YACL,EAAE,EAAE,IAAI;YACR,IAAI,EAAE;gBACJ,IAAI;gBACJ,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;gBACvC,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;gBAC1C,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;gBACvC,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;gBAC1C,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;aACjD;SACF,CAAC;IACJ,CAAC;CACF"}
@@ -95,6 +95,7 @@ export declare class RunHosting {
95
95
  private readonly launching;
96
96
  private reconciled;
97
97
  private stopping;
98
+ private takeBackRetry;
98
99
  private readonly remote;
99
100
  constructor(ctx: RunHostingContext);
100
101
  /** The one registered run host. Absent means the composition root never imported the runtime,
@@ -217,9 +218,11 @@ export declare class RunHosting {
217
218
  * its status at `running`; a successor resumes each one under a fresh takeover. A run with no
218
219
  * recorded program is left alone and named: nothing can be resumed without its source. Never
219
220
  * fatal to the manager; a run that cannot be taken back is logged, not lost (its journal
220
- * stands). Opens the boot gate on return, whichever way it went: a reconcile that could not
221
- * read the store leaves the family serving, since a later resume by hand is the remedy. */
221
+ * stands). Opens the boot gate after the initial pass, even if the scan failed. */
222
222
  reconcile(): Promise<void>;
223
+ private scheduleTakeBackRetry;
224
+ /** Retry the inventory read, not individual launch failures. No drive is launched until the
225
+ * scan completes, so repeating a failed scan cannot repeat a partial set of launches. */
223
226
  private takeBack;
224
227
  /** Renewal: re-mint every live drive's `run-driver` credential for the SAME nkey and attempt
225
228
  * coordinates when it is past its renewal point; the connection presents the fresh one on its
@@ -1 +1 @@
1
- {"version":3,"file":"run-hosting.d.ts","sourceRoot":"","sources":["../src/run-hosting.ts"],"names":[],"mappings":"AA8CA,OAAO,EAiBL,KAAK,iBAAiB,EAAE,KAAK,yBAAyB,EAQtD,KAAK,eAAe,EAGpB,KAAK,aAAa,EAOlB,KAAK,QAAQ,EACb,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,gBAAgB,EAUrB,KAAK,QAAQ,EAGb,KAAK,gBAAgB,EACrB,KAAK,qBAAqB,EAG1B,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,cAAc,EAGnB,KAAK,aAAa,EAClB,KAAK,SAAS,EAEf,MAAM,gBAAgB,CAAC;AAExB,oFAAoF;AACpF,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IACrC,qEAAqE;IACrE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,kGAAkG;IAClG,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B;wEACoE;IACpE,QAAQ,CAAC,MAAM,EAAE;QAAE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;K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