@opengeni/api-router 0.5.7 → 0.7.3

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 CHANGED
@@ -1,13 +1,31 @@
1
1
  import { Hono } from 'hono';
2
2
  import { AppDependencies } from '@opengeni/core';
3
- export { ApiRouteDeps, AppDependencies, DocumentIndexClient, ObjectStorageDependency, SessionWorkflowClient, mergeResourceRefs, mergeToolRefs, normalizeResources, validateFileResources, validateGitHubRepositorySelection, validateGitHubRepositorySelectionShape, validateToolRefs, withDefaultEnabledCapabilityMcpTools, workflowIdForSession } from '@opengeni/core';
3
+ export { ApiRouteDeps, AppDependencies, DocumentIndexClient, ObjectStorageDependency, SessionWorkflowClient, mergeResourceRefs, mergeToolRefs, normalizeResources, validateFileResources, validateGitHubRepositorySelection, validateGitHubRepositorySelectionShape, validateGitHubRepositorySelectionShapes, validateToolRefs, withDefaultEnabledCapabilityMcpTools, workflowIdForSession } from '@opengeni/core';
4
4
  import { SessionEvent } from '@opengeni/contracts';
5
5
  import { Database } from '@opengeni/db';
6
6
  import { EventBus } from '@opengeni/events';
7
+ import { Observability } from '@opengeni/observability';
7
8
 
8
- declare function sseSessionStream(db: Database, bus: EventBus, workspaceId: string, sessionId: string, after: number, signal: AbortSignal): Promise<Response>;
9
+ type SseDeliveryBoundObservation = {
10
+ reason: "desired_size_non_positive" | "stall_timeout" | "frame_too_large";
11
+ desiredSize: number | null;
12
+ queuedFrames: number;
13
+ queuedBytes: number;
14
+ };
15
+ declare function sseSessionStream(db: Database, bus: EventBus, workspaceId: string, sessionId: string, after: number, signal: AbortSignal, options?: SessionSseDeliveryOptions): Promise<Response>;
9
16
  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>;
17
+ declare function sseWorkspaceControlStream(db: Database, bus: EventBus, workspaceId: string, after: number, signal: AbortSignal, options?: SseDeliveryOptions): Promise<Response>;
18
+ type SseDeliveryOptions = {
19
+ maxQueuedBytes?: number;
20
+ stallTimeoutMs?: number;
21
+ observability?: Observability | undefined;
22
+ onObservation?: ((observation: SseDeliveryBoundObservation) => void) | undefined;
23
+ };
24
+ type SessionSseDeliveryOptions = SseDeliveryOptions & {
25
+ /** Host ACL re-check, run even while the event stream is otherwise idle. */
26
+ reauthorize?: (() => Promise<void>) | undefined;
27
+ reauthorizeAfterMs?: number | undefined;
28
+ };
11
29
 
12
30
  declare const API_MAX_REQUEST_BODY_BYTES: number;
13
31
  declare function createApp(deps: AppDependencies): Hono;
package/dist/app.js CHANGED
@@ -14,10 +14,11 @@ import {
14
14
  validateFileResources,
15
15
  validateGitHubRepositorySelection,
16
16
  validateGitHubRepositorySelectionShape,
17
+ validateGitHubRepositorySelectionShapes,
17
18
  validateToolRefs,
18
19
  withDefaultEnabledCapabilityMcpTools,
19
20
  workflowIdForSession
20
- } from "./chunk-HBEJMWD3.js";
21
+ } from "./chunk-EYYTFA7N.js";
21
22
  export {
22
23
  API_MAX_REQUEST_BODY_BYTES,
23
24
  allowedCorsOrigin,
@@ -34,6 +35,7 @@ export {
34
35
  validateFileResources,
35
36
  validateGitHubRepositorySelection,
36
37
  validateGitHubRepositorySelectionShape,
38
+ validateGitHubRepositorySelectionShapes,
37
39
  validateToolRefs,
38
40
  withDefaultEnabledCapabilityMcpTools,
39
41
  workflowIdForSession