@orkestrel/terminal 0.0.4 → 0.0.5

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.
@@ -312,7 +312,7 @@ export declare const CTRL_U: string;
312
312
  * - **`set(snapshot)` upserts under the snapshot's OWN `id`** (no separate id param) — it writes
313
313
  * the row `{ id: snapshot.id, snapshot }`.
314
314
  * - **`get(id)` resolves the stored snapshot for an id**, narrowing the opaque JSON column back to
315
- * a {@link TerminalSnapshot} ({@link import('./helpers.js').isTerminalSnapshot} — the AGENTS §14
315
+ * a {@link TerminalSnapshot} ({@link import('./validators.js').isTerminalSnapshot} — the AGENTS §14
316
316
  * boundary narrow for an untrusted storage read), or `undefined` if none is stored.
317
317
  * - **`delete(id)` drops a snapshot by id**; an absent id is a no-op (no throw).
318
318
  *
@@ -565,8 +565,10 @@ export declare function isCheckboxChoice(value: unknown): value is CheckboxChoic
565
565
  export declare function isInsecureRemote(url: string): boolean;
566
566
 
567
567
  /**
568
- * Narrow an unknown wire value to a {@link PendingPrompt} — the §14 guard a {@link PromptClient}
569
- * applies to each decoded SSE `pending` payload before dispatching it (never an `as`).
568
+ * Narrow an unknown wire value to a {@link PendingPrompt} before dispatching it.
569
+ *
570
+ * @param value - The decoded wire value to inspect
571
+ * @returns Whether `value` is a complete pending-prompt record
570
572
  */
571
573
  export declare const isPendingPrompt: Guard<PendingPrompt>;
572
574
 
@@ -599,7 +601,7 @@ export declare const isPromptType: Guard<PromptType>;
599
601
  */
600
602
  export declare function isTerminalError(value: unknown): value is TerminalError;
601
603
 
602
- /** Narrow an unknown value to a {@link TerminalSnapshot} — a non-empty `id` plus an optional numeric `timeout`. */
604
+ /** Narrow an unknown value to a {@link TerminalSnapshot}. */
603
605
  export declare const isTerminalSnapshot: Guard<TerminalSnapshot>;
604
606
 
605
607
  /**
@@ -985,10 +987,10 @@ export declare class PromptClient implements PromptClientInterface {
985
987
  * - `error` — a connection / dispatch / POST fault (errors are `unknown`).
986
988
  */
987
989
  export declare type PromptClientEventMap = {
988
- connect: [];
989
- disconnect: [];
990
- expire: [id: string];
991
- error: [error: unknown];
990
+ readonly connect: readonly [];
991
+ readonly disconnect: readonly [];
992
+ readonly expire: readonly [id: string];
993
+ readonly error: readonly [error: unknown];
992
994
  };
993
995
 
994
996
  /**
@@ -1042,7 +1044,7 @@ export declare interface PromptClientOptions {
1042
1044
  readonly on?: EmitterHooks<PromptClientEventMap>;
1043
1045
  readonly error?: EmitterErrorHandler;
1044
1046
  readonly fetch?: FetchHandler;
1045
- readonly timer?: TimerHandler;
1047
+ readonly timer?: TimerHandler_2;
1046
1048
  }
1047
1049
 
1048
1050
  /**
@@ -1055,9 +1057,9 @@ export declare interface PromptClientOptions {
1055
1057
  * - `expire` — a parked prompt timed out (or was torn down) unanswered (carries its `id`).
1056
1058
  */
1057
1059
  export declare type PromptEventMap = {
1058
- pending: [prompt: PendingPrompt];
1059
- answer: [id: string, value: unknown];
1060
- expire: [id: string];
1060
+ readonly pending: readonly [prompt: PendingPrompt];
1061
+ readonly answer: readonly [id: string, value: unknown];
1062
+ readonly expire: readonly [id: string];
1061
1063
  };
1062
1064
 
1063
1065
  /**
@@ -1143,7 +1145,7 @@ export declare interface PromptOptions {
1143
1145
  readonly on?: EmitterHooks<PromptEventMap>;
1144
1146
  readonly error?: EmitterErrorHandler;
1145
1147
  readonly timeout?: number;
1146
- readonly timer?: TimerHandler;
1148
+ readonly timer?: TimerHandler_2;
1147
1149
  readonly cap?: number;
1148
1150
  }
1149
1151
 
@@ -1511,9 +1513,9 @@ export declare class TerminalManager implements TerminalManagerInterface {
1511
1513
  * - `expire` — an endpoint's parked prompt timed out (`to` names the endpoint).
1512
1514
  */
1513
1515
  export declare type TerminalManagerEventMap = {
1514
- pending: [prompt: PendingPrompt];
1515
- answer: [to: string, id: string, value: unknown];
1516
- expire: [to: string, id: string];
1516
+ readonly pending: readonly [prompt: PendingPrompt];
1517
+ readonly answer: readonly [to: string, id: string, value: unknown];
1518
+ readonly expire: readonly [to: string, id: string];
1517
1519
  };
1518
1520
 
1519
1521
  /**
@@ -1573,7 +1575,7 @@ export declare interface TerminalManagerInterface {
1573
1575
  export declare interface TerminalManagerOptions {
1574
1576
  readonly store?: TerminalStoreInterface;
1575
1577
  readonly timeout?: number;
1576
- readonly timer?: TimerHandler;
1578
+ readonly timer?: TimerHandler_2;
1577
1579
  readonly cap?: number;
1578
1580
  readonly on?: EmitterHooks<TerminalManagerEventMap>;
1579
1581
  readonly error?: EmitterErrorHandler;
@@ -1582,7 +1584,7 @@ export declare interface TerminalManagerOptions {
1582
1584
  /** Options for {@link import('./factories.js').createTerminal} / a manager-owned {@link PromptInterface} broker — the per-endpoint `timeout` + injected `timer` + optional `cap` on concurrently-parked prompts. */
1583
1585
  export declare interface TerminalOptions {
1584
1586
  readonly timeout?: number;
1585
- readonly timer?: TimerHandler;
1587
+ readonly timer?: TimerHandler_2;
1586
1588
  readonly cap?: number;
1587
1589
  }
1588
1590
 
@@ -1592,7 +1594,7 @@ export declare interface TerminalSnapshot {
1592
1594
  readonly timeout?: number;
1593
1595
  }
1594
1596
 
1595
- /** One opaque persisted row — the shape a `TableInterface<TerminalSnapshotRow>`-backed store reads/writes; `snapshot` is narrowed with {@link import('./helpers.js').isTerminalSnapshot} on read. */
1597
+ /** One opaque persisted row — the shape a `TableInterface<TerminalSnapshotRow>`-backed store reads/writes; `snapshot` is narrowed with {@link import('./validators.js').isTerminalSnapshot} on read. */
1596
1598
  export declare interface TerminalSnapshotRow {
1597
1599
  readonly id: string;
1598
1600
  readonly snapshot: unknown;
@@ -1623,7 +1625,8 @@ export declare type TimerCancel = () => void;
1623
1625
  * `setTimeout` / `clearTimeout`; a test injects a deterministic timer that captures the callback
1624
1626
  * and fires it on demand (no real time, no global fake-timer patching).
1625
1627
  */
1626
- export declare type TimerHandler = (callback: () => void, ms: number) => TimerCancel;
1628
+ declare type TimerHandler_2 = (callback: () => void, ms: number) => TimerCancel;
1629
+ export { TimerHandler_2 as TimerHandler }
1627
1630
 
1628
1631
  /** Toggle `index` in a readonly index list — copy-on-write, returning the new sorted-by-insertion list. */
1629
1632
  export declare function toggleIndex(indices: readonly number[], index: number): readonly number[];
@@ -312,7 +312,7 @@ export declare const CTRL_U: string;
312
312
  * - **`set(snapshot)` upserts under the snapshot's OWN `id`** (no separate id param) — it writes
313
313
  * the row `{ id: snapshot.id, snapshot }`.
314
314
  * - **`get(id)` resolves the stored snapshot for an id**, narrowing the opaque JSON column back to
315
- * a {@link TerminalSnapshot} ({@link import('./helpers.js').isTerminalSnapshot} — the AGENTS §14
315
+ * a {@link TerminalSnapshot} ({@link import('./validators.js').isTerminalSnapshot} — the AGENTS §14
316
316
  * boundary narrow for an untrusted storage read), or `undefined` if none is stored.
317
317
  * - **`delete(id)` drops a snapshot by id**; an absent id is a no-op (no throw).
318
318
  *
@@ -565,8 +565,10 @@ export declare function isCheckboxChoice(value: unknown): value is CheckboxChoic
565
565
  export declare function isInsecureRemote(url: string): boolean;
566
566
 
567
567
  /**
568
- * Narrow an unknown wire value to a {@link PendingPrompt} — the §14 guard a {@link PromptClient}
569
- * applies to each decoded SSE `pending` payload before dispatching it (never an `as`).
568
+ * Narrow an unknown wire value to a {@link PendingPrompt} before dispatching it.
569
+ *
570
+ * @param value - The decoded wire value to inspect
571
+ * @returns Whether `value` is a complete pending-prompt record
570
572
  */
571
573
  export declare const isPendingPrompt: Guard<PendingPrompt>;
572
574
 
@@ -599,7 +601,7 @@ export declare const isPromptType: Guard<PromptType>;
599
601
  */
600
602
  export declare function isTerminalError(value: unknown): value is TerminalError;
601
603
 
602
- /** Narrow an unknown value to a {@link TerminalSnapshot} — a non-empty `id` plus an optional numeric `timeout`. */
604
+ /** Narrow an unknown value to a {@link TerminalSnapshot}. */
603
605
  export declare const isTerminalSnapshot: Guard<TerminalSnapshot>;
604
606
 
605
607
  /**
@@ -985,10 +987,10 @@ export declare class PromptClient implements PromptClientInterface {
985
987
  * - `error` — a connection / dispatch / POST fault (errors are `unknown`).
986
988
  */
987
989
  export declare type PromptClientEventMap = {
988
- connect: [];
989
- disconnect: [];
990
- expire: [id: string];
991
- error: [error: unknown];
990
+ readonly connect: readonly [];
991
+ readonly disconnect: readonly [];
992
+ readonly expire: readonly [id: string];
993
+ readonly error: readonly [error: unknown];
992
994
  };
993
995
 
994
996
  /**
@@ -1042,7 +1044,7 @@ export declare interface PromptClientOptions {
1042
1044
  readonly on?: EmitterHooks<PromptClientEventMap>;
1043
1045
  readonly error?: EmitterErrorHandler;
1044
1046
  readonly fetch?: FetchHandler;
1045
- readonly timer?: TimerHandler;
1047
+ readonly timer?: TimerHandler_2;
1046
1048
  }
1047
1049
 
1048
1050
  /**
@@ -1055,9 +1057,9 @@ export declare interface PromptClientOptions {
1055
1057
  * - `expire` — a parked prompt timed out (or was torn down) unanswered (carries its `id`).
1056
1058
  */
1057
1059
  export declare type PromptEventMap = {
1058
- pending: [prompt: PendingPrompt];
1059
- answer: [id: string, value: unknown];
1060
- expire: [id: string];
1060
+ readonly pending: readonly [prompt: PendingPrompt];
1061
+ readonly answer: readonly [id: string, value: unknown];
1062
+ readonly expire: readonly [id: string];
1061
1063
  };
1062
1064
 
1063
1065
  /**
@@ -1143,7 +1145,7 @@ export declare interface PromptOptions {
1143
1145
  readonly on?: EmitterHooks<PromptEventMap>;
1144
1146
  readonly error?: EmitterErrorHandler;
1145
1147
  readonly timeout?: number;
1146
- readonly timer?: TimerHandler;
1148
+ readonly timer?: TimerHandler_2;
1147
1149
  readonly cap?: number;
1148
1150
  }
1149
1151
 
@@ -1511,9 +1513,9 @@ export declare class TerminalManager implements TerminalManagerInterface {
1511
1513
  * - `expire` — an endpoint's parked prompt timed out (`to` names the endpoint).
1512
1514
  */
1513
1515
  export declare type TerminalManagerEventMap = {
1514
- pending: [prompt: PendingPrompt];
1515
- answer: [to: string, id: string, value: unknown];
1516
- expire: [to: string, id: string];
1516
+ readonly pending: readonly [prompt: PendingPrompt];
1517
+ readonly answer: readonly [to: string, id: string, value: unknown];
1518
+ readonly expire: readonly [to: string, id: string];
1517
1519
  };
1518
1520
 
1519
1521
  /**
@@ -1573,7 +1575,7 @@ export declare interface TerminalManagerInterface {
1573
1575
  export declare interface TerminalManagerOptions {
1574
1576
  readonly store?: TerminalStoreInterface;
1575
1577
  readonly timeout?: number;
1576
- readonly timer?: TimerHandler;
1578
+ readonly timer?: TimerHandler_2;
1577
1579
  readonly cap?: number;
1578
1580
  readonly on?: EmitterHooks<TerminalManagerEventMap>;
1579
1581
  readonly error?: EmitterErrorHandler;
@@ -1582,7 +1584,7 @@ export declare interface TerminalManagerOptions {
1582
1584
  /** Options for {@link import('./factories.js').createTerminal} / a manager-owned {@link PromptInterface} broker — the per-endpoint `timeout` + injected `timer` + optional `cap` on concurrently-parked prompts. */
1583
1585
  export declare interface TerminalOptions {
1584
1586
  readonly timeout?: number;
1585
- readonly timer?: TimerHandler;
1587
+ readonly timer?: TimerHandler_2;
1586
1588
  readonly cap?: number;
1587
1589
  }
1588
1590
 
@@ -1592,7 +1594,7 @@ export declare interface TerminalSnapshot {
1592
1594
  readonly timeout?: number;
1593
1595
  }
1594
1596
 
1595
- /** One opaque persisted row — the shape a `TableInterface<TerminalSnapshotRow>`-backed store reads/writes; `snapshot` is narrowed with {@link import('./helpers.js').isTerminalSnapshot} on read. */
1597
+ /** One opaque persisted row — the shape a `TableInterface<TerminalSnapshotRow>`-backed store reads/writes; `snapshot` is narrowed with {@link import('./validators.js').isTerminalSnapshot} on read. */
1596
1598
  export declare interface TerminalSnapshotRow {
1597
1599
  readonly id: string;
1598
1600
  readonly snapshot: unknown;
@@ -1623,7 +1625,8 @@ export declare type TimerCancel = () => void;
1623
1625
  * `setTimeout` / `clearTimeout`; a test injects a deterministic timer that captures the callback
1624
1626
  * and fires it on demand (no real time, no global fake-timer patching).
1625
1627
  */
1626
- export declare type TimerHandler = (callback: () => void, ms: number) => TimerCancel;
1628
+ declare type TimerHandler_2 = (callback: () => void, ms: number) => TimerCancel;
1629
+ export { TimerHandler_2 as TimerHandler }
1627
1630
 
1628
1631
  /** Toggle `index` in a readonly index list — copy-on-write, returning the new sorted-by-insertion list. */
1629
1632
  export declare function toggleIndex(indices: readonly number[], index: number): readonly number[];