@archastro/sdk 0.5.0 → 0.5.3

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 (242) 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/client.d.ts +26 -0
  7. package/dist/client.d.ts.map +1 -1
  8. package/dist/client.js +27 -1
  9. package/dist/client.js.map +1 -1
  10. package/dist/index.d.ts +1 -1
  11. package/dist/index.d.ts.map +1 -1
  12. package/dist/index.js +2 -2
  13. package/dist/index.js.map +1 -1
  14. package/dist/types/ai.d.ts +150 -12
  15. package/dist/types/ai.d.ts.map +1 -1
  16. package/dist/types/ai.js +71 -41
  17. package/dist/types/ai.js.map +1 -1
  18. package/dist/types/artifacts.d.ts +81 -24
  19. package/dist/types/artifacts.d.ts.map +1 -1
  20. package/dist/types/artifacts.js +39 -21
  21. package/dist/types/artifacts.js.map +1 -1
  22. package/dist/types/automations.d.ts +41 -9
  23. package/dist/types/automations.d.ts.map +1 -1
  24. package/dist/types/automations.js +25 -17
  25. package/dist/types/automations.js.map +1 -1
  26. package/dist/types/chat.d.ts +21185 -39
  27. package/dist/types/chat.d.ts.map +1 -1
  28. package/dist/types/chat.js +64 -8
  29. package/dist/types/chat.js.map +1 -1
  30. package/dist/types/common.d.ts +16970 -2136
  31. package/dist/types/common.d.ts.map +1 -1
  32. package/dist/types/common.js +1695 -332
  33. package/dist/types/common.js.map +1 -1
  34. package/dist/types/config.d.ts +239 -31
  35. package/dist/types/config.d.ts.map +1 -1
  36. package/dist/types/config.js +86 -34
  37. package/dist/types/config.js.map +1 -1
  38. package/dist/types/image.d.ts +27 -4
  39. package/dist/types/image.d.ts.map +1 -1
  40. package/dist/types/image.js +17 -10
  41. package/dist/types/image.js.map +1 -1
  42. package/dist/types/index.d.ts +2 -1
  43. package/dist/types/index.d.ts.map +1 -1
  44. package/dist/types/index.js +3 -2
  45. package/dist/types/index.js.map +1 -1
  46. package/dist/types/invites.d.ts +20 -11
  47. package/dist/types/invites.d.ts.map +1 -1
  48. package/dist/types/invites.js +9 -12
  49. package/dist/types/invites.js.map +1 -1
  50. package/dist/types/notifications.d.ts +163 -0
  51. package/dist/types/notifications.d.ts.map +1 -0
  52. package/dist/types/notifications.js +44 -0
  53. package/dist/types/notifications.js.map +1 -0
  54. package/dist/types/teams.d.ts +1628 -231
  55. package/dist/types/teams.d.ts.map +1 -1
  56. package/dist/types/teams.js +76 -45
  57. package/dist/types/teams.js.map +1 -1
  58. package/dist/types/threads.d.ts +997 -243
  59. package/dist/types/threads.d.ts.map +1 -1
  60. package/dist/types/threads.js +84 -51
  61. package/dist/types/threads.js.map +1 -1
  62. package/dist/types/users.d.ts +98 -18
  63. package/dist/types/users.d.ts.map +1 -1
  64. package/dist/types/users.js +43 -18
  65. package/dist/types/users.js.map +1 -1
  66. package/dist/v1/resources/activity_feed.d.ts +89 -0
  67. package/dist/v1/resources/activity_feed.d.ts.map +1 -1
  68. package/dist/v1/resources/activity_feed.js +56 -2
  69. package/dist/v1/resources/activity_feed.js.map +1 -1
  70. package/dist/v1/resources/agent_computers.d.ts +48 -2
  71. package/dist/v1/resources/agent_computers.d.ts.map +1 -1
  72. package/dist/v1/resources/agent_computers.js +48 -1
  73. package/dist/v1/resources/agent_computers.js.map +1 -1
  74. package/dist/v1/resources/agent_env_vars.d.ts +50 -0
  75. package/dist/v1/resources/agent_env_vars.d.ts.map +1 -0
  76. package/dist/v1/resources/agent_env_vars.js +56 -0
  77. package/dist/v1/resources/agent_env_vars.js.map +1 -0
  78. package/dist/v1/resources/agent_health_actions.d.ts +43 -0
  79. package/dist/v1/resources/agent_health_actions.d.ts.map +1 -0
  80. package/dist/v1/resources/agent_health_actions.js +50 -0
  81. package/dist/v1/resources/agent_health_actions.js.map +1 -0
  82. package/dist/v1/resources/agent_installations.d.ts +100 -0
  83. package/dist/v1/resources/agent_installations.d.ts.map +1 -1
  84. package/dist/v1/resources/agent_installations.js +106 -2
  85. package/dist/v1/resources/agent_installations.js.map +1 -1
  86. package/dist/v1/resources/agent_routine_runs.d.ts +33 -0
  87. package/dist/v1/resources/agent_routine_runs.d.ts.map +1 -0
  88. package/dist/v1/resources/agent_routine_runs.js +48 -0
  89. package/dist/v1/resources/agent_routine_runs.js.map +1 -0
  90. package/dist/v1/resources/agent_routines.d.ts +148 -2
  91. package/dist/v1/resources/agent_routines.d.ts.map +1 -1
  92. package/dist/v1/resources/agent_routines.js +168 -3
  93. package/dist/v1/resources/agent_routines.js.map +1 -1
  94. package/dist/v1/resources/agent_sessions.d.ts +118 -1
  95. package/dist/v1/resources/agent_sessions.d.ts.map +1 -1
  96. package/dist/v1/resources/agent_sessions.js +134 -2
  97. package/dist/v1/resources/agent_sessions.js.map +1 -1
  98. package/dist/v1/resources/agent_skills.d.ts +83 -1
  99. package/dist/v1/resources/agent_skills.d.ts.map +1 -1
  100. package/dist/v1/resources/agent_skills.js +87 -2
  101. package/dist/v1/resources/agent_skills.js.map +1 -1
  102. package/dist/v1/resources/agent_tools.d.ts +109 -2
  103. package/dist/v1/resources/agent_tools.d.ts.map +1 -1
  104. package/dist/v1/resources/agent_tools.js +114 -2
  105. package/dist/v1/resources/agent_tools.js.map +1 -1
  106. package/dist/v1/resources/agents.d.ts +517 -9
  107. package/dist/v1/resources/agents.d.ts.map +1 -1
  108. package/dist/v1/resources/agents.js +515 -12
  109. package/dist/v1/resources/agents.js.map +1 -1
  110. package/dist/v1/resources/ai.d.ts +93 -0
  111. package/dist/v1/resources/ai.d.ts.map +1 -1
  112. package/dist/v1/resources/ai.js +89 -1
  113. package/dist/v1/resources/ai.js.map +1 -1
  114. package/dist/v1/resources/artifacts.d.ts +73 -0
  115. package/dist/v1/resources/artifacts.d.ts.map +1 -1
  116. package/dist/v1/resources/artifacts.js +74 -2
  117. package/dist/v1/resources/artifacts.js.map +1 -1
  118. package/dist/v1/resources/automation_runs.d.ts +8 -4
  119. package/dist/v1/resources/automation_runs.d.ts.map +1 -1
  120. package/dist/v1/resources/automation_runs.js +9 -5
  121. package/dist/v1/resources/automation_runs.js.map +1 -1
  122. package/dist/v1/resources/automations.d.ts +20 -0
  123. package/dist/v1/resources/automations.d.ts.map +1 -1
  124. package/dist/v1/resources/automations.js +21 -1
  125. package/dist/v1/resources/automations.js.map +1 -1
  126. package/dist/v1/resources/bug_reports.d.ts +29 -0
  127. package/dist/v1/resources/bug_reports.d.ts.map +1 -0
  128. package/dist/v1/resources/bug_reports.js +29 -0
  129. package/dist/v1/resources/bug_reports.js.map +1 -0
  130. package/dist/v1/resources/config.d.ts +429 -4
  131. package/dist/v1/resources/config.d.ts.map +1 -1
  132. package/dist/v1/resources/config.js +493 -9
  133. package/dist/v1/resources/config.js.map +1 -1
  134. package/dist/v1/resources/custom_objects.d.ts +117 -2
  135. package/dist/v1/resources/custom_objects.d.ts.map +1 -1
  136. package/dist/v1/resources/custom_objects.js +132 -3
  137. package/dist/v1/resources/custom_objects.js.map +1 -1
  138. package/dist/v1/resources/files.d.ts +62 -0
  139. package/dist/v1/resources/files.d.ts.map +1 -0
  140. package/dist/v1/resources/files.js +58 -0
  141. package/dist/v1/resources/files.js.map +1 -0
  142. package/dist/v1/resources/index.d.ts +13 -0
  143. package/dist/v1/resources/index.d.ts.map +1 -1
  144. package/dist/v1/resources/index.js +14 -1
  145. package/dist/v1/resources/index.js.map +1 -1
  146. package/dist/v1/resources/installation_sources.d.ts +12 -0
  147. package/dist/v1/resources/installation_sources.d.ts.map +1 -1
  148. package/dist/v1/resources/installation_sources.js +13 -1
  149. package/dist/v1/resources/installation_sources.js.map +1 -1
  150. package/dist/v1/resources/invites.d.ts +15 -0
  151. package/dist/v1/resources/invites.d.ts.map +1 -1
  152. package/dist/v1/resources/invites.js +16 -1
  153. package/dist/v1/resources/invites.js.map +1 -1
  154. package/dist/v1/resources/knowledge_documents.d.ts +104 -0
  155. package/dist/v1/resources/knowledge_documents.d.ts.map +1 -0
  156. package/dist/v1/resources/knowledge_documents.js +112 -0
  157. package/dist/v1/resources/knowledge_documents.js.map +1 -0
  158. package/dist/v1/resources/knowledge_sources.d.ts +190 -0
  159. package/dist/v1/resources/knowledge_sources.d.ts.map +1 -0
  160. package/dist/v1/resources/knowledge_sources.js +176 -0
  161. package/dist/v1/resources/knowledge_sources.js.map +1 -0
  162. package/dist/v1/resources/kv.d.ts +73 -0
  163. package/dist/v1/resources/kv.d.ts.map +1 -1
  164. package/dist/v1/resources/kv.js +96 -3
  165. package/dist/v1/resources/kv.js.map +1 -1
  166. package/dist/v1/resources/notification_preferences.d.ts +61 -0
  167. package/dist/v1/resources/notification_preferences.d.ts.map +1 -0
  168. package/dist/v1/resources/notification_preferences.js +65 -0
  169. package/dist/v1/resources/notification_preferences.js.map +1 -0
  170. package/dist/v1/resources/notifications.d.ts +133 -0
  171. package/dist/v1/resources/notifications.d.ts.map +1 -0
  172. package/dist/v1/resources/notifications.js +136 -0
  173. package/dist/v1/resources/notifications.js.map +1 -0
  174. package/dist/v1/resources/orgs.d.ts +18 -0
  175. package/dist/v1/resources/orgs.d.ts.map +1 -1
  176. package/dist/v1/resources/orgs.js +30 -2
  177. package/dist/v1/resources/orgs.js.map +1 -1
  178. package/dist/v1/resources/slack_channel_bindings.d.ts +101 -0
  179. package/dist/v1/resources/slack_channel_bindings.d.ts.map +1 -0
  180. package/dist/v1/resources/slack_channel_bindings.js +114 -0
  181. package/dist/v1/resources/slack_channel_bindings.js.map +1 -0
  182. package/dist/v1/resources/solution_categories.d.ts +36 -0
  183. package/dist/v1/resources/solution_categories.d.ts.map +1 -0
  184. package/dist/v1/resources/solution_categories.js +55 -0
  185. package/dist/v1/resources/solution_categories.js.map +1 -0
  186. package/dist/v1/resources/solution_tags.d.ts +37 -0
  187. package/dist/v1/resources/solution_tags.d.ts.map +1 -0
  188. package/dist/v1/resources/solution_tags.js +54 -0
  189. package/dist/v1/resources/solution_tags.js.map +1 -0
  190. package/dist/v1/resources/solutions.d.ts +309 -0
  191. package/dist/v1/resources/solutions.d.ts.map +1 -0
  192. package/dist/v1/resources/solutions.js +214 -0
  193. package/dist/v1/resources/solutions.js.map +1 -0
  194. package/dist/v1/resources/team_memberships.d.ts +31 -0
  195. package/dist/v1/resources/team_memberships.d.ts.map +1 -1
  196. package/dist/v1/resources/team_memberships.js +49 -2
  197. package/dist/v1/resources/team_memberships.js.map +1 -1
  198. package/dist/v1/resources/teams.d.ts +458 -49
  199. package/dist/v1/resources/teams.d.ts.map +1 -1
  200. package/dist/v1/resources/teams.js +319 -27
  201. package/dist/v1/resources/teams.js.map +1 -1
  202. package/dist/v1/resources/thread_messages.d.ts +70 -0
  203. package/dist/v1/resources/thread_messages.d.ts.map +1 -1
  204. package/dist/v1/resources/thread_messages.js +85 -2
  205. package/dist/v1/resources/thread_messages.js.map +1 -1
  206. package/dist/v1/resources/threads.d.ts +201 -0
  207. package/dist/v1/resources/threads.d.ts.map +1 -1
  208. package/dist/v1/resources/threads.js +220 -4
  209. package/dist/v1/resources/threads.js.map +1 -1
  210. package/dist/v1/resources/users.d.ts +213 -39
  211. package/dist/v1/resources/users.d.ts.map +1 -1
  212. package/dist/v1/resources/users.js +121 -16
  213. package/dist/v1/resources/users.js.map +1 -1
  214. package/dist/v1.d.ts +26 -0
  215. package/dist/v1.d.ts.map +1 -1
  216. package/dist/v1.js +40 -1
  217. package/dist/v1.js.map +1 -1
  218. package/package.json +4 -2
  219. package/dist/types/agents.d.ts +0 -2084
  220. package/dist/types/agents.d.ts.map +0 -1
  221. package/dist/types/agents.js +0 -203
  222. package/dist/types/agents.js.map +0 -1
  223. package/dist/types/members.d.ts +0 -99
  224. package/dist/types/members.d.ts.map +0 -1
  225. package/dist/types/members.js +0 -36
  226. package/dist/types/members.js.map +0 -1
  227. package/dist/types/orgs.d.ts +0 -193
  228. package/dist/types/orgs.d.ts.map +0 -1
  229. package/dist/types/orgs.js +0 -69
  230. package/dist/types/orgs.js.map +0 -1
  231. package/dist/types/reactions.d.ts +0 -29
  232. package/dist/types/reactions.d.ts.map +0 -1
  233. package/dist/types/reactions.js +0 -15
  234. package/dist/types/reactions.js.map +0 -1
  235. package/dist/types/schedules.d.ts +0 -32
  236. package/dist/types/schedules.d.ts.map +0 -1
  237. package/dist/types/schedules.js +0 -16
  238. package/dist/types/schedules.js.map +0 -1
  239. package/dist/types/system.d.ts +0 -23
  240. package/dist/types/system.d.ts.map +0 -1
  241. package/dist/types/system.js +0 -13
  242. package/dist/types/system.js.map +0 -1
@@ -0,0 +1,309 @@
1
+ import { HttpClient } from "../../runtime/http-client.js";
2
+ import type { SolutionDependentsResponse, SolutionImportResponse, SolutionInstallResponse, SolutionListResponse, SolutionSummary, SolutionUpgradeResponse } from "../../types/common.js";
3
+ export declare class SolutionResource {
4
+ private http;
5
+ constructor(http: HttpClient);
6
+ /**
7
+ * List Solutions
8
+ * Returns a paginated list of Solutions visible to the authenticated caller,
9
+ * merging two scopes: app-level Solutions (system-owned rows with no org
10
+ * affiliation, visible to all authenticated viewers in the app) and org-level
11
+ * Solutions (system-owned rows stamped with the viewer's org ID, included when
12
+ * the viewer carries an org context).
13
+ * Solutions that appear under both scopes are deduplicated by their stable
14
+ * `solution_id` value. The merged entry's `owners` array lists every scope the
15
+ * Solution was found under (`"system"` and/or `"org"`). When the app-level copy
16
+ * has a higher `solution_version` than the org-level copy, the response includes
17
+ * `upgrade_available: true` and `latest_version` so callers can prompt for an
18
+ * upgrade.
19
+ * @param params - Query parameters.
20
+ * @param params.page - Page number to return. Defaults to `1`.
21
+ * @param params.pageSize - Number of Solutions per page. Defaults to `25`.
22
+ * @param params.lookupKey - Filter to the Solution whose `lookup_key` matches exactly.
23
+ * @param params.pathPrefix - Filter to Solutions whose `virtual_path` starts with this prefix.
24
+ * @param params.owners - Restrict results to a subset of owner scopes. Accepted values: `"system"` (app-level Solutions) and `"org"` (viewer's org-level Solutions). Omit to include all scopes the viewer can see.
25
+ * @returns Paginated list of Solution summaries visible to the caller.
26
+ */
27
+ list(params?: {
28
+ page?: number;
29
+ pageSize?: number;
30
+ lookupKey?: string;
31
+ pathPrefix?: string;
32
+ owners?: string[];
33
+ }): Promise<SolutionListResponse>;
34
+ /**
35
+ * Import a Solution into the library
36
+ * Imports a Solution and its bundled configs (skills, scripts, templates, files)
37
+ * into the library for the target scope. Two mutually exclusive import modes
38
+ * are supported: pass `solution` to re-import an existing system-owned catalog
39
+ * Solution by ID or `lookup_key`, or pass `solution_bundle` to supply a
40
+ * self-contained inline bundle. Exactly one must be present.
41
+ * The operation upserts the bundle in a single transaction. When `dry_run` is
42
+ * `true` the same pipeline runs but the transaction is rolled back — no rows are
43
+ * persisted and the response reflects what would have been written. The
44
+ * response shape is the same in both cases: the Solution summary plus
45
+ * `installed_configs` listing each config the import created or would create.
46
+ * Pairs with `POST /api/v1/solutions/:solution/install`: this endpoint puts the
47
+ * Solution into the library; install provisions a runtime resource (Agent,
48
+ * AgentRoutine, AgentTool, etc.) from an already-imported Solution.
49
+ * @param input - Request body.
50
+ * @param input.dry_run - When `true`, runs the full import pipeline but rolls back the transaction — no rows are persisted. The response reflects what would have been written. Defaults to `false`.
51
+ * @param input.org - Organization ID (`org_...`) for the import destination scope.
52
+ * @param input.solution - Config ID (`cfg_...`) or `lookup_key` of an existing system-owned, org-less Solution to import into the target scope. Mutually exclusive with `solution_bundle`.
53
+ * @param input.solution_bundle - Self-contained inline bundle containing the Solution metadata plus all bundled configs (skills, templates, configs, files). Mutually exclusive with `solution`.
54
+ * @param input.team - Team ID (`team_...`) for the import destination scope.
55
+ * @param input.user - User ID (`usr_...`) for the import destination scope. Only one of `org`, `team`, or `user` may be set.
56
+ * @param input.virtual_path_prefix - Path prefix under which all uploaded configs' `virtual_path` values are anchored (for example `solutions/<uuid>`). Stable per install; omit to use no prefix.
57
+ * @returns The imported Solution in summary form, plus `installed_configs` — one entry per config the transaction created or would create in `dry_run` mode. `installed_configs` is deprecated; prefer the `solution` summary shape for new integrations.
58
+ */
59
+ create(input: {
60
+ dry_run?: boolean | undefined;
61
+ org?: string | undefined;
62
+ solution?: string | undefined;
63
+ solution_bundle?: {
64
+ configs?: {
65
+ content: string;
66
+ content_type?: string | undefined;
67
+ relative_path: string;
68
+ }[] | undefined;
69
+ lookup_key_prefix?: string | undefined;
70
+ lookup_key_suffix?: string | undefined;
71
+ setup_actions?: {
72
+ depends_on?: string[] | undefined;
73
+ description?: string | undefined;
74
+ kind: string;
75
+ params?: Record<string, unknown> | undefined;
76
+ required?: boolean | undefined;
77
+ sort_order?: number | undefined;
78
+ title: string;
79
+ verify_config?: Record<string, unknown> | undefined;
80
+ }[] | undefined;
81
+ skills?: {
82
+ content: string;
83
+ content_type?: string | undefined;
84
+ files?: {
85
+ content: string;
86
+ content_type?: string | undefined;
87
+ relative_path: string;
88
+ }[] | undefined;
89
+ relative_path: string;
90
+ }[] | undefined;
91
+ solution: {
92
+ content: string;
93
+ content_type?: string | undefined;
94
+ files?: {
95
+ content: string;
96
+ content_type?: string | undefined;
97
+ data_encoding?: string | undefined;
98
+ relative_path: string;
99
+ }[] | undefined;
100
+ lookup_key: string;
101
+ };
102
+ template?: {
103
+ content: string;
104
+ content_type?: string | undefined;
105
+ relative_path: string;
106
+ } | undefined;
107
+ templates?: {
108
+ content: string;
109
+ content_type?: string | undefined;
110
+ relative_path: string;
111
+ }[] | undefined;
112
+ } | undefined;
113
+ team?: string | undefined;
114
+ user?: string | undefined;
115
+ virtual_path_prefix?: string | undefined;
116
+ }): Promise<SolutionImportResponse>;
117
+ /**
118
+ * Delete a Solution
119
+ * Permanently deletes an imported Solution and all configs bundled with it,
120
+ * including templates, skills, scripts, and files. The deletion runs in a
121
+ * single transaction; provider-stored blobs are swept asynchronously after commit.
122
+ * Org-scope callers (for example, an org admin in the Library settings page) can
123
+ * only delete their org's copy of the Solution. App-scope callers can delete
124
+ * Solutions at either scope. RBAC is enforced inside the core delete flow.
125
+ * Returns `204 No Content` on success.
126
+ * @param solution - Solution config ID (`cfg_...`) or `lookup_key` of the Solution to delete.
127
+ * @returns Empty body. HTTP 204 indicates the Solution was deleted successfully.
128
+ */
129
+ delete(solution: string): Promise<void>;
130
+ /**
131
+ * Retrieve a Solution
132
+ * Returns a single Solution identified by its config ID (`cfg_...`) or
133
+ * `lookup_key`, in the same summary shape the list endpoint emits. The response
134
+ * always includes a freshly-minted `readme_url` — call this endpoint to refresh
135
+ * an expired README token without making any other state change.
136
+ * Visibility matches the list endpoint: app-level Solutions (no org affiliation)
137
+ * are visible to every authenticated viewer in the app; org-scoped Solutions are
138
+ * only visible to viewers whose org context matches. Anything else returns 404.
139
+ * When the resolved Solution is org-scoped, the endpoint compares its
140
+ * `solution_version` against the matching app-level copy. If the app-level copy
141
+ * is at a higher version the response includes `upgrade_available: true` and
142
+ * `latest_version`. App-level resolutions always report `upgrade_available: false`.
143
+ * @param solution - Solution config ID (`cfg_...`) or `lookup_key` of the Solution to retrieve.
144
+ * @returns Solution summary including a freshly-minted `readme_url` token valid for one hour.
145
+ */
146
+ get(solution: string): Promise<SolutionSummary>;
147
+ /**
148
+ * Preview Solution delete impact
149
+ * Returns a read-only preview of what deleting the specified Solution would
150
+ * affect: the agents that reference the Solution's bundle, and the count of
151
+ * bundled configs that would be orphaned rather than cascade-deleted.
152
+ * Use this endpoint before calling `DELETE /api/v1/solutions/:solution` to
153
+ * surface a warning when live agents depend on the Solution.
154
+ * Visibility scope mirrors the delete endpoint: org-scope viewers see their
155
+ * org's copy; app-scope viewers can inspect either scope.
156
+ * @param solution - Solution config ID (`cfg_...`) or `lookup_key` of the Solution to inspect.
157
+ * @returns Agents that reference this Solution's bundle plus the count of configs that would be orphaned on delete.
158
+ */
159
+ dependents(solution: string): Promise<SolutionDependentsResponse>;
160
+ /**
161
+ * Install a Solution
162
+ * Provisions a runtime resource from an already-imported Solution. The type of
163
+ * resource created depends on the template the Solution wraps: an
164
+ * `AgentTemplate` produces an Agent, an `AutomationTemplate` produces an
165
+ * Automation, and attachment templates (`AgentRoutineTemplate`,
166
+ * `AgentToolTemplate`, `AgentSkillTemplate`, `AgentComputerTemplate`) attach a
167
+ * sub-resource to an existing Agent specified by `target`.
168
+ * For Solutions that bundle more than one template, pass `template` (the ID or
169
+ * `lookup_key` of the desired template) to select which one to provision.
170
+ * Single-template Solutions do not require `template`.
171
+ * Pairs with `POST /api/v1/solutions` (import): import puts the Solution into
172
+ * the library; install provisions a runtime resource from it.
173
+ * @param solution - Config ID (`cfg_...`) or `lookup_key` of the already-imported Solution to install from.
174
+ * @param input - Request body.
175
+ * @param input.allow_auto_import - When `true`, automatically imports the Solution into the target tenant before installing if the org-scoped copy does not yet exist. Requires either an authenticated org user (member or admin) or a platform-privileged caller (S2S, developer JWT) that also supplies an explicit `org` param. Defaults to `false`; without it the endpoint returns 404 when the org-scoped Solution is missing.
176
+ * @param input.lookup_key - Lookup key override for the provisioned resource (for example, the Agent's `agent_key`).
177
+ * @param input.lookup_key_suffix - Suffix appended to every `config_ref:` resolution at install time. Should be stable per logical install and unique per attempt — allows the same Solution to be installed multiple times in the same app without collisions.
178
+ * @param input.name - Display name override for the provisioned Agent. Ignored for non-Agent Solutions.
179
+ * @param input.org - Organization ID (`org_...`) for the install destination scope.
180
+ * @param input.target - ID or `lookup_key` of the parent Agent to attach to. Required when installing an `AgentRoutineTemplate`, `AgentToolTemplate`, `AgentSkillTemplate`, or `AgentComputerTemplate` Solution, since those produce sub-resources attached to an existing Agent. Omit for `AgentTemplate` and `AutomationTemplate` Solutions, which provision standalone resources.
181
+ * @param input.team - Team ID (`team_...`) for the install destination scope.
182
+ * @param input.template - Config ID (`cfg_...`) or `lookup_key` of the template within the Solution to provision. Required when the Solution bundles more than one template; omit for single-template Solutions, where the only template is selected implicitly.
183
+ * @param input.user - User ID (`usr_...`) for the install destination scope.
184
+ * @returns The provisioned runtime resource (Agent, Automation, AgentRoutine, AgentTool, AgentSkill, or AgentComputer) together with the source Solution's config ID.
185
+ */
186
+ install(solution: string, input: {
187
+ allow_auto_import?: boolean | undefined;
188
+ lookup_key?: string | undefined;
189
+ lookup_key_suffix?: string | undefined;
190
+ name?: string | undefined;
191
+ org?: string | undefined;
192
+ target?: string | undefined;
193
+ team?: string | undefined;
194
+ template?: string | undefined;
195
+ user?: string | undefined;
196
+ }): Promise<SolutionInstallResponse>;
197
+ /**
198
+ * Retrieve a Solution README or asset
199
+ * Serves the README markdown or a bundled asset for an imported Solution. Both
200
+ * modes use the same path and require a short-lived signed `token` in the query
201
+ * string rather than an `Authorization` header, so browsers can load asset URLs
202
+ * directly from `<img src>` attributes without custom request logic.
203
+ * When `file` is omitted the response is the Solution's `readme` field rendered
204
+ * as `text/markdown`. All local asset references in the markdown are rewritten to
205
+ * point back at this endpoint with `?file=PATH&token=TOKEN` so browsers can load
206
+ * images inline without additional authentication.
207
+ * When `file` is set the response is the raw bytes of the matching asset (a File
208
+ * child whose `relative_path` equals `PATH`, or an inline `assets` entry by
209
+ * name) with the asset's stored `Content-Type`.
210
+ * Tokens are scoped to a single Solution, carry the viewer's app, org, and
211
+ * sandbox context from the time they were minted, and expire after one hour.
212
+ * Obtain a fresh token by calling `GET /api/v1/solutions/:solution`, which
213
+ * always returns a newly minted `readme_url`.
214
+ * @param solution - Solution config ID (`cfg_...`) identifying the Solution whose README or asset to retrieve.
215
+ * @param params - Query parameters.
216
+ * @param params.token - Signed URL token minted by the list or show endpoint. Expires after one hour.
217
+ * @param params.file - Relative path of the asset to retrieve (for example `images/hero.png`). When present the response is the raw asset bytes with its real `Content-Type`; when absent the response is the README markdown.
218
+ * @returns README markdown (`text/markdown`) when `file` is omitted, or the raw asset bytes with the asset's `Content-Type` when `file` is set.
219
+ */
220
+ readme(solution: string, params?: {
221
+ token?: string;
222
+ file?: string;
223
+ }): Promise<{
224
+ content: ArrayBuffer;
225
+ mimeType: string;
226
+ }>;
227
+ /**
228
+ * Upgrade an installed Solution
229
+ * Applies an incoming bundle to an already-installed Solution in a single atomic
230
+ * transaction, bringing its configs in line with the new bundle. Config IDs are
231
+ * preserved across the upgrade. Configs that existed in the old bundle but are
232
+ * absent from the new one are orphaned (top-level) or hard-deleted (child rows).
233
+ * Two mutually exclusive source modes: pass `target_solution` to pull the
234
+ * incoming bundle from an existing Solution by ID or `lookup_key`, or pass
235
+ * `solution_bundle` to supply a complete inline bundle directly. Exactly one
236
+ * must be present.
237
+ * When `dry_run` is `true` the full diff is computed and returned but no
238
+ * changes are written. Pass the dry-run response's `review_fingerprint` as
239
+ * `expected_review_fingerprint` when applying to guard against the bundle
240
+ * changing between review and apply.
241
+ * @param solution - Config ID (`cfg_...`) or `lookup_key` of the currently installed Solution to upgrade.
242
+ * @param input - Request body.
243
+ * @param input.allow_downgrade - When `true`, permits an incoming `solution_version` lower than the currently installed version. Defaults to `false`.
244
+ * @param input.dry_run - When `true`, computes and returns the full upgrade diff without persisting any changes. Defaults to `false`.
245
+ * @param input.expected_review_fingerprint - Optional stale-review guard. Pass the `review_fingerprint` returned by a prior `dry_run` call to ensure the bundle has not changed between review and apply.
246
+ * @param input.org - Organization ID (`org_...`) used to resolve org-scoped `lookup_key` values. Config IDs (`cfg_...`) are globally unique and do not require this.
247
+ * @param input.solution_bundle - Complete inline bundle for a direct upgrade, including Solution metadata, templates, skills, configs, files, and setup actions. Mutually exclusive with `target_solution`.
248
+ * @param input.target_solution - Config ID (`cfg_...`) or `lookup_key` of the Solution to use as the incoming upgrade source. Mutually exclusive with `solution_bundle`.
249
+ * @returns Updated Solution plus the full upgrade diff.
250
+ */
251
+ upgrade(solution: string, input: {
252
+ allow_downgrade?: boolean | undefined;
253
+ dry_run?: boolean | undefined;
254
+ expected_review_fingerprint?: string | undefined;
255
+ org?: string | undefined;
256
+ solution_bundle?: {
257
+ configs?: {
258
+ content: string;
259
+ content_type?: string | undefined;
260
+ relative_path: string;
261
+ }[] | undefined;
262
+ lookup_key_prefix?: string | undefined;
263
+ lookup_key_suffix?: string | undefined;
264
+ setup_actions?: {
265
+ depends_on?: string[] | undefined;
266
+ description?: string | undefined;
267
+ kind: string;
268
+ params?: Record<string, unknown> | undefined;
269
+ required?: boolean | undefined;
270
+ sort_order?: number | undefined;
271
+ title: string;
272
+ verify_config?: Record<string, unknown> | undefined;
273
+ }[] | undefined;
274
+ skills?: {
275
+ content: string;
276
+ content_type?: string | undefined;
277
+ files?: {
278
+ content: string;
279
+ content_type?: string | undefined;
280
+ relative_path: string;
281
+ }[] | undefined;
282
+ relative_path: string;
283
+ }[] | undefined;
284
+ solution: {
285
+ content: string;
286
+ content_type?: string | undefined;
287
+ files?: {
288
+ content: string;
289
+ content_type?: string | undefined;
290
+ data_encoding?: string | undefined;
291
+ relative_path: string;
292
+ }[] | undefined;
293
+ lookup_key: string;
294
+ };
295
+ template?: {
296
+ content: string;
297
+ content_type?: string | undefined;
298
+ relative_path: string;
299
+ } | undefined;
300
+ templates?: {
301
+ content: string;
302
+ content_type?: string | undefined;
303
+ relative_path: string;
304
+ }[] | undefined;
305
+ } | undefined;
306
+ target_solution?: string | undefined;
307
+ }): Promise<SolutionUpgradeResponse>;
308
+ }
309
+ //# sourceMappingURL=solutions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"solutions.d.ts","sourceRoot":"","sources":["../../../src/v1/resources/solutions.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC1D,OAAO,KAAK,EAAE,0BAA0B,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,eAAe,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAEzL,qBAAa,gBAAgB;IACf,OAAO,CAAC,IAAI;gBAAJ,IAAI,EAAE,UAAU;IAEpC;;;;;;;;;;;;;;;;;;;;OAoBG;IACG,IAAI,CAAC,MAAM,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAC;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AC,KAAK,CAAC,EAAE;oBAAE,OAAO,EAAE,MAAM,CAAC;oBAAC,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;oBAAC,aAAa,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;oBAAC,aAAa,EAAE,MAAM,CAAA;iBAAE,EAAE,GAAG,SAAS,CAAC;gBAAC,UAAU,EAAE,MAAM,CAAA;aAAE,CAAC;YAAC,QAAQ,CAAC,EAAE;gBAAE,OAAO,EAAE,MAAM,CAAC;gBAAC,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;gBAAC,aAAa,EAAE,MAAM,CAAA;aAAE,GAAG,SAAS,CAAC;YAAC,SAAS,CAAC,EAAE;gBAAE,OAAO,EAAE,MAAM,CAAC;gBAAC,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;gBAAC,aAAa,EAAE,MAAM,CAAA;aAAE,EAAE,GAAG,SAAS,CAAA;SAAE,GAAG,SAAS,CAAC;QAAC,eAAe,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;KAAE,GAAG,OAAO,CAAC,uBAAuB,CAAC;CAG/3C"}
@@ -0,0 +1,214 @@
1
+ // Copyright (c) 2026 ArchAstro Inc. All Rights Reserved.
2
+ // This file is auto-generated by @archastro/sdk-generator. Do not edit.
3
+ // Content hash: fe6c5a3321d1
4
+ export class SolutionResource {
5
+ http;
6
+ constructor(http) {
7
+ this.http = http;
8
+ }
9
+ /**
10
+ * List Solutions
11
+ * Returns a paginated list of Solutions visible to the authenticated caller,
12
+ * merging two scopes: app-level Solutions (system-owned rows with no org
13
+ * affiliation, visible to all authenticated viewers in the app) and org-level
14
+ * Solutions (system-owned rows stamped with the viewer's org ID, included when
15
+ * the viewer carries an org context).
16
+ * Solutions that appear under both scopes are deduplicated by their stable
17
+ * `solution_id` value. The merged entry's `owners` array lists every scope the
18
+ * Solution was found under (`"system"` and/or `"org"`). When the app-level copy
19
+ * has a higher `solution_version` than the org-level copy, the response includes
20
+ * `upgrade_available: true` and `latest_version` so callers can prompt for an
21
+ * upgrade.
22
+ * @param params - Query parameters.
23
+ * @param params.page - Page number to return. Defaults to `1`.
24
+ * @param params.pageSize - Number of Solutions per page. Defaults to `25`.
25
+ * @param params.lookupKey - Filter to the Solution whose `lookup_key` matches exactly.
26
+ * @param params.pathPrefix - Filter to Solutions whose `virtual_path` starts with this prefix.
27
+ * @param params.owners - Restrict results to a subset of owner scopes. Accepted values: `"system"` (app-level Solutions) and `"org"` (viewer's org-level Solutions). Omit to include all scopes the viewer can see.
28
+ * @returns Paginated list of Solution summaries visible to the caller.
29
+ */
30
+ async list(params) {
31
+ const query = {};
32
+ if (params?.page !== undefined) {
33
+ query["page"] = params?.page;
34
+ }
35
+ if (params?.pageSize !== undefined) {
36
+ query["page_size"] = params?.pageSize;
37
+ }
38
+ if (params?.lookupKey !== undefined) {
39
+ query["lookup_key"] = params?.lookupKey;
40
+ }
41
+ if (params?.pathPrefix !== undefined) {
42
+ query["path_prefix"] = params?.pathPrefix;
43
+ }
44
+ if (params?.owners !== undefined) {
45
+ query["owners"] = params?.owners;
46
+ }
47
+ return this.http.request(`/api/v1/solutions`, { query });
48
+ }
49
+ /**
50
+ * Import a Solution into the library
51
+ * Imports a Solution and its bundled configs (skills, scripts, templates, files)
52
+ * into the library for the target scope. Two mutually exclusive import modes
53
+ * are supported: pass `solution` to re-import an existing system-owned catalog
54
+ * Solution by ID or `lookup_key`, or pass `solution_bundle` to supply a
55
+ * self-contained inline bundle. Exactly one must be present.
56
+ * The operation upserts the bundle in a single transaction. When `dry_run` is
57
+ * `true` the same pipeline runs but the transaction is rolled back — no rows are
58
+ * persisted and the response reflects what would have been written. The
59
+ * response shape is the same in both cases: the Solution summary plus
60
+ * `installed_configs` listing each config the import created or would create.
61
+ * Pairs with `POST /api/v1/solutions/:solution/install`: this endpoint puts the
62
+ * Solution into the library; install provisions a runtime resource (Agent,
63
+ * AgentRoutine, AgentTool, etc.) from an already-imported Solution.
64
+ * @param input - Request body.
65
+ * @param input.dry_run - When `true`, runs the full import pipeline but rolls back the transaction — no rows are persisted. The response reflects what would have been written. Defaults to `false`.
66
+ * @param input.org - Organization ID (`org_...`) for the import destination scope.
67
+ * @param input.solution - Config ID (`cfg_...`) or `lookup_key` of an existing system-owned, org-less Solution to import into the target scope. Mutually exclusive with `solution_bundle`.
68
+ * @param input.solution_bundle - Self-contained inline bundle containing the Solution metadata plus all bundled configs (skills, templates, configs, files). Mutually exclusive with `solution`.
69
+ * @param input.team - Team ID (`team_...`) for the import destination scope.
70
+ * @param input.user - User ID (`usr_...`) for the import destination scope. Only one of `org`, `team`, or `user` may be set.
71
+ * @param input.virtual_path_prefix - Path prefix under which all uploaded configs' `virtual_path` values are anchored (for example `solutions/<uuid>`). Stable per install; omit to use no prefix.
72
+ * @returns The imported Solution in summary form, plus `installed_configs` — one entry per config the transaction created or would create in `dry_run` mode. `installed_configs` is deprecated; prefer the `solution` summary shape for new integrations.
73
+ */
74
+ async create(input) {
75
+ return this.http.request(`/api/v1/solutions`, { method: "POST", body: input });
76
+ }
77
+ /**
78
+ * Delete a Solution
79
+ * Permanently deletes an imported Solution and all configs bundled with it,
80
+ * including templates, skills, scripts, and files. The deletion runs in a
81
+ * single transaction; provider-stored blobs are swept asynchronously after commit.
82
+ * Org-scope callers (for example, an org admin in the Library settings page) can
83
+ * only delete their org's copy of the Solution. App-scope callers can delete
84
+ * Solutions at either scope. RBAC is enforced inside the core delete flow.
85
+ * Returns `204 No Content` on success.
86
+ * @param solution - Solution config ID (`cfg_...`) or `lookup_key` of the Solution to delete.
87
+ * @returns Empty body. HTTP 204 indicates the Solution was deleted successfully.
88
+ */
89
+ async delete(solution) {
90
+ await this.http.request(`/api/v1/solutions/${solution}`, { method: "DELETE" });
91
+ }
92
+ /**
93
+ * Retrieve a Solution
94
+ * Returns a single Solution identified by its config ID (`cfg_...`) or
95
+ * `lookup_key`, in the same summary shape the list endpoint emits. The response
96
+ * always includes a freshly-minted `readme_url` — call this endpoint to refresh
97
+ * an expired README token without making any other state change.
98
+ * Visibility matches the list endpoint: app-level Solutions (no org affiliation)
99
+ * are visible to every authenticated viewer in the app; org-scoped Solutions are
100
+ * only visible to viewers whose org context matches. Anything else returns 404.
101
+ * When the resolved Solution is org-scoped, the endpoint compares its
102
+ * `solution_version` against the matching app-level copy. If the app-level copy
103
+ * is at a higher version the response includes `upgrade_available: true` and
104
+ * `latest_version`. App-level resolutions always report `upgrade_available: false`.
105
+ * @param solution - Solution config ID (`cfg_...`) or `lookup_key` of the Solution to retrieve.
106
+ * @returns Solution summary including a freshly-minted `readme_url` token valid for one hour.
107
+ */
108
+ async get(solution) {
109
+ return this.http.request(`/api/v1/solutions/${solution}`);
110
+ }
111
+ /**
112
+ * Preview Solution delete impact
113
+ * Returns a read-only preview of what deleting the specified Solution would
114
+ * affect: the agents that reference the Solution's bundle, and the count of
115
+ * bundled configs that would be orphaned rather than cascade-deleted.
116
+ * Use this endpoint before calling `DELETE /api/v1/solutions/:solution` to
117
+ * surface a warning when live agents depend on the Solution.
118
+ * Visibility scope mirrors the delete endpoint: org-scope viewers see their
119
+ * org's copy; app-scope viewers can inspect either scope.
120
+ * @param solution - Solution config ID (`cfg_...`) or `lookup_key` of the Solution to inspect.
121
+ * @returns Agents that reference this Solution's bundle plus the count of configs that would be orphaned on delete.
122
+ */
123
+ async dependents(solution) {
124
+ return this.http.request(`/api/v1/solutions/${solution}/dependents`);
125
+ }
126
+ /**
127
+ * Install a Solution
128
+ * Provisions a runtime resource from an already-imported Solution. The type of
129
+ * resource created depends on the template the Solution wraps: an
130
+ * `AgentTemplate` produces an Agent, an `AutomationTemplate` produces an
131
+ * Automation, and attachment templates (`AgentRoutineTemplate`,
132
+ * `AgentToolTemplate`, `AgentSkillTemplate`, `AgentComputerTemplate`) attach a
133
+ * sub-resource to an existing Agent specified by `target`.
134
+ * For Solutions that bundle more than one template, pass `template` (the ID or
135
+ * `lookup_key` of the desired template) to select which one to provision.
136
+ * Single-template Solutions do not require `template`.
137
+ * Pairs with `POST /api/v1/solutions` (import): import puts the Solution into
138
+ * the library; install provisions a runtime resource from it.
139
+ * @param solution - Config ID (`cfg_...`) or `lookup_key` of the already-imported Solution to install from.
140
+ * @param input - Request body.
141
+ * @param input.allow_auto_import - When `true`, automatically imports the Solution into the target tenant before installing if the org-scoped copy does not yet exist. Requires either an authenticated org user (member or admin) or a platform-privileged caller (S2S, developer JWT) that also supplies an explicit `org` param. Defaults to `false`; without it the endpoint returns 404 when the org-scoped Solution is missing.
142
+ * @param input.lookup_key - Lookup key override for the provisioned resource (for example, the Agent's `agent_key`).
143
+ * @param input.lookup_key_suffix - Suffix appended to every `config_ref:` resolution at install time. Should be stable per logical install and unique per attempt — allows the same Solution to be installed multiple times in the same app without collisions.
144
+ * @param input.name - Display name override for the provisioned Agent. Ignored for non-Agent Solutions.
145
+ * @param input.org - Organization ID (`org_...`) for the install destination scope.
146
+ * @param input.target - ID or `lookup_key` of the parent Agent to attach to. Required when installing an `AgentRoutineTemplate`, `AgentToolTemplate`, `AgentSkillTemplate`, or `AgentComputerTemplate` Solution, since those produce sub-resources attached to an existing Agent. Omit for `AgentTemplate` and `AutomationTemplate` Solutions, which provision standalone resources.
147
+ * @param input.team - Team ID (`team_...`) for the install destination scope.
148
+ * @param input.template - Config ID (`cfg_...`) or `lookup_key` of the template within the Solution to provision. Required when the Solution bundles more than one template; omit for single-template Solutions, where the only template is selected implicitly.
149
+ * @param input.user - User ID (`usr_...`) for the install destination scope.
150
+ * @returns The provisioned runtime resource (Agent, Automation, AgentRoutine, AgentTool, AgentSkill, or AgentComputer) together with the source Solution's config ID.
151
+ */
152
+ async install(solution, input) {
153
+ return this.http.request(`/api/v1/solutions/${solution}/install`, { method: "POST", body: input });
154
+ }
155
+ /**
156
+ * Retrieve a Solution README or asset
157
+ * Serves the README markdown or a bundled asset for an imported Solution. Both
158
+ * modes use the same path and require a short-lived signed `token` in the query
159
+ * string rather than an `Authorization` header, so browsers can load asset URLs
160
+ * directly from `<img src>` attributes without custom request logic.
161
+ * When `file` is omitted the response is the Solution's `readme` field rendered
162
+ * as `text/markdown`. All local asset references in the markdown are rewritten to
163
+ * point back at this endpoint with `?file=PATH&token=TOKEN` so browsers can load
164
+ * images inline without additional authentication.
165
+ * When `file` is set the response is the raw bytes of the matching asset (a File
166
+ * child whose `relative_path` equals `PATH`, or an inline `assets` entry by
167
+ * name) with the asset's stored `Content-Type`.
168
+ * Tokens are scoped to a single Solution, carry the viewer's app, org, and
169
+ * sandbox context from the time they were minted, and expire after one hour.
170
+ * Obtain a fresh token by calling `GET /api/v1/solutions/:solution`, which
171
+ * always returns a newly minted `readme_url`.
172
+ * @param solution - Solution config ID (`cfg_...`) identifying the Solution whose README or asset to retrieve.
173
+ * @param params - Query parameters.
174
+ * @param params.token - Signed URL token minted by the list or show endpoint. Expires after one hour.
175
+ * @param params.file - Relative path of the asset to retrieve (for example `images/hero.png`). When present the response is the raw asset bytes with its real `Content-Type`; when absent the response is the README markdown.
176
+ * @returns README markdown (`text/markdown`) when `file` is omitted, or the raw asset bytes with the asset's `Content-Type` when `file` is set.
177
+ */
178
+ async readme(solution, params) {
179
+ const query = {};
180
+ query["token"] = params?.token;
181
+ if (params?.file !== undefined) {
182
+ query["file"] = params?.file;
183
+ }
184
+ return this.http.requestRaw(`/api/v1/solutions/${solution}/readme`, { query });
185
+ }
186
+ /**
187
+ * Upgrade an installed Solution
188
+ * Applies an incoming bundle to an already-installed Solution in a single atomic
189
+ * transaction, bringing its configs in line with the new bundle. Config IDs are
190
+ * preserved across the upgrade. Configs that existed in the old bundle but are
191
+ * absent from the new one are orphaned (top-level) or hard-deleted (child rows).
192
+ * Two mutually exclusive source modes: pass `target_solution` to pull the
193
+ * incoming bundle from an existing Solution by ID or `lookup_key`, or pass
194
+ * `solution_bundle` to supply a complete inline bundle directly. Exactly one
195
+ * must be present.
196
+ * When `dry_run` is `true` the full diff is computed and returned but no
197
+ * changes are written. Pass the dry-run response's `review_fingerprint` as
198
+ * `expected_review_fingerprint` when applying to guard against the bundle
199
+ * changing between review and apply.
200
+ * @param solution - Config ID (`cfg_...`) or `lookup_key` of the currently installed Solution to upgrade.
201
+ * @param input - Request body.
202
+ * @param input.allow_downgrade - When `true`, permits an incoming `solution_version` lower than the currently installed version. Defaults to `false`.
203
+ * @param input.dry_run - When `true`, computes and returns the full upgrade diff without persisting any changes. Defaults to `false`.
204
+ * @param input.expected_review_fingerprint - Optional stale-review guard. Pass the `review_fingerprint` returned by a prior `dry_run` call to ensure the bundle has not changed between review and apply.
205
+ * @param input.org - Organization ID (`org_...`) used to resolve org-scoped `lookup_key` values. Config IDs (`cfg_...`) are globally unique and do not require this.
206
+ * @param input.solution_bundle - Complete inline bundle for a direct upgrade, including Solution metadata, templates, skills, configs, files, and setup actions. Mutually exclusive with `target_solution`.
207
+ * @param input.target_solution - Config ID (`cfg_...`) or `lookup_key` of the Solution to use as the incoming upgrade source. Mutually exclusive with `solution_bundle`.
208
+ * @returns Updated Solution plus the full upgrade diff.
209
+ */
210
+ async upgrade(solution, input) {
211
+ return this.http.request(`/api/v1/solutions/${solution}/upgrade`, { method: "POST", body: input });
212
+ }
213
+ }
214
+ //# sourceMappingURL=solutions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"solutions.js","sourceRoot":"","sources":["../../../src/v1/resources/solutions.ts"],"names":[],"mappings":"AAAA,yDAAyD;AACzD,wEAAwE;AACxE,6BAA6B;AAK7B,MAAM,OAAO,gBAAgB;IACP;IAApB,YAAoB,IAAgB;QAAhB,SAAI,GAAJ,IAAI,CAAY;IAAG,CAAC;IAExC;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,KAAK,CAAC,IAAI,CAAC,MAAyG;QAClH,MAAM,KAAK,GAA6F,EAAE,CAAC;QAC3G,IAAI,MAAM,EAAE,IAAI,KAAK,SAAS,EAAE,CAAC;YAC/B,KAAK,CAAC,MAAM,CAAC,GAAG,MAAM,EAAE,IAAI,CAAC;QAC/B,CAAC;QACD,IAAI,MAAM,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AO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,qBAAqB,QAAQ,aAAa,CAAC,CAAC;IACvE,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACH,KAAK,CAAC,OAAO,CAAC,QAAgB,EAAE,KAAkS;QAChU,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,qBAAqB,QAAQ,UAAU,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;IACrG,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,KAAK,CAAC,MAAM,CAAC,QAAgB,EAAE,MAA0C;QACvE,MAAM,KAAK,GAA6F,EAAE,CAAC;QAC3G,KAAK,CAAC,OAAO,CAAC,GAAG,MAAM,EAAE,KAAK,CAAC;QAC/B,IAAI,MAAM,EAAE,IAAI,KAAK,SAAS,EAAE,CAAC;YAC/B,KAAK,CAAC,MAAM,CAAC,GAAG,MAAM,EAAE,IAAI,CAAC;QAC/B,CAAC;QAED,OAAO,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,qBAAqB,QAAQ,SAAS,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;IACjF,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,KAAK,CAAC,OAAO,CAAC,QAAgB,EAAE,KAA2zC;QACz1C,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,qBAAqB,QAAQ,UAAU,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;IACrG,CAAC;CACF"}
@@ -3,6 +3,26 @@ import type { TeamMembershipListResponse } from "../../types/teams.js";
3
3
  export declare class TeamMembershipResource {
4
4
  private http;
5
5
  constructor(http: HttpClient);
6
+ /**
7
+ * List team memberships
8
+ * Returns a paginated list of team memberships across all teams accessible to
9
+ * the authenticated caller. Use the `team`, `user`, and `agent` filters to
10
+ * narrow results to a specific team or principal.
11
+ * This endpoint requires S2S (service-to-service) authentication. Callers
12
+ * authenticated with a user token receive a 401. Each membership includes the
13
+ * resolved `type` (`"user"`, `"agent"`, or `"unknown"`), display name, and
14
+ * profile picture derived from the associated user or agent at request time.
15
+ * Results are returned in offset-based pages. Pass `page` and `page_size` to
16
+ * navigate; the response includes `has_next` and `has_prev` to determine
17
+ * whether adjacent pages exist.
18
+ * @param params - Query parameters.
19
+ * @param params.team - Filter results to memberships belonging to these team IDs (`tm_...`). Multiple values are combined with OR.
20
+ * @param params.user - Filter results to memberships held by these user IDs (`usr_...`). Multiple values are combined with OR.
21
+ * @param params.agent - Filter results to memberships held by these agent IDs (`agt_...`). Multiple values are combined with OR.
22
+ * @param params.page - Page number to retrieve, starting at `1`. Defaults to `1`.
23
+ * @param params.pageSize - Number of memberships to return per page. Defaults to `25`.
24
+ * @returns Paginated list of team memberships matching the applied filters.
25
+ */
6
26
  list(params?: {
7
27
  team?: string[];
8
28
  user?: string[];
@@ -10,6 +30,17 @@ export declare class TeamMembershipResource {
10
30
  page?: number;
11
31
  pageSize?: number;
12
32
  }): Promise<TeamMembershipListResponse>;
33
+ /**
34
+ * Remove a team membership by ID
35
+ * Removes a team membership identified directly by its membership ID. On
36
+ * success, returns 204 No Content.
37
+ * This endpoint is intended for server-to-server callers that already hold the
38
+ * membership ID. To remove a member by user or agent ID instead, use the team
39
+ * members delete endpoint. The caller must have permission to manage the team
40
+ * that the membership belongs to.
41
+ * @param teamMembership - Team membership ID (`tmb_...`) to remove. The membership must be within the caller's app scope.
42
+ * @returns Empty response. Returns 204 No Content on success.
43
+ */
13
44
  delete(teamMembership: string): Promise<void>;
14
45
  }
15
46
  //# sourceMappingURL=team_memberships.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"team_memberships.d.ts","sourceRoot":"","sources":["../../../src/v1/resources/team_memberships.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC1D,OAAO,KAA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