@ogment-ai/cli 0.3.4 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +88 -74
- package/dist/cli.d.ts +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +512 -247
- package/dist/commands/auth.d.ts +22 -0
- package/dist/commands/auth.d.ts.map +1 -0
- package/dist/commands/auth.js +29 -0
- package/dist/commands/catalog.d.ts +29 -0
- package/dist/commands/catalog.d.ts.map +1 -0
- package/dist/commands/catalog.js +151 -0
- package/dist/commands/invoke.d.ts +17 -0
- package/dist/commands/invoke.d.ts.map +1 -0
- package/dist/commands/invoke.js +123 -0
- package/dist/commands/{info.d.ts → status.d.ts} +4 -4
- package/dist/commands/status.d.ts.map +1 -0
- package/dist/commands/{info.js → status.js} +1 -1
- package/dist/output/envelope.d.ts +19 -0
- package/dist/output/envelope.d.ts.map +1 -0
- package/dist/output/envelope.js +51 -0
- package/dist/output/manager.d.ts +16 -3
- package/dist/output/manager.d.ts.map +1 -1
- package/dist/output/manager.js +27 -29
- package/dist/services/account.d.ts.map +1 -1
- package/dist/services/account.js +18 -2
- package/dist/services/auth.d.ts +14 -3
- package/dist/services/auth.d.ts.map +1 -1
- package/dist/services/auth.js +119 -15
- package/dist/services/info.d.ts.map +1 -1
- package/dist/services/info.js +11 -10
- package/dist/services/mcp.d.ts.map +1 -1
- package/dist/services/mcp.js +24 -23
- package/dist/shared/constants.d.ts +0 -1
- package/dist/shared/constants.d.ts.map +1 -1
- package/dist/shared/constants.js +0 -1
- package/dist/shared/error-codes.d.ts +28 -0
- package/dist/shared/error-codes.d.ts.map +1 -0
- package/dist/shared/error-codes.js +25 -0
- package/dist/shared/errors.d.ts +100 -9
- package/dist/shared/errors.d.ts.map +1 -1
- package/dist/shared/errors.js +103 -0
- package/dist/shared/exit-codes.d.ts +8 -5
- package/dist/shared/exit-codes.d.ts.map +1 -1
- package/dist/shared/exit-codes.js +31 -14
- package/dist/shared/guards.d.ts +5 -1
- package/dist/shared/guards.d.ts.map +1 -1
- package/dist/shared/guards.js +6 -1
- package/dist/shared/retry.d.ts +17 -0
- package/dist/shared/retry.d.ts.map +1 -0
- package/dist/shared/retry.js +27 -0
- package/dist/shared/schema-example.d.ts +2 -0
- package/dist/shared/schema-example.d.ts.map +1 -0
- package/dist/shared/schema-example.js +128 -0
- package/dist/shared/schemas.d.ts +0 -42
- package/dist/shared/schemas.d.ts.map +1 -1
- package/dist/shared/schemas.js +0 -21
- package/dist/shared/types.d.ts +84 -12
- package/dist/shared/types.d.ts.map +1 -1
- package/dist/shared/types.js +1 -1
- package/package.json +5 -7
- package/dist/commands/call.d.ts +0 -14
- package/dist/commands/call.d.ts.map +0 -1
- package/dist/commands/call.js +0 -51
- package/dist/commands/describe.d.ts +0 -4
- package/dist/commands/describe.d.ts.map +0 -1
- package/dist/commands/describe.js +0 -109
- package/dist/commands/info.d.ts.map +0 -1
- package/dist/commands/servers.d.ts +0 -13
- package/dist/commands/servers.d.ts.map +0 -1
- package/dist/commands/servers.js +0 -29
- package/dist/postinstall.d.ts +0 -2
- package/dist/postinstall.d.ts.map +0 -1
- package/dist/postinstall.js +0 -12
package/dist/shared/schemas.js
CHANGED
|
@@ -13,24 +13,3 @@ export const toolDefinitionSchema = z.object({
|
|
|
13
13
|
name: z.string(),
|
|
14
14
|
outputSchema: jsonObjectSchema.optional(),
|
|
15
15
|
});
|
|
16
|
-
export const describeToolSchema = z.object({
|
|
17
|
-
description: z.string(),
|
|
18
|
-
name: z.string(),
|
|
19
|
-
outputSchema: jsonObjectSchema,
|
|
20
|
-
parameters: jsonObjectSchema,
|
|
21
|
-
});
|
|
22
|
-
export const describePayloadSchema = z.object({
|
|
23
|
-
tools: z.array(describeToolSchema),
|
|
24
|
-
});
|
|
25
|
-
export const cliJsonSuccessSchema = z.object({
|
|
26
|
-
data: z.unknown(),
|
|
27
|
-
status: z.literal("success"),
|
|
28
|
-
});
|
|
29
|
-
export const cliJsonErrorSchema = z.object({
|
|
30
|
-
error: z.object({
|
|
31
|
-
details: z.string().optional(),
|
|
32
|
-
message: z.string(),
|
|
33
|
-
type: z.string(),
|
|
34
|
-
}),
|
|
35
|
-
status: z.literal("error"),
|
|
36
|
-
});
|
package/dist/shared/types.d.ts
CHANGED
|
@@ -38,18 +38,6 @@ export interface LogoutSuccess {
|
|
|
38
38
|
revoked: boolean;
|
|
39
39
|
localCredentialsDeleted: boolean;
|
|
40
40
|
}
|
|
41
|
-
export interface ServersListSuccess {
|
|
42
|
-
servers: ServerWithOrg[];
|
|
43
|
-
}
|
|
44
|
-
export interface ServerDetailsSuccess {
|
|
45
|
-
server: ServerWithOrg;
|
|
46
|
-
tools: McpToolSummary[];
|
|
47
|
-
}
|
|
48
|
-
export interface ToolCallSuccess {
|
|
49
|
-
serverPath: string;
|
|
50
|
-
toolName: string;
|
|
51
|
-
result: unknown;
|
|
52
|
-
}
|
|
53
41
|
export type BaseUrlSource = "default" | "env";
|
|
54
42
|
export type InfoApiKeySource = "apiKeyOption" | "credentialsError" | "credentialsFile" | "env" | "none";
|
|
55
43
|
export interface InfoRuntimeDetails {
|
|
@@ -111,4 +99,88 @@ export interface InfoPayload {
|
|
|
111
99
|
runtime: InfoRuntimeDetails;
|
|
112
100
|
summary: InfoSummary;
|
|
113
101
|
}
|
|
102
|
+
export declare const CLI_CONTRACT_VERSION: "0.4";
|
|
103
|
+
export type CliContractVersion = typeof CLI_CONTRACT_VERSION;
|
|
104
|
+
export interface CliPaginationMeta {
|
|
105
|
+
nextCursor: string | null;
|
|
106
|
+
}
|
|
107
|
+
export interface CliMeta {
|
|
108
|
+
command: string;
|
|
109
|
+
entity: Record<string, unknown> | null;
|
|
110
|
+
pagination: CliPaginationMeta | null;
|
|
111
|
+
requestId: string;
|
|
112
|
+
timestamp: string;
|
|
113
|
+
}
|
|
114
|
+
export interface CliNextAction {
|
|
115
|
+
command: string;
|
|
116
|
+
id: string;
|
|
117
|
+
reason: string;
|
|
118
|
+
title: string;
|
|
119
|
+
when: string | null;
|
|
120
|
+
}
|
|
121
|
+
export interface CliErrorPayload {
|
|
122
|
+
category: string;
|
|
123
|
+
code: string;
|
|
124
|
+
detail: string;
|
|
125
|
+
diagnostics: Record<string, unknown>;
|
|
126
|
+
docsUrl: string | null;
|
|
127
|
+
retryAfterMs: number | null;
|
|
128
|
+
retryable: boolean;
|
|
129
|
+
suggestedCommand: string | null;
|
|
130
|
+
title: string;
|
|
131
|
+
}
|
|
132
|
+
export interface CliSuccessEnvelope<TData> {
|
|
133
|
+
contract_version: CliContractVersion;
|
|
134
|
+
data: TData;
|
|
135
|
+
error: null;
|
|
136
|
+
meta: CliMeta;
|
|
137
|
+
next_actions: CliNextAction[];
|
|
138
|
+
ok: true;
|
|
139
|
+
}
|
|
140
|
+
export interface CliErrorEnvelope {
|
|
141
|
+
contract_version: CliContractVersion;
|
|
142
|
+
data: null;
|
|
143
|
+
error: CliErrorPayload;
|
|
144
|
+
meta: CliMeta;
|
|
145
|
+
next_actions: CliNextAction[];
|
|
146
|
+
ok: false;
|
|
147
|
+
}
|
|
148
|
+
export interface AuthStatusSuccess {
|
|
149
|
+
agentName: string | null;
|
|
150
|
+
apiKeySource: "apiKeyOption" | "credentialsFile" | "env" | "none";
|
|
151
|
+
loggedIn: boolean;
|
|
152
|
+
}
|
|
153
|
+
export interface CatalogServerSummary {
|
|
154
|
+
capabilities: string[];
|
|
155
|
+
description: string | null;
|
|
156
|
+
name: string;
|
|
157
|
+
orgSlug: string;
|
|
158
|
+
serverId: string;
|
|
159
|
+
toolCount: number;
|
|
160
|
+
version: string | null;
|
|
161
|
+
}
|
|
162
|
+
export interface CatalogSummarySuccess {
|
|
163
|
+
servers: CatalogServerSummary[];
|
|
164
|
+
}
|
|
165
|
+
export interface CatalogToolSummary {
|
|
166
|
+
description: string | null;
|
|
167
|
+
inputSchemaRef: string | null;
|
|
168
|
+
name: string;
|
|
169
|
+
}
|
|
170
|
+
export interface CatalogToolsSuccess {
|
|
171
|
+
server: CatalogServerSummary;
|
|
172
|
+
tools: CatalogToolSummary[];
|
|
173
|
+
}
|
|
174
|
+
export interface CatalogToolDetailsSuccess {
|
|
175
|
+
description: string | null;
|
|
176
|
+
inputSchema: Record<string, unknown>;
|
|
177
|
+
name: string;
|
|
178
|
+
outputSchema: Record<string, unknown> | null;
|
|
179
|
+
server: CatalogServerSummary;
|
|
180
|
+
}
|
|
181
|
+
export interface InvokeSuccess {
|
|
182
|
+
result: unknown;
|
|
183
|
+
serverId: string;
|
|
184
|
+
toolName: string;
|
|
185
|
+
}
|
|
114
186
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/shared/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAED,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,SAAS,EAAE,CAAC;CACtB;AAED,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,IAAI,EAAE,YAAY,EAAE,CAAC;CACtB;AAED,MAAM,WAAW,aAAc,SAAQ,SAAS;IAC9C,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC,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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ogment-ai/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Ogment Vault CLI — secure your AI agents' SaaS credentials",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -40,12 +40,11 @@
|
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@modelcontextprotocol/sdk": "^1.27.0",
|
|
43
|
-
"@ogment-ai/cli-contract": "0.
|
|
43
|
+
"@ogment-ai/cli-contract": "0.4.0",
|
|
44
44
|
"better-result": "^2.7.0",
|
|
45
45
|
"commander": "^14.0.3",
|
|
46
46
|
"open": "^11.0.0",
|
|
47
|
-
"zod": "^4.3.6"
|
|
48
|
-
"zod-to-json-schema": "^3.25.1"
|
|
47
|
+
"zod": "^4.3.6"
|
|
49
48
|
},
|
|
50
49
|
"devDependencies": {
|
|
51
50
|
"@types/node": "^25.3.0",
|
|
@@ -64,9 +63,8 @@
|
|
|
64
63
|
"build": "pnpm clean && tsc -p tsconfig.build.json",
|
|
65
64
|
"dev": "tsx src/cli.ts",
|
|
66
65
|
"start": "node dist/cli.js",
|
|
67
|
-
"local": "
|
|
68
|
-
"local:json": "
|
|
69
|
-
"postinstall": "node -e \"import('./dist/postinstall.js').catch(() => undefined)\"",
|
|
66
|
+
"local": "pnpm run build && CI=1 OGMENT_BASE_URL=${OGMENT_BASE_URL:-http://localhost:3000} node dist/cli.js",
|
|
67
|
+
"local:json": "pnpm run build && CI=1 OGMENT_BASE_URL=${OGMENT_BASE_URL:-http://localhost:3000} node dist/cli.js",
|
|
70
68
|
"lint": "oxlint -c oxlint.config.ts --type-aware --type-check --tsconfig tsconfig.json src test/src test/e2e vitest.config.ts vitest.e2e.config.ts",
|
|
71
69
|
"lint:fix": "pnpm lint -- --fix",
|
|
72
70
|
"format": "oxfmt --write src test/src test/e2e",
|
package/dist/commands/call.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { Result as ResultType } from "better-result";
|
|
2
|
-
import type { McpServiceError } from "../services/mcp.js";
|
|
3
|
-
import { NotFoundError, ValidationError } from "../shared/errors.js";
|
|
4
|
-
import type { ToolCallSuccess } from "../shared/types.js";
|
|
5
|
-
import type { CommandContext } from "./context.js";
|
|
6
|
-
import { type ResolveServerStateError } from "./server-context.js";
|
|
7
|
-
export interface CallCommandOptions {
|
|
8
|
-
argsJson: string | undefined;
|
|
9
|
-
serverPath: string;
|
|
10
|
-
toolName: string;
|
|
11
|
-
}
|
|
12
|
-
export type CallCommandError = McpServiceError | NotFoundError | ResolveServerStateError | ValidationError;
|
|
13
|
-
export declare const runCallCommand: (context: CommandContext, options: CallCommandOptions) => Promise<ResultType<ToolCallSuccess, CallCommandError>>;
|
|
14
|
-
//# sourceMappingURL=call.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"call.d.ts","sourceRoot":"","sources":["../../src/commands/call.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,eAAe,CAAC;AAE1D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACrE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAGL,KAAK,uBAAuB,EAC7B,MAAM,qBAAqB,CAAC;AAE7B,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,MAAM,gBAAgB,GACxB,eAAe,GACf,aAAa,GACb,uBAAuB,GACvB,eAAe,CAAC;AAiCpB,eAAO,MAAM,cAAc,GACzB,SAAS,cAAc,EACvB,SAAS,kBAAkB,KAC1B,OAAO,CAAC,UAAU,CAAC,eAAe,EAAE,gBAAgB,CAAC,CAqCvD,CAAC"}
|
package/dist/commands/call.js
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { Result } from "better-result";
|
|
2
|
-
import { NotFoundError, ValidationError } from "../shared/errors.js";
|
|
3
|
-
import { findServerByPath, resolveServerState, } from "./server-context.js";
|
|
4
|
-
const parseArgs = (argsJson) => {
|
|
5
|
-
if (argsJson === undefined || argsJson.length === 0) {
|
|
6
|
-
return Result.ok({});
|
|
7
|
-
}
|
|
8
|
-
const parsed = Result.try({
|
|
9
|
-
catch: () => new ValidationError({
|
|
10
|
-
details: argsJson,
|
|
11
|
-
message: "Invalid JSON arguments",
|
|
12
|
-
}),
|
|
13
|
-
try: () => JSON.parse(argsJson),
|
|
14
|
-
});
|
|
15
|
-
if (Result.isError(parsed)) {
|
|
16
|
-
return parsed;
|
|
17
|
-
}
|
|
18
|
-
if (typeof parsed.value !== "object" || parsed.value === null || Array.isArray(parsed.value)) {
|
|
19
|
-
return Result.err(new ValidationError({
|
|
20
|
-
message: "Tool arguments must be a JSON object",
|
|
21
|
-
}));
|
|
22
|
-
}
|
|
23
|
-
return Result.ok(parsed.value);
|
|
24
|
-
};
|
|
25
|
-
export const runCallCommand = async (context, options) => {
|
|
26
|
-
const argsResult = parseArgs(options.argsJson);
|
|
27
|
-
if (Result.isError(argsResult)) {
|
|
28
|
-
return argsResult;
|
|
29
|
-
}
|
|
30
|
-
const stateResult = await resolveServerState(context);
|
|
31
|
-
if (Result.isError(stateResult)) {
|
|
32
|
-
return stateResult;
|
|
33
|
-
}
|
|
34
|
-
const targetServerResult = findServerByPath(stateResult.value.servers, options.serverPath);
|
|
35
|
-
if (Result.isError(targetServerResult)) {
|
|
36
|
-
return targetServerResult;
|
|
37
|
-
}
|
|
38
|
-
const targetServer = targetServerResult.value;
|
|
39
|
-
const callResult = await context.services.mcp.callTool({
|
|
40
|
-
orgSlug: targetServer.orgSlug,
|
|
41
|
-
serverPath: targetServer.path,
|
|
42
|
-
}, stateResult.value.apiKey, options.toolName, argsResult.value);
|
|
43
|
-
if (Result.isError(callResult)) {
|
|
44
|
-
return callResult;
|
|
45
|
-
}
|
|
46
|
-
return Result.ok({
|
|
47
|
-
result: callResult.value.structuredContent,
|
|
48
|
-
serverPath: options.serverPath,
|
|
49
|
-
toolName: options.toolName,
|
|
50
|
-
});
|
|
51
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"describe.d.ts","sourceRoot":"","sources":["../../src/commands/describe.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,eAAe,CAAC;AAI1D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAiI5D,eAAO,MAAM,kBAAkB,QAAO,UAAU,CAAC,eAAe,EAAE,KAAK,CAItE,CAAC"}
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
import { Result } from "better-result";
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
import { zodToJsonSchema } from "zod-to-json-schema";
|
|
4
|
-
const asObjectRecord = (value) => {
|
|
5
|
-
if (typeof value === "object" && value !== null) {
|
|
6
|
-
return value;
|
|
7
|
-
}
|
|
8
|
-
return {};
|
|
9
|
-
};
|
|
10
|
-
const toJsonSchemaObject = (schema, title) => {
|
|
11
|
-
return asObjectRecord(zodToJsonSchema(schema, title));
|
|
12
|
-
};
|
|
13
|
-
const commandDefinitions = () => {
|
|
14
|
-
const loginInputSchema = z.object({
|
|
15
|
-
device: z.boolean().optional(),
|
|
16
|
-
});
|
|
17
|
-
const loginOutputSchema = z.object({
|
|
18
|
-
agentName: z.string(),
|
|
19
|
-
alreadyLoggedIn: z.boolean(),
|
|
20
|
-
});
|
|
21
|
-
const serversInputSchema = z.object({
|
|
22
|
-
path: z.string().optional(),
|
|
23
|
-
});
|
|
24
|
-
const serversOutputSchema = z.object({
|
|
25
|
-
server: z
|
|
26
|
-
.object({
|
|
27
|
-
enabled: z.boolean(),
|
|
28
|
-
name: z.string(),
|
|
29
|
-
orgSlug: z.string(),
|
|
30
|
-
path: z.string(),
|
|
31
|
-
})
|
|
32
|
-
.optional(),
|
|
33
|
-
servers: z
|
|
34
|
-
.array(z.object({
|
|
35
|
-
enabled: z.boolean(),
|
|
36
|
-
name: z.string(),
|
|
37
|
-
orgSlug: z.string(),
|
|
38
|
-
path: z.string(),
|
|
39
|
-
}))
|
|
40
|
-
.optional(),
|
|
41
|
-
tools: z
|
|
42
|
-
.array(z.object({
|
|
43
|
-
description: z.string().nullable(),
|
|
44
|
-
inputSchema: z.record(z.string(), z.unknown()),
|
|
45
|
-
name: z.string(),
|
|
46
|
-
}))
|
|
47
|
-
.optional(),
|
|
48
|
-
});
|
|
49
|
-
const callInputSchema = z.object({
|
|
50
|
-
args: z.record(z.string(), z.unknown()).optional(),
|
|
51
|
-
serverPath: z.string(),
|
|
52
|
-
toolName: z.string(),
|
|
53
|
-
});
|
|
54
|
-
const callOutputSchema = z.object({
|
|
55
|
-
result: z.unknown(),
|
|
56
|
-
serverPath: z.string(),
|
|
57
|
-
toolName: z.string(),
|
|
58
|
-
});
|
|
59
|
-
const infoOutputSchema = z.object({
|
|
60
|
-
auth: z.record(z.string(), z.unknown()),
|
|
61
|
-
config: z.record(z.string(), z.unknown()),
|
|
62
|
-
documentation: z.record(z.string(), z.unknown()),
|
|
63
|
-
generatedAt: z.string(),
|
|
64
|
-
remote: z.record(z.string(), z.unknown()),
|
|
65
|
-
runtime: z.record(z.string(), z.unknown()),
|
|
66
|
-
summary: z.record(z.string(), z.unknown()),
|
|
67
|
-
});
|
|
68
|
-
const logoutOutputSchema = z.object({
|
|
69
|
-
localCredentialsDeleted: z.boolean(),
|
|
70
|
-
revoked: z.boolean(),
|
|
71
|
-
});
|
|
72
|
-
return [
|
|
73
|
-
{
|
|
74
|
-
description: "Authenticate with Ogment. Uses browser-assisted device flow by default.",
|
|
75
|
-
name: "ogment_login",
|
|
76
|
-
outputSchema: toJsonSchemaObject(loginOutputSchema, "ogmentLoginOutput"),
|
|
77
|
-
parameters: toJsonSchemaObject(loginInputSchema, "ogmentLoginInput"),
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
description: "List available servers or inspect one server's tools.",
|
|
81
|
-
name: "ogment_servers",
|
|
82
|
-
outputSchema: toJsonSchemaObject(serversOutputSchema, "ogmentServersOutput"),
|
|
83
|
-
parameters: toJsonSchemaObject(serversInputSchema, "ogmentServersInput"),
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
description: "Call a tool on a server.",
|
|
87
|
-
name: "ogment_call",
|
|
88
|
-
outputSchema: toJsonSchemaObject(callOutputSchema, "ogmentCallOutput"),
|
|
89
|
-
parameters: toJsonSchemaObject(callInputSchema, "ogmentCallInput"),
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
description: "Inspect local runtime configuration and remote diagnostics.",
|
|
93
|
-
name: "ogment_info",
|
|
94
|
-
outputSchema: toJsonSchemaObject(infoOutputSchema, "ogmentInfoOutput"),
|
|
95
|
-
parameters: toJsonSchemaObject(z.object({}), "ogmentInfoInput"),
|
|
96
|
-
},
|
|
97
|
-
{
|
|
98
|
-
description: "Revoke current session and delete local credentials.",
|
|
99
|
-
name: "ogment_logout",
|
|
100
|
-
outputSchema: toJsonSchemaObject(logoutOutputSchema, "ogmentLogoutOutput"),
|
|
101
|
-
parameters: toJsonSchemaObject(z.object({}), "ogmentLogoutInput"),
|
|
102
|
-
},
|
|
103
|
-
];
|
|
104
|
-
};
|
|
105
|
-
export const runDescribeCommand = () => {
|
|
106
|
-
return Result.ok({
|
|
107
|
-
tools: commandDefinitions(),
|
|
108
|
-
});
|
|
109
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"info.d.ts","sourceRoot":"","sources":["../../src/commands/info.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,eAAe,CAAC;AAE1D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEtD,MAAM,WAAW,kBAAkB;IACjC,cAAc,EAAE,MAAM,GAAG,SAAS,CAAC;CACpC;AAED,UAAU,kBAAkB;IAC1B,WAAW,EAAE,WAAW,CAAC;CAC1B;AAED,eAAO,MAAM,cAAc,GACzB,SAAS,kBAAkB,EAC3B,MAAM,kBAAkB,KACvB,OAAO,CAAC,UAAU,CAAC,WAAW,EAAE,KAAK,CAAC,CAGxC,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { Result as ResultType } from "better-result";
|
|
2
|
-
import type { McpServiceError } from "../services/mcp.js";
|
|
3
|
-
import { NotFoundError } from "../shared/errors.js";
|
|
4
|
-
import type { ServerDetailsSuccess, ServersListSuccess } from "../shared/types.js";
|
|
5
|
-
import type { CommandContext } from "./context.js";
|
|
6
|
-
import { type ResolveServerStateError } from "./server-context.js";
|
|
7
|
-
export interface ServersCommandOptions {
|
|
8
|
-
path: string | undefined;
|
|
9
|
-
}
|
|
10
|
-
export type ServersCommandSuccess = ServerDetailsSuccess | ServersListSuccess;
|
|
11
|
-
export type ServersCommandError = McpServiceError | NotFoundError | ResolveServerStateError;
|
|
12
|
-
export declare const runServersCommand: (context: CommandContext, options: ServersCommandOptions) => Promise<ResultType<ServersCommandSuccess, ServersCommandError>>;
|
|
13
|
-
//# sourceMappingURL=servers.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"servers.d.ts","sourceRoot":"","sources":["../../src/commands/servers.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,eAAe,CAAC;AAE1D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,KAAK,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACnF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAGL,KAAK,uBAAuB,EAC7B,MAAM,qBAAqB,CAAC;AAE7B,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;CAC1B;AAED,MAAM,MAAM,qBAAqB,GAAG,oBAAoB,GAAG,kBAAkB,CAAC;AAE9E,MAAM,MAAM,mBAAmB,GAAG,eAAe,GAAG,aAAa,GAAG,uBAAuB,CAAC;AAE5F,eAAO,MAAM,iBAAiB,GAC5B,SAAS,cAAc,EACvB,SAAS,qBAAqB,KAC7B,OAAO,CAAC,UAAU,CAAC,qBAAqB,EAAE,mBAAmB,CAAC,CAiChE,CAAC"}
|
package/dist/commands/servers.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { Result } from "better-result";
|
|
2
|
-
import { NotFoundError } from "../shared/errors.js";
|
|
3
|
-
import { findServerByPath, resolveServerState, } from "./server-context.js";
|
|
4
|
-
export const runServersCommand = async (context, options) => {
|
|
5
|
-
const stateResult = await resolveServerState(context);
|
|
6
|
-
if (Result.isError(stateResult)) {
|
|
7
|
-
return stateResult;
|
|
8
|
-
}
|
|
9
|
-
if (typeof options.path !== "string" || options.path.length === 0) {
|
|
10
|
-
return Result.ok({
|
|
11
|
-
servers: stateResult.value.servers,
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
const serverResult = findServerByPath(stateResult.value.servers, options.path);
|
|
15
|
-
if (Result.isError(serverResult)) {
|
|
16
|
-
return serverResult;
|
|
17
|
-
}
|
|
18
|
-
const toolsResult = await context.services.mcp.listTools({
|
|
19
|
-
orgSlug: serverResult.value.orgSlug,
|
|
20
|
-
serverPath: serverResult.value.path,
|
|
21
|
-
}, stateResult.value.apiKey);
|
|
22
|
-
if (Result.isError(toolsResult)) {
|
|
23
|
-
return toolsResult;
|
|
24
|
-
}
|
|
25
|
-
return Result.ok({
|
|
26
|
-
server: serverResult.value,
|
|
27
|
-
tools: toolsResult.value,
|
|
28
|
-
});
|
|
29
|
-
};
|
package/dist/postinstall.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"postinstall.d.ts","sourceRoot":"","sources":["../src/postinstall.ts"],"names":[],"mappings":""}
|
package/dist/postinstall.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { stdout } from "node:process";
|
|
2
|
-
const installGreetingLines = [
|
|
3
|
-
"Thanks for installing @ogment-ai/cli.",
|
|
4
|
-
"",
|
|
5
|
-
"Next steps:",
|
|
6
|
-
" 1. ogment login",
|
|
7
|
-
" 2. ogment servers",
|
|
8
|
-
" 3. ogment --help",
|
|
9
|
-
"",
|
|
10
|
-
"Docs: https://github.com/ogment-ai/ogment-cli/tree/main/packages/ogment#quick-start",
|
|
11
|
-
];
|
|
12
|
-
stdout.write(`${installGreetingLines.join("\n")}\n`);
|