@opengeni/sdk 0.25.0 → 0.25.5
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/README.md +52 -0
- package/dist/index.d.ts +82 -10
- package/dist/index.js +209 -64
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/client.ts +200 -56
- package/src/errors.ts +75 -19
- package/src/index.ts +9 -0
- package/src/types.ts +63 -2
package/src/types.ts
CHANGED
|
@@ -276,6 +276,18 @@ export type SessionToolPolicy = {
|
|
|
276
276
|
inheritedFromSessionId: string | null;
|
|
277
277
|
};
|
|
278
278
|
|
|
279
|
+
export type UpdateSessionToolPolicyRequest =
|
|
280
|
+
| {
|
|
281
|
+
mode: "workspace_default";
|
|
282
|
+
expectedVersion: number;
|
|
283
|
+
}
|
|
284
|
+
| {
|
|
285
|
+
/** Omitted for compatibility with the original explicit-only API. */
|
|
286
|
+
mode?: "explicit" | undefined;
|
|
287
|
+
tools: ToolRef[];
|
|
288
|
+
expectedVersion: number;
|
|
289
|
+
};
|
|
290
|
+
|
|
279
291
|
export type SessionEffectiveToolPolicy = {
|
|
280
292
|
mode: SessionToolPolicy["mode"];
|
|
281
293
|
inheritedFromSessionId: string | null;
|
|
@@ -472,6 +484,7 @@ export type Session = {
|
|
|
472
484
|
resources: ResourceRef[];
|
|
473
485
|
tools: ToolRef[];
|
|
474
486
|
toolPolicy?: SessionToolPolicy | undefined;
|
|
487
|
+
toolPolicyVersion?: number | undefined;
|
|
475
488
|
effectiveToolPolicy?: SessionEffectiveToolPolicy | undefined;
|
|
476
489
|
metadata: Record<string, unknown>;
|
|
477
490
|
/** Frozen creator fact; later turns carry their own independent initiator. */
|
|
@@ -762,6 +775,7 @@ export const SESSION_EVENT_TYPES = [
|
|
|
762
775
|
"terminal.pty.exited",
|
|
763
776
|
"session.title_set",
|
|
764
777
|
"session.mcp.approval_policy.updated",
|
|
778
|
+
"session.tool_policy.updated",
|
|
765
779
|
// Multi-account Codex (P1): the session's inference account changed.
|
|
766
780
|
"codex.account.switched",
|
|
767
781
|
// credential allocator metadata-only per-turn credential selection audit.
|
|
@@ -1993,6 +2007,8 @@ export type ClientAuthConfig =
|
|
|
1993
2007
|
// parity suite. The SDK has no runtime dependency on the Zod contracts package.
|
|
1994
2008
|
export const OPENGENI_API_CONTRACT_REVISION = "2026-07-turn-instructions-v1" as const;
|
|
1995
2009
|
export const OPENGENI_API_CONTRACT_HEADER = "x-opengeni-api-contract" as const;
|
|
2010
|
+
/** Bounded request/response identifier shared by browser, ingress, and API diagnostics. */
|
|
2011
|
+
export const OPENGENI_CORRELATION_HEADER = "x-opengeni-correlation-id" as const;
|
|
1996
2012
|
|
|
1997
2013
|
/**
|
|
1998
2014
|
* Public, unauthenticated-by-default client bootstrap config returned by
|
|
@@ -2324,6 +2340,8 @@ export type NewSessionDraft = {
|
|
|
2324
2340
|
text: string;
|
|
2325
2341
|
resources: ResourceRef[];
|
|
2326
2342
|
tools: ToolRef[];
|
|
2343
|
+
/** False inherits the workspace-default MCP policy; true preserves an explicit array. */
|
|
2344
|
+
toolsProvided: boolean;
|
|
2327
2345
|
model: string;
|
|
2328
2346
|
reasoningEffort: ReasoningEffort;
|
|
2329
2347
|
options: NewSessionDraftOptions;
|
|
@@ -2823,6 +2841,19 @@ export type KnowledgeSourceKind =
|
|
|
2823
2841
|
| "other";
|
|
2824
2842
|
export type DocumentSearchMode = "hybrid" | "vector" | "keyword";
|
|
2825
2843
|
|
|
2844
|
+
export type DocumentVisibility = "workspace" | "private";
|
|
2845
|
+
|
|
2846
|
+
export type DocumentCurationStatus = "none" | "pending" | "suggested" | "auto_filed" | "failed";
|
|
2847
|
+
|
|
2848
|
+
export type DocumentCuration = {
|
|
2849
|
+
suggestedBaseId: string | null;
|
|
2850
|
+
suggestedBaseName: string | null;
|
|
2851
|
+
confidence: number;
|
|
2852
|
+
reason: string | null;
|
|
2853
|
+
originalTitle: string | null;
|
|
2854
|
+
model: string | null;
|
|
2855
|
+
};
|
|
2856
|
+
|
|
2826
2857
|
export type DocumentBase = {
|
|
2827
2858
|
id: string;
|
|
2828
2859
|
workspaceId: string;
|
|
@@ -2851,6 +2882,13 @@ export type Document = {
|
|
|
2851
2882
|
sourceUpdatedAt: string | null;
|
|
2852
2883
|
sourceVersion: string | null;
|
|
2853
2884
|
aclTags: string[];
|
|
2885
|
+
visibility: DocumentVisibility;
|
|
2886
|
+
createdBy: string | null;
|
|
2887
|
+
agentAccess: boolean;
|
|
2888
|
+
summary: string | null;
|
|
2889
|
+
topics: string[];
|
|
2890
|
+
curationStatus: DocumentCurationStatus;
|
|
2891
|
+
curation: DocumentCuration | null;
|
|
2854
2892
|
createdAt: string;
|
|
2855
2893
|
updatedAt: string;
|
|
2856
2894
|
};
|
|
@@ -2897,6 +2935,21 @@ export type AddDocumentRequest = {
|
|
|
2897
2935
|
sourceUpdatedAt?: string | undefined;
|
|
2898
2936
|
sourceVersion?: string | undefined;
|
|
2899
2937
|
aclTags?: string[] | undefined;
|
|
2938
|
+
visibility?: DocumentVisibility | undefined;
|
|
2939
|
+
agentAccess?: boolean | undefined;
|
|
2940
|
+
};
|
|
2941
|
+
|
|
2942
|
+
export type CreateKnowledgeDropRequest = {
|
|
2943
|
+
text?: string | undefined;
|
|
2944
|
+
fileId?: string | undefined;
|
|
2945
|
+
filename?: string | undefined;
|
|
2946
|
+
title?: string | undefined;
|
|
2947
|
+
visibility?: DocumentVisibility | undefined;
|
|
2948
|
+
agentAccess?: boolean | undefined;
|
|
2949
|
+
};
|
|
2950
|
+
|
|
2951
|
+
export type MoveDocumentRequest = {
|
|
2952
|
+
targetBaseId?: string | undefined;
|
|
2900
2953
|
};
|
|
2901
2954
|
|
|
2902
2955
|
export type DocumentSearchRequest = {
|
|
@@ -3333,10 +3386,16 @@ export type GitHubRepository = {
|
|
|
3333
3386
|
|
|
3334
3387
|
export type GitHubRepositoryScope = "all" | "selected";
|
|
3335
3388
|
|
|
3389
|
+
export type GitHubBindingStatus = "disabled" | "unbound" | "bound";
|
|
3390
|
+
|
|
3391
|
+
export type GitHubInstallationLifecycle = "active" | "suspended" | "deleted" | "unverified";
|
|
3392
|
+
|
|
3336
3393
|
export type GitHubInstallationBinding = {
|
|
3337
3394
|
installationId: number;
|
|
3395
|
+
githubAccountId: number | null;
|
|
3338
3396
|
accountLogin: string | null;
|
|
3339
3397
|
accountType: string | null;
|
|
3398
|
+
lifecycle: GitHubInstallationLifecycle;
|
|
3340
3399
|
repositoryScope: GitHubRepositoryScope;
|
|
3341
3400
|
repositoryCount: number;
|
|
3342
3401
|
createdAt: string;
|
|
@@ -3345,12 +3404,14 @@ export type GitHubInstallationBinding = {
|
|
|
3345
3404
|
|
|
3346
3405
|
export type GitHubAppInfo = {
|
|
3347
3406
|
configured: boolean;
|
|
3407
|
+
/** Truthful workspace binding state; server App credentials alone are not a binding. */
|
|
3408
|
+
status: GitHubBindingStatus;
|
|
3348
3409
|
appId: string | null;
|
|
3349
3410
|
clientId: string | null;
|
|
3350
3411
|
appSlug: string | null;
|
|
3351
|
-
/**
|
|
3412
|
+
/** Fresh GitHub-controlled installation/configuration consent entry point. */
|
|
3352
3413
|
installUrl: string | null;
|
|
3353
|
-
/**
|
|
3414
|
+
/** Compatibility alias for installUrl; no repository-admin chooser is exposed. */
|
|
3354
3415
|
linkUrl: string | null;
|
|
3355
3416
|
/** Installation bindings owned independently by this workspace. */
|
|
3356
3417
|
installations: GitHubInstallationBinding[];
|