@opengeni/sdk 0.29.0 → 0.33.1
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 +47 -4
- package/dist/artifact-client.d.ts +11 -0
- package/dist/chunk-YROWFD7R.js +2971 -0
- package/dist/chunk-YROWFD7R.js.map +1 -0
- package/dist/client.d.ts +643 -0
- package/dist/core.d.ts +5 -0
- package/dist/core.js +23 -0
- package/dist/core.js.map +1 -0
- package/dist/desktop.d.ts +71 -0
- package/dist/errors.d.ts +39 -0
- package/dist/index.d.ts +26 -4211
- package/dist/index.js +50 -2729
- package/dist/index.js.map +1 -1
- package/dist/mcp-output.d.ts +15 -0
- package/dist/preference-registry.d.ts +169 -0
- package/dist/proxy.d.ts +64 -0
- package/dist/sse.d.ts +14 -0
- package/dist/stream.d.ts +48 -0
- package/dist/terminal.d.ts +49 -0
- package/dist/transcription.d.ts +189 -0
- package/dist/types.d.ts +3221 -0
- package/dist/workspace-artifacts.d.ts +94 -0
- package/dist/workspace-control-stream.d.ts +12 -0
- package/dist/workspace-instruction-policies.d.ts +98 -0
- package/dist/workspace-state.d.ts +122 -0
- package/package.json +7 -3
- package/src/artifact-client.ts +85 -0
- package/src/client.ts +280 -3
- package/src/core.ts +19 -0
- package/src/index.ts +79 -1
- package/src/preference-registry.ts +210 -0
- package/src/transcription.ts +16 -0
- package/src/types.ts +262 -2
- package/src/workspace-artifacts.ts +94 -0
- package/src/workspace-state.ts +134 -0
package/README.md
CHANGED
|
@@ -8,6 +8,11 @@ helpers for proxying the stream through your own API.
|
|
|
8
8
|
Zero runtime dependencies. Needs only WHATWG `fetch` and streams, so it runs in
|
|
9
9
|
Node 18+, Bun, Deno, browsers, and edge runtimes.
|
|
10
10
|
|
|
11
|
+
Browser clients may call the public API from any origin with an API key or
|
|
12
|
+
other bearer credential. Browser cookies are accepted cross-origin only from
|
|
13
|
+
operator-configured trusted origins; arbitrary embedding origins never receive
|
|
14
|
+
credentialed CORS responses.
|
|
15
|
+
|
|
11
16
|
## Quick start
|
|
12
17
|
|
|
13
18
|
```ts
|
|
@@ -32,7 +37,37 @@ for await (const event of client.streamEvents(workspaceId, session.id)) {
|
|
|
32
37
|
}
|
|
33
38
|
```
|
|
34
39
|
|
|
35
|
-
|
|
40
|
+
## Workspace artifacts
|
|
41
|
+
|
|
42
|
+
Workspace artifacts are generic, immutable HTML publications. The SDK does not
|
|
43
|
+
assign product types such as app, page, dashboard, or gallery. List pages are
|
|
44
|
+
bounded and expose both `truncated` and an opaque `nextCursor` so callers never
|
|
45
|
+
mistake a partial page for the complete workspace catalog.
|
|
46
|
+
|
|
47
|
+
The initial web renderer supports semantic HTML, inline CSS, CSS-only
|
|
48
|
+
interactions, and inline SVG. It removes JavaScript, event handlers, forms,
|
|
49
|
+
embeds, external URLs, and other active or navigation-capable markup before
|
|
50
|
+
rendering. Executable artifacts require a later, stronger isolation boundary.
|
|
51
|
+
|
|
52
|
+
```ts
|
|
53
|
+
let cursor: string | undefined;
|
|
54
|
+
do {
|
|
55
|
+
const page = await client.listWorkspaceArtifacts(workspaceId, {
|
|
56
|
+
limit: 50,
|
|
57
|
+
...(cursor ? { cursor } : {}),
|
|
58
|
+
});
|
|
59
|
+
for (const artifact of page.artifacts) console.log(artifact.title);
|
|
60
|
+
cursor = page.nextCursor ?? undefined;
|
|
61
|
+
} while (cursor);
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Creation and publication require a caller-supplied idempotency key. Reuse the
|
|
65
|
+
same key only to retry the same logical mutation. Agent-authored versions also
|
|
66
|
+
return the exact source session, turn, attempt, and execution generation that
|
|
67
|
+
published them. Version and event history are bounded; inspect
|
|
68
|
+
`versionsTruncated` and `eventsTruncated` on the detail response.
|
|
69
|
+
|
|
70
|
+
Omit `firstPartyMcpTools` for the complete OpenGeni tool catalog. An explicit
|
|
36
71
|
`[]` exposes no broad first-party tools; attached resources and separately
|
|
37
72
|
selected `files`/`docs` MCP servers are unaffected.
|
|
38
73
|
|
|
@@ -210,9 +245,12 @@ await client.sendApprovalDecision(workspaceId, sessionId, { approvalId, decision
|
|
|
210
245
|
## Session tool policy and native web search
|
|
211
246
|
|
|
212
247
|
Omitting `tools` when creating a top-level session selects the current
|
|
213
|
-
workspace-default capability policy
|
|
214
|
-
|
|
215
|
-
|
|
248
|
+
workspace-default capability policy, including the built-in `files` server.
|
|
249
|
+
Passing `tools`, including `[]`, is an intentional fixed narrowing and can
|
|
250
|
+
therefore disable file-download access for that session. OpenGeni's own web UI
|
|
251
|
+
keeps `files` enabled as a hidden default, while API and embedded clients retain
|
|
252
|
+
exact control over the explicit list. Supported Responses providers attach
|
|
253
|
+
their native bounded web-search tool independently of this MCP policy.
|
|
216
254
|
|
|
217
255
|
Existing explicit sessions are not widened when a new default capability is
|
|
218
256
|
introduced. Opt one in explicitly with the current optimistic-concurrency
|
|
@@ -255,6 +293,11 @@ await client.resumeGoal(workspaceId, sessionId); // resets counters, re-arms con
|
|
|
255
293
|
`uploadFile` wraps the three-step flow (begin → signed PUT → complete) in one
|
|
256
294
|
call; the lower-level steps are exported for resumable/custom flows.
|
|
257
295
|
|
|
296
|
+
Browser hosts need no storage credentials or per-application registration.
|
|
297
|
+
OpenGeni authorizes the workspace request and returns a short-lived,
|
|
298
|
+
object-scoped signed URL; operators must configure the private object store to
|
|
299
|
+
allow CORS from `*` so any product embedding the SDK can use that URL.
|
|
300
|
+
|
|
258
301
|
```ts
|
|
259
302
|
const file = await client.uploadFile(workspaceId, {
|
|
260
303
|
filename: "incident-notes.md",
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { OpenGeniClient as OpenGeniCoreClient } from "./client";
|
|
2
|
+
import type { CreateWorkspaceArtifactRequest, PublishWorkspaceArtifactVersionRequest, RollbackWorkspaceArtifactRequest, WorkspaceArtifactContentResponse, WorkspaceArtifactDetailResponse, WorkspaceArtifactListOptions, WorkspaceArtifactListResponse, WorkspaceArtifactMutationResponse } from "./workspace-artifacts";
|
|
3
|
+
/** Public SDK client. Artifact operations stay out of the console's eager core graph. */
|
|
4
|
+
export declare class OpenGeniClient extends OpenGeniCoreClient {
|
|
5
|
+
listWorkspaceArtifacts(workspaceId: string, options?: WorkspaceArtifactListOptions): Promise<WorkspaceArtifactListResponse>;
|
|
6
|
+
getWorkspaceArtifact(workspaceId: string, artifactId: string): Promise<WorkspaceArtifactDetailResponse>;
|
|
7
|
+
getWorkspaceArtifactContent(workspaceId: string, artifactId: string, versionId?: string): Promise<WorkspaceArtifactContentResponse>;
|
|
8
|
+
createWorkspaceArtifact(workspaceId: string, request: CreateWorkspaceArtifactRequest): Promise<WorkspaceArtifactMutationResponse>;
|
|
9
|
+
publishWorkspaceArtifactVersion(workspaceId: string, artifactId: string, request: PublishWorkspaceArtifactVersionRequest): Promise<WorkspaceArtifactMutationResponse>;
|
|
10
|
+
rollbackWorkspaceArtifact(workspaceId: string, artifactId: string, request: RollbackWorkspaceArtifactRequest): Promise<WorkspaceArtifactMutationResponse>;
|
|
11
|
+
}
|