@opengeni/contracts 1.3.0 → 1.4.2

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.
@@ -3,7 +3,13 @@ var protectedName = /password|passwd|secret|credential|authorization|cookie|(^|[
3
3
  var protectedReviewField = (key, fields = []) => protectedName.test(key) || fields.includes(key) || fields.includes("*");
4
4
  var bound = (value, limit) => value.length > limit ? `${value.slice(0, limit)}\u2026` : value;
5
5
  function toolReviewFieldLabel(key) {
6
- const label = key.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/[_-]+/g, " ").replace(/\bids?\b/gi, (word) => word.length === 3 ? "IDs" : "ID");
6
+ const label = key.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/[_-]+/g, " ").replace(/\bids?\b/gi, (word) => word.length === 3 ? "IDs" : "ID").replace(
7
+ /\b(api|url|uri|http|https|ip|sql|json|html)(s?)\b/gi,
8
+ (_word, name, plural) => `${name.toUpperCase()}${plural}`
9
+ ).replace(
10
+ /(?<=\S\s+)([A-Z])([a-z]+)\b/g,
11
+ (_word, first, rest) => `${first.toLowerCase()}${rest}`
12
+ ).trim();
7
13
  return label.charAt(0).toUpperCase() + label.slice(1);
8
14
  }
9
15
  function decodeReviewArguments(value) {
@@ -46,8 +52,29 @@ function toolReviewFields(argumentsValue, context) {
46
52
  const fields = [
47
53
  ...email.fields.filter(
48
54
  (field) => field.path !== "/contentSha256" && field.path !== "/htmlBody" && field.preview !== ""
49
- ).map((field) => ({ ...field, path: `/$email${field.path}` })),
50
- ...original.fields
55
+ ).map((field) => ({
56
+ ...field,
57
+ label: field.path === "/textBody" ? "Message" : field.label,
58
+ path: `/$email${field.path}`,
59
+ ...field.path === "/attachments" ? {
60
+ preview: context.email.attachments.map((attachment) => attachment.name).join(", ").slice(0, 240)
61
+ } : {}
62
+ })),
63
+ ...original.fields.filter(
64
+ (field) => ![
65
+ "/raw",
66
+ "/expectedContentSha256",
67
+ "/from",
68
+ "/to",
69
+ "/cc",
70
+ "/bcc",
71
+ "/subject",
72
+ "/body",
73
+ "/textBody",
74
+ "/htmlBody",
75
+ "/attachments"
76
+ ].includes(field.path)
77
+ )
51
78
  ];
52
79
  return {
53
80
  fields: fields.slice(0, 16),
@@ -59,8 +86,11 @@ function toolReviewFields(argumentsValue, context) {
59
86
  fields: entries.slice(0, 16).map(([key, value], index) => {
60
87
  const hidden = protectedReviewField(key, context?.protectedFields);
61
88
  const safe = hidden ? "[Protected value]" : value;
62
- const count = Array.isArray(value) ? value.length : void 0;
63
- const text = count !== void 0 ? `${count.toLocaleString("en-US")} item${count === 1 ? "" : "s"}` : safe && typeof safe === "object" ? `${Object.keys(safe).length} field${Object.keys(safe).length === 1 ? "" : "s"}` : valueText(safe);
89
+ const count = !hidden && Array.isArray(value) ? value.length : void 0;
90
+ const compactList = !hidden && Array.isArray(value) && value.length > 0 && value.length <= 4 && value.every(
91
+ (entry) => typeof entry === "string" || typeof entry === "number" || typeof entry === "boolean"
92
+ ) ? value.map(valueText).join(", ") : void 0;
93
+ const text = compactList !== void 0 ? compactList : count !== void 0 ? `${count.toLocaleString("en-US")} item${count === 1 ? "" : "s"}` : safe && typeof safe === "object" ? `${Object.keys(safe).length} field${Object.keys(safe).length === 1 ? "" : "s"}` : valueText(safe);
64
94
  return {
65
95
  path: fieldPointer(key, index),
66
96
  label: bound(
@@ -69,7 +99,7 @@ function toolReviewFields(argumentsValue, context) {
69
99
  ),
70
100
  preview: bound(text, 240),
71
101
  ...count !== void 0 ? { count } : {},
72
- truncated: !hidden && (text.length > 240 || typeof value === "object" && value !== null),
102
+ truncated: !hidden && (text.length > 240 || compactList === void 0 && typeof value === "object" && value !== null),
73
103
  ...hidden ? { protected: true } : {}
74
104
  };
75
105
  })
@@ -77,7 +107,12 @@ function toolReviewFields(argumentsValue, context) {
77
107
  }
78
108
  function toolReviewAction(toolName, argumentsValue, context) {
79
109
  const fallback = {
80
- title: context?.title ?? bound(toolReviewFieldLabel(toolName.replace(/^mcp_[^_]+__/, "")), 256),
110
+ title: context?.title ?? bound(
111
+ toolReviewFieldLabel(
112
+ toolName.replace(/^mcp_[^_]+__/, "").replace(/^batch[_-](?=[a-z])/i, "")
113
+ ),
114
+ 256
115
+ ),
81
116
  approveLabel: "Approve action",
82
117
  effects: []
83
118
  };
@@ -88,7 +123,7 @@ function toolReviewAction(toolName, argumentsValue, context) {
88
123
  const selectionKind = thread ? "threads" : "messages";
89
124
  const ids = thread && typeof args.threadId === "string" ? [args.threadId] : Array.isArray(args.messageIds) ? args.messageIds : typeof args.messageId === "string" ? [args.messageId] : null;
90
125
  const selectionCount = ids?.every((id) => typeof id === "string") ? new Set(ids).size : void 0;
91
- const noun = selectionCount === void 0 ? selectionKind : `${selectionCount.toLocaleString("en-US")} ${thread ? "thread" : "message"}${selectionCount === 1 ? "" : "s"}`;
126
+ const noun = selectionCount === void 0 ? thread ? "conversations" : "messages" : `${selectionCount.toLocaleString("en-US")} ${thread ? "conversation" : "message"}${selectionCount === 1 ? "" : "s"}`;
92
127
  const addValues = toolName.startsWith("label_") ? args.labelIds : args.addLabelIds;
93
128
  const adds = Array.isArray(addValues) ? addValues.filter((v) => typeof v === "string") : [];
94
129
  const removeValues = toolName.startsWith("unlabel_") ? args.labelIds : args.removeLabelIds;
@@ -123,7 +158,7 @@ function toolReviewAction(toolName, argumentsValue, context) {
123
158
  approveLabel: trash ? "Move to Trash" : "Apply changes",
124
159
  effects,
125
160
  ...selectionCount === void 0 ? {} : { selectionCount, selectionKind },
126
- ...trash ? { consequence: "Messages stay recoverable in Trash until Gmail deletes them." } : thread ? { consequence: "Applies to every message in the selected thread." } : {}
161
+ ...trash ? { consequence: "Messages stay recoverable in Trash until Gmail deletes them." } : thread ? { consequence: "Applies to every message in the conversation." } : {}
127
162
  };
128
163
  }
129
164
  if (["trash_message", "restore_message", "trash_thread", "restore_thread"].includes(toolName))
@@ -229,4 +264,4 @@ export {
229
264
  toolReviewAction,
230
265
  toolReviewDetails
231
266
  };
232
- //# sourceMappingURL=chunk-RYEHNSO7.js.map
267
+ //# sourceMappingURL=chunk-TCXCRBPF.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/tool-review-presentation.ts"],"sourcesContent":["import type {\n ToolActionReview,\n ToolReviewContext,\n ToolReviewDetailsPage,\n} from \"./tool-action-review\";\n\nconst protectedName =\n /password|passwd|secret|credential|authorization|cookie|(^|[_-])token($|[_-])|api[_-]?key|accessToken|refreshToken|privateKey/i;\nconst protectedReviewField = (key: string, fields: readonly string[] = []) =>\n protectedName.test(key) || fields.includes(key) || fields.includes(\"*\");\nconst bound = (value: string, limit: number) =>\n value.length > limit ? `${value.slice(0, limit)}…` : value;\nexport function toolReviewFieldLabel(key: string): string {\n const label = key\n .replace(/([a-z0-9])([A-Z])/g, \"$1 $2\")\n .replace(/[_-]+/g, \" \")\n .replace(/\\bids?\\b/gi, (word) => (word.length === 3 ? \"IDs\" : \"ID\"))\n .replace(\n /\\b(api|url|uri|http|https|ip|sql|json|html)(s?)\\b/gi,\n (_word, name: string, plural: string) => `${name.toUpperCase()}${plural}`,\n )\n // Sentence case, keeping acronyms: \"Working Directory\" → \"Working directory\".\n .replace(\n /(?<=\\S\\s+)([A-Z])([a-z]+)\\b/g,\n (_word, first: string, rest: string) => `${first.toLowerCase()}${rest}`,\n )\n .trim();\n return label.charAt(0).toUpperCase() + label.slice(1);\n}\nexport function decodeReviewArguments(value: unknown): Record<string, unknown> | null {\n // Historical SDK entries sometimes wrapped arguments in JSON. Decode only once.\n let decoded = value;\n if (typeof decoded === \"string\") {\n try {\n decoded = JSON.parse(decoded);\n } catch {\n return null;\n }\n }\n return decoded && typeof decoded === \"object\" && !Array.isArray(decoded)\n ? (decoded as Record<string, unknown>)\n : null;\n}\nexport function safeReviewValue(\n value: unknown,\n key = \"\",\n protectedFields: readonly string[] = [],\n depth = 0,\n): unknown {\n if (protectedReviewField(key, protectedFields)) return \"[Protected value]\";\n if (depth > 20) return \"[Nested value; open this field for details]\";\n if (Array.isArray(value))\n return value.map((entry) => safeReviewValue(entry, \"\", protectedFields, depth + 1));\n if (value && typeof value === \"object\")\n return Object.fromEntries(\n Object.entries(value).map(([name, entry]) => [\n name,\n safeReviewValue(entry, name, protectedFields, depth + 1),\n ]),\n );\n return value;\n}\nfunction valueText(value: unknown): string {\n return typeof value === \"string\"\n ? value\n : value === null\n ? \"None\"\n : typeof value === \"boolean\"\n ? value\n ? \"Yes\"\n : \"No\"\n : (JSON.stringify(value) ?? \"Unavailable\");\n}\nconst pointer = (name: string) => `/${name.replaceAll(\"~\", \"~0\").replaceAll(\"/\", \"~1\")}`;\n// Long arbitrary property names remain readable without placing them in every\n// preview or URL. An indexed segment opens their saved name and value together.\nconst fieldPointer = (key: string, index: number, parent = \"\") =>\n pointer(key).length > 256 || parent.length + pointer(key).length > 1024\n ? `/~2${index}`\n : pointer(key);\n\nexport function toolReviewFields(\n argumentsValue: unknown,\n context?: ToolReviewContext,\n): { fields: ToolActionReview[\"fields\"]; moreFields: number } {\n const args = decodeReviewArguments(argumentsValue);\n if (!args) return { fields: [], moreFields: 0 };\n const entries = Object.entries(args);\n if (context?.email) {\n const email = toolReviewFields(context.email);\n const original = toolReviewFields(args, { ...context, email: undefined });\n const fields = [\n ...email.fields\n .filter(\n (field) =>\n field.path !== \"/contentSha256\" && field.path !== \"/htmlBody\" && field.preview !== \"\",\n )\n .map((field) => ({\n ...field,\n label: field.path === \"/textBody\" ? \"Message\" : field.label,\n path: `/$email${field.path}`,\n ...(field.path === \"/attachments\"\n ? {\n preview: context\n .email!.attachments.map((attachment) => attachment.name)\n .join(\", \")\n .slice(0, 240),\n }\n : {}),\n })),\n ...original.fields.filter(\n (field) =>\n ![\n \"/raw\",\n \"/expectedContentSha256\",\n \"/from\",\n \"/to\",\n \"/cc\",\n \"/bcc\",\n \"/subject\",\n \"/body\",\n \"/textBody\",\n \"/htmlBody\",\n \"/attachments\",\n ].includes(field.path),\n ),\n ];\n return {\n fields: fields.slice(0, 16),\n moreFields: original.moreFields + Math.max(0, fields.length - 16),\n };\n }\n return {\n moreFields: Math.max(0, entries.length - 16),\n fields: entries.slice(0, 16).map(([key, value], index) => {\n const hidden = protectedReviewField(key, context?.protectedFields);\n const safe = hidden ? \"[Protected value]\" : value;\n const count = !hidden && Array.isArray(value) ? value.length : undefined;\n const compactList =\n !hidden &&\n Array.isArray(value) &&\n value.length > 0 &&\n value.length <= 4 &&\n value.every(\n (entry) =>\n typeof entry === \"string\" || typeof entry === \"number\" || typeof entry === \"boolean\",\n )\n ? value.map(valueText).join(\", \")\n : undefined;\n const text =\n compactList !== undefined\n ? compactList\n : count !== undefined\n ? `${count.toLocaleString(\"en-US\")} item${count === 1 ? \"\" : \"s\"}`\n : safe && typeof safe === \"object\"\n ? `${Object.keys(safe).length} field${Object.keys(safe).length === 1 ? \"\" : \"s\"}`\n : valueText(safe);\n return {\n path: fieldPointer(key, index),\n label: bound(\n (context?.fieldLabels && Object.hasOwn(context.fieldLabels, key)\n ? context.fieldLabels[key]\n : undefined) ?? toolReviewFieldLabel(key),\n 256,\n ),\n preview: bound(text, 240),\n ...(count !== undefined ? { count } : {}),\n truncated:\n !hidden &&\n (text.length > 240 ||\n (compactList === undefined && typeof value === \"object\" && value !== null)),\n ...(hidden ? { protected: true } : {}),\n };\n }),\n };\n}\n\n/** Deterministic consequences from the reviewed bytes. Unknown fields remain visible. */\nexport function toolReviewAction(\n toolName: string,\n argumentsValue: unknown,\n context?: ToolReviewContext,\n): Pick<\n ToolActionReview,\n \"title\" | \"approveLabel\" | \"effects\" | \"consequence\" | \"selectionCount\" | \"selectionKind\"\n> {\n const fallback = {\n title:\n context?.title ??\n bound(\n toolReviewFieldLabel(\n toolName.replace(/^mcp_[^_]+__/, \"\").replace(/^batch[_-](?=[a-z])/i, \"\"),\n ),\n 256,\n ),\n approveLabel: \"Approve action\",\n effects: [] as string[],\n };\n if (context?.kind !== \"gmail\") return fallback;\n const args = decodeReviewArguments(argumentsValue);\n if (!args) return fallback;\n const thread = toolName.endsWith(\"_thread\");\n const selectionKind = thread ? (\"threads\" as const) : (\"messages\" as const);\n const ids =\n thread && typeof args.threadId === \"string\"\n ? [args.threadId]\n : Array.isArray(args.messageIds)\n ? args.messageIds\n : typeof args.messageId === \"string\"\n ? [args.messageId]\n : null;\n const selectionCount = ids?.every((id) => typeof id === \"string\") ? new Set(ids).size : undefined;\n const noun =\n selectionCount === undefined\n ? thread\n ? \"conversations\"\n : \"messages\"\n : `${selectionCount.toLocaleString(\"en-US\")} ${thread ? \"conversation\" : \"message\"}${selectionCount === 1 ? \"\" : \"s\"}`;\n const addValues = toolName.startsWith(\"label_\") ? args.labelIds : args.addLabelIds;\n const adds = Array.isArray(addValues)\n ? addValues.filter((v): v is string => typeof v === \"string\")\n : [];\n const removeValues = toolName.startsWith(\"unlabel_\") ? args.labelIds : args.removeLabelIds;\n const removes = Array.isArray(removeValues)\n ? removeValues.filter((v): v is string => typeof v === \"string\")\n : [];\n const labelEffect = (label: string, adding: boolean): string => {\n const known: Record<string, [string, string]> = {\n TRASH: [\"Move to Trash\", \"Remove from Trash\"],\n INBOX: [\"Move to Inbox\", \"Remove from Inbox\"],\n UNREAD: [\"Mark as unread\", \"Mark as read\"],\n STARRED: [\"Add star\", \"Remove star\"],\n SPAM: [\"Mark as spam\", \"Remove from Spam\"],\n IMPORTANT: [\"Mark as important\", \"Remove importance\"],\n };\n return (\n (Object.hasOwn(known, label) ? known[label]?.[adding ? 0 : 1] : undefined) ??\n `${adding ? \"Add\" : \"Remove\"} label ${bound(label, 120)}`\n );\n };\n const effects = [\n ...adds.map((id) => labelEffect(id, true)),\n ...removes.map((id) => labelEffect(id, false)),\n ];\n if (\n [\n \"batch_modify_messages\",\n \"modify_message\",\n \"modify_thread\",\n \"label_message\",\n \"label_thread\",\n \"unlabel_message\",\n \"unlabel_thread\",\n ].includes(toolName)\n ) {\n const trash = adds.includes(\"TRASH\");\n return {\n title: trash ? `Move ${noun} to Trash` : `Update ${noun}`,\n approveLabel: trash ? \"Move to Trash\" : \"Apply changes\",\n effects,\n ...(selectionCount === undefined ? {} : { selectionCount, selectionKind }),\n ...(trash\n ? { consequence: \"Messages stay recoverable in Trash until Gmail deletes them.\" }\n : thread\n ? { consequence: \"Applies to every message in the conversation.\" }\n : {}),\n };\n }\n if ([\"trash_message\", \"restore_message\", \"trash_thread\", \"restore_thread\"].includes(toolName))\n return {\n title: toolName.startsWith(\"trash_\") ? `Move ${noun} to Trash` : `Remove ${noun} from Trash`,\n approveLabel: toolName.startsWith(\"trash_\") ? \"Move to Trash\" : \"Remove from Trash\",\n effects,\n ...(selectionCount === undefined ? {} : { selectionCount, selectionKind }),\n };\n const named: Record<string, [string, string]> = {\n send_message: [\"Send email\", \"Send email\"],\n send_draft: [\"Send draft\", \"Send draft\"],\n create_draft: [\"Create email draft\", \"Create draft\"],\n update_draft: [\"Update email draft\", \"Update draft\"],\n delete_draft: [\"Delete email draft\", \"Delete draft\"],\n create_label: [\"Create label\", \"Create label\"],\n update_label: [\"Update label\", \"Update label\"],\n delete_label: [\"Delete label\", \"Delete label\"],\n };\n const action = Object.hasOwn(named, toolName) ? named[toolName] : undefined;\n return action ? { title: action[0], approveLabel: action[1], effects } : fallback;\n}\n\n/** A bounded slice of the immutable saved arguments; never evaluates a fresh provider query. */\nexport function toolReviewDetails(\n argumentsValue: unknown,\n context: ToolReviewContext | undefined,\n path: string,\n offset: number,\n limit = 25,\n): Omit<ToolReviewDetailsPage, \"id\" | \"actionDigest\" | \"version\"> {\n if (\n !Number.isSafeInteger(offset) ||\n offset < 0 ||\n !Number.isSafeInteger(limit) ||\n limit < 1 ||\n limit > 50\n )\n throw new Error(\"Invalid review page\");\n const args = decodeReviewArguments(argumentsValue);\n let value: unknown = context?.email ? { ...args, $email: context.email } : args;\n if (path !== \"\") {\n if (!path.startsWith(\"/\")) throw new Error(\"Invalid review field\");\n for (const escaped of path.slice(1).split(\"/\")) {\n if (/^~2\\d+$/.test(escaped)) {\n if (!value || typeof value !== \"object\" || Array.isArray(value))\n throw new Error(\"Review field not found\");\n const selected = Object.entries(value)[Number(escaped.slice(2))];\n if (!selected) throw new Error(\"Review field not found\");\n value = {\n fieldName: selected[0],\n value: protectedReviewField(selected[0], context?.protectedFields)\n ? \"[Protected value]\"\n : selected[1],\n };\n continue;\n }\n const key = escaped.replaceAll(\"~1\", \"/\").replaceAll(\"~0\", \"~\");\n if (protectedReviewField(key, context?.protectedFields)) {\n value = \"[Protected value]\";\n break;\n }\n if (!value || typeof value !== \"object\" || !Object.hasOwn(value, key))\n throw new Error(\"Review field not found\");\n value = (value as Record<string, unknown>)[key];\n }\n }\n type DetailItem = ToolReviewDetailsPage[\"items\"][number];\n const preview = (\n entry: unknown,\n key: string,\n childPath: string,\n ): Pick<DetailItem, \"value\" | \"truncated\" | \"path\"> => {\n const hidden = protectedReviewField(key, context?.protectedFields);\n if (!hidden && entry !== null && typeof entry === \"object\") {\n const count = Array.isArray(entry) ? entry.length : Object.keys(entry).length;\n return {\n value: `${count.toLocaleString(\"en-US\")} ${Array.isArray(entry) ? (count === 1 ? \"item\" : \"items\") : count === 1 ? \"field\" : \"fields\"}`,\n path: childPath,\n truncated: true,\n };\n }\n const text = valueText(safeReviewValue(entry, key, context?.protectedFields));\n return {\n value: bound(text, 4000),\n ...(hidden ? {} : { path: childPath }),\n truncated: !hidden && text.length > 4000,\n };\n };\n let total: number;\n let items: DetailItem[];\n if (Array.isArray(value)) {\n total = value.length;\n items = value.slice(offset, offset + limit).map((entry, index) => ({\n label: `${offset + index + 1}`,\n ...preview(entry, \"\", `${path}/${offset + index}`),\n }));\n } else if (value && typeof value === \"object\") {\n const entries = Object.entries(value);\n total = entries.length;\n items = entries.slice(offset, offset + limit).map(([key, entry], index) => ({\n label: bound(\n (context?.fieldLabels && Object.hasOwn(context.fieldLabels, key)\n ? context.fieldLabels[key]\n : undefined) ?? toolReviewFieldLabel(key),\n 256,\n ),\n ...preview(entry, key, `${path}${fieldPointer(key, offset + index, path)}`),\n }));\n } else {\n const text = valueText(value);\n total = Math.max(1, Math.ceil(text.length / 4000));\n items = Array.from({ length: Math.max(0, Math.min(limit, total - offset)) }, (_, index) => ({\n label: `Part ${offset + index + 1}`,\n value: text.slice((offset + index) * 4000, (offset + index + 1) * 4000),\n }));\n }\n return { path, items, total, nextOffset: offset + limit < total ? offset + limit : null };\n}\n"],"mappings":";AAMA,IAAM,gBACJ;AACF,IAAM,uBAAuB,CAAC,KAAa,SAA4B,CAAC,MACtE,cAAc,KAAK,GAAG,KAAK,OAAO,SAAS,GAAG,KAAK,OAAO,SAAS,GAAG;AACxE,IAAM,QAAQ,CAAC,OAAe,UAC5B,MAAM,SAAS,QAAQ,GAAG,MAAM,MAAM,GAAG,KAAK,CAAC,WAAM;AAChD,SAAS,qBAAqB,KAAqB;AACxD,QAAM,QAAQ,IACX,QAAQ,sBAAsB,OAAO,EACrC,QAAQ,UAAU,GAAG,EACrB,QAAQ,cAAc,CAAC,SAAU,KAAK,WAAW,IAAI,QAAQ,IAAK,EAClE;AAAA,IACC;AAAA,IACA,CAAC,OAAO,MAAc,WAAmB,GAAG,KAAK,YAAY,CAAC,GAAG,MAAM;AAAA,EACzE,EAEC;AAAA,IACC;AAAA,IACA,CAAC,OAAO,OAAe,SAAiB,GAAG,MAAM,YAAY,CAAC,GAAG,IAAI;AAAA,EACvE,EACC,KAAK;AACR,SAAO,MAAM,OAAO,CAAC,EAAE,YAAY,IAAI,MAAM,MAAM,CAAC;AACtD;AACO,SAAS,sBAAsB,OAAgD;AAEpF,MAAI,UAAU;AACd,MAAI,OAAO,YAAY,UAAU;AAC/B,QAAI;AACF,gBAAU,KAAK,MAAM,OAAO;AAAA,IAC9B,QAAQ;AACN,aAAO;AAAA,IACT;AAAA,EACF;AACA,SAAO,WAAW,OAAO,YAAY,YAAY,CAAC,MAAM,QAAQ,OAAO,IAClE,UACD;AACN;AACO,SAAS,gBACd,OACA,MAAM,IACN,kBAAqC,CAAC,GACtC,QAAQ,GACC;AACT,MAAI,qBAAqB,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,QAAQ,OAAO,KAAK,GAAG,IAAI,GAAG,aAAa,KAAK,SAAS,OAAO,IAAI,CAAC,EAAE;AAAA,IAC5E,EAAE;AAAA,EACJ,OAAO;AACL,UAAM,OAAO,UAAU,KAAK;AAC5B,YAAQ,KAAK,IAAI,GAAG,KAAK,KAAK,KAAK,SAAS,GAAI,CAAC;AACjD,YAAQ,MAAM,KAAK,EAAE,QAAQ,KAAK,IAAI,GAAG,KAAK,IAAI,OAAO,QAAQ,MAAM,CAAC,EAAE,GAAG,CAAC,GAAG,WAAW;AAAA,MAC1F,OAAO,QAAQ,SAAS,QAAQ,CAAC;AAAA,MACjC,OAAO,KAAK,OAAO,SAAS,SAAS,MAAO,SAAS,QAAQ,KAAK,GAAI;AAAA,IACxE,EAAE;AAAA,EACJ;AACA,SAAO,EAAE,MAAM,OAAO,OAAO,YAAY,SAAS,QAAQ,QAAQ,SAAS,QAAQ,KAAK;AAC1F;","names":[]}
package/dist/connect.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  IntegrationInstanceKey,
3
3
  IntegrationSource
4
- } from "./chunk-LLFQJL3S.js";
4
+ } from "./chunk-LGT7XRX7.js";
5
5
  import "./chunk-4JGHSSB7.js";
6
6
  import "./chunk-5IXYF6XN.js";
7
7
  import "./chunk-NRMCVHAU.js";
@@ -16,7 +16,7 @@ import "./chunk-YRKRZ6OF.js";
16
16
  import "./chunk-2VORLN2R.js";
17
17
  import "./chunk-GRG7PHWQ.js";
18
18
  import "./chunk-YRXAWWCU.js";
19
- import "./chunk-RYEHNSO7.js";
19
+ import "./chunk-TCXCRBPF.js";
20
20
  import "./chunk-2ACYHZFB.js";
21
21
  import "./chunk-KHHZTBP7.js";
22
22
  import "./chunk-YBW5JSA3.js";
@@ -6,8 +6,8 @@ import {
6
6
  ConnectionUseAuthorizationResult,
7
7
  ConnectionUseDenialReason,
8
8
  ConnectionUseSelectionSource
9
- } from "./chunk-AIEC5DTX.js";
10
- import "./chunk-LLFQJL3S.js";
9
+ } from "./chunk-IBQ2IDBV.js";
10
+ import "./chunk-LGT7XRX7.js";
11
11
  import "./chunk-4JGHSSB7.js";
12
12
  import "./chunk-5IXYF6XN.js";
13
13
  import "./chunk-NRMCVHAU.js";
@@ -22,7 +22,7 @@ import "./chunk-YRKRZ6OF.js";
22
22
  import "./chunk-2VORLN2R.js";
23
23
  import "./chunk-GRG7PHWQ.js";
24
24
  import "./chunk-YRXAWWCU.js";
25
- import "./chunk-RYEHNSO7.js";
25
+ import "./chunk-TCXCRBPF.js";
26
26
  import "./chunk-2ACYHZFB.js";
27
27
  import "./chunk-KHHZTBP7.js";
28
28
  import "./chunk-YBW5JSA3.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  ConnectionMetadata
3
- } from "./chunk-LLFQJL3S.js";
3
+ } from "./chunk-LGT7XRX7.js";
4
4
  import "./chunk-4JGHSSB7.js";
5
5
  import "./chunk-5IXYF6XN.js";
6
6
  import "./chunk-NRMCVHAU.js";
@@ -18,7 +18,7 @@ import "./chunk-YRKRZ6OF.js";
18
18
  import "./chunk-2VORLN2R.js";
19
19
  import "./chunk-GRG7PHWQ.js";
20
20
  import "./chunk-YRXAWWCU.js";
21
- import "./chunk-RYEHNSO7.js";
21
+ import "./chunk-TCXCRBPF.js";
22
22
  import "./chunk-2ACYHZFB.js";
23
23
  import "./chunk-KHHZTBP7.js";
24
24
  import "./chunk-YBW5JSA3.js";
@@ -3,14 +3,14 @@ import {
3
3
  } from "./chunk-KR2V42UZ.js";
4
4
  import {
5
5
  ConnectionUseAuthoritySnapshot
6
- } from "./chunk-AIEC5DTX.js";
6
+ } from "./chunk-IBQ2IDBV.js";
7
7
  import {
8
8
  HostMcpCreateSelections,
9
9
  ManagedUserResourceGrantMode,
10
10
  McpServerConnectionRef,
11
11
  SessionTenancyVisibility,
12
12
  stableJson
13
- } from "./chunk-LLFQJL3S.js";
13
+ } from "./chunk-LGT7XRX7.js";
14
14
  import "./chunk-4JGHSSB7.js";
15
15
  import "./chunk-5IXYF6XN.js";
16
16
  import "./chunk-NRMCVHAU.js";
@@ -25,7 +25,7 @@ import "./chunk-YRKRZ6OF.js";
25
25
  import "./chunk-2VORLN2R.js";
26
26
  import "./chunk-GRG7PHWQ.js";
27
27
  import "./chunk-YRXAWWCU.js";
28
- import "./chunk-RYEHNSO7.js";
28
+ import "./chunk-TCXCRBPF.js";
29
29
  import "./chunk-2ACYHZFB.js";
30
30
  import "./chunk-KHHZTBP7.js";
31
31
  import "./chunk-YBW5JSA3.js";
package/dist/index.d.ts CHANGED
@@ -42,6 +42,7 @@ export * from "./editable-artifact-serialized-commit.js";
42
42
  export * from "./signup-attribution.js";
43
43
  export * from "./product-lifecycle-facts.js";
44
44
  export * from "./tool-catalog.js";
45
+ export * from "./mcp-structured-content.js";
45
46
  export * from "./mcp-oauth.js";
46
47
  export * from "./tool-result-spill.js";
47
48
  export * from "./interaction.js";
@@ -1295,8 +1296,11 @@ export declare const WorkspaceTranscriptionTarget: z.ZodObject<{
1295
1296
  }, z.core.$strict>;
1296
1297
  export type WorkspaceTranscriptionTarget = z.infer<typeof WorkspaceTranscriptionTarget>;
1297
1298
  export declare const TranscriptionErrorCode: z.ZodEnum<{
1299
+ allowance_exhausted: "allowance_exhausted";
1298
1300
  cancelled: "cancelled";
1301
+ insufficient_credits: "insufficient_credits";
1299
1302
  invalid_audio: "invalid_audio";
1303
+ monthly_model_cost_limit: "monthly_model_cost_limit";
1300
1304
  network: "network";
1301
1305
  not_supported: "not_supported";
1302
1306
  permission_denied: "permission_denied";
@@ -1310,8 +1314,11 @@ export declare const TranscriptionErrorCode: z.ZodEnum<{
1310
1314
  export type TranscriptionErrorCode = z.infer<typeof TranscriptionErrorCode>;
1311
1315
  /** Stable user-safe error codes for the native voice-input transcription path. */
1312
1316
  export declare const VoiceInputErrorCode: z.ZodEnum<{
1317
+ allowance_exhausted: "allowance_exhausted";
1313
1318
  cancelled: "cancelled";
1319
+ insufficient_credits: "insufficient_credits";
1314
1320
  invalid_audio: "invalid_audio";
1321
+ monthly_model_cost_limit: "monthly_model_cost_limit";
1315
1322
  network: "network";
1316
1323
  not_supported: "not_supported";
1317
1324
  permission_denied: "permission_denied";
@@ -1466,8 +1473,11 @@ export declare const TranscriptionEvent: z.ZodDiscriminatedUnion<[z.ZodObject<{
1466
1473
  occurredAt: z.ZodString;
1467
1474
  type: z.ZodLiteral<"session.error">;
1468
1475
  code: z.ZodEnum<{
1476
+ allowance_exhausted: "allowance_exhausted";
1469
1477
  cancelled: "cancelled";
1478
+ insufficient_credits: "insufficient_credits";
1470
1479
  invalid_audio: "invalid_audio";
1480
+ monthly_model_cost_limit: "monthly_model_cost_limit";
1471
1481
  network: "network";
1472
1482
  not_supported: "not_supported";
1473
1483
  permission_denied: "permission_denied";
@@ -1559,6 +1569,7 @@ export type WorkspaceTranscriptionPolicy = z.infer<typeof WorkspaceTranscription
1559
1569
  * preferred billing route; credentials and model configuration remain private.
1560
1570
  */
1561
1571
  export declare const VoiceInputProviderId: z.ZodEnum<{
1572
+ "azure-mai": "azure-mai";
1562
1573
  "azure-openai": "azure-openai";
1563
1574
  "codex-subscription": "codex-subscription";
1564
1575
  openai: "openai";
@@ -1568,6 +1579,7 @@ export type VoiceInputProviderId = z.infer<typeof VoiceInputProviderId>;
1568
1579
  export declare const WorkspaceVoiceInputSettings: z.ZodObject<{
1569
1580
  enabled: z.ZodBoolean;
1570
1581
  preferredProvider: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
1582
+ "azure-mai": "azure-mai";
1571
1583
  "azure-openai": "azure-openai";
1572
1584
  "codex-subscription": "codex-subscription";
1573
1585
  openai: "openai";
@@ -1969,6 +1981,7 @@ export declare const WorkspaceSessionToolDefaultsPatch: z.ZodObject<{
1969
1981
  export declare const ClientVoiceInputConfig: z.ZodObject<{
1970
1982
  available: z.ZodBoolean;
1971
1983
  providers: z.ZodOptional<z.ZodArray<z.ZodEnum<{
1984
+ "azure-mai": "azure-mai";
1972
1985
  "azure-openai": "azure-openai";
1973
1986
  "codex-subscription": "codex-subscription";
1974
1987
  openai: "openai";
@@ -2346,6 +2359,7 @@ export declare const WorkspaceSettingsSchema: z.ZodObject<{
2346
2359
  voiceInput: z.ZodOptional<z.ZodObject<{
2347
2360
  enabled: z.ZodBoolean;
2348
2361
  preferredProvider: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
2362
+ "azure-mai": "azure-mai";
2349
2363
  "azure-openai": "azure-openai";
2350
2364
  "codex-subscription": "codex-subscription";
2351
2365
  openai: "openai";
@@ -2687,6 +2701,7 @@ export declare const UpdateWorkspaceSettingsRequest: z.ZodObject<{
2687
2701
  voiceInput: z.ZodOptional<z.ZodObject<{
2688
2702
  enabled: z.ZodBoolean;
2689
2703
  preferredProvider: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
2704
+ "azure-mai": "azure-mai";
2690
2705
  "azure-openai": "azure-openai";
2691
2706
  "codex-subscription": "codex-subscription";
2692
2707
  openai: "openai";
@@ -6506,6 +6521,7 @@ export declare const PromotionalCreditBalance: z.ZodObject<{
6506
6521
  eligibleModelIds: z.ZodArray<z.ZodString>;
6507
6522
  grantId: z.ZodString;
6508
6523
  remainingMicros: z.ZodNumber;
6524
+ coversVoice: z.ZodOptional<z.ZodBoolean>;
6509
6525
  }, z.core.$strip>;
6510
6526
  export type PromotionalCreditBalance = z.infer<typeof PromotionalCreditBalance>;
6511
6527
  export declare const BillingBalance: z.ZodObject<{
@@ -6519,6 +6535,7 @@ export declare const BillingBalance: z.ZodObject<{
6519
6535
  eligibleModelIds: z.ZodArray<z.ZodString>;
6520
6536
  grantId: z.ZodString;
6521
6537
  remainingMicros: z.ZodNumber;
6538
+ coversVoice: z.ZodOptional<z.ZodBoolean>;
6522
6539
  }, z.core.$strip>>>;
6523
6540
  }, z.core.$strip>;
6524
6541
  export type BillingBalance = z.infer<typeof BillingBalance>;
@@ -6576,6 +6593,7 @@ export declare const BillingCheckoutStatus: z.ZodObject<{
6576
6593
  eligibleModelIds: z.ZodArray<z.ZodString>;
6577
6594
  grantId: z.ZodString;
6578
6595
  remainingMicros: z.ZodNumber;
6596
+ coversVoice: z.ZodOptional<z.ZodBoolean>;
6579
6597
  }, z.core.$strip>>>;
6580
6598
  }, z.core.$strip>>;
6581
6599
  }, z.core.$strip>;
@@ -9048,7 +9066,10 @@ export type CodexRealtimeWebrtcRequest = z.infer<typeof CodexRealtimeWebrtcReque
9048
9066
  export declare const CodexRealtimeWebrtcResponse: z.ZodObject<{
9049
9067
  sdp: z.ZodString;
9050
9068
  version: z.ZodLiteral<"v3">;
9051
- model: z.ZodLiteral<"gpt-live-1-boulder-alpha">;
9069
+ model: z.ZodEnum<{
9070
+ "gpt-live-1-boulder-alpha": "gpt-live-1-boulder-alpha";
9071
+ "opengeni-azure/gpt-live-1": "opengeni-azure/gpt-live-1";
9072
+ }>;
9052
9073
  connectionId: z.ZodString;
9053
9074
  connectionEpoch: z.ZodNumber;
9054
9075
  startupFenceSequence: z.ZodNumber;
@@ -9291,6 +9312,7 @@ export declare const SyncSessionRealtimeLedgerResponse: z.ZodObject<{
9291
9312
  export type SyncSessionRealtimeLedgerResponse = z.infer<typeof SyncSessionRealtimeLedgerResponse>;
9292
9313
  export declare const SessionRealtimeModel: z.ZodEnum<{
9293
9314
  "gpt-live-1-boulder-alpha": "gpt-live-1-boulder-alpha";
9315
+ "opengeni-azure/gpt-live-1": "opengeni-azure/gpt-live-1";
9294
9316
  "opengeni-gateway/openai/gpt-realtime-2.1": "opengeni-gateway/openai/gpt-realtime-2.1";
9295
9317
  "opengeni-gateway/openai/gpt-realtime-mini": "opengeni-gateway/openai/gpt-realtime-mini";
9296
9318
  "opengeni-gateway/xai/grok-voice-think-fast-2.0": "opengeni-gateway/xai/grok-voice-think-fast-2.0";
@@ -9303,6 +9325,7 @@ export type SessionRealtimeModel = z.infer<typeof SessionRealtimeModel>;
9303
9325
  export declare const WorkspaceRealtimeModelCatalogItem: z.ZodObject<{
9304
9326
  id: z.ZodEnum<{
9305
9327
  "gpt-live-1-boulder-alpha": "gpt-live-1-boulder-alpha";
9328
+ "opengeni-azure/gpt-live-1": "opengeni-azure/gpt-live-1";
9306
9329
  "opengeni-gateway/openai/gpt-realtime-2.1": "opengeni-gateway/openai/gpt-realtime-2.1";
9307
9330
  "opengeni-gateway/openai/gpt-realtime-mini": "opengeni-gateway/openai/gpt-realtime-mini";
9308
9331
  "opengeni-gateway/xai/grok-voice-think-fast-2.0": "opengeni-gateway/xai/grok-voice-think-fast-2.0";
@@ -9321,6 +9344,7 @@ export declare const WorkspaceRealtimeModelCatalogItem: z.ZodObject<{
9321
9344
  description: z.ZodString;
9322
9345
  available: z.ZodBoolean;
9323
9346
  unavailableReason: z.ZodNullable<z.ZodString>;
9347
+ unavailableCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
9324
9348
  recommended: z.ZodBoolean;
9325
9349
  }, z.core.$strip>;
9326
9350
  export type WorkspaceRealtimeModelCatalogItem = z.infer<typeof WorkspaceRealtimeModelCatalogItem>;
@@ -9328,6 +9352,7 @@ export declare const WorkspaceRealtimeModelCatalogResponse: z.ZodObject<{
9328
9352
  models: z.ZodArray<z.ZodObject<{
9329
9353
  id: z.ZodEnum<{
9330
9354
  "gpt-live-1-boulder-alpha": "gpt-live-1-boulder-alpha";
9355
+ "opengeni-azure/gpt-live-1": "opengeni-azure/gpt-live-1";
9331
9356
  "opengeni-gateway/openai/gpt-realtime-2.1": "opengeni-gateway/openai/gpt-realtime-2.1";
9332
9357
  "opengeni-gateway/openai/gpt-realtime-mini": "opengeni-gateway/openai/gpt-realtime-mini";
9333
9358
  "opengeni-gateway/xai/grok-voice-think-fast-2.0": "opengeni-gateway/xai/grok-voice-think-fast-2.0";
@@ -9346,6 +9371,7 @@ export declare const WorkspaceRealtimeModelCatalogResponse: z.ZodObject<{
9346
9371
  description: z.ZodString;
9347
9372
  available: z.ZodBoolean;
9348
9373
  unavailableReason: z.ZodNullable<z.ZodString>;
9374
+ unavailableCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
9349
9375
  recommended: z.ZodBoolean;
9350
9376
  }, z.core.$strip>>;
9351
9377
  }, z.core.$strip>;
@@ -9369,6 +9395,7 @@ export declare const SessionRealtimeMode: z.ZodObject<{
9369
9395
  browserInstanceId: z.ZodString;
9370
9396
  model: z.ZodEnum<{
9371
9397
  "gpt-live-1-boulder-alpha": "gpt-live-1-boulder-alpha";
9398
+ "opengeni-azure/gpt-live-1": "opengeni-azure/gpt-live-1";
9372
9399
  "opengeni-gateway/openai/gpt-realtime-2.1": "opengeni-gateway/openai/gpt-realtime-2.1";
9373
9400
  "opengeni-gateway/openai/gpt-realtime-mini": "opengeni-gateway/openai/gpt-realtime-mini";
9374
9401
  "opengeni-gateway/xai/grok-voice-think-fast-2.0": "opengeni-gateway/xai/grok-voice-think-fast-2.0";
@@ -9401,6 +9428,7 @@ export declare const BeginSessionRealtimeRequest: z.ZodObject<{
9401
9428
  operationId: z.ZodString;
9402
9429
  model: z.ZodEnum<{
9403
9430
  "gpt-live-1-boulder-alpha": "gpt-live-1-boulder-alpha";
9431
+ "opengeni-azure/gpt-live-1": "opengeni-azure/gpt-live-1";
9404
9432
  "opengeni-gateway/openai/gpt-realtime-2.1": "opengeni-gateway/openai/gpt-realtime-2.1";
9405
9433
  "opengeni-gateway/openai/gpt-realtime-mini": "opengeni-gateway/openai/gpt-realtime-mini";
9406
9434
  "opengeni-gateway/xai/grok-voice-think-fast-2.0": "opengeni-gateway/xai/grok-voice-think-fast-2.0";
@@ -9427,6 +9455,16 @@ export declare const EndSessionRealtimeRequest: z.ZodObject<{
9427
9455
  }>;
9428
9456
  }, z.core.$strip>;
9429
9457
  export type EndSessionRealtimeRequest = z.infer<typeof EndSessionRealtimeRequest>;
9458
+ /**
9459
+ * Server instruction to end a live call now. Deployment-funded voice returns
9460
+ * it from a heartbeat when credits run out; the lease is then no longer
9461
+ * extended, so the client should drain and end the call gracefully.
9462
+ */
9463
+ export declare const SessionRealtimeStopInstruction: z.ZodObject<{
9464
+ code: z.ZodString;
9465
+ message: z.ZodString;
9466
+ }, z.core.$strip>;
9467
+ export type SessionRealtimeStopInstruction = z.infer<typeof SessionRealtimeStopInstruction>;
9430
9468
  export declare const SessionRealtimeMutationResponse: z.ZodObject<{
9431
9469
  mode: z.ZodObject<{
9432
9470
  id: z.ZodString;
@@ -9435,6 +9473,7 @@ export declare const SessionRealtimeMutationResponse: z.ZodObject<{
9435
9473
  browserInstanceId: z.ZodString;
9436
9474
  model: z.ZodEnum<{
9437
9475
  "gpt-live-1-boulder-alpha": "gpt-live-1-boulder-alpha";
9476
+ "opengeni-azure/gpt-live-1": "opengeni-azure/gpt-live-1";
9438
9477
  "opengeni-gateway/openai/gpt-realtime-2.1": "opengeni-gateway/openai/gpt-realtime-2.1";
9439
9478
  "opengeni-gateway/openai/gpt-realtime-mini": "opengeni-gateway/openai/gpt-realtime-mini";
9440
9479
  "opengeni-gateway/xai/grok-voice-think-fast-2.0": "opengeni-gateway/xai/grok-voice-think-fast-2.0";
@@ -9461,6 +9500,10 @@ export declare const SessionRealtimeMutationResponse: z.ZodObject<{
9461
9500
  }>>;
9462
9501
  }, z.core.$strip>;
9463
9502
  replay: z.ZodBoolean;
9503
+ stop: z.ZodOptional<z.ZodObject<{
9504
+ code: z.ZodString;
9505
+ message: z.ZodString;
9506
+ }, z.core.$strip>>;
9464
9507
  }, z.core.$strip>;
9465
9508
  export type SessionRealtimeMutationResponse = z.infer<typeof SessionRealtimeMutationResponse>;
9466
9509
  export declare const SessionAuthorizationOperation: z.ZodEnum<{
@@ -26260,6 +26303,9 @@ export declare const CapabilityRuntime: z.ZodObject<{
26260
26303
  verified_probe: "verified_probe";
26261
26304
  }>;
26262
26305
  }, z.core.$strip>>;
26306
+ operatorOAuthClient: z.ZodOptional<z.ZodObject<{
26307
+ configured: z.ZodBoolean;
26308
+ }, z.core.$strip>>;
26263
26309
  }, z.core.$strip>;
26264
26310
  export type CapabilityRuntime = z.infer<typeof CapabilityRuntime>;
26265
26311
  export declare const CapabilityCatalogItem: z.ZodObject<{
@@ -26332,6 +26378,9 @@ export declare const CapabilityCatalogItem: z.ZodObject<{
26332
26378
  verified_probe: "verified_probe";
26333
26379
  }>;
26334
26380
  }, z.core.$strip>>;
26381
+ operatorOAuthClient: z.ZodOptional<z.ZodObject<{
26382
+ configured: z.ZodBoolean;
26383
+ }, z.core.$strip>>;
26335
26384
  }, z.core.$strip>>;
26336
26385
  lifecycle: z.ZodDefault<z.ZodObject<{
26337
26386
  status: z.ZodEnum<{
@@ -26542,6 +26591,9 @@ export declare const CapabilityCatalogResponse: z.ZodObject<{
26542
26591
  verified_probe: "verified_probe";
26543
26592
  }>;
26544
26593
  }, z.core.$strip>>;
26594
+ operatorOAuthClient: z.ZodOptional<z.ZodObject<{
26595
+ configured: z.ZodBoolean;
26596
+ }, z.core.$strip>>;
26545
26597
  }, z.core.$strip>>;
26546
26598
  lifecycle: z.ZodDefault<z.ZodObject<{
26547
26599
  status: z.ZodEnum<{
@@ -26686,6 +26738,9 @@ export declare const DiscoverMcpCapabilitiesResponse: z.ZodObject<{
26686
26738
  verified_probe: "verified_probe";
26687
26739
  }>;
26688
26740
  }, z.core.$strip>>;
26741
+ operatorOAuthClient: z.ZodOptional<z.ZodObject<{
26742
+ configured: z.ZodBoolean;
26743
+ }, z.core.$strip>>;
26689
26744
  }, z.core.$strip>>;
26690
26745
  lifecycle: z.ZodDefault<z.ZodObject<{
26691
26746
  status: z.ZodEnum<{
@@ -42443,6 +42498,7 @@ export declare const ClientConfig: z.ZodObject<{
42443
42498
  voiceInput: z.ZodDefault<z.ZodObject<{
42444
42499
  available: z.ZodBoolean;
42445
42500
  providers: z.ZodOptional<z.ZodArray<z.ZodEnum<{
42501
+ "azure-mai": "azure-mai";
42446
42502
  "azure-openai": "azure-openai";
42447
42503
  "codex-subscription": "codex-subscription";
42448
42504
  openai: "openai";
package/dist/index.js CHANGED
@@ -1484,6 +1484,7 @@ import {
1484
1484
  SessionRealtimeModel,
1485
1485
  SessionRealtimeMutationResponse,
1486
1486
  SessionRealtimeState,
1487
+ SessionRealtimeStopInstruction,
1487
1488
  SessionRetryRequest,
1488
1489
  SessionRetryResponse,
1489
1490
  SessionScopeSubjectId,
@@ -2091,6 +2092,7 @@ import {
2091
2092
  normalizeWorkspaceLearningSourceKind,
2092
2093
  numberTimelineAnnotations,
2093
2094
  omitInlineWorkspaceArchiveWhenObjectRefPresent,
2095
+ omitStructuredContentTextDuplicates,
2094
2096
  parseSkillFrontmatter,
2095
2097
  parseWorkspaceArchiveDescriptor,
2096
2098
  parseWorkspaceArchiveObjectKey,
@@ -2185,7 +2187,7 @@ import {
2185
2187
  workspaceLearningPolicyRouterContext,
2186
2188
  workspaceLearningSourceKey,
2187
2189
  workspaceSlackReactionChannelAllowed
2188
- } from "./chunk-LLFQJL3S.js";
2190
+ } from "./chunk-LGT7XRX7.js";
2189
2191
  import {
2190
2192
  EPHEMERAL_CHROMIUM_DRIVER_ID,
2191
2193
  browserSessionStorageMode
@@ -2381,7 +2383,7 @@ import {
2381
2383
  toolReviewDetails,
2382
2384
  toolReviewFieldLabel,
2383
2385
  toolReviewFields
2384
- } from "./chunk-RYEHNSO7.js";
2386
+ } from "./chunk-TCXCRBPF.js";
2385
2387
  import {
2386
2388
  AUTOMATIC_SESSION_TITLE_FALLBACK,
2387
2389
  AUTOMATIC_SESSION_TITLE_MAX_GRAPHEMES,
@@ -4316,6 +4318,7 @@ export {
4316
4318
  SessionRealtimeModel,
4317
4319
  SessionRealtimeMutationResponse,
4318
4320
  SessionRealtimeState,
4321
+ SessionRealtimeStopInstruction,
4319
4322
  SessionRetryRequest,
4320
4323
  SessionRetryResponse,
4321
4324
  SessionScopeSubjectId,
@@ -5029,6 +5032,7 @@ export {
5029
5032
  normalizeWorkspaceLearningSourceKind,
5030
5033
  numberTimelineAnnotations,
5031
5034
  omitInlineWorkspaceArchiveWhenObjectRefPresent,
5035
+ omitStructuredContentTextDuplicates,
5032
5036
  openGeniSlackBotRequestedScopes,
5033
5037
  organizationAccessPresetPermissions,
5034
5038
  parseConnectorAttachmentTransferEnvelope,
@@ -0,0 +1,25 @@
1
+ import type { AttemptToolResult } from "./tool-catalog.js";
2
+ /**
3
+ * Remove the backwards-compatibility text copy of an MCP result's
4
+ * `structuredContent`.
5
+ *
6
+ * The MCP specification asks a server that returns `structuredContent` to also
7
+ * return the same value serialized in a text content block. Printing or sending
8
+ * both pays for the payload twice, and the text copy pays again for JSON string
9
+ * escaping inside the result envelope.
10
+ *
11
+ * The envelope (`content`, `structuredContent`, `_meta`, `isError`, extension
12
+ * fields) and its key order are kept. Only a plain `{type: "text", text}` block
13
+ * whose text parses as JSON to a value equal to `structuredContent` is removed.
14
+ * Prose, differing JSON, annotated text, images, resources, and every other
15
+ * block stay. A text block whose JSON carries an integer outside the IEEE-754
16
+ * safe range also stays, because its digits may be more precise than the
17
+ * parsed `structuredContent`. Numbers compare by IEEE-754 value.
18
+ *
19
+ * Results without a removable block are returned as the same object.
20
+ *
21
+ * Callers: the runtime's model-facing MCP projection, and the default
22
+ * `ogtool call` print. The native Connected Machine client implements the
23
+ * same rule in `agent/crates/opengeni-agent/src/codemode.rs`; keep them equal.
24
+ */
25
+ export declare function omitStructuredContentTextDuplicates<T extends AttemptToolResult>(result: T): T;
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  ConnectionMetadata
3
- } from "./chunk-LLFQJL3S.js";
3
+ } from "./chunk-LGT7XRX7.js";
4
4
  import "./chunk-4JGHSSB7.js";
5
5
  import "./chunk-5IXYF6XN.js";
6
6
  import "./chunk-NRMCVHAU.js";
@@ -15,7 +15,7 @@ import "./chunk-YRKRZ6OF.js";
15
15
  import "./chunk-2VORLN2R.js";
16
16
  import "./chunk-GRG7PHWQ.js";
17
17
  import "./chunk-YRXAWWCU.js";
18
- import "./chunk-RYEHNSO7.js";
18
+ import "./chunk-TCXCRBPF.js";
19
19
  import "./chunk-2ACYHZFB.js";
20
20
  import "./chunk-KHHZTBP7.js";
21
21
  import "./chunk-YBW5JSA3.js";
@@ -35,6 +35,7 @@ export type ToolReviewContext = z.infer<typeof ToolReviewContext>;
35
35
  export declare function toolReviewContextFromSchema(inputSchema: unknown, hints: Omit<ToolReviewContext, "fieldLabels" | "protectedFields">): ToolReviewContext;
36
36
  export declare const ToolReviewStatus: z.ZodEnum<{
37
37
  approved: "approved";
38
+ blocked: "blocked";
38
39
  cancelled: "cancelled";
39
40
  completed: "completed";
40
41
  executing: "executing";
@@ -64,6 +65,7 @@ export declare const ToolActionReview: z.ZodObject<{
64
65
  revision: z.ZodString;
65
66
  status: z.ZodEnum<{
66
67
  approved: "approved";
68
+ blocked: "blocked";
67
69
  cancelled: "cancelled";
68
70
  completed: "completed";
69
71
  executing: "executing";
@@ -5,7 +5,7 @@ import {
5
5
  toolReviewDetails,
6
6
  toolReviewFieldLabel,
7
7
  toolReviewFields
8
- } from "./chunk-RYEHNSO7.js";
8
+ } from "./chunk-TCXCRBPF.js";
9
9
  export {
10
10
  decodeReviewArguments,
11
11
  safeReviewValue,