@mnemom/mnemom 0.17.0-next.5 → 0.17.0-next.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.
@@ -1,9 +1,9 @@
1
1
  /**
2
- * `mnemom code setup` + the zero-friction provisioning behind a bare
3
- * `mnemom code <scenario>`.
2
+ * `mnemom agent setup` + the zero-friction provisioning behind a bare
3
+ * `mnemom agent <scenario>`.
4
4
  *
5
- * If a customer names no agent, `mnemom code` launches under a per-customer
6
- * governed identity `code-<handle>`. This module makes that identity REAL in
5
+ * If a customer names no agent, `mnemom agent` launches under a per-customer
6
+ * governed identity `agent-<handle>`. This module makes that identity REAL in
7
7
  * their Mnemom org: it births the agent through the gateway, claims it (so the
8
8
  * customer owns it), and publishes a sane default coding posture. The CARDS are
9
9
  * observe-only (visibility, no active intervention); the goal contract is what
@@ -24,11 +24,19 @@
24
24
  * putAlignmentCard/putProtectionCard (lib/api.ts) — rather than reinventing it.
25
25
  */
26
26
  /**
27
- * The default governed-agent slug for the current customer: `code-<handle>`,
27
+ * The default governed-agent slug for the current customer: `agent-<handle>`,
28
28
  * where <handle> is the local-part of their mnemom login email (sanitised), or
29
29
  * "user" when no email is available (API-key auth / opaque OAuth token).
30
30
  */
31
31
  export declare function defaultAgentSlug(): string;
32
+ /**
33
+ * The default slug resolved from the authenticated IDENTITY: `agent-<handle>` from
34
+ * the login email fetched via `/v1/auth/me`. The CLI's stored OAuth token carries
35
+ * no email, so the sync `defaultAgentSlug()` alone falls back to "agent-user";
36
+ * this fetches the real email once a session exists. Falls back to
37
+ * `defaultAgentSlug()` on any failure. Call it AFTER the session is ensured.
38
+ */
39
+ export declare function resolveDefaultSlug(): Promise<string>;
32
40
  export interface EnsureAgentOptions {
33
41
  /** The already-resolved final agent slug (what rides as x-mnemom-agent). */
34
42
  slug: string;
@@ -52,12 +60,12 @@ export interface EnsureAgentResult {
52
60
  * allowed here (non-interactive without --setup, or not logged in), or when the
53
61
  * customer declines the confirm — in all those cases the launch continues under
54
62
  * the given slug. THROWS only on an actual provisioning failure (birth/claim/
55
- * card write) so the caller can decide whether that is fatal (`mnemom code
63
+ * card write) so the caller can decide whether that is fatal (`mnemom agent
56
64
  * setup`) or a warn-and-continue (a bare launch).
57
65
  */
58
66
  export declare function ensureGovernedAgent(opts: EnsureAgentOptions): Promise<EnsureAgentResult>;
59
- /** `mnemom code setup [--agent <slug>]` — the explicit provisioning entry point. */
60
- export declare function codeSetupCommand(opts?: {
67
+ /** `mnemom agent setup [--agent <slug>]` — the explicit provisioning entry point. */
68
+ export declare function agentSetupCommand(opts?: {
61
69
  agent?: string;
62
70
  }): Promise<void>;
63
71
  /** Thrown when the agent's org has no spendable MU balance. The user-facing
@@ -69,7 +77,7 @@ export declare class MuInsufficientError extends Error {
69
77
  /**
70
78
  * The preamble errors whose guidance is ALREADY printed when thrown — callers
71
79
  * exit 1 quietly instead of re-printing them as "Error: …". One predicate so the
72
- * two catch sites (`mnemom code` and `mnemom code setup`) cannot drift.
80
+ * two catch sites (`mnemom agent` and `mnemom agent setup`) cannot drift.
73
81
  */
74
82
  export declare function isQuietPreambleExit(err: unknown): boolean;
75
83
  /**
@@ -85,7 +93,7 @@ export declare function ensureMnemomSession(opts?: {
85
93
  }): Promise<boolean>;
86
94
  /**
87
95
  * Enforce a positive Mnemom Units balance on the org the agent lives in.
88
- * `mnemom code` has NO free tier — a determined zero/negative balance (or an org
96
+ * `mnemom agent` has NO free tier — a determined zero/negative balance (or an org
89
97
  * with no billing account) is BLOCKED with a portal-style top-up message.
90
98
  * Fails OPEN on an inconclusive error (transient 5xx / network / 403), since the
91
99
  * gateway is the real enforcement and this is a friendly pre-check; hard-blocks
@@ -93,7 +101,7 @@ export declare function ensureMnemomSession(opts?: {
93
101
  */
94
102
  export declare function assertMuBalance(orgId: string, orgLabel: string): Promise<void>;
95
103
  /**
96
- * The shared pre-launch preamble for `mnemom code` (and `mnemom code setup`):
104
+ * The shared pre-launch preamble for `mnemom agent` (and `mnemom agent setup`):
97
105
  * ensure a Mnemom session (login/sign-up), then enforce the MU balance on the
98
106
  * org the agent lives in (default: the user's personal org). Returns the
99
107
  * resolved org so the caller can reuse it. Throws with clear guidance when there
@@ -1,9 +1,9 @@
1
1
  /**
2
- * `mnemom code setup` + the zero-friction provisioning behind a bare
3
- * `mnemom code <scenario>`.
2
+ * `mnemom agent setup` + the zero-friction provisioning behind a bare
3
+ * `mnemom agent <scenario>`.
4
4
  *
5
- * If a customer names no agent, `mnemom code` launches under a per-customer
6
- * governed identity `code-<handle>`. This module makes that identity REAL in
5
+ * If a customer names no agent, `mnemom agent` launches under a per-customer
6
+ * governed identity `agent-<handle>`. This module makes that identity REAL in
7
7
  * their Mnemom org: it births the agent through the gateway, claims it (so the
8
8
  * customer owns it), and publishes a sane default coding posture. The CARDS are
9
9
  * observe-only (visibility, no active intervention); the goal contract is what
@@ -23,21 +23,21 @@
23
23
  * birthThroughGateway (wrap.ts), deriveHashProof (agents.ts), claimAgent +
24
24
  * putAlignmentCard/putProtectionCard (lib/api.ts) — rather than reinventing it.
25
25
  */
26
- import { claimAgent, getAgentByName, getMuBalance, getMyPersonalOrg, MnemomApiError, mintProtectionCapability, putAlignmentCard, putProtectionCard, } from "../lib/api.js";
26
+ import { claimAgent, getAgentByName, getMe, getMuBalance, getMyPersonalOrg, MnemomApiError, mintProtectionCapability, putAlignmentCard, putProtectionCard, } from "../lib/api.js";
27
27
  import { getAuthInfo, isLoggedIn, loginWithBrowser, loginWithDeviceFlow, resolveAuth, } from "../lib/auth.js";
28
28
  import { getActiveOrg } from "../lib/cli-config.js";
29
29
  import { getWebsiteUrl } from "../lib/config.js";
30
30
  import { fmt } from "../lib/format.js";
31
31
  import { askYesNo, isInteractive } from "../lib/prompt.js";
32
- import { resolveGatewayHost, sanitizeAgentName } from "../lib/code.js";
33
- import { configKeySpec, loadCodeConfig, writeCodeConfig } from "../lib/code-config.js";
32
+ import { resolveGatewayHost, sanitizeAgentName } from "../lib/agent.js";
33
+ import { configKeySpec, loadLauncherConfig, writeLauncherConfig } from "../lib/launcher-config.js";
34
34
  import { deriveHashProof } from "./agents.js";
35
35
  import { birthThroughGateway } from "./wrap.js";
36
- import { resolveAnthropicKey } from "./code.js";
37
- import { assertCodeEnabled, CodeNotEnabledError } from "./code-invite.js";
36
+ import { resolveAnthropicKey } from "./agent.js";
37
+ import { assertCodeEnabled, CodeNotEnabledError } from "./agent-invite.js";
38
38
  const say = (line = "") => console.error(line);
39
39
  /**
40
- * The default governed-agent slug for the current customer: `code-<handle>`,
40
+ * The default governed-agent slug for the current customer: `agent-<handle>`,
41
41
  * where <handle> is the local-part of their mnemom login email (sanitised), or
42
42
  * "user" when no email is available (API-key auth / opaque OAuth token).
43
43
  */
@@ -45,7 +45,26 @@ export function defaultAgentSlug() {
45
45
  const email = getAuthInfo()?.email ?? "";
46
46
  const local = email.split("@")[0] ?? "";
47
47
  const handle = sanitizeAgentName(local) || "user";
48
- return `code-${handle}`;
48
+ return `agent-${handle}`;
49
+ }
50
+ /**
51
+ * The default slug resolved from the authenticated IDENTITY: `agent-<handle>` from
52
+ * the login email fetched via `/v1/auth/me`. The CLI's stored OAuth token carries
53
+ * no email, so the sync `defaultAgentSlug()` alone falls back to "agent-user";
54
+ * this fetches the real email once a session exists. Falls back to
55
+ * `defaultAgentSlug()` on any failure. Call it AFTER the session is ensured.
56
+ */
57
+ export async function resolveDefaultSlug() {
58
+ try {
59
+ const email = (await getMe()).email ?? "";
60
+ const handle = sanitizeAgentName(email.split("@")[0] ?? "");
61
+ if (handle)
62
+ return `agent-${handle}`;
63
+ }
64
+ catch {
65
+ // fall through to the token-based best-effort
66
+ }
67
+ return defaultAgentSlug();
49
68
  }
50
69
  /**
51
70
  * Ensure `slug` is a usable governed agent in the customer's org. Returns
@@ -53,7 +72,7 @@ export function defaultAgentSlug() {
53
72
  * allowed here (non-interactive without --setup, or not logged in), or when the
54
73
  * customer declines the confirm — in all those cases the launch continues under
55
74
  * the given slug. THROWS only on an actual provisioning failure (birth/claim/
56
- * card write) so the caller can decide whether that is fatal (`mnemom code
75
+ * card write) so the caller can decide whether that is fatal (`mnemom agent
57
76
  * setup`) or a warn-and-continue (a bare launch).
58
77
  */
59
78
  export async function ensureGovernedAgent(opts) {
@@ -64,11 +83,11 @@ export async function ensureGovernedAgent(opts) {
64
83
  if (loggedIn) {
65
84
  const existing = await getAgentByName(slug).catch(() => null);
66
85
  if (existing) {
67
- // On an EXPLICIT `mnemom code setup`, repair/complete the cards on the
86
+ // On an EXPLICIT `mnemom agent setup`, repair/complete the cards on the
68
87
  // already-claimed agent (e.g. a protection card that failed on a prior run
69
88
  // before we minted its one-time grant). A bare launch leaves it alone.
70
89
  if (opts.setup === true) {
71
- say(fmt.dim(`mnemom code: '${slug}' is already claimed — refreshing its cards.`));
90
+ say(fmt.dim(`mnemom agent: '${slug}' is already claimed — refreshing its cards.`));
72
91
  await publishDefaultCards(existing.id);
73
92
  persistAgentSlug(slug);
74
93
  return { slug, provisioned: true };
@@ -87,8 +106,8 @@ export async function ensureGovernedAgent(opts) {
87
106
  if (opts.setup === true && !interactive) {
88
107
  throw new Error("not authenticated — run `mnemom login` (or set MNEMOM_API_KEY) first.");
89
108
  }
90
- say(fmt.warn(`mnemom code: not logged in — can't provision '${slug}'.`));
91
- say(fmt.dim(" Run `mnemom login`, then `mnemom code setup`. Launching with the unclaimed identity for now."));
109
+ say(fmt.warn(`mnemom agent: not logged in — can't provision '${slug}'.`));
110
+ say(fmt.dim(" Run `mnemom login`, then `mnemom agent setup`. Launching with the unclaimed identity for now."));
92
111
  return { slug, provisioned: false };
93
112
  }
94
113
  // 4. Confirm the plan (interactive runs; --setup non-interactive proceeds).
@@ -101,7 +120,7 @@ export async function ensureGovernedAgent(opts) {
101
120
  say(fmt.label(" Posture:", "observe (alignment + protection observe-only, all surfaces screened); goal contracts nudge"));
102
121
  say(fmt.dim(" Births the agent through the gateway, claims it to your org, and publishes its cards."));
103
122
  if (!(await askYesNo("Provision and claim this agent now?", true))) {
104
- say(fmt.dim(" Skipped — launching under the unclaimed identity. Run `mnemom code setup` anytime."));
123
+ say(fmt.dim(" Skipped — launching under the unclaimed identity. Run `mnemom agent setup` anytime."));
105
124
  return { slug, provisioned: false };
106
125
  }
107
126
  }
@@ -110,7 +129,7 @@ export async function ensureGovernedAgent(opts) {
110
129
  const agentId = await birthThroughGateway(gatewayUrl, "anthropic", slug, opts.anthropicKey);
111
130
  const hashProof = deriveHashProof(opts.anthropicKey, slug);
112
131
  await claimAgent(agentId, { hashProof, orgId: org?.org_id });
113
- say(fmt.success(`mnemom code: claimed '${slug}' (${agentId}) in ${orgLabel}.`));
132
+ say(fmt.success(`mnemom agent: claimed '${slug}' (${agentId}) in ${orgLabel}.`));
114
133
  // Publish the observe-only cards. A card write that can't complete (propagation
115
134
  // right after the claim, or a missing cards:write scope) does NOT abort the
116
135
  // provision — the agent is claimed and governed on whatever landed; we warn how
@@ -162,23 +181,23 @@ async function publishDefaultCards(agentId) {
162
181
  }
163
182
  const prot = await tryPublishCard("protection", () => putProtectionCard(agentId, JSON.stringify(buildCodeProtectionCard(agentId)), "application/json"));
164
183
  if (align.ok && prot.ok) {
165
- say(fmt.success("mnemom code: observe posture published (alignment + protection observe; goal contracts nudge)."));
184
+ say(fmt.success("mnemom agent: observe posture published (alignment + protection observe; goal contracts nudge)."));
166
185
  return;
167
186
  }
168
187
  if (align.ok)
169
- say(fmt.success("mnemom code: alignment card published (observe)."));
188
+ say(fmt.success("mnemom agent: alignment card published (observe)."));
170
189
  for (const c of [align, prot]) {
171
190
  if (c.ok)
172
191
  continue;
173
192
  // Alignment rides a standing cap, so `mnemom card publish` finishes it; the
174
193
  // protection grant is one-time, so re-running setup (which re-mints) is the fix.
175
- const publishCmd = c.name === "alignment" ? "mnemom card publish" : "mnemom code setup";
176
- say(fmt.warn(`mnemom code: couldn't publish the ${c.name} card — ${c.error}`));
194
+ const publishCmd = c.name === "alignment" ? "mnemom card publish" : "mnemom agent setup";
195
+ say(fmt.warn(`mnemom agent: couldn't publish the ${c.name} card — ${c.error}`));
177
196
  say(fmt.dim(` The agent is claimed and running; finish it later with \`${publishCmd}\`.`));
178
197
  }
179
198
  }
180
- /** `mnemom code setup [--agent <slug>]` — the explicit provisioning entry point. */
181
- export async function codeSetupCommand(opts = {}) {
199
+ /** `mnemom agent setup [--agent <slug>]` — the explicit provisioning entry point. */
200
+ export async function agentSetupCommand(opts = {}) {
182
201
  const gatewayHost = resolveGatewayHost(process.env);
183
202
  // Sign in (offer sign-up) and enforce the MU balance before any account write.
184
203
  try {
@@ -190,24 +209,27 @@ export async function codeSetupCommand(opts = {}) {
190
209
  throw err;
191
210
  }
192
211
  const anthropicKey = await resolveAnthropicKey(process.env, { allowPrompt: true });
193
- const slug = opts.agent?.trim() ? sanitizeAgentName(opts.agent.trim()) : defaultAgentSlug();
212
+ // Session exists now, so derive the real handle from /v1/auth/me (not "agent-user").
213
+ const slug = opts.agent?.trim()
214
+ ? sanitizeAgentName(opts.agent.trim())
215
+ : await resolveDefaultSlug();
194
216
  if (!slug)
195
- throw new Error("mnemom code setup: agent slug sanitised to empty — pass --agent <slug>.");
217
+ throw new Error("mnemom agent setup: agent slug sanitised to empty — pass --agent <slug>.");
196
218
  const result = await ensureGovernedAgent({ slug, anthropicKey, setup: true, gatewayHost });
197
219
  if (!result.provisioned) {
198
220
  say(fmt.dim(` '${slug}' is ready (already claimed) or setup was skipped.`));
199
221
  }
200
222
  }
201
223
  function warnUnclaimed(slug) {
202
- say(fmt.warn(`mnemom code: agent '${slug}' is not set up in your org — launching with an UNCLAIMED identity (governance is advisory/fail-open).`));
203
- say(fmt.dim(" Provision it (creates + claims the agent, publishes observe cards): mnemom code setup"));
224
+ say(fmt.warn(`mnemom agent: agent '${slug}' is not set up in your org — launching with an UNCLAIMED identity (governance is advisory/fail-open).`));
225
+ say(fmt.dim(" Provision it (creates + claims the agent, publishes observe cards): mnemom agent setup"));
204
226
  }
205
227
  function persistAgentSlug(slug) {
206
228
  try {
207
- const cfg = loadCodeConfig();
229
+ const cfg = loadLauncherConfig();
208
230
  if (!cfg.agent) {
209
231
  configKeySpec("agent").set(cfg, slug);
210
- writeCodeConfig(cfg);
232
+ writeLauncherConfig(cfg);
211
233
  }
212
234
  }
213
235
  catch {
@@ -228,7 +250,7 @@ export class MuInsufficientError extends Error {
228
250
  /**
229
251
  * The preamble errors whose guidance is ALREADY printed when thrown — callers
230
252
  * exit 1 quietly instead of re-printing them as "Error: …". One predicate so the
231
- * two catch sites (`mnemom code` and `mnemom code setup`) cannot drift.
253
+ * two catch sites (`mnemom agent` and `mnemom agent setup`) cannot drift.
232
254
  */
233
255
  export function isQuietPreambleExit(err) {
234
256
  return err instanceof MuInsufficientError || err instanceof CodeNotEnabledError;
@@ -258,7 +280,7 @@ export async function ensureMnemomSession(opts = {}) {
258
280
  if (!interactive)
259
281
  return false;
260
282
  say(fmt.section("Sign in to Mnemom"));
261
- say(fmt.dim(" mnemom code runs your coding session governed and under your Mnemom account,"));
283
+ say(fmt.dim(" mnemom agent runs your coding session governed and under your Mnemom account,"));
262
284
  say(fmt.dim(" so it shows up in your traces and draws on your org's µ balance."));
263
285
  say(fmt.dim(` New to Mnemom? You can create a free account in the same flow (or at ${getWebsiteUrl()}/signup).`));
264
286
  if (!(await askYesNo("Sign in or create your account now?", true)))
@@ -284,7 +306,7 @@ export async function ensureMnemomSession(opts = {}) {
284
306
  }
285
307
  /**
286
308
  * Enforce a positive Mnemom Units balance on the org the agent lives in.
287
- * `mnemom code` has NO free tier — a determined zero/negative balance (or an org
309
+ * `mnemom agent` has NO free tier — a determined zero/negative balance (or an org
288
310
  * with no billing account) is BLOCKED with a portal-style top-up message.
289
311
  * Fails OPEN on an inconclusive error (transient 5xx / network / 403), since the
290
312
  * gateway is the real enforcement and this is a friendly pre-check; hard-blocks
@@ -313,7 +335,9 @@ export async function assertMuBalance(orgId, orgLabel) {
313
335
  }
314
336
  function safeBigInt(v) {
315
337
  try {
316
- return BigInt(String(v ?? "0").trim().split(".")[0] || "0");
338
+ return BigInt(String(v ?? "0")
339
+ .trim()
340
+ .split(".")[0] || "0");
317
341
  }
318
342
  catch {
319
343
  return 0n;
@@ -327,16 +351,16 @@ function safeBigInt(v) {
327
351
  function printTopUp(orgLabel, balanceMu) {
328
352
  say();
329
353
  say(fmt.warn(`No µ balance — ${orgLabel} is at ${balanceMu} µ.`));
330
- say(fmt.dim(" mnemom code runs on µ, and there's no free tier. Without µ, Mnemom's safety"));
354
+ say(fmt.dim(" mnemom agent runs on µ, and there's no free tier. Without µ, Mnemom's safety"));
331
355
  say(fmt.dim(" features can't run, so the launch is blocked. Top up to launch a governed session:"));
332
356
  say();
333
357
  say(` Top up µ: ${getWebsiteUrl()}/settings/billing`);
334
358
  say(fmt.dim(" If you don't manage billing for this org, ask an admin to top up."));
335
359
  say();
336
- say(fmt.dim(" Your µ balance updates the moment a top-up completes — then re-run `mnemom code`."));
360
+ say(fmt.dim(" Your µ balance updates the moment a top-up completes — then re-run `mnemom agent`."));
337
361
  }
338
362
  /**
339
- * The shared pre-launch preamble for `mnemom code` (and `mnemom code setup`):
363
+ * The shared pre-launch preamble for `mnemom agent` (and `mnemom agent setup`):
340
364
  * ensure a Mnemom session (login/sign-up), then enforce the MU balance on the
341
365
  * org the agent lives in (default: the user's personal org). Returns the
342
366
  * resolved org so the caller can reuse it. Throws with clear guidance when there
@@ -346,14 +370,14 @@ export async function ensureSessionAndBalance(opts) {
346
370
  const interactive = opts.interactive ?? isInteractive();
347
371
  const haveSession = await ensureMnemomSession({ interactive });
348
372
  if (!haveSession) {
349
- throw new Error("mnemom code needs a Mnemom account — it runs your coding session governed and on your org's µ balance.\n" +
373
+ throw new Error("mnemom agent needs a Mnemom account — it runs your coding session governed and on your org's µ balance.\n" +
350
374
  " Sign in: mnemom login (or set MNEMOM_API_KEY)\n" +
351
375
  ` New here? create a free account, then top up µ: ${getWebsiteUrl()}/settings/billing`);
352
376
  }
353
377
  const active = getActiveOrg();
354
378
  const orgId = active?.org_id ?? (await getMyPersonalOrg()).org_id;
355
379
  const orgLabel = active ? `${active.name} (${active.slug})` : "your personal org";
356
- // Invited-cohort gate FIRST: an org that is not enabled for Mnemom Code gets
380
+ // Invited-cohort gate FIRST: an org that is not enabled for Mnemom Agent gets
357
381
  // the invite guidance, not a top-up message (the µ check would be moot).
358
382
  await assertCodeEnabled(orgId, orgLabel);
359
383
  await assertMuBalance(orgId, orgLabel);
@@ -1,5 +1,5 @@
1
1
  /**
2
- * `mnemom code <scenario>` — the CLI's first-class governed-coding-agent launcher.
2
+ * `mnemom agent <scenario>` — the CLI's first-class governed-coding-agent launcher.
3
3
  *
4
4
  * Launches your coding-agent CLI (Claude Code in v1) with its dev-time model
5
5
  * traffic routed through the Mnemom gateway's /anthropic door for observability +
@@ -11,7 +11,7 @@
11
11
  * no router door / Mnemom key). `--cli` selects the executable to run (name or
12
12
  * full path) so codex/cursor/github adapters can be added later.
13
13
  * - The us-2/PROD gateway is the DEFAULT door (https://gateway.mnemom.ai); an
14
- * explicit MNEMOM_CODE_GATEWAY / --gateway still wins, never silently prod.
14
+ * explicit MNEMOM_AGENT_GATEWAY / --gateway still wins, never silently prod.
15
15
  * - Three launch shapes: `terminal` (DEFAULT), `remote-control` (interactive RC
16
16
  * in this terminal), `server` (headless RC dispatcher). RC runs the CLI
17
17
  * UNTOUCHED behind a bundled local TLS proxy (rc-proxy.mjs) — Claude Code
@@ -20,12 +20,12 @@
20
20
  * - yolo (`--dangerously-skip-permissions`) is ON by default; `--no-yolo` opts out.
21
21
  *
22
22
  * The Anthropic key is resolved from a credential source with ZERO 1Password
23
- * dependency (env → the CLI's own ~/.mnemom/code.json store → interactive
23
+ * dependency (env → the CLI's own ~/.mnemom/launcher.json store → interactive
24
24
  * prompt) and placed ONLY in the launched process (an `ANTHROPIC_CUSTOM_HEADERS`
25
25
  * line, or the proxy's stdin under RC). It is never logged, printed, or passed as
26
26
  * an argv value.
27
27
  */
28
- export interface CodeOptions {
28
+ export interface AgentOptions {
29
29
  goal?: string;
30
30
  requirement?: string[];
31
31
  allow?: string[];
@@ -54,7 +54,7 @@ export interface CodeOptions {
54
54
  */
55
55
  setup?: boolean;
56
56
  /**
57
- * Where to source the Anthropic key (from ~/.mnemom/code.toml `key_source`).
57
+ * Where to source the Anthropic key (from ~/.mnemom/launcher.toml `key_source`).
58
58
  * Restricts the default env → store → prompt search: "env" uses env only,
59
59
  * "store" uses env → store (no prompt), "prompt" forces the interactive prompt.
60
60
  * Undefined = the full default order.
@@ -64,13 +64,13 @@ export interface CodeOptions {
64
64
  /** Print the resolved launch plan and exit — no key read, no spawn. */
65
65
  dryRun?: boolean;
66
66
  }
67
- /** Entry point for `mnemom code [scenario]`. Throws on fatal misconfig. */
68
- export declare function codeCommand(scenarioArg: string | undefined, options?: CodeOptions): Promise<void>;
67
+ /** Entry point for `mnemom agent [scenario]`. Throws on fatal misconfig. */
68
+ export declare function agentCommand(scenarioArg: string | undefined, options?: AgentOptions): Promise<void>;
69
69
  /**
70
70
  * Resolve the Anthropic key with NO 1Password dependency (built for external
71
71
  * customer adoption), in order:
72
- * 1. env: MNEMOM_CODE_ANTHROPIC_KEY, else ANTHROPIC_API_KEY
73
- * 2. the CLI's own store: ~/.mnemom/code.json (`anthropic_key`)
72
+ * 1. env: MNEMOM_AGENT_ANTHROPIC_KEY, else ANTHROPIC_API_KEY
73
+ * 2. the CLI's own store: ~/.mnemom/launcher.json (`anthropic_key`)
74
74
  * 3. interactive prompt (masked), offering to save it to the store
75
75
  * Never logged / printed. Throws with guidance when nothing resolves — we refuse
76
76
  * to launch un-routed.
@@ -81,8 +81,8 @@ export declare function resolveAnthropicKey(env: NodeJS.ProcessEnv, opts: {
81
81
  }): Promise<string>;
82
82
  /**
83
83
  * Where an Anthropic key would resolve from RIGHT NOW, without reading its value:
84
- * "env" (MNEMOM_CODE_ANTHROPIC_KEY / ANTHROPIC_API_KEY), "store" (~/.mnemom/code.json),
85
- * or null (would fall to the interactive prompt). For `mnemom code doctor`.
84
+ * "env" (MNEMOM_AGENT_ANTHROPIC_KEY / ANTHROPIC_API_KEY), "store" (~/.mnemom/launcher.json),
85
+ * or null (would fall to the interactive prompt). For `mnemom agent doctor`.
86
86
  */
87
87
  export declare function anthropicKeySource(env?: NodeJS.ProcessEnv): "env" | "store" | null;
88
88
  export interface ResolvedCli {
@@ -92,7 +92,7 @@ export interface ResolvedCli {
92
92
  name: string;
93
93
  }
94
94
  /**
95
- * Resolve which coding-agent CLI to launch. `--cli` (or MNEMOM_CODE_CLI) is a
95
+ * Resolve which coding-agent CLI to launch. `--cli` (or MNEMOM_AGENT_CLI) is a
96
96
  * name or a full path; default "claude". A value with a path separator is used
97
97
  * verbatim (must exist); a bare name is resolved on PATH, then — for claude — the
98
98
  * fnm/nvm/asdf install dirs (a version-manager shim / shell function is absent in
@@ -116,7 +116,7 @@ export interface RcCapability {
116
116
  /**
117
117
  * Can we launch the DEFAULT Remote-Control-in-terminal shape on this machine?
118
118
  * Needs node + openssl (the local proxy mints an ephemeral CA) and a claude
119
- * adapter that advertises `--remote-control`. Used both by `mnemom code doctor`
119
+ * adapter that advertises `--remote-control`. Used both by `mnemom agent doctor`
120
120
  * and by the auto-default selection (a bare launch prefers RC when capable).
121
121
  */
122
122
  export declare function checkRcCapability(cli: ResolvedCli): RcCapability;
@@ -127,7 +127,7 @@ export declare function checkRcCapability(cli: ResolvedCli): RcCapability;
127
127
  * appends `--strict-mcp-config --mcp-config {}` LAST so it wins over any
128
128
  * caller-supplied --mcp-config.
129
129
  */
130
- export declare function buildCliArgs(options: CodeOptions, ctx: {
130
+ export declare function buildCliArgs(options: AgentOptions, ctx: {
131
131
  yolo: boolean;
132
132
  allowCliFlags: boolean;
133
133
  }): string[];