agent-runtime-types 0.1.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.
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Discovery response types for GET /v1/capabilities/manifest.
3
+ *
4
+ * The discovery endpoint returns only capabilities the requesting Operator
5
+ * is authorized to use (policy-filtered). Operator uses this to build
6
+ * its tool catalog dynamically at startup.
7
+ */
8
+ import type { ManifestObjectSchema } from "./manifest.js";
9
+ /** A single discovered capability, ready for tool generation. */
10
+ export type DiscoveredCapability = {
11
+ /** Dotted capability ID (e.g. "email.list_inbox"). */
12
+ id: string;
13
+ /** Tool name for the model (e.g. "email_list_inbox"). Derived from id. */
14
+ toolName: string;
15
+ /** Display label. */
16
+ label: string;
17
+ /** Model-facing description. */
18
+ description: string;
19
+ /** Parameter schema. */
20
+ inputSchema: ManifestObjectSchema;
21
+ /** Whether this action requires approval. */
22
+ requiresApproval: boolean;
23
+ };
24
+ /** GET /v1/capabilities/manifest response shape. */
25
+ export type DiscoveryResponse = {
26
+ /** All capabilities this Operator is authorized to use. */
27
+ capabilities: readonly DiscoveredCapability[];
28
+ /** Broker protocol version for forward compatibility. */
29
+ protocolVersion: string;
30
+ };
31
+ //# sourceMappingURL=discovery.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"discovery.d.ts","sourceRoot":"","sources":["../src/discovery.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAE1D,iEAAiE;AACjE,MAAM,MAAM,oBAAoB,GAAG;IACjC,sDAAsD;IACtD,EAAE,EAAE,MAAM,CAAC;IACX,0EAA0E;IAC1E,QAAQ,EAAE,MAAM,CAAC;IACjB,qBAAqB;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,gCAAgC;IAChC,WAAW,EAAE,MAAM,CAAC;IACpB,wBAAwB;IACxB,WAAW,EAAE,oBAAoB,CAAC;IAClC,6CAA6C;IAC7C,gBAAgB,EAAE,OAAO,CAAC;CAC3B,CAAC;AAEF,oDAAoD;AACpD,MAAM,MAAM,iBAAiB,GAAG;IAC9B,2DAA2D;IAC3D,YAAY,EAAE,SAAS,oBAAoB,EAAE,CAAC;IAC9C,yDAAyD;IACzD,eAAe,EAAE,MAAM,CAAC;CACzB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=discovery.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"discovery.js","sourceRoot":"","sources":["../src/discovery.ts"],"names":[],"mappings":""}
@@ -0,0 +1,51 @@
1
+ /**
2
+ * Typed request/response envelopes for broker communication.
3
+ *
4
+ * These are the wire-format types for POST /v1/capabilities/invoke.
5
+ * Backward-compatible with the existing types in broker-capability-tool.ts.
6
+ */
7
+ import type { BrokerStatus, BrokerErrorCode } from "./status.js";
8
+ /** Typed broker request envelope. Sent by Operator to the broker. */
9
+ export type BrokerCapabilityRequest = {
10
+ /** Dotted capability ID, e.g. "email.list_inbox". */
11
+ capability: string;
12
+ /** Parameters validated against the manifest schema. */
13
+ params: Record<string, unknown>;
14
+ /** Unique correlation ID for cross-service tracing. */
15
+ correlationId: string;
16
+ /** Operator session key (optional, for audit). */
17
+ sessionKey?: string;
18
+ /** Operator agent ID (optional, for policy scoping). */
19
+ agentId?: string;
20
+ };
21
+ /** Typed broker response envelope. Returned by broker on invoke. */
22
+ export type BrokerCapabilityResponse = {
23
+ /** Coarse outcome. */
24
+ status: BrokerStatus;
25
+ /** Present when status is "ok". Adapter-specific result data. */
26
+ data?: unknown;
27
+ /** Human-readable error message. Present on "denied" or "error". */
28
+ error?: string;
29
+ /** Machine-readable error code for programmatic handling. */
30
+ errorCode?: BrokerErrorCode;
31
+ /** Echoed correlation ID for tracing. */
32
+ correlationId: string;
33
+ };
34
+ /** Approval request sent by Operator to broker to resolve a pending action. */
35
+ export type BrokerApprovalRequest = {
36
+ /** The correlationId of the pending action to approve or deny. */
37
+ correlationId: string;
38
+ /** Approval decision. */
39
+ decision: "approve" | "deny";
40
+ /** Operator session key (optional, for audit). */
41
+ sessionKey?: string;
42
+ /** Operator agent ID (optional, for audit). */
43
+ agentId?: string;
44
+ };
45
+ /** Summary of a pending approval returned by the broker. */
46
+ export type PendingApprovalSummary = {
47
+ correlationId: string;
48
+ capability: string;
49
+ createdAt: number;
50
+ };
51
+ //# sourceMappingURL=envelope.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"envelope.d.ts","sourceRoot":"","sources":["../src/envelope.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEjE,qEAAqE;AACrE,MAAM,MAAM,uBAAuB,GAAG;IACpC,qDAAqD;IACrD,UAAU,EAAE,MAAM,CAAC;IACnB,wDAAwD;IACxD,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,uDAAuD;IACvD,aAAa,EAAE,MAAM,CAAC;IACtB,kDAAkD;IAClD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,wDAAwD;IACxD,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,oEAAoE;AACpE,MAAM,MAAM,wBAAwB,GAAG;IACrC,sBAAsB;IACtB,MAAM,EAAE,YAAY,CAAC;IACrB,iEAAiE;IACjE,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,oEAAoE;IACpE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,6DAA6D;IAC7D,SAAS,CAAC,EAAE,eAAe,CAAC;IAC5B,yCAAyC;IACzC,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,+EAA+E;AAC/E,MAAM,MAAM,qBAAqB,GAAG;IAClC,kEAAkE;IAClE,aAAa,EAAE,MAAM,CAAC;IACtB,yBAAyB;IACzB,QAAQ,EAAE,SAAS,GAAG,MAAM,CAAC;IAC7B,kDAAkD;IAClD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,+CAA+C;IAC/C,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,4DAA4D;AAC5D,MAAM,MAAM,sBAAsB,GAAG;IACnC,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=envelope.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"envelope.js","sourceRoot":"","sources":["../src/envelope.ts"],"names":[],"mappings":""}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * @operator/protocol — shared wire-format types for the Operator brokered runtime.
3
+ *
4
+ * This package is intentionally minimal: just types and constants for the
5
+ * protocol between Operator, Broker, and integration services.
6
+ */
7
+ export type { BrokerStatus, BrokerErrorCode } from "./status.js";
8
+ export { BROKER_STATUSES } from "./status.js";
9
+ export type { BrokerCapabilityRequest, BrokerCapabilityResponse, BrokerApprovalRequest, PendingApprovalSummary, } from "./envelope.js";
10
+ export type { ManifestParamSchema, ManifestStringSchema, ManifestNumberSchema, ManifestBooleanSchema, ManifestEnumSchema, ManifestArraySchema, ManifestObjectSchema, CapabilityActionManifest, CapabilityFamilyManifest, } from "./manifest.js";
11
+ export type { DiscoveredCapability, DiscoveryResponse, } from "./discovery.js";
12
+ export type { LogEntry, LogLevel } from "./log.js";
13
+ export { createLogShipper } from "./log-shipper.js";
14
+ export type { LogShipper, LogShipperConfig } from "./log-shipper.js";
15
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,YAAY,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAG9C,YAAY,EACV,uBAAuB,EACvB,wBAAwB,EACxB,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,eAAe,CAAC;AAGvB,YAAY,EACV,mBAAmB,EACnB,oBAAoB,EACpB,oBAAoB,EACpB,qBAAqB,EACrB,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EACpB,wBAAwB,EACxB,wBAAwB,GACzB,MAAM,eAAe,CAAC;AAGvB,YAAY,EACV,oBAAoB,EACpB,iBAAiB,GAClB,MAAM,gBAAgB,CAAC;AAGxB,YAAY,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,YAAY,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @operator/protocol — shared wire-format types for the Operator brokered runtime.
3
+ *
4
+ * This package is intentionally minimal: just types and constants for the
5
+ * protocol between Operator, Broker, and integration services.
6
+ */
7
+ export { BROKER_STATUSES } from "./status.js";
8
+ export { createLogShipper } from "./log-shipper.js";
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AA+B9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC"}
@@ -0,0 +1,31 @@
1
+ import type { LogEntry } from "./log.js";
2
+ export type LogShipperConfig = {
3
+ /** URL of the log collector (e.g., "http://log-collector:4300"). */
4
+ collectorUrl: string;
5
+ /** Bearer token for authenticating with the collector. */
6
+ token: string;
7
+ /** Max entries to buffer before flushing. Default: 20. */
8
+ batchSize?: number;
9
+ /** Max time (ms) to hold entries before flushing. Default: 1000. */
10
+ flushIntervalMs?: number;
11
+ };
12
+ /**
13
+ * Fire-and-forget log shipper that batches entries and POSTs to the collector.
14
+ *
15
+ * - Non-blocking: never throws, never awaits in the critical path.
16
+ * - Passive: silently drops entries if the collector is unreachable.
17
+ * - Batching: accumulates entries and flushes on size or time threshold.
18
+ *
19
+ * Usage:
20
+ * const shipper = createLogShipper({ collectorUrl, token });
21
+ * shipper.ship(entry); // queue an entry
22
+ * await shipper.shutdown(); // flush remaining + stop timer
23
+ */
24
+ export type LogShipper = {
25
+ /** Queue a log entry for shipping. */
26
+ ship(entry: LogEntry): void;
27
+ /** Flush remaining entries and stop the timer. */
28
+ shutdown(): Promise<void>;
29
+ };
30
+ export declare function createLogShipper(config: LogShipperConfig): LogShipper;
31
+ //# sourceMappingURL=log-shipper.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"log-shipper.d.ts","sourceRoot":"","sources":["../src/log-shipper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEzC,MAAM,MAAM,gBAAgB,GAAG;IAC7B,oEAAoE;IACpE,YAAY,EAAE,MAAM,CAAC;IACrB,0DAA0D;IAC1D,KAAK,EAAE,MAAM,CAAC;IACd,0DAA0D;IAC1D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oEAAoE;IACpE,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB,sCAAsC;IACtC,IAAI,CAAC,KAAK,EAAE,QAAQ,GAAG,IAAI,CAAC;IAC5B,kDAAkD;IAClD,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3B,CAAC;AAEF,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,gBAAgB,GAAG,UAAU,CAqDrE"}
@@ -0,0 +1,50 @@
1
+ export function createLogShipper(config) {
2
+ const batchSize = config.batchSize ?? 20;
3
+ const flushIntervalMs = config.flushIntervalMs ?? 1000;
4
+ const endpoint = `${config.collectorUrl}/v1/ingest`;
5
+ const headers = {
6
+ "Content-Type": "application/json",
7
+ Authorization: `Bearer ${config.token}`,
8
+ };
9
+ let buffer = [];
10
+ let timer = null;
11
+ function flush() {
12
+ if (buffer.length === 0)
13
+ return;
14
+ const batch = buffer;
15
+ buffer = [];
16
+ // Fire-and-forget: no await, catch all errors silently
17
+ fetch(endpoint, {
18
+ method: "POST",
19
+ headers,
20
+ body: JSON.stringify(batch),
21
+ signal: AbortSignal.timeout(5000),
22
+ }).catch(() => {
23
+ // Collector unavailable — silently drop. Logs are still on stdout.
24
+ });
25
+ }
26
+ // Start periodic flush timer
27
+ timer = setInterval(flush, flushIntervalMs);
28
+ // Allow the process to exit even if the timer is running
29
+ if (timer && typeof timer === "object" && "unref" in timer) {
30
+ timer.unref();
31
+ }
32
+ return {
33
+ ship(entry) {
34
+ buffer.push(entry);
35
+ if (buffer.length >= batchSize) {
36
+ flush();
37
+ }
38
+ },
39
+ async shutdown() {
40
+ if (timer) {
41
+ clearInterval(timer);
42
+ timer = null;
43
+ }
44
+ flush();
45
+ // Give the last flush a moment to fire
46
+ await new Promise((r) => setTimeout(r, 100));
47
+ },
48
+ };
49
+ }
50
+ //# sourceMappingURL=log-shipper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"log-shipper.js","sourceRoot":"","sources":["../src/log-shipper.ts"],"names":[],"mappings":"AAgCA,MAAM,UAAU,gBAAgB,CAAC,MAAwB;IACvD,MAAM,SAAS,GAAG,MAAM,CAAC,SAAS,IAAI,EAAE,CAAC;IACzC,MAAM,eAAe,GAAG,MAAM,CAAC,eAAe,IAAI,IAAI,CAAC;IACvD,MAAM,QAAQ,GAAG,GAAG,MAAM,CAAC,YAAY,YAAY,CAAC;IACpD,MAAM,OAAO,GAAG;QACd,cAAc,EAAE,kBAAkB;QAClC,aAAa,EAAE,UAAU,MAAM,CAAC,KAAK,EAAE;KACxC,CAAC;IAEF,IAAI,MAAM,GAAe,EAAE,CAAC;IAC5B,IAAI,KAAK,GAA0C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
3
+ *
4
+ * All services emit LogEntry objects as single-line JSON to stdout.
5
+ * The log collector ingests these for correlated cross-service tracing.
6
+ */
7
+ /** Severity level for a log entry. */
8
+ export type LogLevel = "info" | "warn" | "error";
9
+ /** Base structured log entry emitted by every service. */
10
+ export type LogEntry = {
11
+ /** ISO-8601 timestamp. */
12
+ ts: string;
13
+ /** Service name (e.g., "broker", "ai-proxy", "mock-email", "log-collector"). */
14
+ service: string;
15
+ /** Event identifier (e.g., "request", "denied", "ok", "startup"). */
16
+ event: string;
17
+ /** Severity — defaults to "info" if omitted. */
18
+ level?: LogLevel;
19
+ /** Cross-service correlation ID for request tracing. */
20
+ correlationId?: string;
21
+ /** Request duration in milliseconds (for timed events). */
22
+ durationMs?: number;
23
+ /** Arbitrary additional fields. */
24
+ [key: string]: unknown;
25
+ };
26
+ //# sourceMappingURL=log.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"log.d.ts","sourceRoot":"","sources":["../src/log.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,sCAAsC;AACtC,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AAEjD,0DAA0D;AAC1D,MAAM,MAAM,QAAQ,GAAG;IACrB,0BAA0B;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,gFAAgF;IAChF,OAAO,EAAE,MAAM,CAAC;IAChB,qEAAqE;IACrE,KAAK,EAAE,MAAM,CAAC;IACd,gDAAgD;IAChD,KAAK,CAAC,EAAE,QAAQ,CAAC;IACjB,wDAAwD;IACxD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,2DAA2D;IAC3D,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,mCAAmC;IACnC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB,CAAC"}
package/dist/log.js ADDED
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Shared structured log types for the Operator brokered runtime.
3
+ *
4
+ * All services emit LogEntry objects as single-line JSON to stdout.
5
+ * The log collector ingests these for correlated cross-service tracing.
6
+ */
7
+ export {};
8
+ //# sourceMappingURL=log.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"log.js","sourceRoot":"","sources":["../src/log.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
@@ -0,0 +1,84 @@
1
+ /**
2
+ * Capability manifest schema types.
3
+ *
4
+ * These define the format of broker-owned manifest files (one per integration).
5
+ * The manifest is the single source of truth: broker validation and Operator
6
+ * tool schemas are both derived from it.
7
+ *
8
+ * Parameter types are a deliberately constrained subset of JSON Schema —
9
+ * no $ref, no allOf/anyOf/oneOf, no patternProperties. This keeps validation
10
+ * and tool-schema generation simple and auditable.
11
+ */
12
+ export type ManifestStringSchema = {
13
+ type: "string";
14
+ description?: string;
15
+ minLength?: number;
16
+ maxLength?: number;
17
+ /** Regex pattern. Broker validates; Operator does not enforce. */
18
+ pattern?: string;
19
+ };
20
+ export type ManifestNumberSchema = {
21
+ type: "number";
22
+ description?: string;
23
+ minimum?: number;
24
+ maximum?: number;
25
+ /** If true, value must be an integer. */
26
+ integer?: boolean;
27
+ };
28
+ export type ManifestBooleanSchema = {
29
+ type: "boolean";
30
+ description?: string;
31
+ };
32
+ export type ManifestEnumSchema = {
33
+ type: "enum";
34
+ values: readonly string[];
35
+ description?: string;
36
+ };
37
+ export type ManifestArraySchema = {
38
+ type: "array";
39
+ items: ManifestParamSchema;
40
+ description?: string;
41
+ minItems?: number;
42
+ maxItems?: number;
43
+ };
44
+ export type ManifestObjectSchema = {
45
+ type: "object";
46
+ properties: Record<string, ManifestParamSchema>;
47
+ required?: readonly string[];
48
+ description?: string;
49
+ /** Reject unknown properties. Default: true (fail-closed). */
50
+ additionalProperties?: false;
51
+ };
52
+ /**
53
+ * Closed union of all supported parameter types.
54
+ * Adding a new type here requires updating both the broker validator
55
+ * and the Operator's manifestSchemaToTypeBox converter.
56
+ */
57
+ export type ManifestParamSchema = ManifestStringSchema | ManifestNumberSchema | ManifestBooleanSchema | ManifestEnumSchema | ManifestArraySchema | ManifestObjectSchema;
58
+ /** A single capability action within a family. */
59
+ export type CapabilityActionManifest = {
60
+ /** Dotted action ID, e.g. "email.list_inbox". Must be globally unique. */
61
+ id: string;
62
+ /** Human-readable name for display, e.g. "List Inbox". */
63
+ label: string;
64
+ /** Description shown to the model. */
65
+ description: string;
66
+ /** Parameter schema. Top level is always an object. */
67
+ inputSchema: ManifestObjectSchema;
68
+ /** Whether this action requires approval before execution. */
69
+ requiresApproval?: boolean;
70
+ /** Whether this action is read-only (informational for policy). */
71
+ readOnly?: boolean;
72
+ };
73
+ /** A capability family manifest. One per integration (e.g., email, calendar). */
74
+ export type CapabilityFamilyManifest = {
75
+ /** Family ID, e.g. "email". */
76
+ family: string;
77
+ /** Semver version of this manifest. */
78
+ version: string;
79
+ /** Human-readable family description. */
80
+ description: string;
81
+ /** All actions in this family. */
82
+ actions: readonly CapabilityActionManifest[];
83
+ };
84
+ //# sourceMappingURL=manifest.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../src/manifest.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAMH,MAAM,MAAM,oBAAoB,GAAG;IACjC,IAAI,EAAE,QAAQ,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kEAAkE;IAClE,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC,IAAI,EAAE,QAAQ,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,yCAAyC;IACzC,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IACl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M,MAAM,wBAAwB,GAAG;IACrC,+BAA+B;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,uCAAuC;IACvC,OAAO,EAAE,MAAM,CAAC;IAChB,yCAAyC;IACzC,WAAW,EAAE,MAAM,CAAC;IACpB,kCAAkC;IAClC,OAAO,EAAE,SAAS,wBAAwB,EAAE,CAAC;CAC9C,CAAC"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Capability manifest schema types.
3
+ *
4
+ * These define the format of broker-owned manifest files (one per integration).
5
+ * The manifest is the single source of truth: broker validation and Operator
6
+ * tool schemas are both derived from it.
7
+ *
8
+ * Parameter types are a deliberately constrained subset of JSON Schema —
9
+ * no $ref, no allOf/anyOf/oneOf, no patternProperties. This keeps validation
10
+ * and tool-schema generation simple and auditable.
11
+ */
12
+ export {};
13
+ //# sourceMappingURL=manifest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manifest.js","sourceRoot":"","sources":["../src/manifest.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Broker response statuses and structured error codes.
3
+ *
4
+ * These types define the outcome space for every broker interaction.
5
+ * Status is the coarse result; error code is the machine-readable reason.
6
+ */
7
+ /** Exhaustive broker response statuses. */
8
+ export type BrokerStatus = "ok" | "denied" | "needs_approval" | "error";
9
+ /** All valid status values as a frozen set for runtime validation. */
10
+ export declare const BROKER_STATUSES: ReadonlySet<BrokerStatus>;
11
+ /**
12
+ * Structured error codes for programmatic handling and observability.
13
+ * Never leak internal details — these are safe to return to Operator.
14
+ */
15
+ export type BrokerErrorCode = "unknown_capability" | "invalid_params" | "policy_denied" | "adapter_unavailable" | "adapter_error" | "auth_failed" | "rate_limited" | "payload_too_large" | "internal_error" | "approval_not_found" | "approval_expired" | "approval_already_resolved";
16
+ //# sourceMappingURL=status.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../src/status.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,2CAA2C;AAC3C,MAAM,MAAM,YAAY,GAAG,IAAI,GAAG,QAAQ,GAAG,gBAAgB,GAAG,OAAO,CAAC;AAExE,sEAAsE;AACtE,eAAO,MAAM,eAAe,EAAE,WAAW,CAAC,YAAY,CAKpD,CAAC;AAEH;;;GAGG;AACH,MAAM,MAAM,eAAe,GACvB,oBAAoB,GACpB,gBAAgB,GAChB,eAAe,GACf,qBAAqB,GACrB,eAAe,GACf,aAAa,GACb,cAAc,GACd,mBAAmB,GACnB,gBAAgB,GAChB,oBAAoB,GACpB,kBAAkB,GAClB,2BAA2B,CAAC"}
package/dist/status.js ADDED
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Broker response statuses and structured error codes.
3
+ *
4
+ * These types define the outcome space for every broker interaction.
5
+ * Status is the coarse result; error code is the machine-readable reason.
6
+ */
7
+ /** All valid status values as a frozen set for runtime validation. */
8
+ export const BROKER_STATUSES = new Set([
9
+ "ok",
10
+ "denied",
11
+ "needs_approval",
12
+ "error",
13
+ ]);
14
+ //# sourceMappingURL=status.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"status.js","sourceRoot":"","sources":["../src/status.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,sEAAsE;AACtE,MAAM,CAAC,MAAM,eAAe,GAA8B,IAAI,GAAG,CAAC;IAChE,IAAI;IACJ,QAAQ;IACR,gBAAgB;IAChB,OAAO;CACR,CAAC,CAAC"}
package/package.json ADDED
@@ -0,0 +1,26 @@
1
+ {
2
+ "name": "agent-runtime-types",
3
+ "version": "0.1.0",
4
+ "description": "Shared wire-format types for the Operator brokered runtime",
5
+ "type": "module",
6
+ "main": "dist/index.js",
7
+ "types": "dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "default": "./dist/index.js"
12
+ }
13
+ },
14
+ "files": [
15
+ "dist"
16
+ ],
17
+ "scripts": {
18
+ "build": "tsc",
19
+ "typecheck": "tsc --noEmit",
20
+ "prepublishOnly": "npm run build"
21
+ },
22
+ "devDependencies": {
23
+ "@types/node": "^25.5.0",
24
+ "typescript": "^5.7.0"
25
+ }
26
+ }