@ogment-ai/cli 0.3.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 +124 -0
- package/dist/cli.d.ts +19 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +337 -0
- package/dist/commands/call.d.ts +14 -0
- package/dist/commands/call.d.ts.map +1 -0
- package/dist/commands/call.js +51 -0
- package/dist/commands/context.d.ts +15 -0
- package/dist/commands/context.d.ts.map +1 -0
- package/dist/commands/context.js +1 -0
- package/dist/commands/describe.d.ts +4 -0
- package/dist/commands/describe.d.ts.map +1 -0
- package/dist/commands/describe.js +94 -0
- package/dist/commands/server-context.d.ts +14 -0
- package/dist/commands/server-context.d.ts.map +1 -0
- package/dist/commands/server-context.js +26 -0
- package/dist/commands/servers.d.ts +13 -0
- package/dist/commands/servers.d.ts.map +1 -0
- package/dist/commands/servers.js +29 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -0
- package/dist/infra/browser.d.ts +12 -0
- package/dist/infra/browser.d.ts.map +1 -0
- package/dist/infra/browser.js +20 -0
- package/dist/infra/credentials.d.ts +22 -0
- package/dist/infra/credentials.d.ts.map +1 -0
- package/dist/infra/credentials.js +81 -0
- package/dist/infra/env.d.ts +11 -0
- package/dist/infra/env.d.ts.map +1 -0
- package/dist/infra/env.js +98 -0
- package/dist/infra/http.d.ts +12 -0
- package/dist/infra/http.d.ts.map +1 -0
- package/dist/infra/http.js +27 -0
- package/dist/output/manager.d.ts +30 -0
- package/dist/output/manager.d.ts.map +1 -0
- package/dist/output/manager.js +79 -0
- package/dist/services/account.d.ts +16 -0
- package/dist/services/account.d.ts.map +1 -0
- package/dist/services/account.js +66 -0
- package/dist/services/auth.d.ts +38 -0
- package/dist/services/auth.d.ts.map +1 -0
- package/dist/services/auth.js +617 -0
- package/dist/services/mcp.d.ts +33 -0
- package/dist/services/mcp.d.ts.map +1 -0
- package/dist/services/mcp.js +158 -0
- package/dist/shared/constants.d.ts +8 -0
- package/dist/shared/constants.d.ts.map +1 -0
- package/dist/shared/constants.js +7 -0
- package/dist/shared/errors.d.ts +35 -0
- package/dist/shared/errors.d.ts.map +1 -0
- package/dist/shared/errors.js +31 -0
- package/dist/shared/exit-codes.d.ts +12 -0
- package/dist/shared/exit-codes.d.ts.map +1 -0
- package/dist/shared/exit-codes.js +27 -0
- package/dist/shared/guards.d.ts +6 -0
- package/dist/shared/guards.d.ts.map +1 -0
- package/dist/shared/guards.js +26 -0
- package/dist/shared/schemas.d.ts +57 -0
- package/dist/shared/schemas.d.ts.map +1 -0
- package/dist/shared/schemas.js +36 -0
- package/dist/shared/types.d.ts +53 -0
- package/dist/shared/types.d.ts.map +1 -0
- package/dist/shared/types.js +1 -0
- package/package.json +81 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
|
|
2
|
+
import type { Result as ResultType } from "better-result";
|
|
3
|
+
import { RemoteRequestError, type ValidationError } from "../shared/errors.js";
|
|
4
|
+
import type { McpToolSummary, ToolCallResult } from "../shared/types.js";
|
|
5
|
+
interface McpTarget {
|
|
6
|
+
orgSlug: string;
|
|
7
|
+
serverPath: string;
|
|
8
|
+
}
|
|
9
|
+
interface McpClientLike {
|
|
10
|
+
callTool(params: {
|
|
11
|
+
arguments: Record<string, unknown>;
|
|
12
|
+
name: string;
|
|
13
|
+
}): Promise<unknown>;
|
|
14
|
+
close(): Promise<void>;
|
|
15
|
+
connect(transport: unknown): Promise<void>;
|
|
16
|
+
listTools(): Promise<{
|
|
17
|
+
tools: Array<Record<string, unknown>>;
|
|
18
|
+
}>;
|
|
19
|
+
}
|
|
20
|
+
interface McpServiceDeps {
|
|
21
|
+
baseUrl: string;
|
|
22
|
+
createClient?: () => McpClientLike;
|
|
23
|
+
createTransport?: (url: URL, apiKey: string) => StreamableHTTPClientTransport;
|
|
24
|
+
version: string;
|
|
25
|
+
}
|
|
26
|
+
export type McpServiceError = RemoteRequestError | ValidationError;
|
|
27
|
+
export interface McpService {
|
|
28
|
+
callTool(target: McpTarget, apiKey: string, toolName: string, args: Record<string, unknown>): Promise<ResultType<ToolCallResult, McpServiceError>>;
|
|
29
|
+
listTools(target: McpTarget, apiKey: string): Promise<ResultType<McpToolSummary[], McpServiceError>>;
|
|
30
|
+
}
|
|
31
|
+
export declare const createMcpService: (deps: McpServiceDeps) => McpService;
|
|
32
|
+
export {};
|
|
33
|
+
//# sourceMappingURL=mcp.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../../src/services/mcp.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,6BAA6B,EAAE,MAAM,oDAAoD,CAAC;AAEnG,OAAO,KAAK,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,eAAe,CAAC;AAE1D,OAAO,EAAE,kBAAkB,EAAE,KAAK,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAG/E,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEzE,UAAU,SAAS;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,UAAU,aAAa;IACrB,QAAQ,CAAC,MAAM,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACzF,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACvB,OAAO,CAAC,SAAS,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3C,SAAS,IAAI,OAAO,CAAC;QACnB,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;KACvC,CAAC,CAAC;CACJ;AAED,UAAU,cAAc;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,aAAa,CAAC;IACnC,eAAe,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,KAAK,6BAA6B,CAAC;IAC9E,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,MAAM,eAAe,GAAG,kBAAkB,GAAG,eAAe,CAAC;AAEnE,MAAM,WAAW,UAAU;IACzB,QAAQ,CACN,MAAM,EAAE,SAAS,EACjB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC5B,OAAO,CAAC,UAAU,CAAC,cAAc,EAAE,eAAe,CAAC,CAAC,CAAC;IACxD,SAAS,CACP,MAAM,EAAE,SAAS,EACjB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,UAAU,CAAC,cAAc,EAAE,EAAE,eAAe,CAAC,CAAC,CAAC;CAC3D;AAkFD,eAAO,MAAM,gBAAgB,GAAI,MAAM,cAAc,KAAG,UA2GvD,CAAC"}
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import { Client } from "@modelcontextprotocol/sdk/client";
|
|
2
|
+
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
|
|
3
|
+
import { Result } from "better-result";
|
|
4
|
+
import { RemoteRequestError } from "../shared/errors.js";
|
|
5
|
+
import { parseWithSchema } from "../shared/guards.js";
|
|
6
|
+
import { toolDefinitionSchema } from "../shared/schemas.js";
|
|
7
|
+
const defaultCreateClient = (version) => {
|
|
8
|
+
return new Client({
|
|
9
|
+
name: "ogment-cli",
|
|
10
|
+
version,
|
|
11
|
+
}, {
|
|
12
|
+
capabilities: {},
|
|
13
|
+
});
|
|
14
|
+
};
|
|
15
|
+
const defaultCreateTransport = (url, apiKey) => {
|
|
16
|
+
return new StreamableHTTPClientTransport(url, {
|
|
17
|
+
requestInit: {
|
|
18
|
+
headers: {
|
|
19
|
+
Authorization: `Bearer ${apiKey}`,
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
const parseToolCallContent = (result) => {
|
|
25
|
+
if (typeof result !== "object" || result === null) {
|
|
26
|
+
return Result.err(new RemoteRequestError({
|
|
27
|
+
message: "MCP call returned a non-object result",
|
|
28
|
+
}));
|
|
29
|
+
}
|
|
30
|
+
const asRecord = result;
|
|
31
|
+
if (Object.hasOwn(asRecord, "toolResult")) {
|
|
32
|
+
return Result.ok({
|
|
33
|
+
isError: false,
|
|
34
|
+
structuredContent: asRecord["toolResult"],
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
if (Object.hasOwn(asRecord, "structuredContent") && asRecord["structuredContent"] !== undefined) {
|
|
38
|
+
return Result.ok({
|
|
39
|
+
isError: asRecord["isError"] === true,
|
|
40
|
+
structuredContent: asRecord["structuredContent"],
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
const content = asRecord["content"];
|
|
44
|
+
if (Array.isArray(content)) {
|
|
45
|
+
const firstItem = content[0];
|
|
46
|
+
if (typeof firstItem === "object" && firstItem !== null && Object.hasOwn(firstItem, "text")) {
|
|
47
|
+
const text = firstItem.text;
|
|
48
|
+
if (typeof text === "string") {
|
|
49
|
+
const json = Result.try({
|
|
50
|
+
catch: () => text,
|
|
51
|
+
try: () => JSON.parse(text),
|
|
52
|
+
});
|
|
53
|
+
if (Result.isError(json)) {
|
|
54
|
+
return Result.ok({
|
|
55
|
+
isError: asRecord["isError"] === true,
|
|
56
|
+
structuredContent: text,
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
return Result.ok({
|
|
60
|
+
isError: asRecord["isError"] === true,
|
|
61
|
+
structuredContent: json.value,
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
return Result.ok({
|
|
67
|
+
isError: asRecord["isError"] === true,
|
|
68
|
+
structuredContent: asRecord,
|
|
69
|
+
});
|
|
70
|
+
};
|
|
71
|
+
export const createMcpService = (deps) => {
|
|
72
|
+
const createClient = deps.createClient ?? (() => defaultCreateClient(deps.version));
|
|
73
|
+
const createTransport = deps.createTransport ?? defaultCreateTransport;
|
|
74
|
+
const withClient = async (target, apiKey, handler) => {
|
|
75
|
+
const endpoint = `${deps.baseUrl}/api/v1/mcp/${target.orgSlug}/${target.serverPath}`;
|
|
76
|
+
const url = new URL(endpoint);
|
|
77
|
+
const transport = createTransport(url, apiKey);
|
|
78
|
+
const client = createClient();
|
|
79
|
+
const connectResult = await Result.tryPromise({
|
|
80
|
+
catch: (cause) => new RemoteRequestError({
|
|
81
|
+
body: JSON.stringify({ cause }),
|
|
82
|
+
message: "Failed to connect to MCP server",
|
|
83
|
+
}),
|
|
84
|
+
try: async () => {
|
|
85
|
+
await client.connect(transport);
|
|
86
|
+
},
|
|
87
|
+
});
|
|
88
|
+
if (Result.isError(connectResult)) {
|
|
89
|
+
return connectResult;
|
|
90
|
+
}
|
|
91
|
+
try {
|
|
92
|
+
return await handler(client);
|
|
93
|
+
}
|
|
94
|
+
finally {
|
|
95
|
+
await Result.tryPromise({
|
|
96
|
+
catch: () => undefined,
|
|
97
|
+
try: async () => {
|
|
98
|
+
await client.close();
|
|
99
|
+
},
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
return {
|
|
104
|
+
callTool: async (target, apiKey, toolName, args) => {
|
|
105
|
+
return withClient(target, apiKey, async (client) => {
|
|
106
|
+
const toolCallResult = await Result.tryPromise({
|
|
107
|
+
catch: (cause) => new RemoteRequestError({
|
|
108
|
+
body: JSON.stringify({ cause }),
|
|
109
|
+
message: "MCP tool call failed",
|
|
110
|
+
}),
|
|
111
|
+
try: async () => {
|
|
112
|
+
return client.callTool({
|
|
113
|
+
arguments: args,
|
|
114
|
+
name: toolName,
|
|
115
|
+
});
|
|
116
|
+
},
|
|
117
|
+
});
|
|
118
|
+
if (Result.isError(toolCallResult)) {
|
|
119
|
+
return toolCallResult;
|
|
120
|
+
}
|
|
121
|
+
return parseToolCallContent(toolCallResult.value);
|
|
122
|
+
});
|
|
123
|
+
},
|
|
124
|
+
listTools: async (target, apiKey) => {
|
|
125
|
+
return withClient(target, apiKey, async (client) => {
|
|
126
|
+
const toolsResult = await Result.tryPromise({
|
|
127
|
+
catch: (cause) => new RemoteRequestError({
|
|
128
|
+
body: JSON.stringify({ cause }),
|
|
129
|
+
message: "MCP tools/list failed",
|
|
130
|
+
}),
|
|
131
|
+
try: async () => {
|
|
132
|
+
return client.listTools();
|
|
133
|
+
},
|
|
134
|
+
});
|
|
135
|
+
if (Result.isError(toolsResult)) {
|
|
136
|
+
return toolsResult;
|
|
137
|
+
}
|
|
138
|
+
const parsedTools = [];
|
|
139
|
+
for (const tool of toolsResult.value.tools) {
|
|
140
|
+
const parsed = parseWithSchema(toolDefinitionSchema, tool, "MCP tool definition");
|
|
141
|
+
if (Result.isError(parsed)) {
|
|
142
|
+
return parsed;
|
|
143
|
+
}
|
|
144
|
+
const normalizedTool = {
|
|
145
|
+
description: parsed.value.description ?? null,
|
|
146
|
+
inputSchema: parsed.value.inputSchema,
|
|
147
|
+
name: parsed.value.name,
|
|
148
|
+
};
|
|
149
|
+
if (parsed.value.outputSchema !== undefined) {
|
|
150
|
+
normalizedTool.outputSchema = parsed.value.outputSchema;
|
|
151
|
+
}
|
|
152
|
+
parsedTools.push(normalizedTool);
|
|
153
|
+
}
|
|
154
|
+
return Result.ok(parsedTools);
|
|
155
|
+
});
|
|
156
|
+
},
|
|
157
|
+
};
|
|
158
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const APP_NAME = "ogment";
|
|
2
|
+
export declare const APP_DESCRIPTION = "Ogment CLI - secure your AI agents' SaaS credentials";
|
|
3
|
+
export declare const DEFAULT_OGMENT_BASE_URL = "https://dashboard.ogment.ai";
|
|
4
|
+
export declare const CLI_CLIENT_NAME = "Ogment CLI";
|
|
5
|
+
export declare const CLI_REDIRECT_HOST = "127.0.0.1";
|
|
6
|
+
export declare const VERSION = "0.3.0";
|
|
7
|
+
export declare const AGENT_SUCCESS_HINT = "Use `ogment servers` to list available servers.";
|
|
8
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/shared/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ,WAAW,CAAC;AACjC,eAAO,MAAM,eAAe,yDAAyD,CAAC;AAEtF,eAAO,MAAM,uBAAuB,gCAAgC,CAAC;AACrE,eAAO,MAAM,eAAe,eAAe,CAAC;AAC5C,eAAO,MAAM,iBAAiB,cAAc,CAAC;AAE7C,eAAO,MAAM,OAAO,UAAU,CAAC;AAE/B,eAAO,MAAM,kBAAkB,oDAAoD,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export const APP_NAME = "ogment";
|
|
2
|
+
export const APP_DESCRIPTION = "Ogment CLI - secure your AI agents' SaaS credentials";
|
|
3
|
+
export const DEFAULT_OGMENT_BASE_URL = "https://dashboard.ogment.ai";
|
|
4
|
+
export const CLI_CLIENT_NAME = "Ogment CLI";
|
|
5
|
+
export const CLI_REDIRECT_HOST = "127.0.0.1";
|
|
6
|
+
export const VERSION = "0.3.0";
|
|
7
|
+
export const AGENT_SUCCESS_HINT = "Use `ogment servers` to list available servers.";
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
declare const ValidationErrorBase: import("better-result").TaggedErrorClass<"ValidationError", {
|
|
2
|
+
message: string;
|
|
3
|
+
details?: string;
|
|
4
|
+
}>;
|
|
5
|
+
export declare class ValidationError extends ValidationErrorBase {
|
|
6
|
+
}
|
|
7
|
+
declare const AuthErrorBase: import("better-result").TaggedErrorClass<"AuthError", {
|
|
8
|
+
message: string;
|
|
9
|
+
details?: string;
|
|
10
|
+
}>;
|
|
11
|
+
export declare class AuthError extends AuthErrorBase {
|
|
12
|
+
}
|
|
13
|
+
declare const NotFoundErrorBase: import("better-result").TaggedErrorClass<"NotFoundError", {
|
|
14
|
+
message: string;
|
|
15
|
+
resource: string;
|
|
16
|
+
}>;
|
|
17
|
+
export declare class NotFoundError extends NotFoundErrorBase {
|
|
18
|
+
}
|
|
19
|
+
declare const RemoteRequestErrorBase: import("better-result").TaggedErrorClass<"RemoteRequestError", {
|
|
20
|
+
message: string;
|
|
21
|
+
status?: number;
|
|
22
|
+
body?: string;
|
|
23
|
+
}>;
|
|
24
|
+
export declare class RemoteRequestError extends RemoteRequestErrorBase {
|
|
25
|
+
}
|
|
26
|
+
declare const UnexpectedErrorBase: import("better-result").TaggedErrorClass<"UnexpectedError", {
|
|
27
|
+
message: string;
|
|
28
|
+
cause?: unknown;
|
|
29
|
+
}>;
|
|
30
|
+
export declare class UnexpectedError extends UnexpectedErrorBase {
|
|
31
|
+
}
|
|
32
|
+
export type AppError = AuthError | NotFoundError | RemoteRequestError | UnexpectedError | ValidationError;
|
|
33
|
+
export declare const formatAppError: (error: AppError) => string;
|
|
34
|
+
export {};
|
|
35
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/shared/errors.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,mBAAmB;aACd,MAAM;cACL,MAAM;EACd,CAAC;AAEL,qBAAa,eAAgB,SAAQ,mBAAmB;CAAG;AAE3D,QAAA,MAAM,aAAa;aACR,MAAM;cACL,MAAM;EACd,CAAC;AAEL,qBAAa,SAAU,SAAQ,aAAa;CAAG;AAE/C,QAAA,MAAM,iBAAiB;aACZ,MAAM;cACL,MAAM;EACd,CAAC;AAEL,qBAAa,aAAc,SAAQ,iBAAiB;CAAG;AAEvD,QAAA,MAAM,sBAAsB;aACjB,MAAM;aACN,MAAM;WACR,MAAM;EACX,CAAC;AAEL,qBAAa,kBAAmB,SAAQ,sBAAsB;CAAG;AAEjE,QAAA,MAAM,mBAAmB;aACd,MAAM;YACP,OAAO;EACb,CAAC;AAEL,qBAAa,eAAgB,SAAQ,mBAAmB;CAAG;AAE3D,MAAM,MAAM,QAAQ,GAChB,SAAS,GACT,aAAa,GACb,kBAAkB,GAClB,eAAe,GACf,eAAe,CAAC;AAMpB,eAAO,MAAM,cAAc,GAAI,OAAO,QAAQ,KAAG,MAchD,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { TaggedError } from "better-result";
|
|
2
|
+
const ValidationErrorBase = TaggedError("ValidationError")();
|
|
3
|
+
export class ValidationError extends ValidationErrorBase {
|
|
4
|
+
}
|
|
5
|
+
const AuthErrorBase = TaggedError("AuthError")();
|
|
6
|
+
export class AuthError extends AuthErrorBase {
|
|
7
|
+
}
|
|
8
|
+
const NotFoundErrorBase = TaggedError("NotFoundError")();
|
|
9
|
+
export class NotFoundError extends NotFoundErrorBase {
|
|
10
|
+
}
|
|
11
|
+
const RemoteRequestErrorBase = TaggedError("RemoteRequestError")();
|
|
12
|
+
export class RemoteRequestError extends RemoteRequestErrorBase {
|
|
13
|
+
}
|
|
14
|
+
const UnexpectedErrorBase = TaggedError("UnexpectedError")();
|
|
15
|
+
export class UnexpectedError extends UnexpectedErrorBase {
|
|
16
|
+
}
|
|
17
|
+
const hasDetails = (error) => {
|
|
18
|
+
return error._tag === "AuthError" || error._tag === "ValidationError";
|
|
19
|
+
};
|
|
20
|
+
export const formatAppError = (error) => {
|
|
21
|
+
if (error._tag === "NotFoundError") {
|
|
22
|
+
return `${error.message} (${error.resource})`;
|
|
23
|
+
}
|
|
24
|
+
if (error._tag === "RemoteRequestError" && typeof error.status === "number") {
|
|
25
|
+
return `${error.message} (status ${error.status})`;
|
|
26
|
+
}
|
|
27
|
+
if (hasDetails(error) && typeof error.details === "string" && error.details.length > 0) {
|
|
28
|
+
return `${error.message}: ${error.details}`;
|
|
29
|
+
}
|
|
30
|
+
return error.message;
|
|
31
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { AppError } from "./errors.js";
|
|
2
|
+
export declare const EXIT_CODE: {
|
|
3
|
+
readonly auth: 20;
|
|
4
|
+
readonly notFound: 40;
|
|
5
|
+
readonly remoteRequest: 30;
|
|
6
|
+
readonly success: 0;
|
|
7
|
+
readonly unexpected: 50;
|
|
8
|
+
readonly validation: 10;
|
|
9
|
+
};
|
|
10
|
+
export type ExitCode = (typeof EXIT_CODE)[keyof typeof EXIT_CODE];
|
|
11
|
+
export declare const exitCodeForError: (error: AppError) => ExitCode;
|
|
12
|
+
//# sourceMappingURL=exit-codes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exit-codes.d.ts","sourceRoot":"","sources":["../../src/shared/exit-codes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE5C,eAAO,MAAM,SAAS;;;;;;;CAOZ,CAAC;AAEX,MAAM,MAAM,QAAQ,GAAG,CAAC,OAAO,SAAS,CAAC,CAAC,MAAM,OAAO,SAAS,CAAC,CAAC;AAElE,eAAO,MAAM,gBAAgB,GAAI,OAAO,QAAQ,KAAG,QAkBlD,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export const EXIT_CODE = {
|
|
2
|
+
auth: 20,
|
|
3
|
+
notFound: 40,
|
|
4
|
+
remoteRequest: 30,
|
|
5
|
+
success: 0,
|
|
6
|
+
unexpected: 50,
|
|
7
|
+
validation: 10,
|
|
8
|
+
};
|
|
9
|
+
export const exitCodeForError = (error) => {
|
|
10
|
+
switch (error._tag) {
|
|
11
|
+
case "AuthError": {
|
|
12
|
+
return EXIT_CODE.auth;
|
|
13
|
+
}
|
|
14
|
+
case "NotFoundError": {
|
|
15
|
+
return EXIT_CODE.notFound;
|
|
16
|
+
}
|
|
17
|
+
case "RemoteRequestError": {
|
|
18
|
+
return EXIT_CODE.remoteRequest;
|
|
19
|
+
}
|
|
20
|
+
case "UnexpectedError": {
|
|
21
|
+
return EXIT_CODE.unexpected;
|
|
22
|
+
}
|
|
23
|
+
case "ValidationError": {
|
|
24
|
+
return EXIT_CODE.validation;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Result as ResultType } from "better-result";
|
|
2
|
+
import type { ZodTypeAny } from "zod";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
import { ValidationError } from "./errors.js";
|
|
5
|
+
export declare const parseWithSchema: <TSchema extends ZodTypeAny>(schema: TSchema, payload: unknown, context: string) => ResultType<z.infer<TSchema>, ValidationError>;
|
|
6
|
+
//# sourceMappingURL=guards.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"guards.d.ts","sourceRoot":"","sources":["../../src/shared/guards.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AACtC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAoB9C,eAAO,MAAM,eAAe,GAAI,OAAO,SAAS,UAAU,EACxD,QAAQ,OAAO,EACf,SAAS,OAAO,EAChB,SAAS,MAAM,KACd,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,eAAe,CAa9C,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Result } from "better-result";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { ValidationError } from "./errors.js";
|
|
4
|
+
const formatIssues = (issues) => {
|
|
5
|
+
return issues
|
|
6
|
+
.map((issue) => {
|
|
7
|
+
if (issue.path.length === 0) {
|
|
8
|
+
return issue.message;
|
|
9
|
+
}
|
|
10
|
+
const path = issue.path
|
|
11
|
+
.filter((value) => typeof value === "number" || typeof value === "string")
|
|
12
|
+
.join(".");
|
|
13
|
+
return `${path}: ${issue.message}`;
|
|
14
|
+
})
|
|
15
|
+
.join("; ");
|
|
16
|
+
};
|
|
17
|
+
export const parseWithSchema = (schema, payload, context) => {
|
|
18
|
+
const parsed = schema.safeParse(payload);
|
|
19
|
+
if (!parsed.success) {
|
|
20
|
+
return Result.err(new ValidationError({
|
|
21
|
+
details: formatIssues(parsed.error.issues),
|
|
22
|
+
message: `Invalid ${context}`,
|
|
23
|
+
}));
|
|
24
|
+
}
|
|
25
|
+
return Result.ok(parsed.data);
|
|
26
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { accountMeSchema, browserAgentCallbackSchema, cliExchangeErrorSchema, cliExchangeRequestSchema, cliExchangeSuccessSchema, deviceCodeStartSchema, deviceTokenApprovedSchema, oauthClientRegistrationSchema, oauthTokenSchema, orgServerSchema, organizationSchema } from "@ogment-ai/cli-contract/v1";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
export { accountMeSchema, browserAgentCallbackSchema, cliExchangeErrorSchema, cliExchangeRequestSchema, cliExchangeSuccessSchema, deviceCodeStartSchema, deviceTokenApprovedSchema, oauthClientRegistrationSchema, oauthTokenSchema, orgServerSchema, organizationSchema, };
|
|
4
|
+
export type OrgServerSchemaData = z.infer<typeof orgServerSchema>;
|
|
5
|
+
export type OrganizationSchemaData = z.infer<typeof organizationSchema>;
|
|
6
|
+
export type AccountMeData = z.infer<typeof accountMeSchema>["data"];
|
|
7
|
+
export type AccountMeResponse = z.infer<typeof accountMeSchema>;
|
|
8
|
+
export type DeviceCodeStartData = z.infer<typeof deviceCodeStartSchema>["data"];
|
|
9
|
+
export type DeviceCodeStartResponse = z.infer<typeof deviceCodeStartSchema>;
|
|
10
|
+
export type DeviceTokenApprovedData = z.infer<typeof deviceTokenApprovedSchema>["data"];
|
|
11
|
+
export type DeviceTokenApprovedResponse = z.infer<typeof deviceTokenApprovedSchema>;
|
|
12
|
+
export type OauthClientRegistrationResponse = z.infer<typeof oauthClientRegistrationSchema>;
|
|
13
|
+
export type OauthTokenResponse = z.infer<typeof oauthTokenSchema>;
|
|
14
|
+
export declare const credentialsFileSchema: z.ZodObject<{
|
|
15
|
+
accessToken: z.ZodOptional<z.ZodString>;
|
|
16
|
+
agentName: z.ZodOptional<z.ZodString>;
|
|
17
|
+
apiKey: z.ZodOptional<z.ZodString>;
|
|
18
|
+
}, z.core.$strip>;
|
|
19
|
+
export type CredentialsFile = z.infer<typeof credentialsFileSchema>;
|
|
20
|
+
export declare const toolDefinitionSchema: z.ZodObject<{
|
|
21
|
+
description: z.ZodOptional<z.ZodString>;
|
|
22
|
+
inputSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
23
|
+
name: z.ZodString;
|
|
24
|
+
outputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
25
|
+
}, z.core.$strip>;
|
|
26
|
+
export type ToolDefinitionData = z.infer<typeof toolDefinitionSchema>;
|
|
27
|
+
export declare const describeToolSchema: z.ZodObject<{
|
|
28
|
+
description: z.ZodString;
|
|
29
|
+
name: z.ZodString;
|
|
30
|
+
outputSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
31
|
+
parameters: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
32
|
+
}, z.core.$strip>;
|
|
33
|
+
export type DescribeTool = z.infer<typeof describeToolSchema>;
|
|
34
|
+
export declare const describePayloadSchema: z.ZodObject<{
|
|
35
|
+
tools: z.ZodArray<z.ZodObject<{
|
|
36
|
+
description: z.ZodString;
|
|
37
|
+
name: z.ZodString;
|
|
38
|
+
outputSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
39
|
+
parameters: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
40
|
+
}, z.core.$strip>>;
|
|
41
|
+
}, z.core.$strip>;
|
|
42
|
+
export type DescribePayload = z.infer<typeof describePayloadSchema>;
|
|
43
|
+
export declare const cliJsonSuccessSchema: z.ZodObject<{
|
|
44
|
+
data: z.ZodUnknown;
|
|
45
|
+
status: z.ZodLiteral<"success">;
|
|
46
|
+
}, z.core.$strip>;
|
|
47
|
+
export type CliJsonSuccess = z.infer<typeof cliJsonSuccessSchema>;
|
|
48
|
+
export declare const cliJsonErrorSchema: z.ZodObject<{
|
|
49
|
+
error: z.ZodObject<{
|
|
50
|
+
details: z.ZodOptional<z.ZodString>;
|
|
51
|
+
message: z.ZodString;
|
|
52
|
+
type: z.ZodString;
|
|
53
|
+
}, z.core.$strip>;
|
|
54
|
+
status: z.ZodLiteral<"error">;
|
|
55
|
+
}, z.core.$strip>;
|
|
56
|
+
export type CliJsonError = z.infer<typeof cliJsonErrorSchema>;
|
|
57
|
+
//# sourceMappingURL=schemas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../src/shared/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,0BAA0B,EAC1B,sBAAsB,EACtB,wBAAwB,EACxB,wBAAwB,EACxB,qBAAqB,EACrB,yBAAyB,EACzB,6BAA6B,EAC7B,gBAAgB,EAChB,eAAe,EACf,kBAAkB,EACnB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EACL,eAAe,EACf,0BAA0B,EAC1B,sBAAsB,EACtB,wBAAwB,EACxB,wBAAwB,EACxB,qBAAqB,EACrB,yBAAyB,EACzB,6BAA6B,EAC7B,gBAAgB,EAChB,eAAe,EACf,kBAAkB,GACnB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAClE,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AACxE,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC;AACpE,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAChE,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC,MAAM,CAAC,CAAC;AAChF,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAC5E,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC,MAAM,CAAC,CAAC;AACxF,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AACpF,MAAM,MAAM,+BAA+B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AAC5F,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAIlE,eAAO,MAAM,qBAAqB;;;;iBAIhC,CAAC;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEpE,eAAO,MAAM,oBAAoB;;;;;iBAK/B,CAAC;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAEtE,eAAO,MAAM,kBAAkB;;;;;iBAK7B,CAAC;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D,eAAO,MAAM,qBAAqB;;;;;;;iBAEhC,CAAC;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEpE,eAAO,MAAM,oBAAoB;;;iBAG/B,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAElE,eAAO,MAAM,kBAAkB;;;;;;;iBAO7B,CAAC;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { accountMeSchema, browserAgentCallbackSchema, cliExchangeErrorSchema, cliExchangeRequestSchema, cliExchangeSuccessSchema, deviceCodeStartSchema, deviceTokenApprovedSchema, oauthClientRegistrationSchema, oauthTokenSchema, orgServerSchema, organizationSchema, } from "@ogment-ai/cli-contract/v1";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
export { accountMeSchema, browserAgentCallbackSchema, cliExchangeErrorSchema, cliExchangeRequestSchema, cliExchangeSuccessSchema, deviceCodeStartSchema, deviceTokenApprovedSchema, oauthClientRegistrationSchema, oauthTokenSchema, orgServerSchema, organizationSchema, };
|
|
4
|
+
const jsonObjectSchema = z.record(z.string(), z.unknown());
|
|
5
|
+
export const credentialsFileSchema = z.object({
|
|
6
|
+
accessToken: z.string().min(1).optional(),
|
|
7
|
+
agentName: z.string().optional(),
|
|
8
|
+
apiKey: z.string().min(1).optional(),
|
|
9
|
+
});
|
|
10
|
+
export const toolDefinitionSchema = z.object({
|
|
11
|
+
description: z.string().optional(),
|
|
12
|
+
inputSchema: jsonObjectSchema,
|
|
13
|
+
name: z.string(),
|
|
14
|
+
outputSchema: jsonObjectSchema.optional(),
|
|
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
|
+
});
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
export interface Credentials {
|
|
2
|
+
apiKey: string;
|
|
3
|
+
agentName?: string;
|
|
4
|
+
}
|
|
5
|
+
export interface OrgServer {
|
|
6
|
+
name: string;
|
|
7
|
+
path: string;
|
|
8
|
+
enabled: boolean;
|
|
9
|
+
description: string | null;
|
|
10
|
+
}
|
|
11
|
+
export interface Organization {
|
|
12
|
+
orgSlug: string;
|
|
13
|
+
servers: OrgServer[];
|
|
14
|
+
}
|
|
15
|
+
export interface AccountProfile {
|
|
16
|
+
email: string | null;
|
|
17
|
+
name: string | null;
|
|
18
|
+
orgs: Organization[];
|
|
19
|
+
}
|
|
20
|
+
export interface ServerWithOrg extends OrgServer {
|
|
21
|
+
orgSlug: string;
|
|
22
|
+
}
|
|
23
|
+
export interface McpToolSummary {
|
|
24
|
+
name: string;
|
|
25
|
+
description: string | null;
|
|
26
|
+
inputSchema: Record<string, unknown>;
|
|
27
|
+
outputSchema?: Record<string, unknown>;
|
|
28
|
+
}
|
|
29
|
+
export interface ToolCallResult {
|
|
30
|
+
structuredContent: unknown;
|
|
31
|
+
isError: boolean;
|
|
32
|
+
}
|
|
33
|
+
export interface LoginSuccess {
|
|
34
|
+
agentName: string;
|
|
35
|
+
alreadyLoggedIn: boolean;
|
|
36
|
+
}
|
|
37
|
+
export interface LogoutSuccess {
|
|
38
|
+
revoked: boolean;
|
|
39
|
+
localCredentialsDeleted: boolean;
|
|
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
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +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,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACxC;AAED,MAAM,WAAW,cAAc;IAC7B,iBAAiB,EAAE,OAAO,CAAC;IAC3B,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,EAAE,OAAO,CAAC;CAC1B;AAED,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,OAAO,CAAC;IACjB,uBAAuB,EAAE,OAAO,CAAC;CAClC;AAED,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,aAAa,EAAE,CAAC;CAC1B;AAED,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,aAAa,CAAC;IACtB,KAAK,EAAE,cAAc,EAAE,CAAC;CACzB;AAED,MAAM,WAAW,eAAe;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;CACjB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@ogment-ai/cli",
|
|
3
|
+
"version": "0.3.0",
|
|
4
|
+
"description": "Ogment Vault CLI — secure your AI agents' SaaS credentials",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"ogment": "./dist/cli.js"
|
|
8
|
+
},
|
|
9
|
+
"scripts": {
|
|
10
|
+
"clean": "node -e \"import { rmSync } from 'node:fs'; rmSync('dist', { recursive: true, force: true });\"",
|
|
11
|
+
"build": "npm run clean && tsc -p tsconfig.build.json",
|
|
12
|
+
"dev": "tsx src/cli.ts",
|
|
13
|
+
"start": "node dist/cli.js",
|
|
14
|
+
"check-types": "tsc -p tsconfig.json --noEmit",
|
|
15
|
+
"lint": "oxlint -c oxlint.config.ts --type-aware --type-check --tsconfig tsconfig.json src test/src vitest.config.ts",
|
|
16
|
+
"lint:fix": "npm run lint -- --fix",
|
|
17
|
+
"format": "oxfmt --write src test/src",
|
|
18
|
+
"format:check": "oxfmt --check src test/src",
|
|
19
|
+
"test": "vitest -c vitest.config.ts",
|
|
20
|
+
"test:run": "vitest run -c vitest.config.ts",
|
|
21
|
+
"test:coverage": "npm run test:run -- --coverage",
|
|
22
|
+
"test:ui": "npm run test -- --ui",
|
|
23
|
+
"test:changed": "npm run test:run -- --changed",
|
|
24
|
+
"test:ci": "npm run test:coverage",
|
|
25
|
+
"qa": "npm run lint && npm run check-types && npm run test:coverage",
|
|
26
|
+
"prepublishOnly": "npm run build"
|
|
27
|
+
},
|
|
28
|
+
"exports": {
|
|
29
|
+
".": {
|
|
30
|
+
"default": "./dist/cli.js"
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"files": [
|
|
34
|
+
"dist"
|
|
35
|
+
],
|
|
36
|
+
"keywords": [
|
|
37
|
+
"ogment",
|
|
38
|
+
"mcp",
|
|
39
|
+
"ai",
|
|
40
|
+
"vault",
|
|
41
|
+
"oauth",
|
|
42
|
+
"cli",
|
|
43
|
+
"model-context-protocol",
|
|
44
|
+
"agent",
|
|
45
|
+
"security"
|
|
46
|
+
],
|
|
47
|
+
"author": "Ogment <info@ogment.ai>",
|
|
48
|
+
"license": "MIT",
|
|
49
|
+
"repository": {
|
|
50
|
+
"type": "git",
|
|
51
|
+
"url": "git+https://github.com/ogment-ai/ogment-cli.git"
|
|
52
|
+
},
|
|
53
|
+
"bugs": {
|
|
54
|
+
"url": "https://github.com/ogment-ai/ogment-cli/issues"
|
|
55
|
+
},
|
|
56
|
+
"homepage": "https://ogment.ai",
|
|
57
|
+
"engines": {
|
|
58
|
+
"node": ">=18"
|
|
59
|
+
},
|
|
60
|
+
"dependencies": {
|
|
61
|
+
"@modelcontextprotocol/sdk": "^1.26.0",
|
|
62
|
+
"@ogment-ai/cli-contract": "0.3.0",
|
|
63
|
+
"better-result": "^2.7.0",
|
|
64
|
+
"commander": "^13.1.0",
|
|
65
|
+
"open": "^10.2.0",
|
|
66
|
+
"zod": "^4.3.6",
|
|
67
|
+
"zod-to-json-schema": "^3.25.1"
|
|
68
|
+
},
|
|
69
|
+
"devDependencies": {
|
|
70
|
+
"@types/node": "^22.18.12",
|
|
71
|
+
"@vitest/coverage-v8": "^4.0.18",
|
|
72
|
+
"@vitest/ui": "^4.0.18",
|
|
73
|
+
"opensrc": "^0.6.0",
|
|
74
|
+
"oxfmt": "^0.34.0",
|
|
75
|
+
"oxlint": "^1.49.0",
|
|
76
|
+
"oxlint-tsgolint": "^0.14.1",
|
|
77
|
+
"tsx": "^4.21.0",
|
|
78
|
+
"typescript": "^5.9.3",
|
|
79
|
+
"vitest": "^4.0.18"
|
|
80
|
+
}
|
|
81
|
+
}
|