@mintmcp/hosted-cli 0.0.17 → 0.0.19
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/api.d.ts +87 -5
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +65 -4
- package/dist/api.js.map +1 -1
- package/dist/containerBuilder.d.ts +48 -0
- package/dist/containerBuilder.d.ts.map +1 -0
- package/dist/containerBuilder.js +301 -0
- package/dist/containerBuilder.js.map +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +400 -38
- package/dist/index.js.map +1 -1
- package/dist/updateBuilder.d.ts +28 -3
- package/dist/updateBuilder.d.ts.map +1 -1
- package/dist/updateBuilder.js +8 -3
- package/dist/updateBuilder.js.map +1 -1
- package/package.json +3 -2
- package/src/api.ts +87 -4
- package/src/containerBuilder.ts +531 -0
- package/src/index.ts +633 -63
- package/src/updateBuilder.ts +10 -3
package/dist/updateBuilder.d.ts
CHANGED
|
@@ -2,20 +2,45 @@ import type { HostedTransport } from "./api.js";
|
|
|
2
2
|
export type Transport = "http" | "stdio";
|
|
3
3
|
export interface DeployOptions {
|
|
4
4
|
name?: string;
|
|
5
|
+
image?: string;
|
|
5
6
|
transport?: Transport;
|
|
6
7
|
startupCommand?: string;
|
|
7
8
|
mntDataDir?: string;
|
|
8
9
|
}
|
|
9
10
|
export declare function toHostedTransport(transport: Transport): HostedTransport;
|
|
10
|
-
export declare function buildPartialUpdate(options: DeployOptions, secretDataZipGcsPath
|
|
11
|
-
|
|
11
|
+
export declare function buildPartialUpdate(options: DeployOptions, secretDataZipGcsPath?: string, extra?: {
|
|
12
|
+
clearCommand?: boolean;
|
|
13
|
+
}): {
|
|
14
|
+
secretDataZipGcsPath?: string;
|
|
12
15
|
transport?: {
|
|
13
16
|
path: string;
|
|
14
17
|
type: "http";
|
|
15
18
|
} | {
|
|
16
19
|
type: "stdio";
|
|
17
20
|
};
|
|
18
|
-
command
|
|
21
|
+
command: string;
|
|
22
|
+
image?: string;
|
|
23
|
+
userGivenName?: string;
|
|
24
|
+
} | {
|
|
25
|
+
secretDataZipGcsPath?: string;
|
|
26
|
+
transport?: {
|
|
27
|
+
path: string;
|
|
28
|
+
type: "http";
|
|
29
|
+
} | {
|
|
30
|
+
type: "stdio";
|
|
31
|
+
};
|
|
32
|
+
command: null;
|
|
33
|
+
image?: string;
|
|
34
|
+
userGivenName?: string;
|
|
35
|
+
} | {
|
|
36
|
+
secretDataZipGcsPath?: string;
|
|
37
|
+
transport?: {
|
|
38
|
+
path: string;
|
|
39
|
+
type: "http";
|
|
40
|
+
} | {
|
|
41
|
+
type: "stdio";
|
|
42
|
+
};
|
|
43
|
+
image?: string;
|
|
19
44
|
userGivenName?: string;
|
|
20
45
|
};
|
|
21
46
|
//# sourceMappingURL=updateBuilder.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"updateBuilder.d.ts","sourceRoot":"","sources":["../src/updateBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAEhD,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,OAAO,CAAC;AAEzC,MAAM,WAAW,aAAa;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,SAAS,GAAG,eAAe,CAOvE;AAED,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,aAAa,EACtB,oBAAoB,EAAE,MAAM
|
|
1
|
+
{"version":3,"file":"updateBuilder.d.ts","sourceRoot":"","sources":["../src/updateBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAEhD,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,OAAO,CAAC;AAEzC,MAAM,WAAW,aAAa;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,SAAS,GAAG,eAAe,CAOvE;AAED,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,aAAa,EACtB,oBAAoB,CAAC,EAAE,MAAM,EAC7B,KAAK,CAAC,EAAE;IAAE,YAAY,CAAC,EAAE,OAAO,CAAA;CAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgBnC"}
|
package/dist/updateBuilder.js
CHANGED
|
@@ -6,15 +6,20 @@ export function toHostedTransport(transport) {
|
|
|
6
6
|
return { type: "stdio" };
|
|
7
7
|
}
|
|
8
8
|
}
|
|
9
|
-
export function buildPartialUpdate(options, secretDataZipGcsPath) {
|
|
9
|
+
export function buildPartialUpdate(options, secretDataZipGcsPath, extra) {
|
|
10
10
|
return {
|
|
11
11
|
// Omit fields that are undefined to prevent defaults from being applied
|
|
12
12
|
...(options.name ? { userGivenName: options.name } : {}),
|
|
13
|
-
...(options.
|
|
13
|
+
...(options.image ? { image: options.image } : {}),
|
|
14
|
+
...(options.startupCommand
|
|
15
|
+
? { command: options.startupCommand }
|
|
16
|
+
: extra?.clearCommand
|
|
17
|
+
? { command: null }
|
|
18
|
+
: {}),
|
|
14
19
|
...(options.transport
|
|
15
20
|
? { transport: toHostedTransport(options.transport) }
|
|
16
21
|
: {}),
|
|
17
|
-
secretDataZipGcsPath,
|
|
22
|
+
...(secretDataZipGcsPath != undefined ? { secretDataZipGcsPath } : {}),
|
|
18
23
|
};
|
|
19
24
|
}
|
|
20
25
|
//# sourceMappingURL=updateBuilder.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"updateBuilder.js","sourceRoot":"","sources":["../src/updateBuilder.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"updateBuilder.js","sourceRoot":"","sources":["../src/updateBuilder.ts"],"names":[],"mappings":"AAYA,MAAM,UAAU,iBAAiB,CAAC,SAAoB;IACpD,QAAQ,SAAS,EAAE,CAAC;QAClB,KAAK,MAAM;YACT,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;QACxC,KAAK,OAAO;YACV,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;IAC7B,CAAC;AACH,CAAC;AAED,MAAM,UAAU,kBAAkB,CAChC,OAAsB,EACtB,oBAA6B,EAC7B,KAAkC;IAElC,OAAO;QACL,wEAAwE;QACxE,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,aAAa,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACxD,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAClD,GAAG,CAAC,OAAO,CAAC,cAAc;YACxB,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,cAAc,EAAE;YACrC,CAAC,CAAC,KAAK,EAAE,YAAY;gBACnB,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE;gBACnB,CAAC,CAAC,EAAE,CAAC;QACT,GAAG,CAAC,OAAO,CAAC,SAAS;YACnB,CAAC,CAAC,EAAE,SAAS,EAAE,iBAAiB,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE;YACrD,CAAC,CAAC,EAAE,CAAC;QACP,GAAG,CAAC,oBAAoB,IAAI,SAAS,CAAC,CAAC,CAAC,EAAE,oBAAoB,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACvE,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mintmcp/hosted-cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.19",
|
|
4
4
|
"description": "Control hosted servers on MintMCP.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
],
|
|
16
16
|
"scripts": {
|
|
17
17
|
"clean": "node -e \"require('fs').rmSync('dist', { recursive: true, force: true })\"",
|
|
18
|
-
"build": "tsc",
|
|
18
|
+
"build": "tsc -p tsconfig.build.json",
|
|
19
19
|
"test": "jest --config jest.config.cjs && node --experimental-vm-modules ./node_modules/jest/bin/jest.js --config jest.esm.config.cjs",
|
|
20
20
|
"prepublishOnly": "npm run build"
|
|
21
21
|
},
|
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@commander-js/extra-typings": "^14.0.0",
|
|
38
|
+
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
38
39
|
"@trpc/client": "^11.4.3",
|
|
39
40
|
"@trpc/server": "^11.4.3",
|
|
40
41
|
"archiver": "^7.0.1",
|
package/src/api.ts
CHANGED
|
@@ -22,6 +22,12 @@ export const HostedIdSchema = z
|
|
|
22
22
|
.brand<"HostedId">();
|
|
23
23
|
export type HostedId = z.infer<typeof HostedIdSchema>;
|
|
24
24
|
|
|
25
|
+
export const GatewayIdSchema = z.string().min(1);
|
|
26
|
+
export type GatewayId = z.infer<typeof GatewayIdSchema>;
|
|
27
|
+
|
|
28
|
+
export const ManagedImageTagSchema = z.string().regex(/^mi_[0-9A-Za-z]{22}$/);
|
|
29
|
+
export type ManagedImageTag = z.infer<typeof ManagedImageTagSchema>;
|
|
30
|
+
|
|
25
31
|
export const EnvUpdateValueSchema = z.discriminatedUnion("type", [
|
|
26
32
|
z.object({
|
|
27
33
|
type: z.literal("copyPreviousValue"),
|
|
@@ -56,7 +62,7 @@ export const UserConfigUpdateSchema = z.object({
|
|
|
56
62
|
.default(
|
|
57
63
|
"nikolaik/python-nodejs@sha256:1dcaf296688723fbe79c400e1dda743c8e8a8b2812ef4b0af70779914a9cec3c",
|
|
58
64
|
),
|
|
59
|
-
command: z.union([z.string(), z.array(z.string())]),
|
|
65
|
+
command: z.union([z.string(), z.array(z.string())]).optional(),
|
|
60
66
|
transport: HostedTransportSchema,
|
|
61
67
|
cpu: z.number().default(1),
|
|
62
68
|
memoryMiB: z.number().default(4096),
|
|
@@ -77,7 +83,9 @@ const appRouter = router({
|
|
|
77
83
|
mcpHost: router({
|
|
78
84
|
createServer: procedure
|
|
79
85
|
.input(z.object({ config: UserConfigUpdateSchema }))
|
|
80
|
-
.output(
|
|
86
|
+
.output(
|
|
87
|
+
z.object({ hostedId: HostedIdSchema, gatewayId: GatewayIdSchema }),
|
|
88
|
+
)
|
|
81
89
|
.mutation(() => {
|
|
82
90
|
throw new Error("stub");
|
|
83
91
|
}),
|
|
@@ -87,13 +95,88 @@ const appRouter = router({
|
|
|
87
95
|
hostedId: HostedIdSchema,
|
|
88
96
|
update: z.object({
|
|
89
97
|
userGivenName: z.string().optional(),
|
|
90
|
-
|
|
98
|
+
image: z.string().optional(),
|
|
99
|
+
command: z
|
|
100
|
+
.union([z.string(), z.array(z.string())])
|
|
101
|
+
.optional()
|
|
102
|
+
.nullable(),
|
|
91
103
|
transport: HostedTransportSchema.optional(),
|
|
92
104
|
secretDataZipGcsPath: z.string().optional(),
|
|
93
105
|
}),
|
|
94
106
|
}),
|
|
95
107
|
)
|
|
96
|
-
.output(
|
|
108
|
+
.output(
|
|
109
|
+
z.object({
|
|
110
|
+
hostedId: HostedIdSchema,
|
|
111
|
+
gatewayId: GatewayIdSchema.optional(),
|
|
112
|
+
}),
|
|
113
|
+
)
|
|
114
|
+
.mutation(() => {
|
|
115
|
+
throw new Error("stub");
|
|
116
|
+
}),
|
|
117
|
+
createRegistryPushSession: procedure
|
|
118
|
+
.input(
|
|
119
|
+
z.object({
|
|
120
|
+
hostedId: HostedIdSchema,
|
|
121
|
+
}),
|
|
122
|
+
)
|
|
123
|
+
.output(
|
|
124
|
+
z.object({
|
|
125
|
+
registryHost: z.string(),
|
|
126
|
+
repository: z.string(),
|
|
127
|
+
username: z.string(),
|
|
128
|
+
password: z.string(),
|
|
129
|
+
imageTag: ManagedImageTagSchema,
|
|
130
|
+
finalizeToken: z.string(),
|
|
131
|
+
}),
|
|
132
|
+
)
|
|
133
|
+
.mutation(() => {
|
|
134
|
+
throw new Error("stub");
|
|
135
|
+
}),
|
|
136
|
+
createRegistryPushSessionForCreate: procedure
|
|
137
|
+
.input(z.object({}))
|
|
138
|
+
.output(
|
|
139
|
+
z.object({
|
|
140
|
+
registryHost: z.string(),
|
|
141
|
+
repository: z.string(),
|
|
142
|
+
username: z.string(),
|
|
143
|
+
password: z.string(),
|
|
144
|
+
imageTag: ManagedImageTagSchema,
|
|
145
|
+
finalizeToken: z.string(),
|
|
146
|
+
}),
|
|
147
|
+
)
|
|
148
|
+
.mutation(() => {
|
|
149
|
+
throw new Error("stub");
|
|
150
|
+
}),
|
|
151
|
+
finalizeRegistryPush: procedure
|
|
152
|
+
.input(
|
|
153
|
+
z.object({
|
|
154
|
+
hostedId: HostedIdSchema,
|
|
155
|
+
finalizeToken: z.string(),
|
|
156
|
+
}),
|
|
157
|
+
)
|
|
158
|
+
.output(
|
|
159
|
+
z.object({
|
|
160
|
+
hostedId: HostedIdSchema,
|
|
161
|
+
gatewayId: GatewayIdSchema.optional(),
|
|
162
|
+
}),
|
|
163
|
+
)
|
|
164
|
+
.mutation(() => {
|
|
165
|
+
throw new Error("stub");
|
|
166
|
+
}),
|
|
167
|
+
finalizeRegistryPushCreate: procedure
|
|
168
|
+
.input(
|
|
169
|
+
z.object({
|
|
170
|
+
finalizeToken: z.string(),
|
|
171
|
+
config: UserConfigUpdateSchema.omit({ image: true }),
|
|
172
|
+
}),
|
|
173
|
+
)
|
|
174
|
+
.output(
|
|
175
|
+
z.object({
|
|
176
|
+
hostedId: HostedIdSchema,
|
|
177
|
+
gatewayId: GatewayIdSchema,
|
|
178
|
+
}),
|
|
179
|
+
)
|
|
97
180
|
.mutation(() => {
|
|
98
181
|
throw new Error("stub");
|
|
99
182
|
}),
|