@wildo-ai/external-connectors-models 1.0.1 → 1.1.1
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/LICENSE +34 -0
- package/dist/esm/.builder.pid +9 -0
- package/dist/esm/companion-exports.d.ts +8 -0
- package/dist/esm/companion-exports.d.ts.map +1 -0
- package/dist/esm/companion-exports.js +8 -0
- package/dist/esm/companion-exports.js.map +1 -0
- package/dist/esm/core/commons.external-connectors-models.schemas.d.ts +66 -19
- package/dist/esm/core/commons.external-connectors-models.schemas.d.ts.map +1 -1
- package/dist/esm/core/commons.external-connectors-models.schemas.js +51 -3
- package/dist/esm/core/commons.external-connectors-models.schemas.js.map +1 -1
- package/dist/esm/core/oauth2.enums.d.ts.map +1 -1
- package/dist/esm/core/oauth2.enums.js +1 -1
- package/dist/esm/core/oauth2.enums.js.map +1 -1
- package/dist/esm/core/operations.external-connectors-models.schemas.d.ts.map +1 -1
- package/dist/esm/core/operations.external-connectors-models.schemas.js +1 -1
- package/dist/esm/core/operations.external-connectors-models.schemas.js.map +1 -1
- package/dist/esm/core/protocols.external-connectors-models.schemas.d.ts +35 -20
- package/dist/esm/core/protocols.external-connectors-models.schemas.d.ts.map +1 -1
- package/dist/esm/core/protocols.external-connectors-models.schemas.js +1 -1
- package/dist/esm/core/protocols.external-connectors-models.schemas.js.map +1 -1
- package/dist/esm/core/security.external-connectors-models.schemas.d.ts +1 -1
- package/dist/esm/core/security.external-connectors-models.schemas.d.ts.map +1 -1
- package/dist/esm/core/security.external-connectors-models.schemas.js +1 -1
- package/dist/esm/core/security.external-connectors-models.schemas.js.map +1 -1
- package/dist/esm/features/core.external-connectors-models.schemas.d.ts +4 -4
- package/dist/esm/features/core.external-connectors-models.schemas.d.ts.map +1 -1
- package/dist/esm/features/core.external-connectors-models.schemas.js +13 -13
- package/dist/esm/features/core.external-connectors-models.schemas.js.map +1 -1
- package/dist/esm/features/email.external-connectors-models.schemas.d.ts +12 -12
- package/dist/esm/features/email.external-connectors-models.schemas.d.ts.map +1 -1
- package/dist/esm/features/email.external-connectors-models.schemas.js +2 -2
- package/dist/esm/features/email.external-connectors-models.schemas.js.map +1 -1
- package/dist/esm/features/hooks.external-connectors-models.schemas.d.ts.map +1 -1
- package/dist/esm/features/hooks.external-connectors-models.schemas.js +1 -1
- package/dist/esm/features/hooks.external-connectors-models.schemas.js.map +1 -1
- package/dist/esm/features/sms.external-connectors-models.schemas.d.ts +4 -4
- package/dist/esm/features/sms.external-connectors-models.schemas.d.ts.map +1 -1
- package/dist/esm/features/sms.external-connectors-models.schemas.js +1 -1
- package/dist/esm/features/sms.external-connectors-models.schemas.js.map +1 -1
- package/dist/esm/index.d.ts +27 -27
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +5 -6
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/protocols/a2a.external-connectors-models.schemas.d.ts +3 -3
- package/dist/esm/protocols/a2a.external-connectors-models.schemas.d.ts.map +1 -1
- package/dist/esm/protocols/a2a.external-connectors-models.schemas.js +1 -1
- package/dist/esm/protocols/a2a.external-connectors-models.schemas.js.map +1 -1
- package/dist/esm/protocols/agent-client-protocol.external-connectors-models.schemas.d.ts +526 -0
- package/dist/esm/protocols/agent-client-protocol.external-connectors-models.schemas.d.ts.map +1 -0
- package/dist/esm/protocols/agent-client-protocol.external-connectors-models.schemas.js +639 -0
- package/dist/esm/protocols/agent-client-protocol.external-connectors-models.schemas.js.map +1 -0
- package/dist/esm/protocols/billing.standard-interface.schemas.d.ts +67 -0
- package/dist/esm/protocols/billing.standard-interface.schemas.d.ts.map +1 -1
- package/dist/esm/protocols/billing.standard-interface.schemas.js +1 -1
- package/dist/esm/protocols/billing.standard-interface.schemas.js.map +1 -1
- package/dist/esm/protocols/document-extraction.external-connectors-models.schemas.d.ts +179 -0
- package/dist/esm/protocols/document-extraction.external-connectors-models.schemas.d.ts.map +1 -0
- package/dist/esm/protocols/document-extraction.external-connectors-models.schemas.js +217 -0
- package/dist/esm/protocols/document-extraction.external-connectors-models.schemas.js.map +1 -0
- package/dist/esm/protocols/email.external-connectors-models.schemas.d.ts +5 -5
- package/dist/esm/protocols/email.external-connectors-models.schemas.d.ts.map +1 -1
- package/dist/esm/protocols/email.external-connectors-models.schemas.js +1 -1
- package/dist/esm/protocols/email.external-connectors-models.schemas.js.map +1 -1
- package/dist/esm/protocols/email.standard-interface.schemas.d.ts +37 -10
- package/dist/esm/protocols/email.standard-interface.schemas.d.ts.map +1 -1
- package/dist/esm/protocols/email.standard-interface.schemas.js +137 -4
- package/dist/esm/protocols/email.standard-interface.schemas.js.map +1 -1
- package/dist/esm/protocols/embeddings.external-connectors-models.schemas.d.ts +175 -0
- package/dist/esm/protocols/embeddings.external-connectors-models.schemas.d.ts.map +1 -0
- package/dist/esm/protocols/embeddings.external-connectors-models.schemas.js +191 -0
- package/dist/esm/protocols/embeddings.external-connectors-models.schemas.js.map +1 -0
- package/dist/esm/protocols/frontend.external-connectors-models.schemas.d.ts +4 -4
- package/dist/esm/protocols/frontend.external-connectors-models.schemas.d.ts.map +1 -1
- package/dist/esm/protocols/frontend.external-connectors-models.schemas.js +2 -2
- package/dist/esm/protocols/frontend.external-connectors-models.schemas.js.map +1 -1
- package/dist/esm/protocols/git.external-connectors-models.schemas.d.ts +3 -3
- package/dist/esm/protocols/git.external-connectors-models.schemas.d.ts.map +1 -1
- package/dist/esm/protocols/git.external-connectors-models.schemas.js +1 -1
- package/dist/esm/protocols/git.external-connectors-models.schemas.js.map +1 -1
- package/dist/esm/protocols/grpc.external-connectors-models.schemas.d.ts +3 -3
- package/dist/esm/protocols/grpc.external-connectors-models.schemas.d.ts.map +1 -1
- package/dist/esm/protocols/grpc.external-connectors-models.schemas.js +1 -1
- package/dist/esm/protocols/grpc.external-connectors-models.schemas.js.map +1 -1
- package/dist/esm/protocols/hooks.external-connectors-models.schemas.d.ts +14 -6
- package/dist/esm/protocols/hooks.external-connectors-models.schemas.d.ts.map +1 -1
- package/dist/esm/protocols/hooks.external-connectors-models.schemas.js +1 -1
- package/dist/esm/protocols/hooks.external-connectors-models.schemas.js.map +1 -1
- package/dist/esm/protocols/image.external-connectors-models.schemas.d.ts +151 -0
- package/dist/esm/protocols/image.external-connectors-models.schemas.d.ts.map +1 -0
- package/dist/esm/protocols/image.external-connectors-models.schemas.js +150 -0
- package/dist/esm/protocols/image.external-connectors-models.schemas.js.map +1 -0
- package/dist/esm/protocols/llm.external-connectors-models.schemas.d.ts +567 -67
- package/dist/esm/protocols/llm.external-connectors-models.schemas.d.ts.map +1 -1
- package/dist/esm/protocols/llm.external-connectors-models.schemas.js +815 -36
- package/dist/esm/protocols/llm.external-connectors-models.schemas.js.map +1 -1
- package/dist/esm/protocols/mcp.external-connectors-models.schemas.d.ts +3 -3
- package/dist/esm/protocols/mcp.external-connectors-models.schemas.d.ts.map +1 -1
- package/dist/esm/protocols/mcp.external-connectors-models.schemas.js +1 -1
- package/dist/esm/protocols/mcp.external-connectors-models.schemas.js.map +1 -1
- package/dist/esm/protocols/oauth2.external-connectors-models.schemas.d.ts +27 -28
- package/dist/esm/protocols/oauth2.external-connectors-models.schemas.d.ts.map +1 -1
- package/dist/esm/protocols/oauth2.external-connectors-models.schemas.js +1 -3
- package/dist/esm/protocols/oauth2.external-connectors-models.schemas.js.map +1 -1
- package/dist/esm/protocols/rest-api.external-connectors-models.schemas.d.ts +3 -3
- package/dist/esm/protocols/rest-api.external-connectors-models.schemas.d.ts.map +1 -1
- package/dist/esm/protocols/rest-api.external-connectors-models.schemas.js +1 -1
- package/dist/esm/protocols/rest-api.external-connectors-models.schemas.js.map +1 -1
- package/dist/esm/protocols/saml.external-connectors-models.schemas.d.ts +30 -30
- package/dist/esm/protocols/saml.external-connectors-models.schemas.d.ts.map +1 -1
- package/dist/esm/protocols/saml.external-connectors-models.schemas.js +1 -1
- package/dist/esm/protocols/saml.external-connectors-models.schemas.js.map +1 -1
- package/dist/esm/protocols/sms.external-connectors-models.schemas.d.ts +2 -2
- package/dist/esm/protocols/sms.external-connectors-models.schemas.d.ts.map +1 -1
- package/dist/esm/protocols/sms.external-connectors-models.schemas.js +1 -1
- package/dist/esm/protocols/sms.external-connectors-models.schemas.js.map +1 -1
- package/dist/esm/protocols/sms.standard-interface.schemas.d.ts +1 -1
- package/dist/esm/protocols/sms.standard-interface.schemas.d.ts.map +1 -1
- package/dist/esm/protocols/sms.standard-interface.schemas.js +1 -1
- package/dist/esm/protocols/sms.standard-interface.schemas.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +20 -10
- package/dist/esm/core/lazy-loading.external-connectors-models.schemas.d.ts +0 -127
- package/dist/esm/core/lazy-loading.external-connectors-models.schemas.d.ts.map +0 -1
- package/dist/esm/core/lazy-loading.external-connectors-models.schemas.js +0 -22
- package/dist/esm/core/lazy-loading.external-connectors-models.schemas.js.map +0 -1
- package/dist/esm/core/providers.external-connectors-models.schemas.d.ts +0 -80
- package/dist/esm/core/providers.external-connectors-models.schemas.d.ts.map +0 -1
- package/dist/esm/core/providers.external-connectors-models.schemas.js +0 -55
- package/dist/esm/core/providers.external-connectors-models.schemas.js.map +0 -1
- package/dist/esm/protocols/cli-runtime.external-connectors-models.schemas.d.ts +0 -214
- package/dist/esm/protocols/cli-runtime.external-connectors-models.schemas.d.ts.map +0 -1
- package/dist/esm/protocols/cli-runtime.external-connectors-models.schemas.js +0 -188
- package/dist/esm/protocols/cli-runtime.external-connectors-models.schemas.js.map +0 -1
|
@@ -0,0 +1,639 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { ExternalProvider_OperationContextSchema, } from "../core/operations.external-connectors-models.schemas.js";
|
|
3
|
+
import { APPLICATION_ENVIRONMENT, ExternalProvider_ExchangeProtocol_Configuration_BaseSchema, ExternalProvider_ExchangeProtocol_Kind, ExternalProvider_ExchangeProtocol_Profile_BaseSchema, ExternalProvider_ExchangeProtocol_Status_BaseSchema, } from "../core/commons.external-connectors-models.schemas.js";
|
|
4
|
+
//===============================================================
|
|
5
|
+
// Agent Client Protocol (ACP)
|
|
6
|
+
// --------
|
|
7
|
+
// Execution protocol for CODING AGENTS: a long-lived JSON-RPC 2.0 session over
|
|
8
|
+
// stdio between Wildo (the ACP *client*) and an agent subprocess that reads and
|
|
9
|
+
// writes a workspace, runs commands, and asks permission before doing so.
|
|
10
|
+
//
|
|
11
|
+
// This is Zed's Agent Client Protocol (agentclientprotocol.com), NOT IBM's
|
|
12
|
+
// "Agent Communication Protocol" — that one is agent-to-agent and overlaps
|
|
13
|
+
// `A2A_CONNECTOR`. The two share an acronym and nothing else.
|
|
14
|
+
//
|
|
15
|
+
// # Why this is not a one-shot CLI transport with extra fields
|
|
16
|
+
//
|
|
17
|
+
// The transport this REPLACED (removed 2026-08-27) modelled ONE-SHOT command
|
|
18
|
+
// execution: compose argv, feed stdin, wait for exit, parse stdout. Every field
|
|
19
|
+
// it owned (`outputParserMode`, `jsonOutputPath`, per-operation argument
|
|
20
|
+
// templates) described that shape. A
|
|
21
|
+
// coding agent is the opposite shape — a session that streams progress, calls
|
|
22
|
+
// back into the client for permission, survives many turns, and reports token
|
|
23
|
+
// usage as it goes. Modelling it as a one-shot text call is precisely what left
|
|
24
|
+
// the previous lane with no token accounting, no permission channel, no
|
|
25
|
+
// cancellation and no resumption: those are not missing features, they are
|
|
26
|
+
// consequences of the wrong protocol shape.
|
|
27
|
+
//
|
|
28
|
+
// # Deliberately AGENT-NEUTRAL
|
|
29
|
+
//
|
|
30
|
+
// Wildo's default coding agent is Claude Code (through Zed's ACP adapter), but
|
|
31
|
+
// nothing in this contract names it. Every agent-specific concept is either
|
|
32
|
+
// negotiated at runtime (the agent advertises its capabilities and session
|
|
33
|
+
// modes in its `initialize` / `session/new` responses) or authored as opaque
|
|
34
|
+
// `sessionMetaExtensions`. That is what makes selecting a different registered
|
|
35
|
+
// ACP agent a configuration change rather than a new execution lane.
|
|
36
|
+
//===============================================================
|
|
37
|
+
/**
|
|
38
|
+
* Where the agent subprocess runs.
|
|
39
|
+
*
|
|
40
|
+
* Only one host exists today, and it is the same constraint the coding lane has
|
|
41
|
+
* always had: the agent must share a filesystem with the workspace it mutates.
|
|
42
|
+
* A remote host is not a variant of this — it would need the workspace shipped
|
|
43
|
+
* to it, which is a different design, so it is deliberately not enumerated
|
|
44
|
+
* until it exists.
|
|
45
|
+
*/
|
|
46
|
+
export var AgentClientProtocol_RunnerHost;
|
|
47
|
+
(function (AgentClientProtocol_RunnerHost) {
|
|
48
|
+
AgentClientProtocol_RunnerHost["BACKEND_SUBPROCESS"] = "backend_subprocess";
|
|
49
|
+
})(AgentClientProtocol_RunnerHost || (AgentClientProtocol_RunnerHost = {}));
|
|
50
|
+
/**
|
|
51
|
+
* How the spawned agent authenticates to its own model provider.
|
|
52
|
+
*
|
|
53
|
+
* ACP additionally defines a protocol-level `authenticate` method, advertised
|
|
54
|
+
* through the agent's `authMethods` array. That is NOT enumerated here: when an
|
|
55
|
+
* agent advertises auth methods the runner negotiates them at `initialize`
|
|
56
|
+
* time, which is a runtime handshake rather than authored configuration. These
|
|
57
|
+
* modes describe what the HOST does before the process starts.
|
|
58
|
+
*/
|
|
59
|
+
export var AgentClientProtocol_AuthMode;
|
|
60
|
+
(function (AgentClientProtocol_AuthMode) {
|
|
61
|
+
/** The agent needs no credential (a local model, or an agent that refuses work). */
|
|
62
|
+
AgentClientProtocol_AuthMode["NONE"] = "none";
|
|
63
|
+
/**
|
|
64
|
+
* The agent resolves its own credential from host state — an operator's prior
|
|
65
|
+
* interactive login, a keychain entry, an ambient cloud identity. Wildo
|
|
66
|
+
* injects nothing and can see nothing. This is the correct mode for a
|
|
67
|
+
* developer-machine coding agent.
|
|
68
|
+
*/
|
|
69
|
+
AgentClientProtocol_AuthMode["HOST_MANAGED"] = "host_managed";
|
|
70
|
+
/** Wildo resolves a secret by ref and injects it into the child environment. */
|
|
71
|
+
AgentClientProtocol_AuthMode["SECRET_REF_ENV_INJECTION"] = "secret_ref_env_injection";
|
|
72
|
+
})(AgentClientProtocol_AuthMode || (AgentClientProtocol_AuthMode = {}));
|
|
73
|
+
/**
|
|
74
|
+
* Which directory becomes the ACP session's `cwd`.
|
|
75
|
+
*
|
|
76
|
+
* ACP requires `cwd` to be an ABSOLUTE path and treats it as the session's
|
|
77
|
+
* primary filesystem context. The absolute path itself is never authored here:
|
|
78
|
+
* it is host authority supplied at invocation time, which is what makes a
|
|
79
|
+
* profile portable across applications and machines.
|
|
80
|
+
*/
|
|
81
|
+
export var AgentClientProtocol_WorkingDirectoryPolicy;
|
|
82
|
+
(function (AgentClientProtocol_WorkingDirectoryPolicy) {
|
|
83
|
+
AgentClientProtocol_WorkingDirectoryPolicy["WORKSPACE_ROOT"] = "workspace_root";
|
|
84
|
+
AgentClientProtocol_WorkingDirectoryPolicy["WORKSPACE_RELATIVE_PATH"] = "workspace_relative_path";
|
|
85
|
+
})(AgentClientProtocol_WorkingDirectoryPolicy || (AgentClientProtocol_WorkingDirectoryPolicy = {}));
|
|
86
|
+
/**
|
|
87
|
+
* The MOST autonomy a session started from this profile may be granted.
|
|
88
|
+
*
|
|
89
|
+
* This is a Wildo-owned vocabulary, deliberately expressed in terms of what the
|
|
90
|
+
* CLIENT must still decide rather than in any agent's mode identifiers. Agents
|
|
91
|
+
* advertise their own modes at `session/new` (Claude's adapter offers
|
|
92
|
+
* `default`, `auto`, `acceptEdits`, `plan`, `dontAsk`, `bypassPermissions`),
|
|
93
|
+
* and those identifiers are agent-specific strings — binding a provider profile
|
|
94
|
+
* to them would make the contract unusable for any other agent and would break
|
|
95
|
+
* the moment an agent renames one.
|
|
96
|
+
*
|
|
97
|
+
* It is a CEILING, not a selection: the caller (for application creation, the
|
|
98
|
+
* autonomy mode of the journey) chooses at or below it. An authored ceiling is
|
|
99
|
+
* what lets an application say "no session started from this profile may ever
|
|
100
|
+
* skip the permission gate" independently of what any individual run requests.
|
|
101
|
+
*
|
|
102
|
+
* Ordering is meaningful and increasing: PROMPT_ALWAYS < AUTO_ACCEPT_EDITS <
|
|
103
|
+
* UNRESTRICTED. Compare through {@link agentClientProtocolPermissionCeilingRank}
|
|
104
|
+
* rather than by string, so the ordering has one definition.
|
|
105
|
+
*/
|
|
106
|
+
export var AgentClientProtocol_PermissionCeiling;
|
|
107
|
+
(function (AgentClientProtocol_PermissionCeiling) {
|
|
108
|
+
/**
|
|
109
|
+
* Every permission request the agent raises must be answered by the client.
|
|
110
|
+
*
|
|
111
|
+
* Note what this does and does not promise: it guarantees the CLIENT decides
|
|
112
|
+
* every request the agent RAISES, not that the agent raises one per action.
|
|
113
|
+
* Which tool calls escalate is the agent's own policy — measured against
|
|
114
|
+
* Claude's adapter, file edits and writes prompt while a read-only shell
|
|
115
|
+
* command does not. Treat this as "no blanket pre-approval", never as "a
|
|
116
|
+
* complete inventory of what the agent did"; that inventory comes from the
|
|
117
|
+
* tool-call stream and, authoritatively, from the change set.
|
|
118
|
+
*/
|
|
119
|
+
AgentClientProtocol_PermissionCeiling["PROMPT_ALWAYS"] = "prompt_always";
|
|
120
|
+
/**
|
|
121
|
+
* File edits are auto-accepted; everything else must still be answered.
|
|
122
|
+
*
|
|
123
|
+
* "Must still be answered" is a promise the CLIENT keeps, and it is only
|
|
124
|
+
* keepable because the runner refuses to hand the decision to the agent.
|
|
125
|
+
* Measured live against Claude's adapter on 2026-08-27: selecting that
|
|
126
|
+
* agent's own `acceptEdits` session mode ALSO auto-approves arbitrary shell
|
|
127
|
+
* commands, so a mutating `printf > file` executed with no permission request
|
|
128
|
+
* at all and wrote outside the task's declared mutation scope. Under the
|
|
129
|
+
* strictest mode the identical prompt escalated and was denied, and nothing
|
|
130
|
+
* was written.
|
|
131
|
+
*
|
|
132
|
+
* So this ceiling is implemented by keeping the agent in its most-escalating
|
|
133
|
+
* mode and auto-allowing edit-kind requests HERE. The agent's similarly named
|
|
134
|
+
* mode is deliberately not selected: it grants strictly more than its name.
|
|
135
|
+
*/
|
|
136
|
+
AgentClientProtocol_PermissionCeiling["AUTO_ACCEPT_EDITS"] = "auto_accept_edits";
|
|
137
|
+
/**
|
|
138
|
+
* The protocol's NON-MUTATING tool kinds are auto-accepted; everything else must still be
|
|
139
|
+
* answered — and with no human at the other end, that means denied.
|
|
140
|
+
*
|
|
141
|
+
* The read-only lane. `read`, `search`, `fetch` and `think` are exactly the kinds the Agent Client
|
|
142
|
+
* Protocol itself classes as non-mutating; `edit`, `delete` and `move` are its mutating set and are
|
|
143
|
+
* refused here, as are `execute` (which can mutate anything) and `other` (unclassified, so
|
|
144
|
+
* fail-closed).
|
|
145
|
+
*
|
|
146
|
+
* Added 2026-08-29 because neither existing ceiling could express a research agent, MEASURED
|
|
147
|
+
* rather than assumed: a probe under {@link PROMPT_ALWAYS} with every location refused had both
|
|
148
|
+
* `WebFetch` and `WebSearch` arrive as `toolKind: 'fetch'` and be `ceiling_refused`, and the agent
|
|
149
|
+
* ended its turn saying it would not guess a price from memory. So PROMPT_ALWAYS denies research
|
|
150
|
+
* outright, and {@link AUTO_ACCEPT_EDITS} admits precisely the inverse of what research needs.
|
|
151
|
+
*/
|
|
152
|
+
AgentClientProtocol_PermissionCeiling["AUTO_ACCEPT_READS"] = "auto_accept_reads";
|
|
153
|
+
/** No permission gate. Reserve for a disposable or isolated workspace. */
|
|
154
|
+
AgentClientProtocol_PermissionCeiling["UNRESTRICTED"] = "unrestricted";
|
|
155
|
+
})(AgentClientProtocol_PermissionCeiling || (AgentClientProtocol_PermissionCeiling = {}));
|
|
156
|
+
/**
|
|
157
|
+
* Increasing rank for {@link AgentClientProtocol_PermissionCeiling}; the single ordering definition.
|
|
158
|
+
*
|
|
159
|
+
* ## It is a CLAMP order, not a subset lattice — and that distinction is load-bearing
|
|
160
|
+
*
|
|
161
|
+
* Rank answers one question: how much is pre-approved without a human. It is used to LOWER a
|
|
162
|
+
* request that asks for more autonomy than its profile allows, never to reason about which
|
|
163
|
+
* permissions contain which.
|
|
164
|
+
*
|
|
165
|
+
* The sets are deliberately NOT nested. {@link AgentClientProtocol_PermissionCeiling.AUTO_ACCEPT_EDITS}
|
|
166
|
+
* (rank 2) admits the mutating kinds and still refuses `fetch`, while
|
|
167
|
+
* {@link AgentClientProtocol_PermissionCeiling.AUTO_ACCEPT_READS} (rank 1) admits `fetch` and refuses
|
|
168
|
+
* every mutating kind. Reading rank as containment would say the higher ceiling must also admit
|
|
169
|
+
* `fetch` — and making that true would hand every coding agent network access as a side effect of
|
|
170
|
+
* building a research lane. That is a change to the coding lane's posture and it needs its own
|
|
171
|
+
* evidence, not a corollary. Clamping still behaves correctly: a coding profile lowered to
|
|
172
|
+
* AUTO_ACCEPT_READS may fetch and may not edit, which is exactly what asking for less autonomy in
|
|
173
|
+
* the read direction should mean.
|
|
174
|
+
*/
|
|
175
|
+
export function agentClientProtocolPermissionCeilingRank(ceiling) {
|
|
176
|
+
switch (ceiling) {
|
|
177
|
+
case AgentClientProtocol_PermissionCeiling.PROMPT_ALWAYS:
|
|
178
|
+
return 0;
|
|
179
|
+
case AgentClientProtocol_PermissionCeiling.AUTO_ACCEPT_READS:
|
|
180
|
+
return 1;
|
|
181
|
+
case AgentClientProtocol_PermissionCeiling.AUTO_ACCEPT_EDITS:
|
|
182
|
+
return 2;
|
|
183
|
+
case AgentClientProtocol_PermissionCeiling.UNRESTRICTED:
|
|
184
|
+
return 3;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* How much of the HOST MACHINE's agent configuration a session inherits.
|
|
189
|
+
*
|
|
190
|
+
* Coding agents read configuration from the filesystem — instructions, skills,
|
|
191
|
+
* slash commands, sub-agent personas, tool permissions — and they layer several
|
|
192
|
+
* scopes. Measured against Claude's ACP adapter, the default is to load ALL of
|
|
193
|
+
* them, including the operator's personal `~/.claude`: a probe session returned
|
|
194
|
+
* roughly forty commands and a persona belonging to the machine running it,
|
|
195
|
+
* none of which the application authored.
|
|
196
|
+
*
|
|
197
|
+
* That inheritance is not simply undesirable, which is why this is a three-way
|
|
198
|
+
* choice rather than a boolean. A dispatched coding task SHOULD read the
|
|
199
|
+
* application's own instructions and installed skills — that is how the
|
|
200
|
+
* application teaches the agent to use its framework. What it should not
|
|
201
|
+
* silently absorb is whoever happens to be logged in.
|
|
202
|
+
*/
|
|
203
|
+
export var AgentClientProtocol_HostConfigurationInheritance;
|
|
204
|
+
(function (AgentClientProtocol_HostConfigurationInheritance) {
|
|
205
|
+
/** No filesystem-sourced agent configuration. The prompt is the whole instruction. */
|
|
206
|
+
AgentClientProtocol_HostConfigurationInheritance["ISOLATED"] = "isolated";
|
|
207
|
+
/**
|
|
208
|
+
* Configuration owned by the workspace (its committed instructions, its
|
|
209
|
+
* installed skills, its checked-in settings) — but not the operator's
|
|
210
|
+
* personal configuration. The correct default for a dispatched task.
|
|
211
|
+
*/
|
|
212
|
+
AgentClientProtocol_HostConfigurationInheritance["APPLICATION_SCOPED"] = "application_scoped";
|
|
213
|
+
/**
|
|
214
|
+
* Everything the agent would load if a human had started it by hand,
|
|
215
|
+
* including operator-level configuration. Honest about what it is: the run
|
|
216
|
+
* then depends on machine state Wildo neither authored nor recorded, so a run
|
|
217
|
+
* is not reproducible on another machine.
|
|
218
|
+
*/
|
|
219
|
+
AgentClientProtocol_HostConfigurationInheritance["HOST_INHERITED"] = "host_inherited";
|
|
220
|
+
})(AgentClientProtocol_HostConfigurationInheritance || (AgentClientProtocol_HostConfigurationInheritance = {}));
|
|
221
|
+
/**
|
|
222
|
+
* One authored way to start an ACP agent.
|
|
223
|
+
*
|
|
224
|
+
* Mirrors the shape a provider's execution profiles have always had: the
|
|
225
|
+
* spawnable command plus the policy that decides whether it may run at all.
|
|
226
|
+
*/
|
|
227
|
+
export const AgentClientProtocol_ExecutionProfileSchema = z.object({
|
|
228
|
+
runnerHost: z.enum(AgentClientProtocol_RunnerHost).default(AgentClientProtocol_RunnerHost.BACKEND_SUBPROCESS),
|
|
229
|
+
/**
|
|
230
|
+
* The executable that speaks ACP on stdio — OPTIONAL, and normally omitted.
|
|
231
|
+
*
|
|
232
|
+
* How to START an agent is the PROVIDER's knowledge: the package, the pinned
|
|
233
|
+
* version, the launcher. An application that restates it holds a second copy
|
|
234
|
+
* of a version it does not own, which is how the adapter pin came to be
|
|
235
|
+
* declared in two places with no mechanical link. Omit these and the provider
|
|
236
|
+
* contract supplies them; set them only to run an agent the provider does not
|
|
237
|
+
* describe, and accept owning the version if you do.
|
|
238
|
+
*/
|
|
239
|
+
command: z.string().min(1).optional(),
|
|
240
|
+
args: z.array(z.string()).optional(),
|
|
241
|
+
/**
|
|
242
|
+
* Host environment variables forwarded into the child.
|
|
243
|
+
*
|
|
244
|
+
* The runner starts from a minimal identity allowlist and adds only what is
|
|
245
|
+
* named here. Full inheritance is never available: the process that spawns
|
|
246
|
+
* the agent holds platform secrets that must not reach it.
|
|
247
|
+
*/
|
|
248
|
+
inheritedEnvironmentVariables: z.array(z.string().min(1)).optional(),
|
|
249
|
+
authMode: z.enum(AgentClientProtocol_AuthMode),
|
|
250
|
+
secretRef: z.string().optional(),
|
|
251
|
+
secretEnvVarName: z.string().optional(),
|
|
252
|
+
/**
|
|
253
|
+
* The environments this profile may run in — REQUIRED, and never widened by
|
|
254
|
+
* default.
|
|
255
|
+
*
|
|
256
|
+
* This is the gate that keeps a workspace-mutating agent out of production.
|
|
257
|
+
* It is carried here explicitly rather than inherited from anything, because
|
|
258
|
+
* the equivalent guard on the protocol this replaces was enforced by a single
|
|
259
|
+
* function that a new transport could have quietly failed to call.
|
|
260
|
+
*/
|
|
261
|
+
allowedApplicationEnvironments: z.array(z.enum(APPLICATION_ENVIRONMENT)).min(1),
|
|
262
|
+
/** Optional further narrowing to named platform environments. */
|
|
263
|
+
allowedPlatformEnvironmentIds: z.array(z.string()).optional(),
|
|
264
|
+
workingDirectoryPolicy: z.enum(AgentClientProtocol_WorkingDirectoryPolicy).default(AgentClientProtocol_WorkingDirectoryPolicy.WORKSPACE_ROOT),
|
|
265
|
+
workingDirectoryRelativePath: z.string().optional(),
|
|
266
|
+
permissionCeiling: z.enum(AgentClientProtocol_PermissionCeiling).default(AgentClientProtocol_PermissionCeiling.PROMPT_ALWAYS),
|
|
267
|
+
hostConfigurationInheritance: z.enum(AgentClientProtocol_HostConfigurationInheritance).default(AgentClientProtocol_HostConfigurationInheritance.APPLICATION_SCOPED),
|
|
268
|
+
/**
|
|
269
|
+
* Wall-clock ceiling for one prompt turn.
|
|
270
|
+
*
|
|
271
|
+
* On expiry the runner sends `session/cancel` and waits for the agent to
|
|
272
|
+
* settle rather than killing the process: ACP defines cancellation as
|
|
273
|
+
* cooperative, and an agent that is mid-edit should be allowed to stop
|
|
274
|
+
* cleanly. A hard kill remains the fallback if the agent does not honour it.
|
|
275
|
+
*/
|
|
276
|
+
turnTimeoutMs: z.number().int().positive().optional(),
|
|
277
|
+
/**
|
|
278
|
+
* Ceiling on the bytes of session events this run PERSISTS.
|
|
279
|
+
*
|
|
280
|
+
* Semantics are TRUNCATE, not reject — deliberately the opposite of the
|
|
281
|
+
* output cap this replaces, which killed a run for being talkative after it
|
|
282
|
+
* had already mutated the workspace. Losing the tail of a transcript is a
|
|
283
|
+
* reporting loss; losing the run is a work loss.
|
|
284
|
+
*/
|
|
285
|
+
maximumRecordedEventBytes: z.number().int().positive().optional(),
|
|
286
|
+
/**
|
|
287
|
+
* Opaque, agent-specific options passed as `_meta` on `session/new`.
|
|
288
|
+
*
|
|
289
|
+
* ACP reserves `_meta` for extensions, and agents use it for options their
|
|
290
|
+
* own runtime understands and no other agent would. Keeping it opaque is what
|
|
291
|
+
* keeps the rest of this contract agent-neutral — but it is also unvalidated
|
|
292
|
+
* and unportable by construction, so anything Wildo needs to GUARANTEE (the
|
|
293
|
+
* environment gate, the permission ceiling, configuration inheritance) is a
|
|
294
|
+
* typed field above and never expressed here.
|
|
295
|
+
*/
|
|
296
|
+
sessionMetaExtensions: z.record(z.string(), z.unknown()).optional(),
|
|
297
|
+
}).strict().superRefine((profile, context) => {
|
|
298
|
+
if (profile.authMode === AgentClientProtocol_AuthMode.SECRET_REF_ENV_INJECTION && !profile.secretRef) {
|
|
299
|
+
context.addIssue({
|
|
300
|
+
code: "custom",
|
|
301
|
+
message: "`secretRef` is required when `authMode` is `SECRET_REF_ENV_INJECTION`.",
|
|
302
|
+
path: ["secretRef"],
|
|
303
|
+
});
|
|
304
|
+
}
|
|
305
|
+
if (profile.authMode === AgentClientProtocol_AuthMode.SECRET_REF_ENV_INJECTION && !profile.secretEnvVarName) {
|
|
306
|
+
context.addIssue({
|
|
307
|
+
code: "custom",
|
|
308
|
+
message: "`secretEnvVarName` is required when `authMode` is `SECRET_REF_ENV_INJECTION`.",
|
|
309
|
+
path: ["secretEnvVarName"],
|
|
310
|
+
});
|
|
311
|
+
}
|
|
312
|
+
// A host-managed or unauthenticated profile carrying a secret binding is a
|
|
313
|
+
// contradiction the runner would resolve silently — injecting nothing while
|
|
314
|
+
// the authored configuration claims a credential is in play. Refuse it, so
|
|
315
|
+
// "this profile injects no secret" is a property of the schema rather than of
|
|
316
|
+
// a reviewer's reading.
|
|
317
|
+
if (profile.authMode !== AgentClientProtocol_AuthMode.SECRET_REF_ENV_INJECTION &&
|
|
318
|
+
(profile.secretRef !== undefined || profile.secretEnvVarName !== undefined)) {
|
|
319
|
+
context.addIssue({
|
|
320
|
+
code: "custom",
|
|
321
|
+
message: "`secretRef`/`secretEnvVarName` are only valid when `authMode` is `SECRET_REF_ENV_INJECTION`.",
|
|
322
|
+
path: ["secretRef"],
|
|
323
|
+
});
|
|
324
|
+
}
|
|
325
|
+
if (profile.workingDirectoryPolicy === AgentClientProtocol_WorkingDirectoryPolicy.WORKSPACE_RELATIVE_PATH &&
|
|
326
|
+
!profile.workingDirectoryRelativePath) {
|
|
327
|
+
context.addIssue({
|
|
328
|
+
code: "custom",
|
|
329
|
+
message: "`workingDirectoryRelativePath` is required when using `WORKSPACE_RELATIVE_PATH`.",
|
|
330
|
+
path: ["workingDirectoryRelativePath"],
|
|
331
|
+
});
|
|
332
|
+
}
|
|
333
|
+
if (profile.workingDirectoryPolicy !== AgentClientProtocol_WorkingDirectoryPolicy.WORKSPACE_RELATIVE_PATH &&
|
|
334
|
+
profile.workingDirectoryRelativePath !== undefined) {
|
|
335
|
+
context.addIssue({
|
|
336
|
+
code: "custom",
|
|
337
|
+
message: "`workingDirectoryRelativePath` is only valid when using `WORKSPACE_RELATIVE_PATH`.",
|
|
338
|
+
path: ["workingDirectoryRelativePath"],
|
|
339
|
+
});
|
|
340
|
+
}
|
|
341
|
+
// An UNRESTRICTED ceiling on a profile that may run outside development is
|
|
342
|
+
// the one combination with no legitimate reading: it authorises an agent to
|
|
343
|
+
// mutate a non-development workspace with no gate and no record of a decision.
|
|
344
|
+
if (profile.permissionCeiling === AgentClientProtocol_PermissionCeiling.UNRESTRICTED &&
|
|
345
|
+
profile.allowedApplicationEnvironments.some((environment) => environment !== APPLICATION_ENVIRONMENT.DEVELOPMENT)) {
|
|
346
|
+
context.addIssue({
|
|
347
|
+
code: "custom",
|
|
348
|
+
message: "`permissionCeiling: UNRESTRICTED` is only valid for a profile restricted to the DEVELOPMENT environment.",
|
|
349
|
+
path: ["permissionCeiling"],
|
|
350
|
+
});
|
|
351
|
+
}
|
|
352
|
+
});
|
|
353
|
+
/**
|
|
354
|
+
* Transport capability metadata for an ACP-speaking provider.
|
|
355
|
+
*
|
|
356
|
+
* Note how little is declared here compared with a one-shot CLI contract, and
|
|
357
|
+
* why: ACP agents advertise their own capabilities, session modes and available
|
|
358
|
+
* commands during `initialize` and `session/new`. Re-declaring any of that in
|
|
359
|
+
* authored configuration would create a second source of truth that drifts the
|
|
360
|
+
* first time the agent is upgraded. What remains is what the HOST must know
|
|
361
|
+
* before it opens a connection.
|
|
362
|
+
*/
|
|
363
|
+
export const AgentClientProtocol_ProfileSchema = ExternalProvider_ExchangeProtocol_Profile_BaseSchema.extend({
|
|
364
|
+
supportedRunnerHosts: z.array(z.enum(AgentClientProtocol_RunnerHost)).default([
|
|
365
|
+
AgentClientProtocol_RunnerHost.BACKEND_SUBPROCESS,
|
|
366
|
+
]),
|
|
367
|
+
/**
|
|
368
|
+
* The ACP major versions this provider is known to speak.
|
|
369
|
+
*
|
|
370
|
+
* ACP negotiates a single integer at `initialize`: the client offers its
|
|
371
|
+
* latest, the agent answers with that or its own. This list is what the
|
|
372
|
+
* runner is willing to accept in that answer — an agent that returns anything
|
|
373
|
+
* else is refused rather than spoken to hopefully.
|
|
374
|
+
*/
|
|
375
|
+
supportedProtocolVersions: z.array(z.number().int().positive()).min(1).default([1]),
|
|
376
|
+
/**
|
|
377
|
+
* The semantic operations this transport can execute truthfully.
|
|
378
|
+
*
|
|
379
|
+
* Kept as strings to avoid a circular runtime import with the operation
|
|
380
|
+
* family that consumes this protocol — the same reason the CLI contract this
|
|
381
|
+
* replaces did so.
|
|
382
|
+
*/
|
|
383
|
+
supportedOperationKeys: z.array(z.string().min(1)).min(1),
|
|
384
|
+
/**
|
|
385
|
+
* The semantic models valid on this transport.
|
|
386
|
+
*
|
|
387
|
+
* The agent also advertises its own model options per session; this list is
|
|
388
|
+
* the authored subset an application is willing to select from, and it is
|
|
389
|
+
* what a requested model is validated against before a session is opened.
|
|
390
|
+
*/
|
|
391
|
+
supportedModels: z.array(z.string().min(1)).min(1),
|
|
392
|
+
supportedAuthModes: z.array(z.enum(AgentClientProtocol_AuthMode)).default([
|
|
393
|
+
AgentClientProtocol_AuthMode.NONE,
|
|
394
|
+
AgentClientProtocol_AuthMode.HOST_MANAGED,
|
|
395
|
+
AgentClientProtocol_AuthMode.SECRET_REF_ENV_INJECTION,
|
|
396
|
+
]),
|
|
397
|
+
});
|
|
398
|
+
export const AgentClientProtocol_ConfigurationSchema = ExternalProvider_ExchangeProtocol_Configuration_BaseSchema.extend({
|
|
399
|
+
defaultExecutionProfileRef: z.string().optional(),
|
|
400
|
+
executionProfiles: z.record(z.string(), AgentClientProtocol_ExecutionProfileSchema),
|
|
401
|
+
}).superRefine((config, context) => {
|
|
402
|
+
if (config.defaultExecutionProfileRef && !config.executionProfiles[config.defaultExecutionProfileRef]) {
|
|
403
|
+
context.addIssue({
|
|
404
|
+
code: "custom",
|
|
405
|
+
message: "`defaultExecutionProfileRef` must reference an existing execution profile.",
|
|
406
|
+
path: ["defaultExecutionProfileRef"],
|
|
407
|
+
});
|
|
408
|
+
}
|
|
409
|
+
});
|
|
410
|
+
export const AgentClientProtocol_StatusSchema = ExternalProvider_ExchangeProtocol_Status_BaseSchema.extend({
|
|
411
|
+
protocolKind: z.literal(ExternalProvider_ExchangeProtocol_Kind.AGENT_CLIENT_PROTOCOL),
|
|
412
|
+
/** The version actually agreed at the last `initialize`, when one succeeded. */
|
|
413
|
+
negotiatedProtocolVersion: z.number().int().positive().optional(),
|
|
414
|
+
/**
|
|
415
|
+
* The agent's self-reported identity from its last `initialize` response.
|
|
416
|
+
*
|
|
417
|
+
* Recorded because the agent is an independently released dependency: when a
|
|
418
|
+
* run starts behaving differently, "which build answered" is the first
|
|
419
|
+
* question, and it is not answerable from anything Wildo authored.
|
|
420
|
+
*/
|
|
421
|
+
observedAgentName: z.string().optional(),
|
|
422
|
+
observedAgentVersion: z.string().optional(),
|
|
423
|
+
});
|
|
424
|
+
//===============================================================
|
|
425
|
+
// Coding-agent operation family
|
|
426
|
+
// --------
|
|
427
|
+
// The semantic operation an ACP session serves. Deliberately NOT an
|
|
428
|
+
// `LLMProvider_OperationKey`: a run that edits a worktree, executes commands
|
|
429
|
+
// and requests authorisation is a different KIND of work from a text
|
|
430
|
+
// completion, and the two enums being disjoint is what lets an agent
|
|
431
|
+
// configuration be narrowed by its operation key alone.
|
|
432
|
+
//===============================================================
|
|
433
|
+
export var CodingAgent_OperationKey;
|
|
434
|
+
(function (CodingAgent_OperationKey) {
|
|
435
|
+
/** A bounded, scoped change to a workspace, performed by an autonomous agent. */
|
|
436
|
+
CodingAgent_OperationKey["RUN_CODING_TASK"] = "coding.runCodingTask";
|
|
437
|
+
})(CodingAgent_OperationKey || (CodingAgent_OperationKey = {}));
|
|
438
|
+
/**
|
|
439
|
+
* Why a prompt turn ended.
|
|
440
|
+
*
|
|
441
|
+
* The wire values are ACP's own — this is the thin boundary where the
|
|
442
|
+
* protocol's vocabulary is translated into a named one Wildo can branch on and
|
|
443
|
+
* explain. `CANCELLED` in particular must stay distinguishable from `END_TURN`:
|
|
444
|
+
* a cancelled run's partial change set is a different fact from a completed
|
|
445
|
+
* run's, and a lane that conflates them reports work as finished that was
|
|
446
|
+
* interrupted.
|
|
447
|
+
*/
|
|
448
|
+
export var CodingAgent_StopReason;
|
|
449
|
+
(function (CodingAgent_StopReason) {
|
|
450
|
+
/** The agent finished of its own accord. */
|
|
451
|
+
CodingAgent_StopReason["END_TURN"] = "end_turn";
|
|
452
|
+
/** The model's output limit was reached mid-work. */
|
|
453
|
+
CodingAgent_StopReason["MAX_TOKENS"] = "max_tokens";
|
|
454
|
+
/** The agent's own per-turn request budget was exhausted. */
|
|
455
|
+
CodingAgent_StopReason["MAX_TURN_REQUESTS"] = "max_turn_requests";
|
|
456
|
+
/** The model declined the task. */
|
|
457
|
+
CodingAgent_StopReason["REFUSAL"] = "refusal";
|
|
458
|
+
/** The client asked the session to stop, and the agent complied. */
|
|
459
|
+
CodingAgent_StopReason["CANCELLED"] = "cancelled";
|
|
460
|
+
/**
|
|
461
|
+
* WILDO'S OWN marker, not an ACP wire value: the agent reported a stop reason
|
|
462
|
+
* this protocol version does not define.
|
|
463
|
+
*
|
|
464
|
+
* It exists so an unknown value cannot discard evidence. The alternative —
|
|
465
|
+
* throwing — happens AFTER the turn, i.e. after the workspace has already been
|
|
466
|
+
* mutated, so it would turn a completed run into an error whose change set
|
|
467
|
+
* nobody records. Callers must treat this like `CANCELLED`: not a working
|
|
468
|
+
* result, but a run whose changes are real and must still be captured.
|
|
469
|
+
*/
|
|
470
|
+
CodingAgent_StopReason["UNRECOGNISED"] = "wildo.unrecognised";
|
|
471
|
+
})(CodingAgent_StopReason || (CodingAgent_StopReason = {}));
|
|
472
|
+
/**
|
|
473
|
+
* What one coding turn consumed.
|
|
474
|
+
*
|
|
475
|
+
* EVERY field is optional, and that is a statement about the protocol rather
|
|
476
|
+
* than laziness. ACP guarantees only the context-window pair (`used` / `size`)
|
|
477
|
+
* on its usage notification; token breakdowns and monetary cost are agent
|
|
478
|
+
* EXTENSIONS — Claude's adapter reports all of them, another agent may report
|
|
479
|
+
* none. Code that enforces a budget must therefore decide what to do when the
|
|
480
|
+
* number it wants is absent, and the schema makes that unavoidable rather than
|
|
481
|
+
* letting a missing value read as zero.
|
|
482
|
+
*
|
|
483
|
+
* This is the capability the transport it replaces could not express at all:
|
|
484
|
+
* a one-shot CLI reported nothing, so budgets were reduced to wall-clock and
|
|
485
|
+
* run-count proxies.
|
|
486
|
+
*/
|
|
487
|
+
export const CodingAgent_UsageSchema = z.object({
|
|
488
|
+
/** Context-window tokens in use at the end of the turn (ACP: `usage_update.used`). */
|
|
489
|
+
contextUsed: z.number().int().nonnegative().optional(),
|
|
490
|
+
/** Total context window available (ACP: `usage_update.size`). */
|
|
491
|
+
contextWindowSize: z.number().int().nonnegative().optional(),
|
|
492
|
+
inputTokens: z.number().int().nonnegative().optional(),
|
|
493
|
+
outputTokens: z.number().int().nonnegative().optional(),
|
|
494
|
+
/** Tokens READ from the prompt cache — typically the dominant term for a coding turn. */
|
|
495
|
+
cachedReadTokens: z.number().int().nonnegative().optional(),
|
|
496
|
+
/** Tokens WRITTEN to the prompt cache. */
|
|
497
|
+
cachedWriteTokens: z.number().int().nonnegative().optional(),
|
|
498
|
+
totalTokens: z.number().int().nonnegative().optional(),
|
|
499
|
+
/**
|
|
500
|
+
* Monetary cost of the turn, when the agent reports one.
|
|
501
|
+
*
|
|
502
|
+
* Kept as an amount + currency pair rather than a bare number: a budget
|
|
503
|
+
* denominated in an unstated currency is not a budget. Amount is a plain
|
|
504
|
+
* number because it arrives that way; anything that ACCUMULATES cost should
|
|
505
|
+
* round explicitly at its own boundary rather than trusting float addition.
|
|
506
|
+
*/
|
|
507
|
+
cost: z.object({
|
|
508
|
+
amount: z.number().nonnegative(),
|
|
509
|
+
currency: z.string().min(1),
|
|
510
|
+
}).optional(),
|
|
511
|
+
});
|
|
512
|
+
/**
|
|
513
|
+
* Transport metadata for a completed coding run.
|
|
514
|
+
*
|
|
515
|
+
* Note where this lives: WITH the coding-agent family, not in the LLM
|
|
516
|
+
* protocol's transport union. A coding run is not an LLM call with a different
|
|
517
|
+
* wire format, and recording it inside the LLM execution-metadata union would
|
|
518
|
+
* re-create, one layer down, exactly the mis-modelling this protocol exists to
|
|
519
|
+
* end.
|
|
520
|
+
*/
|
|
521
|
+
export const AgentClientProtocol_ExecutionTransportMetadataSchema = z.object({
|
|
522
|
+
protocolKind: z.literal(ExternalProvider_ExchangeProtocol_Kind.AGENT_CLIENT_PROTOCOL),
|
|
523
|
+
providerRef: z.string(),
|
|
524
|
+
executionProfileRef: z.string(),
|
|
525
|
+
model: z.string().optional(),
|
|
526
|
+
/** The ACP major version agreed at `initialize`. */
|
|
527
|
+
negotiatedProtocolVersion: z.number().int().positive().optional(),
|
|
528
|
+
/** The agent's self-reported build — the first question when a run misbehaves. */
|
|
529
|
+
agentName: z.string().optional(),
|
|
530
|
+
agentVersion: z.string().optional(),
|
|
531
|
+
/**
|
|
532
|
+
* The agent-declared session mode the run actually executed under.
|
|
533
|
+
*
|
|
534
|
+
* Recorded verbatim as the agent named it, because it is the agent's
|
|
535
|
+
* vocabulary and the mapping from Wildo's ceiling is lossy in one direction:
|
|
536
|
+
* knowing the run was clamped to `PROMPT_ALWAYS` does not tell a later reader
|
|
537
|
+
* which of the agent's modes that became.
|
|
538
|
+
*/
|
|
539
|
+
sessionModeId: z.string().optional(),
|
|
540
|
+
/** The ACP session, retained so a later turn can resume or fork it. */
|
|
541
|
+
sessionId: z.string().optional(),
|
|
542
|
+
});
|
|
543
|
+
export const CodingAgent_OperationContext_BaseSchema = ExternalProvider_OperationContextSchema.extend({
|
|
544
|
+
usage: CodingAgent_UsageSchema.optional(),
|
|
545
|
+
executionTime: z.number().optional(),
|
|
546
|
+
finishedAt: z.string().optional(),
|
|
547
|
+
transport: AgentClientProtocol_ExecutionTransportMetadataSchema.optional(),
|
|
548
|
+
});
|
|
549
|
+
// ===============================================================
|
|
550
|
+
// Coding-agent I/O
|
|
551
|
+
// ===============================================================
|
|
552
|
+
/**
|
|
553
|
+
* Model-selection configuration for a coding agent.
|
|
554
|
+
*
|
|
555
|
+
* Deliberately smaller than its LLM sibling, and the omissions are the design.
|
|
556
|
+
* There is no `temperature`, `topP` or penalty here: those tune a completion,
|
|
557
|
+
* and an ACP agent is not one — it runs its own inner loop, chooses its own
|
|
558
|
+
* tools and manages its own sampling. Offering an application knobs the
|
|
559
|
+
* transport cannot honour would be worse than offering none, because it would
|
|
560
|
+
* read as configuration and behave as decoration.
|
|
561
|
+
*
|
|
562
|
+
* `maxTokens` is likewise absent: a coding run's budget is enforced by the
|
|
563
|
+
* caller against reported usage after each turn, not requested up front — the
|
|
564
|
+
* agent decides how many model calls its task needs.
|
|
565
|
+
*/
|
|
566
|
+
export const CodingAgent_OperationModelConfiguration_Schema = z.object({
|
|
567
|
+
model: z.string(),
|
|
568
|
+
providerRef: z.string(),
|
|
569
|
+
});
|
|
570
|
+
export const CodingAgent_RunTaskInputSchema = z.object({
|
|
571
|
+
/**
|
|
572
|
+
* The rendered task handed to the agent as the turn's prompt.
|
|
573
|
+
*
|
|
574
|
+
* A single string on purpose: the caller owns task composition (for
|
|
575
|
+
* application creation, a typed task contract renders it), and the transport
|
|
576
|
+
* must not become a second place where task semantics are assembled.
|
|
577
|
+
*/
|
|
578
|
+
prompt: z.string().min(1),
|
|
579
|
+
/**
|
|
580
|
+
* The autonomy this particular run asks for.
|
|
581
|
+
*
|
|
582
|
+
* CLAMPED, never honoured blindly: the runner takes the lower of this and the
|
|
583
|
+
* execution profile's `permissionCeiling`. Absent means the profile's ceiling
|
|
584
|
+
* — which is itself the safe default — so omitting it can never widen
|
|
585
|
+
* authority, only leave it where the profile put it.
|
|
586
|
+
*/
|
|
587
|
+
requestedPermissionCeiling: z.enum(AgentClientProtocol_PermissionCeiling).optional(),
|
|
588
|
+
});
|
|
589
|
+
export const CodingAgent_RunTaskOutputSchema = z.object({
|
|
590
|
+
/** The agent's closing message — its own account of what it did. */
|
|
591
|
+
finalMessage: z.string(),
|
|
592
|
+
stopReason: z.enum(CodingAgent_StopReason),
|
|
593
|
+
/**
|
|
594
|
+
* Absolute paths the agent REPORTED touching, from its tool-call stream.
|
|
595
|
+
*
|
|
596
|
+
* A claim, not a record. An agent reports what its own tooling surfaces, and
|
|
597
|
+
* nothing prevents it writing a file it never mentions — measured against
|
|
598
|
+
* Claude's adapter, file operations happen inside the agent and are reported
|
|
599
|
+
* afterwards rather than routed through the client. Use this to NARROW an
|
|
600
|
+
* attribution question; never as the answer. The authoritative record of what
|
|
601
|
+
* changed is the workspace diff taken around the run.
|
|
602
|
+
*/
|
|
603
|
+
reportedFileLocations: z.array(z.string()).optional(),
|
|
604
|
+
/**
|
|
605
|
+
* How many permission requests the client REFUSED during the turn.
|
|
606
|
+
*
|
|
607
|
+
* Recorded because under the strictest ceiling refusal is the NORMAL outcome,
|
|
608
|
+
* not an exception: without this number a run in which the agent proposed five
|
|
609
|
+
* changes and was refused every one is indistinguishable from a run in which
|
|
610
|
+
* it proposed nothing. The agent's own closing message cannot be relied on to
|
|
611
|
+
* say so.
|
|
612
|
+
*/
|
|
613
|
+
deniedPermissionCount: z.number().int().nonnegative().optional(),
|
|
614
|
+
/**
|
|
615
|
+
* One record per permission request, with the REASON it was decided.
|
|
616
|
+
*
|
|
617
|
+
* The count above says HOW MANY were refused; this says WHY, which is the half that makes a
|
|
618
|
+
* refusal actionable. A run under an UNRESTRICTED ceiling came back with two refusals and no
|
|
619
|
+
* files written, and nothing recorded could distinguish "the scope predicate refused a path"
|
|
620
|
+
* from "the agent offered no option the client would select" — opposite defects with an
|
|
621
|
+
* identical outward appearance, and neither diagnosable without dispatching another agent.
|
|
622
|
+
*
|
|
623
|
+
* Deliberately carries no prompt or file CONTENT: the tool kind, the declared paths, the
|
|
624
|
+
* option kinds offered, and the decision.
|
|
625
|
+
*/
|
|
626
|
+
permissionDecisions: z.array(z.strictObject({
|
|
627
|
+
allowed: z.boolean(),
|
|
628
|
+
reason: z.string(),
|
|
629
|
+
toolKind: z.string().optional(),
|
|
630
|
+
locations: z.array(z.string()),
|
|
631
|
+
offeredOptionKinds: z.array(z.string()),
|
|
632
|
+
})).optional(),
|
|
633
|
+
/**
|
|
634
|
+
* The agent's verbatim stop reason when it was one this version does not
|
|
635
|
+
* define. Present exactly when `stopReason` is `UNRECOGNISED`.
|
|
636
|
+
*/
|
|
637
|
+
rawStopReason: z.string().optional(),
|
|
638
|
+
});
|
|
639
|
+
//# sourceMappingURL=agent-client-protocol.external-connectors-models.schemas.js.map
|