@miadi/tide-contract 0.2.2 → 0.2.4
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 +5 -3
- package/dist/index.d.ts +69 -3
- package/dist/index.d.ts.map +1 -1
- package/package.json +3 -1
- package/schema/tide-api.schema.json +69 -5
package/README.md
CHANGED
|
@@ -16,15 +16,17 @@ This package is the shared covenant between:
|
|
|
16
16
|
- 0.2.0 adds the `multiplexer` discriminator (`"tmux" | "herdr"`, absent ⇒ `"tmux"`), pane targets in both formats, optional `pane_label`, the `TideSendKeysResult` discriminated union, and optional `agent_status` on `EpisodeLane` / `TidePendingApproval`.
|
|
17
17
|
- 0.2.1 corrects the herdr pane-id story from the EP137 live smoke (herdr 0.7.4): real ids are `w1:p2` (legacy `1-2` still accepted), **session-scoped and monotonic** — they do not compact or get reused when panes close, a stale id fails loudly with `pane_not_found`, and `pane rename` sets the `label` field that label→id resolution matches at action time.
|
|
18
18
|
- 0.2.2 types the remaining live-verified herdr envelopes: `TideHerdrPaneInfo` (`pane list` rows), `TideHerdrWaitOutputResult` (`wait output` hit), and `TideHerdrAgentStatusEvent` (`wait agent-status` hits print an EVENT envelope, not a result envelope).
|
|
19
|
+
- 0.2.3 adds the one-call inventory snapshot `TideHerdrInventory` (+ `TideHerdrWorkspaceInfo`/`TideHerdrTabInfo`) behind `getHerdrInventory()`, and widens every pane-id pattern to ALPHANUMERIC segments — live herdr allocates pane suffixes past `p9` as letters (`w2:pE` observed 2026-07-18), which the digits-only patterns rejected.
|
|
20
|
+
- 0.2.4 (unpublished) covenants the peek response from live EP152 cockpit receipts — the previously documented `pane?`/`lines?` fields were fiction; `TidePeekResult` is now the `TideTmuxPeekResult` (`{target, resolved, content}`) / `TideHerdrPeekResult` (`{multiplexer, pane, lines, text}`) union — and lands the deterministic schema→TS drift gate (see Drift posture).
|
|
19
21
|
- Runtime identity constants are exported from `src/index.ts` and mirrored in the schema `x-tide` metadata: `tide`, `MIADI_HOME`, `~/.miadi/navigator`, and `miadi.tide.daemon.v2`.
|
|
20
22
|
- Future work should generate the TypeScript types from the schema and validate IronSilk runtime payloads with Python `jsonschema`.
|
|
21
23
|
|
|
22
24
|
## Drift posture
|
|
23
25
|
|
|
24
|
-
|
|
26
|
+
Steps 1–2 of the intended CI shape are live in `npm test` (jgwill/Miadi#378):
|
|
25
27
|
|
|
26
|
-
1.
|
|
27
|
-
2.
|
|
28
|
+
1. **Done** — `scripts/generate-schema-reference.mjs` deterministically emits reference types from `schema/tide-api.schema.json` into `test/schema-reference.generated.ts` (committed; regenerate with `npm run generate:reference`).
|
|
29
|
+
2. **Done** — `test/drift-gate.test.ts` byte-checks the committed reference (`npm run drift:check`) and compile-asserts exact assignability between every public export and its reference type. Pre-existing divergences sit in explicit waiver sections whose pins fail the build once reconciled. **Layered claims (post-W11):** the byte-check is the schema-movement tripwire — constraint-only edits (pattern/bounds) reach it via the emitted `SCHEMA_CONSTRAINTS` manifest, and unknown or co-occurring schema constructs make generation throw; the type layer proves hand-written parity at assignability granularity only (an optional field added over a loose shape's index signature is byte-layer-visible, not type-layer-visible). Review discipline: a `.generated.ts` diff *is* the schema change — read it.
|
|
28
30
|
3. Validate runtime fixture JSON from IronSilk.
|
|
29
31
|
4. Fail when the contract, client, routes, and runtime drift.
|
|
30
32
|
|
package/dist/index.d.ts
CHANGED
|
@@ -88,11 +88,43 @@ export interface TideDetectMatch {
|
|
|
88
88
|
source_detail: string;
|
|
89
89
|
}
|
|
90
90
|
export type TideDetectResult = TideDetectMatch | null;
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
91
|
+
/**
|
|
92
|
+
* Peek response for a tmux pane, covenanted from the live EP152 cockpit
|
|
93
|
+
* receipt (the previously documented `pane?`/`lines?` fields were fiction —
|
|
94
|
+
* live 0.9.30 returns `{target, resolved, content}`). Absent discriminator
|
|
95
|
+
* means tmux. Kept loose: the route owns field evolution.
|
|
96
|
+
*/
|
|
97
|
+
export interface TideTmuxPeekResult {
|
|
98
|
+
multiplexer?: "tmux";
|
|
99
|
+
/** Resolved tmux pane target (e.g. "%13"). */
|
|
100
|
+
target: string;
|
|
101
|
+
/** Resolved pane identity observed live: session/window/pane/cwd/pid plus attach/switch/select commands. Shape owned by the route; not yet independently covenanted. */
|
|
102
|
+
resolved: Record<string, unknown>;
|
|
103
|
+
/** Captured scrollback text. */
|
|
104
|
+
content: string;
|
|
105
|
+
[key: string]: unknown;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Peek response for a herdr pane, covenanted from the live EP152 cockpit
|
|
109
|
+
* receipt. When addressed by pane label, the resolved session-scoped id is
|
|
110
|
+
* surfaced in `pane`.
|
|
111
|
+
*/
|
|
112
|
+
export interface TideHerdrPeekResult {
|
|
113
|
+
multiplexer: "herdr";
|
|
114
|
+
/** Resolved herdr pane id (e.g. "w7:p4"). */
|
|
115
|
+
pane: string;
|
|
116
|
+
/** Captured lines. */
|
|
117
|
+
lines: string[];
|
|
118
|
+
/** Captured text joined. */
|
|
119
|
+
text: string;
|
|
94
120
|
[key: string]: unknown;
|
|
95
121
|
}
|
|
122
|
+
/**
|
|
123
|
+
* Discriminated union on `multiplexer`; an absent discriminator means the
|
|
124
|
+
* tmux variant. Two live wire shapes exist for one endpoint (EP152
|
|
125
|
+
* cockpit-dogfood §1.4); this union covenants both without unifying them.
|
|
126
|
+
*/
|
|
127
|
+
export type TidePeekResult = TideTmuxPeekResult | TideHerdrPeekResult;
|
|
96
128
|
export interface TideSteerResult {
|
|
97
129
|
[key: string]: unknown;
|
|
98
130
|
}
|
|
@@ -163,6 +195,40 @@ export interface TideHerdrPaneInfo {
|
|
|
163
195
|
terminal_title_stripped?: string;
|
|
164
196
|
[key: string]: unknown;
|
|
165
197
|
}
|
|
198
|
+
/** One row from `herdr workspace list` (loose — herdr owns the shape). */
|
|
199
|
+
export interface TideHerdrWorkspaceInfo {
|
|
200
|
+
/** Session-scoped herdr workspace id (e.g. "w1"). */
|
|
201
|
+
workspace_id?: string;
|
|
202
|
+
label?: string;
|
|
203
|
+
focused?: boolean;
|
|
204
|
+
[key: string]: unknown;
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* One row from `herdr tab list` (loose — herdr owns the shape).
|
|
208
|
+
* `workspace_id` is annotated by getHerdrInventory; raw tab rows may not
|
|
209
|
+
* carry it.
|
|
210
|
+
*/
|
|
211
|
+
export interface TideHerdrTabInfo {
|
|
212
|
+
/** Session-scoped herdr tab id (e.g. "w1:t1"). */
|
|
213
|
+
tab_id?: string;
|
|
214
|
+
label?: string;
|
|
215
|
+
workspace_id?: string;
|
|
216
|
+
[key: string]: unknown;
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* One-call herdr inventory snapshot (getHerdrInventory) for cockpit surfaces:
|
|
220
|
+
* workspaces + panes, tabs on request. Ids are session-scoped — snapshots go
|
|
221
|
+
* stale across herdr restarts; durable addressing is by pane label.
|
|
222
|
+
*/
|
|
223
|
+
export interface TideHerdrInventory {
|
|
224
|
+
multiplexer: "herdr";
|
|
225
|
+
/** ISO timestamp of the snapshot. */
|
|
226
|
+
captured_at: string;
|
|
227
|
+
workspaces: TideHerdrWorkspaceInfo[];
|
|
228
|
+
panes: TideHerdrPaneInfo[];
|
|
229
|
+
/** Present only when tabs were requested (extra CLI spawns per workspace). */
|
|
230
|
+
tabs?: TideHerdrTabInfo[];
|
|
231
|
+
}
|
|
166
232
|
/**
|
|
167
233
|
* Envelope printed by `herdr wait output` on a hit (herdr 0.7.4, EP137):
|
|
168
234
|
* `result.type` is "output_matched" with `matched_line` and a read transcript
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,kBAAkB,mDAAmD,CAAA;AAClF,eAAO,MAAM,gBAAgB,SAAS,CAAA;AACtC,eAAO,MAAM,mBAAmB,eAAe,CAAA;AA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EAAE,MAAM,GAAG,IAAI,CAAA;CAC/B;AAED,MAAM,WAAW,cAAc;IAC7B,UAAU,EAAE,MAAM,CAAA;IAClB,cAAc,EAAE,MAAM,CAAA;IACtB,WAAW,EAAE,MAAM,CAAA;IACnB,eAAe,EAAE,MAAM,GAAG,IAAI,CAAA;IAC9B,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;IACzB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;CAC3B;AAED,MAAM,WAAW,qBAAqB;IACpC,UAAU,EAAE,MAAM,CAAA;IAClB,cAAc,EAAE,MAAM,CAAA;IACtB,aAAa,EAAE,MAAM,CAAA;IACrB,WAAW,EAAE,MAAM,CAAA;IACnB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAA;IAC5B,wBAAwB,EAAE,MAAM,GAAG,IAAI,CAAA;IACvC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;CAC1B;AAED,MAAM,WAAW,mBAAmB;IAClC,WAAW,EAAE,MAAM,CAAA;IACnB,UAAU,EAAE,MAAM,CAAA;IAClB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;IACtB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;IAC1B,6FAA6F;IAC7F,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC1B,YAAY,CAAC,EAAE,eAAe,CAAA;IAC9B,WAAW,EAAE,MAAM,CAAA;IACnB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAA;IAC5B,mBAAmB,EAAE,OAAO,CAAA;IAC5B,UAAU,EAAE,MAAM,CAAA;CACnB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@miadi/tide-contract",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.4",
|
|
4
4
|
"description": "Schema-first Tide API contract shared by Miadi and the IronSilk tide runtime.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"publishConfig": {
|
|
@@ -25,6 +25,8 @@
|
|
|
25
25
|
"scripts": {
|
|
26
26
|
"build": "tsc",
|
|
27
27
|
"type-check": "tsc --noEmit",
|
|
28
|
+
"generate:reference": "node scripts/generate-schema-reference.mjs --write",
|
|
29
|
+
"drift:check": "node scripts/generate-schema-reference.mjs --check",
|
|
28
30
|
"test": "d=$(mktemp -d \"${TMPDIR:-/tmp}/miadi-tide-contract-test.XXXXXX\") && trap 'rm -rf \"$d\"' EXIT && ../../node_modules/.bin/tsc -p tsconfig.test.json --outDir \"$d\" && node --test \"$d\"/test/*.test.js"
|
|
29
31
|
},
|
|
30
32
|
"devDependencies": {
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"episode_id": { "type": "string", "description": "Unique episode identifier." },
|
|
52
52
|
"lane_id": { "type": "string", "description": "Unique lane identifier within the episode (e.g., 'planning', 'delivery')." },
|
|
53
53
|
"lane_role": { "$ref": "#/$defs/episodeLaneRole" },
|
|
54
|
-
"pane_target": { "type": ["string", "null"], "pattern": "^(%?[0-9]+|[0-9]+-[0-9]+|w[0-
|
|
54
|
+
"pane_target": { "type": ["string", "null"], "pattern": "^(%?[0-9]+|[0-9]+-[0-9]+|w[0-9A-Za-z]+:p[0-9A-Za-z]+)$", "description": "Optional pane target: tmux pane id (e.g., '%76' or '76') or herdr pane id (e.g., 'w1:p2' as of herdr 0.7; legacy '1-2' accepted)." },
|
|
55
55
|
"pane_label": { "type": ["string", "null"], "description": "Durable pane label. herdr pane ids are session-scoped (they do not survive a herdr restart), so label→id resolution happens at action time." },
|
|
56
56
|
"agent_status": { "$ref": "#/$defs/agentStatus" },
|
|
57
57
|
"verification_state": { "$ref": "#/$defs/episodeLaneVerificationState" },
|
|
@@ -147,7 +147,7 @@
|
|
|
147
147
|
],
|
|
148
148
|
"properties": {
|
|
149
149
|
"multiplexer": { "$ref": "#/$defs/multiplexer" },
|
|
150
|
-
"tmux_pane": { "type": "string", "pattern": "^(%?[0-9]+|[0-9]+-[0-9]+|w[0-
|
|
150
|
+
"tmux_pane": { "type": "string", "pattern": "^(%?[0-9]+|[0-9]+-[0-9]+|w[0-9A-Za-z]+:p[0-9A-Za-z]+)$", "description": "Pane id in the owning multiplexer: tmux (e.g., '%56') or herdr (e.g., 'w1:p2' as of herdr 0.7; legacy '1-2' accepted). Field name is historical." },
|
|
151
151
|
"pid": { "type": "integer" },
|
|
152
152
|
"cwd": { "type": "string" },
|
|
153
153
|
"domain_id": { "type": ["string", "null"] },
|
|
@@ -258,7 +258,7 @@
|
|
|
258
258
|
"session_name": { "type": "string" },
|
|
259
259
|
"window_id": { "type": "string" },
|
|
260
260
|
"window_name": { "type": "string" },
|
|
261
|
-
"pane_id": { "type": "string", "pattern": "^(%?[0-9]+|[0-9]+-[0-9]+|w[0-
|
|
261
|
+
"pane_id": { "type": "string", "pattern": "^(%?[0-9]+|[0-9]+-[0-9]+|w[0-9A-Za-z]+:p[0-9A-Za-z]+)$", "description": "Pane id in the owning multiplexer: tmux (e.g., '%56') or herdr (e.g., 'w1:p2' as of herdr 0.7; legacy '1-2' accepted)." },
|
|
262
262
|
"pane_label": { "type": "string", "description": "Durable pane label (herdr, set via `pane rename`); resolve label→id at action time — herdr ids are session-scoped and a stale id fails loudly with pane_not_found." },
|
|
263
263
|
"cwd": { "type": "string" },
|
|
264
264
|
"pane_active": { "type": "boolean" },
|
|
@@ -319,7 +319,7 @@
|
|
|
319
319
|
"description": "Result/plan of a direct send-keys steer against a herdr pane. The argv fields carry herdr CLI arguments instead of tmux argv.",
|
|
320
320
|
"properties": {
|
|
321
321
|
"multiplexer": { "const": "herdr" },
|
|
322
|
-
"target": { "type": "string", "pattern": "^([0-9]+-[0-9]+|w[0-
|
|
322
|
+
"target": { "type": "string", "pattern": "^([0-9]+-[0-9]+|w[0-9A-Za-z]+:p[0-9A-Za-z]+)$", "description": "Resolved herdr pane id (e.g., 'w1:p2' as of herdr 0.7; legacy '1-2' accepted). Session-scoped, not durable across herdr restarts." },
|
|
323
323
|
"pane_label": { "type": "string", "description": "Durable pane label this target was resolved from, when label→id resolution ran." },
|
|
324
324
|
"message": { "type": "string", "description": "The literal text typed into the pane." },
|
|
325
325
|
"submitted": { "type": "boolean", "description": "Whether a real Enter key was sent after the literal text." },
|
|
@@ -335,6 +335,37 @@
|
|
|
335
335
|
],
|
|
336
336
|
"description": "Discriminated union on 'multiplexer'; an absent discriminator means the tmux variant."
|
|
337
337
|
},
|
|
338
|
+
"tmuxPeekResult": {
|
|
339
|
+
"type": "object",
|
|
340
|
+
"additionalProperties": true,
|
|
341
|
+
"required": ["target", "resolved", "content"],
|
|
342
|
+
"description": "Peek response for a tmux pane, covenanted from the live EP152 cockpit receipt (one wire shape per multiplexer; absent discriminator means tmux). Kept loose: the route owns field evolution.",
|
|
343
|
+
"properties": {
|
|
344
|
+
"multiplexer": { "const": "tmux" },
|
|
345
|
+
"target": { "type": "string", "pattern": "^%?[0-9]+$", "description": "Resolved tmux pane target (e.g., '%13')." },
|
|
346
|
+
"resolved": { "type": "object", "additionalProperties": true, "description": "Resolved pane identity observed live: session/window/pane/cwd/pid plus attach/switch/select commands. Shape owned by the route; not yet independently covenanted." },
|
|
347
|
+
"content": { "type": "string", "description": "Captured scrollback text." }
|
|
348
|
+
}
|
|
349
|
+
},
|
|
350
|
+
"herdrPeekResult": {
|
|
351
|
+
"type": "object",
|
|
352
|
+
"additionalProperties": true,
|
|
353
|
+
"required": ["multiplexer", "pane", "lines", "text"],
|
|
354
|
+
"description": "Peek response for a herdr pane, covenanted from the live EP152 cockpit receipt. When addressed by pane label, the resolved session-scoped id is surfaced in 'pane'.",
|
|
355
|
+
"properties": {
|
|
356
|
+
"multiplexer": { "const": "herdr" },
|
|
357
|
+
"pane": { "type": "string", "pattern": "^([0-9]+-[0-9]+|w[0-9A-Za-z]+:p[0-9A-Za-z]+)$", "description": "Resolved herdr pane id (e.g., 'w7:p4')." },
|
|
358
|
+
"lines": { "type": "array", "items": { "type": "string" }, "description": "Captured lines." },
|
|
359
|
+
"text": { "type": "string", "description": "Captured text joined." }
|
|
360
|
+
}
|
|
361
|
+
},
|
|
362
|
+
"peekResult": {
|
|
363
|
+
"oneOf": [
|
|
364
|
+
{ "$ref": "#/$defs/tmuxPeekResult" },
|
|
365
|
+
{ "$ref": "#/$defs/herdrPeekResult" }
|
|
366
|
+
],
|
|
367
|
+
"description": "Discriminated union on 'multiplexer'; an absent discriminator means the tmux variant. Two live wire shapes exist for one endpoint (EP152 cockpit-dogfood §1.4); this def covenants both without unifying them."
|
|
368
|
+
},
|
|
338
369
|
"herdrPaneInfo": {
|
|
339
370
|
"type": "object",
|
|
340
371
|
"additionalProperties": true,
|
|
@@ -351,6 +382,39 @@
|
|
|
351
382
|
"terminal_title_stripped": { "type": "string" }
|
|
352
383
|
}
|
|
353
384
|
},
|
|
385
|
+
"herdrWorkspaceInfo": {
|
|
386
|
+
"type": "object",
|
|
387
|
+
"additionalProperties": true,
|
|
388
|
+
"description": "One row from `herdr workspace list` (loose — herdr owns the shape).",
|
|
389
|
+
"properties": {
|
|
390
|
+
"workspace_id": { "type": "string", "description": "Session-scoped herdr workspace id (e.g., 'w1')." },
|
|
391
|
+
"label": { "type": "string" },
|
|
392
|
+
"focused": { "type": "boolean" }
|
|
393
|
+
}
|
|
394
|
+
},
|
|
395
|
+
"herdrTabInfo": {
|
|
396
|
+
"type": "object",
|
|
397
|
+
"additionalProperties": true,
|
|
398
|
+
"description": "One row from `herdr tab list` (loose — herdr owns the shape). workspace_id is annotated by getHerdrInventory; raw tab rows may not carry it.",
|
|
399
|
+
"properties": {
|
|
400
|
+
"tab_id": { "type": "string", "description": "Session-scoped herdr tab id (e.g., 'w1:t1')." },
|
|
401
|
+
"label": { "type": "string" },
|
|
402
|
+
"workspace_id": { "type": "string" }
|
|
403
|
+
}
|
|
404
|
+
},
|
|
405
|
+
"herdrInventory": {
|
|
406
|
+
"type": "object",
|
|
407
|
+
"additionalProperties": false,
|
|
408
|
+
"required": ["multiplexer", "captured_at", "workspaces", "panes"],
|
|
409
|
+
"description": "One-call herdr inventory snapshot (getHerdrInventory) for cockpit surfaces: workspaces + panes, tabs on request. Ids are session-scoped — snapshots go stale across herdr restarts; durable addressing is by pane label.",
|
|
410
|
+
"properties": {
|
|
411
|
+
"multiplexer": { "const": "herdr" },
|
|
412
|
+
"captured_at": { "type": "string", "description": "ISO timestamp of the snapshot." },
|
|
413
|
+
"workspaces": { "type": "array", "items": { "$ref": "#/$defs/herdrWorkspaceInfo" } },
|
|
414
|
+
"panes": { "type": "array", "items": { "$ref": "#/$defs/herdrPaneInfo" } },
|
|
415
|
+
"tabs": { "type": "array", "items": { "$ref": "#/$defs/herdrTabInfo" }, "description": "Present only when tabs were requested (extra CLI spawns per workspace)." }
|
|
416
|
+
}
|
|
417
|
+
},
|
|
354
418
|
"herdrWaitOutputResult": {
|
|
355
419
|
"type": "object",
|
|
356
420
|
"additionalProperties": true,
|
|
@@ -392,7 +456,7 @@
|
|
|
392
456
|
"health": { "$ref": "#/$defs/healthResult" },
|
|
393
457
|
"terminals": { "$ref": "#/$defs/terminalsResult" },
|
|
394
458
|
"detect": { "$ref": "#/$defs/detectResult" },
|
|
395
|
-
"peek": { "$ref": "#/$defs/
|
|
459
|
+
"peek": { "$ref": "#/$defs/peekResult" },
|
|
396
460
|
"steer": { "$ref": "#/$defs/looseOperatorResult" },
|
|
397
461
|
"send": { "$ref": "#/$defs/looseOperatorResult" },
|
|
398
462
|
"sendKeys": { "$ref": "#/$defs/sendKeysResult" },
|