@agen-ai/agent-protocol 0.2.4 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +57 -13
- package/dist/accountQuota/index.d.ts +3 -0
- package/dist/accountQuota/index.js +2 -0
- package/dist/accountQuota/parsers.d.ts +7 -0
- package/dist/accountQuota/parsers.js +20 -0
- package/dist/accountQuota/types.d.ts +89 -0
- package/dist/accountQuota/types.js +12 -0
- package/dist/capabilities/contentReferenceText.d.ts +13 -0
- package/dist/capabilities/contentReferenceText.js +25 -0
- package/dist/capabilities/index.d.ts +1 -0
- package/dist/capabilities/index.js +1 -0
- package/dist/capabilities/types.d.ts +19 -1
- package/dist/capabilities/types.js +6 -0
- package/dist/commands/index.d.ts +3 -0
- package/dist/commands/index.js +2 -0
- package/dist/commands/parsers.d.ts +7 -0
- package/dist/commands/parsers.js +23 -0
- package/dist/commands/types.d.ts +26 -0
- package/dist/commands/types.js +10 -0
- package/dist/effectiveContent/index.d.ts +3 -0
- package/dist/effectiveContent/index.js +2 -0
- package/dist/effectiveContent/parsers.d.ts +7 -0
- package/dist/effectiveContent/parsers.js +23 -0
- package/dist/effectiveContent/types.d.ts +35 -0
- package/dist/effectiveContent/types.js +19 -0
- package/dist/environment/facts.d.ts +28 -0
- package/dist/environment/facts.js +39 -0
- package/dist/environment/index.d.ts +4 -0
- package/dist/environment/index.js +3 -0
- package/dist/environment/parsers.d.ts +17 -0
- package/dist/environment/parsers.js +68 -0
- package/dist/environment/types.d.ts +61 -0
- package/dist/environment/types.js +26 -0
- package/dist/events/types.d.ts +1 -1
- package/dist/extensions/index.d.ts +3 -0
- package/dist/extensions/index.js +2 -0
- package/dist/extensions/parsers.d.ts +7 -0
- package/dist/extensions/parsers.js +23 -0
- package/dist/extensions/types.d.ts +73 -0
- package/dist/extensions/types.js +30 -0
- package/dist/foundation/parsers.d.ts +9 -1
- package/dist/foundation/parsers.js +24 -0
- package/dist/foundation/types.d.ts +5 -1
- package/dist/foundation/types.js +1 -1
- package/dist/integrations/types.d.ts +22 -4
- package/dist/integrations/types.js +6 -2
- package/dist/jsonSchema/generated.d.ts +9893 -5474
- package/dist/jsonSchema/generated.js +3097 -154
- package/dist/public/accountQuota.d.ts +2 -0
- package/dist/public/accountQuota.js +1 -0
- package/dist/public/commands.d.ts +2 -0
- package/dist/public/commands.js +1 -0
- package/dist/public/effectiveContent.d.ts +2 -0
- package/dist/public/effectiveContent.js +1 -0
- package/dist/public/environment.d.ts +2 -0
- package/dist/public/environment.js +1 -0
- package/dist/public/extensions.d.ts +2 -0
- package/dist/public/extensions.js +1 -0
- package/dist/public/index.d.ts +5 -0
- package/dist/public/index.js +5 -0
- package/dist/turns/parsers.d.ts +3 -1
- package/dist/turns/parsers.js +9 -0
- package/dist/turns/types.d.ts +13 -2
- package/dist/turns/types.js +4 -0
- package/dist/zod/accountQuota.d.ts +265 -0
- package/dist/zod/accountQuota.js +155 -0
- package/dist/zod/capabilities.d.ts +79 -1
- package/dist/zod/capabilities.js +21 -5
- package/dist/zod/commands.d.ts +35 -0
- package/dist/zod/commands.js +114 -0
- package/dist/zod/effectiveContent.d.ts +72 -0
- package/dist/zod/effectiveContent.js +157 -0
- package/dist/zod/environment.d.ts +531 -0
- package/dist/zod/environment.js +336 -0
- package/dist/zod/environmentFacts.d.ts +10 -0
- package/dist/zod/environmentFacts.js +40 -0
- package/dist/zod/events.d.ts +23 -23
- package/dist/zod/extensions.d.ts +161 -0
- package/dist/zod/extensions.js +194 -0
- package/dist/zod/foundation.d.ts +6 -1
- package/dist/zod/foundation.js +12 -3
- package/dist/zod/index.d.ts +10 -4
- package/dist/zod/index.js +22 -2
- package/dist/zod/integrations.d.ts +54 -9
- package/dist/zod/integrations.js +49 -6
- package/dist/zod/resources.d.ts +2 -2
- package/dist/zod/turns.d.ts +33 -0
- package/dist/zod/turns.js +34 -1
- package/dist/zod/typeEquality.generated.d.ts +40 -4
- package/package.json +23 -3
package/README.md
CHANGED
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
`@agen-ai/agent-protocol` is the provider-neutral data contract for coding-agent runtimes. It
|
|
4
4
|
defines opaque identifiers, sessions, turns, approval and elicitation requests, technical
|
|
5
5
|
capabilities, typed operations, safe configuration and managed-content inventories, integration
|
|
6
|
-
observations, collaboration lifecycles, generated resources, portable
|
|
7
|
-
provider-observed events. The package does not define a transport or
|
|
6
|
+
observations, effective harness content and package catalogs, environment observations, account-quota observations, collaboration lifecycles, generated resources, portable
|
|
7
|
+
artifact descriptors, and provider-observed events. The package does not define a transport or
|
|
8
|
+
execution runtime.
|
|
8
9
|
|
|
9
10
|
## Ownership boundary
|
|
10
11
|
|
|
@@ -20,12 +21,18 @@ identities to protocol IDs.
|
|
|
20
21
|
the currently running turn. It does not describe, authorize, or implement future-turn queueing;
|
|
21
22
|
that product concern belongs to the caller's control plane.
|
|
22
23
|
|
|
24
|
+
Account-quota observations describe the allowance state reported by the account that funds a
|
|
25
|
+
provider connection. They do not identify that account, authorize a caller, decide whether a turn
|
|
26
|
+
may run, or represent AgenAI billing. `sourceId`, `poolId`, and `windowId` are opaque correlation
|
|
27
|
+
values. A quota observation with a known zero or an unknown reset remains valid; unavailable states
|
|
28
|
+
carry no fabricated windows or hints.
|
|
29
|
+
|
|
23
30
|
## Entrypoints
|
|
24
31
|
|
|
25
32
|
- `@agen-ai/agent-protocol` exports the complete plain API.
|
|
26
33
|
- `/sessions`, `/turns`, `/requests`, `/events`, `/capabilities`, `/artifacts`, `/operations`,
|
|
27
|
-
`/configuration`, `/managed-content`, `/integrations`, `/collaboration`,
|
|
28
|
-
focused plain entrypoints.
|
|
34
|
+
`/configuration`, `/managed-content`, `/integrations`, `/collaboration`, `/resources`, and
|
|
35
|
+
`/account-quota`, `/effective-content`, `/commands`, `/extensions`, and `/environment` are focused plain entrypoints.
|
|
29
36
|
- `/zod` is the only entrypoint that exposes Zod schemas.
|
|
30
37
|
- `/json-schema` exposes deterministic draft 2020-12 schema artifacts.
|
|
31
38
|
|
|
@@ -43,7 +50,7 @@ import {
|
|
|
43
50
|
} from '@agen-ai/agent-protocol';
|
|
44
51
|
|
|
45
52
|
const event: AgentEvent = parseAgentEvent({
|
|
46
|
-
protocolVersion:
|
|
53
|
+
protocolVersion: 9,
|
|
47
54
|
type: 'content.delta',
|
|
48
55
|
sessionId: parseAgentSessionId('external-session:42'),
|
|
49
56
|
turnId: parseAgentTurnId('external-turn:9'),
|
|
@@ -58,7 +65,7 @@ const event: AgentEvent = parseAgentEvent({
|
|
|
58
65
|
const roundTripped = parseAgentEvent(JSON.parse(JSON.stringify(event)));
|
|
59
66
|
```
|
|
60
67
|
|
|
61
|
-
Serialized values carry `protocolVersion:
|
|
68
|
+
Serialized values carry `protocolVersion: 9`; TypeScript API names remain unsuffixed. Unknown
|
|
62
69
|
fields and unsupported protocol versions are rejected.
|
|
63
70
|
|
|
64
71
|
Item snapshots are a closed union keyed by `itemKind`. Common identity and lifecycle fields are
|
|
@@ -71,7 +78,7 @@ attribute bag; source evidence belongs outside the portable event. File-change p
|
|
|
71
78
|
`compareStringsByUnicodeCodePoint` to emit the canonical path ordering required by the protocol
|
|
72
79
|
across both BMP and supplementary Unicode characters.
|
|
73
80
|
|
|
74
|
-
|
|
81
|
+
V9 approval requests correlate to one live item or exact proposed-plan artifact and provide a
|
|
75
82
|
bounded list of typed options. Every option declares its decision, persistence, and neutral scope;
|
|
76
83
|
resolutions select one offered `optionId` or explicitly cancel. Approval capabilities advertise
|
|
77
84
|
the exact persistence/scope combinations an adapter can emit. `context.usage.updated` reports
|
|
@@ -83,7 +90,10 @@ content, and integrations are separate bounded, revisioned catalogs; capability
|
|
|
83
90
|
not carry inventory or authority. Operation and configuration input is correlated to the exact
|
|
84
91
|
offered revision and typed field definition. Collaboration exposes canonical graph identity and
|
|
85
92
|
lifecycle state without provider handles. Generated resources expose portable publication state
|
|
86
|
-
and an artifact reference only when the resource is available.
|
|
93
|
+
and an artifact reference only when the resource is available. Account-quota windows keep period,
|
|
94
|
+
measurement, applicability, allowance, and observation timestamps separate so a provider cannot
|
|
95
|
+
collapse unrelated pools into one percentage. Quantity units remain distinct from exact money,
|
|
96
|
+
which uses integer minor units with an explicit scale. None of these domains has a generic
|
|
87
97
|
extension or metadata bag.
|
|
88
98
|
|
|
89
99
|
## Errors and trust
|
|
@@ -102,13 +112,47 @@ published JSON Schemas enforce the same rule. Plan-step and progress identifiers
|
|
|
102
112
|
messages, and error context must contain non-whitespace content without surrounding whitespace so
|
|
103
113
|
validated protocol output remains canonical across transports and consumers.
|
|
104
114
|
|
|
115
|
+
## Effective environment values
|
|
116
|
+
|
|
117
|
+
`managedContent` describes content a caller manages and distributes. `effectiveContent` describes
|
|
118
|
+
what the selected harness reports for a workspace or session. Effective descriptors keep registration,
|
|
119
|
+
enablement, user invocation, and model callability separate; unknown facts are explicit. Optional
|
|
120
|
+
`agentDefinition` observations preserve primary/subagent mode and hidden state independently of
|
|
121
|
+
those execution facts. They apply only to agent-definition entries and never grant a spawn action. A package
|
|
122
|
+
belongs in `extensions` and references its contributed content, commands, and integrations. MCP
|
|
123
|
+
servers and Apps/connectors share the discriminated `integrations` catalog.
|
|
124
|
+
|
|
125
|
+
`AgentEnvironmentSnapshot` composes these bounded domains without copying their inventories. Each
|
|
126
|
+
domain distinguishes unsupported, not initialized, unavailable, partial, and complete observations.
|
|
127
|
+
Catalog revisions describe semantic content; observation timestamps never grant mutation authority.
|
|
128
|
+
The caller supplies an opaque environment identity. Hosts must scope that identity to their own
|
|
129
|
+
account, workspace, configuration, session, and authorization state.
|
|
130
|
+
|
|
131
|
+
A `content_reference` input part carries the environment and content catalog revisions plus the
|
|
132
|
+
selected content identity and revision. It is neither embedded skill text nor a slash command.
|
|
133
|
+
Providers advertise reference and argument support explicitly. The parser allows at most 16
|
|
134
|
+
references, bounds each argument at 4 KiB of UTF-8, rejects duplicate identities, and includes the
|
|
135
|
+
reference bytes in the existing input envelope. Product admission must still validate current
|
|
136
|
+
catalog identity, visibility, and execution authority before provider delegation.
|
|
137
|
+
|
|
138
|
+
Supported reference capabilities require `textFormats.prompt` and `textFormats.arguments`:
|
|
139
|
+
`unrestricted` adds no text restriction; `single_line` excludes Unicode control (Cc), format (Cf),
|
|
140
|
+
line separator (Zl), and paragraph separator (Zp) characters; `literal_single_line` also excludes
|
|
141
|
+
`$`, `@`, backticks, and a slash after leading whitespace. These constraints apply only when the
|
|
142
|
+
input contains a content reference and do not replace the ordinary input envelope or other
|
|
143
|
+
admission checks. `findAgentContentReferenceTextIssue` reports the affected field and format
|
|
144
|
+
without returning submitted text. `meetAgentContentReferenceTextFormat` retains the stricter
|
|
145
|
+
constraint when composing capabilities. Runtime and product admission must enforce both fields
|
|
146
|
+
before delegation; a composer can use the same pure functions to preserve and explain an invalid draft.
|
|
147
|
+
|
|
105
148
|
## Versioning and release
|
|
106
149
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
150
|
+
Agent Protocol V9 defines the coordinated SDK `0.3.0` contract shared by this package,
|
|
151
|
+
`@agen-ai/validation`, and `@agen-ai/agent-runtime`. Registry publication and dist-tag state are
|
|
152
|
+
release metadata outside this contract. The earlier public `0.2.5` release remains historical. All
|
|
153
|
+
three SDK packages must be released together. Protocol V9 is independent of private transport and
|
|
154
|
+
product persistence versions and directly replaces V8 at live boundaries. There is one current
|
|
155
|
+
parser. The environment and account-quota namespaces each use their own schema version 1.
|
|
112
156
|
|
|
113
157
|
The repository release proof builds and packs `@agen-ai/validation`, this package, and
|
|
114
158
|
`@agen-ai/agent-runtime`; rejects workspace-only or private references; then typechecks and runs a
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { AgentProtocolParseResult } from '../foundation/types.js';
|
|
2
|
+
import type { AgentAccountQuotaSnapshot, AgentAccountQuotaWindow } from './types.js';
|
|
3
|
+
export declare function parseAgentAccountQuotaSnapshot(input: unknown): AgentAccountQuotaSnapshot;
|
|
4
|
+
export declare function safeParseAgentAccountQuotaSnapshot(input: unknown): AgentProtocolParseResult<AgentAccountQuotaSnapshot>;
|
|
5
|
+
export declare function parseAgentAccountQuotaWindow(input: unknown): AgentAccountQuotaWindow;
|
|
6
|
+
export declare function safeParseAgentAccountQuotaWindow(input: unknown): AgentProtocolParseResult<AgentAccountQuotaWindow>;
|
|
7
|
+
//# sourceMappingURL=parsers.d.ts.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { parseWithSchema, safeParseWithSchema } from "../internal/parsers.js";
|
|
2
|
+
import { AgentAccountQuotaSnapshotSchema, AgentAccountQuotaWindowSchema } from "../zod/accountQuota.js";
|
|
3
|
+
function parseAgentAccountQuotaSnapshot(input) {
|
|
4
|
+
return parseWithSchema(AgentAccountQuotaSnapshotSchema, input);
|
|
5
|
+
}
|
|
6
|
+
function safeParseAgentAccountQuotaSnapshot(input) {
|
|
7
|
+
return safeParseWithSchema(AgentAccountQuotaSnapshotSchema, input);
|
|
8
|
+
}
|
|
9
|
+
function parseAgentAccountQuotaWindow(input) {
|
|
10
|
+
return parseWithSchema(AgentAccountQuotaWindowSchema, input);
|
|
11
|
+
}
|
|
12
|
+
function safeParseAgentAccountQuotaWindow(input) {
|
|
13
|
+
return safeParseWithSchema(AgentAccountQuotaWindowSchema, input);
|
|
14
|
+
}
|
|
15
|
+
export {
|
|
16
|
+
parseAgentAccountQuotaSnapshot,
|
|
17
|
+
parseAgentAccountQuotaWindow,
|
|
18
|
+
safeParseAgentAccountQuotaSnapshot,
|
|
19
|
+
safeParseAgentAccountQuotaWindow
|
|
20
|
+
};
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import type { AgentIsoDateTime } from '../foundation/types.js';
|
|
2
|
+
export declare const AGENT_ACCOUNT_QUOTA_SCHEMA_VERSION: 1;
|
|
3
|
+
export declare const AGENT_ACCOUNT_QUOTA_MAX_WINDOWS = 64;
|
|
4
|
+
export declare const AGENT_ACCOUNT_QUOTA_MAX_BYTES = 65536;
|
|
5
|
+
export declare const AGENT_ACCOUNT_QUOTA_MAX_LABEL_LENGTH = 160;
|
|
6
|
+
export declare const AGENT_ACCOUNT_QUOTA_MAX_SCOPE_IDS = 32;
|
|
7
|
+
export type AgentAccountQuotaApplicability = Readonly<{
|
|
8
|
+
kind: 'account';
|
|
9
|
+
}> | Readonly<{
|
|
10
|
+
kind: 'product';
|
|
11
|
+
productId: string;
|
|
12
|
+
}> | Readonly<{
|
|
13
|
+
kind: 'models';
|
|
14
|
+
modelIds: readonly string[];
|
|
15
|
+
}> | Readonly<{
|
|
16
|
+
kind: 'unknown';
|
|
17
|
+
}>;
|
|
18
|
+
export type AgentAccountQuotaPeriod = Readonly<{
|
|
19
|
+
kind: 'rolling' | 'fixed' | 'unknown';
|
|
20
|
+
durationSeconds?: number;
|
|
21
|
+
}> | Readonly<{
|
|
22
|
+
kind: 'calendar';
|
|
23
|
+
unit: 'day' | 'week' | 'month' | 'year';
|
|
24
|
+
timeZone: string;
|
|
25
|
+
}> | Readonly<{
|
|
26
|
+
kind: 'billing_cycle';
|
|
27
|
+
unit: 'month' | 'year' | 'unknown';
|
|
28
|
+
}>;
|
|
29
|
+
export type AgentAccountQuotaMeasurement = Readonly<{
|
|
30
|
+
kind: 'unknown';
|
|
31
|
+
}> | Readonly<{
|
|
32
|
+
kind: 'percentage';
|
|
33
|
+
usedPercent: number;
|
|
34
|
+
}> | Readonly<{
|
|
35
|
+
kind: 'quantity';
|
|
36
|
+
unit: string;
|
|
37
|
+
used?: number;
|
|
38
|
+
limit?: number;
|
|
39
|
+
remaining?: number;
|
|
40
|
+
usedPercent?: number;
|
|
41
|
+
}> | Readonly<{
|
|
42
|
+
kind: 'money';
|
|
43
|
+
currency: string;
|
|
44
|
+
scale: number;
|
|
45
|
+
usedMinorUnits?: number;
|
|
46
|
+
limitMinorUnits?: number;
|
|
47
|
+
remainingMinorUnits?: number;
|
|
48
|
+
usedPercent?: number;
|
|
49
|
+
}>;
|
|
50
|
+
export interface AgentAccountQuotaReset {
|
|
51
|
+
readonly at: AgentIsoDateTime;
|
|
52
|
+
readonly precision: 'reported' | 'estimated';
|
|
53
|
+
readonly observedAt: AgentIsoDateTime;
|
|
54
|
+
}
|
|
55
|
+
export interface AgentAccountQuotaWindow {
|
|
56
|
+
readonly poolId: string;
|
|
57
|
+
readonly windowId: string;
|
|
58
|
+
readonly label: string;
|
|
59
|
+
readonly allowanceKind: 'included' | 'extra' | 'reserve' | 'unknown';
|
|
60
|
+
readonly applicability: AgentAccountQuotaApplicability;
|
|
61
|
+
readonly period: AgentAccountQuotaPeriod;
|
|
62
|
+
readonly measurement: AgentAccountQuotaMeasurement;
|
|
63
|
+
readonly observedAt: AgentIsoDateTime;
|
|
64
|
+
readonly startsAt?: AgentIsoDateTime;
|
|
65
|
+
readonly reset?: AgentAccountQuotaReset;
|
|
66
|
+
}
|
|
67
|
+
export interface AgentAccountQuotaAllowance {
|
|
68
|
+
readonly included: 'allowed' | 'exhausted' | 'unknown';
|
|
69
|
+
readonly extra: 'allowed' | 'unavailable' | 'unknown';
|
|
70
|
+
readonly reserve: 'allowed' | 'unavailable' | 'unknown';
|
|
71
|
+
}
|
|
72
|
+
interface AgentAccountQuotaSnapshotBase {
|
|
73
|
+
readonly schemaVersion: typeof AGENT_ACCOUNT_QUOTA_SCHEMA_VERSION;
|
|
74
|
+
readonly sourceId: string;
|
|
75
|
+
readonly observedAt: AgentIsoDateTime;
|
|
76
|
+
}
|
|
77
|
+
export interface AgentAvailableAccountQuotaSnapshot extends AgentAccountQuotaSnapshotBase {
|
|
78
|
+
readonly state: 'available';
|
|
79
|
+
readonly completeness: 'complete' | 'partial';
|
|
80
|
+
readonly accountLabel?: string;
|
|
81
|
+
readonly planLabel?: string;
|
|
82
|
+
readonly windows: readonly AgentAccountQuotaWindow[];
|
|
83
|
+
readonly allowance: AgentAccountQuotaAllowance;
|
|
84
|
+
}
|
|
85
|
+
export type AgentAccountQuotaSnapshot = AgentAvailableAccountQuotaSnapshot | Readonly<AgentAccountQuotaSnapshotBase & {
|
|
86
|
+
state: 'authentication_required' | 'inapplicable' | 'temporarily_unavailable';
|
|
87
|
+
}>;
|
|
88
|
+
export {};
|
|
89
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
const AGENT_ACCOUNT_QUOTA_SCHEMA_VERSION = 1;
|
|
2
|
+
const AGENT_ACCOUNT_QUOTA_MAX_WINDOWS = 64;
|
|
3
|
+
const AGENT_ACCOUNT_QUOTA_MAX_BYTES = 65536;
|
|
4
|
+
const AGENT_ACCOUNT_QUOTA_MAX_LABEL_LENGTH = 160;
|
|
5
|
+
const AGENT_ACCOUNT_QUOTA_MAX_SCOPE_IDS = 32;
|
|
6
|
+
export {
|
|
7
|
+
AGENT_ACCOUNT_QUOTA_MAX_BYTES,
|
|
8
|
+
AGENT_ACCOUNT_QUOTA_MAX_LABEL_LENGTH,
|
|
9
|
+
AGENT_ACCOUNT_QUOTA_MAX_SCOPE_IDS,
|
|
10
|
+
AGENT_ACCOUNT_QUOTA_MAX_WINDOWS,
|
|
11
|
+
AGENT_ACCOUNT_QUOTA_SCHEMA_VERSION
|
|
12
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { AgentContentReferenceTextFormat, AgentContentReferenceTextFormats } from './types.js';
|
|
2
|
+
export interface AgentContentReferenceTextIssue {
|
|
3
|
+
readonly target: 'prompt' | 'arguments';
|
|
4
|
+
readonly format: Exclude<AgentContentReferenceTextFormat, 'unrestricted'>;
|
|
5
|
+
}
|
|
6
|
+
export declare function isAgentContentReferenceTextAllowed(text: string, format: AgentContentReferenceTextFormat): boolean;
|
|
7
|
+
export declare function meetAgentContentReferenceTextFormat(left: AgentContentReferenceTextFormat, right: AgentContentReferenceTextFormat): AgentContentReferenceTextFormat;
|
|
8
|
+
export declare function findAgentContentReferenceTextIssue(input: {
|
|
9
|
+
readonly prompt: string;
|
|
10
|
+
readonly arguments: readonly string[];
|
|
11
|
+
readonly textFormats: AgentContentReferenceTextFormats;
|
|
12
|
+
}): AgentContentReferenceTextIssue | null;
|
|
13
|
+
//# sourceMappingURL=contentReferenceText.d.ts.map
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
function isAgentContentReferenceTextAllowed(text, format) {
|
|
2
|
+
if (format === "unrestricted") return true;
|
|
3
|
+
if (/[\p{Cc}\p{Cf}\p{Zl}\p{Zp}]/u.test(text)) return false;
|
|
4
|
+
return format !== "literal_single_line" || !/[$@`]/u.test(text) && !text.trimStart().startsWith("/");
|
|
5
|
+
}
|
|
6
|
+
function meetAgentContentReferenceTextFormat(left, right) {
|
|
7
|
+
if (left === "literal_single_line" || right === "literal_single_line") return "literal_single_line";
|
|
8
|
+
if (left === "single_line" || right === "single_line") return "single_line";
|
|
9
|
+
return "unrestricted";
|
|
10
|
+
}
|
|
11
|
+
function findAgentContentReferenceTextIssue(input) {
|
|
12
|
+
const { prompt, arguments: argumentFormat } = input.textFormats;
|
|
13
|
+
if (prompt !== "unrestricted" && !isAgentContentReferenceTextAllowed(input.prompt, prompt)) {
|
|
14
|
+
return { target: "prompt", format: prompt };
|
|
15
|
+
}
|
|
16
|
+
if (argumentFormat !== "unrestricted" && input.arguments.some((value) => !isAgentContentReferenceTextAllowed(value, argumentFormat))) {
|
|
17
|
+
return { target: "arguments", format: argumentFormat };
|
|
18
|
+
}
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
export {
|
|
22
|
+
findAgentContentReferenceTextIssue,
|
|
23
|
+
isAgentContentReferenceTextAllowed,
|
|
24
|
+
meetAgentContentReferenceTextFormat
|
|
25
|
+
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { AgentEnvironmentCapability } from '../environment/types.js';
|
|
1
2
|
import type { AgentArtifactKind } from '../artifacts/index.js';
|
|
2
3
|
import type { AgentCollaborationControlAction, AgentCollaborationRole } from '../collaboration/index.js';
|
|
3
4
|
import type { AgentConfigurationFieldKind } from '../configuration/index.js';
|
|
@@ -121,9 +122,25 @@ export type AgentImageInputCapability = Readonly<{
|
|
|
121
122
|
maxPixelsPerImage: number;
|
|
122
123
|
supportsImageOnly: boolean;
|
|
123
124
|
}>;
|
|
125
|
+
export declare const AGENT_CONTENT_REFERENCE_TEXT_FORMATS: readonly ["unrestricted", "single_line", "literal_single_line"];
|
|
126
|
+
/** Single lines exclude Unicode Cc, Cf, Zl and Zp; literal lines also exclude $, @, backtick and a leading slash. */
|
|
127
|
+
export type AgentContentReferenceTextFormat = typeof AGENT_CONTENT_REFERENCE_TEXT_FORMATS[number];
|
|
128
|
+
export interface AgentContentReferenceTextFormats {
|
|
129
|
+
readonly prompt: AgentContentReferenceTextFormat;
|
|
130
|
+
readonly arguments: AgentContentReferenceTextFormat;
|
|
131
|
+
}
|
|
132
|
+
export type AgentContentReferenceInputCapability = Readonly<{
|
|
133
|
+
kind: 'unsupported';
|
|
134
|
+
}> | Readonly<{
|
|
135
|
+
kind: 'supported';
|
|
136
|
+
maxReferences: number;
|
|
137
|
+
arguments: boolean;
|
|
138
|
+
textFormats: AgentContentReferenceTextFormats;
|
|
139
|
+
}>;
|
|
124
140
|
export interface AgentOperationInputCapability {
|
|
125
141
|
readonly text: true;
|
|
126
142
|
readonly images: AgentImageInputCapability;
|
|
143
|
+
readonly contentReferences: AgentContentReferenceInputCapability;
|
|
127
144
|
}
|
|
128
145
|
export type AgentTurnSteeringCapability = Readonly<{
|
|
129
146
|
kind: 'unsupported';
|
|
@@ -132,7 +149,7 @@ export type AgentTurnSteeringCapability = Readonly<{
|
|
|
132
149
|
input: AgentOperationInputCapability;
|
|
133
150
|
}>;
|
|
134
151
|
export interface AgentCapabilities {
|
|
135
|
-
readonly protocolVersion:
|
|
152
|
+
readonly protocolVersion: 9;
|
|
136
153
|
readonly providerKey: AgentProviderKey;
|
|
137
154
|
readonly sessions: Readonly<{
|
|
138
155
|
create: true;
|
|
@@ -163,6 +180,7 @@ export interface AgentCapabilities {
|
|
|
163
180
|
readonly operations: AgentOperationsCapability;
|
|
164
181
|
readonly managedContent: AgentManagedContentCapability;
|
|
165
182
|
readonly integrations: AgentIntegrationsCapability;
|
|
183
|
+
readonly environment: AgentEnvironmentCapability;
|
|
166
184
|
readonly collaboration: AgentCollaborationCapability;
|
|
167
185
|
readonly generatedResources: AgentGeneratedResourcesCapability;
|
|
168
186
|
readonly authentication: AgentAuthenticationCapability;
|
|
@@ -8,7 +8,13 @@ const AGENT_AUTHENTICATION_FLOWS = [
|
|
|
8
8
|
"browser",
|
|
9
9
|
"terminal"
|
|
10
10
|
];
|
|
11
|
+
const AGENT_CONTENT_REFERENCE_TEXT_FORMATS = [
|
|
12
|
+
"unrestricted",
|
|
13
|
+
"single_line",
|
|
14
|
+
"literal_single_line"
|
|
15
|
+
];
|
|
11
16
|
export {
|
|
12
17
|
AGENT_AUTHENTICATION_FLOWS,
|
|
18
|
+
AGENT_CONTENT_REFERENCE_TEXT_FORMATS,
|
|
13
19
|
AGENT_FILE_CHANGE_MODES
|
|
14
20
|
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { AgentProtocolParseResult } from '../foundation/index.js';
|
|
2
|
+
import type { AgentCommandCatalog, AgentCommandDescriptor } from './types.js';
|
|
3
|
+
export declare function parseAgentCommandDescriptor(input: unknown): AgentCommandDescriptor;
|
|
4
|
+
export declare function safeParseAgentCommandDescriptor(input: unknown): AgentProtocolParseResult<AgentCommandDescriptor>;
|
|
5
|
+
export declare function parseAgentCommandCatalog(input: unknown): AgentCommandCatalog;
|
|
6
|
+
export declare function safeParseAgentCommandCatalog(input: unknown): AgentProtocolParseResult<AgentCommandCatalog>;
|
|
7
|
+
//# sourceMappingURL=parsers.d.ts.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { parseWithSchema, safeParseWithSchema } from "../internal/parsers.js";
|
|
2
|
+
import {
|
|
3
|
+
AgentCommandCatalogSchema,
|
|
4
|
+
AgentCommandDescriptorSchema
|
|
5
|
+
} from "../zod/commands.js";
|
|
6
|
+
function parseAgentCommandDescriptor(input) {
|
|
7
|
+
return parseWithSchema(AgentCommandDescriptorSchema, input);
|
|
8
|
+
}
|
|
9
|
+
function safeParseAgentCommandDescriptor(input) {
|
|
10
|
+
return safeParseWithSchema(AgentCommandDescriptorSchema, input);
|
|
11
|
+
}
|
|
12
|
+
function parseAgentCommandCatalog(input) {
|
|
13
|
+
return parseWithSchema(AgentCommandCatalogSchema, input);
|
|
14
|
+
}
|
|
15
|
+
function safeParseAgentCommandCatalog(input) {
|
|
16
|
+
return safeParseWithSchema(AgentCommandCatalogSchema, input);
|
|
17
|
+
}
|
|
18
|
+
export {
|
|
19
|
+
parseAgentCommandCatalog,
|
|
20
|
+
parseAgentCommandDescriptor,
|
|
21
|
+
safeParseAgentCommandCatalog,
|
|
22
|
+
safeParseAgentCommandDescriptor
|
|
23
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { AgentCommandId, AgentIsoDateTime, AgentOperationId } from '../foundation/index.js';
|
|
2
|
+
import type { AgentAvailabilityFact, AgentEnvironmentSource } from '../environment/facts.js';
|
|
3
|
+
export declare const AGENT_COMMAND_NAME_MAX_LENGTH = 200;
|
|
4
|
+
export declare const AGENT_COMMAND_SUMMARY_MAX_LENGTH = 2000;
|
|
5
|
+
export declare const AGENT_COMMAND_CATALOG_MAX_LENGTH = 1024;
|
|
6
|
+
export declare const AGENT_COMMAND_CATALOG_BYTES_LIMIT: number;
|
|
7
|
+
export interface AgentCommandOperationReference {
|
|
8
|
+
readonly operationId: AgentOperationId;
|
|
9
|
+
readonly revision: number;
|
|
10
|
+
readonly catalogRevision: number;
|
|
11
|
+
}
|
|
12
|
+
export interface AgentCommandDescriptor {
|
|
13
|
+
readonly commandId: AgentCommandId;
|
|
14
|
+
readonly revision: number;
|
|
15
|
+
readonly name: string;
|
|
16
|
+
readonly summary?: string;
|
|
17
|
+
readonly source: AgentEnvironmentSource;
|
|
18
|
+
readonly availability: AgentAvailabilityFact;
|
|
19
|
+
readonly operation?: AgentCommandOperationReference;
|
|
20
|
+
}
|
|
21
|
+
export interface AgentCommandCatalog {
|
|
22
|
+
readonly revision: number;
|
|
23
|
+
readonly observedAt: AgentIsoDateTime;
|
|
24
|
+
readonly commands: readonly AgentCommandDescriptor[];
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
const AGENT_COMMAND_NAME_MAX_LENGTH = 200;
|
|
2
|
+
const AGENT_COMMAND_SUMMARY_MAX_LENGTH = 2e3;
|
|
3
|
+
const AGENT_COMMAND_CATALOG_MAX_LENGTH = 1024;
|
|
4
|
+
const AGENT_COMMAND_CATALOG_BYTES_LIMIT = 512 * 1024;
|
|
5
|
+
export {
|
|
6
|
+
AGENT_COMMAND_CATALOG_BYTES_LIMIT,
|
|
7
|
+
AGENT_COMMAND_CATALOG_MAX_LENGTH,
|
|
8
|
+
AGENT_COMMAND_NAME_MAX_LENGTH,
|
|
9
|
+
AGENT_COMMAND_SUMMARY_MAX_LENGTH
|
|
10
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { AgentProtocolParseResult } from '../foundation/index.js';
|
|
2
|
+
import type { AgentEffectiveContentCatalog, AgentEffectiveContentDescriptor } from './types.js';
|
|
3
|
+
export declare function parseAgentEffectiveContentDescriptor(input: unknown): AgentEffectiveContentDescriptor;
|
|
4
|
+
export declare function safeParseAgentEffectiveContentDescriptor(input: unknown): AgentProtocolParseResult<AgentEffectiveContentDescriptor>;
|
|
5
|
+
export declare function parseAgentEffectiveContentCatalog(input: unknown): AgentEffectiveContentCatalog;
|
|
6
|
+
export declare function safeParseAgentEffectiveContentCatalog(input: unknown): AgentProtocolParseResult<AgentEffectiveContentCatalog>;
|
|
7
|
+
//# sourceMappingURL=parsers.d.ts.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { parseWithSchema, safeParseWithSchema } from "../internal/parsers.js";
|
|
2
|
+
import {
|
|
3
|
+
AgentEffectiveContentCatalogSchema,
|
|
4
|
+
AgentEffectiveContentDescriptorSchema
|
|
5
|
+
} from "../zod/effectiveContent.js";
|
|
6
|
+
function parseAgentEffectiveContentDescriptor(input) {
|
|
7
|
+
return parseWithSchema(AgentEffectiveContentDescriptorSchema, input);
|
|
8
|
+
}
|
|
9
|
+
function safeParseAgentEffectiveContentDescriptor(input) {
|
|
10
|
+
return safeParseWithSchema(AgentEffectiveContentDescriptorSchema, input);
|
|
11
|
+
}
|
|
12
|
+
function parseAgentEffectiveContentCatalog(input) {
|
|
13
|
+
return parseWithSchema(AgentEffectiveContentCatalogSchema, input);
|
|
14
|
+
}
|
|
15
|
+
function safeParseAgentEffectiveContentCatalog(input) {
|
|
16
|
+
return safeParseWithSchema(AgentEffectiveContentCatalogSchema, input);
|
|
17
|
+
}
|
|
18
|
+
export {
|
|
19
|
+
parseAgentEffectiveContentCatalog,
|
|
20
|
+
parseAgentEffectiveContentDescriptor,
|
|
21
|
+
safeParseAgentEffectiveContentCatalog,
|
|
22
|
+
safeParseAgentEffectiveContentDescriptor
|
|
23
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { AgentEffectiveContentId, AgentIsoDateTime } from '../foundation/index.js';
|
|
2
|
+
import type { AgentAvailabilityFact, AgentEnvironmentSource, AgentInvocationPosture, AgentQualifiedExtensionReference } from '../environment/facts.js';
|
|
3
|
+
export declare const AGENT_EFFECTIVE_CONTENT_KINDS: readonly ["skill", "rule", "prompt", "agent_definition"];
|
|
4
|
+
export declare const AGENT_EFFECTIVE_CONTENT_NAME_MAX_LENGTH = 200;
|
|
5
|
+
export declare const AGENT_EFFECTIVE_CONTENT_SUMMARY_MAX_LENGTH = 2000;
|
|
6
|
+
export declare const AGENT_EFFECTIVE_CONTENT_CATALOG_MAX_LENGTH = 1024;
|
|
7
|
+
export declare const AGENT_EFFECTIVE_CONTENT_CATALOG_BYTES_LIMIT: number;
|
|
8
|
+
export type AgentEffectiveContentKind = (typeof AGENT_EFFECTIVE_CONTENT_KINDS)[number];
|
|
9
|
+
export declare const AGENT_DEFINITION_MODES: readonly ["primary", "subagent", "all", "unknown"];
|
|
10
|
+
export type AgentDefinitionMode = (typeof AGENT_DEFINITION_MODES)[number];
|
|
11
|
+
/** Definition metadata does not grant selection or running-agent authority. */
|
|
12
|
+
export interface AgentDefinitionObservation {
|
|
13
|
+
readonly mode: AgentDefinitionMode;
|
|
14
|
+
readonly hidden: AgentAvailabilityFact;
|
|
15
|
+
}
|
|
16
|
+
export interface AgentEffectiveContentDescriptor {
|
|
17
|
+
readonly contentId: AgentEffectiveContentId;
|
|
18
|
+
readonly revision: number;
|
|
19
|
+
readonly kind: AgentEffectiveContentKind;
|
|
20
|
+
readonly name: string;
|
|
21
|
+
readonly summary?: string;
|
|
22
|
+
readonly source: AgentEnvironmentSource;
|
|
23
|
+
readonly registration: AgentAvailabilityFact;
|
|
24
|
+
readonly enablement: AgentAvailabilityFact;
|
|
25
|
+
readonly invocation: AgentInvocationPosture;
|
|
26
|
+
readonly modelCallability: AgentAvailabilityFact;
|
|
27
|
+
readonly extension?: AgentQualifiedExtensionReference;
|
|
28
|
+
readonly agentDefinition?: AgentDefinitionObservation;
|
|
29
|
+
}
|
|
30
|
+
export interface AgentEffectiveContentCatalog {
|
|
31
|
+
readonly revision: number;
|
|
32
|
+
readonly observedAt: AgentIsoDateTime;
|
|
33
|
+
readonly content: readonly AgentEffectiveContentDescriptor[];
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
const AGENT_EFFECTIVE_CONTENT_KINDS = [
|
|
2
|
+
"skill",
|
|
3
|
+
"rule",
|
|
4
|
+
"prompt",
|
|
5
|
+
"agent_definition"
|
|
6
|
+
];
|
|
7
|
+
const AGENT_EFFECTIVE_CONTENT_NAME_MAX_LENGTH = 200;
|
|
8
|
+
const AGENT_EFFECTIVE_CONTENT_SUMMARY_MAX_LENGTH = 2e3;
|
|
9
|
+
const AGENT_EFFECTIVE_CONTENT_CATALOG_MAX_LENGTH = 1024;
|
|
10
|
+
const AGENT_EFFECTIVE_CONTENT_CATALOG_BYTES_LIMIT = 512 * 1024;
|
|
11
|
+
const AGENT_DEFINITION_MODES = ["primary", "subagent", "all", "unknown"];
|
|
12
|
+
export {
|
|
13
|
+
AGENT_DEFINITION_MODES,
|
|
14
|
+
AGENT_EFFECTIVE_CONTENT_CATALOG_BYTES_LIMIT,
|
|
15
|
+
AGENT_EFFECTIVE_CONTENT_CATALOG_MAX_LENGTH,
|
|
16
|
+
AGENT_EFFECTIVE_CONTENT_KINDS,
|
|
17
|
+
AGENT_EFFECTIVE_CONTENT_NAME_MAX_LENGTH,
|
|
18
|
+
AGENT_EFFECTIVE_CONTENT_SUMMARY_MAX_LENGTH
|
|
19
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { AgentExtensionId } from '../foundation/index.js';
|
|
2
|
+
export declare const AGENT_ENVIRONMENT_SCOPES: readonly ["workspace", "project", "user", "system", "remote", "unknown"];
|
|
3
|
+
export declare const AGENT_ENVIRONMENT_ORIGINS: readonly ["managed", "workspace", "user", "bundled", "plugin", "remote", "unknown"];
|
|
4
|
+
export declare const AGENT_INVOCATION_POSTURES: readonly ["user_and_model", "user_only", "model_only", "unavailable", "unknown"];
|
|
5
|
+
export declare const AGENT_ENVIRONMENT_REASONS: readonly ["missing_metadata", "native_ambiguity", "permission_denied", "authentication_required", "source_changed", "capacity_exceeded", "transient_failure"];
|
|
6
|
+
export type AgentEnvironmentScope = (typeof AGENT_ENVIRONMENT_SCOPES)[number];
|
|
7
|
+
export type AgentEnvironmentOrigin = (typeof AGENT_ENVIRONMENT_ORIGINS)[number];
|
|
8
|
+
export type AgentInvocationPosture = (typeof AGENT_INVOCATION_POSTURES)[number];
|
|
9
|
+
export type AgentEnvironmentReason = (typeof AGENT_ENVIRONMENT_REASONS)[number];
|
|
10
|
+
/** A source's location scope and provenance are separate observations. */
|
|
11
|
+
export interface AgentEnvironmentSource {
|
|
12
|
+
readonly scope: AgentEnvironmentScope;
|
|
13
|
+
readonly origin: AgentEnvironmentOrigin;
|
|
14
|
+
}
|
|
15
|
+
/** A native fact is explicit when the provider cannot establish a boolean value. */
|
|
16
|
+
export type AgentAvailabilityFact = Readonly<{
|
|
17
|
+
readonly kind: 'known';
|
|
18
|
+
readonly value: boolean;
|
|
19
|
+
}> | Readonly<{
|
|
20
|
+
readonly kind: 'unknown';
|
|
21
|
+
}>;
|
|
22
|
+
/** A relationship to an observed extension is valid only at an exact package generation. */
|
|
23
|
+
export interface AgentQualifiedExtensionReference {
|
|
24
|
+
readonly extensionId: AgentExtensionId;
|
|
25
|
+
readonly revision: number;
|
|
26
|
+
readonly catalogRevision: number;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=facts.d.ts.map
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
const AGENT_ENVIRONMENT_SCOPES = [
|
|
2
|
+
"workspace",
|
|
3
|
+
"project",
|
|
4
|
+
"user",
|
|
5
|
+
"system",
|
|
6
|
+
"remote",
|
|
7
|
+
"unknown"
|
|
8
|
+
];
|
|
9
|
+
const AGENT_ENVIRONMENT_ORIGINS = [
|
|
10
|
+
"managed",
|
|
11
|
+
"workspace",
|
|
12
|
+
"user",
|
|
13
|
+
"bundled",
|
|
14
|
+
"plugin",
|
|
15
|
+
"remote",
|
|
16
|
+
"unknown"
|
|
17
|
+
];
|
|
18
|
+
const AGENT_INVOCATION_POSTURES = [
|
|
19
|
+
"user_and_model",
|
|
20
|
+
"user_only",
|
|
21
|
+
"model_only",
|
|
22
|
+
"unavailable",
|
|
23
|
+
"unknown"
|
|
24
|
+
];
|
|
25
|
+
const AGENT_ENVIRONMENT_REASONS = [
|
|
26
|
+
"missing_metadata",
|
|
27
|
+
"native_ambiguity",
|
|
28
|
+
"permission_denied",
|
|
29
|
+
"authentication_required",
|
|
30
|
+
"source_changed",
|
|
31
|
+
"capacity_exceeded",
|
|
32
|
+
"transient_failure"
|
|
33
|
+
];
|
|
34
|
+
export {
|
|
35
|
+
AGENT_ENVIRONMENT_ORIGINS,
|
|
36
|
+
AGENT_ENVIRONMENT_REASONS,
|
|
37
|
+
AGENT_ENVIRONMENT_SCOPES,
|
|
38
|
+
AGENT_INVOCATION_POSTURES
|
|
39
|
+
};
|