@arcforge/types 2.0.179 → 2.0.180
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/package.json +1 -1
- package/src/tui.ts +73 -0
package/package.json
CHANGED
package/src/tui.ts
CHANGED
|
@@ -1514,6 +1514,18 @@ export type AgentPayload = {
|
|
|
1514
1514
|
instance: AgentInstance
|
|
1515
1515
|
}
|
|
1516
1516
|
|
|
1517
|
+
/**
|
|
1518
|
+
* `agent:model` — the pin that is now live, and whose agent it is.
|
|
1519
|
+
*
|
|
1520
|
+
* `model` is the pin as written (`codex:gpt-5.6-sol`), not a resolved
|
|
1521
|
+
* capability: it is what the config says and what a picker shows, and a
|
|
1522
|
+
* handler wanting the binding can ask the agent for it.
|
|
1523
|
+
*/
|
|
1524
|
+
export type AgentModelPayload = {
|
|
1525
|
+
model: string
|
|
1526
|
+
instance: AgentInstance
|
|
1527
|
+
}
|
|
1528
|
+
|
|
1517
1529
|
/** `message:sent` — the text, and where it went. */
|
|
1518
1530
|
export type MessageSentPayload = {
|
|
1519
1531
|
content: string
|
|
@@ -1712,6 +1724,22 @@ export type TuiNotifyHooks = {
|
|
|
1712
1724
|
"agent:stopped": (payload: AgentPayload) => void
|
|
1713
1725
|
/** A different instance came on screen. */
|
|
1714
1726
|
"agent:focused": (payload: AgentPayload) => void
|
|
1727
|
+
/**
|
|
1728
|
+
* The focused agent's model changed — what `*` picks.
|
|
1729
|
+
*
|
|
1730
|
+
* Its own event because nothing else announces it. A pick rewrites
|
|
1731
|
+
* axon.config.ts and rebinds the live engine, but it boots nothing and
|
|
1732
|
+
* receives nothing, so `agent:ready` and `message:received` both stay
|
|
1733
|
+
* silent — and a line component declaring those as its triggers went on
|
|
1734
|
+
* showing the previous model until the next boot. The header updated
|
|
1735
|
+
* (it reads Vue state) while the component beside it did not, which is
|
|
1736
|
+
* what made the two disagree on screen.
|
|
1737
|
+
*
|
|
1738
|
+
* Fires after the choice is durable AND the running agent is rebound, so a
|
|
1739
|
+
* handler reading the model gets the one that will answer the next turn
|
|
1740
|
+
* rather than the one being replaced.
|
|
1741
|
+
*/
|
|
1742
|
+
"agent:model": (payload: AgentModelPayload) => void
|
|
1715
1743
|
|
|
1716
1744
|
/** The user sent a message. Fires once it is delivered. */
|
|
1717
1745
|
"message:sent": (payload: MessageSentPayload) => void
|
|
@@ -1740,6 +1768,51 @@ export type TuiHooks = TuiGateHooks & TuiNotifyHooks
|
|
|
1740
1768
|
|
|
1741
1769
|
export type TuiHookName = keyof TuiHooks
|
|
1742
1770
|
|
|
1771
|
+
/**
|
|
1772
|
+
* Every hook name, as a VALUE — the vocabulary a registration is checked against.
|
|
1773
|
+
*
|
|
1774
|
+
* The type above says what is declarable; a type cannot be consulted at runtime,
|
|
1775
|
+
* so `tui.hook("agnet:ready", …)` from a plugin (untyped at the boundary, or
|
|
1776
|
+
* typed and ignored) registered a handler that could never fire and reported
|
|
1777
|
+
* nothing. The same hole let a built-in line component name a hook nothing
|
|
1778
|
+
* emits and simply go stale on screen.
|
|
1779
|
+
*
|
|
1780
|
+
* Kept beside the types deliberately: adding a hook means adding it in both
|
|
1781
|
+
* places, and `tests/extensions/builtin-components.test.ts` fails if this list
|
|
1782
|
+
* and the hooks the app actually raises ever disagree.
|
|
1783
|
+
*/
|
|
1784
|
+
export const TUI_HOOK_NAMES = [
|
|
1785
|
+
"tui:boot",
|
|
1786
|
+
"tui:shutdown",
|
|
1787
|
+
"tui:reloaded",
|
|
1788
|
+
"tui:resize",
|
|
1789
|
+
"tui:copy",
|
|
1790
|
+
"agent:ready",
|
|
1791
|
+
"agent:stopped",
|
|
1792
|
+
"agent:focused",
|
|
1793
|
+
"agent:model",
|
|
1794
|
+
"message:sent",
|
|
1795
|
+
"message:received",
|
|
1796
|
+
"mode:changed",
|
|
1797
|
+
"palette:opened",
|
|
1798
|
+
"palette:closed",
|
|
1799
|
+
"command:ran",
|
|
1800
|
+
"command:failed",
|
|
1801
|
+
"key:pressed",
|
|
1802
|
+
] as const satisfies readonly TuiHookName[]
|
|
1803
|
+
|
|
1804
|
+
/**
|
|
1805
|
+
* Fails to compile if `TUI_HOOK_NAMES` is missing a hook.
|
|
1806
|
+
*
|
|
1807
|
+
* `satisfies` alone only proves every entry is a real name — it says nothing
|
|
1808
|
+
* about the ones left out, so adding a hook to `TuiHooks` and forgetting it
|
|
1809
|
+
* here would typecheck and then reject the new hook at runtime. This assigns
|
|
1810
|
+
* the union to the list's element type, which no longer holds the moment a
|
|
1811
|
+
* name is absent.
|
|
1812
|
+
*/
|
|
1813
|
+
const _everyHookIsListed: (typeof TUI_HOOK_NAMES)[number] = null as unknown as TuiHookName
|
|
1814
|
+
void _everyHookIsListed
|
|
1815
|
+
|
|
1743
1816
|
/**
|
|
1744
1817
|
* A plugin file under `plugins/`.
|
|
1745
1818
|
*
|