@miadi/tide-contract 0.1.2 → 0.2.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 +3 -2
- package/dist/index.d.ts +129 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +3 -2
- package/schema/tide-api.schema.json +172 -4
package/README.md
CHANGED
|
@@ -12,8 +12,9 @@ This package is the shared covenant between:
|
|
|
12
12
|
## Current shape
|
|
13
13
|
|
|
14
14
|
- `schema/tide-api.schema.json` is the planned source of truth.
|
|
15
|
-
- `src/index.ts` carries hand-written TypeScript types for this scaffold.
|
|
16
|
-
-
|
|
15
|
+
- `src/index.ts` carries hand-written TypeScript types for this scaffold, edited in lockstep with the schema (guarded by `npm test`, `test/schema-patterns.test.ts`).
|
|
16
|
+
- 0.2.0 adds the `multiplexer` discriminator (`"tmux" | "herdr"`, absent ⇒ `"tmux"`), pane targets in both formats (tmux `%76`/`76`, herdr `1-2`), optional `pane_label` (herdr ids are compact/non-durable ⇒ label→id resolution at action time), the `TideSendKeysResult` discriminated union, and optional `agent_status` on `EpisodeLane` / `TidePendingApproval`.
|
|
17
|
+
- 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`.
|
|
17
18
|
- Future work should generate the TypeScript types from the schema and validate IronSilk runtime payloads with Python `jsonschema`.
|
|
18
19
|
|
|
19
20
|
## Drift posture
|
package/dist/index.d.ts
CHANGED
|
@@ -2,8 +2,21 @@ export declare const TIDE_API_SCHEMA_ID = "https://miadi.dev/schemas/tide-api.sc
|
|
|
2
2
|
export declare const TIDE_CLI_COMMAND = "tide";
|
|
3
3
|
export declare const TIDE_STATE_ROOT_ENV = "MIADI_HOME";
|
|
4
4
|
export declare const TIDE_DEFAULT_STATE_ROOT = "~/.miadi/navigator";
|
|
5
|
-
export declare const TIDE_DAEMON_CONTRACT_VERSION = "
|
|
5
|
+
export declare const TIDE_DAEMON_CONTRACT_VERSION = "miadi.tide.daemon.v2";
|
|
6
|
+
/**
|
|
7
|
+
* Terminal multiplexer discriminator. Everywhere it is optional, absence means
|
|
8
|
+
* "tmux" — the historical default — so pre-0.2.0 payloads keep validating and
|
|
9
|
+
* existing consumers compile unchanged.
|
|
10
|
+
*/
|
|
11
|
+
export type Multiplexer = "tmux" | "herdr";
|
|
12
|
+
/**
|
|
13
|
+
* Agent status detected by herdr for a pane. "done" means the agent finished
|
|
14
|
+
* but that pane has not been looked at yet.
|
|
15
|
+
*/
|
|
16
|
+
export type TideAgentStatus = "idle" | "working" | "blocked" | "done" | "unknown";
|
|
6
17
|
export interface TerminalContext {
|
|
18
|
+
multiplexer?: Multiplexer;
|
|
19
|
+
/** Pane id in the owning multiplexer: tmux (e.g. "%56") or herdr (e.g. "1-2"). Field name is historical. */
|
|
7
20
|
tmux_pane: string;
|
|
8
21
|
pid: number;
|
|
9
22
|
cwd: string;
|
|
@@ -46,12 +59,16 @@ export interface TideHealthResult {
|
|
|
46
59
|
timestamp: string;
|
|
47
60
|
}
|
|
48
61
|
export interface TideTerminalTarget {
|
|
62
|
+
multiplexer?: Multiplexer;
|
|
49
63
|
terminal_id: string;
|
|
50
64
|
session_id: string;
|
|
51
65
|
session_name: string;
|
|
52
66
|
window_id: string;
|
|
53
67
|
window_name: string;
|
|
68
|
+
/** Pane id in the owning multiplexer: tmux (e.g. "%56") or herdr (e.g. "1-2"). */
|
|
54
69
|
pane_id: string;
|
|
70
|
+
/** Durable pane label (herdr); resolve label→id at action time — herdr ids compact when panes close. */
|
|
71
|
+
pane_label?: string;
|
|
55
72
|
cwd: string;
|
|
56
73
|
pane_active: boolean;
|
|
57
74
|
session_attached: number;
|
|
@@ -82,4 +99,115 @@ export interface TideSteerResult {
|
|
|
82
99
|
export interface TideSendResult {
|
|
83
100
|
[key: string]: unknown;
|
|
84
101
|
}
|
|
102
|
+
/**
|
|
103
|
+
* Result/plan of a direct send-keys steer against a tmux pane. Byte-for-byte
|
|
104
|
+
* the pre-0.2.0 `TideSendKeysResult` shape: the `multiplexer` discriminator is
|
|
105
|
+
* optional and absent means "tmux", so existing producers and consumers keep
|
|
106
|
+
* compiling and validating unchanged.
|
|
107
|
+
*/
|
|
108
|
+
export interface TideTmuxSendKeysResult {
|
|
109
|
+
multiplexer?: "tmux";
|
|
110
|
+
/** Resolved tmux pane target, %-prefixed after normalization (e.g. "%56"). */
|
|
111
|
+
target: string;
|
|
112
|
+
/** The literal text typed into the pane. */
|
|
113
|
+
message: string;
|
|
114
|
+
/** Whether a trailing Enter (`C-m`) was sent after the literal text. */
|
|
115
|
+
submitted: boolean;
|
|
116
|
+
/** Exact `tmux send-keys -l` argv used to type the literal text (no shell). */
|
|
117
|
+
literal_command: string[];
|
|
118
|
+
/** Exact `tmux send-keys … C-m` argv used to submit, or null when `submitted` is false. */
|
|
119
|
+
submit_command: string[] | null;
|
|
120
|
+
/** ISO timestamp the keys were sent (omitted on a dry-run plan). */
|
|
121
|
+
sent_at?: string;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Result/plan of a direct send-keys steer against a herdr pane. The argv
|
|
125
|
+
* fields carry herdr CLI arguments (`pane send-text …` / `pane send-keys …
|
|
126
|
+
* Enter`) instead of tmux argv.
|
|
127
|
+
*/
|
|
128
|
+
export interface TideHerdrSendKeysResult {
|
|
129
|
+
multiplexer: "herdr";
|
|
130
|
+
/** Resolved herdr pane id (e.g. "1-2"). Compact and non-durable. */
|
|
131
|
+
target: string;
|
|
132
|
+
/** Durable pane label this target was resolved from, when label→id resolution ran. */
|
|
133
|
+
pane_label?: string;
|
|
134
|
+
/** The literal text typed into the pane. */
|
|
135
|
+
message: string;
|
|
136
|
+
/** Whether a real Enter key was sent after the literal text. */
|
|
137
|
+
submitted: boolean;
|
|
138
|
+
/** Exact herdr CLI argv used to type the literal text (e.g. ["pane","send-text","1-2", …]). */
|
|
139
|
+
literal_command: string[];
|
|
140
|
+
/** Exact herdr CLI argv used to submit Enter, or null when `submitted` is false. */
|
|
141
|
+
submit_command: string[] | null;
|
|
142
|
+
/** ISO timestamp the keys were sent (omitted on a dry-run plan). */
|
|
143
|
+
sent_at?: string;
|
|
144
|
+
}
|
|
145
|
+
/** Discriminated union on `multiplexer`; an absent discriminator means the tmux variant. */
|
|
146
|
+
export type TideSendKeysResult = TideTmuxSendKeysResult | TideHerdrSendKeysResult;
|
|
147
|
+
export type ObserverControllerPosture = "observer" | "controller" | "auto";
|
|
148
|
+
export type EpisodeLaneRole = "planning" | "perspective" | "delivery" | "implementation" | "custom";
|
|
149
|
+
export type EpisodeLaneVerificationState = "verified" | "unverified" | "unknown";
|
|
150
|
+
export interface EpisodeLane {
|
|
151
|
+
episode_id: string;
|
|
152
|
+
lane_id: string;
|
|
153
|
+
lane_role: EpisodeLaneRole;
|
|
154
|
+
/** Pane target: tmux pane id (e.g. "%76") or herdr pane id (e.g. "1-2"). */
|
|
155
|
+
pane_target: string | null;
|
|
156
|
+
/** Durable pane label. herdr ids are compact and non-durable, so label→id resolution happens at action time. */
|
|
157
|
+
pane_label?: string | null;
|
|
158
|
+
agent_status?: TideAgentStatus;
|
|
159
|
+
verification_state: EpisodeLaneVerificationState;
|
|
160
|
+
domain_id: string | null;
|
|
161
|
+
safe_to_close: boolean;
|
|
162
|
+
continuation_note: string | null;
|
|
163
|
+
posture: ObserverControllerPosture;
|
|
164
|
+
}
|
|
165
|
+
export interface EpisodeLaneTopology {
|
|
166
|
+
episode_id: string;
|
|
167
|
+
session_name: string;
|
|
168
|
+
captured_at: string;
|
|
169
|
+
lanes: EpisodeLane[];
|
|
170
|
+
}
|
|
171
|
+
export interface TideLaneCheckpoint {
|
|
172
|
+
checkpoint_at: string;
|
|
173
|
+
episode_id: string;
|
|
174
|
+
lane_id: string;
|
|
175
|
+
pane_target: string | null;
|
|
176
|
+
/** Durable pane label for re-resolving the (non-durable) herdr pane id at action time. */
|
|
177
|
+
pane_label?: string | null;
|
|
178
|
+
continuation_note: string | null;
|
|
179
|
+
artifact_paths: string[];
|
|
180
|
+
safe_to_close: boolean;
|
|
181
|
+
checkpoint_path: string | null;
|
|
182
|
+
}
|
|
183
|
+
export interface TideResumeLink {
|
|
184
|
+
episode_id: string;
|
|
185
|
+
episode_folder: string;
|
|
186
|
+
resume_path: string;
|
|
187
|
+
summary_excerpt: string | null;
|
|
188
|
+
commit_sha: string | null;
|
|
189
|
+
produced_at: string | null;
|
|
190
|
+
}
|
|
191
|
+
export interface TideAudioManifestLink {
|
|
192
|
+
episode_id: string;
|
|
193
|
+
episode_folder: string;
|
|
194
|
+
manifest_path: string;
|
|
195
|
+
entry_count: number;
|
|
196
|
+
last_mp3_path: string | null;
|
|
197
|
+
last_telegram_message_id: string | null;
|
|
198
|
+
updated_at: string | null;
|
|
199
|
+
}
|
|
200
|
+
export interface TidePendingApproval {
|
|
201
|
+
approval_id: string;
|
|
202
|
+
episode_id: string;
|
|
203
|
+
lane_id: string | null;
|
|
204
|
+
pane_target: string | null;
|
|
205
|
+
/** Durable pane label for re-resolving the (non-durable) herdr pane id at action time. */
|
|
206
|
+
pane_label?: string | null;
|
|
207
|
+
agent_status?: TideAgentStatus;
|
|
208
|
+
action_type: string;
|
|
209
|
+
proposal_text: string | null;
|
|
210
|
+
requires_controller: boolean;
|
|
211
|
+
created_at: string;
|
|
212
|
+
}
|
|
85
213
|
//# sourceMappingURL=index.d.ts.map
|
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;AAC/C,eAAO,MAAM,uBAAuB,uBAAuB,CAAA;AAC3D,eAAO,MAAM,4BAA4B
|
|
1
|
+
{"version":3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
|
5
5
|
export const TIDE_STATE_ROOT_ENV = "MIADI_HOME";
|
|
6
6
|
export const TIDE_DEFAULT_STATE_ROOT = "~/.miadi/navigator";
|
|
7
|
-
export const TIDE_DAEMON_CONTRACT_VERSION = "
|
|
7
|
+
export const TIDE_DAEMON_CONTRACT_VERSION = "miadi.tide.daemon.v2";
|
|
8
8
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,mDAAmD;AACnD,iFAAiF;AAEjF,MAAM,CAAC,MAAM,kBAAkB,GAAG,gDAAgD,CAAA;AAClF,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAA;AACtC,MAAM,CAAC,MAAM,mBAAmB,GAAG,YAAY,CAAA;AAC/C,MAAM,CAAC,MAAM,uBAAuB,GAAG,oBAAoB,CAAA;AAC3D,MAAM,CAAC,MAAM,4BAA4B,GAAG,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,mDAAmD;AACnD,iFAAiF;AAEjF,MAAM,CAAC,MAAM,kBAAkB,GAAG,gDAAgD,CAAA;AAClF,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAA;AACtC,MAAM,CAAC,MAAM,mBAAmB,GAAG,YAAY,CAAA;AAC/C,MAAM,CAAC,MAAM,uBAAuB,GAAG,oBAAoB,CAAA;AAC3D,MAAM,CAAC,MAAM,4BAA4B,GAAG,sBAAsB,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@miadi/tide-contract",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Schema-first Tide API contract shared by Miadi and the IronSilk tide runtime.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"publishConfig": {
|
|
@@ -24,7 +24,8 @@
|
|
|
24
24
|
],
|
|
25
25
|
"scripts": {
|
|
26
26
|
"build": "tsc",
|
|
27
|
-
"type-check": "tsc --noEmit"
|
|
27
|
+
"type-check": "tsc --noEmit",
|
|
28
|
+
"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"
|
|
28
29
|
},
|
|
29
30
|
"devDependencies": {
|
|
30
31
|
"typescript": "^5.4.0"
|
|
@@ -7,10 +7,131 @@
|
|
|
7
7
|
"cliCommand": "tide",
|
|
8
8
|
"stateRootEnv": "MIADI_HOME",
|
|
9
9
|
"defaultStateRoot": "~/.miadi/navigator",
|
|
10
|
-
"daemonContractVersion": "
|
|
10
|
+
"daemonContractVersion": "miadi.tide.daemon.v2"
|
|
11
11
|
},
|
|
12
12
|
"type": "object",
|
|
13
13
|
"$defs": {
|
|
14
|
+
"multiplexer": {
|
|
15
|
+
"type": "string",
|
|
16
|
+
"enum": ["tmux", "herdr"],
|
|
17
|
+
"description": "Terminal multiplexer discriminator. Absent means 'tmux' (the historical default), so pre-0.2.0 payloads stay valid."
|
|
18
|
+
},
|
|
19
|
+
"agentStatus": {
|
|
20
|
+
"type": "string",
|
|
21
|
+
"enum": ["idle", "working", "blocked", "done", "unknown"],
|
|
22
|
+
"description": "Agent status detected by herdr for a pane. 'done' means the agent finished but that pane has not been looked at yet."
|
|
23
|
+
},
|
|
24
|
+
"observerControllerPosture": {
|
|
25
|
+
"type": "string",
|
|
26
|
+
"enum": ["observer", "controller", "auto"],
|
|
27
|
+
"description": "Distinguishes read-only observer mode from controller mode where mutations (send/accept) are allowed."
|
|
28
|
+
},
|
|
29
|
+
"episodeLaneRole": {
|
|
30
|
+
"type": "string",
|
|
31
|
+
"enum": ["planning", "perspective", "delivery", "implementation", "custom"],
|
|
32
|
+
"description": "Semantic role of an episode lane (extensible via 'custom')."
|
|
33
|
+
},
|
|
34
|
+
"episodeLaneVerificationState": {
|
|
35
|
+
"type": "string",
|
|
36
|
+
"enum": ["verified", "unverified", "unknown"],
|
|
37
|
+
"description": "Whether a pane identity for this lane has been verified."
|
|
38
|
+
},
|
|
39
|
+
"episodeLane": {
|
|
40
|
+
"type": "object",
|
|
41
|
+
"additionalProperties": false,
|
|
42
|
+
"required": [
|
|
43
|
+
"episode_id",
|
|
44
|
+
"lane_id",
|
|
45
|
+
"lane_role",
|
|
46
|
+
"verification_state",
|
|
47
|
+
"safe_to_close",
|
|
48
|
+
"posture"
|
|
49
|
+
],
|
|
50
|
+
"properties": {
|
|
51
|
+
"episode_id": { "type": "string", "description": "Unique episode identifier." },
|
|
52
|
+
"lane_id": { "type": "string", "description": "Unique lane identifier within the episode (e.g., 'planning', 'delivery')." },
|
|
53
|
+
"lane_role": { "$ref": "#/$defs/episodeLaneRole" },
|
|
54
|
+
"pane_target": { "type": ["string", "null"], "pattern": "^(%?[0-9]+|[0-9]+-[0-9]+)$", "description": "Optional pane target: tmux pane id (e.g., '%76' or '76') or herdr pane id (e.g., '1-2')." },
|
|
55
|
+
"pane_label": { "type": ["string", "null"], "description": "Durable pane label. herdr pane ids are compact and non-durable, so label→id resolution happens at action time." },
|
|
56
|
+
"agent_status": { "$ref": "#/$defs/agentStatus" },
|
|
57
|
+
"verification_state": { "$ref": "#/$defs/episodeLaneVerificationState" },
|
|
58
|
+
"domain_id": { "type": ["string", "null"] },
|
|
59
|
+
"safe_to_close": { "type": "boolean", "description": "Whether this lane can be closed without losing work." },
|
|
60
|
+
"continuation_note": { "type": ["string", "null"], "description": "Path or inline text for resumption context." },
|
|
61
|
+
"posture": { "$ref": "#/$defs/observerControllerPosture", "description": "Explicit observer/controller boundary." }
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
"episodeLaneTopology": {
|
|
65
|
+
"type": "object",
|
|
66
|
+
"additionalProperties": false,
|
|
67
|
+
"required": ["episode_id", "session_name", "captured_at", "lanes"],
|
|
68
|
+
"properties": {
|
|
69
|
+
"episode_id": { "type": "string" },
|
|
70
|
+
"session_name": { "type": "string", "description": "tmux session name (e.g., 'miadi-episode-077-52')." },
|
|
71
|
+
"captured_at": { "type": "string" },
|
|
72
|
+
"lanes": { "type": "array", "items": { "$ref": "#/$defs/episodeLane" } }
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
"tideLaneCheckpoint": {
|
|
76
|
+
"type": "object",
|
|
77
|
+
"additionalProperties": false,
|
|
78
|
+
"required": ["checkpoint_at", "episode_id", "lane_id", "safe_to_close"],
|
|
79
|
+
"properties": {
|
|
80
|
+
"checkpoint_at": { "type": "string", "description": "ISO 8601 timestamp." },
|
|
81
|
+
"episode_id": { "type": "string" },
|
|
82
|
+
"lane_id": { "type": "string" },
|
|
83
|
+
"pane_target": { "type": ["string", "null"] },
|
|
84
|
+
"pane_label": { "type": ["string", "null"], "description": "Durable pane label for re-resolving the (non-durable) herdr pane id at action time." },
|
|
85
|
+
"continuation_note": { "type": ["string", "null"] },
|
|
86
|
+
"artifact_paths": { "type": "array", "items": { "type": "string" } },
|
|
87
|
+
"safe_to_close": { "type": "boolean" },
|
|
88
|
+
"checkpoint_path": { "type": ["string", "null"], "description": "Path to this checkpoint JSON file (for reference)." }
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
"tideResumeLink": {
|
|
92
|
+
"type": "object",
|
|
93
|
+
"additionalProperties": false,
|
|
94
|
+
"required": ["episode_id", "episode_folder", "resume_path"],
|
|
95
|
+
"properties": {
|
|
96
|
+
"episode_id": { "type": "string" },
|
|
97
|
+
"episode_folder": { "type": "string", "description": "Absolute path to episode folder." },
|
|
98
|
+
"resume_path": { "type": "string", "description": "Absolute path to RESUME.md." },
|
|
99
|
+
"summary_excerpt": { "type": ["string", "null"], "description": "First ~300 characters of RESUME.md body." },
|
|
100
|
+
"commit_sha": { "type": ["string", "null"] },
|
|
101
|
+
"produced_at": { "type": ["string", "null"] }
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
"tideAudioManifestLink": {
|
|
105
|
+
"type": "object",
|
|
106
|
+
"additionalProperties": false,
|
|
107
|
+
"required": ["episode_id", "episode_folder", "manifest_path", "entry_count"],
|
|
108
|
+
"properties": {
|
|
109
|
+
"episode_id": { "type": "string" },
|
|
110
|
+
"episode_folder": { "type": "string" },
|
|
111
|
+
"manifest_path": { "type": "string", "description": "Absolute path to AUDIO-MANIFEST.md." },
|
|
112
|
+
"entry_count": { "type": "integer", "minimum": 0 },
|
|
113
|
+
"last_mp3_path": { "type": ["string", "null"] },
|
|
114
|
+
"last_telegram_message_id": { "type": ["string", "null"] },
|
|
115
|
+
"updated_at": { "type": ["string", "null"] }
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
"tidePendingApproval": {
|
|
119
|
+
"type": "object",
|
|
120
|
+
"additionalProperties": false,
|
|
121
|
+
"required": ["approval_id", "episode_id", "action_type", "requires_controller", "created_at"],
|
|
122
|
+
"properties": {
|
|
123
|
+
"approval_id": { "type": "string" },
|
|
124
|
+
"episode_id": { "type": "string" },
|
|
125
|
+
"lane_id": { "type": ["string", "null"] },
|
|
126
|
+
"pane_target": { "type": ["string", "null"] },
|
|
127
|
+
"pane_label": { "type": ["string", "null"], "description": "Durable pane label for re-resolving the (non-durable) herdr pane id at action time." },
|
|
128
|
+
"agent_status": { "$ref": "#/$defs/agentStatus" },
|
|
129
|
+
"action_type": { "type": "string", "description": "e.g., 'steer', 'send', 'close', 'commit'." },
|
|
130
|
+
"proposal_text": { "type": ["string", "null"] },
|
|
131
|
+
"requires_controller": { "type": "boolean" },
|
|
132
|
+
"created_at": { "type": "string" }
|
|
133
|
+
}
|
|
134
|
+
},
|
|
14
135
|
"terminalContext": {
|
|
15
136
|
"type": "object",
|
|
16
137
|
"additionalProperties": false,
|
|
@@ -25,7 +146,8 @@
|
|
|
25
146
|
"captured_at"
|
|
26
147
|
],
|
|
27
148
|
"properties": {
|
|
28
|
-
"
|
|
149
|
+
"multiplexer": { "$ref": "#/$defs/multiplexer" },
|
|
150
|
+
"tmux_pane": { "type": "string", "pattern": "^(%?[0-9]+|[0-9]+-[0-9]+)$", "description": "Pane id in the owning multiplexer: tmux (e.g., '%56') or herdr (e.g., '1-2'). Field name is historical." },
|
|
29
151
|
"pid": { "type": "integer" },
|
|
30
152
|
"cwd": { "type": "string" },
|
|
31
153
|
"domain_id": { "type": ["string", "null"] },
|
|
@@ -130,12 +252,14 @@
|
|
|
130
252
|
"select_pane_command"
|
|
131
253
|
],
|
|
132
254
|
"properties": {
|
|
255
|
+
"multiplexer": { "$ref": "#/$defs/multiplexer" },
|
|
133
256
|
"terminal_id": { "type": "string" },
|
|
134
257
|
"session_id": { "type": "string" },
|
|
135
258
|
"session_name": { "type": "string" },
|
|
136
259
|
"window_id": { "type": "string" },
|
|
137
260
|
"window_name": { "type": "string" },
|
|
138
|
-
"pane_id": { "type": "string", "pattern": "
|
|
261
|
+
"pane_id": { "type": "string", "pattern": "^(%?[0-9]+|[0-9]+-[0-9]+)$", "description": "Pane id in the owning multiplexer: tmux (e.g., '%56') or herdr (e.g., '1-2')." },
|
|
262
|
+
"pane_label": { "type": "string", "description": "Durable pane label (herdr); resolve label→id at action time — herdr ids compact when panes close." },
|
|
139
263
|
"cwd": { "type": "string" },
|
|
140
264
|
"pane_active": { "type": "boolean" },
|
|
141
265
|
"session_attached": { "type": "integer", "minimum": 0 },
|
|
@@ -172,6 +296,44 @@
|
|
|
172
296
|
"looseOperatorResult": {
|
|
173
297
|
"type": "object",
|
|
174
298
|
"additionalProperties": true
|
|
299
|
+
},
|
|
300
|
+
"tmuxSendKeysResult": {
|
|
301
|
+
"type": "object",
|
|
302
|
+
"additionalProperties": false,
|
|
303
|
+
"required": ["target", "message", "submitted", "literal_command", "submit_command"],
|
|
304
|
+
"description": "Result/plan of a direct send-keys steer against a tmux pane. Byte-for-byte the pre-0.2.0 TideSendKeysResult shape: the discriminator is optional and absent means 'tmux'.",
|
|
305
|
+
"properties": {
|
|
306
|
+
"multiplexer": { "const": "tmux" },
|
|
307
|
+
"target": { "type": "string", "pattern": "^%?[0-9]+$", "description": "Resolved tmux pane target, %-prefixed after normalization (e.g., '%56')." },
|
|
308
|
+
"message": { "type": "string", "description": "The literal text typed into the pane." },
|
|
309
|
+
"submitted": { "type": "boolean", "description": "Whether a trailing Enter (C-m) was sent after the literal text." },
|
|
310
|
+
"literal_command": { "type": "array", "items": { "type": "string" }, "description": "Exact `tmux send-keys -l` argv used to type the literal text (no shell)." },
|
|
311
|
+
"submit_command": { "type": ["array", "null"], "items": { "type": "string" }, "description": "Exact `tmux send-keys … C-m` argv used to submit, or null when 'submitted' is false." },
|
|
312
|
+
"sent_at": { "type": "string", "description": "ISO timestamp the keys were sent (omitted on a dry-run plan)." }
|
|
313
|
+
}
|
|
314
|
+
},
|
|
315
|
+
"herdrSendKeysResult": {
|
|
316
|
+
"type": "object",
|
|
317
|
+
"additionalProperties": false,
|
|
318
|
+
"required": ["multiplexer", "target", "message", "submitted", "literal_command", "submit_command"],
|
|
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
|
+
"properties": {
|
|
321
|
+
"multiplexer": { "const": "herdr" },
|
|
322
|
+
"target": { "type": "string", "pattern": "^[0-9]+-[0-9]+$", "description": "Resolved herdr pane id (e.g., '1-2'). Compact and non-durable." },
|
|
323
|
+
"pane_label": { "type": "string", "description": "Durable pane label this target was resolved from, when label→id resolution ran." },
|
|
324
|
+
"message": { "type": "string", "description": "The literal text typed into the pane." },
|
|
325
|
+
"submitted": { "type": "boolean", "description": "Whether a real Enter key was sent after the literal text." },
|
|
326
|
+
"literal_command": { "type": "array", "items": { "type": "string" }, "description": "Exact herdr CLI argv used to type the literal text (e.g., ['pane','send-text','1-2', …])." },
|
|
327
|
+
"submit_command": { "type": ["array", "null"], "items": { "type": "string" }, "description": "Exact herdr CLI argv used to submit Enter (['pane','send-keys','1-2','Enter']), or null when 'submitted' is false." },
|
|
328
|
+
"sent_at": { "type": "string", "description": "ISO timestamp the keys were sent (omitted on a dry-run plan)." }
|
|
329
|
+
}
|
|
330
|
+
},
|
|
331
|
+
"sendKeysResult": {
|
|
332
|
+
"oneOf": [
|
|
333
|
+
{ "$ref": "#/$defs/tmuxSendKeysResult" },
|
|
334
|
+
{ "$ref": "#/$defs/herdrSendKeysResult" }
|
|
335
|
+
],
|
|
336
|
+
"description": "Discriminated union on 'multiplexer'; an absent discriminator means the tmux variant."
|
|
175
337
|
}
|
|
176
338
|
},
|
|
177
339
|
"properties": {
|
|
@@ -181,6 +343,12 @@
|
|
|
181
343
|
"detect": { "$ref": "#/$defs/detectResult" },
|
|
182
344
|
"peek": { "$ref": "#/$defs/looseOperatorResult" },
|
|
183
345
|
"steer": { "$ref": "#/$defs/looseOperatorResult" },
|
|
184
|
-
"send": { "$ref": "#/$defs/looseOperatorResult" }
|
|
346
|
+
"send": { "$ref": "#/$defs/looseOperatorResult" },
|
|
347
|
+
"sendKeys": { "$ref": "#/$defs/sendKeysResult" },
|
|
348
|
+
"episodeLaneTopology": { "$ref": "#/$defs/episodeLaneTopology" },
|
|
349
|
+
"tideLaneCheckpoint": { "$ref": "#/$defs/tideLaneCheckpoint" },
|
|
350
|
+
"tideResumeLink": { "$ref": "#/$defs/tideResumeLink" },
|
|
351
|
+
"tideAudioManifestLink": { "$ref": "#/$defs/tideAudioManifestLink" },
|
|
352
|
+
"tidePendingApproval": { "$ref": "#/$defs/tidePendingApproval" }
|
|
185
353
|
}
|
|
186
354
|
}
|