@independo/inderun-contracts 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.
Files changed (45) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +16 -0
  3. package/dist/generated/http-request.d.ts +34 -0
  4. package/dist/generated/http-request.d.ts.map +1 -0
  5. package/dist/generated/http-request.js +2 -0
  6. package/dist/generated/http-response.d.ts +25 -0
  7. package/dist/generated/http-response.d.ts.map +1 -0
  8. package/dist/generated/http-response.js +2 -0
  9. package/dist/generated/inderun-error.d.ts +45 -0
  10. package/dist/generated/inderun-error.d.ts.map +1 -0
  11. package/dist/generated/inderun-error.js +2 -0
  12. package/dist/generated/index.d.ts +10 -0
  13. package/dist/generated/index.d.ts.map +1 -0
  14. package/dist/generated/index.js +2 -0
  15. package/dist/generated/route-plan.d.ts +59 -0
  16. package/dist/generated/route-plan.d.ts.map +1 -0
  17. package/dist/generated/route-plan.js +2 -0
  18. package/dist/generated/route-planner-input.d.ts +104 -0
  19. package/dist/generated/route-planner-input.d.ts.map +1 -0
  20. package/dist/generated/route-planner-input.js +2 -0
  21. package/dist/generated/schemas.d.ts +610 -0
  22. package/dist/generated/schemas.d.ts.map +1 -0
  23. package/dist/generated/schemas.js +773 -0
  24. package/dist/generated/task-request.d.ts +171 -0
  25. package/dist/generated/task-request.d.ts.map +1 -0
  26. package/dist/generated/task-request.js +2 -0
  27. package/dist/generated/task-result.d.ts +96 -0
  28. package/dist/generated/task-result.d.ts.map +1 -0
  29. package/dist/generated/task-result.js +2 -0
  30. package/dist/generated/telemetry-event.d.ts +29 -0
  31. package/dist/generated/telemetry-event.d.ts.map +1 -0
  32. package/dist/generated/telemetry-event.js +2 -0
  33. package/dist/host.d.ts +111 -0
  34. package/dist/host.d.ts.map +1 -0
  35. package/dist/host.js +1 -0
  36. package/dist/index.d.ts +6 -0
  37. package/dist/index.d.ts.map +1 -0
  38. package/dist/index.js +2 -0
  39. package/dist/types.d.ts +18 -0
  40. package/dist/types.d.ts.map +1 -0
  41. package/dist/types.js +1 -0
  42. package/dist/validators.d.ts +30 -0
  43. package/dist/validators.d.ts.map +1 -0
  44. package/dist/validators.js +158 -0
  45. package/package.json +33 -0
@@ -0,0 +1,171 @@
1
+ /**
2
+ * The standard request payload for initiating a text-to-text execution task within the
3
+ * IndeRun framework.
4
+ */
5
+ export type TaskRequest = {
6
+ /**
7
+ * A unique identifier used to retrieve credentials from a secure local storage. Raw
8
+ * sensitive keys (API keys, etc.) should NEVER be placed directly in the request payload.
9
+ */
10
+ authContextRef?: string;
11
+ /**
12
+ * Request-level routing constraints used by the planner.
13
+ */
14
+ constraints?: Constraints;
15
+ /**
16
+ * Optional configuration for fine-tuning how the AI model generates its response.
17
+ */
18
+ generation?: Generation;
19
+ /**
20
+ * A list of interaction messages for multi-turn conversation or chat-style execution.
21
+ */
22
+ messages?: Message[];
23
+ /**
24
+ * Soft routing preferences used for deterministic provider ordering.
25
+ */
26
+ preferences?: Preferences;
27
+ /**
28
+ * A simple, single-turn text prompt used to trigger a response from the AI model.
29
+ */
30
+ prompt?: string;
31
+ /**
32
+ * Optional identifier for tracking or correlating this specific execution attempt.
33
+ */
34
+ requestId?: string;
35
+ /**
36
+ * Contract schema version used to interpret the request payload.
37
+ */
38
+ schemaVersion: "1.0";
39
+ /**
40
+ * A descriptor specifying the type of work to be performed. For text-to-text, the kind must
41
+ * be 'text_to_text'.
42
+ */
43
+ task: Task;
44
+ /**
45
+ * Execution preferences for tracking usage and performance metrics.
46
+ */
47
+ telemetry?: Telemetry;
48
+ [property: string]: unknown;
49
+ };
50
+ /**
51
+ * Request-level routing constraints used by the planner.
52
+ */
53
+ export type Constraints = {
54
+ /**
55
+ * Cloud execution constraint.
56
+ */
57
+ cloud?: Cloud;
58
+ /**
59
+ * Privacy requirement or preference for execution placement.
60
+ */
61
+ privacy?: Privacy;
62
+ /**
63
+ * Optional routing timeout budget in milliseconds.
64
+ */
65
+ timeoutMs?: number;
66
+ [property: string]: unknown;
67
+ };
68
+ /**
69
+ * Cloud execution constraint.
70
+ */
71
+ export type Cloud = "forbidden" | "allowed" | "required";
72
+ /**
73
+ * Privacy requirement or preference for execution placement.
74
+ */
75
+ export type Privacy = "local_required" | "local_preferred" | "cloud_allowed" | "cloud_required";
76
+ /**
77
+ * Optional configuration for fine-tuning how the AI model generates its response.
78
+ */
79
+ export type Generation = {
80
+ /**
81
+ * The maximum number of tokens to generate in a single response.
82
+ */
83
+ maxOutputTokens?: number;
84
+ /**
85
+ * A fixed seed for deterministic generation (where supported by the underlying provider).
86
+ */
87
+ seed?: number;
88
+ /**
89
+ * Sequence tokens that should terminate the generation process.
90
+ */
91
+ stop?: string[];
92
+ /**
93
+ * Controls the randomness of the output. Range: 0 (most deterministic) to 2 (highest
94
+ * variance).
95
+ */
96
+ temperature?: number;
97
+ /**
98
+ * Nucleus sampling parameter for controlling diversity vs focus in the output.
99
+ */
100
+ topP?: number;
101
+ [property: string]: unknown;
102
+ };
103
+ /**
104
+ * An individual message in a conversation.
105
+ */
106
+ export type Message = {
107
+ /**
108
+ * The actual text content of the message.
109
+ */
110
+ content: string;
111
+ /**
112
+ * The role of the author (e.g., 'user', 'assistant').
113
+ */
114
+ role: Role;
115
+ [property: string]: unknown;
116
+ };
117
+ /**
118
+ * The role of the author (e.g., 'user', 'assistant').
119
+ */
120
+ export type Role = "system" | "user" | "assistant";
121
+ /**
122
+ * Soft routing preferences used for deterministic provider ordering.
123
+ */
124
+ export type Preferences = {
125
+ /**
126
+ * Primary optimization goal when multiple providers remain eligible.
127
+ */
128
+ optimizeFor?: OptimizeFor;
129
+ [property: string]: unknown;
130
+ };
131
+ /**
132
+ * Primary optimization goal when multiple providers remain eligible.
133
+ */
134
+ export type OptimizeFor = "privacy" | "latency" | "cost" | "balanced";
135
+ /**
136
+ * A descriptor specifying the type of work to be performed. For text-to-text, the kind must
137
+ * be 'text_to_text'.
138
+ */
139
+ export type Task = {
140
+ /**
141
+ * The standard task category. Currently supports 'text_to_text' for prompt-based
142
+ * interactions.
143
+ */
144
+ kind: "text_to_text";
145
+ [property: string]: unknown;
146
+ };
147
+ /**
148
+ * Execution preferences for tracking usage and performance metrics.
149
+ */
150
+ export type Telemetry = {
151
+ /**
152
+ * Whether the user consents to telemetry collection for this specific request.
153
+ */
154
+ consent?: boolean;
155
+ /**
156
+ * The granularity of the collected metrics (off, minimal, or debug).
157
+ */
158
+ level?: Level;
159
+ /**
160
+ * Optional key-value pairs for correlating telemetry data with specific features or users.
161
+ */
162
+ tags?: {
163
+ [key: string]: string;
164
+ };
165
+ [property: string]: unknown;
166
+ };
167
+ /**
168
+ * The granularity of the collected metrics (off, minimal, or debug).
169
+ */
170
+ export type Level = "off" | "minimal" | "debug";
171
+ //# sourceMappingURL=task-request.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"task-request.d.ts","sourceRoot":"","sources":["../../src/generated/task-request.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,MAAM,WAAW,GAAG;IACtB;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;OAEG;IACH,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B;;OAEG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC;IACrB;;OAEG;IACH,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,aAAa,EAAE,KAAK,CAAC;IACrB;;;OAGG;IACH,IAAI,EAAE,IAAI,CAAC;IACX;;OAEG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC/B,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG;IACtB;;OAEG;IACH,KAAK,CA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ACH,MAAM,MAAM,IAAI,GAAG;IACf;;;OAGG;IACH,IAAI,EAAE,cAAc,CAAC;IACrB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC/B,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG;IACpB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC;IACd;;OAEG;IACH,IAAI,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;IACjC,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC/B,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,KAAK,GAAG,KAAK,GAAG,SAAS,GAAG,OAAO,CAAC"}
@@ -0,0 +1,2 @@
1
+ /* This file was generated from JSON Schema using quicktype. Do not edit by hand. */
2
+ export {};
@@ -0,0 +1,96 @@
1
+ /**
2
+ * The standard response payload for completed text-to-text execution within the IndeRun
3
+ * framework.
4
+ */
5
+ export type TaskResult = {
6
+ /**
7
+ * Standardized reason describing how generation concluded (e.g., 'stop', 'length',
8
+ * 'cancelled', or 'error').
9
+ */
10
+ finishReason: FinishReason;
11
+ /**
12
+ * The normalized content returned from the selected provider.
13
+ */
14
+ output: Output;
15
+ /**
16
+ * A unique, opaque identifier assigned by the engine for this specific execution attempt.
17
+ */
18
+ runId: string;
19
+ /**
20
+ * Contract schema version used to interpret the result payload.
21
+ */
22
+ schemaVersion: "1.0";
23
+ /**
24
+ * Required metadata providing an overview of the execution result and performance metrics.
25
+ */
26
+ telemetry: Telemetry;
27
+ /**
28
+ * Optional metadata regarding the quantity of tokens processed by the provider.
29
+ */
30
+ usage?: Usage;
31
+ [property: string]: unknown;
32
+ };
33
+ /**
34
+ * Standardized reason describing how generation concluded (e.g., 'stop', 'length',
35
+ * 'cancelled', or 'error').
36
+ */
37
+ export type FinishReason = "stop" | "length" | "cancelled" | "error";
38
+ /**
39
+ * The normalized content returned from the selected provider.
40
+ */
41
+ export type Output = {
42
+ /**
43
+ * The actual text generated by the execution.
44
+ */
45
+ text: string;
46
+ /**
47
+ * Output payload category (e.g., 'text' for Mode 1 text-to-text).
48
+ */
49
+ type: "text";
50
+ [property: string]: unknown;
51
+ };
52
+ /**
53
+ * Required metadata providing an overview of the execution result and performance metrics.
54
+ */
55
+ export type Telemetry = {
56
+ /**
57
+ * Included if the request resulted in a provider-level error (e.g., 'CapabilityMismatch' or
58
+ * 'Unavailable').
59
+ */
60
+ errorClass?: ErrorClass;
61
+ /**
62
+ * The identifier for the specific provider that handled the request (e.g.,
63
+ * 'openai_compatible_cloud').
64
+ */
65
+ providerUsed: string;
66
+ /**
67
+ * Measured execution duration in milliseconds, including route selection and result
68
+ * processing.
69
+ */
70
+ totalMs: number;
71
+ [property: string]: unknown;
72
+ };
73
+ /**
74
+ * Included if the request resulted in a provider-level error (e.g., 'CapabilityMismatch' or
75
+ * 'Unavailable').
76
+ */
77
+ export type ErrorClass = "CapabilityMismatch" | "Offline" | "AuthError" | "RateLimited" | "Timeout" | "Unavailable" | "Internal";
78
+ /**
79
+ * Optional metadata regarding the quantity of tokens processed by the provider.
80
+ */
81
+ export type Usage = {
82
+ /**
83
+ * Number of input tokens consumed, as reported by the provider.
84
+ */
85
+ inputTokens?: number;
86
+ /**
87
+ * Number of output tokens generated, as reported by the provider.
88
+ */
89
+ outputTokens?: number;
90
+ /**
91
+ * Aggregated token count for this request, as reported by the provider.
92
+ */
93
+ totalTokens?: number;
94
+ [property: string]: unknown;
95
+ };
96
+ //# sourceMappingURL=task-result.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"task-result.d.ts","sourceRoot":"","sources":["../../src/generated/task-result.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,MAAM,UAAU,GAAG;IACrB;;;OAGG;IACH,YAAY,EAAE,YAAY,CAAC;IAC3B;;OAEG;IACH,MAAM,EAAE,MAAM,CAA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
2
+ * Normalized telemetry event emitted by the orchestrator and providers.
3
+ */
4
+ export type TelemetryEvent = {
5
+ /**
6
+ * Event-specific metadata. It must not contain prompt payloads or raw secrets.
7
+ */
8
+ payload: {
9
+ [key: string]: unknown;
10
+ };
11
+ /**
12
+ * Opaque run identifier associated with this execution event.
13
+ */
14
+ runId: string;
15
+ /**
16
+ * Wall-clock event timestamp in Unix epoch milliseconds.
17
+ */
18
+ timestamp: number;
19
+ /**
20
+ * Telemetry event kind emitted by the orchestrator or provider integration.
21
+ */
22
+ type: Type;
23
+ [property: string]: unknown;
24
+ };
25
+ /**
26
+ * Telemetry event kind emitted by the orchestrator or provider integration.
27
+ */
28
+ export type Type = "route_decided" | "attempt_succeeded" | "attempt_failed";
29
+ //# sourceMappingURL=telemetry-event.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"telemetry-event.d.ts","sourceRoot":"","sources":["../../src/generated/telemetry-event.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG;IACzB;;OAEG;IACH,OAAO,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAC;IACpC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,IAAI,EAAE,IAAI,CAAC;IACX,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC/B,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,IAAI,GAAG,eAAe,GAAG,mBAAmB,GAAG,gBAAgB,CAAC"}
@@ -0,0 +1,2 @@
1
+ /* This file was generated from JSON Schema using quicktype. Do not edit by hand. */
2
+ export {};
package/dist/host.d.ts ADDED
@@ -0,0 +1,111 @@
1
+ import type { HttpRequest, HttpResponse, TelemetryEvent } from "./generated/index.js";
2
+ /**
3
+ * Service to inspect and monitor network connectivity status.
4
+ */
5
+ export interface ConnectivityService {
6
+ /**
7
+ * Resolves to true if the host is connected to the network, false otherwise.
8
+ */
9
+ isOnline(): Promise<boolean>;
10
+ }
11
+ /**
12
+ * Operating system thermal states denoting system heat and throttling risk.
13
+ */
14
+ export type ThermalState = "nominal" | "fair" | "serious" | "critical";
15
+ /**
16
+ * Service to inspect host device battery, power, and thermal constraints.
17
+ */
18
+ export interface DeviceConstraintsService {
19
+ /**
20
+ * Retrieves the current thermal state of the device, if supported.
21
+ */
22
+ getThermalState?(): Promise<ThermalState>;
23
+ /**
24
+ * Checks if the host device has low power mode enabled, if supported.
25
+ */
26
+ isLowPowerModeEnabled?(): Promise<boolean>;
27
+ }
28
+ /**
29
+ * Secure storage interface to store and retrieve sensitive credentials/tokens
30
+ * without exposing them to request payloads.
31
+ */
32
+ export interface SecureStorageService {
33
+ /**
34
+ * Gets a secret by its unique slot identifier.
35
+ */
36
+ getSecret(slotId: string): Promise<string | null>;
37
+ /**
38
+ * Securely saves a secret under a unique slot identifier.
39
+ */
40
+ setSecret(slotId: string, secret: string): Promise<void>;
41
+ /**
42
+ * Deletes a secret by its slot identifier.
43
+ */
44
+ deleteSecret(slotId: string): Promise<void>;
45
+ }
46
+ /**
47
+ * Service providing clocks for request timeouts and execution timing telemetry.
48
+ */
49
+ export interface ClockService {
50
+ /**
51
+ * Returns current UNIX timestamp in milliseconds.
52
+ */
53
+ now(): number;
54
+ /**
55
+ * Returns monotonic high-resolution time in milliseconds.
56
+ */
57
+ monotonicNow?(): number;
58
+ }
59
+ export type { HttpRequest, HttpResponse, TelemetryEvent } from "./generated/index.js";
60
+ /**
61
+ * HttpClient service for cloud provider communication.
62
+ */
63
+ export interface HttpClientService {
64
+ /**
65
+ * Dispatches a normalized HTTP request and returns the normalized response.
66
+ * @param request - Configuration options for the HTTP request.
67
+ */
68
+ send(request: HttpRequest): Promise<HttpResponse>;
69
+ }
70
+ export type TelemetryEventType = TelemetryEvent["type"];
71
+ /**
72
+ * Telemetry service listener hook interface.
73
+ */
74
+ export interface TelemetryService {
75
+ /**
76
+ * Emits a telemetry event.
77
+ * @param event - The generated telemetry event.
78
+ */
79
+ emit(event: TelemetryEvent): void;
80
+ }
81
+ /**
82
+ * Registry of platform-specific host services utilized by the Engine Core.
83
+ * Evaluates execution capabilities and manages OS-level boundaries.
84
+ */
85
+ export interface HostServices {
86
+ /**
87
+ * Network connectivity service.
88
+ */
89
+ connectivity: ConnectivityService;
90
+ /**
91
+ * Device constraints service.
92
+ */
93
+ deviceConstraints?: DeviceConstraintsService;
94
+ /**
95
+ * Secure storage service.
96
+ */
97
+ secureStorage?: SecureStorageService;
98
+ /**
99
+ * Clock service.
100
+ */
101
+ clock?: ClockService;
102
+ /**
103
+ * HTTP Client service for performing network requests.
104
+ */
105
+ httpClient?: HttpClientService;
106
+ /**
107
+ * Telemetry service to monitor execution steps, latency, and success rates.
108
+ */
109
+ telemetry?: TelemetryService;
110
+ }
111
+ //# sourceMappingURL=host.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"host.d.ts","sourceRoot":"","sources":["../src/host.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtF;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,QAAQ,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;CAC9B;AAED;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,GAAG,UAAU,CAAC;AAEvE;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC;;OAEG;IACH,eAAe,CAAC,IAAI,OAAO,CAAC,YAAY,CAAC,CAAC;IAC1C;;OAEG;IACH,qBAAqB,CAAC,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;CAC5C;AAED;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAClD;;OAEG;IACH,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACzD;;OAEG;IACH,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC7C;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B;;OAEG;IACH,GAAG,IAAI,MAAM,CAAC;IACd;;OAEG;IACH,YAAY,CAAC,IAAI,MAAM,CAAC;CACzB;AAED,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtF;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC;;;OAGG;IACH,IAAI,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;CACnD;AAED,MAAM,MAAM,kBAAkB,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC;AAExD;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;OAGG;IACH,IAAI,CAAC,KAAK,EAAE,cAAc,GAAG,IAAI,CAAC;CACnC;AAED;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B;;OAEG;IACH,YAAY,EAAE,mBAAmB,CAAC;IAClC;;OAEG;IACH,iBAAiB,CAAC,EAAE,wBAAwB,CAAC;IAC7C;;OAEG;IACH,aAAa,CAAC,EAAE,oBAAoB,CAAC;IACrC;;OAEG;IACH,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB;;OAEG;IACH,UAAU,CAAC,EAAE,iBAAiB,CAAC;IAC/B;;OAEG;IACH,SAAS,CAAC,EAAE,gBAAgB,CAAC;CAC9B"}
package/dist/host.js ADDED
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,6 @@
1
+ export type * from "./generated/index.js";
2
+ export { httpRequestSchema, httpResponseSchema, inderunErrorSchema, routePlanSchema, routePlannerInputSchema, taskRequestSchema, taskResultSchema, telemetryEventSchema } from "./generated/index.js";
3
+ export { getHttpRequestValidationIssues, getHttpResponseValidationIssues, getIndeRunErrorValidationIssues, getRoutePlanValidationIssues, getRoutePlannerInputValidationIssues, getTaskRequestValidationIssues, getTaskResultValidationIssues, getTelemetryEventValidationIssues, validateHttpRequest, validateHttpResponse, validateIndeRunError, validateRoutePlan, validateRoutePlannerInput, validateTaskRequest, validateTaskResult, validateTelemetryEvent, type ValidationIssue } from "./validators.js";
4
+ export type { FinishReason, IndeRunErrorClass, SchemaVersion, SharedRoutePlan, SharedRoutePlannerInput, TaskKind, RoutingConstraints, RoutingPreferences } from "./types.js";
5
+ export type { ConnectivityService, ThermalState, DeviceConstraintsService, SecureStorageService, ClockService, HttpClientService, TelemetryEventType, TelemetryService, HostServices } from "./host.js";
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,mBAAmB,sBAAsB,CAAC;AAC1C,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,eAAe,EACf,uBAAuB,EACvB,iBAAiB,EACjB,gBAAgB,EAChB,oBAAoB,EACrB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,8BAA8B,EAC9B,+BAA+B,EAC/B,+BAA+B,EAC/B,4BAA4B,EAC5B,oCAAoC,EACpC,8BAA8B,EAC9B,6BAA6B,EAC7B,iCAAiC,EACjC,mBAAmB,EACnB,oBAAoB,EACpB,oBAAoB,EACpB,iBAAiB,EACjB,yBAAyB,EACzB,mBAAmB,EACnB,kBAAkB,EAClB,sBAAsB,EACtB,KAAK,eAAe,EACrB,MAAM,iBAAiB,CAAC;AACzB,YAAY,EACV,YAAY,EACZ,iBAAiB,EACjB,aAAa,EACb,eAAe,EACf,uBAAuB,EACvB,QAAQ,EACR,kBAAkB,EAClB,kBAAkB,EACnB,MAAM,YAAY,CAAC;AAEpB,YAAY,EACV,mBAAmB,EACnB,YAAY,EACZ,wBAAwB,EACxB,oBAAoB,EACpB,YAAY,EACZ,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,EAChB,YAAY,EACb,MAAM,WAAW,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,2 @@
1
+ export { httpRequestSchema, httpResponseSchema, inderunErrorSchema, routePlanSchema, routePlannerInputSchema, taskRequestSchema, taskResultSchema, telemetryEventSchema } from "./generated/index.js";
2
+ export { getHttpRequestValidationIssues, getHttpResponseValidationIssues, getIndeRunErrorValidationIssues, getRoutePlanValidationIssues, getRoutePlannerInputValidationIssues, getTaskRequestValidationIssues, getTaskResultValidationIssues, getTelemetryEventValidationIssues, validateHttpRequest, validateHttpResponse, validateIndeRunError, validateRoutePlan, validateRoutePlannerInput, validateTaskRequest, validateTaskResult, validateTelemetryEvent } from "./validators.js";
@@ -0,0 +1,18 @@
1
+ import type { IndeRunError, RoutePlan, RoutePlannerInput, TaskRequest, TaskResult } from "./generated/index.js";
2
+ /** Contract schema version (e.g. `"1.0"`) carried by every task request. */
3
+ export type SchemaVersion = TaskRequest["schemaVersion"];
4
+ /** Supported task kinds (currently `"text_to_text"`). */
5
+ export type TaskKind = TaskRequest["task"]["kind"];
6
+ /** Normalized reason a task finished (e.g. `stop`, `length`, `error`). */
7
+ export type FinishReason = TaskResult["finishReason"];
8
+ /** The shared error taxonomy value carried on `IndeRunError`. */
9
+ export type IndeRunErrorClass = IndeRunError["errorClass"];
10
+ /** Input schema consumed by the shared (Rust/WASM) route planner. */
11
+ export type SharedRoutePlannerInput = RoutePlannerInput;
12
+ /** Route plan produced by the shared route planner. */
13
+ export type SharedRoutePlan = RoutePlan;
14
+ /** Routing constraints (cloud/privacy/timeout) from a task request. */
15
+ export type RoutingConstraints = NonNullable<TaskRequest["constraints"]>;
16
+ /** Routing preferences (e.g. `optimizeFor`) from a task request. */
17
+ export type RoutingPreferences = NonNullable<TaskRequest["preferences"]>;
18
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,SAAS,EACT,iBAAiB,EACjB,WAAW,EACX,UAAU,EACX,MAAM,sBAAsB,CAAC;AAK9B,4EAA4E;AAC5E,MAAM,MAAM,aAAa,GAAG,WAAW,CAAC,eAAe,CAAC,CAAC;AACzD,yDAAyD;AACzD,MAAM,MAAM,QAAQ,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC;AACnD,0EAA0E;AAC1E,MAAM,MAAM,YAAY,GAAG,UAAU,CAAC,cAAc,CAAC,CAAC;AACtD,iEAAiE;AACjE,MAAM,MAAM,iBAAiB,GAAG,YAAY,CAAC,YAAY,CAAC,CAAC;AAC3D,qEAAqE;AACrE,MAAM,MAAM,uBAAuB,GAAG,iBAAiB,CAAC;AACxD,uDAAuD;AACvD,MAAM,MAAM,eAAe,GAAG,SAAS,CAAC;AACxC,uEAAuE;AACvE,MAAM,MAAM,kBAAkB,GAAG,WAAW,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC,CAAC;AACzE,oEAAoE;AACpE,MAAM,MAAM,kBAAkB,GAAG,WAAW,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC,CAAC"}
package/dist/types.js ADDED
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,30 @@
1
+ import type { IndeRunError } from "./generated/inderun-error.js";
2
+ import type { HttpRequest } from "./generated/http-request.js";
3
+ import type { HttpResponse } from "./generated/http-response.js";
4
+ import type { RoutePlan } from "./generated/route-plan.js";
5
+ import type { RoutePlannerInput } from "./generated/route-planner-input.js";
6
+ import type { TaskRequest } from "./generated/task-request.js";
7
+ import type { TaskResult } from "./generated/task-result.js";
8
+ import type { TelemetryEvent } from "./generated/telemetry-event.js";
9
+ export type ValidationIssue = {
10
+ path: string;
11
+ message: string;
12
+ keyword?: string;
13
+ };
14
+ export declare function validateTaskRequest(value: unknown): value is TaskRequest;
15
+ export declare function validateTaskResult(value: unknown): value is TaskResult;
16
+ export declare function validateIndeRunError(value: unknown): value is IndeRunError;
17
+ export declare function validateHttpRequest(value: unknown): value is HttpRequest;
18
+ export declare function validateHttpResponse(value: unknown): value is HttpResponse;
19
+ export declare function validateTelemetryEvent(value: unknown): value is TelemetryEvent;
20
+ export declare function validateRoutePlannerInput(value: unknown): value is RoutePlannerInput;
21
+ export declare function validateRoutePlan(value: unknown): value is RoutePlan;
22
+ export declare function getTaskRequestValidationIssues(value: unknown): ValidationIssue[];
23
+ export declare function getTaskResultValidationIssues(value: unknown): ValidationIssue[];
24
+ export declare function getIndeRunErrorValidationIssues(value: unknown): ValidationIssue[];
25
+ export declare function getHttpRequestValidationIssues(value: unknown): ValidationIssue[];
26
+ export declare function getHttpResponseValidationIssues(value: unknown): ValidationIssue[];
27
+ export declare function getTelemetryEventValidationIssues(value: unknown): ValidationIssue[];
28
+ export declare function getRoutePlannerInputValidationIssues(value: unknown): ValidationIssue[];
29
+ export declare function getRoutePlanValidationIssues(value: unknown): ValidationIssue[];
30
+ //# sourceMappingURL=validators.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validators.d.ts","sourceRoot":"","sources":["../src/validators.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AAW5E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,KAAK,E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