@mnemom/mnemom 0.7.1 → 0.8.0

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/dist/index.js CHANGED
@@ -1,42 +1,19 @@
1
1
  #!/usr/bin/env node
2
2
  import { program } from "commander";
3
- import { initCommand } from "./commands/init.js";
4
3
  import { statusCommand } from "./commands/status.js";
5
4
  import { integrityCommand } from "./commands/integrity.js";
6
5
  import { logsCommand } from "./commands/logs.js";
7
6
  import { licenseActivateCommand, licenseStatusCommand, licenseDeactivateCommand } from "./commands/license.js";
8
- import { cardShowCommand, cardPublishCommand, cardValidateCommand } from "./commands/card.js";
7
+ import { cardShowCommand, cardPublishCommand, cardValidateCommand, cardEditCommand, cardEvaluateCommand } from "./commands/card.js";
9
8
  import { policyInitCommand, policyValidateCommand, policyPublishCommand, policyListCommand, policyTestCommand, policyEvaluateCommand, } from "./commands/policy.js";
10
- import { registerCommand } from "./commands/register.js";
11
- import { agentsListCommand, agentsRemoveCommand, agentsAddCommand, agentsDefaultCommand, agentsRekeyCommand, agentsCheckBindingCommand } from "./commands/agents.js";
9
+ import { protectionShowCommand, protectionPublishCommand, protectionValidateCommand, protectionEditCommand } from "./commands/protection.js";
10
+ import { agentsListCommand } from "./commands/agents.js";
12
11
  import { loginCommand, logoutCommand, whoamiCommand } from "./commands/auth.js";
13
- import { makeMigrateConfigCommand } from "./commands/migrate-config.js";
14
12
  program
15
13
  .name("mnemom")
16
- .description("Transparent AI agent tracing - AAP compliant")
17
- .version("0.6.0")
18
- .option("--agent <name>", "Select agent by name");
19
- program
20
- .command("init")
21
- .description("Initialize smoltbot for traced mode (interactive, --openclaw, or --standalone)")
22
- .option("-y, --yes", "Skip confirmation prompts (accept defaults)")
23
- .option("-f, --force", "Force reconfiguration even if already configured")
24
- .option("--openclaw", "Configure using OpenClaw (requires OpenClaw installed)")
25
- .option("--standalone", "Configure standalone (prompt for API keys directly)")
26
- .action(async (options) => {
27
- try {
28
- await initCommand({
29
- yes: options.yes,
30
- force: options.force,
31
- openclaw: options.openclaw,
32
- standalone: options.standalone,
33
- });
34
- }
35
- catch (error) {
36
- console.error("Error:", error instanceof Error ? error.message : error);
37
- process.exit(1);
38
- }
39
- });
14
+ .description("Transparent AI agent tracing")
15
+ .version("0.8.0")
16
+ .option("--agent <name>", "Select agent by name (or set MNEMOM_AGENT)");
40
17
  program
41
18
  .command("status")
42
19
  .description("Show agent status and connection info")
@@ -117,12 +94,15 @@ license
117
94
  process.exit(1);
118
95
  }
119
96
  });
97
+ // ============================================================================
98
+ // Card commands (alignment card)
99
+ // ============================================================================
120
100
  const cardCmd = program
121
101
  .command("card")
122
102
  .description("Manage alignment card");
123
103
  cardCmd
124
104
  .command("show")
125
- .description("Display active alignment card")
105
+ .description("Display alignment card (YAML)")
126
106
  .action(async () => {
127
107
  try {
128
108
  const opts = program.opts();
@@ -134,13 +114,12 @@ cardCmd
134
114
  }
135
115
  });
136
116
  cardCmd
137
- .command("publish")
138
- .argument("<file>", "Path to card JSON file")
139
- .description("Publish alignment card from JSON file")
140
- .action(async (file) => {
117
+ .command("edit")
118
+ .description("Edit alignment card in $EDITOR")
119
+ .action(async () => {
141
120
  try {
142
121
  const opts = program.opts();
143
- await cardPublishCommand(file, opts.agent);
122
+ await cardEditCommand(opts.agent);
144
123
  }
145
124
  catch (error) {
146
125
  console.error("Error:", error instanceof Error ? error.message : error);
@@ -148,198 +127,174 @@ cardCmd
148
127
  }
149
128
  });
150
129
  cardCmd
151
- .command("validate")
152
- .argument("<file>", "Path to card JSON file")
153
- .description("Validate card JSON locally")
154
- .action(async (file) => {
155
- try {
156
- await cardValidateCommand(file);
157
- }
158
- catch (error) {
159
- console.error("Error:", error instanceof Error ? error.message : error);
160
- process.exit(1);
161
- }
162
- });
163
- const policyCmd = program
164
- .command("policy")
165
- .description("Manage policy engine");
166
- policyCmd
167
- .command("init")
168
- .description("Scaffold a policy.json template")
169
- .action(async () => {
170
- try {
171
- await policyInitCommand();
172
- }
173
- catch (error) {
174
- console.error("Error:", error instanceof Error ? error.message : error);
175
- process.exit(1);
176
- }
177
- });
178
- policyCmd
179
- .command("validate")
180
- .argument("<file>", "Path to policy JSON file")
181
- .description("Validate policy locally")
182
- .action(async (file) => {
183
- try {
184
- await policyValidateCommand(file);
185
- }
186
- catch (error) {
187
- console.error("Error:", error instanceof Error ? error.message : error);
188
- process.exit(1);
189
- }
190
- });
191
- policyCmd
192
130
  .command("publish")
193
- .argument("<file>", "Path to policy JSON file")
194
- .description("Validate and publish policy to API")
131
+ .argument("<file>", "Path to alignment card file (YAML or JSON)")
132
+ .description("Publish alignment card")
195
133
  .action(async (file) => {
196
134
  try {
197
135
  const opts = program.opts();
198
- await policyPublishCommand(file, opts.agent);
199
- }
200
- catch (error) {
201
- console.error("Error:", error instanceof Error ? error.message : error);
202
- process.exit(1);
203
- }
204
- });
205
- policyCmd
206
- .command("list")
207
- .description("List active policy for current agent")
208
- .action(async () => {
209
- try {
210
- const opts = program.opts();
211
- await policyListCommand(opts.agent);
136
+ await cardPublishCommand(file, opts.agent);
212
137
  }
213
138
  catch (error) {
214
139
  console.error("Error:", error instanceof Error ? error.message : error);
215
140
  process.exit(1);
216
141
  }
217
142
  });
218
- policyCmd
219
- .command("test")
220
- .argument("<file>", "Path to policy JSON file")
221
- .option("--against-traces", "Test against historical traces")
222
- .description("Dry-run policy against historical traces")
143
+ cardCmd
144
+ .command("validate")
145
+ .argument("<file>", "Path to alignment card file (YAML or JSON)")
146
+ .description("Validate alignment card locally")
223
147
  .action(async (file) => {
224
148
  try {
225
- const opts = program.opts();
226
- await policyTestCommand(file, opts.agent);
149
+ await cardValidateCommand(file);
227
150
  }
228
151
  catch (error) {
229
152
  console.error("Error:", error instanceof Error ? error.message : error);
230
153
  process.exit(1);
231
154
  }
232
155
  });
233
- policyCmd
156
+ cardCmd
234
157
  .command("evaluate")
235
- .argument("<file>", "Path to policy JSON file")
236
- .option("--card <file>", "Path to alignment card JSON file")
158
+ .argument("<file>", "Path to alignment card file (YAML or JSON)")
237
159
  .option("--tools <tools>", "Comma-separated list of tool names")
238
160
  .option("--tool-manifest <file>", "Path to tool manifest JSON file")
239
161
  .option("--strict", "Exit with code 1 on warnings (not just failures)")
240
- .description("Evaluate policy against tools locally (for CI/CD)")
162
+ .description("Evaluate card policy against tools locally (for CI/CD)")
241
163
  .action(async (file, options) => {
242
164
  try {
243
- await policyEvaluateCommand(file, options);
165
+ await cardEvaluateCommand(file, options);
244
166
  }
245
167
  catch (error) {
246
168
  console.error("Error:", error instanceof Error ? error.message : error);
247
169
  process.exit(1);
248
170
  }
249
171
  });
250
- program
251
- .command("register <name>")
252
- .description("Register a new named agent")
253
- .option("--openclaw", "Configure using OpenClaw")
254
- .option("--standalone", "Configure standalone mode")
255
- .option("--set-default", "Set as default agent")
256
- .action(async (name, options) => {
172
+ // ============================================================================
173
+ // Protection card commands
174
+ // ============================================================================
175
+ const protectionCmd = program
176
+ .command("protection")
177
+ .description("Manage protection card");
178
+ protectionCmd
179
+ .command("show")
180
+ .description("Display protection card (YAML)")
181
+ .action(async () => {
257
182
  try {
258
- await registerCommand(name, {
259
- openclaw: options.openclaw,
260
- standalone: options.standalone,
261
- setDefault: options.setDefault,
262
- });
183
+ const opts = program.opts();
184
+ await protectionShowCommand(opts.agent);
263
185
  }
264
186
  catch (error) {
265
187
  console.error("Error:", error instanceof Error ? error.message : error);
266
188
  process.exit(1);
267
189
  }
268
190
  });
269
- const agentsCmd = program
270
- .command("agents")
271
- .description("List and manage registered agents");
272
- agentsCmd
191
+ protectionCmd
192
+ .command("edit")
193
+ .description("Edit protection card in $EDITOR")
273
194
  .action(async () => {
274
195
  try {
275
- await agentsListCommand();
196
+ const opts = program.opts();
197
+ await protectionEditCommand(opts.agent);
276
198
  }
277
199
  catch (error) {
278
200
  console.error("Error:", error instanceof Error ? error.message : error);
279
201
  process.exit(1);
280
202
  }
281
203
  });
282
- agentsCmd
283
- .command("remove <name>")
284
- .description("Remove a registered agent")
285
- .action(async (name) => {
204
+ protectionCmd
205
+ .command("publish")
206
+ .argument("<file>", "Path to protection card file (YAML or JSON)")
207
+ .description("Publish protection card")
208
+ .action(async (file) => {
286
209
  try {
287
- await agentsRemoveCommand(name);
210
+ const opts = program.opts();
211
+ await protectionPublishCommand(file, opts.agent);
288
212
  }
289
213
  catch (error) {
290
214
  console.error("Error:", error instanceof Error ? error.message : error);
291
215
  process.exit(1);
292
216
  }
293
217
  });
294
- agentsCmd
295
- .command("add <name-or-id>")
296
- .description("Register an existing API agent in local config")
297
- .option("--alias <alias>", "Local alias name (default: agent's API name)")
298
- .action(async (nameOrId, options) => {
218
+ protectionCmd
219
+ .command("validate")
220
+ .argument("<file>", "Path to protection card file (YAML or JSON)")
221
+ .description("Validate protection card locally")
222
+ .action(async (file) => {
299
223
  try {
300
- await agentsAddCommand(nameOrId, options.alias);
224
+ await protectionValidateCommand(file);
301
225
  }
302
226
  catch (error) {
303
227
  console.error("Error:", error instanceof Error ? error.message : error);
304
228
  process.exit(1);
305
229
  }
306
230
  });
307
- agentsCmd
308
- .command("default <name>")
309
- .description("Set the default agent")
310
- .action(async (name) => {
311
- try {
312
- await agentsDefaultCommand(name);
313
- }
314
- catch (error) {
315
- console.error("Error:", error instanceof Error ? error.message : error);
316
- process.exit(1);
317
- }
231
+ // ============================================================================
232
+ // Policy commands (removed — stubs with migration guidance)
233
+ // ============================================================================
234
+ const policyCmd = program
235
+ .command("policy")
236
+ .description("(removed) Policy is now part of the alignment card");
237
+ policyCmd
238
+ .command("init")
239
+ .description("(removed) Use `mnemom card validate`")
240
+ .action(async () => { await policyInitCommand(); });
241
+ policyCmd
242
+ .command("validate")
243
+ .argument("<file>", "Path to policy file")
244
+ .description("(removed) Use `mnemom card validate`")
245
+ .action(async (file) => { await policyValidateCommand(file); });
246
+ policyCmd
247
+ .command("publish")
248
+ .argument("<file>", "Path to policy file")
249
+ .description("(removed) Use `mnemom card publish`")
250
+ .action(async (file) => {
251
+ const opts = program.opts();
252
+ await policyPublishCommand(file, opts.agent);
318
253
  });
319
- agentsCmd
320
- .command("rekey [name]")
321
- .description("Re-bind an agent to a new provider API key (key hashed locally, never transmitted)")
322
- .action(async (name) => {
323
- try {
324
- await agentsRekeyCommand(name);
325
- }
326
- catch (error) {
327
- console.error("Error:", error instanceof Error ? error.message : error);
328
- process.exit(1);
329
- }
254
+ policyCmd
255
+ .command("list")
256
+ .description("(removed) Use `mnemom card show`")
257
+ .action(async () => {
258
+ const opts = program.opts();
259
+ await policyListCommand(opts.agent);
330
260
  });
331
- agentsCmd
332
- .command("check-binding [name]")
333
- .description("Verify that a provider API key is bound to an agent (key hashed locally, never transmitted)")
334
- .action(async (name) => {
261
+ policyCmd
262
+ .command("test")
263
+ .argument("<file>", "Path to policy file")
264
+ .description("(removed) Use `mnemom card evaluate`")
265
+ .action(async (file) => {
266
+ const opts = program.opts();
267
+ await policyTestCommand(file, opts.agent);
268
+ });
269
+ policyCmd
270
+ .command("evaluate")
271
+ .argument("<file>", "Path to policy file")
272
+ .option("--card <file>", "Path to card file")
273
+ .option("--tools <tools>", "Comma-separated list of tool names")
274
+ .option("--tool-manifest <file>", "Path to tool manifest JSON file")
275
+ .option("--strict", "Exit with code 1 on warnings")
276
+ .description("(removed) Use `mnemom card evaluate`")
277
+ .action(async (file, options) => {
278
+ await policyEvaluateCommand(file, options);
279
+ });
280
+ // ============================================================================
281
+ // Agent management
282
+ // ============================================================================
283
+ program
284
+ .command("agents")
285
+ .description("List agents in your account")
286
+ .action(async () => {
335
287
  try {
336
- await agentsCheckBindingCommand(name);
288
+ await agentsListCommand();
337
289
  }
338
290
  catch (error) {
339
291
  console.error("Error:", error instanceof Error ? error.message : error);
340
292
  process.exit(1);
341
293
  }
342
294
  });
295
+ // ============================================================================
296
+ // Auth
297
+ // ============================================================================
343
298
  program
344
299
  .command("login")
345
300
  .description("Authenticate with your Mnemom account")
@@ -377,5 +332,4 @@ program
377
332
  process.exit(1);
378
333
  }
379
334
  });
380
- program.addCommand(makeMigrateConfigCommand());
381
335
  program.parse();
package/dist/lib/api.d.ts CHANGED
@@ -131,3 +131,44 @@ export declare function testPolicyHistorical(agentId: string, policyJson: Record
131
131
  skipped: number;
132
132
  };
133
133
  }>;
134
+ /**
135
+ * Fetch the canonical alignment card as YAML (or JSON fallback).
136
+ * Returns the raw response body as a string.
137
+ */
138
+ export declare function getAlignmentCard(agentId: string, format?: "yaml" | "json"): Promise<{
139
+ body: string;
140
+ contentType: string;
141
+ }>;
142
+ /**
143
+ * Publish (create or update) an alignment card.
144
+ * Accepts YAML or JSON body; set contentType accordingly.
145
+ */
146
+ export declare function putAlignmentCard(agentId: string, body: string, contentType?: "text/yaml" | "application/json"): Promise<{
147
+ card_id: string;
148
+ composed: boolean;
149
+ }>;
150
+ /**
151
+ * Fetch the canonical protection card as YAML (or JSON fallback).
152
+ */
153
+ export declare function getProtectionCard(agentId: string, format?: "yaml" | "json"): Promise<{
154
+ body: string;
155
+ contentType: string;
156
+ }>;
157
+ /**
158
+ * Publish (create or update) a protection card.
159
+ */
160
+ export declare function putProtectionCard(agentId: string, body: string, contentType?: "text/yaml" | "application/json"): Promise<{
161
+ card_id: string;
162
+ composed: boolean;
163
+ }>;
164
+ /**
165
+ * Resolve an agent name or ID to a server agent ID.
166
+ *
167
+ * Resolution order:
168
+ * 1. Explicit agentName parameter (--agent flag)
169
+ * 2. MNEMOM_AGENT environment variable
170
+ *
171
+ * If the value looks like an agent ID (smolt-* or mnm-*), uses it directly.
172
+ * Otherwise resolves the name from the authenticated user's agent list.
173
+ */
174
+ export declare function resolveAgentId(agentName?: string): Promise<string>;
package/dist/lib/api.js CHANGED
@@ -82,7 +82,7 @@ export async function listAgents() {
82
82
  const response = await fetch(url, { headers: await authHeaders() });
83
83
  if (!response.ok) {
84
84
  if (response.status === 401) {
85
- throw new Error("Not authenticated. Run `smoltbot login` or set MNEMOM_API_KEY.");
85
+ throw new Error("Not authenticated. Run `mnemom login` or set MNEMOM_API_KEY.");
86
86
  }
87
87
  const err = await response.json().catch(() => ({ error: "unknown" }));
88
88
  throw new Error(err.message || `Failed to list agents: ${response.status}`);
@@ -205,3 +205,133 @@ export async function testPolicyHistorical(agentId, policyJson, limit = 50) {
205
205
  }
206
206
  return response.json();
207
207
  }
208
+ // ============================================================================
209
+ // Unified Card API (UC-4+)
210
+ // ============================================================================
211
+ /**
212
+ * Fetch the canonical alignment card as YAML (or JSON fallback).
213
+ * Returns the raw response body as a string.
214
+ */
215
+ export async function getAlignmentCard(agentId, format = "yaml") {
216
+ const accept = format === "yaml" ? "text/yaml" : "application/json";
217
+ const url = validateUrl(`${API_BASE}/v1/agents/${agentId}/alignment-card`);
218
+ const response = await fetch(url, {
219
+ headers: { Accept: accept, ...(await authHeaders()) },
220
+ });
221
+ if (!response.ok) {
222
+ if (response.status === 404) {
223
+ return { body: "", contentType: "" };
224
+ }
225
+ const error = (await response.json().catch(() => ({
226
+ error: "unknown",
227
+ message: response.statusText,
228
+ })));
229
+ throw new Error(error.message || `Failed to fetch alignment card: ${response.status}`);
230
+ }
231
+ const ct = response.headers.get("content-type") ?? "";
232
+ const body = await response.text();
233
+ return { body, contentType: ct };
234
+ }
235
+ /**
236
+ * Publish (create or update) an alignment card.
237
+ * Accepts YAML or JSON body; set contentType accordingly.
238
+ */
239
+ export async function putAlignmentCard(agentId, body, contentType = "text/yaml") {
240
+ const url = validateUrl(`${API_BASE}/v1/agents/${agentId}/alignment-card`);
241
+ const response = await fetch(url, {
242
+ method: "PUT",
243
+ headers: { "Content-Type": contentType, ...(await authHeaders()) },
244
+ body: sanitizeForHttp(body),
245
+ });
246
+ if (!response.ok) {
247
+ const error = (await response.json().catch(() => ({
248
+ error: "unknown",
249
+ message: response.statusText,
250
+ })));
251
+ throw new Error(error.message || `Failed to publish alignment card: ${response.status}`);
252
+ }
253
+ return response.json();
254
+ }
255
+ /**
256
+ * Fetch the canonical protection card as YAML (or JSON fallback).
257
+ */
258
+ export async function getProtectionCard(agentId, format = "yaml") {
259
+ const accept = format === "yaml" ? "text/yaml" : "application/json";
260
+ const url = validateUrl(`${API_BASE}/v1/agents/${agentId}/protection-card`);
261
+ const response = await fetch(url, {
262
+ headers: { Accept: accept, ...(await authHeaders()) },
263
+ });
264
+ if (!response.ok) {
265
+ if (response.status === 404) {
266
+ return { body: "", contentType: "" };
267
+ }
268
+ const error = (await response.json().catch(() => ({
269
+ error: "unknown",
270
+ message: response.statusText,
271
+ })));
272
+ throw new Error(error.message || `Failed to fetch protection card: ${response.status}`);
273
+ }
274
+ const ct = response.headers.get("content-type") ?? "";
275
+ const body = await response.text();
276
+ return { body, contentType: ct };
277
+ }
278
+ /**
279
+ * Publish (create or update) a protection card.
280
+ */
281
+ export async function putProtectionCard(agentId, body, contentType = "text/yaml") {
282
+ const url = validateUrl(`${API_BASE}/v1/agents/${agentId}/protection-card`);
283
+ const response = await fetch(url, {
284
+ method: "PUT",
285
+ headers: { "Content-Type": contentType, ...(await authHeaders()) },
286
+ body: sanitizeForHttp(body),
287
+ });
288
+ if (!response.ok) {
289
+ const error = (await response.json().catch(() => ({
290
+ error: "unknown",
291
+ message: response.statusText,
292
+ })));
293
+ throw new Error(error.message || `Failed to publish protection card: ${response.status}`);
294
+ }
295
+ return response.json();
296
+ }
297
+ // ============================================================================
298
+ // Agent Resolution (server-side, no local config)
299
+ // ============================================================================
300
+ /**
301
+ * Resolve an agent name or ID to a server agent ID.
302
+ *
303
+ * Resolution order:
304
+ * 1. Explicit agentName parameter (--agent flag)
305
+ * 2. MNEMOM_AGENT environment variable
306
+ *
307
+ * If the value looks like an agent ID (smolt-* or mnm-*), uses it directly.
308
+ * Otherwise resolves the name from the authenticated user's agent list.
309
+ */
310
+ export async function resolveAgentId(agentName) {
311
+ const name = agentName ?? process.env.MNEMOM_AGENT;
312
+ if (!name) {
313
+ console.error("\nAgent required. Use --agent <name> or set MNEMOM_AGENT.\n");
314
+ console.error("List your agents with: mnemom agents\n");
315
+ process.exit(1);
316
+ }
317
+ // If it looks like an agent ID, use directly (no server call needed)
318
+ if (/^(smolt-[0-9a-f]{8}|mnm-[0-9a-f-]{36})$/.test(name)) {
319
+ return name;
320
+ }
321
+ // Resolve name from server (requires auth)
322
+ try {
323
+ const agent = await getAgentByName(name);
324
+ if (agent)
325
+ return agent.id;
326
+ }
327
+ catch (err) {
328
+ const msg = err instanceof Error ? err.message : String(err);
329
+ if (msg.includes("Not authenticated")) {
330
+ console.error(`\nNot authenticated. Run \`mnemom login\` first.\n`);
331
+ process.exit(1);
332
+ }
333
+ }
334
+ console.error(`\nAgent not found: ${name}`);
335
+ console.error("List your agents with: mnemom agents\n");
336
+ process.exit(1);
337
+ }
@@ -1,4 +1,26 @@
1
- import { type AuthTokens } from "./config.js";
1
+ /**
2
+ * Auth credential management.
3
+ *
4
+ * Stores auth tokens in ~/.mnemom/auth.json (UC-9: no more config.json).
5
+ * License JWTs are stored alongside auth tokens.
6
+ */
7
+ export interface AuthTokens {
8
+ accessToken: string;
9
+ refreshToken: string;
10
+ expiresAt: number;
11
+ userId: string;
12
+ email: string;
13
+ }
14
+ export interface AuthStore {
15
+ auth?: AuthTokens;
16
+ licenseJwt?: string;
17
+ }
18
+ export declare function saveAuthTokens(tokens: AuthTokens): void;
19
+ export declare function clearAuthTokens(): void;
20
+ export declare function getAuthInfo(): AuthTokens | null;
21
+ export declare function saveLicenseJwt(jwt: string): void;
22
+ export declare function clearLicenseJwt(): void;
23
+ export declare function getLicenseJwt(): string | null;
2
24
  export type AuthCredential = {
3
25
  type: "jwt";
4
26
  token: string;
@@ -12,8 +34,8 @@ export type AuthCredential = {
12
34
  * Get a valid access token, or null if not authenticated.
13
35
  *
14
36
  * Resolution order:
15
- * 1. SMOLTBOT_TOKEN environment variable (CI / non-interactive)
16
- * 2. Stored token from config (auto-refreshes if expired)
37
+ * 1. MNEMOM_TOKEN environment variable (CI / non-interactive)
38
+ * 2. Stored token from auth store (auto-refreshes if expired)
17
39
  */
18
40
  export declare function getAccessToken(): Promise<string | null>;
19
41
  /**
@@ -21,19 +43,15 @@ export declare function getAccessToken(): Promise<string | null>;
21
43
  */
22
44
  export declare function requireAccessToken(): Promise<string>;
23
45
  /**
24
- * Get the Mnemom API key from env var or config.
25
- *
26
- * Resolution order:
27
- * 1. MNEMOM_API_KEY environment variable
28
- * 2. Stored mnemomApiKey from config
46
+ * Get the Mnemom API key from env var.
29
47
  */
30
48
  export declare function getMnemomApiKey(): string | null;
31
49
  /**
32
50
  * Resolve the best available auth credential.
33
51
  *
34
52
  * Resolution order:
35
- * 1. JWT (SMOLTBOT_TOKEN env or stored token with auto-refresh)
36
- * 2. API key (MNEMOM_API_KEY env or config mnemomApiKey)
53
+ * 1. JWT (MNEMOM_TOKEN env or stored token with auto-refresh)
54
+ * 2. API key (MNEMOM_API_KEY env)
37
55
  * 3. None
38
56
  */
39
57
  export declare function resolveAuth(): Promise<AuthCredential>;
@@ -44,17 +62,8 @@ export declare function requireAuth(): Promise<AuthCredential & {
44
62
  type: "jwt" | "api-key";
45
63
  }>;
46
64
  /**
47
- * Authenticate via browser-based login flow.
48
- *
49
- * 1. Start a local HTTP server on a random port
50
- * 2. Generate a random `state` nonce for CSRF protection
51
- * 3. Open the browser to the API's CLI login page
52
- * 4. Wait for the login page to POST tokens back to localhost
53
- * 5. Verify state, store tokens, and close the server
65
+ * Check if the user is logged in (has any credential).
54
66
  */
67
+ export declare function isLoggedIn(): Promise<boolean>;
55
68
  export declare function loginWithBrowser(): Promise<AuthTokens>;
56
- /**
57
- * Authenticate with email + password via the API auth proxy.
58
- * Used by --no-browser fallback.
59
- */
60
69
  export declare function loginWithPassword(email: string, password: string): Promise<AuthTokens>;