@hediet/linkrpc-cli 0.0.3-next.20260925.3 → 0.0.3-next.20260926.2
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/dist/chunks/{cli-DA7el6WB.js → cli-CGKufid3.js} +5 -22
- package/dist/chunks/{cli-DA7el6WB.js.map → cli-CGKufid3.js.map} +1 -1
- package/dist/chunks/{runApprovalUi-Dmme5115.js → runApprovalUi-CzPirGRo.js} +2 -2
- package/dist/chunks/{runApprovalUi-Dmme5115.js.map → runApprovalUi-CzPirGRo.js.map} +1 -1
- package/dist/chunks/{runUi-iTwO1iUN.js → runUi-DvI4Tq4L.js} +2 -2
- package/dist/chunks/{runUi-iTwO1iUN.js.map → runUi-DvI4Tq4L.js.map} +1 -1
- package/dist/hub.js +1 -1
- package/dist/linkrpc.js +1 -1
- package/dist/rpc.js +1 -1
- package/package.json +5 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runUi-iTwO1iUN.js","names":[],"sources":["../../src/ui/SchemaSession.tsx","../../src/ui/ViewController.ts","../../src/ui/UiModel.ts","../../src/ui/schemaInspect.ts","../../src/ui/FieldRow.tsx","../../src/ui/ViewArea.tsx","../../src/views/TerminalKeyInput.tsx","../../src/ui/App.tsx","../../src/ui/runUi.tsx"],"sourcesContent":["import React from \"react\";\nimport { Box, Text } from \"ink\";\nimport { autorun, derived, observableValue, type IObservable } from \"@vscode/observables\";\nimport type { ViewCommand, ViewSession } from \"../views/types\";\nimport type { SchemaState } from \"./UiModel\";\nimport { safeTerminalText } from \"./terminalText\";\n\n/** Built-in read-only view; uses the same viewport and command contract as contributions. */\nexport class SchemaSession implements ViewSession {\n readonly element = <SchemaPanel session={this} />;\n readonly viewport = observableValue(this, { rows: 24, columns: 80, top: 0, left: 0, disposed: false });\n constructor(readonly schema: IObservable<SchemaState>) {}\n readonly lines = derived(this, reader => {\n const value = this.schema.read(reader);\n return (value.kind === \"loaded\" ? JSON.stringify(value.schema, null, 2)\n : value.kind === \"error\" ? String(value.error)\n : value.kind === \"none\" ? \"Select an interface to inspect its schema.\" : \"Loading schema…\")\n .split(\"\\n\").map(safeTerminalText);\n });\n readonly commands = derived(this, (reader): readonly ViewCommand[] => {\n const viewport = this.viewport.read(reader);\n if (viewport.disposed) return [];\n const lines = this.lines.read(reader);\n const page = Math.max(1, viewport.rows - 2);\n const maxTop = Math.max(0, lines.length - page);\n const maxLeft = Math.max(0, lines.reduce((width, line) => Math.max(width, [...line].length), 0) - viewport.columns);\n const top = Math.min(viewport.top, maxTop), left = Math.min(viewport.left, maxLeft);\n const move = (vertical: number, horizontal = 0) => this.viewport.set({\n ...this.viewport.get(), top: Math.max(0, Math.min(maxTop, top + vertical)),\n left: Math.max(0, Math.min(maxLeft, left + horizontal)),\n }, undefined);\n const command = (id: string, title: string, keys: readonly string[], execute: () => void, enabled: boolean): ViewCommand =>\n ({ id: `schema.${id}`, title, keybindings: keys.map(key => ({ key })), execute, enabled, context: \"Schema\" });\n return [\n command(\"up\", \"Scroll up\", [\"up\", \"k\"], () => move(-1), top > 0),\n command(\"down\", \"Scroll down\", [\"down\", \"j\"], () => move(1), top < maxTop),\n command(\"pageUp\", \"Page up\", [\"pageup\"], () => move(-page), top > 0),\n command(\"pageDown\", \"Page down\", [\"pagedown\"], () => move(page), top < maxTop),\n command(\"first\", \"First line\", [\"home\", \"g\"], () => move(-maxTop), top > 0),\n command(\"last\", \"Last line\", [\"end\", \"G\"], () => move(maxTop), top < maxTop),\n command(\"left\", \"Scroll left\", [\"left\", \"h\"], () => move(0, -20), left > 0),\n command(\"right\", \"Scroll right\", [\"right\", \"l\"], () => move(0, 20), left < maxLeft),\n ];\n });\n setViewport(rows: number, columns = this.viewport.get().columns): void {\n const state = this.viewport.get();\n if (rows !== state.rows || columns !== state.columns) this.viewport.set({ ...state, rows, columns }, undefined);\n }\n captureState(): unknown { const { top, left } = this.viewport.get(); return { top, left }; }\n restoreState(value: unknown): void {\n const state = value as { top?: number; left?: number } | undefined;\n if (state) this.viewport.set({ ...this.viewport.get(), top: state.top ?? 0, left: state.left ?? 0 }, undefined);\n }\n dispose(): void { this.viewport.set({ ...this.viewport.get(), disposed: true }, undefined); }\n}\n\nclass SchemaPanel extends React.Component<{ readonly session: SchemaSession }, { revision: number }> {\n state = { revision: 0 };\n private subscription: { dispose(): void } | undefined;\n componentDidMount(): void {\n this.subscription = autorun(reader => {\n this.props.session.viewport.read(reader);\n this.props.session.lines.read(reader);\n this.setState(previous => ({ revision: previous.revision + 1 }));\n });\n }\n componentWillUnmount(): void { this.subscription?.dispose(); }\n render(): React.ReactNode {\n const { session } = this.props;\n const { rows, columns, top } = session.viewport.get();\n const lines = session.lines.get();\n const left = Math.min(session.viewport.get().left,\n Math.max(0, lines.reduce((width, line) => Math.max(width, [...line].length), 0) - columns));\n const capacity = Math.max(1, rows - 2);\n const start = Math.min(top, Math.max(0, lines.length - capacity));\n const schema = session.schema.get();\n return <Box flexDirection=\"column\" width={columns} height={rows} flexShrink={0} overflow=\"hidden\">\n {rows > 1 && <Box height={1} flexShrink={0} overflow=\"hidden\">\n <Text bold color=\"cyan\" wrap=\"truncate-end\">{schema.kind === \"loaded\" ? `SCHEMA ${safeTerminalText(schema.schema.id)}` : \"SCHEMA\"}</Text>\n </Box>}\n {Array.from({ length: capacity }, (_, offset) => <Box key={offset} height={1} flexShrink={0} overflow=\"hidden\">\n <Text wrap=\"truncate-end\">{[...(lines[start + offset] ?? \"\")].slice(left).join(\"\") || \" \"}</Text>\n </Box>)}\n {rows > 2 && <Box height={1} flexShrink={0} overflow=\"hidden\">\n <Text dimColor wrap=\"truncate-end\">{`Lines ${start + 1}–${Math.min(lines.length, start + capacity)}/${lines.length} · column ${left + 1}`}</Text>\n </Box>}\n </Box>;\n }\n}\n","import { Disposable, autorun, derived, observableValue, type IObservable } from \"@vscode/observables\";\nimport type { CliChannel } from \"@hediet/linkrpc-client\";\nimport { views } from \"../views/registry\";\nimport { resolveViewTarget } from \"../views/discovery\";\nimport { formatCondition, interfaceTarget, matchesTarget, targetId, type ViewInterface, type ViewSession, type ViewTarget } from \"../views/types\";\nimport type { MethodKey, SchemaState, UiServiceListing } from \"./UiModel\";\nimport { SchemaSession } from \"./SchemaSession\";\n\nexport class ViewController extends Disposable {\n readonly tab = observableValue<string>(this, \"methods\");\n readonly kind = observableValue<\"interface\" | \"service\">(this, \"interface\");\n readonly session = observableValue<ViewSession | undefined>(this, undefined);\n readonly error = observableValue<string | undefined>(this, undefined);\n readonly connectionGeneration = observableValue(this, 0);\n readonly connected = observableValue(this, true);\n private generation = 0;\n private savedState: { readonly key: string; readonly state: unknown } | undefined;\n private sessionKey: string | undefined;\n private readonly pendingCleanup = new Set<Promise<void>>();\n\n constructor(\n private readonly channel: CliChannel,\n private readonly selection: IObservable<MethodKey | undefined>,\n private readonly schema: IObservable<SchemaState>,\n private readonly listings: () => readonly UiServiceListing[],\n ) {\n super();\n this._register(autorun(reader => {\n const tab = this.tab.read(reader);\n const target = this.target.read(reader);\n this.connectionGeneration.read(reader);\n const connected = this.connected.read(reader);\n const generation = ++this.generation;\n const previous = this.session.get();\n if (previous && this.sessionKey) this.savedState = { key: this.sessionKey, state: previous.captureState?.() };\n this.stopSession(previous);\n this.session.set(undefined, undefined);\n this.error.set(undefined, undefined);\n if (tab === \"schema\") {\n const key = `schema:${target?.id ?? \"\"}`;\n const session = new SchemaSession(this.schema);\n if (this.savedState?.key === key) session.restoreState(this.savedState.state);\n this.sessionKey = key;\n this.session.set(session, undefined);\n return;\n }\n const view = views.find(value => value.id === tab);\n if (!view || !target || !matchesTarget(target, view) || !connected) return;\n const key = `${tab}:${target.id}`;\n void resolveViewTarget(channel, view, target.id).then(context => {\n if (generation !== this.generation) return;\n const session = view.createSession(context);\n if (this.savedState?.key === key) session.restoreState?.(this.savedState.state);\n this.sessionKey = key;\n this.session.set(session, undefined);\n }).catch(error => {\n if (generation === this.generation) this.error.set(String(error), undefined);\n });\n }));\n }\n\n readonly target = derived(this, (reader): ViewTarget | undefined => {\n const selection = this.selection.read(reader);\n if (!selection) return undefined;\n const state = this.schema.read(reader);\n const all = this.listings();\n const listing = all.find(value => value.serviceId === selection.serviceId\n && value.interfaceId === selection.interfaceId\n && !!value.isDefault === !!selection.isDefault);\n const selected: ViewInterface = {\n ...selection, discoveredFrom: listing?.discoveredFrom ?? selection.serviceId,\n hash: listing?.hash, tags: state.kind === \"loaded\" ? state.schema.tags : listing?.tags,\n };\n if (this.kind.read(reader) === \"interface\") return interfaceTarget(selected);\n const interfaces: ViewInterface[] = [];\n for (const value of [selected, ...all.filter(value => value.serviceId === selected.serviceId\n && value.discoveredFrom === selected.discoveredFrom)]) {\n if (!interfaces.some(item => item.interfaceId === value.interfaceId)) interfaces.push(value);\n }\n return {\n id: targetId(\"service\", selected), kind: \"service\", serviceId: selected.serviceId,\n discoveredFrom: selected.discoveredFrom, interfaces,\n };\n });\n\n readonly tabs = derived(this, reader => {\n const target = this.target.read(reader);\n return [\n { id: \"methods\", title: \"Methods\", condition: \"interface:any | service:any\" },\n { id: \"schema\", title: \"Schema\", condition: \"interface:any | service:any\" },\n ...views.filter(view => target && matchesTarget(target, view)).map(view => ({\n id: view.id, title: view.title, condition: view.conditions.map(formatCondition).join(\" | \"),\n })),\n ];\n });\n\n cycleTab(): void {\n const tabs = this.tabs.get();\n const index = tabs.findIndex(tab => tab.id === this.tab.get());\n this.tab.set(tabs[(index + 1) % tabs.length]!.id, undefined);\n }\n toggleKind(): void { this.kind.set(this.kind.get() === \"interface\" ? \"service\" : \"interface\", undefined); }\n disconnect(): void { this.connected.set(false, undefined); }\n reconnect(): void {\n if (!this.connected.get()) this.connected.set(true, undefined);\n else this.connectionGeneration.set(this.connectionGeneration.get() + 1, undefined);\n }\n private stopSession(session: ViewSession | undefined): void {\n session?.dispose();\n const cleanup = session?.disposeAsync?.();\n if (!cleanup) return;\n this.pendingCleanup.add(cleanup);\n void cleanup.then(() => this.pendingCleanup.delete(cleanup), () => this.pendingCleanup.delete(cleanup));\n }\n async waitForIdle(): Promise<void> {\n await Promise.allSettled([...this.pendingCleanup]);\n }\n override dispose(): void {\n ++this.generation;\n this.stopSession(this.session.get());\n super.dispose();\n }\n}\n","import {\n Disposable,\n ObservableLazyPromise,\n ObservablePromise,\n autorun,\n derived,\n observableValue,\n} from \"@vscode/observables\";\nimport type {\n MethodSchema,\n LinkRpcInterfaceSchema as SvcInterfaceSchema,\n LinkRpcJsonSchema as SvcJsonSchema,\n} from \"@hediet/linkrpc\";\nimport {\n type CliChannel,\n fetchDefaults,\n fetchSchema,\n walkHubDetailed,\n} from \"@hediet/linkrpc-client\";\nimport { validateValueAgainstSchema } from \"../validation\";\nimport { ViewController } from \"./ViewController\";\n\nexport interface MethodKey {\n /** \"\" means the root (no `serviceId::` prefix on the wire). */\n readonly serviceId: string;\n readonly interfaceId: string;\n /** The synthetic default entry invokes methods in bare form. */\n readonly isDefault?: boolean;\n /** `undefined` => no method picked yet; the view shows the method list. */\n readonly methodName: string | undefined;\n}\n\nexport interface UiServiceListing {\n readonly tags?: readonly string[];\n readonly serviceId: string;\n readonly interfaceId: string;\n readonly hash?: string;\n readonly discoveredFrom: string;\n readonly path?: string;\n readonly isDefault?: boolean;\n}\n\nexport interface CallOutcome {\n readonly result: unknown;\n readonly latencyMs: number;\n}\n\nexport interface HistoryEntry {\n readonly method: string;\n readonly params: unknown;\n readonly result: unknown | undefined;\n readonly error: unknown | undefined;\n readonly latencyMs: number;\n readonly timestamp: number;\n}\n\nexport interface FieldDesc {\n readonly name: string;\n readonly required: boolean;\n readonly schema: SvcJsonSchema;\n}\n\nexport type MethodListItem = MethodSchema & { readonly name: string };\n\nexport type SchemaState =\n | { kind: \"none\" }\n | { kind: \"loading\" }\n | { kind: \"error\"; error: unknown }\n | { kind: \"loaded\"; schema: SvcInterfaceSchema; method: MethodListItem | undefined };\n\n/**\n * View model for the TUI. Owns the live channel and an in-memory schema cache\n * keyed by interface id. Loading state for every async lookup is expressed as\n * an `ObservablePromise` from `@vscode/observables` — no ad-hoc loading flags.\n */\nexport class UiModel extends Disposable {\n public readonly views: ViewController;\n /** Initial directory fetch — kicked off in the constructor. */\n public readonly servicesPromise: ObservablePromise<UiServiceListing[]>;\n\n /** Non-fatal discovery failures for services that could not be inspected. */\n public readonly discoveryWarnings = observableValue<readonly string[]>(\n \"UiModel.discoveryWarnings\",\n [],\n );\n\n public readonly selection = observableValue<MethodKey | undefined>(\n \"UiModel.selection\",\n undefined,\n );\n\n public readonly formValues = observableValue<Record<string, unknown>>(\n \"UiModel.formValues\",\n {},\n );\n\n /** Index of the currently-focused form field (clamped at render time). */\n public readonly formCursor = observableValue<number>(\n \"UiModel.formCursor\",\n 0,\n );\n\n /** True when the focused field is in input mode (text being typed). */\n public readonly formEditing = observableValue<boolean>(\n \"UiModel.formEditing\",\n false,\n );\n\n /** Which Miller column currently owns keyboard focus. */\n public readonly focusedColumn = observableValue<0 | 1 | 2>(\n \"UiModel.focusedColumn\",\n 0,\n );\n\n public readonly rawJsonMode = observableValue<boolean>(\n \"UiModel.rawJsonMode\",\n false,\n );\n\n public readonly rawJsonText = observableValue<string>(\n \"UiModel.rawJsonText\",\n \"{}\",\n );\n\n public readonly history = observableValue<HistoryEntry[]>(\n \"UiModel.history\",\n [],\n );\n\n /**\n * Wraps the in-flight call (if any). `undefined` until the user first\n * submits, then re-assigned on each submit. The view reads\n * `promiseResult` to render loading / result / error.\n */\n public readonly lastCall = observableValue<ObservablePromise<CallOutcome> | undefined>(\n \"UiModel.lastCall\",\n undefined,\n );\n\n /**\n * Server→client stream messages received during the in-flight call.\n * Reset to `[]` on each `submit()`, then appended to as `$stream::send`\n * notifications arrive. The view renders these live below the result.\n */\n public readonly streamChunks = observableValue<readonly unknown[]>(\n \"UiModel.streamChunks\",\n [],\n );\n\n /**\n * One-line, human-readable description of the identity signing outbound\n * calls (e.g. `managed (node abcd012345…)`). Rendered in the header.\n * `undefined` until `runUi` resolves the principal.\n */\n public readonly identity = observableValue<string | undefined>(\n \"UiModel.identity\",\n undefined,\n );\n\n /**\n * Per-interface schema cache. `ObservableLazyPromise` defers the actual\n * fetch until something asks for it; the autorun below makes \"something\n * asks\" happen whenever a method on that interface is selected.\n */\n private readonly _schemas = new Map<string, ObservableLazyPromise<SvcInterfaceSchema>>();\n\n constructor(\n private readonly _channel: CliChannel,\n ) {\n super();\n this.servicesPromise = ObservablePromise.fromFn(async () => {\n const result = await loadUiServices(_channel);\n this.discoveryWarnings.set(result.warnings, undefined);\n return result.services;\n });\n // Drain the bare promise so an early close (test teardown, user quit\n // before the call settles) doesn't surface as an unhandled rejection.\n // The error is still observable via `servicesPromise.promiseResult`.\n this.servicesPromise.promise.catch(() => { });\n this.views = this._register(new ViewController(\n _channel, this.selection, this.currentSchemaState,\n () => this.servicesPromise.promiseResult.get()?.data ?? [],\n ));\n\n // When selection changes, kick the lazy schema promise so its\n // observable state starts ticking. The derived below only OBSERVES;\n // it doesn't trigger.\n this._register(autorun((reader) => {\n const sel = this.selection.read(reader);\n if (!sel) return;\n void this._getOrCreateSchema(\n sel.serviceId,\n sel.interfaceId,\n sel.isDefault === true,\n ).getPromise().catch(() => { });\n }));\n // Miller-column convenience: when the methods column gains focus and\n // no method is picked yet, auto-select the first one so the form\n // column shows a preview instead of an empty pane.\n this._register(autorun((reader) => {\n if (this.focusedColumn.read(reader) !== 1) return;\n const sel = this.selection.read(reader);\n if (!sel || sel.methodName !== undefined) return;\n const methods = this.currentMethods.read(reader);\n if (methods.length === 0) return;\n this.selection.set({ ...sel, methodName: methods[0].name }, undefined);\n }));\n }\n\n public readonly currentSchemaState = derived(this, (reader): SchemaState => {\n const sel = this.selection.read(reader);\n if (!sel) return { kind: \"none\" };\n const lazy = this._getOrCreateSchema(\n sel.serviceId,\n sel.interfaceId,\n sel.isDefault === true,\n );\n const result = lazy.cachedPromiseResult.read(reader);\n if (!result) return { kind: \"loading\" };\n if (result.error) return { kind: \"error\", error: result.error };\n const schema = result.data!;\n const methodSchema = sel.methodName !== undefined\n ? schema.methods[sel.methodName]\n : undefined;\n const method = methodSchema && sel.methodName !== undefined\n ? { ...methodSchema, name: sel.methodName }\n : undefined;\n return { kind: \"loaded\", schema, method };\n });\n\n /** Flat list of top-level fields for the currently-selected method. */\n public readonly currentFields = derived(this, (reader): readonly FieldDesc[] => {\n const state = this.currentSchemaState.read(reader);\n if (state.kind !== \"loaded\" || !state.method) return [];\n const paramsSchema = state.method.params;\n return collectTopLevelFields(\n paramsSchema,\n state.schema.components?.schemas ?? {},\n );\n });\n\n /** All methods on the currently-selected interface (column 2). */\n public readonly currentMethods = derived(this, (reader): readonly MethodListItem[] => {\n const state = this.currentSchemaState.read(reader);\n return state.kind === \"loaded\"\n ? Object.entries(state.schema.methods).map(([name, method]) => ({ name, ...method }))\n : [];\n });\n\n /**\n * Whether the currently-selected method declares stream payloads in\n * either direction. Drives the \"streaming\" affordance in the view.\n */\n public readonly currentMethodStreams = derived(this, (reader): { server: boolean; client: boolean } => {\n const state = this.currentSchemaState.read(reader);\n if (state.kind !== \"loaded\" || !state.method) return { server: false, client: false };\n return {\n server: state.method.serverStream !== undefined,\n client: state.method.clientStream !== undefined,\n };\n });\n\n /** Per-field validation errors against the live method schema. */\n public readonly formErrors = derived(this, (reader): ReadonlyMap<string, string> => {\n const state = this.currentSchemaState.read(reader);\n const errors = new Map<string, string>();\n if (state.kind !== \"loaded\" || !state.method) return errors;\n const paramsSchema = state.method.params;\n const components = state.schema.components?.schemas ?? {};\n const resolvedParamsSchema = resolveSchema(paramsSchema, components);\n if (!isObjectSchema(resolvedParamsSchema)) return errors;\n const values = this.formValues.read(reader);\n const required = new Set(resolvedParamsSchema.required ?? []);\n for (const [name, sub] of Object.entries(resolvedParamsSchema.properties)) {\n const value = values[name];\n if (value === undefined) {\n if (required.has(name)) errors.set(name, \"required\");\n continue;\n }\n const reason = validateValueAgainstSchema(value, sub, components);\n if (reason !== undefined) errors.set(name, reason);\n }\n return errors;\n });\n\n public readonly canSubmit = derived(this, (reader): boolean => {\n const sel = this.selection.read(reader);\n if (!sel || sel.methodName === undefined) return false;\n const state = this.currentSchemaState.read(reader);\n if (state.kind !== \"loaded\" || !state.method) return false;\n return this.formErrors.read(reader).size === 0;\n });\n\n public select(key: MethodKey): void {\n this.selection.set(key, undefined);\n this.formValues.set({}, undefined);\n this.rawJsonText.set(\"{}\", undefined);\n this.formCursor.set(0, undefined);\n this.formEditing.set(false, undefined);\n }\n\n /** Pick a concrete method on the currently-selected service/interface. */\n public selectMethod(methodName: string): void {\n const sel = this.selection.get();\n if (!sel) return;\n this.select({ ...sel, methodName });\n }\n\n public focusColumn(column: 0 | 1 | 2): void {\n this.focusedColumn.set(column, undefined);\n }\n\n /**\n * Move the column-0 cursor by `delta`. The cursor is implicit: it's the\n * row whose `(serviceId, interfaceId)` matches the current selection.\n * Stepping off the ends clamps; methodName is cleared so the methods\n * column re-previews the new service.\n */\n public moveServiceCursor(delta: -1 | 1): void {\n const services = this.servicesPromise.promiseResult.get()?.data ?? [];\n if (services.length === 0) return;\n const sel = this.selection.get();\n const currentIdx = sel\n ? services.findIndex((s) =>\n s.serviceId === sel.serviceId\n && s.interfaceId === sel.interfaceId\n && (s.isDefault === true) === (sel.isDefault === true))\n : -1;\n const nextIdx = Math.max(0, Math.min(services.length - 1, currentIdx + delta));\n const next = services[nextIdx];\n this.select({\n serviceId: next.serviceId,\n interfaceId: next.interfaceId,\n methodName: undefined,\n ...(next.isDefault === true ? { isDefault: true } : {}),\n });\n }\n\n /**\n * Move the column-1 cursor by `delta`. Triggers a full `select()` so the\n * form column starts fresh for the newly-previewed method (Miller-style\n * \"each cursor move is a new preview\").\n */\n public moveMethodCursor(delta: -1 | 1): void {\n const methods = this.currentMethods.get();\n if (methods.length === 0) return;\n const sel = this.selection.get();\n if (!sel) return;\n const currentIdx = sel.methodName !== undefined\n ? methods.findIndex((m) => m.name === sel.methodName)\n : -1;\n const nextIdx = Math.max(0, Math.min(methods.length - 1, currentIdx + delta));\n this.selectMethod(methods[nextIdx].name);\n }\n\n public setField(name: string, value: unknown): void {\n const current = this.formValues.get();\n if (value === undefined) {\n // Clearing a field — drop the key so required-checks fire and so\n // wire payloads don't carry explicit `undefined`s.\n const { [name]: _drop, ...rest } = current;\n void _drop;\n this.formValues.set(rest, undefined);\n return;\n }\n this.formValues.set({ ...current, [name]: value }, undefined);\n }\n\n /**\n * Returns the exact `{ method, params }` `submit` would send right\n * now, or `undefined` when no method is fully selected. Lets a host\n * (e.g. the explorer's access-request prompt) preview the concrete\n * call before issuing a one-shot capability bound to it.\n */\n public peekPendingCall(): { method: string; params: unknown } | undefined {\n const sel = this.selection.get();\n if (!sel || sel.methodName === undefined) return undefined;\n const params = this._collectParams();\n const method = sel.isDefault === true\n ? sel.methodName\n : sel.serviceId\n ? `${sel.serviceId}::${sel.interfaceId}::${sel.methodName}`\n : `${sel.interfaceId}::${sel.methodName}`;\n return { method, params };\n }\n\n public submit(): void {\n const sel = this.selection.get();\n if (!sel || sel.methodName === undefined) return;\n const params = this._collectParams();\n const wireMethod = sel.isDefault === true\n ? sel.methodName\n : sel.serviceId\n ? `${sel.serviceId}::${sel.interfaceId}::${sel.methodName}`\n : `${sel.interfaceId}::${sel.methodName}`;\n const start = performance.now();\n this.streamChunks.set([], undefined);\n const promise = ObservablePromise.fromFn(async () => {\n // Stream-capable send: appends any server→client `$stream::send`\n // messages to `streamChunks` as they arrive, then resolves with\n // the call's final response. Behaves like a plain request when the\n // method does not stream.\n const call = this._channel.sendRequestWithStream(wireMethod, params as never, {\n onStreamMessage: (payload) => {\n this.streamChunks.set([...this.streamChunks.get(), payload], undefined);\n },\n });\n const result = await call.result;\n return { result, latencyMs: performance.now() - start } satisfies CallOutcome;\n });\n this.lastCall.set(promise, undefined);\n // Record into history once it settles — keep one place that writes\n // the journal, so views don't have to worry about it.\n promise.promise.then(\n (outcome) => {\n this.history.set(\n [\n ...this.history.get(),\n { method: wireMethod, params, result: outcome.result, error: undefined, latencyMs: outcome.latencyMs, timestamp: Date.now() },\n ],\n undefined,\n );\n },\n (error) => {\n const latencyMs = performance.now() - start;\n this.history.set(\n [\n ...this.history.get(),\n { method: wireMethod, params, result: undefined, error, latencyMs, timestamp: Date.now() },\n ],\n undefined,\n );\n },\n );\n }\n\n private _collectParams(): unknown {\n if (this.rawJsonMode.get()) {\n const text = this.rawJsonText.get().trim();\n if (text.length === 0) return undefined;\n try {\n return JSON.parse(text);\n } catch {\n // The view shows the parse error; submit still sends the\n // unparsable text as a string so the wire layer can complain.\n return text;\n }\n }\n return this.formValues.get();\n }\n\n private _getOrCreateSchema(\n serviceId: string,\n interfaceId: string,\n isDefault: boolean,\n ): ObservableLazyPromise<SvcInterfaceSchema> {\n const key = `${isDefault ? \"default\" : serviceId}::${interfaceId}`;\n let p = this._schemas.get(key);\n if (!p) {\n // Fetch schemas from the directory that reported the interface.\n const listings = this.servicesPromise.promiseResult.get()?.data ?? [];\n const match = listings.find(\n (s) =>\n s.serviceId === serviceId\n && s.interfaceId === interfaceId\n && (s.isDefault === true) === isDefault,\n );\n const reporter = isDefault ? \"\" : (match?.discoveredFrom ?? serviceId);\n const target = reporter === \"\" ? undefined : reporter;\n p = new ObservableLazyPromise(() =>\n fetchSchema(this._channel, interfaceId, match?.hash, target));\n this._schemas.set(key, p);\n }\n return p;\n }\n}\n\ninterface UiServicesResult {\n readonly services: UiServiceListing[];\n readonly warnings: readonly string[];\n}\n\nasync function loadUiServices(channel: CliChannel): Promise<UiServicesResult> {\n const [walkResult, defaultsResult] = await Promise.all([\n walkHubDetailed(channel),\n fetchDefaults(channel).then(\n (defaults) => ({ ok: true as const, defaults }),\n (error: unknown) => ({ ok: false as const, error }),\n ),\n ]);\n\n const warnings = walkResult.inaccessible.map(({ serviceId, reason }) =>\n `Service \"${serviceId}\" does not offer a usable hubrpc.directory::list: ${reason}`\n );\n if (!defaultsResult.ok) {\n warnings.push(\n `The root service does not offer hubrpc.defaults::get: ${getErrorMessage(defaultsResult.error)}`,\n );\n return { services: walkResult.listings, warnings };\n }\n\n const { defaults } = defaultsResult;\n if (defaults.interfaceId === undefined) {\n return { services: walkResult.listings, warnings };\n }\n return {\n services: [{\n serviceId: \"\",\n interfaceId: defaults.interfaceId,\n ...(defaults.hash === undefined ? {} : { hash: defaults.hash }),\n discoveredFrom: \"\",\n isDefault: true,\n }, ...walkResult.listings],\n warnings,\n };\n}\n\nfunction getErrorMessage(error: unknown): string {\n return error instanceof Error ? error.message : String(error);\n}\n\nfunction collectTopLevelFields(\n schema: SvcJsonSchema | undefined,\n components: Readonly<Record<string, SvcJsonSchema>>,\n): FieldDesc[] {\n const resolved = resolveSchema(schema, components);\n if (!isObjectSchema(resolved)) return [];\n const required = new Set(resolved.required ?? []);\n return Object.entries(resolved.properties).map(([name, sub]) => ({\n name,\n required: required.has(name),\n schema: resolveSchema(sub, components) ?? sub,\n }));\n}\n\nfunction resolveSchema(\n schema: SvcJsonSchema | undefined,\n components: Readonly<Record<string, SvcJsonSchema>>,\n seen: ReadonlySet<string> = new Set(),\n): SvcJsonSchema | undefined {\n if (\n schema === undefined\n || typeof schema !== \"object\"\n || !(\"$ref\" in schema)\n ) {\n return schema;\n }\n const prefix = \"#/components/schemas/\";\n if (!schema.$ref.startsWith(prefix) || seen.has(schema.$ref)) {\n return schema;\n }\n const target = components[schema.$ref.slice(prefix.length)];\n if (target === undefined) {\n return schema;\n }\n return resolveSchema(target, components, new Set([...seen, schema.$ref]));\n}\n\nfunction isObjectSchema(\n s: SvcJsonSchema | undefined,\n): s is Extract<SvcJsonSchema, { type: \"object\"; properties: Record<string, SvcJsonSchema> }> {\n return !!s\n && typeof s === \"object\"\n && \"type\" in s\n && s.type === \"object\"\n && \"properties\" in s;\n}\n","import type { LinkRpcJsonSchema as SvcJsonSchema } from \"@hediet/linkrpc\";\n\n/**\n * Coarse classification of a field for the TUI. The form uses this to pick\n * a widget — fall back to free-form JSON editing for anything we can't render\n * inline.\n */\nexport type FieldKind =\n | \"string\"\n | \"number\"\n | \"integer\"\n | \"boolean\"\n | \"enum\"\n | \"json\";\n\nexport interface FieldClassification {\n readonly kind: FieldKind;\n /** Enumerated values for `kind === \"enum\"`. */\n readonly enumValues?: ReadonlyArray<unknown>;\n}\n\nexport function classifyField(schema: SvcJsonSchema): FieldClassification {\n if (typeof schema === \"boolean\") return { kind: \"json\" };\n if (\"enum\" in schema) {\n return { kind: \"enum\", enumValues: schema.enum };\n }\n if (\"const\" in schema) {\n return { kind: \"enum\", enumValues: [schema.const] };\n }\n if (\"anyOf\" in schema) {\n // Treat unions of constants (or single-value branches) as enums so\n // they get the cycle widget instead of a JSON editor.\n const values: unknown[] = [];\n for (const branch of schema.anyOf) {\n if (typeof branch === \"object\" && \"const\" in branch) values.push(branch.const);\n else if (typeof branch === \"object\" && \"enum\" in branch) values.push(...branch.enum);\n else return { kind: \"json\" };\n }\n return { kind: \"enum\", enumValues: values };\n }\n if (\"type\" in schema && typeof schema.type === \"string\") {\n switch (schema.type) {\n case \"string\": return { kind: \"string\" };\n case \"number\": return { kind: \"number\" };\n case \"integer\": return { kind: \"integer\" };\n case \"boolean\": return { kind: \"boolean\" };\n default: return { kind: \"json\" }; // object, array, null\n }\n }\n return { kind: \"json\" };\n}\n\n/** A sensible default value for a freshly-focused field, by kind. */\nexport function defaultValueFor(c: FieldClassification): unknown {\n switch (c.kind) {\n case \"string\": return \"\";\n case \"number\":\n case \"integer\": return 0;\n case \"boolean\": return false;\n case \"enum\": return c.enumValues?.[0] ?? null;\n case \"json\": return null;\n }\n}\n\n/**\n * Move to the next/previous value in an enum field. Wraps at the ends. The\n * cycle is what powers `←`/`→` on enum fields without needing edit mode.\n */\nexport function cycleEnum(\n values: ReadonlyArray<unknown>,\n current: unknown,\n delta: 1 | -1,\n): unknown {\n if (values.length === 0) return current;\n const idx = values.findIndex((v) => deepEqual(v, current));\n const next = (idx < 0 ? 0 : idx + delta + values.length) % values.length;\n return values[next];\n}\n\nfunction deepEqual(a: unknown, b: unknown): boolean {\n if (a === b) return true;\n if (typeof a !== typeof b) return false;\n if (a === null || b === null) return false;\n if (typeof a !== \"object\") return false;\n return JSON.stringify(a) === JSON.stringify(b);\n}\n\n/** Parse a user-typed string into a value compatible with the given kind. */\nexport function parseTypedValue(\n raw: string,\n kind: FieldKind,\n): { ok: true; value: unknown } | { ok: false; error: string } {\n switch (kind) {\n case \"string\": return { ok: true, value: raw };\n case \"number\": {\n if (raw.trim() === \"\") return { ok: true, value: undefined };\n const n = Number(raw);\n if (!Number.isFinite(n)) return { ok: false, error: `not a number: ${raw}` };\n return { ok: true, value: n };\n }\n case \"integer\": {\n if (raw.trim() === \"\") return { ok: true, value: undefined };\n const n = Number(raw);\n if (!Number.isInteger(n)) return { ok: false, error: `not an integer: ${raw}` };\n return { ok: true, value: n };\n }\n case \"json\": {\n if (raw.trim() === \"\") return { ok: true, value: undefined };\n try { return { ok: true, value: JSON.parse(raw) }; }\n catch (e) { return { ok: false, error: (e as Error).message }; }\n }\n case \"boolean\":\n case \"enum\":\n // These don't go through edit mode at all.\n return { ok: false, error: \"not editable via text input\" };\n }\n}\n\n/** Render the current value for display next to the field label. */\nexport function displayValue(value: unknown, kind: FieldKind): string {\n if (value === undefined) return \"(unset)\";\n if (kind === \"string\") return typeof value === \"string\" ? value : JSON.stringify(value);\n if (kind === \"boolean\") return value ? \"[x]\" : \"[ ]\";\n if (kind === \"json\") {\n const text = JSON.stringify(value);\n return text.length > 60 ? text.slice(0, 57) + \"...\" : text;\n }\n return JSON.stringify(value);\n}\n\n/** A short human description of the schema, shown in dim text after the value. */\nexport function describeSchema(s: SvcJsonSchema): string {\n if (typeof s === \"boolean\") return s ? \"any\" : \"never\";\n if (\"type\" in s && typeof s.type === \"string\") return s.type;\n if (\"enum\" in s) return `enum(${s.enum.map((v) => JSON.stringify(v)).join(\" | \")})`;\n if (\"const\" in s) return `const ${JSON.stringify(s.const)}`;\n if (\"anyOf\" in s) return s.anyOf.map(describeSchema).join(\" | \");\n if (\"$ref\" in s) return s.$ref;\n return \"?\";\n}\n","import React from \"react\";\nimport { Box, Text } from \"ink\";\nimport TextInput from \"ink-text-input\";\nimport type { FieldDesc, UiModel } from \"./UiModel\";\nimport {\n classifyField,\n describeSchema,\n parseTypedValue,\n type FieldClassification,\n} from \"./schemaInspect\";\n\nexport interface FieldRowProps {\n readonly model: UiModel;\n readonly field: FieldDesc;\n readonly value: unknown;\n readonly focused: boolean;\n readonly editing: boolean;\n readonly error: string | undefined;\n}\n\nconst NAME_W = 12;\nconst VALUE_W = 24;\n\n/**\n * One row of the method form. To keep ink/yoga happy across resizes, the\n * non-editing path renders the whole row as a single `<Text>` with nested\n * colored spans, instead of multiple Boxes that try to share the column's\n * width. Boxes-around-Text in row direction tend to collapse to the\n * narrowest measurement on the first paint — single-Text rows lay out\n * predictably.\n *\n * The editing path swaps the value column for a `TextInput`; the surrounding\n * row stays a Box because TextInput is a component, not a string.\n */\nexport const FieldRow: React.FC<FieldRowProps> = ({ model, field, value, focused, editing, error }) => {\n const cls = classifyField(field.schema);\n const cursor = focused ? \"› \" : \" \";\n const namePadded = pad(field.name, NAME_W);\n const optionalMark = field.required ? \"\" : \"?\";\n const typeLabel = describeSchema(field.schema);\n\n return (\n <Box flexDirection=\"column\" flexShrink={0}>\n {editing ? (\n <Box flexDirection=\"row\" flexShrink={0}>\n <Text color={focused ? \"cyan\" : undefined}>{cursor}</Text>\n <Text bold>{namePadded}</Text>\n <Text dimColor>{optionalMark === \"\" ? \"\" : optionalMark + \" \"}</Text>\n <Box flexGrow={1} flexShrink={1}>\n <TextEditor model={model} field={field} value={value} cls={cls} />\n </Box>\n <Text dimColor> {typeLabel}</Text>\n </Box>\n ) : (\n <Text>\n <Text color={focused ? \"cyan\" : undefined}>{cursor}</Text>\n <Text bold>{namePadded}</Text>\n <Text dimColor>{optionalMark + \" \"}</Text>\n <Text color=\"yellow\">{pad(formatValue(value, cls), VALUE_W)}</Text>\n <Text dimColor> {typeLabel}</Text>\n </Text>\n )}\n {error ? (\n <Box marginLeft={NAME_W + 2} flexShrink={0}>\n <Text color=\"red\">! {error}</Text>\n </Box>\n ) : null}\n </Box>\n );\n};\n\nconst TextEditor: React.FC<{\n model: UiModel;\n field: FieldDesc;\n value: unknown;\n cls: FieldClassification;\n}> = ({ model, field, value, cls }) => {\n const initial = textForEditing(value, cls.kind);\n const [draft, setDraft] = React.useState(initial);\n React.useEffect(() => { setDraft(initial); }, [initial]);\n\n return (\n <TextInput\n value={draft}\n onChange={setDraft}\n onSubmit={(submitted) => {\n const parsed = parseTypedValue(submitted, cls.kind);\n if (parsed.ok) {\n model.setField(field.name, parsed.value);\n model.formEditing.set(false, undefined);\n }\n // Invalid input: stay in edit mode. The error row already\n // shows the schema-derived complaint via `formErrors`.\n }}\n focus={true}\n />\n );\n};\n\nfunction textForEditing(value: unknown, kind: FieldClassification[\"kind\"]): string {\n if (value === undefined) return \"\";\n if (kind === \"string\") return typeof value === \"string\" ? value : JSON.stringify(value);\n if (kind === \"json\") return JSON.stringify(value);\n return String(value);\n}\n\nfunction formatValue(value: unknown, cls: FieldClassification): string {\n if (value === undefined) return \"(unset)\";\n switch (cls.kind) {\n case \"boolean\": return value ? \"[x]\" : \"[ ]\";\n case \"enum\": return `< ${stringifyEnum(value)} >`;\n case \"string\": return typeof value === \"string\" ? value : JSON.stringify(value);\n case \"json\": {\n const text = JSON.stringify(value);\n return text.length > 40 ? text.slice(0, 37) + \"...\" : text;\n }\n default: return JSON.stringify(value);\n }\n}\n\nfunction stringifyEnum(value: unknown): string {\n return typeof value === \"string\" ? value : JSON.stringify(value);\n}\n\n/** Pad to `width` with spaces, or truncate with `…` if too long. */\nfunction pad(text: string, width: number): string {\n if (text.length === width) return text;\n if (text.length < width) return text + \" \".repeat(width - text.length);\n return text.slice(0, width - 1) + \"…\";\n}\n","import React from \"react\";\nimport { Box, Text } from \"ink\";\nimport { autorun } from \"@vscode/observables\";\nimport type { UiModel } from \"./UiModel\";\nimport { safeTerminalText } from \"./terminalText\";\nimport { ViewFrame } from \"../views/ViewFrame\";\nimport { formatCommandLegend, hostCommands } from \"../views/commands\";\n\n/** Class binding keeps contributed views hook-free. Models own their sessions. */\nexport class ViewArea extends React.Component<{\n readonly model: UiModel;\n readonly height: number;\n readonly chromeRows?: number;\n readonly columns?: number;\n readonly children: React.ReactNode;\n}, { revision: number }> {\n state = { revision: 0 };\n private subscription: { dispose(): void } | undefined;\n componentDidMount(): void {\n this.subscription = autorun(reader => {\n const model = this.props.model;\n model.views.tab.read(reader);\n model.views.kind.read(reader);\n model.views.tabs.read(reader);\n model.views.session.read(reader);\n model.views.error.read(reader);\n model.focusedColumn.read(reader);\n model.currentSchemaState.read(reader);\n this.setState(previous => ({ revision: previous.revision + 1 }));\n });\n }\n componentWillUnmount(): void { this.subscription?.dispose(); }\n render(): React.ReactNode {\n const model = this.props.model;\n const views = model.views;\n const selected = views.tab.get();\n const tabs = views.tabs.get();\n const current = tabs.find(tab => tab.id === selected);\n const chromeRows = this.props.chromeRows ?? 2;\n const contentRows = Math.max(1, this.props.height - chromeRows);\n return <Box flexDirection=\"column\" flexGrow={1} flexBasis={0} minWidth={0} height={this.props.height} overflow=\"hidden\">\n {chromeRows > 0 && <Box height={1} flexShrink={0}><Text wrap=\"truncate-end\">{views.kind.get()}: {tabs.map(tab => tab.id === selected ? `[${tab.title}]` : tab.title).join(\" \")}</Text></Box>}\n {chromeRows > 1 && <Box height={1} flexShrink={0}><Text dimColor wrap=\"truncate-end\">{safeTerminalText(current?.condition ?? \"Unavailable for this target\")}</Text></Box>}\n {selected === \"methods\" ? <Box height={contentRows} flexShrink={0} overflow=\"hidden\">{this.props.children}</Box>\n : views.error.get() ? <Text color=\"red\">{safeTerminalText(views.error.get()!)}</Text>\n : views.session.get() ? <ViewFrame session={views.session.get()!} rows={contentRows} maxColumns={this.props.columns}\n tabbed active={model.focusedColumn.get() > 0} />\n : <Text>{current ? \"Loading view…\" : \"View unavailable; press tab\"}</Text>}\n </Box>;\n }\n}\n\nexport class ViewFooter extends React.Component<{ readonly model: UiModel }, { revision: number }> {\n state = { revision: 0 };\n private subscription: { dispose(): void } | undefined;\n componentDidMount(): void {\n this.subscription = autorun(reader => {\n this.props.model.views.tab.read(reader);\n this.props.model.views.session.read(reader);\n this.props.model.focusedColumn.read(reader);\n this.props.model.formEditing.read(reader);\n this.setState(previous => ({ revision: previous.revision + 1 }));\n });\n }\n componentWillUnmount(): void { this.subscription?.dispose(); }\n render(): React.ReactNode {\n const model = this.props.model;\n if (model.views.session.get()) return <Text dimColor>\n {model.focusedColumn.get() === 0 ? \"Enter/→: focus view\" : \"View commands shown above\"}\n </Text>;\n const noop = () => {};\n const commands = hostCommands({ quit: noop, nextTab: noop, toggleScope: noop,\n back: model.views.tab.get() !== \"methods\" ? noop : undefined }, model.formEditing.get());\n return <Text dimColor wrap=\"truncate-end\">\n {(model.views.tab.get() === \"methods\" ? \"←/→: switch column · ↑/↓: move · Enter: edit/submit · Esc: cancel edit · \" : \"\")\n + formatCommandLegend(commands)}\n </Text>;\n }\n}\n","import React from \"react\";\nimport { stdin } from \"node:process\";\nimport { emitKeypressEvents, type Key } from \"node:readline\";\nimport type { ViewKeyEvent } from \"./types\";\n\n/** Readline preserves named keys such as Home/End that Ink's Key type omits. */\nexport class TerminalKeyInput extends React.Component<{ readonly onKey: (event: ViewKeyEvent) => void }> {\n private readonly onKey = (input: string, key: Key) => this.props.onKey({ ...key, input });\n componentDidMount(): void {\n emitKeypressEvents(stdin);\n stdin.on(\"keypress\", this.onKey);\n }\n componentWillUnmount(): void { stdin.off(\"keypress\", this.onKey); }\n render(): React.ReactNode { return null; }\n}\n","import React from \"react\";\nimport { Box, Text, measureElement, useApp, useInput, useStdout, type DOMElement } from \"ink\";\nimport { autorun, observableValue } from \"@vscode/observables\";\nimport { useObservable } from \"./useObservable\";\nimport { UiModel } from \"./UiModel\";\nimport { FieldRow } from \"./FieldRow\";\nimport { classifyField, cycleEnum, defaultValueFor } from \"./schemaInspect\";\nimport { useScroll } from \"./scroll\";\nimport type { MethodSchema } from \"@hediet/linkrpc\";\nimport { ViewArea, ViewFooter } from \"./ViewArea\";\nimport { dispatchHostKey, matchesKey } from \"../views/commands\";\nimport { TerminalKeyInput } from \"../views/TerminalKeyInput\";\nimport type { ViewKeyEvent } from \"../views/types\";\n\nexport interface AppProps {\n readonly model: UiModel;\n}\n\n// Fixed-height regions framing the scrollable columns. Heights are explicit\n// (not flex) so the windowing math below knows exactly how many rows each list\n// may render — Ink/Yoga gives no usable measurement before paint.\n/** Column chrome that is not list rows: top border + bottom border + title. */\nconst COLUMN_CHROME_H = 3;\n\nexport function uiLayout(columns: number, rows: number, focusedColumn: number, warningCount = 0) {\n const width = Math.max(1, Math.floor(columns));\n const height = Math.max(1, Math.floor(rows));\n const compact = width < 60;\n const headerRows = height > 2 ? 1 + Math.min(warningCount, Math.max(0, height - 10)) : 0;\n const footerRows = height > 1 ? 1 : 0;\n const bodyRows = Math.max(1, height - headerRows - footerRows);\n const sidebarWidth = compact ? focusedColumn === 0 ? width : 0\n : Math.min(28, Math.max(18, Math.floor(width * .22)));\n const mainWidth = width - sidebarWidth;\n const viewHeaderRows = Math.min(bodyRows - 1, height < 20 ? 1 : 2);\n const contentRows = bodyRows - viewHeaderRows;\n const resultRows = Math.min(Math.max(0, contentRows - 1), Math.max(3, Math.min(6, Math.floor(contentRows / 3))));\n const methodRows = contentRows - resultRows;\n const splitMethods = mainWidth >= 65;\n const methodWidth = splitMethods ? Math.min(30, Math.max(22, Math.floor(mainWidth * .35))) : mainWidth;\n return { width, height, compact, headerRows, footerRows, bodyRows, sidebarWidth, mainWidth,\n viewHeaderRows, contentRows, resultRows, methodRows, splitMethods, methodWidth };\n}\n\n/**\n * Miller-column TUI: three columns left → right (services, methods, form)\n * plus a result pane at the bottom. ←/→ moves focus between columns, ↑/↓\n * moves the cursor inside the focused column. Each cursor move in columns\n * 0 / 1 immediately previews into the column to its right.\n */\nexport const App: React.FC<AppProps> = ({ model }) => {\n const { exit } = useApp();\n const { stdout } = useStdout();\n // Keep Ink's raw-mode lease while contributed tabs unmount the method/form\n // input handlers. TerminalKeyInput dispatches the complete readline key set.\n useInput(() => {});\n return <AppLayout model={model} exit={exit} stdout={stdout} />;\n};\n\nclass AppLayout extends React.Component<AppProps & {\n readonly exit: () => void;\n readonly stdout: NodeJS.WriteStream;\n}, { revision: number }> {\n state = { revision: 0 };\n private readonly measuredColumns = observableValue<number | undefined>(this, undefined);\n private readonly root = React.createRef<DOMElement>();\n private mounted = false;\n private subscription: { dispose(): void } | undefined;\n private readonly invalidate = () => this.setState(previous => ({ revision: previous.revision + 1 }));\n componentDidMount(): void {\n this.mounted = true;\n // Update explicit pane bounds before Ink's synchronous resize repaint.\n this.props.stdout.prependListener(\"resize\", this.invalidate);\n this.subscription = autorun(reader => {\n const { model } = this.props;\n model.focusedColumn.read(reader);\n model.formEditing.read(reader);\n model.discoveryWarnings.read(reader);\n model.views.tab.read(reader);\n this.measuredColumns.read(reader);\n this.invalidate();\n });\n this.measure();\n }\n componentDidUpdate(): void { this.measure(); }\n private measure(): void {\n queueMicrotask(() => {\n if (!this.mounted || !this.root.current) return;\n const width = Math.max(1, Math.floor(measureElement(this.root.current).width));\n if (width !== this.measuredColumns.get()) this.measuredColumns.set(width, undefined);\n });\n }\n componentWillUnmount(): void {\n this.mounted = false;\n this.subscription?.dispose();\n this.props.stdout.off(\"resize\", this.invalidate);\n }\n private readonly onKey = (event: ViewKeyEvent) => {\n const { model, exit } = this.props;\n const focusedColumn = model.focusedColumn.get();\n // While editing a field, the text input owns input — don't intercept\n // ← / → for column nav (those move the text cursor).\n if (model.formEditing.get()) {\n if (matchesKey({ key: \"c\", ctrl: true }, event)) exit();\n return;\n }\n const inView = model.views.tab.get() !== \"methods\" && focusedColumn > 0;\n if (dispatchHostKey(inView ? model.views.session.get() : undefined, event, {\n quit: exit,\n nextTab: () => model.views.cycleTab(),\n toggleScope: () => model.views.toggleKind(),\n back: inView ? () => model.focusColumn(0) : undefined,\n })) return;\n if (inView) return;\n if (event.name === \"left\" && focusedColumn > 0) {\n model.focusColumn((focusedColumn - 1) as 0 | 1 | 2);\n return;\n }\n if (event.name === \"right\" && focusedColumn < 2) {\n model.focusColumn((focusedColumn + 1) as 0 | 1 | 2);\n return;\n }\n };\n\n render(): React.ReactNode {\n const { model, stdout } = this.props;\n const focusedColumn = model.focusedColumn.get();\n const warnings = model.discoveryWarnings.get();\n const columns = Math.min(this.measuredColumns.get() ?? 1, stdout.columns ?? 80);\n const layout = uiLayout(columns, stdout.rows ?? 30, focusedColumn, warnings.length);\n return <Box ref={this.root} flexDirection=\"column\" width=\"100%\" minWidth={0} height={layout.height} overflow=\"hidden\">\n <TerminalKeyInput onKey={this.onKey} />\n {layout.headerRows > 0 && <Box height={layout.headerRows} flexShrink={0} overflow=\"hidden\">\n <Header model={model} warnings={warnings.slice(0, layout.headerRows - 1)} />\n </Box>}\n <Box width={layout.width} height={layout.bodyRows} flexShrink={0} overflow=\"hidden\">\n {layout.sidebarWidth > 0 && <ServicesColumn model={model} focused={focusedColumn === 0}\n width={layout.sidebarWidth} height={layout.bodyRows} listHeight={Math.max(1, layout.bodyRows - COLUMN_CHROME_H)} />}\n {layout.mainWidth > 0 && <Box width={layout.mainWidth} height={layout.bodyRows} flexShrink={0} overflow=\"hidden\">\n <ViewArea model={model} height={layout.bodyRows} columns={layout.mainWidth} chromeRows={layout.viewHeaderRows}>\n <Box flexDirection=\"column\" height={layout.contentRows} width={layout.mainWidth} flexShrink={0} overflow=\"hidden\">\n <Box height={layout.methodRows} width={layout.mainWidth} flexShrink={0} overflow=\"hidden\">\n {(layout.splitMethods || focusedColumn !== 2) && <MethodsColumn model={model}\n focused={focusedColumn === 1} width={layout.methodWidth} height={layout.methodRows}\n listHeight={Math.max(1, layout.methodRows - COLUMN_CHROME_H)} />}\n {(layout.splitMethods || focusedColumn === 2) && <FormColumn model={model}\n focused={focusedColumn === 2} height={layout.methodRows}\n listHeight={Math.max(1, layout.methodRows - COLUMN_CHROME_H)} />}\n </Box>\n {layout.resultRows > 0 && <ResultPane model={model} height={layout.resultRows} />}\n </Box>\n </ViewArea>\n </Box>}\n </Box>\n {layout.footerRows > 0 && <Box height={layout.footerRows} flexShrink={0} overflow=\"hidden\">\n <ViewFooter model={model} />\n </Box>}\n </Box>;\n }\n}\n\n/** \"▲ N more\" / \"▼ N more\" indicator row, shown only when items are hidden. */\nconst ScrollIndicator: React.FC<{ direction: \"up\" | \"down\"; count: number }> = ({ direction, count }) => {\n if (count <= 0) return null;\n const arrow = direction === \"up\" ? \"\\u25b2\" : \"\\u25bc\";\n return <Text dimColor>{` ${arrow} ${count} more`}</Text>;\n};\n\n// -- header: signing identity --\n\nconst Header: React.FC<{ model: UiModel; warnings: readonly string[] }> = ({ model, warnings }) => {\n const identity = useObservable(model.identity);\n return (\n <Box flexDirection=\"column\">\n <Box height={1} flexShrink={0}>\n <Text dimColor>identity: </Text>\n <Text wrap=\"truncate-end\">{identity ?? \"(resolving…)\"}</Text>\n </Box>\n {warnings.map((warning) => (\n <Text key={warning} color=\"yellow\" wrap=\"truncate-end\">! {warning}</Text>\n ))}\n </Box>\n );\n};\n\n// -- col 0: services --\n\nconst ServicesColumn: React.FC<{ model: UiModel; focused: boolean; width: number; height: number; listHeight: number }> = ({ model, focused, width, height, listHeight }) => {\n const result = useObservable(model.servicesPromise.promiseResult);\n const selection = useObservable(model.selection);\n\n useInput(\n (_input, key) => {\n if (key.upArrow) model.moveServiceCursor(-1);\n else if (key.downArrow) model.moveServiceCursor(1);\n else if (key.return) model.focusColumn(1);\n },\n { isActive: focused },\n );\n\n const services = !result || result.error ? [] : (result.data ?? []);\n const cursorIdx = selection\n ? services.findIndex((s) =>\n s.serviceId === selection.serviceId\n && s.interfaceId === selection.interfaceId\n && (s.isDefault === true) === (selection.isDefault === true))\n : -1;\n const win = useScroll(services.length, Math.max(0, cursorIdx), listHeight);\n\n return (\n <Column title=\"Services\" focused={focused} width={width} height={height}>\n {!result ? (\n <Text dimColor>Loading…</Text>\n ) : result.error ? (\n <Text color=\"red\">Error: {String(result.error)}</Text>\n ) : services.length === 0 ? (\n <Text dimColor>(no services)</Text>\n ) : (\n <>\n <ScrollIndicator direction=\"up\" count={win.above} />\n {services.slice(win.start, win.end).map((s) => {\n const isCursor = !!selection\n && selection.serviceId === s.serviceId\n && selection.interfaceId === s.interfaceId\n && (selection.isDefault === true) === (s.isDefault === true);\n return (\n <Text\n key={`${s.isDefault === true ? \"default\" : s.serviceId}/${s.interfaceId}`}\n color={isCursor ? (focused ? \"cyan\" : \"white\") : undefined}\n wrap=\"truncate-end\"\n >\n {(isCursor ? \"\\u203a \" : \" \")\n + (s.isDefault === true ? \"default \" : s.serviceId ? `${s.serviceId} ` : \"\")}\n <Text dimColor>{s.interfaceId}</Text>\n </Text>\n );\n })}\n <ScrollIndicator direction=\"down\" count={win.below} />\n </>\n )}\n </Column>\n );\n};\n\n// -- col 1: methods --\n\nconst MethodsColumn: React.FC<{ model: UiModel; focused: boolean; width: number; height: number; listHeight: number }> = ({ model, focused, width, height, listHeight }) => {\n const selection = useObservable(model.selection);\n const schemaState = useObservable(model.currentSchemaState);\n const methods = useObservable(model.currentMethods);\n\n useInput(\n (_input, key) => {\n if (key.upArrow) model.moveMethodCursor(-1);\n else if (key.downArrow) model.moveMethodCursor(1);\n else if (key.return) model.focusColumn(2);\n },\n { isActive: focused },\n );\n\n const cursorIdx = selection?.methodName !== undefined\n ? methods.findIndex((m) => m.name === selection.methodName)\n : -1;\n const win = useScroll(methods.length, Math.max(0, cursorIdx), listHeight);\n\n return (\n <Column title=\"Methods\" focused={focused} width={width} height={height}>\n {!selection ? (\n <Text dimColor>(select a service)</Text>\n ) : schemaState.kind === \"loading\" ? (\n <Text dimColor>Loading…</Text>\n ) : schemaState.kind === \"error\" ? (\n <Text color=\"red\">Error: {String(schemaState.error)}</Text>\n ) : methods.length === 0 ? (\n <Text dimColor>(no methods)</Text>\n ) : (\n <>\n <ScrollIndicator direction=\"up\" count={win.above} />\n {methods.slice(win.start, win.end).map((m) => {\n const isCursor = selection.methodName === m.name;\n return (\n <Text\n key={m.name}\n color={isCursor ? (focused ? \"cyan\" : \"white\") : undefined}\n wrap=\"truncate-end\"\n >\n {(isCursor ? \"\\u203a \" : \" \")}\n <Text dimColor>{m.result === undefined ? \"notify \" : \"req \"}</Text>\n {m.name}\n {m.serverStream !== undefined ? <Text color=\"magenta\">{\" \\u2193stream\"}</Text> : null}\n </Text>\n );\n })}\n <ScrollIndicator direction=\"down\" count={win.below} />\n </>\n )}\n </Column>\n );\n};\n\n// -- col 2: form --\n\nconst FormColumn: React.FC<{ model: UiModel; focused: boolean; height: number; listHeight: number }> = ({ model, focused, height, listHeight }) => {\n const selection = useObservable(model.selection);\n const schemaState = useObservable(model.currentSchemaState);\n\n return (\n <Column title=\"Form\" focused={focused} flexGrow={1} height={height}>\n {!selection ? (\n <Text dimColor>(select a service first)</Text>\n ) : selection.methodName === undefined ? (\n <Text dimColor>(select a method first)</Text>\n ) : schemaState.kind === \"loading\" ? (\n <Text dimColor>Loading…</Text>\n ) : schemaState.kind === \"loaded\" && schemaState.method ? (\n <MethodForm model={model} method={schemaState.method} focused={focused} listHeight={listHeight} />\n ) : schemaState.kind === \"error\" ? (\n <Text color=\"red\">Error: {String(schemaState.error)}</Text>\n ) : (\n <Text color=\"red\">Method \"{selection.methodName}\" not in schema</Text>\n )}\n </Column>\n );\n};\n\nconst MethodForm: React.FC<{ model: UiModel; method: MethodSchema & { readonly name: string }; focused: boolean; listHeight: number }> = ({ model, method, focused, listHeight }) => {\n const fields = useObservable(model.currentFields);\n const formValues = useObservable(model.formValues);\n const errors = useObservable(model.formErrors);\n const canSubmit = useObservable(model.canSubmit);\n const cursor = useObservable(model.formCursor);\n const editing = useObservable(model.formEditing);\n\n const submitRowIdx = fields.length;\n const safeCursor = Math.max(0, Math.min(submitRowIdx, cursor));\n const focusedField = safeCursor < submitRowIdx ? fields[safeCursor] : undefined;\n\n // Rows the field list may occupy: the column's list area minus the method\n // header (name + optional summary + blank) and the submit affordance\n // (blank + submit line). Fields are windowed so a long parameter list never\n // overflows the column and corrupts the panes below.\n const headerLines = 1 + (method.summary ? 1 : 0) + 1;\n const submitLines = 2;\n const fieldsHeight = Math.max(1, listHeight - headerLines - submitLines);\n const win = useScroll(fields.length, Math.min(safeCursor, Math.max(0, fields.length - 1)), fieldsHeight);\n\n useInput(\n (input, key) => {\n if (key.upArrow) {\n model.formCursor.set(Math.max(0, safeCursor - 1), undefined);\n return;\n }\n if (key.downArrow) {\n model.formCursor.set(Math.min(submitRowIdx, safeCursor + 1), undefined);\n return;\n }\n if (focusedField) {\n const cls = classifyField(focusedField.schema);\n const current = formValues[focusedField.name];\n if (cls.kind === \"boolean\" && input === \" \") {\n model.setField(focusedField.name, !current);\n return;\n }\n if (cls.kind === \"enum\") {\n if (key.leftArrow || key.rightArrow) {\n const dir: 1 | -1 = key.rightArrow ? 1 : -1;\n const seed = current === undefined ? defaultValueFor(cls) : current;\n model.setField(focusedField.name, cycleEnum(cls.enumValues ?? [], seed, dir));\n return;\n }\n }\n if (key.return) {\n if (cls.kind === \"boolean\") {\n model.setField(focusedField.name, !current);\n return;\n }\n if (cls.kind === \"enum\") {\n const seed = current === undefined ? defaultValueFor(cls) : current;\n model.setField(focusedField.name, cycleEnum(cls.enumValues ?? [], seed, 1));\n return;\n }\n if (current === undefined) {\n model.setField(focusedField.name, defaultValueFor(cls));\n }\n model.formEditing.set(true, undefined);\n return;\n }\n if (input === \"x\" && focusedField.required === false && current !== undefined) {\n model.setField(focusedField.name, undefined);\n return;\n }\n } else if (safeCursor === submitRowIdx && key.return) {\n if (canSubmit) model.submit();\n return;\n }\n },\n { isActive: focused && !editing },\n );\n\n useInput(\n (_input, key) => {\n if (key.escape) model.formEditing.set(false, undefined);\n },\n { isActive: focused && editing },\n );\n\n return (\n <Box flexDirection=\"column\" flexShrink={0}>\n <Text bold>{(method.result === undefined ? \"notify \" : \"request \") + method.name}</Text>\n {method.summary ? <Text dimColor>{method.summary}</Text> : null}\n <Box marginTop={1} flexDirection=\"column\" flexShrink={0}>\n {fields.length === 0 ? (\n <Text dimColor>(no parameters)</Text>\n ) : (\n <>\n <ScrollIndicator direction=\"up\" count={win.above} />\n {fields.slice(win.start, win.end).map((f, i) => {\n const idx = win.start + i;\n return (\n <FieldRow\n key={f.name}\n model={model}\n field={f}\n value={formValues[f.name]}\n focused={focused && safeCursor === idx}\n editing={editing && safeCursor === idx}\n error={errors.get(f.name)}\n />\n );\n })}\n <ScrollIndicator direction=\"down\" count={win.below} />\n </>\n )}\n </Box>\n <Box marginTop={1} flexShrink={0}>\n <Text color={canSubmit ? \"green\" : \"gray\"}>{submitLabel(focused && safeCursor === submitRowIdx, canSubmit)}</Text>\n </Box>\n </Box>\n );\n};\n\nfunction submitLabel(focused: boolean, canSubmit: boolean): string {\n const prefix = focused ? \"\\u203a \" : \" \";\n const hint = canSubmit ? \"\" : \" \\u2014 fix errors first\";\n return `${prefix}[Submit${hint}]`;\n}\n\n// -- shared column shell --\n\nconst Column: React.FC<{\n title: string;\n focused: boolean;\n children: React.ReactNode;\n width?: string | number;\n flexGrow?: number;\n height?: number;\n}> = ({ title, focused, children, width, flexGrow, height }) => {\n return (\n <Box\n flexDirection=\"column\"\n width={width}\n flexGrow={flexGrow}\n height={height}\n minWidth={0}\n overflow=\"hidden\"\n borderStyle=\"single\"\n borderColor={focused ? \"cyan\" : undefined}\n paddingX={1}\n >\n <Text bold>{title}</Text>\n {children}\n </Box>\n );\n};\n\n// -- result pane --\n\nconst ResultPane: React.FC<{ model: UiModel; height: number }> = ({ model, height }) => {\n const promise = useObservable(model.lastCall);\n const result = useObservable(promise ? promise.promiseResult : NO_RESULT);\n const chunks = useObservable(model.streamChunks);\n\n return (\n <Box flexDirection=\"column\" height={height} flexShrink={0} overflow=\"hidden\" borderStyle=\"single\" paddingX={1}>\n <Text bold>Result</Text>\n {chunks.length > 0 ? (\n <Box flexDirection=\"column\">\n {chunks.map((c, i) => (\n <Text key={i} dimColor>{\"\\u2502 \" + formatChunk(c)}</Text>\n ))}\n </Box>\n ) : null}\n {!promise ? (\n <Text dimColor>(no calls yet)</Text>\n ) : !result ? (\n <Text dimColor>{chunks.length > 0 ? \"Streaming…\" : \"Calling…\"}</Text>\n ) : result.error ? (\n <Text color=\"red\">Error: {formatError(result.error)}</Text>\n ) : (\n <Text>\n {JSON.stringify(result.data?.result)}\n {\" \"}\n <Text dimColor>{result.data?.latencyMs.toFixed(1)}ms</Text>\n </Text>\n )}\n </Box>\n );\n};\n\nconst NO_RESULT = observableValue<undefined>(\"App.NO_RESULT\", undefined);\n\nfunction formatChunk(c: unknown): string {\n return typeof c === \"string\" ? c : JSON.stringify(c);\n}\n\nfunction formatError(e: unknown): string {\n if (e instanceof Error) return e.message;\n return String(e);\n}\n","import { render } from \"ink\";\nimport {\n ChannelConnector,\n type IRequestSender,\n type JsonValue,\n type RawStreamingCall,\n RpcError,\n type SendOpts,\n type SigningCallCtx,\n SigningSender,\n type StreamSendOpts,\n} from \"@hediet/linkrpc\";\nimport { isHubEndpoint, openHubChannel } from \"@hediet/linkrpc/node\";\nimport { type CliSigning, connect } from \"@hediet/linkrpc-client\";\nimport type { ResolvedEndpoint } from \"@hediet/linkrpc-client\";\nimport { setupSigning } from \"@hediet/linkrpc-client\";\nimport type { SigningSession } from \"@hediet/linkrpc-client\";\nimport { formatPrincipalSource, type PrincipalSpec } from \"@hediet/linkrpc-client\";\nimport { UiModel } from \"./UiModel\";\nimport { App } from \"./App\";\nimport { withStaticHubReflection } from \"../commands/staticHubReflection\";\nimport type { StaticHubSchema } from \"../staticHubSchema\";\n\nexport interface RunUiOptions {\n readonly endpoint: ResolvedEndpoint;\n readonly principalSpec: PrincipalSpec;\n readonly schema?: StaticHubSchema;\n readonly profile?: \"rpc\" | \"hub\";\n}\n\nexport async function runUi(opts: RunUiOptions): Promise<void> {\n if (isHubEndpoint(opts.endpoint) && opts.profile !== \"rpc\") {\n await _runUiReconnecting(opts.endpoint, opts.principalSpec, opts.schema);\n } else {\n await _runUiOnce(opts.endpoint, opts.principalSpec, opts.schema, opts.profile);\n }\n}\n\n/** Non-Hub endpoints: a single connection, no redial. */\nasync function _runUiOnce(endpoint: ResolvedEndpoint, principalSpec: PrincipalSpec, schema?: StaticHubSchema, profile?: \"rpc\" | \"hub\"): Promise<void> {\n const conn = await connect(endpoint);\n const identity = _isRawEndpoint(endpoint) || profile === \"rpc\"\n ? \"unsigned (raw endpoint)\"\n : _formatIdentity(\n await setupSigning(conn.channel, conn.signing, principalSpec, {\n negotiateHubCaps: false,\n }),\n );\n const model = new UiModel(schema ? withStaticHubReflection(conn.channel, schema) : conn.channel);\n model.identity.set(identity, undefined);\n const instance = render(<App model={model} />, { exitOnCtrlC: false });\n try {\n await instance.waitUntilExit();\n } finally {\n model.dispose();\n await model.views.waitForIdle();\n conn.close();\n }\n}\n\nfunction _isRawEndpoint(endpoint: ResolvedEndpoint): boolean {\n return endpoint.kind === \"ws-no-init\"\n || (endpoint.kind === \"socket\" && endpoint.brokerMode === \"raw\");\n}\n\n/**\n * Hub / env connection: keep the UI alive across socket drops. A stable\n * {@link SwappableSender} backs the {@link UiModel}; on every (re)connect we\n * open a fresh hub channel, install signing, and point the swappable sender at\n * the new signed channel. The TUI is rendered once, after the first connect.\n */\nasync function _runUiReconnecting(\n endpoint: Extract<ResolvedEndpoint, { kind: \"ws\"; } | { kind: \"socket\"; }>,\n principalSpec: PrincipalSpec,\n schema?: StaticHubSchema,\n): Promise<void> {\n const swappable = new SwappableSender();\n let model: UiModel | undefined;\n\n const hubEndpoint = endpoint.kind === \"ws\" ? endpoint.url : endpoint.path;\n const connector = ChannelConnector.expBackoff(() =>\n openHubChannel({ endpoint: hubEndpoint, token: endpoint.token ?? \"\" })\n );\n\n const handle = connector.keepConnected(async ({ channel }) => {\n const signing: CliSigning = {};\n const signed = SigningSender.wrapChannel(channel, signing).sender;\n const session = await setupSigning(signed, signing, principalSpec, {\n negotiateHubCaps: true,\n });\n swappable.setTarget(signed);\n channel.onClose(() => {\n swappable.setTarget(undefined);\n model?.views.disconnect();\n model?.identity.set(\"disconnected; reconnecting…\", undefined);\n });\n\n if (!model) {\n model = new UiModel(schema ? withStaticHubReflection(swappable, schema) : swappable);\n model.identity.set(_formatIdentity(session), undefined);\n const instance = render(<App model={model} />, { exitOnCtrlC: false });\n // When the user quits the TUI, stop redialing and tear down.\n void instance.waitUntilExit().then(async () => {\n model?.dispose();\n await model?.views.waitForIdle();\n handle.stop();\n }, () => handle.stop());\n } else {\n // Reconnected: update header identity label. Pending/next calls\n // use the swapped target; signing hooks live on that sender.\n model.identity.set(_formatIdentity(session), undefined);\n model.views.reconnect();\n }\n });\n\n try {\n await handle.done;\n } finally {\n model?.dispose();\n await model?.views.waitForIdle();\n }\n}\n\n/** One-line identity label for the TUI header (source + truncated nodeId). */\nfunction _formatIdentity(session: SigningSession): string {\n return formatPrincipalSource(session.principalSource, session.principal.identity.publicSigningIdentity.principal);\n}\n\n/**\n * An {@link IRequestSender} whose delegate can be swapped at runtime. Lets the\n * {@link UiModel} hold one stable channel reference while the underlying signed\n * channel is replaced on each reconnect. Calls issued while disconnected reject.\n */\nclass SwappableSender implements IRequestSender<SigningCallCtx> {\n private _target: IRequestSender<SigningCallCtx> | undefined;\n\n public setTarget(target: IRequestSender<SigningCallCtx> | undefined): void {\n this._target = target;\n }\n\n private _require(): IRequestSender<SigningCallCtx> {\n if (!this._target) {\n throw new RpcError(\"not connected\", -32000);\n }\n return this._target;\n }\n\n public sendRequest(\n method: string,\n params: JsonValue | undefined,\n opts?: SendOpts<SigningCallCtx>,\n ): Promise<JsonValue> {\n return this._require().sendRequest(method, params, opts);\n }\n\n public sendNotification(\n method: string,\n params: JsonValue | undefined,\n opts?: SendOpts<SigningCallCtx>,\n ): Promise<void> {\n return this._require().sendNotification(method, params, opts);\n }\n\n public sendRequestWithStream(\n method: string,\n params: JsonValue | undefined,\n opts?: StreamSendOpts<SigningCallCtx>,\n ): RawStreamingCall {\n return this._require().sendRequestWithStream(method, params, opts);\n }\n\n public close(): void {\n this._target?.close();\n }\n}\n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KAAM;EAE9C,OAAO,KAAK;CAChB;CAEA,YACI,QACA,QACA,MACkB;EAClB,OAAO,KAAK,SAAS,CAAC,CAAC,YAAY,QAAQ,QAAQ,IAAI;CAC3D;CAEA,iBACI,QACA,QACA,MACa;EACb,OAAO,KAAK,SAAS,CAAC,CAAC,iBAAiB,QAAQ,QAAQ,IAAI;CAChE;CAEA,sBACI,QACA,QACA,MACgB;EAChB,OAAO,KAAK,SAAS,CAAC,CAAC,sBAAsB,QAAQ,QAAQ,IAAI;CACrE;CAEA,QAAqB;EACjB,KAAK,SAAS,MAAM;CACxB;AACJ"}
|
|
1
|
+
{"version":3,"file":"runUi-DvI4Tq4L.js","names":[],"sources":["../../src/ui/SchemaSession.tsx","../../src/ui/ViewController.ts","../../src/ui/UiModel.ts","../../src/ui/schemaInspect.ts","../../src/ui/FieldRow.tsx","../../src/ui/ViewArea.tsx","../../src/views/TerminalKeyInput.tsx","../../src/ui/App.tsx","../../src/ui/runUi.tsx"],"sourcesContent":["import React from \"react\";\nimport { Box, Text } from \"ink\";\nimport { autorun, derived, observableValue, type IObservable } from \"@vscode/observables\";\nimport type { ViewCommand, ViewSession } from \"../views/types\";\nimport type { SchemaState } from \"./UiModel\";\nimport { safeTerminalText } from \"./terminalText\";\n\n/** Built-in read-only view; uses the same viewport and command contract as contributions. */\nexport class SchemaSession implements ViewSession {\n readonly element = <SchemaPanel session={this} />;\n readonly viewport = observableValue(this, { rows: 24, columns: 80, top: 0, left: 0, disposed: false });\n constructor(readonly schema: IObservable<SchemaState>) {}\n readonly lines = derived(this, reader => {\n const value = this.schema.read(reader);\n return (value.kind === \"loaded\" ? JSON.stringify(value.schema, null, 2)\n : value.kind === \"error\" ? String(value.error)\n : value.kind === \"none\" ? \"Select an interface to inspect its schema.\" : \"Loading schema…\")\n .split(\"\\n\").map(safeTerminalText);\n });\n readonly commands = derived(this, (reader): readonly ViewCommand[] => {\n const viewport = this.viewport.read(reader);\n if (viewport.disposed) return [];\n const lines = this.lines.read(reader);\n const page = Math.max(1, viewport.rows - 2);\n const maxTop = Math.max(0, lines.length - page);\n const maxLeft = Math.max(0, lines.reduce((width, line) => Math.max(width, [...line].length), 0) - viewport.columns);\n const top = Math.min(viewport.top, maxTop), left = Math.min(viewport.left, maxLeft);\n const move = (vertical: number, horizontal = 0) => this.viewport.set({\n ...this.viewport.get(), top: Math.max(0, Math.min(maxTop, top + vertical)),\n left: Math.max(0, Math.min(maxLeft, left + horizontal)),\n }, undefined);\n const command = (id: string, title: string, keys: readonly string[], execute: () => void, enabled: boolean): ViewCommand =>\n ({ id: `schema.${id}`, title, keybindings: keys.map(key => ({ key })), execute, enabled, context: \"Schema\" });\n return [\n command(\"up\", \"Scroll up\", [\"up\", \"k\"], () => move(-1), top > 0),\n command(\"down\", \"Scroll down\", [\"down\", \"j\"], () => move(1), top < maxTop),\n command(\"pageUp\", \"Page up\", [\"pageup\"], () => move(-page), top > 0),\n command(\"pageDown\", \"Page down\", [\"pagedown\"], () => move(page), top < maxTop),\n command(\"first\", \"First line\", [\"home\", \"g\"], () => move(-maxTop), top > 0),\n command(\"last\", \"Last line\", [\"end\", \"G\"], () => move(maxTop), top < maxTop),\n command(\"left\", \"Scroll left\", [\"left\", \"h\"], () => move(0, -20), left > 0),\n command(\"right\", \"Scroll right\", [\"right\", \"l\"], () => move(0, 20), left < maxLeft),\n ];\n });\n setViewport(rows: number, columns = this.viewport.get().columns): void {\n const state = this.viewport.get();\n if (rows !== state.rows || columns !== state.columns) this.viewport.set({ ...state, rows, columns }, undefined);\n }\n captureState(): unknown { const { top, left } = this.viewport.get(); return { top, left }; }\n restoreState(value: unknown): void {\n const state = value as { top?: number; left?: number } | undefined;\n if (state) this.viewport.set({ ...this.viewport.get(), top: state.top ?? 0, left: state.left ?? 0 }, undefined);\n }\n dispose(): void { this.viewport.set({ ...this.viewport.get(), disposed: true }, undefined); }\n}\n\nclass SchemaPanel extends React.Component<{ readonly session: SchemaSession }, { revision: number }> {\n state = { revision: 0 };\n private subscription: { dispose(): void } | undefined;\n componentDidMount(): void {\n this.subscription = autorun(reader => {\n this.props.session.viewport.read(reader);\n this.props.session.lines.read(reader);\n this.setState(previous => ({ revision: previous.revision + 1 }));\n });\n }\n componentWillUnmount(): void { this.subscription?.dispose(); }\n render(): React.ReactNode {\n const { session } = this.props;\n const { rows, columns, top } = session.viewport.get();\n const lines = session.lines.get();\n const left = Math.min(session.viewport.get().left,\n Math.max(0, lines.reduce((width, line) => Math.max(width, [...line].length), 0) - columns));\n const capacity = Math.max(1, rows - 2);\n const start = Math.min(top, Math.max(0, lines.length - capacity));\n const schema = session.schema.get();\n return <Box flexDirection=\"column\" width={columns} height={rows} flexShrink={0} overflow=\"hidden\">\n {rows > 1 && <Box height={1} flexShrink={0} overflow=\"hidden\">\n <Text bold color=\"cyan\" wrap=\"truncate-end\">{schema.kind === \"loaded\" ? `SCHEMA ${safeTerminalText(schema.schema.id)}` : \"SCHEMA\"}</Text>\n </Box>}\n {Array.from({ length: capacity }, (_, offset) => <Box key={offset} height={1} flexShrink={0} overflow=\"hidden\">\n <Text wrap=\"truncate-end\">{[...(lines[start + offset] ?? \"\")].slice(left).join(\"\") || \" \"}</Text>\n </Box>)}\n {rows > 2 && <Box height={1} flexShrink={0} overflow=\"hidden\">\n <Text dimColor wrap=\"truncate-end\">{`Lines ${start + 1}–${Math.min(lines.length, start + capacity)}/${lines.length} · column ${left + 1}`}</Text>\n </Box>}\n </Box>;\n }\n}\n","import { Disposable, autorun, derived, observableValue, type IObservable } from \"@vscode/observables\";\nimport type { CliChannel } from \"@hediet/linkrpc-client\";\nimport { views } from \"../views/registry\";\nimport { resolveViewTarget } from \"../views/discovery\";\nimport { formatCondition, interfaceTarget, matchesTarget, targetId, type ViewInterface, type ViewSession, type ViewTarget } from \"../views/types\";\nimport type { MethodKey, SchemaState, UiServiceListing } from \"./UiModel\";\nimport { SchemaSession } from \"./SchemaSession\";\n\nexport class ViewController extends Disposable {\n readonly tab = observableValue<string>(this, \"methods\");\n readonly kind = observableValue<\"interface\" | \"service\">(this, \"interface\");\n readonly session = observableValue<ViewSession | undefined>(this, undefined);\n readonly error = observableValue<string | undefined>(this, undefined);\n readonly connectionGeneration = observableValue(this, 0);\n readonly connected = observableValue(this, true);\n private generation = 0;\n private savedState: { readonly key: string; readonly state: unknown } | undefined;\n private sessionKey: string | undefined;\n private readonly pendingCleanup = new Set<Promise<void>>();\n\n constructor(\n private readonly channel: CliChannel,\n private readonly selection: IObservable<MethodKey | undefined>,\n private readonly schema: IObservable<SchemaState>,\n private readonly listings: () => readonly UiServiceListing[],\n ) {\n super();\n this._register(autorun(reader => {\n const tab = this.tab.read(reader);\n const target = this.target.read(reader);\n this.connectionGeneration.read(reader);\n const connected = this.connected.read(reader);\n const generation = ++this.generation;\n const previous = this.session.get();\n if (previous && this.sessionKey) this.savedState = { key: this.sessionKey, state: previous.captureState?.() };\n this.stopSession(previous);\n this.session.set(undefined, undefined);\n this.error.set(undefined, undefined);\n if (tab === \"schema\") {\n const key = `schema:${target?.id ?? \"\"}`;\n const session = new SchemaSession(this.schema);\n if (this.savedState?.key === key) session.restoreState(this.savedState.state);\n this.sessionKey = key;\n this.session.set(session, undefined);\n return;\n }\n const view = views.find(value => value.id === tab);\n if (!view || !target || !matchesTarget(target, view) || !connected) return;\n const key = `${tab}:${target.id}`;\n void resolveViewTarget(channel, view, target.id).then(context => {\n if (generation !== this.generation) return;\n const session = view.createSession(context);\n if (this.savedState?.key === key) session.restoreState?.(this.savedState.state);\n this.sessionKey = key;\n this.session.set(session, undefined);\n }).catch(error => {\n if (generation === this.generation) this.error.set(String(error), undefined);\n });\n }));\n }\n\n readonly target = derived(this, (reader): ViewTarget | undefined => {\n const selection = this.selection.read(reader);\n if (!selection) return undefined;\n const state = this.schema.read(reader);\n const all = this.listings();\n const listing = all.find(value => value.serviceId === selection.serviceId\n && value.interfaceId === selection.interfaceId\n && !!value.isDefault === !!selection.isDefault);\n const selected: ViewInterface = {\n ...selection, discoveredFrom: listing?.discoveredFrom ?? selection.serviceId,\n hash: listing?.hash, tags: state.kind === \"loaded\" ? state.schema.tags : listing?.tags,\n };\n if (this.kind.read(reader) === \"interface\") return interfaceTarget(selected);\n const interfaces: ViewInterface[] = [];\n for (const value of [selected, ...all.filter(value => value.serviceId === selected.serviceId\n && value.discoveredFrom === selected.discoveredFrom)]) {\n if (!interfaces.some(item => item.interfaceId === value.interfaceId)) interfaces.push(value);\n }\n return {\n id: targetId(\"service\", selected), kind: \"service\", serviceId: selected.serviceId,\n discoveredFrom: selected.discoveredFrom, interfaces,\n };\n });\n\n readonly tabs = derived(this, reader => {\n const target = this.target.read(reader);\n return [\n { id: \"methods\", title: \"Methods\", condition: \"interface:any | service:any\" },\n { id: \"schema\", title: \"Schema\", condition: \"interface:any | service:any\" },\n ...views.filter(view => target && matchesTarget(target, view)).map(view => ({\n id: view.id, title: view.title, condition: view.conditions.map(formatCondition).join(\" | \"),\n })),\n ];\n });\n\n cycleTab(): void {\n const tabs = this.tabs.get();\n const index = tabs.findIndex(tab => tab.id === this.tab.get());\n this.tab.set(tabs[(index + 1) % tabs.length]!.id, undefined);\n }\n toggleKind(): void { this.kind.set(this.kind.get() === \"interface\" ? \"service\" : \"interface\", undefined); }\n disconnect(): void { this.connected.set(false, undefined); }\n reconnect(): void {\n if (!this.connected.get()) this.connected.set(true, undefined);\n else this.connectionGeneration.set(this.connectionGeneration.get() + 1, undefined);\n }\n private stopSession(session: ViewSession | undefined): void {\n session?.dispose();\n const cleanup = session?.disposeAsync?.();\n if (!cleanup) return;\n this.pendingCleanup.add(cleanup);\n void cleanup.then(() => this.pendingCleanup.delete(cleanup), () => this.pendingCleanup.delete(cleanup));\n }\n async waitForIdle(): Promise<void> {\n await Promise.allSettled([...this.pendingCleanup]);\n }\n override dispose(): void {\n ++this.generation;\n this.stopSession(this.session.get());\n super.dispose();\n }\n}\n","import {\n Disposable,\n ObservableLazyPromise,\n ObservablePromise,\n autorun,\n derived,\n observableValue,\n} from \"@vscode/observables\";\nimport type {\n MethodSchema,\n LinkRpcInterfaceSchema as SvcInterfaceSchema,\n LinkRpcJsonSchema as SvcJsonSchema,\n} from \"@hediet/linkrpc\";\nimport {\n type CliChannel,\n fetchDefaults,\n fetchSchema,\n walkHubDetailed,\n} from \"@hediet/linkrpc-client\";\nimport { validateValueAgainstSchema } from \"../validation\";\nimport { ViewController } from \"./ViewController\";\n\nexport interface MethodKey {\n /** \"\" means the root (no `serviceId::` prefix on the wire). */\n readonly serviceId: string;\n readonly interfaceId: string;\n /** The synthetic default entry invokes methods in bare form. */\n readonly isDefault?: boolean;\n /** `undefined` => no method picked yet; the view shows the method list. */\n readonly methodName: string | undefined;\n}\n\nexport interface UiServiceListing {\n readonly tags?: readonly string[];\n readonly serviceId: string;\n readonly interfaceId: string;\n readonly hash?: string;\n readonly discoveredFrom: string;\n readonly path?: string;\n readonly isDefault?: boolean;\n}\n\nexport interface CallOutcome {\n readonly result: unknown;\n readonly latencyMs: number;\n}\n\nexport interface HistoryEntry {\n readonly method: string;\n readonly params: unknown;\n readonly result: unknown | undefined;\n readonly error: unknown | undefined;\n readonly latencyMs: number;\n readonly timestamp: number;\n}\n\nexport interface FieldDesc {\n readonly name: string;\n readonly required: boolean;\n readonly schema: SvcJsonSchema;\n}\n\nexport type MethodListItem = MethodSchema & { readonly name: string };\n\nexport type SchemaState =\n | { kind: \"none\" }\n | { kind: \"loading\" }\n | { kind: \"error\"; error: unknown }\n | { kind: \"loaded\"; schema: SvcInterfaceSchema; method: MethodListItem | undefined };\n\n/**\n * View model for the TUI. Owns the live channel and an in-memory schema cache\n * keyed by interface id. Loading state for every async lookup is expressed as\n * an `ObservablePromise` from `@vscode/observables` — no ad-hoc loading flags.\n */\nexport class UiModel extends Disposable {\n public readonly views: ViewController;\n /** Initial directory fetch — kicked off in the constructor. */\n public readonly servicesPromise: ObservablePromise<UiServiceListing[]>;\n\n /** Non-fatal discovery failures for services that could not be inspected. */\n public readonly discoveryWarnings = observableValue<readonly string[]>(\n \"UiModel.discoveryWarnings\",\n [],\n );\n\n public readonly selection = observableValue<MethodKey | undefined>(\n \"UiModel.selection\",\n undefined,\n );\n\n public readonly formValues = observableValue<Record<string, unknown>>(\n \"UiModel.formValues\",\n {},\n );\n\n /** Index of the currently-focused form field (clamped at render time). */\n public readonly formCursor = observableValue<number>(\n \"UiModel.formCursor\",\n 0,\n );\n\n /** True when the focused field is in input mode (text being typed). */\n public readonly formEditing = observableValue<boolean>(\n \"UiModel.formEditing\",\n false,\n );\n\n /** Which Miller column currently owns keyboard focus. */\n public readonly focusedColumn = observableValue<0 | 1 | 2>(\n \"UiModel.focusedColumn\",\n 0,\n );\n\n public readonly rawJsonMode = observableValue<boolean>(\n \"UiModel.rawJsonMode\",\n false,\n );\n\n public readonly rawJsonText = observableValue<string>(\n \"UiModel.rawJsonText\",\n \"{}\",\n );\n\n public readonly history = observableValue<HistoryEntry[]>(\n \"UiModel.history\",\n [],\n );\n\n /**\n * Wraps the in-flight call (if any). `undefined` until the user first\n * submits, then re-assigned on each submit. The view reads\n * `promiseResult` to render loading / result / error.\n */\n public readonly lastCall = observableValue<ObservablePromise<CallOutcome> | undefined>(\n \"UiModel.lastCall\",\n undefined,\n );\n\n /**\n * Server→client stream messages received during the in-flight call.\n * Reset to `[]` on each `submit()`, then appended to as `$stream::send`\n * notifications arrive. The view renders these live below the result.\n */\n public readonly streamChunks = observableValue<readonly unknown[]>(\n \"UiModel.streamChunks\",\n [],\n );\n\n /**\n * One-line, human-readable description of the identity signing outbound\n * calls (e.g. `managed (node abcd012345…)`). Rendered in the header.\n * `undefined` until `runUi` resolves the principal.\n */\n public readonly identity = observableValue<string | undefined>(\n \"UiModel.identity\",\n undefined,\n );\n\n /**\n * Per-interface schema cache. `ObservableLazyPromise` defers the actual\n * fetch until something asks for it; the autorun below makes \"something\n * asks\" happen whenever a method on that interface is selected.\n */\n private readonly _schemas = new Map<string, ObservableLazyPromise<SvcInterfaceSchema>>();\n\n constructor(\n private readonly _channel: CliChannel,\n ) {\n super();\n this.servicesPromise = ObservablePromise.fromFn(async () => {\n const result = await loadUiServices(_channel);\n this.discoveryWarnings.set(result.warnings, undefined);\n return result.services;\n });\n // Drain the bare promise so an early close (test teardown, user quit\n // before the call settles) doesn't surface as an unhandled rejection.\n // The error is still observable via `servicesPromise.promiseResult`.\n this.servicesPromise.promise.catch(() => { });\n this.views = this._register(new ViewController(\n _channel, this.selection, this.currentSchemaState,\n () => this.servicesPromise.promiseResult.get()?.data ?? [],\n ));\n\n // When selection changes, kick the lazy schema promise so its\n // observable state starts ticking. The derived below only OBSERVES;\n // it doesn't trigger.\n this._register(autorun((reader) => {\n const sel = this.selection.read(reader);\n if (!sel) return;\n void this._getOrCreateSchema(\n sel.serviceId,\n sel.interfaceId,\n sel.isDefault === true,\n ).getPromise().catch(() => { });\n }));\n // Miller-column convenience: when the methods column gains focus and\n // no method is picked yet, auto-select the first one so the form\n // column shows a preview instead of an empty pane.\n this._register(autorun((reader) => {\n if (this.focusedColumn.read(reader) !== 1) return;\n const sel = this.selection.read(reader);\n if (!sel || sel.methodName !== undefined) return;\n const methods = this.currentMethods.read(reader);\n if (methods.length === 0) return;\n this.selection.set({ ...sel, methodName: methods[0].name }, undefined);\n }));\n }\n\n public readonly currentSchemaState = derived(this, (reader): SchemaState => {\n const sel = this.selection.read(reader);\n if (!sel) return { kind: \"none\" };\n const lazy = this._getOrCreateSchema(\n sel.serviceId,\n sel.interfaceId,\n sel.isDefault === true,\n );\n const result = lazy.cachedPromiseResult.read(reader);\n if (!result) return { kind: \"loading\" };\n if (result.error) return { kind: \"error\", error: result.error };\n const schema = result.data!;\n const methodSchema = sel.methodName !== undefined\n ? schema.methods[sel.methodName]\n : undefined;\n const method = methodSchema && sel.methodName !== undefined\n ? { ...methodSchema, name: sel.methodName }\n : undefined;\n return { kind: \"loaded\", schema, method };\n });\n\n /** Flat list of top-level fields for the currently-selected method. */\n public readonly currentFields = derived(this, (reader): readonly FieldDesc[] => {\n const state = this.currentSchemaState.read(reader);\n if (state.kind !== \"loaded\" || !state.method) return [];\n const paramsSchema = state.method.params;\n return collectTopLevelFields(\n paramsSchema,\n state.schema.components?.schemas ?? {},\n );\n });\n\n /** All methods on the currently-selected interface (column 2). */\n public readonly currentMethods = derived(this, (reader): readonly MethodListItem[] => {\n const state = this.currentSchemaState.read(reader);\n return state.kind === \"loaded\"\n ? Object.entries(state.schema.methods).map(([name, method]) => ({ name, ...method }))\n : [];\n });\n\n /**\n * Whether the currently-selected method declares stream payloads in\n * either direction. Drives the \"streaming\" affordance in the view.\n */\n public readonly currentMethodStreams = derived(this, (reader): { server: boolean; client: boolean } => {\n const state = this.currentSchemaState.read(reader);\n if (state.kind !== \"loaded\" || !state.method) return { server: false, client: false };\n return {\n server: state.method.serverStream !== undefined,\n client: state.method.clientStream !== undefined,\n };\n });\n\n /** Per-field validation errors against the live method schema. */\n public readonly formErrors = derived(this, (reader): ReadonlyMap<string, string> => {\n const state = this.currentSchemaState.read(reader);\n const errors = new Map<string, string>();\n if (state.kind !== \"loaded\" || !state.method) return errors;\n const paramsSchema = state.method.params;\n const components = state.schema.components?.schemas ?? {};\n const resolvedParamsSchema = resolveSchema(paramsSchema, components);\n if (!isObjectSchema(resolvedParamsSchema)) return errors;\n const values = this.formValues.read(reader);\n const required = new Set(resolvedParamsSchema.required ?? []);\n for (const [name, sub] of Object.entries(resolvedParamsSchema.properties)) {\n const value = values[name];\n if (value === undefined) {\n if (required.has(name)) errors.set(name, \"required\");\n continue;\n }\n const reason = validateValueAgainstSchema(value, sub, components);\n if (reason !== undefined) errors.set(name, reason);\n }\n return errors;\n });\n\n public readonly canSubmit = derived(this, (reader): boolean => {\n const sel = this.selection.read(reader);\n if (!sel || sel.methodName === undefined) return false;\n const state = this.currentSchemaState.read(reader);\n if (state.kind !== \"loaded\" || !state.method) return false;\n return this.formErrors.read(reader).size === 0;\n });\n\n public select(key: MethodKey): void {\n this.selection.set(key, undefined);\n this.formValues.set({}, undefined);\n this.rawJsonText.set(\"{}\", undefined);\n this.formCursor.set(0, undefined);\n this.formEditing.set(false, undefined);\n }\n\n /** Pick a concrete method on the currently-selected service/interface. */\n public selectMethod(methodName: string): void {\n const sel = this.selection.get();\n if (!sel) return;\n this.select({ ...sel, methodName });\n }\n\n public focusColumn(column: 0 | 1 | 2): void {\n this.focusedColumn.set(column, undefined);\n }\n\n /**\n * Move the column-0 cursor by `delta`. The cursor is implicit: it's the\n * row whose `(serviceId, interfaceId)` matches the current selection.\n * Stepping off the ends clamps; methodName is cleared so the methods\n * column re-previews the new service.\n */\n public moveServiceCursor(delta: -1 | 1): void {\n const services = this.servicesPromise.promiseResult.get()?.data ?? [];\n if (services.length === 0) return;\n const sel = this.selection.get();\n const currentIdx = sel\n ? services.findIndex((s) =>\n s.serviceId === sel.serviceId\n && s.interfaceId === sel.interfaceId\n && (s.isDefault === true) === (sel.isDefault === true))\n : -1;\n const nextIdx = Math.max(0, Math.min(services.length - 1, currentIdx + delta));\n const next = services[nextIdx];\n this.select({\n serviceId: next.serviceId,\n interfaceId: next.interfaceId,\n methodName: undefined,\n ...(next.isDefault === true ? { isDefault: true } : {}),\n });\n }\n\n /**\n * Move the column-1 cursor by `delta`. Triggers a full `select()` so the\n * form column starts fresh for the newly-previewed method (Miller-style\n * \"each cursor move is a new preview\").\n */\n public moveMethodCursor(delta: -1 | 1): void {\n const methods = this.currentMethods.get();\n if (methods.length === 0) return;\n const sel = this.selection.get();\n if (!sel) return;\n const currentIdx = sel.methodName !== undefined\n ? methods.findIndex((m) => m.name === sel.methodName)\n : -1;\n const nextIdx = Math.max(0, Math.min(methods.length - 1, currentIdx + delta));\n this.selectMethod(methods[nextIdx].name);\n }\n\n public setField(name: string, value: unknown): void {\n const current = this.formValues.get();\n if (value === undefined) {\n // Clearing a field — drop the key so required-checks fire and so\n // wire payloads don't carry explicit `undefined`s.\n const { [name]: _drop, ...rest } = current;\n void _drop;\n this.formValues.set(rest, undefined);\n return;\n }\n this.formValues.set({ ...current, [name]: value }, undefined);\n }\n\n /**\n * Returns the exact `{ method, params }` `submit` would send right\n * now, or `undefined` when no method is fully selected. Lets a host\n * (e.g. the explorer's access-request prompt) preview the concrete\n * call before issuing a one-shot capability bound to it.\n */\n public peekPendingCall(): { method: string; params: unknown } | undefined {\n const sel = this.selection.get();\n if (!sel || sel.methodName === undefined) return undefined;\n const params = this._collectParams();\n const method = sel.isDefault === true\n ? sel.methodName\n : sel.serviceId\n ? `${sel.serviceId}::${sel.interfaceId}::${sel.methodName}`\n : `${sel.interfaceId}::${sel.methodName}`;\n return { method, params };\n }\n\n public submit(): void {\n const sel = this.selection.get();\n if (!sel || sel.methodName === undefined) return;\n const params = this._collectParams();\n const wireMethod = sel.isDefault === true\n ? sel.methodName\n : sel.serviceId\n ? `${sel.serviceId}::${sel.interfaceId}::${sel.methodName}`\n : `${sel.interfaceId}::${sel.methodName}`;\n const start = performance.now();\n this.streamChunks.set([], undefined);\n const promise = ObservablePromise.fromFn(async () => {\n // Stream-capable send: appends any server→client `$stream::send`\n // messages to `streamChunks` as they arrive, then resolves with\n // the call's final response. Behaves like a plain request when the\n // method does not stream.\n const call = this._channel.sendRequestWithStream(wireMethod, params as never, {\n onStreamMessage: (payload) => {\n this.streamChunks.set([...this.streamChunks.get(), payload], undefined);\n },\n });\n const result = await call.result;\n return { result, latencyMs: performance.now() - start } satisfies CallOutcome;\n });\n this.lastCall.set(promise, undefined);\n // Record into history once it settles — keep one place that writes\n // the journal, so views don't have to worry about it.\n promise.promise.then(\n (outcome) => {\n this.history.set(\n [\n ...this.history.get(),\n { method: wireMethod, params, result: outcome.result, error: undefined, latencyMs: outcome.latencyMs, timestamp: Date.now() },\n ],\n undefined,\n );\n },\n (error) => {\n const latencyMs = performance.now() - start;\n this.history.set(\n [\n ...this.history.get(),\n { method: wireMethod, params, result: undefined, error, latencyMs, timestamp: Date.now() },\n ],\n undefined,\n );\n },\n );\n }\n\n private _collectParams(): unknown {\n if (this.rawJsonMode.get()) {\n const text = this.rawJsonText.get().trim();\n if (text.length === 0) return undefined;\n try {\n return JSON.parse(text);\n } catch {\n // The view shows the parse error; submit still sends the\n // unparsable text as a string so the wire layer can complain.\n return text;\n }\n }\n return this.formValues.get();\n }\n\n private _getOrCreateSchema(\n serviceId: string,\n interfaceId: string,\n isDefault: boolean,\n ): ObservableLazyPromise<SvcInterfaceSchema> {\n const key = `${isDefault ? \"default\" : serviceId}::${interfaceId}`;\n let p = this._schemas.get(key);\n if (!p) {\n // Fetch schemas from the directory that reported the interface.\n const listings = this.servicesPromise.promiseResult.get()?.data ?? [];\n const match = listings.find(\n (s) =>\n s.serviceId === serviceId\n && s.interfaceId === interfaceId\n && (s.isDefault === true) === isDefault,\n );\n const reporter = isDefault ? \"\" : (match?.discoveredFrom ?? serviceId);\n const target = reporter === \"\" ? undefined : reporter;\n p = new ObservableLazyPromise(() =>\n fetchSchema(this._channel, interfaceId, match?.hash, target));\n this._schemas.set(key, p);\n }\n return p;\n }\n}\n\ninterface UiServicesResult {\n readonly services: UiServiceListing[];\n readonly warnings: readonly string[];\n}\n\nasync function loadUiServices(channel: CliChannel): Promise<UiServicesResult> {\n const [walkResult, defaultsResult] = await Promise.all([\n walkHubDetailed(channel),\n fetchDefaults(channel).then(\n (defaults) => ({ ok: true as const, defaults }),\n (error: unknown) => ({ ok: false as const, error }),\n ),\n ]);\n\n const warnings = walkResult.inaccessible.map(({ serviceId, reason }) =>\n `Service \"${serviceId}\" does not offer a usable hubrpc.directory::list: ${reason}`\n );\n if (!defaultsResult.ok) {\n warnings.push(\n `The root service does not offer hubrpc.defaults::get: ${getErrorMessage(defaultsResult.error)}`,\n );\n return { services: walkResult.listings, warnings };\n }\n\n const { defaults } = defaultsResult;\n if (defaults.interfaceId === undefined) {\n return { services: walkResult.listings, warnings };\n }\n return {\n services: [{\n serviceId: \"\",\n interfaceId: defaults.interfaceId,\n ...(defaults.hash === undefined ? {} : { hash: defaults.hash }),\n discoveredFrom: \"\",\n isDefault: true,\n }, ...walkResult.listings],\n warnings,\n };\n}\n\nfunction getErrorMessage(error: unknown): string {\n return error instanceof Error ? error.message : String(error);\n}\n\nfunction collectTopLevelFields(\n schema: SvcJsonSchema | undefined,\n components: Readonly<Record<string, SvcJsonSchema>>,\n): FieldDesc[] {\n const resolved = resolveSchema(schema, components);\n if (!isObjectSchema(resolved)) return [];\n const required = new Set(resolved.required ?? []);\n return Object.entries(resolved.properties).map(([name, sub]) => ({\n name,\n required: required.has(name),\n schema: resolveSchema(sub, components) ?? sub,\n }));\n}\n\nfunction resolveSchema(\n schema: SvcJsonSchema | undefined,\n components: Readonly<Record<string, SvcJsonSchema>>,\n seen: ReadonlySet<string> = new Set(),\n): SvcJsonSchema | undefined {\n if (\n schema === undefined\n || typeof schema !== \"object\"\n || !(\"$ref\" in schema)\n ) {\n return schema;\n }\n const prefix = \"#/components/schemas/\";\n if (!schema.$ref.startsWith(prefix) || seen.has(schema.$ref)) {\n return schema;\n }\n const target = components[schema.$ref.slice(prefix.length)];\n if (target === undefined) {\n return schema;\n }\n return resolveSchema(target, components, new Set([...seen, schema.$ref]));\n}\n\nfunction isObjectSchema(\n s: SvcJsonSchema | undefined,\n): s is Extract<SvcJsonSchema, { type: \"object\"; properties: Record<string, SvcJsonSchema> }> {\n return !!s\n && typeof s === \"object\"\n && \"type\" in s\n && s.type === \"object\"\n && \"properties\" in s;\n}\n","import type { LinkRpcJsonSchema as SvcJsonSchema } from \"@hediet/linkrpc\";\n\n/**\n * Coarse classification of a field for the TUI. The form uses this to pick\n * a widget — fall back to free-form JSON editing for anything we can't render\n * inline.\n */\nexport type FieldKind =\n | \"string\"\n | \"number\"\n | \"integer\"\n | \"boolean\"\n | \"enum\"\n | \"json\";\n\nexport interface FieldClassification {\n readonly kind: FieldKind;\n /** Enumerated values for `kind === \"enum\"`. */\n readonly enumValues?: ReadonlyArray<unknown>;\n}\n\nexport function classifyField(schema: SvcJsonSchema): FieldClassification {\n if (typeof schema === \"boolean\") return { kind: \"json\" };\n if (\"enum\" in schema) {\n return { kind: \"enum\", enumValues: schema.enum };\n }\n if (\"const\" in schema) {\n return { kind: \"enum\", enumValues: [schema.const] };\n }\n if (\"anyOf\" in schema) {\n // Treat unions of constants (or single-value branches) as enums so\n // they get the cycle widget instead of a JSON editor.\n const values: unknown[] = [];\n for (const branch of schema.anyOf) {\n if (typeof branch === \"object\" && \"const\" in branch) values.push(branch.const);\n else if (typeof branch === \"object\" && \"enum\" in branch) values.push(...branch.enum);\n else return { kind: \"json\" };\n }\n return { kind: \"enum\", enumValues: values };\n }\n if (\"type\" in schema && typeof schema.type === \"string\") {\n switch (schema.type) {\n case \"string\": return { kind: \"string\" };\n case \"number\": return { kind: \"number\" };\n case \"integer\": return { kind: \"integer\" };\n case \"boolean\": return { kind: \"boolean\" };\n default: return { kind: \"json\" }; // object, array, null\n }\n }\n return { kind: \"json\" };\n}\n\n/** A sensible default value for a freshly-focused field, by kind. */\nexport function defaultValueFor(c: FieldClassification): unknown {\n switch (c.kind) {\n case \"string\": return \"\";\n case \"number\":\n case \"integer\": return 0;\n case \"boolean\": return false;\n case \"enum\": return c.enumValues?.[0] ?? null;\n case \"json\": return null;\n }\n}\n\n/**\n * Move to the next/previous value in an enum field. Wraps at the ends. The\n * cycle is what powers `←`/`→` on enum fields without needing edit mode.\n */\nexport function cycleEnum(\n values: ReadonlyArray<unknown>,\n current: unknown,\n delta: 1 | -1,\n): unknown {\n if (values.length === 0) return current;\n const idx = values.findIndex((v) => deepEqual(v, current));\n const next = (idx < 0 ? 0 : idx + delta + values.length) % values.length;\n return values[next];\n}\n\nfunction deepEqual(a: unknown, b: unknown): boolean {\n if (a === b) return true;\n if (typeof a !== typeof b) return false;\n if (a === null || b === null) return false;\n if (typeof a !== \"object\") return false;\n return JSON.stringify(a) === JSON.stringify(b);\n}\n\n/** Parse a user-typed string into a value compatible with the given kind. */\nexport function parseTypedValue(\n raw: string,\n kind: FieldKind,\n): { ok: true; value: unknown } | { ok: false; error: string } {\n switch (kind) {\n case \"string\": return { ok: true, value: raw };\n case \"number\": {\n if (raw.trim() === \"\") return { ok: true, value: undefined };\n const n = Number(raw);\n if (!Number.isFinite(n)) return { ok: false, error: `not a number: ${raw}` };\n return { ok: true, value: n };\n }\n case \"integer\": {\n if (raw.trim() === \"\") return { ok: true, value: undefined };\n const n = Number(raw);\n if (!Number.isInteger(n)) return { ok: false, error: `not an integer: ${raw}` };\n return { ok: true, value: n };\n }\n case \"json\": {\n if (raw.trim() === \"\") return { ok: true, value: undefined };\n try { return { ok: true, value: JSON.parse(raw) }; }\n catch (e) { return { ok: false, error: (e as Error).message }; }\n }\n case \"boolean\":\n case \"enum\":\n // These don't go through edit mode at all.\n return { ok: false, error: \"not editable via text input\" };\n }\n}\n\n/** Render the current value for display next to the field label. */\nexport function displayValue(value: unknown, kind: FieldKind): string {\n if (value === undefined) return \"(unset)\";\n if (kind === \"string\") return typeof value === \"string\" ? value : JSON.stringify(value);\n if (kind === \"boolean\") return value ? \"[x]\" : \"[ ]\";\n if (kind === \"json\") {\n const text = JSON.stringify(value);\n return text.length > 60 ? text.slice(0, 57) + \"...\" : text;\n }\n return JSON.stringify(value);\n}\n\n/** A short human description of the schema, shown in dim text after the value. */\nexport function describeSchema(s: SvcJsonSchema): string {\n if (typeof s === \"boolean\") return s ? \"any\" : \"never\";\n if (\"type\" in s && typeof s.type === \"string\") return s.type;\n if (\"enum\" in s) return `enum(${s.enum.map((v) => JSON.stringify(v)).join(\" | \")})`;\n if (\"const\" in s) return `const ${JSON.stringify(s.const)}`;\n if (\"anyOf\" in s) return s.anyOf.map(describeSchema).join(\" | \");\n if (\"$ref\" in s) return s.$ref;\n return \"?\";\n}\n","import React from \"react\";\nimport { Box, Text } from \"ink\";\nimport TextInput from \"ink-text-input\";\nimport type { FieldDesc, UiModel } from \"./UiModel\";\nimport {\n classifyField,\n describeSchema,\n parseTypedValue,\n type FieldClassification,\n} from \"./schemaInspect\";\n\nexport interface FieldRowProps {\n readonly model: UiModel;\n readonly field: FieldDesc;\n readonly value: unknown;\n readonly focused: boolean;\n readonly editing: boolean;\n readonly error: string | undefined;\n}\n\nconst NAME_W = 12;\nconst VALUE_W = 24;\n\n/**\n * One row of the method form. To keep ink/yoga happy across resizes, the\n * non-editing path renders the whole row as a single `<Text>` with nested\n * colored spans, instead of multiple Boxes that try to share the column's\n * width. Boxes-around-Text in row direction tend to collapse to the\n * narrowest measurement on the first paint — single-Text rows lay out\n * predictably.\n *\n * The editing path swaps the value column for a `TextInput`; the surrounding\n * row stays a Box because TextInput is a component, not a string.\n */\nexport const FieldRow: React.FC<FieldRowProps> = ({ model, field, value, focused, editing, error }) => {\n const cls = classifyField(field.schema);\n const cursor = focused ? \"› \" : \" \";\n const namePadded = pad(field.name, NAME_W);\n const optionalMark = field.required ? \"\" : \"?\";\n const typeLabel = describeSchema(field.schema);\n\n return (\n <Box flexDirection=\"column\" flexShrink={0}>\n {editing ? (\n <Box flexDirection=\"row\" flexShrink={0}>\n <Text color={focused ? \"cyan\" : undefined}>{cursor}</Text>\n <Text bold>{namePadded}</Text>\n <Text dimColor>{optionalMark === \"\" ? \"\" : optionalMark + \" \"}</Text>\n <Box flexGrow={1} flexShrink={1}>\n <TextEditor model={model} field={field} value={value} cls={cls} />\n </Box>\n <Text dimColor> {typeLabel}</Text>\n </Box>\n ) : (\n <Text>\n <Text color={focused ? \"cyan\" : undefined}>{cursor}</Text>\n <Text bold>{namePadded}</Text>\n <Text dimColor>{optionalMark + \" \"}</Text>\n <Text color=\"yellow\">{pad(formatValue(value, cls), VALUE_W)}</Text>\n <Text dimColor> {typeLabel}</Text>\n </Text>\n )}\n {error ? (\n <Box marginLeft={NAME_W + 2} flexShrink={0}>\n <Text color=\"red\">! {error}</Text>\n </Box>\n ) : null}\n </Box>\n );\n};\n\nconst TextEditor: React.FC<{\n model: UiModel;\n field: FieldDesc;\n value: unknown;\n cls: FieldClassification;\n}> = ({ model, field, value, cls }) => {\n const initial = textForEditing(value, cls.kind);\n const [draft, setDraft] = React.useState(initial);\n React.useEffect(() => { setDraft(initial); }, [initial]);\n\n return (\n <TextInput\n value={draft}\n onChange={setDraft}\n onSubmit={(submitted) => {\n const parsed = parseTypedValue(submitted, cls.kind);\n if (parsed.ok) {\n model.setField(field.name, parsed.value);\n model.formEditing.set(false, undefined);\n }\n // Invalid input: stay in edit mode. The error row already\n // shows the schema-derived complaint via `formErrors`.\n }}\n focus={true}\n />\n );\n};\n\nfunction textForEditing(value: unknown, kind: FieldClassification[\"kind\"]): string {\n if (value === undefined) return \"\";\n if (kind === \"string\") return typeof value === \"string\" ? value : JSON.stringify(value);\n if (kind === \"json\") return JSON.stringify(value);\n return String(value);\n}\n\nfunction formatValue(value: unknown, cls: FieldClassification): string {\n if (value === undefined) return \"(unset)\";\n switch (cls.kind) {\n case \"boolean\": return value ? \"[x]\" : \"[ ]\";\n case \"enum\": return `< ${stringifyEnum(value)} >`;\n case \"string\": return typeof value === \"string\" ? value : JSON.stringify(value);\n case \"json\": {\n const text = JSON.stringify(value);\n return text.length > 40 ? text.slice(0, 37) + \"...\" : text;\n }\n default: return JSON.stringify(value);\n }\n}\n\nfunction stringifyEnum(value: unknown): string {\n return typeof value === \"string\" ? value : JSON.stringify(value);\n}\n\n/** Pad to `width` with spaces, or truncate with `…` if too long. */\nfunction pad(text: string, width: number): string {\n if (text.length === width) return text;\n if (text.length < width) return text + \" \".repeat(width - text.length);\n return text.slice(0, width - 1) + \"…\";\n}\n","import React from \"react\";\nimport { Box, Text } from \"ink\";\nimport { autorun } from \"@vscode/observables\";\nimport type { UiModel } from \"./UiModel\";\nimport { safeTerminalText } from \"./terminalText\";\nimport { ViewFrame } from \"../views/ViewFrame\";\nimport { formatCommandLegend, hostCommands } from \"../views/commands\";\n\n/** Class binding keeps contributed views hook-free. Models own their sessions. */\nexport class ViewArea extends React.Component<{\n readonly model: UiModel;\n readonly height: number;\n readonly chromeRows?: number;\n readonly columns?: number;\n readonly children: React.ReactNode;\n}, { revision: number }> {\n state = { revision: 0 };\n private subscription: { dispose(): void } | undefined;\n componentDidMount(): void {\n this.subscription = autorun(reader => {\n const model = this.props.model;\n model.views.tab.read(reader);\n model.views.kind.read(reader);\n model.views.tabs.read(reader);\n model.views.session.read(reader);\n model.views.error.read(reader);\n model.focusedColumn.read(reader);\n model.currentSchemaState.read(reader);\n this.setState(previous => ({ revision: previous.revision + 1 }));\n });\n }\n componentWillUnmount(): void { this.subscription?.dispose(); }\n render(): React.ReactNode {\n const model = this.props.model;\n const views = model.views;\n const selected = views.tab.get();\n const tabs = views.tabs.get();\n const current = tabs.find(tab => tab.id === selected);\n const chromeRows = this.props.chromeRows ?? 2;\n const contentRows = Math.max(1, this.props.height - chromeRows);\n return <Box flexDirection=\"column\" flexGrow={1} flexBasis={0} minWidth={0} height={this.props.height} overflow=\"hidden\">\n {chromeRows > 0 && <Box height={1} flexShrink={0}><Text wrap=\"truncate-end\">{views.kind.get()}: {tabs.map(tab => tab.id === selected ? `[${tab.title}]` : tab.title).join(\" \")}</Text></Box>}\n {chromeRows > 1 && <Box height={1} flexShrink={0}><Text dimColor wrap=\"truncate-end\">{safeTerminalText(current?.condition ?? \"Unavailable for this target\")}</Text></Box>}\n {selected === \"methods\" ? <Box height={contentRows} flexShrink={0} overflow=\"hidden\">{this.props.children}</Box>\n : views.error.get() ? <Text color=\"red\">{safeTerminalText(views.error.get()!)}</Text>\n : views.session.get() ? <ViewFrame session={views.session.get()!} rows={contentRows} maxColumns={this.props.columns}\n tabbed active={model.focusedColumn.get() > 0} />\n : <Text>{current ? \"Loading view…\" : \"View unavailable; press tab\"}</Text>}\n </Box>;\n }\n}\n\nexport class ViewFooter extends React.Component<{ readonly model: UiModel }, { revision: number }> {\n state = { revision: 0 };\n private subscription: { dispose(): void } | undefined;\n componentDidMount(): void {\n this.subscription = autorun(reader => {\n this.props.model.views.tab.read(reader);\n this.props.model.views.session.read(reader);\n this.props.model.focusedColumn.read(reader);\n this.props.model.formEditing.read(reader);\n this.setState(previous => ({ revision: previous.revision + 1 }));\n });\n }\n componentWillUnmount(): void { this.subscription?.dispose(); }\n render(): React.ReactNode {\n const model = this.props.model;\n if (model.views.session.get()) return <Text dimColor>\n {model.focusedColumn.get() === 0 ? \"Enter/→: focus view\" : \"View commands shown above\"}\n </Text>;\n const noop = () => {};\n const commands = hostCommands({ quit: noop, nextTab: noop, toggleScope: noop,\n back: model.views.tab.get() !== \"methods\" ? noop : undefined }, model.formEditing.get());\n return <Text dimColor wrap=\"truncate-end\">\n {(model.views.tab.get() === \"methods\" ? \"←/→: switch column · ↑/↓: move · Enter: edit/submit · Esc: cancel edit · \" : \"\")\n + formatCommandLegend(commands)}\n </Text>;\n }\n}\n","import React from \"react\";\nimport { stdin } from \"node:process\";\nimport { emitKeypressEvents, type Key } from \"node:readline\";\nimport type { ViewKeyEvent } from \"./types\";\n\n/** Readline preserves named keys such as Home/End that Ink's Key type omits. */\nexport class TerminalKeyInput extends React.Component<{ readonly onKey: (event: ViewKeyEvent) => void }> {\n private readonly onKey = (input: string, key: Key) => this.props.onKey({ ...key, input });\n componentDidMount(): void {\n emitKeypressEvents(stdin);\n stdin.on(\"keypress\", this.onKey);\n }\n componentWillUnmount(): void { stdin.off(\"keypress\", this.onKey); }\n render(): React.ReactNode { return null; }\n}\n","import React from \"react\";\nimport { Box, Text, measureElement, useApp, useInput, useStdout, type DOMElement } from \"ink\";\nimport { autorun, observableValue } from \"@vscode/observables\";\nimport { useObservable } from \"./useObservable\";\nimport { UiModel } from \"./UiModel\";\nimport { FieldRow } from \"./FieldRow\";\nimport { classifyField, cycleEnum, defaultValueFor } from \"./schemaInspect\";\nimport { useScroll } from \"./scroll\";\nimport type { MethodSchema } from \"@hediet/linkrpc\";\nimport { ViewArea, ViewFooter } from \"./ViewArea\";\nimport { dispatchHostKey, matchesKey } from \"../views/commands\";\nimport { TerminalKeyInput } from \"../views/TerminalKeyInput\";\nimport type { ViewKeyEvent } from \"../views/types\";\n\nexport interface AppProps {\n readonly model: UiModel;\n}\n\n// Fixed-height regions framing the scrollable columns. Heights are explicit\n// (not flex) so the windowing math below knows exactly how many rows each list\n// may render — Ink/Yoga gives no usable measurement before paint.\n/** Column chrome that is not list rows: top border + bottom border + title. */\nconst COLUMN_CHROME_H = 3;\n\nexport function uiLayout(columns: number, rows: number, focusedColumn: number, warningCount = 0) {\n const width = Math.max(1, Math.floor(columns));\n const height = Math.max(1, Math.floor(rows));\n const compact = width < 60;\n const headerRows = height > 2 ? 1 + Math.min(warningCount, Math.max(0, height - 10)) : 0;\n const footerRows = height > 1 ? 1 : 0;\n const bodyRows = Math.max(1, height - headerRows - footerRows);\n const sidebarWidth = compact ? focusedColumn === 0 ? width : 0\n : Math.min(28, Math.max(18, Math.floor(width * .22)));\n const mainWidth = width - sidebarWidth;\n const viewHeaderRows = Math.min(bodyRows - 1, height < 20 ? 1 : 2);\n const contentRows = bodyRows - viewHeaderRows;\n const resultRows = Math.min(Math.max(0, contentRows - 1), Math.max(3, Math.min(6, Math.floor(contentRows / 3))));\n const methodRows = contentRows - resultRows;\n const splitMethods = mainWidth >= 65;\n const methodWidth = splitMethods ? Math.min(30, Math.max(22, Math.floor(mainWidth * .35))) : mainWidth;\n return { width, height, compact, headerRows, footerRows, bodyRows, sidebarWidth, mainWidth,\n viewHeaderRows, contentRows, resultRows, methodRows, splitMethods, methodWidth };\n}\n\n/**\n * Miller-column TUI: three columns left → right (services, methods, form)\n * plus a result pane at the bottom. ←/→ moves focus between columns, ↑/↓\n * moves the cursor inside the focused column. Each cursor move in columns\n * 0 / 1 immediately previews into the column to its right.\n */\nexport const App: React.FC<AppProps> = ({ model }) => {\n const { exit } = useApp();\n const { stdout } = useStdout();\n // Keep Ink's raw-mode lease while contributed tabs unmount the method/form\n // input handlers. TerminalKeyInput dispatches the complete readline key set.\n useInput(() => {});\n return <AppLayout model={model} exit={exit} stdout={stdout} />;\n};\n\nclass AppLayout extends React.Component<AppProps & {\n readonly exit: () => void;\n readonly stdout: NodeJS.WriteStream;\n}, { revision: number }> {\n state = { revision: 0 };\n private readonly measuredColumns = observableValue<number | undefined>(this, undefined);\n private readonly root = React.createRef<DOMElement>();\n private mounted = false;\n private subscription: { dispose(): void } | undefined;\n private readonly invalidate = () => this.setState(previous => ({ revision: previous.revision + 1 }));\n componentDidMount(): void {\n this.mounted = true;\n // Update explicit pane bounds before Ink's synchronous resize repaint.\n this.props.stdout.prependListener(\"resize\", this.invalidate);\n this.subscription = autorun(reader => {\n const { model } = this.props;\n model.focusedColumn.read(reader);\n model.formEditing.read(reader);\n model.discoveryWarnings.read(reader);\n model.views.tab.read(reader);\n this.measuredColumns.read(reader);\n this.invalidate();\n });\n this.measure();\n }\n componentDidUpdate(): void { this.measure(); }\n private measure(): void {\n queueMicrotask(() => {\n if (!this.mounted || !this.root.current) return;\n const width = Math.max(1, Math.floor(measureElement(this.root.current).width));\n if (width !== this.measuredColumns.get()) this.measuredColumns.set(width, undefined);\n });\n }\n componentWillUnmount(): void {\n this.mounted = false;\n this.subscription?.dispose();\n this.props.stdout.off(\"resize\", this.invalidate);\n }\n private readonly onKey = (event: ViewKeyEvent) => {\n const { model, exit } = this.props;\n const focusedColumn = model.focusedColumn.get();\n // While editing a field, the text input owns input — don't intercept\n // ← / → for column nav (those move the text cursor).\n if (model.formEditing.get()) {\n if (matchesKey({ key: \"c\", ctrl: true }, event)) exit();\n return;\n }\n const inView = model.views.tab.get() !== \"methods\" && focusedColumn > 0;\n if (dispatchHostKey(inView ? model.views.session.get() : undefined, event, {\n quit: exit,\n nextTab: () => model.views.cycleTab(),\n toggleScope: () => model.views.toggleKind(),\n back: inView ? () => model.focusColumn(0) : undefined,\n })) return;\n if (inView) return;\n if (event.name === \"left\" && focusedColumn > 0) {\n model.focusColumn((focusedColumn - 1) as 0 | 1 | 2);\n return;\n }\n if (event.name === \"right\" && focusedColumn < 2) {\n model.focusColumn((focusedColumn + 1) as 0 | 1 | 2);\n return;\n }\n };\n\n render(): React.ReactNode {\n const { model, stdout } = this.props;\n const focusedColumn = model.focusedColumn.get();\n const warnings = model.discoveryWarnings.get();\n const columns = Math.min(this.measuredColumns.get() ?? 1, stdout.columns ?? 80);\n const layout = uiLayout(columns, stdout.rows ?? 30, focusedColumn, warnings.length);\n return <Box ref={this.root} flexDirection=\"column\" width=\"100%\" minWidth={0} height={layout.height} overflow=\"hidden\">\n <TerminalKeyInput onKey={this.onKey} />\n {layout.headerRows > 0 && <Box height={layout.headerRows} flexShrink={0} overflow=\"hidden\">\n <Header model={model} warnings={warnings.slice(0, layout.headerRows - 1)} />\n </Box>}\n <Box width={layout.width} height={layout.bodyRows} flexShrink={0} overflow=\"hidden\">\n {layout.sidebarWidth > 0 && <ServicesColumn model={model} focused={focusedColumn === 0}\n width={layout.sidebarWidth} height={layout.bodyRows} listHeight={Math.max(1, layout.bodyRows - COLUMN_CHROME_H)} />}\n {layout.mainWidth > 0 && <Box width={layout.mainWidth} height={layout.bodyRows} flexShrink={0} overflow=\"hidden\">\n <ViewArea model={model} height={layout.bodyRows} columns={layout.mainWidth} chromeRows={layout.viewHeaderRows}>\n <Box flexDirection=\"column\" height={layout.contentRows} width={layout.mainWidth} flexShrink={0} overflow=\"hidden\">\n <Box height={layout.methodRows} width={layout.mainWidth} flexShrink={0} overflow=\"hidden\">\n {(layout.splitMethods || focusedColumn !== 2) && <MethodsColumn model={model}\n focused={focusedColumn === 1} width={layout.methodWidth} height={layout.methodRows}\n listHeight={Math.max(1, layout.methodRows - COLUMN_CHROME_H)} />}\n {(layout.splitMethods || focusedColumn === 2) && <FormColumn model={model}\n focused={focusedColumn === 2} height={layout.methodRows}\n listHeight={Math.max(1, layout.methodRows - COLUMN_CHROME_H)} />}\n </Box>\n {layout.resultRows > 0 && <ResultPane model={model} height={layout.resultRows} />}\n </Box>\n </ViewArea>\n </Box>}\n </Box>\n {layout.footerRows > 0 && <Box height={layout.footerRows} flexShrink={0} overflow=\"hidden\">\n <ViewFooter model={model} />\n </Box>}\n </Box>;\n }\n}\n\n/** \"▲ N more\" / \"▼ N more\" indicator row, shown only when items are hidden. */\nconst ScrollIndicator: React.FC<{ direction: \"up\" | \"down\"; count: number }> = ({ direction, count }) => {\n if (count <= 0) return null;\n const arrow = direction === \"up\" ? \"\\u25b2\" : \"\\u25bc\";\n return <Text dimColor>{` ${arrow} ${count} more`}</Text>;\n};\n\n// -- header: signing identity --\n\nconst Header: React.FC<{ model: UiModel; warnings: readonly string[] }> = ({ model, warnings }) => {\n const identity = useObservable(model.identity);\n return (\n <Box flexDirection=\"column\">\n <Box height={1} flexShrink={0}>\n <Text dimColor>identity: </Text>\n <Text wrap=\"truncate-end\">{identity ?? \"(resolving…)\"}</Text>\n </Box>\n {warnings.map((warning) => (\n <Text key={warning} color=\"yellow\" wrap=\"truncate-end\">! {warning}</Text>\n ))}\n </Box>\n );\n};\n\n// -- col 0: services --\n\nconst ServicesColumn: React.FC<{ model: UiModel; focused: boolean; width: number; height: number; listHeight: number }> = ({ model, focused, width, height, listHeight }) => {\n const result = useObservable(model.servicesPromise.promiseResult);\n const selection = useObservable(model.selection);\n\n useInput(\n (_input, key) => {\n if (key.upArrow) model.moveServiceCursor(-1);\n else if (key.downArrow) model.moveServiceCursor(1);\n else if (key.return) model.focusColumn(1);\n },\n { isActive: focused },\n );\n\n const services = !result || result.error ? [] : (result.data ?? []);\n const cursorIdx = selection\n ? services.findIndex((s) =>\n s.serviceId === selection.serviceId\n && s.interfaceId === selection.interfaceId\n && (s.isDefault === true) === (selection.isDefault === true))\n : -1;\n const win = useScroll(services.length, Math.max(0, cursorIdx), listHeight);\n\n return (\n <Column title=\"Services\" focused={focused} width={width} height={height}>\n {!result ? (\n <Text dimColor>Loading…</Text>\n ) : result.error ? (\n <Text color=\"red\">Error: {String(result.error)}</Text>\n ) : services.length === 0 ? (\n <Text dimColor>(no services)</Text>\n ) : (\n <>\n <ScrollIndicator direction=\"up\" count={win.above} />\n {services.slice(win.start, win.end).map((s) => {\n const isCursor = !!selection\n && selection.serviceId === s.serviceId\n && selection.interfaceId === s.interfaceId\n && (selection.isDefault === true) === (s.isDefault === true);\n return (\n <Text\n key={`${s.isDefault === true ? \"default\" : s.serviceId}/${s.interfaceId}`}\n color={isCursor ? (focused ? \"cyan\" : \"white\") : undefined}\n wrap=\"truncate-end\"\n >\n {(isCursor ? \"\\u203a \" : \" \")\n + (s.isDefault === true ? \"default \" : s.serviceId ? `${s.serviceId} ` : \"\")}\n <Text dimColor>{s.interfaceId}</Text>\n </Text>\n );\n })}\n <ScrollIndicator direction=\"down\" count={win.below} />\n </>\n )}\n </Column>\n );\n};\n\n// -- col 1: methods --\n\nconst MethodsColumn: React.FC<{ model: UiModel; focused: boolean; width: number; height: number; listHeight: number }> = ({ model, focused, width, height, listHeight }) => {\n const selection = useObservable(model.selection);\n const schemaState = useObservable(model.currentSchemaState);\n const methods = useObservable(model.currentMethods);\n\n useInput(\n (_input, key) => {\n if (key.upArrow) model.moveMethodCursor(-1);\n else if (key.downArrow) model.moveMethodCursor(1);\n else if (key.return) model.focusColumn(2);\n },\n { isActive: focused },\n );\n\n const cursorIdx = selection?.methodName !== undefined\n ? methods.findIndex((m) => m.name === selection.methodName)\n : -1;\n const win = useScroll(methods.length, Math.max(0, cursorIdx), listHeight);\n\n return (\n <Column title=\"Methods\" focused={focused} width={width} height={height}>\n {!selection ? (\n <Text dimColor>(select a service)</Text>\n ) : schemaState.kind === \"loading\" ? (\n <Text dimColor>Loading…</Text>\n ) : schemaState.kind === \"error\" ? (\n <Text color=\"red\">Error: {String(schemaState.error)}</Text>\n ) : methods.length === 0 ? (\n <Text dimColor>(no methods)</Text>\n ) : (\n <>\n <ScrollIndicator direction=\"up\" count={win.above} />\n {methods.slice(win.start, win.end).map((m) => {\n const isCursor = selection.methodName === m.name;\n return (\n <Text\n key={m.name}\n color={isCursor ? (focused ? \"cyan\" : \"white\") : undefined}\n wrap=\"truncate-end\"\n >\n {(isCursor ? \"\\u203a \" : \" \")}\n <Text dimColor>{m.result === undefined ? \"notify \" : \"req \"}</Text>\n {m.name}\n {m.serverStream !== undefined ? <Text color=\"magenta\">{\" \\u2193stream\"}</Text> : null}\n </Text>\n );\n })}\n <ScrollIndicator direction=\"down\" count={win.below} />\n </>\n )}\n </Column>\n );\n};\n\n// -- col 2: form --\n\nconst FormColumn: React.FC<{ model: UiModel; focused: boolean; height: number; listHeight: number }> = ({ model, focused, height, listHeight }) => {\n const selection = useObservable(model.selection);\n const schemaState = useObservable(model.currentSchemaState);\n\n return (\n <Column title=\"Form\" focused={focused} flexGrow={1} height={height}>\n {!selection ? (\n <Text dimColor>(select a service first)</Text>\n ) : selection.methodName === undefined ? (\n <Text dimColor>(select a method first)</Text>\n ) : schemaState.kind === \"loading\" ? (\n <Text dimColor>Loading…</Text>\n ) : schemaState.kind === \"loaded\" && schemaState.method ? (\n <MethodForm model={model} method={schemaState.method} focused={focused} listHeight={listHeight} />\n ) : schemaState.kind === \"error\" ? (\n <Text color=\"red\">Error: {String(schemaState.error)}</Text>\n ) : (\n <Text color=\"red\">Method \"{selection.methodName}\" not in schema</Text>\n )}\n </Column>\n );\n};\n\nconst MethodForm: React.FC<{ model: UiModel; method: MethodSchema & { readonly name: string }; focused: boolean; listHeight: number }> = ({ model, method, focused, listHeight }) => {\n const fields = useObservable(model.currentFields);\n const formValues = useObservable(model.formValues);\n const errors = useObservable(model.formErrors);\n const canSubmit = useObservable(model.canSubmit);\n const cursor = useObservable(model.formCursor);\n const editing = useObservable(model.formEditing);\n\n const submitRowIdx = fields.length;\n const safeCursor = Math.max(0, Math.min(submitRowIdx, cursor));\n const focusedField = safeCursor < submitRowIdx ? fields[safeCursor] : undefined;\n\n // Rows the field list may occupy: the column's list area minus the method\n // header (name + optional summary + blank) and the submit affordance\n // (blank + submit line). Fields are windowed so a long parameter list never\n // overflows the column and corrupts the panes below.\n const headerLines = 1 + (method.summary ? 1 : 0) + 1;\n const submitLines = 2;\n const fieldsHeight = Math.max(1, listHeight - headerLines - submitLines);\n const win = useScroll(fields.length, Math.min(safeCursor, Math.max(0, fields.length - 1)), fieldsHeight);\n\n useInput(\n (input, key) => {\n if (key.upArrow) {\n model.formCursor.set(Math.max(0, safeCursor - 1), undefined);\n return;\n }\n if (key.downArrow) {\n model.formCursor.set(Math.min(submitRowIdx, safeCursor + 1), undefined);\n return;\n }\n if (focusedField) {\n const cls = classifyField(focusedField.schema);\n const current = formValues[focusedField.name];\n if (cls.kind === \"boolean\" && input === \" \") {\n model.setField(focusedField.name, !current);\n return;\n }\n if (cls.kind === \"enum\") {\n if (key.leftArrow || key.rightArrow) {\n const dir: 1 | -1 = key.rightArrow ? 1 : -1;\n const seed = current === undefined ? defaultValueFor(cls) : current;\n model.setField(focusedField.name, cycleEnum(cls.enumValues ?? [], seed, dir));\n return;\n }\n }\n if (key.return) {\n if (cls.kind === \"boolean\") {\n model.setField(focusedField.name, !current);\n return;\n }\n if (cls.kind === \"enum\") {\n const seed = current === undefined ? defaultValueFor(cls) : current;\n model.setField(focusedField.name, cycleEnum(cls.enumValues ?? [], seed, 1));\n return;\n }\n if (current === undefined) {\n model.setField(focusedField.name, defaultValueFor(cls));\n }\n model.formEditing.set(true, undefined);\n return;\n }\n if (input === \"x\" && focusedField.required === false && current !== undefined) {\n model.setField(focusedField.name, undefined);\n return;\n }\n } else if (safeCursor === submitRowIdx && key.return) {\n if (canSubmit) model.submit();\n return;\n }\n },\n { isActive: focused && !editing },\n );\n\n useInput(\n (_input, key) => {\n if (key.escape) model.formEditing.set(false, undefined);\n },\n { isActive: focused && editing },\n );\n\n return (\n <Box flexDirection=\"column\" flexShrink={0}>\n <Text bold>{(method.result === undefined ? \"notify \" : \"request \") + method.name}</Text>\n {method.summary ? <Text dimColor>{method.summary}</Text> : null}\n <Box marginTop={1} flexDirection=\"column\" flexShrink={0}>\n {fields.length === 0 ? (\n <Text dimColor>(no parameters)</Text>\n ) : (\n <>\n <ScrollIndicator direction=\"up\" count={win.above} />\n {fields.slice(win.start, win.end).map((f, i) => {\n const idx = win.start + i;\n return (\n <FieldRow\n key={f.name}\n model={model}\n field={f}\n value={formValues[f.name]}\n focused={focused && safeCursor === idx}\n editing={editing && safeCursor === idx}\n error={errors.get(f.name)}\n />\n );\n })}\n <ScrollIndicator direction=\"down\" count={win.below} />\n </>\n )}\n </Box>\n <Box marginTop={1} flexShrink={0}>\n <Text color={canSubmit ? \"green\" : \"gray\"}>{submitLabel(focused && safeCursor === submitRowIdx, canSubmit)}</Text>\n </Box>\n </Box>\n );\n};\n\nfunction submitLabel(focused: boolean, canSubmit: boolean): string {\n const prefix = focused ? \"\\u203a \" : \" \";\n const hint = canSubmit ? \"\" : \" \\u2014 fix errors first\";\n return `${prefix}[Submit${hint}]`;\n}\n\n// -- shared column shell --\n\nconst Column: React.FC<{\n title: string;\n focused: boolean;\n children: React.ReactNode;\n width?: string | number;\n flexGrow?: number;\n height?: number;\n}> = ({ title, focused, children, width, flexGrow, height }) => {\n return (\n <Box\n flexDirection=\"column\"\n width={width}\n flexGrow={flexGrow}\n height={height}\n minWidth={0}\n overflow=\"hidden\"\n borderStyle=\"single\"\n borderColor={focused ? \"cyan\" : undefined}\n paddingX={1}\n >\n <Text bold>{title}</Text>\n {children}\n </Box>\n );\n};\n\n// -- result pane --\n\nconst ResultPane: React.FC<{ model: UiModel; height: number }> = ({ model, height }) => {\n const promise = useObservable(model.lastCall);\n const result = useObservable(promise ? promise.promiseResult : NO_RESULT);\n const chunks = useObservable(model.streamChunks);\n\n return (\n <Box flexDirection=\"column\" height={height} flexShrink={0} overflow=\"hidden\" borderStyle=\"single\" paddingX={1}>\n <Text bold>Result</Text>\n {chunks.length > 0 ? (\n <Box flexDirection=\"column\">\n {chunks.map((c, i) => (\n <Text key={i} dimColor>{\"\\u2502 \" + formatChunk(c)}</Text>\n ))}\n </Box>\n ) : null}\n {!promise ? (\n <Text dimColor>(no calls yet)</Text>\n ) : !result ? (\n <Text dimColor>{chunks.length > 0 ? \"Streaming…\" : \"Calling…\"}</Text>\n ) : result.error ? (\n <Text color=\"red\">Error: {formatError(result.error)}</Text>\n ) : (\n <Text>\n {JSON.stringify(result.data?.result)}\n {\" \"}\n <Text dimColor>{result.data?.latencyMs.toFixed(1)}ms</Text>\n </Text>\n )}\n </Box>\n );\n};\n\nconst NO_RESULT = observableValue<undefined>(\"App.NO_RESULT\", undefined);\n\nfunction formatChunk(c: unknown): string {\n return typeof c === \"string\" ? c : JSON.stringify(c);\n}\n\nfunction formatError(e: unknown): string {\n if (e instanceof Error) return e.message;\n return String(e);\n}\n","import { render } from \"ink\";\nimport {\n ChannelConnector,\n type IRequestSender,\n type JsonValue,\n type RawStreamingCall,\n RpcError,\n type SendOpts,\n type SigningCallCtx,\n SigningSender,\n type StreamSendOpts,\n} from \"@hediet/linkrpc\";\nimport { isHubEndpoint, openHubChannel } from \"@hediet/linkrpc/node\";\nimport { type CliSigning, connect } from \"@hediet/linkrpc-client\";\nimport type { ResolvedEndpoint } from \"@hediet/linkrpc-client\";\nimport { setupSigning } from \"@hediet/linkrpc-client\";\nimport type { SigningSession } from \"@hediet/linkrpc-client\";\nimport { formatPrincipalSource, type PrincipalSpec } from \"@hediet/linkrpc-client\";\nimport { UiModel } from \"./UiModel\";\nimport { App } from \"./App\";\nimport { withStaticHubReflection } from \"../commands/staticHubReflection\";\nimport type { StaticHubSchema } from \"../staticHubSchema\";\n\nexport interface RunUiOptions {\n readonly endpoint: ResolvedEndpoint;\n readonly principalSpec: PrincipalSpec;\n readonly schema?: StaticHubSchema;\n readonly profile?: \"rpc\" | \"hub\";\n}\n\nexport async function runUi(opts: RunUiOptions): Promise<void> {\n if (isHubEndpoint(opts.endpoint) && opts.profile !== \"rpc\") {\n await _runUiReconnecting(opts.endpoint, opts.principalSpec, opts.schema);\n } else {\n await _runUiOnce(opts.endpoint, opts.principalSpec, opts.schema, opts.profile);\n }\n}\n\n/** Non-Hub endpoints: a single connection, no redial. */\nasync function _runUiOnce(endpoint: ResolvedEndpoint, principalSpec: PrincipalSpec, schema?: StaticHubSchema, profile?: \"rpc\" | \"hub\"): Promise<void> {\n const conn = await connect(endpoint);\n const identity = _isRawEndpoint(endpoint) || profile === \"rpc\"\n ? \"unsigned (raw endpoint)\"\n : _formatIdentity(\n await setupSigning(conn.channel, conn.signing, principalSpec, {\n negotiateHubCaps: false,\n }),\n );\n const model = new UiModel(schema ? withStaticHubReflection(conn.channel, schema) : conn.channel);\n model.identity.set(identity, undefined);\n const instance = render(<App model={model} />, { exitOnCtrlC: false });\n try {\n await instance.waitUntilExit();\n } finally {\n model.dispose();\n await model.views.waitForIdle();\n conn.close();\n }\n}\n\nfunction _isRawEndpoint(endpoint: ResolvedEndpoint): boolean {\n return endpoint.kind === \"ws-no-init\"\n || (endpoint.kind === \"socket\" && endpoint.brokerMode === \"raw\");\n}\n\n/**\n * Hub / env connection: keep the UI alive across socket drops. A stable\n * {@link SwappableSender} backs the {@link UiModel}; on every (re)connect we\n * open a fresh hub channel, install signing, and point the swappable sender at\n * the new signed channel. The TUI is rendered once, after the first connect.\n */\nasync function _runUiReconnecting(\n endpoint: Extract<ResolvedEndpoint, { kind: \"ws\"; } | { kind: \"socket\"; }>,\n principalSpec: PrincipalSpec,\n schema?: StaticHubSchema,\n): Promise<void> {\n const swappable = new SwappableSender();\n let model: UiModel | undefined;\n\n const hubEndpoint = endpoint.kind === \"ws\" ? endpoint.url : endpoint.path;\n const connector = ChannelConnector.expBackoff(() =>\n openHubChannel({ endpoint: hubEndpoint, token: endpoint.token ?? \"\" })\n );\n\n const handle = connector.keepConnected(async ({ channel }) => {\n const signing: CliSigning = {};\n const signed = SigningSender.wrapChannel(channel, signing).sender;\n const session = await setupSigning(signed, signing, principalSpec, {\n negotiateHubCaps: true,\n });\n swappable.setTarget(signed);\n channel.onClose(() => {\n swappable.setTarget(undefined);\n model?.views.disconnect();\n model?.identity.set(\"disconnected; reconnecting…\", undefined);\n });\n\n if (!model) {\n model = new UiModel(schema ? withStaticHubReflection(swappable, schema) : swappable);\n model.identity.set(_formatIdentity(session), undefined);\n const instance = render(<App model={model} />, { exitOnCtrlC: false });\n // When the user quits the TUI, stop redialing and tear down.\n void instance.waitUntilExit().then(async () => {\n model?.dispose();\n await model?.views.waitForIdle();\n handle.stop();\n }, () => handle.stop());\n } else {\n // Reconnected: update header identity label. Pending/next calls\n // use the swapped target; signing hooks live on that sender.\n model.identity.set(_formatIdentity(session), undefined);\n model.views.reconnect();\n }\n });\n\n try {\n await handle.done;\n } finally {\n model?.dispose();\n await model?.views.waitForIdle();\n }\n}\n\n/** One-line identity label for the TUI header (source + truncated nodeId). */\nfunction _formatIdentity(session: SigningSession): string {\n return formatPrincipalSource(session.principalSource, session.principal.identity.publicSigningIdentity.principal);\n}\n\n/**\n * An {@link IRequestSender} whose delegate can be swapped at runtime. Lets the\n * {@link UiModel} hold one stable channel reference while the underlying signed\n * channel is replaced on each reconnect. Calls issued while disconnected reject.\n */\nclass SwappableSender implements IRequestSender<SigningCallCtx> {\n private _target: IRequestSender<SigningCallCtx> | undefined;\n\n public setTarget(target: IRequestSender<SigningCallCtx> | undefined): void {\n this._target = target;\n }\n\n private _require(): IRequestSender<SigningCallCtx> {\n if (!this._target) {\n throw new RpcError(\"not connected\", -32000);\n }\n return this._target;\n }\n\n public sendRequest(\n method: string,\n params: JsonValue | undefined,\n opts?: SendOpts<SigningCallCtx>,\n ): Promise<JsonValue> {\n return this._require().sendRequest(method, params, opts);\n }\n\n public sendNotification(\n method: string,\n params: JsonValue | undefined,\n opts?: SendOpts<SigningCallCtx>,\n ): Promise<void> {\n return this._require().sendNotification(method, params, opts);\n }\n\n public sendRequestWithStream(\n method: string,\n params: JsonValue | undefined,\n opts?: StreamSendOpts<SigningCallCtx>,\n ): RawStreamingCall {\n return this._require().sendRequestWithStream(method, params, opts);\n }\n\n public close(): void {\n this._target?.close();\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AAQA,IAAa,gBAAb,MAAkD;CAGzB;CAFrB,UAAmB,oBAAC,aAAD,EAAa,SAAS,KAAO,CAAA;CAChD,WAAoB,gBAAgB,MAAM;EAAE,MAAM;EAAI,SAAS;EAAI,KAAK;EAAG,MAAM;EAAG,UAAU;CAAM,CAAC;CAC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