@ingram-cloud/sdk 1.9.0 → 1.11.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/dist/client.js +1 -1
- package/dist/zod/agents.js +26 -13
- package/dist/zod/tenant.js +8 -2
- package/package.json +2 -2
- package/ts/client.ts +1 -1
- package/ts/zod/agents.ts +27 -13
- package/ts/zod/tenant.ts +8 -2
package/dist/client.js
CHANGED
|
@@ -354,7 +354,7 @@ export class IngramCloud {
|
|
|
354
354
|
list: (aid, opts) => this.data("GET", `/agents/${enc(aid)}/ui`, opts),
|
|
355
355
|
get: (aid, name, opts) => this.json("GET", `/agents/${enc(aid)}/ui/${enc(name)}`, opts),
|
|
356
356
|
/** Upload/replace a template — `html` is the bundle, `meta` its
|
|
357
|
-
* `
|
|
357
|
+
* `UiResourceIn` sidecar. Replaces by name. */
|
|
358
358
|
put: (aid, html, meta, opts) => {
|
|
359
359
|
const form = new FormData();
|
|
360
360
|
form.append("file", html instanceof Blob
|
package/dist/zod/agents.js
CHANGED
|
@@ -23,8 +23,8 @@ export const AgentVariable = z
|
|
|
23
23
|
required: z.boolean().optional(),
|
|
24
24
|
})
|
|
25
25
|
.meta({ id: "AgentVariable" });
|
|
26
|
-
/** A
|
|
27
|
-
*
|
|
26
|
+
/** A typed app-tool bound to a UI template: the MCP host's model (or the
|
|
27
|
+
* rendered panel) calls it and the template renders the result. */
|
|
28
28
|
export const UiResourceTool = z
|
|
29
29
|
.object({
|
|
30
30
|
description: z.string(),
|
|
@@ -32,8 +32,12 @@ export const UiResourceTool = z
|
|
|
32
32
|
input_schema: z.record(z.string(), z.unknown()).optional(),
|
|
33
33
|
/** Scoped instruction the smith runs with when this tool is called. */
|
|
34
34
|
instruction: z.string().nullish(),
|
|
35
|
-
/** Writes gate through approval; reads flow freely
|
|
35
|
+
/** Writes gate through approval; reads flow freely. */
|
|
36
36
|
mutating: z.boolean().optional(),
|
|
37
|
+
/** Who may call the tool — the MCP Apps `_meta.ui.visibility` list. Omitted
|
|
38
|
+
* means both; `["app"]` hides it from the host's model so only the rendered
|
|
39
|
+
* panel can call it (a refresh or a paginated read). */
|
|
40
|
+
visibility: z.array(z.enum(["model", "app"])).optional(),
|
|
37
41
|
})
|
|
38
42
|
.meta({ id: "UiResourceTool" });
|
|
39
43
|
/** CSP domain allowlists for the sandboxed iframe — the MCP Apps `_meta.ui.csp`
|
|
@@ -46,19 +50,30 @@ export const UiCsp = z
|
|
|
46
50
|
baseUriDomains: z.array(z.string()).optional(),
|
|
47
51
|
})
|
|
48
52
|
.meta({ id: "UiCsp" });
|
|
53
|
+
/** The authored metadata of a UI template — one set of fields shared by the
|
|
54
|
+
* upload sidecar and the stored resource. `csp`, `permissions`, `prefers_border`
|
|
55
|
+
* and `domain` are the MCP Apps resource `_meta.ui`, echoed to the host verbatim. */
|
|
56
|
+
const uiTemplateMeta = {
|
|
57
|
+
csp: UiCsp.nullish(),
|
|
58
|
+
/** Host permissions the template requests, a Permissions-Policy-style map
|
|
59
|
+
* (e.g. `{ "camera": {}, "microphone": {} }`). */
|
|
60
|
+
permissions: z.record(z.string(), z.unknown()).nullish(),
|
|
61
|
+
/** Whether the host should draw its own border around the panel. Omitted
|
|
62
|
+
* leaves it to the host (Claude: borderless on web, bordered on mobile). */
|
|
63
|
+
prefers_border: z.boolean().nullish(),
|
|
64
|
+
/** A stable sandbox origin for the panel, in the host's own format — needed
|
|
65
|
+
* only when the panel runs its own OAuth flow or is CORS-allowlisted. */
|
|
66
|
+
domain: z.string().nullish(),
|
|
67
|
+
tool: UiResourceTool.nullish(),
|
|
68
|
+
};
|
|
49
69
|
/** A tenant-authored interactive UI template (MCP Apps, SEP-1865) attached to an
|
|
50
70
|
* agent. The HTML bundle lives in blob storage; this is its wire metadata (the
|
|
51
|
-
* internal blob ref is never exposed).
|
|
52
|
-
* `_meta.ui` shape and are echoed to the host on `resources/read`. */
|
|
71
|
+
* internal blob ref is never exposed). */
|
|
53
72
|
export const UiResource = z
|
|
54
73
|
.object({
|
|
55
74
|
name: z.string(),
|
|
56
75
|
content_hash: z.string(),
|
|
57
|
-
|
|
58
|
-
/** Host permissions the template requests, a Permissions-Policy-style map
|
|
59
|
-
* (e.g. `{ "camera": {}, "microphone": {} }`). */
|
|
60
|
-
permissions: z.record(z.string(), z.unknown()).optional(),
|
|
61
|
-
tool: UiResourceTool.nullish(),
|
|
76
|
+
...uiTemplateMeta,
|
|
62
77
|
})
|
|
63
78
|
.meta({ id: "UiResource" });
|
|
64
79
|
/** The mutable draft head — what the next publish snapshots. */
|
|
@@ -180,9 +195,7 @@ export const UiResourceIn = z
|
|
|
180
195
|
.string()
|
|
181
196
|
.regex(/^[a-z0-9][a-z0-9_-]*$/, "lowercase letters, digits, - and _")
|
|
182
197
|
.max(63),
|
|
183
|
-
|
|
184
|
-
permissions: z.record(z.string(), z.unknown()).nullish(),
|
|
185
|
-
tool: UiResourceTool.nullish(),
|
|
198
|
+
...uiTemplateMeta,
|
|
186
199
|
})
|
|
187
200
|
.meta({ id: "UiResourceIn" });
|
|
188
201
|
export const UiResourceListOut = z
|
package/dist/zod/tenant.js
CHANGED
|
@@ -194,11 +194,14 @@ export const ModelsListOut = z
|
|
|
194
194
|
providers: z.array(ModelProviderOut),
|
|
195
195
|
})
|
|
196
196
|
.meta({ id: "ModelsListOut" });
|
|
197
|
-
/** A BYOK model key — the `api_key` is NEVER echoed, only its presence.
|
|
197
|
+
/** A BYOK model key — the `api_key` is NEVER echoed, only its presence.
|
|
198
|
+
* `workspace_id` is Anthropic's `anthropic-workspace-id`: required by an
|
|
199
|
+
* identity-linked (multi-workspace) key, implicit in a workspace-scoped one. */
|
|
198
200
|
export const ModelKeyOut = z
|
|
199
201
|
.object({
|
|
200
202
|
provider: z.string(),
|
|
201
203
|
base_url: z.string().nullable(),
|
|
204
|
+
workspace_id: z.string().nullable(),
|
|
202
205
|
has_key: z.boolean(),
|
|
203
206
|
updated_at: z.string().nullable(),
|
|
204
207
|
})
|
|
@@ -206,18 +209,21 @@ export const ModelKeyOut = z
|
|
|
206
209
|
export const ModelKeyListOut = z
|
|
207
210
|
.object({ data: z.array(ModelKeyOut) })
|
|
208
211
|
.meta({ id: "ModelKeyListOut" });
|
|
209
|
-
/** The PUT ack — never echoes the key, only presence + the
|
|
212
|
+
/** The PUT ack — never echoes the key, only presence + the non-secret
|
|
213
|
+
* `base_url` / `workspace_id`. */
|
|
210
214
|
export const ModelKeyConfiguredOut = z
|
|
211
215
|
.object({
|
|
212
216
|
provider: z.string(),
|
|
213
217
|
configured: z.boolean(),
|
|
214
218
|
base_url: z.string().nullable(),
|
|
219
|
+
workspace_id: z.string().nullable(),
|
|
215
220
|
})
|
|
216
221
|
.meta({ id: "ModelKeyConfiguredOut" });
|
|
217
222
|
export const ModelKeyIn = z
|
|
218
223
|
.object({
|
|
219
224
|
api_key: z.string(),
|
|
220
225
|
base_url: z.string().nullish(),
|
|
226
|
+
workspace_id: z.string().nullish(),
|
|
221
227
|
})
|
|
222
228
|
.meta({ id: "ModelKeyIn" });
|
|
223
229
|
// ── Providers (tenant OAuth client credentials) ──────────────────────────────
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ingram-cloud/sdk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.11.0",
|
|
4
4
|
"description": "Typed wire contract + management-plane client for the Ingram Cloud API: Zod schemas to validate request/response bodies, TypeScript types for the JSON you read back, SSE/webhook event types, and a typed REST client.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"api",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"prepack": "bun run build"
|
|
64
64
|
},
|
|
65
65
|
"dependencies": {
|
|
66
|
-
"zod": "^4.4
|
|
66
|
+
"zod": "^4.5.4"
|
|
67
67
|
},
|
|
68
68
|
"devDependencies": {
|
|
69
69
|
"vitest": "^4.1.10"
|
package/ts/client.ts
CHANGED
|
@@ -832,7 +832,7 @@ export class IngramCloud {
|
|
|
832
832
|
opts,
|
|
833
833
|
),
|
|
834
834
|
/** Upload/replace a template — `html` is the bundle, `meta` its
|
|
835
|
-
* `
|
|
835
|
+
* `UiResourceIn` sidecar. Replaces by name. */
|
|
836
836
|
put: (
|
|
837
837
|
aid: string,
|
|
838
838
|
html: string | Blob,
|
package/ts/zod/agents.ts
CHANGED
|
@@ -25,8 +25,8 @@ export const AgentVariable = z
|
|
|
25
25
|
})
|
|
26
26
|
.meta({ id: "AgentVariable" });
|
|
27
27
|
|
|
28
|
-
/** A
|
|
29
|
-
*
|
|
28
|
+
/** A typed app-tool bound to a UI template: the MCP host's model (or the
|
|
29
|
+
* rendered panel) calls it and the template renders the result. */
|
|
30
30
|
export const UiResourceTool = z
|
|
31
31
|
.object({
|
|
32
32
|
description: z.string(),
|
|
@@ -34,8 +34,12 @@ export const UiResourceTool = z
|
|
|
34
34
|
input_schema: z.record(z.string(), z.unknown()).optional(),
|
|
35
35
|
/** Scoped instruction the smith runs with when this tool is called. */
|
|
36
36
|
instruction: z.string().nullish(),
|
|
37
|
-
/** Writes gate through approval; reads flow freely
|
|
37
|
+
/** Writes gate through approval; reads flow freely. */
|
|
38
38
|
mutating: z.boolean().optional(),
|
|
39
|
+
/** Who may call the tool — the MCP Apps `_meta.ui.visibility` list. Omitted
|
|
40
|
+
* means both; `["app"]` hides it from the host's model so only the rendered
|
|
41
|
+
* panel can call it (a refresh or a paginated read). */
|
|
42
|
+
visibility: z.array(z.enum(["model", "app"])).optional(),
|
|
39
43
|
})
|
|
40
44
|
.meta({ id: "UiResourceTool" });
|
|
41
45
|
|
|
@@ -50,19 +54,31 @@ export const UiCsp = z
|
|
|
50
54
|
})
|
|
51
55
|
.meta({ id: "UiCsp" });
|
|
52
56
|
|
|
57
|
+
/** The authored metadata of a UI template — one set of fields shared by the
|
|
58
|
+
* upload sidecar and the stored resource. `csp`, `permissions`, `prefers_border`
|
|
59
|
+
* and `domain` are the MCP Apps resource `_meta.ui`, echoed to the host verbatim. */
|
|
60
|
+
const uiTemplateMeta = {
|
|
61
|
+
csp: UiCsp.nullish(),
|
|
62
|
+
/** Host permissions the template requests, a Permissions-Policy-style map
|
|
63
|
+
* (e.g. `{ "camera": {}, "microphone": {} }`). */
|
|
64
|
+
permissions: z.record(z.string(), z.unknown()).nullish(),
|
|
65
|
+
/** Whether the host should draw its own border around the panel. Omitted
|
|
66
|
+
* leaves it to the host (Claude: borderless on web, bordered on mobile). */
|
|
67
|
+
prefers_border: z.boolean().nullish(),
|
|
68
|
+
/** A stable sandbox origin for the panel, in the host's own format — needed
|
|
69
|
+
* only when the panel runs its own OAuth flow or is CORS-allowlisted. */
|
|
70
|
+
domain: z.string().nullish(),
|
|
71
|
+
tool: UiResourceTool.nullish(),
|
|
72
|
+
};
|
|
73
|
+
|
|
53
74
|
/** A tenant-authored interactive UI template (MCP Apps, SEP-1865) attached to an
|
|
54
75
|
* agent. The HTML bundle lives in blob storage; this is its wire metadata (the
|
|
55
|
-
* internal blob ref is never exposed).
|
|
56
|
-
* `_meta.ui` shape and are echoed to the host on `resources/read`. */
|
|
76
|
+
* internal blob ref is never exposed). */
|
|
57
77
|
export const UiResource = z
|
|
58
78
|
.object({
|
|
59
79
|
name: z.string(),
|
|
60
80
|
content_hash: z.string(),
|
|
61
|
-
|
|
62
|
-
/** Host permissions the template requests, a Permissions-Policy-style map
|
|
63
|
-
* (e.g. `{ "camera": {}, "microphone": {} }`). */
|
|
64
|
-
permissions: z.record(z.string(), z.unknown()).optional(),
|
|
65
|
-
tool: UiResourceTool.nullish(),
|
|
81
|
+
...uiTemplateMeta,
|
|
66
82
|
})
|
|
67
83
|
.meta({ id: "UiResource" });
|
|
68
84
|
|
|
@@ -197,9 +213,7 @@ export const UiResourceIn = z
|
|
|
197
213
|
.string()
|
|
198
214
|
.regex(/^[a-z0-9][a-z0-9_-]*$/, "lowercase letters, digits, - and _")
|
|
199
215
|
.max(63),
|
|
200
|
-
|
|
201
|
-
permissions: z.record(z.string(), z.unknown()).nullish(),
|
|
202
|
-
tool: UiResourceTool.nullish(),
|
|
216
|
+
...uiTemplateMeta,
|
|
203
217
|
})
|
|
204
218
|
.meta({ id: "UiResourceIn" });
|
|
205
219
|
|
package/ts/zod/tenant.ts
CHANGED
|
@@ -226,11 +226,14 @@ export const ModelsListOut = z
|
|
|
226
226
|
})
|
|
227
227
|
.meta({ id: "ModelsListOut" });
|
|
228
228
|
|
|
229
|
-
/** A BYOK model key — the `api_key` is NEVER echoed, only its presence.
|
|
229
|
+
/** A BYOK model key — the `api_key` is NEVER echoed, only its presence.
|
|
230
|
+
* `workspace_id` is Anthropic's `anthropic-workspace-id`: required by an
|
|
231
|
+
* identity-linked (multi-workspace) key, implicit in a workspace-scoped one. */
|
|
230
232
|
export const ModelKeyOut = z
|
|
231
233
|
.object({
|
|
232
234
|
provider: z.string(),
|
|
233
235
|
base_url: z.string().nullable(),
|
|
236
|
+
workspace_id: z.string().nullable(),
|
|
234
237
|
has_key: z.boolean(),
|
|
235
238
|
updated_at: z.string().nullable(),
|
|
236
239
|
})
|
|
@@ -240,12 +243,14 @@ export const ModelKeyListOut = z
|
|
|
240
243
|
.object({ data: z.array(ModelKeyOut) })
|
|
241
244
|
.meta({ id: "ModelKeyListOut" });
|
|
242
245
|
|
|
243
|
-
/** The PUT ack — never echoes the key, only presence + the
|
|
246
|
+
/** The PUT ack — never echoes the key, only presence + the non-secret
|
|
247
|
+
* `base_url` / `workspace_id`. */
|
|
244
248
|
export const ModelKeyConfiguredOut = z
|
|
245
249
|
.object({
|
|
246
250
|
provider: z.string(),
|
|
247
251
|
configured: z.boolean(),
|
|
248
252
|
base_url: z.string().nullable(),
|
|
253
|
+
workspace_id: z.string().nullable(),
|
|
249
254
|
})
|
|
250
255
|
.meta({ id: "ModelKeyConfiguredOut" });
|
|
251
256
|
|
|
@@ -253,6 +258,7 @@ export const ModelKeyIn = z
|
|
|
253
258
|
.object({
|
|
254
259
|
api_key: z.string(),
|
|
255
260
|
base_url: z.string().nullish(),
|
|
261
|
+
workspace_id: z.string().nullish(),
|
|
256
262
|
})
|
|
257
263
|
.meta({ id: "ModelKeyIn" });
|
|
258
264
|
|