@cubos/agent-sdk 0.0.1154105 → 0.0.1154782

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.
@@ -208,6 +208,7 @@ export declare function agentsApi(t: Transport, tenantSlug: string): {
208
208
  listAutoCallTools: (agentSlug: string, signal?: AbortSignal) => Promise<{
209
209
  available: import("../generated/schema.js").components["schemas"]["AutoCallableTool"][];
210
210
  enabled_mcp_count: number;
211
+ gated?: import("../generated/schema.js").components["schemas"]["GatedAutoCallTool"][];
211
212
  }>;
212
213
  putAutoCallTools: (agentSlug: string, tools: Schemas["AutoCallToolRef"][]) => Promise<void>;
213
214
  };
@@ -1545,7 +1545,7 @@ export interface paths {
1545
1545
  };
1546
1546
  /**
1547
1547
  * List auto-call tools
1548
- * @description Lists every eligible auto-call candidate for the agent, each flagged with whether it is currently selected, plus the count of attached MCPs. A tool is eligible when its MCP is attached, the tool is enabled, present upstream, within the agent's allowlist, and accepts `{}` as input.
1548
+ * @description Lists every eligible auto-call candidate for the agent, each flagged with whether it is currently selected, plus the count of attached MCPs. A tool is eligible when its MCP is attached, the tool is enabled, present upstream, within the agent's allowlist, accepts `{}` as input, and no skill gates it — an auto-call runs before the model can read a skill. A selected tool that a skill gated afterwards is listed under `gated` instead: the harness skips it.
1549
1549
  */
1550
1550
  get: {
1551
1551
  parameters: {
@@ -1591,7 +1591,7 @@ export interface paths {
1591
1591
  };
1592
1592
  /**
1593
1593
  * Replace auto-call tools
1594
- * @description Replaces the agent's entire auto-call selection with the request body, in one transaction. Each entry is checked against the same eligibility rules as the list endpoint; one ineligible entry rejects the whole request with `422`.
1594
+ * @description Replaces the agent's entire auto-call selection with the request body, in one transaction. Each entry is checked against the same eligibility rules as the list endpoint — a tool a skill gates included; one ineligible entry rejects the whole request with `422`, whose body names every refused tool and the first rule it fails.
1595
1595
  */
1596
1596
  put: {
1597
1597
  parameters: {
@@ -1635,12 +1635,14 @@ export interface paths {
1635
1635
  };
1636
1636
  content?: never;
1637
1637
  };
1638
- /** @description One of the tools is not eligible */
1638
+ /** @description One or more tools are not eligible; the body names each and why */
1639
1639
  422: {
1640
1640
  headers: {
1641
1641
  [name: string]: unknown;
1642
1642
  };
1643
- content?: never;
1643
+ content: {
1644
+ "application/json": components["schemas"]["AutoCallToolsRefused"];
1645
+ };
1644
1646
  };
1645
1647
  };
1646
1648
  };
@@ -5041,7 +5043,7 @@ export interface paths {
5041
5043
  put?: never;
5042
5044
  /**
5043
5045
  * Archive conversation
5044
- * @description Soft-archives the conversation by setting `archived_at` and bumping `last_activity_at` so list subscribers see the change. Idempotent: re-archiving keeps the original timestamp and emits no SSE delta.
5046
+ * @description Soft-archives the conversation by setting `archived_at` and bumping `last_activity_at` so list subscribers see the change. Idempotent: re-archiving keeps the original timestamp and emits no SSE delta. Archiving settles what was pending on the conversation — open client tool calls are closed unanswered, a parent conversation waiting on it gets what it had already said of its reply, marked as cut short, and a knowledge-base curation run it carried is abandoned.
5045
5047
  */
5046
5048
  post: {
5047
5049
  parameters: {
@@ -5348,7 +5350,7 @@ export interface paths {
5348
5350
  };
5349
5351
  content?: never;
5350
5352
  };
5351
- /** @description Another claimant holds a live lease. */
5353
+ /** @description Another claimant holds a live lease — or, as a plain-text body, the conversation is archived. */
5352
5354
  409: {
5353
5355
  headers: {
5354
5356
  [name: string]: unknown;
@@ -6076,7 +6078,7 @@ export interface paths {
6076
6078
  };
6077
6079
  /**
6078
6080
  * Create or replace a filesystem file
6079
- * @description Writes one file into the conversation's filesystem, creating parent directories and overwriting whatever was at `path`. The body is `multipart/form-data` with a single `file` part. Starts no turn: the agent is told about the change as part of its next request, so send a message or a steer if you want an answer now. 409 when the conversation's agent has `feature_filesystem` off; 413 when the file or the resulting tree is over the size cap.
6081
+ * @description Writes one file into the conversation's filesystem, creating parent directories and overwriting whatever was at `path`. The body is `multipart/form-data` with a single `file` part. Starts no turn: the agent is told about the change as part of its next request, so send a message or a steer if you want an answer now. 409 when the conversation's agent has `feature_filesystem` off or the conversation is archived; 413 when the file or the resulting tree is over the size cap.
6080
6082
  */
6081
6083
  put: {
6082
6084
  parameters: {
@@ -6663,7 +6665,7 @@ export interface paths {
6663
6665
  put?: never;
6664
6666
  /**
6665
6667
  * Steer the agent
6666
- * @description Appends an `agent_directive` — an operator/system instruction (e.g. a failed payment to resolve) the agent acts on and replies to the user about, rendered to the model distinctly from the user's own words — and wakes the dispatcher. Works on any conversation, including channel-backed ones. Empty content returns 400.
6668
+ * @description Appends an `agent_directive` — an operator/system instruction (e.g. a failed payment to resolve) the agent acts on and replies to the user about, rendered to the model distinctly from the user's own words — and wakes the dispatcher. Works on any conversation, including channel-backed ones, as long as it is not archived: an archived conversation takes no new event and returns 409. Empty content returns 400.
6667
6669
  */
6668
6670
  post: {
6669
6671
  parameters: {
@@ -6715,6 +6717,13 @@ export interface paths {
6715
6717
  };
6716
6718
  content?: never;
6717
6719
  };
6720
+ /** @description The conversation is archived. */
6721
+ 409: {
6722
+ headers: {
6723
+ [name: string]: unknown;
6724
+ };
6725
+ content?: never;
6726
+ };
6718
6727
  };
6719
6728
  };
6720
6729
  delete?: never;
@@ -6858,7 +6867,7 @@ export interface paths {
6858
6867
  put?: never;
6859
6868
  /**
6860
6869
  * Send a user message
6861
- * @description Appends a `user_message` to the conversation log with a serialized, monotonically increasing `seq`, and wakes the dispatcher so a turn runs. Only for conversations without a channel — a channel-backed conversation (Telegram/WhatsApp/…) receives the user's words through the channel itself, so injecting one here would forge a message the user never sent; that returns 409. Empty content returns 400.
6870
+ * @description Appends a `user_message` to the conversation log with a serialized, monotonically increasing `seq`, and wakes the dispatcher so a turn runs. Only for conversations without a channel — a channel-backed conversation (Telegram/WhatsApp/…) receives the user's words through the channel itself, so injecting one here would forge a message the user never sent; that returns 409. An archived conversation takes no new event and also returns 409. Empty content returns 400.
6862
6871
  */
6863
6872
  post: {
6864
6873
  parameters: {
@@ -6910,6 +6919,7 @@ export interface paths {
6910
6919
  };
6911
6920
  content?: never;
6912
6921
  };
6922
+ /** @description The conversation is channel-backed, or archived. */
6913
6923
  409: {
6914
6924
  headers: {
6915
6925
  [name: string]: unknown;
@@ -6935,7 +6945,7 @@ export interface paths {
6935
6945
  put?: never;
6936
6946
  /**
6937
6947
  * Send a voice message
6938
- * @description Appends a `user_message` carrying an audio attachment and wakes the dispatcher. `multipart/form-data` with an `audio` part. The bytes are stored content-addressed; the harness transcribes them through the agent's STT model before the turn runs and records a `media_transcription` event, so the reply answers what was said. The message content is empty by design — the transcription is the text. Same channel rule as the text route: a channel-backed conversation returns 409.
6948
+ * @description Appends a `user_message` carrying an audio attachment and wakes the dispatcher. `multipart/form-data` with an `audio` part. The bytes are stored content-addressed; the harness transcribes them through the agent's STT model before the turn runs and records a `media_transcription` event, so the reply answers what was said. The message content is empty by design — the transcription is the text. Same rules as the text route: a channel-backed or archived conversation returns 409.
6939
6949
  */
6940
6950
  post: {
6941
6951
  parameters: {
@@ -6988,7 +6998,7 @@ export interface paths {
6988
6998
  };
6989
6999
  content?: never;
6990
7000
  };
6991
- /** @description The conversation is channel-backed. */
7001
+ /** @description The conversation is channel-backed, or archived. */
6992
7002
  409: {
6993
7003
  headers: {
6994
7004
  [name: string]: unknown;
@@ -7021,7 +7031,7 @@ export interface paths {
7021
7031
  put?: never;
7022
7032
  /**
7023
7033
  * Send a user message with images
7024
- * @description Appends one `user_message` carrying up to 10 image attachments. `multipart/form-data` with repeated `file` parts (any `image/*` type), optional repeated `label` text parts (the i-th label names the i-th file — the model sees it next to that image and can refer to images by name), and an optional `caption` text part shared by the set. The harness shows the images to the model natively when the agent's chat model has vision, or describes them with the agent's fallback vision model — in both cases after the image plugin has normalized them (oriented, downscaled, re-encoded as PNG or JPEG); a type no plugin reads reaches the model as a placeholder. Same channel rule as the plain user-message route: channel-backed conversations return 409.
7034
+ * @description Appends one `user_message` carrying up to 10 image attachments. `multipart/form-data` with repeated `file` parts (any `image/*` type), optional repeated `label` text parts (the i-th label names the i-th file — the model sees it next to that image and can refer to images by name), and an optional `caption` text part shared by the set. The harness shows the images to the model natively when the agent's chat model has vision, or describes them with the agent's fallback vision model — in both cases after the image plugin has normalized them (oriented, downscaled, re-encoded as PNG or JPEG); a type no plugin reads reaches the model as a placeholder. Same channel rule as the plain user-message route: channel-backed conversations return 409, and so do archived ones.
7025
7035
  */
7026
7036
  post: {
7027
7037
  parameters: {
@@ -7074,6 +7084,7 @@ export interface paths {
7074
7084
  };
7075
7085
  content?: never;
7076
7086
  };
7087
+ /** @description The conversation is channel-backed, or archived. */
7077
7088
  409: {
7078
7089
  headers: {
7079
7090
  [name: string]: unknown;
@@ -12501,6 +12512,12 @@ export interface components {
12501
12512
  selected: boolean;
12502
12513
  tool_name: string;
12503
12514
  };
12515
+ /**
12516
+ * @description Why a tool cannot be auto-called. Checked in this order; a refused tool
12517
+ * carries the first that applies.
12518
+ * @enum {string}
12519
+ */
12520
+ AutoCallRefusal: "unknown_mcp" | "unknown_tool" | "mcp_not_attached" | "disabled" | "disappeared" | "not_in_allowlist" | "required_arguments" | "gated";
12504
12521
  AutoCallToolRef: {
12505
12522
  mcp_slug: string;
12506
12523
  tool_name: string;
@@ -12508,7 +12525,8 @@ export interface components {
12508
12525
  AutoCallToolsConfig: {
12509
12526
  /**
12510
12527
  * @description Tools the operator can pick from: enabled MCPs for the agent, in
12511
- * the allowlist if any, present upstream, and accept `{}` as input.
12528
+ * the allowlist if any, present upstream, accept `{}` as input, and
12529
+ * no skill gates them.
12512
12530
  */
12513
12531
  available: components["schemas"]["AutoCallableTool"][];
12514
12532
  /**
@@ -12518,6 +12536,22 @@ export interface components {
12518
12536
  * `available = []` because every tool has required arguments.
12519
12537
  */
12520
12538
  enabled_mcp_count: number;
12539
+ /**
12540
+ * @description Tools in the agent's selection that a skill gated after they were
12541
+ * picked. The harness never calls them: an auto-call runs before the
12542
+ * model can read any skill. They are not in `available`, so the next
12543
+ * save of the selection drops them.
12544
+ */
12545
+ gated?: components["schemas"]["GatedAutoCallTool"][];
12546
+ };
12547
+ /**
12548
+ * @description Body of the `422` that refuses an auto-call selection: every refused tool
12549
+ * and why, plus all of it in one sentence under `error` — the shape the
12550
+ * MCP routes' errors already have.
12551
+ */
12552
+ AutoCallToolsRefused: {
12553
+ error: string;
12554
+ rejected: components["schemas"]["RejectedAutoCallTool"][];
12521
12555
  };
12522
12556
  /**
12523
12557
  * @description One segment of an agent message.
@@ -13844,6 +13878,16 @@ export interface components {
13844
13878
  * @enum {string}
13845
13879
  */
13846
13880
  FinishError: "length" | "content_filter";
13881
+ /**
13882
+ * @description A tool still in the agent's auto-call selection that the harness skips
13883
+ * because a skill gates it.
13884
+ */
13885
+ GatedAutoCallTool: {
13886
+ /** @description Slugs of the MCP's skills that unlock the tool. */
13887
+ gating_skills: string[];
13888
+ mcp_slug: string;
13889
+ tool_name: string;
13890
+ };
13847
13891
  /**
13848
13892
  * @description Returned by the generate/rotate-secret route: the new plaintext, shown
13849
13893
  * only here.
@@ -14702,6 +14746,18 @@ export interface components {
14702
14746
  default: string;
14703
14747
  options: string[];
14704
14748
  };
14749
+ /** @description One tool the `PUT` refused. */
14750
+ RejectedAutoCallTool: {
14751
+ /** @description Slugs of the MCP's skills that unlock the tool, for `gated`. */
14752
+ gating_skills?: string[];
14753
+ mcp_slug: string;
14754
+ /** @description `mcp/tool: why`, in prose, ready to show an operator. */
14755
+ message: string;
14756
+ reason: components["schemas"]["AutoCallRefusal"];
14757
+ /** @description The arguments the tool requires, for `required_arguments`. */
14758
+ required_arguments?: string[];
14759
+ tool_name: string;
14760
+ };
14705
14761
  ReplaceAgentMcpRolesInput: {
14706
14762
  role_slugs: string[];
14707
14763
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cubos/agent-sdk",
3
- "version": "0.0.1154105",
3
+ "version": "0.0.1154782",
4
4
  "type": "module",
5
5
  "description": "Client for the Cubos Agent conversation API. Runs anywhere fetch does.",
6
6
  "license": "SEE LICENSE IN LICENSE",