tmux-ide 2.9.0-beta.14 → 2.9.0-beta.15
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/bin/cli.js +314 -233
- package/package.json +1 -1
- package/packages/contracts/src/__tests__/pane-stream.test.ts +36 -0
- package/packages/contracts/src/desktop-host.ts +3 -0
- package/packages/contracts/src/index.ts +2 -0
- package/packages/contracts/src/pane-stream.ts +5 -1
- package/packages/contracts/src/semantic-icons.ts +47 -0
- package/packages/daemon/dist/command-center/server.js +14 -0
- package/packages/daemon/dist/terminal/mirror/mirror-service.js +11 -0
- package/packages/daemon/dist/terminal/mirror/session-channel.js +44 -0
- package/packages/daemon/dist/terminal/pane-stream/pane-stream-websocket.js +4 -1
- package/packages/daemon/dist/terminal/session-runtime/registry.js +18 -9
- package/packages/daemon/dist/terminal/session-runtime/transport-binding.js +9 -3
- package/packages/daemon/src/command-center/server.ts +14 -0
- package/packages/daemon/src/terminal/mirror/mirror-service.ts +11 -0
- package/packages/daemon/src/terminal/mirror/session-channel.ts +45 -0
- package/packages/daemon/src/terminal/pane-stream/pane-stream-websocket.ts +15 -2
- package/packages/daemon/src/terminal/session-runtime/registry.ts +36 -10
- package/packages/daemon/src/terminal/session-runtime/transport-binding.ts +11 -3
- package/packages/daemon-client/src/pane-stream-client.ts +14 -3
- package/packages/daemon-client/src/workspace-client-types.ts +6 -1
- package/packages/daemon-client/src/workspace-client.test.ts +44 -3
- package/packages/daemon-client/src/workspace-client.ts +4 -1
package/bin/cli.js
CHANGED
|
@@ -4976,6 +4976,7 @@ var init_pane_stream = __esm({
|
|
|
4976
4976
|
}).strict())();
|
|
4977
4977
|
PaneStreamViewportFrameSchemaZ = /* @__PURE__ */ (() => z39.object({
|
|
4978
4978
|
type: z39.literal("viewport"),
|
|
4979
|
+
semanticWindowId: TerminalAttachmentSemanticWindowIdSchemaZ.optional(),
|
|
4979
4980
|
seq: z39.number().int().positive().max(PANE_STREAM_MAX_INPUT_SEQUENCE),
|
|
4980
4981
|
cols: z39.number().int().min(2).max(PANE_STREAM_MAX_GRID_CELLS),
|
|
4981
4982
|
rows: z39.number().int().min(2).max(PANE_STREAM_MAX_GRID_CELLS),
|
|
@@ -7413,7 +7414,8 @@ var init_desktop_host = __esm({
|
|
|
7413
7414
|
status: z54.literal("ok"),
|
|
7414
7415
|
daemon: DaemonInstanceIdentitySchemaZ,
|
|
7415
7416
|
capabilities: z54.object({
|
|
7416
|
-
appWindowMutation: CommandAvailabilitySchemaZ
|
|
7417
|
+
appWindowMutation: CommandAvailabilitySchemaZ,
|
|
7418
|
+
semanticWindowViewport: CommandAvailabilitySchemaZ.optional()
|
|
7417
7419
|
}).strict()
|
|
7418
7420
|
}).strict(),
|
|
7419
7421
|
z54.object({ status: z54.literal("error"), error: DesktopDaemonCapabilityErrorSchemaZ }).strict()
|
|
@@ -8232,6 +8234,14 @@ var init_saved_machines = __esm({
|
|
|
8232
8234
|
}
|
|
8233
8235
|
});
|
|
8234
8236
|
|
|
8237
|
+
// packages/contracts/src/semantic-icons.ts
|
|
8238
|
+
import { z as z65 } from "zod";
|
|
8239
|
+
var init_semantic_icons = __esm({
|
|
8240
|
+
"packages/contracts/src/semantic-icons.ts"() {
|
|
8241
|
+
"use strict";
|
|
8242
|
+
}
|
|
8243
|
+
});
|
|
8244
|
+
|
|
8235
8245
|
// packages/contracts/src/index.ts
|
|
8236
8246
|
var init_src = __esm({
|
|
8237
8247
|
"packages/contracts/src/index.ts"() {
|
|
@@ -8307,6 +8317,7 @@ var init_src = __esm({
|
|
|
8307
8317
|
init_shared_monotonic_clock();
|
|
8308
8318
|
init_visual_theme_presets();
|
|
8309
8319
|
init_saved_machines();
|
|
8320
|
+
init_semantic_icons();
|
|
8310
8321
|
}
|
|
8311
8322
|
});
|
|
8312
8323
|
|
|
@@ -10248,7 +10259,7 @@ var require_package = __commonJS({
|
|
|
10248
10259
|
"package.json"(exports, module) {
|
|
10249
10260
|
module.exports = {
|
|
10250
10261
|
name: "tmux-ide",
|
|
10251
|
-
version: "2.9.0-beta.
|
|
10262
|
+
version: "2.9.0-beta.15",
|
|
10252
10263
|
description: "A visual, agent-aware IDE for any tmux session, with optional workspace presets",
|
|
10253
10264
|
type: "module",
|
|
10254
10265
|
bin: {
|
|
@@ -10599,21 +10610,21 @@ var init_classify = __esm({
|
|
|
10599
10610
|
});
|
|
10600
10611
|
|
|
10601
10612
|
// packages/daemon/src/schemas/registry.ts
|
|
10602
|
-
import { z as
|
|
10613
|
+
import { z as z66 } from "zod";
|
|
10603
10614
|
var RegisteredProjectSchemaZ, RegisterProjectRequestSchemaZ, InitProjectRequestSchemaZ;
|
|
10604
10615
|
var init_registry = __esm({
|
|
10605
10616
|
"packages/daemon/src/schemas/registry.ts"() {
|
|
10606
10617
|
"use strict";
|
|
10607
10618
|
init_src();
|
|
10608
10619
|
RegisteredProjectSchemaZ = DaemonRegisteredProjectSchemaZ;
|
|
10609
|
-
RegisterProjectRequestSchemaZ =
|
|
10610
|
-
dir:
|
|
10611
|
-
name:
|
|
10612
|
-
persistence:
|
|
10620
|
+
RegisterProjectRequestSchemaZ = z66.object({
|
|
10621
|
+
dir: z66.string().min(1),
|
|
10622
|
+
name: z66.string().min(1).optional(),
|
|
10623
|
+
persistence: z66.enum(["durable", "volatile"]).optional()
|
|
10613
10624
|
});
|
|
10614
|
-
InitProjectRequestSchemaZ =
|
|
10615
|
-
dir:
|
|
10616
|
-
template:
|
|
10625
|
+
InitProjectRequestSchemaZ = z66.object({
|
|
10626
|
+
dir: z66.string().min(1),
|
|
10627
|
+
template: z66.string().min(1).optional()
|
|
10617
10628
|
});
|
|
10618
10629
|
}
|
|
10619
10630
|
});
|
|
@@ -10883,7 +10894,7 @@ var init_project_probe = __esm({
|
|
|
10883
10894
|
import { EventEmitter } from "node:events";
|
|
10884
10895
|
import { existsSync as existsSync7, mkdirSync as mkdirSync6, readFileSync as readFileSync6, renameSync as renameSync4, writeFileSync as writeFileSync5 } from "node:fs";
|
|
10885
10896
|
import { dirname as dirname9, isAbsolute as isAbsolute5, join as join10, resolve as resolve6 } from "node:path";
|
|
10886
|
-
import { z as
|
|
10897
|
+
import { z as z67 } from "zod";
|
|
10887
10898
|
function applyAction(state, action) {
|
|
10888
10899
|
switch (action.type) {
|
|
10889
10900
|
case "register":
|
|
@@ -11042,9 +11053,9 @@ var init_project_registry = __esm({
|
|
|
11042
11053
|
init_registry();
|
|
11043
11054
|
init_project_probe();
|
|
11044
11055
|
init_runtime_namespace();
|
|
11045
|
-
RegistryFileSchemaZ =
|
|
11046
|
-
version:
|
|
11047
|
-
projects:
|
|
11056
|
+
RegistryFileSchemaZ = z67.object({
|
|
11057
|
+
version: z67.literal(1),
|
|
11058
|
+
projects: z67.array(RegisteredProjectSchemaZ)
|
|
11048
11059
|
});
|
|
11049
11060
|
ProjectRegistryError = class extends Error {
|
|
11050
11061
|
code;
|
|
@@ -14312,7 +14323,7 @@ var init_notify_state = __esm({
|
|
|
14312
14323
|
import { existsSync as existsSync16, mkdirSync as mkdirSync13, readFileSync as readFileSync13, renameSync as renameSync7, writeFileSync as writeFileSync11 } from "node:fs";
|
|
14313
14324
|
import { homedir as homedir12 } from "node:os";
|
|
14314
14325
|
import { dirname as dirname16, join as join19 } from "node:path";
|
|
14315
|
-
import { z as
|
|
14326
|
+
import { z as z68 } from "zod";
|
|
14316
14327
|
function isBareShell(cmd) {
|
|
14317
14328
|
return /^-?(zsh|bash|sh|fish|dash|ksh|tcsh|csh|nu)$/.test(cmd.trim());
|
|
14318
14329
|
}
|
|
@@ -14484,32 +14495,32 @@ var init_snapshot2 = __esm({
|
|
|
14484
14495
|
init_src2();
|
|
14485
14496
|
init_process_tree();
|
|
14486
14497
|
init_sessions2();
|
|
14487
|
-
PaneSnapshotSchemaZ =
|
|
14488
|
-
index:
|
|
14489
|
-
cwd:
|
|
14490
|
-
command:
|
|
14491
|
-
agent:
|
|
14492
|
-
agentSessionId:
|
|
14493
|
-
agentState:
|
|
14494
|
-
title:
|
|
14498
|
+
PaneSnapshotSchemaZ = z68.object({
|
|
14499
|
+
index: z68.number(),
|
|
14500
|
+
cwd: z68.string(),
|
|
14501
|
+
command: z68.string().nullable(),
|
|
14502
|
+
agent: z68.string().nullable(),
|
|
14503
|
+
agentSessionId: z68.string().nullable(),
|
|
14504
|
+
agentState: z68.string().nullable(),
|
|
14505
|
+
title: z68.string()
|
|
14495
14506
|
});
|
|
14496
|
-
WindowSnapshotSchemaZ =
|
|
14497
|
-
index:
|
|
14498
|
-
name:
|
|
14499
|
-
active:
|
|
14500
|
-
layout:
|
|
14501
|
-
panes:
|
|
14507
|
+
WindowSnapshotSchemaZ = z68.object({
|
|
14508
|
+
index: z68.number(),
|
|
14509
|
+
name: z68.string(),
|
|
14510
|
+
active: z68.boolean(),
|
|
14511
|
+
layout: z68.string(),
|
|
14512
|
+
panes: z68.array(PaneSnapshotSchemaZ)
|
|
14502
14513
|
});
|
|
14503
|
-
SessionSnapshotSchemaZ =
|
|
14504
|
-
name:
|
|
14505
|
-
cwd:
|
|
14506
|
-
adopted:
|
|
14507
|
-
windows:
|
|
14514
|
+
SessionSnapshotSchemaZ = z68.object({
|
|
14515
|
+
name: z68.string(),
|
|
14516
|
+
cwd: z68.string(),
|
|
14517
|
+
adopted: z68.boolean(),
|
|
14518
|
+
windows: z68.array(WindowSnapshotSchemaZ)
|
|
14508
14519
|
});
|
|
14509
|
-
FleetSnapshotSchemaZ =
|
|
14510
|
-
version:
|
|
14511
|
-
savedAt:
|
|
14512
|
-
sessions:
|
|
14520
|
+
FleetSnapshotSchemaZ = z68.object({
|
|
14521
|
+
version: z68.literal(1),
|
|
14522
|
+
savedAt: z68.string(),
|
|
14523
|
+
sessions: z68.array(SessionSnapshotSchemaZ)
|
|
14513
14524
|
});
|
|
14514
14525
|
SNAPSHOT_PANE_FORMAT = [
|
|
14515
14526
|
"#{session_name}",
|
|
@@ -16808,7 +16819,7 @@ import { createRequire } from "node:module";
|
|
|
16808
16819
|
import { randomUUID as randomUUID4 } from "node:crypto";
|
|
16809
16820
|
import { basename as basename8, dirname as dirname20, resolve as resolve13 } from "node:path";
|
|
16810
16821
|
import { fileURLToPath as fileURLToPath6 } from "node:url";
|
|
16811
|
-
import { z as
|
|
16822
|
+
import { z as z69 } from "zod";
|
|
16812
16823
|
function defaultCliEntryPath() {
|
|
16813
16824
|
if (process.env.TMUX_IDE_CLI) return resolve13(process.env.TMUX_IDE_CLI);
|
|
16814
16825
|
const current = fileURLToPath6(import.meta.url);
|
|
@@ -16903,7 +16914,7 @@ async function tryDispatchAction(name, input, options = {}) {
|
|
|
16903
16914
|
details: failure2.data.error.details
|
|
16904
16915
|
});
|
|
16905
16916
|
}
|
|
16906
|
-
const success =
|
|
16917
|
+
const success = z69.object({ ok: z69.literal(true), result: contract.result }).safeParse(body);
|
|
16907
16918
|
if (success.success) return success.data.result;
|
|
16908
16919
|
}
|
|
16909
16920
|
return null;
|
|
@@ -16916,12 +16927,12 @@ var init_cli_action_bridge = __esm({
|
|
|
16916
16927
|
init_canonical_daemon();
|
|
16917
16928
|
init_canonical_daemon_bootstrap();
|
|
16918
16929
|
init_pane_source_credentials();
|
|
16919
|
-
FailureEnvelopeZ =
|
|
16920
|
-
ok:
|
|
16921
|
-
error:
|
|
16922
|
-
code:
|
|
16923
|
-
message:
|
|
16924
|
-
details:
|
|
16930
|
+
FailureEnvelopeZ = z69.object({
|
|
16931
|
+
ok: z69.literal(false),
|
|
16932
|
+
error: z69.object({
|
|
16933
|
+
code: z69.string(),
|
|
16934
|
+
message: z69.string(),
|
|
16935
|
+
details: z69.unknown().optional()
|
|
16925
16936
|
})
|
|
16926
16937
|
});
|
|
16927
16938
|
RETRY_SAFE_OWNER_ACTIONS = /* @__PURE__ */ new Set([
|
|
@@ -16965,7 +16976,7 @@ var init_cli_action_bridge = __esm({
|
|
|
16965
16976
|
import { EventEmitter as EventEmitter2 } from "node:events";
|
|
16966
16977
|
import { existsSync as existsSync20, mkdirSync as mkdirSync15, readFileSync as readFileSync17, renameSync as renameSync9, writeFileSync as writeFileSync13 } from "node:fs";
|
|
16967
16978
|
import { dirname as dirname21, join as join22 } from "node:path";
|
|
16968
|
-
import { z as
|
|
16979
|
+
import { z as z70 } from "zod";
|
|
16969
16980
|
function isSessionInventory(value) {
|
|
16970
16981
|
return !Array.isArray(value);
|
|
16971
16982
|
}
|
|
@@ -17042,9 +17053,9 @@ var init_workspace_registry = __esm({
|
|
|
17042
17053
|
"use strict";
|
|
17043
17054
|
init_src();
|
|
17044
17055
|
init_runtime_namespace();
|
|
17045
|
-
RegistryFileSchemaZ2 =
|
|
17046
|
-
version:
|
|
17047
|
-
workspaces:
|
|
17056
|
+
RegistryFileSchemaZ2 = z70.object({
|
|
17057
|
+
version: z70.literal(1),
|
|
17058
|
+
workspaces: z70.array(WorkspaceSchemaZ)
|
|
17048
17059
|
});
|
|
17049
17060
|
WORKSPACE_REGISTRY_TMUX_TIMEOUT_MS = 2e3;
|
|
17050
17061
|
WorkspaceAlreadyExistsError = class extends Error {
|
|
@@ -18317,7 +18328,7 @@ var init_native_grid_capture = __esm({
|
|
|
18317
18328
|
});
|
|
18318
18329
|
|
|
18319
18330
|
// packages/daemon/src/command-center/resources/terminal-native-backing-route.ts
|
|
18320
|
-
import { z as
|
|
18331
|
+
import { z as z71 } from "zod";
|
|
18321
18332
|
function mountTerminalNativeBackingRoute(app, options) {
|
|
18322
18333
|
const authorize = ownerAuthorityGate(options.ownerToken, {
|
|
18323
18334
|
whenOwnerless: "unavailable",
|
|
@@ -18383,11 +18394,11 @@ var init_terminal_native_backing_route = __esm({
|
|
|
18383
18394
|
"use strict";
|
|
18384
18395
|
init_owner_authority();
|
|
18385
18396
|
init_native_grid_capture();
|
|
18386
|
-
requestSchema =
|
|
18387
|
-
generation:
|
|
18388
|
-
incarnation:
|
|
18389
|
-
revision:
|
|
18390
|
-
stateHash:
|
|
18397
|
+
requestSchema = z71.object({
|
|
18398
|
+
generation: z71.uuid(),
|
|
18399
|
+
incarnation: z71.string().min(1).max(512),
|
|
18400
|
+
revision: z71.coerce.number().int().nonnegative(),
|
|
18401
|
+
stateHash: z71.string().min(1).max(128)
|
|
18391
18402
|
}).strict();
|
|
18392
18403
|
}
|
|
18393
18404
|
});
|
|
@@ -26416,7 +26427,7 @@ var init_workspace_pane_creation2 = __esm({
|
|
|
26416
26427
|
});
|
|
26417
26428
|
|
|
26418
26429
|
// packages/daemon/src/terminal/attachments/semantic-pane-catalog.ts
|
|
26419
|
-
import { z as
|
|
26430
|
+
import { z as z72 } from "zod";
|
|
26420
26431
|
function analyzeTrustedSemanticPaneCatalog(candidates) {
|
|
26421
26432
|
const rows = [];
|
|
26422
26433
|
let invalidRuntimeProof = false;
|
|
@@ -26465,18 +26476,18 @@ var init_semantic_pane_catalog = __esm({
|
|
|
26465
26476
|
"packages/daemon/src/terminal/attachments/semantic-pane-catalog.ts"() {
|
|
26466
26477
|
"use strict";
|
|
26467
26478
|
init_src();
|
|
26468
|
-
RuntimeSessionIdSchemaZ =
|
|
26469
|
-
RuntimeWindowIdSchemaZ =
|
|
26470
|
-
RuntimePaneIdSchemaZ =
|
|
26471
|
-
TrustedSemanticPaneSnapshotSchemaZ =
|
|
26479
|
+
RuntimeSessionIdSchemaZ = z72.string().max(32).regex(/^\$(?:0|[1-9][0-9]*)$/u);
|
|
26480
|
+
RuntimeWindowIdSchemaZ = z72.string().max(32).regex(/^@(?:0|[1-9][0-9]*)$/u);
|
|
26481
|
+
RuntimePaneIdSchemaZ = z72.string().max(32).regex(/^%(?:0|[1-9][0-9]*)$/u);
|
|
26482
|
+
TrustedSemanticPaneSnapshotSchemaZ = z72.object({
|
|
26472
26483
|
workspaceName: WorkspaceIdSchemaZ,
|
|
26473
26484
|
semanticPaneId: TerminalAttachmentSemanticPaneIdSchemaZ.nullable(),
|
|
26474
26485
|
windowStamp: TerminalAttachmentSemanticWindowIdSchemaZ.nullable().optional(),
|
|
26475
26486
|
sessionId: RuntimeSessionIdSchemaZ,
|
|
26476
26487
|
windowId: RuntimeWindowIdSchemaZ,
|
|
26477
26488
|
runtimePaneId: RuntimePaneIdSchemaZ,
|
|
26478
|
-
windowPaneCount:
|
|
26479
|
-
sessionWindowCount:
|
|
26489
|
+
windowPaneCount: z72.number().int().positive(),
|
|
26490
|
+
sessionWindowCount: z72.number().int().positive()
|
|
26480
26491
|
}).strict();
|
|
26481
26492
|
SemanticPaneCatalogError = class extends Error {
|
|
26482
26493
|
code;
|
|
@@ -26499,7 +26510,7 @@ var init_semantic_pane_catalog = __esm({
|
|
|
26499
26510
|
}
|
|
26500
26511
|
/** Resolves a pane set from one trusted discovery snapshot. */
|
|
26501
26512
|
async resolveMany(targets) {
|
|
26502
|
-
const parsedTargets =
|
|
26513
|
+
const parsedTargets = z72.array(TerminalAttachmentSemanticTargetSchemaZ).min(1).max(4096).parse(targets);
|
|
26503
26514
|
const diagnosticTarget = parsedTargets[0];
|
|
26504
26515
|
let discovered;
|
|
26505
26516
|
try {
|
|
@@ -32884,7 +32895,7 @@ var init_app_window_mutation2 = __esm({
|
|
|
32884
32895
|
|
|
32885
32896
|
// packages/daemon/src/lib/tmux-external-interaction-observer.ts
|
|
32886
32897
|
import { execFile as execFile10 } from "node:child_process";
|
|
32887
|
-
import { z as
|
|
32898
|
+
import { z as z73 } from "zod";
|
|
32888
32899
|
function socketArguments(authority) {
|
|
32889
32900
|
return authority.socketSelector.kind === "path" ? ["-S", authority.socketSelector.path] : ["-L", authority.socketSelector.name];
|
|
32890
32901
|
}
|
|
@@ -33220,7 +33231,7 @@ var init_tmux_external_interaction_observer = __esm({
|
|
|
33220
33231
|
}
|
|
33221
33232
|
const ownPrefix = `${this.#daemonInstanceId}:`;
|
|
33222
33233
|
const authoredOperationId = record.operationMarker?.startsWith(ownPrefix) ? record.operationMarker.slice(ownPrefix.length) : null;
|
|
33223
|
-
const operationId =
|
|
33234
|
+
const operationId = z73.uuid().safeParse(authoredOperationId);
|
|
33224
33235
|
let identity;
|
|
33225
33236
|
try {
|
|
33226
33237
|
identity = await this.#io.runTmux(
|
|
@@ -34421,7 +34432,7 @@ var init_workspace_multiplexer_verbs = __esm({
|
|
|
34421
34432
|
|
|
34422
34433
|
// packages/daemon/src/terminal/session-runtime/runtime-observability.ts
|
|
34423
34434
|
import { randomUUID as randomUUID10 } from "node:crypto";
|
|
34424
|
-
import { z as
|
|
34435
|
+
import { z as z74 } from "zod";
|
|
34425
34436
|
function createSessionRuntimeObservability(options = {}) {
|
|
34426
34437
|
const capacity = options.capacity ?? 1024;
|
|
34427
34438
|
if (!Number.isInteger(capacity) || capacity < 1 || capacity > 65536)
|
|
@@ -34439,7 +34450,7 @@ function createSessionRuntimeObservability(options = {}) {
|
|
|
34439
34450
|
nowMicros,
|
|
34440
34451
|
beginTrace(scenario, authority, traceId) {
|
|
34441
34452
|
return Object.freeze({
|
|
34442
|
-
traceId:
|
|
34453
|
+
traceId: z74.uuid().parse(traceId ?? createTraceId()),
|
|
34443
34454
|
scenario,
|
|
34444
34455
|
authority
|
|
34445
34456
|
});
|
|
@@ -36312,6 +36323,7 @@ var init_session_channel = __esm({
|
|
|
36312
36323
|
ageByRuntime = /* @__PURE__ */ new Map();
|
|
36313
36324
|
maxAgeMs = 0;
|
|
36314
36325
|
geometryParticipating = false;
|
|
36326
|
+
fittedWindows = /* @__PURE__ */ new Map();
|
|
36315
36327
|
cancelSync = null;
|
|
36316
36328
|
lastDisplayNameSyncAtMs = 0;
|
|
36317
36329
|
disposed = false;
|
|
@@ -36669,10 +36681,42 @@ var init_session_channel = __esm({
|
|
|
36669
36681
|
throw new RangeError("viewport must contain positive bounded terminal cells");
|
|
36670
36682
|
}
|
|
36671
36683
|
this.input.flush();
|
|
36684
|
+
this.clearWindowViewports();
|
|
36672
36685
|
this.io.send(`refresh-client -C ${cols}x${rows}`);
|
|
36673
36686
|
}
|
|
36687
|
+
/**
|
|
36688
|
+
* Experimental: window-specific overrides stay private to this control client.
|
|
36689
|
+
* Native tmux still falls back to the client size for unscoped neighbours;
|
|
36690
|
+
* do not advertise isolated fitting until that behavior is accounted for.
|
|
36691
|
+
*/
|
|
36692
|
+
fitWindowViewport(semanticWindowId, cols, rows) {
|
|
36693
|
+
if (!Number.isSafeInteger(cols) || !Number.isSafeInteger(rows) || cols < 2 || rows < 2 || cols > 4096 || rows > 4096) {
|
|
36694
|
+
throw new RangeError("viewport must contain positive bounded terminal cells");
|
|
36695
|
+
}
|
|
36696
|
+
const window2 = [...this.windowsByRuntime.values()].find(
|
|
36697
|
+
(entry) => entry.semanticId === semanticWindowId
|
|
36698
|
+
);
|
|
36699
|
+
if (!window2 || !/^@[0-9]+$/u.test(window2.runtimeId)) {
|
|
36700
|
+
throw new Error("unknown semantic window in this session");
|
|
36701
|
+
}
|
|
36702
|
+
const previous = this.fittedWindows.get(window2.runtimeId);
|
|
36703
|
+
if (previous?.cols === cols && previous.rows === rows) return;
|
|
36704
|
+
this.input.flush();
|
|
36705
|
+
this.io.send(`refresh-client -C ${window2.runtimeId}:${cols}x${rows}`);
|
|
36706
|
+
this.fittedWindows.set(window2.runtimeId, { cols, rows });
|
|
36707
|
+
}
|
|
36708
|
+
/** Must also run on geometry-owner handoff, before the next owner fits. */
|
|
36709
|
+
clearWindowViewports() {
|
|
36710
|
+
if (!this.fittedWindows.size) return;
|
|
36711
|
+
this.input.flush();
|
|
36712
|
+
for (const runtimeId of this.fittedWindows.keys()) {
|
|
36713
|
+
if (this.windowsByRuntime.has(runtimeId)) this.io.send(`refresh-client -C ${runtimeId}:`);
|
|
36714
|
+
}
|
|
36715
|
+
this.fittedWindows.clear();
|
|
36716
|
+
}
|
|
36674
36717
|
/** Toggle whether the retained control client participates in tmux sizing. */
|
|
36675
36718
|
setGeometryParticipation(active2) {
|
|
36719
|
+
if (!active2) this.clearWindowViewports();
|
|
36676
36720
|
if (this.geometryParticipating === active2) return;
|
|
36677
36721
|
this.geometryParticipating = active2;
|
|
36678
36722
|
this.input.flush();
|
|
@@ -38316,6 +38360,8 @@ var init_session_channel = __esm({
|
|
|
38316
38360
|
if (stage.windows.has(stage.currentWindow)) changedWindows.add(stage.currentWindow);
|
|
38317
38361
|
}
|
|
38318
38362
|
this.currentWindow = stage.currentWindow;
|
|
38363
|
+
for (const runtimeId of this.fittedWindows.keys())
|
|
38364
|
+
if (!stage.windows.has(runtimeId)) this.fittedWindows.delete(runtimeId);
|
|
38319
38365
|
this.windowsByRuntime.clear();
|
|
38320
38366
|
for (const [key, value] of stage.windows) this.windowsByRuntime.set(key, value);
|
|
38321
38367
|
this.layoutByWindow.clear();
|
|
@@ -38846,6 +38892,15 @@ var init_mirror_service = __esm({
|
|
|
38846
38892
|
if (!entry || entry.retired) throw new Error(`Mirror session ${session} is unavailable`);
|
|
38847
38893
|
entry.channel.fitViewport(cols, rows);
|
|
38848
38894
|
}
|
|
38895
|
+
fitWindowViewport(session, semanticWindowId, cols, rows) {
|
|
38896
|
+
const entry = this.channels.get(session);
|
|
38897
|
+
if (!entry || entry.retired) throw new Error(`Mirror session ${session} is unavailable`);
|
|
38898
|
+
entry.channel.fitWindowViewport(semanticWindowId, cols, rows);
|
|
38899
|
+
}
|
|
38900
|
+
clearWindowViewports(session) {
|
|
38901
|
+
const entry = this.channels.get(session);
|
|
38902
|
+
if (entry && !entry.retired) entry.channel.clearWindowViewports();
|
|
38903
|
+
}
|
|
38849
38904
|
/** Keep the retained control client passive unless the arbiter elects it. */
|
|
38850
38905
|
setGeometryParticipation(session, active2) {
|
|
38851
38906
|
const entry = this.channels.get(session);
|
|
@@ -39211,7 +39266,7 @@ var init_semantic_mutation_resource_changes = __esm({
|
|
|
39211
39266
|
});
|
|
39212
39267
|
|
|
39213
39268
|
// packages/daemon/src/terminal/session-runtime/semantic-mutation-executor.ts
|
|
39214
|
-
import { z as
|
|
39269
|
+
import { z as z75 } from "zod";
|
|
39215
39270
|
function replayedResult(result) {
|
|
39216
39271
|
return result === void 0 ? void 0 : { ...result, outcome: "replayed" };
|
|
39217
39272
|
}
|
|
@@ -39273,7 +39328,7 @@ var init_semantic_mutation_executor = __esm({
|
|
|
39273
39328
|
new SessionRuntimeIntentError("rejected", "Session semantic mutation executor is disposed")
|
|
39274
39329
|
);
|
|
39275
39330
|
}
|
|
39276
|
-
const operationId =
|
|
39331
|
+
const operationId = z75.uuid().parse(rawOperationId);
|
|
39277
39332
|
let intent = SessionRuntimeSemanticIntentSchemaZ.parse(rawIntent);
|
|
39278
39333
|
if (intent.verb === "workspace.pane.send" || intent.verb === "workspace.pane.read") {
|
|
39279
39334
|
intent = { ...intent, origin: authority.origin };
|
|
@@ -56070,7 +56125,7 @@ var init_authority_arbiter = __esm({
|
|
|
56070
56125
|
|
|
56071
56126
|
// packages/daemon/src/terminal/session-runtime/registry.ts
|
|
56072
56127
|
import { randomUUID as randomUUID11 } from "node:crypto";
|
|
56073
|
-
import { z as
|
|
56128
|
+
import { z as z76 } from "zod";
|
|
56074
56129
|
async function abortable(promise, signal) {
|
|
56075
56130
|
if (!signal) return promise;
|
|
56076
56131
|
signal.throwIfAborted();
|
|
@@ -56719,7 +56774,10 @@ var init_registry2 = __esm({
|
|
|
56719
56774
|
session,
|
|
56720
56775
|
scheduler,
|
|
56721
56776
|
nativeGeometryHysteresisMs,
|
|
56722
|
-
onGeometryAuthorityChanged: (clientId) =>
|
|
56777
|
+
onGeometryAuthorityChanged: (clientId) => {
|
|
56778
|
+
this.#mirror.clearWindowViewports(this.session);
|
|
56779
|
+
this.#mirror.setGeometryParticipation(this.session, clientId !== null);
|
|
56780
|
+
},
|
|
56723
56781
|
onNativeGeometryYieldExpired: () => this.#publishAuthority()
|
|
56724
56782
|
});
|
|
56725
56783
|
this.#terminalDeliveryHub = new SessionRuntimeTerminalDeliveryHub(
|
|
@@ -56944,7 +57002,7 @@ var init_registry2 = __esm({
|
|
|
56944
57002
|
);
|
|
56945
57003
|
}
|
|
56946
57004
|
const input = SessionRuntimeTerminalInputSchemaZ.parse(rawInput);
|
|
56947
|
-
if (performanceTraceId !== void 0) performanceTraceId =
|
|
57005
|
+
if (performanceTraceId !== void 0) performanceTraceId = z76.uuid().parse(performanceTraceId);
|
|
56948
57006
|
const causalProbe = rawCausalProbe === void 0 ? null : CausalCellProbeV1SchemaZ.parse(rawCausalProbe);
|
|
56949
57007
|
if (causalProbe) {
|
|
56950
57008
|
if (causalProbe.traceId !== performanceTraceId || causalProbe.clientId !== clientId || causalProbe.semanticPaneId !== semanticPaneId3 || causalProbe.generation !== this.generation)
|
|
@@ -57046,7 +57104,7 @@ var init_registry2 = __esm({
|
|
|
57046
57104
|
Object.freeze({ ageMs, ...timing ? { timing } : {} })
|
|
57047
57105
|
);
|
|
57048
57106
|
}
|
|
57049
|
-
fitViewport(clientId, lease, cols, rows) {
|
|
57107
|
+
fitViewport(clientId, lease, cols, rows, semanticWindowId) {
|
|
57050
57108
|
this.assertController(lease, clientId);
|
|
57051
57109
|
const geometryLease = this.#authority.leaseFor(clientId, "geometry") ?? this.#authority.claim(clientId, "geometry");
|
|
57052
57110
|
if (!geometryLease) {
|
|
@@ -57056,9 +57114,10 @@ var init_registry2 = __esm({
|
|
|
57056
57114
|
);
|
|
57057
57115
|
}
|
|
57058
57116
|
this.#mirror.setGeometryParticipation(this.session, true);
|
|
57059
|
-
this.#mirror.fitViewport(this.session, cols, rows);
|
|
57117
|
+
if (semanticWindowId === void 0) this.#mirror.fitViewport(this.session, cols, rows);
|
|
57118
|
+
else this.#mirror.fitWindowViewport(this.session, semanticWindowId, cols, rows);
|
|
57060
57119
|
}
|
|
57061
|
-
fitViewportWithAuthority(clientId, lease, cols, rows) {
|
|
57120
|
+
fitViewportWithAuthority(clientId, lease, cols, rows, semanticWindowId) {
|
|
57062
57121
|
const parsed = SessionRuntimeAuthorityLeaseSchemaZ.parse(lease);
|
|
57063
57122
|
let exact;
|
|
57064
57123
|
try {
|
|
@@ -57076,7 +57135,8 @@ var init_registry2 = __esm({
|
|
|
57076
57135
|
);
|
|
57077
57136
|
}
|
|
57078
57137
|
this.#mirror.setGeometryParticipation(this.session, true);
|
|
57079
|
-
this.#mirror.fitViewport(this.session, cols, rows);
|
|
57138
|
+
if (semanticWindowId === void 0) this.#mirror.fitViewport(this.session, cols, rows);
|
|
57139
|
+
else this.#mirror.fitWindowViewport(this.session, semanticWindowId, cols, rows);
|
|
57080
57140
|
}
|
|
57081
57141
|
async whenReady() {
|
|
57082
57142
|
if (this.#disposed) throw new Error(`SessionRuntime ${this.session} is disposed`);
|
|
@@ -57325,7 +57385,7 @@ var init_registry2 = __esm({
|
|
|
57325
57385
|
#assignController(clientId) {
|
|
57326
57386
|
this.#controllerRevision += 1;
|
|
57327
57387
|
this.#controllerClientId = clientId;
|
|
57328
|
-
this.#controllerToken =
|
|
57388
|
+
this.#controllerToken = z76.uuid().parse(this.#createControllerToken());
|
|
57329
57389
|
return this.#currentLease();
|
|
57330
57390
|
}
|
|
57331
57391
|
#clearController() {
|
|
@@ -57454,13 +57514,13 @@ var init_registry2 = __esm({
|
|
|
57454
57514
|
failCausalCellProbe(semanticPaneId3, traceId, reason) {
|
|
57455
57515
|
this.#runtime.failCausalCellProbe(semanticPaneId3, traceId, reason);
|
|
57456
57516
|
}
|
|
57457
|
-
fitViewport(lease, cols, rows) {
|
|
57517
|
+
fitViewport(lease, cols, rows, semanticWindowId) {
|
|
57458
57518
|
this.#assertOpen();
|
|
57459
|
-
this.#runtime.fitViewport(this.clientId, lease, cols, rows);
|
|
57519
|
+
this.#runtime.fitViewport(this.clientId, lease, cols, rows, semanticWindowId);
|
|
57460
57520
|
}
|
|
57461
|
-
fitViewportWithAuthority(lease, cols, rows) {
|
|
57521
|
+
fitViewportWithAuthority(lease, cols, rows, semanticWindowId) {
|
|
57462
57522
|
this.#assertOpen();
|
|
57463
|
-
this.#runtime.fitViewportWithAuthority(this.clientId, lease, cols, rows);
|
|
57523
|
+
this.#runtime.fitViewportWithAuthority(this.clientId, lease, cols, rows, semanticWindowId);
|
|
57464
57524
|
}
|
|
57465
57525
|
async describe() {
|
|
57466
57526
|
this.#assertOpen();
|
|
@@ -57560,7 +57620,7 @@ var init_registry2 = __esm({
|
|
|
57560
57620
|
});
|
|
57561
57621
|
|
|
57562
57622
|
// packages/daemon/src/terminal/session-runtime/transport-binding.ts
|
|
57563
|
-
import { z as
|
|
57623
|
+
import { z as z77 } from "zod";
|
|
57564
57624
|
function sameAuthorityLease(left, right) {
|
|
57565
57625
|
return left.generation === right.generation && left.session === right.session && left.clientId === right.clientId && left.authority === right.authority && left.token === right.token && left.revision === right.revision;
|
|
57566
57626
|
}
|
|
@@ -57601,9 +57661,9 @@ var init_transport_binding = __esm({
|
|
|
57601
57661
|
"use strict";
|
|
57602
57662
|
init_src();
|
|
57603
57663
|
init_registry2();
|
|
57604
|
-
TransportSchemaZ =
|
|
57605
|
-
LeaseIdSchemaZ =
|
|
57606
|
-
HostClientIdSchemaZ =
|
|
57664
|
+
TransportSchemaZ = z77.enum(["terminal-attachment", "pane-stream"]);
|
|
57665
|
+
LeaseIdSchemaZ = z77.uuid();
|
|
57666
|
+
HostClientIdSchemaZ = z77.string().min(1).max(4096).refine((v) => !/[\0\r\n]/u.test(v));
|
|
57607
57667
|
clientsByRegistry = /* @__PURE__ */ new WeakMap();
|
|
57608
57668
|
SessionRuntimeTransportBinding = class {
|
|
57609
57669
|
#binder;
|
|
@@ -57828,7 +57888,7 @@ var init_transport_binding = __esm({
|
|
|
57828
57888
|
throw error;
|
|
57829
57889
|
}
|
|
57830
57890
|
}
|
|
57831
|
-
fitViewport(expectedLease, cols, rows) {
|
|
57891
|
+
fitViewport(expectedLease, cols, rows, semanticWindowId) {
|
|
57832
57892
|
this.#assertOpen();
|
|
57833
57893
|
if (this.#shared.geometryTransportLeaseIds.at(-1) !== this.#transportLeaseId) {
|
|
57834
57894
|
throw new SessionRuntimeControllerLeaseError(
|
|
@@ -57843,7 +57903,8 @@ var init_transport_binding = __esm({
|
|
|
57843
57903
|
"stale-controller-lease",
|
|
57844
57904
|
"Geometry authority retired."
|
|
57845
57905
|
);
|
|
57846
|
-
this.#shared.consumer.fitViewport(controller, cols, rows);
|
|
57906
|
+
if (semanticWindowId === void 0) this.#shared.consumer.fitViewport(controller, cols, rows);
|
|
57907
|
+
else this.#shared.consumer.fitViewport(controller, cols, rows, semanticWindowId);
|
|
57847
57908
|
return;
|
|
57848
57909
|
}
|
|
57849
57910
|
const lease = this.#geometryAuthorityLease;
|
|
@@ -57852,7 +57913,9 @@ var init_transport_binding = __esm({
|
|
|
57852
57913
|
"stale-controller-lease",
|
|
57853
57914
|
"Geometry authority retired."
|
|
57854
57915
|
);
|
|
57855
|
-
|
|
57916
|
+
if (semanticWindowId === void 0)
|
|
57917
|
+
this.#shared.consumer.fitViewportWithAuthority(lease, cols, rows);
|
|
57918
|
+
else this.#shared.consumer.fitViewportWithAuthority(lease, cols, rows, semanticWindowId);
|
|
57856
57919
|
}
|
|
57857
57920
|
executionHandleForSource(semanticPaneId3) {
|
|
57858
57921
|
this.assertController(semanticPaneId3);
|
|
@@ -58128,7 +58191,7 @@ var init_admission_util = __esm({
|
|
|
58128
58191
|
});
|
|
58129
58192
|
|
|
58130
58193
|
// packages/contracts/src/terminal-attachment-stream.ts
|
|
58131
|
-
import { z as
|
|
58194
|
+
import { z as z78 } from "zod";
|
|
58132
58195
|
function decodeTerminalAttachmentInputFrame(frame) {
|
|
58133
58196
|
if (!(frame instanceof Uint8Array) || frame.byteLength <= TERMINAL_ATTACHMENT_INPUT_FRAME_HEADER_BYTES || frame.byteLength > TERMINAL_ATTACHMENT_MAX_INPUT_WIRE_BYTES || frame[0] !== TERMINAL_ATTACHMENT_INPUT_FRAME_KIND) {
|
|
58134
58197
|
return null;
|
|
@@ -58151,10 +58214,10 @@ var init_terminal_attachment_stream = __esm({
|
|
|
58151
58214
|
TERMINAL_ATTACHMENT_INPUT_FRAME_HEADER_BYTES = /* @__PURE__ */ (() => 5)();
|
|
58152
58215
|
TERMINAL_ATTACHMENT_MAX_INPUT_FRAME_BYTES = /* @__PURE__ */ (() => 64 * 1024)();
|
|
58153
58216
|
TERMINAL_ATTACHMENT_MAX_INPUT_WIRE_BYTES = /* @__PURE__ */ (() => TERMINAL_ATTACHMENT_INPUT_FRAME_HEADER_BYTES + TERMINAL_ATTACHMENT_MAX_INPUT_FRAME_BYTES)();
|
|
58154
|
-
TerminalAttachmentInputLimitsSchemaZ = /* @__PURE__ */ (() =>
|
|
58155
|
-
maxFrameBytes:
|
|
58156
|
-
maxAcceptedBytes:
|
|
58157
|
-
maxAcceptedFrames:
|
|
58217
|
+
TerminalAttachmentInputLimitsSchemaZ = /* @__PURE__ */ (() => z78.object({
|
|
58218
|
+
maxFrameBytes: z78.number().int().positive().max(TERMINAL_ATTACHMENT_MAX_INPUT_FRAME_BYTES),
|
|
58219
|
+
maxAcceptedBytes: z78.number().int().positive().max(4 * 1024 * 1024),
|
|
58220
|
+
maxAcceptedFrames: z78.number().int().positive().max(16384)
|
|
58158
58221
|
}).strict().refine((limits) => limits.maxFrameBytes <= limits.maxAcceptedBytes, {
|
|
58159
58222
|
message: "terminal input frame limit cannot exceed its lifetime byte limit"
|
|
58160
58223
|
}))();
|
|
@@ -58162,13 +58225,13 @@ var init_terminal_attachment_stream = __esm({
|
|
|
58162
58225
|
});
|
|
58163
58226
|
|
|
58164
58227
|
// packages/daemon/src/terminal/attachments/grouped-tmux.ts
|
|
58165
|
-
import { z as
|
|
58228
|
+
import { z as z79 } from "zod";
|
|
58166
58229
|
function tmux4(argv) {
|
|
58167
58230
|
return { executable: "tmux", argv };
|
|
58168
58231
|
}
|
|
58169
58232
|
function groupedTmuxViewSessionName(attachmentId, generation) {
|
|
58170
58233
|
const parsed = GroupedTmuxAttachmentPlanInputSchemaZ.shape.attachmentId.parse(attachmentId);
|
|
58171
|
-
const parsedGeneration =
|
|
58234
|
+
const parsedGeneration = z79.number().int().min(0).max(GROUPED_TMUX_MAX_GENERATION).parse(generation);
|
|
58172
58235
|
return `${GROUPED_TMUX_VIEW_SESSION_PREFIX}${parsed.replaceAll("-", "").toLowerCase()}-${parsedGeneration.toString(36)}`;
|
|
58173
58236
|
}
|
|
58174
58237
|
function markerValue(attachmentId, generation) {
|
|
@@ -58293,17 +58356,17 @@ var init_grouped_tmux = __esm({
|
|
|
58293
58356
|
GROUPED_TMUX_MAX_GENERATION = 65535;
|
|
58294
58357
|
GROUPED_TMUX_PLACEHOLDER_WINDOW = "__tmux_ide_attachment_placeholder";
|
|
58295
58358
|
GROUPED_TMUX_PLACEHOLDER_COMMAND = "exec sleep 2147483647";
|
|
58296
|
-
RuntimeSessionIdSchemaZ2 =
|
|
58297
|
-
RuntimeWindowIdSchemaZ2 =
|
|
58298
|
-
RuntimePaneIdSchemaZ2 =
|
|
58299
|
-
GroupedTmuxAttachmentPlanInputSchemaZ =
|
|
58300
|
-
attachmentId:
|
|
58301
|
-
generation:
|
|
58359
|
+
RuntimeSessionIdSchemaZ2 = z79.string().max(32).regex(/^\$(?:0|[1-9][0-9]*)$/u, "source session id must be a tmux runtime id");
|
|
58360
|
+
RuntimeWindowIdSchemaZ2 = z79.string().max(32).regex(/^@(?:0|[1-9][0-9]*)$/u, "source window id must be a tmux runtime id");
|
|
58361
|
+
RuntimePaneIdSchemaZ2 = z79.string().max(32).regex(/^%(?:0|[1-9][0-9]*)$/u, "source pane id must be a tmux runtime id");
|
|
58362
|
+
GroupedTmuxAttachmentPlanInputSchemaZ = z79.object({
|
|
58363
|
+
attachmentId: z79.uuid(),
|
|
58364
|
+
generation: z79.number().int().min(0).max(GROUPED_TMUX_MAX_GENERATION),
|
|
58302
58365
|
target: TerminalAttachmentSemanticTargetSchemaZ,
|
|
58303
58366
|
viewerMode: TerminalAttachmentViewerModeSchemaZ,
|
|
58304
58367
|
geometryOwnership: TerminalAttachmentGeometryOwnershipSchemaZ.default("passive"),
|
|
58305
58368
|
viewport: TerminalAttachmentViewportSchemaZ,
|
|
58306
|
-
source:
|
|
58369
|
+
source: z79.object({
|
|
58307
58370
|
sessionId: RuntimeSessionIdSchemaZ2,
|
|
58308
58371
|
windowId: RuntimeWindowIdSchemaZ2,
|
|
58309
58372
|
runtimePaneId: RuntimePaneIdSchemaZ2,
|
|
@@ -58313,7 +58376,7 @@ var init_grouped_tmux = __esm({
|
|
|
58313
58376
|
* gate: any positive count is valid. Single-pane windows keep passing
|
|
58314
58377
|
* `1`, so their plans stay byte-identical.
|
|
58315
58378
|
*/
|
|
58316
|
-
windowPaneCount:
|
|
58379
|
+
windowPaneCount: z79.number().int().positive()
|
|
58317
58380
|
}).strict()
|
|
58318
58381
|
}).strict().superRefine(refuseReadOnlyGeometryOwner);
|
|
58319
58382
|
}
|
|
@@ -58321,7 +58384,7 @@ var init_grouped_tmux = __esm({
|
|
|
58321
58384
|
|
|
58322
58385
|
// packages/daemon/src/terminal/attachments/lease-manager.ts
|
|
58323
58386
|
import { createHash as createHash14, randomBytes as randomBytes5, randomUUID as randomUUID12, timingSafeEqual as timingSafeEqual4 } from "node:crypto";
|
|
58324
|
-
import { z as
|
|
58387
|
+
import { z as z80 } from "zod";
|
|
58325
58388
|
function positiveDuration(value, fallback, label2) {
|
|
58326
58389
|
const resolved2 = value ?? fallback;
|
|
58327
58390
|
if (!Number.isSafeInteger(resolved2) || resolved2 <= 0) {
|
|
@@ -58357,10 +58420,10 @@ var init_lease_manager = __esm({
|
|
|
58357
58420
|
"use strict";
|
|
58358
58421
|
init_src();
|
|
58359
58422
|
init_grouped_tmux();
|
|
58360
|
-
BindingIdSchemaZ =
|
|
58361
|
-
RequestIdSchemaZ =
|
|
58423
|
+
BindingIdSchemaZ = z80.string().min(1).max(4096).refine((value) => !value.includes("\0"));
|
|
58424
|
+
RequestIdSchemaZ = z80.uuid();
|
|
58362
58425
|
RuntimeWindowId = /^@(?:0|[1-9][0-9]*)$/u;
|
|
58363
|
-
AttachmentViewOperationSchemaZ =
|
|
58426
|
+
AttachmentViewOperationSchemaZ = z80.enum(["create", "attach", "recover"]);
|
|
58364
58427
|
RedemptionTicketPattern = /^ta1_[A-Za-z0-9_-]{43}$/u;
|
|
58365
58428
|
MarkerPattern = /^v1:([0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}):(0|[1-9][0-9]*)$/iu;
|
|
58366
58429
|
AttachmentLeaseError = class extends Error {
|
|
@@ -58651,7 +58714,7 @@ var init_lease_manager = __esm({
|
|
|
58651
58714
|
throw new AttachmentLeaseError("lease-expired", "The attachment lease has expired.");
|
|
58652
58715
|
}
|
|
58653
58716
|
const clientClaim = typeof executionResult === "object" && executionResult.status === "executed" ? executionResult.clientClaim : null;
|
|
58654
|
-
if (clientClaim && (!
|
|
58717
|
+
if (clientClaim && (!z80.uuid().safeParse(clientClaim.attemptId).success || clientClaim.attachmentId !== state.plan.identity.attachmentId || clientClaim.generation !== state.plan.identity.generation || parsedOperation === "create")) {
|
|
58655
58718
|
this.#removeState(state);
|
|
58656
58719
|
await this.#cleanupPlan(state);
|
|
58657
58720
|
throw new AttachmentLeaseError(
|
|
@@ -58810,7 +58873,7 @@ var init_lease_manager = __esm({
|
|
|
58810
58873
|
#freshId() {
|
|
58811
58874
|
for (let attempt = 0; attempt < 16; attempt += 1) {
|
|
58812
58875
|
const candidate = this.#createId();
|
|
58813
|
-
if (
|
|
58876
|
+
if (z80.uuid().safeParse(candidate).success && !this.#leases.has(candidate)) return candidate;
|
|
58814
58877
|
}
|
|
58815
58878
|
throw new AttachmentLeaseError(
|
|
58816
58879
|
"identity-generation-failed",
|
|
@@ -58996,7 +59059,7 @@ var init_lease_manager = __esm({
|
|
|
58996
59059
|
});
|
|
58997
59060
|
|
|
58998
59061
|
// packages/daemon/src/terminal/attachments/direct-websocket.ts
|
|
58999
|
-
import { z as
|
|
59062
|
+
import { z as z81 } from "zod";
|
|
59000
59063
|
function defaultSchedule(callback, delayMs) {
|
|
59001
59064
|
const timer = setTimeout(callback, delayMs);
|
|
59002
59065
|
timer.unref?.();
|
|
@@ -59047,7 +59110,7 @@ function sameTarget(left, right) {
|
|
|
59047
59110
|
return left.workspaceName === right.workspaceName && left.semanticPaneId === right.semanticPaneId;
|
|
59048
59111
|
}
|
|
59049
59112
|
function validDescriptorIdentity(descriptor) {
|
|
59050
|
-
return
|
|
59113
|
+
return z81.uuid().safeParse(descriptor.leaseId).success && z81.uuid().safeParse(descriptor.requestId).success && Number.isSafeInteger(descriptor.issuedAt) && Number.isSafeInteger(descriptor.expiresAt) && Number.isSafeInteger(descriptor.bindingGeneration) && descriptor.bindingGeneration >= 0 && Number.isSafeInteger(descriptor.viewGeneration) && descriptor.viewGeneration >= 0;
|
|
59051
59114
|
}
|
|
59052
59115
|
function boundedInputCapability(client, viewerMode) {
|
|
59053
59116
|
const input = viewerMode === "interactive" ? client.boundedInput : null;
|
|
@@ -59088,18 +59151,18 @@ var init_direct_websocket = __esm({
|
|
|
59088
59151
|
TERMINAL_ATTACHMENT_MAX_LIVE_CONTROL_FRAMES = 1024;
|
|
59089
59152
|
WS_OPEN4 = 1;
|
|
59090
59153
|
TicketPattern = /^ta1_[A-Za-z0-9_-]{43}$/u;
|
|
59091
|
-
BindingIdSchemaZ2 =
|
|
59092
|
-
RedemptionFrameSchemaZ =
|
|
59093
|
-
type:
|
|
59094
|
-
protocolVersion:
|
|
59095
|
-
ticket:
|
|
59096
|
-
requestId:
|
|
59154
|
+
BindingIdSchemaZ2 = z81.string().min(1).max(4096).refine((value) => !value.includes("\0"));
|
|
59155
|
+
RedemptionFrameSchemaZ = z81.object({
|
|
59156
|
+
type: z81.literal("redeem"),
|
|
59157
|
+
protocolVersion: z81.literal(TERMINAL_ATTACHMENT_PROTOCOL_VERSION),
|
|
59158
|
+
ticket: z81.string().regex(TicketPattern),
|
|
59159
|
+
requestId: z81.uuid(),
|
|
59097
59160
|
daemonInstanceId: BindingIdSchemaZ2
|
|
59098
59161
|
}).strict();
|
|
59099
|
-
ResizeFrameSchemaZ =
|
|
59100
|
-
type:
|
|
59101
|
-
protocolVersion:
|
|
59102
|
-
generation:
|
|
59162
|
+
ResizeFrameSchemaZ = z81.object({
|
|
59163
|
+
type: z81.literal("resize"),
|
|
59164
|
+
protocolVersion: z81.literal(TERMINAL_ATTACHMENT_PROTOCOL_VERSION),
|
|
59165
|
+
generation: z81.number().int().nonnegative(),
|
|
59103
59166
|
viewport: TerminalAttachmentViewportSchemaZ
|
|
59104
59167
|
}).strict();
|
|
59105
59168
|
GridSchemaZ = TerminalAttachmentViewportSchemaZ;
|
|
@@ -59219,7 +59282,7 @@ var init_direct_websocket = __esm({
|
|
|
59219
59282
|
}
|
|
59220
59283
|
const parsedRequest = TerminalAttachRequestSchemaZ.parse(request);
|
|
59221
59284
|
const origin = canonicalRendererOrigin(context.rendererOrigin);
|
|
59222
|
-
const requestId =
|
|
59285
|
+
const requestId = z81.uuid().parse(context.requestId);
|
|
59223
59286
|
const projectIdentity = BindingIdSchemaZ2.parse(context.projectIdentity);
|
|
59224
59287
|
if (this.#pending.size + this.#pendingReservations >= this.#maxPending) {
|
|
59225
59288
|
throw new TerminalAttachmentAdmissionError(
|
|
@@ -60044,7 +60107,7 @@ var init_direct_websocket = __esm({
|
|
|
60044
60107
|
|
|
60045
60108
|
// packages/daemon/src/terminal/attachments/tmux-view-executor.ts
|
|
60046
60109
|
import { isDeepStrictEqual } from "node:util";
|
|
60047
|
-
import { z as
|
|
60110
|
+
import { z as z82 } from "zod";
|
|
60048
60111
|
function tmux5(argv) {
|
|
60049
60112
|
return { executable: "tmux", argv };
|
|
60050
60113
|
}
|
|
@@ -60135,7 +60198,7 @@ function parseViewSessionName(value) {
|
|
|
60135
60198
|
const match = ViewNamePattern.exec(value);
|
|
60136
60199
|
if (!match) return null;
|
|
60137
60200
|
const attachmentId = uuidFromCompactHex(match[1]);
|
|
60138
|
-
if (!
|
|
60201
|
+
if (!z82.uuid().safeParse(attachmentId).success) return null;
|
|
60139
60202
|
const generation = Number.parseInt(match[2], 36);
|
|
60140
60203
|
if (!Number.isSafeInteger(generation) || generation < 0 || generation > GROUPED_TMUX_MAX_GENERATION || generation.toString(36) !== match[2]) {
|
|
60141
60204
|
return null;
|
|
@@ -60202,9 +60265,9 @@ var init_tmux_view_executor = __esm({
|
|
|
60202
60265
|
MAX_MARKER_OUTPUT_ROWS = 1;
|
|
60203
60266
|
SOURCE_PROOF_MISMATCH_SENTINEL = "__tmux_ide_source_proof_mismatch_v1__";
|
|
60204
60267
|
VIEW_PROOF_MISMATCH_SENTINEL = "__tmux_ide_view_proof_mismatch_v1__";
|
|
60205
|
-
RuntimeSessionIdSchemaZ3 =
|
|
60206
|
-
RuntimeWindowIdSchemaZ3 =
|
|
60207
|
-
RuntimePaneIdSchemaZ3 =
|
|
60268
|
+
RuntimeSessionIdSchemaZ3 = z82.string().max(32).regex(/^\$(?:0|[1-9][0-9]*)$/u);
|
|
60269
|
+
RuntimeWindowIdSchemaZ3 = z82.string().max(32).regex(/^@(?:0|[1-9][0-9]*)$/u);
|
|
60270
|
+
RuntimePaneIdSchemaZ3 = z82.string().max(32).regex(/^%(?:0|[1-9][0-9]*)$/u);
|
|
60208
60271
|
MarkerPattern2 = /^v1:([0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}):(0|[1-9][0-9]*)$/u;
|
|
60209
60272
|
ViewNamePattern = /^_tmux-ide-view-v1-([0-9a-f]{32})-([0-9a-z]+)$/u;
|
|
60210
60273
|
TmuxAttachmentClientTransportError = class extends Error {
|
|
@@ -60266,18 +60329,18 @@ var init_tmux_view_executor = __esm({
|
|
|
60266
60329
|
}
|
|
60267
60330
|
}
|
|
60268
60331
|
};
|
|
60269
|
-
TmuxAttachmentClientTransportInputSchemaZ =
|
|
60270
|
-
operation:
|
|
60271
|
-
identity:
|
|
60272
|
-
attachmentId:
|
|
60273
|
-
generation:
|
|
60274
|
-
viewSessionName:
|
|
60275
|
-
markerValue:
|
|
60332
|
+
TmuxAttachmentClientTransportInputSchemaZ = z82.object({
|
|
60333
|
+
operation: z82.enum(["attach", "recover"]),
|
|
60334
|
+
identity: z82.object({
|
|
60335
|
+
attachmentId: z82.uuid(),
|
|
60336
|
+
generation: z82.number().int().min(0).max(GROUPED_TMUX_MAX_GENERATION),
|
|
60337
|
+
viewSessionName: z82.string(),
|
|
60338
|
+
markerValue: z82.string(),
|
|
60276
60339
|
expectedSourceSessionId: RuntimeSessionIdSchemaZ3,
|
|
60277
60340
|
expectedViewSessionId: RuntimeSessionIdSchemaZ3,
|
|
60278
60341
|
expectedWindowId: RuntimeWindowIdSchemaZ3,
|
|
60279
60342
|
expectedPaneId: RuntimePaneIdSchemaZ3,
|
|
60280
|
-
expectedWindowPaneCount:
|
|
60343
|
+
expectedWindowPaneCount: z82.number().int().positive()
|
|
60281
60344
|
}).strict(),
|
|
60282
60345
|
viewport: TerminalAttachmentViewportSchemaZ,
|
|
60283
60346
|
viewerMode: TerminalAttachmentViewerModeSchemaZ,
|
|
@@ -60347,7 +60410,7 @@ var init_tmux_view_executor = __esm({
|
|
|
60347
60410
|
throw new TmuxAttachmentViewExecutorError("invalid-request");
|
|
60348
60411
|
}
|
|
60349
60412
|
const result = this.#clientTransport.beginGuardedAttach(input);
|
|
60350
|
-
if (result.status !== "claimed" || !
|
|
60413
|
+
if (result.status !== "claimed" || !z82.uuid().safeParse(result.attemptId).success || result.attachmentId !== plan.identity.attachmentId || result.generation !== plan.identity.generation || !(result.outcome instanceof Promise)) {
|
|
60351
60414
|
throw new TmuxAttachmentViewExecutorError("mutation-outcome-uncertain");
|
|
60352
60415
|
}
|
|
60353
60416
|
return result;
|
|
@@ -61322,7 +61385,7 @@ var init_pty_tmux_attachment_launcher = __esm({
|
|
|
61322
61385
|
import { accessSync as accessSync6, constants as constants6, realpathSync as realpathSync13, statSync as statSync13 } from "node:fs";
|
|
61323
61386
|
import { execFile as execFile11 } from "node:child_process";
|
|
61324
61387
|
import { isAbsolute as isAbsolute14 } from "node:path";
|
|
61325
|
-
import { z as
|
|
61388
|
+
import { z as z83 } from "zod";
|
|
61326
61389
|
function presentationEnvironment(source) {
|
|
61327
61390
|
const environment = {
|
|
61328
61391
|
TERM: SAFE_TERMINAL_VALUE2.test(source.TERM ?? "") ? source.TERM : "xterm-256color"
|
|
@@ -61770,7 +61833,7 @@ function commandString(argv) {
|
|
|
61770
61833
|
return argv.map((value) => value === ";" ? ";" : quoteArgument(value)).join(" ");
|
|
61771
61834
|
}
|
|
61772
61835
|
function geometryDescriptorIsValid(descriptor, client) {
|
|
61773
|
-
return
|
|
61836
|
+
return z83.uuid().safeParse(descriptor.leaseId).success && z83.uuid().safeParse(descriptor.requestId).success && TerminalAttachmentSemanticTargetSchemaZ.safeParse(descriptor.target).success && descriptor.status === "active" && Number.isSafeInteger(descriptor.bindingGeneration) && descriptor.bindingGeneration >= 0 && Number.isSafeInteger(descriptor.viewGeneration) && descriptor.viewGeneration >= 0 && descriptor.viewGeneration <= GROUPED_TMUX_MAX_GENERATION && z83.uuid().safeParse(client.attemptId).success && client.attachmentId === descriptor.leaseId && client.generation === descriptor.viewGeneration && Number.isSafeInteger(client.pid) && client.pid > 0;
|
|
61774
61837
|
}
|
|
61775
61838
|
async function enumerateStartupMarkedViews(executor) {
|
|
61776
61839
|
let failure2;
|
|
@@ -63192,7 +63255,7 @@ var init_terminal_attachment_upgrade = __esm({
|
|
|
63192
63255
|
|
|
63193
63256
|
// packages/daemon/src/terminal/pane-stream/lease-manager.ts
|
|
63194
63257
|
import { createHash as createHash15, randomBytes as randomBytes6, randomUUID as randomUUID14, timingSafeEqual as timingSafeEqual5 } from "node:crypto";
|
|
63195
|
-
import { z as
|
|
63258
|
+
import { z as z84 } from "zod";
|
|
63196
63259
|
function positiveDuration2(value, fallback, label2) {
|
|
63197
63260
|
const resolved2 = value ?? fallback;
|
|
63198
63261
|
if (!Number.isSafeInteger(resolved2) || resolved2 <= 0) {
|
|
@@ -63218,9 +63281,9 @@ var init_lease_manager2 = __esm({
|
|
|
63218
63281
|
"packages/daemon/src/terminal/pane-stream/lease-manager.ts"() {
|
|
63219
63282
|
"use strict";
|
|
63220
63283
|
init_src();
|
|
63221
|
-
BindingIdSchemaZ3 =
|
|
63222
|
-
RequestIdSchemaZ2 =
|
|
63223
|
-
SessionNameSchemaZ =
|
|
63284
|
+
BindingIdSchemaZ3 = z84.string().min(1).max(4096).refine((value) => !value.includes("\0"));
|
|
63285
|
+
RequestIdSchemaZ2 = z84.uuid();
|
|
63286
|
+
SessionNameSchemaZ = z84.string().min(1).max(256).refine((value) => !/[\0\r\n]/u.test(value));
|
|
63224
63287
|
TicketPattern2 = /^ps1_[A-Za-z0-9_-]{43}$/u;
|
|
63225
63288
|
PaneStreamLeaseError = class extends Error {
|
|
63226
63289
|
code;
|
|
@@ -63376,7 +63439,7 @@ var init_lease_manager2 = __esm({
|
|
|
63376
63439
|
#freshId() {
|
|
63377
63440
|
for (let attempt = 0; attempt < 16; attempt += 1) {
|
|
63378
63441
|
const candidate = this.#createId();
|
|
63379
|
-
if (
|
|
63442
|
+
if (z84.uuid().safeParse(candidate).success && !this.#leases.has(candidate)) return candidate;
|
|
63380
63443
|
}
|
|
63381
63444
|
throw new PaneStreamLeaseError(
|
|
63382
63445
|
"identity-generation-failed",
|
|
@@ -63516,7 +63579,7 @@ var init_wire_ledger = __esm({
|
|
|
63516
63579
|
});
|
|
63517
63580
|
|
|
63518
63581
|
// packages/daemon/src/terminal/pane-stream/pane-stream-websocket.ts
|
|
63519
|
-
import { z as
|
|
63582
|
+
import { z as z85 } from "zod";
|
|
63520
63583
|
function semanticBackendRefusal(error) {
|
|
63521
63584
|
let candidate = error;
|
|
63522
63585
|
for (let depth = 0; depth < 3; depth += 1) {
|
|
@@ -63616,7 +63679,7 @@ var init_pane_stream_websocket = __esm({
|
|
|
63616
63679
|
]);
|
|
63617
63680
|
TYPE_FIRST_INPUT_FRAME_PREFIX = Buffer.from('{"type":"input",', "utf8");
|
|
63618
63681
|
TicketPattern3 = /^ps1_[A-Za-z0-9_-]{43}$/u;
|
|
63619
|
-
BindingIdSchemaZ4 =
|
|
63682
|
+
BindingIdSchemaZ4 = z85.string().min(1).max(4096).refine((value) => !value.includes("\0"));
|
|
63620
63683
|
PaneStreamAdmissionError = class extends Error {
|
|
63621
63684
|
code;
|
|
63622
63685
|
constructor(code, message) {
|
|
@@ -63713,7 +63776,7 @@ var init_pane_stream_websocket = __esm({
|
|
|
63713
63776
|
if (origin === null) {
|
|
63714
63777
|
throw new PaneStreamAdmissionError("invalid-origin", "Renderer Origin is invalid.");
|
|
63715
63778
|
}
|
|
63716
|
-
const requestId =
|
|
63779
|
+
const requestId = z85.uuid().parse(context.requestId);
|
|
63717
63780
|
const projectIdentity = BindingIdSchemaZ4.parse(context.projectIdentity);
|
|
63718
63781
|
if (this.#pending.size >= this.#maxPending) {
|
|
63719
63782
|
throw new PaneStreamAdmissionError(
|
|
@@ -63764,7 +63827,7 @@ var init_pane_stream_websocket = __esm({
|
|
|
63764
63827
|
});
|
|
63765
63828
|
const descriptor = issued.descriptor;
|
|
63766
63829
|
const ticket = issued.redemptionTicket;
|
|
63767
|
-
const valid = TicketPattern3.test(ticket) &&
|
|
63830
|
+
const valid = TicketPattern3.test(ticket) && z85.uuid().safeParse(descriptor.leaseId).success && descriptor.requestId === requestId && (this.#mirror.describeSessionAuthority === void 0 || descriptor.runtimeSessionId === runtimeSessionId) && descriptor.status === "awaiting-redemption" && descriptor.viewerMode === request.viewerMode && descriptor.workspaceName === request.workspaceName && descriptor.panes.length === request.panes.length && descriptor.panes.every((pane, index) => pane === request.panes[index]) && descriptor.expiresAt > this.#now();
|
|
63768
63831
|
const ticketDigest = digestSecret(ticket);
|
|
63769
63832
|
const duplicate = [...this.#pending.values()].some(
|
|
63770
63833
|
(pending2) => digestsEqual(pending2.ticketDigest, ticketDigest)
|
|
@@ -63835,7 +63898,7 @@ var init_pane_stream_websocket = __esm({
|
|
|
63835
63898
|
if (input.hostClientId && !hostClientId) {
|
|
63836
63899
|
return { accepted: false, code: "origin-rejected", httpStatus: 403 };
|
|
63837
63900
|
}
|
|
63838
|
-
const requestId = input.requestId ?
|
|
63901
|
+
const requestId = input.requestId ? z85.uuid().safeParse(input.requestId).data : void 0;
|
|
63839
63902
|
if (input.requestId && !requestId) {
|
|
63840
63903
|
return { accepted: false, code: "origin-rejected", httpStatus: 403 };
|
|
63841
63904
|
}
|
|
@@ -65121,7 +65184,15 @@ var init_pane_stream_websocket = __esm({
|
|
|
65121
65184
|
if (!this.#prepareInputAuthority(true)) return;
|
|
65122
65185
|
this.#nextViewportSeq += 1;
|
|
65123
65186
|
try {
|
|
65124
|
-
|
|
65187
|
+
if (frame.semanticWindowId === void 0)
|
|
65188
|
+
this.#sessionRuntimeBinding.fitViewport(frame.authorityLease, frame.cols, frame.rows);
|
|
65189
|
+
else
|
|
65190
|
+
this.#sessionRuntimeBinding.fitViewport(
|
|
65191
|
+
frame.authorityLease,
|
|
65192
|
+
frame.cols,
|
|
65193
|
+
frame.rows,
|
|
65194
|
+
frame.semanticWindowId
|
|
65195
|
+
);
|
|
65125
65196
|
this.#sendFrame(null, {
|
|
65126
65197
|
type: "viewport-ack",
|
|
65127
65198
|
seq: frame.seq,
|
|
@@ -65901,74 +65972,74 @@ var init_semantic_multiplexer_actions = __esm({
|
|
|
65901
65972
|
});
|
|
65902
65973
|
|
|
65903
65974
|
// packages/daemon/src/command-center/schemas.ts
|
|
65904
|
-
import { z as
|
|
65975
|
+
import { z as z86 } from "zod";
|
|
65905
65976
|
var updateTaskSchema, createTaskSchema, savePlanSchema, savePlanContentSchema, sendCommandSchema, createMilestoneSchema, updateMilestoneSchema, updateAssertionSchema, triggerResearchSchema, launchSchema, stopSchema, skillNameRegex, createSkillSchema, updateSkillSchema;
|
|
65906
65977
|
var init_schemas = __esm({
|
|
65907
65978
|
"packages/daemon/src/command-center/schemas.ts"() {
|
|
65908
65979
|
"use strict";
|
|
65909
|
-
updateTaskSchema =
|
|
65910
|
-
status:
|
|
65911
|
-
assignee:
|
|
65912
|
-
title:
|
|
65913
|
-
description:
|
|
65914
|
-
priority:
|
|
65980
|
+
updateTaskSchema = z86.object({
|
|
65981
|
+
status: z86.enum(["todo", "in-progress", "review", "done"]).optional(),
|
|
65982
|
+
assignee: z86.string().optional(),
|
|
65983
|
+
title: z86.string().optional(),
|
|
65984
|
+
description: z86.string().optional(),
|
|
65985
|
+
priority: z86.number().optional()
|
|
65915
65986
|
});
|
|
65916
|
-
createTaskSchema =
|
|
65917
|
-
title:
|
|
65918
|
-
description:
|
|
65919
|
-
priority:
|
|
65920
|
-
goal:
|
|
65921
|
-
tags:
|
|
65987
|
+
createTaskSchema = z86.object({
|
|
65988
|
+
title: z86.string().trim().min(1, "Title is required"),
|
|
65989
|
+
description: z86.string().optional(),
|
|
65990
|
+
priority: z86.number().optional(),
|
|
65991
|
+
goal: z86.string().optional(),
|
|
65992
|
+
tags: z86.array(z86.string()).optional()
|
|
65922
65993
|
});
|
|
65923
|
-
savePlanSchema =
|
|
65924
|
-
content:
|
|
65994
|
+
savePlanSchema = z86.object({
|
|
65995
|
+
content: z86.string().max(1e6, "Plan content is too large")
|
|
65925
65996
|
});
|
|
65926
|
-
savePlanContentSchema =
|
|
65927
|
-
content:
|
|
65997
|
+
savePlanContentSchema = z86.object({
|
|
65998
|
+
content: z86.string().max(1e6, "Plan content is too large")
|
|
65928
65999
|
});
|
|
65929
|
-
sendCommandSchema =
|
|
65930
|
-
target:
|
|
65931
|
-
message:
|
|
65932
|
-
noEnter:
|
|
66000
|
+
sendCommandSchema = z86.object({
|
|
66001
|
+
target: z86.string().min(1, "Target pane is required"),
|
|
66002
|
+
message: z86.string().min(1, "Message is required"),
|
|
66003
|
+
noEnter: z86.boolean().optional()
|
|
65933
66004
|
});
|
|
65934
|
-
createMilestoneSchema =
|
|
65935
|
-
title:
|
|
65936
|
-
sequence:
|
|
65937
|
-
description:
|
|
66005
|
+
createMilestoneSchema = z86.object({
|
|
66006
|
+
title: z86.string().trim().min(1, "Title is required"),
|
|
66007
|
+
sequence: z86.number().int().positive(),
|
|
66008
|
+
description: z86.string().optional()
|
|
65938
66009
|
});
|
|
65939
|
-
updateMilestoneSchema =
|
|
65940
|
-
status:
|
|
65941
|
-
title:
|
|
65942
|
-
description:
|
|
66010
|
+
updateMilestoneSchema = z86.object({
|
|
66011
|
+
status: z86.enum(["locked", "active", "done", "validating"]).optional(),
|
|
66012
|
+
title: z86.string().optional(),
|
|
66013
|
+
description: z86.string().optional()
|
|
65943
66014
|
});
|
|
65944
|
-
updateAssertionSchema =
|
|
65945
|
-
status:
|
|
65946
|
-
evidence:
|
|
65947
|
-
verifiedBy:
|
|
66015
|
+
updateAssertionSchema = z86.object({
|
|
66016
|
+
status: z86.enum(["pending", "passing", "failing", "blocked"]),
|
|
66017
|
+
evidence: z86.string().optional(),
|
|
66018
|
+
verifiedBy: z86.string().optional()
|
|
65948
66019
|
});
|
|
65949
|
-
triggerResearchSchema =
|
|
65950
|
-
type:
|
|
66020
|
+
triggerResearchSchema = z86.object({
|
|
66021
|
+
type: z86.string().trim().min(1, "Research type is required")
|
|
65951
66022
|
});
|
|
65952
|
-
launchSchema =
|
|
65953
|
-
attach:
|
|
66023
|
+
launchSchema = z86.object({
|
|
66024
|
+
attach: z86.boolean().optional()
|
|
65954
66025
|
}).optional();
|
|
65955
|
-
stopSchema =
|
|
66026
|
+
stopSchema = z86.object({}).optional();
|
|
65956
66027
|
skillNameRegex = /^[A-Za-z0-9._ -]+$/;
|
|
65957
|
-
createSkillSchema =
|
|
65958
|
-
name:
|
|
66028
|
+
createSkillSchema = z86.object({
|
|
66029
|
+
name: z86.string().trim().min(1, "Skill name is required").regex(
|
|
65959
66030
|
skillNameRegex,
|
|
65960
66031
|
"Skill name may only contain letters, digits, dot, dash, underscore, or space"
|
|
65961
66032
|
),
|
|
65962
|
-
role:
|
|
65963
|
-
description:
|
|
65964
|
-
specialties:
|
|
65965
|
-
body:
|
|
66033
|
+
role: z86.string().trim().optional(),
|
|
66034
|
+
description: z86.string().optional(),
|
|
66035
|
+
specialties: z86.array(z86.string()).optional(),
|
|
66036
|
+
body: z86.string().optional()
|
|
65966
66037
|
});
|
|
65967
|
-
updateSkillSchema =
|
|
65968
|
-
role:
|
|
65969
|
-
description:
|
|
65970
|
-
specialties:
|
|
65971
|
-
body:
|
|
66038
|
+
updateSkillSchema = z86.object({
|
|
66039
|
+
role: z86.string().trim().optional(),
|
|
66040
|
+
description: z86.string().optional(),
|
|
66041
|
+
specialties: z86.array(z86.string()).optional(),
|
|
66042
|
+
body: z86.string().optional()
|
|
65972
66043
|
});
|
|
65973
66044
|
}
|
|
65974
66045
|
});
|
|
@@ -69140,64 +69211,64 @@ var init_project_init_runner = __esm({
|
|
|
69140
69211
|
});
|
|
69141
69212
|
|
|
69142
69213
|
// packages/daemon/src/schemas/inspect.ts
|
|
69143
|
-
import { z as
|
|
69214
|
+
import { z as z87 } from "zod";
|
|
69144
69215
|
var ProjectInspectDetectedSchemaZ, ProjectInspectSchemaZ, InspectFilesystemRequestSchemaZ, OnboardProjectRequestSchemaZ;
|
|
69145
69216
|
var init_inspect = __esm({
|
|
69146
69217
|
"packages/daemon/src/schemas/inspect.ts"() {
|
|
69147
69218
|
"use strict";
|
|
69148
|
-
ProjectInspectDetectedSchemaZ =
|
|
69219
|
+
ProjectInspectDetectedSchemaZ = z87.object({
|
|
69149
69220
|
/** Detected package manager from lockfile, or `null`. */
|
|
69150
|
-
packageManager:
|
|
69221
|
+
packageManager: z87.enum(["pnpm", "npm", "yarn", "bun"]).nullable(),
|
|
69151
69222
|
/** Detected frameworks (e.g. `["next", "convex"]`). Empty array when none. */
|
|
69152
|
-
frameworks:
|
|
69223
|
+
frameworks: z87.array(z87.string()),
|
|
69153
69224
|
/** Suggested dev command (e.g. `pnpm dev`). `null` if no dev script found. */
|
|
69154
|
-
devCommand:
|
|
69225
|
+
devCommand: z87.string().nullable(),
|
|
69155
69226
|
/** Suggested test command (e.g. `pnpm test`). `null` if no test script found. */
|
|
69156
|
-
testCommand:
|
|
69227
|
+
testCommand: z87.string().nullable()
|
|
69157
69228
|
});
|
|
69158
|
-
ProjectInspectSchemaZ =
|
|
69229
|
+
ProjectInspectSchemaZ = z87.object({
|
|
69159
69230
|
/** Sanitized basename of the directory — safe to use as a tmux session name. */
|
|
69160
|
-
name:
|
|
69231
|
+
name: z87.string(),
|
|
69161
69232
|
/** Absolute, canonical path to the directory. */
|
|
69162
|
-
dir:
|
|
69233
|
+
dir: z87.string(),
|
|
69163
69234
|
/** Whether `<dir>/ide.yml` exists. Legacy compatibility fact. */
|
|
69164
|
-
hasIdeYml:
|
|
69235
|
+
hasIdeYml: z87.boolean(),
|
|
69165
69236
|
/** Whether `.tmux-ide/workspace.yml` exists or wins discovery. */
|
|
69166
|
-
hasWorkspaceConfig:
|
|
69237
|
+
hasWorkspaceConfig: z87.boolean().optional(),
|
|
69167
69238
|
/** Generalized winning config kind. Added without replacing `hasIdeYml`. */
|
|
69168
|
-
configKind:
|
|
69239
|
+
configKind: z87.enum(["workspace", "legacy", "none"]).optional(),
|
|
69169
69240
|
/** Generalized winning config path. Added without replacing legacy path facts. */
|
|
69170
|
-
configPath:
|
|
69241
|
+
configPath: z87.string().nullable().optional(),
|
|
69171
69242
|
/** Legacy config path when an `ide.yml` is present. */
|
|
69172
|
-
ideConfigPath:
|
|
69243
|
+
ideConfigPath: z87.string().nullable().optional(),
|
|
69173
69244
|
/** Git remote origin URL, or `null` if not a git repo / no origin / probe failed. */
|
|
69174
|
-
gitOrigin:
|
|
69245
|
+
gitOrigin: z87.string().nullable(),
|
|
69175
69246
|
/** Current git branch, or `null` if not a git repo / detached HEAD / probe failed. */
|
|
69176
|
-
gitBranch:
|
|
69247
|
+
gitBranch: z87.string().nullable(),
|
|
69177
69248
|
/** Detected stack signals (reuses `tmux-ide detect` logic). */
|
|
69178
69249
|
detected: ProjectInspectDetectedSchemaZ
|
|
69179
69250
|
});
|
|
69180
|
-
InspectFilesystemRequestSchemaZ =
|
|
69181
|
-
dir:
|
|
69251
|
+
InspectFilesystemRequestSchemaZ = z87.object({
|
|
69252
|
+
dir: z87.string().min(1)
|
|
69182
69253
|
});
|
|
69183
|
-
OnboardProjectRequestSchemaZ =
|
|
69184
|
-
dir:
|
|
69254
|
+
OnboardProjectRequestSchemaZ = z87.object({
|
|
69255
|
+
dir: z87.string().min(1),
|
|
69185
69256
|
/** Optional override for the project name — defaults to inspect.name. */
|
|
69186
|
-
name:
|
|
69257
|
+
name: z87.string().min(1).optional(),
|
|
69187
69258
|
/** 1, 2, or 3 — how many Claude panes to scaffold in the top row. */
|
|
69188
|
-
agents:
|
|
69259
|
+
agents: z87.number().int().min(1).max(3),
|
|
69189
69260
|
/**
|
|
69190
69261
|
* Optional per-agent pane titles. When provided, length must equal
|
|
69191
69262
|
* `agents`; the server uses these as `title:` for the Claude panes
|
|
69192
69263
|
* instead of the canonical `Lead`/`Teammate N`/`Claude N` defaults.
|
|
69193
69264
|
*/
|
|
69194
|
-
agentNames:
|
|
69265
|
+
agentNames: z87.array(z87.string().min(1)).optional(),
|
|
69195
69266
|
/** Dev server command (e.g. `pnpm dev`). Omit / null to skip the dev pane. */
|
|
69196
|
-
devCommand:
|
|
69267
|
+
devCommand: z87.string().min(1).nullable().optional(),
|
|
69197
69268
|
/** Test command (e.g. `pnpm test`). Currently informational; stored for later. */
|
|
69198
|
-
testCommand:
|
|
69269
|
+
testCommand: z87.string().min(1).nullable().optional(),
|
|
69199
69270
|
/** Lint command (e.g. `pnpm lint`). Currently informational; stored for later. */
|
|
69200
|
-
lintCommand:
|
|
69271
|
+
lintCommand: z87.string().min(1).nullable().optional()
|
|
69201
69272
|
});
|
|
69202
69273
|
}
|
|
69203
69274
|
});
|
|
@@ -72888,7 +72959,7 @@ import { Hono } from "hono";
|
|
|
72888
72959
|
import { streamSSE } from "hono/streaming";
|
|
72889
72960
|
import { cors } from "hono/cors";
|
|
72890
72961
|
import { zValidator } from "@hono/zod-validator";
|
|
72891
|
-
import { z as
|
|
72962
|
+
import { z as z88 } from "zod";
|
|
72892
72963
|
import { realpathSync as realpathSync17 } from "node:fs";
|
|
72893
72964
|
import { homedir as homedir17 } from "node:os";
|
|
72894
72965
|
import { isAbsolute as isAbsolute18, resolve as pathResolve } from "node:path";
|
|
@@ -72938,7 +73009,7 @@ function requireHostCapability(ownerToken) {
|
|
|
72938
73009
|
if (denied) return denied;
|
|
72939
73010
|
markActionOwnerAuthorized(c);
|
|
72940
73011
|
}
|
|
72941
|
-
if (requirement === "owner-and-operation-id" && !
|
|
73012
|
+
if (requirement === "owner-and-operation-id" && !z88.uuid().safeParse(c.req.header("X-Tmux-Ide-Operation-Id")).success) {
|
|
72942
73013
|
return c.json({ error: "A stable host operation id is required" }, 400);
|
|
72943
73014
|
}
|
|
72944
73015
|
return next();
|
|
@@ -73096,7 +73167,7 @@ function createApp(options = {}) {
|
|
|
73096
73167
|
} catch {
|
|
73097
73168
|
return c.json({ error: "Invalid capability request" }, 400);
|
|
73098
73169
|
}
|
|
73099
|
-
if (!
|
|
73170
|
+
if (!z88.object({}).strict().safeParse(body).success) {
|
|
73100
73171
|
return c.json({ error: "Invalid capability request" }, 400);
|
|
73101
73172
|
}
|
|
73102
73173
|
const appWindowCommandRegistered = daemonActionCommandRegistry.descriptors().some(({ id: id2 }) => id2 === "workspace.app-window.mutate");
|
|
@@ -73104,6 +73175,16 @@ function createApp(options = {}) {
|
|
|
73104
73175
|
status: "ok",
|
|
73105
73176
|
daemon: daemonInstanceIdentity,
|
|
73106
73177
|
capabilities: {
|
|
73178
|
+
// Opt-in keeps the response compatible with older strict host schemas.
|
|
73179
|
+
...c.req.query("windowViewport") === "1" ? {
|
|
73180
|
+
semanticWindowViewport: options.paneStreamIssueBackend ? {
|
|
73181
|
+
available: false,
|
|
73182
|
+
reason: "Window fitting is awaiting isolated sizing qualification."
|
|
73183
|
+
} : {
|
|
73184
|
+
available: false,
|
|
73185
|
+
reason: "This daemon has no pane-stream backend."
|
|
73186
|
+
}
|
|
73187
|
+
} : {},
|
|
73107
73188
|
appWindowMutation: appWindowCommandRegistered && options.appWindowMutationBackend !== void 0 ? { available: true } : {
|
|
73108
73189
|
available: false,
|
|
73109
73190
|
reason: "This daemon generation has no AppWindow mutation backend."
|
|
@@ -76908,7 +76989,7 @@ var init_doctor = __esm({
|
|
|
76908
76989
|
// packages/daemon/src/lib/ssh-daemon-transport.ts
|
|
76909
76990
|
import { spawn as spawn9 } from "node:child_process";
|
|
76910
76991
|
import { createServer as createServer3 } from "node:net";
|
|
76911
|
-
import { z as
|
|
76992
|
+
import { z as z89 } from "zod";
|
|
76912
76993
|
function failure(message) {
|
|
76913
76994
|
return new SshConnectionError(`SSH daemon connection: ${message}`);
|
|
76914
76995
|
}
|
|
@@ -76957,11 +77038,11 @@ var init_ssh_daemon_transport = __esm({
|
|
|
76957
77038
|
"packages/daemon/src/lib/ssh-daemon-transport.ts"() {
|
|
76958
77039
|
"use strict";
|
|
76959
77040
|
init_src();
|
|
76960
|
-
RemoteDaemonHandshakeSchema =
|
|
76961
|
-
version:
|
|
77041
|
+
RemoteDaemonHandshakeSchema = z89.object({
|
|
77042
|
+
version: z89.literal(1),
|
|
76962
77043
|
daemon: CanonicalDaemonInfoSchema.strict().extend({
|
|
76963
|
-
bindHostname:
|
|
76964
|
-
authToken:
|
|
77044
|
+
bindHostname: z89.enum(["127.0.0.1", "localhost", "::1", "0.0.0.0", "::"]),
|
|
77045
|
+
authToken: z89.string().min(1).max(4096)
|
|
76965
77046
|
})
|
|
76966
77047
|
}).strict();
|
|
76967
77048
|
SshConnectionError = class extends Error {
|