@brimveyn/aimux 1.16.3 → 1.18.2
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/package.json +4 -2
- package/src/app-runtime/backend-runtime-events.ts +179 -0
- package/src/app-runtime/side-effects.ts +3 -1
- package/src/app.tsx +26 -0
- package/src/cli/chord.ts +77 -0
- package/src/cli/client/bootstrap.ts +76 -0
- package/src/cli/client/daemon-client.ts +228 -0
- package/src/cli/client/workspace-resolver.ts +57 -0
- package/src/cli/commands/tab/close.ts +33 -0
- package/src/cli/commands/tab/create.ts +109 -0
- package/src/cli/commands/tab/focus.ts +33 -0
- package/src/cli/commands/tab/list.ts +52 -0
- package/src/cli/commands/tab/send.ts +83 -0
- package/src/cli/commands/tab/snapshot.ts +127 -0
- package/src/cli/commands/tab/tail.ts +171 -0
- package/src/cli/commands/tab/wait.ts +86 -0
- package/src/cli/commands/workspace/close.ts +32 -0
- package/src/cli/commands/workspace/create.ts +92 -0
- package/src/cli/commands/workspace/list.ts +25 -0
- package/src/cli/commands/workspace/show.ts +32 -0
- package/src/cli/commands/workspace/switch.ts +75 -0
- package/src/cli/commands/worktree/create.ts +113 -0
- package/src/cli/commands/worktree/list.ts +44 -0
- package/src/cli/commands/worktree/remove.ts +59 -0
- package/src/cli/context.ts +16 -0
- package/src/cli/flags.ts +101 -0
- package/src/cli/index.ts +258 -0
- package/src/cli/output.ts +30 -0
- package/src/cli/registry.ts +54 -0
- package/src/cli/snapshot-render.ts +54 -0
- package/src/daemon/catalog-writer.ts +123 -0
- package/src/daemon/daemon.ts +566 -11
- package/src/daemon/reexec-client.ts +147 -0
- package/src/daemon/runtime-paths.ts +161 -1
- package/src/daemon/session-registry.ts +17 -0
- package/src/index.tsx +80 -2
- package/src/input/modes/bridge.ts +6 -0
- package/src/input/modes/transitions.ts +2 -0
- package/src/input/modes/types.ts +1 -0
- package/src/ipc/README.md +112 -0
- package/src/ipc/manager-protocol.ts +54 -4
- package/src/ipc/protocol.ts +466 -25
- package/src/platform/daemon-control.ts +14 -0
- package/src/restart-daemon.ts +36 -4
- package/src/session-backend/bootstrap.ts +110 -0
- package/src/session-backend/local-session-backend.ts +6 -0
- package/src/session-backend/remote-session-backend.ts +63 -0
- package/src/session-backend/types.ts +34 -0
- package/src/state/reducers/modal-state.ts +66 -1
- package/src/state/types.ts +40 -0
- package/src/state/validation.ts +1 -1
- package/src/terminal-manager/manager-client.ts +24 -7
- package/src/ui/components/flash/flash-label-badge.tsx +38 -0
- package/src/ui/components/layout/sidebar/tab-item.tsx +2 -0
- package/src/ui/components/layout/sidebar/workspace-list.tsx +4 -0
- package/src/ui/components/layout/sidebar/worktree-row.tsx +2 -0
- package/src/ui/components/layout/top-tab-bar.tsx +2 -0
- package/src/ui/flash/assign-labels.ts +126 -0
- package/src/ui/flash/build-labels.ts +78 -0
- package/src/ui/hooks/use-flash-label.ts +40 -0
- package/src/ui/root.tsx +3 -0
|
@@ -34,10 +34,32 @@ import {
|
|
|
34
34
|
// is raised in lockstep to force matching binaries.
|
|
35
35
|
export const MANAGER_PROTOCOL_MIN_VERSION = 8
|
|
36
36
|
export const MANAGER_PROTOCOL_VERSION = 8
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Capability strings advertised by *this* process in its `helloResult`. New
|
|
40
|
+
* additive TM features should be introduced here rather than via a MIN bump
|
|
41
|
+
* — bumping MIN forces a fresh TM and kills every PTY. See
|
|
42
|
+
* `src/ipc/README.md`.
|
|
43
|
+
*/
|
|
44
|
+
export const MANAGER_PROTOCOL_CAPABILITIES: readonly string[] = [
|
|
45
|
+
'setBroadcastEnabled',
|
|
46
|
+
'createTabWorktreeId',
|
|
47
|
+
]
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Capability name a daemon must observe on the TM's helloResult before
|
|
51
|
+
* sending `setBroadcastEnabled`.
|
|
52
|
+
*/
|
|
53
|
+
export const MANAGER_CAPABILITY_SET_BROADCAST_ENABLED = 'setBroadcastEnabled'
|
|
54
|
+
|
|
37
55
|
/**
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
56
|
+
* Version-based fallback for `setBroadcastEnabled`. TM binaries that predate
|
|
57
|
+
* the capability field (built before the additive-contract migration) don't
|
|
58
|
+
* advertise capabilities, but any TM at v4+ speaks the request. Callers gate
|
|
59
|
+
* on `capabilities.has('setBroadcastEnabled') || selectedVersion >= this`.
|
|
60
|
+
*
|
|
61
|
+
* Rolling-upgrade window: new daemon + old TM (still v4+) would otherwise
|
|
62
|
+
* silently regress to always-broadcasting, spiking CPU and IPC traffic.
|
|
41
63
|
*/
|
|
42
64
|
export const MANAGER_PROTOCOL_BROADCAST_GATE_VERSION = 4
|
|
43
65
|
|
|
@@ -51,6 +73,11 @@ export interface ManagerHelloResult {
|
|
|
51
73
|
maxVersion: number
|
|
52
74
|
processVersion: string
|
|
53
75
|
selectedVersion: number
|
|
76
|
+
/**
|
|
77
|
+
* Feature flags. Always present on the typed shape; older peers that did
|
|
78
|
+
* not yet advertise capabilities are normalised to `[]` at parse time.
|
|
79
|
+
*/
|
|
80
|
+
capabilities: string[]
|
|
54
81
|
}
|
|
55
82
|
|
|
56
83
|
export interface ManagerAttachRequest {
|
|
@@ -85,6 +112,13 @@ export type ManagerRequest =
|
|
|
85
112
|
cwd?: string
|
|
86
113
|
/** Extra env vars merged into the spawned PTY's environment. */
|
|
87
114
|
env?: Record<string, string>
|
|
115
|
+
/**
|
|
116
|
+
* Worktree this tab belongs to (UI grouping). Capability-gated on
|
|
117
|
+
* `createTabWorktreeId`. Pre-cap TMs silently drop the field, which
|
|
118
|
+
* matches the previous behaviour where every new tab had
|
|
119
|
+
* `worktreeId = undefined`.
|
|
120
|
+
*/
|
|
121
|
+
worktreeId?: string
|
|
88
122
|
}
|
|
89
123
|
}
|
|
90
124
|
| { id: string; type: 'write'; payload: { sessionId: string; tabId: string; data: string } }
|
|
@@ -240,7 +274,10 @@ function isHelloResult(value: unknown): value is ManagerHelloResult {
|
|
|
240
274
|
isFiniteNumber(value.minVersion) &&
|
|
241
275
|
isFiniteNumber(value.maxVersion) &&
|
|
242
276
|
isFiniteNumber(value.selectedVersion) &&
|
|
243
|
-
isString(value.processVersion)
|
|
277
|
+
isString(value.processVersion) &&
|
|
278
|
+
// Wire-back-compat: legacy peers omit capabilities entirely. The parser
|
|
279
|
+
// normalises that to `[]` before returning the typed shape.
|
|
280
|
+
(value.capabilities === undefined || isStringArray(value.capabilities))
|
|
244
281
|
)
|
|
245
282
|
}
|
|
246
283
|
|
|
@@ -250,6 +287,12 @@ function assert(condition: boolean, message: string): asserts condition {
|
|
|
250
287
|
}
|
|
251
288
|
}
|
|
252
289
|
|
|
290
|
+
function normaliseManagerCapabilities(payload: Record<string, unknown>): void {
|
|
291
|
+
if (!Array.isArray(payload.capabilities)) {
|
|
292
|
+
payload.capabilities = []
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
|
|
253
296
|
export function selectManagerProtocolVersion(payload: ManagerHelloRequest): number | null {
|
|
254
297
|
return negotiateProtocolVersion(
|
|
255
298
|
payload.minVersion,
|
|
@@ -261,6 +304,7 @@ export function selectManagerProtocolVersion(payload: ManagerHelloRequest): numb
|
|
|
261
304
|
|
|
262
305
|
export function createManagerHelloResult(selectedVersion: number): ManagerHelloResult {
|
|
263
306
|
return {
|
|
307
|
+
capabilities: [...MANAGER_PROTOCOL_CAPABILITIES],
|
|
264
308
|
maxVersion: MANAGER_PROTOCOL_VERSION,
|
|
265
309
|
minVersion: MANAGER_PROTOCOL_MIN_VERSION,
|
|
266
310
|
processVersion: getProcessVersion(),
|
|
@@ -316,6 +360,10 @@ export function parseManagerRequest(value: unknown): ManagerRequest {
|
|
|
316
360
|
value.payload.env === undefined || isStringRecord(value.payload.env),
|
|
317
361
|
'createTab.env must be a string-keyed string record'
|
|
318
362
|
)
|
|
363
|
+
assert(
|
|
364
|
+
value.payload.worktreeId === undefined || isString(value.payload.worktreeId),
|
|
365
|
+
'createTab.worktreeId must be a string when present'
|
|
366
|
+
)
|
|
319
367
|
return value as ManagerRequest
|
|
320
368
|
case 'write':
|
|
321
369
|
assert(isString(value.payload.sessionId), 'write.sessionId must be a string')
|
|
@@ -375,6 +423,8 @@ export function parseManagerMessage(value: unknown): ManagerResponse | ManagerEv
|
|
|
375
423
|
case 'helloResult':
|
|
376
424
|
assert(isString(value.id), 'helloResult.id must be a string')
|
|
377
425
|
assert(isHelloResult(value.payload), 'helloResult.payload is invalid')
|
|
426
|
+
// Normalise wire-back-compat: pre-capability TMs omit the field.
|
|
427
|
+
normaliseManagerCapabilities(value.payload)
|
|
378
428
|
return value as ManagerResponse
|
|
379
429
|
case 'ok':
|
|
380
430
|
assert(isString(value.id), 'ok.id must be a string')
|