@opengeni/contracts 5.4.0 → 5.5.0-canary.36927100590001
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/dist/agent-config.d.ts +872 -0
- package/dist/allowance-refusal.d.ts +9 -0
- package/dist/allowance-refusal.js +50 -0
- package/dist/allowance-refusal.js.map +1 -0
- package/dist/api-key-presets.d.ts +19 -0
- package/dist/atlassian.js +8 -6
- package/dist/{chunk-U56WR2ES.js → chunk-BHKAFQNX.js} +9873 -8307
- package/dist/chunk-BHKAFQNX.js.map +1 -0
- package/dist/chunk-EK7NDGFR.js +128 -0
- package/dist/chunk-EK7NDGFR.js.map +1 -0
- package/dist/chunk-KHHZTBP7.js +11 -0
- package/dist/chunk-KHHZTBP7.js.map +1 -0
- package/dist/{chunk-IABHGRIB.js → chunk-O77VSFYZ.js} +9 -2
- package/dist/chunk-O77VSFYZ.js.map +1 -0
- package/dist/{chunk-P3HLDT77.js → chunk-QR5D2IQC.js} +3 -1
- package/dist/chunk-QR5D2IQC.js.map +1 -0
- package/dist/{chunk-RSYFTR5M.js → chunk-VYSAG53F.js} +2 -2
- package/dist/{chunk-YWMOIZ6A.js → chunk-ZO7D7PXS.js} +2 -2
- package/dist/claude-subscription-oauth.d.ts +17 -0
- package/dist/connect.js +8 -6
- package/dist/connect.js.map +1 -1
- package/dist/connection-authority.js +9 -7
- package/dist/external-identities.d.ts +10 -0
- package/dist/external-identities.js +2 -2
- package/dist/google-drive.js +8 -6
- package/dist/google-drive.js.map +1 -1
- package/dist/host-mcp-bindings.js +10 -8
- package/dist/host-mcp-bindings.js.map +1 -1
- package/dist/index.d.ts +2626 -19
- package/dist/index.js +284 -48
- package/dist/model-context-inspector.d.ts +86 -0
- package/dist/organization-membership-lifecycle.d.ts +3 -0
- package/dist/permissions.d.ts +1 -0
- package/dist/personal-github.js +8 -6
- package/dist/personal-github.js.map +1 -1
- package/dist/product-analytics.d.ts +12 -0
- package/dist/product-lifecycle-facts.d.ts +24 -1
- package/dist/session-final-reply.d.ts +6 -0
- package/dist/session-final-reply.js +9 -0
- package/dist/session-final-reply.js.map +1 -0
- package/dist/session-history-import.d.ts +944 -0
- package/dist/usage-allowances.d.ts +285 -0
- package/dist/usage-allowances.js +49 -0
- package/dist/usage-allowances.js.map +1 -0
- package/dist/workspace-integration-wire.d.ts +12 -1
- package/dist/workspace-integration-wire.js +5 -1
- package/dist/workspace-integrations.d.ts +374 -32
- package/package.json +13 -1
- package/src/agent-config.ts +1539 -0
- package/src/allowance-refusal.ts +81 -0
- package/src/api-key-presets.ts +25 -0
- package/src/claude-subscription-oauth.ts +32 -0
- package/src/index.ts +334 -35
- package/src/model-context-inspector.ts +13 -0
- package/src/permissions.ts +2 -0
- package/src/product-analytics.ts +13 -0
- package/src/product-lifecycle-facts.ts +45 -19
- package/src/session-final-reply.ts +16 -0
- package/src/session-goal-reports.ts +11 -1
- package/src/session-history-import.ts +159 -0
- package/src/usage-allowances.ts +187 -0
- package/src/workspace-integration-wire.ts +16 -0
- package/src/workspace-integrations.ts +201 -5
- package/dist/chunk-IABHGRIB.js.map +0 -1
- package/dist/chunk-P3HLDT77.js.map +0 -1
- package/dist/chunk-U56WR2ES.js.map +0 -1
- /package/dist/{chunk-RSYFTR5M.js.map → chunk-VYSAG53F.js.map} +0 -0
- /package/dist/{chunk-YWMOIZ6A.js.map → chunk-ZO7D7PXS.js.map} +0 -0
|
@@ -0,0 +1,872 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent configuration: one `agent` object that describes what an OpenGeni
|
|
3
|
+
* agent is (identity), how it answers (renderer, instructions alias) and what
|
|
4
|
+
* it can do (capabilities). Capabilities are product words; this module owns
|
|
5
|
+
* the single registry that maps every first-party tool to exactly one of them
|
|
6
|
+
* and the pure resolution shared by every session creator (API, MCP child,
|
|
7
|
+
* Slack, scheduled tasks, automations) and the mid-session update.
|
|
8
|
+
*
|
|
9
|
+
* Invariants:
|
|
10
|
+
* - `"all"` reproduces the creator's legacy tool values exactly: capability
|
|
11
|
+
* filtering only removes tools of capabilities that are OFF, and every
|
|
12
|
+
* capability is ON under `"all"` (deployment-disabled capabilities are
|
|
13
|
+
* reported but never rewrite the stored selection; the runtime enforces them).
|
|
14
|
+
* - A session with no configuration (`null`) keeps byte-identical legacy
|
|
15
|
+
* behavior; nothing here runs for it.
|
|
16
|
+
* - Children and agent callers may only narrow.
|
|
17
|
+
*
|
|
18
|
+
* This module must not import runtime values from `./index` (the index
|
|
19
|
+
* re-exports it); only types cross that edge.
|
|
20
|
+
*/
|
|
21
|
+
import { z } from "zod";
|
|
22
|
+
import type { FirstPartyMcpToolName, SessionToolPolicy, ToolRef } from "./index.js";
|
|
23
|
+
export declare const AGENT_CAPABILITY_IDS: readonly ["webSearch", "humanInput", "skills", "goals", "subagents", "knowledge", "schedules", "artifacts", "browser", "media", "workspaceFiles", "workspaceConnectors", "workspaceAdmin"];
|
|
24
|
+
export declare const AgentCapabilityId: z.ZodEnum<{
|
|
25
|
+
artifacts: "artifacts";
|
|
26
|
+
browser: "browser";
|
|
27
|
+
goals: "goals";
|
|
28
|
+
humanInput: "humanInput";
|
|
29
|
+
knowledge: "knowledge";
|
|
30
|
+
media: "media";
|
|
31
|
+
schedules: "schedules";
|
|
32
|
+
skills: "skills";
|
|
33
|
+
subagents: "subagents";
|
|
34
|
+
webSearch: "webSearch";
|
|
35
|
+
workspaceAdmin: "workspaceAdmin";
|
|
36
|
+
workspaceConnectors: "workspaceConnectors";
|
|
37
|
+
workspaceFiles: "workspaceFiles";
|
|
38
|
+
}>;
|
|
39
|
+
export type AgentCapabilityId = z.infer<typeof AgentCapabilityId>;
|
|
40
|
+
/** Boolean capabilities: every capability except the three-state `skills`. */
|
|
41
|
+
export type AgentBooleanCapabilityId = Exclude<AgentCapabilityId, "skills">;
|
|
42
|
+
export declare const AGENT_BOOLEAN_CAPABILITY_IDS: AgentBooleanCapabilityId[];
|
|
43
|
+
/** `read` reads installed Skills; `manage` also saves/installs/publishes/removes. */
|
|
44
|
+
export declare const AgentSkillsCapability: z.ZodUnion<readonly [z.ZodLiteral<"read">, z.ZodLiteral<"manage">, z.ZodLiteral<false>]>;
|
|
45
|
+
export type AgentSkillsCapability = z.infer<typeof AgentSkillsCapability>;
|
|
46
|
+
export declare const AgentCapabilityStartingPoint: z.ZodEnum<{
|
|
47
|
+
all: "all";
|
|
48
|
+
none: "none";
|
|
49
|
+
}>;
|
|
50
|
+
export type AgentCapabilityStartingPoint = z.infer<typeof AgentCapabilityStartingPoint>;
|
|
51
|
+
export declare const AgentCapabilityToggles: z.ZodObject<{
|
|
52
|
+
webSearch: z.ZodOptional<z.ZodBoolean>;
|
|
53
|
+
humanInput: z.ZodOptional<z.ZodBoolean>;
|
|
54
|
+
skills: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"read">, z.ZodLiteral<"manage">, z.ZodLiteral<false>]>>;
|
|
55
|
+
goals: z.ZodOptional<z.ZodBoolean>;
|
|
56
|
+
subagents: z.ZodOptional<z.ZodBoolean>;
|
|
57
|
+
knowledge: z.ZodOptional<z.ZodBoolean>;
|
|
58
|
+
schedules: z.ZodOptional<z.ZodBoolean>;
|
|
59
|
+
artifacts: z.ZodOptional<z.ZodBoolean>;
|
|
60
|
+
browser: z.ZodOptional<z.ZodBoolean>;
|
|
61
|
+
media: z.ZodOptional<z.ZodBoolean>;
|
|
62
|
+
workspaceFiles: z.ZodOptional<z.ZodBoolean>;
|
|
63
|
+
workspaceConnectors: z.ZodOptional<z.ZodBoolean>;
|
|
64
|
+
workspaceAdmin: z.ZodOptional<z.ZodBoolean>;
|
|
65
|
+
}, z.core.$strict>;
|
|
66
|
+
export type AgentCapabilityToggles = z.infer<typeof AgentCapabilityToggles>;
|
|
67
|
+
/**
|
|
68
|
+
* `"all"`: everything this workspace offers (today's behavior). `"none"`: the
|
|
69
|
+
* session's own tools plus essentials (human input and reading Skills). An
|
|
70
|
+
* object starts from one of them and switches individual capabilities.
|
|
71
|
+
*/
|
|
72
|
+
export declare const AgentCapabilities: z.ZodUnion<readonly [z.ZodLiteral<"all">, z.ZodLiteral<"none">, z.ZodObject<{
|
|
73
|
+
webSearch: z.ZodOptional<z.ZodBoolean>;
|
|
74
|
+
humanInput: z.ZodOptional<z.ZodBoolean>;
|
|
75
|
+
skills: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"read">, z.ZodLiteral<"manage">, z.ZodLiteral<false>]>>;
|
|
76
|
+
goals: z.ZodOptional<z.ZodBoolean>;
|
|
77
|
+
subagents: z.ZodOptional<z.ZodBoolean>;
|
|
78
|
+
knowledge: z.ZodOptional<z.ZodBoolean>;
|
|
79
|
+
schedules: z.ZodOptional<z.ZodBoolean>;
|
|
80
|
+
artifacts: z.ZodOptional<z.ZodBoolean>;
|
|
81
|
+
browser: z.ZodOptional<z.ZodBoolean>;
|
|
82
|
+
media: z.ZodOptional<z.ZodBoolean>;
|
|
83
|
+
workspaceFiles: z.ZodOptional<z.ZodBoolean>;
|
|
84
|
+
workspaceConnectors: z.ZodOptional<z.ZodBoolean>;
|
|
85
|
+
workspaceAdmin: z.ZodOptional<z.ZodBoolean>;
|
|
86
|
+
from: z.ZodEnum<{
|
|
87
|
+
all: "all";
|
|
88
|
+
none: "none";
|
|
89
|
+
}>;
|
|
90
|
+
}, z.core.$strict>]>;
|
|
91
|
+
export type AgentCapabilities = z.infer<typeof AgentCapabilities>;
|
|
92
|
+
/** `opengeni` emits `sandbox:`/`artifact:` links and inline visuals; `markdown` does not. */
|
|
93
|
+
export declare const AgentRenderer: z.ZodEnum<{
|
|
94
|
+
markdown: "markdown";
|
|
95
|
+
opengeni: "opengeni";
|
|
96
|
+
}>;
|
|
97
|
+
export type AgentRenderer = z.infer<typeof AgentRenderer>;
|
|
98
|
+
export declare const AGENT_IDENTITY_MAX_CHARACTERS = 8000;
|
|
99
|
+
/** Same bound as `SESSION_INSTRUCTIONS_MAX_CHARACTERS` (asserted by test). */
|
|
100
|
+
export declare const AGENT_INSTRUCTIONS_MAX_CHARACTERS = 65536;
|
|
101
|
+
export declare const AgentIdentity: z.ZodString;
|
|
102
|
+
/** The request-side agent object. Every field is optional. */
|
|
103
|
+
export declare const AgentConfigRequest: z.ZodObject<{
|
|
104
|
+
capabilities: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"all">, z.ZodLiteral<"none">, z.ZodObject<{
|
|
105
|
+
webSearch: z.ZodOptional<z.ZodBoolean>;
|
|
106
|
+
humanInput: z.ZodOptional<z.ZodBoolean>;
|
|
107
|
+
skills: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"read">, z.ZodLiteral<"manage">, z.ZodLiteral<false>]>>;
|
|
108
|
+
goals: z.ZodOptional<z.ZodBoolean>;
|
|
109
|
+
subagents: z.ZodOptional<z.ZodBoolean>;
|
|
110
|
+
knowledge: z.ZodOptional<z.ZodBoolean>;
|
|
111
|
+
schedules: z.ZodOptional<z.ZodBoolean>;
|
|
112
|
+
artifacts: z.ZodOptional<z.ZodBoolean>;
|
|
113
|
+
browser: z.ZodOptional<z.ZodBoolean>;
|
|
114
|
+
media: z.ZodOptional<z.ZodBoolean>;
|
|
115
|
+
workspaceFiles: z.ZodOptional<z.ZodBoolean>;
|
|
116
|
+
workspaceConnectors: z.ZodOptional<z.ZodBoolean>;
|
|
117
|
+
workspaceAdmin: z.ZodOptional<z.ZodBoolean>;
|
|
118
|
+
from: z.ZodEnum<{
|
|
119
|
+
all: "all";
|
|
120
|
+
none: "none";
|
|
121
|
+
}>;
|
|
122
|
+
}, z.core.$strict>]>>;
|
|
123
|
+
identity: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
124
|
+
instructions: z.ZodOptional<z.ZodString>;
|
|
125
|
+
renderer: z.ZodOptional<z.ZodEnum<{
|
|
126
|
+
markdown: "markdown";
|
|
127
|
+
opengeni: "opengeni";
|
|
128
|
+
}>>;
|
|
129
|
+
}, z.core.$strict>;
|
|
130
|
+
export type AgentConfigRequest = z.infer<typeof AgentConfigRequest>;
|
|
131
|
+
/** Workspace "Defaults for new sessions" agent part (no instructions alias). */
|
|
132
|
+
export declare const WorkspaceAgentDefaults: z.ZodObject<{
|
|
133
|
+
capabilities: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"all">, z.ZodLiteral<"none">, z.ZodObject<{
|
|
134
|
+
webSearch: z.ZodOptional<z.ZodBoolean>;
|
|
135
|
+
humanInput: z.ZodOptional<z.ZodBoolean>;
|
|
136
|
+
skills: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"read">, z.ZodLiteral<"manage">, z.ZodLiteral<false>]>>;
|
|
137
|
+
goals: z.ZodOptional<z.ZodBoolean>;
|
|
138
|
+
subagents: z.ZodOptional<z.ZodBoolean>;
|
|
139
|
+
knowledge: z.ZodOptional<z.ZodBoolean>;
|
|
140
|
+
schedules: z.ZodOptional<z.ZodBoolean>;
|
|
141
|
+
artifacts: z.ZodOptional<z.ZodBoolean>;
|
|
142
|
+
browser: z.ZodOptional<z.ZodBoolean>;
|
|
143
|
+
media: z.ZodOptional<z.ZodBoolean>;
|
|
144
|
+
workspaceFiles: z.ZodOptional<z.ZodBoolean>;
|
|
145
|
+
workspaceConnectors: z.ZodOptional<z.ZodBoolean>;
|
|
146
|
+
workspaceAdmin: z.ZodOptional<z.ZodBoolean>;
|
|
147
|
+
from: z.ZodEnum<{
|
|
148
|
+
all: "all";
|
|
149
|
+
none: "none";
|
|
150
|
+
}>;
|
|
151
|
+
}, z.core.$strict>]>>;
|
|
152
|
+
identity: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
153
|
+
renderer: z.ZodOptional<z.ZodEnum<{
|
|
154
|
+
markdown: "markdown";
|
|
155
|
+
opengeni: "opengeni";
|
|
156
|
+
}>>;
|
|
157
|
+
}, z.core.$strict>;
|
|
158
|
+
export type WorkspaceAgentDefaults = z.infer<typeof WorkspaceAgentDefaults>;
|
|
159
|
+
export declare const ResolvedAgentCapabilities: z.ZodObject<{
|
|
160
|
+
webSearch: z.ZodBoolean;
|
|
161
|
+
humanInput: z.ZodBoolean;
|
|
162
|
+
skills: z.ZodUnion<readonly [z.ZodLiteral<"read">, z.ZodLiteral<"manage">, z.ZodLiteral<false>]>;
|
|
163
|
+
goals: z.ZodBoolean;
|
|
164
|
+
subagents: z.ZodBoolean;
|
|
165
|
+
knowledge: z.ZodBoolean;
|
|
166
|
+
schedules: z.ZodBoolean;
|
|
167
|
+
artifacts: z.ZodBoolean;
|
|
168
|
+
browser: z.ZodBoolean;
|
|
169
|
+
media: z.ZodBoolean;
|
|
170
|
+
workspaceFiles: z.ZodBoolean;
|
|
171
|
+
workspaceConnectors: z.ZodBoolean;
|
|
172
|
+
workspaceAdmin: z.ZodBoolean;
|
|
173
|
+
}, z.core.$strict>;
|
|
174
|
+
export type ResolvedAgentCapabilities = z.infer<typeof ResolvedAgentCapabilities>;
|
|
175
|
+
export declare const ResolvedAgentConfigSource: z.ZodEnum<{
|
|
176
|
+
deployment_default: "deployment_default";
|
|
177
|
+
inherited: "inherited";
|
|
178
|
+
legacy_conversion: "legacy_conversion";
|
|
179
|
+
request: "request";
|
|
180
|
+
workspace_default: "workspace_default";
|
|
181
|
+
}>;
|
|
182
|
+
export type ResolvedAgentConfigSource = z.infer<typeof ResolvedAgentConfigSource>;
|
|
183
|
+
/**
|
|
184
|
+
* The frozen per-session configuration (`sessions.agent_config`). `capabilities`
|
|
185
|
+
* is the effective map; `unavailable` names capabilities the configuration
|
|
186
|
+
* wanted on but this deployment does not offer (reported off, never widened
|
|
187
|
+
* later without a new resolution).
|
|
188
|
+
*/
|
|
189
|
+
export declare const ResolvedAgentConfig: z.ZodObject<{
|
|
190
|
+
version: z.ZodLiteral<1>;
|
|
191
|
+
from: z.ZodEnum<{
|
|
192
|
+
all: "all";
|
|
193
|
+
none: "none";
|
|
194
|
+
}>;
|
|
195
|
+
capabilities: z.ZodObject<{
|
|
196
|
+
webSearch: z.ZodBoolean;
|
|
197
|
+
humanInput: z.ZodBoolean;
|
|
198
|
+
skills: z.ZodUnion<readonly [z.ZodLiteral<"read">, z.ZodLiteral<"manage">, z.ZodLiteral<false>]>;
|
|
199
|
+
goals: z.ZodBoolean;
|
|
200
|
+
subagents: z.ZodBoolean;
|
|
201
|
+
knowledge: z.ZodBoolean;
|
|
202
|
+
schedules: z.ZodBoolean;
|
|
203
|
+
artifacts: z.ZodBoolean;
|
|
204
|
+
browser: z.ZodBoolean;
|
|
205
|
+
media: z.ZodBoolean;
|
|
206
|
+
workspaceFiles: z.ZodBoolean;
|
|
207
|
+
workspaceConnectors: z.ZodBoolean;
|
|
208
|
+
workspaceAdmin: z.ZodBoolean;
|
|
209
|
+
}, z.core.$strict>;
|
|
210
|
+
unavailable: z.ZodDefault<z.ZodArray<z.ZodEnum<{
|
|
211
|
+
artifacts: "artifacts";
|
|
212
|
+
browser: "browser";
|
|
213
|
+
goals: "goals";
|
|
214
|
+
humanInput: "humanInput";
|
|
215
|
+
knowledge: "knowledge";
|
|
216
|
+
media: "media";
|
|
217
|
+
schedules: "schedules";
|
|
218
|
+
skills: "skills";
|
|
219
|
+
subagents: "subagents";
|
|
220
|
+
webSearch: "webSearch";
|
|
221
|
+
workspaceAdmin: "workspaceAdmin";
|
|
222
|
+
workspaceConnectors: "workspaceConnectors";
|
|
223
|
+
workspaceFiles: "workspaceFiles";
|
|
224
|
+
}>>>;
|
|
225
|
+
identity: z.ZodNullable<z.ZodString>;
|
|
226
|
+
renderer: z.ZodEnum<{
|
|
227
|
+
markdown: "markdown";
|
|
228
|
+
opengeni: "opengeni";
|
|
229
|
+
}>;
|
|
230
|
+
source: z.ZodEnum<{
|
|
231
|
+
deployment_default: "deployment_default";
|
|
232
|
+
inherited: "inherited";
|
|
233
|
+
legacy_conversion: "legacy_conversion";
|
|
234
|
+
request: "request";
|
|
235
|
+
workspace_default: "workspace_default";
|
|
236
|
+
}>;
|
|
237
|
+
}, z.core.$strict>;
|
|
238
|
+
export type ResolvedAgentConfig = z.infer<typeof ResolvedAgentConfig>;
|
|
239
|
+
/** `PUT /v1/workspaces/:workspaceId/sessions/:sessionId/agent`. Omitted fields keep current values. */
|
|
240
|
+
export declare const UpdateSessionAgentRequest: z.ZodObject<{
|
|
241
|
+
agent: z.ZodObject<{
|
|
242
|
+
capabilities: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"all">, z.ZodLiteral<"none">, z.ZodObject<{
|
|
243
|
+
webSearch: z.ZodOptional<z.ZodBoolean>;
|
|
244
|
+
humanInput: z.ZodOptional<z.ZodBoolean>;
|
|
245
|
+
skills: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"read">, z.ZodLiteral<"manage">, z.ZodLiteral<false>]>>;
|
|
246
|
+
goals: z.ZodOptional<z.ZodBoolean>;
|
|
247
|
+
subagents: z.ZodOptional<z.ZodBoolean>;
|
|
248
|
+
knowledge: z.ZodOptional<z.ZodBoolean>;
|
|
249
|
+
schedules: z.ZodOptional<z.ZodBoolean>;
|
|
250
|
+
artifacts: z.ZodOptional<z.ZodBoolean>;
|
|
251
|
+
browser: z.ZodOptional<z.ZodBoolean>;
|
|
252
|
+
media: z.ZodOptional<z.ZodBoolean>;
|
|
253
|
+
workspaceFiles: z.ZodOptional<z.ZodBoolean>;
|
|
254
|
+
workspaceConnectors: z.ZodOptional<z.ZodBoolean>;
|
|
255
|
+
workspaceAdmin: z.ZodOptional<z.ZodBoolean>;
|
|
256
|
+
from: z.ZodEnum<{
|
|
257
|
+
all: "all";
|
|
258
|
+
none: "none";
|
|
259
|
+
}>;
|
|
260
|
+
}, z.core.$strict>]>>;
|
|
261
|
+
identity: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
262
|
+
instructions: z.ZodOptional<z.ZodString>;
|
|
263
|
+
renderer: z.ZodOptional<z.ZodEnum<{
|
|
264
|
+
markdown: "markdown";
|
|
265
|
+
opengeni: "opengeni";
|
|
266
|
+
}>>;
|
|
267
|
+
}, z.core.$strict>;
|
|
268
|
+
expectedVersion: z.ZodNumber;
|
|
269
|
+
}, z.core.$strict>;
|
|
270
|
+
export type UpdateSessionAgentRequest = z.infer<typeof UpdateSessionAgentRequest>;
|
|
271
|
+
/** Client-safe rollout projection. */
|
|
272
|
+
export declare const ClientAgentConfig: z.ZodObject<{
|
|
273
|
+
enabled: z.ZodBoolean;
|
|
274
|
+
defaultForNewSessions: z.ZodBoolean;
|
|
275
|
+
capabilities: z.ZodArray<z.ZodObject<{
|
|
276
|
+
id: z.ZodEnum<{
|
|
277
|
+
artifacts: "artifacts";
|
|
278
|
+
browser: "browser";
|
|
279
|
+
goals: "goals";
|
|
280
|
+
humanInput: "humanInput";
|
|
281
|
+
knowledge: "knowledge";
|
|
282
|
+
media: "media";
|
|
283
|
+
schedules: "schedules";
|
|
284
|
+
skills: "skills";
|
|
285
|
+
subagents: "subagents";
|
|
286
|
+
webSearch: "webSearch";
|
|
287
|
+
workspaceAdmin: "workspaceAdmin";
|
|
288
|
+
workspaceConnectors: "workspaceConnectors";
|
|
289
|
+
workspaceFiles: "workspaceFiles";
|
|
290
|
+
}>;
|
|
291
|
+
available: z.ZodBoolean;
|
|
292
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
293
|
+
}, z.core.$strict>>;
|
|
294
|
+
}, z.core.$strict>;
|
|
295
|
+
export type ClientAgentConfig = z.infer<typeof ClientAgentConfig>;
|
|
296
|
+
/** A first-party tool's owner: a capability, or pure runtime mechanics. */
|
|
297
|
+
export type AgentToolCapability = AgentCapabilityId | "runtime";
|
|
298
|
+
/**
|
|
299
|
+
* Exhaustive map from every `FIRST_PARTY_MCP_TOOL_NAMES` entry to exactly one
|
|
300
|
+
* owner. The `Record` type makes an unmapped new name a compile error, and
|
|
301
|
+
* `agent-config-registry.test.ts` asserts it at runtime too.
|
|
302
|
+
*
|
|
303
|
+
* `runtime` tools are mechanics every agent needs regardless of what it may do:
|
|
304
|
+
* - `wait_for_input`: ends the turn and waits for the next input.
|
|
305
|
+
* - `command_read` / `command_wait`: read/await the session's own background
|
|
306
|
+
* sandbox commands (the shell already exists whenever a sandbox is attached).
|
|
307
|
+
* - `set_session_title`: session titling.
|
|
308
|
+
*/
|
|
309
|
+
export declare const FIRST_PARTY_MCP_TOOL_CAPABILITIES: {
|
|
310
|
+
readonly set_session_title: "runtime";
|
|
311
|
+
readonly wait_for_input: "runtime";
|
|
312
|
+
readonly command_wait: "runtime";
|
|
313
|
+
readonly command_read: "runtime";
|
|
314
|
+
readonly goal_set: "goals";
|
|
315
|
+
readonly goal_update: "goals";
|
|
316
|
+
readonly goal_progress: "goals";
|
|
317
|
+
readonly goal_complete: "goals";
|
|
318
|
+
readonly goal_pause: "goals";
|
|
319
|
+
readonly goal_resume: "goals";
|
|
320
|
+
readonly knowledge_search: "knowledge";
|
|
321
|
+
readonly knowledge_prepare_save: "knowledge";
|
|
322
|
+
readonly knowledge_get: "knowledge";
|
|
323
|
+
readonly knowledge_browse: "knowledge";
|
|
324
|
+
readonly knowledge_save: "knowledge";
|
|
325
|
+
readonly knowledge_retain_file: "knowledge";
|
|
326
|
+
readonly knowledge_retain_message: "knowledge";
|
|
327
|
+
readonly knowledge_archive: "knowledge";
|
|
328
|
+
readonly instruction_policy_save: "knowledge";
|
|
329
|
+
readonly instruction_policy_get: "knowledge";
|
|
330
|
+
readonly memory_search: "knowledge";
|
|
331
|
+
readonly memory_save: "knowledge";
|
|
332
|
+
readonly memory_correct: "knowledge";
|
|
333
|
+
readonly preference_registry_summary: "knowledge";
|
|
334
|
+
readonly preference_registry_get: "knowledge";
|
|
335
|
+
readonly task_notes_list: "knowledge";
|
|
336
|
+
readonly task_note_save: "knowledge";
|
|
337
|
+
readonly task_note_archive: "knowledge";
|
|
338
|
+
readonly task_note_replace: "knowledge";
|
|
339
|
+
readonly work_claim_upsert: "knowledge";
|
|
340
|
+
readonly work_claim_release: "knowledge";
|
|
341
|
+
readonly knowledge_propose: "knowledge";
|
|
342
|
+
readonly knowledge_correct: "knowledge";
|
|
343
|
+
readonly task_note_promote_knowledge: "knowledge";
|
|
344
|
+
readonly task_note_promote_instruction_policy: "knowledge";
|
|
345
|
+
readonly task_note_promote_preference: "knowledge";
|
|
346
|
+
readonly instruction_policy_propose: "knowledge";
|
|
347
|
+
readonly preference_propose: "knowledge";
|
|
348
|
+
readonly remember: "knowledge";
|
|
349
|
+
readonly remember_confirm: "knowledge";
|
|
350
|
+
readonly company_profile_propose: "knowledge";
|
|
351
|
+
readonly company_profile_confirm: "knowledge";
|
|
352
|
+
readonly sandboxes_list: "workspaceAdmin";
|
|
353
|
+
readonly sandbox_attach: "workspaceAdmin";
|
|
354
|
+
readonly sandbox_swap: "workspaceAdmin";
|
|
355
|
+
readonly run_on: "workspaceAdmin";
|
|
356
|
+
readonly sandbox_provision: "workspaceAdmin";
|
|
357
|
+
readonly connected_machine_remove: "workspaceAdmin";
|
|
358
|
+
readonly connected_machine_enroll_token: "workspaceAdmin";
|
|
359
|
+
readonly project_list: "workspaceAdmin";
|
|
360
|
+
readonly project_get: "workspaceAdmin";
|
|
361
|
+
readonly project_create: "workspaceAdmin";
|
|
362
|
+
readonly project_update: "workspaceAdmin";
|
|
363
|
+
readonly project_reorder: "workspaceAdmin";
|
|
364
|
+
readonly project_delete: "workspaceAdmin";
|
|
365
|
+
readonly session_set_project: "workspaceAdmin";
|
|
366
|
+
readonly rig_list: "workspaceAdmin";
|
|
367
|
+
readonly rig_get: "workspaceAdmin";
|
|
368
|
+
readonly rig_propose_change: "workspaceAdmin";
|
|
369
|
+
readonly rig_verify: "workspaceAdmin";
|
|
370
|
+
readonly rig_promote: "workspaceAdmin";
|
|
371
|
+
readonly variable_set_list: "workspaceAdmin";
|
|
372
|
+
readonly environment_list: "workspaceAdmin";
|
|
373
|
+
readonly variable_set_get_variable: "workspaceAdmin";
|
|
374
|
+
readonly variable_set_set_variable: "workspaceAdmin";
|
|
375
|
+
readonly environment_set_variable: "workspaceAdmin";
|
|
376
|
+
readonly capability_catalog_search: "workspaceAdmin";
|
|
377
|
+
readonly capability_authorization_request: "workspaceAdmin";
|
|
378
|
+
readonly custom_mcp_setup_request: "workspaceAdmin";
|
|
379
|
+
readonly sessions_list: "subagents";
|
|
380
|
+
readonly session_get: "subagents";
|
|
381
|
+
readonly session_events: "subagents";
|
|
382
|
+
readonly session_wait: "subagents";
|
|
383
|
+
readonly session_create: "subagents";
|
|
384
|
+
readonly session_send_message: "subagents";
|
|
385
|
+
readonly session_pause: "subagents";
|
|
386
|
+
readonly session_resume: "subagents";
|
|
387
|
+
readonly session_steer: "subagents";
|
|
388
|
+
readonly session_human_input_respond: "subagents";
|
|
389
|
+
readonly set_other_session_title: "subagents";
|
|
390
|
+
readonly session_set_model: "subagents";
|
|
391
|
+
readonly interaction_discover: "browser";
|
|
392
|
+
readonly browser_open: "browser";
|
|
393
|
+
readonly browser_tabs: "browser";
|
|
394
|
+
readonly browser_observe: "browser";
|
|
395
|
+
readonly browser_read: "browser";
|
|
396
|
+
readonly browser_screenshot: "browser";
|
|
397
|
+
readonly browser_act: "browser";
|
|
398
|
+
readonly browser_clipboard: "browser";
|
|
399
|
+
readonly browser_debug: "browser";
|
|
400
|
+
readonly browser_auth: "browser";
|
|
401
|
+
readonly interaction_request_human: "browser";
|
|
402
|
+
readonly browser_identity: "browser";
|
|
403
|
+
readonly browser_publish: "browser";
|
|
404
|
+
readonly browser_lifecycle: "browser";
|
|
405
|
+
readonly computer_open: "browser";
|
|
406
|
+
readonly computer_targets: "browser";
|
|
407
|
+
readonly computer_observe: "browser";
|
|
408
|
+
readonly computer_clipboard: "browser";
|
|
409
|
+
readonly computer_act: "browser";
|
|
410
|
+
readonly computer_lifecycle: "browser";
|
|
411
|
+
readonly github_connect_link: "workspaceConnectors";
|
|
412
|
+
readonly github_repositories_list: "workspaceConnectors";
|
|
413
|
+
readonly social_connections_list: "workspaceConnectors";
|
|
414
|
+
readonly social_posts_recent: "workspaceConnectors";
|
|
415
|
+
readonly social_daily_analysis_context: "workspaceConnectors";
|
|
416
|
+
readonly social_search_live: "workspaceConnectors";
|
|
417
|
+
readonly social_mentions_live: "workspaceConnectors";
|
|
418
|
+
readonly social_thread_fetch: "workspaceConnectors";
|
|
419
|
+
readonly social_posts_sync: "workspaceConnectors";
|
|
420
|
+
readonly social_post_reply: "workspaceConnectors";
|
|
421
|
+
readonly x_accounts_list: "workspaceConnectors";
|
|
422
|
+
readonly x_search_live: "workspaceConnectors";
|
|
423
|
+
readonly x_mentions_live: "workspaceConnectors";
|
|
424
|
+
readonly x_thread_fetch: "workspaceConnectors";
|
|
425
|
+
readonly x_posts_sync: "workspaceConnectors";
|
|
426
|
+
readonly x_post_reply: "workspaceConnectors";
|
|
427
|
+
readonly reddit_accounts_list: "workspaceConnectors";
|
|
428
|
+
readonly reddit_search_live: "workspaceConnectors";
|
|
429
|
+
readonly reddit_mentions_live: "workspaceConnectors";
|
|
430
|
+
readonly reddit_thread_fetch: "workspaceConnectors";
|
|
431
|
+
readonly reddit_posts_sync: "workspaceConnectors";
|
|
432
|
+
readonly reddit_post_reply: "workspaceConnectors";
|
|
433
|
+
readonly slack_bot_list_channels: "workspaceConnectors";
|
|
434
|
+
readonly slack_bot_search: "workspaceConnectors";
|
|
435
|
+
readonly slack_bot_channel_history: "workspaceConnectors";
|
|
436
|
+
readonly slack_bot_thread_replies: "workspaceConnectors";
|
|
437
|
+
readonly slack_bot_list_users: "workspaceConnectors";
|
|
438
|
+
readonly slack_bot_list_files: "workspaceConnectors";
|
|
439
|
+
readonly slack_bot_file_info: "workspaceConnectors";
|
|
440
|
+
readonly slack_bot_file_content: "workspaceConnectors";
|
|
441
|
+
readonly slack_bot_upload_file: "workspaceConnectors";
|
|
442
|
+
readonly slack_bot_post_message: "workspaceConnectors";
|
|
443
|
+
readonly slack_bot_delete_message: "workspaceConnectors";
|
|
444
|
+
readonly slack_bot_prepare_message: "workspaceConnectors";
|
|
445
|
+
readonly slack_bot_send_prepared_message: "workspaceConnectors";
|
|
446
|
+
readonly fiken_companies_list: "workspaceConnectors";
|
|
447
|
+
readonly fiken_contacts_list: "workspaceConnectors";
|
|
448
|
+
readonly fiken_contact_create: "workspaceConnectors";
|
|
449
|
+
readonly fiken_products_list: "workspaceConnectors";
|
|
450
|
+
readonly fiken_invoices_list: "workspaceConnectors";
|
|
451
|
+
readonly fiken_invoice_get: "workspaceConnectors";
|
|
452
|
+
readonly fiken_invoice_draft_create: "workspaceConnectors";
|
|
453
|
+
readonly fiken_bank_accounts_list: "workspaceConnectors";
|
|
454
|
+
readonly fiken_purchases_list: "workspaceConnectors";
|
|
455
|
+
readonly fiken_sales_list: "workspaceConnectors";
|
|
456
|
+
readonly atlassian_sources_list: "workspaceConnectors";
|
|
457
|
+
readonly atlassian_search: "workspaceConnectors";
|
|
458
|
+
readonly atlassian_get: "workspaceConnectors";
|
|
459
|
+
readonly scheduled_tasks_list: "schedules";
|
|
460
|
+
readonly scheduled_tasks_get: "schedules";
|
|
461
|
+
readonly scheduled_tasks_create: "schedules";
|
|
462
|
+
readonly scheduled_tasks_update: "schedules";
|
|
463
|
+
readonly scheduled_tasks_pause: "schedules";
|
|
464
|
+
readonly scheduled_tasks_resume: "schedules";
|
|
465
|
+
readonly scheduled_tasks_trigger: "schedules";
|
|
466
|
+
readonly scheduled_tasks_delete: "schedules";
|
|
467
|
+
readonly scheduled_task_runs_list: "schedules";
|
|
468
|
+
readonly artifacts_list: "artifacts";
|
|
469
|
+
readonly artifacts_get_source: "artifacts";
|
|
470
|
+
readonly artifacts_prepare_upload: "artifacts";
|
|
471
|
+
readonly artifacts_create: "artifacts";
|
|
472
|
+
readonly artifacts_publish: "artifacts";
|
|
473
|
+
readonly artifacts_rollback: "artifacts";
|
|
474
|
+
readonly artifacts_archive: "artifacts";
|
|
475
|
+
readonly artifacts_restore: "artifacts";
|
|
476
|
+
readonly sandbox_file_publish: "artifacts";
|
|
477
|
+
readonly editable_artifact_list: "artifacts";
|
|
478
|
+
readonly editable_artifact_create: "artifacts";
|
|
479
|
+
readonly editable_artifact_import: "artifacts";
|
|
480
|
+
readonly editable_artifact_get: "artifacts";
|
|
481
|
+
readonly editable_artifact_inspect: "artifacts";
|
|
482
|
+
readonly editable_artifact_apply: "artifacts";
|
|
483
|
+
readonly editable_artifact_export: "artifacts";
|
|
484
|
+
readonly editable_artifact_export_status: "artifacts";
|
|
485
|
+
};
|
|
486
|
+
/** Owner of a non-MCP tool: a capability, runtime mechanics, or the sandbox. */
|
|
487
|
+
export type AgentFunctionToolClass = AgentCapabilityId | "runtime" | "sandbox";
|
|
488
|
+
/** Tools served outside the first-party MCP catalog, by the name the model sees. */
|
|
489
|
+
export declare const AGENT_FUNCTION_TOOL_CAPABILITIES: {
|
|
490
|
+
readonly web_search: "webSearch";
|
|
491
|
+
readonly x_search: "webSearch";
|
|
492
|
+
readonly image_generation: "media";
|
|
493
|
+
readonly request_human_input: "humanInput";
|
|
494
|
+
readonly list_models: "subagents";
|
|
495
|
+
readonly generate_image: "media";
|
|
496
|
+
readonly generate_video: "media";
|
|
497
|
+
readonly get_video_generation_capabilities: "media";
|
|
498
|
+
readonly skill_read: "skills";
|
|
499
|
+
readonly skill_search: "skills";
|
|
500
|
+
readonly skill_checkout: "skills";
|
|
501
|
+
readonly skill_save: "skills";
|
|
502
|
+
readonly skill_install: "skills";
|
|
503
|
+
readonly skill_publish: "skills";
|
|
504
|
+
readonly skill_remove: "skills";
|
|
505
|
+
readonly exec_command: "sandbox";
|
|
506
|
+
readonly write_stdin: "sandbox";
|
|
507
|
+
readonly apply_patch: "sandbox";
|
|
508
|
+
readonly view_image: "sandbox";
|
|
509
|
+
readonly repository_skill_read: "sandbox";
|
|
510
|
+
readonly code_search: "sandbox";
|
|
511
|
+
readonly tool_search: "runtime";
|
|
512
|
+
readonly tool_list: "runtime";
|
|
513
|
+
readonly tool_invoke: "runtime";
|
|
514
|
+
readonly operation_read: "runtime";
|
|
515
|
+
readonly refresh_credentials: "runtime";
|
|
516
|
+
readonly knowledge_source_fetch: "runtime";
|
|
517
|
+
readonly knowledge_source_read: "runtime";
|
|
518
|
+
};
|
|
519
|
+
export type AgentFunctionToolName = keyof typeof AGENT_FUNCTION_TOOL_CAPABILITIES;
|
|
520
|
+
/**
|
|
521
|
+
* Value-free snapshot of the adapters actually selected for one runtime build.
|
|
522
|
+
* Undefined means attachment has not been resolved, not that media is absent.
|
|
523
|
+
* Subscription pool readiness is not evidence for either adapter.
|
|
524
|
+
*/
|
|
525
|
+
export type AgentMediaAttachment = {
|
|
526
|
+
image: "native_hosted" | "provider_adapter" | null;
|
|
527
|
+
video: boolean;
|
|
528
|
+
};
|
|
529
|
+
export declare function resolveAgentMediaToolSurface(config: ResolvedAgentConfig | null | undefined, attachment?: AgentMediaAttachment): {
|
|
530
|
+
toolsKnown: boolean;
|
|
531
|
+
hosted: AgentFunctionToolName[];
|
|
532
|
+
runtime: AgentFunctionToolName[];
|
|
533
|
+
};
|
|
534
|
+
/** Skill tools that only read installed Skills (`skills: "read"`). */
|
|
535
|
+
export declare const AGENT_SKILL_READ_TOOL_NAMES: readonly ["skill_read"];
|
|
536
|
+
/** Skill tools that change Skills (`skills: "manage"` only). */
|
|
537
|
+
export declare const AGENT_SKILL_MANAGE_TOOL_NAMES: readonly ["skill_search", "skill_checkout", "skill_save", "skill_install", "skill_publish", "skill_remove"];
|
|
538
|
+
/** Built-in MCP servers that belong to a capability rather than the product. */
|
|
539
|
+
export declare const AGENT_BUILTIN_MCP_SERVER_CAPABILITIES: {
|
|
540
|
+
readonly opengeni: "runtime";
|
|
541
|
+
readonly files: "workspaceFiles";
|
|
542
|
+
readonly docs: "knowledge";
|
|
543
|
+
readonly "google-drive-publishing": "workspaceConnectors";
|
|
544
|
+
};
|
|
545
|
+
export declare function firstPartyMcpToolCapability(tool: FirstPartyMcpToolName): AgentToolCapability;
|
|
546
|
+
/** Availability narrows configuration; it never grants a disabled capability. */
|
|
547
|
+
export type AgentToolEnvironment = {
|
|
548
|
+
/** Explicit product MCPs are independent of ambient workspace connectors. */
|
|
549
|
+
productServerIds?: ReadonlySet<string>;
|
|
550
|
+
unavailable?: readonly AgentCapabilityId[];
|
|
551
|
+
hasSkills?: boolean;
|
|
552
|
+
webSearch?: boolean;
|
|
553
|
+
humanInput?: boolean;
|
|
554
|
+
media?: boolean | undefined;
|
|
555
|
+
hasDeferredTools?: boolean;
|
|
556
|
+
routerInHistory?: boolean;
|
|
557
|
+
};
|
|
558
|
+
export declare const AGENT_RUNTIME_MECHANIC_TOOL_NAMES: readonly ["wait_for_input", "command_read", "command_wait"];
|
|
559
|
+
/**
|
|
560
|
+
* The one turn-time capability gate. Null means the historical attachment
|
|
561
|
+
* rules, including unconditional Skill tools and router. Resource-derived
|
|
562
|
+
* sandbox tools, product MCPs and runtime mechanics are never toggled.
|
|
563
|
+
*/
|
|
564
|
+
export declare function resolveAgentToolFamilies(config: ResolvedAgentConfig | null | undefined, environment?: AgentToolEnvironment): {
|
|
565
|
+
webSearch: boolean;
|
|
566
|
+
humanInput: boolean;
|
|
567
|
+
media: boolean;
|
|
568
|
+
subagents: boolean;
|
|
569
|
+
skills: "manage" | "read" | false;
|
|
570
|
+
router: boolean;
|
|
571
|
+
allowsFirstPartyTool: (name: FirstPartyMcpToolName) => boolean;
|
|
572
|
+
firstPartyTools(names: readonly FirstPartyMcpToolName[]): FirstPartyMcpToolName[];
|
|
573
|
+
allowsFunctionTool(name: string): boolean;
|
|
574
|
+
allowsMcpServer(id: string): boolean;
|
|
575
|
+
};
|
|
576
|
+
export declare function firstPartyMcpToolsForCapability(capability: AgentCapabilityId): FirstPartyMcpToolName[];
|
|
577
|
+
/** Product words for UI and docs. Meaning is fixed by the ids. */
|
|
578
|
+
export declare const AGENT_CAPABILITY_DESCRIPTIONS: Readonly<Record<AgentCapabilityId, {
|
|
579
|
+
label: string;
|
|
580
|
+
description: string;
|
|
581
|
+
}>>;
|
|
582
|
+
/**
|
|
583
|
+
* Sections of the modular operational contract (sessions with an agent
|
|
584
|
+
* configuration). The order is the composition order. `base_behavior` and
|
|
585
|
+
* `runtime_mechanics` are always present; every other module is included only
|
|
586
|
+
* when its capability or resource is present. The model-context inspector
|
|
587
|
+
* reports them as metadata on the `operational_contract` layer.
|
|
588
|
+
*/
|
|
589
|
+
export declare const AGENT_PROMPT_MODULE_IDS: readonly ["base_behavior", "runtime_mechanics", "renderer_markdown", "sandbox", "connected_machine", "repositories", "workspace_environment", "rig", "artifacts", "goals", "subagents", "knowledge", "skills", "admin", "attachments"];
|
|
590
|
+
export declare const AgentPromptModuleId: z.ZodEnum<{
|
|
591
|
+
admin: "admin";
|
|
592
|
+
artifacts: "artifacts";
|
|
593
|
+
attachments: "attachments";
|
|
594
|
+
base_behavior: "base_behavior";
|
|
595
|
+
connected_machine: "connected_machine";
|
|
596
|
+
goals: "goals";
|
|
597
|
+
knowledge: "knowledge";
|
|
598
|
+
renderer_markdown: "renderer_markdown";
|
|
599
|
+
repositories: "repositories";
|
|
600
|
+
rig: "rig";
|
|
601
|
+
runtime_mechanics: "runtime_mechanics";
|
|
602
|
+
sandbox: "sandbox";
|
|
603
|
+
skills: "skills";
|
|
604
|
+
subagents: "subagents";
|
|
605
|
+
workspace_environment: "workspace_environment";
|
|
606
|
+
}>;
|
|
607
|
+
export type AgentPromptModuleId = z.infer<typeof AgentPromptModuleId>;
|
|
608
|
+
export declare const AGENT_PROMPT_MODULE_TITLES: Readonly<Record<AgentPromptModuleId, string>>;
|
|
609
|
+
/** The prompt module each capability owns; capabilities absent here own none. */
|
|
610
|
+
export declare const AGENT_CAPABILITY_PROMPT_MODULES: Readonly<Partial<Record<AgentCapabilityId, readonly AgentPromptModuleId[]>>>;
|
|
611
|
+
export declare const AgentConfigErrorCode: z.ZodEnum<{
|
|
612
|
+
agent_capability_unavailable: "agent_capability_unavailable";
|
|
613
|
+
agent_config_conflict: "agent_config_conflict";
|
|
614
|
+
agent_config_not_enabled: "agent_config_not_enabled";
|
|
615
|
+
agent_config_widening: "agent_config_widening";
|
|
616
|
+
}>;
|
|
617
|
+
export type AgentConfigErrorCode = z.infer<typeof AgentConfigErrorCode>;
|
|
618
|
+
/** Typed resolution failure. Transports render it as 422 with `details.code`. */
|
|
619
|
+
export declare class AgentConfigError extends Error {
|
|
620
|
+
readonly code: AgentConfigErrorCode;
|
|
621
|
+
readonly capability: AgentCapabilityId | undefined;
|
|
622
|
+
constructor(code: AgentConfigErrorCode, message: string, capability?: AgentCapabilityId);
|
|
623
|
+
}
|
|
624
|
+
export declare function isAgentConfigError(error: unknown): error is AgentConfigError;
|
|
625
|
+
export declare function allAgentCapabilities(): ResolvedAgentCapabilities;
|
|
626
|
+
/** `"none"`: the session's own tools plus the essentials. */
|
|
627
|
+
export declare function noneAgentCapabilities(): ResolvedAgentCapabilities;
|
|
628
|
+
export declare function agentCapabilityEnabled(capabilities: ResolvedAgentCapabilities, id: AgentCapabilityId): boolean;
|
|
629
|
+
/** Clamp `value` to `ceiling` (children and agent callers never widen). */
|
|
630
|
+
export declare function intersectAgentCapabilities(value: ResolvedAgentCapabilities, ceiling: ResolvedAgentCapabilities): ResolvedAgentCapabilities;
|
|
631
|
+
/** First capability `value` enables beyond `ceiling`, or null. */
|
|
632
|
+
export declare function agentCapabilityWidening(value: ResolvedAgentCapabilities, ceiling: ResolvedAgentCapabilities): AgentCapabilityId | null;
|
|
633
|
+
/** Hard limits: capabilities this deployment does not offer, with a reason. */
|
|
634
|
+
export type AgentConfigDeploymentLimits = {
|
|
635
|
+
unavailable: Partial<Record<AgentCapabilityId, string>>;
|
|
636
|
+
};
|
|
637
|
+
export type AgentConfigCreator = "api" | "slack" | "scheduled" | "automation" | "site_auth_maintenance";
|
|
638
|
+
/** What the workspace offers when a configuration is being created. */
|
|
639
|
+
export type AgentConfigWorkspaceContext = {
|
|
640
|
+
/** Explicit `settings.sessionAgentDefaults`, honored only with admission enabled. */
|
|
641
|
+
defaults: WorkspaceAgentDefaults | null;
|
|
642
|
+
/** Legacy `settings.agentHumanInputEnabled`; false maps to `humanInput: false`. */
|
|
643
|
+
humanInputEnabled: boolean;
|
|
644
|
+
};
|
|
645
|
+
export type AgentConfigParent = {
|
|
646
|
+
kind: "configured";
|
|
647
|
+
config: ResolvedAgentConfig;
|
|
648
|
+
}
|
|
649
|
+
/** A null-config parent: its current effective capabilities are the ceiling. */
|
|
650
|
+
| {
|
|
651
|
+
kind: "legacy";
|
|
652
|
+
ceiling: ResolvedAgentCapabilities;
|
|
653
|
+
};
|
|
654
|
+
export type ResolveAgentConfigInput = {
|
|
655
|
+
creator: AgentConfigCreator;
|
|
656
|
+
/** The request `agent` object; undefined when omitted. */
|
|
657
|
+
request?: AgentConfigRequest | undefined;
|
|
658
|
+
/** The legacy session `instructions` field (alias target). */
|
|
659
|
+
instructions?: string | undefined;
|
|
660
|
+
workspace: AgentConfigWorkspaceContext;
|
|
661
|
+
deployment: AgentConfigDeploymentLimits & {
|
|
662
|
+
admissionEnabled: boolean;
|
|
663
|
+
defaultForNewSessions: boolean;
|
|
664
|
+
};
|
|
665
|
+
/** Undefined for a top-level session. */
|
|
666
|
+
parent?: AgentConfigParent | undefined;
|
|
667
|
+
/** Whether the new session carries a goal. */
|
|
668
|
+
goal: boolean;
|
|
669
|
+
};
|
|
670
|
+
export type ResolveAgentConfigResult = {
|
|
671
|
+
config: ResolvedAgentConfig | null;
|
|
672
|
+
/** The effective session instructions after the alias rule. */
|
|
673
|
+
instructions: string | undefined;
|
|
674
|
+
};
|
|
675
|
+
/**
|
|
676
|
+
* Resolve the frozen agent configuration for a new session.
|
|
677
|
+
*
|
|
678
|
+
* Order: deployment limits, then the workspace default, then the request, then
|
|
679
|
+
* the parent (children only narrow). Returns `config: null` (exact legacy)
|
|
680
|
+
* when nothing asks for a configuration: no request `agent`, no configured
|
|
681
|
+
* parent, no honored workspace default, and the default-for-new-sessions
|
|
682
|
+
* switch off (or a legacy parent, which keeps its tree legacy).
|
|
683
|
+
*/
|
|
684
|
+
export declare function resolveAgentConfig(input: ResolveAgentConfigInput): ResolveAgentConfigResult;
|
|
685
|
+
/**
|
|
686
|
+
* Resolve a mid-session update. Omitted fields keep the current values; a
|
|
687
|
+
* legacy (null) session converts from `legacyCeiling` (its current effective
|
|
688
|
+
* state). Agent callers may only narrow.
|
|
689
|
+
*/
|
|
690
|
+
export declare function resolveAgentConfigUpdate(input: {
|
|
691
|
+
current: ResolvedAgentConfig | null;
|
|
692
|
+
legacyCeiling: ResolvedAgentCapabilities;
|
|
693
|
+
request: AgentConfigRequest;
|
|
694
|
+
deployment: AgentConfigDeploymentLimits & {
|
|
695
|
+
admissionEnabled: boolean;
|
|
696
|
+
};
|
|
697
|
+
onlyNarrow: boolean;
|
|
698
|
+
/** A parent's configuration or legacy ceiling; children never widen past it. */
|
|
699
|
+
parentCeiling?: ResolvedAgentCapabilities | undefined;
|
|
700
|
+
goal: boolean;
|
|
701
|
+
}): ResolvedAgentConfig;
|
|
702
|
+
/**
|
|
703
|
+
* Narrow a creator's first-party selection (its exact legacy value) to the
|
|
704
|
+
* enabled capabilities. `"all"` returns `baseline` unchanged. `explicit`, when
|
|
705
|
+
* the request listed `firstPartyMcpTools` itself, must not name a tool of a
|
|
706
|
+
* capability the configuration turns off.
|
|
707
|
+
*/
|
|
708
|
+
export declare function agentConfigFirstPartyMcpTools(config: ResolvedAgentConfig, baseline: readonly FirstPartyMcpToolName[], explicit?: readonly FirstPartyMcpToolName[]): FirstPartyMcpToolName[];
|
|
709
|
+
/**
|
|
710
|
+
* First-party tools a capability change adds on top of the current selection:
|
|
711
|
+
* the default-selection tools of every capability that `next` enables and
|
|
712
|
+
* `previous` did not. Unchanged capabilities keep their exact current tools.
|
|
713
|
+
*/
|
|
714
|
+
export declare function agentConfigAddedFirstPartyMcpTools(previous: ResolvedAgentCapabilities, next: ResolvedAgentConfig, defaults: readonly FirstPartyMcpToolName[]): FirstPartyMcpToolName[];
|
|
715
|
+
export type AgentConfigToolRefsInput = {
|
|
716
|
+
config: ResolvedAgentConfig;
|
|
717
|
+
tools: readonly ToolRef[];
|
|
718
|
+
toolPolicy: SessionToolPolicy;
|
|
719
|
+
/** Product servers: attached to this session or named explicitly by the request. */
|
|
720
|
+
productServerIds: ReadonlySet<string>;
|
|
721
|
+
/** Server ids the request's explicit `tools` named (strict conflict check). */
|
|
722
|
+
explicitServerIds?: ReadonlySet<string>;
|
|
723
|
+
};
|
|
724
|
+
/**
|
|
725
|
+
* Apply `workspaceFiles`, `knowledge` (the `docs` server) and
|
|
726
|
+
* `workspaceConnectors` to the stored tool refs and policy. A workspace-default
|
|
727
|
+
* policy keeps tracking defaults with `files`/`docs` excluded when their
|
|
728
|
+
* capability is off; with connectors off it becomes an explicit policy holding
|
|
729
|
+
* only product refs (plus enabled built-ins), so no workspace default connector
|
|
730
|
+
* ever reaches the session. `"all"` returns the input unchanged.
|
|
731
|
+
*/
|
|
732
|
+
export declare function agentConfigToolRefs(input: AgentConfigToolRefsInput): {
|
|
733
|
+
tools: ToolRef[];
|
|
734
|
+
toolPolicy: SessionToolPolicy;
|
|
735
|
+
};
|
|
736
|
+
/**
|
|
737
|
+
* The effective capabilities of a null-config (legacy) session, used as the
|
|
738
|
+
* ceiling when a child asks for an explicit configuration and when a legacy
|
|
739
|
+
* session converts on its first update. Legacy sessions always carry web
|
|
740
|
+
* search, media, list_models and every Skill tool, so those are on.
|
|
741
|
+
*/
|
|
742
|
+
export declare function legacyEffectiveAgentCapabilities(input: {
|
|
743
|
+
firstPartyMcpTools: readonly FirstPartyMcpToolName[];
|
|
744
|
+
tools: readonly ToolRef[];
|
|
745
|
+
toolPolicy: SessionToolPolicy;
|
|
746
|
+
humanInputEnabled: boolean;
|
|
747
|
+
/**
|
|
748
|
+
* The workspace's current omitted-tools default server ids, when known. A
|
|
749
|
+
* workspace-default session only has `files`/`docs`/connectors that are
|
|
750
|
+
* actually defaults; without this the ceiling assumes they are.
|
|
751
|
+
*/
|
|
752
|
+
defaultServerIds?: Iterable<string> | undefined;
|
|
753
|
+
}): ResolvedAgentCapabilities;
|
|
754
|
+
/**
|
|
755
|
+
* Deployment limits derivable from the deployment's first-party ceiling: a
|
|
756
|
+
* capability whose every first-party tool is outside the allowlist is not
|
|
757
|
+
* offered. Callers add feature flags (for example hosted web search).
|
|
758
|
+
*/
|
|
759
|
+
export declare function agentConfigDeploymentLimitsFromAllowlist(allowed: readonly FirstPartyMcpToolName[], extra?: Partial<Record<AgentCapabilityId, string>>): AgentConfigDeploymentLimits;
|
|
760
|
+
export type AgentEffectiveToolEntry = {
|
|
761
|
+
name: string;
|
|
762
|
+
capability: AgentCapabilityId | "runtime" | "sandbox" | "product";
|
|
763
|
+
source: "first_party" | "runtime" | "hosted" | "sandbox" | "mcp";
|
|
764
|
+
visibility?: "upfront" | "search";
|
|
765
|
+
};
|
|
766
|
+
export type AgentEffectiveMcpServerEntry = {
|
|
767
|
+
id: string;
|
|
768
|
+
capability: AgentCapabilityId | "runtime" | "product";
|
|
769
|
+
toolsKnown: boolean;
|
|
770
|
+
};
|
|
771
|
+
export declare const AgentEffectiveTools: z.ZodObject<{
|
|
772
|
+
capabilities: z.ZodObject<{
|
|
773
|
+
webSearch: z.ZodBoolean;
|
|
774
|
+
humanInput: z.ZodBoolean;
|
|
775
|
+
skills: z.ZodUnion<readonly [z.ZodLiteral<"read">, z.ZodLiteral<"manage">, z.ZodLiteral<false>]>;
|
|
776
|
+
goals: z.ZodBoolean;
|
|
777
|
+
subagents: z.ZodBoolean;
|
|
778
|
+
knowledge: z.ZodBoolean;
|
|
779
|
+
schedules: z.ZodBoolean;
|
|
780
|
+
artifacts: z.ZodBoolean;
|
|
781
|
+
browser: z.ZodBoolean;
|
|
782
|
+
media: z.ZodBoolean;
|
|
783
|
+
workspaceFiles: z.ZodBoolean;
|
|
784
|
+
workspaceConnectors: z.ZodBoolean;
|
|
785
|
+
workspaceAdmin: z.ZodBoolean;
|
|
786
|
+
}, z.core.$strict>;
|
|
787
|
+
unavailable: z.ZodArray<z.ZodEnum<{
|
|
788
|
+
artifacts: "artifacts";
|
|
789
|
+
browser: "browser";
|
|
790
|
+
goals: "goals";
|
|
791
|
+
humanInput: "humanInput";
|
|
792
|
+
knowledge: "knowledge";
|
|
793
|
+
media: "media";
|
|
794
|
+
schedules: "schedules";
|
|
795
|
+
skills: "skills";
|
|
796
|
+
subagents: "subagents";
|
|
797
|
+
webSearch: "webSearch";
|
|
798
|
+
workspaceAdmin: "workspaceAdmin";
|
|
799
|
+
workspaceConnectors: "workspaceConnectors";
|
|
800
|
+
workspaceFiles: "workspaceFiles";
|
|
801
|
+
}>>;
|
|
802
|
+
mediaToolsKnown: z.ZodOptional<z.ZodBoolean>;
|
|
803
|
+
tools: z.ZodArray<z.ZodObject<{
|
|
804
|
+
name: z.ZodString;
|
|
805
|
+
capability: z.ZodUnion<readonly [z.ZodEnum<{
|
|
806
|
+
artifacts: "artifacts";
|
|
807
|
+
browser: "browser";
|
|
808
|
+
goals: "goals";
|
|
809
|
+
humanInput: "humanInput";
|
|
810
|
+
knowledge: "knowledge";
|
|
811
|
+
media: "media";
|
|
812
|
+
schedules: "schedules";
|
|
813
|
+
skills: "skills";
|
|
814
|
+
subagents: "subagents";
|
|
815
|
+
webSearch: "webSearch";
|
|
816
|
+
workspaceAdmin: "workspaceAdmin";
|
|
817
|
+
workspaceConnectors: "workspaceConnectors";
|
|
818
|
+
workspaceFiles: "workspaceFiles";
|
|
819
|
+
}>, z.ZodLiteral<"runtime">, z.ZodLiteral<"sandbox">, z.ZodLiteral<"product">]>;
|
|
820
|
+
source: z.ZodEnum<{
|
|
821
|
+
first_party: "first_party";
|
|
822
|
+
hosted: "hosted";
|
|
823
|
+
mcp: "mcp";
|
|
824
|
+
runtime: "runtime";
|
|
825
|
+
sandbox: "sandbox";
|
|
826
|
+
}>;
|
|
827
|
+
visibility: z.ZodOptional<z.ZodEnum<{
|
|
828
|
+
search: "search";
|
|
829
|
+
upfront: "upfront";
|
|
830
|
+
}>>;
|
|
831
|
+
}, z.core.$strict>>;
|
|
832
|
+
mcpServers: z.ZodArray<z.ZodObject<{
|
|
833
|
+
id: z.ZodString;
|
|
834
|
+
capability: z.ZodUnion<readonly [z.ZodEnum<{
|
|
835
|
+
artifacts: "artifacts";
|
|
836
|
+
browser: "browser";
|
|
837
|
+
goals: "goals";
|
|
838
|
+
humanInput: "humanInput";
|
|
839
|
+
knowledge: "knowledge";
|
|
840
|
+
media: "media";
|
|
841
|
+
schedules: "schedules";
|
|
842
|
+
skills: "skills";
|
|
843
|
+
subagents: "subagents";
|
|
844
|
+
webSearch: "webSearch";
|
|
845
|
+
workspaceAdmin: "workspaceAdmin";
|
|
846
|
+
workspaceConnectors: "workspaceConnectors";
|
|
847
|
+
workspaceFiles: "workspaceFiles";
|
|
848
|
+
}>, z.ZodLiteral<"runtime">, z.ZodLiteral<"product">]>;
|
|
849
|
+
toolsKnown: z.ZodBoolean;
|
|
850
|
+
}, z.core.$strict>>;
|
|
851
|
+
}, z.core.$strict>;
|
|
852
|
+
export type AgentEffectiveTools = z.infer<typeof AgentEffectiveTools>;
|
|
853
|
+
/**
|
|
854
|
+
* Project known model tools through the same turn-time gates. External MCP
|
|
855
|
+
* schemas are never guessed: their server stays toolsKnown:false until listed.
|
|
856
|
+
*/
|
|
857
|
+
export declare function projectAgentEffectiveTools(input: {
|
|
858
|
+
config: ResolvedAgentConfig;
|
|
859
|
+
firstPartyMcpTools: readonly FirstPartyMcpToolName[];
|
|
860
|
+
mcpServerIds: readonly string[];
|
|
861
|
+
/** Servers attached to the session itself; other non-built-in ids are workspace connectors. */
|
|
862
|
+
productServerIds: ReadonlySet<string>;
|
|
863
|
+
environment?: AgentToolEnvironment;
|
|
864
|
+
runtimeToolNames?: readonly AgentFunctionToolName[];
|
|
865
|
+
hostedToolNames?: readonly AgentFunctionToolName[];
|
|
866
|
+
sandboxToolNames?: readonly AgentFunctionToolName[];
|
|
867
|
+
routerToolNames?: readonly AgentFunctionToolName[];
|
|
868
|
+
/** Raw first-party names; other entries use model-facing names. */
|
|
869
|
+
upfrontToolNames?: ReadonlySet<string>;
|
|
870
|
+
firstPartyModelNames?: ReadonlyMap<FirstPartyMcpToolName, string>;
|
|
871
|
+
mediaAttachment?: AgentMediaAttachment | undefined;
|
|
872
|
+
}): AgentEffectiveTools;
|