@opengeni/sdk 3.3.2 → 3.7.0-canary.0

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 (76) hide show
  1. package/README.md +80 -6
  2. package/dist/artifact-client.d.ts +4 -2
  3. package/dist/artifacts.d.ts +1 -1
  4. package/dist/artifacts.js +6 -6
  5. package/dist/browser.d.ts +5 -2
  6. package/dist/browser.js +14 -4
  7. package/dist/{chunk-YXQX7RQT.js → chunk-2E2BFEEN.js} +2 -2
  8. package/dist/{chunk-JUS2UYRP.js → chunk-3QDQTYOE.js} +3 -1
  9. package/dist/chunk-3QDQTYOE.js.map +1 -0
  10. package/dist/{chunk-C2H7HBNP.js → chunk-7S2MZ65L.js} +6 -6
  11. package/dist/chunk-FMLDFJ2Q.js +246 -0
  12. package/dist/chunk-FMLDFJ2Q.js.map +1 -0
  13. package/dist/{chunk-TRNI7KEO.js → chunk-IQTEPOI3.js} +228 -26
  14. package/dist/chunk-IQTEPOI3.js.map +1 -0
  15. package/dist/chunk-IRAEPLXG.js +350 -0
  16. package/dist/chunk-IRAEPLXG.js.map +1 -0
  17. package/dist/{chunk-QT3KFVDP.js → chunk-MPGVC7EO.js} +10 -2
  18. package/dist/chunk-MPGVC7EO.js.map +1 -0
  19. package/dist/{chunk-C4DJPZRU.js → chunk-OO5LPTO7.js} +14 -1
  20. package/dist/chunk-OO5LPTO7.js.map +1 -0
  21. package/dist/{chunk-KKRO2VCP.js → chunk-QTBAMHEF.js} +2 -2
  22. package/dist/client.d.ts +51 -11
  23. package/dist/codex-realtime-controller.js +2 -2
  24. package/dist/core.d.ts +5 -2
  25. package/dist/core.js +17 -7
  26. package/dist/document-authority.js +5 -5
  27. package/dist/editable-artifacts.js +4 -4
  28. package/dist/errors.d.ts +12 -0
  29. package/dist/github-repositories.d.ts +10 -0
  30. package/dist/github-repositories.js +36 -0
  31. package/dist/github-repositories.js.map +1 -0
  32. package/dist/index.d.ts +13 -6
  33. package/dist/index.js +99 -52
  34. package/dist/index.js.map +1 -1
  35. package/dist/interaction.js +2 -2
  36. package/dist/model-context.d.ts +49 -0
  37. package/dist/model-picker-order.d.ts +1 -0
  38. package/dist/model-picker-order.js +10 -0
  39. package/dist/model-picker-order.js.map +1 -0
  40. package/dist/proxy.d.ts +7 -5
  41. package/dist/realtime.js +2 -2
  42. package/dist/session-titles.d.ts +2 -28
  43. package/dist/site.d.ts +93 -0
  44. package/dist/site.js +35 -0
  45. package/dist/site.js.map +1 -0
  46. package/dist/stream.d.ts +2 -0
  47. package/dist/tools-FSTY4FAY.js +12 -0
  48. package/dist/tools-FSTY4FAY.js.map +1 -0
  49. package/dist/tools.d.ts +61 -0
  50. package/dist/types.d.ts +231 -9
  51. package/dist/workspace-artifacts.d.ts +26 -1
  52. package/package.json +14 -2
  53. package/src/artifact-client.ts +16 -1
  54. package/src/artifacts.ts +1 -0
  55. package/src/browser.ts +16 -0
  56. package/src/client.ts +332 -22
  57. package/src/core.ts +16 -0
  58. package/src/errors.ts +23 -0
  59. package/src/github-repositories.ts +60 -0
  60. package/src/index.ts +94 -1
  61. package/src/model-context.ts +69 -0
  62. package/src/model-picker-order.ts +6 -0
  63. package/src/proxy.ts +17 -6
  64. package/src/session-titles.ts +8 -82
  65. package/src/site.ts +544 -0
  66. package/src/stream.ts +29 -8
  67. package/src/tools.ts +396 -0
  68. package/src/types.ts +287 -10
  69. package/src/workspace-artifacts.ts +33 -2
  70. package/dist/chunk-C4DJPZRU.js.map +0 -1
  71. package/dist/chunk-JUS2UYRP.js.map +0 -1
  72. package/dist/chunk-QT3KFVDP.js.map +0 -1
  73. package/dist/chunk-TRNI7KEO.js.map +0 -1
  74. /package/dist/{chunk-YXQX7RQT.js.map → chunk-2E2BFEEN.js.map} +0 -0
  75. /package/dist/{chunk-C2H7HBNP.js.map → chunk-7S2MZ65L.js.map} +0 -0
  76. /package/dist/{chunk-KKRO2VCP.js.map → chunk-QTBAMHEF.js.map} +0 -0
@@ -0,0 +1,49 @@
1
+ export type ModelContextInstructionLayerId = "operational_contract" | "persona_and_core" | "workspace_governance" | "session_instructions" | "workspace_memory" | "codemode" | "git_bindings" | "genesis_title" | "sdk_capability_instructions" | "sandbox_preamble" | "sandbox_filesystem" | "sent_system_instructions";
2
+ export type ModelContextInstructionLayer = {
3
+ id: ModelContextInstructionLayerId;
4
+ title: string;
5
+ content: string;
6
+ utf8Bytes: number;
7
+ estimatedTokens: number;
8
+ };
9
+ export type ModelContextToolVisibility = "eager" | "searchable";
10
+ export type ModelContextTool = {
11
+ name: string;
12
+ type: string;
13
+ visibility: ModelContextToolVisibility;
14
+ description?: string | undefined;
15
+ namespace?: string | undefined;
16
+ schema?: unknown | undefined;
17
+ utf8Bytes: number;
18
+ estimatedTokens: number;
19
+ };
20
+ export type ModelContextSkillKind = "preference_descriptor" | "runtime_skill" | "native_tool_skill";
21
+ export type ModelContextSkill = {
22
+ kind: ModelContextSkillKind;
23
+ name: string;
24
+ description: string;
25
+ source?: string | undefined;
26
+ path?: string | undefined;
27
+ };
28
+ export type ModelContextTokenCounts = {
29
+ instructions: number;
30
+ tools: number;
31
+ prefix: number;
32
+ };
33
+ export type ModelContextSnapshot = {
34
+ version: 1;
35
+ capturedAt: string;
36
+ source: "model_request";
37
+ requestIndex: number;
38
+ instructions: string;
39
+ layers: ModelContextInstructionLayer[];
40
+ tools: ModelContextTool[];
41
+ skills: ModelContextSkill[];
42
+ tokens: ModelContextTokenCounts;
43
+ };
44
+ export type SessionModelContextResponse = {
45
+ sessionId: string;
46
+ attemptId: string | null;
47
+ turnId: string | null;
48
+ snapshot: ModelContextSnapshot | null;
49
+ };
@@ -0,0 +1 @@
1
+ export { compareModelPickerOrder, modelPickerBillingClassFor, type ModelPickerBillingCandidate, type ModelPickerBillingClass, } from "@opengeni/contracts/model-picker-order";
@@ -0,0 +1,10 @@
1
+ // src/model-picker-order.ts
2
+ import {
3
+ compareModelPickerOrder,
4
+ modelPickerBillingClassFor
5
+ } from "@opengeni/contracts/model-picker-order";
6
+ export {
7
+ compareModelPickerOrder,
8
+ modelPickerBillingClassFor
9
+ };
10
+ //# sourceMappingURL=model-picker-order.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/model-picker-order.ts"],"sourcesContent":["export {\n compareModelPickerOrder,\n modelPickerBillingClassFor,\n type ModelPickerBillingCandidate,\n type ModelPickerBillingClass,\n} from \"@opengeni/contracts/model-picker-order\";\n"],"mappings":";AAAA;AAAA,EACE;AAAA,EACA;AAAA,OAGK;","names":[]}
package/dist/proxy.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { OpenGeniClient } from "./client.js";
2
- import type { StreamSessionEventsOptions } from "./stream.js";
2
+ import { type StreamSessionEventsOptions } from "./stream.js";
3
3
  import type { SessionEvent } from "./types.js";
4
4
  /**
5
5
  * Proxy-through-your-own-API helpers.
@@ -11,9 +11,10 @@ import type { SessionEvent } from "./types.js";
11
11
  * OpenGeni's own SSE stream (`id: <sequence>`, `event: <type>`,
12
12
  * `data: <event JSON>`), so the browser side can consume it with this same
13
13
  * SDK's streaming core (or a plain `EventSource`), including resume via
14
- * `?after=` / `Last-Event-ID`.
14
+ * `?after=` / `Last-Event-ID`. An ordinary event uses its own sequence as the
15
+ * SSE `id`; a compact event uses the server-owned sequence it covers through.
15
16
  */
16
- /** Format one event exactly as OpenGeni's API emits it over SSE. */
17
+ /** Format one event with the exact OpenGeni data and resume-cursor semantics. */
17
18
  export declare function formatSseEvent(event: SessionEvent): string;
18
19
  export type SseReStreamOptions = {
19
20
  /**
@@ -38,8 +39,9 @@ export declare function sessionEventsToSseStream(events: AsyncIterable<SessionEv
38
39
  export declare function sessionEventsToSseResponse(events: AsyncIterable<SessionEvent>, options?: SseReStreamOptions): Response;
39
40
  /**
40
41
  * Read the resume cursor a reconnecting SSE client sent: the `after` query
41
- * parameter, or the standard `Last-Event-ID` header (the re-emitted stream
42
- * sets `id:` to the sequence). Returns 0 (full replay) when absent.
42
+ * parameter, or the standard `Last-Event-ID` header. Re-emitted streams set
43
+ * `id:` to the event sequence for ordinary events and the covered high-water
44
+ * sequence for compact events. Returns 0 (full replay) when absent.
43
45
  */
44
46
  export declare function resumeSequenceFromRequest(request: Request): number;
45
47
  export type ProxySessionEventStreamOptions = Omit<StreamSessionEventsOptions, "after"> & {
package/dist/realtime.js CHANGED
@@ -27,8 +27,8 @@ import {
27
27
  sessionRealtimeOwnerStorageKey,
28
28
  sessionRealtimeOwnerStorageNamespace,
29
29
  startCodexRealtimeWebrtc
30
- } from "./chunk-C2H7HBNP.js";
31
- import "./chunk-C4DJPZRU.js";
30
+ } from "./chunk-7S2MZ65L.js";
31
+ import "./chunk-OO5LPTO7.js";
32
32
 
33
33
  // src/realtime.ts
34
34
  function sessionRealtimeTransportKind(model) {
@@ -1,28 +1,2 @@
1
- import { AUTOMATIC_SESSION_TITLE_FALLBACK } from "@opengeni/contracts/session-titles";
2
- import type { Session } from "./types.js";
3
- export { AUTOMATIC_SESSION_TITLE_FALLBACK };
4
- export type SessionDisplayTitleInput = {
5
- title?: Session["title"] | undefined;
6
- titleSource?: Session["titleSource"] | undefined;
7
- initialMessage?: Session["initialMessage"] | null | undefined;
8
- metadata?: Readonly<Record<string, unknown>> | undefined;
9
- };
10
- export type SessionDisplayTitleOptions = {
11
- /** Optional metadata fields to try before the opening-prompt preview. */
12
- metadataKeys?: readonly string[] | undefined;
13
- };
14
- /**
15
- * Whether the durable title still represents the automatic-title pending state.
16
- * A user-authored title always wins, even when its literal value is the fallback.
17
- */
18
- export declare function sessionTitleIsPending(input: SessionDisplayTitleInput): boolean;
19
- /**
20
- * Derive the title a client should display for a session.
21
- *
22
- * A semantic agent title or human rename wins. While automatic naming is still
23
- * pending, clients show a short, sensitive-safe preview of the opening prompt;
24
- * the preview is never persisted as title metadata and is replaced naturally
25
- * when `session.title_set` arrives. Obvious credential-, URL-, or identifier-
26
- * shaped prompt prefixes retain the generic fallback.
27
- */
28
- export declare function deriveSessionDisplayTitle(input: SessionDisplayTitleInput, options?: SessionDisplayTitleOptions): string;
1
+ export { AUTOMATIC_SESSION_TITLE_FALLBACK, deriveAutomaticSessionTitlePreview, deriveSessionDisplayTitle, sessionTitleIsPending, } from "@opengeni/contracts/session-titles";
2
+ export type { SessionDisplayTitleInput, SessionDisplayTitleOptions, } from "@opengeni/contracts/session-titles";
package/dist/site.d.ts ADDED
@@ -0,0 +1,93 @@
1
+ import { type OpenGeniWorkspaceTools } from "./tools.js";
2
+ import type { ToolGatewayCallRequest, ToolGatewayCallResponse, ToolGatewayCatalog, ToolGatewayDeclarationsResponse } from "./types.js";
3
+ export declare const OPENGENI_SITE_BRIDGE_VERSION: 2;
4
+ export declare const OPENGENI_SITE_BRIDGE_CONNECT: "opengeni.site.connect";
5
+ export declare const OPENGENI_SITE_BRIDGE_READY: "opengeni.site.ready";
6
+ export declare const OPENGENI_SITE_BRIDGE_REQUEST: "opengeni.site.request";
7
+ export declare const OPENGENI_SITE_BRIDGE_RESPONSE: "opengeni.site.response";
8
+ export declare const OPENGENI_SITE_BRIDGE_CANCEL: "opengeni.site.cancel";
9
+ export declare const OPENGENI_SITE_BRIDGE_BOOTSTRAP_GLOBAL: "__opengeniSiteBridgeBootstrapV2";
10
+ export declare const OPENGENI_SITE_LOCAL_CODEMODE_PATH: "/__opengeni/site-tools";
11
+ export type OpenGeniSiteBridgeConnectMessage = {
12
+ type: typeof OPENGENI_SITE_BRIDGE_CONNECT;
13
+ version: typeof OPENGENI_SITE_BRIDGE_VERSION;
14
+ };
15
+ export type OpenGeniSiteBridgeReadyMessage = {
16
+ type: typeof OPENGENI_SITE_BRIDGE_READY;
17
+ version: typeof OPENGENI_SITE_BRIDGE_VERSION;
18
+ };
19
+ /** Site-originated calls cannot carry host-only approval tokens or Site-version authority. */
20
+ export type OpenGeniSiteToolCallRequest = Omit<ToolGatewayCallRequest, "approvalToken" | "siteArtifactId" | "siteVersionId">;
21
+ /** Host-filtered catalog projection. Tenant routing context never enters Site code. */
22
+ export type OpenGeniSiteToolCatalog = Omit<ToolGatewayCatalog, "accountId" | "workspaceId">;
23
+ export type OpenGeniSiteWorkspaceTools = OpenGeniWorkspaceTools<OpenGeniSiteToolCatalog>;
24
+ export type OpenGeniSiteBridgeRequestMessage = {
25
+ type: typeof OPENGENI_SITE_BRIDGE_REQUEST;
26
+ version: typeof OPENGENI_SITE_BRIDGE_VERSION;
27
+ requestId: string;
28
+ } & ({
29
+ method: "catalog";
30
+ } | {
31
+ method: "call";
32
+ payload: OpenGeniSiteToolCallRequest;
33
+ } | {
34
+ method: "declarations";
35
+ });
36
+ export type OpenGeniSiteBridgeCancelMessage = {
37
+ type: typeof OPENGENI_SITE_BRIDGE_CANCEL;
38
+ version: typeof OPENGENI_SITE_BRIDGE_VERSION;
39
+ requestId: string;
40
+ };
41
+ export type OpenGeniSiteBridgeResponseMessage = {
42
+ type: typeof OPENGENI_SITE_BRIDGE_RESPONSE;
43
+ version: typeof OPENGENI_SITE_BRIDGE_VERSION;
44
+ requestId: string;
45
+ } & ({
46
+ ok: true;
47
+ value: OpenGeniSiteToolCatalog | ToolGatewayCallResponse | ToolGatewayDeclarationsResponse;
48
+ } | {
49
+ ok: false;
50
+ error: {
51
+ code: string;
52
+ message: string;
53
+ retryable: boolean;
54
+ outcomeUnknown?: boolean;
55
+ };
56
+ });
57
+ export type OpenGeniSiteClient = {
58
+ /** Workspace-bound typed facade. The parent host owns workspace identity and credentials. */
59
+ readonly tools: OpenGeniSiteWorkspaceTools;
60
+ close(): void;
61
+ };
62
+ export type OpenGeniSiteClientOptions = {
63
+ /** Advanced embedding seam; ordinary Sites accept bootstrap only from their exact parent. */
64
+ parentWindow?: MessageEventSource;
65
+ /** Advanced embedding seam for listening to the host's document-bound bootstrap message. */
66
+ siteWindow?: Pick<Window, "parent" | "addEventListener" | "removeEventListener">;
67
+ /** Test/embedding seam for an already document-bound host bootstrap port. */
68
+ bootstrapPort?: MessagePort;
69
+ connectTimeoutMs?: number;
70
+ requestTimeoutMs?: number;
71
+ createMessageChannel?: () => MessageChannel;
72
+ /** Local-preview seam. Top-level pages use this same-origin Codemode proxy automatically. */
73
+ localCodemodePath?: string | false;
74
+ /** Test/embedding seam for local-preview requests. */
75
+ fetch?: typeof globalThis.fetch;
76
+ };
77
+ export declare class OpenGeniSiteBridgeError extends Error {
78
+ readonly code: string;
79
+ readonly retryable: boolean;
80
+ readonly outcomeUnknown: boolean;
81
+ constructor(code: string, message: string, retryable?: boolean, outcomeUnknown?: boolean);
82
+ }
83
+ /**
84
+ * Create the browser client used by a Site. Published iframes use the parent
85
+ * MessagePort; top-level sandbox previews use the same-origin Codemode adapter.
86
+ * Credentials remain in the selected host and never enter Site code.
87
+ */
88
+ export declare function createOpenGeniSiteClient(options?: OpenGeniSiteClientOptions): OpenGeniSiteClient;
89
+ export declare function isOpenGeniSiteBridgeConnectMessage(value: unknown): value is OpenGeniSiteBridgeConnectMessage;
90
+ export declare function isOpenGeniSiteBridgeRequestMessage(value: unknown): value is OpenGeniSiteBridgeRequestMessage;
91
+ export declare function isOpenGeniSiteBridgeCancelMessage(value: unknown): value is OpenGeniSiteBridgeCancelMessage;
92
+ /** Strip every host-only field before a call crosses the Site boundary. */
93
+ export declare function sanitizeOpenGeniSiteToolCallRequest(value: ToolGatewayCallRequest): OpenGeniSiteToolCallRequest;
package/dist/site.js ADDED
@@ -0,0 +1,35 @@
1
+ import {
2
+ OPENGENI_SITE_BRIDGE_BOOTSTRAP_GLOBAL,
3
+ OPENGENI_SITE_BRIDGE_CANCEL,
4
+ OPENGENI_SITE_BRIDGE_CONNECT,
5
+ OPENGENI_SITE_BRIDGE_READY,
6
+ OPENGENI_SITE_BRIDGE_REQUEST,
7
+ OPENGENI_SITE_BRIDGE_RESPONSE,
8
+ OPENGENI_SITE_BRIDGE_VERSION,
9
+ OPENGENI_SITE_LOCAL_CODEMODE_PATH,
10
+ OpenGeniSiteBridgeError,
11
+ createOpenGeniSiteClient,
12
+ isOpenGeniSiteBridgeCancelMessage,
13
+ isOpenGeniSiteBridgeConnectMessage,
14
+ isOpenGeniSiteBridgeRequestMessage,
15
+ sanitizeOpenGeniSiteToolCallRequest
16
+ } from "./chunk-IRAEPLXG.js";
17
+ import "./chunk-FMLDFJ2Q.js";
18
+ import "./chunk-OO5LPTO7.js";
19
+ export {
20
+ OPENGENI_SITE_BRIDGE_BOOTSTRAP_GLOBAL,
21
+ OPENGENI_SITE_BRIDGE_CANCEL,
22
+ OPENGENI_SITE_BRIDGE_CONNECT,
23
+ OPENGENI_SITE_BRIDGE_READY,
24
+ OPENGENI_SITE_BRIDGE_REQUEST,
25
+ OPENGENI_SITE_BRIDGE_RESPONSE,
26
+ OPENGENI_SITE_BRIDGE_VERSION,
27
+ OPENGENI_SITE_LOCAL_CODEMODE_PATH,
28
+ OpenGeniSiteBridgeError,
29
+ createOpenGeniSiteClient,
30
+ isOpenGeniSiteBridgeCancelMessage,
31
+ isOpenGeniSiteBridgeConnectMessage,
32
+ isOpenGeniSiteBridgeRequestMessage,
33
+ sanitizeOpenGeniSiteToolCallRequest
34
+ };
35
+ //# sourceMappingURL=site.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
package/dist/stream.d.ts CHANGED
@@ -61,3 +61,5 @@ export declare function streamSessionEvents(transport: SessionEventStreamTranspo
61
61
  export declare function runBeforeLive(beforeLive: (() => void | Promise<void>) | undefined, timeoutMs: number, signal: AbortSignal | undefined): Promise<void>;
62
62
  export declare function jitteredDelay(delayMs: number, ratio: number): number;
63
63
  export declare function withStreamInactivityTimeout(stream: ReadableStream<Uint8Array>, timeoutMs: number, signal: AbortSignal | undefined): ReadableStream<Uint8Array>;
64
+ /** Trusted SSE coverage attached non-enumerably to a streamed event. */
65
+ export declare function sessionEventStreamCoveredThrough(event: SessionEvent): number | null;
@@ -0,0 +1,12 @@
1
+ import {
2
+ OpenGeniToolCallError,
3
+ OpenGeniToolReapprovalRequiredError,
4
+ OpenGeniToolsClient
5
+ } from "./chunk-FMLDFJ2Q.js";
6
+ import "./chunk-OO5LPTO7.js";
7
+ export {
8
+ OpenGeniToolCallError,
9
+ OpenGeniToolReapprovalRequiredError,
10
+ OpenGeniToolsClient
11
+ };
12
+ //# sourceMappingURL=tools-FSTY4FAY.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,61 @@
1
+ import type { ToolGatewayApprovalResponse, ToolGatewayCatalog, ToolGatewayDeclarationsResponse, ToolGatewayIdentity, ToolGatewayResult } from "./types.js";
2
+ export type OpenGeniToolCallOptions = {
3
+ operationId?: string;
4
+ signal?: AbortSignal;
5
+ refreshCatalog?: boolean;
6
+ /** Server-issued, single-use capability returned by `$approve`. */
7
+ approvalToken?: string;
8
+ };
9
+ export type OpenGeniToolFunction<TArguments extends Record<string, unknown> = Record<string, unknown>, TResult = unknown> = (argumentsValue?: TArguments, options?: OpenGeniToolCallOptions) => Promise<TResult>;
10
+ export interface OpenGeniDynamicToolNamespace {
11
+ readonly [key: string]: OpenGeniDynamicToolNode;
12
+ }
13
+ export type OpenGeniDynamicToolNode = OpenGeniDynamicToolNamespace & OpenGeniToolFunction;
14
+ /** Declaration-generation target for one exact workspace catalog. */
15
+ export interface OpenGeniGeneratedTools {
16
+ }
17
+ export type OpenGeniWorkspaceTools<TCatalog extends Pick<ToolGatewayCatalog, "version" | "generation" | "digest" | "createdAt" | "entries"> = ToolGatewayCatalog> = OpenGeniGeneratedTools & OpenGeniDynamicToolNamespace & {
18
+ readonly $catalog: (options?: {
19
+ refresh?: boolean;
20
+ signal?: AbortSignal;
21
+ }) => Promise<TCatalog>;
22
+ readonly $call: (identity: ToolGatewayIdentity, argumentsValue?: Record<string, unknown>, options?: OpenGeniToolCallOptions) => Promise<unknown>;
23
+ readonly $approve: (identity: ToolGatewayIdentity, argumentsValue?: Record<string, unknown>, options?: {
24
+ operationId?: string;
25
+ signal?: AbortSignal;
26
+ }) => Promise<ToolGatewayApprovalResponse>;
27
+ readonly $declarations: (options?: {
28
+ signal?: AbortSignal;
29
+ }) => Promise<ToolGatewayDeclarationsResponse>;
30
+ };
31
+ export interface OpenGeniToolTransport {
32
+ requestJson<T>(method: string, path: string, body?: unknown, query?: Record<string, string>, options?: {
33
+ signal?: AbortSignal;
34
+ timeoutMs?: number;
35
+ }): Promise<T>;
36
+ }
37
+ export interface OpenGeniToolsFacade {
38
+ forWorkspace(workspaceId: string): OpenGeniWorkspaceTools;
39
+ }
40
+ export declare class OpenGeniToolCallError extends Error {
41
+ readonly result: ToolGatewayResult;
42
+ readonly code: string;
43
+ readonly retryable: boolean;
44
+ readonly outcomeUnknown: boolean;
45
+ constructor(result: ToolGatewayResult);
46
+ }
47
+ /** A catalog refresh invalidated the single-use approval capability for this call. */
48
+ export declare class OpenGeniToolReapprovalRequiredError extends Error {
49
+ readonly operationId: string;
50
+ readonly previousCatalogDigest: string;
51
+ readonly catalogDigest: string;
52
+ readonly identity: ToolGatewayIdentity;
53
+ readonly code: "tool_reapproval_required";
54
+ readonly retryable = false;
55
+ constructor(operationId: string, previousCatalogDigest: string, catalogDigest: string, identity: ToolGatewayIdentity);
56
+ }
57
+ export declare class OpenGeniToolsClient implements OpenGeniToolsFacade {
58
+ private readonly transport;
59
+ constructor(transport: OpenGeniToolTransport);
60
+ forWorkspace(workspaceId: string): OpenGeniWorkspaceTools;
61
+ }