@opengeni/sdk 1.0.2 → 1.1.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.
- package/dist/adapters/next.js +2 -2
- package/dist/artifact-catalog.d.ts +7 -0
- package/dist/artifacts.js +4 -4
- package/dist/browser.js +2 -2
- package/dist/chat/index.js +8 -7
- package/dist/chat/index.js.map +1 -1
- package/dist/{chunk-FG3OO5LM.js → chunk-BNZNLUD4.js} +12 -2
- package/dist/chunk-BNZNLUD4.js.map +1 -0
- package/dist/{chunk-AH5D5Q5V.js → chunk-E3KHK7FG.js} +2 -2
- package/dist/{chunk-MOTJYIYL.js → chunk-H6WMYN23.js} +2 -2
- package/dist/{chunk-YIKA2QT4.js → chunk-RLLUZFOW.js} +1 -1
- package/dist/{chunk-YIKA2QT4.js.map → chunk-RLLUZFOW.js.map} +1 -1
- package/dist/{chunk-DUVIYER4.js → chunk-T6HNHCN2.js} +2 -2
- package/dist/{chunk-RWKB6YZG.js → chunk-YH3W3HZZ.js} +2 -2
- package/dist/{chunk-HMGADJGZ.js → chunk-ZBMS2HCV.js} +2 -2
- package/dist/client.d.ts +5 -1
- package/dist/core.js +3 -3
- package/dist/document-authority.js +3 -3
- package/dist/editable-artifacts.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +7 -7
- package/dist/session-proxy.js +2 -2
- package/dist/site-browser-runtime.gen.d.ts +1 -1
- package/dist/site-document.js +1 -1
- package/dist/site-document.js.map +1 -1
- package/dist/site.js +3 -3
- package/dist/types.d.ts +1 -1
- package/package.json +5 -4
- package/src/artifact-catalog.ts +8 -0
- package/src/chat/opengeni.ts +3 -2
- package/src/client.ts +23 -1
- package/src/index.ts +1 -0
- package/src/site-browser-runtime.gen.ts +1 -1
- package/src/types.ts +1 -0
- package/dist/chunk-FG3OO5LM.js.map +0 -1
- /package/dist/{chunk-AH5D5Q5V.js.map → chunk-E3KHK7FG.js.map} +0 -0
- /package/dist/{chunk-MOTJYIYL.js.map → chunk-H6WMYN23.js.map} +0 -0
- /package/dist/{chunk-DUVIYER4.js.map → chunk-T6HNHCN2.js.map} +0 -0
- /package/dist/{chunk-RWKB6YZG.js.map → chunk-YH3W3HZZ.js.map} +0 -0
- /package/dist/{chunk-HMGADJGZ.js.map → chunk-ZBMS2HCV.js.map} +0 -0
package/dist/site.js
CHANGED
|
@@ -18,11 +18,11 @@ import {
|
|
|
18
18
|
sanitizeOpenGeniSiteToolCallRequest,
|
|
19
19
|
serveSiteHttp,
|
|
20
20
|
siteSessionPath
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-T6HNHCN2.js";
|
|
22
22
|
import "./chunk-4SMEOV3P.js";
|
|
23
|
-
import "./chunk-
|
|
23
|
+
import "./chunk-BNZNLUD4.js";
|
|
24
24
|
import "./chunk-APXVSSSY.js";
|
|
25
|
-
import "./chunk-
|
|
25
|
+
import "./chunk-RLLUZFOW.js";
|
|
26
26
|
import "./chunk-NC57YMUO.js";
|
|
27
27
|
import "./chunk-V6GIY62B.js";
|
|
28
28
|
export {
|
package/dist/types.d.ts
CHANGED
|
@@ -4976,7 +4976,7 @@ export type ScheduledTaskRunAwaitingHuman = {
|
|
|
4976
4976
|
};
|
|
4977
4977
|
export type ScheduledTaskAdmissionRefusal = {
|
|
4978
4978
|
version: 1;
|
|
4979
|
-
reason: "scheduled_authority_unavailable" | "machine_target_unavailable" | "machine_enrollment_inactive" | "variable_set_unavailable" | "rig_version_unavailable" | "insufficient_credits" | "monthly_model_cost_limit" | "monthly_agent_run_limit" | (string & {});
|
|
4979
|
+
reason: "scheduled_authority_unavailable" | "machine_target_unavailable" | "machine_enrollment_inactive" | "variable_set_unavailable" | "rig_version_unavailable" | "scheduled_model_unavailable" | "insufficient_credits" | "monthly_model_cost_limit" | "monthly_agent_run_limit" | (string & {});
|
|
4980
4980
|
retryable: boolean;
|
|
4981
4981
|
};
|
|
4982
4982
|
export type ScheduledTaskAccessFailureReason = "missing_connection" | "expired" | "insufficient_scope" | "refresh_failed" | "personal_authority_unavailable" | "unsupported_auth" | "resource_scope_unavailable";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengeni/sdk",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "Framework-agnostic TypeScript SDK for the OpenGeni API: typed client, session lifecycle, SSE event streaming with reconnect + replay-by-sequence, and proxy re-streaming helpers.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -165,7 +165,8 @@
|
|
|
165
165
|
"./session-list-entries": {
|
|
166
166
|
"types": "./dist/session-list-entries.d.ts",
|
|
167
167
|
"import": "./dist/session-list-entries.js"
|
|
168
|
-
}
|
|
168
|
+
},
|
|
169
|
+
"./package.json": "./package.json"
|
|
169
170
|
},
|
|
170
171
|
"publishConfig": {
|
|
171
172
|
"access": "public",
|
|
@@ -177,8 +178,8 @@
|
|
|
177
178
|
"prepublishOnly": "bash ../../scripts/prepublish-guard"
|
|
178
179
|
},
|
|
179
180
|
"dependencies": {
|
|
180
|
-
"@opengeni/connect": "1.0
|
|
181
|
-
"@opengeni/contracts": "1.0
|
|
181
|
+
"@opengeni/connect": "1.1.0",
|
|
182
|
+
"@opengeni/contracts": "1.1.0"
|
|
182
183
|
},
|
|
183
184
|
"engines": {
|
|
184
185
|
"node": ">=18"
|
package/src/artifact-catalog.ts
CHANGED
|
@@ -16,6 +16,8 @@ export type ArtifactCatalogItem = {
|
|
|
16
16
|
createdAt: string;
|
|
17
17
|
updatedAt: string;
|
|
18
18
|
status: "active" | "archived";
|
|
19
|
+
/** Shared workspace pin; absent on older servers. Never grants content access. */
|
|
20
|
+
pinned?: boolean;
|
|
19
21
|
/** Present only when the viewer can read this session. */
|
|
20
22
|
sourceSessionId?: string;
|
|
21
23
|
versionId?: string;
|
|
@@ -39,3 +41,9 @@ export type ArtifactCatalogListResponse = {
|
|
|
39
41
|
items: ArtifactCatalogItem[];
|
|
40
42
|
nextCursor: string | null;
|
|
41
43
|
};
|
|
44
|
+
|
|
45
|
+
export type ArtifactPinResponse = {
|
|
46
|
+
kind: ArtifactCatalogKind;
|
|
47
|
+
artifactId: string;
|
|
48
|
+
pinned: boolean;
|
|
49
|
+
};
|
package/src/chat/opengeni.ts
CHANGED
|
@@ -76,11 +76,12 @@ export class OpenGeni {
|
|
|
76
76
|
constructor(options: OpenGeniOptions) {
|
|
77
77
|
if (!options.apiKey) throw new TypeError("Opengeni requires an apiKey.");
|
|
78
78
|
this.client = new OpenGeniClient({
|
|
79
|
-
|
|
79
|
+
// An empty value (a blank `OPENGENI_API_BASE_URL=` in .env) means the default.
|
|
80
|
+
baseUrl: options.baseUrl?.trim() || DEFAULT_OPENGENI_BASE_URL,
|
|
80
81
|
apiKey: options.apiKey,
|
|
81
82
|
...(options.fetch ? { fetch: options.fetch } : {}),
|
|
82
83
|
});
|
|
83
|
-
this.organizationId = options.organizationId ?? "";
|
|
84
|
+
this.organizationId = options.organizationId?.trim() ?? "";
|
|
84
85
|
this.source = options.source ?? DEFAULT_CHAT_SOURCE;
|
|
85
86
|
this.resolveWorkspaceId = createWorkspaceIdResolver(this.client, {
|
|
86
87
|
organizationId: () => this.resolveOrganizationId(),
|
package/src/client.ts
CHANGED
|
@@ -5,7 +5,12 @@ import type {
|
|
|
5
5
|
ClaudeSubscriptionSetupTokenRequest,
|
|
6
6
|
SubscriptionPoolSettings,
|
|
7
7
|
} from "@opengeni/contracts";
|
|
8
|
-
import type {
|
|
8
|
+
import type {
|
|
9
|
+
ArtifactCatalogKind,
|
|
10
|
+
ArtifactCatalogListOptions,
|
|
11
|
+
ArtifactCatalogListResponse,
|
|
12
|
+
ArtifactPinResponse,
|
|
13
|
+
} from "./artifact-catalog";
|
|
9
14
|
import type {
|
|
10
15
|
SessionMessageSearchRequest,
|
|
11
16
|
SessionMessageSearchResponse,
|
|
@@ -7589,6 +7594,23 @@ export class OpenGeniClient {
|
|
|
7589
7594
|
);
|
|
7590
7595
|
}
|
|
7591
7596
|
|
|
7597
|
+
/** Idempotently set a workspace-shared pin; refresh the catalog after completion. */
|
|
7598
|
+
async updateArtifactPin(
|
|
7599
|
+
workspaceId: string,
|
|
7600
|
+
kind: ArtifactCatalogKind,
|
|
7601
|
+
artifactId: string,
|
|
7602
|
+
pinned: boolean,
|
|
7603
|
+
options: { signal?: AbortSignal } = {},
|
|
7604
|
+
): Promise<ArtifactPinResponse> {
|
|
7605
|
+
return this.requestJson<ArtifactPinResponse>(
|
|
7606
|
+
"PUT",
|
|
7607
|
+
`/v1/workspaces/${encodeURIComponent(workspaceId)}/artifact-catalog/${encodeURIComponent(kind)}/${encodeURIComponent(artifactId)}/pin`,
|
|
7608
|
+
{ pinned },
|
|
7609
|
+
undefined,
|
|
7610
|
+
options,
|
|
7611
|
+
);
|
|
7612
|
+
}
|
|
7613
|
+
|
|
7592
7614
|
async listWorkspaceArtifacts(
|
|
7593
7615
|
workspaceId: string,
|
|
7594
7616
|
options: WorkspaceArtifactListOptions & { signal?: AbortSignal } = {},
|