@independo/inderun-contracts 0.3.0-dev.9 → 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.
@@ -0,0 +1,78 @@
1
+ /* This file was generated from JSON Schema using quicktype. Do not edit by hand. */
2
+
3
+ /**
4
+ * Deterministic shared-core Mode-1 route planning result.
5
+ */
6
+ export type RoutePlan = {
7
+ /**
8
+ * Eligible candidates in deterministic order.
9
+ */
10
+ candidates: Candidate[];
11
+ /**
12
+ * Human-readable selection or failure explanation suitable for telemetry/debugging.
13
+ */
14
+ explanation: Explanation;
15
+ /**
16
+ * Normalized routing failure class when no provider is selected.
17
+ */
18
+ failureCode?: FailureCode;
19
+ /**
20
+ * Fallback provider IDs ordered after the primary selection.
21
+ */
22
+ fallbackProviderIds: string[];
23
+ /**
24
+ * Providers filtered out during planning together with machine-readable reasons.
25
+ */
26
+ rejectedProviders: RejectedProvider[];
27
+ /**
28
+ * Chosen primary provider ID, if any.
29
+ */
30
+ selectedProviderId?: string;
31
+ [property: string]: unknown;
32
+ }
33
+
34
+ export type Candidate = {
35
+ order: number;
36
+ providerId: string;
37
+ [property: string]: unknown;
38
+ }
39
+
40
+ /**
41
+ * Human-readable selection or failure explanation suitable for telemetry/debugging.
42
+ */
43
+ export type Explanation = {
44
+ selectedProviderId?: string;
45
+ summary: string;
46
+ [property: string]: unknown;
47
+ }
48
+
49
+ /**
50
+ * Normalized routing failure class when no provider is selected.
51
+ */
52
+ export type FailureCode = "capability_mismatch" | "offline" | "unavailable";
53
+
54
+ export type RejectedProvider = {
55
+ providerId: string;
56
+ reasons: Reason[];
57
+ [property: string]: unknown;
58
+ }
59
+
60
+ export type Reason = {
61
+ /**
62
+ * Normalized rejection reason. 'streaming_not_supported' means the descriptor does not
63
+ * statically declare Mode-2 streaming; 'streaming_unavailable' means it declares streaming
64
+ * but the dynamic capability snapshot reports it cannot stream in the current host
65
+ * environment.
66
+ */
67
+ code: Code;
68
+ message: string;
69
+ [property: string]: unknown;
70
+ }
71
+
72
+ /**
73
+ * Normalized rejection reason. 'streaming_not_supported' means the descriptor does not
74
+ * statically declare Mode-2 streaming; 'streaming_unavailable' means it declares streaming
75
+ * but the dynamic capability snapshot reports it cannot stream in the current host
76
+ * environment.
77
+ */
78
+ export type Code = "task_not_supported" | "run_not_supported" | "streaming_not_supported" | "streaming_unavailable" | "privacy_constraint" | "cloud_constraint" | "offline" | "capability_unavailable";
@@ -0,0 +1,161 @@
1
+ /* This file was generated from JSON Schema using quicktype. Do not edit by hand. */
2
+
3
+ /**
4
+ * Pure data input contract for deterministic shared-core route planning.
5
+ */
6
+ export type RoutePlannerInput = {
7
+ /**
8
+ * Hard routing constraints evaluated before provider selection.
9
+ */
10
+ constraints: Constraints;
11
+ /**
12
+ * Interaction mode the caller is requesting. Absent means 'run' (Mode 1), so planner inputs
13
+ * produced before this field existed keep their exact Mode-1 semantics. The mode filters
14
+ * eligible providers; it never changes candidate ordering.
15
+ */
16
+ interactionMode?: InteractionMode;
17
+ /**
18
+ * Soft route ordering preferences applied after hard filtering.
19
+ */
20
+ preferences: Preferences;
21
+ /**
22
+ * Static descriptors plus dynamic capability snapshots for planning.
23
+ */
24
+ providers: Provider[];
25
+ /**
26
+ * Minimal task descriptor for provider task matching.
27
+ */
28
+ task: Task;
29
+ [property: string]: unknown;
30
+ }
31
+
32
+ /**
33
+ * Hard routing constraints evaluated before provider selection.
34
+ */
35
+ export type Constraints = {
36
+ /**
37
+ * Cloud execution constraint.
38
+ */
39
+ cloud?: Cloud;
40
+ /**
41
+ * Current connectivity snapshot used for cloud route planning.
42
+ */
43
+ networkOnline?: boolean;
44
+ /**
45
+ * Privacy requirement or preference for execution placement.
46
+ */
47
+ privacy?: PrivacyEnum;
48
+ [property: string]: unknown;
49
+ }
50
+
51
+ /**
52
+ * Cloud execution constraint.
53
+ */
54
+ export type Cloud = "forbidden" | "allowed" | "required";
55
+
56
+ /**
57
+ * Privacy requirement or preference for execution placement.
58
+ */
59
+ export type PrivacyEnum = "local_required" | "local_preferred" | "cloud_allowed" | "cloud_required";
60
+
61
+ /**
62
+ * Interaction mode the caller is requesting. Absent means 'run' (Mode 1), so planner inputs
63
+ * produced before this field existed keep their exact Mode-1 semantics. The mode filters
64
+ * eligible providers; it never changes candidate ordering.
65
+ */
66
+ export type InteractionMode = "run" | "stream";
67
+
68
+ /**
69
+ * Soft route ordering preferences applied after hard filtering.
70
+ */
71
+ export type Preferences = {
72
+ /**
73
+ * Primary optimization goal when multiple providers remain eligible.
74
+ */
75
+ optimizeFor?: OptimizeFor;
76
+ [property: string]: unknown;
77
+ }
78
+
79
+ /**
80
+ * Primary optimization goal when multiple providers remain eligible.
81
+ */
82
+ export type OptimizeFor = "privacy" | "latency" | "cost" | "balanced";
83
+
84
+ export type Provider = {
85
+ capabilities: Capabilities;
86
+ descriptor: Descriptor;
87
+ [property: string]: unknown;
88
+ }
89
+
90
+ export type Capabilities = {
91
+ available: boolean;
92
+ /**
93
+ * Whether cancellation is honored right now in this host environment. Absent inherits the
94
+ * static descriptor.cancel value (any value other than 'none' means available).
95
+ */
96
+ cancellationAvailable?: boolean;
97
+ reason?: string;
98
+ /**
99
+ * Whether the provider can stream right now in this host environment. Absent inherits the
100
+ * static descriptor.supports.streaming value.
101
+ */
102
+ streamingAvailable?: boolean;
103
+ /**
104
+ * Human-readable explanation used when streamingAvailable is false. Absent lets the planner
105
+ * synthesize a default message.
106
+ */
107
+ streamingUnavailableReason?: string;
108
+ [property: string]: unknown;
109
+ }
110
+
111
+ export type Descriptor = {
112
+ /**
113
+ * Cancellation guarantee the provider offers. Carried for route explanations and telemetry;
114
+ * the planner does not filter on it.
115
+ */
116
+ cancel?: Cancel;
117
+ id: string;
118
+ /**
119
+ * Descriptor privacy metadata used to enforce local/cloud routing rules.
120
+ */
121
+ privacy?: PrivacyObject;
122
+ supports: Supports;
123
+ tasks: string[];
124
+ type: Type;
125
+ [property: string]: unknown;
126
+ }
127
+
128
+ /**
129
+ * Cancellation guarantee the provider offers. Carried for route explanations and telemetry;
130
+ * the planner does not filter on it.
131
+ */
132
+ export type Cancel = "hard" | "soft" | "none";
133
+
134
+ /**
135
+ * Descriptor privacy metadata used to enforce local/cloud routing rules.
136
+ */
137
+ export type PrivacyObject = {
138
+ dataLeavesDevice: boolean;
139
+ regions?: string[];
140
+ [property: string]: unknown;
141
+ }
142
+
143
+ export type Supports = {
144
+ run: boolean;
145
+ /**
146
+ * Whether the provider statically declares Mode-2 streaming. Absent is treated as false: a
147
+ * descriptor that predates this field cannot be assumed to stream.
148
+ */
149
+ streaming?: boolean;
150
+ [property: string]: unknown;
151
+ }
152
+
153
+ export type Type = "local" | "edge" | "cloud";
154
+
155
+ /**
156
+ * Minimal task descriptor for provider task matching.
157
+ */
158
+ export type Task = {
159
+ kind: string;
160
+ [property: string]: unknown;
161
+ }