@opengeni/contracts 1.0.2 → 1.2.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.
@@ -293,8 +293,15 @@ export declare const ClientAgentConfig: z.ZodObject<{
293
293
  }, z.core.$strict>>;
294
294
  }, z.core.$strict>;
295
295
  export type ClientAgentConfig = z.infer<typeof ClientAgentConfig>;
296
- /** A first-party tool's owner: a capability, or pure runtime mechanics. */
296
+ /** A built-in MCP server's owner: a capability, or pure runtime mechanics. */
297
297
  export type AgentToolCapability = AgentCapabilityId | "runtime";
298
+ /**
299
+ * A first-party tool's owner: a capability, pure runtime mechanics, or the
300
+ * attached compute (a managed sandbox or Connected Machine).
301
+ */
302
+ export type AgentFirstPartyToolOwner = AgentToolCapability | "sandbox";
303
+ /** Owners no capability toggles: the runtime or the attached compute derives them. */
304
+ export declare function isDerivedAgentToolOwner(owner: AgentFirstPartyToolOwner): owner is "runtime" | "sandbox";
298
305
  /**
299
306
  * Exhaustive map from every `FIRST_PARTY_MCP_TOOL_NAMES` entry to exactly one
300
307
  * owner. The `Record` type makes an unmapped new name a compile error, and
@@ -302,15 +309,18 @@ export type AgentToolCapability = AgentCapabilityId | "runtime";
302
309
  *
303
310
  * `runtime` tools are mechanics every agent needs regardless of what it may do:
304
311
  * - `wait_for_input`: ends the turn and waits for the next input.
305
- * - `command_read` / `command_wait`: read/await the session's own background
306
- * sandbox commands (the shell already exists whenever a sandbox is attached).
307
312
  * - `set_session_title`: session titling.
313
+ *
314
+ * `sandbox` tools are derived from attached compute and never toggled:
315
+ * - `command_read` / `command_wait`: read/await the session's own background
316
+ * commands. A command can only exist on a managed sandbox or Connected
317
+ * Machine, so a turn with neither attached never receives them.
308
318
  */
309
319
  export declare const FIRST_PARTY_MCP_TOOL_CAPABILITIES: {
310
320
  readonly set_session_title: "runtime";
311
321
  readonly wait_for_input: "runtime";
312
- readonly command_wait: "runtime";
313
- readonly command_read: "runtime";
322
+ readonly command_wait: "sandbox";
323
+ readonly command_read: "sandbox";
314
324
  readonly goal_set: "goals";
315
325
  readonly goal_update: "goals";
316
326
  readonly goal_progress: "goals";
@@ -544,7 +554,7 @@ export declare const AGENT_BUILTIN_MCP_SERVER_CAPABILITIES: {
544
554
  readonly docs: "knowledge";
545
555
  readonly "google-drive-publishing": "workspaceConnectors";
546
556
  };
547
- export declare function firstPartyMcpToolCapability(tool: FirstPartyMcpToolName): AgentToolCapability;
557
+ export declare function firstPartyMcpToolCapability(tool: FirstPartyMcpToolName): AgentFirstPartyToolOwner;
548
558
  /** Availability narrows configuration; it never grants a disabled capability. */
549
559
  export type AgentToolEnvironment = {
550
560
  /** Explicit product MCPs are independent of ambient workspace connectors. */
@@ -556,12 +566,23 @@ export type AgentToolEnvironment = {
556
566
  media?: boolean | undefined;
557
567
  hasDeferredTools?: boolean;
558
568
  routerInHistory?: boolean;
569
+ /**
570
+ * Whether the turn has a managed sandbox or Connected Machine attached.
571
+ * `false` withholds the `sandbox`-owned first-party tools, which could never
572
+ * find a command; undefined means not yet known and keeps them.
573
+ */
574
+ sandboxAttached?: boolean;
559
575
  };
560
- export declare const AGENT_RUNTIME_MECHANIC_TOOL_NAMES: readonly ["wait_for_input", "command_read", "command_wait"];
576
+ /** Runtime mechanics every configured agent receives. */
577
+ export declare const AGENT_RUNTIME_MECHANIC_TOOL_NAMES: readonly ["wait_for_input"];
578
+ /** First-party tools a configured agent receives whenever compute is attached. */
579
+ export declare const AGENT_SANDBOX_MECHANIC_TOOL_NAMES: readonly ["command_read", "command_wait"];
561
580
  /**
562
581
  * The one turn-time capability gate. Null means the historical attachment
563
582
  * rules, including unconditional Skill tools and router. Resource-derived
564
- * sandbox tools, product MCPs and runtime mechanics are never toggled.
583
+ * sandbox tools, product MCPs and runtime mechanics are never toggled; the
584
+ * `sandbox`-owned first-party tools follow `environment.sandboxAttached` for
585
+ * every session, configured or not.
565
586
  */
566
587
  export declare function resolveAgentToolFamilies(config: ResolvedAgentConfig | null | undefined, environment?: AgentToolEnvironment): {
567
588
  webSearch: boolean;
@@ -26,6 +26,7 @@ export declare const ArtifactCatalogItem: z.ZodObject<{
26
26
  active: "active";
27
27
  archived: "archived";
28
28
  }>;
29
+ pinned: z.ZodOptional<z.ZodBoolean>;
29
30
  sourceSessionId: z.ZodOptional<z.ZodString>;
30
31
  versionId: z.ZodOptional<z.ZodString>;
31
32
  file: z.ZodOptional<z.ZodObject<{
@@ -114,6 +115,7 @@ export declare const ArtifactCatalogListResponse: z.ZodObject<{
114
115
  active: "active";
115
116
  archived: "archived";
116
117
  }>;
118
+ pinned: z.ZodOptional<z.ZodBoolean>;
117
119
  sourceSessionId: z.ZodOptional<z.ZodString>;
118
120
  versionId: z.ZodOptional<z.ZodString>;
119
121
  file: z.ZodOptional<z.ZodObject<{
@@ -159,3 +161,20 @@ export declare const ArtifactCatalogListResponse: z.ZodObject<{
159
161
  nextCursor: z.ZodNullable<z.ZodString>;
160
162
  }, z.core.$strict>;
161
163
  export type ArtifactCatalogListResponse = z.infer<typeof ArtifactCatalogListResponse>;
164
+ export declare const UpdateArtifactPinRequest: z.ZodObject<{
165
+ pinned: z.ZodBoolean;
166
+ }, z.core.$strict>;
167
+ export type UpdateArtifactPinRequest = z.infer<typeof UpdateArtifactPinRequest>;
168
+ export declare const ArtifactPinResponse: z.ZodObject<{
169
+ kind: z.ZodEnum<{
170
+ document: "document";
171
+ file: "file";
172
+ image: "image";
173
+ presentation: "presentation";
174
+ site: "site";
175
+ spreadsheet: "spreadsheet";
176
+ }>;
177
+ artifactId: z.ZodString;
178
+ pinned: z.ZodBoolean;
179
+ }, z.core.$strict>;
180
+ export type ArtifactPinResponse = z.infer<typeof ArtifactPinResponse>;
package/dist/atlassian.js CHANGED
@@ -17,12 +17,13 @@ import {
17
17
  AtlassianSyncCadence,
18
18
  SaveAtlassianSourcesRequest,
19
19
  atlassianScopesAllowRead
20
- } from "./chunk-X7ETVO4P.js";
20
+ } from "./chunk-L73LKLKP.js";
21
21
  import "./chunk-5IXYF6XN.js";
22
22
  import "./chunk-NRMCVHAU.js";
23
23
  import "./chunk-WYBDERIY.js";
24
24
  import "./chunk-4JGHSSB7.js";
25
25
  import "./chunk-EK7NDGFR.js";
26
+ import "./chunk-XSBEB2HQ.js";
26
27
  import "./chunk-O77VSFYZ.js";
27
28
  import "./chunk-NVJMJWLL.js";
28
29
  import "./chunk-SIOU2K4U.js";
@@ -30,6 +30,15 @@ export declare const BundledSkillSelection: z.ZodPipe<z.ZodArray<z.ZodEnum<{
30
30
  }>>, z.ZodTransform<("builtin:document-parsing" | "builtin:opengeni-client" | "builtin:opengeni-documents" | "builtin:opengeni-help" | "builtin:opengeni-presentations" | "builtin:opengeni-projects" | "builtin:opengeni-schedules" | "builtin:opengeni-sites" | "builtin:opengeni-skills" | "builtin:opengeni-spreadsheets" | "builtin:opengeni-video-generation" | "builtin:opengeni-visualize")[], ("builtin:document-parsing" | "builtin:opengeni-client" | "builtin:opengeni-documents" | "builtin:opengeni-help" | "builtin:opengeni-presentations" | "builtin:opengeni-projects" | "builtin:opengeni-schedules" | "builtin:opengeni-sites" | "builtin:opengeni-skills" | "builtin:opengeni-spreadsheets" | "builtin:opengeni-video-generation" | "builtin:opengeni-visualize")[]>>;
31
31
  /** Undefined is defaults/inheritance; an explicit empty list disables bundles. */
32
32
  export declare function resolveBundledSkillSelection(requested: readonly BundledSkillId[] | undefined, parent: readonly BundledSkillId[] | undefined): BundledSkillId[] | undefined;
33
+ /**
34
+ * Freeze the defaults a session's agent configuration implies. An agent that
35
+ * starts from `capabilities: "none"` carries no bundled Opengeni guides unless
36
+ * the request lists them; an explicit list (including `[]`) is kept exactly,
37
+ * and `"all"` or legacy (null) configurations keep the bundled defaults.
38
+ */
39
+ export declare function bundledSkillSelectionForAgentConfig(selection: BundledSkillId[] | undefined, agentConfig: {
40
+ from: "all" | "none";
41
+ } | null | undefined): BundledSkillId[] | undefined;
33
42
  export declare function withBundledSkillSelectionMetadata(metadata: Record<string, unknown>, ids: readonly BundledSkillId[] | undefined): Record<string, unknown>;
34
43
  /**
35
44
  * Exact stored selection for keyed create replay identity. Unlike the
@@ -13,6 +13,9 @@ import {
13
13
  UsageAllowanceStatus,
14
14
  UsageAllowanceWindow
15
15
  } from "./chunk-EK7NDGFR.js";
16
+ import {
17
+ modelLogoUrl
18
+ } from "./chunk-XSBEB2HQ.js";
16
19
  import {
17
20
  OPENGENI_WEBHOOK_TEST_EVENT_TYPE,
18
21
  WORKSPACE_WEBHOOK_EVENT_TYPES
@@ -196,6 +199,8 @@ var ArtifactCatalogItem = z4.object({
196
199
  createdAt: z4.string().datetime({ offset: true }),
197
200
  updatedAt: z4.string().datetime({ offset: true }),
198
201
  status: z4.enum(["active", "archived"]),
202
+ /** Shared workspace metadata, not content-access authority. */
203
+ pinned: z4.boolean().optional(),
199
204
  sourceSessionId: z4.string().uuid().optional(),
200
205
  versionId: z4.string().min(1).max(128).optional(),
201
206
  file: RetainedArtifactReferenceSchema.optional(),
@@ -216,6 +221,12 @@ var ArtifactCatalogListResponse = z4.object({
216
221
  items: z4.array(ArtifactCatalogItem).max(100),
217
222
  nextCursor: z4.string().max(8192).nullable()
218
223
  }).strict();
224
+ var UpdateArtifactPinRequest = z4.object({ pinned: z4.boolean() }).strict();
225
+ var ArtifactPinResponse = z4.object({
226
+ kind: ArtifactCatalogKind,
227
+ artifactId: z4.string().min(1).max(128),
228
+ pinned: z4.boolean()
229
+ }).strict();
219
230
 
220
231
  // src/claude-subscription-oauth.ts
221
232
  import { z as z5 } from "zod";
@@ -1143,11 +1154,14 @@ var ClientAgentConfig = z13.object({
1143
1154
  }).strict()
1144
1155
  )
1145
1156
  }).strict();
1157
+ function isDerivedAgentToolOwner(owner) {
1158
+ return owner === "runtime" || owner === "sandbox";
1159
+ }
1146
1160
  var FIRST_PARTY_MCP_TOOL_CAPABILITIES = {
1147
1161
  set_session_title: "runtime",
1148
1162
  wait_for_input: "runtime",
1149
- command_wait: "runtime",
1150
- command_read: "runtime",
1163
+ command_wait: "sandbox",
1164
+ command_read: "sandbox",
1151
1165
  goal_set: "goals",
1152
1166
  goal_update: "goals",
1153
1167
  goal_progress: "goals",
@@ -1390,7 +1404,9 @@ function firstPartyMcpToolCapability(tool) {
1390
1404
  return FIRST_PARTY_MCP_TOOL_CAPABILITIES[tool];
1391
1405
  }
1392
1406
  var AGENT_RUNTIME_MECHANIC_TOOL_NAMES = [
1393
- "wait_for_input",
1407
+ "wait_for_input"
1408
+ ];
1409
+ var AGENT_SANDBOX_MECHANIC_TOOL_NAMES = [
1394
1410
  "command_read",
1395
1411
  "command_wait"
1396
1412
  ];
@@ -1400,8 +1416,10 @@ function resolveAgentToolFamilies(config, environment = {}) {
1400
1416
  const humanInput = enabled("humanInput") && environment.humanInput !== false;
1401
1417
  const media = enabled("media") && environment.media !== false;
1402
1418
  const skills = !config ? "manage" : enabled("skills") ? config.capabilities.skills : false;
1419
+ const sandboxTools = environment.sandboxAttached !== false;
1403
1420
  const allowsFirstPartyTool = (name) => {
1404
1421
  const owner = FIRST_PARTY_MCP_TOOL_CAPABILITIES[name];
1422
+ if (owner === "sandbox") return sandboxTools;
1405
1423
  return owner === "runtime" || enabled(owner);
1406
1424
  };
1407
1425
  return {
@@ -1413,10 +1431,13 @@ function resolveAgentToolFamilies(config, environment = {}) {
1413
1431
  router: !config || environment.hasDeferredTools === true || environment.routerInHistory === true,
1414
1432
  allowsFirstPartyTool,
1415
1433
  firstPartyTools(names) {
1416
- return !config ? [...names] : [
1434
+ return !config ? names.filter(
1435
+ (name) => sandboxTools || FIRST_PARTY_MCP_TOOL_CAPABILITIES[name] !== "sandbox"
1436
+ ) : [
1417
1437
  .../* @__PURE__ */ new Set([
1418
1438
  ...names.filter(allowsFirstPartyTool),
1419
- ...AGENT_RUNTIME_MECHANIC_TOOL_NAMES
1439
+ ...AGENT_RUNTIME_MECHANIC_TOOL_NAMES,
1440
+ ...sandboxTools ? AGENT_SANDBOX_MECHANIC_TOOL_NAMES : []
1420
1441
  ])
1421
1442
  ];
1422
1443
  },
@@ -1845,7 +1866,7 @@ function capabilityFilteredOut(config, id) {
1845
1866
  function agentConfigFirstPartyMcpTools(config, baseline, explicit) {
1846
1867
  for (const tool of explicit ?? []) {
1847
1868
  const owner = FIRST_PARTY_MCP_TOOL_CAPABILITIES[tool];
1848
- if (owner !== "runtime" && capabilityFilteredOut(config, owner)) {
1869
+ if (!isDerivedAgentToolOwner(owner) && capabilityFilteredOut(config, owner)) {
1849
1870
  throw new AgentConfigError(
1850
1871
  "agent_config_conflict",
1851
1872
  `firstPartyMcpTools lists ${tool}, but agent capability ${owner} is off`,
@@ -1855,13 +1876,13 @@ function agentConfigFirstPartyMcpTools(config, baseline, explicit) {
1855
1876
  }
1856
1877
  return baseline.filter((tool) => {
1857
1878
  const owner = FIRST_PARTY_MCP_TOOL_CAPABILITIES[tool];
1858
- return owner === "runtime" || !capabilityFilteredOut(config, owner);
1879
+ return isDerivedAgentToolOwner(owner) || !capabilityFilteredOut(config, owner);
1859
1880
  });
1860
1881
  }
1861
1882
  function agentConfigAddedFirstPartyMcpTools(previous, next, defaults) {
1862
1883
  return defaults.filter((tool) => {
1863
1884
  const owner = FIRST_PARTY_MCP_TOOL_CAPABILITIES[tool];
1864
- return owner !== "runtime" && !agentCapabilityEnabled(previous, owner) && agentCapabilityEnabled(next.capabilities, owner);
1885
+ return !isDerivedAgentToolOwner(owner) && !agentCapabilityEnabled(previous, owner) && agentCapabilityEnabled(next.capabilities, owner);
1865
1886
  });
1866
1887
  }
1867
1888
  function agentConfigToolRefs(input) {
@@ -2728,6 +2749,9 @@ function resolveBundledSkillSelection(requested, parent) {
2728
2749
  throw new Error("A child cannot widen its parent's bundled Skill selection");
2729
2750
  return selected === void 0 ? void 0 : BundledSkillSelection.parse(selected);
2730
2751
  }
2752
+ function bundledSkillSelectionForAgentConfig(selection, agentConfig) {
2753
+ return selection === void 0 && agentConfig?.from === "none" ? [] : selection;
2754
+ }
2731
2755
  var BUNDLED_SKILL_SELECTION_KEY = "_opengeni_bundled_skill_ids_v1";
2732
2756
  function withBundledSkillSelectionMetadata(metadata, ids) {
2733
2757
  const next = { ...metadata };
@@ -14931,11 +14955,22 @@ var McpConnectionAccountSelections = z57.array(McpConnectionAccountSelection).ma
14931
14955
  seen.add(key);
14932
14956
  }
14933
14957
  });
14958
+ var PromotionalCreditScope = z57.object({
14959
+ label: z57.string().trim().min(1).max(120),
14960
+ eligibleModelIds: z57.array(z57.string().trim().min(1).max(200)).min(1).max(40)
14961
+ });
14962
+ var PromotionalCreditBalance = PromotionalCreditScope.extend({
14963
+ grantId: z57.string().uuid(),
14964
+ remainingMicros: z57.number().int().nonnegative()
14965
+ });
14934
14966
  var BillingBalance = z57.object({
14935
14967
  accountId: z57.string().uuid(),
14936
14968
  balanceMicros: z57.number().int(),
14937
14969
  currency: z57.literal("usd"),
14938
- updatedAt: z57.string()
14970
+ updatedAt: z57.string(),
14971
+ /** General credits, including unrestricted legacy grants. May be negative after use. */
14972
+ generalBalanceMicros: z57.number().int().optional(),
14973
+ promotionalCredits: z57.array(PromotionalCreditBalance).optional()
14939
14974
  });
14940
14975
  var CreateCheckoutRequest = z57.object({
14941
14976
  accountId: z57.string().uuid().optional(),
@@ -14956,7 +14991,8 @@ var CreateCheckoutResponse = z57.object({
14956
14991
  checkoutSessionId: z57.string(),
14957
14992
  url: z57.string().url(),
14958
14993
  /** The credits this checkout grants once it completes. */
14959
- amountUsd: z57.number().optional()
14994
+ amountUsd: z57.number().optional(),
14995
+ promotionalScope: PromotionalCreditScope.optional()
14960
14996
  });
14961
14997
  var BillingCheckoutStatus = z57.object({
14962
14998
  checkoutSessionId: z57.string(),
@@ -14966,7 +15002,8 @@ var BillingCheckoutStatus = z57.object({
14966
15002
  amountMicros: z57.number().int(),
14967
15003
  currency: z57.literal("usd"),
14968
15004
  /** True when a coupon covered the whole checkout, so nothing was charged. */
14969
- free: z57.boolean()
15005
+ free: z57.boolean(),
15006
+ promotionalScope: PromotionalCreditScope.optional()
14970
15007
  }),
14971
15008
  balance: BillingBalance.nullable()
14972
15009
  });
@@ -24076,6 +24113,7 @@ var ClientModel = /* @__PURE__ */ defineModelContractSchema(
24076
24113
  label: z57.string(),
24077
24114
  /** Optional curated compact label for dense UI (e.g. mobile composer). */
24078
24115
  shortLabel: z57.string().min(1).max(64).optional(),
24116
+ logoUrl: z57.string().refine((value) => modelLogoUrl({ id: "", logoUrl: value }) !== null).optional(),
24079
24117
  provider: z57.string(),
24080
24118
  // provider id
24081
24119
  providerLabel: z57.string(),
@@ -24168,6 +24206,8 @@ var ModelAvailabilityV1 = /* @__PURE__ */ defineModelContractSchema(
24168
24206
  var WorkspaceModelCatalogModel = /* @__PURE__ */ defineModelContractSchema(
24169
24207
  () => ClientModel.extend({
24170
24208
  credentialReadiness: ModelCredentialReadinessV1,
24209
+ /** Current funding status, without exposing the organization's balance. */
24210
+ creditFunding: z57.enum(["promotional", "general", "unavailable"]).optional(),
24171
24211
  /** Exact workspace-policy verdict without exposing provider identity. */
24172
24212
  policyAllowed: z57.boolean().optional(),
24173
24213
  availability: ModelAvailabilityV1
@@ -24391,6 +24431,8 @@ export {
24391
24431
  ArtifactCatalogItem,
24392
24432
  ArtifactCatalogListQuery,
24393
24433
  ArtifactCatalogListResponse,
24434
+ UpdateArtifactPinRequest,
24435
+ ArtifactPinResponse,
24394
24436
  ClaudeSubscriptionSetupTokenRequest,
24395
24437
  ClaudeSubscriptionOAuthStartRequest,
24396
24438
  ClaudeSubscriptionOAuthStartResponse,
@@ -24513,6 +24555,7 @@ export {
24513
24555
  ResolvedAgentConfig,
24514
24556
  UpdateSessionAgentRequest,
24515
24557
  ClientAgentConfig,
24558
+ isDerivedAgentToolOwner,
24516
24559
  FIRST_PARTY_MCP_TOOL_CAPABILITIES,
24517
24560
  AGENT_FUNCTION_TOOL_CAPABILITIES,
24518
24561
  resolveAgentMediaToolSurface,
@@ -24521,6 +24564,7 @@ export {
24521
24564
  AGENT_BUILTIN_MCP_SERVER_CAPABILITIES,
24522
24565
  firstPartyMcpToolCapability,
24523
24566
  AGENT_RUNTIME_MECHANIC_TOOL_NAMES,
24567
+ AGENT_SANDBOX_MECHANIC_TOOL_NAMES,
24524
24568
  resolveAgentToolFamilies,
24525
24569
  firstPartyMcpToolsForCapability,
24526
24570
  AGENT_CAPABILITY_DESCRIPTIONS,
@@ -24643,6 +24687,7 @@ export {
24643
24687
  BundledSkillId,
24644
24688
  BundledSkillSelection,
24645
24689
  resolveBundledSkillSelection,
24690
+ bundledSkillSelectionForAgentConfig,
24646
24691
  withBundledSkillSelectionMetadata,
24647
24692
  storedBundledSkillSelectionIdentity,
24648
24693
  bundledSkillSelectionFromMetadata,
@@ -25704,6 +25749,8 @@ export {
25704
25749
  McpConnectionAccountBindings,
25705
25750
  McpConnectionAccountSelection,
25706
25751
  McpConnectionAccountSelections,
25752
+ PromotionalCreditScope,
25753
+ PromotionalCreditBalance,
25707
25754
  BillingBalance,
25708
25755
  CreateCheckoutRequest,
25709
25756
  CreateCheckoutResponse,
@@ -26541,4 +26588,4 @@ export {
26541
26588
  AtlassianDisconnectRequest,
26542
26589
  atlassianScopesAllowRead
26543
26590
  };
26544
- //# sourceMappingURL=chunk-X7ETVO4P.js.map
26591
+ //# sourceMappingURL=chunk-L73LKLKP.js.map