@opengeni/contracts 1.0.2 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/connect.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  IntegrationInstanceKey,
3
3
  IntegrationSource
4
- } from "./chunk-X7ETVO4P.js";
4
+ } from "./chunk-VSM752ZW.js";
5
5
  import "./chunk-5IXYF6XN.js";
6
6
  import "./chunk-NRMCVHAU.js";
7
7
  import "./chunk-WYBDERIY.js";
@@ -6,8 +6,8 @@ import {
6
6
  ConnectionUseAuthorizationResult,
7
7
  ConnectionUseDenialReason,
8
8
  ConnectionUseSelectionSource
9
- } from "./chunk-46KLD2UH.js";
10
- import "./chunk-X7ETVO4P.js";
9
+ } from "./chunk-6GXQBK6J.js";
10
+ import "./chunk-VSM752ZW.js";
11
11
  import "./chunk-5IXYF6XN.js";
12
12
  import "./chunk-NRMCVHAU.js";
13
13
  import "./chunk-WYBDERIY.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  ConnectionMetadata
3
- } from "./chunk-X7ETVO4P.js";
3
+ } from "./chunk-VSM752ZW.js";
4
4
  import "./chunk-5IXYF6XN.js";
5
5
  import "./chunk-NRMCVHAU.js";
6
6
  import {
@@ -3,14 +3,14 @@ import {
3
3
  } from "./chunk-KR2V42UZ.js";
4
4
  import {
5
5
  ConnectionUseAuthoritySnapshot
6
- } from "./chunk-46KLD2UH.js";
6
+ } from "./chunk-6GXQBK6J.js";
7
7
  import {
8
8
  HostMcpCreateSelections,
9
9
  ManagedUserResourceGrantMode,
10
10
  McpServerConnectionRef,
11
11
  SessionTenancyVisibility,
12
12
  stableJson
13
- } from "./chunk-X7ETVO4P.js";
13
+ } from "./chunk-VSM752ZW.js";
14
14
  import "./chunk-5IXYF6XN.js";
15
15
  import "./chunk-NRMCVHAU.js";
16
16
  import "./chunk-WYBDERIY.js";
package/dist/index.d.ts CHANGED
@@ -8537,6 +8537,8 @@ export declare const SessionGoalContinuation: z.ZodObject<{
8537
8537
  holdReason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
8538
8538
  }, z.core.$strip>;
8539
8539
  export type SessionGoalContinuation = z.infer<typeof SessionGoalContinuation>;
8540
+ /** New admission pauses are specific; the wire field remains open for older peers. */
8541
+ export type GoalAdmissionPausedReason = "model_unavailable" | "model_policy" | "credits" | "budget" | "usage_limit" | "usage_policy" | "allowance";
8540
8542
  export declare const SessionGoal: z.ZodObject<{
8541
8543
  id: z.ZodString;
8542
8544
  accountId: z.ZodString;
@@ -18814,7 +18816,8 @@ export type KnowledgeSourceSyncRunSummary = z.infer<typeof KnowledgeSourceSyncRu
18814
18816
  * means every occurrence is refused until the task or a resource it names
18815
18817
  * changes. Known reasons: `scheduled_authority_unavailable`,
18816
18818
  * `machine_target_unavailable`, `machine_enrollment_inactive`,
18817
- * `variable_set_unavailable`, `rig_version_unavailable` (terminal) and
18819
+ * `variable_set_unavailable`, `rig_version_unavailable`, `scheduled_model_unavailable`
18820
+ * (terminal) and
18818
18821
  * `insufficient_credits`, `allowance_exhausted`, `monthly_model_cost_limit`, `monthly_agent_run_limit`
18819
18822
  * (transient). Readers must tolerate new reasons.
18820
18823
  */
package/dist/index.js CHANGED
@@ -22,6 +22,7 @@ import {
22
22
  AGENT_PROMPT_MODULE_IDS,
23
23
  AGENT_PROMPT_MODULE_TITLES,
24
24
  AGENT_RUNTIME_MECHANIC_TOOL_NAMES,
25
+ AGENT_SANDBOX_MECHANIC_TOOL_NAMES,
25
26
  AGENT_SKILL_MANAGE_TOOL_NAMES,
26
27
  AGENT_SKILL_READ_TOOL_NAMES,
27
28
  ANALYTICS_MODEL_PROVIDERS,
@@ -112,6 +113,7 @@ import {
112
113
  ArtifactCatalogKind,
113
114
  ArtifactCatalogListQuery,
114
115
  ArtifactCatalogListResponse,
116
+ ArtifactPinResponse,
115
117
  AssignableWorkspaceMemberRole,
116
118
  AtlassianBrowseItem,
117
119
  AtlassianBrowseResponse,
@@ -1685,6 +1687,7 @@ import {
1685
1687
  UninstallPluginResult,
1686
1688
  UninstallSkillRequest,
1687
1689
  UninstallSkillResult,
1690
+ UpdateArtifactPinRequest,
1688
1691
  UpdateAutomationSourceRequest,
1689
1692
  UpdateAutomationTriggerRequest,
1690
1693
  UpdateBrowserIdentityRequest,
@@ -1997,6 +2000,7 @@ import {
1997
2000
  boundSessionMcpText,
1998
2001
  boundWorkspaceControlEvent,
1999
2002
  boundedTaskNoteText,
2003
+ bundledSkillSelectionForAgentConfig,
2000
2004
  bundledSkillSelectionFromMetadata,
2001
2005
  canonicalCodexFleetReplayJsonV1,
2002
2006
  canonicalModalCheckpointProviderBinding,
@@ -2041,6 +2045,7 @@ import {
2041
2045
  isAgentConfigError,
2042
2046
  isChildLifecycleSystemUpdateKind,
2043
2047
  isClearedRunStateBlob,
2048
+ isDerivedAgentToolOwner,
2044
2049
  isDirectModelId,
2045
2050
  isModelUnavailableError,
2046
2051
  isOpenSuffixRunStateBlob,
@@ -2167,7 +2172,7 @@ import {
2167
2172
  workspaceLearningPolicyRouterContext,
2168
2173
  workspaceLearningSourceKey,
2169
2174
  workspaceSlackReactionChannelAllowed
2170
- } from "./chunk-X7ETVO4P.js";
2175
+ } from "./chunk-VSM752ZW.js";
2171
2176
  import {
2172
2177
  COMPUTER_SCREENSHOT_MAX_BYTES,
2173
2178
  COMPUTER_SCREENSHOT_MAX_DIMENSION,
@@ -2602,6 +2607,7 @@ export {
2602
2607
  AGENT_PROMPT_MODULE_IDS,
2603
2608
  AGENT_PROMPT_MODULE_TITLES,
2604
2609
  AGENT_RUNTIME_MECHANIC_TOOL_NAMES,
2610
+ AGENT_SANDBOX_MECHANIC_TOOL_NAMES,
2605
2611
  AGENT_SKILL_MANAGE_TOOL_NAMES,
2606
2612
  AGENT_SKILL_READ_TOOL_NAMES,
2607
2613
  ANALYTICS_MODEL_PROVIDERS,
@@ -2697,6 +2703,7 @@ export {
2697
2703
  ArtifactCatalogKind,
2698
2704
  ArtifactCatalogListQuery,
2699
2705
  ArtifactCatalogListResponse,
2706
+ ArtifactPinResponse,
2700
2707
  AssignableWorkspaceMemberRole,
2701
2708
  AtlassianBrowseItem,
2702
2709
  AtlassianBrowseResponse,
@@ -4494,6 +4501,7 @@ export {
4494
4501
  UninstallPluginResult,
4495
4502
  UninstallSkillRequest,
4496
4503
  UninstallSkillResult,
4504
+ UpdateArtifactPinRequest,
4497
4505
  UpdateAutomationSourceRequest,
4498
4506
  UpdateAutomationTriggerRequest,
4499
4507
  UpdateBrowserIdentityRequest,
@@ -4856,6 +4864,7 @@ export {
4856
4864
  boundedTaskNoteText,
4857
4865
  browserSessionStorageMode,
4858
4866
  buildOpenGeniSlackBotManifest,
4867
+ bundledSkillSelectionForAgentConfig,
4859
4868
  bundledSkillSelectionFromMetadata,
4860
4869
  canonicalCodexFleetReplayJsonV1,
4861
4870
  canonicalModalCheckpointProviderBinding,
@@ -4945,6 +4954,7 @@ export {
4945
4954
  isAgentConfigError,
4946
4955
  isChildLifecycleSystemUpdateKind,
4947
4956
  isClearedRunStateBlob,
4957
+ isDerivedAgentToolOwner,
4948
4958
  isDirectModelId,
4949
4959
  isModelUnavailableError,
4950
4960
  isOpenSuffixRunStateBlob,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  ConnectionMetadata
3
- } from "./chunk-X7ETVO4P.js";
3
+ } from "./chunk-VSM752ZW.js";
4
4
  import "./chunk-5IXYF6XN.js";
5
5
  import "./chunk-NRMCVHAU.js";
6
6
  import "./chunk-WYBDERIY.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengeni/contracts",
3
- "version": "1.0.2",
3
+ "version": "1.1.0",
4
4
  "description": "Shared zod schemas and wire-contract types for the OpenGeni API.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -200,9 +200,22 @@ export type ClientAgentConfig = z.infer<typeof ClientAgentConfig>;
200
200
  // Capability registry
201
201
  // ---------------------------------------------------------------------------
202
202
 
203
- /** A first-party tool's owner: a capability, or pure runtime mechanics. */
203
+ /** A built-in MCP server's owner: a capability, or pure runtime mechanics. */
204
204
  export type AgentToolCapability = AgentCapabilityId | "runtime";
205
205
 
206
+ /**
207
+ * A first-party tool's owner: a capability, pure runtime mechanics, or the
208
+ * attached compute (a managed sandbox or Connected Machine).
209
+ */
210
+ export type AgentFirstPartyToolOwner = AgentToolCapability | "sandbox";
211
+
212
+ /** Owners no capability toggles: the runtime or the attached compute derives them. */
213
+ export function isDerivedAgentToolOwner(
214
+ owner: AgentFirstPartyToolOwner,
215
+ ): owner is "runtime" | "sandbox" {
216
+ return owner === "runtime" || owner === "sandbox";
217
+ }
218
+
206
219
  /**
207
220
  * Exhaustive map from every `FIRST_PARTY_MCP_TOOL_NAMES` entry to exactly one
208
221
  * owner. The `Record` type makes an unmapped new name a compile error, and
@@ -210,15 +223,18 @@ export type AgentToolCapability = AgentCapabilityId | "runtime";
210
223
  *
211
224
  * `runtime` tools are mechanics every agent needs regardless of what it may do:
212
225
  * - `wait_for_input`: ends the turn and waits for the next input.
213
- * - `command_read` / `command_wait`: read/await the session's own background
214
- * sandbox commands (the shell already exists whenever a sandbox is attached).
215
226
  * - `set_session_title`: session titling.
227
+ *
228
+ * `sandbox` tools are derived from attached compute and never toggled:
229
+ * - `command_read` / `command_wait`: read/await the session's own background
230
+ * commands. A command can only exist on a managed sandbox or Connected
231
+ * Machine, so a turn with neither attached never receives them.
216
232
  */
217
233
  export const FIRST_PARTY_MCP_TOOL_CAPABILITIES = {
218
234
  set_session_title: "runtime",
219
235
  wait_for_input: "runtime",
220
- command_wait: "runtime",
221
- command_read: "runtime",
236
+ command_wait: "sandbox",
237
+ command_read: "sandbox",
222
238
 
223
239
  goal_set: "goals",
224
240
  goal_update: "goals",
@@ -400,7 +416,7 @@ export const FIRST_PARTY_MCP_TOOL_CAPABILITIES = {
400
416
  editable_artifact_apply: "artifacts",
401
417
  editable_artifact_export: "artifacts",
402
418
  editable_artifact_export_status: "artifacts",
403
- } as const satisfies Record<FirstPartyMcpToolName, AgentToolCapability>;
419
+ } as const satisfies Record<FirstPartyMcpToolName, AgentFirstPartyToolOwner>;
404
420
 
405
421
  /** Owner of a non-MCP tool: a capability, runtime mechanics, or the sandbox. */
406
422
  export type AgentFunctionToolClass = AgentCapabilityId | "runtime" | "sandbox";
@@ -493,7 +509,7 @@ export const AGENT_BUILTIN_MCP_SERVER_CAPABILITIES = {
493
509
  "google-drive-publishing": "workspaceConnectors",
494
510
  } as const satisfies Record<string, AgentToolCapability>;
495
511
 
496
- export function firstPartyMcpToolCapability(tool: FirstPartyMcpToolName): AgentToolCapability {
512
+ export function firstPartyMcpToolCapability(tool: FirstPartyMcpToolName): AgentFirstPartyToolOwner {
497
513
  return FIRST_PARTY_MCP_TOOL_CAPABILITIES[tool];
498
514
  }
499
515
 
@@ -508,10 +524,21 @@ export type AgentToolEnvironment = {
508
524
  media?: boolean | undefined;
509
525
  hasDeferredTools?: boolean;
510
526
  routerInHistory?: boolean;
527
+ /**
528
+ * Whether the turn has a managed sandbox or Connected Machine attached.
529
+ * `false` withholds the `sandbox`-owned first-party tools, which could never
530
+ * find a command; undefined means not yet known and keeps them.
531
+ */
532
+ sandboxAttached?: boolean;
511
533
  };
512
534
 
535
+ /** Runtime mechanics every configured agent receives. */
513
536
  export const AGENT_RUNTIME_MECHANIC_TOOL_NAMES = [
514
537
  "wait_for_input",
538
+ ] as const satisfies readonly FirstPartyMcpToolName[];
539
+
540
+ /** First-party tools a configured agent receives whenever compute is attached. */
541
+ export const AGENT_SANDBOX_MECHANIC_TOOL_NAMES = [
515
542
  "command_read",
516
543
  "command_wait",
517
544
  ] as const satisfies readonly FirstPartyMcpToolName[];
@@ -519,7 +546,9 @@ export const AGENT_RUNTIME_MECHANIC_TOOL_NAMES = [
519
546
  /**
520
547
  * The one turn-time capability gate. Null means the historical attachment
521
548
  * rules, including unconditional Skill tools and router. Resource-derived
522
- * sandbox tools, product MCPs and runtime mechanics are never toggled.
549
+ * sandbox tools, product MCPs and runtime mechanics are never toggled; the
550
+ * `sandbox`-owned first-party tools follow `environment.sandboxAttached` for
551
+ * every session, configured or not.
523
552
  */
524
553
  export function resolveAgentToolFamilies(
525
554
  config: ResolvedAgentConfig | null | undefined,
@@ -534,8 +563,10 @@ export function resolveAgentToolFamilies(
534
563
  const humanInput = enabled("humanInput") && environment.humanInput !== false;
535
564
  const media = enabled("media") && environment.media !== false;
536
565
  const skills = !config ? "manage" : enabled("skills") ? config.capabilities.skills : false;
566
+ const sandboxTools = environment.sandboxAttached !== false;
537
567
  const allowsFirstPartyTool = (name: FirstPartyMcpToolName): boolean => {
538
- const owner = FIRST_PARTY_MCP_TOOL_CAPABILITIES[name];
568
+ const owner: AgentFirstPartyToolOwner = FIRST_PARTY_MCP_TOOL_CAPABILITIES[name];
569
+ if (owner === "sandbox") return sandboxTools;
539
570
  return owner === "runtime" || enabled(owner);
540
571
  };
541
572
  return {
@@ -549,11 +580,14 @@ export function resolveAgentToolFamilies(
549
580
  allowsFirstPartyTool,
550
581
  firstPartyTools(names: readonly FirstPartyMcpToolName[]): FirstPartyMcpToolName[] {
551
582
  return !config
552
- ? [...names]
583
+ ? names.filter(
584
+ (name) => sandboxTools || FIRST_PARTY_MCP_TOOL_CAPABILITIES[name] !== "sandbox",
585
+ )
553
586
  : [
554
587
  ...new Set([
555
588
  ...names.filter(allowsFirstPartyTool),
556
589
  ...AGENT_RUNTIME_MECHANIC_TOOL_NAMES,
590
+ ...(sandboxTools ? AGENT_SANDBOX_MECHANIC_TOOL_NAMES : []),
557
591
  ]),
558
592
  ];
559
593
  },
@@ -1203,8 +1237,8 @@ export function agentConfigFirstPartyMcpTools(
1203
1237
  explicit?: readonly FirstPartyMcpToolName[],
1204
1238
  ): FirstPartyMcpToolName[] {
1205
1239
  for (const tool of explicit ?? []) {
1206
- const owner = FIRST_PARTY_MCP_TOOL_CAPABILITIES[tool];
1207
- if (owner !== "runtime" && capabilityFilteredOut(config, owner)) {
1240
+ const owner: AgentFirstPartyToolOwner = FIRST_PARTY_MCP_TOOL_CAPABILITIES[tool];
1241
+ if (!isDerivedAgentToolOwner(owner) && capabilityFilteredOut(config, owner)) {
1208
1242
  throw new AgentConfigError(
1209
1243
  "agent_config_conflict",
1210
1244
  `firstPartyMcpTools lists ${tool}, but agent capability ${owner} is off`,
@@ -1213,8 +1247,8 @@ export function agentConfigFirstPartyMcpTools(
1213
1247
  }
1214
1248
  }
1215
1249
  return baseline.filter((tool) => {
1216
- const owner = FIRST_PARTY_MCP_TOOL_CAPABILITIES[tool];
1217
- return owner === "runtime" || !capabilityFilteredOut(config, owner);
1250
+ const owner: AgentFirstPartyToolOwner = FIRST_PARTY_MCP_TOOL_CAPABILITIES[tool];
1251
+ return isDerivedAgentToolOwner(owner) || !capabilityFilteredOut(config, owner);
1218
1252
  });
1219
1253
  }
1220
1254
 
@@ -1229,9 +1263,9 @@ export function agentConfigAddedFirstPartyMcpTools(
1229
1263
  defaults: readonly FirstPartyMcpToolName[],
1230
1264
  ): FirstPartyMcpToolName[] {
1231
1265
  return defaults.filter((tool) => {
1232
- const owner = FIRST_PARTY_MCP_TOOL_CAPABILITIES[tool];
1266
+ const owner: AgentFirstPartyToolOwner = FIRST_PARTY_MCP_TOOL_CAPABILITIES[tool];
1233
1267
  return (
1234
- owner !== "runtime" &&
1268
+ !isDerivedAgentToolOwner(owner) &&
1235
1269
  !agentCapabilityEnabled(previous, owner) &&
1236
1270
  agentCapabilityEnabled(next.capabilities, owner)
1237
1271
  );
@@ -1325,7 +1359,7 @@ export function legacyEffectiveAgentCapabilities(input: {
1325
1359
  */
1326
1360
  defaultServerIds?: Iterable<string> | undefined;
1327
1361
  }): ResolvedAgentCapabilities {
1328
- const selected = new Set<AgentToolCapability>(
1362
+ const selected = new Set<AgentFirstPartyToolOwner>(
1329
1363
  input.firstPartyMcpTools.map((tool) => FIRST_PARTY_MCP_TOOL_CAPABILITIES[tool]),
1330
1364
  );
1331
1365
  const ids = new Set(input.tools.map((tool) => tool.id));
@@ -20,6 +20,8 @@ export const ArtifactCatalogItem = z
20
20
  createdAt: z.string().datetime({ offset: true }),
21
21
  updatedAt: z.string().datetime({ offset: true }),
22
22
  status: z.enum(["active", "archived"]),
23
+ /** Shared workspace metadata, not content-access authority. */
24
+ pinned: z.boolean().optional(),
23
25
  sourceSessionId: z.string().uuid().optional(),
24
26
  versionId: z.string().min(1).max(128).optional(),
25
27
  file: RetainedArtifactReferenceSchema.optional(),
@@ -58,3 +60,15 @@ export const ArtifactCatalogListResponse = z
58
60
  })
59
61
  .strict();
60
62
  export type ArtifactCatalogListResponse = z.infer<typeof ArtifactCatalogListResponse>;
63
+
64
+ export const UpdateArtifactPinRequest = z.object({ pinned: z.boolean() }).strict();
65
+ export type UpdateArtifactPinRequest = z.infer<typeof UpdateArtifactPinRequest>;
66
+
67
+ export const ArtifactPinResponse = z
68
+ .object({
69
+ kind: ArtifactCatalogKind,
70
+ artifactId: z.string().min(1).max(128),
71
+ pinned: z.boolean(),
72
+ })
73
+ .strict();
74
+ export type ArtifactPinResponse = z.infer<typeof ArtifactPinResponse>;
@@ -32,6 +32,19 @@ export function resolveBundledSkillSelection(
32
32
  return selected === undefined ? undefined : BundledSkillSelection.parse(selected);
33
33
  }
34
34
 
35
+ /**
36
+ * Freeze the defaults a session's agent configuration implies. An agent that
37
+ * starts from `capabilities: "none"` carries no bundled Opengeni guides unless
38
+ * the request lists them; an explicit list (including `[]`) is kept exactly,
39
+ * and `"all"` or legacy (null) configurations keep the bundled defaults.
40
+ */
41
+ export function bundledSkillSelectionForAgentConfig(
42
+ selection: BundledSkillId[] | undefined,
43
+ agentConfig: { from: "all" | "none" } | null | undefined,
44
+ ): BundledSkillId[] | undefined {
45
+ return selection === undefined && agentConfig?.from === "none" ? [] : selection;
46
+ }
47
+
35
48
  // Immutable session configuration, following the existing create-identity
36
49
  // metadata convention. Callers cannot set this through arbitrary metadata.
37
50
  const BUNDLED_SKILL_SELECTION_KEY = "_opengeni_bundled_skill_ids_v1";
package/src/index.ts CHANGED
@@ -6709,6 +6709,16 @@ export const SessionGoalContinuation = z.object({
6709
6709
  });
6710
6710
  export type SessionGoalContinuation = z.infer<typeof SessionGoalContinuation>;
6711
6711
 
6712
+ /** New admission pauses are specific; the wire field remains open for older peers. */
6713
+ export type GoalAdmissionPausedReason =
6714
+ | "model_unavailable"
6715
+ | "model_policy"
6716
+ | "credits"
6717
+ | "budget"
6718
+ | "usage_limit"
6719
+ | "usage_policy"
6720
+ | "allowance";
6721
+
6712
6722
  export const SessionGoal = z.object({
6713
6723
  id: z.string().uuid(),
6714
6724
  accountId: z.string().uuid(),
@@ -10430,7 +10440,8 @@ export type KnowledgeSourceSyncRunSummary = z.infer<typeof KnowledgeSourceSyncRu
10430
10440
  * means every occurrence is refused until the task or a resource it names
10431
10441
  * changes. Known reasons: `scheduled_authority_unavailable`,
10432
10442
  * `machine_target_unavailable`, `machine_enrollment_inactive`,
10433
- * `variable_set_unavailable`, `rig_version_unavailable` (terminal) and
10443
+ * `variable_set_unavailable`, `rig_version_unavailable`, `scheduled_model_unavailable`
10444
+ * (terminal) and
10434
10445
  * `insufficient_credits`, `allowance_exhausted`, `monthly_model_cost_limit`, `monthly_agent_run_limit`
10435
10446
  * (transient). Readers must tolerate new reasons.
10436
10447
  */