@opengeni/sdk 0.27.0 → 0.29.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/README.md +44 -5
- package/dist/index.d.ts +44 -14
- package/dist/index.js +125 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +5 -0
- package/src/mcp-output.ts +161 -0
- package/src/types.ts +84 -12
package/README.md
CHANGED
|
@@ -21,6 +21,8 @@ const client = new OpenGeniClient({
|
|
|
21
21
|
const session = await client.createSession(workspaceId, {
|
|
22
22
|
initialMessage: "Investigate the failing deploy on staging",
|
|
23
23
|
resources: [{ kind: "repository", uri: "https://github.com/acme/app.git", ref: "main" }],
|
|
24
|
+
// Exact model-visible first-party surface; permissions remain independent.
|
|
25
|
+
firstPartyMcpTools: ["set_session_title"],
|
|
24
26
|
});
|
|
25
27
|
|
|
26
28
|
for await (const event of client.streamEvents(workspaceId, session.id)) {
|
|
@@ -30,6 +32,32 @@ for await (const event of client.streamEvents(workspaceId, session.id)) {
|
|
|
30
32
|
}
|
|
31
33
|
```
|
|
32
34
|
|
|
35
|
+
Omit `firstPartyMcpTools` for the minimal self-management default. An explicit
|
|
36
|
+
`[]` exposes no broad first-party tools; attached resources and separately
|
|
37
|
+
selected `files`/`docs` MCP servers are unaffected.
|
|
38
|
+
|
|
39
|
+
## MCP tool output normalization
|
|
40
|
+
|
|
41
|
+
MCP transports and event stores can represent the same tool result as a direct
|
|
42
|
+
object, JSON text, a text content block, or nested `result`,
|
|
43
|
+
`structuredContent`, and `content` envelopes. Use the shared zero-dependency
|
|
44
|
+
normalizer when an embedding host needs one stable interpretation:
|
|
45
|
+
|
|
46
|
+
```ts
|
|
47
|
+
import { normalizeMcpOutput } from "@opengeni/sdk";
|
|
48
|
+
|
|
49
|
+
const normalized = normalizeMcpOutput(toolOutput);
|
|
50
|
+
|
|
51
|
+
normalized.value; // canonical machine-readable value
|
|
52
|
+
normalized.text; // presentation text
|
|
53
|
+
normalized.isError; // preserved across recognized nested envelopes
|
|
54
|
+
normalized.raw; // original evidence
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Malformed text and unknown objects pass through without throwing. Envelope
|
|
58
|
+
recognition is deliberately conservative: an ordinary domain object is not
|
|
59
|
+
unwrapped merely because it has a field named `result`.
|
|
60
|
+
|
|
33
61
|
## Error handling
|
|
34
62
|
|
|
35
63
|
Non-2xx responses throw `OpenGeniApiError` with stable transport metadata:
|
|
@@ -194,14 +222,25 @@ version; the audited change takes effect on its next attempt:
|
|
|
194
222
|
const session = await client.getSession(workspaceId, sessionId);
|
|
195
223
|
const updated = await client.updateSessionToolPolicy(workspaceId, sessionId, {
|
|
196
224
|
mode: "workspace_default",
|
|
197
|
-
expectedVersion: session.toolPolicyVersion
|
|
225
|
+
expectedVersion: session.toolPolicyVersion,
|
|
226
|
+
});
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
To keep a fixed allow-list, replace both connected MCP servers and individual
|
|
230
|
+
OpenGeni tools atomically:
|
|
231
|
+
|
|
232
|
+
```ts
|
|
233
|
+
await client.updateSessionToolPolicy(workspaceId, sessionId, {
|
|
234
|
+
mode: "explicit",
|
|
235
|
+
tools,
|
|
236
|
+
firstPartyMcpTools,
|
|
237
|
+
expectedVersion: session.toolPolicyVersion,
|
|
198
238
|
});
|
|
199
239
|
```
|
|
200
240
|
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
cross-provider, MCP, or sandbox fallback.
|
|
241
|
+
Follow-up Send and Steer requests inherit this session policy and cannot carry
|
|
242
|
+
a private one-turn tool override. `tool_search` discovers deferred MCP schemas;
|
|
243
|
+
it is not public web search.
|
|
205
244
|
|
|
206
245
|
## Goals
|
|
207
246
|
|
package/dist/index.d.ts
CHANGED
|
@@ -355,16 +355,16 @@ type ToolRef = {
|
|
|
355
355
|
optional?: boolean | undefined;
|
|
356
356
|
};
|
|
357
357
|
type SessionToolPolicy = {
|
|
358
|
-
mode: "workspace_default" | "explicit" | "inherited"
|
|
358
|
+
mode: "workspace_default" | "explicit" | "inherited";
|
|
359
359
|
inheritedFromSessionId: string | null;
|
|
360
360
|
};
|
|
361
361
|
type UpdateSessionToolPolicyRequest = {
|
|
362
362
|
mode: "workspace_default";
|
|
363
363
|
expectedVersion: number;
|
|
364
364
|
} | {
|
|
365
|
-
|
|
366
|
-
mode?: "explicit" | undefined;
|
|
365
|
+
mode: "explicit";
|
|
367
366
|
tools: ToolRef[];
|
|
367
|
+
firstPartyMcpTools: FirstPartyMcpToolName[];
|
|
368
368
|
expectedVersion: number;
|
|
369
369
|
};
|
|
370
370
|
type SessionEffectiveToolPolicy = {
|
|
@@ -548,8 +548,8 @@ type Session = {
|
|
|
548
548
|
resources: ResourceRef[];
|
|
549
549
|
skills: SessionSkill[];
|
|
550
550
|
tools: ToolRef[];
|
|
551
|
-
toolPolicy
|
|
552
|
-
toolPolicyVersion
|
|
551
|
+
toolPolicy: SessionToolPolicy;
|
|
552
|
+
toolPolicyVersion: number;
|
|
553
553
|
effectiveToolPolicy?: SessionEffectiveToolPolicy | undefined;
|
|
554
554
|
metadata: Record<string, unknown>;
|
|
555
555
|
/** Frozen creator fact; later turns carry their own independent initiator. */
|
|
@@ -567,6 +567,7 @@ type Session = {
|
|
|
567
567
|
rigId: string | null;
|
|
568
568
|
rigVersionId: string | null;
|
|
569
569
|
firstPartyMcpPermissions: string[] | null;
|
|
570
|
+
firstPartyMcpTools: FirstPartyMcpToolName[];
|
|
570
571
|
mcpServers: SessionMcpServerMetadata[];
|
|
571
572
|
parentSessionId: string | null;
|
|
572
573
|
/** Immutable server-authored nested-agent lineage and policy snapshot. */
|
|
@@ -725,7 +726,7 @@ type SessionHumanInputRequest = {
|
|
|
725
726
|
createdAt: string;
|
|
726
727
|
updatedAt: string;
|
|
727
728
|
};
|
|
728
|
-
declare const SESSION_EVENT_TYPES: readonly ["session.created", "session.event.envelope_omitted", "session.status.changed", "session.requiresAction", "session.humanInput.requested", "session.context.compaction.requested", "session.context.compacted", "session.context.compaction.skipped", "session.context.cleared", "user.message", "user.pause", "user.approvalDecision", "user.humanInputResponse", "turn.queued", "turn.started", "turn.completed", "turn.failed", "turn.cancelled", "turn.superseded", "turn.recovery.requested", "turn.capacity_waiting", "agent.message.delta", "agent.message.completed", "agent.reasoning.delta", "agent.toolCall.created", "agent.toolCall.output", "agent.model.request", "agent.model.usage", "tool.auth_needed", "credential.auth_needed", "agent.updated", "rig.setup.started", "rig.setup.completed", "rig.setup.skipped", "rig.setup.failed", "sandbox.operation.started", "sandbox.operation.completed", "sandbox.operation.failed", "sandbox.command.output.delta", "artifact.created", "goal.set", "goal.updated", "goal.completed", "goal.paused", "goal.resumed", "goal.cleared", "goal.continuation", "system.update.pending", "system.update.delivered", "session.control.paused", "session.control.resumed", "session.control.steer_requested", "workspace.inference.paused", "workspace.inference.resumed", "session.queue.changed", "session.queue.prompt.cancelled", "session.queue.history", "turn.event.rejected_late", "memory.saved", "memory.corrected", "stream.url.rotated", "stream.opened", "stream.closed", "stream.revoked", "recording.started", "recording.available", "recording.failed", "fs.changed", "git.changed", "terminal.pty.started", "terminal.pty.output.delta", "terminal.pty.exited", "session.title_set", "session.mcp.approval_policy.updated", "session.tool_policy.updated", "codex.account.switched", "codex.credential.selected", "codex.fleet.decision", "codex.capacity.waiting", "codex.capacity.resumed", "codex.capacity.superseded", "sandbox.box.created", "sandbox.box.lost", "sandbox.box.terminated", "sandbox.box.snapshot", "sandbox.env.drift", "session.route.reconciled", "workspace.revision.captured", "workspace.revision.degraded", "machine.op.failed", "machine.op.recovered", "machine.link.lost", "machine.link.restored", "machine.runner.restarted"];
|
|
729
|
+
declare const SESSION_EVENT_TYPES: readonly ["session.created", "session.event.envelope_omitted", "session.status.changed", "session.requiresAction", "session.humanInput.requested", "session.context.compaction.requested", "session.context.compacted", "session.context.compaction.skipped", "session.context.cleared", "user.message", "user.pause", "user.approvalDecision", "user.humanInputResponse", "turn.queued", "turn.started", "turn.completed", "turn.failed", "turn.cancelled", "turn.superseded", "turn.recovery.requested", "turn.capacity_waiting", "agent.message.delta", "agent.message.completed", "agent.reasoning.delta", "agent.toolCall.created", "agent.toolCall.output", "agent.model.request", "agent.model.usage", "tool.auth_needed", "credential.auth_needed", "agent.updated", "rig.setup.started", "rig.setup.completed", "rig.setup.skipped", "rig.setup.failed", "sandbox.operation.started", "sandbox.operation.completed", "sandbox.operation.failed", "sandbox.command.output.delta", "artifact.created", "goal.set", "goal.updated", "goal.completed", "goal.paused", "goal.resumed", "goal.cleared", "goal.continuation", "system.update.pending", "system.update.delivered", "system.update.superseded", "system.update.cancelled", "system.update.settled", "session.control.paused", "session.control.resumed", "session.control.steer_requested", "workspace.inference.paused", "workspace.inference.resumed", "session.queue.changed", "session.queue.prompt.cancelled", "session.queue.history", "turn.event.rejected_late", "memory.saved", "memory.corrected", "stream.url.rotated", "stream.opened", "stream.closed", "stream.revoked", "recording.started", "recording.available", "recording.failed", "fs.changed", "git.changed", "terminal.pty.started", "terminal.pty.output.delta", "terminal.pty.exited", "session.title_set", "session.mcp.approval_policy.updated", "session.tool_policy.updated", "codex.account.switched", "codex.credential.selected", "codex.fleet.decision", "codex.capacity.waiting", "codex.capacity.resumed", "codex.capacity.superseded", "sandbox.box.created", "sandbox.box.lost", "sandbox.box.terminated", "sandbox.box.snapshot", "sandbox.env.drift", "session.route.reconciled", "workspace.revision.captured", "workspace.revision.degraded", "machine.op.failed", "machine.op.recovered", "machine.link.lost", "machine.link.restored", "machine.runner.restarted"];
|
|
729
730
|
type KnownSessionEventType = (typeof SESSION_EVENT_TYPES)[number];
|
|
730
731
|
/**
|
|
731
732
|
* Event types the SDK knows about today, kept open so a newer OpenGeni server
|
|
@@ -1426,6 +1427,7 @@ type CreateSessionRequest = {
|
|
|
1426
1427
|
expectedNewSessionDraftRevision?: number | undefined;
|
|
1427
1428
|
maxNestedAgentDepth?: number | undefined;
|
|
1428
1429
|
firstPartyMcpPermissions?: string[] | undefined;
|
|
1430
|
+
firstPartyMcpTools?: FirstPartyMcpToolName[] | undefined;
|
|
1429
1431
|
mcpServers?: SessionMcpServerInput[] | undefined;
|
|
1430
1432
|
sandbox?: "shared" | "new" | {
|
|
1431
1433
|
groupId: string;
|
|
@@ -1438,6 +1440,7 @@ type KnownPermission = (typeof KNOWN_PERMISSIONS)[number];
|
|
|
1438
1440
|
* can introduce permissions without breaking older SDK consumers.
|
|
1439
1441
|
*/
|
|
1440
1442
|
type Permission = KnownPermission | (string & {});
|
|
1443
|
+
type FirstPartyMcpToolName = "set_session_title" | "goal_set" | "goal_update" | "goal_complete" | "goal_pause" | "memory_search" | "memory_save" | "memory_correct" | "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_list_users" | "slack_bot_post_message";
|
|
1441
1444
|
type ProductAccessMode = "local" | "configured" | "managed";
|
|
1442
1445
|
type ModelCapabilitySupportV1 = "supported" | "unsupported" | "unknown";
|
|
1443
1446
|
type ModelCapabilityStateV1 = {
|
|
@@ -2018,9 +2021,6 @@ type ComposerDraft = {
|
|
|
2018
2021
|
revision: number;
|
|
2019
2022
|
text: string;
|
|
2020
2023
|
resources: ResourceRef[];
|
|
2021
|
-
tools: ToolRef[];
|
|
2022
|
-
/** False inherits the session policy; true preserves an explicit array. */
|
|
2023
|
-
toolsProvided: boolean;
|
|
2024
2024
|
model: string;
|
|
2025
2025
|
reasoningEffort: ReasoningEffort;
|
|
2026
2026
|
sourceTurnId: string | null;
|
|
@@ -2035,6 +2035,7 @@ type NewSessionDraftOptions = {
|
|
|
2035
2035
|
rigId?: string | undefined;
|
|
2036
2036
|
goal?: GoalSpec | undefined;
|
|
2037
2037
|
firstPartyMcpPermissions?: Permission[] | undefined;
|
|
2038
|
+
firstPartyMcpTools?: FirstPartyMcpToolName[] | undefined;
|
|
2038
2039
|
};
|
|
2039
2040
|
type NewSessionDraft = {
|
|
2040
2041
|
revision: number;
|
|
@@ -2054,10 +2055,18 @@ type SessionQueueSnapshot = {
|
|
|
2054
2055
|
/** The latest interrupted attempt has not yet durably proved physical quiescence. */
|
|
2055
2056
|
stoppingPreviousAttempt: boolean;
|
|
2056
2057
|
items: SessionTurn[];
|
|
2058
|
+
/** Canonical pending machine inputs. Events only invalidate this snapshot. */
|
|
2059
|
+
pendingInputs: SessionPendingInputPreview[];
|
|
2060
|
+
/** Exact next bounded input batch that will join an already-waiting prompt. */
|
|
2061
|
+
pendingInputAttachment: {
|
|
2062
|
+
turnId: string;
|
|
2063
|
+
inputIds: string[];
|
|
2064
|
+
} | null;
|
|
2057
2065
|
};
|
|
2066
|
+
type SessionPendingInputPreview = Pick<SessionSystemUpdate, "id" | "sessionId" | "kind" | "classification" | "sourceId" | "summary" | "createdAt">;
|
|
2058
2067
|
type SystemUpdateClassification = "success" | "failure" | "action_required" | "info";
|
|
2059
2068
|
type SessionSystemUpdateKind = "scheduled_occurrence" | "goal_continuation" | "agent_message" | "agent_steer_instruction" | "child_terminal_result";
|
|
2060
|
-
type SessionSystemUpdateState = "pending" | "
|
|
2069
|
+
type SessionSystemUpdateState = "pending" | "delivered" | "cancelled" | "superseded" | "failed";
|
|
2061
2070
|
type SessionSystemUpdate = {
|
|
2062
2071
|
id: string;
|
|
2063
2072
|
sessionId: string;
|
|
@@ -2070,6 +2079,7 @@ type SessionSystemUpdate = {
|
|
|
2070
2079
|
lineage: Record<string, unknown>;
|
|
2071
2080
|
state: SessionSystemUpdateState;
|
|
2072
2081
|
deliveredTurnId: string | null;
|
|
2082
|
+
deliveredHistoryItemId: string | null;
|
|
2073
2083
|
deliveredAt: string | null;
|
|
2074
2084
|
createdAt: string;
|
|
2075
2085
|
};
|
|
@@ -2892,6 +2902,7 @@ type GitHubRepository = {
|
|
|
2892
2902
|
};
|
|
2893
2903
|
type GitHubRepositoryScope = "all" | "selected";
|
|
2894
2904
|
type GitHubBindingStatus = "disabled" | "unbound" | "bound";
|
|
2905
|
+
type GitHubAppSetupMode = "platform" | "operator";
|
|
2895
2906
|
type GitHubInstallationLifecycle = "active" | "suspended" | "deleted" | "unverified";
|
|
2896
2907
|
type GitHubInstallationBinding = {
|
|
2897
2908
|
installationId: number;
|
|
@@ -2901,6 +2912,8 @@ type GitHubInstallationBinding = {
|
|
|
2901
2912
|
lifecycle: GitHubInstallationLifecycle;
|
|
2902
2913
|
repositoryScope: GitHubRepositoryScope;
|
|
2903
2914
|
repositoryCount: number;
|
|
2915
|
+
/** OpenGeni-owned entry point for changing the installation's repository allowlist. */
|
|
2916
|
+
configureUrl: string | null;
|
|
2904
2917
|
createdAt: string;
|
|
2905
2918
|
updatedAt: string;
|
|
2906
2919
|
};
|
|
@@ -2908,12 +2921,14 @@ type GitHubAppInfo = {
|
|
|
2908
2921
|
configured: boolean;
|
|
2909
2922
|
/** Truthful workspace binding state; server App credentials alone are not a binding. */
|
|
2910
2923
|
status: GitHubBindingStatus;
|
|
2924
|
+
/** Platform deployments expose installation only; operator deployments may create an App. */
|
|
2925
|
+
setupMode: GitHubAppSetupMode;
|
|
2911
2926
|
appId: string | null;
|
|
2912
2927
|
clientId: string | null;
|
|
2913
2928
|
appSlug: string | null;
|
|
2914
|
-
/** Fresh
|
|
2929
|
+
/** Fresh OAuth-first existing-installation discovery and install entry point. */
|
|
2915
2930
|
installUrl: string | null;
|
|
2916
|
-
/** Compatibility alias for installUrl
|
|
2931
|
+
/** Compatibility alias for installUrl. */
|
|
2917
2932
|
linkUrl: string | null;
|
|
2918
2933
|
/** Installation bindings owned independently by this workspace. */
|
|
2919
2934
|
installations: GitHubInstallationBinding[];
|
|
@@ -2995,7 +3010,6 @@ type UserMessageEventInput = {
|
|
|
2995
3010
|
text: string;
|
|
2996
3011
|
turnInstructions?: string | undefined;
|
|
2997
3012
|
resources?: ResourceRef[] | undefined;
|
|
2998
|
-
tools?: ToolRef[] | undefined;
|
|
2999
3013
|
model?: string | undefined;
|
|
3000
3014
|
reasoningEffort?: ReasoningEffort | undefined;
|
|
3001
3015
|
mcpCredentialUpdates?: SessionMcpCredentialUpdateInput[] | undefined;
|
|
@@ -4058,6 +4072,22 @@ type SseMessage = {
|
|
|
4058
4072
|
};
|
|
4059
4073
|
declare function parseSseStream(stream: ReadableStream<Uint8Array>): AsyncGenerator<SseMessage, void, void>;
|
|
4060
4074
|
|
|
4075
|
+
/**
|
|
4076
|
+
* A transport-tolerant MCP tool result.
|
|
4077
|
+
*
|
|
4078
|
+
* `value` is the canonical machine-readable payload after recognized MCP/JSON
|
|
4079
|
+
* envelopes are removed. `text` is the best presentation string without
|
|
4080
|
+
* discarding structured data. `raw` always retains the original evidence.
|
|
4081
|
+
*/
|
|
4082
|
+
type NormalizedMcpOutput = Readonly<{
|
|
4083
|
+
raw: unknown;
|
|
4084
|
+
value: unknown;
|
|
4085
|
+
text: string;
|
|
4086
|
+
isError: boolean;
|
|
4087
|
+
}>;
|
|
4088
|
+
/** Normalize common direct, JSON, and standard MCP result envelopes without throwing. */
|
|
4089
|
+
declare function normalizeMcpOutput(output: unknown): NormalizedMcpOutput;
|
|
4090
|
+
|
|
4061
4091
|
/**
|
|
4062
4092
|
* Translate the negotiated desktop capability into the WebSocket URL the noVNC
|
|
4063
4093
|
* RFB client connects to. The scoped provider token is ALREADY embedded in the
|
|
@@ -4178,4 +4208,4 @@ declare function ttydInputFrame(data: string): string;
|
|
|
4178
4208
|
/** Build a client→server RESIZE frame: "1" + JSON.stringify({ columns, rows }). */
|
|
4179
4209
|
declare function ttydResizeFrame(columns: number, rows: number): string;
|
|
4180
4210
|
|
|
4181
|
-
export { type AccessContext, type AccessGrant, type AccountGrant, type AccountRole, type AcknowledgeStreamRequest, type AcknowledgeStreamResponse, type ActivateWorkspaceInstructionPolicyRequest, type AddDocumentRequest, type AddWorkspaceMemberRequest, type AgentMessageCompletedPayload, type AgentTextDeltaPayload, type AgentToolCallCreatedPayload, type AgentToolCallOutputPayload, type ApiKey, type AttachViewerRequest, type AttachViewerResponse, type BillingBalance, type BillingEntitlementsResponse, type BillingMode, type BillingSummary, type BillingUsageResponse, type CapabilityCatalogItem, type CapabilityCatalogResponse, type CapabilityInstallation, type CapabilityInstallationStatus, type CapabilityKind, type CapabilityPack, type CapabilityPackConnector, type CapabilityPackConnectorAuthModel, type CapabilityPackKnowledge, type CapabilityPackScheduledTaskTemplate, type CapabilityPackSkill, type CapabilityPackSkillFile, type CapabilityPackVariableSetSpec, type CapabilityRuntime, type CapabilitySource, type CapabilityUnavailableReason, type ClientAuthConfig, type ClientConfig, type ClientModel, type ClientSessionEventInput, type CodexAccount, type CodexAccountOverview, type CodexAccountSwitchedPayload, type CodexAccountsResponse, type CodexAllocatorUpdate, type CodexConnectPoll, type CodexConnectStart, type CodexConnectionStatus, type CodexFleetCacheState, type CodexFleetConfidence, type CodexFleetDecisionEventPayload, type CodexFleetDecisionScore, type CodexFleetShadowComparison, type CodexOverviewResponse, type CodexResetCredit, type CodexResetRedemptionRecovery, type CodexRotationSettings, type CodexUsage, type CodexUsageMap, type CodexUsagePayload, type CodexUsageWindow, type CompactSessionContextResult, type CompleteFileUploadResponse, type ComposerDraft, type ComputerUseCapability, type ConnectionKind, type ConnectionMetadata, type ConnectionResponse, type ConnectionStatus, type CreateApiKeyRequest, type CreateApiKeyResponse, type CreateCapabilityCatalogItemRequest, type CreateCheckoutRequest, type CreateCheckoutResponse, type CreateConnectionRequest, type CreateDocumentBaseRequest, type CreateFileUploadRequest, type CreateFileUploadResponse, type CreateGitHubAppManifestRequest, type CreateGitHubAppManifestResponse, type CreateKnowledgeDropRequest, type CreateKnowledgeMemoryRequest, type CreateRigRequest, type CreateScheduledTaskRequest, type CreateSessionRequest, type CreateVariableSetRequest, type CreateWorkspaceEnvironmentRequest, type CreateWorkspaceInstructionPolicyDraftRequest, type CreateWorkspaceRequest, DEFAULT_WORKSPACE_TRANSCRIPTION_POLICY, type DeleteSessionQueueItemRequest, type DesktopConnectionState, type DesktopRfbFactory, type DesktopRfbLike, type DesktopStreamCapability, type DesktopStreamEvent, type DeviceEnrollmentApproveRequest, type DeviceEnrollmentApproveResponse, type DeviceEnrollmentDenyRequest, type DeviceEnrollmentDenyResponse, type DeviceEnrollmentLookupMachine, type DeviceEnrollmentLookupRequest, type DeviceEnrollmentLookupResponse, type DiscoverMcpCapabilitiesResponse, type Document, type DocumentBase, type DocumentCuration, type DocumentCurationStatus, type DocumentSearchMode, type DocumentSearchRequest, type DocumentSearchResponse, type DocumentSearchResult, type DocumentStatus, type DocumentVisibility, type EditSessionQueueItemRequest, type EffectiveControlBlocker, type EffectiveControlResumeOption, type EffectiveSessionControl, type EnableCapabilityRequest, type EnablePackRequest, type EnrollTokenExchangeRequest, type EnrollTokenExchangeResponse, type EnrollmentCredentials, type EnrollmentOs, type EntitlementValue, type Entitlements, type EntitlementsMode, type FetchLike, type FileAsset, type FileDownloadUrlResponse, type FileResourceRef, type FileStatus, type FileSystemCapability, type FileUploadData, type FsChangeKind, type FsChangedPayload, type FsDeleteRequest, type FsDeleteResponse, type FsEncoding, type FsListRequest, type FsListResponse, type FsMkdirRequest, type FsMkdirResponse, type FsMoveRequest, type FsMoveResponse, type FsNodeType, type FsReadRequest, type FsReadResponse, type FsTreeNode, type FsWriteRequest, type FsWriteResponse, type GetPackResponse, type GetWorkspaceCaptureFileResponse, type GetWorkspaceCaptureResponse, type GitCapability, type GitChangedPayload, type GitCommit, type GitCredentialBindingId, type GitCredentialProvider, type GitDiffHunk, type GitDiffLine, type GitDiffLineType, type GitDiffRequest, type GitDiffResponse, type GitFileDiff, type GitFileStatus, type GitFileStatusCode, type GitHubAppInfo, type GitHubBindingStatus, type GitHubInstallationBinding, type GitHubInstallationLifecycle, type GitHubRepositoriesResponse, type GitHubRepository, type GitHubRepositoryScope, type GitLogRequest, type GitLogResponse, type GitRepositoryAccess, type GitShowRequest, type GitShowResponse, type GitStatusRequest, type GitStatusResponse, type GoalSpec, type HumanInputAnswer, type HumanInputOption, type HumanInputQuestion, type HumanInputQuestionKind, type HumanInputResponse, type ImportLegacyWorkspaceInstructionPolicyDraftRequest, type IntegrationClientMetadata, KNOWN_PERMISSIONS, KNOWN_USAGE_EVENT_TYPES, type KnowledgeMemory, type KnowledgeMemoryKind, type KnowledgeMemorySearchRequest, type KnowledgeMemoryStatus, type KnowledgeSourceKind, type KnowledgeSourceRef, type KnownPermission, type KnownSessionEventType, type KnownUsageEventType, type LineageNode, type ListApiKeysResponse, type ListConnectionsResponse, type ListPacksResponse, type ListWorkspaceMembersResponse, type MachineKind, type MachineMetricsSeriesResponse, type MachineState, type MachineView, type MachinesResponse, type McpServerConnectionRef, type MetricSample, type MintEnrollTokenRequest, type MintEnrollTokenResponse, type ModelAvailabilityV1, type ModelBillingAttributionV1, type ModelCapabilitiesV1, type ModelCapabilityStateV1, type ModelCapabilitySupportV1, type ModelCredentialReadinessV1, type ModelCredentialSourceV1, type ModelPricingScheduleV1, type ModelPricingV1, type MoveDocumentRequest, type MoveSessionQueueItemRequest, type NewSessionDraft, type NewSessionDraftOptions, type OAuthStartRequest, type OAuthStartResponse, OPENGENI_API_CONTRACT_HEADER, OPENGENI_API_CONTRACT_REVISION, OPENGENI_CORRELATION_HEADER, OpenGeniApiContractMismatchError, OpenGeniApiError, OpenGeniClient, type OpenGeniClientOptions, type OpenGeniRequestOptions, OpenGeniSessionListCursorError, type OpenGeniSlackBotInstallRequest, type OpenGeniSlackBotInstallStart, OpenGeniStreamError, type PackInstallation, type PackInstallationStatus, type Permission, type ProductAccessMode, type ProposeRigChangeRequest, type ProxySessionEventStreamOptions, type PtyCloseRequest, type PtyOpenRequest, type PtyOpenResponse, type PtyResizeRequest, type PtyWriteRequest, RETAINED_OUTPUT_DEFAULT_PAGE_BYTES, RETAINED_OUTPUT_MAX_PAGE_BYTES, type ReasoningEffort, type RecordingAvailablePayload, type RecordingCapability, type RecordingCodec, type RecordingContentType, type RecordingFailedPayload, type RecordingFailedReason, type RecordingMode, type RecordingStartedPayload, type RegisterCapabilityPackRequest, type RepositoryResourceRef, type ResourceRef, type RetainedArtifactContent, type RetainedArtifactContentOptions, type RetainedArtifactMetadata, type RetainedArtifactReference, type RetainedArtifactUnavailable, type RetainedOutputKind, type RetainedOutputUnavailableReason, type Rig, type RigChange, type RigChangeKind, type RigChangeStatus, type RigChangeVerification, type RigCheck, type RigCheckResult, type RigDefinitionEditPayload, type RigSetupAppendPayload, type RigVersion, type RollbackWorkspaceInstructionPolicyRequest, SESSION_EVENT_TYPES, type SandboxBackend, type SandboxCapabilityName, type SandboxCommandOutputDeltaPayload, type SandboxOs, type SaveComposerDraftRequest, type SaveNewSessionDraftRequest, type ScheduledTask, type ScheduledTaskAgentConfig, type ScheduledTaskAgentConfigInput, type ScheduledTaskDayOfWeek, type ScheduledTaskOverlapPolicy, type ScheduledTaskRun, type ScheduledTaskRunMode, type ScheduledTaskRunStatus, type ScheduledTaskScheduleSpec, type ScheduledTaskStatus, type ScheduledTaskTriggerType, type SendMessageInput, type ServiceTurnInitiator, type ServiceTurnInitiatorContext, type Session, type SessionCapabilities, type SessionCommandReceipt, type SessionControlResponse, type SessionEffectiveToolPolicy, type SessionEvent, type SessionEventCompactResult, type SessionEventCompactResultOptions, type SessionEventLatestClass, type SessionEventListOptions, type SessionEventPage, type SessionEventPayloadMode, type SessionEventReadDirection, type SessionEventReadMode, type SessionEventResultMode, type SessionEventSemanticClass, type SessionEventStreamTransport, type SessionEventType, type SessionGoal, type SessionGoalCreatedBy, type SessionGoalStatus, type SessionHumanInputRequest, type SessionLineageResponse, type SessionListResponse, type SessionMcpApprovalPolicy, type SessionMcpCredentialUpdateInput, type SessionMcpServerInput, type SessionMcpServerMetadata, type SessionQueueMutationResponse, type SessionQueueSnapshot, type SessionStatus, type SessionStatusChangedPayload, type SessionStructuredCapabilities, type SessionSummary, type SessionSystemUpdate, type SessionSystemUpdateKind, type SessionSystemUpdateState, type SessionToolPolicy, type SessionTurn, type SessionTurnSource, type SessionTurnStatus, type SetWorkspaceEnvironmentVariableRequest, type SseMessage, type SseReStreamOptions, type SteerMessageResult, type SteerSessionQueueItemRequest, type StreamClosedPayload, type StreamConnectionState, type StreamOpenedPayload, type StreamRevokedPayload, type StreamSessionEventsOptions, type StreamUrlRotatedPayload, type SubmitHumanInputResponseRequest, type SwapActiveSandboxRequest, type SwapActiveSandboxResponse, TTYD_SUBPROTOCOL, type TerminalCapability, type TerminalExecRequest, type TerminalExecResponse, type TerminalPtyExitedPayload, type TerminalPtyOutputDeltaPayload, type TerminalPtyStartedPayload, type ToolAuthNeededPayload, type ToolRef, type TranscriptionAdapter, type TranscriptionAdapterDescriptor, type TranscriptionAdapterStartContext, type TranscriptionAuthorization, type TranscriptionCredentialMode, type TranscriptionDiagnostic, type TranscriptionErrorCode, type TranscriptionEvent, type TranscriptionEventListener, type TranscriptionLifecycleStatus, type TranscriptionPolicyBlockReason, type TranscriptionResultMetadata, type TranscriptionSession, type TranscriptionSessionRequest, type TranscriptionSpeaker, type TranscriptionTargetSelection, type TranscriptionTimeSpan, type TranscriptionWord, TtydClientCommand, TtydServerCommand, type TurnInitiator, type UpdateConnectionRequest, type UpdateKnowledgeMemoryRequest, type UpdateRigRequest, type UpdateScheduledTaskRequest, type UpdateSessionGoalRequest, type UpdateSessionMcpApprovalPolicyRequest, type UpdateSessionMcpApprovalPolicyResponse, type UpdateSessionPinRequest, type UpdateSessionRequest, type UpdateSessionToolPolicyRequest, type UpdateVariableSetRequest, type UpdateWorkspaceEnvironmentRequest, type UpdateWorkspaceMemberRequest, type UpdateWorkspaceRequest, type UpdateWorkspaceSettingsRequest, type UploadFileInput, type UsageEvent, type UsageEventType, type UserApprovalDecisionEventInput, type UserHumanInputResponseEventInput, type UserMessageEventInput, type VariableSet, type VariableSetVariableMetadata, type ViewerHeartbeatRequest, type ViewerHeartbeatResponse, type ViewerHolder, type Workspace, type WorkspaceCaptureDegradedReason, type WorkspaceCaptureFile, type WorkspaceCaptureManifest, type WorkspaceCaptureRepo, type WorkspaceCaptureSignedUrl, type WorkspaceCaptureStats, type WorkspaceControlEvent, type WorkspaceControlEventPage, type WorkspaceControlStreamTransport, type WorkspaceEnvironment, type WorkspaceEnvironmentVariableMetadata, type WorkspaceInferenceControlResponse, type WorkspaceInstructionPolicyActivationEvent, type WorkspaceInstructionPolicyActivationResponse, type WorkspaceInstructionPolicyActivationType, type WorkspaceInstructionPolicyConflictResponse, type WorkspaceInstructionPolicyDiffRequest, type WorkspaceInstructionPolicyDiffResponse, type WorkspaceInstructionPolicyDraftProvenanceSource, type WorkspaceInstructionPolicyHead, type WorkspaceInstructionPolicyKind, type WorkspaceInstructionPolicyListOptions, type WorkspaceInstructionPolicyListResponse, type WorkspaceInstructionPolicyProvenanceSource, type WorkspaceInstructionPolicyRevision, type WorkspaceInstructionPolicyRevisionIdentity, type WorkspaceInstructionPolicyScope, type WorkspaceInstructionPolicyTarget, type WorkspaceMember, type WorkspaceMemorySearchMode, type WorkspaceMemorySearchRequest, type WorkspaceMemorySearchResponse, type WorkspaceMemorySearchResult, type WorkspaceModelCatalogModel, type WorkspaceModelCatalogResponse, type WorkspaceRegisteredPack, type WorkspaceRevisionCapturedPayload, type WorkspaceRevisionDegradedPayload, type WorkspaceSettings, type WorkspaceTranscriptionPolicy, type WorkspaceTranscriptionTarget, applyUrlRotation, authorizeTranscriptionAdapter, createTranscriptionSessionRequest, desktopSocketUrl, formatSseEvent, isRetryableStreamError, nextDesktopState, normalizeWorkspaceInstructionPolicyRoleKey, parseSseStream, proxySessionEventStream, resolveWorkspaceTranscriptionPolicy, resumeSequenceFromRequest, sessionEventsToSseResponse, sessionEventsToSseStream, streamSessionEvents, streamWorkspaceControlEvents, terminalSocketUrl, ttydAuthFrame, ttydInputFrame, ttydResizeFrame };
|
|
4211
|
+
export { type AccessContext, type AccessGrant, type AccountGrant, type AccountRole, type AcknowledgeStreamRequest, type AcknowledgeStreamResponse, type ActivateWorkspaceInstructionPolicyRequest, type AddDocumentRequest, type AddWorkspaceMemberRequest, type AgentMessageCompletedPayload, type AgentTextDeltaPayload, type AgentToolCallCreatedPayload, type AgentToolCallOutputPayload, type ApiKey, type AttachViewerRequest, type AttachViewerResponse, type BillingBalance, type BillingEntitlementsResponse, type BillingMode, type BillingSummary, type BillingUsageResponse, type CapabilityCatalogItem, type CapabilityCatalogResponse, type CapabilityInstallation, type CapabilityInstallationStatus, type CapabilityKind, type CapabilityPack, type CapabilityPackConnector, type CapabilityPackConnectorAuthModel, type CapabilityPackKnowledge, type CapabilityPackScheduledTaskTemplate, type CapabilityPackSkill, type CapabilityPackSkillFile, type CapabilityPackVariableSetSpec, type CapabilityRuntime, type CapabilitySource, type CapabilityUnavailableReason, type ClientAuthConfig, type ClientConfig, type ClientModel, type ClientSessionEventInput, type CodexAccount, type CodexAccountOverview, type CodexAccountSwitchedPayload, type CodexAccountsResponse, type CodexAllocatorUpdate, type CodexConnectPoll, type CodexConnectStart, type CodexConnectionStatus, type CodexFleetCacheState, type CodexFleetConfidence, type CodexFleetDecisionEventPayload, type CodexFleetDecisionScore, type CodexFleetShadowComparison, type CodexOverviewResponse, type CodexResetCredit, type CodexResetRedemptionRecovery, type CodexRotationSettings, type CodexUsage, type CodexUsageMap, type CodexUsagePayload, type CodexUsageWindow, type CompactSessionContextResult, type CompleteFileUploadResponse, type ComposerDraft, type ComputerUseCapability, type ConnectionKind, type ConnectionMetadata, type ConnectionResponse, type ConnectionStatus, type CreateApiKeyRequest, type CreateApiKeyResponse, type CreateCapabilityCatalogItemRequest, type CreateCheckoutRequest, type CreateCheckoutResponse, type CreateConnectionRequest, type CreateDocumentBaseRequest, type CreateFileUploadRequest, type CreateFileUploadResponse, type CreateGitHubAppManifestRequest, type CreateGitHubAppManifestResponse, type CreateKnowledgeDropRequest, type CreateKnowledgeMemoryRequest, type CreateRigRequest, type CreateScheduledTaskRequest, type CreateSessionRequest, type CreateVariableSetRequest, type CreateWorkspaceEnvironmentRequest, type CreateWorkspaceInstructionPolicyDraftRequest, type CreateWorkspaceRequest, DEFAULT_WORKSPACE_TRANSCRIPTION_POLICY, type DeleteSessionQueueItemRequest, type DesktopConnectionState, type DesktopRfbFactory, type DesktopRfbLike, type DesktopStreamCapability, type DesktopStreamEvent, type DeviceEnrollmentApproveRequest, type DeviceEnrollmentApproveResponse, type DeviceEnrollmentDenyRequest, type DeviceEnrollmentDenyResponse, type DeviceEnrollmentLookupMachine, type DeviceEnrollmentLookupRequest, type DeviceEnrollmentLookupResponse, type DiscoverMcpCapabilitiesResponse, type Document, type DocumentBase, type DocumentCuration, type DocumentCurationStatus, type DocumentSearchMode, type DocumentSearchRequest, type DocumentSearchResponse, type DocumentSearchResult, type DocumentStatus, type DocumentVisibility, type EditSessionQueueItemRequest, type EffectiveControlBlocker, type EffectiveControlResumeOption, type EffectiveSessionControl, type EnableCapabilityRequest, type EnablePackRequest, type EnrollTokenExchangeRequest, type EnrollTokenExchangeResponse, type EnrollmentCredentials, type EnrollmentOs, type EntitlementValue, type Entitlements, type EntitlementsMode, type FetchLike, type FileAsset, type FileDownloadUrlResponse, type FileResourceRef, type FileStatus, type FileSystemCapability, type FileUploadData, type FirstPartyMcpToolName, type FsChangeKind, type FsChangedPayload, type FsDeleteRequest, type FsDeleteResponse, type FsEncoding, type FsListRequest, type FsListResponse, type FsMkdirRequest, type FsMkdirResponse, type FsMoveRequest, type FsMoveResponse, type FsNodeType, type FsReadRequest, type FsReadResponse, type FsTreeNode, type FsWriteRequest, type FsWriteResponse, type GetPackResponse, type GetWorkspaceCaptureFileResponse, type GetWorkspaceCaptureResponse, type GitCapability, type GitChangedPayload, type GitCommit, type GitCredentialBindingId, type GitCredentialProvider, type GitDiffHunk, type GitDiffLine, type GitDiffLineType, type GitDiffRequest, type GitDiffResponse, type GitFileDiff, type GitFileStatus, type GitFileStatusCode, type GitHubAppInfo, type GitHubAppSetupMode, type GitHubBindingStatus, type GitHubInstallationBinding, type GitHubInstallationLifecycle, type GitHubRepositoriesResponse, type GitHubRepository, type GitHubRepositoryScope, type GitLogRequest, type GitLogResponse, type GitRepositoryAccess, type GitShowRequest, type GitShowResponse, type GitStatusRequest, type GitStatusResponse, type GoalSpec, type HumanInputAnswer, type HumanInputOption, type HumanInputQuestion, type HumanInputQuestionKind, type HumanInputResponse, type ImportLegacyWorkspaceInstructionPolicyDraftRequest, type IntegrationClientMetadata, KNOWN_PERMISSIONS, KNOWN_USAGE_EVENT_TYPES, type KnowledgeMemory, type KnowledgeMemoryKind, type KnowledgeMemorySearchRequest, type KnowledgeMemoryStatus, type KnowledgeSourceKind, type KnowledgeSourceRef, type KnownPermission, type KnownSessionEventType, type KnownUsageEventType, type LineageNode, type ListApiKeysResponse, type ListConnectionsResponse, type ListPacksResponse, type ListWorkspaceMembersResponse, type MachineKind, type MachineMetricsSeriesResponse, type MachineState, type MachineView, type MachinesResponse, type McpServerConnectionRef, type MetricSample, type MintEnrollTokenRequest, type MintEnrollTokenResponse, type ModelAvailabilityV1, type ModelBillingAttributionV1, type ModelCapabilitiesV1, type ModelCapabilityStateV1, type ModelCapabilitySupportV1, type ModelCredentialReadinessV1, type ModelCredentialSourceV1, type ModelPricingScheduleV1, type ModelPricingV1, type MoveDocumentRequest, type MoveSessionQueueItemRequest, type NewSessionDraft, type NewSessionDraftOptions, type NormalizedMcpOutput, type OAuthStartRequest, type OAuthStartResponse, OPENGENI_API_CONTRACT_HEADER, OPENGENI_API_CONTRACT_REVISION, OPENGENI_CORRELATION_HEADER, OpenGeniApiContractMismatchError, OpenGeniApiError, OpenGeniClient, type OpenGeniClientOptions, type OpenGeniRequestOptions, OpenGeniSessionListCursorError, type OpenGeniSlackBotInstallRequest, type OpenGeniSlackBotInstallStart, OpenGeniStreamError, type PackInstallation, type PackInstallationStatus, type Permission, type ProductAccessMode, type ProposeRigChangeRequest, type ProxySessionEventStreamOptions, type PtyCloseRequest, type PtyOpenRequest, type PtyOpenResponse, type PtyResizeRequest, type PtyWriteRequest, RETAINED_OUTPUT_DEFAULT_PAGE_BYTES, RETAINED_OUTPUT_MAX_PAGE_BYTES, type ReasoningEffort, type RecordingAvailablePayload, type RecordingCapability, type RecordingCodec, type RecordingContentType, type RecordingFailedPayload, type RecordingFailedReason, type RecordingMode, type RecordingStartedPayload, type RegisterCapabilityPackRequest, type RepositoryResourceRef, type ResourceRef, type RetainedArtifactContent, type RetainedArtifactContentOptions, type RetainedArtifactMetadata, type RetainedArtifactReference, type RetainedArtifactUnavailable, type RetainedOutputKind, type RetainedOutputUnavailableReason, type Rig, type RigChange, type RigChangeKind, type RigChangeStatus, type RigChangeVerification, type RigCheck, type RigCheckResult, type RigDefinitionEditPayload, type RigSetupAppendPayload, type RigVersion, type RollbackWorkspaceInstructionPolicyRequest, SESSION_EVENT_TYPES, type SandboxBackend, type SandboxCapabilityName, type SandboxCommandOutputDeltaPayload, type SandboxOs, type SaveComposerDraftRequest, type SaveNewSessionDraftRequest, type ScheduledTask, type ScheduledTaskAgentConfig, type ScheduledTaskAgentConfigInput, type ScheduledTaskDayOfWeek, type ScheduledTaskOverlapPolicy, type ScheduledTaskRun, type ScheduledTaskRunMode, type ScheduledTaskRunStatus, type ScheduledTaskScheduleSpec, type ScheduledTaskStatus, type ScheduledTaskTriggerType, type SendMessageInput, type ServiceTurnInitiator, type ServiceTurnInitiatorContext, type Session, type SessionCapabilities, type SessionCommandReceipt, type SessionControlResponse, type SessionEffectiveToolPolicy, type SessionEvent, type SessionEventCompactResult, type SessionEventCompactResultOptions, type SessionEventLatestClass, type SessionEventListOptions, type SessionEventPage, type SessionEventPayloadMode, type SessionEventReadDirection, type SessionEventReadMode, type SessionEventResultMode, type SessionEventSemanticClass, type SessionEventStreamTransport, type SessionEventType, type SessionGoal, type SessionGoalCreatedBy, type SessionGoalStatus, type SessionHumanInputRequest, type SessionLineageResponse, type SessionListResponse, type SessionMcpApprovalPolicy, type SessionMcpCredentialUpdateInput, type SessionMcpServerInput, type SessionMcpServerMetadata, type SessionPendingInputPreview, type SessionQueueMutationResponse, type SessionQueueSnapshot, type SessionStatus, type SessionStatusChangedPayload, type SessionStructuredCapabilities, type SessionSummary, type SessionSystemUpdate, type SessionSystemUpdateKind, type SessionSystemUpdateState, type SessionToolPolicy, type SessionTurn, type SessionTurnSource, type SessionTurnStatus, type SetWorkspaceEnvironmentVariableRequest, type SseMessage, type SseReStreamOptions, type SteerMessageResult, type SteerSessionQueueItemRequest, type StreamClosedPayload, type StreamConnectionState, type StreamOpenedPayload, type StreamRevokedPayload, type StreamSessionEventsOptions, type StreamUrlRotatedPayload, type SubmitHumanInputResponseRequest, type SwapActiveSandboxRequest, type SwapActiveSandboxResponse, TTYD_SUBPROTOCOL, type TerminalCapability, type TerminalExecRequest, type TerminalExecResponse, type TerminalPtyExitedPayload, type TerminalPtyOutputDeltaPayload, type TerminalPtyStartedPayload, type ToolAuthNeededPayload, type ToolRef, type TranscriptionAdapter, type TranscriptionAdapterDescriptor, type TranscriptionAdapterStartContext, type TranscriptionAuthorization, type TranscriptionCredentialMode, type TranscriptionDiagnostic, type TranscriptionErrorCode, type TranscriptionEvent, type TranscriptionEventListener, type TranscriptionLifecycleStatus, type TranscriptionPolicyBlockReason, type TranscriptionResultMetadata, type TranscriptionSession, type TranscriptionSessionRequest, type TranscriptionSpeaker, type TranscriptionTargetSelection, type TranscriptionTimeSpan, type TranscriptionWord, TtydClientCommand, TtydServerCommand, type TurnInitiator, type UpdateConnectionRequest, type UpdateKnowledgeMemoryRequest, type UpdateRigRequest, type UpdateScheduledTaskRequest, type UpdateSessionGoalRequest, type UpdateSessionMcpApprovalPolicyRequest, type UpdateSessionMcpApprovalPolicyResponse, type UpdateSessionPinRequest, type UpdateSessionRequest, type UpdateSessionToolPolicyRequest, type UpdateVariableSetRequest, type UpdateWorkspaceEnvironmentRequest, type UpdateWorkspaceMemberRequest, type UpdateWorkspaceRequest, type UpdateWorkspaceSettingsRequest, type UploadFileInput, type UsageEvent, type UsageEventType, type UserApprovalDecisionEventInput, type UserHumanInputResponseEventInput, type UserMessageEventInput, type VariableSet, type VariableSetVariableMetadata, type ViewerHeartbeatRequest, type ViewerHeartbeatResponse, type ViewerHolder, type Workspace, type WorkspaceCaptureDegradedReason, type WorkspaceCaptureFile, type WorkspaceCaptureManifest, type WorkspaceCaptureRepo, type WorkspaceCaptureSignedUrl, type WorkspaceCaptureStats, type WorkspaceControlEvent, type WorkspaceControlEventPage, type WorkspaceControlStreamTransport, type WorkspaceEnvironment, type WorkspaceEnvironmentVariableMetadata, type WorkspaceInferenceControlResponse, type WorkspaceInstructionPolicyActivationEvent, type WorkspaceInstructionPolicyActivationResponse, type WorkspaceInstructionPolicyActivationType, type WorkspaceInstructionPolicyConflictResponse, type WorkspaceInstructionPolicyDiffRequest, type WorkspaceInstructionPolicyDiffResponse, type WorkspaceInstructionPolicyDraftProvenanceSource, type WorkspaceInstructionPolicyHead, type WorkspaceInstructionPolicyKind, type WorkspaceInstructionPolicyListOptions, type WorkspaceInstructionPolicyListResponse, type WorkspaceInstructionPolicyProvenanceSource, type WorkspaceInstructionPolicyRevision, type WorkspaceInstructionPolicyRevisionIdentity, type WorkspaceInstructionPolicyScope, type WorkspaceInstructionPolicyTarget, type WorkspaceMember, type WorkspaceMemorySearchMode, type WorkspaceMemorySearchRequest, type WorkspaceMemorySearchResponse, type WorkspaceMemorySearchResult, type WorkspaceModelCatalogModel, type WorkspaceModelCatalogResponse, type WorkspaceRegisteredPack, type WorkspaceRevisionCapturedPayload, type WorkspaceRevisionDegradedPayload, type WorkspaceSettings, type WorkspaceTranscriptionPolicy, type WorkspaceTranscriptionTarget, applyUrlRotation, authorizeTranscriptionAdapter, createTranscriptionSessionRequest, desktopSocketUrl, formatSseEvent, isRetryableStreamError, nextDesktopState, normalizeMcpOutput, normalizeWorkspaceInstructionPolicyRoleKey, parseSseStream, proxySessionEventStream, resolveWorkspaceTranscriptionPolicy, resumeSequenceFromRequest, sessionEventsToSseResponse, sessionEventsToSseStream, streamSessionEvents, streamWorkspaceControlEvents, terminalSocketUrl, ttydAuthFrame, ttydInputFrame, ttydResizeFrame };
|
package/dist/index.js
CHANGED
|
@@ -393,6 +393,9 @@ var SESSION_EVENT_TYPES = [
|
|
|
393
393
|
"goal.continuation",
|
|
394
394
|
"system.update.pending",
|
|
395
395
|
"system.update.delivered",
|
|
396
|
+
"system.update.superseded",
|
|
397
|
+
"system.update.cancelled",
|
|
398
|
+
"system.update.settled",
|
|
396
399
|
"session.control.paused",
|
|
397
400
|
"session.control.resumed",
|
|
398
401
|
"session.control.steer_requested",
|
|
@@ -2636,6 +2639,127 @@ function proxySessionEventStream(client, workspaceId, sessionId, options = {}) {
|
|
|
2636
2639
|
});
|
|
2637
2640
|
}
|
|
2638
2641
|
|
|
2642
|
+
// src/mcp-output.ts
|
|
2643
|
+
var MAX_MCP_OUTPUT_DEPTH = 8;
|
|
2644
|
+
var RESULT_ENVELOPE_KEYS = /* @__PURE__ */ new Set(["result", "isError", "jsonrpc", "id", "_meta"]);
|
|
2645
|
+
function normalizeMcpOutput(output) {
|
|
2646
|
+
const normalized = normalizeValue(output, 0, /* @__PURE__ */ new Set());
|
|
2647
|
+
return {
|
|
2648
|
+
raw: output,
|
|
2649
|
+
value: normalized.value,
|
|
2650
|
+
text: normalized.text,
|
|
2651
|
+
isError: normalized.isError
|
|
2652
|
+
};
|
|
2653
|
+
}
|
|
2654
|
+
function normalizeValue(value, depth, ancestors) {
|
|
2655
|
+
if (value === null || value === void 0) {
|
|
2656
|
+
return { value, text: "", isError: false };
|
|
2657
|
+
}
|
|
2658
|
+
if (typeof value === "string") {
|
|
2659
|
+
return normalizeText(value, depth, ancestors);
|
|
2660
|
+
}
|
|
2661
|
+
if (typeof value !== "object") {
|
|
2662
|
+
return { value, text: String(value), isError: false };
|
|
2663
|
+
}
|
|
2664
|
+
if (depth >= MAX_MCP_OUTPUT_DEPTH || ancestors.has(value)) {
|
|
2665
|
+
return { value, text: safeStringify(value), isError: false };
|
|
2666
|
+
}
|
|
2667
|
+
ancestors.add(value);
|
|
2668
|
+
try {
|
|
2669
|
+
if (Array.isArray(value)) {
|
|
2670
|
+
return { value, text: safeStringify(value), isError: false };
|
|
2671
|
+
}
|
|
2672
|
+
const record = value;
|
|
2673
|
+
const envelopeError = record.isError === true;
|
|
2674
|
+
if (record.type === "text" && typeof record.text === "string") {
|
|
2675
|
+
const normalized = normalizeText(record.text, depth + 1, ancestors);
|
|
2676
|
+
return {
|
|
2677
|
+
value: normalized.value,
|
|
2678
|
+
text: record.text,
|
|
2679
|
+
isError: envelopeError || normalized.isError
|
|
2680
|
+
};
|
|
2681
|
+
}
|
|
2682
|
+
if ("structuredContent" in record) {
|
|
2683
|
+
const normalized = normalizeValue(record.structuredContent, depth + 1, ancestors);
|
|
2684
|
+
return {
|
|
2685
|
+
value: normalized.value,
|
|
2686
|
+
text: firstMcpText(record.content) ?? normalized.text,
|
|
2687
|
+
isError: envelopeError || normalized.isError
|
|
2688
|
+
};
|
|
2689
|
+
}
|
|
2690
|
+
if (isMcpContent(record.content)) {
|
|
2691
|
+
const text = firstMcpText(record.content);
|
|
2692
|
+
if (text !== null) {
|
|
2693
|
+
const normalized = normalizeText(text, depth + 1, ancestors);
|
|
2694
|
+
return {
|
|
2695
|
+
value: normalized.value,
|
|
2696
|
+
text,
|
|
2697
|
+
isError: envelopeError || normalized.isError
|
|
2698
|
+
};
|
|
2699
|
+
}
|
|
2700
|
+
return {
|
|
2701
|
+
value,
|
|
2702
|
+
text: safeStringify(value),
|
|
2703
|
+
isError: envelopeError
|
|
2704
|
+
};
|
|
2705
|
+
}
|
|
2706
|
+
if (isResultEnvelope(record)) {
|
|
2707
|
+
const normalized = normalizeValue(record.result, depth + 1, ancestors);
|
|
2708
|
+
return {
|
|
2709
|
+
value: normalized.value,
|
|
2710
|
+
text: normalized.text,
|
|
2711
|
+
isError: envelopeError || normalized.isError
|
|
2712
|
+
};
|
|
2713
|
+
}
|
|
2714
|
+
return {
|
|
2715
|
+
value,
|
|
2716
|
+
text: safeStringify(value),
|
|
2717
|
+
isError: envelopeError
|
|
2718
|
+
};
|
|
2719
|
+
} finally {
|
|
2720
|
+
ancestors.delete(value);
|
|
2721
|
+
}
|
|
2722
|
+
}
|
|
2723
|
+
function normalizeText(text, depth, ancestors) {
|
|
2724
|
+
try {
|
|
2725
|
+
const parsed = JSON.parse(text);
|
|
2726
|
+
const normalized = normalizeValue(parsed, depth + 1, ancestors);
|
|
2727
|
+
return {
|
|
2728
|
+
value: normalized.value,
|
|
2729
|
+
text,
|
|
2730
|
+
isError: normalized.isError
|
|
2731
|
+
};
|
|
2732
|
+
} catch {
|
|
2733
|
+
return { value: text, text, isError: false };
|
|
2734
|
+
}
|
|
2735
|
+
}
|
|
2736
|
+
function isMcpContent(value) {
|
|
2737
|
+
return Array.isArray(value) && value.some(
|
|
2738
|
+
(part) => part !== null && typeof part === "object" && typeof part.type === "string"
|
|
2739
|
+
);
|
|
2740
|
+
}
|
|
2741
|
+
function firstMcpText(value) {
|
|
2742
|
+
if (!Array.isArray(value)) {
|
|
2743
|
+
return null;
|
|
2744
|
+
}
|
|
2745
|
+
for (const part of value) {
|
|
2746
|
+
if (part !== null && typeof part === "object" && part.type === "text" && typeof part.text === "string") {
|
|
2747
|
+
return part.text;
|
|
2748
|
+
}
|
|
2749
|
+
}
|
|
2750
|
+
return null;
|
|
2751
|
+
}
|
|
2752
|
+
function isResultEnvelope(record) {
|
|
2753
|
+
return "result" in record && Object.keys(record).every((key) => RESULT_ENVELOPE_KEYS.has(key));
|
|
2754
|
+
}
|
|
2755
|
+
function safeStringify(value) {
|
|
2756
|
+
try {
|
|
2757
|
+
return JSON.stringify(value) ?? "";
|
|
2758
|
+
} catch {
|
|
2759
|
+
return String(value);
|
|
2760
|
+
}
|
|
2761
|
+
}
|
|
2762
|
+
|
|
2639
2763
|
// src/desktop.ts
|
|
2640
2764
|
function desktopSocketUrl(cap) {
|
|
2641
2765
|
if (!cap.url) {
|
|
@@ -2966,6 +3090,7 @@ export {
|
|
|
2966
3090
|
formatSseEvent,
|
|
2967
3091
|
isRetryableStreamError,
|
|
2968
3092
|
nextDesktopState,
|
|
3093
|
+
normalizeMcpOutput,
|
|
2969
3094
|
normalizeWorkspaceInstructionPolicyRoleKey,
|
|
2970
3095
|
parseSseStream,
|
|
2971
3096
|
proxySessionEventStream,
|