@ingram-cloud/sdk 1.4.0 → 1.6.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 +34 -35
- package/dist/client.js +240 -23
- package/dist/index.js +4 -0
- package/dist/scopes.js +52 -0
- package/dist/zod/_actor.js +33 -0
- package/dist/zod/_page.js +18 -4
- package/dist/zod/agents.js +7 -3
- package/dist/zod/approvals.js +9 -0
- package/dist/zod/billing.js +136 -0
- package/dist/zod/budgets.js +2 -3
- package/dist/zod/connections.js +2 -3
- package/dist/zod/conversations.js +4 -11
- package/dist/zod/deployments.js +32 -0
- package/dist/zod/files.js +2 -9
- package/dist/zod/index.js +3 -0
- package/dist/zod/mcp.js +8 -10
- package/dist/zod/observability.js +38 -19
- package/dist/zod/projects.js +4 -4
- package/dist/zod/runs.js +19 -4
- package/dist/zod/schedules.js +2 -7
- package/dist/zod/skills.js +73 -0
- package/dist/zod/smith-revisions.js +2 -3
- package/dist/zod/smiths.js +6 -0
- package/dist/zod/tenant.js +24 -4
- package/dist/zod/vector-stores.js +6 -19
- package/package.json +25 -18
- package/ts/client.ts +456 -60
- package/ts/index.ts +4 -0
- package/ts/responses.ts +40 -2
- package/ts/scopes.ts +57 -0
- package/ts/zod/_actor.ts +36 -0
- package/ts/zod/_page.ts +19 -4
- package/ts/zod/agents.ts +7 -3
- package/ts/zod/approvals.ts +9 -0
- package/ts/zod/billing.ts +168 -0
- package/ts/zod/budgets.ts +2 -3
- package/ts/zod/connections.ts +2 -3
- package/ts/zod/conversations.ts +7 -11
- package/ts/zod/deployments.ts +36 -0
- package/ts/zod/files.ts +2 -9
- package/ts/zod/index.ts +3 -0
- package/ts/zod/mcp.ts +8 -11
- package/ts/zod/observability.ts +74 -24
- package/ts/zod/projects.ts +4 -4
- package/ts/zod/runs.ts +21 -4
- package/ts/zod/schedules.ts +2 -7
- package/ts/zod/skills.ts +85 -0
- package/ts/zod/smith-revisions.ts +2 -3
- package/ts/zod/smiths.ts +6 -0
- package/ts/zod/tenant.ts +33 -5
- package/ts/zod/vector-stores.ts +9 -19
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent Skills (#175) — a folder anchored by SKILL.md, per the Agent Skills
|
|
3
|
+
* specification, stored as an immutable version and attached to an agent.
|
|
4
|
+
*
|
|
5
|
+
* A version's bytes never appear on the wire: `files` lists each path with its
|
|
6
|
+
* size and content hash, so a tenant can see exactly what they installed.
|
|
7
|
+
*/
|
|
8
|
+
import { z } from "zod";
|
|
9
|
+
/** One file in a skill version, as the caller uploaded it. */
|
|
10
|
+
export const SkillFile = z
|
|
11
|
+
.object({
|
|
12
|
+
path: z.string(),
|
|
13
|
+
size: z.number().int(),
|
|
14
|
+
sha256: z.string(),
|
|
15
|
+
media_type: z.string(),
|
|
16
|
+
})
|
|
17
|
+
.meta({ id: "SkillFile" });
|
|
18
|
+
/** One published agent version that froze a reference to this skill version.
|
|
19
|
+
* A frozen reference is the only kind that blocks a delete, so this is the
|
|
20
|
+
* list a `409 skill_in_use` would name. */
|
|
21
|
+
export const SkillReference = z
|
|
22
|
+
.object({ agent_id: z.string(), version: z.number().int() })
|
|
23
|
+
.meta({ id: "SkillReference" });
|
|
24
|
+
/** An immutable published version of a skill. */
|
|
25
|
+
export const SkillVersion = z
|
|
26
|
+
.object({
|
|
27
|
+
skill_id: z.string(),
|
|
28
|
+
version: z.number().int(),
|
|
29
|
+
description: z.string(),
|
|
30
|
+
license: z.string().nullable(),
|
|
31
|
+
compatibility: z.unknown().nullable(),
|
|
32
|
+
metadata: z.record(z.string(), z.unknown()).nullable(),
|
|
33
|
+
references: z.array(z.string()),
|
|
34
|
+
scripts: z.array(z.string()),
|
|
35
|
+
assets: z.array(z.string()),
|
|
36
|
+
files: z.array(SkillFile),
|
|
37
|
+
/** Published agent versions holding this one frozen. Always present, `[]`
|
|
38
|
+
* when nothing does. */
|
|
39
|
+
referenced_by: z.array(SkillReference),
|
|
40
|
+
bytes: z.number().int(),
|
|
41
|
+
created_at: z.string(),
|
|
42
|
+
})
|
|
43
|
+
.meta({ id: "SkillVersion" });
|
|
44
|
+
/** The skill resource. `default_version` is what an agent gets when it names none. */
|
|
45
|
+
export const Skill = z
|
|
46
|
+
.object({
|
|
47
|
+
id: z.string(),
|
|
48
|
+
object: z.literal("skill"),
|
|
49
|
+
name: z.string(),
|
|
50
|
+
description: z.string(),
|
|
51
|
+
default_version: z.number().int(),
|
|
52
|
+
created_at: z.string(),
|
|
53
|
+
updated_at: z.string(),
|
|
54
|
+
})
|
|
55
|
+
.meta({ id: "Skill" });
|
|
56
|
+
export const SkillListOut = z
|
|
57
|
+
.object({ object: z.literal("list"), data: z.array(Skill) })
|
|
58
|
+
.meta({ id: "SkillListOut" });
|
|
59
|
+
export const SkillVersionListOut = z
|
|
60
|
+
.object({ object: z.literal("list"), data: z.array(SkillVersion) })
|
|
61
|
+
.meta({ id: "SkillVersionListOut" });
|
|
62
|
+
/** Move the skill's `default_version` to an existing version. */
|
|
63
|
+
export const SkillUpdateIn = z
|
|
64
|
+
.object({ default_version: z.number().int().positive() })
|
|
65
|
+
.meta({ id: "SkillUpdateIn" });
|
|
66
|
+
/** One skill reference in an agent's `skills` config. Omitted `version` resolves
|
|
67
|
+
* to the skill's `default_version` and is frozen at publish. */
|
|
68
|
+
export const SkillRef = z
|
|
69
|
+
.object({
|
|
70
|
+
skill_id: z.string(),
|
|
71
|
+
version: z.number().int().positive().optional(),
|
|
72
|
+
})
|
|
73
|
+
.meta({ id: "SkillRef" });
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
* `#/components/schemas/<id>` rather than inlining it.
|
|
17
17
|
*/
|
|
18
18
|
import { z } from "zod";
|
|
19
|
+
import { pageOut } from "./_page.js";
|
|
19
20
|
/** An immutable snapshot of a smith's effective behaviour config at one revision. */
|
|
20
21
|
export const SmithRevisionOut = z
|
|
21
22
|
.object({
|
|
@@ -36,9 +37,7 @@ export const SmithRevisionOut = z
|
|
|
36
37
|
created_at: z.string().nullish(),
|
|
37
38
|
})
|
|
38
39
|
.meta({ id: "SmithRevisionOut" });
|
|
39
|
-
export const RevisionListOut =
|
|
40
|
-
.object({ data: z.array(SmithRevisionOut) })
|
|
41
|
-
.meta({ id: "RevisionListOut" });
|
|
40
|
+
export const RevisionListOut = pageOut(SmithRevisionOut, "RevisionListOut");
|
|
42
41
|
// ── Request bodies ──────────────────────────────────────────────────────────
|
|
43
42
|
export const RestoreIn = z
|
|
44
43
|
.object({ note: z.string().nullish() })
|
package/dist/zod/smiths.js
CHANGED
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
* `#/components/schemas/<id>` rather than inlining it.
|
|
18
18
|
*/
|
|
19
19
|
import { z } from "zod";
|
|
20
|
+
import { SkillRef } from "./skills.js";
|
|
20
21
|
// ── Smith response ───────────────────────────────────────────────────────────
|
|
21
22
|
export const SmithOut = z
|
|
22
23
|
.object({
|
|
@@ -38,6 +39,7 @@ export const SmithOut = z
|
|
|
38
39
|
vector_store_ids: z.array(z.string()).optional(),
|
|
39
40
|
/** Registered MCP servers this smith's runs load, by name. Null = all. */
|
|
40
41
|
mcp_servers: z.array(z.string()).nullish(),
|
|
42
|
+
skills: z.array(SkillRef).optional(),
|
|
41
43
|
auto_memory: z.boolean().optional(),
|
|
42
44
|
memory_consolidation: z.boolean().optional(),
|
|
43
45
|
/** How the config resolved: by reference, with overrides, or embedded. */
|
|
@@ -58,6 +60,7 @@ export const SmithOut = z
|
|
|
58
60
|
enabled_hosted_tools: z.array(z.string()),
|
|
59
61
|
vector_store_ids: z.array(z.string()),
|
|
60
62
|
mcp_servers: z.array(z.string()).nullable(),
|
|
63
|
+
skills: z.array(SkillRef),
|
|
61
64
|
auto_memory: z.boolean().nullable(),
|
|
62
65
|
memory_consolidation: z.boolean().nullable(),
|
|
63
66
|
})
|
|
@@ -90,6 +93,7 @@ export const SmithCreate = z
|
|
|
90
93
|
vector_store_ids: z.array(z.string()).nullish(),
|
|
91
94
|
/** Scope this smith's runs to these registered MCP servers (by name). */
|
|
92
95
|
mcp_servers: z.array(z.string()).nullish(),
|
|
96
|
+
skills: z.array(SkillRef).nullish(),
|
|
93
97
|
auto_memory: z.boolean().nullish(),
|
|
94
98
|
memory_consolidation: z.boolean().nullish(),
|
|
95
99
|
})
|
|
@@ -110,6 +114,8 @@ export const SmithPatch = z
|
|
|
110
114
|
/** Scope this smith's runs to these registered MCP servers (by name).
|
|
111
115
|
* Null clears the per-smith override (re-inherit the agent's value). */
|
|
112
116
|
mcp_servers: z.array(z.string()).nullish(),
|
|
117
|
+
/** Null clears the per-smith override (re-inherit the agent's value). */
|
|
118
|
+
skills: z.array(SkillRef).nullish(),
|
|
113
119
|
auto_memory: z.boolean().nullish(),
|
|
114
120
|
memory_consolidation: z.boolean().nullish(),
|
|
115
121
|
})
|
package/dist/zod/tenant.js
CHANGED
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
* `#/components/schemas/<id>` rather than inlining it.
|
|
13
13
|
*/
|
|
14
14
|
import { z } from "zod";
|
|
15
|
+
import { Actor } from "./_actor.js";
|
|
15
16
|
import { pageOut } from "./_page.js";
|
|
16
17
|
// ── Events (poll mirror of the webhook firehose) ─────────────────────────────
|
|
17
18
|
/** One event in the `/v1/events` feed — the `{v:1}` envelope (sans `tenant_id`,
|
|
@@ -24,6 +25,8 @@ export const EventOut = z
|
|
|
24
25
|
type: z.string(),
|
|
25
26
|
smith_id: z.string().nullable(),
|
|
26
27
|
data: z.record(z.string(), z.unknown()),
|
|
28
|
+
/** Who acted. Null on events recorded before attribution shipped. */
|
|
29
|
+
actor: Actor.nullable(),
|
|
27
30
|
created_at: z.string().nullable(),
|
|
28
31
|
})
|
|
29
32
|
.meta({ id: "EventOut" });
|
|
@@ -50,9 +53,7 @@ export const WebhookCreateOut = z
|
|
|
50
53
|
})
|
|
51
54
|
.meta({ id: "WebhookCreateOut" });
|
|
52
55
|
/** The patch/delete-adjacent ack shape (just the id). */
|
|
53
|
-
export const WebhookIdOut = z
|
|
54
|
-
.object({ id: z.string() })
|
|
55
|
-
.meta({ id: "WebhookIdOut" });
|
|
56
|
+
export const WebhookIdOut = z.object({ id: z.string() }).meta({ id: "WebhookIdOut" });
|
|
56
57
|
export const WebhookIn = z
|
|
57
58
|
.object({
|
|
58
59
|
url: z.string(),
|
|
@@ -142,7 +143,9 @@ export const TokenIn = z
|
|
|
142
143
|
scope: z.string().default("smith"),
|
|
143
144
|
smith_id: z.string().nullish(),
|
|
144
145
|
permissions: z.array(z.string()).nullish(),
|
|
145
|
-
|
|
146
|
+
// Positive and bounded: `0` used to read as "no expiry" and mint a permanent
|
|
147
|
+
// admin token, and a ttl past year 275760 overflows the `Date` we serialize.
|
|
148
|
+
ttl_seconds: z.number().int().positive().max(315_360_000).nullish(),
|
|
146
149
|
name: z.string().nullish(),
|
|
147
150
|
})
|
|
148
151
|
.meta({ id: "TokenIn" });
|
|
@@ -287,3 +290,20 @@ export const HostedToolOut = z
|
|
|
287
290
|
export const HostedToolsListOut = z
|
|
288
291
|
.object({ data: z.array(HostedToolOut) })
|
|
289
292
|
.meta({ id: "HostedToolsListOut" });
|
|
293
|
+
// ── Sandbox secrets (env a tenant's sandboxes carry) ─────────────────────────
|
|
294
|
+
/** One secret by name. The value is NEVER echoed — only that it is set. */
|
|
295
|
+
export const SandboxSecretOut = z
|
|
296
|
+
.object({
|
|
297
|
+
name: z.string(),
|
|
298
|
+
updated_at: z.string().nullable(),
|
|
299
|
+
})
|
|
300
|
+
.meta({ id: "SandboxSecretOut" });
|
|
301
|
+
export const SandboxSecretListOut = z
|
|
302
|
+
.object({ data: z.array(SandboxSecretOut) })
|
|
303
|
+
.meta({ id: "SandboxSecretListOut" });
|
|
304
|
+
export const SandboxSecretIn = z
|
|
305
|
+
.object({ value: z.string() })
|
|
306
|
+
.meta({ id: "SandboxSecretIn" });
|
|
307
|
+
export const SandboxSecretConfiguredOut = z
|
|
308
|
+
.object({ name: z.string(), configured: z.boolean() })
|
|
309
|
+
.meta({ id: "SandboxSecretConfiguredOut" });
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
* rather than being accepted and ignored.
|
|
17
17
|
*/
|
|
18
18
|
import { z } from "zod";
|
|
19
|
+
import { oaiListOut } from "./_page.js";
|
|
19
20
|
// ── Chunking ─────────────────────────────────────────────────────────────────
|
|
20
21
|
/** Static chunking params. Overlap must not exceed half the chunk size. */
|
|
21
22
|
export const StaticChunkingConfig = z
|
|
@@ -47,7 +48,9 @@ export const ChunkingStrategyOut = z
|
|
|
47
48
|
/** File attributes: ≤16 keys, key ≤64 chars, value string(≤512)|number|bool. */
|
|
48
49
|
export const VectorStoreAttributes = z
|
|
49
50
|
.record(z.string().max(64), z.union([z.string().max(512), z.number(), z.boolean()]))
|
|
50
|
-
.refine((v) => Object.keys(v).length <= 16, {
|
|
51
|
+
.refine((v) => Object.keys(v).length <= 16, {
|
|
52
|
+
message: "at most 16 attribute keys",
|
|
53
|
+
});
|
|
51
54
|
/** A filter node: a comparison (`type` eq/ne/gt/gte/lt/lte/in/nin over `key`/
|
|
52
55
|
* `value`) or a compound (`type` and/or over nested `filters`). The grammar is
|
|
53
56
|
* recursive; the schema validates one node and the API validates nested nodes
|
|
@@ -118,15 +121,7 @@ export const VectorStoreOut = z
|
|
|
118
121
|
})
|
|
119
122
|
.meta({ id: "VectorStoreOut" });
|
|
120
123
|
/** Vector stores, in OpenAI's `list` envelope. */
|
|
121
|
-
export const VectorStoreListOut =
|
|
122
|
-
.object({
|
|
123
|
-
object: z.literal("list"),
|
|
124
|
-
data: z.array(VectorStoreOut),
|
|
125
|
-
first_id: z.string().nullable(),
|
|
126
|
-
last_id: z.string().nullable(),
|
|
127
|
-
has_more: z.boolean(),
|
|
128
|
-
})
|
|
129
|
-
.meta({ id: "VectorStoreListOut" });
|
|
124
|
+
export const VectorStoreListOut = oaiListOut(VectorStoreOut, "VectorStoreListOut");
|
|
130
125
|
/** Modify body (OpenAI uses `POST`, not `PATCH`). */
|
|
131
126
|
export const VectorStorePatch = z
|
|
132
127
|
.object({
|
|
@@ -174,15 +169,7 @@ export const VectorStoreFileOut = z
|
|
|
174
169
|
attributes: VectorStoreAttributes.nullable(),
|
|
175
170
|
})
|
|
176
171
|
.meta({ id: "VectorStoreFileOut" });
|
|
177
|
-
export const VectorStoreFileListOut =
|
|
178
|
-
.object({
|
|
179
|
-
object: z.literal("list"),
|
|
180
|
-
data: z.array(VectorStoreFileOut),
|
|
181
|
-
first_id: z.string().nullable(),
|
|
182
|
-
last_id: z.string().nullable(),
|
|
183
|
-
has_more: z.boolean(),
|
|
184
|
-
})
|
|
185
|
-
.meta({ id: "VectorStoreFileListOut" });
|
|
172
|
+
export const VectorStoreFileListOut = oaiListOut(VectorStoreFileOut, "VectorStoreFileListOut");
|
|
186
173
|
/** Update body: attributes only (chunking is frozen once indexed). */
|
|
187
174
|
export const VectorStoreFileUpdate = z
|
|
188
175
|
.object({
|
package/package.json
CHANGED
|
@@ -1,26 +1,29 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ingram-cloud/sdk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.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
|
-
"license": "MIT",
|
|
6
|
-
"type": "module",
|
|
7
|
-
"homepage": "https://cloud.ingram.tech",
|
|
8
5
|
"keywords": [
|
|
9
|
-
"
|
|
6
|
+
"api",
|
|
10
7
|
"ingram",
|
|
8
|
+
"ingram-cloud",
|
|
9
|
+
"openapi",
|
|
11
10
|
"sdk",
|
|
12
|
-
"api",
|
|
13
11
|
"wire",
|
|
14
|
-
"zod"
|
|
15
|
-
"openapi"
|
|
12
|
+
"zod"
|
|
16
13
|
],
|
|
14
|
+
"homepage": "https://github.com/ingram-technologies/ingram-cloud-sdks/tree/main/packages/sdk#readme",
|
|
15
|
+
"bugs": "https://github.com/ingram-technologies/ingram-cloud-sdks/issues",
|
|
16
|
+
"license": "MIT",
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "git+https://github.com/ingram-technologies/ingram-cloud-sdks.git",
|
|
20
|
+
"directory": "packages/sdk"
|
|
21
|
+
},
|
|
17
22
|
"files": [
|
|
18
23
|
"ts",
|
|
19
24
|
"dist"
|
|
20
25
|
],
|
|
21
|
-
"
|
|
22
|
-
"access": "public"
|
|
23
|
-
},
|
|
26
|
+
"type": "module",
|
|
24
27
|
"exports": {
|
|
25
28
|
".": {
|
|
26
29
|
"types": "./ts/index.ts",
|
|
@@ -48,20 +51,24 @@
|
|
|
48
51
|
"default": "./dist/client.js"
|
|
49
52
|
}
|
|
50
53
|
},
|
|
54
|
+
"publishConfig": {
|
|
55
|
+
"access": "public"
|
|
56
|
+
},
|
|
51
57
|
"scripts": {
|
|
52
58
|
"build": "tsc -p tsconfig.build.json",
|
|
53
59
|
"typecheck": "tsc --noEmit",
|
|
54
60
|
"lint": "oxlint",
|
|
55
61
|
"format": "oxfmt --write .",
|
|
56
|
-
"
|
|
57
|
-
|
|
58
|
-
"devDependencies": {
|
|
59
|
-
"@ingram-tech/oxlint-config": "^0.2.2",
|
|
60
|
-
"oxfmt": "^0.58.0",
|
|
61
|
-
"oxlint": "^1.73.0",
|
|
62
|
-
"typescript": "^6"
|
|
62
|
+
"test": "vitest run",
|
|
63
|
+
"prepack": "bun run build"
|
|
63
64
|
},
|
|
64
65
|
"dependencies": {
|
|
65
66
|
"zod": "^4.4.3"
|
|
67
|
+
},
|
|
68
|
+
"devDependencies": {
|
|
69
|
+
"vitest": "^4.1.10"
|
|
70
|
+
},
|
|
71
|
+
"engines": {
|
|
72
|
+
"node": ">=20"
|
|
66
73
|
}
|
|
67
74
|
}
|