dsh-ntr 0.2.1 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/protocol.ts CHANGED
@@ -238,6 +238,50 @@ export interface AcpPluginConfig {
238
238
  * up and reports the `cancelled` stop as-is. Default 2.
239
239
  */
240
240
  staleCancelMaxRetries?: number
241
+ /**
242
+ * Inactivity watchdog for a turn the agent owes an answer: how long the turn
243
+ * may stay SILENT before the host finalizes it as stalled.
244
+ *
245
+ * The clock is `LiveSession.lastAgentActivityAt`, refreshed by ANY
246
+ * `session/update`, at every turn start, at each segment start (the host
247
+ * handing the turn back after a card), and when a permission ask arrives or
248
+ * is resolved. The watchdog only READS it while the turn is watched: an OPEN
249
+ * agent segment (always true on the `/acp`-RPC path, which has no driver
250
+ * stream) and no pending approval. The host-card execution phase and an
251
+ * unanswered ask are exempt by that gate, not because the clock is frozen —
252
+ * they legitimately move it too.
253
+ *
254
+ * Firing finalizes the TURN only (an `agent/notice` plus the usual turn
255
+ * end); it does NOT kill the agent process. The wedged `session/prompt` is
256
+ * abandoned, and the next message reclaims the session: parked with
257
+ * `releaseAll` and resumed with `session/load`, or reset outright when the
258
+ * agent declares no `loadSession` (the context is gone and the user is
259
+ * told).
260
+ *
261
+ * Default 600000 ms (10 minutes); `0` disables the WHOLE watchdog, the tool
262
+ * window included.
263
+ */
264
+ turnStallMs?: number
265
+ /**
266
+ * The longer silence window applied while ANY ACP tool call is still active
267
+ * by `toolCallId` — parallel calls are tracked as a set, so the window lasts
268
+ * until the LAST of them finishes. The agent is working on its own clock in
269
+ * there, so the plain turn window would call a healthy long-running tool
270
+ * stalled.
271
+ *
272
+ * Default 1800000 ms (30 minutes); `0` falls back to
273
+ * {@link AcpPluginConfig.turnStallMs}. It matches
274
+ * `TOOL_OUTPUT_WAIT_MS = 30 * 60 * 1000` in `presets/acp/acp-guard.mjs`, so
275
+ * the two halves of one turn agree on how long a tool may take.
276
+ */
277
+ turnStallToolMs?: number
278
+ /**
279
+ * How often the watchdog scans for silent turns, in milliseconds. A tuning /
280
+ * test knob only: NO settings-page control exists for it — and none for the
281
+ * two windows above either; the whole watchdog is configured in the patch
282
+ * file. Default 30000 ms.
283
+ */
284
+ turnStallTickMs?: number
241
285
  }
242
286
 
243
287
  // ---- Host → browser events (`/api/acp/stream`, SSE) ----
@@ -564,6 +608,38 @@ export interface AgentIdPayload { agentId: string }
564
608
  export interface DefaultAgentSetPayload { agentId?: string }
565
609
  /** `default/agent`: the plugin's own default agent id, or `undefined` when unset. */
566
610
  export type DefaultAgentResult = { agentId?: string }
611
+ /** `plugin/version`: the installed host package's version, for the settings badge. */
612
+ export type PluginVersionResult = { version?: string }
613
+
614
+ /**
615
+ * Where the plugin's own update check stands. The host half only ever reports
616
+ * facts it can read from the harness plugin manager and the npm registry — it
617
+ * never downloads, swaps files, or restarts itself.
618
+ */
619
+ export type PluginUpdateStatus =
620
+ | 'unsupported' | 'not-installed' | 'source-install' | 'managed'
621
+ | 'current' | 'available' | 'applying' | 'busy'
622
+ | 'applied' | 'restart-required' | 'failed'
623
+
624
+ /**
625
+ * One update-check answer, shared by `plugin/update-check` and
626
+ * `plugin/update-apply`.
627
+ */
628
+ export interface PluginUpdateState {
629
+ status: PluginUpdateStatus
630
+ /** 运行中(内存里)的插件版本 */
631
+ current: string
632
+ /** 磁盘上装着的版本(listBundles().version),可读时才有 */
633
+ installed?: string
634
+ /** profile registry 链上最新的稳定版 */
635
+ latest?: string
636
+ /** latest 的 npm 发布时间 ISO */
637
+ publishedAt?: string
638
+ /** 实际按顺序问过的 registry */
639
+ registries?: string[]
640
+ /** 失败/额外说明(英文技术信息,UI 自己负责本地化) */
641
+ message?: string
642
+ }
567
643
 
568
644
  /**
569
645
  * How the composer-edge agent tag shows liveness (the blue halo). `breath`