@opengeni/contracts 0.27.0 → 0.28.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3268,6 +3268,10 @@ var DEFAULT_FIRST_PARTY_MCP_PERMISSIONS = [
3268
3268
  "sessions:read",
3269
3269
  "sessions:create",
3270
3270
  "sessions:control",
3271
+ // Read-only connection discovery lets the selected first-party connector
3272
+ // tools resolve an already-installed workspace principal. Credentials stay
3273
+ // inside the broker and remain subject to each tool's own authorization.
3274
+ "connections:read",
3271
3275
  "variable-sets:use",
3272
3276
  "variable-sets:manage",
3273
3277
  "rigs:use",
@@ -3315,6 +3319,11 @@ var FIRST_PARTY_MCP_TOOL_NAMES = [
3315
3319
  "social_connections_list",
3316
3320
  "social_posts_recent",
3317
3321
  "social_daily_analysis_context",
3322
+ "social_search_live",
3323
+ "social_mentions_live",
3324
+ "social_thread_fetch",
3325
+ "social_posts_sync",
3326
+ "social_post_reply",
3318
3327
  "scheduled_tasks_list",
3319
3328
  "scheduled_tasks_get",
3320
3329
  "scheduled_tasks_create",
@@ -3340,7 +3349,9 @@ var FIRST_PARTY_MCP_TOOL_NAMES = [
3340
3349
  "artifacts_rollback"
3341
3350
  ];
3342
3351
  var FirstPartyMcpToolName = z6.enum(FIRST_PARTY_MCP_TOOL_NAMES);
3343
- var DEFAULT_FIRST_PARTY_MCP_TOOLS = FIRST_PARTY_MCP_TOOL_NAMES;
3352
+ var DEFAULT_FIRST_PARTY_MCP_TOOLS = FIRST_PARTY_MCP_TOOL_NAMES.filter(
3353
+ (name) => !name.startsWith("social_") && !name.startsWith("slack_bot_")
3354
+ );
3344
3355
  function prefixedMcpToolName(registryId2, toolName) {
3345
3356
  return `${registryId2}__${toolName}`;
3346
3357
  }
@@ -6132,6 +6143,7 @@ var EnablePackRequest = withVariableSetIdAlias({
6132
6143
  });
6133
6144
  var SocialProvider = z6.enum([
6134
6145
  "x",
6146
+ "reddit",
6135
6147
  "linkedin",
6136
6148
  "instagram",
6137
6149
  "facebook",
@@ -6192,6 +6204,12 @@ var CreateSocialPostRequest = z6.object({
6192
6204
  metrics: z6.record(z6.string(), z6.number()).default({}),
6193
6205
  raw: z6.record(z6.string(), z6.unknown()).default({})
6194
6206
  });
6207
+ var SocialOAuthProviderId = z6.enum(["x", "reddit"]);
6208
+ var SocialOAuthStartRequest = z6.object({
6209
+ provider: SocialOAuthProviderId,
6210
+ scopes: z6.array(z6.string().min(1)).optional(),
6211
+ returnPath: z6.string().optional()
6212
+ });
6195
6213
  var ConnectionKind = z6.enum(["oauth2", "api_key", "app_install", "delegated"]);
6196
6214
  var ConnectionStatus = z6.enum(["active", "needs_reauth", "revoked", "error"]);
6197
6215
  var OPENGENI_PERSONAL_SLACK_MCP_URL = "https://mcp.slack.com/mcp";
@@ -6230,6 +6248,44 @@ var ConnectionMetadata = z6.object({
6230
6248
  createdAt: z6.string(),
6231
6249
  updatedAt: z6.string()
6232
6250
  });
6251
+ var PERSONAL_SLACK_CONNECTION_STATUS_RANK = {
6252
+ active: 0,
6253
+ needs_reauth: 1,
6254
+ error: 2,
6255
+ revoked: 3
6256
+ };
6257
+ function comparePersonalSlackCanonicalConnections(left, right) {
6258
+ const statusDelta = PERSONAL_SLACK_CONNECTION_STATUS_RANK[left.status] - PERSONAL_SLACK_CONNECTION_STATUS_RANK[right.status];
6259
+ if (statusDelta !== 0) return statusDelta;
6260
+ const updatedAtDelta = compareDescending(
6261
+ canonicalConnectionTimestamp(left.updatedAt),
6262
+ canonicalConnectionTimestamp(right.updatedAt)
6263
+ );
6264
+ if (updatedAtDelta !== 0) return updatedAtDelta;
6265
+ const createdAtDelta = compareDescending(
6266
+ canonicalConnectionTimestamp(left.createdAt),
6267
+ canonicalConnectionTimestamp(right.createdAt)
6268
+ );
6269
+ if (createdAtDelta !== 0) return createdAtDelta;
6270
+ return compareDescending(left.id, right.id);
6271
+ }
6272
+ function selectCanonicalPersonalSlackConnection(connections) {
6273
+ let selected = null;
6274
+ for (const connection of connections) {
6275
+ if (!selected || comparePersonalSlackCanonicalConnections(connection, selected) < 0) {
6276
+ selected = connection;
6277
+ }
6278
+ }
6279
+ return selected;
6280
+ }
6281
+ function canonicalConnectionTimestamp(value) {
6282
+ const timestamp = Date.parse(value);
6283
+ return Number.isFinite(timestamp) ? timestamp : Number.NEGATIVE_INFINITY;
6284
+ }
6285
+ function compareDescending(left, right) {
6286
+ if (left === right) return 0;
6287
+ return left > right ? -1 : 1;
6288
+ }
6233
6289
  var ConnectionCredentialBundle = z6.record(z6.string(), z6.unknown());
6234
6290
  var CreateConnectionRequest = z6.object({
6235
6291
  providerDomain: z6.string().min(1),
@@ -6498,8 +6554,8 @@ var Session = z6.object({
6498
6554
  // Non-default first-party MCP token permissions (manager-style sessions);
6499
6555
  // null means the fixed worker default set.
6500
6556
  firstPartyMcpPermissions: z6.array(Permission).nullable(),
6501
- // Exact model-visible OpenGeni selection. All catalogued tools are selected
6502
- // by default; [] intentionally selects none.
6557
+ // Exact model-visible OpenGeni selection. The default omits connector-wide
6558
+ // tools; [] intentionally selects none.
6503
6559
  firstPartyMcpTools: z6.array(FirstPartyMcpToolName),
6504
6560
  // Per-session third-party MCP servers, metadata only. Credential values are
6505
6561
  // write-only and never appear here.
@@ -8204,7 +8260,8 @@ var CreateSessionRequest = withVariableSetIdAlias({
8204
8260
  // rejected; creation never silently expands a child beyond that set.
8205
8261
  firstPartyMcpPermissions: z6.array(Permission).optional(),
8206
8262
  // Exact model-visible selection from the broad first-party OpenGeni MCP
8207
- // catalog. Omission selects the full catalog; [] intentionally exposes none.
8263
+ // catalog. Omission selects the safe non-connector default; [] intentionally
8264
+ // exposes none.
8208
8265
  // This does not grant authority: every registered tool is permission-gated.
8209
8266
  firstPartyMcpTools: z6.array(FirstPartyMcpToolName).optional(),
8210
8267
  // Third-party MCP servers attached only to this session. For an agent-created
@@ -9166,6 +9223,21 @@ var ClientConfig = /* @__PURE__ */ defineModelContractSchema(
9166
9223
  }),
9167
9224
  productAccessMode: ProductAccessMode,
9168
9225
  auth: ClientAuthConfig.default({ mode: "none" }),
9226
+ analytics: z6.object({
9227
+ consentRequired: z6.boolean(),
9228
+ providers: z6.object({
9229
+ reo: z6.object({
9230
+ clientId: z6.string().max(128).regex(/^[A-Za-z0-9_-]+$/u)
9231
+ }).optional(),
9232
+ posthog: z6.object({
9233
+ projectKey: z6.string().min(1).max(256),
9234
+ host: z6.string().url().max(2048)
9235
+ }).optional(),
9236
+ ga4: z6.object({
9237
+ measurementId: z6.string().max(32).regex(/^G-[A-Z0-9]+$/u)
9238
+ }).optional()
9239
+ })
9240
+ }).default({ consentRequired: true, providers: {} }),
9169
9241
  // Server-wide hint: does this deployment support Channel-A structured services
9170
9242
  // at all (P4.4). Per-session availability is negotiated on /stream-capabilities
9171
9243
  // (it depends on the session's pinned backend); this is the coarse on/off the
@@ -9680,6 +9752,8 @@ export {
9680
9752
  CreateSocialConnectionRequest,
9681
9753
  SocialPost,
9682
9754
  CreateSocialPostRequest,
9755
+ SocialOAuthProviderId,
9756
+ SocialOAuthStartRequest,
9683
9757
  ConnectionKind,
9684
9758
  ConnectionStatus,
9685
9759
  OPENGENI_PERSONAL_SLACK_MCP_URL,
@@ -9688,6 +9762,8 @@ export {
9688
9762
  OPENGENI_SLACK_BOT_SESSION_METADATA_KEY,
9689
9763
  OpenGeniSlackBotConnectionMetadata,
9690
9764
  ConnectionMetadata,
9765
+ comparePersonalSlackCanonicalConnections,
9766
+ selectCanonicalPersonalSlackConnection,
9691
9767
  ConnectionCredentialBundle,
9692
9768
  CreateConnectionRequest,
9693
9769
  OpenGeniSlackBotInstallRequest,
@@ -9906,4 +9982,4 @@ export {
9906
9982
  ClientConfig,
9907
9983
  evaluateWorkspaceModelPolicy
9908
9984
  };
9909
- //# sourceMappingURL=chunk-S4F2GZPD.js.map
9985
+ //# sourceMappingURL=chunk-3Q5FLMOD.js.map