@jini-ai/daemon 0.3.8 → 0.5.1

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.
Files changed (159) hide show
  1. package/CHANGELOG.md +124 -0
  2. package/README.md +50 -8
  3. package/dist/agent-executor/contracts.d.ts +736 -0
  4. package/dist/agent-executor/contracts.js +28 -0
  5. package/dist/agent-executor/event-translation.d.ts +87 -0
  6. package/dist/agent-executor/event-translation.js +230 -0
  7. package/dist/agent-executor/events.d.ts +190 -0
  8. package/dist/agent-executor/events.js +848 -0
  9. package/dist/agent-executor/handoff.d.ts +18 -0
  10. package/dist/agent-executor/handoff.js +16 -0
  11. package/dist/agent-executor/index.d.ts +98 -0
  12. package/dist/agent-executor/index.js +98 -0
  13. package/dist/agent-executor/launch.d.ts +375 -0
  14. package/dist/agent-executor/launch.js +1001 -0
  15. package/dist/agent-executor/mcp-bridge.d.ts +338 -0
  16. package/dist/agent-executor/mcp-bridge.js +835 -0
  17. package/dist/agent-executor/values.d.ts +5 -0
  18. package/dist/agent-executor/values.js +13 -0
  19. package/dist/agent-executor.d.ts +375 -176
  20. package/dist/agent-executor.js +388 -335
  21. package/dist/close-status.d.ts +11 -8
  22. package/dist/close-status.js +31 -19
  23. package/dist/continuation/continuation-transport.d.ts +3 -1
  24. package/dist/continuation/continuation-transport.js +1 -1
  25. package/dist/continuation/journal.d.ts +12 -5
  26. package/dist/continuation/journal.js +4 -4
  27. package/dist/continuation/run-scoped-context-store.d.ts +13 -4
  28. package/dist/continuation/run-scoped-context-store.js +6 -6
  29. package/dist/continuation/run-start-handler.d.ts +1 -1
  30. package/dist/continuation/run-start-handler.js +3 -16
  31. package/dist/delegated-tool-bridge.d.ts +7 -3
  32. package/dist/delegated-tool-bridge.js +32 -31
  33. package/dist/event-log.d.ts +7 -5
  34. package/dist/event-log.js +12 -11
  35. package/dist/frontend-capability-tools.d.ts +1 -1
  36. package/dist/frontend-capability-tools.js +3 -2
  37. package/dist/frontend-session-registry.d.ts +32 -9
  38. package/dist/frontend-session-registry.js +12 -11
  39. package/dist/http/active-context.d.ts +105 -0
  40. package/dist/http/active-context.js +67 -0
  41. package/dist/http/agents.d.ts +68 -0
  42. package/dist/http/agents.js +12 -0
  43. package/dist/http/attachments.d.ts +618 -0
  44. package/dist/http/attachments.js +1034 -0
  45. package/dist/http/cancel-owned-runs.d.ts +49 -0
  46. package/dist/http/cancel-owned-runs.js +35 -0
  47. package/dist/http/component-catalog.d.ts +84 -0
  48. package/dist/http/component-catalog.js +64 -0
  49. package/dist/http/connectors.d.ts +209 -0
  50. package/dist/http/connectors.js +409 -0
  51. package/dist/http/daemon-status.d.ts +76 -0
  52. package/dist/http/daemon-status.js +55 -0
  53. package/dist/http/db-ops.d.ts +123 -0
  54. package/dist/http/db-ops.js +189 -0
  55. package/dist/http/delegated-tools.d.ts +113 -0
  56. package/dist/http/delegated-tools.js +230 -0
  57. package/dist/http/frontend-control.d.ts +136 -0
  58. package/dist/http/frontend-control.js +79 -0
  59. package/dist/http/frontend-sessions.d.ts +110 -0
  60. package/dist/http/frontend-sessions.js +180 -0
  61. package/dist/http/health.d.ts +95 -0
  62. package/dist/http/health.js +40 -0
  63. package/dist/http/host-tools.d.ts +214 -0
  64. package/dist/http/host-tools.js +329 -0
  65. package/dist/http/index.d.ts +52 -0
  66. package/dist/http/index.js +27 -0
  67. package/dist/http/media.d.ts +146 -0
  68. package/dist/http/media.js +346 -0
  69. package/dist/http/memory.d.ts +265 -0
  70. package/dist/http/memory.js +328 -0
  71. package/dist/http/model-proxy.d.ts +49 -0
  72. package/dist/http/model-proxy.js +642 -0
  73. package/dist/http/remote-run-events.d.ts +70 -0
  74. package/dist/http/remote-run-events.js +224 -0
  75. package/dist/http/research.d.ts +48 -0
  76. package/dist/http/research.js +315 -0
  77. package/dist/http/route-manifest.d.ts +35 -0
  78. package/dist/http/route-manifest.js +103 -0
  79. package/dist/http/routines.d.ts +120 -0
  80. package/dist/http/routines.js +298 -0
  81. package/dist/http/run-credentials.d.ts +73 -0
  82. package/dist/http/run-credentials.js +71 -0
  83. package/dist/http/runs.d.ts +91 -0
  84. package/dist/http/runs.js +221 -0
  85. package/dist/http/terminals.d.ts +138 -0
  86. package/dist/http/terminals.js +325 -0
  87. package/dist/http/tool-catalog.d.ts +78 -0
  88. package/dist/http/tool-catalog.js +66 -0
  89. package/dist/http/workspace-root.d.ts +77 -0
  90. package/dist/http/workspace-root.js +63 -0
  91. package/dist/http/xai.d.ts +90 -0
  92. package/dist/http/xai.js +655 -0
  93. package/dist/image-prompt-delivery.d.ts +13 -3
  94. package/dist/image-prompt-delivery.js +5 -5
  95. package/dist/index.d.ts +556 -4
  96. package/dist/index.js +556 -4
  97. package/dist/legacy-data-migration.d.ts +59 -8
  98. package/dist/legacy-data-migration.js +38 -33
  99. package/dist/read-only-tools.d.ts +130 -0
  100. package/dist/read-only-tools.js +115 -0
  101. package/dist/remote-tool-bridge.d.ts +11 -5
  102. package/dist/remote-tool-bridge.js +15 -15
  103. package/dist/routines/index.d.ts +1 -1
  104. package/dist/routines/index.js +1 -1
  105. package/dist/routines/routine-store.d.ts +34 -12
  106. package/dist/routines/routine-store.js +21 -20
  107. package/dist/routines/schedule.d.ts +48 -10
  108. package/dist/routines/schedule.js +21 -21
  109. package/dist/routines/scheduler.d.ts +32 -11
  110. package/dist/routines/scheduler.js +61 -57
  111. package/dist/routines/types.d.ts +10 -3
  112. package/dist/run/core/result.d.ts +6 -2
  113. package/dist/run/core/result.js +3 -3
  114. package/dist/run/core/retry.d.ts +17 -4
  115. package/dist/run/core/retry.js +7 -11
  116. package/dist/run/diagnostics/diagnostics.d.ts +14 -4
  117. package/dist/run/diagnostics/diagnostics.js +7 -7
  118. package/dist/run/index.d.ts +1 -1
  119. package/dist/run/index.js +1 -1
  120. package/dist/run-credentials.d.ts +138 -0
  121. package/dist/run-credentials.js +152 -0
  122. package/dist/run-lifecycle.d.ts +92 -33
  123. package/dist/run-lifecycle.js +81 -74
  124. package/dist/scheduler.d.ts +8 -0
  125. package/dist/scheduler.js +2 -0
  126. package/dist/session-coordination.d.ts +115 -0
  127. package/dist/session-coordination.js +111 -0
  128. package/dist/store/agent-sessions/errors.d.ts +8 -0
  129. package/dist/store/agent-sessions/errors.js +10 -0
  130. package/dist/store/agent-sessions/index.d.ts +12 -0
  131. package/dist/store/agent-sessions/index.js +19 -0
  132. package/dist/store/agent-sessions/pglite.d.ts +12 -0
  133. package/dist/store/agent-sessions/pglite.js +7 -0
  134. package/dist/store/agent-sessions/ports.d.ts +24 -0
  135. package/dist/store/agent-sessions/ports.js +2 -0
  136. package/dist/store/agent-sessions/postgres.d.ts +12 -0
  137. package/dist/store/agent-sessions/postgres.js +7 -0
  138. package/dist/store/agent-sessions/schema.d.ts +3 -0
  139. package/dist/store/agent-sessions/schema.js +23 -0
  140. package/dist/store/agent-sessions/sql.d.ts +35 -0
  141. package/dist/store/agent-sessions/sql.js +59 -0
  142. package/dist/store/agent-sessions/sqlite.d.ts +117 -0
  143. package/dist/store/agent-sessions/sqlite.js +128 -0
  144. package/dist/store/event-log/sqlite.d.ts +75 -0
  145. package/dist/store/event-log/sqlite.js +230 -0
  146. package/dist/surface-exchanges.d.ts +97 -0
  147. package/dist/surface-exchanges.js +153 -0
  148. package/dist/terminal-session.d.ts +43 -11
  149. package/dist/terminal-session.js +22 -20
  150. package/dist/tokens.js +4 -4
  151. package/dist/tool-audit.d.ts +114 -0
  152. package/dist/tool-audit.js +95 -0
  153. package/dist/tool-executor.d.ts +22 -7
  154. package/dist/tool-executor.js +16 -16
  155. package/dist/tool-result-media.d.ts +3 -1
  156. package/dist/tool-result-media.js +1 -1
  157. package/dist/tool-result-surfaces.d.ts +3 -1
  158. package/dist/tool-result-surfaces.js +1 -1
  159. package/package.json +127 -9
@@ -0,0 +1,214 @@
1
+ /**
2
+ * @module host-tools
3
+ *
4
+ * Generic "open a working directory in a local host tool" surface, ported
5
+ * from the routes-classification table's `host-tools.ts` MIXED row (see
6
+ * `archived provenance ledger`): the editor catalogue, `$PATH`/mac-bundle probing, and
7
+ * guarded detached-spawn machinery have zero OD dependency and are ported
8
+ * here in full. `GET /api/editors` (which uses solely this machinery) was
9
+ * mounted first; `POST /api/resources/:resourceRef/open-in` (OD's `POST
10
+ * /api/projects/:id/open-in`) is now ported too, now that a generic
11
+ * workspace-root port exists (`workspace-root.ts`) to stand in for OD's
12
+ * `projectStore.getProject`/`projectFiles.resolveProjectDir` — see that
13
+ * route's own doc below for the exact mapping.
14
+ *
15
+ * The probing functions take an injectable `HostToolProbeEnv` (filesystem
16
+ * `access`, `env`, `platform`) rather than reading `process.env`/`fs`
17
+ * directly, so every platform/found/missing branch is exercisable from a
18
+ * single-OS test runner without touching the real filesystem.
19
+ */
20
+ import { spawn as nodeSpawn } from 'node:child_process';
21
+ import type { Express } from 'express';
22
+ import { type AdapterContext } from '@jini-ai/http-kit';
23
+ import { type WorkspaceRootResolver } from './workspace-root.js';
24
+ export type RealPlatform = 'darwin' | 'win32' | 'linux';
25
+ export type Platform = RealPlatform | 'unknown';
26
+ export interface CatalogueEntry {
27
+ readonly id: string;
28
+ readonly label: string;
29
+ readonly icon: string;
30
+ /** CLI shim name to probe on `$PATH`. Mutually exclusive in practice with `macOpenBundle`, though both may be set as a fallback pair. */
31
+ readonly command?: string;
32
+ readonly commandArgs?: ({ workingDir }: {
33
+ workingDir: string;
34
+ }) => string[];
35
+ /** macOS-only fallback: when the CLI shim is missing, look for an app bundle by name and launch it via `open -a "<name>"`. */
36
+ readonly macOpenBundle?: string | readonly string[];
37
+ readonly macOpenArgs?: ({ bundleName, workingDir }: {
38
+ bundleName: string;
39
+ workingDir: string;
40
+ }) => string[];
41
+ readonly platforms?: readonly RealPlatform[];
42
+ readonly excludedPlatforms?: readonly RealPlatform[];
43
+ }
44
+ /** The cross-platform-staple + macOS-bundle editor/tool catalogue, unchanged from the origin. */
45
+ export declare const CATALOGUE: readonly CatalogueEntry[];
46
+ /** Maps Node's `process.platform` to this module's tri-state `Platform`; anything else (aix, freebsd, sunos, ...) is `'unknown'`. */
47
+ export declare function currentPlatform(_required: Record<string, never>, { nodePlatform }?: {
48
+ readonly nodePlatform?: NodeJS.Platform | undefined;
49
+ }): Platform;
50
+ export declare function applicableForPlatform({ entry, platform }: {
51
+ readonly entry: CatalogueEntry;
52
+ readonly platform: Platform;
53
+ }, _optional?: Record<string, never>): boolean;
54
+ /**
55
+ * Everything the probing functions below need from the outside world, gathered into one
56
+ * injectable value. Production code gets {@link defaultProbeEnv}; tests inject a fake `access`
57
+ * (so "found"/"missing" is a table, not a real filesystem) and any `platform`/`env` they want to
58
+ * exercise, independent of the OS actually running the test.
59
+ */
60
+ export interface HostToolProbeEnv {
61
+ readonly access: ({ path, mode }: {
62
+ path: string;
63
+ mode: number;
64
+ }) => Promise<void>;
65
+ readonly env: Readonly<Record<string, string | undefined>>;
66
+ readonly platform: Platform;
67
+ }
68
+ export declare function defaultProbeEnv(_required: Record<string, never>, _optional?: Record<string, never>): HostToolProbeEnv;
69
+ /**
70
+ * `$PATH` directories to probe, plus the common macOS/Linux locations a login shell would have
71
+ * that a GUI-launched daemon's thin inherited `PATH` often lacks (no `/usr/local/bin`, no
72
+ * `/opt/homebrew/bin`) — without these, CLI shims installed via an editor's "Install command"
73
+ * action are invisible to a daemon launched by double-clicking an app bundle.
74
+ */
75
+ export declare function pathDirs(probeEnv: HostToolProbeEnv): string[];
76
+ export declare function probeCommandOnPath({ command, probeEnv }: {
77
+ readonly command: string;
78
+ readonly probeEnv: HostToolProbeEnv;
79
+ }, _optional?: Record<string, never>): Promise<string | null>;
80
+ export declare function probeMacBundle({ name, probeEnv }: {
81
+ readonly name: string | readonly string[];
82
+ readonly probeEnv: HostToolProbeEnv;
83
+ }, _optional?: Record<string, never>): Promise<{
84
+ name: string;
85
+ path: string;
86
+ } | null>;
87
+ /**
88
+ * A discriminated union rather than one shape with optional fields: `resolvedPath`/`launch` are
89
+ * only ever set together (both "found" branches below set the pair; the "not found" branch sets
90
+ * neither), so the type says that directly instead of leaving `resolvedPath` reachable-but-absent
91
+ * when `available` is `false`.
92
+ */
93
+ type ResolvedEntry = {
94
+ readonly available: true;
95
+ readonly resolvedPath: string;
96
+ readonly launch: {
97
+ readonly command: string;
98
+ readonly argsForDir: (requiredArgs: {
99
+ readonly workingDir: string;
100
+ }) => string[];
101
+ };
102
+ } | {
103
+ readonly available: false;
104
+ };
105
+ export declare function resolveEntry({ entry }: {
106
+ readonly entry: CatalogueEntry;
107
+ }, { probeEnv }?: {
108
+ readonly probeEnv?: HostToolProbeEnv | undefined;
109
+ }): Promise<ResolvedEntry>;
110
+ export interface HostToolLaunchPlan {
111
+ readonly available: boolean;
112
+ readonly resolvedPath?: string;
113
+ readonly command?: string;
114
+ readonly args?: string[];
115
+ }
116
+ /** Resolves the concrete `{command, args}` a caller would spawn to open `workingDir` in `editorId`, or `available: false` if that tool isn't installed/known. */
117
+ export declare function resolveHostToolLaunchPlan({ editorId, workingDir }: {
118
+ readonly editorId: string;
119
+ readonly workingDir: string;
120
+ }, { probeEnv }?: {
121
+ readonly probeEnv?: HostToolProbeEnv | undefined;
122
+ }): Promise<HostToolLaunchPlan>;
123
+ export type LaunchHostToolResult = {
124
+ readonly ok: true;
125
+ } | {
126
+ readonly ok: false;
127
+ readonly error: string;
128
+ };
129
+ /**
130
+ * Spawns a detached host-tool launch and waits for the OS to confirm it actually started. Node
131
+ * emits `'spawn'` once the child is running and `'error'` when the launch is refused (missing
132
+ * binary, quarantine, EACCES) — `'error'` arrives on a later tick, so this must be awaited before
133
+ * a caller replies, otherwise a launch the OS rejected would be reported as success (origin's
134
+ * #3871).
135
+ *
136
+ * Deliberately never passes `shell: true`: on Windows that would route the launch through
137
+ * `cmd.exe`, which shell-interprets args — and one of them is a caller-supplied directory path,
138
+ * so a path containing `&`/`|`/`^`/`>` etc. would inject commands. `command` is already resolved
139
+ * to an absolute path (including `.exe`/`.cmd`), so it's routed through `createCommandInvocation`
140
+ * (`@jini-ai/platform`), which runs a `.cmd`/`.bat` via `cmd.exe` with
141
+ * `CommandLineToArgvW`-safe verbatim args and everything else directly — no shell, no
142
+ * metacharacter interpretation.
143
+ */
144
+ export declare function launchHostTool({ command, args }: {
145
+ readonly command: string;
146
+ readonly args: string[];
147
+ }, { spawnImpl }?: {
148
+ readonly spawnImpl?: typeof nodeSpawn | undefined;
149
+ }): Promise<LaunchHostToolResult>;
150
+ export interface HostEditor {
151
+ readonly id: string;
152
+ readonly label: string;
153
+ readonly icon: string;
154
+ readonly available: boolean;
155
+ readonly resolvedPath?: string;
156
+ readonly platforms?: readonly RealPlatform[];
157
+ }
158
+ export interface HostEditorsResponse {
159
+ readonly editors: readonly HostEditor[];
160
+ readonly platform: Platform;
161
+ }
162
+ /** Probes every catalogue entry applicable to the current platform and reports which are actually installed. */
163
+ export declare function listAvailableEditors(_required: Record<string, never>, { probeEnv }?: {
164
+ readonly probeEnv?: HostToolProbeEnv | undefined;
165
+ }): Promise<HostEditorsResponse>;
166
+ /** `GET /api/editors` — lists the host-tool catalogue applicable to this platform with live availability. */
167
+ export declare const hostEditorsRoute: import("@jini-ai/http-kit").JsonRouteSpec<void, HostEditorsResponse, Record<string, never>>;
168
+ export interface OpenResourceInEditorRequest {
169
+ readonly resourceRef: string;
170
+ readonly editorId: string;
171
+ readonly detail?: string;
172
+ }
173
+ export interface OpenResourceInEditorResponse {
174
+ readonly ok: true;
175
+ readonly editorId: string;
176
+ readonly path: string;
177
+ }
178
+ /** Everything `POST /api/resources/:resourceRef/open-in` needs from the host. */
179
+ export interface HostToolsOpenInDeps {
180
+ /** Resolves a resource reference to a filesystem working directory. Defaults to {@link denyAllWorkspaceRoots} — a host that never wires a real resolver gets a 404 on every call, never a guessed path (see `workspace-root.ts`). */
181
+ readonly resolveRoot?: WorkspaceRootResolver;
182
+ readonly probeEnv?: HostToolProbeEnv;
183
+ readonly spawnImpl?: typeof nodeSpawn;
184
+ }
185
+ /**
186
+ * `POST /api/resources/:resourceRef/open-in` — launches `editorId` (from
187
+ * {@link CATALOGUE}) rooted at the working directory `deps.resolveRoot`
188
+ * resolves for `resourceRef`. Ported from OD's `POST
189
+ * /api/projects/:id/open-in`: `projectId` generalizes to the opaque
190
+ * `resourceRef` this package already uses (`active-context.ts`,
191
+ * `cancel-owned-runs.ts`), and `getProject`/`resolveProjectDir` generalize
192
+ * to the injected {@link WorkspaceRootResolver}. `PROJECT_NOT_FOUND` (an
193
+ * OD-product-only code with no `@jini-ai/protocol` equivalent — see
194
+ * `response.ts`'s file-map note) becomes a generic `NOT_FOUND` when the
195
+ * resolver denies. `EDITOR_NOT_AVAILABLE` (OD's 409 for "installed catalogue
196
+ * entry, but not found on this machine") becomes `CONFLICT`, which already
197
+ * maps to 409 in this package's `ERROR_STATUS_BY_CODE`.
198
+ *
199
+ * The launch-failure message is returned to the caller verbatim (unlike
200
+ * `runs.ts`'s SEC-005 redaction of internal agent-run errors): this is a
201
+ * same-origin, explicitly-consented, single local action the caller just
202
+ * asked for (open the tool it named, at the directory it's authorized to
203
+ * open) — the underlying spawn error (e.g. a quarantined/missing binary) is
204
+ * operationally useful to the caller and does not cross a trust boundary
205
+ * the way an internal agent-run exception can.
206
+ */
207
+ export declare const openResourceInEditorRoute: import("@jini-ai/http-kit").JsonRouteSpec<OpenResourceInEditorRequest, OpenResourceInEditorResponse, HostToolsOpenInDeps>;
208
+ /** Mounts `GET /api/editors` and `POST /api/resources/:resourceRef/open-in` on `app`. A pack's `http(app, services)` calls this directly. */
209
+ export declare function registerHostToolsRoutes({ app, adapter }: {
210
+ readonly app: Express;
211
+ readonly adapter: AdapterContext;
212
+ }, openInDeps?: HostToolsOpenInDeps): void;
213
+ export {};
214
+ //# sourceMappingURL=host-tools.d.ts.map
@@ -0,0 +1,329 @@
1
+ /**
2
+ * @module host-tools
3
+ *
4
+ * Generic "open a working directory in a local host tool" surface, ported
5
+ * from the routes-classification table's `host-tools.ts` MIXED row (see
6
+ * `archived provenance ledger`): the editor catalogue, `$PATH`/mac-bundle probing, and
7
+ * guarded detached-spawn machinery have zero OD dependency and are ported
8
+ * here in full. `GET /api/editors` (which uses solely this machinery) was
9
+ * mounted first; `POST /api/resources/:resourceRef/open-in` (OD's `POST
10
+ * /api/projects/:id/open-in`) is now ported too, now that a generic
11
+ * workspace-root port exists (`workspace-root.ts`) to stand in for OD's
12
+ * `projectStore.getProject`/`projectFiles.resolveProjectDir` — see that
13
+ * route's own doc below for the exact mapping.
14
+ *
15
+ * The probing functions take an injectable `HostToolProbeEnv` (filesystem
16
+ * `access`, `env`, `platform`) rather than reading `process.env`/`fs`
17
+ * directly, so every platform/found/missing branch is exercisable from a
18
+ * single-OS test runner without touching the real filesystem.
19
+ */
20
+ import { spawn as nodeSpawn } from 'node:child_process';
21
+ import { access as fsAccess, constants as fsConstants } from 'node:fs/promises';
22
+ import { createCommandInvocation } from '@jini-ai/platform';
23
+ import { createApiError } from '@jini-ai/protocol';
24
+ import { defineJsonRoute, mountJsonRoute } from '@jini-ai/http-kit';
25
+ import { validationError } from '@jini-ai/http-kit';
26
+ import { err, ok } from '@jini-ai/http-kit';
27
+ import { denyAllWorkspaceRoots, resolveWorkspaceRoot, WorkspaceRootDeniedError } from './workspace-root.js';
28
+ const MAC_OPEN_COMMAND = '/usr/bin/open';
29
+ /** The cross-platform-staple + macOS-bundle editor/tool catalogue, unchanged from the origin. */
30
+ export const CATALOGUE = [
31
+ { id: 'cursor', label: 'Cursor', icon: 'sparkles', command: 'cursor', macOpenBundle: 'Cursor' },
32
+ { id: 'vscode', label: 'VS Code', icon: 'file-code', command: 'code', macOpenBundle: 'Visual Studio Code' },
33
+ { id: 'windsurf', label: 'Windsurf', icon: 'sparkles', command: 'windsurf', macOpenBundle: 'Windsurf' },
34
+ { id: 'zed', label: 'Zed', icon: 'edit', command: 'zed', macOpenBundle: 'Zed' },
35
+ { id: 'qoder', label: 'Qoder', icon: 'sparkles', command: 'qoder', macOpenBundle: ['Qoder', 'QoderWork'] },
36
+ { id: 'antigravity', label: 'Antigravity', icon: 'orbit', command: 'antigravity', macOpenBundle: ['Antigravity', 'Google Antigravity'] },
37
+ { id: 'webstorm', label: 'WebStorm', icon: 'edit', command: 'webstorm', macOpenBundle: 'WebStorm' },
38
+ { id: 'idea', label: 'IntelliJ IDEA', icon: 'edit', command: 'idea', macOpenBundle: 'IntelliJ IDEA' },
39
+ { id: 'xcode', label: 'Xcode', icon: 'file-code', macOpenBundle: ['Xcode', 'Xcode-beta', 'Xcode Beta'], platforms: ['darwin'] },
40
+ { id: 'finder', label: 'Finder', icon: 'folder', command: MAC_OPEN_COMMAND, commandArgs: ({ workingDir }) => ['-R', workingDir], platforms: ['darwin'] },
41
+ { id: 'explorer', label: 'Explorer', icon: 'folder', command: 'explorer', platforms: ['win32'] },
42
+ { id: 'file-manager', label: 'File Manager', icon: 'folder', command: 'xdg-open', platforms: ['linux'] },
43
+ { id: 'terminal', label: 'Terminal', icon: 'sliders', macOpenBundle: 'Terminal', platforms: ['darwin'] },
44
+ // darwin-only: Warp cold-starts ignore the cwd argument on win32/linux, so the
45
+ // "open in Warp" UX is broken on those platforms (origin's #4544).
46
+ { id: 'warp', label: 'Warp', icon: 'sliders', macOpenBundle: 'Warp', platforms: ['darwin'] },
47
+ ];
48
+ /** Maps Node's `process.platform` to this module's tri-state `Platform`; anything else (aix, freebsd, sunos, ...) is `'unknown'`. */
49
+ export function currentPlatform(_required, { nodePlatform = process.platform } = {}) {
50
+ switch (nodePlatform) {
51
+ case 'darwin':
52
+ return 'darwin';
53
+ case 'win32':
54
+ return 'win32';
55
+ case 'linux':
56
+ return 'linux';
57
+ default:
58
+ return 'unknown';
59
+ }
60
+ }
61
+ export function applicableForPlatform({ entry, platform }, _optional = {}) {
62
+ if (platform === 'unknown')
63
+ return false;
64
+ if (entry.platforms && !entry.platforms.includes(platform))
65
+ return false;
66
+ if (entry.excludedPlatforms && entry.excludedPlatforms.includes(platform))
67
+ return false;
68
+ return true;
69
+ }
70
+ export function defaultProbeEnv(_required, _optional = {}) {
71
+ return { access: ({ path, mode }) => fsAccess(path, mode), env: process.env, platform: currentPlatform({}) };
72
+ }
73
+ /**
74
+ * `$PATH` directories to probe, plus the common macOS/Linux locations a login shell would have
75
+ * that a GUI-launched daemon's thin inherited `PATH` often lacks (no `/usr/local/bin`, no
76
+ * `/opt/homebrew/bin`) — without these, CLI shims installed via an editor's "Install command"
77
+ * action are invisible to a daemon launched by double-clicking an app bundle.
78
+ */
79
+ export function pathDirs(probeEnv) {
80
+ const raw = probeEnv.env.PATH ?? '';
81
+ const sep = probeEnv.platform === 'win32' ? ';' : ':';
82
+ const home = probeEnv.env.HOME ?? '';
83
+ const extras = probeEnv.platform === 'darwin'
84
+ ? ['/usr/local/bin', '/opt/homebrew/bin', '/usr/bin', '/bin', '/usr/sbin', '/sbin', `${home}/.local/bin`]
85
+ : probeEnv.platform === 'linux'
86
+ ? ['/usr/local/bin', '/usr/bin', '/bin', `${home}/.local/bin`]
87
+ : [];
88
+ return [...raw.split(sep), ...extras].filter((dir) => dir.length > 0);
89
+ }
90
+ export async function probeCommandOnPath({ command, probeEnv }, _optional = {}) {
91
+ if (command.includes('/')) {
92
+ try {
93
+ await probeEnv.access({ path: command, mode: fsConstants.X_OK });
94
+ return command;
95
+ }
96
+ catch {
97
+ return null;
98
+ }
99
+ }
100
+ const dirs = pathDirs(probeEnv);
101
+ const suffixes = probeEnv.platform === 'win32' ? ['.exe', '.cmd', '.bat', ''] : [''];
102
+ for (const dir of dirs) {
103
+ for (const suffix of suffixes) {
104
+ const candidate = `${dir}/${command}${suffix}`;
105
+ try {
106
+ await probeEnv.access({ path: candidate, mode: fsConstants.X_OK });
107
+ return candidate;
108
+ }
109
+ catch {
110
+ // not here
111
+ }
112
+ }
113
+ }
114
+ return null;
115
+ }
116
+ async function resolveMacOpenCommand(probeEnv) {
117
+ try {
118
+ await probeEnv.access({ path: MAC_OPEN_COMMAND, mode: fsConstants.X_OK });
119
+ return MAC_OPEN_COMMAND;
120
+ }
121
+ catch {
122
+ return (await probeCommandOnPath({ command: 'open', probeEnv })) ?? MAC_OPEN_COMMAND;
123
+ }
124
+ }
125
+ export async function probeMacBundle({ name, probeEnv }, _optional = {}) {
126
+ if (probeEnv.platform !== 'darwin')
127
+ return null;
128
+ const names = Array.isArray(name) ? name : [name];
129
+ const home = probeEnv.env.HOME ?? '';
130
+ const candidates = [
131
+ (bundleName) => `/Applications/${bundleName}.app`,
132
+ (bundleName) => `${home}/Applications/${bundleName}.app`,
133
+ (bundleName) => `/System/Applications/${bundleName}.app`,
134
+ (bundleName) => `/System/Applications/Utilities/${bundleName}.app`,
135
+ (bundleName) => `/System/Library/CoreServices/${bundleName}.app`,
136
+ ];
137
+ for (const bundleName of names) {
138
+ for (const candidate of candidates) {
139
+ const path = candidate(bundleName);
140
+ try {
141
+ await probeEnv.access({ path, mode: fsConstants.R_OK });
142
+ return { name: bundleName, path };
143
+ }
144
+ catch {
145
+ // not here
146
+ }
147
+ }
148
+ }
149
+ return null;
150
+ }
151
+ export async function resolveEntry({ entry }, { probeEnv = defaultProbeEnv({}) } = {}) {
152
+ if (entry.command) {
153
+ const resolved = await probeCommandOnPath({ command: entry.command, probeEnv });
154
+ if (resolved) {
155
+ return {
156
+ available: true,
157
+ resolvedPath: resolved,
158
+ launch: { command: resolved, argsForDir: entry.commandArgs ? ({ workingDir }) => entry.commandArgs({ workingDir }) : ({ workingDir }) => [workingDir] },
159
+ };
160
+ }
161
+ }
162
+ if (entry.macOpenBundle && probeEnv.platform === 'darwin') {
163
+ const bundle = await probeMacBundle({ name: entry.macOpenBundle, probeEnv });
164
+ if (bundle) {
165
+ return {
166
+ available: true,
167
+ resolvedPath: bundle.path,
168
+ launch: {
169
+ command: await resolveMacOpenCommand(probeEnv),
170
+ argsForDir: entry.macOpenArgs
171
+ ? ({ workingDir }) => entry.macOpenArgs({ bundleName: bundle.name, workingDir })
172
+ : ({ workingDir }) => ['-a', bundle.name, workingDir],
173
+ },
174
+ };
175
+ }
176
+ }
177
+ return { available: false };
178
+ }
179
+ /** Resolves the concrete `{command, args}` a caller would spawn to open `workingDir` in `editorId`, or `available: false` if that tool isn't installed/known. */
180
+ export async function resolveHostToolLaunchPlan({ editorId, workingDir }, { probeEnv = defaultProbeEnv({}) } = {}) {
181
+ const entry = CATALOGUE.find((c) => c.id === editorId);
182
+ if (!entry)
183
+ return { available: false };
184
+ const probe = await resolveEntry({ entry }, { probeEnv });
185
+ if (!probe.available)
186
+ return { available: false };
187
+ return {
188
+ available: true,
189
+ resolvedPath: probe.resolvedPath,
190
+ command: probe.launch.command,
191
+ args: probe.launch.argsForDir({ workingDir }),
192
+ };
193
+ }
194
+ /**
195
+ * Spawns a detached host-tool launch and waits for the OS to confirm it actually started. Node
196
+ * emits `'spawn'` once the child is running and `'error'` when the launch is refused (missing
197
+ * binary, quarantine, EACCES) — `'error'` arrives on a later tick, so this must be awaited before
198
+ * a caller replies, otherwise a launch the OS rejected would be reported as success (origin's
199
+ * #3871).
200
+ *
201
+ * Deliberately never passes `shell: true`: on Windows that would route the launch through
202
+ * `cmd.exe`, which shell-interprets args — and one of them is a caller-supplied directory path,
203
+ * so a path containing `&`/`|`/`^`/`>` etc. would inject commands. `command` is already resolved
204
+ * to an absolute path (including `.exe`/`.cmd`), so it's routed through `createCommandInvocation`
205
+ * (`@jini-ai/platform`), which runs a `.cmd`/`.bat` via `cmd.exe` with
206
+ * `CommandLineToArgvW`-safe verbatim args and everything else directly — no shell, no
207
+ * metacharacter interpretation.
208
+ */
209
+ export function launchHostTool({ command, args }, { spawnImpl = nodeSpawn } = {}) {
210
+ return new Promise((resolve) => {
211
+ const invocation = createCommandInvocation({ command, args });
212
+ const child = spawnImpl(invocation.command, invocation.args, {
213
+ detached: true,
214
+ stdio: 'ignore',
215
+ windowsHide: process.platform === 'win32',
216
+ windowsVerbatimArguments: invocation.windowsVerbatimArguments,
217
+ });
218
+ let settled = false;
219
+ child.once('spawn', () => {
220
+ if (settled)
221
+ return;
222
+ settled = true;
223
+ child.unref();
224
+ resolve({ ok: true });
225
+ });
226
+ child.once('error', (spawnError) => {
227
+ if (settled)
228
+ return;
229
+ settled = true;
230
+ resolve({ ok: false, error: spawnError instanceof Error ? spawnError.message : String(spawnError) });
231
+ });
232
+ });
233
+ }
234
+ /** Probes every catalogue entry applicable to the current platform and reports which are actually installed. */
235
+ export async function listAvailableEditors(_required, { probeEnv = defaultProbeEnv({}) } = {}) {
236
+ const filtered = CATALOGUE.filter((entry) => applicableForPlatform({ entry, platform: probeEnv.platform }));
237
+ const editors = await Promise.all(filtered.map(async (entry) => {
238
+ const probe = await resolveEntry({ entry }, { probeEnv });
239
+ return {
240
+ id: entry.id,
241
+ label: entry.label,
242
+ icon: entry.icon,
243
+ available: probe.available,
244
+ ...(probe.available ? { resolvedPath: probe.resolvedPath } : {}),
245
+ ...(entry.platforms ? { platforms: entry.platforms } : {}),
246
+ };
247
+ }));
248
+ return { editors, platform: probeEnv.platform };
249
+ }
250
+ /** `GET /api/editors` — lists the host-tool catalogue applicable to this platform with live availability. */
251
+ export const hostEditorsRoute = defineJsonRoute({ method: 'get', path: '/api/editors', parse: () => ok({ value: undefined }), handle: async () => ok({ value: await listAvailableEditors({}) }) });
252
+ function isRecord(value) {
253
+ return typeof value === 'object' && value !== null && !Array.isArray(value);
254
+ }
255
+ function parseOpenResourceInEditor(input) {
256
+ const resourceRef = input.params.resourceRef;
257
+ if (typeof resourceRef !== 'string' || resourceRef.length === 0) {
258
+ return err({ error: validationError({ message: 'resourceRef must be a non-empty path parameter' }) });
259
+ }
260
+ if (!isRecord(input.body))
261
+ return err({ error: validationError({ message: 'body must be a JSON object' }) });
262
+ const editorId = input.body.editorId;
263
+ if (typeof editorId !== 'string' || editorId.length === 0) {
264
+ return err({ error: validationError({ message: 'editorId is required' }, { issues: [{ path: 'editorId', message: 'required non-empty string' }] }) });
265
+ }
266
+ const detail = input.body.detail;
267
+ if (detail !== undefined && (typeof detail !== 'string' || detail.length === 0)) {
268
+ return err({ error: validationError({ message: 'detail must be a non-empty string when provided' }) });
269
+ }
270
+ return ok({ value: { resourceRef, editorId, ...(detail === undefined ? {} : { detail }) } });
271
+ }
272
+ /**
273
+ * `POST /api/resources/:resourceRef/open-in` — launches `editorId` (from
274
+ * {@link CATALOGUE}) rooted at the working directory `deps.resolveRoot`
275
+ * resolves for `resourceRef`. Ported from OD's `POST
276
+ * /api/projects/:id/open-in`: `projectId` generalizes to the opaque
277
+ * `resourceRef` this package already uses (`active-context.ts`,
278
+ * `cancel-owned-runs.ts`), and `getProject`/`resolveProjectDir` generalize
279
+ * to the injected {@link WorkspaceRootResolver}. `PROJECT_NOT_FOUND` (an
280
+ * OD-product-only code with no `@jini-ai/protocol` equivalent — see
281
+ * `response.ts`'s file-map note) becomes a generic `NOT_FOUND` when the
282
+ * resolver denies. `EDITOR_NOT_AVAILABLE` (OD's 409 for "installed catalogue
283
+ * entry, but not found on this machine") becomes `CONFLICT`, which already
284
+ * maps to 409 in this package's `ERROR_STATUS_BY_CODE`.
285
+ *
286
+ * The launch-failure message is returned to the caller verbatim (unlike
287
+ * `runs.ts`'s SEC-005 redaction of internal agent-run errors): this is a
288
+ * same-origin, explicitly-consented, single local action the caller just
289
+ * asked for (open the tool it named, at the directory it's authorized to
290
+ * open) — the underlying spawn error (e.g. a quarantined/missing binary) is
291
+ * operationally useful to the caller and does not cross a trust boundary
292
+ * the way an internal agent-run exception can.
293
+ */
294
+ export const openResourceInEditorRoute = defineJsonRoute({
295
+ method: 'post', path: '/api/resources/:resourceRef/open-in', parse: parseOpenResourceInEditor, handle: async ({ input, deps }) => {
296
+ const entry = CATALOGUE.find((c) => c.id === input.editorId);
297
+ if (!entry)
298
+ return err({ error: createApiError({ code: 'BAD_REQUEST', message: `unknown editor: ${input.editorId}` }) });
299
+ const probeEnv = deps.probeEnv ?? defaultProbeEnv({});
300
+ if (!applicableForPlatform({ entry, platform: probeEnv.platform })) {
301
+ return err({ error: createApiError({ code: 'BAD_REQUEST', message: `${entry.label} is not available on ${probeEnv.platform}` }) });
302
+ }
303
+ let resolvedDir;
304
+ try {
305
+ resolvedDir = await resolveWorkspaceRoot({ request: { resourceRef: input.resourceRef, ...(input.detail === undefined ? {} : { detail: input.detail }) } }, { resolver: deps.resolveRoot ?? denyAllWorkspaceRoots });
306
+ }
307
+ catch (error) {
308
+ if (error instanceof WorkspaceRootDeniedError) {
309
+ return err({ error: createApiError({ code: 'NOT_FOUND', message: `resource "${input.resourceRef}" was not found` }) });
310
+ }
311
+ throw error;
312
+ }
313
+ const launchPlan = await resolveHostToolLaunchPlan({ editorId: input.editorId, workingDir: resolvedDir }, { probeEnv });
314
+ if (!launchPlan.available || !launchPlan.command || !launchPlan.args) {
315
+ return err({ error: createApiError({ code: 'CONFLICT', message: `${entry.label} is not installed` }) });
316
+ }
317
+ const launch = await launchHostTool({ command: launchPlan.command, args: launchPlan.args }, { spawnImpl: deps.spawnImpl ?? nodeSpawn });
318
+ if (!launch.ok) {
319
+ return err({ error: createApiError({ code: 'INTERNAL_ERROR', message: `failed to launch ${entry.label}: ${launch.error}` }) });
320
+ }
321
+ return ok({ value: { ok: true, editorId: input.editorId, path: resolvedDir } });
322
+ }
323
+ }, { requireSameOrigin: true });
324
+ /** Mounts `GET /api/editors` and `POST /api/resources/:resourceRef/open-in` on `app`. A pack's `http(app, services)` calls this directly. */
325
+ export function registerHostToolsRoutes({ app, adapter }, openInDeps = {}) {
326
+ mountJsonRoute({ app, spec: hostEditorsRoute, deps: {}, adapter });
327
+ mountJsonRoute({ app, spec: openResourceInEditorRoute, deps: openInDeps, adapter });
328
+ }
329
+ //# sourceMappingURL=host-tools.js.map
@@ -0,0 +1,52 @@
1
+ /** Daemon route packs; generic transport primitives live in @jini-ai/http-kit. */
2
+ export type { ResolveWorkspaceRootOptions, WorkspaceRootRequest, WorkspaceRootResolver, } from './workspace-root.js';
3
+ export { denyAllWorkspaceRoots, resolveWorkspaceRoot, WorkspaceRootDeniedError } from './workspace-root.js';
4
+ export type { RunCancellationService } from './cancel-owned-runs.js';
5
+ export { cancelRunsOwnedBy } from './cancel-owned-runs.js';
6
+ export type { ActiveContextDeps, ActiveContextResource } from './active-context.js';
7
+ export { ACTIVE_CONTEXT_TTL_MS, getActiveRoute, registerActiveContextRoutes, setActiveRoute, } from './active-context.js';
8
+ export type { CatalogueEntry, HostEditor, HostEditorsResponse, HostToolLaunchPlan, HostToolProbeEnv, LaunchHostToolResult, Platform, RealPlatform, } from './host-tools.js';
9
+ export { applicableForPlatform, CATALOGUE, currentPlatform, defaultProbeEnv, hostEditorsRoute, launchHostTool, listAvailableEditors, pathDirs, probeCommandOnPath, probeMacBundle, registerHostToolsRoutes, resolveEntry, resolveHostToolLaunchPlan, } from './host-tools.js';
10
+ export type { DaemonShutdownResponse, DaemonStatusDeps, DaemonStatusResponse, } from './daemon-status.js';
11
+ export { daemonShutdownRoute, daemonStatusRoute, registerDaemonStatusRoutes } from './daemon-status.js';
12
+ export type { RunCancelResponse, RunCreateRequest, RunHttpDeps, RunInternalErrorContext, RunListResponse, RunStartContext, RunStartHandler, RunStartResponse, RunStatusResponse, } from './runs.js';
13
+ export { registerRunEventStream, registerRunRoutes, RUN_EVENTS_ROUTE_PATH, runCancelRoute, runListRoute, runStartRoute, runStatusRoute, } from './runs.js';
14
+ export { JINI_ROUTE_MANIFEST, manifestRoutesForFamilies, routeFamilyManifest } from './route-manifest.js';
15
+ export type { AgentListResponse, AgentModelSummary, AgentsHttpDeps, AgentSummary } from './agents.js';
16
+ export { agentListRoute, agentRescanRoute, registerAgentRoutes } from './agents.js';
17
+ export type { MemoryChangeEmitter, MemoryConfigResponse, MemoryDeleteEntryResponse, MemoryEntryInput, MemoryEntryResponse, MemoryExtractionLog, MemoryExtractionsResponse, MemoryHttpDeps, MemoryIndexResponse, MemoryNoteEntry, MemoryNoteEntrySummary, MemoryNoteStore, MemoryNoteStoreOptions, MemoryOverviewResponse, MemoryRemovedResponse, MemoryTreeNode, MemoryTreeNodePatch, MemoryTreeResponse, MemoryUpdateTreeNodeResponse, MemoryVerificationsResponse, MemoryVerifyLog, } from './memory.js';
18
+ export { memoryClearExtractionsRoute, memoryClearVerificationsRoute, memoryCreateEntryRoute, memoryDeleteEntryRoute, memoryListExtractionsRoute, memoryListVerificationsRoute, memoryOverviewRoute, memoryReadEntryRoute, memoryRemoveExtractionRoute, memoryRemoveVerificationRoute, memoryTreeRoute, memoryUpdateEntryRoute, memoryUpdateTreeNodeRoute, memoryWriteConfigRoute, memoryWriteIndexRoute, registerMemoryEventStream, registerMemoryRoutes, } from './memory.js';
19
+ export type { RoutineDeleteResponse, RoutineHttpDeps, RoutineListResponse, RoutineResponse, RoutineRunNowResponse, RoutineRunsResponse, RoutineScheduler, } from './routines.js';
20
+ export { registerRoutineRoutes, routineCreateRoute, routineDeleteRoute, routineGetRoute, routineListRoute, routineRunNowRoute, routineRunsListRoute, routineUpdateRoute, } from './routines.js';
21
+ export type { CreateDaemonDbToolRegistrationsOptions, DaemonDbHttpDeps, DaemonDbInternalErrorContext, DaemonDbOperations, DaemonDbStatusReport, DaemonDbTableInfo, DaemonDbToolRegistrations, DaemonDbVacuumResult, DbIntegrityIssue, DbIntegrityIssueKind, DbIntegrityReport, } from './db-ops.js';
22
+ export { createDaemonDbToolRegistrations, daemonDbInspectRoute, daemonDbVacuumRoute, daemonDbVerifyRoute, DB_INSPECT_TOOL_ID, DB_VACUUM_TOOL_ID, DB_VERIFY_TOOL_ID, denyAllDaemonDbPolicy, registerDaemonDbRoutes, } from './db-ops.js';
23
+ export type { ToolCatalogEntry, ToolCatalogHttpDeps, ToolCatalogQuery, ToolCatalogSearchHit, } from './tool-catalog.js';
24
+ export { registerToolCatalogRoutes, toolCatalogDescribeRoute, toolCatalogSearchRoute, } from './tool-catalog.js';
25
+ export type { ComponentCatalogEntry, ComponentCatalogHttpDeps, ComponentCatalogQuery, ComponentCatalogSearchHit, } from './component-catalog.js';
26
+ export { registerComponentCatalogRoutes, componentCatalogDescribeRoute, componentCatalogSearchRoute, } from './component-catalog.js';
27
+ export type { DelegatedToolExecuteRequest, DelegatedToolExecuteResponse, DelegatedToolsHttpDeps, DelegatedToolsInternalErrorContext, } from './delegated-tools.js';
28
+ export { delegatedToolExecuteRoute, registerDelegatedToolRoutes, } from './delegated-tools.js';
29
+ export type { RemoteRunEventHttpDeps, RemoteRunEventResponse, RemoteToolBridgeTokenConfig, RemoteToolResultRequest, RemoteToolUseRequest, } from './remote-run-events.js';
30
+ export { registerRemoteRunEventRoutes, remoteToolResultRoute, remoteToolUseRoute, requireRemoteToolBridgeToken, } from './remote-run-events.js';
31
+ export type { FrontendSessionAttachedEvent, FrontendSessionErrorEvent, FrontendSessionInvocationEvent, FrontendSessionResponseBody, FrontendSessionResponseRequest, FrontendSessionStreamEvent, FrontendSessionsHttpDeps, } from './frontend-sessions.js';
32
+ export { FRONTEND_SESSION_RESPONSE_ROUTE_PATH, FRONTEND_SESSION_STREAM_ROUTE_PATH, frontendSessionResponseRoute, handleFrontendSessionStream, parseCapabilityQuery, registerFrontendSessionRoutes, } from './frontend-sessions.js';
33
+ export { createFrontendControl } from './frontend-control.js';
34
+ export type { CreateFrontendControlOptions, FrontendBindErrorContext, FrontendControl, FrontendHttpExtension, } from './frontend-control.js';
35
+ export type { TerminalActionResponse, TerminalCreateRequest, TerminalListResponse, TerminalsHttpDeps, TerminalsInternalErrorContext, } from './terminals.js';
36
+ export { registerTerminalEventStream, registerTerminalRoutes, terminalCreateRoute, terminalDeleteRoute, terminalKillRoute, terminalListRoute, terminalResizeRoute, terminalStdinRoute, } from './terminals.js';
37
+ export type { ModelProxyHttpDeps, ModelProxyInternalErrorContext } from './model-proxy.js';
38
+ export { registerModelProxyRoutes } from './model-proxy.js';
39
+ export type { HealthHttpDeps, HealthReadinessResult, LivenessResponse, ReadinessResponse, VersionResponse } from './health.js';
40
+ export { apiHealthRoute, apiReadyRoute, apiVersionInfoRoute, healthRoute, readyRoute, registerHealthRoutes, versionInfoRoute, } from './health.js';
41
+ export type { AuthCredentials, AuthProvider, AuthSession, AuthUser, Charge, ChargeInput, ChargeStatus, ConnectorsAuthSessionResponse, ConnectorsAuthUserResponse, ConnectorsAuthVerifyResponse, ConnectorsChargeResponse, ConnectorsDbQueryResponse, ConnectorsDbRecordResponse, ConnectorsHttpDeps, ConnectorsInternalErrorContext, ConnectorsOkResponse, ConnectorsStorageGetResponse, ConnectorsStorageListResponse, ConnectorsStorageMetaResponse, DbProvider, DbQuery, DbRecord, PaymentsProvider, RealtimeProvider, StorageObjectMeta, StorageProvider, StoragePutOptions, } from './connectors.js';
42
+ export { connectorsAuthSessionRoute, connectorsAuthSignInRoute, connectorsAuthSignOutRoute, connectorsAuthSignUpRoute, connectorsDbDeleteRoute, connectorsDbGetRoute, connectorsDbInsertRoute, connectorsDbQueryRoute, connectorsDbUpdateRoute, connectorsPaymentsChargeRoute, connectorsPaymentsGetRoute, connectorsPaymentsRefundRoute, connectorsRealtimePublishRoute, connectorsStorageDeleteRoute, connectorsStorageGetRoute, connectorsStorageListRoute, connectorsStoragePutRoute, registerConnectorsRoutes, } from './connectors.js';
43
+ export type { ResearchHttpDeps, ResearchInternalErrorContext, ResearchProviderCredentials, ResearchSearchResponse, ResearchSource, } from './research.js';
44
+ export { registerResearchRoutes, researchSearchRoute } from './research.js';
45
+ export type { MediaGenerateResponse, MediaHttpDeps, MediaInternalErrorContext, MediaTaskDeleteResponse, MediaTaskListResponse, MediaTaskResponse, } from './media.js';
46
+ export { mediaGenerateRoute, mediaTaskDeleteRoute, mediaTaskGetRoute, mediaTaskListRoute, registerMediaRoutes, } from './media.js';
47
+ export type { AttachmentClaim, AttachmentRejectionReason, AttachmentsHttpDeps, AttachmentsInternalErrorContext, AttachmentStore, AttachmentUploadResponse, CreateDiskAttachmentStoreOptions, ObservedAttachmentIdentity, PendingAttachmentSummary, RecordedAttachmentIdentity, StoredAttachment, } from './attachments.js';
48
+ export { ATTACHMENTS_ROUTE_PATH, AttachmentRejectedError, createDiskAttachmentStore, detectAttachmentKind, handleAttachmentCleanup, handleAttachmentUpload, isUnchangedAttachment, registerAttachmentRoutes, sanitizeAttachmentName, writeBoundedAttachmentBody, } from './attachments.js';
49
+ export type { XaiAuthStatusResponse, XaiHttpDeps, XaiInternalErrorContext, XaiOauthStartResponse, XaiOkResponse, XaiSearchResponse, } from './xai.js';
50
+ export { registerXaiRoutes, xaiAuthStatusRoute, xaiOauthCancelRoute, xaiOauthCompleteRoute, xaiOauthDisconnectRoute, xaiOauthStartRoute, xaiSearchRoute, } from './xai.js';
51
+ export * from './run-credentials.js';
52
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,27 @@
1
+ export { denyAllWorkspaceRoots, resolveWorkspaceRoot, WorkspaceRootDeniedError } from './workspace-root.js';
2
+ export { cancelRunsOwnedBy } from './cancel-owned-runs.js';
3
+ export { ACTIVE_CONTEXT_TTL_MS, getActiveRoute, registerActiveContextRoutes, setActiveRoute, } from './active-context.js';
4
+ export { applicableForPlatform, CATALOGUE, currentPlatform, defaultProbeEnv, hostEditorsRoute, launchHostTool, listAvailableEditors, pathDirs, probeCommandOnPath, probeMacBundle, registerHostToolsRoutes, resolveEntry, resolveHostToolLaunchPlan, } from './host-tools.js';
5
+ export { daemonShutdownRoute, daemonStatusRoute, registerDaemonStatusRoutes } from './daemon-status.js';
6
+ export { registerRunEventStream, registerRunRoutes, RUN_EVENTS_ROUTE_PATH, runCancelRoute, runListRoute, runStartRoute, runStatusRoute, } from './runs.js';
7
+ export { JINI_ROUTE_MANIFEST, manifestRoutesForFamilies, routeFamilyManifest } from './route-manifest.js';
8
+ export { agentListRoute, agentRescanRoute, registerAgentRoutes } from './agents.js';
9
+ export { memoryClearExtractionsRoute, memoryClearVerificationsRoute, memoryCreateEntryRoute, memoryDeleteEntryRoute, memoryListExtractionsRoute, memoryListVerificationsRoute, memoryOverviewRoute, memoryReadEntryRoute, memoryRemoveExtractionRoute, memoryRemoveVerificationRoute, memoryTreeRoute, memoryUpdateEntryRoute, memoryUpdateTreeNodeRoute, memoryWriteConfigRoute, memoryWriteIndexRoute, registerMemoryEventStream, registerMemoryRoutes, } from './memory.js';
10
+ export { registerRoutineRoutes, routineCreateRoute, routineDeleteRoute, routineGetRoute, routineListRoute, routineRunNowRoute, routineRunsListRoute, routineUpdateRoute, } from './routines.js';
11
+ export { createDaemonDbToolRegistrations, daemonDbInspectRoute, daemonDbVacuumRoute, daemonDbVerifyRoute, DB_INSPECT_TOOL_ID, DB_VACUUM_TOOL_ID, DB_VERIFY_TOOL_ID, denyAllDaemonDbPolicy, registerDaemonDbRoutes, } from './db-ops.js';
12
+ export { registerToolCatalogRoutes, toolCatalogDescribeRoute, toolCatalogSearchRoute, } from './tool-catalog.js';
13
+ export { registerComponentCatalogRoutes, componentCatalogDescribeRoute, componentCatalogSearchRoute, } from './component-catalog.js';
14
+ export { delegatedToolExecuteRoute, registerDelegatedToolRoutes, } from './delegated-tools.js';
15
+ export { registerRemoteRunEventRoutes, remoteToolResultRoute, remoteToolUseRoute, requireRemoteToolBridgeToken, } from './remote-run-events.js';
16
+ export { FRONTEND_SESSION_RESPONSE_ROUTE_PATH, FRONTEND_SESSION_STREAM_ROUTE_PATH, frontendSessionResponseRoute, handleFrontendSessionStream, parseCapabilityQuery, registerFrontendSessionRoutes, } from './frontend-sessions.js';
17
+ export { createFrontendControl } from './frontend-control.js';
18
+ export { registerTerminalEventStream, registerTerminalRoutes, terminalCreateRoute, terminalDeleteRoute, terminalKillRoute, terminalListRoute, terminalResizeRoute, terminalStdinRoute, } from './terminals.js';
19
+ export { registerModelProxyRoutes } from './model-proxy.js';
20
+ export { apiHealthRoute, apiReadyRoute, apiVersionInfoRoute, healthRoute, readyRoute, registerHealthRoutes, versionInfoRoute, } from './health.js';
21
+ export { connectorsAuthSessionRoute, connectorsAuthSignInRoute, connectorsAuthSignOutRoute, connectorsAuthSignUpRoute, connectorsDbDeleteRoute, connectorsDbGetRoute, connectorsDbInsertRoute, connectorsDbQueryRoute, connectorsDbUpdateRoute, connectorsPaymentsChargeRoute, connectorsPaymentsGetRoute, connectorsPaymentsRefundRoute, connectorsRealtimePublishRoute, connectorsStorageDeleteRoute, connectorsStorageGetRoute, connectorsStorageListRoute, connectorsStoragePutRoute, registerConnectorsRoutes, } from './connectors.js';
22
+ export { registerResearchRoutes, researchSearchRoute } from './research.js';
23
+ export { mediaGenerateRoute, mediaTaskDeleteRoute, mediaTaskGetRoute, mediaTaskListRoute, registerMediaRoutes, } from './media.js';
24
+ export { ATTACHMENTS_ROUTE_PATH, AttachmentRejectedError, createDiskAttachmentStore, detectAttachmentKind, handleAttachmentCleanup, handleAttachmentUpload, isUnchangedAttachment, registerAttachmentRoutes, sanitizeAttachmentName, writeBoundedAttachmentBody, } from './attachments.js';
25
+ export { registerXaiRoutes, xaiAuthStatusRoute, xaiOauthCancelRoute, xaiOauthCompleteRoute, xaiOauthDisconnectRoute, xaiOauthStartRoute, xaiSearchRoute, } from './xai.js';
26
+ export * from './run-credentials.js';
27
+ //# sourceMappingURL=index.js.map