@agen-ai/agent-protocol 0.2.5 → 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.
Files changed (79) hide show
  1. package/README.md +44 -13
  2. package/dist/capabilities/contentReferenceText.d.ts +13 -0
  3. package/dist/capabilities/contentReferenceText.js +25 -0
  4. package/dist/capabilities/index.d.ts +1 -0
  5. package/dist/capabilities/index.js +1 -0
  6. package/dist/capabilities/types.d.ts +19 -1
  7. package/dist/capabilities/types.js +6 -0
  8. package/dist/commands/index.d.ts +3 -0
  9. package/dist/commands/index.js +2 -0
  10. package/dist/commands/parsers.d.ts +7 -0
  11. package/dist/commands/parsers.js +23 -0
  12. package/dist/commands/types.d.ts +26 -0
  13. package/dist/commands/types.js +10 -0
  14. package/dist/effectiveContent/index.d.ts +3 -0
  15. package/dist/effectiveContent/index.js +2 -0
  16. package/dist/effectiveContent/parsers.d.ts +7 -0
  17. package/dist/effectiveContent/parsers.js +23 -0
  18. package/dist/effectiveContent/types.d.ts +35 -0
  19. package/dist/effectiveContent/types.js +19 -0
  20. package/dist/environment/facts.d.ts +28 -0
  21. package/dist/environment/facts.js +39 -0
  22. package/dist/environment/index.d.ts +4 -0
  23. package/dist/environment/index.js +3 -0
  24. package/dist/environment/parsers.d.ts +17 -0
  25. package/dist/environment/parsers.js +68 -0
  26. package/dist/environment/types.d.ts +61 -0
  27. package/dist/environment/types.js +26 -0
  28. package/dist/events/types.d.ts +1 -1
  29. package/dist/extensions/index.d.ts +3 -0
  30. package/dist/extensions/index.js +2 -0
  31. package/dist/extensions/parsers.d.ts +7 -0
  32. package/dist/extensions/parsers.js +23 -0
  33. package/dist/extensions/types.d.ts +73 -0
  34. package/dist/extensions/types.js +30 -0
  35. package/dist/foundation/parsers.d.ts +9 -1
  36. package/dist/foundation/parsers.js +24 -0
  37. package/dist/foundation/types.d.ts +5 -1
  38. package/dist/foundation/types.js +1 -1
  39. package/dist/integrations/types.d.ts +22 -4
  40. package/dist/integrations/types.js +6 -2
  41. package/dist/jsonSchema/generated.d.ts +9390 -5844
  42. package/dist/jsonSchema/generated.js +2526 -157
  43. package/dist/public/commands.d.ts +2 -0
  44. package/dist/public/commands.js +1 -0
  45. package/dist/public/effectiveContent.d.ts +2 -0
  46. package/dist/public/effectiveContent.js +1 -0
  47. package/dist/public/environment.d.ts +2 -0
  48. package/dist/public/environment.js +1 -0
  49. package/dist/public/extensions.d.ts +2 -0
  50. package/dist/public/extensions.js +1 -0
  51. package/dist/public/index.d.ts +4 -0
  52. package/dist/public/index.js +4 -0
  53. package/dist/turns/parsers.d.ts +3 -1
  54. package/dist/turns/parsers.js +9 -0
  55. package/dist/turns/types.d.ts +13 -2
  56. package/dist/turns/types.js +4 -0
  57. package/dist/zod/capabilities.d.ts +79 -1
  58. package/dist/zod/capabilities.js +21 -5
  59. package/dist/zod/commands.d.ts +35 -0
  60. package/dist/zod/commands.js +114 -0
  61. package/dist/zod/effectiveContent.d.ts +72 -0
  62. package/dist/zod/effectiveContent.js +157 -0
  63. package/dist/zod/environment.d.ts +531 -0
  64. package/dist/zod/environment.js +336 -0
  65. package/dist/zod/environmentFacts.d.ts +10 -0
  66. package/dist/zod/environmentFacts.js +40 -0
  67. package/dist/zod/events.d.ts +21 -21
  68. package/dist/zod/extensions.d.ts +161 -0
  69. package/dist/zod/extensions.js +194 -0
  70. package/dist/zod/foundation.d.ts +5 -1
  71. package/dist/zod/foundation.js +8 -0
  72. package/dist/zod/index.d.ts +9 -4
  73. package/dist/zod/index.js +21 -2
  74. package/dist/zod/integrations.d.ts +50 -5
  75. package/dist/zod/integrations.js +49 -6
  76. package/dist/zod/turns.d.ts +33 -0
  77. package/dist/zod/turns.js +34 -1
  78. package/dist/zod/typeEquality.generated.d.ts +34 -4
  79. package/package.json +18 -2
package/README.md CHANGED
@@ -3,7 +3,7 @@
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, account-quota observations, collaboration lifecycles, generated resources, portable
6
+ observations, effective harness content and package catalogs, environment observations, account-quota observations, collaboration lifecycles, generated resources, portable
7
7
  artifact descriptors, and provider-observed events. The package does not define a transport or
8
8
  execution runtime.
9
9
 
@@ -32,7 +32,7 @@ carry no fabricated windows or hints.
32
32
  - `@agen-ai/agent-protocol` exports the complete plain API.
33
33
  - `/sessions`, `/turns`, `/requests`, `/events`, `/capabilities`, `/artifacts`, `/operations`,
34
34
  `/configuration`, `/managed-content`, `/integrations`, `/collaboration`, `/resources`, and
35
- `/account-quota` are focused plain entrypoints.
35
+ `/account-quota`, `/effective-content`, `/commands`, `/extensions`, and `/environment` are focused plain entrypoints.
36
36
  - `/zod` is the only entrypoint that exposes Zod schemas.
37
37
  - `/json-schema` exposes deterministic draft 2020-12 schema artifacts.
38
38
 
@@ -50,7 +50,7 @@ import {
50
50
  } from '@agen-ai/agent-protocol';
51
51
 
52
52
  const event: AgentEvent = parseAgentEvent({
53
- protocolVersion: 8,
53
+ protocolVersion: 9,
54
54
  type: 'content.delta',
55
55
  sessionId: parseAgentSessionId('external-session:42'),
56
56
  turnId: parseAgentTurnId('external-turn:9'),
@@ -65,7 +65,7 @@ const event: AgentEvent = parseAgentEvent({
65
65
  const roundTripped = parseAgentEvent(JSON.parse(JSON.stringify(event)));
66
66
  ```
67
67
 
68
- Serialized values carry `protocolVersion: 8`; TypeScript API names remain unsuffixed. Unknown
68
+ Serialized values carry `protocolVersion: 9`; TypeScript API names remain unsuffixed. Unknown
69
69
  fields and unsupported protocol versions are rejected.
70
70
 
71
71
  Item snapshots are a closed union keyed by `itemKind`. Common identity and lifecycle fields are
@@ -78,7 +78,7 @@ attribute bag; source evidence belongs outside the portable event. File-change p
78
78
  `compareStringsByUnicodeCodePoint` to emit the canonical path ordering required by the protocol
79
79
  across both BMP and supplementary Unicode characters.
80
80
 
81
- V8 approval requests correlate to one live item or exact proposed-plan artifact and provide a
81
+ V9 approval requests correlate to one live item or exact proposed-plan artifact and provide a
82
82
  bounded list of typed options. Every option declares its decision, persistence, and neutral scope;
83
83
  resolutions select one offered `optionId` or explicitly cancel. Approval capabilities advertise
84
84
  the exact persistence/scope combinations an adapter can emit. `context.usage.updated` reports
@@ -112,16 +112,47 @@ published JSON Schemas enforce the same rule. Plan-step and progress identifiers
112
112
  messages, and error context must contain non-whitespace content without surrounding whitespace so
113
113
  validated protocol output remains canonical across transports and consumers.
114
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
+
115
148
  ## Versioning and release
116
149
 
117
- The package is at `0.2.5` while the public API is still being proven with external adapters.
118
- Pre-1.0 releases may include breaking changes during this beta period, and every such change is
119
- called out in the release notes. Protocol V8 is independent of any host transport or product
120
- persistence version. It directly replaces V7 in source; there is no compatibility parser, alias,
121
- or extension reader. The account-quota namespace starts at schema version 1 and is additive to
122
- Protocol V8. The required `MaterializedAgentProviderInstance.accountQuota` runtime field is a
123
- source-level implementer change in the coordinated `0.2.5` release; all three SDK packages must
124
- be upgraded together. See the public repository migration guide for the explicit unsupported port.
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.
125
156
 
126
157
  The repository release proof builds and packs `@agen-ai/validation`, this package, and
127
158
  `@agen-ai/agent-runtime`; rejects workspace-only or private references; then typechecks and runs a
@@ -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
1
  export * from './types.js';
2
2
  export * from './parsers.js';
3
+ export * from './contentReferenceText.js';
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1,2 +1,3 @@
1
1
  export * from "./types.js";
2
2
  export * from "./parsers.js";
3
+ export * from "./contentReferenceText.js";
@@ -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: 8;
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,3 @@
1
+ export * from './types.js';
2
+ export * from './parsers.js';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,2 @@
1
+ export * from "./types.js";
2
+ export * from "./parsers.js";
@@ -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,3 @@
1
+ export * from './types.js';
2
+ export * from './parsers.js';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,2 @@
1
+ export * from "./types.js";
2
+ export * from "./parsers.js";
@@ -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
+ };
@@ -0,0 +1,4 @@
1
+ export * from './types.js';
2
+ export * from './parsers.js';
3
+ export * from './facts.js';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,3 @@
1
+ export * from "./types.js";
2
+ export * from "./parsers.js";
3
+ export * from "./facts.js";
@@ -0,0 +1,17 @@
1
+ import type { AgentProtocolParseResult } from '../foundation/index.js';
2
+ import type { AgentEnvironmentCapability, AgentEnvironmentContentResult, AgentEnvironmentCommandsResult, AgentEnvironmentExtensionsResult, AgentEnvironmentIntegrationsResult, AgentEnvironmentInvalidation, AgentEnvironmentSnapshot } from './types.js';
3
+ export declare function parseAgentEnvironmentCapability(input: unknown): AgentEnvironmentCapability;
4
+ export declare function safeParseAgentEnvironmentCapability(input: unknown): AgentProtocolParseResult<AgentEnvironmentCapability>;
5
+ export declare function parseAgentEnvironmentContentResult(input: unknown): AgentEnvironmentContentResult;
6
+ export declare function safeParseAgentEnvironmentContentResult(input: unknown): AgentProtocolParseResult<AgentEnvironmentContentResult>;
7
+ export declare function parseAgentEnvironmentCommandsResult(input: unknown): AgentEnvironmentCommandsResult;
8
+ export declare function safeParseAgentEnvironmentCommandsResult(input: unknown): AgentProtocolParseResult<AgentEnvironmentCommandsResult>;
9
+ export declare function parseAgentEnvironmentExtensionsResult(input: unknown): AgentEnvironmentExtensionsResult;
10
+ export declare function safeParseAgentEnvironmentExtensionsResult(input: unknown): AgentProtocolParseResult<AgentEnvironmentExtensionsResult>;
11
+ export declare function parseAgentEnvironmentIntegrationsResult(input: unknown): AgentEnvironmentIntegrationsResult;
12
+ export declare function safeParseAgentEnvironmentIntegrationsResult(input: unknown): AgentProtocolParseResult<AgentEnvironmentIntegrationsResult>;
13
+ export declare function parseAgentEnvironmentInvalidation(input: unknown): AgentEnvironmentInvalidation;
14
+ export declare function safeParseAgentEnvironmentInvalidation(input: unknown): AgentProtocolParseResult<AgentEnvironmentInvalidation>;
15
+ export declare function parseAgentEnvironmentSnapshot(input: unknown): AgentEnvironmentSnapshot;
16
+ export declare function safeParseAgentEnvironmentSnapshot(input: unknown): AgentProtocolParseResult<AgentEnvironmentSnapshot>;
17
+ //# sourceMappingURL=parsers.d.ts.map
@@ -0,0 +1,68 @@
1
+ import { parseWithSchema, safeParseWithSchema } from "../internal/parsers.js";
2
+ import {
3
+ AgentEnvironmentCapabilitySchema,
4
+ AgentEnvironmentContentResultSchema,
5
+ AgentEnvironmentCommandsResultSchema,
6
+ AgentEnvironmentExtensionsResultSchema,
7
+ AgentEnvironmentIntegrationsResultSchema,
8
+ AgentEnvironmentInvalidationSchema,
9
+ AgentEnvironmentSnapshotSchema
10
+ } from "../zod/environment.js";
11
+ function parseAgentEnvironmentCapability(input) {
12
+ return parseWithSchema(AgentEnvironmentCapabilitySchema, input);
13
+ }
14
+ function safeParseAgentEnvironmentCapability(input) {
15
+ return safeParseWithSchema(AgentEnvironmentCapabilitySchema, input);
16
+ }
17
+ function parseAgentEnvironmentContentResult(input) {
18
+ return parseWithSchema(AgentEnvironmentContentResultSchema, input);
19
+ }
20
+ function safeParseAgentEnvironmentContentResult(input) {
21
+ return safeParseWithSchema(AgentEnvironmentContentResultSchema, input);
22
+ }
23
+ function parseAgentEnvironmentCommandsResult(input) {
24
+ return parseWithSchema(AgentEnvironmentCommandsResultSchema, input);
25
+ }
26
+ function safeParseAgentEnvironmentCommandsResult(input) {
27
+ return safeParseWithSchema(AgentEnvironmentCommandsResultSchema, input);
28
+ }
29
+ function parseAgentEnvironmentExtensionsResult(input) {
30
+ return parseWithSchema(AgentEnvironmentExtensionsResultSchema, input);
31
+ }
32
+ function safeParseAgentEnvironmentExtensionsResult(input) {
33
+ return safeParseWithSchema(AgentEnvironmentExtensionsResultSchema, input);
34
+ }
35
+ function parseAgentEnvironmentIntegrationsResult(input) {
36
+ return parseWithSchema(AgentEnvironmentIntegrationsResultSchema, input);
37
+ }
38
+ function safeParseAgentEnvironmentIntegrationsResult(input) {
39
+ return safeParseWithSchema(AgentEnvironmentIntegrationsResultSchema, input);
40
+ }
41
+ function parseAgentEnvironmentInvalidation(input) {
42
+ return parseWithSchema(AgentEnvironmentInvalidationSchema, input);
43
+ }
44
+ function safeParseAgentEnvironmentInvalidation(input) {
45
+ return safeParseWithSchema(AgentEnvironmentInvalidationSchema, input);
46
+ }
47
+ function parseAgentEnvironmentSnapshot(input) {
48
+ return parseWithSchema(AgentEnvironmentSnapshotSchema, input);
49
+ }
50
+ function safeParseAgentEnvironmentSnapshot(input) {
51
+ return safeParseWithSchema(AgentEnvironmentSnapshotSchema, input);
52
+ }
53
+ export {
54
+ parseAgentEnvironmentCapability,
55
+ parseAgentEnvironmentCommandsResult,
56
+ parseAgentEnvironmentContentResult,
57
+ parseAgentEnvironmentExtensionsResult,
58
+ parseAgentEnvironmentIntegrationsResult,
59
+ parseAgentEnvironmentInvalidation,
60
+ parseAgentEnvironmentSnapshot,
61
+ safeParseAgentEnvironmentCapability,
62
+ safeParseAgentEnvironmentCommandsResult,
63
+ safeParseAgentEnvironmentContentResult,
64
+ safeParseAgentEnvironmentExtensionsResult,
65
+ safeParseAgentEnvironmentIntegrationsResult,
66
+ safeParseAgentEnvironmentInvalidation,
67
+ safeParseAgentEnvironmentSnapshot
68
+ };
@@ -0,0 +1,61 @@
1
+ import type { AgentCommandCatalog } from '../commands/index.js';
2
+ import type { AgentEffectiveContentCatalog } from '../effectiveContent/index.js';
3
+ import type { AgentExtensionCatalog } from '../extensions/index.js';
4
+ import type { AgentIntegrationCatalog } from '../integrations/index.js';
5
+ import type { AgentEnvironmentId } from '../foundation/index.js';
6
+ import type { AgentEnvironmentReason } from './facts.js';
7
+ export declare const AGENT_ENVIRONMENT_SCHEMA_VERSION: 1;
8
+ export declare const AGENT_ENVIRONMENT_DOMAINS: readonly ["content", "commands", "extensions", "integrations"];
9
+ export declare const AGENT_ENVIRONMENT_EVIDENCE_EXTENTS: readonly ["workspace_discovery", "session"];
10
+ export declare const AGENT_ENVIRONMENT_COMPLETENESSES: readonly ["complete", "partial"];
11
+ export declare const AGENT_ENVIRONMENT_DOMAIN_CATALOG_BYTES_LIMIT: number;
12
+ export declare const AGENT_ENVIRONMENT_SNAPSHOT_BYTES_LIMIT: number;
13
+ export declare const AGENT_ENVIRONMENT_EFFECTIVE_ENTRIES_MAX_LENGTH = 1024;
14
+ export declare const AGENT_ENVIRONMENT_INTEGRATION_CONTRIBUTIONS_MAX_LENGTH = 4096;
15
+ export type AgentEnvironmentDomain = (typeof AGENT_ENVIRONMENT_DOMAINS)[number];
16
+ export type AgentEnvironmentEvidenceExtent = (typeof AGENT_ENVIRONMENT_EVIDENCE_EXTENTS)[number];
17
+ export type AgentEnvironmentCompleteness = (typeof AGENT_ENVIRONMENT_COMPLETENESSES)[number];
18
+ export type AgentEnvironmentAvailableDomainResult<Catalog> = Readonly<{
19
+ readonly kind: 'available';
20
+ readonly catalog: Catalog;
21
+ readonly extent: AgentEnvironmentEvidenceExtent;
22
+ readonly completeness: AgentEnvironmentCompleteness;
23
+ readonly reasons: readonly AgentEnvironmentReason[];
24
+ }>;
25
+ export type AgentEnvironmentUnavailableDomainResult = Readonly<{
26
+ readonly kind: 'unsupported' | 'not_initialized' | 'unavailable';
27
+ readonly reasons: readonly AgentEnvironmentReason[];
28
+ }>;
29
+ export type AgentEnvironmentDomainResult<Catalog> = AgentEnvironmentAvailableDomainResult<Catalog> | AgentEnvironmentUnavailableDomainResult;
30
+ export type AgentEnvironmentContentResult = AgentEnvironmentDomainResult<AgentEffectiveContentCatalog>;
31
+ export type AgentEnvironmentCommandsResult = AgentEnvironmentDomainResult<AgentCommandCatalog>;
32
+ export type AgentEnvironmentExtensionsResult = AgentEnvironmentDomainResult<AgentExtensionCatalog>;
33
+ export type AgentEnvironmentIntegrationsResult = AgentEnvironmentDomainResult<AgentIntegrationCatalog>;
34
+ export interface AgentEnvironmentSnapshot {
35
+ readonly schemaVersion: typeof AGENT_ENVIRONMENT_SCHEMA_VERSION;
36
+ readonly environmentId: AgentEnvironmentId;
37
+ readonly revision: number;
38
+ readonly content: AgentEnvironmentContentResult;
39
+ readonly commands: AgentEnvironmentCommandsResult;
40
+ readonly extensions: AgentEnvironmentExtensionsResult;
41
+ readonly integrations: AgentEnvironmentIntegrationsResult;
42
+ }
43
+ export interface AgentEnvironmentInvalidation {
44
+ readonly environmentId: AgentEnvironmentId;
45
+ readonly domains: readonly AgentEnvironmentDomain[];
46
+ }
47
+ /** The serializable capability advertised by a provider instance or session. */
48
+ export type AgentEnvironmentReadCapability = Readonly<{
49
+ readonly kind: 'unsupported';
50
+ }> | Readonly<{
51
+ readonly kind: 'read';
52
+ readonly domains: readonly AgentEnvironmentDomain[];
53
+ }> | Readonly<{
54
+ readonly kind: 'read_and_watch';
55
+ readonly domains: readonly AgentEnvironmentDomain[];
56
+ }>;
57
+ export interface AgentEnvironmentCapability {
58
+ readonly instance: AgentEnvironmentReadCapability;
59
+ readonly session: AgentEnvironmentReadCapability;
60
+ }
61
+ //# sourceMappingURL=types.d.ts.map