@zergai/ztc 0.23.0-beta.1 → 0.24.0-beta.1

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.
Files changed (146) hide show
  1. package/README.md +299 -13
  2. package/bin/zmux-darwin-arm64 +0 -0
  3. package/bin/ztc-audio-darwin-arm64 +0 -0
  4. package/bin/ztc-capture-darwin-arm64 +0 -0
  5. package/bin/ztc-tui-darwin-arm64 +0 -0
  6. package/bin/zterm-darwin-arm64 +2 -2
  7. package/dist/agent/agent.js +57 -14
  8. package/dist/agent/backends/http_error.d.ts +2 -0
  9. package/dist/agent/backends/http_error.js +2 -0
  10. package/dist/agent/backends/router_gate.d.ts +3 -2
  11. package/dist/agent/backends/router_gate.js +5 -4
  12. package/dist/agent/backends/router_keys.d.ts +14 -0
  13. package/dist/agent/backends/router_keys.js +19 -0
  14. package/dist/agent/backends/router_refusal.d.ts +5 -3
  15. package/dist/agent/backends/router_refusal.js +28 -6
  16. package/dist/agent/backends/types.d.ts +1 -1
  17. package/dist/agent/backends/zrouter_stream.js +10 -6
  18. package/dist/agent/commands/agent_cli.d.ts +11 -1
  19. package/dist/agent/commands/agent_cli.js +295 -38
  20. package/dist/agent/commands/diff.js +4 -1
  21. package/dist/agent/commands/help.js +4 -1
  22. package/dist/agent/commands/plan.js +3 -1
  23. package/dist/agent/commands/session_redaction.d.ts +16 -0
  24. package/dist/agent/commands/session_redaction.js +77 -0
  25. package/dist/agent/commands/settings.js +144 -0
  26. package/dist/agent/commands/types.d.ts +5 -0
  27. package/dist/agent/commands/usage_spec.d.ts +4 -0
  28. package/dist/agent/commands/usage_spec.js +10 -4
  29. package/dist/agent/runtime/policy.d.ts +25 -0
  30. package/dist/agent/runtime/policy.js +154 -26
  31. package/dist/agent/runtime/source_verification.js +6 -2
  32. package/dist/agent/runtime/tool_runtime.js +81 -3
  33. package/dist/agent/tools/apply_patch.js +678 -131
  34. package/dist/agent/tools/bus_message.d.ts +26 -1
  35. package/dist/agent/tools/bus_message.js +126 -10
  36. package/dist/agent/tools/file.d.ts +16 -1
  37. package/dist/agent/tools/file.js +43 -5
  38. package/dist/agent/tools/index.d.ts +1 -1
  39. package/dist/agent/tools/index.js +1 -1
  40. package/dist/agent/tools/pane.js +5 -0
  41. package/dist/agent/tools/search.js +5 -1
  42. package/dist/agent/tools/supervision.js +16 -2
  43. package/dist/agent/tools/types.d.ts +22 -0
  44. package/dist/app/mirror_startup.d.ts +7 -5
  45. package/dist/app/mirror_startup.js +7 -5
  46. package/dist/app/navigator_mirrors.d.ts +20 -0
  47. package/dist/app/navigator_mirrors.js +36 -0
  48. package/dist/app/workspace_layout_controller.d.ts +11 -2
  49. package/dist/app/workspace_layout_controller.js +13 -2
  50. package/dist/batch/worktree.js +9 -1
  51. package/dist/cli_ratatui.d.ts +264 -12
  52. package/dist/cli_ratatui.js +1198 -103
  53. package/dist/config/types.d.ts +29 -0
  54. package/dist/desktop/daily/source_baseline.js +3 -1
  55. package/dist/diagnostics/session_export.d.ts +1 -0
  56. package/dist/diagnostics/session_export.js +229 -26
  57. package/dist/emulation/tool_adapters.js +42 -5
  58. package/dist/headless.js +24 -5
  59. package/dist/instance_registry.d.ts +7 -0
  60. package/dist/mcp/workspace_server.d.ts +12 -1
  61. package/dist/mcp/workspace_server.js +75 -8
  62. package/dist/panes/agent_cli.d.ts +60 -3
  63. package/dist/panes/agent_cli.js +169 -16
  64. package/dist/panes/agent_pane_sessions.d.ts +22 -0
  65. package/dist/panes/agent_pane_sessions.js +111 -0
  66. package/dist/panes/agent_panes.d.ts +77 -3
  67. package/dist/panes/agent_panes.js +199 -10
  68. package/dist/panes/agent_profiles.d.ts +5 -0
  69. package/dist/panes/agent_profiles.js +7 -0
  70. package/dist/panes/agent_resume.d.ts +134 -0
  71. package/dist/panes/agent_resume.js +155 -0
  72. package/dist/panes/agent_sessions/claude_head.d.ts +32 -0
  73. package/dist/panes/agent_sessions/claude_head.js +122 -0
  74. package/dist/panes/agent_sessions/claude_store.d.ts +59 -0
  75. package/dist/panes/agent_sessions/claude_store.js +223 -0
  76. package/dist/panes/agent_sessions/codex_head.d.ts +55 -0
  77. package/dist/panes/agent_sessions/codex_head.js +161 -0
  78. package/dist/panes/agent_sessions/codex_store.d.ts +43 -0
  79. package/dist/panes/agent_sessions/codex_store.js +187 -0
  80. package/dist/panes/agent_sessions/controller.d.ts +74 -0
  81. package/dist/panes/agent_sessions/controller.js +110 -0
  82. package/dist/panes/agent_sessions/cut_json.d.ts +14 -0
  83. package/dist/panes/agent_sessions/cut_json.js +109 -0
  84. package/dist/panes/agent_sessions/limits.d.ts +48 -0
  85. package/dist/panes/agent_sessions/limits.js +48 -0
  86. package/dist/panes/agent_sessions/scan.d.ts +49 -0
  87. package/dist/panes/agent_sessions/scan.js +86 -0
  88. package/dist/panes/agent_sessions/store_fs.d.ts +51 -0
  89. package/dist/panes/agent_sessions/store_fs.js +128 -0
  90. package/dist/panes/agent_sessions/stores.d.ts +36 -0
  91. package/dist/panes/agent_sessions/stores.js +89 -0
  92. package/dist/panes/agent_sessions/title.d.ts +9 -0
  93. package/dist/panes/agent_sessions/title.js +51 -0
  94. package/dist/panes/agent_sessions/types.d.ts +48 -0
  95. package/dist/panes/agent_sessions/types.js +2 -0
  96. package/dist/panes/reply_arbitrator.d.ts +39 -0
  97. package/dist/panes/reply_arbitrator.js +185 -0
  98. package/dist/panes/reply_modes.d.ts +291 -0
  99. package/dist/panes/reply_modes.js +598 -0
  100. package/dist/runtime_info.js +11 -2
  101. package/dist/session.js +4 -2
  102. package/dist/simulation/living/context.d.ts +8 -8
  103. package/dist/simulation/living/types.d.ts +5 -5
  104. package/dist/simulation/toolkit/dynamic_state.d.ts +1 -1
  105. package/dist/ui/ratatui/ipc_path.d.ts +5 -0
  106. package/dist/ui/ratatui/ipc_path.js +23 -3
  107. package/dist/ui/ratatui/pane_credential_broker.d.ts +23 -8
  108. package/dist/ui/ratatui/pane_credential_broker.js +49 -14
  109. package/dist/ui/ratatui/pane_relay.d.ts +5 -2
  110. package/dist/ui/ratatui/pane_relay.js +86 -19
  111. package/dist/ui/ratatui/process.js +3 -0
  112. package/dist/ui/ratatui/protocol.d.ts +50 -1
  113. package/dist/ui/ratatui/protocol.js +56 -0
  114. package/dist/ui/ratatui/relay_policy.d.ts +39 -0
  115. package/dist/ui/ratatui/relay_policy.js +94 -0
  116. package/dist/ui/ratatui/screen_privacy.d.ts +15 -0
  117. package/dist/ui/ratatui/screen_privacy.js +24 -0
  118. package/dist/ui/scrollback.js +8 -0
  119. package/dist/ui/widgets/agent_sessions_panel.d.ts +139 -0
  120. package/dist/ui/widgets/agent_sessions_panel.js +542 -0
  121. package/dist/ui/widgets/log_view.d.ts +5 -1
  122. package/dist/ui/widgets/log_view.js +40 -4
  123. package/dist/utils/atomic_write.js +9 -11
  124. package/dist/utils/canonical_path.d.ts +19 -0
  125. package/dist/utils/canonical_path.js +44 -0
  126. package/dist/utils/compaction.d.ts +2 -1
  127. package/dist/utils/compaction.js +3 -1
  128. package/dist/utils/git_directory_names.d.ts +51 -0
  129. package/dist/utils/git_directory_names.js +429 -0
  130. package/dist/utils/temporary_write_root.d.ts +6 -1
  131. package/dist/utils/temporary_write_root.js +32 -2
  132. package/dist/utils/tool_result_message.d.ts +4 -1
  133. package/dist/utils/tool_result_message.js +6 -2
  134. package/dist/web/bus_hold.d.ts +70 -0
  135. package/dist/web/bus_hold.js +118 -0
  136. package/dist/web/mirror_client.d.ts +7 -3
  137. package/dist/web/mirror_client.js +61 -23
  138. package/dist/web/mirror_route_gate.d.ts +40 -0
  139. package/dist/web/mirror_route_gate.js +71 -0
  140. package/dist/web/mirror_stream.d.ts +147 -22
  141. package/dist/web/mirror_stream.js +350 -83
  142. package/dist/web/pane_credentials.d.ts +32 -1
  143. package/dist/web/pane_credentials.js +62 -2
  144. package/dist/workspace_collision.js +11 -2
  145. package/dist/zlm-embed.mjs +940 -273
  146. package/package.json +34 -12
@@ -13,10 +13,11 @@ import type { HostedSessionSettings } from '../hosted/session_settings.js';
13
13
  import { type PaneStateUpdate } from './pane_registry.js';
14
14
  import { type WorkspaceRuntimeSnapshot, type WorkspaceTodo } from '../workspace_runtime.js';
15
15
  import type { UsageSnapshot } from '../usage_snapshot.js';
16
+ import { type ReplyMode } from '../panes/reply_modes.js';
16
17
  import { type AccountOpResult } from './accounts_mirror.js';
17
18
  /** The bus member a person in the browser mirror speaks as ("User"); panes and the coordinator are 0 and up. */
18
19
  export declare const BROWSER_BUS_MEMBER_ID = -1;
19
- /** The bus member of the ZTC that runs the mirror ("Overseer", or a sim's coordinator): the parent of every pane on it. */
20
+ /** The bus member of the ZTC that runs the mirror (Main, or a sim's coordinator): the parent of every pane on it. */
20
21
  export declare const OVERSEER_BUS_MEMBER_ID = 0;
21
22
  export type MirrorEventType = 'message' | 'stream_start' | 'reasoning_delta' | 'stream_delta' | 'stream_end' | 'stream_reset' | 'tool_call' | 'tool_result' | 'status' | 'token_usage' | 'error' | 'cancel' | 'mode_change' | 'pane_info' | 'pane_output' | 'zde_lite_state' | 'session_end' | 'reload' | 'clear' | 'todo_list' | 'prompt_entry' | 'ask_user' | 'queue_state' | 'command_pane' | 'command_jobs' | 'evidence' | 'goal' | 'task_handoff' | 'accounts' | 'open_accounts' | 'hook_approval_request' | 'widget_prompt' | 'widget_select' | 'widget_questionnaire' | 'widget_dismiss' | 'widget_settings' | 'context_progress_bar_config' | 'zlicky_cursor' | 'zlicky_highlight' | 'zlicky_clear' | 'zlicky_status' | 'zlicky_capture_request' | 'cv_run_start' | 'cv_run_tick' | 'cv_run_end' | 'cv_diagnose_start' | 'cv_diagnose_classification' | 'cv_diagnose_proposal' | 'cv_diagnose_pr_opened' | 'cv_diagnose_end' | (string & {});
22
23
  export interface MirrorEvent {
@@ -76,7 +77,45 @@ export interface BusMessage {
76
77
  * didn't type it. Every other message has no marker.
77
78
  */
78
79
  via?: 'broadcast';
80
+ /**
81
+ * How the agent pane that sends Main this message asks to be answered by itself in their exchange (panes/reply_modes.ts),
82
+ * as workspace-mcp's send_message gives it; none for the person's default.
83
+ */
84
+ replyMode?: ReplyMode;
79
85
  }
86
+ /**
87
+ * What the ZTC that runs the bus says of a pane's message before it is delivered (onBusMessageCheck): a refusal, in its
88
+ * words, which delivers nothing; or a notice for its sender, which /bus/send's answer carries.
89
+ */
90
+ export type BusMessageCheck = {
91
+ refuse: string;
92
+ } | {
93
+ notice?: string;
94
+ };
95
+ /**
96
+ * What became of a bus message: delivered (or queued for its pane); held for a ZTC agent's pane until it joins the bus
97
+ * (see BusHold); or refused, since what that pane holds is full, since its pane runs no agent, or since the program of
98
+ * the ZTC pane it waited for has exited.
99
+ */
100
+ export type BusDelivery = 'delivered' | 'held' | 'hold_full' | 'not_an_agent' | 'pane_exited';
101
+ /**
102
+ * What a sender is told of its bus message (busSendResult): taken, and, with held, waiting for its pane to join the bus,
103
+ * in the mirror's words; or refused, with the status /bus/send answers, a code and the mirror's words. A sender over HTTP
104
+ * gets it from /bus/send's answer (MirrorClient.sendBusMessage); one in this process, Main, from busSendResult.
105
+ */
106
+ export type BusSendResult = {
107
+ ok: true;
108
+ held?: false;
109
+ } | {
110
+ ok: true;
111
+ held: true;
112
+ notice: string;
113
+ } | {
114
+ ok: false;
115
+ status: number;
116
+ code?: string;
117
+ error: string;
118
+ };
80
119
  export type MirrorMuxCommand = {
81
120
  type: 'focus_pane';
82
121
  pane_id: number;
@@ -381,10 +420,10 @@ export interface ZlickyWebStatus {
381
420
  /**
382
421
  * Where what the mirror's input callback delivers came from: the person in the browser mirror (a browser session's
383
422
  * /input, /submit and /pane-input for pane 0, in open mode a request with no credential, and in a hosted runtime what
384
- * the host's proxy forwards for the signed-in owner); 'relayed', the same routes posted by a ZTC process or a pane (the
385
- * process-wide internal token or a pane's own credential), which is never the person; or /broadcast, which only
386
- * colony's AgentBridge posts to (the overseer's send_to_worktree tool and the colony dashboard's send) and which keeps
387
- * the Router attempt it always had, though it is never the person's typing.
423
+ * the host's proxy forwards for the signed-in owner); 'relayed', the same routes posted by a ZTC process (the
424
+ * process-wide internal token; a pane's own credential reaches none of them), which is never the person; or
425
+ * /broadcast, which only colony's AgentBridge posts to (the overseer's send_to_worktree tool and the colony dashboard's
426
+ * send) and which keeps the Router attempt it always had, though it is never the person's typing.
388
427
  */
389
428
  export type MirrorInputVia = 'browser' | 'relayed' | 'broadcast';
390
429
  export type InputCallback = (input: MessageInput, via: MirrorInputVia) => void;
@@ -421,10 +460,11 @@ export declare function formatMissingWebClientNotice(port: number): string;
421
460
  */
422
461
  export declare const MIRROR_REMOTE_PEER_REFUSAL: string;
423
462
  /**
424
- * What a mirror that keeps pane controls for credentialed callers (setPaneControlCredentialRequired) answers one with
425
- * none: the browser has a credential when ZTC opened it with its link.
463
+ * What a mirror that answers only credentialed callers (setPaneControlCredentialRequired) answers a request with none,
464
+ * on every route but its page's scripts and icons and /health (servedWithoutCredential): the browser has a credential
465
+ * when ZTC opened it with its link. The page itself says it (MIRROR_NEEDS_LINK_PAGE).
426
466
  */
427
- export declare const MIRROR_PANE_CONTROL_NEEDS_LINK: string;
467
+ export declare const MIRROR_NEEDS_LINK = "This mirror answers only the link ZTC gives. Open it from ZTC with /mirror open.";
428
468
  /** What an open mirror says once, as it starts. */
429
469
  export declare const MIRROR_OPEN_ACCESS_NOTICE: string;
430
470
  /**
@@ -473,6 +513,7 @@ export declare class MirrorStreamServer implements MirrorPublisher {
473
513
  private paneInputCallback;
474
514
  private paneControlCallback;
475
515
  private agentPaneMessageCallback;
516
+ private busMessageCheck;
476
517
  private muxCommandCallback;
477
518
  private supervisionCommandCallback;
478
519
  private paneViewportCallback;
@@ -536,6 +577,10 @@ export declare class MirrorStreamServer implements MirrorPublisher {
536
577
  private busConnections;
537
578
  private busCallbacks;
538
579
  private busQueues;
580
+ /** An agent's messages for a ZTC agent's pane that hasn't joined the bus yet (see waitsForJoin). */
581
+ private readonly busHold;
582
+ /** Fires when the next held message comes due (armBusHoldExpiry). */
583
+ private busHoldTimer;
539
584
  private busMembers;
540
585
  private busObservers;
541
586
  private eventObservers;
@@ -575,13 +620,17 @@ export declare class MirrorStreamServer implements MirrorPublisher {
575
620
  /** The address this mirror listens on. */
576
621
  getHost(): string;
577
622
  /**
578
- * Whether this mirror, while sign-in is off, opens panes and takes typing only from a caller with a credential: a
579
- * pane's own, a workspace monitor's, ZTC's own, or the browser session the link ZTC gives starts (getLaunchUrl then
580
- * carries one). For the desktop owner's mirror and a zmux owner's own silent one (see
623
+ * Whether this mirror, while sign-in is off, answers only a caller with a credential: a pane's own, a workspace
624
+ * monitor's, ZTC's own, or the browser session the link ZTC gives starts (getLaunchUrl then carries one). A caller
625
+ * with none gets 401 on every route but the page's scripts and icons, and /health (servedWithoutCredential), reads
626
+ * and the page itself included (which then says how to open the mirror), and no voice stream; /health tells it only
627
+ * that the mirror is up. For the desktop owner's mirror and a zmux owner's own silent one (see
581
628
  * mirrorPaneControlNeedsCredential), which nothing is meant to reach except through ZTC. Sign-in mode has its own
582
629
  * checks, which this leaves as they are.
583
630
  */
584
631
  setPaneControlCredentialRequired(required: boolean): void;
632
+ /** Whether this mirror answers only a caller with a credential (setPaneControlCredentialRequired). */
633
+ isPaneControlCredentialRequired(): boolean;
585
634
  /** What to tell the person once as this mirror starts about connecting from other machines; null for nothing. */
586
635
  remoteAccessNotice(): string | null;
587
636
  getEventHistory(): MirrorEvent[];
@@ -723,6 +772,11 @@ export declare class MirrorStreamServer implements MirrorPublisher {
723
772
  * it into the pane with its sender); false leaves the usual fallbacks.
724
773
  */
725
774
  onAgentPaneMessage(cb: (paneId: number, msg: BusMessage) => boolean): void;
775
+ /**
776
+ * What Main says of a message a pane posts to /bus/send before it is delivered (BusMessageCheck): it refuses a reply
777
+ * mode that names an arbitrator the person didn't set up, and tells the sender what became of its mode.
778
+ */
779
+ onBusMessageCheck(cb: (msg: BusMessage) => BusMessageCheck): void;
726
780
  onMuxCommand(cb: (command: MirrorMuxCommand) => Promise<MirrorMuxCommandResult>): void;
727
781
  onSupervisionCommand(cb: (command: MirrorSupervisionCommand) => Promise<MirrorSupervisionCommandResult>): void;
728
782
  onPaneViewport(cb: (paneId: number, ansi?: boolean) => Promise<MirrorPaneViewportResult>): void;
@@ -744,9 +798,64 @@ export declare class MirrorStreamServer implements MirrorPublisher {
744
798
  */
745
799
  onAllBusMessages(callback: (msg: BusMessage) => void): () => void;
746
800
  /**
747
- * Deliver a bus message to the appropriate target(s).
801
+ * Deliver a bus message to the appropriate target(s). With `agentsOnly` (what a pane's own credential sends), a message
802
+ * goes only to an agent: Main, every bus member ('all'), a pane on the bus or running ZTC, or a Claude Code or Codex
803
+ * pane, which the owner types it into with its sender. For any other pane (a shell, a command) nothing is delivered,
804
+ * queued or typed, and the answer is 'not_an_agent'. Whoever sends it, an agent's message for a ZTC agent's pane that
805
+ * hasn't joined the bus is held until it joins, never typed into the pane, and the answer is 'held' (waitsForJoin);
806
+ * once the renderer has reported that pane's program exited, nothing is held or typed and the answer is 'pane_exited'
807
+ * (forExitedZtc), until a ZTC that joins stands for the pane again. What a pane that can no longer join held is dropped
808
+ * first (dropUnjoinable), so no message for it goes ahead of one that waits.
748
809
  */
749
- deliverBusMessage(msg: BusMessage): void;
810
+ deliverBusMessage(msg: BusMessage, options?: {
811
+ agentsOnly?: boolean;
812
+ }): BusDelivery;
813
+ /** What the sender of a message for TO is told of its DELIVERY (deliverBusMessage), in the mirror's words. */
814
+ busSendResult(delivery: BusDelivery, to: number | 'all'): BusSendResult;
815
+ /** Whether pane TO is Main, on the bus, or a ZTC agent's pane, which gets a message when it joins (isZtcAgentPane). */
816
+ private isZtcBusTarget;
817
+ /**
818
+ * Whether pane PANE_ID runs a ZTC agent: one its owner registered as a ZTC pane, or one whose credential is that of a
819
+ * ZTC that joins the bus (PaneCredentialStore.joinsBus), whatever its type: a native ZTC pane runs as a process pane,
820
+ * and a colony cell is never registered here.
821
+ */
822
+ private isZtcAgentPane;
823
+ /** Whether bus member ID is on the bus: in this process, or on a stream that is still open. */
824
+ private isOnBus;
825
+ /**
826
+ * Does MSG wait for its pane to join the bus? An agent's message (ztc_message) for a pane that isn't on the bus does,
827
+ * from whoever sends it, when its credential is that of a ZTC that joins the bus as it starts
828
+ * (PaneCredentialStore.joinsBus: a ZTC pane in pane mode, a native ZTC pane, a colony cell): it is held and delivered as
829
+ * a message when the pane joins, never typed into the pane as though the person had typed it. A pane that joins no
830
+ * bus, as the browser mirror's own ZTC chat panes, which read stdin, still gets it there. The owner's control commands
831
+ * ({"__ztc_cmd":...} from the ZTC that opened the pane) still go on the pane's control channel, and input
832
+ * (user_input, context_only) to its terminal, as before.
833
+ */
834
+ private waitsForJoin;
835
+ /**
836
+ * Is MSG one that would wait for its pane to join the bus (waitsForJoin), for a ZTC pane off the bus whose program the
837
+ * renderer has reported exited (PaneCredentialStore.ztcExited)? Nothing would join: its sender is told so at once, and
838
+ * so is the sender of every later one, until the pane holds a credential of a ZTC that joins again, started again in
839
+ * place by its owner or opened anew.
840
+ */
841
+ private forExitedZtc;
842
+ /** Whether MSG is an agent's message (ztc_message) for one pane, not Main, and not the owner's control command. */
843
+ private isAgentMessageForPane;
844
+ /**
845
+ * Let go of what pane PANE_ID held once it can no longer join the bus, and tell its senders on the bus: it isn't on the
846
+ * bus, and no credential that joins stands for it any more, since its program was started again in place without one
847
+ * (the renderer's restart, or a replace a pane asked for through the pane relay). A message for it from then on is
848
+ * answered as for any pane that holds no such credential, and never goes ahead of one that still waited.
849
+ */
850
+ private dropUnjoinable;
851
+ /** Drop each held message whose pane hasn't joined when it comes due (BusHold's HOLD_DEADLINE_MS). */
852
+ private armBusHoldExpiry;
853
+ /**
854
+ * Tell each sender on the bus (a ZTC pane, Main) of its DROPPED messages and why, in one message from ZTC for each
855
+ * pane they waited for. A sender off the bus (a Claude Code or Codex pane, the browser member) was told its message was
856
+ * held and hears nothing more; nothing is typed into a pane.
857
+ */
858
+ private dropHeld;
750
859
  private queueBusMessage;
751
860
  private pruneExpiredBusQueues;
752
861
  /**
@@ -988,6 +1097,8 @@ export declare class MirrorStreamServer implements MirrorPublisher {
988
1097
  * for tests; otherwise read from the canonical zaai location.
989
1098
  */
990
1099
  private resolveCvStatePath;
1100
+ /** POST /mirror/publish (a CV publisher's events, behind its own secret) or GET /cv/snapshot (the public CV artifact). */
1101
+ private handleCvRoute;
991
1102
  /**
992
1103
  * GET /cv/snapshot — replaces the old Django /api/cv/snapshot endpoint.
993
1104
  * Returns {schema_version, scenarios:[…]} sorted by (use_case, scenario, seed).
@@ -1030,25 +1141,39 @@ export declare class MirrorStreamServer implements MirrorPublisher {
1030
1141
  */
1031
1142
  private isOpenModeOperatorSession;
1032
1143
  /**
1033
- * Refuse, answering RES, a caller with no credential that would open a pane or type into one (/input, /submit,
1034
- * /pane-input, /broadcast, /bus/send and PANE_OPENING_MUX_COMMANDS), on a mirror that keeps those for credentialed
1035
- * callers (setPaneControlCredentialRequired). True when it refused. Answers to what a pane already asks
1036
- * (/ask-user-answer, /widget-answer, /attention/action, /hook-approval) are not refused here yet: they wait for the
1037
- * approval model outside access gets.
1144
+ * Is AUTH a request with no credential to a mirror that answers only credentialed callers
1145
+ * (setPaneControlCredentialRequired)? Sign-in refuses a request with no credential itself.
1146
+ */
1147
+ private holdsNoCredentialHere;
1148
+ /**
1149
+ * Refuse, answering RES with 401, a request with no credential on a mirror that answers only credentialed callers
1150
+ * (setPaneControlCredentialRequired), unless it asks for the page's scripts and icons, or /health
1151
+ * (servedWithoutCredential). The page itself is refused with a page saying how to open the mirror, anything else with
1152
+ * the same words in JSON. True when it refused. Sign-in refuses a request with no credential itself.
1038
1153
  */
1039
- private refusesUncredentialedPaneControl;
1154
+ private refusesUncredentialedRequest;
1040
1155
  /**
1041
1156
  * Who a caller is on the bus, from how it authenticated, never from what it writes: the person (speaksForPerson) is
1042
1157
  * the browser member; a pane's credential is that pane; the process-wide token is ZTC's own and may speak as any pane
1043
1158
  * or the overseer, and as the person only in a hosted runtime.
1044
1159
  */
1045
1160
  private mayClaimBusMember;
1161
+ /**
1162
+ * May PANE's own credential send COMMAND to /supervision/command? Only for its own pane's sessions: it lists them as
1163
+ * their supervisor, starts one as the supervisor of a pane its own pane opened through the pane relay (as the pane's
1164
+ * credential records: PaneCredentialStore.openerOf), never of a pane ZTC, the person or another pane opened, and stops
1165
+ * one it supervises (asking the owner which those are, since a stop names only its target). A session is kept by the
1166
+ * pane it supervises, so a start for another pane's would take that session over.
1167
+ */
1168
+ private supervisesOwnSessions;
1046
1169
  /** Where input this caller posts to /input, /submit or /pane-input came from (see MirrorInputVia). */
1047
1170
  private inputVia;
1048
- /** The bus member that input this caller posts for another pane speaks as: the person only for the person. */
1171
+ /**
1172
+ * The bus member that input this caller posts for another pane speaks as: the person only for the person, member 0
1173
+ * for ZTC's own process, by the name it joined the bus with ("Main" or its /rename name), "Main" until it has. A
1174
+ * pane's own credential posts no input (paneCredentialReaches).
1175
+ */
1049
1176
  private inputSender;
1050
- /** May a pane's own credential use this route? (See PANE_CREDENTIAL_PATHS.) */
1051
- private paneCredentialReaches;
1052
1177
  /**
1053
1178
  * May this principal mutate the account pool (POST /mirror/account)? Those ops
1054
1179
  * have real host side effects — `login` spawns an OAuth flow on the ztc host;