dsh-rewind-plugin 0.11.0 → 0.12.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.
- package/CONTRIBUTING.md +4 -3
- package/README.en.md +28 -42
- package/README.md +23 -36
- package/SECURITY.md +56 -24
- package/docs/architecture.md +19 -8
- package/docs/compat/audit.md +1 -1
- package/docs/compat/diagnostics.md +2 -1
- package/docs/compat/diagnostics.zh.md +2 -1
- package/docs/compat/tracking-boundary.md +6 -6
- package/docs/compat/tracking-boundary.zh.md +2 -2
- package/docs/format.md +159 -53
- package/docs/snapshot-auto-cleanup.md +8 -10
- package/docs/snapshot-auto-cleanup.zh.md +2 -4
- package/lib/client.js +77 -51
- package/lib/index.js +1036 -228
- package/lib/types/client/portals.d.ts +34 -0
- package/lib/types/locales.d.ts +1 -0
- package/lib/types/snapshot.d.ts +397 -83
- package/package.json +1 -1
|
@@ -163,6 +163,40 @@ export declare function actionsContainerOf(row: HTMLElement | undefined): HTMLEl
|
|
|
163
163
|
* is otherwise only reachable through a full React portal render.
|
|
164
164
|
*/
|
|
165
165
|
export declare function collectTargets(chat: HiddenChat, hiddenSeqs: ReadonlySet<number>): readonly PortalTarget[];
|
|
166
|
+
/**
|
|
167
|
+
* The session-kind slice the durable-target gate reads — the session
|
|
168
|
+
* snapshot's `subagent` cell, the Harness's own runtime signal for a
|
|
169
|
+
* direct-subagent (child) session. Typed structurally so the plugin never
|
|
170
|
+
* imports the session-controller snapshot contract.
|
|
171
|
+
*/
|
|
172
|
+
export interface SessionKindLike {
|
|
173
|
+
/** Non-null exactly while this Session is addressed as a subagent child. */
|
|
174
|
+
readonly subagent: unknown;
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Whether a session is rewind-inert: a direct-subagent (child) session.
|
|
178
|
+
*
|
|
179
|
+
* The Harness refuses every generic Session RPC for a subagent-owned identity
|
|
180
|
+
* (`session/agent-busy`, "use subagent delivery for this child session"), so
|
|
181
|
+
* `/rewind` can never execute there — the command's own admission is the
|
|
182
|
+
* refusal, before any handler runs. A wired-up ↶ button in such a session is
|
|
183
|
+
* therefore dead UI that closes its popover and does nothing
|
|
184
|
+
* (SiriLee/dsh-rewind#26). This mirrors the Harness's own slash-command
|
|
185
|
+
* directory (which returns no commands for an addressed child), the pending
|
|
186
|
+
* path's `collectPendingTargets` gate, and the Host's `isSubagentSession`
|
|
187
|
+
* skips: a child session gets no rewind surface and records no snapshot.
|
|
188
|
+
*/
|
|
189
|
+
export declare function isRewindInertSession(snapshot: SessionKindLike): boolean;
|
|
190
|
+
/**
|
|
191
|
+
* Collect the durable (sent-message) rewind targets of one session: none at all
|
|
192
|
+
* for a rewind-inert subagent session, otherwise `collectTargets`' DOM→target
|
|
193
|
+
* pairing. Kept separate from `collectTargets` so the session-kind gate is a
|
|
194
|
+
* pure, directly testable decision.
|
|
195
|
+
* @param snapshot - the session snapshot carrying the `subagent` cell.
|
|
196
|
+
* @param chat - the session's chat snapshot, or undefined while unavailable.
|
|
197
|
+
* @param hiddenSeqs - anchor seqs withdrawn by previous rewinds.
|
|
198
|
+
*/
|
|
199
|
+
export declare function collectDurableTargets(snapshot: SessionKindLike, chat: HiddenChat | undefined, hiddenSeqs: ReadonlySet<number>): readonly PortalTarget[];
|
|
166
200
|
interface RewindPortalsProps extends RewindBridgeDeps {
|
|
167
201
|
readonly sessionId: string;
|
|
168
202
|
}
|