refactor(api): remove ApiProxy package

This commit is contained in:
imccyu
2026-08-27 22:26:29 +08:00
parent e14d354e83
commit 4f00a8b82a
42 changed files with 54 additions and 3529 deletions
+1 -1
View File
@@ -198,7 +198,7 @@ export function expectedDshPackageFiles(manifest: PackageManifest): readonly str
...exportDefault(manifest, './worker') === './lib/worker.js' ? ['lib/worker.js'] : [],
// UI plugin packages ship their browser bundle beside the node lib
// (single-artifact ruling: dist/ retired, ./client resolves lib/client.js).
// Keyed on the artifact path, not the subpath name: apiproxy's ./client is
// Keyed on the artifact path, not the subpath name: a package's ./client is
// a browser-safe source channel, not a bundle.
...exportDefault(manifest, './client') === './lib/client.js' ? ['lib/client.js'] : [],
// runtime's shell-held loader subpath ships as its own bundle beside the client half.
+1 -1
View File
@@ -1,7 +1,7 @@
/** Map one workspace source alias target to its declaration-build target. */
export function builtDeclarationPath(candidate: string): string {
// Two workspace path forms exist: whole-package entries end in /src, subpath
// wildcards (apiproxy's browser-safe /api and /client channels) in /src/*.
// wildcards (browser-safe /types and /client channels) in /src/*.
if (candidate.endsWith('/src')) {
return `${candidate.slice(0, -'/src'.length)}/lib/types`
}
+3 -3
View File
@@ -58,7 +58,6 @@ export const SERVICE_PAGE: Record<string, string> = {
agentDefaultModel: 'core.md',
agentPresets: 'core.md',
agents: 'core.md',
apiProxy: 'typert.md',
approval: 'approval.md',
attachments: 'attachment.md',
shell: 'shell.md',
@@ -618,6 +617,7 @@ export const LINK_MAP: Readonly<Record<string, string>> = {
DirectoryListing: 'workspace.md',
TypertContribution: 'invariants.md',
TypertRemoteEventSource: 'typert.md',
RemoteEventHostInfo: 'typert.md',
TypertFace: 'invariants.md',
TypertPackageFilter: 'invariants.md',
TypertPackageRecord: 'invariants.md',
@@ -661,7 +661,7 @@ export const TYPE_LINK_EXEMPTIONS: Readonly<Record<string, string>> = {
BashEnvVariableInfo: 'service-local metadata type is owned by packages/shell/tool-bash/src/index.ts',
CompactionAgentContext: 'compaction service input is owned by packages/compaction/compaction/src/index.ts',
ManualCompactAgentContext: 'manual compaction service input is owned by packages/compaction/compaction/src/index.ts',
ClientResponse: 'wire response message is owned by packages/host/apiproxy/src/api/rpc.ts',
ClientResponse: 'wire response message is owned by packages/client/connection/src/rpc.ts',
ApprovalRequestId: 'dynamic Plugin approval identity is owned by packages/extensions/cordis-host-runner/src/types.ts',
CordisErrorDetails: 'Cordis runtime error payload is owned by packages/extensions/cordis-host-runner/src/types.ts',
CordisInspectPlatform: 'Cordis inspect platform identity is owned by packages/extensions/cordis-host-runner/src/types.ts',
@@ -714,7 +714,7 @@ export const TYPE_LINK_EXEMPTIONS: Readonly<Record<string, string>> = {
PermissionSelect: 'permissions projection payload is owned by packages/interaction/permission-presets/src/types.ts',
PromptAssembly: 'assembly result is owned by packages/core/system-prompt/README.md',
RequestRunId: 'dynamic-package payload contract is owned by packages/extensions/cordis-host-runner/src/types.ts',
RpcReceipt: 'carrier-layer receipt is owned by packages/host/apiproxy/src/api/rpc.ts',
RpcReceipt: 'carrier-layer receipt is owned by packages/client/connection/src/rpc.ts',
Sandbox: 'external E2B SDK handle is owned by packages/e2b/e2b/README.md',
SessionForkSource: 'service-local fork input is owned by packages/core/session/src/index.ts',
SubagentRunEndInfo: 'event payload contract is owned by packages/subagent/subagent/src/types.ts',
+9 -17
View File
@@ -104,7 +104,7 @@ const SERVICE_ROLES: ServiceRole[] = [
title: 'Durable binary attachment storage',
mode: 'seam',
implementations: ['attachment-local'],
consumers: ['api-session-controller', 'host-apiproxy', 'tool-fs', 'llm-pi-ai', 'llm-deepseek'],
consumers: ['api-session-controller', 'tool-fs', 'llm-pi-ai', 'llm-deepseek'],
note: 'The host commits accepted images before session events; provider adapters resolve authorized durable references into provider-native content.',
},
{
@@ -236,8 +236,8 @@ const SERVICE_ROLES: ServiceRole[] = [
title: 'User-settings seam',
mode: 'seam',
implementations: ['settings-file'],
consumers: ['llm-deepseek', 'llm-pi-ai', 'host-apiproxy'],
note: 'Plugins register namespace schemas and resolve layered values; providers store the raw document. The LLM adapters register their entry config as the composition base under the user section; the web gateway serves redacted layered descriptors and writes the user layer.',
consumers: ['api-settings-controller', 'llm-deepseek', 'llm-pi-ai'],
note: 'Plugins register namespace schemas and resolve layered values; providers store the raw document. The LLM adapters register their entry config as the composition base under the user section; the settings controller serves redacted layered descriptors and writes the user layer.',
},
{
key: 'subagentModelSelection',
@@ -253,8 +253,8 @@ const SERVICE_ROLES: ServiceRole[] = [
title: 'Credential seam',
mode: 'seam',
implementations: ['credentials-local'],
consumers: ['llm-deepseek', 'llm-pi-ai', 'host-apiproxy'],
note: 'Configuration carries references to secrets; providers own the values. Consumers resolve per operation, so a rotated credential reaches the very next request; the web gateway exposes value-free views and write-only storage.',
consumers: ['api-settings-controller', 'llm-deepseek', 'llm-pi-ai'],
note: 'Configuration carries references to secrets; providers own the values. Consumers resolve per operation, so a rotated credential reaches the very next request; the settings controller exposes value-free views and write-only storage.',
},
{
key: 'authorization',
@@ -389,15 +389,15 @@ const SERVICE_ROLES: ServiceRole[] = [
pkg: 'session-projection',
title: 'Session projection units',
mode: 'core',
consumers: ['tool-todo', 'session-title', 'host-apiproxy'],
note: 'Domains register state-driven fold units; the eager drive keeps per-session watermark states and api-proxy serves baselines and pushes changed values.',
consumers: ['api-session-controller', 'tool-todo', 'session-title'],
note: 'Domains register state-driven fold units; the eager drive keeps per-session watermark states and the Session controller serves baselines and pushes changed values.',
},
{
key: 'sessionProjectionCache',
pkg: 'session-projection-cache',
title: 'Persisted projection cache',
mode: 'core',
consumers: ['host-apiproxy'],
consumers: ['api-session-controller', 'session-query', 'session-reference', 'subagent'],
note: 'Durably checkpoints projection unit states per session (throttled + turn/end/detach mandatory points) and serves the cold-read ladder: cache row + persistence tail replay, so listings never load full logs.',
},
{
@@ -422,7 +422,7 @@ const SERVICE_ROLES: ServiceRole[] = [
pkg: 'agent-default-model',
title: 'Default Agent model selection',
mode: 'core',
consumers: ['headless', 'host-apiproxy'],
consumers: ['api-session-controller', 'headless'],
note: 'Layers the default ModelSelection through settings so direct and Host-backed Agent entry points share one state owner.',
},
{
@@ -648,14 +648,6 @@ const SERVICE_ROLES: ServiceRole[] = [
consumers: ['tool-lsp'],
note: 'Provider registration and selection plus normalized query execution over exactly four operations; the seam offers no protocol escape hatch, so a backend translates into the normalized request and result.',
},
{
key: 'apiProxy',
pkg: 'host-apiproxy',
title: 'Host API dispatch',
mode: 'core',
consumers: ['client-connection'],
note: 'The transport-agnostic host gateway face: it dispatches browser API calls, and each open host stream subscribes to the events it forwards rather than being pushed to through a broadcast verb.',
},
{
key: 'dynamicCordisRunner',
pkg: 'cordis-host-runner',
@@ -114,7 +114,6 @@ const SENTENCE_MODEL_EXPERIENCE: Readonly<Record<string, SentenceContract>> = {
'packages/e2b/fs-e2b': { kind: 'indirect', reason: 'The provider backend delegates model rendering to dsh-tool-fs.' },
'packages/fs/fs-local': { kind: 'indirect', reason: 'The provider backend delegates model rendering to dsh-tool-fs.' },
'packages/hooks/hook-protocol': { kind: 'indirect', reason: 'Only the hook bridge plugins render decoded hook output to a model.' },
'packages/host/apiproxy': { kind: 'none', reason: 'The wire contract and fetch carriers move already-composed messages and register nothing model-facing.' },
'packages/host/directory-picker': { kind: 'none', reason: 'The GUI-host picking seam registers nothing model-facing.' },
'packages/host/directory-picker-auto': { kind: 'none', reason: 'The GUI-host picking chooser only mounts a backend row; it registers nothing model-facing.' },
'packages/host/directory-picker-browse': { kind: 'none', reason: 'The GUI-host picking backend registers nothing model-facing.' },