@opengeni/contracts 0.21.0 → 0.23.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/index.d.ts +971 -252
- package/dist/index.js +157 -35
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +241 -68
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -626,6 +626,77 @@ export const DEFAULT_FIRST_PARTY_MCP_PERMISSIONS = [
|
|
|
626
626
|
"github:use",
|
|
627
627
|
] as const satisfies readonly Permission[];
|
|
628
628
|
|
|
629
|
+
/**
|
|
630
|
+
* Exact public catalog for tools served by the broad first-party `opengeni`
|
|
631
|
+
* MCP server. Adding a registration does not make it model-visible: the name
|
|
632
|
+
* must be admitted here and selected by the session policy.
|
|
633
|
+
*
|
|
634
|
+
* `files_get_download_url` intentionally is not in this catalog. It belongs to
|
|
635
|
+
* the dedicated `files` MCP server.
|
|
636
|
+
*/
|
|
637
|
+
export const FIRST_PARTY_MCP_TOOL_NAMES = [
|
|
638
|
+
"set_session_title",
|
|
639
|
+
"goal_set",
|
|
640
|
+
"goal_update",
|
|
641
|
+
"goal_complete",
|
|
642
|
+
"goal_pause",
|
|
643
|
+
"memory_search",
|
|
644
|
+
"memory_save",
|
|
645
|
+
"memory_correct",
|
|
646
|
+
"sandboxes_list",
|
|
647
|
+
"sandbox_attach",
|
|
648
|
+
"sandbox_swap",
|
|
649
|
+
"run_on",
|
|
650
|
+
"sandbox_provision",
|
|
651
|
+
"rig_list",
|
|
652
|
+
"rig_get",
|
|
653
|
+
"rig_propose_change",
|
|
654
|
+
"rig_verify",
|
|
655
|
+
"rig_promote",
|
|
656
|
+
"sessions_list",
|
|
657
|
+
"session_get",
|
|
658
|
+
"session_events",
|
|
659
|
+
"session_create",
|
|
660
|
+
"session_send_message",
|
|
661
|
+
"session_pause",
|
|
662
|
+
"session_resume",
|
|
663
|
+
"session_steer",
|
|
664
|
+
"set_other_session_title",
|
|
665
|
+
"variable_set_list",
|
|
666
|
+
"environment_list",
|
|
667
|
+
"variable_set_set_variable",
|
|
668
|
+
"environment_set_variable",
|
|
669
|
+
"github_connect_link",
|
|
670
|
+
"github_token",
|
|
671
|
+
"github_repositories_list",
|
|
672
|
+
"social_connections_list",
|
|
673
|
+
"social_posts_recent",
|
|
674
|
+
"social_daily_analysis_context",
|
|
675
|
+
"scheduled_tasks_list",
|
|
676
|
+
"scheduled_tasks_get",
|
|
677
|
+
"scheduled_tasks_create",
|
|
678
|
+
"scheduled_tasks_update",
|
|
679
|
+
"scheduled_tasks_pause",
|
|
680
|
+
"scheduled_tasks_resume",
|
|
681
|
+
"scheduled_tasks_trigger",
|
|
682
|
+
"scheduled_tasks_delete",
|
|
683
|
+
"scheduled_task_runs_list",
|
|
684
|
+
"slack_bot_list_channels",
|
|
685
|
+
"slack_bot_channel_history",
|
|
686
|
+
"slack_bot_list_users",
|
|
687
|
+
"slack_bot_post_message",
|
|
688
|
+
] as const;
|
|
689
|
+
export const FirstPartyMcpToolName = z.enum(FIRST_PARTY_MCP_TOOL_NAMES);
|
|
690
|
+
export type FirstPartyMcpToolName = z.infer<typeof FirstPartyMcpToolName>;
|
|
691
|
+
|
|
692
|
+
/**
|
|
693
|
+
* Every catalogued OpenGeni tool is selected by default. Registration-time
|
|
694
|
+
* authorization remains the independent access boundary; an explicit session
|
|
695
|
+
* policy may narrow this model-visible set.
|
|
696
|
+
*/
|
|
697
|
+
export const DEFAULT_FIRST_PARTY_MCP_TOOLS =
|
|
698
|
+
FIRST_PARTY_MCP_TOOL_NAMES satisfies readonly FirstPartyMcpToolName[];
|
|
699
|
+
|
|
629
700
|
export function prefixedMcpToolName(registryId: string, toolName: string): string {
|
|
630
701
|
return `${registryId}__${toolName}`;
|
|
631
702
|
}
|
|
@@ -1139,6 +1210,9 @@ export const DelegatedAccessTokenPayload = z
|
|
|
1139
1210
|
// Worker-asserted session scope for first-party MCP calls (HMAC-signed, not
|
|
1140
1211
|
// agent-controlled); enables session-scoped tools such as goal management.
|
|
1141
1212
|
sessionId: z.string().uuid().optional(),
|
|
1213
|
+
// Model-visible first-party tool selection for a worker-bound session.
|
|
1214
|
+
// This is visibility only; permissions remain the authorization boundary.
|
|
1215
|
+
firstPartyMcpTools: z.array(FirstPartyMcpToolName).optional(),
|
|
1142
1216
|
// The turn making the call (the caller's identity), HMAC-signed by the worker
|
|
1143
1217
|
// at turn setup. Lets a tool classify WHO is calling from the token itself,
|
|
1144
1218
|
// instead of racily re-reading the session's live active_turn_id — e.g. the
|
|
@@ -2186,6 +2260,11 @@ export type GitHubInstallationSummary = {
|
|
|
2186
2260
|
|
|
2187
2261
|
export type GitHubInstallationAuthorityKind = "personal_owner" | "organization_owner";
|
|
2188
2262
|
|
|
2263
|
+
export interface GitHubInstallationBindingCandidate {
|
|
2264
|
+
installation: GitHubInstallationSummary;
|
|
2265
|
+
authorityKind: GitHubInstallationAuthorityKind;
|
|
2266
|
+
}
|
|
2267
|
+
|
|
2189
2268
|
export interface GitHubInstallationBindingProof {
|
|
2190
2269
|
actorId: number;
|
|
2191
2270
|
actorLogin: string;
|
|
@@ -2223,6 +2302,15 @@ export type GitHubAppApiPort = {
|
|
|
2223
2302
|
code: string;
|
|
2224
2303
|
installationId: number;
|
|
2225
2304
|
}) => Promise<GitHubInstallationBindingProof>;
|
|
2305
|
+
/**
|
|
2306
|
+
* Exchange one fresh GitHub user-authorization code and return only existing
|
|
2307
|
+
* App installations for which that exact human is the personal owner or an
|
|
2308
|
+
* active organization owner. Visibility and repository permissions alone
|
|
2309
|
+
* must never produce a candidate.
|
|
2310
|
+
*/
|
|
2311
|
+
discoverInstallationBindingCandidates?: (input: {
|
|
2312
|
+
code: string;
|
|
2313
|
+
}) => Promise<GitHubInstallationBindingCandidate[]>;
|
|
2226
2314
|
authorizeUser?: (input: { code: string }) => Promise<GitHubUserInstallationAccess[]>;
|
|
2227
2315
|
verifyInstallationAccessForUser?: (input: {
|
|
2228
2316
|
code: string;
|
|
@@ -2821,12 +2909,9 @@ const registryId = /^[A-Za-z0-9_-]+$/;
|
|
|
2821
2909
|
export const SessionMcpServerId = z.string().min(1).regex(registryId);
|
|
2822
2910
|
export type SessionMcpServerId = z.infer<typeof SessionMcpServerId>;
|
|
2823
2911
|
|
|
2824
|
-
// How a session's persisted
|
|
2825
|
-
// reserved for rows written before this descriptor existed; those rows must
|
|
2826
|
-
// keep their materialized historical allow-list rather than being guessed to
|
|
2827
|
-
// mean either omitted or explicitly empty.
|
|
2912
|
+
// How a session's persisted tool selection was chosen.
|
|
2828
2913
|
export const SessionToolPolicy = z.object({
|
|
2829
|
-
mode: z.enum(["workspace_default", "explicit", "inherited"
|
|
2914
|
+
mode: z.enum(["workspace_default", "explicit", "inherited"]),
|
|
2830
2915
|
inheritedFromSessionId: z.string().uuid().nullable(),
|
|
2831
2916
|
});
|
|
2832
2917
|
export type SessionToolPolicy = z.infer<typeof SessionToolPolicy>;
|
|
@@ -2848,7 +2933,7 @@ const SessionEffectiveToolPolicyIds = z
|
|
|
2848
2933
|
// counts remain exact and idsTruncated makes that explicit to clients.
|
|
2849
2934
|
export const SessionEffectiveToolPolicy = z
|
|
2850
2935
|
.object({
|
|
2851
|
-
mode: z.enum(["workspace_default", "explicit", "inherited"
|
|
2936
|
+
mode: z.enum(["workspace_default", "explicit", "inherited"]),
|
|
2852
2937
|
inheritedFromSessionId: z.string().uuid().nullable(),
|
|
2853
2938
|
selectedIds: SessionEffectiveToolPolicyIds,
|
|
2854
2939
|
effectiveIds: SessionEffectiveToolPolicyIds,
|
|
@@ -3226,10 +3311,9 @@ export const UpdateSessionRequest = z.object({
|
|
|
3226
3311
|
export type UpdateSessionRequest = z.infer<typeof UpdateSessionRequest>;
|
|
3227
3312
|
|
|
3228
3313
|
/**
|
|
3229
|
-
* Replace
|
|
3230
|
-
* to
|
|
3231
|
-
*
|
|
3232
|
-
* was supported.
|
|
3314
|
+
* Replace the complete durable session tool policy, or explicitly opt back in
|
|
3315
|
+
* to current workspace defaults. MCP servers and individual OpenGeni tools
|
|
3316
|
+
* advance atomically under one policy version.
|
|
3233
3317
|
*/
|
|
3234
3318
|
export const UpdateSessionToolPolicyRequest = z.union([
|
|
3235
3319
|
z
|
|
@@ -3240,8 +3324,9 @@ export const UpdateSessionToolPolicyRequest = z.union([
|
|
|
3240
3324
|
.strict(),
|
|
3241
3325
|
z
|
|
3242
3326
|
.object({
|
|
3243
|
-
mode: z.literal("explicit")
|
|
3327
|
+
mode: z.literal("explicit"),
|
|
3244
3328
|
tools: z.array(ToolRef).max(64),
|
|
3329
|
+
firstPartyMcpTools: z.array(FirstPartyMcpToolName),
|
|
3245
3330
|
expectedVersion: z.number().int().positive(),
|
|
3246
3331
|
})
|
|
3247
3332
|
.strict(),
|
|
@@ -3596,10 +3681,6 @@ export const ComposerDraft = z.object({
|
|
|
3596
3681
|
revision: z.number().int().nonnegative(),
|
|
3597
3682
|
text: z.string(),
|
|
3598
3683
|
resources: z.array(ResourceRef),
|
|
3599
|
-
tools: z.array(ToolRef),
|
|
3600
|
-
// False means the draft inherits the session policy. True preserves an
|
|
3601
|
-
// explicit array, including [], across autosave/reload and queue checkout.
|
|
3602
|
-
toolsProvided: z.boolean().default(false),
|
|
3603
3684
|
model: z.string().min(1),
|
|
3604
3685
|
reasoningEffort: ReasoningEffort,
|
|
3605
3686
|
sourceTurnId: z.string().uuid().nullable(),
|
|
@@ -3608,21 +3689,6 @@ export const ComposerDraft = z.object({
|
|
|
3608
3689
|
});
|
|
3609
3690
|
export type ComposerDraft = z.infer<typeof ComposerDraft>;
|
|
3610
3691
|
|
|
3611
|
-
export const SessionQueueSnapshot = z.object({
|
|
3612
|
-
version: z.number().int().nonnegative(),
|
|
3613
|
-
effectiveControl: EffectiveSessionControl,
|
|
3614
|
-
/**
|
|
3615
|
-
* True while the latest attempt is interrupted but has not durably proved
|
|
3616
|
-
* quiescence: no more inference, user-visible output, or workspace-persistence
|
|
3617
|
-
* authority. Temporal cancellation/terminalization is not that proof. This is
|
|
3618
|
-
* distinct from ordinary capacity queueing, remains accurate with an empty
|
|
3619
|
-
* visible queue, and is independent of Steer-row metadata or withdrawal.
|
|
3620
|
-
*/
|
|
3621
|
-
stoppingPreviousAttempt: z.boolean(),
|
|
3622
|
-
items: z.array(SessionTurn),
|
|
3623
|
-
});
|
|
3624
|
-
export type SessionQueueSnapshot = z.infer<typeof SessionQueueSnapshot>;
|
|
3625
|
-
|
|
3626
3692
|
export const MoveSessionQueueItemRequest = z.object({
|
|
3627
3693
|
clientEventId: SessionOperationKey,
|
|
3628
3694
|
expectedQueueVersion: z.number().int().nonnegative(),
|
|
@@ -3655,8 +3721,6 @@ export type DeleteSessionQueueItemRequest = z.infer<typeof DeleteSessionQueueIte
|
|
|
3655
3721
|
export const SaveComposerDraftRequest = ComposerDraft.pick({
|
|
3656
3722
|
text: true,
|
|
3657
3723
|
resources: true,
|
|
3658
|
-
tools: true,
|
|
3659
|
-
toolsProvided: true,
|
|
3660
3724
|
model: true,
|
|
3661
3725
|
reasoningEffort: true,
|
|
3662
3726
|
}).extend({ expectedRevision: z.number().int().nonnegative() });
|
|
@@ -3675,6 +3739,7 @@ export const NewSessionDraftOptions = z.object({
|
|
|
3675
3739
|
rigId: z.string().uuid().optional(),
|
|
3676
3740
|
goal: GoalSpec.optional(),
|
|
3677
3741
|
firstPartyMcpPermissions: z.array(Permission).optional(),
|
|
3742
|
+
firstPartyMcpTools: z.array(FirstPartyMcpToolName).optional(),
|
|
3678
3743
|
});
|
|
3679
3744
|
export type NewSessionDraftOptions = z.infer<typeof NewSessionDraftOptions>;
|
|
3680
3745
|
|
|
@@ -3974,7 +4039,6 @@ export type SessionSystemUpdatePayload = z.infer<typeof SessionSystemUpdatePaylo
|
|
|
3974
4039
|
|
|
3975
4040
|
export const SessionSystemUpdateState = z.enum([
|
|
3976
4041
|
"pending",
|
|
3977
|
-
"deferred",
|
|
3978
4042
|
"delivered",
|
|
3979
4043
|
"cancelled",
|
|
3980
4044
|
"superseded",
|
|
@@ -3994,11 +4058,104 @@ export const SessionSystemUpdate = z.object({
|
|
|
3994
4058
|
lineage: z.record(z.string(), z.unknown()),
|
|
3995
4059
|
state: SessionSystemUpdateState,
|
|
3996
4060
|
deliveredTurnId: z.string().uuid().nullable(),
|
|
4061
|
+
/**
|
|
4062
|
+
* The exact durable model-memory row containing the coalesced batch that
|
|
4063
|
+
* delivered this update. Null until claim; every member of one batch shares
|
|
4064
|
+
* the same id.
|
|
4065
|
+
*/
|
|
4066
|
+
deliveredHistoryItemId: z.string().uuid().nullable(),
|
|
3997
4067
|
deliveredAt: z.string().nullable(),
|
|
3998
4068
|
createdAt: z.string(),
|
|
3999
4069
|
});
|
|
4000
4070
|
export type SessionSystemUpdate = z.infer<typeof SessionSystemUpdate>;
|
|
4001
4071
|
|
|
4072
|
+
/**
|
|
4073
|
+
* Bounded queue projection of a canonical pending machine input. Full payload,
|
|
4074
|
+
* lineage, and dedupe data remain in canonical storage and never inflate the
|
|
4075
|
+
* hot queue response.
|
|
4076
|
+
*/
|
|
4077
|
+
export const SessionPendingInputPreview = SessionSystemUpdate.pick({
|
|
4078
|
+
id: true,
|
|
4079
|
+
sessionId: true,
|
|
4080
|
+
kind: true,
|
|
4081
|
+
classification: true,
|
|
4082
|
+
sourceId: true,
|
|
4083
|
+
summary: true,
|
|
4084
|
+
createdAt: true,
|
|
4085
|
+
});
|
|
4086
|
+
export type SessionPendingInputPreview = z.infer<typeof SessionPendingInputPreview>;
|
|
4087
|
+
|
|
4088
|
+
export const SessionQueueSnapshot = z.object({
|
|
4089
|
+
version: z.number().int().nonnegative(),
|
|
4090
|
+
effectiveControl: EffectiveSessionControl,
|
|
4091
|
+
/**
|
|
4092
|
+
* True while the latest attempt is interrupted but has not durably proved
|
|
4093
|
+
* quiescence: no more inference, user-visible output, or workspace-persistence
|
|
4094
|
+
* authority. Temporal cancellation/terminalization is not that proof. This is
|
|
4095
|
+
* distinct from ordinary capacity queueing, remains accurate with an empty
|
|
4096
|
+
* visible queue, and is independent of Steer-row metadata or withdrawal.
|
|
4097
|
+
*/
|
|
4098
|
+
stoppingPreviousAttempt: z.boolean(),
|
|
4099
|
+
items: z.array(SessionTurn),
|
|
4100
|
+
/** Canonical bounded previews; never reconstructed from session events. */
|
|
4101
|
+
pendingInputs: z.array(SessionPendingInputPreview),
|
|
4102
|
+
/**
|
|
4103
|
+
* Exact members of the next bounded machine-input batch that will join an
|
|
4104
|
+
* already-waiting human/API prompt. Null means the next machine-input claim
|
|
4105
|
+
* is standalone. This is a projection of canonical rows, not queue state.
|
|
4106
|
+
*/
|
|
4107
|
+
pendingInputAttachment: z
|
|
4108
|
+
.object({
|
|
4109
|
+
turnId: z.string().uuid(),
|
|
4110
|
+
inputIds: z.array(z.string().uuid()).min(1),
|
|
4111
|
+
})
|
|
4112
|
+
.nullable(),
|
|
4113
|
+
});
|
|
4114
|
+
export type SessionQueueSnapshot = z.infer<typeof SessionQueueSnapshot>;
|
|
4115
|
+
|
|
4116
|
+
/**
|
|
4117
|
+
* Deterministic, protocol-safe model representation of one claimed machine
|
|
4118
|
+
* input batch. This exact string is persisted before inference and replayed on
|
|
4119
|
+
* every later turn; callers must not synthesize an equivalent transient copy.
|
|
4120
|
+
*/
|
|
4121
|
+
export function renderSessionSystemUpdateBatch(
|
|
4122
|
+
updates: ReadonlyArray<
|
|
4123
|
+
Pick<
|
|
4124
|
+
SessionSystemUpdate,
|
|
4125
|
+
"id" | "kind" | "classification" | "sourceId" | "summary" | "payload" | "lineage"
|
|
4126
|
+
>
|
|
4127
|
+
>,
|
|
4128
|
+
): string {
|
|
4129
|
+
if (updates.length === 0) {
|
|
4130
|
+
throw new TypeError("A durable machine-input batch requires at least one update");
|
|
4131
|
+
}
|
|
4132
|
+
return [
|
|
4133
|
+
"[OpenGeni internal updates]",
|
|
4134
|
+
"These platform updates were delivered together for this inference. They are not human prompts.",
|
|
4135
|
+
JSON.stringify({
|
|
4136
|
+
updates: updates.map((update) => ({
|
|
4137
|
+
id: update.id,
|
|
4138
|
+
kind: update.kind,
|
|
4139
|
+
classification: update.classification,
|
|
4140
|
+
sourceId: update.sourceId,
|
|
4141
|
+
summary: update.summary,
|
|
4142
|
+
payload: update.payload,
|
|
4143
|
+
lineage: update.lineage,
|
|
4144
|
+
})),
|
|
4145
|
+
}),
|
|
4146
|
+
].join("\n");
|
|
4147
|
+
}
|
|
4148
|
+
|
|
4149
|
+
export function sessionSystemUpdateBatchHistoryItem(
|
|
4150
|
+
updates: Parameters<typeof renderSessionSystemUpdateBatch>[0],
|
|
4151
|
+
): { type: "message"; role: "system"; content: string } {
|
|
4152
|
+
return {
|
|
4153
|
+
type: "message",
|
|
4154
|
+
role: "system",
|
|
4155
|
+
content: renderSessionSystemUpdateBatch(updates),
|
|
4156
|
+
};
|
|
4157
|
+
}
|
|
4158
|
+
|
|
4002
4159
|
export const VariableSetVariableName = z
|
|
4003
4160
|
.string()
|
|
4004
4161
|
.regex(/^[A-Z][A-Z0-9_]*$/)
|
|
@@ -5049,13 +5206,9 @@ export const Session = z.object({
|
|
|
5049
5206
|
resources: z.array(ResourceRef),
|
|
5050
5207
|
skills: SessionSkills.default([]),
|
|
5051
5208
|
tools: z.array(ToolRef),
|
|
5052
|
-
// Origin
|
|
5053
|
-
|
|
5054
|
-
|
|
5055
|
-
// Optimistic-concurrency fence for durable policy mutations. Optional for
|
|
5056
|
-
// older clients/fixtures; current servers always emit the authoritative
|
|
5057
|
-
// value.
|
|
5058
|
-
toolPolicyVersion: z.number().int().positive().optional(),
|
|
5209
|
+
// Origin and optimistic-concurrency fence for the durable session policy.
|
|
5210
|
+
toolPolicy: SessionToolPolicy,
|
|
5211
|
+
toolPolicyVersion: z.number().int().positive(),
|
|
5059
5212
|
// Secret-safe current resolution, computed at an API/read or execution
|
|
5060
5213
|
// boundary from IDs only. Optional because internal DB readers need not load
|
|
5061
5214
|
// the workspace runtime registry.
|
|
@@ -5092,6 +5245,9 @@ export const Session = z.object({
|
|
|
5092
5245
|
// Non-default first-party MCP token permissions (manager-style sessions);
|
|
5093
5246
|
// null means the fixed worker default set.
|
|
5094
5247
|
firstPartyMcpPermissions: z.array(Permission).nullable(),
|
|
5248
|
+
// Exact model-visible OpenGeni selection. All catalogued tools are selected
|
|
5249
|
+
// by default; [] intentionally selects none.
|
|
5250
|
+
firstPartyMcpTools: z.array(FirstPartyMcpToolName),
|
|
5095
5251
|
// Per-session third-party MCP servers, metadata only. Credential values are
|
|
5096
5252
|
// write-only and never appear here.
|
|
5097
5253
|
mcpServers: z.array(SessionMcpServerMetadata).default([]),
|
|
@@ -5264,6 +5420,9 @@ export const SessionEventType = z.enum([
|
|
|
5264
5420
|
"goal.continuation",
|
|
5265
5421
|
"system.update.pending",
|
|
5266
5422
|
"system.update.delivered",
|
|
5423
|
+
"system.update.superseded",
|
|
5424
|
+
"system.update.cancelled",
|
|
5425
|
+
"system.update.settled",
|
|
5267
5426
|
"session.control.paused",
|
|
5268
5427
|
"session.control.resumed",
|
|
5269
5428
|
"session.control.steer_requested",
|
|
@@ -5464,6 +5623,9 @@ export const SESSION_EVENT_SEMANTIC_CLASS_TYPES = {
|
|
|
5464
5623
|
"goal.continuation",
|
|
5465
5624
|
"system.update.pending",
|
|
5466
5625
|
"system.update.delivered",
|
|
5626
|
+
"system.update.superseded",
|
|
5627
|
+
"system.update.cancelled",
|
|
5628
|
+
"system.update.settled",
|
|
5467
5629
|
"session.control.paused",
|
|
5468
5630
|
"session.control.resumed",
|
|
5469
5631
|
"session.control.steer_requested",
|
|
@@ -7377,6 +7539,10 @@ export const CreateSessionRequest = withVariableSetIdAlias({
|
|
|
7377
7539
|
// A goal-bearing session whose explicit/effective set omits goals:manage is
|
|
7378
7540
|
// rejected; creation never silently expands a child beyond that set.
|
|
7379
7541
|
firstPartyMcpPermissions: z.array(Permission).optional(),
|
|
7542
|
+
// Exact model-visible selection from the broad first-party OpenGeni MCP
|
|
7543
|
+
// catalog. Omission selects the full catalog; [] intentionally exposes none.
|
|
7544
|
+
// This does not grant authority: every registered tool is permission-gated.
|
|
7545
|
+
firstPartyMcpTools: z.array(FirstPartyMcpToolName).optional(),
|
|
7380
7546
|
// Third-party MCP servers attached only to this session. For an agent-created
|
|
7381
7547
|
// child, omission snapshots its trusted immediate parent's server definitions,
|
|
7382
7548
|
// policies, connection refs, and encrypted credentials. Explicit arrays,
|
|
@@ -7588,21 +7754,22 @@ export const ClientSessionEvent = z.discriminatedUnion("type", [
|
|
|
7588
7754
|
z.object({
|
|
7589
7755
|
type: z.literal("user.message"),
|
|
7590
7756
|
clientEventId: SessionOperationKey.optional(),
|
|
7591
|
-
payload: z
|
|
7592
|
-
|
|
7593
|
-
|
|
7594
|
-
|
|
7595
|
-
|
|
7596
|
-
|
|
7597
|
-
|
|
7598
|
-
|
|
7599
|
-
|
|
7600
|
-
|
|
7601
|
-
|
|
7602
|
-
|
|
7603
|
-
|
|
7604
|
-
|
|
7605
|
-
|
|
7757
|
+
payload: z
|
|
7758
|
+
.object({
|
|
7759
|
+
text: z.string().min(1),
|
|
7760
|
+
// System-level host context for this exact turn only. Persisted on the
|
|
7761
|
+
// turn for retry/recovery, never copied into the visible user message.
|
|
7762
|
+
turnInstructions: z.string().trim().min(1).max(32768).optional(),
|
|
7763
|
+
resources: z.array(ResourceRef).default([]),
|
|
7764
|
+
model: z.string().min(1).optional(),
|
|
7765
|
+
reasoningEffort: ReasoningEffort.optional(),
|
|
7766
|
+
controlEtag: z.string().min(1).optional(),
|
|
7767
|
+
expectedDraftRevision: z.number().int().nonnegative().optional(),
|
|
7768
|
+
// Header-value rotation only. URL/name/tool settings are immutable after
|
|
7769
|
+
// session create; persisted events expose metadata, never header values.
|
|
7770
|
+
mcpCredentialUpdates: z.array(SessionMcpCredentialUpdateInput).optional(),
|
|
7771
|
+
})
|
|
7772
|
+
.strict(),
|
|
7606
7773
|
}),
|
|
7607
7774
|
z.object({
|
|
7608
7775
|
type: z.literal("user.approvalDecision"),
|
|
@@ -7624,19 +7791,20 @@ export const ClientSessionEvent = z.discriminatedUnion("type", [
|
|
|
7624
7791
|
]);
|
|
7625
7792
|
export type ClientSessionEvent = z.infer<typeof ClientSessionEvent>;
|
|
7626
7793
|
|
|
7627
|
-
export const SteerSessionMessageRequest = z
|
|
7628
|
-
|
|
7629
|
-
|
|
7630
|
-
|
|
7631
|
-
|
|
7632
|
-
|
|
7633
|
-
|
|
7634
|
-
|
|
7635
|
-
|
|
7636
|
-
|
|
7637
|
-
|
|
7638
|
-
|
|
7639
|
-
})
|
|
7794
|
+
export const SteerSessionMessageRequest = z
|
|
7795
|
+
.object({
|
|
7796
|
+
text: z.string().min(1),
|
|
7797
|
+
// Same per-turn system-level context as a queued user.message.
|
|
7798
|
+
turnInstructions: z.string().trim().min(1).max(32768).optional(),
|
|
7799
|
+
resources: z.array(ResourceRef).default([]),
|
|
7800
|
+
model: z.string().min(1).optional(),
|
|
7801
|
+
reasoningEffort: ReasoningEffort.optional(),
|
|
7802
|
+
clientEventId: SessionOperationKey.optional(),
|
|
7803
|
+
controlEtag: z.string().min(1).optional(),
|
|
7804
|
+
expectedDraftRevision: z.number().int().nonnegative().optional(),
|
|
7805
|
+
mcpCredentialUpdates: z.array(SessionMcpCredentialUpdateInput).optional(),
|
|
7806
|
+
})
|
|
7807
|
+
.strict();
|
|
7640
7808
|
export type SteerSessionMessageRequest = z.infer<typeof SteerSessionMessageRequest>;
|
|
7641
7809
|
|
|
7642
7810
|
export const SteerSessionMessageResponse = z.object({
|
|
@@ -7680,6 +7848,9 @@ export type GitHubRepositoryScope = z.infer<typeof GitHubRepositoryScope>;
|
|
|
7680
7848
|
export const GitHubBindingStatus = z.enum(["disabled", "unbound", "bound"]);
|
|
7681
7849
|
export type GitHubBindingStatus = z.infer<typeof GitHubBindingStatus>;
|
|
7682
7850
|
|
|
7851
|
+
export const GitHubAppSetupMode = z.enum(["platform", "operator"]);
|
|
7852
|
+
export type GitHubAppSetupMode = z.infer<typeof GitHubAppSetupMode>;
|
|
7853
|
+
|
|
7683
7854
|
export const GitHubInstallationLifecycle = z.enum(["active", "suspended", "deleted", "unverified"]);
|
|
7684
7855
|
export type GitHubInstallationLifecycle = z.infer<typeof GitHubInstallationLifecycle>;
|
|
7685
7856
|
|
|
@@ -7691,6 +7862,7 @@ export const GitHubInstallationBinding = z.object({
|
|
|
7691
7862
|
lifecycle: GitHubInstallationLifecycle,
|
|
7692
7863
|
repositoryScope: GitHubRepositoryScope,
|
|
7693
7864
|
repositoryCount: z.number().int().nonnegative(),
|
|
7865
|
+
configureUrl: z.string().url().nullable(),
|
|
7694
7866
|
createdAt: z.string(),
|
|
7695
7867
|
updatedAt: z.string(),
|
|
7696
7868
|
});
|
|
@@ -7699,6 +7871,7 @@ export type GitHubInstallationBinding = z.infer<typeof GitHubInstallationBinding
|
|
|
7699
7871
|
export const GitHubAppInfo = z.object({
|
|
7700
7872
|
configured: z.boolean(),
|
|
7701
7873
|
status: GitHubBindingStatus,
|
|
7874
|
+
setupMode: GitHubAppSetupMode,
|
|
7702
7875
|
appId: z.string().nullable(),
|
|
7703
7876
|
clientId: z.string().nullable(),
|
|
7704
7877
|
appSlug: z.string().nullable(),
|