@archastro/sdk 0.5.2 → 0.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.
Files changed (230) hide show
  1. package/README.md +86 -0
  2. package/dist/auth.d.ts +143 -0
  3. package/dist/auth.d.ts.map +1 -1
  4. package/dist/auth.js +187 -1
  5. package/dist/auth.js.map +1 -1
  6. package/dist/channels/api_chat_channel.d.ts +4 -0
  7. package/dist/channels/api_chat_channel.d.ts.map +1 -1
  8. package/dist/channels/api_chat_channel.js +9 -1
  9. package/dist/channels/api_chat_channel.js.map +1 -1
  10. package/dist/client.d.ts +26 -0
  11. package/dist/client.d.ts.map +1 -1
  12. package/dist/client.js +27 -1
  13. package/dist/client.js.map +1 -1
  14. package/dist/index.d.ts +1 -1
  15. package/dist/index.d.ts.map +1 -1
  16. package/dist/index.js +2 -2
  17. package/dist/index.js.map +1 -1
  18. package/dist/runtime/http-client.d.ts +17 -0
  19. package/dist/runtime/http-client.d.ts.map +1 -1
  20. package/dist/runtime/http-client.js +116 -0
  21. package/dist/runtime/http-client.js.map +1 -1
  22. package/dist/types/ai.d.ts +421 -14
  23. package/dist/types/ai.d.ts.map +1 -1
  24. package/dist/types/ai.js +121 -41
  25. package/dist/types/ai.js.map +1 -1
  26. package/dist/types/artifacts.d.ts +81 -24
  27. package/dist/types/artifacts.d.ts.map +1 -1
  28. package/dist/types/artifacts.js +39 -21
  29. package/dist/types/artifacts.js.map +1 -1
  30. package/dist/types/automations.d.ts +41 -9
  31. package/dist/types/automations.d.ts.map +1 -1
  32. package/dist/types/automations.js +25 -17
  33. package/dist/types/automations.js.map +1 -1
  34. package/dist/types/chat.d.ts +21560 -0
  35. package/dist/types/chat.d.ts.map +1 -0
  36. package/dist/types/chat.js +70 -0
  37. package/dist/types/chat.js.map +1 -0
  38. package/dist/types/common.d.ts +17031 -2136
  39. package/dist/types/common.d.ts.map +1 -1
  40. package/dist/types/common.js +1701 -332
  41. package/dist/types/common.js.map +1 -1
  42. package/dist/types/config.d.ts +245 -37
  43. package/dist/types/config.d.ts.map +1 -1
  44. package/dist/types/config.js +86 -34
  45. package/dist/types/config.js.map +1 -1
  46. package/dist/types/image.d.ts +27 -4
  47. package/dist/types/image.d.ts.map +1 -1
  48. package/dist/types/image.js +17 -10
  49. package/dist/types/image.js.map +1 -1
  50. package/dist/types/index.d.ts +2 -1
  51. package/dist/types/index.d.ts.map +1 -1
  52. package/dist/types/index.js +3 -2
  53. package/dist/types/index.js.map +1 -1
  54. package/dist/types/invites.d.ts +20 -11
  55. package/dist/types/invites.d.ts.map +1 -1
  56. package/dist/types/invites.js +9 -12
  57. package/dist/types/invites.js.map +1 -1
  58. package/dist/types/notifications.d.ts +163 -0
  59. package/dist/types/notifications.d.ts.map +1 -0
  60. package/dist/types/notifications.js +44 -0
  61. package/dist/types/notifications.js.map +1 -0
  62. package/dist/types/teams.d.ts +1640 -231
  63. package/dist/types/teams.d.ts.map +1 -1
  64. package/dist/types/teams.js +76 -45
  65. package/dist/types/teams.js.map +1 -1
  66. package/dist/types/threads.d.ts +1007 -243
  67. package/dist/types/threads.d.ts.map +1 -1
  68. package/dist/types/threads.js +84 -51
  69. package/dist/types/threads.js.map +1 -1
  70. package/dist/types/users.d.ts +98 -18
  71. package/dist/types/users.d.ts.map +1 -1
  72. package/dist/types/users.js +43 -18
  73. package/dist/types/users.js.map +1 -1
  74. package/dist/v1/resources/activity_feed.d.ts +90 -0
  75. package/dist/v1/resources/activity_feed.d.ts.map +1 -1
  76. package/dist/v1/resources/activity_feed.js +56 -2
  77. package/dist/v1/resources/activity_feed.js.map +1 -1
  78. package/dist/v1/resources/agent_computers.d.ts +48 -2
  79. package/dist/v1/resources/agent_computers.d.ts.map +1 -1
  80. package/dist/v1/resources/agent_computers.js +48 -1
  81. package/dist/v1/resources/agent_computers.js.map +1 -1
  82. package/dist/v1/resources/agent_env_vars.d.ts +50 -0
  83. package/dist/v1/resources/agent_env_vars.d.ts.map +1 -0
  84. package/dist/v1/resources/agent_env_vars.js +56 -0
  85. package/dist/v1/resources/agent_env_vars.js.map +1 -0
  86. package/dist/v1/resources/agent_health_actions.d.ts +43 -0
  87. package/dist/v1/resources/agent_health_actions.d.ts.map +1 -0
  88. package/dist/v1/resources/agent_health_actions.js +50 -0
  89. package/dist/v1/resources/agent_health_actions.js.map +1 -0
  90. package/dist/v1/resources/agent_installations.d.ts +100 -0
  91. package/dist/v1/resources/agent_installations.d.ts.map +1 -1
  92. package/dist/v1/resources/agent_installations.js +106 -2
  93. package/dist/v1/resources/agent_installations.js.map +1 -1
  94. package/dist/v1/resources/agent_routine_runs.d.ts +33 -0
  95. package/dist/v1/resources/agent_routine_runs.d.ts.map +1 -0
  96. package/dist/v1/resources/agent_routine_runs.js +48 -0
  97. package/dist/v1/resources/agent_routine_runs.js.map +1 -0
  98. package/dist/v1/resources/agent_routines.d.ts +148 -2
  99. package/dist/v1/resources/agent_routines.d.ts.map +1 -1
  100. package/dist/v1/resources/agent_routines.js +168 -3
  101. package/dist/v1/resources/agent_routines.js.map +1 -1
  102. package/dist/v1/resources/agent_sessions.d.ts +118 -1
  103. package/dist/v1/resources/agent_sessions.d.ts.map +1 -1
  104. package/dist/v1/resources/agent_sessions.js +134 -2
  105. package/dist/v1/resources/agent_sessions.js.map +1 -1
  106. package/dist/v1/resources/agent_skills.d.ts +83 -1
  107. package/dist/v1/resources/agent_skills.d.ts.map +1 -1
  108. package/dist/v1/resources/agent_skills.js +87 -2
  109. package/dist/v1/resources/agent_skills.js.map +1 -1
  110. package/dist/v1/resources/agent_tools.d.ts +109 -2
  111. package/dist/v1/resources/agent_tools.d.ts.map +1 -1
  112. package/dist/v1/resources/agent_tools.js +114 -2
  113. package/dist/v1/resources/agent_tools.js.map +1 -1
  114. package/dist/v1/resources/agents.d.ts +519 -9
  115. package/dist/v1/resources/agents.d.ts.map +1 -1
  116. package/dist/v1/resources/agents.js +516 -12
  117. package/dist/v1/resources/agents.js.map +1 -1
  118. package/dist/v1/resources/ai.d.ts +174 -3
  119. package/dist/v1/resources/ai.d.ts.map +1 -1
  120. package/dist/v1/resources/ai.js +114 -3
  121. package/dist/v1/resources/ai.js.map +1 -1
  122. package/dist/v1/resources/artifacts.d.ts +73 -0
  123. package/dist/v1/resources/artifacts.d.ts.map +1 -1
  124. package/dist/v1/resources/artifacts.js +74 -2
  125. package/dist/v1/resources/artifacts.js.map +1 -1
  126. package/dist/v1/resources/automation_runs.d.ts +8 -4
  127. package/dist/v1/resources/automation_runs.d.ts.map +1 -1
  128. package/dist/v1/resources/automation_runs.js +9 -5
  129. package/dist/v1/resources/automation_runs.js.map +1 -1
  130. package/dist/v1/resources/automations.d.ts +20 -0
  131. package/dist/v1/resources/automations.d.ts.map +1 -1
  132. package/dist/v1/resources/automations.js +21 -1
  133. package/dist/v1/resources/automations.js.map +1 -1
  134. package/dist/v1/resources/bug_reports.d.ts +29 -0
  135. package/dist/v1/resources/bug_reports.d.ts.map +1 -0
  136. package/dist/v1/resources/bug_reports.js +29 -0
  137. package/dist/v1/resources/bug_reports.js.map +1 -0
  138. package/dist/v1/resources/config.d.ts +437 -4
  139. package/dist/v1/resources/config.d.ts.map +1 -1
  140. package/dist/v1/resources/config.js +497 -9
  141. package/dist/v1/resources/config.js.map +1 -1
  142. package/dist/v1/resources/custom_objects.d.ts +117 -2
  143. package/dist/v1/resources/custom_objects.d.ts.map +1 -1
  144. package/dist/v1/resources/custom_objects.js +132 -3
  145. package/dist/v1/resources/custom_objects.js.map +1 -1
  146. package/dist/v1/resources/files.d.ts +62 -0
  147. package/dist/v1/resources/files.d.ts.map +1 -0
  148. package/dist/v1/resources/files.js +58 -0
  149. package/dist/v1/resources/files.js.map +1 -0
  150. package/dist/v1/resources/index.d.ts +13 -0
  151. package/dist/v1/resources/index.d.ts.map +1 -1
  152. package/dist/v1/resources/index.js +14 -1
  153. package/dist/v1/resources/index.js.map +1 -1
  154. package/dist/v1/resources/installation_sources.d.ts +12 -0
  155. package/dist/v1/resources/installation_sources.d.ts.map +1 -1
  156. package/dist/v1/resources/installation_sources.js +13 -1
  157. package/dist/v1/resources/installation_sources.js.map +1 -1
  158. package/dist/v1/resources/invites.d.ts +15 -0
  159. package/dist/v1/resources/invites.d.ts.map +1 -1
  160. package/dist/v1/resources/invites.js +16 -1
  161. package/dist/v1/resources/invites.js.map +1 -1
  162. package/dist/v1/resources/knowledge_documents.d.ts +104 -0
  163. package/dist/v1/resources/knowledge_documents.d.ts.map +1 -0
  164. package/dist/v1/resources/knowledge_documents.js +112 -0
  165. package/dist/v1/resources/knowledge_documents.js.map +1 -0
  166. package/dist/v1/resources/knowledge_sources.d.ts +190 -0
  167. package/dist/v1/resources/knowledge_sources.d.ts.map +1 -0
  168. package/dist/v1/resources/knowledge_sources.js +176 -0
  169. package/dist/v1/resources/knowledge_sources.js.map +1 -0
  170. package/dist/v1/resources/kv.d.ts +73 -0
  171. package/dist/v1/resources/kv.d.ts.map +1 -1
  172. package/dist/v1/resources/kv.js +96 -3
  173. package/dist/v1/resources/kv.js.map +1 -1
  174. package/dist/v1/resources/notification_preferences.d.ts +61 -0
  175. package/dist/v1/resources/notification_preferences.d.ts.map +1 -0
  176. package/dist/v1/resources/notification_preferences.js +65 -0
  177. package/dist/v1/resources/notification_preferences.js.map +1 -0
  178. package/dist/v1/resources/notifications.d.ts +133 -0
  179. package/dist/v1/resources/notifications.d.ts.map +1 -0
  180. package/dist/v1/resources/notifications.js +136 -0
  181. package/dist/v1/resources/notifications.js.map +1 -0
  182. package/dist/v1/resources/orgs.d.ts +18 -0
  183. package/dist/v1/resources/orgs.d.ts.map +1 -1
  184. package/dist/v1/resources/orgs.js +30 -2
  185. package/dist/v1/resources/orgs.js.map +1 -1
  186. package/dist/v1/resources/slack_channel_bindings.d.ts +101 -0
  187. package/dist/v1/resources/slack_channel_bindings.d.ts.map +1 -0
  188. package/dist/v1/resources/slack_channel_bindings.js +114 -0
  189. package/dist/v1/resources/slack_channel_bindings.js.map +1 -0
  190. package/dist/v1/resources/solution_categories.d.ts +36 -0
  191. package/dist/v1/resources/solution_categories.d.ts.map +1 -0
  192. package/dist/v1/resources/solution_categories.js +55 -0
  193. package/dist/v1/resources/solution_categories.js.map +1 -0
  194. package/dist/v1/resources/solution_tags.d.ts +37 -0
  195. package/dist/v1/resources/solution_tags.d.ts.map +1 -0
  196. package/dist/v1/resources/solution_tags.js +54 -0
  197. package/dist/v1/resources/solution_tags.js.map +1 -0
  198. package/dist/v1/resources/solutions.d.ts +313 -0
  199. package/dist/v1/resources/solutions.d.ts.map +1 -0
  200. package/dist/v1/resources/solutions.js +218 -0
  201. package/dist/v1/resources/solutions.js.map +1 -0
  202. package/dist/v1/resources/team_memberships.d.ts +31 -0
  203. package/dist/v1/resources/team_memberships.d.ts.map +1 -1
  204. package/dist/v1/resources/team_memberships.js +49 -2
  205. package/dist/v1/resources/team_memberships.js.map +1 -1
  206. package/dist/v1/resources/teams.d.ts +461 -49
  207. package/dist/v1/resources/teams.d.ts.map +1 -1
  208. package/dist/v1/resources/teams.js +319 -27
  209. package/dist/v1/resources/teams.js.map +1 -1
  210. package/dist/v1/resources/thread_messages.d.ts +70 -0
  211. package/dist/v1/resources/thread_messages.d.ts.map +1 -1
  212. package/dist/v1/resources/thread_messages.js +85 -2
  213. package/dist/v1/resources/thread_messages.js.map +1 -1
  214. package/dist/v1/resources/threads.d.ts +221 -0
  215. package/dist/v1/resources/threads.d.ts.map +1 -1
  216. package/dist/v1/resources/threads.js +252 -4
  217. package/dist/v1/resources/threads.js.map +1 -1
  218. package/dist/v1/resources/users.d.ts +215 -39
  219. package/dist/v1/resources/users.d.ts.map +1 -1
  220. package/dist/v1/resources/users.js +121 -16
  221. package/dist/v1/resources/users.js.map +1 -1
  222. package/dist/v1.d.ts +26 -0
  223. package/dist/v1.d.ts.map +1 -1
  224. package/dist/v1.js +40 -1
  225. package/dist/v1.js.map +1 -1
  226. package/package.json +4 -2
  227. package/dist/types/agents.d.ts +0 -2084
  228. package/dist/types/agents.d.ts.map +0 -1
  229. package/dist/types/agents.js +0 -203
  230. package/dist/types/agents.js.map +0 -1
@@ -1,29 +1,141 @@
1
1
  // Copyright (c) 2026 ArchAstro Inc. All Rights Reserved.
2
2
  // This file is auto-generated by @archastro/sdk-generator. Do not edit.
3
- // Content hash: 864175271cd6
3
+ // Content hash: 17976ccf71fe
4
4
  export class AgentAgentComputerResource {
5
5
  http;
6
6
  constructor(http) {
7
7
  this.http = http;
8
8
  }
9
+ /**
10
+ * List computers
11
+ * Returns all computers belonging to the authenticated app, ordered by creation
12
+ * time descending. Pass `agent` to scope the results to a single agent's
13
+ * computers. When `agent` is omitted, computers for all agents in the app are
14
+ * returned.
15
+ * Requires an app-scoped API key. If the specified agent does not exist or does
16
+ * not belong to the app, the endpoint returns 404.
17
+ * @param agent - Agent ID (`agt_...`). When provided, only computers belonging to this agent are returned.
18
+ * @returns Object containing a `data` array of computer records.
19
+ */
9
20
  async list(agent) {
10
21
  return this.http.request(`/api/v1/agents/${agent}/agent_computers`);
11
22
  }
23
+ /**
24
+ * Provision a computer for an agent
25
+ * Creates and provisions a new computer resource associated with the specified
26
+ * agent. The computer is allocated in the requested region (defaulting to `iad`)
27
+ * and its status transitions from `provisioning` to `running` once it is ready.
28
+ * Requires an app-scoped API key. The agent identified by `agent` must belong
29
+ * to the same app. Supplying a `lookup_key` lets you retrieve this computer
30
+ * later without storing its ID — the key must be unique within the app.
31
+ * @param agent - Agent ID (`agt_...`). When provided, only computers belonging to this agent are returned.
32
+ * @param input - Request body.
33
+ * @param input.config - Provider-specific configuration for the computer. Supported keys vary by provider. A top-level `provider` takes precedence over `config.provider`.
34
+ * @param input.lookup_key - Stable, user-defined key for this computer. Must be unique within the app. Use it to look up the computer without storing its ID.
35
+ * @param input.metadata - Arbitrary key-value metadata to attach to the computer. Not interpreted by the platform; returned as-is on all subsequent reads.
36
+ * @param input.name - Human-readable display name for the computer.
37
+ * @param input.provider - Compute backend for the computer: `"sprites"` (Fly Sprites, the default) or `"vercel"` (Vercel Sandbox). Folded into `config.provider`.
38
+ * @param input.region - Region in which to provision the computer, e.g. `"iad"`. Defaults to `"iad"` when omitted.
39
+ * @returns The newly provisioned computer.
40
+ */
12
41
  async create(agent, input) {
13
42
  return this.http.request(`/api/v1/agents/${agent}/agent_computers`, { method: "POST", body: input });
14
43
  }
15
44
  }
45
+ export class AgentAgentEnvVarResource {
46
+ http;
47
+ constructor(http) {
48
+ this.http = http;
49
+ }
50
+ /**
51
+ * List an agent's environment variables
52
+ * Returns all environment variables defined for the specified agent. Variable
53
+ * values are always masked in the response; only the last four characters are
54
+ * visible. To inspect a specific variable, use the retrieve endpoint.
55
+ * The authenticated user must have access to the agent's parent app. Pass the
56
+ * app scope via the `app` parameter when calling with an API key that is scoped
57
+ * to a specific app. Results are returned in an unordered flat list.
58
+ * @param agent - Agent ID (`agt_...`). Returns environment variables belonging to this agent.
59
+ * @returns List of environment variables for the agent, with values masked.
60
+ */
61
+ async list(agent) {
62
+ return this.http.request(`/api/v1/agents/${agent}/agent_env_vars`);
63
+ }
64
+ /**
65
+ * Create an agent environment variable
66
+ * Creates a new environment variable for the specified agent. The variable is
67
+ * stored securely and the plaintext `value` is never returned after creation;
68
+ * subsequent reads return a masked representation showing only the last four
69
+ * characters.
70
+ * The authenticated user must have access to the agent's parent app. Pass the
71
+ * app scope via the `app` parameter when calling with an API key that is scoped
72
+ * to a specific app. Each `key` must be unique within the agent; attempting to
73
+ * create a duplicate key returns a validation error.
74
+ * @param agent - Agent ID (`agt_...`). Returns environment variables belonging to this agent.
75
+ * @param input - Request body.
76
+ * @param input.description - Optional human-readable note describing what the variable is used for.
77
+ * @param input.key - Environment variable name, e.g. `WEBHOOK_SECRET`. Must be unique within the agent.
78
+ * @param input.value - Plaintext secret value to store. The value is encrypted at rest and never returned in full.
79
+ * @returns The newly created environment variable with its value masked.
80
+ */
81
+ async create(agent, input) {
82
+ return this.http.request(`/api/v1/agents/${agent}/agent_env_vars`, { method: "POST", body: input });
83
+ }
84
+ }
16
85
  export class AgentAgentInstallationResource {
17
86
  http;
18
87
  constructor(http) {
19
88
  this.http = http;
20
89
  }
90
+ /**
91
+ * List installations for an agent
92
+ * Returns all installations belonging to the specified agent, across all kinds and
93
+ * states. Use this endpoint to inspect which external services and enablement channels
94
+ * an agent is connected to.
95
+ * Results are scoped to the authenticated app and are returned in an unordered array.
96
+ * To list installations across all agents in an app, use the top-level List
97
+ * Installations endpoint instead. The caller must have app scope for the app that
98
+ * owns the agent.
99
+ * @param agent - Agent ID (`agt_...`) whose installations you want to retrieve.
100
+ * @returns The list of installations for the specified agent.
101
+ */
21
102
  async list(agent) {
22
103
  return this.http.request(`/api/v1/agents/${agent}/agent_installations`);
23
104
  }
105
+ /**
106
+ * Create an installation
107
+ * Creates a new installation for an agent, connecting it to an external service or
108
+ * enablement channel via the specified `kind`. The installation begins in a pending
109
+ * state unless an integration is supplied at creation time, in which case it is
110
+ * activated immediately.
111
+ * Supply `shared_integration` to bind an existing org- or app-level integration, or
112
+ * supply `integration` to create a new integration inline and activate the installation
113
+ * in a single request. Supplying both fields returns 422.
114
+ * Use `lookup_key` to assign a stable identifier you can reference later in knowledge
115
+ * search `source_refs`. The key must be unique within the app, org, and sandbox
116
+ * combination. The caller must have app scope for the app that owns the agent.
117
+ * @param agent - Agent ID (`agt_...`) whose installations you want to retrieve.
118
+ * @param input - Request body.
119
+ * @param input.config - Kind-specific configuration object. Shape varies by `kind`; omit if the kind requires no initial configuration.
120
+ * @param input.integration - Inline integration fields to create for `integration/*` kinds. When provided, a new Integration record is created and the installation is activated immediately. Mutually exclusive with `shared_integration`.
121
+ * @param input.kind - Installation kind that determines the external service being connected. Examples: `"enablement/github_app"`, `"enablement/slack_bot"`, `"integration/github"`, `"integration/gmail"`, `"web/site"`. Use the List Kinds endpoint to retrieve all supported values.
122
+ * @param input.lookup_key - Stable identifier you assign to this installation. Propagated to backing context source rows so they can be referenced via knowledge search `source_refs`. Must contain only lowercase letters, numbers, underscores, or hyphens (max 100 characters). Must be unique within the same app, org, and sandbox combination. Omit to skip stable referencing.
123
+ * @param input.shared_integration - ID of an existing shared org- or app-level integration to bind to this installation. Mutually exclusive with `integration`.
124
+ * @returns The newly created installation.
125
+ */
24
126
  async create(agent, input) {
25
127
  return this.http.request(`/api/v1/agents/${agent}/agent_installations`, { method: "POST", body: input });
26
128
  }
129
+ /**
130
+ * List available installation kinds
131
+ * Returns the full catalogue of installation kinds supported by the platform. Use
132
+ * the returned `kind` values when calling the Create Installation endpoint.
133
+ * The list is platform-wide and does not vary by agent. The `agent` parameter is
134
+ * accepted for future per-agent filtering but is currently unused. The caller must
135
+ * have app scope to call this endpoint.
136
+ * @param agent - Agent ID (`agt_...`) whose installations you want to retrieve.
137
+ * @returns The list of all supported installation kinds.
138
+ */
27
139
  async kinds(agent) {
28
140
  return this.http.request(`/api/v1/agents/${agent}/agent_installations/kinds`);
29
141
  }
@@ -33,9 +145,59 @@ export class AgentAgentToolResource {
33
145
  constructor(http) {
34
146
  this.http = http;
35
147
  }
148
+ /**
149
+ * List agent tools
150
+ * Returns all tools for the authenticated app, optionally filtered by agent
151
+ * or tool kind. Both explicitly created tools and tools derived from connected
152
+ * integrations (installation-sourced tools) are included in the response.
153
+ * Installation-sourced tools appear with `source: "installation"` and
154
+ * `status: "active"`. They are synthesized at request time from connected
155
+ * integrations and do not have a persistent tool ID of the `atl_...` form;
156
+ * their `id` is a composite of the installation ID and server tool type.
157
+ * Use the `agent` filter to retrieve tools for a specific agent. Supplying an
158
+ * `agent` ID that does not belong to the authenticated app returns 404.
159
+ * Requires app scope.
160
+ * @param agent - Filter results to tools belonging to this agent (`agt_...`). Omit to return tools across all agents in the app.
161
+ * @param params - Query parameters.
162
+ * @param params.kind - Filter by tool kind. One of `"builtin"` or `"custom"`. Omit to return tools of all kinds.
163
+ * @returns List of tools matching the supplied filters.
164
+ */
36
165
  async list(agent, params) {
37
- return this.http.request(`/api/v1/agents/${agent}/agent_tools`, { query: params });
166
+ const query = {};
167
+ if (params?.kind !== undefined) {
168
+ query["kind"] = params?.kind;
169
+ }
170
+ return this.http.request(`/api/v1/agents/${agent}/agent_tools`, { query });
38
171
  }
172
+ /**
173
+ * Create an agent tool
174
+ * Creates a new tool and attaches it to the specified agent. Tools can be
175
+ * either `"builtin"` (a platform-provided capability identified by
176
+ * `builtin_tool_key`) or `"custom"` (a caller-defined tool with its own name,
177
+ * description, parameter schema, and handler).
178
+ * New tools are created in `"draft"` status by default unless `status:
179
+ * "active"` is explicitly supplied. Draft tools are not exposed to the LLM
180
+ * during agent runs; call the activate endpoint to promote them.
181
+ * For built-in tools that support multiple instances per agent (those whose
182
+ * catalog entry has a `multi_instance_mode`), supply `name_prefix` to
183
+ * namespace the LLM-facing tool names. Requires app scope.
184
+ * @param agent - Filter results to tools belonging to this agent (`agt_...`). Omit to return tools across all agents in the app.
185
+ * @param input - Request body.
186
+ * @param input.async - When `true`, the tool executes asynchronously and the agent does not block waiting for a result. Applies to `"custom"` tools.
187
+ * @param input.builtin_tool_config - Configuration object for the built-in tool. Shape is defined by the catalog entry's `config_schema` for the chosen `builtin_tool_key`. Applies only to `"builtin"` tools.
188
+ * @param input.builtin_tool_key - Key identifying the built-in tool type to add (e.g. `"knowledge_search"`). Required when `kind` is `"builtin"`. Must match a key in the tool catalog.
189
+ * @param input.config - Config ID (`cfg_...`) referencing the script or workflow graph that implements the tool handler. Applies to `"custom"` tools.
190
+ * @param input.description - Human-readable description of what the tool does. Shown to the LLM as context. Applies primarily to `"custom"` tools.
191
+ * @param input.handler_type - Execution handler for the tool. One of `"script"` or `"workflow_graph"`. Applies to `"custom"` tools.
192
+ * @param input.kind - Tool kind. One of `"builtin"` or `"custom"`.
193
+ * @param input.lookup_key - Optional stable identifier you can use to look up this tool without its ID. Must be unique within the app. Useful for idempotent provisioning.
194
+ * @param input.metadata - Arbitrary key-value metadata to attach to the tool. Not interpreted by the platform.
195
+ * @param input.name - Display name for the tool. Required when `kind` is `"custom"`.
196
+ * @param input.name_prefix - Per-instance namespace for built-in tools that support multiple instances per agent. Stamped onto LLM-facing tool names (e.g. `"org"` produces `"org_knowledge_search"`). Must match `^[a-z][a-z0-9_]*$` and be at most 24 characters. Required for `"namespaced"` multi-instance tools; omit for single-instance tools.
197
+ * @param input.parameters - JSON Schema object describing the tool's input parameters. Used by the LLM to construct valid tool calls. Applies to `"custom"` tools.
198
+ * @param input.status - Initial status of the tool. One of `"draft"` or `"active"`. Defaults to `"draft"` when omitted.
199
+ * @returns The newly created tool.
200
+ */
39
201
  async create(agent, input) {
40
202
  return this.http.request(`/api/v1/agents/${agent}/agent_tools`, { method: "POST", body: input });
41
203
  }
@@ -45,9 +207,36 @@ export class ScheduleResource {
45
207
  constructor(http) {
46
208
  this.http = http;
47
209
  }
210
+ /**
211
+ * List schedules for an agent
212
+ * Returns all schedules belonging to the specified agent in any status. Use the
213
+ * `status` parameter to narrow results to a single lifecycle state.
214
+ * Requires an app-scoped API key. The agent must belong to the app identified
215
+ * by the key.
216
+ * @param agent - Agent ID (`agi_...`). The agent whose schedules you want to retrieve.
217
+ * @param params - Query parameters.
218
+ * @param params.status - Filter results by schedule status. One of `"active"`, `"paused"`, `"completed"`, `"cancelled"`, or `"expired"`. Omit to return schedules in all statuses.
219
+ * @returns Successful response
220
+ */
48
221
  async list(agent, params) {
49
- return this.http.request(`/api/v1/agents/${agent}/schedules`, { query: params });
222
+ const query = {};
223
+ if (params?.status !== undefined) {
224
+ query["status"] = params?.status;
225
+ }
226
+ return this.http.request(`/api/v1/agents/${agent}/schedules`, { query });
50
227
  }
228
+ /**
229
+ * Retrieve a schedule
230
+ * Returns a single schedule belonging to the specified agent. Use this endpoint
231
+ * to fetch the current state, next run time, and configuration of an individual
232
+ * schedule.
233
+ * Requires an app-scoped API key. Both the agent and the schedule must belong
234
+ * to the app identified by the key. Returns 404 if the schedule does not exist
235
+ * or belongs to a different agent.
236
+ * @param agent - Agent ID (`agi_...`). The agent whose schedules you want to retrieve.
237
+ * @param schedule - Schedule ID (`asc_...`). The schedule to retrieve.
238
+ * @returns The requested agent schedule.
239
+ */
51
240
  async get(agent, schedule) {
52
241
  return this.http.request(`/api/v1/agents/${agent}/schedules/${schedule}`);
53
242
  }
@@ -55,52 +244,367 @@ export class ScheduleResource {
55
244
  export class AgentResource {
56
245
  http;
57
246
  agent_computers;
247
+ agent_env_vars;
58
248
  agent_installations;
59
249
  agent_tools;
60
250
  schedules;
61
251
  constructor(http) {
62
252
  this.http = http;
63
253
  this.agent_computers = new AgentAgentComputerResource(http);
254
+ this.agent_env_vars = new AgentAgentEnvVarResource(http);
64
255
  this.agent_installations = new AgentAgentInstallationResource(http);
65
256
  this.agent_tools = new AgentAgentToolResource(http);
66
257
  this.schedules = new ScheduleResource(http);
67
258
  }
259
+ /**
260
+ * List agents
261
+ * Returns a paginated list of agents visible to the authenticated caller. Results are
262
+ * ordered by creation time descending.
263
+ * Use `search` to filter by name, org, team, or owner fields. Use `user` or `org_id`
264
+ * to scope the list to a specific owner. Use `template_config` to find agents whose
265
+ * last applied template matches a given config ID. Use `solution_config` to find
266
+ * agents whose last applied template was imported as part of any of the given
267
+ * Solution config IDs.
268
+ * Pagination is page-based: pass `page` and `page_size` to navigate through large
269
+ * result sets. When called under a developer app scope, only agents belonging to that
270
+ * app are returned.
271
+ * @param params - Query parameters.
272
+ * @param params.page - Page number to retrieve, 1-indexed. Defaults to `1`.
273
+ * @param params.pageSize - Number of agents to return per page. Defaults to `25`.
274
+ * @param params.search - Free-text search string matched against the agent name, org, team, and owner fields.
275
+ * @param params.user - User ID (`usr_...`) to filter by. Returns only agents owned by this user.
276
+ * @param params.orgId - Organization ID (`org_...`) to filter by. Returns only agents owned by this org.
277
+ * @param params.templateConfig - Config ID (`cfg_...`) or `lookup_key` of an AgentTemplate. Returns only agents whose last applied template matches.
278
+ * @param params.solutionConfig - Solution config IDs (`cfg_...`) to filter by. Returns only agents whose last applied template was imported as part of any of the listed Solutions. Pass one or more IDs.
279
+ * @returns Paginated list of agents matching the supplied filters.
280
+ */
68
281
  async list(params) {
69
- return this.http.request(`/api/v1/agents`, { query: params });
282
+ const query = {};
283
+ if (params?.page !== undefined) {
284
+ query["page"] = params?.page;
285
+ }
286
+ if (params?.pageSize !== undefined) {
287
+ query["page_size"] = params?.pageSize;
288
+ }
289
+ if (params?.search !== undefined) {
290
+ query["search"] = params?.search;
291
+ }
292
+ if (params?.user !== undefined) {
293
+ query["user"] = params?.user;
294
+ }
295
+ if (params?.orgId !== undefined) {
296
+ query["org_id"] = params?.orgId;
297
+ }
298
+ if (params?.templateConfig !== undefined) {
299
+ query["template_config"] = params?.templateConfig;
300
+ }
301
+ if (params?.solutionConfig !== undefined) {
302
+ query["solution_config"] = params?.solutionConfig;
303
+ }
304
+ return this.http.request(`/api/v1/agents`, { query });
70
305
  }
306
+ /**
307
+ * Create an agent
308
+ * Creates a new agent. Supports two mutually exclusive provisioning modes.
309
+ * **Template mode** — pass `template` with the ID or `lookup_key` of an existing
310
+ * AgentTemplate config. The agent's tools, routines, skills, and installations are
311
+ * provisioned from that template's `config_ref` entries.
312
+ * **Bundle mode** — pass `template_bundle` with a self-contained install payload
313
+ * (AgentTemplate body plus every skill, script, and config it references). The entire
314
+ * bundle commits in a single transaction; any failure rolls back the whole install and
315
+ * the response includes `installed_configs[]` — one entry per persisted config.
316
+ * Pass exactly one of `template` or `template_bundle`. If neither is supplied, `name`
317
+ * is required and a blank agent is created. Requires authentication; when called under
318
+ * a developer app scope (`/developer/apps/:app/...`), the caller must hold the app scope
319
+ * for the target app.
320
+ * @param input - Request body.
321
+ * @param input.acl - Access control list controlling which users, teams, or orgs can read or manage this agent.
322
+ * @param input.email - Email address assigned to the agent. Used as the agent's contact identity.
323
+ * @param input.identity - System-prompt identity string describing who the agent is. Passed verbatim to the model on each conversation turn.
324
+ * @param input.lookup_key - Stable, unique slug used to look up this agent by name instead of ID. Must be unique within the owning app or org.
325
+ * @param input.metadata - Arbitrary key-value map stored on the agent. Not interpreted by the platform.
326
+ * @param input.model - Default AI model identifier for this agent, e.g. `claude-sonnet-4-5`. Overridden per-request when the caller specifies a model.
327
+ * @param input.name - Display name for the agent. Required when neither `template` nor `template_bundle` is provided.
328
+ * @param input.org - Organization ID (`org_...`) that should own this agent. Mutually exclusive with `team` and `user`.
329
+ * @param input.originator - Free-form label identifying the source or author of the agent, e.g. a user ID, a deploy pipeline, or a slug.
330
+ * @param input.phone_number - Phone number assigned to the agent in E.164 format, e.g. `+15550001234`.
331
+ * @param input.profile_picture - Profile picture to attach to the agent. All three subfields are required when this object is present.
332
+ * @param input.team - Team ID (`team_...`) that should own this agent. Mutually exclusive with `org` and `user`.
333
+ * @param input.template - ID (`cfg_...`) or `lookup_key` of an existing AgentTemplate config to provision from. Mutually exclusive with `template_bundle`.
334
+ * @param input.template_bundle - Self-contained install bundle containing an AgentTemplate plus all referenced skills and configs. The entire bundle is committed atomically. Mutually exclusive with `template`.
335
+ * @param input.user - User ID (`usr_...`) that should own this agent. Mutually exclusive with `org` and `team`.
336
+ * @returns The newly created agent. When `template_bundle` was supplied, the response also includes `installed_configs[]` — one entry per persisted config object, with `key` echoing the caller-supplied input identifier.
337
+ */
71
338
  async create(input) {
72
339
  return this.http.request(`/api/v1/agents`, { method: "POST", body: input });
73
340
  }
341
+ /**
342
+ * Delete an agent
343
+ * Permanently deletes an agent and all of its associated resources. This action cannot
344
+ * be undone.
345
+ * The authenticated caller must own the agent or hold sufficient permissions within its
346
+ * owning org or team. When called under a developer app scope, the caller must hold the
347
+ * app scope for the target app.
348
+ * @param agent - ID (`agi_...`) or `lookup_key` of the agent to delete.
349
+ * @returns Empty body. Returns HTTP 204 on success.
350
+ */
74
351
  async delete(agent) {
75
352
  await this.http.request(`/api/v1/agents/${agent}`, { method: "DELETE" });
76
353
  }
354
+ /**
355
+ * Retrieve an agent
356
+ * Returns the agent identified by ID or `lookup_key`. The authenticated caller must
357
+ * own the agent or hold sufficient permissions within its owning org or team.
358
+ * When called under a developer app scope, the agent must belong to that app. Use the
359
+ * list endpoint to retrieve many agents at once.
360
+ * @param agent - ID (`agi_...`) or `lookup_key` of the agent to retrieve.
361
+ * @returns The requested agent.
362
+ */
77
363
  async get(agent) {
78
364
  return this.http.request(`/api/v1/agents/${agent}`);
79
365
  }
366
+ /**
367
+ * Update an agent
368
+ * Updates one or more fields on an existing agent. Only the fields you supply are
369
+ * changed; omitted fields retain their current values.
370
+ * To clear the agent's default model, pass `model` as an empty string. The
371
+ * authenticated caller must own the agent or hold write permissions within its owning
372
+ * org or team. When called under a developer app scope, the caller must hold the app
373
+ * scope for the target app.
374
+ * @param agent - ID (`agi_...`) or `lookup_key` of the agent to update.
375
+ * @param input - Request body.
376
+ * @param input.acl - Replacement access control list. Fully replaces the existing ACL.
377
+ * @param input.email - New email address for the agent.
378
+ * @param input.identity - Replacement identity system-prompt string describing who the agent is.
379
+ * @param input.lookup_key - New `lookup_key` slug. Must be unique within the owning app or org.
380
+ * @param input.metadata - Replacement key-value metadata map. The entire map is replaced, not merged.
381
+ * @param input.model - New default AI model identifier, e.g. `claude-sonnet-4-5`. Pass an empty string to clear the agent's default model.
382
+ * @param input.name - New display name for the agent.
383
+ * @param input.org - Organization ID (`org_...`) to transfer ownership to.
384
+ * @param input.originator - Replacement originator label identifying the source or author of the agent.
385
+ * @param input.phone_number - New phone number for the agent in E.164 format, e.g. `+15550001234`.
386
+ * @param input.profile_picture - Replacement profile picture. All three subfields are required when this object is present.
387
+ * @param input.team - Team ID (`team_...`) to transfer ownership to.
388
+ * @param input.user - User ID (`usr_...`) to transfer ownership to.
389
+ * @returns The updated agent with all current field values.
390
+ */
80
391
  async update(agent, input) {
81
392
  return this.http.request(`/api/v1/agents/${agent}`, { method: "PATCH", body: input });
82
393
  }
394
+ /**
395
+ * List health actions for an agent
396
+ * Returns all health actions associated with a given agent. Health actions
397
+ * represent required or recommended steps — such as setting environment
398
+ * variables, completing OAuth installations, or running custom verifiers —
399
+ * that an agent needs to reach a healthy state.
400
+ * Results are not paginated; the full list for the agent is returned. Use
401
+ * the `source`, `status`, and `kind` filters to narrow results to the
402
+ * subset your UI or workflow needs. Multiple values for the same filter
403
+ * are treated as OR (e.g. passing two statuses returns actions matching
404
+ * either). The caller must be authenticated and scoped to the app that
405
+ * owns the agent.
406
+ * @param agent - Agent ID (`agt_...`) or lookup key of the agent whose health actions you want to list.
407
+ * @param params - Query parameters.
408
+ * @param params.source - Filter results to actions from one or more lifecycle stages. Accepted values: `"setup"` (actions created during agent installation) and `"health"` (ongoing health checks). Omit to return actions from all stages.
409
+ * @param params.status - Filter results to actions in one or more statuses. Accepted values: `"pending"`, `"completed"`, `"skipped"`, and `"degraded"`. Omit to return actions in all statuses.
410
+ * @param params.kind - Filter results to actions of one or more kinds. Accepted values: `"env_var"` (a required secret or config value), `"install"` (an OAuth or integration install step), and `"custom"` (a platform-defined check). Omit to return all kinds.
411
+ * @returns Object containing a `data` array of health action objects for the specified agent.
412
+ */
413
+ async agentHealthActions(agent, params) {
414
+ const query = {};
415
+ if (params?.source !== undefined) {
416
+ query["source"] = params?.source;
417
+ }
418
+ if (params?.status !== undefined) {
419
+ query["status"] = params?.status;
420
+ }
421
+ if (params?.kind !== undefined) {
422
+ query["kind"] = params?.kind;
423
+ }
424
+ return this.http.request(`/api/v1/agents/${agent}/agent_health_actions`, { query });
425
+ }
426
+ /**
427
+ * Create a routine
428
+ * Creates a new routine and attaches it to the specified agent. Routines define
429
+ * how an agent responds to events or a cron schedule; the `handler_type` controls
430
+ * which execution model is used.
431
+ * The routine is created in `"draft"` status by default. To start processing
432
+ * events immediately, either pass `status: "active"` or call the activate
433
+ * endpoint after creation. Scheduled routines must run no more frequently than
434
+ * once per hour. Requires app scope.
435
+ * @param agent - Agent ID (`agt_...`) that this routine will be attached to.
436
+ * @param input - Request body.
437
+ * @param input.acl - Access control list governing who can read or manage this routine.
438
+ * @param input.config - Workflow config ID (`cfg_...`). Required when `handler_type` is `"workflow_graph"`.
439
+ * @param input.description - Optional human-readable description of what this routine does.
440
+ * @param input.event_config - Mapping of event types to trigger configuration. Each key is an event type string; each value is an object with a `"filters"` map and an optional `"dedupe_key_path"` (a JSON path used to deduplicate events, e.g. `"$.thread.id"`).
441
+ * @param input.event_type - Event type that triggers this routine. Deprecated — use `event_config` instead.
442
+ * @param input.handler_type - Execution model for this routine. One of `"workflow_graph"`, `"script"`, `"preset"`, or `"chain"`.
443
+ * @param input.lookup_key - Stable, unique key you assign to this routine for deterministic lookup. Must be unique within the app.
444
+ * @param input.metadata - Arbitrary key-value metadata you can attach to the routine. Not interpreted by the platform.
445
+ * @param input.name - Human-readable display name for the routine.
446
+ * @param input.preset_config - Configuration passed to the preset at runtime. Used when `handler_type` is `"preset"`.
447
+ * @param input.preset_name - Name of the registered preset to use. Required when `handler_type` is `"preset"`.
448
+ * @param input.schedule - Cron expression for time-triggered routines (e.g. `"0 9 * * 1"`). Must not be more frequent than once per hour.
449
+ * @param input.script - Inline script source. Required when `handler_type` is `"script"`.
450
+ * @param input.status - Initial lifecycle status. One of `"draft"` or `"active"`. Defaults to `"draft"`.
451
+ * @param input.steps - Ordered list of steps for a chain handler. Required when `handler_type` is `"chain"`; must be omitted or empty otherwise. Each step must have exactly one handler body field (`preset_name`, `script`, or `config`) matching that step's `handler_type`.
452
+ * @param input.trigger_context - Context in which the routine is triggered. One of `"chat_session"` or `"event"`. Defaults to `"event"`.
453
+ * @returns The newly created routine.
454
+ */
83
455
  async agentRoutines(agent, input) {
84
456
  return this.http.request(`/api/v1/agents/${agent}/agent_routines`, { method: "POST", body: input });
85
457
  }
458
+ /**
459
+ * List working memory entries for an agent
460
+ * Returns a paginated list of working memory entries belonging to the specified
461
+ * agent. Entries are key-value pairs the agent stores for context between
462
+ * interactions. Results are ordered by creation time descending (newest first)
463
+ * and can be filtered with a substring search against the key name.
464
+ * Requires an app-scoped API key. The authenticated caller must have access to
465
+ * the app the agent belongs to. Returns 403 if the key is not app-scoped, and
466
+ * 404 if the agent does not exist within the accessible scope.
467
+ * @param agent - Agent ID (`agt_...`) whose working memory entries to retrieve.
468
+ * @param params - Query parameters.
469
+ * @param params.page - Page number to retrieve, starting at 1. Defaults to 1.
470
+ * @param params.pageSize - Number of entries to return per page. Defaults to 25.
471
+ * @param params.search - Substring filter applied to entry keys (case-insensitive). Omit to return all keys.
472
+ * @returns Paginated list of working memory entries for the agent.
473
+ */
86
474
  async agentWorkingMemory(agent, params) {
87
- return this.http.request(`/api/v1/agents/${agent}/agent_working_memory`, { query: params });
475
+ const query = {};
476
+ if (params?.page !== undefined) {
477
+ query["page"] = params?.page;
478
+ }
479
+ if (params?.pageSize !== undefined) {
480
+ query["page_size"] = params?.pageSize;
481
+ }
482
+ if (params?.search !== undefined) {
483
+ query["search"] = params?.search;
484
+ }
485
+ return this.http.request(`/api/v1/agents/${agent}/agent_working_memory`, { query });
486
+ }
487
+ /**
488
+ * Export an agent as an AgentTemplate
489
+ * Reconstructs an AgentTemplate config from a deployed agent and all of its
490
+ * sub-resources (tools, routines, skills, installations). Returns the template
491
+ * definition together with every dependent config file (scripts, workflows, skills,
492
+ * schemas) and their raw content, producing a fully self-contained export bundle.
493
+ * Use this endpoint to snapshot an agent's current configuration for backup,
494
+ * migration, or to seed a new Solution template. Pass `remove_identity: true` to
495
+ * strip instance-specific fields (email, phone number) before export.
496
+ * The authenticated caller must own the agent or hold sufficient permissions within
497
+ * its owning org or team. When called under a developer app scope, the caller must
498
+ * hold the app scope for the target app.
499
+ * @param agent - ID (`agi_...`) or `lookup_key` of the agent to export.
500
+ * @param params - Query parameters.
501
+ * @param params.removeIdentity - When `true`, strips instance-unique identity fields (`email`, `phone_number`) from the exported template so it can be reused as a generic blueprint.
502
+ * @returns Export bundle containing the reconstructed AgentTemplate and all dependent config files with their raw content.
503
+ */
504
+ async export(agent, params) {
505
+ const query = {};
506
+ if (params?.removeIdentity !== undefined) {
507
+ query["remove_identity"] = params?.removeIdentity;
508
+ }
509
+ return this.http.request(`/api/v1/agents/${agent}/export`, { query });
88
510
  }
89
511
  /**
90
- * Export agent as AgentTemplate
91
- * Reconstructs an AgentTemplate config from a deployed agent and its sub-resources
92
- * (tools, routines, skills, installations). Returns the template plus all dependent
93
- * config files (scripts, workflows, skills, schemas) with their raw content for a
94
- * fully self-contained export.
512
+ * Retrieve an agent's health profile
513
+ * Returns an aggregate health profile for the specified agent, including an overall
514
+ * status, a numeric health score, recent activity metrics, and a list of recommended
515
+ * remediation actions.
516
+ * The health check is computed on demand at request time. The `checked_at` timestamp
517
+ * in the response reflects when the evaluation ran. Use this endpoint to surface
518
+ * diagnostics about tool availability, model configuration, and runtime activity in
519
+ * dashboards or monitoring workflows.
520
+ * The authenticated caller must own the agent or hold sufficient permissions within
521
+ * its owning org or team. When called under a developer app scope, the caller must
522
+ * hold the app scope for the target app.
523
+ * @param agent - ID (`agi_...`) or `lookup_key` of the agent to evaluate.
524
+ * @returns Aggregate health profile for the agent, including status, score, activity metrics, and recommended actions.
95
525
  */
96
- async export(agent) {
97
- return this.http.request(`/api/v1/agents/${agent}/export`);
526
+ async health(agent) {
527
+ return this.http.request(`/api/v1/agents/${agent}/health`);
98
528
  }
529
+ /**
530
+ * Search an agent's knowledge base
531
+ * Performs a semantic search over an agent's knowledge base and returns a ranked,
532
+ * `kind`-discriminated list of matching items.
533
+ * Two item kinds may appear in `data`:
534
+ * - `"chunk"` — chunk-level results from the agent's context store. Present for all agents.
535
+ * - `"document"` — document-level results. Present only when the agent has an active
536
+ * `archastro/knowledge` installation.
537
+ * Results from both kinds are scored with Reciprocal Rank Fusion (RRF), normalized to
538
+ * be comparable across kinds, then merged into a single ranked list. On a relevance tie,
539
+ * chunks appear before documents. The total number of results is capped at `max_results`
540
+ * across both kinds.
541
+ * Use `mode` to choose the retrieval strategy: `"hybrid"` (default) combines vector and
542
+ * full-text search; `"vector"` and `"fulltext"` select each strategy independently.
543
+ * @param agent - ID (`agi_...`) or `lookup_key` of the agent whose knowledge base to search.
544
+ * @param input - Request body.
545
+ * @param input.max_results - Maximum total results to return across all kinds. Chunks and documents are ranked together and the list is capped at this value. Defaults to `20`; maximum is `100`.
546
+ * @param input.mode - Retrieval strategy. One of `"hybrid"` (default), `"vector"`, or `"fulltext"`.
547
+ * @param input.query - Natural-language search query used to retrieve relevant knowledge items.
548
+ * @param input.recency_days - When set, restricts results to items indexed within the last N days.
549
+ * @param input.source_types - Array of source-type slugs used to filter chunk results, e.g. `["web", "file"]`. Omit to include all source types.
550
+ * @returns Successful response
551
+ */
99
552
  async search(agent, input) {
100
553
  return this.http.request(`/api/v1/agents/${agent}/search`, { method: "POST", body: input });
101
554
  }
555
+ /**
556
+ * Create a thread for an agent
557
+ * Creates a new thread owned by the specified agent. The thread is scoped to the
558
+ * agent's identity and is immediately available for messaging.
559
+ * The authenticated caller must have access to the agent's parent app. If your
560
+ * API key is scoped to a specific app, pass that app's ID via the `app` parameter.
561
+ * Attempting to create a thread for an agent you cannot access returns 404.
562
+ * By default the platform may send an automatic welcome message into the new
563
+ * thread. Pass `skip_welcome_message: true` to suppress this behavior.
564
+ * @param agent - Agent ID (`agt_...`). The thread will be owned by this agent.
565
+ * @param input - Request body.
566
+ * @param input.skip_welcome_message - When `true`, suppresses the automatic welcome message that the platform sends when a new thread is created. Defaults to `false`.
567
+ * @param input.thread - Attributes for the new thread.
568
+ * @returns The newly created thread.
569
+ */
102
570
  async threads(agent, input) {
103
571
  return this.http.request(`/api/v1/agents/${agent}/threads`, { method: "POST", body: input });
104
572
  }
573
+ /**
574
+ * Upgrade an agent from an AgentTemplate
575
+ * Upgrades an existing agent by reconciling it against an AgentTemplate from a
576
+ * Solution. Supports two modes:
577
+ * - `"reapply"` (default) — re-applies the agent's currently tracked template,
578
+ * picking up any changes the template author has made since the last apply.
579
+ * - `"replace"` — moves the agent to a different template. `template` is required
580
+ * in this mode.
581
+ * Set `dry_run: true` to compute and return the full upgrade diff (adds, updates,
582
+ * removes, noops) without writing any changes. The response includes a
583
+ * `review_fingerprint` you can pass back via `expected_review_fingerprint` on the
584
+ * live apply to guard against the diff changing between review and execution.
585
+ * Safe overrides (`name`, `email`, `phone_number`, `metadata`, `identity`,
586
+ * `originator`, `model`) let you pin instance-specific values that should not be
587
+ * overwritten by the template during the upgrade.
588
+ * The authenticated caller must own the agent or hold write permissions within its
589
+ * owning org or team. When called under a developer app scope, the caller must hold
590
+ * the app scope for the target app.
591
+ * @param agent - ID (`agi_...`) or `lookup_key` of the agent to upgrade.
592
+ * @param input - Request body.
593
+ * @param input.dry_run - When `true`, computes and returns the full upgrade diff without persisting any changes. Use with `expected_review_fingerprint` to guard the live apply.
594
+ * @param input.email - Instance-specific email address override. Pins this value so the template upgrade does not overwrite it.
595
+ * @param input.expected_review_fingerprint - Stale-review guard. Pass the `review_fingerprint` returned by a prior `dry_run` response to ensure the diff has not changed between review and live apply. Returns an error if the fingerprint no longer matches.
596
+ * @param input.identity - Instance-specific identity system-prompt override. Pins this value so the template upgrade does not overwrite it.
597
+ * @param input.metadata - Instance-specific metadata override. Pins this value so the template upgrade does not overwrite it.
598
+ * @param input.mode - Upgrade mode. `"reapply"` (default) refreshes the agent's tracked template; `"replace"` moves the agent to a different template (requires `template`).
599
+ * @param input.model - Instance-specific default model override. Pins this value so the template upgrade does not overwrite it. Pass an empty string to clear the model.
600
+ * @param input.name - Instance-specific name override. Pins this value so the template upgrade does not overwrite it.
601
+ * @param input.originator - Instance-specific originator label override. Pins this value so the template upgrade does not overwrite it.
602
+ * @param input.phone_number - Instance-specific phone number override in E.164 format. Pins this value so the template upgrade does not overwrite it.
603
+ * @param input.template - ID (`cfg_...`) or `lookup_key` of the target AgentTemplate config. Optional in `"reapply"` mode; required in `"replace"` mode.
604
+ * @returns The upgrade outcome, including the updated agent, the source Solution and template summaries, and the full diff (`upgrade_result`) with status, dry-run flag, aggregate counts, and a per-resource change list. When `dry_run` is `true`, `agent` is `null` and no changes are persisted.
605
+ */
606
+ async upgrade(agent, input) {
607
+ return this.http.request(`/api/v1/agents/${agent}/upgrade`, { method: "POST", body: input });
608
+ }
105
609
  }
106
610
  //# sourceMappingURL=agents.js.map