c2e0c16d6a
Every client plugin package carries dshClient ({platform, inject,
immediately?}) and emits lib/client.js through the shared clientBundle
preset; exports["./client"] points at the bundle. The infrastructure
tier (connection, runtime, ui-theme, i18n, hmr) declares immediately: true
in its manifest — absent means lazy. The bundle purity gate covers all
nine packages: platform modules stay external, INLINE_SAFE wire layers
inline, any other cross-plugin value import is a build error. Migrations
that rule forced: scopeOf became a SessionsService method and
transportError moved into dsh-host-apiproxy's wire layer; the store
engine stays in runtime under a documented temporary exemption
(TODO(webload/store-rehome)).
47 lines
1.8 KiB
TypeScript
47 lines
1.8 KiB
TypeScript
/**
|
|
* apiproxy contract-layer barrel. api/ has zero Node dependencies and is
|
|
* importable from the browser; the TS interfaces are the authoritative contract, HTTP/SSE are
|
|
* merely physical channels (four-quadrant message model).
|
|
*/
|
|
|
|
import type { SessionsApi } from './sessions.ts'
|
|
import type { HostApi } from './host.ts'
|
|
import type { EventsApi } from './events.ts'
|
|
import type { ClientResponse, RpcReceipt } from './rpc.ts'
|
|
|
|
/** Root interface of the unified API surface. New client-request domain = one new file pair + one field here + one map row. */
|
|
export interface ApiProxy {
|
|
sessions: SessionsApi
|
|
host: HostApi
|
|
events: EventsApi
|
|
/** Response entry for server-requests (client-response, echoing their rpcId); not a domain method (four-quadrant model). */
|
|
respond(message: ClientResponse): Promise<RpcReceipt>
|
|
}
|
|
|
|
// ---- Domain interfaces and payload entities ----
|
|
export type { HistoryEntry, SessionsApi, SessionSummary } from './sessions.ts'
|
|
export type { HostApi } from './host.ts'
|
|
export type { EventsApi, MuxFrame, HostFrame, ToolCallView, ToolEventView, ToolResultView } from './events.ts'
|
|
export type { ApprovalResponsePayload } from './approvals.ts'
|
|
export type { QuestionResponsePayload } from './questions.ts'
|
|
|
|
// ---- Message layer: narrow forms (domain-signature view) ----
|
|
export type { RpcRequest, RpcResponse } from './rpc.ts'
|
|
|
|
// ---- Message layer: the four wire full forms + carrier receipt ----
|
|
export type {
|
|
ClientRequest,
|
|
ClientResponse,
|
|
RpcMessage,
|
|
RpcReceipt,
|
|
ServerRequest,
|
|
ServerResponse,
|
|
} from './rpc.ts'
|
|
|
|
// ---- Errors and ids ----
|
|
export { RpcId, transportError } from './rpc.ts'
|
|
export type { RpcError, RpcErrorCode, RpcErrorDetailsMap, RpcResult } from './rpc.ts'
|
|
|
|
// ---- Method registry and derived generics ----
|
|
export type { RequestPayload, ResponseValue, RpcMethodMap } from './rpc-map.ts'
|