@mintmcp/hosted-cli 0.0.17 → 0.0.18

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.
@@ -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.startupCommand ? { command: options.startupCommand } : {}),
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":"AAWA,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,oBAA4B;IAE5B,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,CAA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AAE,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.17",
3
+ "version": "0.0.18",
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
  },
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(z.object({ hostedId: HostedIdSchema }))
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
- command: z.union([z.string(), z.array(z.string())]).optional(),
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(z.unknown())
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
  }),