@mutagent/cli 0.1.228 → 0.1.229
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/bin/cli.js +102 -17
- package/dist/bin/cli.js.map +5 -4
- package/dist/index.js +102 -17
- package/dist/index.js.map +5 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -343,6 +343,91 @@ function buildCreateProviderBody(data) {
|
|
|
343
343
|
return body;
|
|
344
344
|
}
|
|
345
345
|
|
|
346
|
+
// src/lib/sdk-mappers.ts
|
|
347
|
+
import { Provider as SDKProviderEnum } from "@mutagent/sdk/models";
|
|
348
|
+
function isProviderType(value) {
|
|
349
|
+
return PROVIDER_TYPES.includes(value);
|
|
350
|
+
}
|
|
351
|
+
function narrowProviderType(value) {
|
|
352
|
+
return isProviderType(value) ? value : value;
|
|
353
|
+
}
|
|
354
|
+
function toIsoString(value) {
|
|
355
|
+
if (value === null || value === undefined)
|
|
356
|
+
return null;
|
|
357
|
+
return value instanceof Date ? value.toISOString() : value;
|
|
358
|
+
}
|
|
359
|
+
function toAgent(sdk) {
|
|
360
|
+
return {
|
|
361
|
+
id: sdk.id,
|
|
362
|
+
name: sdk.name,
|
|
363
|
+
slug: sdk.slug,
|
|
364
|
+
description: sdk.description,
|
|
365
|
+
systemPrompt: sdk.systemPrompt,
|
|
366
|
+
model: sdk.model,
|
|
367
|
+
maxTurns: sdk.maxTurns,
|
|
368
|
+
permissionMode: sdk.permissionMode,
|
|
369
|
+
allowedTools: sdk.allowedTools,
|
|
370
|
+
disallowedTools: sdk.disallowedTools,
|
|
371
|
+
status: sdk.status,
|
|
372
|
+
isPublic: sdk.isPublic,
|
|
373
|
+
metadata: sdk.metadata,
|
|
374
|
+
tags: sdk.tags,
|
|
375
|
+
createdBy: sdk.createdBy,
|
|
376
|
+
createdAt: toIsoString(sdk.createdAt),
|
|
377
|
+
updatedAt: toIsoString(sdk.updatedAt)
|
|
378
|
+
};
|
|
379
|
+
}
|
|
380
|
+
function toAgentList(sdk) {
|
|
381
|
+
return sdk.map(toAgent);
|
|
382
|
+
}
|
|
383
|
+
function toWorkspace(sdk) {
|
|
384
|
+
return {
|
|
385
|
+
id: sdk.id,
|
|
386
|
+
name: sdk.name,
|
|
387
|
+
description: sdk.description,
|
|
388
|
+
slug: sdk.slug,
|
|
389
|
+
isDefault: sdk.isDefault,
|
|
390
|
+
metadata: sdk.metadata,
|
|
391
|
+
createdBy: sdk.createdBy,
|
|
392
|
+
createdAt: toIsoString(sdk.createdAt),
|
|
393
|
+
updatedAt: toIsoString(sdk.updatedAt)
|
|
394
|
+
};
|
|
395
|
+
}
|
|
396
|
+
function toWorkspaceList(sdk) {
|
|
397
|
+
return sdk.map(toWorkspace);
|
|
398
|
+
}
|
|
399
|
+
function toProvider(sdk) {
|
|
400
|
+
return {
|
|
401
|
+
id: sdk.id,
|
|
402
|
+
name: sdk.name,
|
|
403
|
+
provider: narrowProviderType(sdk.provider),
|
|
404
|
+
hostedFamily: sdk.hostedFamily ?? null,
|
|
405
|
+
baseUrl: sdk.baseUrl,
|
|
406
|
+
isActive: sdk.isActive,
|
|
407
|
+
metadata: sdk.metadata,
|
|
408
|
+
createdBy: sdk.createdBy,
|
|
409
|
+
createdAt: toIsoString(sdk.createdAt),
|
|
410
|
+
updatedAt: toIsoString(sdk.updatedAt)
|
|
411
|
+
};
|
|
412
|
+
}
|
|
413
|
+
function toProviderList(sdk) {
|
|
414
|
+
return sdk.map(toProvider);
|
|
415
|
+
}
|
|
416
|
+
function toProviderTestResult(sdk) {
|
|
417
|
+
return {
|
|
418
|
+
success: sdk.success,
|
|
419
|
+
provider: sdk.provider ?? undefined,
|
|
420
|
+
latencyMs: sdk.latencyMs ?? undefined,
|
|
421
|
+
message: sdk.message,
|
|
422
|
+
error: sdk.error ?? undefined,
|
|
423
|
+
models: sdk.models ?? undefined
|
|
424
|
+
};
|
|
425
|
+
}
|
|
426
|
+
var PROVIDER_TYPES;
|
|
427
|
+
var init_sdk_mappers = __esm(() => {
|
|
428
|
+
PROVIDER_TYPES = Object.values(SDKProviderEnum);
|
|
429
|
+
});
|
|
430
|
+
|
|
346
431
|
// src/lib/sdk-client.ts
|
|
347
432
|
var exports_sdk_client = {};
|
|
348
433
|
__export(exports_sdk_client, {
|
|
@@ -466,7 +551,7 @@ class SDKClientWrapper {
|
|
|
466
551
|
status: filters?.status
|
|
467
552
|
});
|
|
468
553
|
return {
|
|
469
|
-
data: response.result.data,
|
|
554
|
+
data: toAgentList(response.result.data),
|
|
470
555
|
total: response.result.total
|
|
471
556
|
};
|
|
472
557
|
} catch (error) {
|
|
@@ -478,7 +563,7 @@ class SDKClientWrapper {
|
|
|
478
563
|
const response = await this.sdk.agents.getAgent({
|
|
479
564
|
id: parseInt(id, 10)
|
|
480
565
|
});
|
|
481
|
-
return response;
|
|
566
|
+
return toAgent(response);
|
|
482
567
|
} catch (error) {
|
|
483
568
|
this.handleError(error);
|
|
484
569
|
}
|
|
@@ -500,7 +585,7 @@ class SDKClientWrapper {
|
|
|
500
585
|
metadata: data.metadata ?? undefined,
|
|
501
586
|
tags: data.tags ?? undefined
|
|
502
587
|
});
|
|
503
|
-
return response;
|
|
588
|
+
return toAgent(response);
|
|
504
589
|
} catch (error) {
|
|
505
590
|
this.handleError(error);
|
|
506
591
|
}
|
|
@@ -524,7 +609,7 @@ class SDKClientWrapper {
|
|
|
524
609
|
tags: data.tags ?? undefined
|
|
525
610
|
}
|
|
526
611
|
});
|
|
527
|
-
return response;
|
|
612
|
+
return toAgent(response);
|
|
528
613
|
} catch (error) {
|
|
529
614
|
this.handleError(error);
|
|
530
615
|
}
|
|
@@ -543,7 +628,7 @@ class SDKClientWrapper {
|
|
|
543
628
|
const response = await this.sdk.workspaces.listWorkspaces({
|
|
544
629
|
includeInactive: false
|
|
545
630
|
});
|
|
546
|
-
const workspaces = response.workspaces;
|
|
631
|
+
const workspaces = toWorkspaceList(response.workspaces);
|
|
547
632
|
const offset = filters?.offset ?? 0;
|
|
548
633
|
const limit = filters?.limit ?? workspaces.length;
|
|
549
634
|
return {
|
|
@@ -559,7 +644,7 @@ class SDKClientWrapper {
|
|
|
559
644
|
const response = await this.sdk.workspaces.getWorkspace({
|
|
560
645
|
wsId: id
|
|
561
646
|
});
|
|
562
|
-
return response;
|
|
647
|
+
return toWorkspace(response);
|
|
563
648
|
} catch (error) {
|
|
564
649
|
this.handleError(error);
|
|
565
650
|
}
|
|
@@ -570,9 +655,8 @@ class SDKClientWrapper {
|
|
|
570
655
|
provider: filters?.type,
|
|
571
656
|
includeInactive: true
|
|
572
657
|
});
|
|
573
|
-
const
|
|
574
|
-
const
|
|
575
|
-
const total = raw.result?.total ?? raw.total ?? configs.length;
|
|
658
|
+
const configs = toProviderList(response.configs);
|
|
659
|
+
const total = response.total;
|
|
576
660
|
const offset = filters?.offset ?? 0;
|
|
577
661
|
const limit = filters?.limit ?? configs.length;
|
|
578
662
|
return {
|
|
@@ -588,7 +672,7 @@ class SDKClientWrapper {
|
|
|
588
672
|
const response = await this.sdk.providerConfigs.getProvider({
|
|
589
673
|
id
|
|
590
674
|
});
|
|
591
|
-
return response;
|
|
675
|
+
return toProvider(response);
|
|
592
676
|
} catch (error) {
|
|
593
677
|
this.handleError(error);
|
|
594
678
|
}
|
|
@@ -627,19 +711,19 @@ class SDKClientWrapper {
|
|
|
627
711
|
if (this.workspaceResolution === "none" && this.organizationId) {
|
|
628
712
|
try {
|
|
629
713
|
const response = await this.sdk.workspaces.listWorkspaces({ includeInactive: false });
|
|
630
|
-
const workspaces = response.workspaces;
|
|
714
|
+
const workspaces = toWorkspaceList(response.workspaces);
|
|
631
715
|
if (workspaces.length === 1 && workspaces[0]) {
|
|
632
|
-
this.workspaceId =
|
|
716
|
+
this.workspaceId = workspaces[0].id;
|
|
633
717
|
this.workspaceResolution = "sole";
|
|
634
718
|
} else if (workspaces.length > 1) {
|
|
635
719
|
const defaultWs = workspaces.find((ws) => ws.isDefault);
|
|
636
720
|
if (defaultWs) {
|
|
637
|
-
this.workspaceId =
|
|
721
|
+
this.workspaceId = defaultWs.id;
|
|
638
722
|
this.workspaceResolution = "configured";
|
|
639
723
|
} else {
|
|
640
724
|
const first = workspaces[0] ?? undefined;
|
|
641
725
|
if (first) {
|
|
642
|
-
this.workspaceId = this.workspaceId ??
|
|
726
|
+
this.workspaceId = this.workspaceId ?? first.id;
|
|
643
727
|
this.workspaceResolution = "ambiguous";
|
|
644
728
|
}
|
|
645
729
|
}
|
|
@@ -664,7 +748,7 @@ class SDKClientWrapper {
|
|
|
664
748
|
const response = await this.sdk.providerConfigs.testProvider({
|
|
665
749
|
id
|
|
666
750
|
});
|
|
667
|
-
return response;
|
|
751
|
+
return toProviderTestResult(response);
|
|
668
752
|
} catch (error) {
|
|
669
753
|
this.handleError(error);
|
|
670
754
|
}
|
|
@@ -695,7 +779,7 @@ class SDKClientWrapper {
|
|
|
695
779
|
baseUrl: data.baseUrl
|
|
696
780
|
}
|
|
697
781
|
});
|
|
698
|
-
return { ...response, workspaceId };
|
|
782
|
+
return { ...toProvider(response), workspaceId };
|
|
699
783
|
} catch (error) {
|
|
700
784
|
this.handleError(error);
|
|
701
785
|
}
|
|
@@ -777,6 +861,7 @@ var sdkClient = null;
|
|
|
777
861
|
var init_sdk_client = __esm(() => {
|
|
778
862
|
init_errors();
|
|
779
863
|
init_config();
|
|
864
|
+
init_sdk_mappers();
|
|
780
865
|
});
|
|
781
866
|
|
|
782
867
|
// src/index.ts
|
|
@@ -991,5 +1076,5 @@ export {
|
|
|
991
1076
|
ApiError
|
|
992
1077
|
};
|
|
993
1078
|
|
|
994
|
-
//# debugId=
|
|
1079
|
+
//# debugId=0DD0E9CADB40CE1464756E2164756E21
|
|
995
1080
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../src/lib/config.ts", "../src/lib/errors.ts", "../src/lib/provider-request.ts", "../src/lib/sdk-client.ts", "../src/index.ts", "../src/lib/output.ts"],
|
|
3
|
+
"sources": ["../src/lib/config.ts", "../src/lib/errors.ts", "../src/lib/provider-request.ts", "../src/lib/sdk-mappers.ts", "../src/lib/sdk-client.ts", "../src/index.ts", "../src/lib/output.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
5
|
"import { cosmiconfigSync } from 'cosmiconfig';\nimport { z } from 'zod';\nimport { homedir } from 'os';\nimport { join } from 'path';\nimport { existsSync, readFileSync, writeFileSync, mkdirSync } from 'fs';\nimport type { Config } from '../types/index.js';\n\nconst configSchema = z.object({\n apiKey: z.string().optional(),\n endpoint: z.string().default('https://api.mutagent.io'),\n format: z.enum(['table', 'json']).default('table'),\n timeout: z.number().default(30000),\n defaultWorkspace: z.string().optional(),\n defaultWorkspaceSource: z.enum(['user', 'login-inferred']).optional(),\n defaultOrganization: z.string().optional(),\n});\n\n/**\n * Where `defaultWorkspace` came from.\n *\n * `user` — an explicit `mutagent config set workspace <id>`\n * `login-inferred` — chosen FOR the user at login, when the account had several\n * workspaces and none was marked default\n *\n * The distinction exists because a provider write must not land in a workspace\n * nobody chose (FR-CLI-002). Without it the two are indistinguishable in config,\n * so a login-time guess reads as a deliberate choice and the ambiguity gate can\n * never fire — the guess is simply laundered one layer upstream.\n */\nexport type WorkspaceSource = 'user' | 'login-inferred';\n\nconst credentialsSchema = z.object({\n apiKey: z.string().optional(),\n endpoint: z.string().optional(),\n defaultWorkspace: z.string().optional(),\n defaultWorkspaceSource: z.enum(['user', 'login-inferred']).optional(),\n defaultOrganization: z.string().optional(),\n expiresAt: z.string().optional(),\n}).loose();\n\nexport interface FullCredentials {\n apiKey: string;\n endpoint?: string;\n workspaceId?: string;\n organizationId?: string;\n expiresAt?: string;\n}\n\nconst CREDENTIALS_DIR = join(homedir(), '.config', 'mutagent');\nconst CREDENTIALS_FILE = join(CREDENTIALS_DIR, 'credentials.json');\n\nfunction parseJsonSafe<T>(content: string, schema: z.ZodType<T>): T | null {\n try {\n const parsed: unknown = JSON.parse(content);\n return schema.parse(parsed);\n } catch {\n return null;\n }\n}\n\nexport function loadConfig(): Config {\n // Load from cosmiconfig (rc files)\n const explorer = cosmiconfigSync('mutagent');\n const result = explorer.search();\n\n // Safely extract config from cosmiconfig result\n const rcConfig = result?.config as Record<string, unknown> | undefined;\n\n // Load from credentials file\n let credentials: z.infer<typeof credentialsSchema> | null = null;\n if (existsSync(CREDENTIALS_FILE)) {\n credentials = parseJsonSafe(readFileSync(CREDENTIALS_FILE, 'utf-8'), credentialsSchema);\n }\n\n // Merge configs: ENV > credentials > rc files > defaults\n const merged = {\n providers: {},\n environment: 'production',\n ...rcConfig,\n ...credentials,\n apiKey: process.env.MUTAGENT_API_KEY ?? credentials?.apiKey ?? (rcConfig?.apiKey as string | undefined),\n endpoint: process.env.MUTAGENT_ENDPOINT ?? credentials?.endpoint ?? (rcConfig?.endpoint as string | undefined),\n defaultWorkspace: credentials?.defaultWorkspace ?? (rcConfig?.defaultWorkspace as string | undefined),\n // Provenance defaults to 'login-inferred' for anything without an explicit\n // stamp — including rc-file values. An rc file LOOKS like an act of\n // configuration, but `mutagent init` scaffolds it from the same login guess,\n // so trusting it would let logging out and re-initialising UPGRADE a guess\n // into a choice. Only `config set workspace` earns 'user'; everything else\n // is re-verified against the account's real workspaces, which costs a lookup\n // and never costs a credential written somewhere nobody picked.\n defaultWorkspaceSource: credentials?.defaultWorkspace\n ? (credentials.defaultWorkspaceSource ?? 'login-inferred')\n : (rcConfig?.defaultWorkspace ? 'login-inferred' : undefined),\n defaultOrganization: credentials?.defaultOrganization ?? (rcConfig?.defaultOrganization as string | undefined),\n };\n\n return configSchema.parse(merged) as Config;\n}\n\nexport function saveCredentials(apiKey: string, endpoint?: string): void {\n if (!existsSync(CREDENTIALS_DIR)) {\n mkdirSync(CREDENTIALS_DIR, { recursive: true });\n }\n\n const config = loadConfig();\n const credentials = {\n apiKey,\n endpoint: endpoint ?? config.endpoint,\n };\n\n writeFileSync(CREDENTIALS_FILE, JSON.stringify(credentials, null, 2));\n}\n\n/**\n * Save full credentials including workspace and organization info\n * Used by browser auth flow which returns complete credential set\n */\nexport function saveFullCredentials(creds: FullCredentials): void {\n if (!existsSync(CREDENTIALS_DIR)) {\n mkdirSync(CREDENTIALS_DIR, { recursive: true });\n }\n\n // Load existing credentials to preserve any custom settings\n let existingCredentials: Record<string, unknown> = {};\n if (existsSync(CREDENTIALS_FILE)) {\n try {\n existingCredentials = JSON.parse(readFileSync(CREDENTIALS_FILE, 'utf-8')) as Record<string, unknown>;\n } catch {\n // Ignore parse errors, start fresh\n }\n }\n\n // A workspace id arriving through the LOGIN flow was picked for the user, not\n // by them — auth-flow takes `workspaces.find(isDefault) ?? workspaces[0]`.\n // Record that provenance so a provider write can refuse to land in a guessed\n // workspace (FR-CLI-002). An explicit `config set workspace` overwrites\n // this with 'user'. A pre-existing 'user' choice is never downgraded.\n const existingSource = existingCredentials.defaultWorkspaceSource as WorkspaceSource | undefined;\n const workspaceChanged = creds.workspaceId !== undefined\n && creds.workspaceId !== existingCredentials.defaultWorkspace;\n const source: WorkspaceSource | undefined = creds.workspaceId === undefined\n ? existingSource\n : workspaceChanged\n ? 'login-inferred'\n : (existingSource ?? 'login-inferred');\n\n const credentials = {\n ...existingCredentials,\n apiKey: creds.apiKey,\n endpoint: creds.endpoint ?? existingCredentials.endpoint ?? 'https://api.mutagent.io',\n defaultWorkspace: creds.workspaceId ?? existingCredentials.defaultWorkspace,\n defaultWorkspaceSource: source,\n defaultOrganization: creds.organizationId ?? existingCredentials.defaultOrganization,\n expiresAt: creds.expiresAt,\n };\n\n writeFileSync(CREDENTIALS_FILE, JSON.stringify(credentials, null, 2));\n}\n\nexport function clearCredentials(): void {\n if (existsSync(CREDENTIALS_FILE)) {\n writeFileSync(CREDENTIALS_FILE, JSON.stringify({}));\n }\n}\n\nexport function hasCredentials(): boolean {\n if (process.env.MUTAGENT_API_KEY) return true;\n if (!existsSync(CREDENTIALS_FILE)) return false;\n\n const credentials = parseJsonSafe(readFileSync(CREDENTIALS_FILE, 'utf-8'), credentialsSchema);\n return credentials?.apiKey !== undefined && credentials.apiKey !== '';\n}\n\nexport function getApiKey(): string | undefined {\n return process.env.MUTAGENT_API_KEY ?? loadConfig().apiKey;\n}\n\nexport function setDefaultWorkspace(\n workspaceId: string,\n source: WorkspaceSource = 'user'\n): void {\n if (!existsSync(CREDENTIALS_DIR)) {\n mkdirSync(CREDENTIALS_DIR, { recursive: true });\n }\n\n let existingCredentials: Record<string, unknown> = {};\n if (existsSync(CREDENTIALS_FILE)) {\n try {\n existingCredentials = JSON.parse(readFileSync(CREDENTIALS_FILE, 'utf-8')) as Record<string, unknown>;\n } catch {\n // Ignore parse errors, start fresh\n }\n }\n\n const updated = {\n ...existingCredentials,\n defaultWorkspace: workspaceId,\n // Provenance is the CALLER's to state, and defaults to 'user' because the\n // only user-facing caller is `mutagent config set workspace`. Machine\n // callers that pick a workspace FOR the user — `init`'s auto-correction to\n // workspaces[0], for instance — must pass 'login-inferred', or the gate\n // that exists to refuse a guessed workspace is handed a laundered guess.\n defaultWorkspaceSource: source,\n };\n\n writeFileSync(CREDENTIALS_FILE, JSON.stringify(updated, null, 2));\n}\n\nexport function setDefaultOrganization(organizationId: string): void {\n if (!existsSync(CREDENTIALS_DIR)) {\n mkdirSync(CREDENTIALS_DIR, { recursive: true });\n }\n\n let existingCredentials: Record<string, unknown> = {};\n if (existsSync(CREDENTIALS_FILE)) {\n try {\n existingCredentials = JSON.parse(readFileSync(CREDENTIALS_FILE, 'utf-8')) as Record<string, unknown>;\n } catch {\n // Ignore parse errors, start fresh\n }\n }\n\n const updated = {\n ...existingCredentials,\n defaultOrganization: organizationId,\n };\n\n writeFileSync(CREDENTIALS_FILE, JSON.stringify(updated, null, 2));\n}\n",
|
|
6
6
|
"export class MutagentError extends Error {\n constructor(\n public code: string,\n message: string,\n public suggestion?: string,\n public exitCode = 1\n ) {\n super(message);\n this.name = 'MutagentError';\n }\n\n toJSON(): { success: false; error: string; code: string; suggestedAction?: string } {\n return {\n success: false,\n error: this.message,\n code: this.code,\n suggestedAction: this.suggestion,\n };\n }\n}\n\nexport interface AuthenticationErrorOptions {\n suggestions?: string[];\n cause?: Error;\n}\n\nexport const AUTH_REMEDIATION_MESSAGE = [\n 'Authentication required. Options:',\n ' Interactive: mutagent auth login --browser',\n ' Non-interactive: export MUTAGENT_API_KEY=<your-key>',\n ' CI/CD: mutagent auth login --api-key <key>',\n].join('\\n');\n\nexport class AuthenticationError extends MutagentError {\n readonly suggestions: string[];\n override readonly cause?: Error;\n\n constructor(\n message?: string,\n options: AuthenticationErrorOptions = {}\n ) {\n super(\n 'AUTH_REQUIRED',\n message ?? 'Authentication required. Please run \"mutagent auth login\"',\n options.suggestions ? options.suggestions[0] : 'Run: mutagent auth login --browser',\n 2\n );\n this.suggestions = options.suggestions ?? [\n 'mutagent auth login --browser',\n 'export MUTAGENT_API_KEY=<your-key>',\n 'mutagent auth login --api-key <key>',\n ];\n this.suggestion = options.suggestions ? options.suggestions[0] : 'Run: mutagent auth login --browser';\n this.cause = options.cause;\n }\n}\n\nexport class ApiError extends MutagentError {\n readonly statusCode: number;\n\n constructor(status: number, message: string) {\n super(\n `API_${String(status)}`,\n message,\n status === 401 ? 'Check your API key with: mutagent auth status' : undefined,\n 1\n );\n this.statusCode = status;\n }\n}\n\nexport const WORKSPACE_REMEDIATION_MESSAGE = [\n 'Workspace context missing. To fix:',\n ' mutagent config set workspace <workspace-id> # Set default workspace',\n ' mutagent workspaces list # List available workspaces',\n].join('\\n');\n\nexport class WorkspaceContextError extends MutagentError {\n constructor(message?: string) {\n super(\n 'WORKSPACE_REQUIRED',\n message ?? 'Workspace context is required but not configured',\n 'Run: mutagent config set workspace <workspace-id>',\n 3\n );\n }\n}\n\nexport class ValidationError extends MutagentError {\n constructor(message: string) {\n super(\n 'VALIDATION_ERROR',\n message,\n 'Check the command syntax with: mutagent <command> --help',\n 1\n );\n }\n}\n\n// =============================================================================\n// Additional Error Classes for Configuration & Auth System\n// =============================================================================\n\nexport class CredentialsExpiredError extends AuthenticationError {\n readonly expiredAt: Date;\n\n constructor(expiredAt: Date) {\n super();\n this.expiredAt = expiredAt;\n this.code = 'AUTH_EXPIRED';\n this.message = `Credentials expired at ${expiredAt.toISOString()}`;\n this.suggestion = 'Run \"mutagent auth login\" to refresh your credentials';\n }\n}\n\nexport class InvalidApiKeyError extends MutagentError {\n constructor(keyPreview?: string) {\n const preview = keyPreview ? ` (received: \"${keyPreview}...\")` : '';\n super(\n 'INVALID_API_KEY',\n `Invalid API key format${preview}`,\n 'API keys should start with \"sk_\" or \"sk-\" and be at least 20 characters',\n 2\n );\n }\n}\n\nexport interface ConfigErrorOptions {\n cause?: Error;\n suggestions?: string[];\n configPath?: string;\n}\n\nexport class ConfigError extends MutagentError {\n readonly configPath?: string;\n readonly suggestions: string[];\n override readonly cause?: Error;\n\n constructor(\n message: string,\n options: ConfigErrorOptions = {}\n ) {\n super(\n 'CONFIG_ERROR',\n message,\n options.suggestions ? options.suggestions[0] : 'Run \"mutagent config validate\" to check your configuration',\n 3\n );\n this.configPath = options.configPath;\n this.suggestions = options.suggestions ?? ['Run \"mutagent config validate\" to check your configuration'];\n this.suggestion = options.suggestions ? options.suggestions[0] : 'Run \"mutagent config validate\" to check your configuration';\n this.cause = options.cause;\n }\n}\n\nexport class ConfigNotFoundError extends ConfigError {\n constructor(configPath: string) {\n super(\n `Configuration file not found: ${configPath}`,\n { suggestions: ['Create a configuration file with \"mutagent config init\" or use --config'] }\n );\n this.code = 'CONFIG_NOT_FOUND';\n this.suggestion = 'Create a configuration file with \"mutagent config init\" or use --config';\n }\n}\n\nexport class ConfigParseError extends ConfigError {\n readonly parseError: Error;\n\n constructor(\n configPath: string,\n parseError: Error\n ) {\n super(\n `Failed to parse configuration file: ${configPath}`,\n { suggestions: ['Validate your JSON/JavaScript syntax and check for trailing commas'] }\n );\n this.code = 'CONFIG_PARSE_ERROR';\n this.suggestion = 'Validate your JSON/JavaScript syntax and check for trailing commas';\n this.parseError = parseError;\n }\n}\n\nexport interface PermissionErrorOptions {\n cause?: Error;\n}\n\nexport class PermissionError extends MutagentError {\n readonly path?: string;\n readonly operation: string;\n override readonly cause?: Error;\n\n constructor(\n operation: string,\n path?: string,\n options: PermissionErrorOptions = {}\n ) {\n const pathMsg = path ? ` at ${path}` : '';\n super(\n 'PERMISSION_ERROR',\n `Permission denied: ${operation}${pathMsg}`,\n 'Check file permissions and ensure the file is not read-only',\n 8\n );\n this.operation = operation;\n this.path = path;\n this.cause = options.cause;\n }\n}\n\nexport class NetworkError extends MutagentError {\n readonly url?: string;\n readonly statusCode?: number;\n\n constructor(\n message = 'Network error',\n url?: string,\n statusCode?: number\n ) {\n super(\n 'NETWORK_ERROR',\n message,\n 'Check your internet connection and verify the server URL',\n 5\n );\n this.url = url;\n this.statusCode = statusCode;\n }\n}\n\nexport class RateLimitError extends NetworkError {\n readonly retryAfter?: number;\n\n constructor(\n retryAfter?: number\n ) {\n super(\n 'Rate limit exceeded',\n undefined,\n 429\n );\n this.code = 'RATE_LIMIT_ERROR';\n this.suggestion = retryAfter \n ? `Wait ${String(retryAfter)} seconds before retrying`\n : 'Wait a few seconds before retrying';\n this.retryAfter = retryAfter;\n this.exitCode = 6;\n }\n}\n\nexport class NotFoundError extends MutagentError {\n constructor(resource: string, id: string) {\n super(\n 'NOT_FOUND',\n `${resource} not found: ${id}`,\n `Check the ID and try again. List available ${resource.toLowerCase()}s with the appropriate list command.`,\n 1\n );\n }\n}\n\nexport class QuotaExceededError extends MutagentError {\n constructor(message?: string) {\n super(\n 'QUOTA_EXCEEDED',\n message ?? 'Quota exceeded',\n 'Check your plan limits or contact support to upgrade',\n 1\n );\n }\n}\n\nexport class PrerequisiteMissingError extends MutagentError {\n constructor(what: string, howToFix: string) {\n super(\n 'PREREQUISITE_MISSING',\n what,\n howToFix,\n 1\n );\n }\n}\n\nexport class ProviderError extends MutagentError {\n constructor(message: string, suggestion?: string) {\n super(\n 'PROVIDER_ERROR',\n message,\n suggestion ?? 'Check your provider configuration with: mutagent providers list',\n 1\n );\n }\n}\n\n// =============================================================================\n// Error Factory Functions\n// =============================================================================\n\nexport function createErrorFromUnknown(error: unknown): MutagentError {\n if (error instanceof MutagentError) {\n return error;\n }\n\n if (error instanceof Error) {\n return new MutagentError(\n 'UNKNOWN_ERROR',\n error.message,\n undefined,\n 1\n );\n }\n\n return new MutagentError(\n 'UNKNOWN_ERROR',\n typeof error === 'string' ? error : 'An unknown error occurred',\n undefined,\n 1\n );\n}\n\nexport function handleError(error: unknown, isJson: boolean): never {\n if (error instanceof MutagentError) {\n if (isJson) {\n const jsonOutput = error.toJSON();\n // Include remediation info for auth errors\n if (error instanceof AuthenticationError) {\n (jsonOutput as Record<string, unknown>).remediation = {\n interactive: 'mutagent auth login --browser',\n nonInteractive: 'export MUTAGENT_API_KEY=<your-key>',\n ciCd: 'mutagent auth login --api-key <key>',\n };\n }\n // Include remediation info for workspace context errors\n if (error instanceof WorkspaceContextError) {\n (jsonOutput as Record<string, unknown>).remediation = {\n setWorkspace: 'mutagent config set workspace <workspace-id>',\n listWorkspaces: 'mutagent workspaces list',\n };\n }\n // Include auth recovery hint for 403 API errors\n if (error instanceof ApiError && error.statusCode === 403) {\n (jsonOutput as Record<string, unknown>).remediation = {\n interactive: 'mutagent auth login --browser',\n nonInteractive: 'export MUTAGENT_API_KEY=<your-key>',\n checkPermissions: 'Verify your API key has the required permissions',\n };\n }\n // Include _agentGuidance for AI agents to self-correct\n if (error.suggestion) {\n const helpMatch = /^Run:\\s+(mutagent\\s+[^\\n]+--help)/.exec(error.suggestion);\n const helpCommand = helpMatch ? helpMatch[1] : 'mutagent --help';\n (jsonOutput as Record<string, unknown>)._agentGuidance = {\n helpCommand,\n suggestion: error.suggestion,\n };\n }\n console.log(JSON.stringify(jsonOutput, null, 2));\n } else {\n console.error(`Error: ${error.message}`);\n if (error instanceof AuthenticationError) {\n console.error('');\n console.error(AUTH_REMEDIATION_MESSAGE);\n } else if (error instanceof WorkspaceContextError) {\n console.error('');\n console.error(WORKSPACE_REMEDIATION_MESSAGE);\n } else if (error instanceof ApiError && error.statusCode === 403) {\n console.error('');\n console.error('Access denied. To fix:');\n console.error(' mutagent auth login --browser # Re-authenticate');\n console.error(' export MUTAGENT_API_KEY=mt_xxx # Or use a different API key');\n } else if (error instanceof ValidationError) {\n if (error.suggestion) {\n console.error(`Suggestion: ${error.suggestion}`);\n }\n console.error('');\n console.error('Run `mutagent <command> --help` for usage information.');\n } else if (error.suggestion) {\n console.error(`Suggestion: ${error.suggestion}`);\n }\n // Show help hint for missing arguments or invalid input errors\n if (error.code === 'MISSING_ARGUMENTS' || error.code === 'INVALID_ARGUMENTS' || error.code === 'INVALID_INPUT') {\n console.error('');\n console.error('Run `mutagent <command> --help` for usage information.');\n }\n }\n process.exit(error.exitCode);\n }\n\n // Catch Speakeasy SDK internal errors that leaked past sdk-client wrapper\n if (error && typeof error === 'object') {\n const sdkErr = error as { name?: string; rawValue?: unknown; rawMessage?: string; message?: string };\n if (\n sdkErr.name === 'SDKValidationError' ||\n sdkErr.name === 'SDKError' ||\n sdkErr.rawValue !== undefined ||\n sdkErr.rawMessage !== undefined\n ) {\n const friendlyMessage = sdkErr.rawMessage ?? sdkErr.message ?? 'Request failed';\n const wrapped = new MutagentError(\n 'REQUEST_FAILED',\n friendlyMessage,\n 'Check your input and try again. Run the command with --help for usage details.'\n );\n if (isJson) {\n console.log(JSON.stringify(wrapped.toJSON(), null, 2));\n } else {\n console.error(`Error: ${wrapped.message}`);\n if (wrapped.suggestion) {\n console.error(`Suggestion: ${wrapped.suggestion}`);\n }\n }\n process.exit(1);\n }\n }\n\n // Unknown error\n const message = error instanceof Error ? error.message : 'Unknown error';\n if (isJson) {\n console.log(JSON.stringify({ success: false, error: message, code: 'UNKNOWN_ERROR' }, null, 2));\n } else {\n console.error(`Error: ${message}`);\n }\n process.exit(1);\n}\n",
|
|
7
7
|
"/**\n * @fileoverview The provider create-request body, as it goes on the wire.\n * @module @mutagent/cli/lib/provider-request\n *\n * WHY THIS IS ITS OWN MODULE\n * --------------------------\n * Five credential flags once reached no server at all. `createProvider` mapped\n * them into the generated SDK's `metadata`, whose outbound schema types the\n * field `z.object({})`; zod strips unknown keys, so every one was deleted on the\n * way out. Measured: `metadata keys on wire: []`. The operator passed `--region`\n * and the server replied that a region was required.\n *\n * Nothing caught it. `tsc` could not — the generated type is `{}` and\n * `Record<string, unknown>` is assignable to it. The command tests could not —\n * they assert what the command hands the WRAPPER, and the loss happened below\n * that boundary. A 688-case suite stayed green.\n *\n * So the body construction lives here, separate from the client, for one\n * reason: the provider tests replace `lib/sdk-client.js` wholesale via\n * `mock.module()`, and a builder living inside that module could only ever be\n * asserted through its own mock. Here it is reachable unmocked, and the wire\n * shape can be asserted directly.\n */\n\nexport interface CreateProviderRequest {\n name: string;\n provider: string;\n /** Optional: the secret's wire name is per-entry (Vertex uses serviceAccountKey). */\n apiKey?: string;\n baseUrl?: string;\n isDefault?: boolean;\n /** Which hosted family a gateway configuration targets. */\n hostedFamily?: string;\n /** Per-entry credential material, keyed by the catalog's wire names. */\n credentialFields?: Record<string, unknown>;\n}\n\n/**\n * Build the exact JSON body for `POST /api/providers`.\n *\n * Matches the post-#1365 server contract: `credentialFields` and `hostedFamily`\n * are first-class, `apiKey` is optional because the secret's wire name is\n * per-entry, and there is no `scope` — the server derives the tenant from the\n * verified `x-workspace-id` header.\n */\nexport function buildCreateProviderBody(data: CreateProviderRequest): Record<string, unknown> {\n const body: Record<string, unknown> = {\n name: data.name,\n provider: data.provider,\n isDefault: data.isDefault ?? false,\n };\n\n // The secret's wire name is per-entry: ten entries call it `apiKey`, Google\n // Vertex calls it `serviceAccountKey`. The server accepts either the\n // top-level slot or the correspondingly-named key inside credentialFields.\n if (data.apiKey) body.apiKey = data.apiKey;\n if (data.baseUrl) body.baseUrl = data.baseUrl;\n if (data.hostedFamily) body.hostedFamily = data.hostedFamily;\n if (data.credentialFields && Object.keys(data.credentialFields).length > 0) {\n body.credentialFields = data.credentialFields;\n }\n\n return body;\n}\n",
|
|
8
|
-
"// SDK Client wrapper for MutagenT API\n/// <reference lib=\"dom\" />\nimport { Mutagent, HTTPClient } from '@mutagent/sdk';\nimport type { Agent, CreateAgentInput, UpdateAgentInput, Workspace, Provider, ProviderTestResult } from '../types/index.js';\nimport { ApiError, AuthenticationError, MutagentError, WorkspaceContextError } from './errors.js';\nimport { getApiKey, loadConfig, type WorkspaceSource } from './config.js';\nimport { buildCreateProviderBody } from './provider-request.js';\n\n/**\n * SDK Client Wrapper\n *\n * This class wraps the real @mutagent/sdk to provide a consistent interface\n * for CLI commands. It maps the SDK's method signatures to the interface\n * expected by the CLI.\n */\n/**\n * How the active workspace was arrived at.\n *\n * This exists because reads and writes tolerate different amounts of guessing.\n * Listing against a guessed workspace shows you the wrong rows; WRITING a\n * credential into a guessed workspace puts a secret somewhere you did not\n * choose, and the CLI reports success either way. So the resolution PATH is\n * recorded here and the write path refuses anything it had to guess at.\n *\n * - `configured` — came from config, or from a workspace the server marks default\n * - `sole` — the account has exactly one workspace, so there is nothing to guess\n * - `ambiguous` — several workspaces, none marked default; the first was taken\n * - `none` — no workspace could be resolved at all\n */\nexport type WorkspaceResolution = 'configured' | 'sole' | 'ambiguous' | 'none';\n\nclass SDKClientWrapper {\n private sdk: Mutagent;\n private apiKey: string;\n private endpoint: string;\n private workspaceId?: string;\n private organizationId?: string;\n private workspaceResolution: WorkspaceResolution = 'none';\n\n constructor(opts: {\n apiKey: string;\n serverURL?: string;\n workspaceId?: string;\n organizationId?: string;\n workspaceSource?: WorkspaceSource;\n }) {\n this.apiKey = opts.apiKey;\n this.endpoint = opts.serverURL ?? 'http://localhost:3003';\n this.workspaceId = opts.workspaceId;\n this.organizationId = opts.organizationId;\n // A configured id counts as CHOSEN only when the config says a human chose\n // it. Login persists `workspaces.find(isDefault) ?? workspaces[0]` into the\n // same key (auth-flow.ts:167), so treating any configured id as 'configured'\n // laundered that guess into a deliberate choice and the ambiguity gate could\n // never fire. An inferred id is left unresolved here and re-derived against\n // the account's actual workspaces by ensureContext().\n if (opts.workspaceId && opts.workspaceSource === 'user') {\n this.workspaceResolution = 'configured';\n }\n\n // Create HTTP client with tenancy header injection\n const httpClient = new HTTPClient();\n httpClient.addHook(\"beforeRequest\", (req) => {\n if (this.workspaceId) req.headers.set(\"x-workspace-id\", this.workspaceId);\n if (this.organizationId) req.headers.set(\"x-organization-id\", this.organizationId);\n return req;\n });\n\n this.sdk = new Mutagent({\n security: {\n apiKey: this.apiKey,\n },\n serverURL: this.endpoint,\n httpClient,\n });\n }\n\n /**\n * Helper to handle SDK errors and convert them to CLI errors.\n * Masks Speakeasy SDK internal errors (SDKValidationError, SDKError, etc.)\n * so users see clean, actionable messages instead of raw stack traces.\n */\n private handleError(error: unknown): never {\n if (error && typeof error === 'object') {\n const err = error as { statusCode?: number; message?: string; body?: string; name?: string; rawValue?: unknown; rawMessage?: string };\n\n if (err.statusCode === 401) {\n throw new AuthenticationError();\n }\n if (err.statusCode === 403) {\n throw new ApiError(403, err.message ?? err.body ?? 'Access denied');\n }\n\n // Detect workspace/org context errors from the server\n const errMessage = (err.message ?? err.body ?? '').toLowerCase();\n if (\n errMessage.includes('workspace') && (errMessage.includes('missing') || errMessage.includes('required')) ||\n errMessage.includes('x-workspace-id')\n ) {\n throw new WorkspaceContextError(err.message ?? err.body ?? undefined);\n }\n\n if (err.statusCode) {\n throw new ApiError(err.statusCode, err.message ?? err.body ?? 'Unknown error');\n }\n\n // Catch Speakeasy SDK internal errors (SDKValidationError, SDKError, etc.)\n if (\n err.name === 'SDKValidationError' ||\n err.name === 'SDKError' ||\n err.rawValue !== undefined ||\n err.rawMessage !== undefined\n ) {\n const friendlyMessage = err.rawMessage ?? err.message ?? 'Request failed';\n throw new MutagentError(\n 'REQUEST_FAILED',\n friendlyMessage,\n 'Check your input and try again. Run the command with --help for usage details.'\n );\n }\n }\n\n // Catch network errors (fetch failures, DNS resolution, etc.)\n if (error instanceof TypeError && typeof error.message === 'string') {\n if (error.message.includes('fetch') || error.message.includes('network') || error.message.includes('ECONNREFUSED')) {\n throw new MutagentError(\n 'NETWORK_ERROR',\n 'Unable to connect to the Mutagent server',\n 'Check your internet connection and verify the server URL with: mutagent config list'\n );\n }\n }\n\n // Last resort: wrap unknown errors in MutagentError\n if (error instanceof Error) {\n throw new MutagentError(\n 'REQUEST_FAILED',\n error.message,\n 'Run the command with --help for usage details'\n );\n }\n\n throw new MutagentError(\n 'UNKNOWN_ERROR',\n 'An unexpected error occurred',\n 'Run the command with --help for usage details'\n );\n }\n\n /**\n * Helper for direct HTTP requests (for endpoints not yet in SDK)\n */\n private async request<T>(path: string, options?: RequestInit): Promise<T> {\n // Convert Headers object to plain object if needed\n const optHeaders = options?.headers;\n let extraHeaders: Record<string, string> = {};\n if (optHeaders instanceof Headers) {\n optHeaders.forEach((value, key) => {\n extraHeaders[key] = value;\n });\n } else if (optHeaders) {\n extraHeaders = optHeaders as Record<string, string>;\n }\n\n // Build tenancy headers from stored config\n const tenancyHeaders: Record<string, string> = {};\n if (this.workspaceId) tenancyHeaders['x-workspace-id'] = this.workspaceId;\n if (this.organizationId) tenancyHeaders['x-organization-id'] = this.organizationId;\n\n const response = await fetch(`${this.endpoint}${path}`, {\n ...options,\n headers: {\n 'x-api-key': this.apiKey,\n 'Content-Type': 'application/json',\n ...tenancyHeaders,\n ...extraHeaders,\n },\n });\n\n if (!response.ok) {\n if (response.status === 401) {\n throw new AuthenticationError();\n }\n if (response.status === 403) {\n throw new ApiError(403, await response.text() || 'Access denied');\n }\n const error = await response.text();\n // Detect workspace context errors from the server response body\n const errorLower = error.toLowerCase();\n if (\n errorLower.includes('workspace') && (errorLower.includes('missing') || errorLower.includes('required')) ||\n errorLower.includes('x-workspace-id')\n ) {\n throw new WorkspaceContextError(error);\n }\n throw new ApiError(response.status, error);\n }\n\n return response.json() as Promise<T>;\n }\n\n // =========================================================================\n // AGENTS\n // =========================================================================\n\n async listAgents(filters?: { limit?: number; offset?: number; name?: string; status?: string }): Promise<{ data: Agent[]; total: number }> {\n try {\n const response = await this.sdk.agents.listAgents({\n limit: filters?.limit,\n offset: filters?.offset,\n name: filters?.name,\n status: filters?.status,\n });\n return {\n data: response.result.data as unknown as Agent[],\n total: response.result.total,\n };\n } catch (error) {\n this.handleError(error);\n }\n }\n\n async getAgent(id: string): Promise<Agent> {\n try {\n const response = await this.sdk.agents.getAgent({\n id: parseInt(id, 10),\n });\n return response as unknown as Agent;\n } catch (error) {\n this.handleError(error);\n }\n }\n\n async createAgent(data: CreateAgentInput): Promise<Agent> {\n try {\n const response = await this.sdk.agents.createAgent({\n name: data.name,\n slug: data.slug,\n description: data.description ?? undefined,\n systemPrompt: data.systemPrompt,\n model: data.model ?? undefined,\n maxTurns: data.maxTurns ?? undefined,\n permissionMode: data.permissionMode ?? undefined,\n allowedTools: data.allowedTools ?? undefined,\n disallowedTools: data.disallowedTools ?? undefined,\n status: data.status ?? undefined,\n isPublic: data.isPublic ?? undefined,\n metadata: data.metadata ?? undefined,\n tags: data.tags ?? undefined,\n });\n return response as unknown as Agent;\n } catch (error) {\n this.handleError(error);\n }\n }\n\n async updateAgent(id: string, data: UpdateAgentInput): Promise<Agent> {\n try {\n const response = await this.sdk.agents.updateAgent({\n id: parseInt(id, 10),\n body: {\n name: data.name ?? undefined,\n description: data.description ?? undefined,\n systemPrompt: data.systemPrompt ?? undefined,\n model: data.model ?? undefined,\n maxTurns: data.maxTurns ?? undefined,\n permissionMode: data.permissionMode ?? undefined,\n allowedTools: data.allowedTools ?? undefined,\n disallowedTools: data.disallowedTools ?? undefined,\n status: data.status ?? undefined,\n isPublic: data.isPublic ?? undefined,\n metadata: data.metadata ?? undefined,\n tags: data.tags ?? undefined,\n },\n });\n return response as unknown as Agent;\n } catch (error) {\n this.handleError(error);\n }\n }\n\n async deleteAgent(id: string): Promise<void> {\n try {\n await this.sdk.agents.deleteAgent({\n id: parseInt(id, 10),\n });\n } catch (error) {\n this.handleError(error);\n }\n }\n\n // =========================================================================\n // WORKSPACES\n // =========================================================================\n\n async listWorkspaces(filters?: { limit?: number; offset?: number }): Promise<{ data: Workspace[]; total: number }> {\n try {\n const response = await this.sdk.workspaces.listWorkspaces({\n includeInactive: false,\n });\n // SDK returns { workspaces: [...], total } but CLI expects { data: [...], total }\n const workspaces = response.workspaces as unknown as Workspace[];\n // Apply client-side pagination if needed\n const offset = filters?.offset ?? 0;\n const limit = filters?.limit ?? workspaces.length;\n return {\n data: workspaces.slice(offset, offset + limit),\n total: response.total,\n };\n } catch (error) {\n this.handleError(error);\n }\n }\n\n async getWorkspace(id: string): Promise<Workspace> {\n try {\n const response = await this.sdk.workspaces.getWorkspace({\n wsId: id,\n });\n return response as unknown as Workspace;\n } catch (error) {\n this.handleError(error);\n }\n }\n\n // =========================================================================\n // PROVIDERS\n // =========================================================================\n\n async listProviders(filters?: { limit?: number; offset?: number; type?: string }): Promise<{ data: Provider[]; total: number }> {\n try {\n // No workspaceId/organizationId here: the provider-unification epic\n // (T-2.1/T-2.2, #1384) retired the request-side scope params, so the\n // server derives the workspace from `x-workspace-id`. That header is set\n // on EVERY SDK call by the beforeRequest hook in this constructor, so\n // dropping the params changes what is sent on the wire, not which\n // workspace is read.\n const response = await this.sdk.providerConfigs.listProviders({\n provider: filters?.type,\n includeInactive: true,\n });\n // SDK (Speakeasy-generated) returns ProviderConfigsList: { configs: [...], total }\n // Guard against SDK regen wrapping the payload in a `result` envelope.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const raw = response as any;\n const configs = (raw.result?.configs ?? raw.configs ?? []) as Provider[];\n const total: number = raw.result?.total ?? raw.total ?? configs.length;\n // Apply client-side pagination if needed\n const offset = filters?.offset ?? 0;\n const limit = filters?.limit ?? configs.length;\n return {\n data: configs.slice(offset, offset + limit),\n total,\n };\n } catch (error) {\n this.handleError(error);\n }\n }\n\n async getProvider(id: string): Promise<Provider> {\n try {\n const response = await this.sdk.providerConfigs.getProvider({\n id: id,\n });\n return response as unknown as Provider;\n } catch (error) {\n this.handleError(error);\n }\n }\n\n async getModelsCatalog(): Promise<{ models: { id: string; displayName: string; provider: { id: string; name: string; kind: string }; roles: string[] }[] }> {\n try {\n const wsId = this.workspaceId;\n if (!wsId) return { models: [] };\n const qs = `?workspaceId=${encodeURIComponent(wsId)}`;\n return await this.request<{ models: { id: string; displayName: string; provider: { id: string; name: string; kind: string }; roles: string[] }[] }>(`/api/providers/catalog${qs}`);\n } catch {\n return { models: [] };\n }\n }\n\n getCurrentWorkspaceId(): string | undefined {\n return this.workspaceId;\n }\n\n getCurrentOrgId(): string | undefined {\n return this.organizationId;\n }\n\n /**\n * Auto-resolve organization and workspace context when not provided via config.\n * Called once at client init so ALL commands benefit from tenancy headers.\n */\n async ensureContext(): Promise<void> {\n // A workspace whose provenance is a login-time guess must still be\n // classified against the account's real workspaces, so this cannot early-out\n // merely because an id is present — that is what let the guess through.\n const needsWorkspaceClassification =\n !this.workspaceId || this.workspaceResolution === 'none';\n if (this.organizationId && !needsWorkspaceClassification) return;\n\n if (!this.organizationId) {\n let orgs = await fetchOrganizations(this.apiKey, this.endpoint).catch(() => []);\n if (orgs.length === 0) {\n // Retry once after 1s for transient network failures\n await new Promise(r => setTimeout(r, 1000));\n orgs = await fetchOrganizations(this.apiKey, this.endpoint).catch(() => []);\n }\n if (orgs.length > 0 && orgs[0]) {\n this.organizationId = orgs[0].id;\n }\n }\n\n // Runs when no workspace is known AND when the known one is a login-time\n // guess, so the guess is re-classified rather than trusted.\n if (this.workspaceResolution === 'none' && this.organizationId) {\n try {\n const response = await this.sdk.workspaces.listWorkspaces({ includeInactive: false });\n const workspaces = response.workspaces as unknown as Workspace[];\n if (workspaces.length === 1 && workspaces[0]) {\n // Exactly one workspace — there is nothing to guess between.\n this.workspaceId = String(workspaces[0].id);\n this.workspaceResolution = 'sole';\n } else if (workspaces.length > 1) {\n const defaultWs = workspaces.find((ws: Workspace) => ws.isDefault);\n if (defaultWs) {\n // The server marks one default — an explicit choice, not a guess.\n this.workspaceId = String(defaultWs.id);\n this.workspaceResolution = 'configured';\n } else {\n // Several candidates and no stated preference. Reads tolerate the\n // first one; writes must not (see requireUnambiguousWorkspace).\n const first = workspaces[0] ?? undefined;\n if (first) {\n this.workspaceId = this.workspaceId ?? String(first.id);\n this.workspaceResolution = 'ambiguous';\n }\n }\n }\n } catch {\n /* best-effort */\n }\n }\n }\n\n /**\n * Resolution path of the active workspace. Reads may ignore this; writes\n * MUST NOT.\n */\n getWorkspaceResolution(): WorkspaceResolution {\n return this.workspaceResolution;\n }\n\n /**\n * Gate for every mutating provider command (FR-CLI-002).\n *\n * Returns the workspace a write will land in, or throws an actionable error\n * naming the command that sets one. A write is allowed only when the target\n * was not guessed at — see WorkspaceResolution.\n */\n requireUnambiguousWorkspace(): string {\n if (!this.workspaceId || this.workspaceResolution === 'none') {\n throw new MutagentError(\n 'WORKSPACE_REQUIRED',\n 'No workspace configured.',\n 'Set one with: mutagent config set workspace <workspace-id> (list them with: mutagent workspaces list)'\n );\n }\n\n if (this.workspaceResolution === 'ambiguous') {\n throw new MutagentError(\n 'WORKSPACE_AMBIGUOUS',\n 'Several workspaces are available and none is marked default, so the target for this write is ambiguous.',\n 'Choose one explicitly: mutagent config set workspace <workspace-id> (list them with: mutagent workspaces list)'\n );\n }\n\n return this.workspaceId;\n }\n\n async testProvider(id: string): Promise<ProviderTestResult> {\n try {\n const response = await this.sdk.providerConfigs.testProvider({\n id: id,\n });\n return response as unknown as ProviderTestResult;\n } catch (error) {\n this.handleError(error);\n }\n }\n\n /**\n * Create a provider configuration in the active workspace.\n *\n * The caller names no tenancy level. A configuration belongs to the workspace\n * and to nothing else (FR-CORE-001), so the target is resolved here rather\n * than chosen by the command.\n */\n async createProvider(data: {\n name: string;\n provider: string;\n /** Optional: the secret's wire name is per-entry (Vertex uses serviceAccountKey). */\n apiKey?: string;\n baseUrl?: string;\n isDefault?: boolean;\n /** Hosted vendor for gateway entries (azure/vertex/bedrock); undefined for direct. */\n hostedFamily?: string;\n /** Non-secret per-entry material — region, projectId, deploymentName, endpoint. */\n credentialFields?: Record<string, unknown>;\n }): Promise<Provider> {\n // The write target. Throws an actionable error rather than guessing.\n this.requireUnambiguousWorkspace();\n\n // ── Why this does NOT go through the generated SDK ──────────────────────\n //\n // `sdk.providerConfigs.createProvider` parses the body through\n // `NameProviderApiKey$outboundSchema` before sending, and in the CURRENT\n // generated model `metadata` is typed `z.object({})`. zod strips unknown\n // keys, so every per-entry credential field mapped into `metadata` was\n // deleted on the way out — measured, `metadata keys on wire: []`. The five\n // flags reached no server at all: the flag the operator passed was the flag\n // the server then said was missing.\n //\n // That is this task's own thesis turned on itself — a field mapped to a key\n // the recipient ignores — and strictly worse than the `--scope` it replaced,\n // which at least arrived. `tsc` cannot catch it: the generated type is `{}`,\n // and `Record<string, unknown>` is assignable to `{}`.\n //\n // The generated model is also STALE against the server contract this task\n // targets. After #1365 the create body carries `credentialFields` and\n // `hostedFamily` as first-class fields and no longer carries `scope`; the\n // regenerated SDK (#1372) has none of that — it still exposes `scope`,\n // `family`, and the empty `metadata`. So there is no shape of the generated\n // call that expresses the request correctly.\n //\n // Until the SDK is regenerated against the post-#1365 contract, this posts\n // the true body directly. `request()` is the same raw path the wrapper\n // already uses for the models catalog, and it carries the tenancy headers\n // the server derives the workspace from. When the SDK catches up, this\n // reverts to a generated call and the shape below is exactly what it must\n // produce — asserted by createProvider's wire test.\n const body = buildCreateProviderBody(data);\n\n try {\n const created = await this.request<Provider>('/api/providers', {\n method: 'POST',\n body: JSON.stringify(body),\n });\n return created;\n } catch (error) {\n this.handleError(error);\n }\n }\n\n async updateProvider(id: string, data: {\n name?: string;\n apiKey?: string;\n isActive?: boolean;\n isDefault?: boolean;\n baseUrl?: string | null;\n }): Promise<Provider & { workspaceId?: string }> {\n // A write — same gate as create (FR-CLI-002). The resolved target is\n // returned so the command can state where the write landed.\n const workspaceId = this.requireUnambiguousWorkspace();\n\n try {\n const response = await this.sdk.providerConfigs.updateProvider({\n id,\n body: {\n name: data.name,\n apiKey: data.apiKey,\n isActive: data.isActive,\n isDefault: data.isDefault,\n baseUrl: data.baseUrl,\n },\n });\n return { ...(response as unknown as Provider), workspaceId };\n } catch (error) {\n this.handleError(error);\n }\n }\n\n async deleteProvider(id: string): Promise<{ workspaceId: string }> {\n // A write — same gate as create (FR-CLI-002). The resolved target is\n // returned so the command can state where the write landed.\n const workspaceId = this.requireUnambiguousWorkspace();\n\n try {\n await this.sdk.providerConfigs.deleteProvider({ id });\n return { workspaceId };\n } catch (error) {\n this.handleError(error);\n }\n }\n}\n\n// Singleton SDK client\nlet sdkClient: SDKClientWrapper | null = null;\n\nexport async function getSDKClient(): Promise<SDKClientWrapper> {\n if (!sdkClient) {\n const apiKey = getApiKey();\n if (!apiKey) {\n throw new AuthenticationError();\n }\n\n const config = loadConfig();\n sdkClient = new SDKClientWrapper({\n apiKey: apiKey,\n serverURL: config.endpoint,\n workspaceId: config.defaultWorkspace,\n organizationId: config.defaultOrganization,\n workspaceSource: config.defaultWorkspaceSource,\n });\n\n // Auto-resolve org + workspace context so all commands get tenancy headers\n await sdkClient.ensureContext().catch((err: unknown) => {\n // Log to stderr (not stdout — don't pollute JSON output)\n if (process.env.MUTAGENT_DEBUG) {\n const message = err instanceof Error ? err.message : String(err);\n process.stderr.write(`[mutagent] Context resolution failed: ${message}\\n`);\n }\n });\n }\n\n return sdkClient;\n}\n\nexport function resetSDKClient(): void {\n sdkClient = null;\n}\n\nexport async function validateApiKey(apiKey: string, endpoint: string): Promise<boolean> {\n // Use /api/providers — works with workspace-scoped mg_live_ keys without requiring org context\n try {\n const response = await fetch(`${endpoint}/api/providers`, {\n headers: { 'x-api-key': apiKey },\n });\n return response.ok;\n } catch {\n return false;\n }\n}\n\n/**\n * Fetch organizations for the authenticated API key.\n * Returns array of { id, name } or empty array on failure.\n */\nexport async function fetchOrganizations(apiKey: string, endpoint: string): Promise<{ id: string; name: string }[]> {\n try {\n const response = await fetch(`${endpoint}/api/organizations`, {\n headers: { 'x-api-key': apiKey },\n });\n if (!response.ok) return [];\n const data = await response.json() as { data?: { id: string; name: string }[] };\n return data.data ?? [];\n } catch {\n return [];\n }\n}\n\n/**\n * Fetch workspaces for the given organization.\n * Returns array of { id, name, isDefault } or empty array on failure.\n */\nexport async function fetchWorkspaces(apiKey: string, endpoint: string, orgId: string): Promise<{ id: string; name: string; isDefault?: boolean }[]> {\n try {\n const response = await fetch(`${endpoint}/api/workspaces`, {\n headers: { 'x-api-key': apiKey, 'x-organization-id': orgId },\n });\n if (!response.ok) return [];\n const data = await response.json() as { workspaces?: { id: string; name: string; isDefault?: boolean }[] };\n return data.workspaces ?? [];\n } catch {\n return [];\n }\n}\n\n// Export the wrapper class for type compatibility\nexport { SDKClientWrapper as MutagentSDK };\n",
|
|
8
|
+
"/**\n * @fileoverview Explicit SDK → CLI mapping for every return shape (#1351)\n * @module @mutagent/cli/lib/sdk-mappers\n *\n * WHY THIS FILE EXISTS\n *\n * `sdk-client.ts` returned SDK payloads through `as unknown as <CLIType>` at ten\n * public-method return sites. A cast is not a conversion: it silences the\n * compiler and changes nothing at runtime, so the CLI's type-check carried no\n * evidence about return shapes at all.\n *\n * Measured rather than assumed (#1351): six breaking changes injected into the\n * SDK's models — `Agent.id` number→string, `Agent.name`→`title`,\n * `ProviderConfig.provider`→`kind`, `WorkspacesListWorkspace.slug`→`handle`,\n * `.isDefault`→`primary`, `TestConnectionResult.message`→`msg` — produced\n * **+0 errors** against real CLI source. A control (renaming an *uncast*\n * envelope key) fired 2, proving the harness was live. The type-check would\n * have passed against essentially any SDK preserving method names and request\n * shapes.\n *\n * `--external @mutagent/sdk` in package.json means `bun build` resolves and\n * type-checks nothing of the SDK either, so the build gate carries zero SDK\n * evidence. `type-check` was the only gate that could carry any, and it covered\n * requests only.\n *\n * Each function below reads its source fields BY NAME, so a renamed or retyped\n * SDK field is a compile error here — at one named site, in one file — instead\n * of a column silently rendering `undefined`.\n *\n * WHY A SEPARATE FILE\n *\n * `sdk-client.ts` is 680 lines against this repo's 500-line hard limit\n * (mutagent-cli/CLAUDE.md, enforced by ESLint `max-lines`). Growing it further\n * to hold these functions would trade one violation for a worse one.\n *\n * THE FOUR MISMATCHES THESE MAPPINGS RESOLVE, and why each resolves that way —\n * the server is the authority in every case:\n *\n * D1 id: CLI said `number`, SDK says `string`. The DB primary keys are\n * `text` (`provider-configs.ts`), so the CLI was wrong. `Provider.id` and\n * `Workspace.id` are now `string`. `Agent.id` stays `number` — the SDK\n * agrees it is a number there, so there was never a mismatch to fix.\n * D2 createdAt/updatedAt: CLI said `string | null`, SDK says `Date` (its zod\n * layer coerces). Mapped with `.toISOString()`, which is what the CLI's\n * own doc comments already promised (\"ISO 8601\").\n * D3 Provider.provider: CLI has a closed union, SDK an open `string`. The\n * catalog IS closed, so the narrowing is correct — done ONCE, here, with\n * an explicit unknown-value fallback rather than a blind assertion.\n * D4 The `raw.result` envelope guard on listProviders described a shape the\n * SDK does not produce (`ProviderConfigsList` has no `result`). Deleted\n * at the call site rather than mapped.\n */\n\nimport { Provider as SDKProviderEnum } from '@mutagent/sdk/models';\nimport type { Agent, Provider, ProviderTestResult, ProviderType, Workspace } from '../types/index.js';\n\n/**\n * The closed catalog set, DERIVED from the SDK's own enum rather than restated.\n *\n * `ProviderType` is an alias for that enum, so `Object.values` is exactly the\n * legal set and cannot drift from it. A hand-written copy would be one more\n * hand-maintained set with no equality check — the same shape of defect #1351\n * is about — and would silently rot the next time a provider is added.\n */\nconst PROVIDER_TYPES: readonly string[] = Object.values(SDKProviderEnum);\n\n/** Whether a raw string is one of the catalog ids this CLI knows. */\nexport function isProviderType(value: string): value is ProviderType {\n return PROVIDER_TYPES.includes(value);\n}\n\n/**\n * D3. Narrow the SDK's open `string` to the CLI's closed union, once.\n *\n * A value outside the set is passed through rather than rejected. The server\n * validates `provider` against the same closed catalog before persisting it, so\n * an unknown value here means this CLI is simply older than the server it is\n * talking to. Rendering an unfamiliar name is strictly better than crashing a\n * list command, and this function is on the read path only.\n */\nexport function narrowProviderType(value: string): ProviderType {\n return isProviderType(value) ? value : (value as ProviderType);\n}\n\n/**\n * D2. `Date` → ISO 8601 string, preserving null/undefined as null.\n *\n * The CLI's own field docs already say \"ISO 8601\"; only the type disagreed.\n */\nexport function toIsoString(value: Date | string | null | undefined): string | null {\n if (value === null || value === undefined) return null;\n return value instanceof Date ? value.toISOString() : value;\n}\n\n/** The SDK agent shape this mapper reads. Structural, so any source matching it works. */\ninterface SdkAgentLike {\n id: number;\n name: string;\n slug: string;\n description: string | null;\n systemPrompt: string;\n model: string;\n maxTurns: number | null;\n permissionMode: string | null;\n allowedTools: string[] | null;\n disallowedTools: string[] | null;\n status: string;\n isPublic: boolean;\n metadata: unknown;\n tags: string[] | null;\n createdBy: string | null;\n createdAt: Date | string | null;\n updatedAt: Date | string | null;\n}\n\nexport function toAgent(sdk: SdkAgentLike): Agent {\n return {\n id: sdk.id,\n name: sdk.name,\n slug: sdk.slug,\n description: sdk.description,\n systemPrompt: sdk.systemPrompt,\n model: sdk.model,\n maxTurns: sdk.maxTurns,\n permissionMode: sdk.permissionMode,\n allowedTools: sdk.allowedTools,\n disallowedTools: sdk.disallowedTools,\n status: sdk.status,\n isPublic: sdk.isPublic,\n metadata: sdk.metadata,\n tags: sdk.tags,\n createdBy: sdk.createdBy,\n createdAt: toIsoString(sdk.createdAt),\n updatedAt: toIsoString(sdk.updatedAt),\n };\n}\n\nexport function toAgentList(sdk: readonly SdkAgentLike[]): Agent[] {\n return sdk.map(toAgent);\n}\n\n/** The SDK workspace shape. `id` is `string` per D1. */\ninterface SdkWorkspaceLike {\n id: string;\n name: string;\n description: string | null;\n slug: string;\n isDefault: boolean;\n metadata: unknown;\n createdBy: string | null;\n createdAt: Date | string | null;\n updatedAt: Date | string | null;\n}\n\nexport function toWorkspace(sdk: SdkWorkspaceLike): Workspace {\n return {\n id: sdk.id,\n name: sdk.name,\n description: sdk.description,\n slug: sdk.slug,\n isDefault: sdk.isDefault,\n metadata: sdk.metadata,\n createdBy: sdk.createdBy,\n createdAt: toIsoString(sdk.createdAt),\n updatedAt: toIsoString(sdk.updatedAt),\n };\n}\n\nexport function toWorkspaceList(sdk: readonly SdkWorkspaceLike[]): Workspace[] {\n return sdk.map(toWorkspace);\n}\n\n/** The SDK provider-config shape. `id` is `string` per D1, `provider` open per D3. */\ninterface SdkProviderLike {\n id: string;\n name: string;\n provider: string;\n hostedFamily?: string | null;\n baseUrl: string | null;\n isActive: boolean;\n metadata: unknown;\n createdBy: string | null;\n createdAt: Date | string | null;\n updatedAt: Date | string | null;\n}\n\nexport function toProvider(sdk: SdkProviderLike): Provider {\n return {\n id: sdk.id,\n name: sdk.name,\n provider: narrowProviderType(sdk.provider),\n hostedFamily: sdk.hostedFamily ?? null,\n baseUrl: sdk.baseUrl,\n isActive: sdk.isActive,\n metadata: sdk.metadata,\n createdBy: sdk.createdBy,\n createdAt: toIsoString(sdk.createdAt),\n updatedAt: toIsoString(sdk.updatedAt),\n };\n}\n\nexport function toProviderList(sdk: readonly SdkProviderLike[]): Provider[] {\n return sdk.map(toProvider);\n}\n\n/**\n * The SDK connection-test shape.\n *\n * `message` is the field #1351 renamed to `msg` to prove the cast was blind.\n * Reading it by name here is what makes that rename a compile error.\n */\ninterface SdkProviderTestResultLike {\n success: boolean;\n provider?: string | null;\n latencyMs?: number | null;\n message: string;\n error?: string | null;\n models?: string[] | null;\n}\n\nexport function toProviderTestResult(sdk: SdkProviderTestResultLike): ProviderTestResult {\n return {\n success: sdk.success,\n provider: sdk.provider ?? undefined,\n latencyMs: sdk.latencyMs ?? undefined,\n message: sdk.message,\n error: sdk.error ?? undefined,\n models: sdk.models ?? undefined,\n };\n}\n",
|
|
9
|
+
"// SDK Client wrapper for MutagenT API\n/// <reference lib=\"dom\" />\nimport { Mutagent, HTTPClient } from '@mutagent/sdk';\nimport type { Agent, CreateAgentInput, UpdateAgentInput, Workspace, Provider, ProviderTestResult } from '../types/index.js';\nimport { ApiError, AuthenticationError, MutagentError, WorkspaceContextError } from './errors.js';\nimport { getApiKey, loadConfig, type WorkspaceSource } from './config.js';\nimport { buildCreateProviderBody } from './provider-request.js';\n// Explicit SDK → CLI conversion replacing the return-side casts (#1351). In its\n// own file: this one is already over the 500-line limit and must not grow.\nimport { toAgent, toAgentList, toProvider, toProviderList, toProviderTestResult, toWorkspace, toWorkspaceList } from './sdk-mappers.js';\n\n/**\n * SDK Client Wrapper\n *\n * This class wraps the real @mutagent/sdk to provide a consistent interface\n * for CLI commands. It maps the SDK's method signatures to the interface\n * expected by the CLI.\n */\n/**\n * How the active workspace was arrived at.\n *\n * This exists because reads and writes tolerate different amounts of guessing.\n * Listing against a guessed workspace shows you the wrong rows; WRITING a\n * credential into a guessed workspace puts a secret somewhere you did not\n * choose, and the CLI reports success either way. So the resolution PATH is\n * recorded here and the write path refuses anything it had to guess at.\n *\n * - `configured` — came from config, or from a workspace the server marks default\n * - `sole` — the account has exactly one workspace, so there is nothing to guess\n * - `ambiguous` — several workspaces, none marked default; the first was taken\n * - `none` — no workspace could be resolved at all\n */\nexport type WorkspaceResolution = 'configured' | 'sole' | 'ambiguous' | 'none';\n\nclass SDKClientWrapper {\n private sdk: Mutagent;\n private apiKey: string;\n private endpoint: string;\n private workspaceId?: string;\n private organizationId?: string;\n private workspaceResolution: WorkspaceResolution = 'none';\n\n constructor(opts: {\n apiKey: string;\n serverURL?: string;\n workspaceId?: string;\n organizationId?: string;\n workspaceSource?: WorkspaceSource;\n }) {\n this.apiKey = opts.apiKey;\n this.endpoint = opts.serverURL ?? 'http://localhost:3003';\n this.workspaceId = opts.workspaceId;\n this.organizationId = opts.organizationId;\n // A configured id counts as CHOSEN only when the config says a human chose\n // it. Login persists `workspaces.find(isDefault) ?? workspaces[0]` into the\n // same key (auth-flow.ts:167), so treating any configured id as 'configured'\n // laundered that guess into a deliberate choice and the ambiguity gate could\n // never fire. An inferred id is left unresolved here and re-derived against\n // the account's actual workspaces by ensureContext().\n if (opts.workspaceId && opts.workspaceSource === 'user') {\n this.workspaceResolution = 'configured';\n }\n\n // Create HTTP client with tenancy header injection\n const httpClient = new HTTPClient();\n httpClient.addHook(\"beforeRequest\", (req) => {\n if (this.workspaceId) req.headers.set(\"x-workspace-id\", this.workspaceId);\n if (this.organizationId) req.headers.set(\"x-organization-id\", this.organizationId);\n return req;\n });\n\n this.sdk = new Mutagent({\n security: {\n apiKey: this.apiKey,\n },\n serverURL: this.endpoint,\n httpClient,\n });\n }\n\n /**\n * Helper to handle SDK errors and convert them to CLI errors.\n * Masks Speakeasy SDK internal errors (SDKValidationError, SDKError, etc.)\n * so users see clean, actionable messages instead of raw stack traces.\n */\n private handleError(error: unknown): never {\n if (error && typeof error === 'object') {\n const err = error as { statusCode?: number; message?: string; body?: string; name?: string; rawValue?: unknown; rawMessage?: string };\n\n if (err.statusCode === 401) {\n throw new AuthenticationError();\n }\n if (err.statusCode === 403) {\n throw new ApiError(403, err.message ?? err.body ?? 'Access denied');\n }\n\n // Detect workspace/org context errors from the server\n const errMessage = (err.message ?? err.body ?? '').toLowerCase();\n if (\n errMessage.includes('workspace') && (errMessage.includes('missing') || errMessage.includes('required')) ||\n errMessage.includes('x-workspace-id')\n ) {\n throw new WorkspaceContextError(err.message ?? err.body ?? undefined);\n }\n\n if (err.statusCode) {\n throw new ApiError(err.statusCode, err.message ?? err.body ?? 'Unknown error');\n }\n\n // Catch Speakeasy SDK internal errors (SDKValidationError, SDKError, etc.)\n if (\n err.name === 'SDKValidationError' ||\n err.name === 'SDKError' ||\n err.rawValue !== undefined ||\n err.rawMessage !== undefined\n ) {\n const friendlyMessage = err.rawMessage ?? err.message ?? 'Request failed';\n throw new MutagentError(\n 'REQUEST_FAILED',\n friendlyMessage,\n 'Check your input and try again. Run the command with --help for usage details.'\n );\n }\n }\n\n // Catch network errors (fetch failures, DNS resolution, etc.)\n if (error instanceof TypeError && typeof error.message === 'string') {\n if (error.message.includes('fetch') || error.message.includes('network') || error.message.includes('ECONNREFUSED')) {\n throw new MutagentError(\n 'NETWORK_ERROR',\n 'Unable to connect to the Mutagent server',\n 'Check your internet connection and verify the server URL with: mutagent config list'\n );\n }\n }\n\n // Last resort: wrap unknown errors in MutagentError\n if (error instanceof Error) {\n throw new MutagentError(\n 'REQUEST_FAILED',\n error.message,\n 'Run the command with --help for usage details'\n );\n }\n\n throw new MutagentError(\n 'UNKNOWN_ERROR',\n 'An unexpected error occurred',\n 'Run the command with --help for usage details'\n );\n }\n\n /**\n * Helper for direct HTTP requests (for endpoints not yet in SDK)\n */\n private async request<T>(path: string, options?: RequestInit): Promise<T> {\n // Convert Headers object to plain object if needed\n const optHeaders = options?.headers;\n let extraHeaders: Record<string, string> = {};\n if (optHeaders instanceof Headers) {\n optHeaders.forEach((value, key) => {\n extraHeaders[key] = value;\n });\n } else if (optHeaders) {\n extraHeaders = optHeaders as Record<string, string>;\n }\n\n // Build tenancy headers from stored config\n const tenancyHeaders: Record<string, string> = {};\n if (this.workspaceId) tenancyHeaders['x-workspace-id'] = this.workspaceId;\n if (this.organizationId) tenancyHeaders['x-organization-id'] = this.organizationId;\n\n const response = await fetch(`${this.endpoint}${path}`, {\n ...options,\n headers: {\n 'x-api-key': this.apiKey,\n 'Content-Type': 'application/json',\n ...tenancyHeaders,\n ...extraHeaders,\n },\n });\n\n if (!response.ok) {\n if (response.status === 401) {\n throw new AuthenticationError();\n }\n if (response.status === 403) {\n throw new ApiError(403, await response.text() || 'Access denied');\n }\n const error = await response.text();\n // Detect workspace context errors from the server response body\n const errorLower = error.toLowerCase();\n if (\n errorLower.includes('workspace') && (errorLower.includes('missing') || errorLower.includes('required')) ||\n errorLower.includes('x-workspace-id')\n ) {\n throw new WorkspaceContextError(error);\n }\n throw new ApiError(response.status, error);\n }\n\n return response.json() as Promise<T>;\n }\n\n // =========================================================================\n // AGENTS\n // =========================================================================\n\n async listAgents(filters?: { limit?: number; offset?: number; name?: string; status?: string }): Promise<{ data: Agent[]; total: number }> {\n try {\n const response = await this.sdk.agents.listAgents({\n limit: filters?.limit,\n offset: filters?.offset,\n name: filters?.name,\n status: filters?.status,\n });\n return {\n data: toAgentList(response.result.data),\n total: response.result.total,\n };\n } catch (error) {\n this.handleError(error);\n }\n }\n\n async getAgent(id: string): Promise<Agent> {\n try {\n const response = await this.sdk.agents.getAgent({\n id: parseInt(id, 10),\n });\n return toAgent(response);\n } catch (error) {\n this.handleError(error);\n }\n }\n\n async createAgent(data: CreateAgentInput): Promise<Agent> {\n try {\n const response = await this.sdk.agents.createAgent({\n name: data.name,\n slug: data.slug,\n description: data.description ?? undefined,\n systemPrompt: data.systemPrompt,\n model: data.model ?? undefined,\n maxTurns: data.maxTurns ?? undefined,\n permissionMode: data.permissionMode ?? undefined,\n allowedTools: data.allowedTools ?? undefined,\n disallowedTools: data.disallowedTools ?? undefined,\n status: data.status ?? undefined,\n isPublic: data.isPublic ?? undefined,\n metadata: data.metadata ?? undefined,\n tags: data.tags ?? undefined,\n });\n return toAgent(response);\n } catch (error) {\n this.handleError(error);\n }\n }\n\n async updateAgent(id: string, data: UpdateAgentInput): Promise<Agent> {\n try {\n const response = await this.sdk.agents.updateAgent({\n id: parseInt(id, 10),\n body: {\n name: data.name ?? undefined,\n description: data.description ?? undefined,\n systemPrompt: data.systemPrompt ?? undefined,\n model: data.model ?? undefined,\n maxTurns: data.maxTurns ?? undefined,\n permissionMode: data.permissionMode ?? undefined,\n allowedTools: data.allowedTools ?? undefined,\n disallowedTools: data.disallowedTools ?? undefined,\n status: data.status ?? undefined,\n isPublic: data.isPublic ?? undefined,\n metadata: data.metadata ?? undefined,\n tags: data.tags ?? undefined,\n },\n });\n return toAgent(response);\n } catch (error) {\n this.handleError(error);\n }\n }\n\n async deleteAgent(id: string): Promise<void> {\n try {\n await this.sdk.agents.deleteAgent({\n id: parseInt(id, 10),\n });\n } catch (error) {\n this.handleError(error);\n }\n }\n\n // =========================================================================\n // WORKSPACES\n // =========================================================================\n\n async listWorkspaces(filters?: { limit?: number; offset?: number }): Promise<{ data: Workspace[]; total: number }> {\n try {\n const response = await this.sdk.workspaces.listWorkspaces({\n includeInactive: false,\n });\n // SDK returns { workspaces: [...], total } but CLI expects { data: [...], total }\n const workspaces = toWorkspaceList(response.workspaces);\n // Apply client-side pagination if needed\n const offset = filters?.offset ?? 0;\n const limit = filters?.limit ?? workspaces.length;\n return {\n data: workspaces.slice(offset, offset + limit),\n total: response.total,\n };\n } catch (error) {\n this.handleError(error);\n }\n }\n\n async getWorkspace(id: string): Promise<Workspace> {\n try {\n const response = await this.sdk.workspaces.getWorkspace({\n wsId: id,\n });\n return toWorkspace(response);\n } catch (error) {\n this.handleError(error);\n }\n }\n\n // =========================================================================\n // PROVIDERS\n // =========================================================================\n\n async listProviders(filters?: { limit?: number; offset?: number; type?: string }): Promise<{ data: Provider[]; total: number }> {\n try {\n // No workspaceId/organizationId here: the provider-unification epic\n // (T-2.1/T-2.2, #1384) retired the request-side scope params, so the\n // server derives the workspace from `x-workspace-id`. That header is set\n // on EVERY SDK call by the beforeRequest hook in this constructor, so\n // dropping the params changes what is sent on the wire, not which\n // workspace is read.\n const response = await this.sdk.providerConfigs.listProviders({\n provider: filters?.type,\n includeInactive: true,\n });\n // SDK (Speakeasy-generated) returns ProviderConfigsList: { configs, total }.\n // D4 (#1351): the `raw.result` envelope guard that used to sit here\n // described a shape the SDK does not produce — `ProviderConfigsList` has\n // no `result` member — and the `as any` it needed erased the real one.\n const configs = toProviderList(response.configs);\n const total: number = response.total;\n // Apply client-side pagination if needed\n const offset = filters?.offset ?? 0;\n const limit = filters?.limit ?? configs.length;\n return {\n data: configs.slice(offset, offset + limit),\n total,\n };\n } catch (error) {\n this.handleError(error);\n }\n }\n\n async getProvider(id: string): Promise<Provider> {\n try {\n const response = await this.sdk.providerConfigs.getProvider({\n id: id,\n });\n return toProvider(response);\n } catch (error) {\n this.handleError(error);\n }\n }\n\n async getModelsCatalog(): Promise<{ models: { id: string; displayName: string; provider: { id: string; name: string; kind: string }; roles: string[] }[] }> {\n try {\n const wsId = this.workspaceId;\n if (!wsId) return { models: [] };\n const qs = `?workspaceId=${encodeURIComponent(wsId)}`;\n return await this.request<{ models: { id: string; displayName: string; provider: { id: string; name: string; kind: string }; roles: string[] }[] }>(`/api/providers/catalog${qs}`);\n } catch {\n return { models: [] };\n }\n }\n\n getCurrentWorkspaceId(): string | undefined {\n return this.workspaceId;\n }\n\n getCurrentOrgId(): string | undefined {\n return this.organizationId;\n }\n\n /**\n * Auto-resolve organization and workspace context when not provided via config.\n * Called once at client init so ALL commands benefit from tenancy headers.\n */\n async ensureContext(): Promise<void> {\n // A workspace whose provenance is a login-time guess must still be\n // classified against the account's real workspaces, so this cannot early-out\n // merely because an id is present — that is what let the guess through.\n const needsWorkspaceClassification =\n !this.workspaceId || this.workspaceResolution === 'none';\n if (this.organizationId && !needsWorkspaceClassification) return;\n\n if (!this.organizationId) {\n let orgs = await fetchOrganizations(this.apiKey, this.endpoint).catch(() => []);\n if (orgs.length === 0) {\n // Retry once after 1s for transient network failures\n await new Promise(r => setTimeout(r, 1000));\n orgs = await fetchOrganizations(this.apiKey, this.endpoint).catch(() => []);\n }\n if (orgs.length > 0 && orgs[0]) {\n this.organizationId = orgs[0].id;\n }\n }\n\n // Runs when no workspace is known AND when the known one is a login-time\n // guess, so the guess is re-classified rather than trusted.\n if (this.workspaceResolution === 'none' && this.organizationId) {\n try {\n const response = await this.sdk.workspaces.listWorkspaces({ includeInactive: false });\n const workspaces = toWorkspaceList(response.workspaces);\n if (workspaces.length === 1 && workspaces[0]) {\n // Exactly one workspace — there is nothing to guess between.\n this.workspaceId = workspaces[0].id;\n this.workspaceResolution = 'sole';\n } else if (workspaces.length > 1) {\n const defaultWs = workspaces.find((ws: Workspace) => ws.isDefault);\n if (defaultWs) {\n // The server marks one default — an explicit choice, not a guess.\n this.workspaceId = defaultWs.id;\n this.workspaceResolution = 'configured';\n } else {\n // Several candidates and no stated preference. Reads tolerate the\n // first one; writes must not (see requireUnambiguousWorkspace).\n const first = workspaces[0] ?? undefined;\n if (first) {\n this.workspaceId = this.workspaceId ?? first.id;\n this.workspaceResolution = 'ambiguous';\n }\n }\n }\n } catch {\n /* best-effort */\n }\n }\n }\n\n /**\n * Resolution path of the active workspace. Reads may ignore this; writes\n * MUST NOT.\n */\n getWorkspaceResolution(): WorkspaceResolution {\n return this.workspaceResolution;\n }\n\n /**\n * Gate for every mutating provider command (FR-CLI-002).\n *\n * Returns the workspace a write will land in, or throws an actionable error\n * naming the command that sets one. A write is allowed only when the target\n * was not guessed at — see WorkspaceResolution.\n */\n requireUnambiguousWorkspace(): string {\n if (!this.workspaceId || this.workspaceResolution === 'none') {\n throw new MutagentError(\n 'WORKSPACE_REQUIRED',\n 'No workspace configured.',\n 'Set one with: mutagent config set workspace <workspace-id> (list them with: mutagent workspaces list)'\n );\n }\n\n if (this.workspaceResolution === 'ambiguous') {\n throw new MutagentError(\n 'WORKSPACE_AMBIGUOUS',\n 'Several workspaces are available and none is marked default, so the target for this write is ambiguous.',\n 'Choose one explicitly: mutagent config set workspace <workspace-id> (list them with: mutagent workspaces list)'\n );\n }\n\n return this.workspaceId;\n }\n\n async testProvider(id: string): Promise<ProviderTestResult> {\n try {\n const response = await this.sdk.providerConfigs.testProvider({\n id: id,\n });\n return toProviderTestResult(response);\n } catch (error) {\n this.handleError(error);\n }\n }\n\n /**\n * Create a provider configuration in the active workspace.\n *\n * The caller names no tenancy level. A configuration belongs to the workspace\n * and to nothing else (FR-CORE-001), so the target is resolved here rather\n * than chosen by the command.\n */\n async createProvider(data: {\n name: string;\n provider: string;\n /** Optional: the secret's wire name is per-entry (Vertex uses serviceAccountKey). */\n apiKey?: string;\n baseUrl?: string;\n isDefault?: boolean;\n /** Hosted vendor for gateway entries (azure/vertex/bedrock); undefined for direct. */\n hostedFamily?: string;\n /** Non-secret per-entry material — region, projectId, deploymentName, endpoint. */\n credentialFields?: Record<string, unknown>;\n }): Promise<Provider> {\n // The write target. Throws an actionable error rather than guessing.\n this.requireUnambiguousWorkspace();\n\n // ── Why this does NOT go through the generated SDK ──────────────────────\n //\n // `sdk.providerConfigs.createProvider` parses the body through\n // `NameProviderApiKey$outboundSchema` before sending, and in the CURRENT\n // generated model `metadata` is typed `z.object({})`. zod strips unknown\n // keys, so every per-entry credential field mapped into `metadata` was\n // deleted on the way out — measured, `metadata keys on wire: []`. The five\n // flags reached no server at all: the flag the operator passed was the flag\n // the server then said was missing.\n //\n // That is this task's own thesis turned on itself — a field mapped to a key\n // the recipient ignores — and strictly worse than the `--scope` it replaced,\n // which at least arrived. `tsc` cannot catch it: the generated type is `{}`,\n // and `Record<string, unknown>` is assignable to `{}`.\n //\n // The generated model is also STALE against the server contract this task\n // targets. After #1365 the create body carries `credentialFields` and\n // `hostedFamily` as first-class fields and no longer carries `scope`; the\n // regenerated SDK (#1372) has none of that — it still exposes `scope`,\n // `family`, and the empty `metadata`. So there is no shape of the generated\n // call that expresses the request correctly.\n //\n // Until the SDK is regenerated against the post-#1365 contract, this posts\n // the true body directly. `request()` is the same raw path the wrapper\n // already uses for the models catalog, and it carries the tenancy headers\n // the server derives the workspace from. When the SDK catches up, this\n // reverts to a generated call and the shape below is exactly what it must\n // produce — asserted by createProvider's wire test.\n const body = buildCreateProviderBody(data);\n\n try {\n const created = await this.request<Provider>('/api/providers', {\n method: 'POST',\n body: JSON.stringify(body),\n });\n return created;\n } catch (error) {\n this.handleError(error);\n }\n }\n\n async updateProvider(id: string, data: {\n name?: string;\n apiKey?: string;\n isActive?: boolean;\n isDefault?: boolean;\n baseUrl?: string | null;\n }): Promise<Provider & { workspaceId?: string }> {\n // A write — same gate as create (FR-CLI-002). The resolved target is\n // returned so the command can state where the write landed.\n const workspaceId = this.requireUnambiguousWorkspace();\n\n try {\n const response = await this.sdk.providerConfigs.updateProvider({\n id,\n body: {\n name: data.name,\n apiKey: data.apiKey,\n isActive: data.isActive,\n isDefault: data.isDefault,\n baseUrl: data.baseUrl,\n },\n });\n return { ...toProvider(response), workspaceId };\n } catch (error) {\n this.handleError(error);\n }\n }\n\n async deleteProvider(id: string): Promise<{ workspaceId: string }> {\n // A write — same gate as create (FR-CLI-002). The resolved target is\n // returned so the command can state where the write landed.\n const workspaceId = this.requireUnambiguousWorkspace();\n\n try {\n await this.sdk.providerConfigs.deleteProvider({ id });\n return { workspaceId };\n } catch (error) {\n this.handleError(error);\n }\n }\n}\n\n// Singleton SDK client\nlet sdkClient: SDKClientWrapper | null = null;\n\nexport async function getSDKClient(): Promise<SDKClientWrapper> {\n if (!sdkClient) {\n const apiKey = getApiKey();\n if (!apiKey) {\n throw new AuthenticationError();\n }\n\n const config = loadConfig();\n sdkClient = new SDKClientWrapper({\n apiKey: apiKey,\n serverURL: config.endpoint,\n workspaceId: config.defaultWorkspace,\n organizationId: config.defaultOrganization,\n workspaceSource: config.defaultWorkspaceSource,\n });\n\n // Auto-resolve org + workspace context so all commands get tenancy headers\n await sdkClient.ensureContext().catch((err: unknown) => {\n // Log to stderr (not stdout — don't pollute JSON output)\n if (process.env.MUTAGENT_DEBUG) {\n const message = err instanceof Error ? err.message : String(err);\n process.stderr.write(`[mutagent] Context resolution failed: ${message}\\n`);\n }\n });\n }\n\n return sdkClient;\n}\n\nexport function resetSDKClient(): void {\n sdkClient = null;\n}\n\nexport async function validateApiKey(apiKey: string, endpoint: string): Promise<boolean> {\n // Use /api/providers — works with workspace-scoped mg_live_ keys without requiring org context\n try {\n const response = await fetch(`${endpoint}/api/providers`, {\n headers: { 'x-api-key': apiKey },\n });\n return response.ok;\n } catch {\n return false;\n }\n}\n\n/**\n * Fetch organizations for the authenticated API key.\n * Returns array of { id, name } or empty array on failure.\n */\nexport async function fetchOrganizations(apiKey: string, endpoint: string): Promise<{ id: string; name: string }[]> {\n try {\n const response = await fetch(`${endpoint}/api/organizations`, {\n headers: { 'x-api-key': apiKey },\n });\n if (!response.ok) return [];\n const data = await response.json() as { data?: { id: string; name: string }[] };\n return data.data ?? [];\n } catch {\n return [];\n }\n}\n\n/**\n * Fetch workspaces for the given organization.\n * Returns array of { id, name, isDefault } or empty array on failure.\n */\nexport async function fetchWorkspaces(apiKey: string, endpoint: string, orgId: string): Promise<{ id: string; name: string; isDefault?: boolean }[]> {\n try {\n const response = await fetch(`${endpoint}/api/workspaces`, {\n headers: { 'x-api-key': apiKey, 'x-organization-id': orgId },\n });\n if (!response.ok) return [];\n const data = await response.json() as { workspaces?: { id: string; name: string; isDefault?: boolean }[] };\n return data.workspaces ?? [];\n } catch {\n return [];\n }\n}\n\n// Export the wrapper class for type compatibility\nexport { SDKClientWrapper as MutagentSDK };\n",
|
|
9
10
|
"// Public API exports for @mutagent/cli\nexport { loadConfig, saveCredentials, clearCredentials } from './lib/config.js';\nexport { getSDKClient, validateApiKey } from './lib/sdk-client.js';\nexport { OutputFormatter } from './lib/output.js';\nexport { MutagentError, AuthenticationError, ApiError } from './lib/errors.js';\nexport type {\n Config,\n Workspace,\n Agent,\n Provider,\n} from './types/index.js';\n\n// Version\nexport const version = '0.1.0';\n",
|
|
10
11
|
"import chalk from 'chalk';\nimport { existsSync, readFileSync } from 'fs';\nimport { join } from 'path';\nimport type { Command } from 'commander';\nimport type { OutputFormat } from '../types/index.js';\n\n// ---------------------------------------------------------------------------\n// Compat metadata (Scope D)\n// ---------------------------------------------------------------------------\n\ninterface CompatMetadata {\n cliVersion: string;\n skillVersion: string;\n skillMinCliVersion: string;\n}\n\nlet _compatCache: CompatMetadata | null = null;\nlet _globalCliVersion = '0.0.0';\n\n/**\n * Set the global CLI version for compat metadata injection.\n * Called once from cli.ts after the version is resolved.\n */\nexport function setCliVersion(version: string): void {\n _globalCliVersion = version;\n _compatCache = null; // reset cache when version changes\n}\n\n/**\n * Build the _compat metadata block included in all --json output.\n * Reads SKILL.md frontmatter for metadata.skill_version and metadata.skill_min_cli_version.\n * Results are cached after the first call (process-lifetime cache).\n *\n * Per D4 (locked): warn-but-not-block when cliVersion < skillMinCliVersion.\n * The Skill compares these values and emits a prominent warn but continues.\n */\nexport function getCompatMetadata(cliVersion: string = _globalCliVersion): CompatMetadata {\n if (_compatCache !== null) return _compatCache;\n\n let skillVersion = 'unknown';\n let skillMinCliVersion = 'unknown';\n\n try {\n // Look for installed skill first (runtime path), then source path\n const candidatePaths = [\n join(process.cwd(), '.claude', 'skills', 'mutagent-cli', 'SKILL.md'),\n join(process.cwd(), 'mutagent-cli', '.claude', 'skills', 'mutagent-cli', 'SKILL.md'),\n ];\n for (const p of candidatePaths) {\n if (existsSync(p)) {\n const content = readFileSync(p, 'utf-8');\n // New spec shape: keys are indented under `metadata:` block, values are quoted strings.\n // Regex strips optional surrounding double-quotes from the captured value.\n const verMatch = /^\\s+skill_version:\\s+\"?([^\"\\n]+)\"?\\s*$/m.exec(content);\n const minMatch = /^\\s+skill_min_cli_version:\\s+\"?([^\"\\n]+)\"?\\s*$/m.exec(content);\n // Hard-error guard: if a `metadata:` block exists but neither key is found, throw so\n // the bug surfaces in CI rather than silently returning \"unknown\".\n if (/^metadata:/m.test(content) && !verMatch && !minMatch) {\n throw new Error(\n 'Bundled SKILL.md is missing metadata.skill_version / skill_min_cli_version' +\n ' — re-run `bun run sync-skill` to regenerate.'\n );\n }\n if (verMatch?.[1]) skillVersion = verMatch[1].trim();\n if (minMatch?.[1]) skillMinCliVersion = minMatch[1].trim();\n break;\n }\n }\n } catch (err) {\n // Pre-existing tolerance: SKILL.md may not exist in either candidate path (e.g. invoked\n // outside a project dir). That's OK — fall back to \"unknown\".\n // BUT: a `metadata:` block exists with neither expected key means sync-skill is broken.\n // Per plan D5 — fail loud so CI catches it, even if it crashes one CLI invocation.\n if (err instanceof Error && err.message.startsWith('Bundled SKILL.md is missing')) {\n throw err;\n }\n }\n\n _compatCache = { cliVersion, skillVersion, skillMinCliVersion };\n return _compatCache;\n}\n\n/**\n * Safely extract the --json flag from Commander options chain.\n * Handles the `any` type from Commander's opts() method.\n */\nexport function getJsonFlag(command: Command | undefined): boolean {\n if (!command) return false;\n // Navigate up the parent chain to find the root command options\n \n const parentOpts = command.parent ? command.parent.opts() : null;\n \n const ownOpts = command.opts();\n \n return Boolean(parentOpts?.json ?? ownOpts.json);\n}\n\nexport class OutputFormatter {\n constructor(private format: OutputFormat) {}\n\n output(data: unknown): void {\n if (this.format === 'json') {\n // Scope D: inject _compat into all directive-carrying JSON output\n let enriched = data;\n if (\n _globalCliVersion !== '0.0.0' &&\n data !== null &&\n typeof data === 'object' &&\n !Array.isArray(data) &&\n '_directive' in (data as Record<string, unknown>)\n ) {\n enriched = {\n ...(data as Record<string, unknown>),\n _compat: getCompatMetadata(_globalCliVersion),\n };\n }\n console.log(JSON.stringify(enriched, null, 2));\n } else {\n this.formatTable(data);\n }\n }\n\n private formatTable(data: unknown): void {\n if (Array.isArray(data)) {\n this.formatArray(data);\n } else if (data && typeof data === 'object') {\n this.formatObject(data as Record<string, unknown>);\n } else {\n console.log(data);\n }\n }\n\n private formatArray(data: unknown[]): void {\n if (data.length === 0) {\n console.log(chalk.gray('No results'));\n return;\n }\n\n // Get columns from first item\n const firstItem = data[0];\n if (!firstItem || typeof firstItem !== 'object') {\n data.forEach(item => { console.log(` ${String(item)}`); });\n return;\n }\n\n const keys = Object.keys(firstItem);\n \n // Helper to convert any value to display string\n const toDisplayString = (val: unknown): string => {\n if (val === null || val === undefined) return '';\n if (typeof val === 'object') return JSON.stringify(val);\n if (typeof val === 'string') return val;\n if (typeof val === 'number' || typeof val === 'boolean' || typeof val === 'bigint') {\n return val.toString();\n }\n return JSON.stringify(val);\n };\n\n // Calculate column widths\n const widths: Record<string, number> = {};\n keys.forEach(key => {\n widths[key] = Math.max(\n key.length,\n ...data.map(item => toDisplayString((item as Record<string, unknown>)[key]).length)\n );\n });\n\n // Print header\n const header = keys.map(key => chalk.bold(key.toUpperCase().padEnd(widths[key] ?? 10))).join(' ');\n console.log(header);\n console.log(keys.map(key => '-'.repeat(widths[key] ?? 10)).join(' '));\n\n // Print rows\n data.forEach(item => {\n const row = keys.map(key => {\n const value = toDisplayString((item as Record<string, unknown>)[key]);\n const width = widths[key] ?? 10;\n return value.padEnd(width).slice(0, width);\n }).join(' ');\n console.log(row);\n });\n\n console.log(chalk.gray(`\\n${String(data.length)} result(s)`));\n }\n\n private formatObject(data: Record<string, unknown>): void {\n const maxKeyLength = Math.max(...Object.keys(data).map(k => k.length));\n\n Object.entries(data).forEach(([key, value]) => {\n const formattedKey = chalk.bold(key.padEnd(maxKeyLength));\n let formattedValue: string;\n\n if (value === null || value === undefined) {\n formattedValue = '';\n } else if (typeof value === 'object') {\n formattedValue = JSON.stringify(value, null, 2);\n } else if (typeof value === 'string') {\n formattedValue = value;\n } else if (typeof value === 'number' || typeof value === 'boolean' || typeof value === 'bigint') {\n formattedValue = value.toString();\n } else {\n formattedValue = JSON.stringify(value);\n }\n\n console.log(`${formattedKey} ${formattedValue}`);\n });\n }\n\n success(message: string): void {\n if (this.format === 'json') {\n console.log(JSON.stringify({ success: true, message }, null, 2));\n } else {\n console.log(chalk.green(`✓ ${message}`));\n }\n }\n\n error(message: string, code?: string, suggestedAction?: string): void {\n if (this.format === 'json') {\n const result: Record<string, unknown> = { success: false, error: message };\n if (code) result.code = code;\n if (suggestedAction) result.suggestedAction = suggestedAction;\n console.log(JSON.stringify(result, null, 2));\n } else {\n console.log(chalk.red(`✗ ${message}`));\n }\n }\n\n info(message: string): void {\n if (this.format !== 'json') {\n console.log(chalk.blue(`ℹ ${message}`));\n }\n }\n\n warn(message: string): void {\n if (this.format === 'json') {\n console.log(JSON.stringify({ warning: message }, null, 2));\n } else {\n console.log(chalk.yellow(`⚠ ${message}`));\n }\n }\n}\n\ninterface Spinner {\n start: () => Promise<unknown> | undefined;\n stop?: () => void;\n succeed?: () => void;\n fail?: () => void;\n}\n\nexport function createSpinner(text: string, isJson: boolean): Spinner {\n if (isJson) {\n // No-op spinner for JSON mode - returns undefined to match interface\n const noop = (): undefined => undefined;\n return {\n start: noop,\n stop: noop,\n succeed: noop,\n fail: noop,\n };\n }\n\n // Dynamic import for ora (ESM)\n const start = async (): Promise<unknown> => {\n const { default: ora } = await import('ora');\n return ora(text).start();\n };\n\n return { start };\n}\n"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