@agen-ai/agent-protocol 0.2.4 → 0.2.5

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 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 artifact descriptors, and
7
- provider-observed events. The package does not define a transport or execution runtime.
6
+ 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`, and `/resources` are
28
- focused plain entrypoints.
34
+ `/configuration`, `/managed-content`, `/integrations`, `/collaboration`, `/resources`, and
35
+ `/account-quota` 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
 
@@ -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. None of these domains has a generic
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
@@ -104,11 +114,14 @@ validated protocol output remains canonical across transports and consumers.
104
114
 
105
115
  ## Versioning and release
106
116
 
107
- The package is at `0.2.4` while the public API is still being proven with external adapters.
117
+ The package is at `0.2.5` while the public API is still being proven with external adapters.
108
118
  Pre-1.0 releases may include breaking changes during this beta period, and every such change is
109
119
  called out in the release notes. Protocol V8 is independent of any host transport or product
110
120
  persistence version. It directly replaces V7 in source; there is no compatibility parser, alias,
111
- or extension reader.
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.
112
125
 
113
126
  The repository release proof builds and packs `@agen-ai/validation`, this package, and
114
127
  `@agen-ai/agent-runtime`; rejects workspace-only or private references; then typechecks and runs a
@@ -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/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
+ };