@opengeni/api-router 0.5.4 → 0.5.6
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/app.d.ts +9 -1
- package/dist/app.js +7 -1
- package/dist/{chunk-DO2G3JSB.js → chunk-HBEJMWD3.js} +528 -270
- package/dist/chunk-HBEJMWD3.js.map +1 -0
- package/dist/index.js +8 -27
- package/dist/index.js.map +1 -1
- package/package.json +10 -10
- package/src/app.ts +180 -31
- package/src/http/sse.ts +57 -2
- package/src/index.ts +8 -27
- package/src/mcp/server.ts +167 -85
- package/src/routes/sessions.ts +141 -109
- package/src/routes/workspaces.ts +30 -43
- package/dist/chunk-DO2G3JSB.js.map +0 -1
package/dist/app.d.ts
CHANGED
|
@@ -7,10 +7,18 @@ import { EventBus } from '@opengeni/events';
|
|
|
7
7
|
|
|
8
8
|
declare function sseSessionStream(db: Database, bus: EventBus, workspaceId: string, sessionId: string, after: number, signal: AbortSignal): Promise<Response>;
|
|
9
9
|
declare function replaySessionEvents(loadPage: (after: number, limit: number) => Promise<SessionEvent[]>, send: (event: SessionEvent) => Promise<void>, after: number, pageSize?: number): Promise<void>;
|
|
10
|
+
declare function sseWorkspaceControlStream(db: Database, bus: EventBus, workspaceId: string, after: number, signal: AbortSignal): Promise<Response>;
|
|
10
11
|
|
|
12
|
+
declare const API_MAX_REQUEST_BODY_BYTES: number;
|
|
11
13
|
declare function createApp(deps: AppDependencies): Hono;
|
|
12
14
|
declare function allowedCorsOrigin(pattern: string, origin: string): boolean;
|
|
13
15
|
declare function httpStatusForError(error: unknown): number;
|
|
14
16
|
declare function routeLabel(pathname: string): string;
|
|
17
|
+
/**
|
|
18
|
+
* State-changing OpenGeni HTTP calls must never cross an incompatible rollout
|
|
19
|
+
* boundary. Standard third-party protocols and externally initiated callbacks
|
|
20
|
+
* are intentionally outside this product API contract.
|
|
21
|
+
*/
|
|
22
|
+
declare function isApiContractProtectedMutation(method: string, pathname: string): boolean;
|
|
15
23
|
|
|
16
|
-
export { allowedCorsOrigin, createApp, httpStatusForError, replaySessionEvents, routeLabel, sseSessionStream };
|
|
24
|
+
export { API_MAX_REQUEST_BODY_BYTES, allowedCorsOrigin, createApp, httpStatusForError, isApiContractProtectedMutation, replaySessionEvents, routeLabel, sseSessionStream, sseWorkspaceControlStream };
|
package/dist/app.js
CHANGED
|
@@ -1,30 +1,36 @@
|
|
|
1
1
|
import {
|
|
2
|
+
API_MAX_REQUEST_BODY_BYTES,
|
|
2
3
|
allowedCorsOrigin,
|
|
3
4
|
createApp,
|
|
4
5
|
httpStatusForError,
|
|
6
|
+
isApiContractProtectedMutation,
|
|
5
7
|
mergeResourceRefs,
|
|
6
8
|
mergeToolRefs,
|
|
7
9
|
normalizeResources,
|
|
8
10
|
replaySessionEvents,
|
|
9
11
|
routeLabel,
|
|
10
12
|
sseSessionStream,
|
|
13
|
+
sseWorkspaceControlStream,
|
|
11
14
|
validateFileResources,
|
|
12
15
|
validateGitHubRepositorySelection,
|
|
13
16
|
validateGitHubRepositorySelectionShape,
|
|
14
17
|
validateToolRefs,
|
|
15
18
|
withDefaultEnabledCapabilityMcpTools,
|
|
16
19
|
workflowIdForSession
|
|
17
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-HBEJMWD3.js";
|
|
18
21
|
export {
|
|
22
|
+
API_MAX_REQUEST_BODY_BYTES,
|
|
19
23
|
allowedCorsOrigin,
|
|
20
24
|
createApp,
|
|
21
25
|
httpStatusForError,
|
|
26
|
+
isApiContractProtectedMutation,
|
|
22
27
|
mergeResourceRefs,
|
|
23
28
|
mergeToolRefs,
|
|
24
29
|
normalizeResources,
|
|
25
30
|
replaySessionEvents,
|
|
26
31
|
routeLabel,
|
|
27
32
|
sseSessionStream,
|
|
33
|
+
sseWorkspaceControlStream,
|
|
28
34
|
validateFileResources,
|
|
29
35
|
validateGitHubRepositorySelection,
|
|
30
36
|
validateGitHubRepositorySelectionShape,
|