@palai/sdk 0.1.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.
Files changed (84) hide show
  1. package/CHANGELOG.md +65 -0
  2. package/LICENSE +201 -0
  3. package/README.md +160 -0
  4. package/dist/client.d.ts +94 -0
  5. package/dist/client.d.ts.map +1 -0
  6. package/dist/client.js +296 -0
  7. package/dist/client.js.map +1 -0
  8. package/dist/errors.d.ts +40 -0
  9. package/dist/errors.d.ts.map +1 -0
  10. package/dist/errors.js +143 -0
  11. package/dist/errors.js.map +1 -0
  12. package/dist/generated/tools.d.ts +39 -0
  13. package/dist/generated/tools.d.ts.map +1 -0
  14. package/dist/generated/tools.js +44 -0
  15. package/dist/generated/tools.js.map +1 -0
  16. package/dist/generated/types.d.ts +341 -0
  17. package/dist/generated/types.d.ts.map +1 -0
  18. package/dist/generated/types.js +7 -0
  19. package/dist/generated/types.js.map +1 -0
  20. package/dist/index.browser.d.ts +3 -0
  21. package/dist/index.browser.d.ts.map +1 -0
  22. package/dist/index.browser.js +6 -0
  23. package/dist/index.browser.js.map +1 -0
  24. package/dist/index.d.ts +30 -0
  25. package/dist/index.d.ts.map +1 -0
  26. package/dist/index.js +25 -0
  27. package/dist/index.js.map +1 -0
  28. package/dist/orchestrator.d.ts +61 -0
  29. package/dist/orchestrator.d.ts.map +1 -0
  30. package/dist/orchestrator.js +159 -0
  31. package/dist/orchestrator.js.map +1 -0
  32. package/dist/resources/agents.d.ts +67 -0
  33. package/dist/resources/agents.d.ts.map +1 -0
  34. package/dist/resources/agents.js +75 -0
  35. package/dist/resources/agents.js.map +1 -0
  36. package/dist/resources/approvals.d.ts +33 -0
  37. package/dist/resources/approvals.d.ts.map +1 -0
  38. package/dist/resources/approvals.js +33 -0
  39. package/dist/resources/approvals.js.map +1 -0
  40. package/dist/resources/artifacts.d.ts +36 -0
  41. package/dist/resources/artifacts.d.ts.map +1 -0
  42. package/dist/resources/artifacts.js +70 -0
  43. package/dist/resources/artifacts.js.map +1 -0
  44. package/dist/resources/model-routes.d.ts +70 -0
  45. package/dist/resources/model-routes.d.ts.map +1 -0
  46. package/dist/resources/model-routes.js +74 -0
  47. package/dist/resources/model-routes.js.map +1 -0
  48. package/dist/resources/reads.d.ts +49 -0
  49. package/dist/resources/reads.d.ts.map +1 -0
  50. package/dist/resources/reads.js +91 -0
  51. package/dist/resources/reads.js.map +1 -0
  52. package/dist/resources/responses.d.ts +70 -0
  53. package/dist/resources/responses.d.ts.map +1 -0
  54. package/dist/resources/responses.js +147 -0
  55. package/dist/resources/responses.js.map +1 -0
  56. package/dist/resources/secret-refs.d.ts +24 -0
  57. package/dist/resources/secret-refs.d.ts.map +1 -0
  58. package/dist/resources/secret-refs.js +33 -0
  59. package/dist/resources/secret-refs.js.map +1 -0
  60. package/dist/resources/sessions.d.ts +106 -0
  61. package/dist/resources/sessions.d.ts.map +1 -0
  62. package/dist/resources/sessions.js +161 -0
  63. package/dist/resources/sessions.js.map +1 -0
  64. package/dist/resources/shared.d.ts +31 -0
  65. package/dist/resources/shared.d.ts.map +1 -0
  66. package/dist/resources/shared.js +32 -0
  67. package/dist/resources/shared.js.map +1 -0
  68. package/dist/resources/skills.d.ts +40 -0
  69. package/dist/resources/skills.d.ts.map +1 -0
  70. package/dist/resources/skills.js +40 -0
  71. package/dist/resources/skills.js.map +1 -0
  72. package/dist/schema.d.ts +35 -0
  73. package/dist/schema.d.ts.map +1 -0
  74. package/dist/schema.js +30 -0
  75. package/dist/schema.js.map +1 -0
  76. package/dist/server-only.d.ts +2 -0
  77. package/dist/server-only.d.ts.map +1 -0
  78. package/dist/server-only.js +22 -0
  79. package/dist/server-only.js.map +1 -0
  80. package/dist/stream.d.ts +38 -0
  81. package/dist/stream.d.ts.map +1 -0
  82. package/dist/stream.js +314 -0
  83. package/dist/stream.js.map +1 -0
  84. package/package.json +44 -0
@@ -0,0 +1,159 @@
1
+ // The orchestrator kit is server-only: it drives durable runs with the API-key client, so
2
+ // importing it marks its importer server-only (never bundle it for the browser — see ./server-only.ts).
3
+ import "./server-only.js";
4
+ import { createHash } from "node:crypto";
5
+ import { delay, ResponseStream } from "./stream.js";
6
+ // ─────────────────────────────────────────────────────────────────────────────────────────
7
+ // External-orchestrator kit — the §35.1 five-step contract as thin helpers over the client.
8
+ //
9
+ // This kit lets an EXTERNAL durable orchestrator (Temporal, Restate, a CI pipeline, or a plain
10
+ // script) drive a Palai run through the canonical five steps without re-implementing any of the
11
+ // client's HTTP, idempotent-retry, or reconnecting-SSE machinery — it composes `client.responses`
12
+ // and `client.sessions.commands`. It writes NO vendor adapter: the contract it pins is the same
13
+ // one ANY orchestrator follows (docs/orchestrator-kit.md, §35.2).
14
+ //
15
+ // The two identities the contract keeps SEPARATE — never conflated:
16
+ // • workflowId — the EXTERNAL orchestrator's durable workflow identity. The orchestrator owns it
17
+ // and may replay it from its own history any number of times (a retry storm).
18
+ // • runId / responseId / sessionId — Palai's CANONICAL run identity, minted by the server on the
19
+ // FIRST admission. The workflow id never replaces it and is never inferred from it.
20
+ //
21
+ // The bridge between them is the idempotency key, derived deterministically from the workflow id
22
+ // (workflowIdempotencyKey). It is the SINGLE retry owner (§35.2): every replay under the same
23
+ // workflow id carries the same key, so the server settles exactly ONE run — a storm of retries does
24
+ // not multiply runs (AUT-013). An orchestrator that lost its state re-derives the same key from its
25
+ // own workflow id and reconciles to the same run without ever having persisted the run id.
26
+ // ─────────────────────────────────────────────────────────────────────────────────────────
27
+ // Terminal run statuses (spec §22.3): a run in one of these has settled. queued/running are the only
28
+ // non-terminal states. A terminal-FAILED run is a real OUTCOME, so a wait RESOLVES with it (the caller
29
+ // inspects `status` / `error`) rather than throwing.
30
+ const TERMINAL_STATUSES = new Set(["completed", "failed", "canceled", "timed_out", "budget_exceeded", "expired"]);
31
+ export function isTerminalStatus(status) {
32
+ return TERMINAL_STATUSES.has(status);
33
+ }
34
+ // workflowIdempotencyKey derives the stable per-workflow key. Pure function of the workflow id: same id
35
+ // ⇒ same key (replays reconcile), different id ⇒ different key. sha256-truncated so an arbitrary external
36
+ // workflow id maps to a bounded, opaque key.
37
+ // NOTE: the key carries no orchestrator-system namespace — two DISTINCT orchestrator systems under the
38
+ // same principal that reuse the same workflow-id string collide on one key (identical body ⇒ silently
39
+ // shared run; different body ⇒ a loud ErrIdempotencyMismatch). Pass StartOptions.idempotencyKey to
40
+ // namespace them explicitly.
41
+ export function workflowIdempotencyKey(workflowId) {
42
+ if (workflowId === "") {
43
+ throw new Error("@palai/sdk: an orchestrator workflow id must not be empty");
44
+ }
45
+ return "wf_" + createHash("sha256").update(workflowId).digest("hex").slice(0, 32);
46
+ }
47
+ // Orchestrator is the kit surface: one instance wraps a Palai client and exposes the five-step contract.
48
+ export class Orchestrator {
49
+ #client;
50
+ constructor(client) {
51
+ this.#client = client;
52
+ }
53
+ // start — STEP 1: create-with-workflow-ID-metadata + idempotency-key. The external workflow id rides
54
+ // `metadata.workflow_id` (untrusted external correlation, never an identity override — §38.6); the
55
+ // idempotency key is derived from it, so this exact call is safe to REPLAY. A callback in options wires
56
+ // the webhook wait mode. Returns the WorkflowRun carrying BOTH identities.
57
+ async start(workflowId, request, options = {}) {
58
+ const idempotencyKey = options.idempotencyKey ?? workflowIdempotencyKey(workflowId);
59
+ const body = {
60
+ ...request,
61
+ metadata: { ...request.metadata, workflow_id: workflowId },
62
+ ...(options.callback !== undefined ? { callback: options.callback } : {}),
63
+ };
64
+ const created = await this.#client.responses.create(body, {
65
+ idempotencyKey,
66
+ signal: options.signal,
67
+ ...(options.timeoutMs !== undefined ? { timeoutMs: options.timeoutMs } : {}),
68
+ });
69
+ return toWorkflowRun(workflowId, idempotencyKey, created);
70
+ }
71
+ // reconcile — STEP 5: reconcile-by-key. Re-issues start under the SAME derived key. Because the key is
72
+ // the single retry owner, the server REPLAYS the original admission and returns the SAME run — so an
73
+ // orchestrator recovering from a crash (holding only its workflow id + the original request) resolves
74
+ // back to the one run it created, never a duplicate. This is start()'s idempotency made explicit as the
75
+ // recovery entrypoint; call it with the identical request the workflow first submitted.
76
+ reconcile(workflowId, request, options = {}) {
77
+ return this.start(workflowId, request, options);
78
+ }
79
+ // waitByPoll — STEP 2 (poll): polls the run to its terminal projection. The orchestrator owns this wait
80
+ // deadline; a timeout throws WITHOUT canceling the run (reconcile/result recover it later).
81
+ async waitByPoll(run, options = {}) {
82
+ const deadline = Date.now() + (options.timeoutMs ?? 60_000);
83
+ const interval = options.pollIntervalMs ?? 250;
84
+ for (;;) {
85
+ const resp = await this.#client.responses.retrieve(run.responseId, { signal: options.signal });
86
+ if (isTerminalStatus(resp.status)) {
87
+ return resp;
88
+ }
89
+ if (Date.now() + interval > deadline) {
90
+ throw new Error(`@palai/sdk: run ${run.runId} did not settle within the ${options.timeoutMs ?? 60_000}ms poll deadline`);
91
+ }
92
+ await delay(interval, options.signal);
93
+ }
94
+ }
95
+ // waitByStream — STEP 2 (SSE): drains the run's session event stream to its terminal event and returns
96
+ // the canonical terminal Response. It reuses ResponseStream, so a transport drop reconnects with
97
+ // Last-Event-ID (loss-less) — the kit adds no SSE code of its own. start() runs once here and returns
98
+ // the ALREADY-created identity, so the wait subscribes without minting a second run.
99
+ waitByStream(run, options = {}) {
100
+ const stream = new ResponseStream({
101
+ transport: this.#client,
102
+ start: async () => ({ responseID: run.responseId, sessionID: run.sessionId }),
103
+ signal: options.signal,
104
+ lastEventId: options.lastEventId ?? null,
105
+ });
106
+ return stream.finalResponse();
107
+ }
108
+ // result — reads the canonical terminal Response by run identity. The WEBHOOK wait mode resolves here:
109
+ // when Palai POSTs the callback, the orchestrator's handler calls result() to READ BACK the canonical
110
+ // outcome rather than trusting the (untrusted) webhook body. STEP 4's structured result + artifacts ride
111
+ // this Response (output + metadata; artifacts via client.artifacts.listForResponse).
112
+ result(run, options = {}) {
113
+ return this.#client.responses.retrieve(run.responseId, { signal: options.signal });
114
+ }
115
+ // sendMessage — STEP 3 (message command): delivers a steer message to the run's session. Durable +
116
+ // idempotent server-side (the command_id), so an orchestrator activity retry does not double-deliver.
117
+ sendMessage(run, message, options = {}) {
118
+ return this.#client.sessions.commands.steer(run.sessionId, { message, ...(options.commandId !== undefined ? { commandId: options.commandId } : {}) }, { ...(options.signal !== undefined ? { signal: options.signal } : {}) });
119
+ }
120
+ // cancel — STEP 3 (cancel command): propagates cancellation to the run. Naturally idempotent (a canceled
121
+ // terminal is monotonic), so a retried cancel settles once. This is cancel PROPAGATION: the orchestrator
122
+ // canceling its workflow tells Palai to cancel the run it owns.
123
+ cancel(run, options = {}) {
124
+ return this.#client.responses.cancel(run.responseId, { ...(options.signal !== undefined ? { signal: options.signal } : {}) });
125
+ }
126
+ // runActivity composes the happy path into ONE durable activity an orchestrator schedules: start
127
+ // (idempotent) → wait (chosen mode) → return the terminal Response (structured result + artifacts). On
128
+ // an orchestrator retry with the same workflowId it replays to the same run and resumes the wait — no
129
+ // duplicate run. The webhook mode returns the started (possibly still-running) Response immediately; the
130
+ // orchestrator's callback handler resolves it with result().
131
+ async runActivity(workflowId, request, options = {}) {
132
+ const run = await this.start(workflowId, request, options);
133
+ const waitOpts = {
134
+ signal: options.signal,
135
+ ...(options.waitTimeoutMs !== undefined ? { timeoutMs: options.waitTimeoutMs } : {}),
136
+ ...(options.pollIntervalMs !== undefined ? { pollIntervalMs: options.pollIntervalMs } : {}),
137
+ };
138
+ switch (options.wait ?? "poll") {
139
+ case "stream":
140
+ return this.waitByStream(run, waitOpts);
141
+ case "webhook":
142
+ return this.result(run, waitOpts);
143
+ default:
144
+ return this.waitByPoll(run, waitOpts);
145
+ }
146
+ }
147
+ }
148
+ // toWorkflowRun projects a created Response into the WorkflowRun handle, coercing the branded id types to
149
+ // plain strings.
150
+ function toWorkflowRun(workflowId, idempotencyKey, created) {
151
+ return {
152
+ workflowId,
153
+ idempotencyKey,
154
+ responseId: String(created.id),
155
+ runId: String(created.run_id ?? ""),
156
+ sessionId: String(created.session_id ?? ""),
157
+ };
158
+ }
159
+ //# sourceMappingURL=orchestrator.js.map
@@ -0,0 +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"}
@@ -0,0 +1,67 @@
1
+ import type { Palai } from "../client.ts";
2
+ import { type CallOptions, type ListParams, type Page } from "./shared.ts";
3
+ export interface AgentProfile {
4
+ id: string;
5
+ object: string;
6
+ [key: string]: unknown;
7
+ }
8
+ export interface AgentRevision {
9
+ id: string;
10
+ object: string;
11
+ [key: string]: unknown;
12
+ }
13
+ export interface SubagentRef {
14
+ /** A published profile id. Mutually exclusive with `name`. */
15
+ ref?: string;
16
+ /** The model-visible name of an inline subagent. Mutually exclusive with `ref`. */
17
+ name?: string;
18
+ /** What this subagent is FOR — the routing signal a parent model reads. */
19
+ description?: string;
20
+ model?: string;
21
+ tools?: readonly string[];
22
+ instructions?: string;
23
+ skills?: readonly string[];
24
+ subagents?: SubagentRef[];
25
+ }
26
+ export interface DelegationLimits {
27
+ max_depth?: number;
28
+ max_children?: number;
29
+ }
30
+ export interface DefineAgentParams {
31
+ name: string;
32
+ description?: string;
33
+ instructions?: string;
34
+ model?: string;
35
+ tools?: readonly string[];
36
+ tool_sets?: readonly string[];
37
+ mcp_connections?: readonly string[];
38
+ skills?: readonly string[];
39
+ hooks?: readonly string[];
40
+ environment?: string;
41
+ subagents?: SubagentRef[];
42
+ delegation?: DelegationLimits;
43
+ [key: string]: unknown;
44
+ }
45
+ export interface PublishedAgent extends AgentProfile {
46
+ revisionId: string;
47
+ }
48
+ export interface AgentRevisionCreateParams {
49
+ instructions?: string;
50
+ model?: string;
51
+ [key: string]: unknown;
52
+ }
53
+ export declare class Agents {
54
+ #private;
55
+ constructor(client: Palai);
56
+ create(params: {
57
+ name: string;
58
+ description?: string;
59
+ }, options?: CallOptions): Promise<AgentProfile>;
60
+ createRevision(agentID: string, params: AgentRevisionCreateParams, options?: CallOptions): Promise<AgentRevision>;
61
+ list(params?: ListParams, options?: CallOptions): Promise<Page<AgentProfile>>;
62
+ retrieve(agentID: string, options?: CallOptions): Promise<AgentProfile>;
63
+ listRevisions(agentID: string, params?: ListParams, options?: CallOptions): Promise<Page<AgentRevision>>;
64
+ defineAgent(params: DefineAgentParams, options?: CallOptions): Promise<PublishedAgent>;
65
+ publishRevision(agentID: string, revisionID: string, options?: CallOptions): Promise<AgentRevision>;
66
+ }
67
+ //# sourceMappingURL=agents.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agents.d.ts","sourceRoot":"","sources":["../../src/resources/agents.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAA2B,KAAK,WAAW,EAAE,KAAK,UAAU,EAAE,KAAK,IAAI,EAAE,MAAM,aAAa,CAAC;AAKpG,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AACD,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAMD,MAAM,WAAW,WAAW;IAC1B,8DAA8D;IAC9D,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,mFAAmF;IACnF,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,2EAA2E;IAC3E,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3B,SAAS,CAAC,EAAE,WAAW,EAAE,CAAC;CAC3B;AAID,MAAM,WAAW,gBAAgB;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAID,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC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M,EAAE,OAAO,GAAE,WAAgB,GAAG,OAAO,CAAC,YAAY,CAAC,CAGhF;IAIK,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,GAAE,UAAe,EAAE,OAAO,GAAE,WAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAOrH;IAgBK,WAAW,CAAC,MAAM,EAAE,iBAAiB,EAAE,OAAO,GAAE,WAAgB,GAAG,OAAO,CAAC,cAAc,CAAC,CAS/F;IAGK,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,GAAE,WAAgB,GAAG,OAAO,CAAC,aAAa,CAAC,CAO5G;CACF"}
@@ -0,0 +1,75 @@
1
+ import { callArgs, enc, listPath } from "./shared.js";
2
+ // Agents is the /v1/agents resource: author a profile and its revisions, read them back, and publish.
3
+ //
4
+ // ‼️ THE AUTHORING WRITES WERE ABSENT AND THE COMMENT HERE SAID SO — "out of this parity task's scope".
5
+ // That was true of the task and false of the product: with only list/retrieve/publish, an SDK holder
6
+ // could publish a revision they had no way to create, on a profile they had no way to open. The plane
7
+ // has had POST /v1/agents and POST /v1/agents/{id}/revisions the whole time; what was missing was the
8
+ // half of the SDK that reaches them, and "a customer creates an agent and opens a session with the key
9
+ // we minted for them" is not a sentence the SDK could complete.
10
+ export class Agents {
11
+ #client;
12
+ constructor(client) {
13
+ this.#client = client;
14
+ }
15
+ // create opens a new agent-profile lineage. The profile is an IDENTITY and carries no behaviour: what
16
+ // an agent does lives on its revisions, which is why this takes a name and nothing else.
17
+ async create(params, options = {}) {
18
+ const r = await this.#client.request("POST", "/v1/agents", { body: params, ...callArgs(options) });
19
+ return r.body;
20
+ }
21
+ // createRevision adds a DRAFT revision to a profile (201). A draft steers no run — publishRevision is
22
+ // the transition that makes it the one a session resolves — so authoring and arming stay two calls a
23
+ // reader can tell apart.
24
+ //
25
+ // The 201 carries the id and NO Location header, and that is the plane's deliberate choice rather than
26
+ // an omission: `/v1/agent-revisions/{id}` is not a mounted address, and a correct-looking wrong URL is
27
+ // worse than none. Read it from the returned body.
28
+ async createRevision(agentID, params, options = {}) {
29
+ const r = await this.#client.request("POST", `/v1/agents/${enc(agentID)}/revisions`, { body: params, ...callArgs(options) });
30
+ return r.body;
31
+ }
32
+ // list returns a tenant-scoped page of agent-profile lineages.
33
+ async list(params = {}, options = {}) {
34
+ const result = await this.#client.request("GET", listPath("/v1/agents", params), callArgs(options));
35
+ return result.body;
36
+ }
37
+ // retrieve reads one agent-profile lineage; a foreign/unknown id is a 404.
38
+ async retrieve(agentID, options = {}) {
39
+ const result = await this.#client.request("GET", `/v1/agents/${enc(agentID)}`, callArgs(options));
40
+ return result.body;
41
+ }
42
+ // listRevisions pages one profile's revisions. The cursor is profile-scoped server-side, so a
43
+ // cursor from one profile does not validate on another.
44
+ async listRevisions(agentID, params = {}, options = {}) {
45
+ const result = await this.#client.request("GET", listPath(`/v1/agents/${enc(agentID)}/revisions`, params), callArgs(options));
46
+ return result.body;
47
+ }
48
+ // defineAgent folds create + revise + publish into one call, because they are one INTENT.
49
+ //
50
+ // ‼️ THE MIDDLE STATE IS ONE NOBODY ASKS FOR. A draft revision steers no run, so an agent created and
51
+ // revised but not published EXISTS and DOES NOTHING — it appears in every picker and runs the project
52
+ // default. That is the shape a client produces every time it forgets the third call, and it fails
53
+ // silently, which is why this exists as one call rather than as documentation saying "remember to
54
+ // publish".
55
+ //
56
+ // The identity/behaviour split is the SERVER's: the profile carries name and description, the revision
57
+ // carries everything a run executes. A caller who sent instructions to /v1/agents would have them
58
+ // accepted and ignored, so this routes each field to the half that reads it.
59
+ //
60
+ // agents.create / createRevision / publishRevision remain: a caller staging a draft for review needs
61
+ // the middle state this skips.
62
+ async defineAgent(params, options = {}) {
63
+ const { name, description, ...behaviour } = params;
64
+ const profile = await this.create(description === undefined ? { name } : { name, description }, options);
65
+ const revision = await this.createRevision(profile.id, behaviour, options);
66
+ await this.publishRevision(profile.id, revision.id, options);
67
+ return { ...profile, revisionId: revision.id };
68
+ }
69
+ // publishRevision publishes a draft revision, making it the profile's active config.
70
+ async publishRevision(agentID, revisionID, options = {}) {
71
+ const result = await this.#client.request("POST", `/v1/agents/${enc(agentID)}/revisions/${enc(revisionID)}/publish`, callArgs(options));
72
+ return result.body;
73
+ }
74
+ }
75
+ //# sourceMappingURL=agents.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agents.js","sourceRoot":"","sources":["../../src/resources/agents.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,QAAQ,EAAgD,MAAM,aAAa,CAAC;AAgGpG,sGAAsG;AACtG,EAAE;AACF,wGAAwG;AACxG,qGAAqG;AACrG,sGAAsG;AACtG,sGAAsG;AACtG,uGAAuG;AACvG,gEAAgE;AAChE,MAAM,OAAO,MAAM;IACjB,OAAO,CAAQ;IACf,YAAY,MAAa;QACvB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC;IAED,sGAAsG;IACtG,yFAAyF;IACzF,KAAK,CAAC,MAAM,CAAC,MAA8C,EAAE,OAAO,GAAgB,EAAE;QACpF,MAAM,CAAC,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,OAAO,CAAe,MAAM,EAAE,YAAY,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QACjH,OAAO,CAAC,CAAC,IAAI,CAAC;IAChB,CAAC;IAED,sGAAsG;IACtG,qGAAqG;IACrG,yBAAyB;IACzB,EAAE;IACF,uGAAuG;IACvG,uGAAuG;IACvG,mDAAmD;IACnD,KAAK,CAAC,cAAc,CAClB,OAAe,EACf,MAAiC,EACjC,OAAO,GAAgB,EAAE;QAEzB,MAAM,CAAC,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,OAAO,CAClC,MAAM,EACN,cAAc,GAAG,CAAC,OAAO,CAAC,YAAY,EACtC,EAAE,IAAI,EAAE,M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,KAAK,CAAC,WAAW,CAAC,MAAyB,EAAE,OAAO,GAAgB,EAAE;QACpE,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,GAAG,SAAS,EAAE,GAAG,MAAM,CAAC;QACnD,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,MAAM,CAC/B,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,EAC5D,OAAO,CACR,CAAC;QACF,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,EAAE,SAAsC,EAAE,OAAO,CAAC,CAAC;QACxG,MAAM,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,EAAE,EAAE,QAAQ,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;QAC7D,OAAO,EAAE,GAAG,OAAO,EAAE,UAAU,EAAE,QAAQ,CAAC,EAAE,EAAE,CAAC;IACjD,CAAC;IAED,qFAAqF;IACrF,KAAK,CAAC,eAAe,CAAC,OAAe,EAAE,UAAkB,EAAE,OAAO,GAAgB,EAAE;QAClF,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,OAAO,CACvC,MAAM,EACN,cAAc,GAAG,CAAC,OAAO,CAAC,cAAc,GAAG,CAAC,UAAU,CAAC,UAAU,EACjE,QAAQ,CAAC,OAAO,CAAC,CAClB,CAAC;QACF,OAAO,MAAM,CAAC,IAAI,CAAC;IACrB,CAAC;CACF"}
@@ -0,0 +1,33 @@
1
+ import type { Palai } from "../client.ts";
2
+ import { type CallOptions, type ListParams, type Page } from "./shared.ts";
3
+ export interface PendingApproval {
4
+ id: string;
5
+ object: string;
6
+ tool_call_id: string;
7
+ run_id: string;
8
+ session_id: string;
9
+ response_id?: string;
10
+ request_hash: string;
11
+ expires_at?: string | null;
12
+ created_at: string;
13
+ [key: string]: unknown;
14
+ }
15
+ export interface ApprovalDecisionResult {
16
+ id: string;
17
+ object: string;
18
+ decision: string;
19
+ }
20
+ export interface ApproveParams {
21
+ requestHash: string;
22
+ }
23
+ export interface DenyParams extends ApproveParams {
24
+ reason?: string;
25
+ }
26
+ export declare class Approvals {
27
+ #private;
28
+ constructor(client: Palai);
29
+ list(params?: ListParams, options?: CallOptions): Promise<Page<PendingApproval>>;
30
+ approve(approvalID: string, params: ApproveParams, options?: CallOptions): Promise<ApprovalDecisionResult>;
31
+ deny(approvalID: string, params: DenyParams, options?: CallOptions): Promise<ApprovalDecisionResult>;
32
+ }
33
+ //# sourceMappingURL=approvals.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"approvals.d.ts","sourceRoot":"","sources":["../../src/resources/approvals.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAA2B,KAAK,WAAW,EAAE,KAAK,UAAU,EAAE,KAAK,IAAI,EAAE,MAAM,aAAa,CAAC;AAkBpG,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IAIrB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAGD,MAAM,WAAW,sBAAsB;IACrC,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,aAAa;IAI5B,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,UAAW,SAAQ,aAAa;IAG/C,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAGD,qBAAa,SAAS;;IAEpB,YAAY,MAAM,EAAE,KAAK,EAExB;IAGK,IAAI,CAAC,MAAM,GAAE,UAAe,EAAE,OAAO,GAAE,WAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,CAO7F;IAID,OAAO,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,OAAO,GAAE,WAAgB,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAE7G;IAGD,IAAI,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,GAAE,WAAgB,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAEvG;CAqBF"}
@@ -0,0 +1,33 @@
1
+ import { callArgs, enc, listPath } from "./shared.js";
2
+ // Approvals is the /v1/approvals resource: read what is waiting, and answer it.
3
+ export class Approvals {
4
+ #client;
5
+ constructor(client) {
6
+ this.#client = client;
7
+ }
8
+ // list returns the tenant's pending approvals, newest first, with the shared cursor.
9
+ async list(params = {}, options = {}) {
10
+ const result = await this.#client.request("GET", listPath("/v1/approvals", params), callArgs(options));
11
+ return result.body;
12
+ }
13
+ // approve lets the parked call run. Idempotent by the approval's own state machine: a second approve of
14
+ // an already-approved row is the same answer, and one whose arguments changed is refused by the hash.
15
+ approve(approvalID, params, options = {}) {
16
+ return this.#decide(approvalID, "approve", { request_hash: params.requestHash, reason: "" }, options);
17
+ }
18
+ // deny refuses it, with a reason the agent reads.
19
+ deny(approvalID, params, options = {}) {
20
+ return this.#decide(approvalID, "deny", { request_hash: params.requestHash, reason: params.reason ?? "" }, options);
21
+ }
22
+ async #decide(approvalID, verb, body, options) {
23
+ const result = await this.#client.request("POST", `/v1/approvals/${enc(approvalID)}/${verb}`, {
24
+ body,
25
+ // The decision is keyed by the approval id and its request hash, and the row's state machine
26
+ // settles once — so a connection torn after the server committed is safe to re-send.
27
+ idempotent: true,
28
+ ...callArgs(options),
29
+ });
30
+ return result.body;
31
+ }
32
+ }
33
+ //# sourceMappingURL=approvals.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"approvals.js","sourceRoot":"","sources":["../../src/resources/approvals.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,QAAQ,EAAgD,MAAM,aAAa,CAAC;AAsDpG,gFAAgF;AAChF,MAAM,OAAO,SAAS;IACpB,OAAO,CAAQ;IACf,YAAY,MAAa;QACvB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC;IAED,qFAAqF;IACrF,KAAK,CAAC,IAAI,CAAC,MAAM,GAAe,EAAE,EAAE,OAAO,GAAgB,EAAE;QAC3D,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,OAAO,CACvC,KAAK,EACL,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC,EACjC,QAAQ,CAAC,OAAO,CAAC,CAClB,CAAC;QACF,OAAO,MAAM,CAAC,IAAI,CAAC;IACrB,CAAC;IAED,wGAAwG;IACxG,sGAAsG;IACtG,OAAO,CAAC,UAAkB,EAAE,MAAqB,EAAE,OAAO,GAAgB,EAAE;QAC1E,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,SAAS,EAAE,EAAE,YAAY,EAAE,MAAM,CAAC,WAAW,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IACxG,CAAC;IAED,kDAAkD;IAClD,IAAI,CAAC,UAAkB,EAAE,MAAkB,EAAE,OAAO,GAAgB,EAAE;QACpE,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,MAAM,EAAE,EAAE,YAAY,EAAE,MAAM,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,IAAI,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IACtH,CAAC;IAED,KAAK,CAAC,OAAO,CACX,UAAkB,EAClB,IAAwB,EACxB,IAA8C,EAC9C,OAAoB;QAEpB,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,OAAO,CACvC,MAAM,EACN,iBAAiB,GAAG,CAAC,UAAU,CAAC,IAAI,IAAI,EAAE,EAC1C;YACE,IAAI;YACJ,6FAA6F;YAC7F,qFAAqF;YACrF,UAAU,EAAE,IAAI;YAChB,GAAG,QAAQ,CAAC,OAAO,CAAC;SACrB,CACF,CAAC;QACF,OAAO,MAAM,CAAC,IAAI,CAAC;IACrB,CAAC;CACF"}
@@ -0,0 +1,36 @@
1
+ import type { Palai } from "../client.ts";
2
+ import { type CallOptions, type DownloadOptions, type ListView } from "./shared.ts";
3
+ export interface Artifact {
4
+ id: string;
5
+ object: string;
6
+ [key: string]: unknown;
7
+ }
8
+ export interface ArtifactDownload {
9
+ stream: ReadableStream<Uint8Array>;
10
+ contentDigest: string | null;
11
+ contentType: string;
12
+ contentLength: number | null;
13
+ bytes(): Promise<Uint8Array>;
14
+ }
15
+ export declare class Artifacts {
16
+ #private;
17
+ constructor(client: Palai);
18
+ /**
19
+ * create uploads bytes and returns the artifact whose id a run's `image_ref` content item names.
20
+ *
21
+ * ‼️ THIS IS HOW A SCREENSHOT REACHES A MODEL, and its absence was the gap: the Go SDK has had this
22
+ * since E09 and the TypeScript one did not, so a browser app — the only kind that has a file picker —
23
+ * could download artifacts and never send one. The demo's chat could show what the agent produced and
24
+ * not what the operator was looking at.
25
+ *
26
+ * NO MEDIA TYPE IS SENT, deliberately. The server sniffs the bytes (http.DetectContentType) and
27
+ * refuses anything outside its allow-list, so a caller-declared type would be a claim the server
28
+ * ignores — a lie in a function signature. A caller who knows what it is holding still learns what the
29
+ * server decided, from the `media_type` on the artifact that comes back.
30
+ */
31
+ create(content: Uint8Array, options?: CallOptions): Promise<Artifact>;
32
+ retrieve(artifactID: string, options?: CallOptions): Promise<Artifact>;
33
+ download(artifactID: string, options?: DownloadOptions): Promise<ArtifactDownload>;
34
+ listForResponse(responseID: string, options?: CallOptions): Promise<ListView<Artifact>>;
35
+ }
36
+ //# sourceMappingURL=artifacts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"artifacts.d.ts","sourceRoot":"","sources":["../../src/resources/artifacts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAiB,KAAK,WAAW,EAAE,KAAK,eAAe,EAAE,KAAK,QAAQ,EAAE,MAAM,aAAa,CAAC;AAKnG,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAMD,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,cAAc,CAAC,UAAU,CAAC,CAAC;IACnC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,KAAK,IAAI,OAAO,CAAC,UAAU,CAAC,CAAC;CAC9B;AAMD,qBAAa,SAAS;;IAEpB,YAAY,MAAM,EAAE,KAAK,EAExB;IAED;;;;;;;;;;;;OAYG;IACG,MAAM,CAAC,OAAO,EAAE,UAAU,EAAE,OAAO,GAAE,WAAgB,GAAG,OAAO,CAAC,QAAQ,CAAC,CAW9E;IAGK,QAAQ,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,GAAE,WAAgB,GAAG,OAAO,CAAC,QAAQ,CAAC,CAG/E;IAMK,QAAQ,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,GAAE,eAAoB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAU3F;IAIK,eAAe,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,GAAE,WAAgB,GAAG,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAOhG;CACF"}
@@ -0,0 +1,70 @@
1
+ import { callArgs, enc } from "./shared.js";
2
+ // Artifacts is the artifact retrieval resource (spec §22.6, E13 T5): the never-opened READ half of the
3
+ // E09 write-path — metadata, an authenticated streaming download, and a run-scoped list. A wrong-tenant
4
+ // or unknown id is an indistinguishable 404 (NotFoundError), so the surface leaks no cross-tenant
5
+ // existence.
6
+ export class Artifacts {
7
+ #client;
8
+ constructor(client) {
9
+ this.#client = client;
10
+ }
11
+ /**
12
+ * create uploads bytes and returns the artifact whose id a run's `image_ref` content item names.
13
+ *
14
+ * ‼️ THIS IS HOW A SCREENSHOT REACHES A MODEL, and its absence was the gap: the Go SDK has had this
15
+ * since E09 and the TypeScript one did not, so a browser app — the only kind that has a file picker —
16
+ * could download artifacts and never send one. The demo's chat could show what the agent produced and
17
+ * not what the operator was looking at.
18
+ *
19
+ * NO MEDIA TYPE IS SENT, deliberately. The server sniffs the bytes (http.DetectContentType) and
20
+ * refuses anything outside its allow-list, so a caller-declared type would be a claim the server
21
+ * ignores — a lie in a function signature. A caller who knows what it is holding still learns what the
22
+ * server decided, from the `media_type` on the artifact that comes back.
23
+ */
24
+ async create(content, options = {}) {
25
+ if (content.byteLength === 0) {
26
+ // Refused before the round trip: the server answers 400 for an empty body, and paying a request to
27
+ // be told what the caller already knows is a request nobody needed.
28
+ throw new TypeError("artifacts.create: the content carried no bytes");
29
+ }
30
+ const result = await this.#client.request("POST", "/v1/artifacts", {
31
+ ...callArgs(options),
32
+ bytes: content,
33
+ });
34
+ return result.body;
35
+ }
36
+ // retrieve returns an artifact's metadata; a foreign/unknown id is a 404.
37
+ async retrieve(artifactID, options = {}) {
38
+ const result = await this.#client.request("GET", `/v1/artifacts/${enc(artifactID)}`, callArgs(options));
39
+ return result.body;
40
+ }
41
+ // download opens the authenticated byte stream for an artifact. HONEST CEILING: this is a direct
42
+ // authenticated download — the object's bytes stream straight from the object store through the
43
+ // control-plane; a pre-signed URL + expiry policy is E13-H. The SSE primitive in stream.ts does NOT
44
+ // fit here (it frames an event stream, not raw bytes), so this reads the raw response body instead.
45
+ async download(artifactID, options = {}) {
46
+ const response = await this.#client.openDownload(`/v1/artifacts/${enc(artifactID)}/content`, options);
47
+ const contentLength = response.headers.get("Content-Length");
48
+ return {
49
+ stream: response.body ?? emptyStream(),
50
+ contentDigest: response.headers.get("Content-Digest"),
51
+ contentType: response.headers.get("Content-Type") ?? "application/octet-stream",
52
+ contentLength: contentLength === null ? null : Number(contentLength),
53
+ bytes: async () => new Uint8Array(await response.arrayBuffer()),
54
+ };
55
+ }
56
+ // listForResponse lists the artifacts a response's run produced. A known run with no artifacts is an
57
+ // empty list, not a miss; an unknown/foreign response id is a 404.
58
+ async listForResponse(responseID, options = {}) {
59
+ const result = await this.#client.request("GET", `/v1/responses/${enc(responseID)}/artifacts`, callArgs(options));
60
+ return result.body;
61
+ }
62
+ }
63
+ function emptyStream() {
64
+ return new ReadableStream({
65
+ start(controller) {
66
+ controller.close();
67
+ },
68
+ });
69
+ }
70
+ //# sourceMappingURL=artifacts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"artifacts.js","sourceRoot":"","sources":["../../src/resources/artifacts.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAyD,MAAM,aAAa,CAAC;AAuBnG,uGAAuG;AACvG,wGAAwG;AACxG,kGAAkG;AAClG,aAAa;AACb,MAAM,OAAO,SAAS;IACpB,OAAO,CAAQ;IACf,YAAY,MAAa;QACvB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,KAAK,CAAC,MAAM,CAAC,OAAmB,EAAE,OAAO,GAAgB,EAAE;QACzD,IAAI,OAAO,CAAC,UAAU,KAAK,CAAC,EAAE,CAAC;YAC7B,mGAAmG;YACnG,oEAAoE;YACpE,MAAM,IAAI,SAAS,CAAC,gDAAgD,CAAC,CAAC;QACxE,CAAC;QACD,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,OAAO,CAAW,MAAM,EAAE,eAAe,EAAE;YAC3E,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Ae,CAAC,UAAkB,EAAE,OAAO,GAAgB,EAAE;QACjE,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,OAAO,CACvC,KAAK,EACL,iBAAiB,GAAG,CAAC,UAAU,CAAC,YAAY,EAC5C,QAAQ,CAAC,OAAO,CAAC,CAClB,CAAC;QACF,OAAO,MAAM,CAAC,IAAI,CAAC;IACrB,CAAC;CACF;AAED,SAAS,WAAW;IAClB,OAAO,IAAI,cAAc,CAAa;QACpC,KAAK,CAAC,UAAU;YACd,UAAU,CAAC,KAAK,EAAE,CAAC;QACrB,CAAC;KACF,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,70 @@
1
+ import type { ModelConnection, ModelRoute, ModelRouteRevision } from "../generated/types.ts";
2
+ import type { Palai } from "../client.ts";
3
+ import { type CallOptions, type ListView } from "./shared.ts";
4
+ export interface ModelConnectionCreateParams {
5
+ provider: string;
6
+ secret_ref: string;
7
+ /**
8
+ * This connection's OWN endpoint. OPTIONAL on every protocol: empty means the vendor's own endpoint, and
9
+ * a value reaches an OpenAI-compatible target such as Grok, z.ai or Azure OpenAI.
10
+ *
11
+ * It used to be REQUIRED by an `openai-compatible` family and REFUSED on the others. That family was
12
+ * dissolved on 2026-08-11 — it was the same wire protocol wearing a second name, so reaching a new
13
+ * compatible target needed an adapter and a release rather than a row. The protocols a deployment speaks
14
+ * are served by `GET /v1/model-protocols`; this SDK carries no copy of the list.
15
+ */
16
+ base_url?: string;
17
+ }
18
+ /**
19
+ * One credential probe's finding (E29). `outcome` is the verdict; `not_probed` means NOTHING was checked
20
+ * and must never be rendered as a pass. `checked` is the server's own sentence about what a probe does not
21
+ * establish — the model id's validity above all — carried in the payload so a UI cannot overstate it.
22
+ */
23
+ export interface ModelConnectionVerification {
24
+ object: string;
25
+ connection_id: string;
26
+ provider: string;
27
+ outcome: "credential_accepted" | "credential_rejected" | "unreachable" | "transient" | "not_probed";
28
+ status?: number;
29
+ endpoint?: string;
30
+ detail?: string;
31
+ checked?: string;
32
+ }
33
+ export interface ModelRouteCreateParams {
34
+ name: string;
35
+ }
36
+ export interface ModelRouteRevisionCreateParams {
37
+ model: string;
38
+ connection_id: string;
39
+ /**
40
+ * How hard runs on this route think, and whether a person sees the reasoning.
41
+ *
42
+ * ‼️ THEY ARE TYPED HERE BECAUSE THE PLANE'S DECODER IS STRICT AND SILENT ABOUT IT. A field this SDK
43
+ * does not name cannot be smuggled through — strictDecodeBody is DisallowUnknownFields and these params
44
+ * carry no escape hatch — so an untyped knob is a knob no SDK caller can turn at all. `thinking` shipped
45
+ * exactly that way and stayed write-only-by-curl; `effort` is not repeating it.
46
+ *
47
+ * `effort` is the canonical ladder: none | minimal | low | medium | high | xhigh | max. Which rungs a
48
+ * given model accepts is the PROVIDER's answer — Anthropic has no none/minimal — and the plane refuses
49
+ * an unmappable rung rather than quietly substituting a more expensive one.
50
+ */
51
+ effort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max";
52
+ /** Ask the provider to return the model's reasoning where a person can read it. */
53
+ thinking?: "visible";
54
+ }
55
+ export declare class ModelRoutes {
56
+ #private;
57
+ constructor(client: Palai);
58
+ createConnection(params: ModelConnectionCreateParams, options?: CallOptions): Promise<ModelConnection>;
59
+ verifyConnection(connectionID: string, options?: CallOptions): Promise<ModelConnectionVerification>;
60
+ createRoute(params: ModelRouteCreateParams, options?: CallOptions): Promise<ModelRoute>;
61
+ createRevision(routeID: string, params: ModelRouteRevisionCreateParams, options?: CallOptions): Promise<ModelRouteRevision>;
62
+ publishRevision(routeID: string, revisionID: string, options?: CallOptions): Promise<ModelRouteRevision>;
63
+ listConnections(options?: CallOptions): Promise<ListView<ModelConnection>>;
64
+ getConnection(connectionID: string, options?: CallOptions): Promise<ModelConnection>;
65
+ listRoutes(options?: CallOptions): Promise<ListView<ModelRoute>>;
66
+ getRoute(routeID: string, options?: CallOptions): Promise<ModelRoute>;
67
+ listRevisions(routeID: string, options?: CallOptions): Promise<ListView<ModelRouteRevision>>;
68
+ getRevision(routeID: string, revisionID: string, options?: CallOptions): Promise<ModelRouteRevision>;
69
+ }
70
+ //# sourceMappingURL=model-routes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"model-routes.d.ts","sourceRoot":"","sources":["../../src/resources/model-routes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC7F,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAiB,KAAK,WAAW,EAAE,KAAK,QAAQ,EAAE,MAAM,aAAa,CAAC;AAQ7E,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB;;;;;;;;OAQG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;;GAIG;AACH,MAAM,WAAW,2BAA2B;IAC1C,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,qBAAqB,GAAG,qBAAqB,GAAG,aAAa,GAAG,WAAW,GAAG,YAAY,CAAC;IACpG,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AACD,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,MAAM,CAAC;CACd;AACD,MAAM,WAAW,8BAA8B;IAC7C,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,MAAM,CAAC;IACtB;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,KAAK,CAAC;IAC1E,mFAAmF;IACnF,QAAQ,C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