@termwright/protocol 0.2.0 → 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.
- package/README.md +213 -605
- package/dist/action-model-BP9Znu6L.d.ts +219 -0
- package/dist/action-model.d.ts +3 -0
- package/dist/action-model.js +15 -0
- package/dist/action-model.js.map +1 -0
- package/dist/capability-graph.d.ts +90 -0
- package/dist/capability-graph.js +43 -0
- package/dist/capability-graph.js.map +1 -0
- package/dist/chunk-B4VUTTUE.js +59 -0
- package/dist/chunk-B4VUTTUE.js.map +1 -0
- package/dist/chunk-CZK6NNP3.js +389 -0
- package/dist/chunk-CZK6NNP3.js.map +1 -0
- package/dist/chunk-ODOJRXL6.js +84 -0
- package/dist/chunk-ODOJRXL6.js.map +1 -0
- package/dist/chunk-PUXRCPGY.js +112 -0
- package/dist/chunk-PUXRCPGY.js.map +1 -0
- package/dist/chunk-VBLS6E6U.js +1109 -0
- package/dist/chunk-VBLS6E6U.js.map +1 -0
- package/dist/chunk-ZZIYHDJ4.js +202 -0
- package/dist/chunk-ZZIYHDJ4.js.map +1 -0
- package/dist/contract-CH9gmj2Y.d.ts +746 -0
- package/dist/contract.d.ts +2 -0
- package/dist/contract.js +21 -0
- package/dist/contract.js.map +1 -0
- package/dist/index.d.ts +82 -798
- package/dist/index.js +1087 -766
- package/dist/index.js.map +1 -1
- package/dist/run-events.d.ts +158 -0
- package/dist/run-events.js +27 -0
- package/dist/run-events.js.map +1 -0
- package/dist/run-journal.d.ts +55 -0
- package/dist/run-journal.js +10 -0
- package/dist/run-journal.js.map +1 -0
- package/dist/run-state.d.ts +38 -0
- package/dist/run-state.js +19 -0
- package/dist/run-state.js.map +1 -0
- package/dist/test-provider.d.ts +22 -0
- package/dist/test-provider.js +32 -0
- package/dist/test-provider.js.map +1 -0
- package/package.json +33 -5
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
import { b as SemanticSnapshot, n as ObservationStamp, O as Observation, R as Rect, j as EvidenceProvenance } from './contract-CH9gmj2Y.js';
|
|
2
|
+
import './capability-graph.js';
|
|
3
|
+
|
|
4
|
+
/** Policy applied when runtime values cross an artifact/publication boundary. */
|
|
5
|
+
declare const ARTIFACT_VALUE_POLICIES: readonly ["none", "redacted", "raw"];
|
|
6
|
+
type ArtifactValuePolicy = (typeof ARTIFACT_VALUE_POLICIES)[number];
|
|
7
|
+
/** Secure default. Recording raw input must always be an explicit choice. */
|
|
8
|
+
declare const DEFAULT_ARTIFACT_VALUE_POLICY: ArtifactValuePolicy;
|
|
9
|
+
type ValueSensitivity = 'public' | 'sensitive';
|
|
10
|
+
/** Explicit wrapper for values which must not enter artifacts by default. */
|
|
11
|
+
interface SensitiveValue {
|
|
12
|
+
readonly sensitivity: 'sensitive';
|
|
13
|
+
readonly value: string;
|
|
14
|
+
}
|
|
15
|
+
interface PublicValue {
|
|
16
|
+
readonly sensitivity: 'public';
|
|
17
|
+
readonly value: string;
|
|
18
|
+
}
|
|
19
|
+
/** Plain strings remain executable but are conservatively sensitive at artifact boundaries. */
|
|
20
|
+
type ExecutableValue = string | PublicValue | SensitiveValue;
|
|
21
|
+
type RecordedValue = {
|
|
22
|
+
readonly status: 'known';
|
|
23
|
+
readonly value: string;
|
|
24
|
+
readonly sensitivity: ValueSensitivity;
|
|
25
|
+
} | {
|
|
26
|
+
readonly status: 'withheld';
|
|
27
|
+
readonly reason: 'artifact-policy';
|
|
28
|
+
readonly sensitivity: ValueSensitivity | 'unknown';
|
|
29
|
+
};
|
|
30
|
+
declare function sensitive(value: string): SensitiveValue;
|
|
31
|
+
declare function publicValue(value: string): PublicValue;
|
|
32
|
+
declare function executableText(value: ExecutableValue): string;
|
|
33
|
+
declare function valueSensitivity(value: ExecutableValue): ValueSensitivity;
|
|
34
|
+
declare function recordValue(value: ExecutableValue, policy: ArtifactValuePolicy): RecordedValue;
|
|
35
|
+
declare function projectSemanticSnapshotForArtifact(snapshot: SemanticSnapshot, policy?: ArtifactValuePolicy): SemanticSnapshot;
|
|
36
|
+
|
|
37
|
+
type LocatorDomain = 'semantic' | 'screen';
|
|
38
|
+
type SemanticLocatorRef = `semantic:${string}@${number}`;
|
|
39
|
+
type ScreenLocatorRef = `screen:${number},${number},${number},${number}@${number}`;
|
|
40
|
+
type LocatorRef = SemanticLocatorRef | ScreenLocatorRef;
|
|
41
|
+
type ConditionTextMatcher = {
|
|
42
|
+
readonly kind: 'exact' | 'substring';
|
|
43
|
+
readonly text: string;
|
|
44
|
+
} | {
|
|
45
|
+
readonly kind: 'regex';
|
|
46
|
+
readonly source: string;
|
|
47
|
+
readonly flags: string;
|
|
48
|
+
};
|
|
49
|
+
type Condition = {
|
|
50
|
+
readonly kind: 'attached';
|
|
51
|
+
readonly target: string;
|
|
52
|
+
} | {
|
|
53
|
+
readonly kind: 'detached';
|
|
54
|
+
readonly target: string;
|
|
55
|
+
} | {
|
|
56
|
+
readonly kind: 'displayed';
|
|
57
|
+
readonly target: string;
|
|
58
|
+
} | {
|
|
59
|
+
readonly kind: 'hidden';
|
|
60
|
+
readonly target: string;
|
|
61
|
+
} | {
|
|
62
|
+
readonly kind: 'visible';
|
|
63
|
+
readonly target: string;
|
|
64
|
+
} | {
|
|
65
|
+
readonly kind: 'in-viewport';
|
|
66
|
+
readonly target: string;
|
|
67
|
+
readonly minRatio: number;
|
|
68
|
+
} | {
|
|
69
|
+
readonly kind: 'offscreen';
|
|
70
|
+
readonly target: string;
|
|
71
|
+
} | {
|
|
72
|
+
readonly kind: 'receives-pointer';
|
|
73
|
+
readonly target: string;
|
|
74
|
+
} | {
|
|
75
|
+
readonly kind: 'pointer-region';
|
|
76
|
+
readonly target: string;
|
|
77
|
+
} | {
|
|
78
|
+
readonly kind: 'pointer-input';
|
|
79
|
+
readonly target: string;
|
|
80
|
+
} | {
|
|
81
|
+
readonly kind: 'mouse-input-enabled';
|
|
82
|
+
readonly target: string;
|
|
83
|
+
} | {
|
|
84
|
+
readonly kind: 'enabled';
|
|
85
|
+
readonly target: string;
|
|
86
|
+
} | {
|
|
87
|
+
readonly kind: 'disabled';
|
|
88
|
+
readonly target: string;
|
|
89
|
+
} | {
|
|
90
|
+
readonly kind: 'focused';
|
|
91
|
+
readonly target: string;
|
|
92
|
+
} | {
|
|
93
|
+
readonly kind: 'checked';
|
|
94
|
+
readonly target: string;
|
|
95
|
+
readonly value: boolean;
|
|
96
|
+
} | {
|
|
97
|
+
readonly kind: 'selected';
|
|
98
|
+
readonly target: string;
|
|
99
|
+
readonly value: boolean;
|
|
100
|
+
} | {
|
|
101
|
+
readonly kind: 'expanded';
|
|
102
|
+
readonly target: string;
|
|
103
|
+
readonly value: boolean;
|
|
104
|
+
} | {
|
|
105
|
+
readonly kind: 'collapsed';
|
|
106
|
+
readonly target: string;
|
|
107
|
+
} | {
|
|
108
|
+
readonly kind: 'value';
|
|
109
|
+
readonly target: string;
|
|
110
|
+
readonly matcher: ConditionTextMatcher;
|
|
111
|
+
} | {
|
|
112
|
+
readonly kind: 'not';
|
|
113
|
+
readonly condition: Condition;
|
|
114
|
+
} | {
|
|
115
|
+
readonly kind: 'all' | 'any';
|
|
116
|
+
readonly conditions: readonly Condition[];
|
|
117
|
+
};
|
|
118
|
+
type ScreenLeafCondition = Extract<Condition, {
|
|
119
|
+
readonly kind: 'attached' | 'detached' | 'displayed' | 'hidden' | 'visible' | 'in-viewport' | 'offscreen' | 'receives-pointer' | 'pointer-region' | 'pointer-input' | 'mouse-input-enabled';
|
|
120
|
+
}>;
|
|
121
|
+
type ScreenCondition = ScreenLeafCondition | {
|
|
122
|
+
readonly kind: 'not';
|
|
123
|
+
readonly condition: ScreenCondition;
|
|
124
|
+
} | {
|
|
125
|
+
readonly kind: 'all' | 'any';
|
|
126
|
+
readonly conditions: readonly ScreenCondition[];
|
|
127
|
+
};
|
|
128
|
+
interface ConditionResult {
|
|
129
|
+
readonly condition: Condition;
|
|
130
|
+
readonly checkpoint: ObservationStamp;
|
|
131
|
+
readonly observation: Observation<boolean>;
|
|
132
|
+
readonly verdict: 'satisfied' | 'unsatisfied' | 'inconclusive';
|
|
133
|
+
}
|
|
134
|
+
/** A disjoint physical region represented as canonical, non-overlapping row spans. */
|
|
135
|
+
interface PhysicalRegion {
|
|
136
|
+
readonly checkpoint: ObservationStamp;
|
|
137
|
+
readonly coordinateSpace: 'viewport-cells';
|
|
138
|
+
readonly intendedRect: Rect;
|
|
139
|
+
readonly spans: readonly {
|
|
140
|
+
readonly row: number;
|
|
141
|
+
readonly from: number;
|
|
142
|
+
readonly to: number;
|
|
143
|
+
}[];
|
|
144
|
+
readonly evidence: EvidenceProvenance;
|
|
145
|
+
}
|
|
146
|
+
type ActionKind = 'click' | 'double-click' | 'hover' | 'drag' | 'focus' | 'activate' | 'press' | 'type' | 'paste' | 'fill' | 'check' | 'uncheck' | 'wheel' | 'shell-command' | 'resize';
|
|
147
|
+
interface ActionIntent {
|
|
148
|
+
readonly kind: ActionKind;
|
|
149
|
+
readonly selector?: string;
|
|
150
|
+
readonly targetRef?: LocatorRef;
|
|
151
|
+
}
|
|
152
|
+
type ExecutableDeviceOperation = {
|
|
153
|
+
readonly device: 'keyboard';
|
|
154
|
+
readonly kind: 'press' | 'type' | 'paste';
|
|
155
|
+
readonly value: ExecutableValue;
|
|
156
|
+
} | {
|
|
157
|
+
readonly device: 'mouse';
|
|
158
|
+
readonly kind: 'move' | 'down' | 'up' | 'wheel';
|
|
159
|
+
readonly row: number;
|
|
160
|
+
readonly column: number;
|
|
161
|
+
readonly button?: 'left' | 'middle' | 'right';
|
|
162
|
+
readonly modifiers?: readonly ('shift' | 'alt' | 'control')[];
|
|
163
|
+
readonly deltaX?: number;
|
|
164
|
+
readonly deltaY?: number;
|
|
165
|
+
};
|
|
166
|
+
type RecordedDeviceOperation = {
|
|
167
|
+
readonly device: 'keyboard';
|
|
168
|
+
readonly kind: 'press' | 'type' | 'paste';
|
|
169
|
+
readonly value: RecordedValue;
|
|
170
|
+
} | Exclude<ExecutableDeviceOperation, {
|
|
171
|
+
readonly device: 'keyboard';
|
|
172
|
+
}>;
|
|
173
|
+
/** Runtime-only plan. It must be projected before crossing an artifact boundary. */
|
|
174
|
+
interface ExecutableActionPlan {
|
|
175
|
+
readonly actionId: string;
|
|
176
|
+
readonly contractId: string;
|
|
177
|
+
readonly intent: ActionIntent;
|
|
178
|
+
readonly checkpoint: ObservationStamp;
|
|
179
|
+
readonly requirements: readonly ConditionResult[];
|
|
180
|
+
readonly strategy: string;
|
|
181
|
+
readonly physicalRegion?: PhysicalRegion;
|
|
182
|
+
readonly operations: readonly ExecutableDeviceOperation[];
|
|
183
|
+
}
|
|
184
|
+
interface ActionPlan {
|
|
185
|
+
readonly actionId: string;
|
|
186
|
+
readonly contractId: string;
|
|
187
|
+
readonly intent: ActionIntent;
|
|
188
|
+
readonly checkpoint: ObservationStamp;
|
|
189
|
+
readonly requirements: readonly ConditionResult[];
|
|
190
|
+
readonly strategy: string;
|
|
191
|
+
readonly physicalRegion?: PhysicalRegion;
|
|
192
|
+
readonly operations: readonly RecordedDeviceOperation[];
|
|
193
|
+
readonly valuePolicy: ArtifactValuePolicy;
|
|
194
|
+
}
|
|
195
|
+
interface ActionabilityExplanation {
|
|
196
|
+
readonly actionable: boolean;
|
|
197
|
+
readonly intent: ActionIntent;
|
|
198
|
+
readonly checkpoint: ObservationStamp;
|
|
199
|
+
readonly requirements: readonly ConditionResult[];
|
|
200
|
+
readonly strategy?: string;
|
|
201
|
+
readonly reason?: {
|
|
202
|
+
readonly code: string;
|
|
203
|
+
readonly message: string;
|
|
204
|
+
readonly targetRef?: LocatorRef;
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
interface ActionReceipt {
|
|
208
|
+
readonly intent: ActionIntent;
|
|
209
|
+
readonly plan: ActionPlan;
|
|
210
|
+
readonly before: ObservationStamp;
|
|
211
|
+
readonly after: ObservationStamp;
|
|
212
|
+
readonly executed: readonly RecordedDeviceOperation[];
|
|
213
|
+
readonly outcome: 'completed' | 'partial' | 'failed';
|
|
214
|
+
}
|
|
215
|
+
declare function recordDeviceOperation(operation: ExecutableDeviceOperation, policy: ArtifactValuePolicy): RecordedDeviceOperation;
|
|
216
|
+
declare function recordActionPlan(plan: ExecutableActionPlan, policy: ArtifactValuePolicy): ActionPlan;
|
|
217
|
+
declare function projectActionReceiptForArtifact(receipt: ActionReceipt, policy: ArtifactValuePolicy): ActionReceipt;
|
|
218
|
+
|
|
219
|
+
export { ARTIFACT_VALUE_POLICIES as A, type Condition as C, DEFAULT_ARTIFACT_VALUE_POLICY as D, type ExecutableActionPlan as E, type LocatorDomain as L, type PhysicalRegion as P, type RecordedDeviceOperation as R, type ScreenCondition as S, type ValueSensitivity as V, type ActionIntent as a, type ActionKind as b, type ActionPlan as c, type ActionReceipt as d, type ActionabilityExplanation as e, type ArtifactValuePolicy as f, type ConditionResult as g, type ConditionTextMatcher as h, type ExecutableDeviceOperation as i, type ExecutableValue as j, type LocatorRef as k, type PublicValue as l, type RecordedValue as m, type ScreenLeafCondition as n, type ScreenLocatorRef as o, type SemanticLocatorRef as p, type SensitiveValue as q, executableText as r, projectActionReceiptForArtifact as s, projectSemanticSnapshotForArtifact as t, publicValue as u, recordActionPlan as v, recordDeviceOperation as w, recordValue as x, sensitive as y, valueSensitivity as z };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import './contract-CH9gmj2Y.js';
|
|
2
|
+
export { a as ActionIntent, b as ActionKind, c as ActionPlan, d as ActionReceipt, e as ActionabilityExplanation, C as Condition, g as ConditionResult, h as ConditionTextMatcher, E as ExecutableActionPlan, i as ExecutableDeviceOperation, L as LocatorDomain, k as LocatorRef, P as PhysicalRegion, R as RecordedDeviceOperation, S as ScreenCondition, n as ScreenLeafCondition, o as ScreenLocatorRef, p as SemanticLocatorRef, s as projectActionReceiptForArtifact, v as recordActionPlan, w as recordDeviceOperation } from './action-model-BP9Znu6L.js';
|
|
3
|
+
export { CONDITION_KINDS, ConditionKind } from './capability-graph.js';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import {
|
|
2
|
+
projectActionReceiptForArtifact,
|
|
3
|
+
recordActionPlan,
|
|
4
|
+
recordDeviceOperation
|
|
5
|
+
} from "./chunk-PUXRCPGY.js";
|
|
6
|
+
import {
|
|
7
|
+
CONDITION_KINDS
|
|
8
|
+
} from "./chunk-VBLS6E6U.js";
|
|
9
|
+
export {
|
|
10
|
+
CONDITION_KINDS,
|
|
11
|
+
projectActionReceiptForArtifact,
|
|
12
|
+
recordActionPlan,
|
|
13
|
+
recordDeviceOperation
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=action-model.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Executable capability graph shared by certification, negotiation tooling,
|
|
3
|
+
* documentation and every public action surface.
|
|
4
|
+
*
|
|
5
|
+
* A producer declaration is not itself a public guarantee. Edges make the
|
|
6
|
+
* complete path explicit: producer fact -> frozen session evidence -> runtime
|
|
7
|
+
* prerequisite -> planning strategy/public consumer. Diagnostic facts never
|
|
8
|
+
* unlock a public API.
|
|
9
|
+
*/
|
|
10
|
+
declare const CAPABILITY_GRAPH_VERSION: 5;
|
|
11
|
+
declare const CAPABILITY_NODE_CATEGORIES: readonly ["evidence", "input", "planning", "synchronization", "diagnostic"];
|
|
12
|
+
type CapabilityNodeCategory = (typeof CAPABILITY_NODE_CATEGORIES)[number];
|
|
13
|
+
declare const CAPABILITY_NODE_LAYERS: readonly ["producer", "session", "runtime", "strategy", "public"];
|
|
14
|
+
type CapabilityNodeLayer = (typeof CAPABILITY_NODE_LAYERS)[number];
|
|
15
|
+
declare const CAPABILITY_EDGE_KINDS: readonly ["produces", "requires", "requires-any", "runtime-requires", "diagnoses"];
|
|
16
|
+
type CapabilityEdgeKind = (typeof CAPABILITY_EDGE_KINDS)[number];
|
|
17
|
+
declare const ADAPTER_CAPABILITIES: readonly ["tree", "intended-geometry", "clipped-geometry", "states", "focus-state", "actions", "action-recipes", "text-ranges", "render-revisions", "logs", "pointer-hit-grid"];
|
|
18
|
+
type AdapterCapability = (typeof ADAPTER_CAPABILITIES)[number];
|
|
19
|
+
declare const PROBE_CAPABILITIES: readonly ["stable-identity", "intended-rect", "visible-rect", "operations", "annotations", "frame-begin", "paint-order"];
|
|
20
|
+
type ProbeCapability = (typeof PROBE_CAPABILITIES)[number];
|
|
21
|
+
declare const EVIDENCE_PROVIDER_CAPABILITIES: readonly ["pointer-regions", "hit-test", "focus-state", "action-recipes", "scroll-state", "painted-regions", "terminal-input-modes"];
|
|
22
|
+
type EvidenceProviderCapability = (typeof EVIDENCE_PROVIDER_CAPABILITIES)[number];
|
|
23
|
+
declare const EVIDENCE_PROVIDER_TYPES: readonly ["pointer-evidence", "focus-evidence", "action-strategy", "scroll-evidence", "paint-evidence", "input-mode-evidence"];
|
|
24
|
+
type EvidenceProviderType = (typeof EVIDENCE_PROVIDER_TYPES)[number];
|
|
25
|
+
declare const SESSION_CAPABILITIES: readonly ["semantic-tree", "stable-identity", "intended-geometry", "clipped-geometry", "painted-region", "pointer-geometry", "pointer-hit-testing", "focus", "scroll", "render-order", "action-strategies", "keyboard-input", "pointer-input", "focus-input", "paired-revisions"];
|
|
26
|
+
type SessionCapabilityId = (typeof SESSION_CAPABILITIES)[number];
|
|
27
|
+
declare const RUNTIME_PREREQUISITES: readonly ["writable-pty", "terminal-input-modes-authoritative", "mouse-reporting-enabled", "mouse-motion-enabled", "focus-reporting-enabled", "committed-observation"];
|
|
28
|
+
type RuntimePrerequisiteId = (typeof RUNTIME_PREREQUISITES)[number];
|
|
29
|
+
declare const PUBLIC_CAPABILITY_CONSUMERS: readonly ["locator.semantic-query", "locator.semantic-scroll", "locator.painted-region", "condition.attached", "condition.displayed", "condition.visible", "condition.in-viewport", "condition.focused", "condition.value", "action.click", "action.hover", "action.drag", "action.focus", "action.activate", "action.type", "action.fill", "action.check", "action.uncheck", "device.keyboard", "device.mouse", "device.window-focus", "checkpoint", "runner.inspector", "trace.action", "recorder.semantic-action", "mcp.semantic-action", "runner.diagnostics", "trace.diagnostics"];
|
|
30
|
+
type PublicCapabilityConsumer = (typeof PUBLIC_CAPABILITY_CONSUMERS)[number];
|
|
31
|
+
declare const CAPABILITY_CONFORMANCE_CLAIMS: readonly ["claim.semantic-tree-authoritative", "claim.stable-identity-authoritative", "claim.intended-geometry-authoritative", "claim.clipped-geometry-authoritative", "claim.painted-region-authoritative", "claim.pointer-region-authoritative", "claim.pointer-hit-test-authoritative", "claim.focus-authoritative", "claim.scroll-authoritative", "claim.render-order-authoritative", "claim.action-strategy-authoritative", "claim.keyboard-real-pty", "claim.pointer-real-pty", "claim.focus-report-real-pty", "claim.paired-revisions", "claim.logs-diagnostic"];
|
|
32
|
+
type CapabilityConformanceClaimId = (typeof CAPABILITY_CONFORMANCE_CLAIMS)[number];
|
|
33
|
+
declare const CONDITION_KINDS: readonly ["attached", "detached", "displayed", "hidden", "visible", "in-viewport", "offscreen", "receives-pointer", "pointer-region", "pointer-input", "mouse-input-enabled", "enabled", "disabled", "focused", "checked", "selected", "expanded", "collapsed", "value", "not", "all", "any"];
|
|
34
|
+
type ConditionKind = (typeof CONDITION_KINDS)[number];
|
|
35
|
+
type CapabilityNodeId = `adapter.${AdapterCapability}` | `probe.${ProbeCapability}` | `provider.${EvidenceProviderCapability}` | `terminal.${'writable-pty' | 'input-modes-observable'}` | `session.${SessionCapabilityId}` | `runtime.${RuntimePrerequisiteId}` | `strategy.${'pointer-target' | 'keyboard-activate' | 'pointer-activate' | 'focus-by-pointer' | 'type-focused'}` | `public.${PublicCapabilityConsumer}` | `diagnostic.${'semantic-tree' | 'geometry' | 'render-order' | 'logs'}`;
|
|
36
|
+
interface CapabilityRemediation {
|
|
37
|
+
readonly code: 'select-certified-adapter' | 'register-application-provider' | 'enable-terminal-runtime' | 'wait-for-committed-observation' | 'no-authoritative-producer';
|
|
38
|
+
readonly message: string;
|
|
39
|
+
readonly providerType?: EvidenceProviderType;
|
|
40
|
+
readonly runtimePrerequisite?: RuntimePrerequisiteId;
|
|
41
|
+
}
|
|
42
|
+
interface CapabilityGraphNode {
|
|
43
|
+
readonly id: CapabilityNodeId;
|
|
44
|
+
readonly category: CapabilityNodeCategory;
|
|
45
|
+
readonly layer: CapabilityNodeLayer;
|
|
46
|
+
readonly description: string;
|
|
47
|
+
readonly conformanceClaims?: readonly CapabilityConformanceClaimId[];
|
|
48
|
+
readonly conditions?: readonly ConditionKind[];
|
|
49
|
+
readonly publicConsumer?: PublicCapabilityConsumer;
|
|
50
|
+
readonly remediation: CapabilityRemediation;
|
|
51
|
+
}
|
|
52
|
+
interface CapabilityGraphEdge {
|
|
53
|
+
readonly from: CapabilityNodeId;
|
|
54
|
+
readonly to: CapabilityNodeId;
|
|
55
|
+
readonly kind: CapabilityEdgeKind;
|
|
56
|
+
}
|
|
57
|
+
declare const CAPABILITY_GRAPH: Readonly<{
|
|
58
|
+
version: 5;
|
|
59
|
+
nodes: CapabilityGraphNode[];
|
|
60
|
+
edges: readonly CapabilityGraphEdge[];
|
|
61
|
+
}>;
|
|
62
|
+
interface CapabilityGraphValidationResult {
|
|
63
|
+
readonly ok: boolean;
|
|
64
|
+
readonly errors: readonly string[];
|
|
65
|
+
}
|
|
66
|
+
/** Mechanical integrity gate used by protocol and registry tests. */
|
|
67
|
+
declare function validateCapabilityGraph(): CapabilityGraphValidationResult;
|
|
68
|
+
declare function capabilityNode(id: CapabilityNodeId): CapabilityGraphNode;
|
|
69
|
+
/** Generated, deterministic remediation for a missing graph node. */
|
|
70
|
+
declare function capabilityRemediation(id: CapabilityNodeId): CapabilityRemediation;
|
|
71
|
+
interface CapabilityResolution {
|
|
72
|
+
readonly available: boolean;
|
|
73
|
+
readonly target: CapabilityNodeId;
|
|
74
|
+
readonly missing: readonly CapabilityNodeId[];
|
|
75
|
+
readonly remediation: readonly CapabilityRemediation[];
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Resolves the frozen session facts produced by an exact set of negotiated
|
|
79
|
+
* producer nodes. Only explicit `produces` edges may create a session
|
|
80
|
+
* capability; similarly named adapter facts never imply extra guarantees.
|
|
81
|
+
*/
|
|
82
|
+
declare function sessionCapabilitiesFromProducers(producers: ReadonlySet<CapabilityNodeId>): ReadonlyMap<SessionCapabilityId, readonly CapabilityNodeId[]>;
|
|
83
|
+
/**
|
|
84
|
+
* Resolve a strategy or public consumer against one already-negotiated
|
|
85
|
+
* session/runtime node set. Session nodes are leaves: producer declarations do
|
|
86
|
+
* not opportunistically unlock them after negotiation.
|
|
87
|
+
*/
|
|
88
|
+
declare function resolveCapability(target: CapabilityNodeId, available: ReadonlySet<CapabilityNodeId>): CapabilityResolution;
|
|
89
|
+
|
|
90
|
+
export { ADAPTER_CAPABILITIES, type AdapterCapability, CAPABILITY_CONFORMANCE_CLAIMS, CAPABILITY_EDGE_KINDS, CAPABILITY_GRAPH, CAPABILITY_GRAPH_VERSION, CAPABILITY_NODE_CATEGORIES, CAPABILITY_NODE_LAYERS, CONDITION_KINDS, type CapabilityConformanceClaimId, type CapabilityEdgeKind, type CapabilityGraphEdge, type CapabilityGraphNode, type CapabilityGraphValidationResult, type CapabilityNodeCategory, type CapabilityNodeId, type CapabilityNodeLayer, type CapabilityRemediation, type CapabilityResolution, type ConditionKind, EVIDENCE_PROVIDER_CAPABILITIES, EVIDENCE_PROVIDER_TYPES, type EvidenceProviderCapability, type EvidenceProviderType, PROBE_CAPABILITIES, PUBLIC_CAPABILITY_CONSUMERS, type ProbeCapability, type PublicCapabilityConsumer, RUNTIME_PREREQUISITES, type RuntimePrerequisiteId, SESSION_CAPABILITIES, type SessionCapabilityId, capabilityNode, capabilityRemediation, resolveCapability, sessionCapabilitiesFromProducers, validateCapabilityGraph };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ADAPTER_CAPABILITIES,
|
|
3
|
+
CAPABILITY_CONFORMANCE_CLAIMS,
|
|
4
|
+
CAPABILITY_EDGE_KINDS,
|
|
5
|
+
CAPABILITY_GRAPH,
|
|
6
|
+
CAPABILITY_GRAPH_VERSION,
|
|
7
|
+
CAPABILITY_NODE_CATEGORIES,
|
|
8
|
+
CAPABILITY_NODE_LAYERS,
|
|
9
|
+
CONDITION_KINDS,
|
|
10
|
+
EVIDENCE_PROVIDER_CAPABILITIES,
|
|
11
|
+
EVIDENCE_PROVIDER_TYPES,
|
|
12
|
+
PROBE_CAPABILITIES,
|
|
13
|
+
PUBLIC_CAPABILITY_CONSUMERS,
|
|
14
|
+
RUNTIME_PREREQUISITES,
|
|
15
|
+
SESSION_CAPABILITIES,
|
|
16
|
+
capabilityNode,
|
|
17
|
+
capabilityRemediation,
|
|
18
|
+
resolveCapability,
|
|
19
|
+
sessionCapabilitiesFromProducers,
|
|
20
|
+
validateCapabilityGraph
|
|
21
|
+
} from "./chunk-VBLS6E6U.js";
|
|
22
|
+
export {
|
|
23
|
+
ADAPTER_CAPABILITIES,
|
|
24
|
+
CAPABILITY_CONFORMANCE_CLAIMS,
|
|
25
|
+
CAPABILITY_EDGE_KINDS,
|
|
26
|
+
CAPABILITY_GRAPH,
|
|
27
|
+
CAPABILITY_GRAPH_VERSION,
|
|
28
|
+
CAPABILITY_NODE_CATEGORIES,
|
|
29
|
+
CAPABILITY_NODE_LAYERS,
|
|
30
|
+
CONDITION_KINDS,
|
|
31
|
+
EVIDENCE_PROVIDER_CAPABILITIES,
|
|
32
|
+
EVIDENCE_PROVIDER_TYPES,
|
|
33
|
+
PROBE_CAPABILITIES,
|
|
34
|
+
PUBLIC_CAPABILITY_CONSUMERS,
|
|
35
|
+
RUNTIME_PREREQUISITES,
|
|
36
|
+
SESSION_CAPABILITIES,
|
|
37
|
+
capabilityNode,
|
|
38
|
+
capabilityRemediation,
|
|
39
|
+
resolveCapability,
|
|
40
|
+
sessionCapabilitiesFromProducers,
|
|
41
|
+
validateCapabilityGraph
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=capability-graph.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import {
|
|
2
|
+
SESSION_CAPABILITIES
|
|
3
|
+
} from "./chunk-VBLS6E6U.js";
|
|
4
|
+
|
|
5
|
+
// src/probe/ir.ts
|
|
6
|
+
var PROBE_UNOBSERVABLE_FIELDS = [
|
|
7
|
+
"focused",
|
|
8
|
+
"disabled",
|
|
9
|
+
"checked",
|
|
10
|
+
"expanded",
|
|
11
|
+
"readonly",
|
|
12
|
+
"selected",
|
|
13
|
+
"busy",
|
|
14
|
+
"multiline",
|
|
15
|
+
"required",
|
|
16
|
+
"multiselectable",
|
|
17
|
+
"displayed",
|
|
18
|
+
"value",
|
|
19
|
+
"selectedIndex",
|
|
20
|
+
"textSelection",
|
|
21
|
+
"scroll",
|
|
22
|
+
"scrollExtent",
|
|
23
|
+
"intendedRect",
|
|
24
|
+
"visibleRect",
|
|
25
|
+
"paintOrder",
|
|
26
|
+
"text",
|
|
27
|
+
"parent"
|
|
28
|
+
];
|
|
29
|
+
var PROBE_INJECTION_TIERS = ["T0", "T1", "T2", "T3"];
|
|
30
|
+
var PROBE_SEMANTIC_CLASSES = ["A", "B"];
|
|
31
|
+
var PROBE_DEGRADED_CAPABILITIES = Object.freeze([
|
|
32
|
+
...SESSION_CAPABILITIES,
|
|
33
|
+
"inactive-screen-tree",
|
|
34
|
+
"custom-container-enumeration"
|
|
35
|
+
]);
|
|
36
|
+
var PROVENANCE_SOURCES = [
|
|
37
|
+
"annotation",
|
|
38
|
+
"recognizer",
|
|
39
|
+
"framework",
|
|
40
|
+
"application",
|
|
41
|
+
"correlation",
|
|
42
|
+
"heuristic"
|
|
43
|
+
];
|
|
44
|
+
|
|
45
|
+
// src/contract.ts
|
|
46
|
+
function evidence(source, method, strength, providerId) {
|
|
47
|
+
if (providerId.trim().length === 0) throw new TypeError("evidence providerId must not be empty");
|
|
48
|
+
return Object.freeze({ source, method, strength, providerId });
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export {
|
|
52
|
+
PROBE_UNOBSERVABLE_FIELDS,
|
|
53
|
+
PROBE_INJECTION_TIERS,
|
|
54
|
+
PROBE_SEMANTIC_CLASSES,
|
|
55
|
+
PROBE_DEGRADED_CAPABILITIES,
|
|
56
|
+
PROVENANCE_SOURCES,
|
|
57
|
+
evidence
|
|
58
|
+
};
|
|
59
|
+
//# sourceMappingURL=chunk-B4VUTTUE.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/probe/ir.ts","../src/contract.ts"],"sourcesContent":["/**\n * Probe IR — what an instrumented process **observed**, not what it means.\n *\n * A probe reports facts; a recognizer turns them into the semantic tree. The\n * split exists because the six frameworks disagree about what is even knowable,\n * and collapsing that disagreement early is how a tree ends up asserting things\n * no framework ever said.\n *\n * Three rules shape every type here, each forced by the Phase 0 audits:\n *\n * 1. **Never fabricate identity.** Immediate-mode frameworks have none, and a\n * synthesised ordinal presented as a handle is worse than no handle: a test\n * written against it fails later and looks flaky rather than wrong. Identity\n * is therefore a typed capability with `frame-local` as a first-class value.\n * 2. **Intent is not ownership.** The rectangle a widget was drawn *into* is not\n * the cells it ended up owning; later writes win and no framework records\n * who painted what. The two are separate fields, and only one framework\n * computes the second.\n * 3. **Absent and unobservable are different facts.** A state a framework does\n * not expose is not a state that is off. The IR says which is which, rather\n * than letting `undefined` mean both.\n *\n * Naming note: the words `region` and `area` are avoided throughout. Each\n * carries at least three conflicting meanings across the audited frameworks,\n * and an IR that reuses them inherits every one of those ambiguities.\n */\n\n/**\n * How an object's identity behaves across frames.\n *\n * `frame-local` is a legitimate answer, not a degraded one: in immediate mode\n * the widget is consumed by the render and nothing upstream survives to be\n * named again. A consumer must not correlate `frame-local` values between\n * frames.\n */\nexport type ProbeIdentityKind = 'stable' | 'frame-local';\n\n/** An object's identity, tagged with what it is worth. */\nexport interface ProbeIdentity {\n readonly kind: ProbeIdentityKind;\n /** Unique within its frame; unique across the session only when `stable`. */\n readonly value: string;\n}\n\n/**\n * A rectangle in terminal cells.\n *\n * Deliberately not called a region or an area: `row`/`column` are absolute\n * cell coordinates, and negative origins are legal because a widget may be\n * partly scrolled off.\n */\nexport interface ProbeRect {\n readonly row: number;\n readonly column: number;\n readonly width: number;\n readonly height: number;\n}\n\n/**\n * Where an object was drawn.\n *\n * `intendedRect` is where it *asked* to draw. It is a statement of intent, not\n * a claim on cells: frameworks do not clip it, do not validate it against the\n * viewport, and a later write silently wins. For overlapping UIs — popups,\n * modals, shadows — it is not where the object ended up.\n *\n * `visibleRect` is the intersection with the clip imposed by ancestors, which\n * is the closest any framework gets to \"what the user can see\". Only one of\n * the six computes it; everywhere else it is absent, and inferring it from\n * `intendedRect` would be inventing a fact.\n */\nexport interface ProbeGeometry {\n readonly intendedRect?: ProbeRect;\n readonly visibleRect?: ProbeRect;\n}\n\n/** Scroll position, in cells, of a scrollable object's viewport. */\nexport interface ProbeScroll {\n readonly row: number;\n readonly column: number;\n}\n\n/** Total scrollable extent, in cells. Absent where a framework cannot report it. */\nexport interface ProbeExtent {\n readonly rows: number;\n readonly columns: number;\n}\n\n/**\n * State a probe read directly from the framework.\n *\n * Every field is optional, and absence means \"not reported by this probe\".\n * A field the framework is *known* not to expose belongs in\n * {@link ProbeObject.unobservable} instead, so a consumer can tell \"off\" from\n * \"unknowable\".\n *\n * The three selection facts have separate names on purpose. An accessibility\n * `selected` flag, a highlighted collection index and a selected text range\n * are not interchangeable, even though frameworks often call all three\n * \"selection\".\n */\nexport interface ProbeObservedState {\n readonly focused?: boolean;\n readonly disabled?: boolean;\n readonly checked?: boolean | 'mixed';\n readonly expanded?: boolean;\n readonly readonly?: boolean;\n readonly selected?: boolean;\n readonly busy?: boolean;\n readonly multiline?: boolean;\n readonly required?: boolean;\n readonly multiselectable?: boolean;\n /**\n * Whether the framework's own display flag is on. Distinct from being\n * scrolled out of view, which shows up as an empty `visibleRect`.\n */\n readonly displayed?: boolean;\n /** Contents of a value-bearing widget. `''` means empty, not absent. */\n readonly value?: string;\n /** Explicit confidentiality classification. Omitted values default sensitive. */\n readonly valueSensitivity?: 'public' | 'sensitive';\n /** Highlighted item in a collection, by index. Not a text selection. */\n readonly selectedIndex?: number;\n /** Selected text range within this object. Not an item selection. */\n readonly textSelection?: { readonly start: number; readonly end: number };\n readonly scroll?: ProbeScroll;\n readonly scrollExtent?: ProbeExtent;\n}\n\n/** Field names a probe can declare unobservable. */\nexport const PROBE_UNOBSERVABLE_FIELDS = [\n 'focused',\n 'disabled',\n 'checked',\n 'expanded',\n 'readonly',\n 'selected',\n 'busy',\n 'multiline',\n 'required',\n 'multiselectable',\n 'displayed',\n 'value',\n 'selectedIndex',\n 'textSelection',\n 'scroll',\n 'scrollExtent',\n 'intendedRect',\n 'visibleRect',\n 'paintOrder',\n 'text',\n 'parent',\n] as const;\n\nexport type ProbeUnobservableField = (typeof PROBE_UNOBSERVABLE_FIELDS)[number];\n\n/**\n * Author-supplied annotations carried verbatim.\n *\n * The probe does not interpret these — a recognizer does, at the top of the\n * merge precedence. `role` is deliberately a free string here: it is whatever\n * the author wrote, and validating it against the closed role set is the\n * recognizer's job, which can then report a bad annotation instead of silently\n * dropping it.\n */\nexport interface ProbeAccessibilityHints {\n /** Framework-native accessibility role, in the framework's vocabulary. */\n readonly role?: string;\n readonly name?: string;\n readonly description?: string;\n}\n\nexport interface ProbeAnnotations {\n readonly role?: string;\n readonly name?: string;\n readonly testId?: string;\n readonly description?: string;\n /** Application-domain JSON state, kept outside the portable state flags. */\n readonly extended?: import('../tree.js').SemanticExtendedState;\n /** Descriptive action intent; never callbacks or a second input channel. */\n readonly actions?: readonly import('../roles.js').SemanticAction[];\n /** Production key bindings represented as data, never framework callbacks. */\n readonly inputRecipes?: readonly import('../roles.js').PhysicalInputRecipe[];\n /** Probe identity values of author-declared labelling relationships. */\n readonly labelledBy?: readonly string[];\n /** Probe identity values of author-declared description relationships. */\n readonly describedBy?: readonly string[];\n}\n\n/**\n * One object a probe observed in a frame.\n *\n * `frameworkType` is required. It is the framework's own name for the thing —\n * a class name, a constructor name, a widget type — and it is what keeps an\n * unrecognised widget alive as a `generic` node instead of being dropped. Its\n * quality varies enormously (Textual gives a full class ancestry; Ink gives one\n * of four host-element names), so a recognizer must treat it as a hint, not a\n * classification.\n */\nexport interface ProbeObject {\n readonly identity: ProbeIdentity;\n readonly frameworkType: string;\n /** Parent's identity value; absent for a root. */\n readonly parent?: string;\n readonly geometry?: ProbeGeometry;\n readonly state?: ProbeObservedState;\n /** Text the object itself carries, not its descendants'. */\n readonly text?: string;\n /** Accessibility metadata retained by the framework itself, not author SDK data. */\n readonly accessibility?: ProbeAccessibilityHints;\n readonly annotations?: ProbeAnnotations;\n /**\n * Where this object sits in paint order: higher was painted later, and\n * therefore on top.\n *\n * Available in three of the six frameworks (a compositor hit-test, a z-order\n * child list, a paint-order key) and absent in the rest. It is the only fact\n * that makes \"is my target actually the thing at this cell\" answerable\n * without inventing cell ownership, which no framework records.\n */\n readonly paintOrder?: number;\n /**\n * Facts this framework cannot report for this object. Distinct from a field\n * simply being absent, which means the probe did not report it this time.\n */\n readonly unobservable?: readonly ProbeUnobservableField[];\n}\n\n/**\n * A render or layout call the probe intercepted.\n *\n * Only some frameworks expose a call stream, and in immediate mode it is the\n * *only* structure that exists — there is no tree to walk, just an ordered list\n * of \"this type was drawn into this rectangle\". `ordinal` is the position in\n * that stream and is meaningful only within its frame.\n */\nexport interface ProbeOperation {\n readonly kind: 'render' | 'layout';\n readonly ordinal: number;\n /** Identity of the object this call concerned, when the probe can attribute it. */\n readonly target?: ProbeIdentity;\n readonly frameworkType?: string;\n readonly intendedRect?: ProbeRect;\n}\n\n/**\n * One observed frame.\n *\n * `objects` may be empty and `operations` may carry everything: that is what an\n * immediate-mode frame looks like, and a flat op list is a legal degenerate\n * tree rather than an error.\n */\nexport interface ProbeFrame {\n /** Monotonic within the session. Every framework has exactly one of these. */\n readonly frame: number;\n readonly objects: readonly ProbeObject[];\n readonly operations?: readonly ProbeOperation[];\n}\n\n/** Optional abilities a probe declares at handshake time. */\nexport { PROBE_CAPABILITIES } from '../capability-graph.js';\nexport type { ProbeCapability } from '../capability-graph.js';\nimport {\n SESSION_CAPABILITIES,\n type ProbeCapability,\n type SessionCapabilityId,\n} from '../capability-graph.js';\n\n/** Injection tiers used by the semantic-probe attachment doctrine. */\nexport const PROBE_INJECTION_TIERS = ['T0', 'T1', 'T2', 'T3'] as const;\nexport type ProbeInjectionTier = (typeof PROBE_INJECTION_TIERS)[number];\n\n/** Semantic class A has geometry; class B deliberately publishes a tree without it. */\nexport const PROBE_SEMANTIC_CLASSES = ['A', 'B'] as const;\nexport type ProbeSemanticClass = (typeof PROBE_SEMANTIC_CLASSES)[number];\n\n/**\n * Named reductions a probe can report even when the broader session\n * capability remains useful. These are deliberately more precise than the\n * capability graph: omitting inactive screens must not disable the live\n * semantic tree, and an opaque custom container must not disable known\n * framework children.\n */\nexport const PROBE_DEGRADED_CAPABILITIES = Object.freeze([\n ...SESSION_CAPABILITIES,\n 'inactive-screen-tree',\n 'custom-container-enumeration',\n] as const);\nexport type ProbeDegradedCapabilityId =\n SessionCapabilityId | 'inactive-screen-tree' | 'custom-container-enumeration';\n\n/** Runtime record of the strongest attachment mechanism that actually engaged. */\nexport interface ProbeInstrumentation {\n readonly highestTier: ProbeInjectionTier;\n readonly semanticClass: ProbeSemanticClass;\n readonly degradedCapabilities: readonly ProbeDegradedCapabilityId[];\n}\n\n/**\n * What a probe says about itself when it attaches.\n *\n * @remarks\n * `frame-begin` is optional for a reason that is easy to get wrong. No audited\n * framework offers a hook guaranteed to fire before every frame: one lets a\n * pre-draw hook veto the frame entirely (so the post-draw hook never runs), one\n * exposes only a post-frame hook, and one decouples submission from the flush\n * with a ticker. A consumer must therefore never read \"no frame-begin\" as \"no\n * frame in progress\" — doing so turns four of the six frameworks into a hang\n * rather than an error.\n */\nexport interface ProbeInfo {\n /** Framework name, e.g. `ink`, `textual`, `ratatui`. */\n readonly framework: string;\n readonly frameworkVersion?: string;\n /** Version of the probe itself, so a mismatch is diagnosable. */\n readonly probeVersion: string;\n /** The best identity this probe can offer for any object. */\n readonly identityKind: ProbeIdentityKind;\n readonly capabilities: readonly ProbeCapability[];\n /**\n * How this concrete run attached and what it could not observe.\n * Optional on the wire so existing protocol-v2/custom adapters remain valid.\n */\n readonly instrumentation?: ProbeInstrumentation;\n}\n\n/**\n * Where a semantic fact came from.\n *\n * Ranked: an annotation is what the author said, a recognizer is what our rules\n * concluded, `framework` is what the framework itself reported, `correlation`\n * is what matching across sources implied, and `heuristic` is a guess that\n * happened to be useful. The merge precedence follows this order, except that\n * physical facts — bounds, focus, visibility, cells — are never casually\n * overridden by an annotation: an author may name a thing, but may not declare\n * where it is on screen.\n */\nexport const PROVENANCE_SOURCES = [\n 'annotation',\n 'recognizer',\n 'framework',\n 'application',\n 'correlation',\n 'heuristic',\n] as const;\n\nexport type ProvenanceSource = (typeof PROVENANCE_SOURCES)[number];\n","export {\n ADAPTER_CAPABILITIES,\n EVIDENCE_PROVIDER_CAPABILITIES,\n SESSION_CAPABILITIES,\n} from './capability-graph.js';\nexport type {\n AdapterCapability,\n EvidenceProviderCapability,\n SessionCapabilityId,\n} from './capability-graph.js';\nexport {\n PROBE_DEGRADED_CAPABILITIES,\n PROBE_INJECTION_TIERS,\n PROBE_SEMANTIC_CLASSES,\n} from './probe/ir.js';\nimport type { EvidenceProviderCapability, SessionCapabilityId } from './capability-graph.js';\nimport type { ProbeInstrumentation } from './probe/ir.js';\n\n/**\n * Stable application provider identity announced in the adapter hello.\n *\n * Providers are collected before hello is sent. The declaration is therefore\n * part of the same immutable negotiation as framework and terminal evidence;\n * there is no late-registration message and no mutable side channel.\n */\nexport interface EvidenceProviderRegistration {\n readonly id: string;\n readonly version: string;\n readonly capabilities: readonly EvidenceProviderCapability[];\n /** How the application obtains its authoritative production-router facts. */\n readonly method: 'native' | 'declared';\n}\n\n/** Where a fact originated, how it was obtained, and what consumers may infer. */\nexport interface EvidenceProvenance {\n readonly source: 'framework' | 'application' | 'terminal' | 'recognizer' | 'driver';\n readonly method:\n 'native' | 'instrumented' | 'declared' | 'correlated' | 'measured' | 'derived' | 'heuristic';\n readonly strength: 'authoritative' | 'diagnostic';\n /** Stable identity of the producer, never a display label. */\n readonly providerId: string;\n}\n\nexport function evidence(\n source: EvidenceProvenance['source'],\n method: EvidenceProvenance['method'],\n strength: EvidenceProvenance['strength'],\n providerId: string,\n): EvidenceProvenance {\n if (providerId.trim().length === 0) throw new TypeError('evidence providerId must not be empty');\n return Object.freeze({ source, method, strength, providerId });\n}\n\nexport type SessionCapabilityAvailability =\n | { readonly status: 'supported'; readonly evidence: EvidenceProvenance }\n | {\n readonly status: 'unsupported';\n readonly reason:\n 'not-negotiated' | 'framework-unobservable' | 'terminal-unobservable' | 'provider-required';\n };\n\nexport type ContractProvider =\n | {\n readonly id: string;\n readonly kind: 'framework' | 'terminal';\n readonly version: string;\n }\n | {\n readonly id: string;\n readonly kind: 'application';\n readonly version: string;\n readonly method: 'native' | 'declared';\n readonly capabilities: readonly EvidenceProviderCapability[];\n };\n\n/**\n * Immutable public contract negotiated once for one session epoch.\n *\n * Runtime state (disabled nodes, clipping, terminal modes currently off) is\n * intentionally absent. Those are actionability observations, not capability.\n */\nexport interface EffectiveSessionContract {\n readonly contractId: string;\n readonly sessionId: string;\n readonly epoch: number;\n readonly protocol: 'termwright/2';\n readonly framework: {\n readonly name: string;\n readonly version: string;\n readonly adapterVersion: string;\n readonly certificationId: string;\n /** Runtime attachment facts declared by a framework probe, when available. */\n readonly instrumentation?: ProbeInstrumentation;\n } | null;\n readonly providers: readonly ContractProvider[];\n readonly capabilities: Readonly<Record<SessionCapabilityId, SessionCapabilityAvailability>>;\n readonly terminal: {\n readonly profile: string;\n readonly platform: string;\n readonly mouseModesObservable: boolean;\n };\n}\n"],"mappings":";;;;;AAkIO,IAAM,4BAA4B;AAAA,EACvC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAqHO,IAAM,wBAAwB,CAAC,MAAM,MAAM,MAAM,IAAI;AAIrD,IAAM,yBAAyB,CAAC,KAAK,GAAG;AAUxC,IAAM,8BAA8B,OAAO,OAAO;AAAA,EACvD,GAAG;AAAA,EACH;AAAA,EACA;AACF,CAAU;AAkDH,IAAM,qBAAqB;AAAA,EAChC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;;;AC7SO,SAAS,SACd,QACA,QACA,UACA,YACoB;AACpB,MAAI,WAAW,KAAK,EAAE,WAAW,EAAG,OAAM,IAAI,UAAU,uCAAuC;AAC/F,SAAO,OAAO,OAAO,EAAE,QAAQ,QAAQ,UAAU,WAAW,CAAC;AAC/D;","names":[]}
|