@ingram-cloud/sdk 1.4.0 → 1.5.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 +168 -15
- 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/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 +16 -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 +6 -8
- package/ts/client.ts +385 -51
- package/ts/index.ts +4 -0
- package/ts/responses.ts +40 -2
- package/ts/scopes.ts +57 -0
- package/ts/zod/.impeccable/hook.cache.json +1 -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/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 +18 -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
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
* endpoint.
|
|
18
18
|
*/
|
|
19
19
|
import { z } from "zod";
|
|
20
|
-
import {
|
|
20
|
+
import { oaiListOut } from "./_page.js";
|
|
21
21
|
/** A conversation — the OpenAI Conversations object + IC extensions. */
|
|
22
22
|
export const ConversationOut = z
|
|
23
23
|
.object({
|
|
@@ -35,7 +35,8 @@ export const ConversationOut = z
|
|
|
35
35
|
metadata: z.record(z.string(), z.unknown()),
|
|
36
36
|
})
|
|
37
37
|
.meta({ id: "ConversationOut" });
|
|
38
|
-
|
|
38
|
+
/** The conversation list, in OpenAI's `list` envelope (page with `?after=`). */
|
|
39
|
+
export const ConversationListOut = oaiListOut(ConversationOut, "ConversationListOut");
|
|
39
40
|
/** The delete acknowledgement, in OpenAI's `*.deleted` shape. */
|
|
40
41
|
export const ConversationDeleted = z
|
|
41
42
|
.object({
|
|
@@ -66,15 +67,7 @@ export const ConversationItem = z
|
|
|
66
67
|
})
|
|
67
68
|
.meta({ id: "ConversationItem" });
|
|
68
69
|
/** A conversation's items, in OpenAI's `list` envelope (not the IC cursor page). */
|
|
69
|
-
export const ConversationItemListOut =
|
|
70
|
-
.object({
|
|
71
|
-
object: z.literal("list"),
|
|
72
|
-
data: z.array(ConversationItem),
|
|
73
|
-
first_id: z.string().nullable(),
|
|
74
|
-
last_id: z.string().nullable(),
|
|
75
|
-
has_more: z.boolean(),
|
|
76
|
-
})
|
|
77
|
-
.meta({ id: "ConversationItemListOut" });
|
|
70
|
+
export const ConversationItemListOut = oaiListOut(ConversationItem, "ConversationItemListOut");
|
|
78
71
|
/** Create body — OpenAI accepts `metadata`; `title` is the IC extension. */
|
|
79
72
|
export const ConversationCreate = z
|
|
80
73
|
.object({
|
package/dist/zod/deployments.js
CHANGED
|
@@ -103,3 +103,35 @@ export const DeploymentPatch = z
|
|
|
103
103
|
owner_email: z.string().nullish(),
|
|
104
104
|
})
|
|
105
105
|
.meta({ id: "DeploymentPatch" });
|
|
106
|
+
// ── Inbound events ───────────────────────────────────────────────────────────
|
|
107
|
+
/**
|
|
108
|
+
* One message as it arrived, before anything interpreted it — the immutable
|
|
109
|
+
* ingest record behind every channel-triggered run, in CloudEvents terms
|
|
110
|
+
* (`source` / `type` / `subject` / `data`).
|
|
111
|
+
*
|
|
112
|
+
* It is recorded before resolution, so an event that matched no smith is here
|
|
113
|
+
* too, with `smith_id: ""` — "the webhook fired and nothing happened" is a
|
|
114
|
+
* readable answer, not an absence. `idempotency_key` is the provider's own
|
|
115
|
+
* delivery id (`Message-Id`, `X-GitHub-Delivery`); a re-delivery of the same key
|
|
116
|
+
* records once, so this log is also the dedup ledger. `""` throughout means the
|
|
117
|
+
* source supplied nothing, never "unknown".
|
|
118
|
+
*/
|
|
119
|
+
export const InboundEventOut = z
|
|
120
|
+
.object({
|
|
121
|
+
id: z.string(),
|
|
122
|
+
/** The channel it arrived on: `email`, `telegram`, `slack`, `whatsapp`, … */
|
|
123
|
+
source: z.string(),
|
|
124
|
+
/** The provider's event name (`email.received`); `""` if it names none. */
|
|
125
|
+
type: z.string(),
|
|
126
|
+
/** The addressed resource — inbox address, channel, repo. */
|
|
127
|
+
subject: z.string(),
|
|
128
|
+
/** The provider's delivery id, and this log's dedup key. */
|
|
129
|
+
idempotency_key: z.string(),
|
|
130
|
+
/** The smith it woke; `""` when the sender resolved to none. */
|
|
131
|
+
smith_id: z.string(),
|
|
132
|
+
/** The provider payload as received. */
|
|
133
|
+
data: z.record(z.string(), z.unknown()),
|
|
134
|
+
created_at: z.string().nullable(),
|
|
135
|
+
})
|
|
136
|
+
.meta({ id: "InboundEventOut" });
|
|
137
|
+
export const InboundEventListOut = pageOut(InboundEventOut, "InboundEventListOut");
|
package/dist/zod/files.js
CHANGED
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
* listed.
|
|
12
12
|
*/
|
|
13
13
|
import { z } from "zod";
|
|
14
|
+
import { oaiListOut } from "./_page.js";
|
|
14
15
|
/** OpenAI's upload purposes. Vector-store source files are `assistants`. */
|
|
15
16
|
export const FilePurpose = z.enum([
|
|
16
17
|
"assistants",
|
|
@@ -36,15 +37,7 @@ export const FileOut = z
|
|
|
36
37
|
})
|
|
37
38
|
.meta({ id: "FileOut" });
|
|
38
39
|
/** Files, in OpenAI's `list` envelope (not the IC cursor page). */
|
|
39
|
-
export const FileListOut =
|
|
40
|
-
.object({
|
|
41
|
-
object: z.literal("list"),
|
|
42
|
-
data: z.array(FileOut),
|
|
43
|
-
first_id: z.string().nullable(),
|
|
44
|
-
last_id: z.string().nullable(),
|
|
45
|
-
has_more: z.boolean(),
|
|
46
|
-
})
|
|
47
|
-
.meta({ id: "FileListOut" });
|
|
40
|
+
export const FileListOut = oaiListOut(FileOut, "FileListOut");
|
|
48
41
|
/** The delete acknowledgement, in OpenAI's `*.deleted` shape. */
|
|
49
42
|
export const FileDeleted = z
|
|
50
43
|
.object({
|
package/dist/zod/index.js
CHANGED
|
@@ -8,9 +8,11 @@
|
|
|
8
8
|
* when the last one lands, the generated file and the `openapi-zod-client` step
|
|
9
9
|
* are deleted and this becomes the sole `schemas` source.
|
|
10
10
|
*/
|
|
11
|
+
export * from "./_actor.js";
|
|
11
12
|
export * from "./_page.js";
|
|
12
13
|
export * from "./agents.js";
|
|
13
14
|
export * from "./approvals.js";
|
|
15
|
+
export * from "./billing.js";
|
|
14
16
|
export * from "./budgets.js";
|
|
15
17
|
export * from "./catalog.js";
|
|
16
18
|
export * from "./connections.js";
|
|
@@ -26,6 +28,7 @@ export * from "./observability.js";
|
|
|
26
28
|
export * from "./projects.js";
|
|
27
29
|
export * from "./runs.js";
|
|
28
30
|
export * from "./schedules.js";
|
|
31
|
+
export * from "./skills.js";
|
|
29
32
|
export * from "./slack.js";
|
|
30
33
|
export * from "./smith-revisions.js";
|
|
31
34
|
export * from "./smiths.js";
|
package/dist/zod/mcp.js
CHANGED
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
* emit as `$ref` components rather than inlined objects.
|
|
15
15
|
*/
|
|
16
16
|
import { z } from "zod";
|
|
17
|
+
import { pageOut } from "./_page.js";
|
|
17
18
|
/** One approval-policy rule: a name glob that gates matching tools behind a
|
|
18
19
|
* human approval. `require` is always `"approval"` today (the only supported
|
|
19
20
|
* value); arg-conditional (`when`) gating is rejected, not stored. */
|
|
@@ -66,6 +67,10 @@ export const McpServerOut = z
|
|
|
66
67
|
tool_allowlist: z.array(z.string()).nullish(),
|
|
67
68
|
approval_policy: z.array(ApprovalRule).optional(),
|
|
68
69
|
tools: z.array(McpTool),
|
|
70
|
+
/** How many tools this registration currently holds — what a run is offered,
|
|
71
|
+
* before the allow-list gate each tool's own `enabled` reports. Same number on
|
|
72
|
+
* a read as on the register/refresh response that produced it. */
|
|
73
|
+
tools_discovered: z.number().int(),
|
|
69
74
|
tools_refreshed_at: z.string().nullable(),
|
|
70
75
|
/** `degraded` when the edge failed discovery, its secret can't be decoded at
|
|
71
76
|
* run time, or its last `tools/call` failed at the transport level;
|
|
@@ -81,17 +86,10 @@ export const McpServerOut = z
|
|
|
81
86
|
created_at: z.string().nullable(),
|
|
82
87
|
})
|
|
83
88
|
.meta({ id: "McpServerOut" });
|
|
84
|
-
export const McpServerListOut =
|
|
85
|
-
.object({ data: z.array(McpServerOut) })
|
|
86
|
-
.meta({ id: "McpServerListOut" });
|
|
87
|
-
/** Register/replace and refresh echo the server back plus the count of tools
|
|
88
|
-
* discovered in the just-run `tools/list`. */
|
|
89
|
-
export const McpServerWriteOut = McpServerOut.extend({
|
|
90
|
-
tools_discovered: z.number().int(),
|
|
91
|
-
}).meta({ id: "McpServerWriteOut" });
|
|
89
|
+
export const McpServerListOut = pageOut(McpServerOut, "McpServerListOut");
|
|
92
90
|
// ── Request bodies ──────────────────────────────────────────────────────────
|
|
93
|
-
/** Auth block on a register/replace body. `
|
|
94
|
-
* bearer) — never echoed back. */
|
|
91
|
+
/** Auth block on a register/replace body. `kind` is `none` | `bearer` | `oauth`;
|
|
92
|
+
* `secret` (the shared bearer token) is write-only — never echoed back. */
|
|
95
93
|
export const McpAuthIn = z
|
|
96
94
|
.object({
|
|
97
95
|
kind: z.string().nullish(),
|
|
@@ -23,14 +23,7 @@ import { pageOut } from "./_page.js";
|
|
|
23
23
|
/** Span kinds emitted by the observability backend. `retrieval` covers vector-store
|
|
24
24
|
* search (the hosted `file_search` tool, and externally-pushed RAG spans). */
|
|
25
25
|
export const ICSpanKindEnum = z
|
|
26
|
-
.enum([
|
|
27
|
-
"run",
|
|
28
|
-
"model_call",
|
|
29
|
-
"tool_call",
|
|
30
|
-
"memory_op",
|
|
31
|
-
"retrieval",
|
|
32
|
-
"runtime_event",
|
|
33
|
-
])
|
|
26
|
+
.enum(["run", "model_call", "tool_call", "memory_op", "retrieval", "runtime_event"])
|
|
34
27
|
.meta({ id: "SpanKind" });
|
|
35
28
|
/** A single timed unit of work inside a trace. */
|
|
36
29
|
export const SpanOut = z
|
|
@@ -61,7 +54,10 @@ export const SpanNodeOut = SpanOut.extend({
|
|
|
61
54
|
export const TraceOut = z
|
|
62
55
|
.object({
|
|
63
56
|
id: z.string(),
|
|
64
|
-
|
|
57
|
+
/** Null for a trace no smith owns — an external `/v1/traces:ingest` under a
|
|
58
|
+
* tenant token attributes to none. Such a trace is tenant-scope only: a
|
|
59
|
+
* smith-bound token cannot read it. */
|
|
60
|
+
smith_id: z.string().nullable(),
|
|
65
61
|
app_id: z.string().nullable(),
|
|
66
62
|
run_id: z.string().nullable(),
|
|
67
63
|
root_kind: ICSpanKindEnum,
|
|
@@ -82,24 +78,32 @@ export const TraceDetailOut = TraceOut.extend({
|
|
|
82
78
|
}).meta({ id: "TraceDetailOut" });
|
|
83
79
|
export const TraceListOut = pageOut(TraceOut, "TraceListOut");
|
|
84
80
|
/** Aggregated usage grouped by app, smith, model, or customer. */
|
|
81
|
+
/** The token/cost amounts a usage bucket reports. `tokens` is the grand total
|
|
82
|
+
* (input + output); `input_tokens` is the input slice, and `cache_read_tokens`
|
|
83
|
+
* / `cache_write_tokens` are sub-slices of input (reads served from the
|
|
84
|
+
* provider's prompt cache, writes billed at the cache-write premium). The cache
|
|
85
|
+
* hit rate is `cache_read_tokens / input_tokens`. */
|
|
86
|
+
const UsageAmounts = z.object({
|
|
87
|
+
tokens: z.number(),
|
|
88
|
+
input_tokens: z.number(),
|
|
89
|
+
cache_read_tokens: z.number(),
|
|
90
|
+
cache_write_tokens: z.number(),
|
|
91
|
+
cost: z.number(),
|
|
92
|
+
run_count: z.number(),
|
|
93
|
+
});
|
|
85
94
|
export const UsageBreakdownOut = z
|
|
86
95
|
.object({
|
|
87
96
|
group_by: z.enum(["app", "smith", "model", "customer"]),
|
|
88
|
-
totals:
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
run_count: z.number(),
|
|
92
|
-
}),
|
|
93
|
-
groups: z.array(z.object({
|
|
97
|
+
totals: UsageAmounts,
|
|
98
|
+
groups: z.array(z
|
|
99
|
+
.object({
|
|
94
100
|
app: z.string().nullable().optional(),
|
|
95
101
|
smith: z.string().nullable().optional(),
|
|
96
102
|
model: z.string().nullable().optional(),
|
|
97
103
|
// Customer-grouped views label unassigned usage `principal:<smith id>`.
|
|
98
104
|
customer: z.string().nullable().optional(),
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
run_count: z.number(),
|
|
102
|
-
})),
|
|
105
|
+
})
|
|
106
|
+
.extend(UsageAmounts.shape)),
|
|
103
107
|
/** Custom billable events aggregated per meter over the same filters. */
|
|
104
108
|
meters: z
|
|
105
109
|
.array(z.object({
|
|
@@ -132,3 +136,18 @@ export const UsageEventListOut = z
|
|
|
132
136
|
has_more: z.boolean(),
|
|
133
137
|
})
|
|
134
138
|
.meta({ id: "UsageEventListOut" });
|
|
139
|
+
// ── Span ingestion (POST /v1/traces:ingest) ─────────────────────────────────
|
|
140
|
+
/** The request body for span ingestion (externally-pushed spans / OTel).
|
|
141
|
+
*
|
|
142
|
+
* Deliberately permissive: the handler normalizes rather than rejects — an
|
|
143
|
+
* unrecognized `kind` degrades to `runtime_event`, missing ids and timestamps
|
|
144
|
+
* are generated. Validating {@link ICSpanIn} here would 422 exactly the sloppy
|
|
145
|
+
* exporter payloads the endpoint exists to absorb. `ICSpanIn` documents the
|
|
146
|
+
* shape for callers; the wire stays open. */
|
|
147
|
+
export const TraceIngestIn = z
|
|
148
|
+
.object({ spans: z.array(z.record(z.string(), z.unknown())).optional() })
|
|
149
|
+
.meta({ id: "TraceIngestIn" });
|
|
150
|
+
/** The 202 ack for span ingestion: how many spans were written. */
|
|
151
|
+
export const TraceIngestOut = z
|
|
152
|
+
.object({ accepted: z.number().int() })
|
|
153
|
+
.meta({ id: "TraceIngestOut" });
|
package/dist/zod/projects.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 { pageOut } from "./_page.js";
|
|
15
16
|
export const ProjectOut = z
|
|
16
17
|
.object({
|
|
17
18
|
id: z.string(),
|
|
@@ -24,9 +25,7 @@ export const ProjectOut = z
|
|
|
24
25
|
archived_at: z.string().nullable(),
|
|
25
26
|
})
|
|
26
27
|
.meta({ id: "ProjectOut" });
|
|
27
|
-
export const ProjectListOut =
|
|
28
|
-
.object({ data: z.array(ProjectOut) })
|
|
29
|
-
.meta({ id: "ProjectListOut" });
|
|
28
|
+
export const ProjectListOut = pageOut(ProjectOut, "ProjectListOut");
|
|
30
29
|
/**
|
|
31
30
|
* The secret minted when an org mints a project (tenant-admin) token. Shape
|
|
32
31
|
* matches `mintToken`'s return; the `tenant` module owns the canonical
|
|
@@ -52,7 +51,8 @@ export const ProjectIn = z
|
|
|
52
51
|
.meta({ id: "ProjectIn" });
|
|
53
52
|
export const ProjectTokenIn = z
|
|
54
53
|
.object({
|
|
55
|
-
ttl_seconds
|
|
54
|
+
// Same bounds as `TokenIn.ttl_seconds` — this mints a `tenant:*` token too.
|
|
55
|
+
ttl_seconds: z.number().int().positive().max(315_360_000).nullish(),
|
|
56
56
|
name: z.string().nullish(),
|
|
57
57
|
})
|
|
58
58
|
.meta({ id: "ProjectTokenIn" });
|
package/dist/zod/runs.js
CHANGED
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
* are deliberately not modelled.
|
|
21
21
|
*/
|
|
22
22
|
import { z } from "zod";
|
|
23
|
+
import { Actor } from "./_actor.js";
|
|
23
24
|
import { pageOut } from "./_page.js";
|
|
24
25
|
/** One message in a run's `input`. `content` is a plain string for a text-only
|
|
25
26
|
* turn, or an array of content parts (`{type:"text"|"file"|"image", …}`) for a
|
|
@@ -28,10 +29,7 @@ import { pageOut } from "./_page.js";
|
|
|
28
29
|
export const InputMessage = z
|
|
29
30
|
.object({
|
|
30
31
|
role: z.string(),
|
|
31
|
-
content: z.union([
|
|
32
|
-
z.string(),
|
|
33
|
-
z.array(z.record(z.string(), z.unknown())),
|
|
34
|
-
]),
|
|
32
|
+
content: z.union([z.string(), z.array(z.record(z.string(), z.unknown()))]),
|
|
35
33
|
})
|
|
36
34
|
.meta({ id: "InputMessage" });
|
|
37
35
|
/** One run's own token usage (the `usage` map on a run). Distinct from the
|
|
@@ -49,6 +47,16 @@ export const RunUsage = z
|
|
|
49
47
|
cost: z.number().optional(),
|
|
50
48
|
})
|
|
51
49
|
.meta({ id: "RunUsage" });
|
|
50
|
+
/** One thing that went wrong during a run without ending it — today, a tool source
|
|
51
|
+
* the run could not reach. A run that lost its tools still answers, and the answer
|
|
52
|
+
* is shaped like a healthy one, so this rides the run's own summary fields rather
|
|
53
|
+
* than a nested metadata key nobody reads. */
|
|
54
|
+
export const RunWarning = z
|
|
55
|
+
.object({
|
|
56
|
+
code: z.string(),
|
|
57
|
+
message: z.string(),
|
|
58
|
+
})
|
|
59
|
+
.meta({ id: "RunWarning" });
|
|
52
60
|
export const RunOut = z
|
|
53
61
|
.object({
|
|
54
62
|
id: z.string(),
|
|
@@ -75,8 +83,12 @@ export const RunOut = z
|
|
|
75
83
|
})
|
|
76
84
|
.nullable(),
|
|
77
85
|
stop_reason: z.string().nullable(),
|
|
86
|
+
// Always present, `[]` on a clean run: absence must never read as "fine".
|
|
87
|
+
warnings: z.array(RunWarning),
|
|
78
88
|
usage: RunUsage.nullable(),
|
|
79
89
|
metadata: z.record(z.string(), z.unknown()).optional(),
|
|
90
|
+
/** Who started this run. Null on runs created before attribution shipped. */
|
|
91
|
+
actor: Actor.nullable(),
|
|
80
92
|
created_at: z.string().nullable(),
|
|
81
93
|
updated_at: z.string().nullable(),
|
|
82
94
|
})
|
package/dist/zod/schedules.js
CHANGED
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
* `#/components/schemas/<id>` rather than inlining it.
|
|
14
14
|
*/
|
|
15
15
|
import { z } from "zod";
|
|
16
|
+
import { pageOut } from "./_page.js";
|
|
16
17
|
/** A schedule's stored input: messages replayed as the run input on each fire. */
|
|
17
18
|
const ScheduleInput = z.array(z.record(z.string(), z.unknown()));
|
|
18
19
|
export const ScheduleOut = z
|
|
@@ -25,17 +26,13 @@ export const ScheduleOut = z
|
|
|
25
26
|
input: ScheduleInput,
|
|
26
27
|
/** Thread the fired runs append to; null mints a fresh thread per fire. */
|
|
27
28
|
thread_id: z.string().nullable(),
|
|
28
|
-
/** Max overlapping fired runs before new fires are skipped. */
|
|
29
|
-
max_concurrent: z.number().int(),
|
|
30
29
|
enabled: z.boolean(),
|
|
31
30
|
next_fire_at: z.string().nullable(),
|
|
32
31
|
last_fire_at: z.string().nullable(),
|
|
33
32
|
created_at: z.string().nullable(),
|
|
34
33
|
})
|
|
35
34
|
.meta({ id: "ScheduleOut" });
|
|
36
|
-
export const ScheduleListOut =
|
|
37
|
-
.object({ data: z.array(ScheduleOut) })
|
|
38
|
-
.meta({ id: "ScheduleListOut" });
|
|
35
|
+
export const ScheduleListOut = pageOut(ScheduleOut, "ScheduleListOut");
|
|
39
36
|
/** `POST .../:sid/run_now` — the fire is enqueued onto the smith's serial delivery
|
|
40
37
|
* lane (not run inline), so the response acknowledges the queued delivery rather
|
|
41
38
|
* than a completed run. Poll `/v1/events` or the smith's runs for the outcome. */
|
|
@@ -54,7 +51,6 @@ export const ScheduleIn = z
|
|
|
54
51
|
timezone: z.string().default("UTC"),
|
|
55
52
|
input: ScheduleInput.default([]),
|
|
56
53
|
thread_id: z.string().nullish(),
|
|
57
|
-
max_concurrent: z.number().int().default(1),
|
|
58
54
|
enabled: z.boolean().default(true),
|
|
59
55
|
})
|
|
60
56
|
.meta({ id: "ScheduleIn" });
|
|
@@ -65,7 +61,6 @@ export const SchedulePatch = z
|
|
|
65
61
|
timezone: z.string().nullish(),
|
|
66
62
|
input: ScheduleInput.nullish(),
|
|
67
63
|
thread_id: z.string().nullish(),
|
|
68
|
-
max_concurrent: z.number().int().nullish(),
|
|
69
64
|
enabled: z.boolean().nullish(),
|
|
70
65
|
})
|
|
71
66
|
.meta({ id: "SchedulePatch" });
|
|
@@ -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,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ingram-cloud/sdk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.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
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -51,15 +51,13 @@
|
|
|
51
51
|
"scripts": {
|
|
52
52
|
"build": "tsc -p tsconfig.build.json",
|
|
53
53
|
"typecheck": "tsc --noEmit",
|
|
54
|
-
"lint": "
|
|
55
|
-
"format": "
|
|
56
|
-
"prepublishOnly": "bun run build"
|
|
54
|
+
"lint": "nk lint",
|
|
55
|
+
"format": "nk format",
|
|
56
|
+
"prepublishOnly": "bun run build",
|
|
57
|
+
"check": "nk check"
|
|
57
58
|
},
|
|
58
59
|
"devDependencies": {
|
|
59
|
-
"@ingram-tech/
|
|
60
|
-
"oxfmt": "^0.58.0",
|
|
61
|
-
"oxlint": "^1.73.0",
|
|
62
|
-
"typescript": "^6"
|
|
60
|
+
"@ingram-tech/nk-dev": "^0.10.0"
|
|
63
61
|
},
|
|
64
62
|
"dependencies": {
|
|
65
63
|
"zod": "^4.4.3"
|