@opengeni/sdk 0.32.1 → 0.34.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 +35 -0
- package/dist/artifact-client.d.ts +11 -0
- package/dist/chunk-54EKPXXP.js +3002 -0
- package/dist/chunk-54EKPXXP.js.map +1 -0
- package/dist/client.d.ts +12 -2
- package/dist/core.d.ts +5 -0
- package/dist/core.js +23 -0
- package/dist/core.js.map +1 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +45 -2916
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +41 -3
- package/dist/workspace-artifacts.d.ts +94 -0
- package/package.json +5 -1
- package/src/artifact-client.ts +85 -0
- package/src/client.ts +43 -1
- package/src/core.ts +19 -0
- package/src/index.ts +14 -1
- package/src/types.ts +57 -2
- package/src/workspace-artifacts.ts +94 -0
package/dist/types.d.ts
CHANGED
|
@@ -387,6 +387,29 @@ export type OAuthStartResponse = {
|
|
|
387
387
|
authorizationUrl: string | null;
|
|
388
388
|
expiresAt: string;
|
|
389
389
|
};
|
|
390
|
+
export type SocialProvider = "x" | "reddit" | "linkedin" | "instagram" | "facebook" | "tiktok" | "youtube" | "custom";
|
|
391
|
+
export type SocialConnectionStatus = "connected" | "needs_reauth" | "disabled";
|
|
392
|
+
export type SocialConnection = {
|
|
393
|
+
id: string;
|
|
394
|
+
accountId: string;
|
|
395
|
+
workspaceId: string;
|
|
396
|
+
provider: SocialProvider;
|
|
397
|
+
accountHandle: string;
|
|
398
|
+
accountName: string | null;
|
|
399
|
+
externalAccountId: string | null;
|
|
400
|
+
status: SocialConnectionStatus;
|
|
401
|
+
scopes: string[];
|
|
402
|
+
credentialRef: string | null;
|
|
403
|
+
tokenMetadata: Record<string, unknown>;
|
|
404
|
+
metadata: Record<string, unknown>;
|
|
405
|
+
createdAt: string;
|
|
406
|
+
updatedAt: string;
|
|
407
|
+
};
|
|
408
|
+
export type SocialOAuthStartRequest = {
|
|
409
|
+
provider: "x" | "reddit";
|
|
410
|
+
scopes?: string[] | undefined;
|
|
411
|
+
returnPath?: string | undefined;
|
|
412
|
+
};
|
|
390
413
|
/** The immutable principal whose authority accepted a session or turn. */
|
|
391
414
|
export type TurnInitiator = {
|
|
392
415
|
kind: "subject" | "service";
|
|
@@ -1312,14 +1335,14 @@ export type CreateSessionRequest = {
|
|
|
1312
1335
|
groupId: string;
|
|
1313
1336
|
} | undefined;
|
|
1314
1337
|
};
|
|
1315
|
-
export declare const KNOWN_PERMISSIONS: readonly ["account:read", "account:admin", "members:manage", "workspace:create", "billing:read", "billing:manage", "workspace:read", "workspace:admin", "sessions:create", "sessions:read", "sessions:control", "stream:view", "stream:control", "stream:acknowledge", "files:upload", "files:read", "files:write", "terminal:attach", "documents:manage", "documents:search", "scheduled_tasks:manage", "scheduled_tasks:run", "github:manage", "github:use", "api_keys:manage", "connections:read", "connections:write", "environments:manage", "environments:use", "variable-sets:manage", "variable-sets:use", "mcp_servers:attach", "toolspace:call", "goals:manage", "enrollments:read", "enrollments:manage", "rigs:use", "rigs:manage"];
|
|
1338
|
+
export declare const KNOWN_PERMISSIONS: readonly ["account:read", "account:admin", "members:manage", "workspace:create", "billing:read", "billing:manage", "workspace:read", "workspace:admin", "sessions:create", "sessions:read", "sessions:control", "stream:view", "stream:control", "stream:acknowledge", "files:upload", "files:read", "files:write", "terminal:attach", "documents:manage", "documents:search", "scheduled_tasks:manage", "scheduled_tasks:run", "github:manage", "github:use", "api_keys:manage", "connections:read", "connections:write", "environments:manage", "environments:use", "variable-sets:manage", "variable-sets:use", "mcp_servers:attach", "toolspace:call", "goals:manage", "enrollments:read", "enrollments:manage", "rigs:use", "rigs:manage", "artifacts:read", "artifacts:publish"];
|
|
1316
1339
|
export type KnownPermission = (typeof KNOWN_PERMISSIONS)[number];
|
|
1317
1340
|
/**
|
|
1318
1341
|
* Permissions the SDK knows about today, kept open so a newer OpenGeni server
|
|
1319
1342
|
* can introduce permissions without breaking older SDK consumers.
|
|
1320
1343
|
*/
|
|
1321
1344
|
export type Permission = KnownPermission | (string & {});
|
|
1322
|
-
export type FirstPartyMcpToolName = "set_session_title" | "goal_set" | "goal_update" | "goal_complete" | "goal_pause" | "memory_search" | "memory_save" | "memory_correct" | "preference_registry_summary" | "preference_registry_get" | "sandboxes_list" | "sandbox_attach" | "sandbox_swap" | "run_on" | "sandbox_provision" | "rig_list" | "rig_get" | "rig_propose_change" | "rig_verify" | "rig_promote" | "sessions_list" | "session_get" | "session_events" | "session_create" | "session_send_message" | "session_pause" | "session_resume" | "session_steer" | "set_other_session_title" | "variable_set_list" | "environment_list" | "variable_set_set_variable" | "environment_set_variable" | "github_connect_link" | "github_token" | "github_repositories_list" | "social_connections_list" | "social_posts_recent" | "social_daily_analysis_context" | "scheduled_tasks_list" | "scheduled_tasks_get" | "scheduled_tasks_create" | "scheduled_tasks_update" | "scheduled_tasks_pause" | "scheduled_tasks_resume" | "scheduled_tasks_trigger" | "scheduled_tasks_delete" | "scheduled_task_runs_list" | "slack_bot_list_channels" | "slack_bot_channel_history" | "slack_bot_thread_replies" | "slack_bot_list_users" | "slack_bot_list_files" | "slack_bot_file_info" | "slack_bot_file_content" | "slack_bot_post_message" | "slack_bot_delete_message";
|
|
1345
|
+
export type FirstPartyMcpToolName = "set_session_title" | "goal_set" | "goal_update" | "goal_complete" | "goal_pause" | "memory_search" | "memory_save" | "memory_correct" | "preference_registry_summary" | "preference_registry_get" | "sandboxes_list" | "sandbox_attach" | "sandbox_swap" | "run_on" | "sandbox_provision" | "rig_list" | "rig_get" | "rig_propose_change" | "rig_verify" | "rig_promote" | "sessions_list" | "session_get" | "session_events" | "session_create" | "session_send_message" | "session_pause" | "session_resume" | "session_steer" | "set_other_session_title" | "variable_set_list" | "environment_list" | "variable_set_set_variable" | "environment_set_variable" | "github_connect_link" | "github_token" | "github_repositories_list" | "social_connections_list" | "social_posts_recent" | "social_daily_analysis_context" | "social_search_live" | "social_mentions_live" | "social_thread_fetch" | "social_posts_sync" | "social_post_reply" | "scheduled_tasks_list" | "scheduled_tasks_get" | "scheduled_tasks_create" | "scheduled_tasks_update" | "scheduled_tasks_pause" | "scheduled_tasks_resume" | "scheduled_tasks_trigger" | "scheduled_tasks_delete" | "scheduled_task_runs_list" | "slack_bot_list_channels" | "slack_bot_channel_history" | "slack_bot_thread_replies" | "slack_bot_list_users" | "slack_bot_list_files" | "slack_bot_file_info" | "slack_bot_file_content" | "slack_bot_post_message" | "slack_bot_delete_message" | "artifacts_list" | "artifacts_get_source" | "artifacts_create" | "artifacts_publish" | "artifacts_rollback";
|
|
1323
1346
|
export type ProductAccessMode = "local" | "configured" | "managed";
|
|
1324
1347
|
export type ModelCapabilitySupportV1 = "supported" | "unsupported" | "unknown";
|
|
1325
1348
|
export type ModelCapabilityStateV1 = {
|
|
@@ -1644,7 +1667,7 @@ export type ClientAuthConfig = {
|
|
|
1644
1667
|
mode: "managedSession";
|
|
1645
1668
|
session: "cookie";
|
|
1646
1669
|
};
|
|
1647
|
-
export declare const OPENGENI_API_CONTRACT_REVISION: "2026-07-
|
|
1670
|
+
export declare const OPENGENI_API_CONTRACT_REVISION: "2026-07-workspace-artifacts-v1";
|
|
1648
1671
|
export declare const OPENGENI_API_CONTRACT_HEADER: "x-opengeni-api-contract";
|
|
1649
1672
|
/** Bounded request/response identifier shared by browser, ingress, and API diagnostics. */
|
|
1650
1673
|
export declare const OPENGENI_CORRELATION_HEADER: "x-opengeni-correlation-id";
|
|
@@ -1676,6 +1699,21 @@ export type ClientConfig = {
|
|
|
1676
1699
|
voiceInput?: ClientVoiceInputConfig | undefined;
|
|
1677
1700
|
productAccessMode: ProductAccessMode;
|
|
1678
1701
|
auth: ClientAuthConfig;
|
|
1702
|
+
analytics: {
|
|
1703
|
+
consentRequired: boolean;
|
|
1704
|
+
providers: {
|
|
1705
|
+
reo?: {
|
|
1706
|
+
clientId: string;
|
|
1707
|
+
} | undefined;
|
|
1708
|
+
posthog?: {
|
|
1709
|
+
projectKey: string;
|
|
1710
|
+
host: string;
|
|
1711
|
+
} | undefined;
|
|
1712
|
+
ga4?: {
|
|
1713
|
+
measurementId: string;
|
|
1714
|
+
} | undefined;
|
|
1715
|
+
};
|
|
1716
|
+
};
|
|
1679
1717
|
structuredServices: {
|
|
1680
1718
|
fileSystem: boolean;
|
|
1681
1719
|
git: boolean;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
export type WorkspaceArtifactVersion = {
|
|
2
|
+
id: string;
|
|
3
|
+
accountId: string;
|
|
4
|
+
workspaceId: string;
|
|
5
|
+
artifactId: string;
|
|
6
|
+
revision: number;
|
|
7
|
+
contentType: "text/html";
|
|
8
|
+
contentSha256: string;
|
|
9
|
+
sizeBytes: number;
|
|
10
|
+
sourceSessionId: string | null;
|
|
11
|
+
sourceTurnId: string | null;
|
|
12
|
+
sourceAttemptId: string | null;
|
|
13
|
+
sourceExecutionGeneration: number | null;
|
|
14
|
+
createdBySubjectId: string;
|
|
15
|
+
createdAt: string;
|
|
16
|
+
};
|
|
17
|
+
export type WorkspaceArtifact = {
|
|
18
|
+
id: string;
|
|
19
|
+
accountId: string;
|
|
20
|
+
workspaceId: string;
|
|
21
|
+
slug: string;
|
|
22
|
+
title: string;
|
|
23
|
+
description: string | null;
|
|
24
|
+
status: "active" | "archived";
|
|
25
|
+
currentVersion: WorkspaceArtifactVersion | null;
|
|
26
|
+
createdBySubjectId: string;
|
|
27
|
+
createdAt: string;
|
|
28
|
+
updatedAt: string;
|
|
29
|
+
};
|
|
30
|
+
export type WorkspaceArtifactEvent = {
|
|
31
|
+
id: string;
|
|
32
|
+
accountId: string;
|
|
33
|
+
workspaceId: string;
|
|
34
|
+
artifactId: string;
|
|
35
|
+
type: "published" | "rolled_back";
|
|
36
|
+
fromVersionId: string | null;
|
|
37
|
+
toVersionId: string;
|
|
38
|
+
sourceSessionId: string | null;
|
|
39
|
+
sourceTurnId: string | null;
|
|
40
|
+
sourceAttemptId: string | null;
|
|
41
|
+
sourceExecutionGeneration: number | null;
|
|
42
|
+
actorSubjectId: string;
|
|
43
|
+
reason: string;
|
|
44
|
+
createdAt: string;
|
|
45
|
+
};
|
|
46
|
+
export type WorkspaceArtifactListOptions = {
|
|
47
|
+
limit?: number;
|
|
48
|
+
cursor?: string;
|
|
49
|
+
};
|
|
50
|
+
export type WorkspaceArtifactListResponse = {
|
|
51
|
+
artifacts: WorkspaceArtifact[];
|
|
52
|
+
nextCursor: string | null;
|
|
53
|
+
truncated: boolean;
|
|
54
|
+
};
|
|
55
|
+
export type WorkspaceArtifactDetailResponse = {
|
|
56
|
+
artifact: WorkspaceArtifact;
|
|
57
|
+
versions: WorkspaceArtifactVersion[];
|
|
58
|
+
events: WorkspaceArtifactEvent[];
|
|
59
|
+
versionsTruncated: boolean;
|
|
60
|
+
eventsTruncated: boolean;
|
|
61
|
+
};
|
|
62
|
+
export type WorkspaceArtifactContentResponse = {
|
|
63
|
+
artifactId: string;
|
|
64
|
+
versionId: string;
|
|
65
|
+
contentType: "text/html";
|
|
66
|
+
contentSha256: string;
|
|
67
|
+
html: string;
|
|
68
|
+
};
|
|
69
|
+
export type WorkspaceArtifactMutationResponse = {
|
|
70
|
+
artifact: WorkspaceArtifact;
|
|
71
|
+
version: WorkspaceArtifactVersion;
|
|
72
|
+
event: WorkspaceArtifactEvent;
|
|
73
|
+
replayed: boolean;
|
|
74
|
+
};
|
|
75
|
+
export type CreateWorkspaceArtifactRequest = {
|
|
76
|
+
slug?: string;
|
|
77
|
+
title: string;
|
|
78
|
+
description?: string | null;
|
|
79
|
+
html: string;
|
|
80
|
+
idempotencyKey: string;
|
|
81
|
+
};
|
|
82
|
+
export type PublishWorkspaceArtifactVersionRequest = {
|
|
83
|
+
title?: string;
|
|
84
|
+
description?: string | null;
|
|
85
|
+
html: string;
|
|
86
|
+
expectedCurrentVersionId: string;
|
|
87
|
+
idempotencyKey: string;
|
|
88
|
+
};
|
|
89
|
+
export type RollbackWorkspaceArtifactRequest = {
|
|
90
|
+
versionId: string;
|
|
91
|
+
expectedCurrentVersionId: string;
|
|
92
|
+
reason: string;
|
|
93
|
+
idempotencyKey: string;
|
|
94
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengeni/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.34.1",
|
|
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": {
|
|
@@ -21,6 +21,10 @@
|
|
|
21
21
|
".": {
|
|
22
22
|
"types": "./dist/index.d.ts",
|
|
23
23
|
"import": "./dist/index.js"
|
|
24
|
+
},
|
|
25
|
+
"./core": {
|
|
26
|
+
"types": "./dist/core.d.ts",
|
|
27
|
+
"import": "./dist/core.js"
|
|
24
28
|
}
|
|
25
29
|
},
|
|
26
30
|
"publishConfig": {
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { OpenGeniClient as OpenGeniCoreClient } from "./client";
|
|
2
|
+
import type {
|
|
3
|
+
CreateWorkspaceArtifactRequest,
|
|
4
|
+
PublishWorkspaceArtifactVersionRequest,
|
|
5
|
+
RollbackWorkspaceArtifactRequest,
|
|
6
|
+
WorkspaceArtifactContentResponse,
|
|
7
|
+
WorkspaceArtifactDetailResponse,
|
|
8
|
+
WorkspaceArtifactListOptions,
|
|
9
|
+
WorkspaceArtifactListResponse,
|
|
10
|
+
WorkspaceArtifactMutationResponse,
|
|
11
|
+
} from "./workspace-artifacts";
|
|
12
|
+
|
|
13
|
+
/** Public SDK client. Artifact operations stay out of the console's eager core graph. */
|
|
14
|
+
export class OpenGeniClient extends OpenGeniCoreClient {
|
|
15
|
+
async listWorkspaceArtifacts(
|
|
16
|
+
workspaceId: string,
|
|
17
|
+
options: WorkspaceArtifactListOptions = {},
|
|
18
|
+
): Promise<WorkspaceArtifactListResponse> {
|
|
19
|
+
const query = new URLSearchParams();
|
|
20
|
+
if (options.limit !== undefined) query.set("limit", String(options.limit));
|
|
21
|
+
if (options.cursor) query.set("cursor", options.cursor);
|
|
22
|
+
const suffix = query.size > 0 ? `?${query.toString()}` : "";
|
|
23
|
+
return await this.requestJson<WorkspaceArtifactListResponse>(
|
|
24
|
+
"GET",
|
|
25
|
+
`/v1/workspaces/${workspaceId}/published-artifacts${suffix}`,
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
async getWorkspaceArtifact(
|
|
30
|
+
workspaceId: string,
|
|
31
|
+
artifactId: string,
|
|
32
|
+
): Promise<WorkspaceArtifactDetailResponse> {
|
|
33
|
+
return await this.requestJson<WorkspaceArtifactDetailResponse>(
|
|
34
|
+
"GET",
|
|
35
|
+
`/v1/workspaces/${workspaceId}/published-artifacts/${encodeURIComponent(artifactId)}`,
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
async getWorkspaceArtifactContent(
|
|
40
|
+
workspaceId: string,
|
|
41
|
+
artifactId: string,
|
|
42
|
+
versionId?: string,
|
|
43
|
+
): Promise<WorkspaceArtifactContentResponse> {
|
|
44
|
+
const query = versionId ? `?versionId=${encodeURIComponent(versionId)}` : "";
|
|
45
|
+
return await this.requestJson<WorkspaceArtifactContentResponse>(
|
|
46
|
+
"GET",
|
|
47
|
+
`/v1/workspaces/${workspaceId}/published-artifacts/${encodeURIComponent(artifactId)}/content${query}`,
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
async createWorkspaceArtifact(
|
|
52
|
+
workspaceId: string,
|
|
53
|
+
request: CreateWorkspaceArtifactRequest,
|
|
54
|
+
): Promise<WorkspaceArtifactMutationResponse> {
|
|
55
|
+
return await this.requestJson<WorkspaceArtifactMutationResponse>(
|
|
56
|
+
"POST",
|
|
57
|
+
`/v1/workspaces/${workspaceId}/published-artifacts`,
|
|
58
|
+
request,
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
async publishWorkspaceArtifactVersion(
|
|
63
|
+
workspaceId: string,
|
|
64
|
+
artifactId: string,
|
|
65
|
+
request: PublishWorkspaceArtifactVersionRequest,
|
|
66
|
+
): Promise<WorkspaceArtifactMutationResponse> {
|
|
67
|
+
return await this.requestJson<WorkspaceArtifactMutationResponse>(
|
|
68
|
+
"POST",
|
|
69
|
+
`/v1/workspaces/${workspaceId}/published-artifacts/${encodeURIComponent(artifactId)}/versions`,
|
|
70
|
+
request,
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
async rollbackWorkspaceArtifact(
|
|
75
|
+
workspaceId: string,
|
|
76
|
+
artifactId: string,
|
|
77
|
+
request: RollbackWorkspaceArtifactRequest,
|
|
78
|
+
): Promise<WorkspaceArtifactMutationResponse> {
|
|
79
|
+
return await this.requestJson<WorkspaceArtifactMutationResponse>(
|
|
80
|
+
"POST",
|
|
81
|
+
`/v1/workspaces/${workspaceId}/published-artifacts/${encodeURIComponent(artifactId)}/rollback`,
|
|
82
|
+
request,
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
}
|
package/src/client.ts
CHANGED
|
@@ -201,6 +201,8 @@ import type {
|
|
|
201
201
|
ConnectionResponse,
|
|
202
202
|
OAuthStartRequest,
|
|
203
203
|
OAuthStartResponse,
|
|
204
|
+
SocialConnection,
|
|
205
|
+
SocialOAuthStartRequest,
|
|
204
206
|
} from "./types";
|
|
205
207
|
import type {
|
|
206
208
|
ActivateWorkspaceInstructionPolicyRequest,
|
|
@@ -2364,6 +2366,11 @@ export class OpenGeniClient {
|
|
|
2364
2366
|
});
|
|
2365
2367
|
const putResponse = await this.fetchImpl(upload.putUrl, {
|
|
2366
2368
|
method: "PUT",
|
|
2369
|
+
// Signed object-storage URLs carry their own short-lived authority.
|
|
2370
|
+
// Browser cookies and HTTP auth must never accompany this cross-origin
|
|
2371
|
+
// request: credentialed fetches are incompatible with wildcard CORS and
|
|
2372
|
+
// can leak ambient credentials to a caller-selected storage endpoint.
|
|
2373
|
+
credentials: "omit",
|
|
2367
2374
|
// The backend's requiredHeaders already carry the canonical lowercase
|
|
2368
2375
|
// `content-type` for every storage backend (Azure/S3/GCS). Do NOT also set
|
|
2369
2376
|
// a `Content-Type` key here: WHATWG Headers treats the two casings as the
|
|
@@ -2862,6 +2869,41 @@ export class OpenGeniClient {
|
|
|
2862
2869
|
);
|
|
2863
2870
|
}
|
|
2864
2871
|
|
|
2872
|
+
/**
|
|
2873
|
+
* Start a first-party social OAuth flow (X / Reddit); redirect the user to
|
|
2874
|
+
* the returned `authorizationUrl`. The completed connection lands in
|
|
2875
|
+
* `listSocialConnections`.
|
|
2876
|
+
*/
|
|
2877
|
+
async startSocialOAuth(
|
|
2878
|
+
workspaceId: string,
|
|
2879
|
+
request: SocialOAuthStartRequest,
|
|
2880
|
+
): Promise<OAuthStartResponse> {
|
|
2881
|
+
return await this.requestJson<OAuthStartResponse>(
|
|
2882
|
+
"POST",
|
|
2883
|
+
`/v1/workspaces/${workspaceId}/social/oauth/start`,
|
|
2884
|
+
request,
|
|
2885
|
+
);
|
|
2886
|
+
}
|
|
2887
|
+
|
|
2888
|
+
/** Connected social accounts (X / Reddit / pushed custom providers). */
|
|
2889
|
+
async listSocialConnections(workspaceId: string): Promise<SocialConnection[]> {
|
|
2890
|
+
return await this.requestJson<SocialConnection[]>(
|
|
2891
|
+
"GET",
|
|
2892
|
+
`/v1/workspaces/${workspaceId}/social/connections`,
|
|
2893
|
+
);
|
|
2894
|
+
}
|
|
2895
|
+
|
|
2896
|
+
/** Drop the stored social OAuth credential and disable the connection. */
|
|
2897
|
+
async disconnectSocialConnection(
|
|
2898
|
+
workspaceId: string,
|
|
2899
|
+
connectionId: string,
|
|
2900
|
+
): Promise<SocialConnection> {
|
|
2901
|
+
return await this.requestJson<SocialConnection>(
|
|
2902
|
+
"DELETE",
|
|
2903
|
+
`/v1/workspaces/${workspaceId}/social/connections/${connectionId}`,
|
|
2904
|
+
);
|
|
2905
|
+
}
|
|
2906
|
+
|
|
2865
2907
|
/** Public, immutably-cached URL for a catalog item's logo, or null when the item has none. */
|
|
2866
2908
|
catalogAssetUrl(logoAssetPath: string | null): string | null {
|
|
2867
2909
|
return logoAssetPath ? `${this.baseUrl}/v1/${logoAssetPath}` : null;
|
|
@@ -3165,7 +3207,7 @@ export class OpenGeniClient {
|
|
|
3165
3207
|
);
|
|
3166
3208
|
}
|
|
3167
3209
|
|
|
3168
|
-
|
|
3210
|
+
protected async requestJson<T>(
|
|
3169
3211
|
method: string,
|
|
3170
3212
|
path: string,
|
|
3171
3213
|
body?: unknown,
|
package/src/core.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export { OpenGeniClient as OpenGeniCoreClient } from "./client";
|
|
2
|
+
export type {
|
|
3
|
+
FetchLike,
|
|
4
|
+
OpenGeniClientOptions,
|
|
5
|
+
OpenGeniRequestOptions,
|
|
6
|
+
SendMessageInput,
|
|
7
|
+
SteerMessageResult,
|
|
8
|
+
TranscribeAudioInput,
|
|
9
|
+
WorkspaceControlEventPage,
|
|
10
|
+
} from "./client";
|
|
11
|
+
export {
|
|
12
|
+
OpenGeniApiContractMismatchError,
|
|
13
|
+
OpenGeniApiError,
|
|
14
|
+
OpenGeniSessionListCursorError,
|
|
15
|
+
OpenGeniStreamError,
|
|
16
|
+
isRetryableStreamError,
|
|
17
|
+
} from "./errors";
|
|
18
|
+
export { resolveWorkspaceVoiceInputEnabled } from "./transcription";
|
|
19
|
+
export { OPENGENI_API_CONTRACT_HEADER, OPENGENI_API_CONTRACT_REVISION } from "./types";
|
package/src/index.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { OpenGeniClient } from "./client";
|
|
1
|
+
export { OpenGeniClient } from "./artifact-client";
|
|
2
2
|
export type {
|
|
3
3
|
FetchLike,
|
|
4
4
|
OpenGeniClientOptions,
|
|
@@ -56,6 +56,19 @@ export type {
|
|
|
56
56
|
} from "./stream";
|
|
57
57
|
export { streamWorkspaceControlEvents } from "./workspace-control-stream";
|
|
58
58
|
export type { WorkspaceControlStreamTransport } from "./workspace-control-stream";
|
|
59
|
+
export type {
|
|
60
|
+
CreateWorkspaceArtifactRequest,
|
|
61
|
+
PublishWorkspaceArtifactVersionRequest,
|
|
62
|
+
RollbackWorkspaceArtifactRequest,
|
|
63
|
+
WorkspaceArtifact,
|
|
64
|
+
WorkspaceArtifactContentResponse,
|
|
65
|
+
WorkspaceArtifactDetailResponse,
|
|
66
|
+
WorkspaceArtifactEvent,
|
|
67
|
+
WorkspaceArtifactListOptions,
|
|
68
|
+
WorkspaceArtifactListResponse,
|
|
69
|
+
WorkspaceArtifactMutationResponse,
|
|
70
|
+
WorkspaceArtifactVersion,
|
|
71
|
+
} from "./workspace-artifacts";
|
|
59
72
|
export { normalizeWorkspaceInstructionPolicyRoleKey } from "./workspace-instruction-policies";
|
|
60
73
|
export type {
|
|
61
74
|
ActivateWorkspaceInstructionPolicyRequest,
|
package/src/types.ts
CHANGED
|
@@ -525,6 +525,41 @@ export type OAuthStartResponse = {
|
|
|
525
525
|
expiresAt: string;
|
|
526
526
|
};
|
|
527
527
|
|
|
528
|
+
export type SocialProvider =
|
|
529
|
+
| "x"
|
|
530
|
+
| "reddit"
|
|
531
|
+
| "linkedin"
|
|
532
|
+
| "instagram"
|
|
533
|
+
| "facebook"
|
|
534
|
+
| "tiktok"
|
|
535
|
+
| "youtube"
|
|
536
|
+
| "custom";
|
|
537
|
+
|
|
538
|
+
export type SocialConnectionStatus = "connected" | "needs_reauth" | "disabled";
|
|
539
|
+
|
|
540
|
+
export type SocialConnection = {
|
|
541
|
+
id: string;
|
|
542
|
+
accountId: string;
|
|
543
|
+
workspaceId: string;
|
|
544
|
+
provider: SocialProvider;
|
|
545
|
+
accountHandle: string;
|
|
546
|
+
accountName: string | null;
|
|
547
|
+
externalAccountId: string | null;
|
|
548
|
+
status: SocialConnectionStatus;
|
|
549
|
+
scopes: string[];
|
|
550
|
+
credentialRef: string | null;
|
|
551
|
+
tokenMetadata: Record<string, unknown>;
|
|
552
|
+
metadata: Record<string, unknown>;
|
|
553
|
+
createdAt: string;
|
|
554
|
+
updatedAt: string;
|
|
555
|
+
};
|
|
556
|
+
|
|
557
|
+
export type SocialOAuthStartRequest = {
|
|
558
|
+
provider: "x" | "reddit";
|
|
559
|
+
scopes?: string[] | undefined;
|
|
560
|
+
returnPath?: string | undefined;
|
|
561
|
+
};
|
|
562
|
+
|
|
528
563
|
/** The immutable principal whose authority accepted a session or turn. */
|
|
529
564
|
export type TurnInitiator = {
|
|
530
565
|
kind: "subject" | "service";
|
|
@@ -1728,6 +1763,8 @@ export const KNOWN_PERMISSIONS = [
|
|
|
1728
1763
|
"enrollments:manage",
|
|
1729
1764
|
"rigs:use",
|
|
1730
1765
|
"rigs:manage",
|
|
1766
|
+
"artifacts:read",
|
|
1767
|
+
"artifacts:publish",
|
|
1731
1768
|
] as const;
|
|
1732
1769
|
|
|
1733
1770
|
export type KnownPermission = (typeof KNOWN_PERMISSIONS)[number];
|
|
@@ -1778,6 +1815,11 @@ export type FirstPartyMcpToolName =
|
|
|
1778
1815
|
| "social_connections_list"
|
|
1779
1816
|
| "social_posts_recent"
|
|
1780
1817
|
| "social_daily_analysis_context"
|
|
1818
|
+
| "social_search_live"
|
|
1819
|
+
| "social_mentions_live"
|
|
1820
|
+
| "social_thread_fetch"
|
|
1821
|
+
| "social_posts_sync"
|
|
1822
|
+
| "social_post_reply"
|
|
1781
1823
|
| "scheduled_tasks_list"
|
|
1782
1824
|
| "scheduled_tasks_get"
|
|
1783
1825
|
| "scheduled_tasks_create"
|
|
@@ -1795,7 +1837,12 @@ export type FirstPartyMcpToolName =
|
|
|
1795
1837
|
| "slack_bot_file_info"
|
|
1796
1838
|
| "slack_bot_file_content"
|
|
1797
1839
|
| "slack_bot_post_message"
|
|
1798
|
-
| "slack_bot_delete_message"
|
|
1840
|
+
| "slack_bot_delete_message"
|
|
1841
|
+
| "artifacts_list"
|
|
1842
|
+
| "artifacts_get_source"
|
|
1843
|
+
| "artifacts_create"
|
|
1844
|
+
| "artifacts_publish"
|
|
1845
|
+
| "artifacts_rollback";
|
|
1799
1846
|
|
|
1800
1847
|
export type ProductAccessMode = "local" | "configured" | "managed";
|
|
1801
1848
|
|
|
@@ -2160,7 +2207,7 @@ export type ClientAuthConfig =
|
|
|
2160
2207
|
|
|
2161
2208
|
// Kept value-identical to @opengeni/contracts and pinned by the SDK contract
|
|
2162
2209
|
// parity suite. The SDK has no runtime dependency on the Zod contracts package.
|
|
2163
|
-
export const OPENGENI_API_CONTRACT_REVISION = "2026-07-
|
|
2210
|
+
export const OPENGENI_API_CONTRACT_REVISION = "2026-07-workspace-artifacts-v1" as const;
|
|
2164
2211
|
export const OPENGENI_API_CONTRACT_HEADER = "x-opengeni-api-contract" as const;
|
|
2165
2212
|
/** Bounded request/response identifier shared by browser, ingress, and API diagnostics. */
|
|
2166
2213
|
export const OPENGENI_CORRELATION_HEADER = "x-opengeni-correlation-id" as const;
|
|
@@ -2187,6 +2234,14 @@ export type ClientConfig = {
|
|
|
2187
2234
|
voiceInput?: ClientVoiceInputConfig | undefined;
|
|
2188
2235
|
productAccessMode: ProductAccessMode;
|
|
2189
2236
|
auth: ClientAuthConfig;
|
|
2237
|
+
analytics: {
|
|
2238
|
+
consentRequired: boolean;
|
|
2239
|
+
providers: {
|
|
2240
|
+
reo?: { clientId: string } | undefined;
|
|
2241
|
+
posthog?: { projectKey: string; host: string } | undefined;
|
|
2242
|
+
ga4?: { measurementId: string } | undefined;
|
|
2243
|
+
};
|
|
2244
|
+
};
|
|
2190
2245
|
// Server-wide hint: does this deployment support Channel-A structured services
|
|
2191
2246
|
// at all (P4.4). Per-session availability is negotiated on /stream-capabilities;
|
|
2192
2247
|
// this is the coarse on/off the client uses to decide whether to even attempt
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
export type WorkspaceArtifactVersion = {
|
|
2
|
+
id: string;
|
|
3
|
+
accountId: string;
|
|
4
|
+
workspaceId: string;
|
|
5
|
+
artifactId: string;
|
|
6
|
+
revision: number;
|
|
7
|
+
contentType: "text/html";
|
|
8
|
+
contentSha256: string;
|
|
9
|
+
sizeBytes: number;
|
|
10
|
+
sourceSessionId: string | null;
|
|
11
|
+
sourceTurnId: string | null;
|
|
12
|
+
sourceAttemptId: string | null;
|
|
13
|
+
sourceExecutionGeneration: number | null;
|
|
14
|
+
createdBySubjectId: string;
|
|
15
|
+
createdAt: string;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export type WorkspaceArtifact = {
|
|
19
|
+
id: string;
|
|
20
|
+
accountId: string;
|
|
21
|
+
workspaceId: string;
|
|
22
|
+
slug: string;
|
|
23
|
+
title: string;
|
|
24
|
+
description: string | null;
|
|
25
|
+
status: "active" | "archived";
|
|
26
|
+
currentVersion: WorkspaceArtifactVersion | null;
|
|
27
|
+
createdBySubjectId: string;
|
|
28
|
+
createdAt: string;
|
|
29
|
+
updatedAt: string;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export type WorkspaceArtifactEvent = {
|
|
33
|
+
id: string;
|
|
34
|
+
accountId: string;
|
|
35
|
+
workspaceId: string;
|
|
36
|
+
artifactId: string;
|
|
37
|
+
type: "published" | "rolled_back";
|
|
38
|
+
fromVersionId: string | null;
|
|
39
|
+
toVersionId: string;
|
|
40
|
+
sourceSessionId: string | null;
|
|
41
|
+
sourceTurnId: string | null;
|
|
42
|
+
sourceAttemptId: string | null;
|
|
43
|
+
sourceExecutionGeneration: number | null;
|
|
44
|
+
actorSubjectId: string;
|
|
45
|
+
reason: string;
|
|
46
|
+
createdAt: string;
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export type WorkspaceArtifactListOptions = { limit?: number; cursor?: string };
|
|
50
|
+
export type WorkspaceArtifactListResponse = {
|
|
51
|
+
artifacts: WorkspaceArtifact[];
|
|
52
|
+
nextCursor: string | null;
|
|
53
|
+
truncated: boolean;
|
|
54
|
+
};
|
|
55
|
+
export type WorkspaceArtifactDetailResponse = {
|
|
56
|
+
artifact: WorkspaceArtifact;
|
|
57
|
+
versions: WorkspaceArtifactVersion[];
|
|
58
|
+
events: WorkspaceArtifactEvent[];
|
|
59
|
+
versionsTruncated: boolean;
|
|
60
|
+
eventsTruncated: boolean;
|
|
61
|
+
};
|
|
62
|
+
export type WorkspaceArtifactContentResponse = {
|
|
63
|
+
artifactId: string;
|
|
64
|
+
versionId: string;
|
|
65
|
+
contentType: "text/html";
|
|
66
|
+
contentSha256: string;
|
|
67
|
+
html: string;
|
|
68
|
+
};
|
|
69
|
+
export type WorkspaceArtifactMutationResponse = {
|
|
70
|
+
artifact: WorkspaceArtifact;
|
|
71
|
+
version: WorkspaceArtifactVersion;
|
|
72
|
+
event: WorkspaceArtifactEvent;
|
|
73
|
+
replayed: boolean;
|
|
74
|
+
};
|
|
75
|
+
export type CreateWorkspaceArtifactRequest = {
|
|
76
|
+
slug?: string;
|
|
77
|
+
title: string;
|
|
78
|
+
description?: string | null;
|
|
79
|
+
html: string;
|
|
80
|
+
idempotencyKey: string;
|
|
81
|
+
};
|
|
82
|
+
export type PublishWorkspaceArtifactVersionRequest = {
|
|
83
|
+
title?: string;
|
|
84
|
+
description?: string | null;
|
|
85
|
+
html: string;
|
|
86
|
+
expectedCurrentVersionId: string;
|
|
87
|
+
idempotencyKey: string;
|
|
88
|
+
};
|
|
89
|
+
export type RollbackWorkspaceArtifactRequest = {
|
|
90
|
+
versionId: string;
|
|
91
|
+
expectedCurrentVersionId: string;
|
|
92
|
+
reason: string;
|
|
93
|
+
idempotencyKey: string;
|
|
94
|
+
};
|