@archastro/sdk 0.5.2 → 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.
- package/README.md +86 -0
- package/dist/auth.d.ts +143 -0
- package/dist/auth.d.ts.map +1 -1
- package/dist/auth.js +187 -1
- package/dist/auth.js.map +1 -1
- package/dist/client.d.ts +26 -0
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +27 -1
- package/dist/client.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/types/ai.d.ts +150 -12
- package/dist/types/ai.d.ts.map +1 -1
- package/dist/types/ai.js +71 -41
- package/dist/types/ai.js.map +1 -1
- package/dist/types/artifacts.d.ts +81 -24
- package/dist/types/artifacts.d.ts.map +1 -1
- package/dist/types/artifacts.js +39 -21
- package/dist/types/artifacts.js.map +1 -1
- package/dist/types/automations.d.ts +41 -9
- package/dist/types/automations.d.ts.map +1 -1
- package/dist/types/automations.js +25 -17
- package/dist/types/automations.js.map +1 -1
- package/dist/types/chat.d.ts +21418 -0
- package/dist/types/chat.d.ts.map +1 -0
- package/dist/types/chat.js +70 -0
- package/dist/types/chat.js.map +1 -0
- package/dist/types/common.d.ts +16970 -2136
- package/dist/types/common.d.ts.map +1 -1
- package/dist/types/common.js +1695 -332
- package/dist/types/common.js.map +1 -1
- package/dist/types/config.d.ts +239 -31
- package/dist/types/config.d.ts.map +1 -1
- package/dist/types/config.js +86 -34
- package/dist/types/config.js.map +1 -1
- package/dist/types/image.d.ts +27 -4
- package/dist/types/image.d.ts.map +1 -1
- package/dist/types/image.js +17 -10
- package/dist/types/image.js.map +1 -1
- package/dist/types/index.d.ts +2 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +3 -2
- package/dist/types/index.js.map +1 -1
- package/dist/types/invites.d.ts +20 -11
- package/dist/types/invites.d.ts.map +1 -1
- package/dist/types/invites.js +9 -12
- package/dist/types/invites.js.map +1 -1
- package/dist/types/notifications.d.ts +163 -0
- package/dist/types/notifications.d.ts.map +1 -0
- package/dist/types/notifications.js +44 -0
- package/dist/types/notifications.js.map +1 -0
- package/dist/types/teams.d.ts +1628 -231
- package/dist/types/teams.d.ts.map +1 -1
- package/dist/types/teams.js +76 -45
- package/dist/types/teams.js.map +1 -1
- package/dist/types/threads.d.ts +997 -243
- package/dist/types/threads.d.ts.map +1 -1
- package/dist/types/threads.js +84 -51
- package/dist/types/threads.js.map +1 -1
- package/dist/types/users.d.ts +98 -18
- package/dist/types/users.d.ts.map +1 -1
- package/dist/types/users.js +43 -18
- package/dist/types/users.js.map +1 -1
- package/dist/v1/resources/activity_feed.d.ts +89 -0
- package/dist/v1/resources/activity_feed.d.ts.map +1 -1
- package/dist/v1/resources/activity_feed.js +56 -2
- package/dist/v1/resources/activity_feed.js.map +1 -1
- package/dist/v1/resources/agent_computers.d.ts +48 -2
- package/dist/v1/resources/agent_computers.d.ts.map +1 -1
- package/dist/v1/resources/agent_computers.js +48 -1
- package/dist/v1/resources/agent_computers.js.map +1 -1
- package/dist/v1/resources/agent_env_vars.d.ts +50 -0
- package/dist/v1/resources/agent_env_vars.d.ts.map +1 -0
- package/dist/v1/resources/agent_env_vars.js +56 -0
- package/dist/v1/resources/agent_env_vars.js.map +1 -0
- package/dist/v1/resources/agent_health_actions.d.ts +43 -0
- package/dist/v1/resources/agent_health_actions.d.ts.map +1 -0
- package/dist/v1/resources/agent_health_actions.js +50 -0
- package/dist/v1/resources/agent_health_actions.js.map +1 -0
- package/dist/v1/resources/agent_installations.d.ts +100 -0
- package/dist/v1/resources/agent_installations.d.ts.map +1 -1
- package/dist/v1/resources/agent_installations.js +106 -2
- package/dist/v1/resources/agent_installations.js.map +1 -1
- package/dist/v1/resources/agent_routine_runs.d.ts +33 -0
- package/dist/v1/resources/agent_routine_runs.d.ts.map +1 -0
- package/dist/v1/resources/agent_routine_runs.js +48 -0
- package/dist/v1/resources/agent_routine_runs.js.map +1 -0
- package/dist/v1/resources/agent_routines.d.ts +148 -2
- package/dist/v1/resources/agent_routines.d.ts.map +1 -1
- package/dist/v1/resources/agent_routines.js +168 -3
- package/dist/v1/resources/agent_routines.js.map +1 -1
- package/dist/v1/resources/agent_sessions.d.ts +118 -1
- package/dist/v1/resources/agent_sessions.d.ts.map +1 -1
- package/dist/v1/resources/agent_sessions.js +134 -2
- package/dist/v1/resources/agent_sessions.js.map +1 -1
- package/dist/v1/resources/agent_skills.d.ts +83 -1
- package/dist/v1/resources/agent_skills.d.ts.map +1 -1
- package/dist/v1/resources/agent_skills.js +87 -2
- package/dist/v1/resources/agent_skills.js.map +1 -1
- package/dist/v1/resources/agent_tools.d.ts +109 -2
- package/dist/v1/resources/agent_tools.d.ts.map +1 -1
- package/dist/v1/resources/agent_tools.js +114 -2
- package/dist/v1/resources/agent_tools.js.map +1 -1
- package/dist/v1/resources/agents.d.ts +517 -9
- package/dist/v1/resources/agents.d.ts.map +1 -1
- package/dist/v1/resources/agents.js +515 -12
- package/dist/v1/resources/agents.js.map +1 -1
- package/dist/v1/resources/ai.d.ts +93 -0
- package/dist/v1/resources/ai.d.ts.map +1 -1
- package/dist/v1/resources/ai.js +89 -1
- package/dist/v1/resources/ai.js.map +1 -1
- package/dist/v1/resources/artifacts.d.ts +73 -0
- package/dist/v1/resources/artifacts.d.ts.map +1 -1
- package/dist/v1/resources/artifacts.js +74 -2
- package/dist/v1/resources/artifacts.js.map +1 -1
- package/dist/v1/resources/automation_runs.d.ts +8 -4
- package/dist/v1/resources/automation_runs.d.ts.map +1 -1
- package/dist/v1/resources/automation_runs.js +9 -5
- package/dist/v1/resources/automation_runs.js.map +1 -1
- package/dist/v1/resources/automations.d.ts +20 -0
- package/dist/v1/resources/automations.d.ts.map +1 -1
- package/dist/v1/resources/automations.js +21 -1
- package/dist/v1/resources/automations.js.map +1 -1
- package/dist/v1/resources/bug_reports.d.ts +29 -0
- package/dist/v1/resources/bug_reports.d.ts.map +1 -0
- package/dist/v1/resources/bug_reports.js +29 -0
- package/dist/v1/resources/bug_reports.js.map +1 -0
- package/dist/v1/resources/config.d.ts +429 -4
- package/dist/v1/resources/config.d.ts.map +1 -1
- package/dist/v1/resources/config.js +493 -9
- package/dist/v1/resources/config.js.map +1 -1
- package/dist/v1/resources/custom_objects.d.ts +117 -2
- package/dist/v1/resources/custom_objects.d.ts.map +1 -1
- package/dist/v1/resources/custom_objects.js +132 -3
- package/dist/v1/resources/custom_objects.js.map +1 -1
- package/dist/v1/resources/files.d.ts +62 -0
- package/dist/v1/resources/files.d.ts.map +1 -0
- package/dist/v1/resources/files.js +58 -0
- package/dist/v1/resources/files.js.map +1 -0
- package/dist/v1/resources/index.d.ts +13 -0
- package/dist/v1/resources/index.d.ts.map +1 -1
- package/dist/v1/resources/index.js +14 -1
- package/dist/v1/resources/index.js.map +1 -1
- package/dist/v1/resources/installation_sources.d.ts +12 -0
- package/dist/v1/resources/installation_sources.d.ts.map +1 -1
- package/dist/v1/resources/installation_sources.js +13 -1
- package/dist/v1/resources/installation_sources.js.map +1 -1
- package/dist/v1/resources/invites.d.ts +15 -0
- package/dist/v1/resources/invites.d.ts.map +1 -1
- package/dist/v1/resources/invites.js +16 -1
- package/dist/v1/resources/invites.js.map +1 -1
- package/dist/v1/resources/knowledge_documents.d.ts +104 -0
- package/dist/v1/resources/knowledge_documents.d.ts.map +1 -0
- package/dist/v1/resources/knowledge_documents.js +112 -0
- package/dist/v1/resources/knowledge_documents.js.map +1 -0
- package/dist/v1/resources/knowledge_sources.d.ts +190 -0
- package/dist/v1/resources/knowledge_sources.d.ts.map +1 -0
- package/dist/v1/resources/knowledge_sources.js +176 -0
- package/dist/v1/resources/knowledge_sources.js.map +1 -0
- package/dist/v1/resources/kv.d.ts +73 -0
- package/dist/v1/resources/kv.d.ts.map +1 -1
- package/dist/v1/resources/kv.js +96 -3
- package/dist/v1/resources/kv.js.map +1 -1
- package/dist/v1/resources/notification_preferences.d.ts +61 -0
- package/dist/v1/resources/notification_preferences.d.ts.map +1 -0
- package/dist/v1/resources/notification_preferences.js +65 -0
- package/dist/v1/resources/notification_preferences.js.map +1 -0
- package/dist/v1/resources/notifications.d.ts +133 -0
- package/dist/v1/resources/notifications.d.ts.map +1 -0
- package/dist/v1/resources/notifications.js +136 -0
- package/dist/v1/resources/notifications.js.map +1 -0
- package/dist/v1/resources/orgs.d.ts +18 -0
- package/dist/v1/resources/orgs.d.ts.map +1 -1
- package/dist/v1/resources/orgs.js +30 -2
- package/dist/v1/resources/orgs.js.map +1 -1
- package/dist/v1/resources/slack_channel_bindings.d.ts +101 -0
- package/dist/v1/resources/slack_channel_bindings.d.ts.map +1 -0
- package/dist/v1/resources/slack_channel_bindings.js +114 -0
- package/dist/v1/resources/slack_channel_bindings.js.map +1 -0
- package/dist/v1/resources/solution_categories.d.ts +36 -0
- package/dist/v1/resources/solution_categories.d.ts.map +1 -0
- package/dist/v1/resources/solution_categories.js +55 -0
- package/dist/v1/resources/solution_categories.js.map +1 -0
- package/dist/v1/resources/solution_tags.d.ts +37 -0
- package/dist/v1/resources/solution_tags.d.ts.map +1 -0
- package/dist/v1/resources/solution_tags.js +54 -0
- package/dist/v1/resources/solution_tags.js.map +1 -0
- package/dist/v1/resources/solutions.d.ts +309 -0
- package/dist/v1/resources/solutions.d.ts.map +1 -0
- package/dist/v1/resources/solutions.js +214 -0
- package/dist/v1/resources/solutions.js.map +1 -0
- package/dist/v1/resources/team_memberships.d.ts +31 -0
- package/dist/v1/resources/team_memberships.d.ts.map +1 -1
- package/dist/v1/resources/team_memberships.js +49 -2
- package/dist/v1/resources/team_memberships.js.map +1 -1
- package/dist/v1/resources/teams.d.ts +458 -49
- package/dist/v1/resources/teams.d.ts.map +1 -1
- package/dist/v1/resources/teams.js +319 -27
- package/dist/v1/resources/teams.js.map +1 -1
- package/dist/v1/resources/thread_messages.d.ts +70 -0
- package/dist/v1/resources/thread_messages.d.ts.map +1 -1
- package/dist/v1/resources/thread_messages.js +85 -2
- package/dist/v1/resources/thread_messages.js.map +1 -1
- package/dist/v1/resources/threads.d.ts +201 -0
- package/dist/v1/resources/threads.d.ts.map +1 -1
- package/dist/v1/resources/threads.js +220 -4
- package/dist/v1/resources/threads.js.map +1 -1
- package/dist/v1/resources/users.d.ts +213 -39
- package/dist/v1/resources/users.d.ts.map +1 -1
- package/dist/v1/resources/users.js +121 -16
- package/dist/v1/resources/users.js.map +1 -1
- package/dist/v1.d.ts +26 -0
- package/dist/v1.d.ts.map +1 -1
- package/dist/v1.js +40 -1
- package/dist/v1.js.map +1 -1
- package/package.json +3 -1
- package/dist/types/agents.d.ts +0 -2084
- package/dist/types/agents.d.ts.map +0 -1
- package/dist/types/agents.js +0 -203
- package/dist/types/agents.js.map +0 -1
|
@@ -1,17 +1,52 @@
|
|
|
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:
|
|
3
|
+
// Content hash: 631811b3d935
|
|
4
4
|
export class ThreadMemberResource {
|
|
5
5
|
http;
|
|
6
6
|
constructor(http) {
|
|
7
7
|
this.http = http;
|
|
8
8
|
}
|
|
9
|
+
/**
|
|
10
|
+
* Remove a member from a thread
|
|
11
|
+
* Removes a user or agent membership from the specified thread. The authenticated
|
|
12
|
+
* user must have access to the thread. A successful removal returns HTTP 204 with
|
|
13
|
+
* no response body.
|
|
14
|
+
* Supply either `user` or `agent` depending on the value of `type`. Returns 404
|
|
15
|
+
* if the thread or the membership record does not exist.
|
|
16
|
+
* @param thread - Thread ID (`thr_...`) identifying the thread to remove the member from.
|
|
17
|
+
* @returns Empty response body. HTTP 204 on success.
|
|
18
|
+
*/
|
|
9
19
|
async remove(thread) {
|
|
10
20
|
await this.http.request(`/api/v1/threads/${thread}/members`, { method: "DELETE" });
|
|
11
21
|
}
|
|
22
|
+
/**
|
|
23
|
+
* List members of a thread
|
|
24
|
+
* Returns all current members of the specified thread, including both user and
|
|
25
|
+
* agent members. The authenticated user must have visibility into the thread;
|
|
26
|
+
* requests from users without access return 403.
|
|
27
|
+
* Results are returned as a flat array in the `data` field. The list is not
|
|
28
|
+
* paginated — all members are returned in a single response.
|
|
29
|
+
* @param thread - Thread ID (`thr_...`) identifying the thread to remove the member from.
|
|
30
|
+
* @returns Successful response
|
|
31
|
+
*/
|
|
12
32
|
async list(thread) {
|
|
13
33
|
return this.http.request(`/api/v1/threads/${thread}/members`);
|
|
14
34
|
}
|
|
35
|
+
/**
|
|
36
|
+
* Add a member to a thread
|
|
37
|
+
* Adds a user or agent as a member of the specified thread. The authenticated
|
|
38
|
+
* user must have access to the thread. On success the new membership record is
|
|
39
|
+
* returned with HTTP 201.
|
|
40
|
+
* Supply either `user` or `agent` depending on the value of `type`. Attempting
|
|
41
|
+
* to add a principal that is already a member of the thread returns a 422 error.
|
|
42
|
+
* @param thread - Thread ID (`thr_...`) identifying the thread to remove the member from.
|
|
43
|
+
* @param input - Request body.
|
|
44
|
+
* @param input.agent - Agent ID of the principal to add. Required when `type` is `"agent"`.
|
|
45
|
+
* @param input.membership_type - Role granted to the new member. One of `"owner"` or `"member"`. Defaults to `"member"`.
|
|
46
|
+
* @param input.type - Kind of principal being added. Must be `"user"` or `"agent"`.
|
|
47
|
+
* @param input.user - User ID of the principal to add. Required when `type` is `"user"`.
|
|
48
|
+
* @returns The newly created thread membership record.
|
|
49
|
+
*/
|
|
15
50
|
async create(thread, input) {
|
|
16
51
|
return this.http.request(`/api/v1/threads/${thread}/members`, { method: "POST", body: input });
|
|
17
52
|
}
|
|
@@ -21,9 +56,31 @@ export class SettingResource {
|
|
|
21
56
|
constructor(http) {
|
|
22
57
|
this.http = http;
|
|
23
58
|
}
|
|
59
|
+
/**
|
|
60
|
+
* Retrieve thread settings
|
|
61
|
+
* Returns the current settings for the specified thread. Settings control
|
|
62
|
+
* per-thread behavior such as whether the AI agent is enabled.
|
|
63
|
+
* The authenticated user must own the thread or be a member of its workspace.
|
|
64
|
+
* If settings have never been explicitly configured, defaults are returned
|
|
65
|
+
* (for example, `agent_enabled` defaults to `true`).
|
|
66
|
+
* @param thread - Thread ID (`thr_...`). Must belong to the authenticated user's workspace.
|
|
67
|
+
* @returns Successful response
|
|
68
|
+
*/
|
|
24
69
|
async list(thread) {
|
|
25
70
|
return this.http.request(`/api/v1/threads/${thread}/settings`);
|
|
26
71
|
}
|
|
72
|
+
/**
|
|
73
|
+
* Update thread settings
|
|
74
|
+
* Updates the settings for the specified thread. Only fields included in
|
|
75
|
+
* the `settings` map are modified; omitted fields retain their current values.
|
|
76
|
+
* The authenticated user must own the thread or be a member of its workspace.
|
|
77
|
+
* Returns the full settings object reflecting the state after the update.
|
|
78
|
+
* Validation errors are returned as `422 Unprocessable Entity`.
|
|
79
|
+
* @param thread - Thread ID (`thr_...`). Must belong to the authenticated user's workspace.
|
|
80
|
+
* @param input - Request body.
|
|
81
|
+
* @param input.settings - Map of settings fields to update. Include only the keys you want to change.
|
|
82
|
+
* @returns The thread settings object after the update has been applied.
|
|
83
|
+
*/
|
|
27
84
|
async replace(thread, input) {
|
|
28
85
|
return this.http.request(`/api/v1/threads/${thread}/settings`, { method: "PUT", body: input });
|
|
29
86
|
}
|
|
@@ -37,35 +94,194 @@ export class ThreadResource {
|
|
|
37
94
|
this.members = new ThreadMemberResource(http);
|
|
38
95
|
this.settings = new SettingResource(http);
|
|
39
96
|
}
|
|
97
|
+
/**
|
|
98
|
+
* Delete a thread
|
|
99
|
+
* Permanently deletes a thread and all of its messages and artifacts. This action
|
|
100
|
+
* cannot be undone.
|
|
101
|
+
* The authenticated user must own the thread or be an owner of the team the thread
|
|
102
|
+
* belongs to. Attempting to delete a thread owned by another user or team returns 403.
|
|
103
|
+
* @param thread - Thread ID (`thr_...`). The authenticated user must own this thread.
|
|
104
|
+
* @returns Empty response on successful deletion.
|
|
105
|
+
*/
|
|
40
106
|
async delete(thread) {
|
|
41
107
|
await this.http.request(`/api/v1/threads/${thread}`, { method: "DELETE" });
|
|
42
108
|
}
|
|
109
|
+
/**
|
|
110
|
+
* Retrieve a thread
|
|
111
|
+
* Returns the full thread record for the given thread ID. The authenticated user
|
|
112
|
+
* must own the thread or be a member of the workspace it belongs to.
|
|
113
|
+
* Use this endpoint to fetch the current state of a single thread, including its
|
|
114
|
+
* title, description, and metadata. To list many threads, use the list endpoint
|
|
115
|
+
* with cursor-based pagination.
|
|
116
|
+
* @param thread - Thread ID (`thr_...`). The authenticated user must have access to this thread.
|
|
117
|
+
* @returns The requested thread object.
|
|
118
|
+
*/
|
|
43
119
|
async get(thread) {
|
|
44
120
|
return this.http.request(`/api/v1/threads/${thread}`);
|
|
45
121
|
}
|
|
122
|
+
/**
|
|
123
|
+
* Update a thread
|
|
124
|
+
* Updates one or more mutable properties of the specified thread and returns
|
|
125
|
+
* the full thread object with the applied changes. Only the fields you provide
|
|
126
|
+
* are modified; omitted fields retain their current values.
|
|
127
|
+
* If `profile_picture` is supplied, the image is uploaded before the other
|
|
128
|
+
* fields are saved. Supplying invalid base64 picture data returns 422 and no
|
|
129
|
+
* other fields are updated.
|
|
130
|
+
* The authenticated user must own the thread or be a team owner of the workspace
|
|
131
|
+
* the thread belongs to.
|
|
132
|
+
* @param thread - Thread ID (`thr_...`). The authenticated user must have permission to update this thread.
|
|
133
|
+
* @param input - Request body.
|
|
134
|
+
* @param input.description - Optional longer text describing the thread's purpose. Replaces the existing description when provided.
|
|
135
|
+
* @param input.metadata - Arbitrary key-value metadata to store on the thread. Merged with or replaces existing metadata.
|
|
136
|
+
* @param input.muted - When `true`, suppresses notifications for new messages in this thread for the authenticated user.
|
|
137
|
+
* @param input.profile_picture - New profile picture for the thread. Provide all three inner fields to replace the existing image.
|
|
138
|
+
* @param input.title - Human-readable display name for the thread. Replaces the existing title when provided.
|
|
139
|
+
* @returns The thread object after the update has been applied.
|
|
140
|
+
*/
|
|
46
141
|
async replace(thread, input) {
|
|
47
142
|
return this.http.request(`/api/v1/threads/${thread}`, { method: "PUT", body: input });
|
|
48
143
|
}
|
|
144
|
+
/**
|
|
145
|
+
* List agents in a thread
|
|
146
|
+
* Returns the agents participating in the specified thread. Only personal user
|
|
147
|
+
* threads (threads owned by a single user, not a team) expose agents through
|
|
148
|
+
* this endpoint; requests for team threads return 404.
|
|
149
|
+
* The authenticated user must have visibility into the thread. Each agent entry
|
|
150
|
+
* includes display information such as name and profile picture. Thread-level
|
|
151
|
+
* overrides (e.g. a custom name or profile picture set for this thread) take
|
|
152
|
+
* precedence over the agent's default values. When the caller is the thread
|
|
153
|
+
* owner, each entry also includes an `agent_config` object describing the
|
|
154
|
+
* agent's message policy and context configuration.
|
|
155
|
+
* @param thread - Thread ID (`thr_...`). Must be a personal user thread visible to the authenticated user.
|
|
156
|
+
* @returns Successful response
|
|
157
|
+
*/
|
|
49
158
|
async agents(thread) {
|
|
50
159
|
return this.http.request(`/api/v1/threads/${thread}/agents`);
|
|
51
160
|
}
|
|
161
|
+
/**
|
|
162
|
+
* List artifacts for a thread
|
|
163
|
+
* Returns all artifacts produced during a thread's AI conversation. Artifacts are
|
|
164
|
+
* structured outputs such as code files, documents, or generated assets created
|
|
165
|
+
* by the AI agent in response to messages in the thread.
|
|
166
|
+
* The authenticated user must have access to the specified thread. Results are
|
|
167
|
+
* returned in a single page; there is no cursor-based pagination for this endpoint.
|
|
168
|
+
* @param thread - Thread ID (`thr_...`). Must be accessible to the authenticated user.
|
|
169
|
+
* @returns Successful response
|
|
170
|
+
*/
|
|
52
171
|
async artifacts(thread) {
|
|
53
172
|
return this.http.request(`/api/v1/threads/${thread}/artifacts`);
|
|
54
173
|
}
|
|
174
|
+
/**
|
|
175
|
+
* Mark a thread as read
|
|
176
|
+
* Records that a user has read up to a specific message in the thread. Unread
|
|
177
|
+
* indicators and badge counts are cleared up to the specified message.
|
|
178
|
+
* You must supply exactly one of `last_read_message` or `use_latest_message`.
|
|
179
|
+
* Omitting both returns 400. If `use_latest_message` is `true` and the thread
|
|
180
|
+
* has no messages, the request succeeds silently with no state change.
|
|
181
|
+
* For server-to-server (S2S) requests where no user identity is present in the
|
|
182
|
+
* token, the `user` param is required to identify whose read state to update.
|
|
183
|
+
* @param thread - Thread ID (`thr_...`). The thread to mark as read.
|
|
184
|
+
* @param input - Request body.
|
|
185
|
+
* @param input.last_read_message - Message ID (`msg_...`) to record as the last read message. Mutually exclusive with `use_latest_message`.
|
|
186
|
+
* @param input.use_latest_message - When `true`, marks the thread as read up to the latest message. Mutually exclusive with `last_read_message`.
|
|
187
|
+
* @param input.user - User ID (`usr_...`) whose read state to update. Required for S2S requests; ignored when an authenticated user is present in the token.
|
|
188
|
+
* @returns Empty response on success.
|
|
189
|
+
*/
|
|
55
190
|
async markRead(thread, input) {
|
|
56
191
|
await this.http.request(`/api/v1/threads/${thread}/mark_read`, { method: "POST", body: input });
|
|
57
192
|
}
|
|
193
|
+
/**
|
|
194
|
+
* List messages in a thread
|
|
195
|
+
* Returns a cursor-paginated list of messages belonging to the specified thread,
|
|
196
|
+
* ordered from oldest to newest. Supply `before_cursor` or `after_cursor` (not both)
|
|
197
|
+
* to page through the result set; omit both to receive the most recent page.
|
|
198
|
+
* The authenticated user must have access to the thread's owner (workspace or user).
|
|
199
|
+
* A 403 is returned if the thread exists but is not accessible to the caller; a 404
|
|
200
|
+
* is returned if the thread does not exist or is not visible to the authenticated user.
|
|
201
|
+
* Pass `include_reply_counts: true` to annotate each message with the number of
|
|
202
|
+
* threaded replies it has received. This adds a small amount of latency and should
|
|
203
|
+
* be omitted when reply counts are not needed.
|
|
204
|
+
* @param thread - Thread ID (`thr_...`). The authenticated user must have access to this thread.
|
|
205
|
+
* @param params - Query parameters.
|
|
206
|
+
* @param params.beforeCursor - Opaque cursor returned in a previous response's `before_cursor` field. When provided, returns the page of messages immediately before that position. Cannot be combined with `after_cursor`.
|
|
207
|
+
* @param params.afterCursor - Opaque cursor returned in a previous response's `after_cursor` field. When provided, returns the page of messages immediately after that position. Cannot be combined with `before_cursor`.
|
|
208
|
+
* @param params.limit - Maximum number of messages to return per page. Defaults to 20.
|
|
209
|
+
* @param params.includeReplyCounts - When `true`, each message in the response is annotated with its threaded reply count. Defaults to `false`. Adds latency; omit when reply counts are not needed.
|
|
210
|
+
* @returns Successful response
|
|
211
|
+
*/
|
|
58
212
|
async messages(thread, params) {
|
|
59
|
-
|
|
213
|
+
const query = {};
|
|
214
|
+
if (params?.beforeCursor !== undefined) {
|
|
215
|
+
query["before_cursor"] = params?.beforeCursor;
|
|
216
|
+
}
|
|
217
|
+
if (params?.afterCursor !== undefined) {
|
|
218
|
+
query["after_cursor"] = params?.afterCursor;
|
|
219
|
+
}
|
|
220
|
+
if (params?.limit !== undefined) {
|
|
221
|
+
query["limit"] = params?.limit;
|
|
222
|
+
}
|
|
223
|
+
if (params?.includeReplyCounts !== undefined) {
|
|
224
|
+
query["include_reply_counts"] = params?.includeReplyCounts;
|
|
225
|
+
}
|
|
226
|
+
return this.http.request(`/api/v1/threads/${thread}/messages`, { query });
|
|
60
227
|
}
|
|
228
|
+
/**
|
|
229
|
+
* Update a thread's profile picture
|
|
230
|
+
* Uploads a new profile picture for the specified thread and returns the updated
|
|
231
|
+
* thread object. The image must be supplied as a base64-encoded string with its
|
|
232
|
+
* MIME type.
|
|
233
|
+
* The authenticated user must own the thread or be a team owner of the workspace
|
|
234
|
+
* the thread belongs to. Supplying invalid base64 data returns 422.
|
|
235
|
+
* @param thread - Thread ID (`thr_...`). The authenticated user must have permission to update this thread.
|
|
236
|
+
* @param input - Request body.
|
|
237
|
+
* @param input.picture - Profile picture payload. Must include the base64-encoded image data and its MIME type.
|
|
238
|
+
* @returns The thread object after the profile picture has been updated.
|
|
239
|
+
*/
|
|
61
240
|
async picture(thread, input) {
|
|
62
241
|
return this.http.request(`/api/v1/threads/${thread}/picture`, { method: "PUT", body: input });
|
|
63
242
|
}
|
|
243
|
+
/**
|
|
244
|
+
* Retrieve a thread's read status
|
|
245
|
+
* Returns the read status of a thread for the specified user, including the ID
|
|
246
|
+
* of the last message they have read and the number of unread messages remaining.
|
|
247
|
+
* For user-authenticated requests, the status is always returned for the
|
|
248
|
+
* authenticated user and the `user` parameter is ignored. For server-to-server
|
|
249
|
+
* (S2S) requests, the `user` parameter is required and must be a valid user ID.
|
|
250
|
+
* Returns 404 if the thread does not exist or the caller does not have access
|
|
251
|
+
* to it.
|
|
252
|
+
* @param thread - Thread ID (`thr_...`). Must be accessible to the authenticated user or, for S2S requests, to the specified user.
|
|
253
|
+
* @param params - Query parameters.
|
|
254
|
+
* @param params.user - User ID (`usr_...`) whose read status to retrieve. Required for S2S requests; ignored for user-authenticated requests, which always return the status for the authenticated user.
|
|
255
|
+
* @returns The read status record for the requested thread and user.
|
|
256
|
+
*/
|
|
64
257
|
async readStatus(thread, params) {
|
|
65
|
-
|
|
258
|
+
const query = {};
|
|
259
|
+
if (params?.user !== undefined) {
|
|
260
|
+
query["user"] = params?.user;
|
|
261
|
+
}
|
|
262
|
+
return this.http.request(`/api/v1/threads/${thread}/read_status`, { query });
|
|
66
263
|
}
|
|
264
|
+
/**
|
|
265
|
+
* Search context items within a thread
|
|
266
|
+
* Performs a full-text search over context items (messages, files, and other
|
|
267
|
+
* indexed sources) attached to the specified thread. Returns tagged objects
|
|
268
|
+
* whose content matches the query string.
|
|
269
|
+
* Use the `type` param to restrict results to a particular context source. All
|
|
270
|
+
* accessible context source types are searched when `type` is omitted. The
|
|
271
|
+
* authenticated user must have access to the thread.
|
|
272
|
+
* @param thread - Thread ID (`thr_...`). Must be accessible to the authenticated user.
|
|
273
|
+
* @param params - Query parameters.
|
|
274
|
+
* @param params.q - Full-text search query. Results are ranked by relevance to this string.
|
|
275
|
+
* @param params.type - Context source type to restrict the search to, e.g. `"thread/messages"`. Omit to search across all context sources for the thread.
|
|
276
|
+
* @returns Successful response
|
|
277
|
+
*/
|
|
67
278
|
async search(thread, params) {
|
|
68
|
-
|
|
279
|
+
const query = {};
|
|
280
|
+
query["q"] = params?.q;
|
|
281
|
+
if (params?.type !== undefined) {
|
|
282
|
+
query["type"] = params?.type;
|
|
283
|
+
}
|
|
284
|
+
return this.http.request(`/api/v1/threads/${thread}/search`, { query });
|
|
69
285
|
}
|
|
70
286
|
}
|
|
71
287
|
//# sourceMappingURL=threads.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"threads.js","sourceRoot":"","sources":["../../../src/v1/resources/threads.ts"],"names":[],"mappings":"AAAA,yDAAyD;AACzD,wEAAwE;AACxE,6BAA6B;AAK7B,MAAM,OAAO,oBAAoB;IACX;IAApB,YAAoB,IAAgB;QAAhB,SAAI,GAAJ,IAAI,CAAY;IAAG,CAAC;IAExC,KAAK,CAAC,MAAM,CAAC,MAAc;QACzB,MAAM,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,mBAAmB,MAAM,UAAU,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAC;IACrF,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,MAAc;QACvB,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,mBAAmB,MAAM,UAAU,CAAC,CAAC;IAChE,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,MAAc,EAAE,KAAoH;QAC/I,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,mBAAmB,MAAM,UAAU,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;IACjG,CAAC;CACF;AAED,MAAM,OAAO,eAAe;IACN;IAApB,YAAoB,IAAgB;QAAhB,SAAI,GAAJ,IAAI,CAAY;IAAG,CAAC;IAExC,KAAK,CAAC,IAAI,CAAC,MAAc;QACvB,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,mBAAmB,MAAM,WAAW,CAAC,CAAC;IACjE,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,MAAc,EAAE,KAA4C;QACxE,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,mBAAmB,MAAM,WAAW,EAAE,EAAE,MAA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AC;QAC/B,CAAC;QAED,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,mBAAmB,MAAM,SAAS,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;IAC1E,CAAC;CACF"}
|
|
@@ -1,47 +1,25 @@
|
|
|
1
1
|
import { HttpClient } from "../../runtime/http-client.js";
|
|
2
|
-
import type { Artifact } from "../../types/artifacts.js";
|
|
3
2
|
import type { Thread } from "../../types/threads.js";
|
|
4
3
|
import type { User, UserInvite } from "../../types/users.js";
|
|
5
|
-
export declare class UserArtifactResource {
|
|
6
|
-
private http;
|
|
7
|
-
constructor(http: HttpClient);
|
|
8
|
-
list(user: string): Promise<{
|
|
9
|
-
data: {
|
|
10
|
-
agent?: string | undefined;
|
|
11
|
-
content_type?: string | undefined;
|
|
12
|
-
created_at?: string | undefined;
|
|
13
|
-
current_version?: string | undefined;
|
|
14
|
-
description?: string | undefined;
|
|
15
|
-
file?: string | undefined;
|
|
16
|
-
file_name?: string | undefined;
|
|
17
|
-
file_url?: string | undefined;
|
|
18
|
-
id: string;
|
|
19
|
-
image_source?: {
|
|
20
|
-
file?: string | undefined;
|
|
21
|
-
height?: number | undefined;
|
|
22
|
-
media?: string | undefined;
|
|
23
|
-
mime_type?: string | undefined;
|
|
24
|
-
refresh_url?: string | undefined;
|
|
25
|
-
url?: string | undefined;
|
|
26
|
-
width?: number | undefined;
|
|
27
|
-
} | undefined;
|
|
28
|
-
name?: string | undefined;
|
|
29
|
-
org?: string | undefined;
|
|
30
|
-
sandbox?: string | undefined;
|
|
31
|
-
team?: string | undefined;
|
|
32
|
-
thread?: string | undefined;
|
|
33
|
-
updated_at?: string | undefined;
|
|
34
|
-
user?: string | undefined;
|
|
35
|
-
version?: number | undefined;
|
|
36
|
-
}[];
|
|
37
|
-
}>;
|
|
38
|
-
create(user: string, input: {
|
|
39
|
-
artifact: Record<string, unknown>;
|
|
40
|
-
}): Promise<Artifact>;
|
|
41
|
-
}
|
|
42
4
|
export declare class UserThreadResource {
|
|
43
5
|
private http;
|
|
44
6
|
constructor(http: HttpClient);
|
|
7
|
+
/**
|
|
8
|
+
* List threads for a user
|
|
9
|
+
* Returns all threads visible to the specified user. The authenticated caller must
|
|
10
|
+
* have access to the target user's account; a 403 is returned otherwise.
|
|
11
|
+
* Pass one or more `agent` IDs to narrow results to threads where at least one of
|
|
12
|
+
* the listed agents is also a member — useful for displaying every thread a user
|
|
13
|
+
* shares with a particular agent. Pass one or more `filter` objects to narrow
|
|
14
|
+
* results by thread metadata key/value pairs. Both narrowings may be combined in
|
|
15
|
+
* a single request.
|
|
16
|
+
* Results are returned as a flat array; no cursor-based pagination is applied.
|
|
17
|
+
* @param user - User ID (`usr_...`) whose threads should be listed.
|
|
18
|
+
* @param params - Query parameters.
|
|
19
|
+
* @param params.agent - Array of agent user IDs (`usr_...`). When provided, only threads where at least one of the listed agents is also a member are returned. Omit or pass an empty array to return all threads regardless of agent membership.
|
|
20
|
+
* @param params.filter - Array of metadata filter objects. Each filter matches threads whose `metadata` map contains the specified key/value pair. All filters must match (logical AND). Omit to return threads regardless of metadata.
|
|
21
|
+
* @returns Successful response
|
|
22
|
+
*/
|
|
45
23
|
list(user: string, params?: {
|
|
46
24
|
agent?: string[];
|
|
47
25
|
filter?: {
|
|
@@ -55,12 +33,18 @@ export declare class UserThreadResource {
|
|
|
55
33
|
created_at?: string | undefined;
|
|
56
34
|
creator?: {
|
|
57
35
|
alias?: string | undefined;
|
|
36
|
+
app?: string | undefined;
|
|
37
|
+
app_name?: string | undefined;
|
|
58
38
|
email?: string | undefined;
|
|
59
39
|
id: string;
|
|
40
|
+
is_system_user?: boolean | undefined;
|
|
60
41
|
metadata?: Record<string, unknown> | undefined;
|
|
61
42
|
name?: string | undefined;
|
|
62
43
|
org?: string | undefined;
|
|
44
|
+
org_name?: string | undefined;
|
|
45
|
+
org_role?: string | undefined;
|
|
63
46
|
sandbox?: string | undefined;
|
|
47
|
+
sandbox_name?: string | undefined;
|
|
64
48
|
} | undefined;
|
|
65
49
|
description?: string | undefined;
|
|
66
50
|
id: string;
|
|
@@ -71,6 +55,7 @@ export declare class UserThreadResource {
|
|
|
71
55
|
key?: string | undefined;
|
|
72
56
|
last_activity?: string | undefined;
|
|
73
57
|
metadata?: Record<string, unknown> | undefined;
|
|
58
|
+
muted?: boolean | undefined;
|
|
74
59
|
org?: string | undefined;
|
|
75
60
|
parent_message?: {
|
|
76
61
|
actors?: {
|
|
@@ -164,12 +149,18 @@ export declare class UserThreadResource {
|
|
|
164
149
|
participant?: string[] | undefined;
|
|
165
150
|
participants?: {
|
|
166
151
|
alias?: string | undefined;
|
|
152
|
+
app?: string | undefined;
|
|
153
|
+
app_name?: string | undefined;
|
|
167
154
|
email?: string | undefined;
|
|
168
155
|
id: string;
|
|
156
|
+
is_system_user?: boolean | undefined;
|
|
169
157
|
metadata?: Record<string, unknown> | undefined;
|
|
170
158
|
name?: string | undefined;
|
|
171
159
|
org?: string | undefined;
|
|
160
|
+
org_name?: string | undefined;
|
|
161
|
+
org_role?: string | undefined;
|
|
172
162
|
sandbox?: string | undefined;
|
|
163
|
+
sandbox_name?: string | undefined;
|
|
173
164
|
}[] | undefined;
|
|
174
165
|
participating_actor?: string[] | undefined;
|
|
175
166
|
participating_agents?: {
|
|
@@ -195,12 +186,71 @@ export declare class UserThreadResource {
|
|
|
195
186
|
email?: string | undefined;
|
|
196
187
|
id: string;
|
|
197
188
|
identity?: string | undefined;
|
|
189
|
+
last_applied_template_config?: string | undefined;
|
|
198
190
|
lookup_key?: string | undefined;
|
|
199
191
|
metadata?: Record<string, unknown> | undefined;
|
|
200
192
|
name?: string | undefined;
|
|
201
193
|
org?: string | undefined;
|
|
194
|
+
org_name?: string | undefined;
|
|
195
|
+
originator?: string | undefined;
|
|
202
196
|
phone_number?: string | undefined;
|
|
203
197
|
sandbox?: string | undefined;
|
|
198
|
+
source_solution?: {
|
|
199
|
+
solution: {
|
|
200
|
+
category_keys?: string[] | undefined;
|
|
201
|
+
created_at?: string | undefined;
|
|
202
|
+
description?: string | undefined;
|
|
203
|
+
id: string;
|
|
204
|
+
kind: string;
|
|
205
|
+
latest_solution?: string | undefined;
|
|
206
|
+
latest_version?: string | undefined;
|
|
207
|
+
lookup_key?: string | undefined;
|
|
208
|
+
metadata?: Record<string, unknown> | undefined;
|
|
209
|
+
name?: string | undefined;
|
|
210
|
+
org?: string | undefined;
|
|
211
|
+
org_logo?: {
|
|
212
|
+
file?: string | undefined;
|
|
213
|
+
height?: number | undefined;
|
|
214
|
+
media?: string | undefined;
|
|
215
|
+
mime_type?: string | undefined;
|
|
216
|
+
refresh_url?: string | undefined;
|
|
217
|
+
url?: string | undefined;
|
|
218
|
+
width?: number | undefined;
|
|
219
|
+
} | undefined;
|
|
220
|
+
org_name?: string | undefined;
|
|
221
|
+
org_slug?: string | undefined;
|
|
222
|
+
owners: string[];
|
|
223
|
+
readme_url?: string | undefined;
|
|
224
|
+
solution_id?: string | undefined;
|
|
225
|
+
solution_version?: string | undefined;
|
|
226
|
+
tag_keys?: string[] | undefined;
|
|
227
|
+
template_kind?: string | undefined;
|
|
228
|
+
templates: {
|
|
229
|
+
description?: string | undefined;
|
|
230
|
+
display_name?: string | undefined;
|
|
231
|
+
id?: string | undefined;
|
|
232
|
+
kind: string;
|
|
233
|
+
lookup_key?: string | undefined;
|
|
234
|
+
name?: string | undefined;
|
|
235
|
+
readme_url?: string | undefined;
|
|
236
|
+
virtual_path?: string | undefined;
|
|
237
|
+
}[];
|
|
238
|
+
updated_at?: string | undefined;
|
|
239
|
+
upgrade_available: boolean;
|
|
240
|
+
virtual_path?: string | undefined;
|
|
241
|
+
};
|
|
242
|
+
template: {
|
|
243
|
+
created_at?: string | undefined;
|
|
244
|
+
description?: string | undefined;
|
|
245
|
+
display_name?: string | undefined;
|
|
246
|
+
id: string;
|
|
247
|
+
kind: string;
|
|
248
|
+
lookup_key?: string | undefined;
|
|
249
|
+
name?: string | undefined;
|
|
250
|
+
updated_at?: string | undefined;
|
|
251
|
+
virtual_path?: string | undefined;
|
|
252
|
+
};
|
|
253
|
+
} | undefined;
|
|
204
254
|
team?: string | undefined;
|
|
205
255
|
updated_at?: string | undefined;
|
|
206
256
|
user?: string | undefined;
|
|
@@ -220,6 +270,19 @@ export declare class UserThreadResource {
|
|
|
220
270
|
user?: string | undefined;
|
|
221
271
|
}[];
|
|
222
272
|
}>;
|
|
273
|
+
/**
|
|
274
|
+
* Create a thread for a user
|
|
275
|
+
* Creates a new thread owned by the specified user. The authenticated caller must
|
|
276
|
+
* have access to the target user's account; a 403 is returned otherwise.
|
|
277
|
+
* An automatic welcome message is sent into the thread upon creation unless
|
|
278
|
+
* `skip_welcome_message` is set to `true`. The thread is immediately visible to
|
|
279
|
+
* the owning user and any members added at creation time.
|
|
280
|
+
* @param user - User ID (`usr_...`) whose threads should be listed.
|
|
281
|
+
* @param input - Request body.
|
|
282
|
+
* @param input.skip_welcome_message - When `true`, suppresses the automatic welcome message that is otherwise sent into the thread on creation. Defaults to `false`.
|
|
283
|
+
* @param input.thread - Attributes for the new thread. See ThreadCreateParams for the full set of accepted fields.
|
|
284
|
+
* @returns The newly created thread object.
|
|
285
|
+
*/
|
|
223
286
|
create(user: string, input: {
|
|
224
287
|
skip_welcome_message?: boolean | undefined;
|
|
225
288
|
thread: {
|
|
@@ -228,6 +291,7 @@ export declare class UserThreadResource {
|
|
|
228
291
|
is_unlisted?: boolean | undefined;
|
|
229
292
|
key?: string | undefined;
|
|
230
293
|
metadata?: Record<string, unknown> | undefined;
|
|
294
|
+
muted?: boolean | undefined;
|
|
231
295
|
org_id?: string | undefined;
|
|
232
296
|
profile_picture?: {
|
|
233
297
|
data?: string | undefined;
|
|
@@ -243,11 +307,94 @@ export declare class UserThreadResource {
|
|
|
243
307
|
}
|
|
244
308
|
export declare class UserResource {
|
|
245
309
|
private http;
|
|
246
|
-
readonly artifacts: UserArtifactResource;
|
|
247
310
|
readonly threads: UserThreadResource;
|
|
248
311
|
constructor(http: HttpClient);
|
|
312
|
+
/**
|
|
313
|
+
* Retrieve the current user
|
|
314
|
+
* Returns the user associated with the authenticated session or bearer
|
|
315
|
+
* token. This is the canonical way to resolve "who am I?" after
|
|
316
|
+
* authentication.
|
|
317
|
+
* The response includes the user's profile, notification settings, and
|
|
318
|
+
* profile picture, along with the app, organization, and sandbox the
|
|
319
|
+
* token is scoped to and their display names — enough to establish full
|
|
320
|
+
* session context in a single call. Unauthenticated requests return 401.
|
|
321
|
+
* @returns The authenticated user object.
|
|
322
|
+
*/
|
|
249
323
|
me(): Promise<User>;
|
|
324
|
+
/**
|
|
325
|
+
* Retrieve a user by ID
|
|
326
|
+
* Returns the user identified by `user`. The authenticated user must share
|
|
327
|
+
* at least one team with the target user; requests for users outside any
|
|
328
|
+
* shared team are rejected with 403.
|
|
329
|
+
* A user may always retrieve their own profile with this endpoint. Use the
|
|
330
|
+
* `GET /users/me` endpoint as a convenience alias for retrieving the
|
|
331
|
+
* authenticated user without specifying an ID.
|
|
332
|
+
* @param user - User ID (`usr_...`) of the user to retrieve.
|
|
333
|
+
* @returns The requested user object.
|
|
334
|
+
*/
|
|
250
335
|
get(user: string): Promise<User>;
|
|
336
|
+
/**
|
|
337
|
+
* List a user's artifacts
|
|
338
|
+
* Returns all artifacts owned by the specified user. Artifacts represent
|
|
339
|
+
* AI-generated or user-uploaded files associated with agent sessions,
|
|
340
|
+
* threads, or sandboxes — such as images, documents, and code outputs.
|
|
341
|
+
* The authenticated user must be requesting their own artifacts or must
|
|
342
|
+
* have administrative access. Attempting to list artifacts for a user
|
|
343
|
+
* the caller is not authorized to access returns 403.
|
|
344
|
+
* Results are returned in a single page without cursor pagination. Each
|
|
345
|
+
* artifact in the response reflects the state of its current version,
|
|
346
|
+
* including a short-lived signed `file_url` for direct download.
|
|
347
|
+
* @param user - User ID (`usr_...`). The authenticated user must be this user or have access to their artifacts.
|
|
348
|
+
* @returns Successful response
|
|
349
|
+
*/
|
|
350
|
+
artifacts(user: string): Promise<{
|
|
351
|
+
data: {
|
|
352
|
+
agent?: string | undefined;
|
|
353
|
+
content_type?: string | undefined;
|
|
354
|
+
created_at?: string | undefined;
|
|
355
|
+
current_version?: string | undefined;
|
|
356
|
+
description?: string | undefined;
|
|
357
|
+
file?: string | undefined;
|
|
358
|
+
file_name?: string | undefined;
|
|
359
|
+
file_url?: string | undefined;
|
|
360
|
+
id: string;
|
|
361
|
+
image_source?: {
|
|
362
|
+
file?: string | undefined;
|
|
363
|
+
height?: number | undefined;
|
|
364
|
+
media?: string | undefined;
|
|
365
|
+
mime_type?: string | undefined;
|
|
366
|
+
refresh_url?: string | undefined;
|
|
367
|
+
url?: string | undefined;
|
|
368
|
+
width?: number | undefined;
|
|
369
|
+
} | undefined;
|
|
370
|
+
name?: string | undefined;
|
|
371
|
+
org?: string | undefined;
|
|
372
|
+
sandbox?: string | undefined;
|
|
373
|
+
team?: string | undefined;
|
|
374
|
+
thread?: string | undefined;
|
|
375
|
+
updated_at?: string | undefined;
|
|
376
|
+
user?: string | undefined;
|
|
377
|
+
version?: number | undefined;
|
|
378
|
+
}[];
|
|
379
|
+
}>;
|
|
380
|
+
/**
|
|
381
|
+
* Create a user invite
|
|
382
|
+
* Creates a new invite for the authenticated user. The invite can optionally be
|
|
383
|
+
* scoped to a specific thread, a persona, or carry arbitrary metadata. The
|
|
384
|
+
* caller receives the new invite object at HTTP 201.
|
|
385
|
+
* The invite key is always generated server-side (192-bit URL-safe random
|
|
386
|
+
* string) and cannot be supplied by the caller.
|
|
387
|
+
* The path `:user` must match the authenticated user. If a `thread_id` is
|
|
388
|
+
* provided, the authenticated user must have permission to invite others to that
|
|
389
|
+
* thread; team threads are not supported and return an error. Supplying a
|
|
390
|
+
* `thread_id` that does not exist or that belongs to a different user returns
|
|
391
|
+
* an error. If a key collision occurs during creation the call returns a 409
|
|
392
|
+
* conflict — simply retry to generate a new key.
|
|
393
|
+
* @param user - User ID (`usr_...`). Must match the authenticated user.
|
|
394
|
+
* @param input - Request body.
|
|
395
|
+
* @param input.invite - Parameters for the new invite. See the UserInviteCreateParams schema for field details.
|
|
396
|
+
* @returns The newly created invite object.
|
|
397
|
+
*/
|
|
251
398
|
invites(user: string, input: {
|
|
252
399
|
invite: {
|
|
253
400
|
metadata?: Record<string, unknown> | undefined;
|
|
@@ -255,6 +402,16 @@ export declare class UserResource {
|
|
|
255
402
|
thread_id?: string | undefined;
|
|
256
403
|
};
|
|
257
404
|
}): Promise<UserInvite>;
|
|
405
|
+
/**
|
|
406
|
+
* List organizations for a user
|
|
407
|
+
* Returns the organizations the specified user belongs to. A user can belong
|
|
408
|
+
* to at most one organization, so the `data` array contains either zero or one
|
|
409
|
+
* items.
|
|
410
|
+
* The authenticated viewer must have permission to inspect the target user.
|
|
411
|
+
* Returns an empty `data` array when the user has no organization membership.
|
|
412
|
+
* @param user - User ID (`usr_...`) whose organization membership you want to retrieve.
|
|
413
|
+
* @returns Successful response
|
|
414
|
+
*/
|
|
258
415
|
orgs(user: string): Promise<{
|
|
259
416
|
data: {
|
|
260
417
|
created_at?: string | undefined;
|
|
@@ -263,6 +420,7 @@ export declare class UserResource {
|
|
|
263
420
|
id: string;
|
|
264
421
|
industry?: string | undefined;
|
|
265
422
|
name?: string | undefined;
|
|
423
|
+
onboarding_track?: string | undefined;
|
|
266
424
|
sandbox?: string | undefined;
|
|
267
425
|
slug?: string | undefined;
|
|
268
426
|
status?: string | undefined;
|
|
@@ -270,6 +428,22 @@ export declare class UserResource {
|
|
|
270
428
|
website?: string | undefined;
|
|
271
429
|
}[];
|
|
272
430
|
}>;
|
|
431
|
+
/**
|
|
432
|
+
* Update the current user's profile
|
|
433
|
+
* Updates one or more profile fields for the authenticated user. All
|
|
434
|
+
* fields are optional; omit any you do not want to change.
|
|
435
|
+
* When `profile_picture` is supplied, the image is uploaded and replaces
|
|
436
|
+
* the existing picture. The previous picture is deleted after the new one
|
|
437
|
+
* is stored. Image upload failures return 422 without modifying other
|
|
438
|
+
* profile fields.
|
|
439
|
+
* @param user - User ID (`usr_...`) or `"me"` for the authenticated user.
|
|
440
|
+
* @param input - Request body.
|
|
441
|
+
* @param input.alias - Short display alias shown in place of the full name in compact UI contexts.
|
|
442
|
+
* @param input.full_name - Updated display name for the user.
|
|
443
|
+
* @param input.metadata - Arbitrary key-value metadata to associate with the user. Existing keys are merged; pass `null` for a key to remove it.
|
|
444
|
+
* @param input.profile_picture - New profile picture to upload as a base64-encoded image. Replaces any existing picture.
|
|
445
|
+
* @returns The user object with updated profile fields.
|
|
446
|
+
*/
|
|
273
447
|
profile(user: string, input: {
|
|
274
448
|
alias?: string | undefined;
|
|
275
449
|
full_name?: string | undefined;
|