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