@opengeni/contracts 1.3.0 → 1.4.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/agent-config.d.ts +1 -0
- package/dist/atlassian.js +2 -2
- package/dist/{chunk-RYEHNSO7.js → chunk-TCXCRBPF.js} +45 -10
- package/dist/chunk-TCXCRBPF.js.map +1 -0
- package/dist/{chunk-AIEC5DTX.js → chunk-UDKWSRES.js} +2 -2
- package/dist/{chunk-LLFQJL3S.js → chunk-YFEAAOBX.js} +85 -7
- package/dist/chunk-YFEAAOBX.js.map +1 -0
- package/dist/connect.js +2 -2
- package/dist/connection-authority.js +3 -3
- package/dist/google-drive.js +2 -2
- package/dist/host-mcp-bindings.js +3 -3
- package/dist/index.d.ts +42 -1
- package/dist/index.js +6 -2
- package/dist/mcp-structured-content.d.ts +25 -0
- package/dist/personal-github.js +2 -2
- package/dist/tool-action-review.d.ts +2 -0
- package/dist/tool-review-presentation.js +1 -1
- package/dist/transcription-recordings.d.ts +21 -0
- package/package.json +1 -1
- package/src/agent-config.ts +4 -1
- package/src/index.ts +25 -1
- package/src/mcp-structured-content.ts +81 -0
- package/src/tool-action-review.ts +1 -0
- package/src/tool-review-presentation.ts +76 -14
- package/src/transcription-recordings.ts +3 -0
- package/dist/chunk-LLFQJL3S.js.map +0 -1
- package/dist/chunk-RYEHNSO7.js.map +0 -1
- /package/dist/{chunk-AIEC5DTX.js.map → chunk-UDKWSRES.js.map} +0 -0
|
@@ -14,7 +14,17 @@ export function toolReviewFieldLabel(key: string): string {
|
|
|
14
14
|
const label = key
|
|
15
15
|
.replace(/([a-z0-9])([A-Z])/g, "$1 $2")
|
|
16
16
|
.replace(/[_-]+/g, " ")
|
|
17
|
-
.replace(/\bids?\b/gi, (word) => (word.length === 3 ? "IDs" : "ID"))
|
|
17
|
+
.replace(/\bids?\b/gi, (word) => (word.length === 3 ? "IDs" : "ID"))
|
|
18
|
+
.replace(
|
|
19
|
+
/\b(api|url|uri|http|https|ip|sql|json|html)(s?)\b/gi,
|
|
20
|
+
(_word, name: string, plural: string) => `${name.toUpperCase()}${plural}`,
|
|
21
|
+
)
|
|
22
|
+
// Sentence case, keeping acronyms: "Working Directory" → "Working directory".
|
|
23
|
+
.replace(
|
|
24
|
+
/(?<=\S\s+)([A-Z])([a-z]+)\b/g,
|
|
25
|
+
(_word, first: string, rest: string) => `${first.toLowerCase()}${rest}`,
|
|
26
|
+
)
|
|
27
|
+
.trim();
|
|
18
28
|
return label.charAt(0).toUpperCase() + label.slice(1);
|
|
19
29
|
}
|
|
20
30
|
export function decodeReviewArguments(value: unknown): Record<string, unknown> | null {
|
|
@@ -85,8 +95,35 @@ export function toolReviewFields(
|
|
|
85
95
|
(field) =>
|
|
86
96
|
field.path !== "/contentSha256" && field.path !== "/htmlBody" && field.preview !== "",
|
|
87
97
|
)
|
|
88
|
-
.map((field) => ({
|
|
89
|
-
|
|
98
|
+
.map((field) => ({
|
|
99
|
+
...field,
|
|
100
|
+
label: field.path === "/textBody" ? "Message" : field.label,
|
|
101
|
+
path: `/$email${field.path}`,
|
|
102
|
+
...(field.path === "/attachments"
|
|
103
|
+
? {
|
|
104
|
+
preview: context
|
|
105
|
+
.email!.attachments.map((attachment) => attachment.name)
|
|
106
|
+
.join(", ")
|
|
107
|
+
.slice(0, 240),
|
|
108
|
+
}
|
|
109
|
+
: {}),
|
|
110
|
+
})),
|
|
111
|
+
...original.fields.filter(
|
|
112
|
+
(field) =>
|
|
113
|
+
![
|
|
114
|
+
"/raw",
|
|
115
|
+
"/expectedContentSha256",
|
|
116
|
+
"/from",
|
|
117
|
+
"/to",
|
|
118
|
+
"/cc",
|
|
119
|
+
"/bcc",
|
|
120
|
+
"/subject",
|
|
121
|
+
"/body",
|
|
122
|
+
"/textBody",
|
|
123
|
+
"/htmlBody",
|
|
124
|
+
"/attachments",
|
|
125
|
+
].includes(field.path),
|
|
126
|
+
),
|
|
90
127
|
];
|
|
91
128
|
return {
|
|
92
129
|
fields: fields.slice(0, 16),
|
|
@@ -98,13 +135,26 @@ export function toolReviewFields(
|
|
|
98
135
|
fields: entries.slice(0, 16).map(([key, value], index) => {
|
|
99
136
|
const hidden = protectedReviewField(key, context?.protectedFields);
|
|
100
137
|
const safe = hidden ? "[Protected value]" : value;
|
|
101
|
-
const count = Array.isArray(value) ? value.length : undefined;
|
|
138
|
+
const count = !hidden && Array.isArray(value) ? value.length : undefined;
|
|
139
|
+
const compactList =
|
|
140
|
+
!hidden &&
|
|
141
|
+
Array.isArray(value) &&
|
|
142
|
+
value.length > 0 &&
|
|
143
|
+
value.length <= 4 &&
|
|
144
|
+
value.every(
|
|
145
|
+
(entry) =>
|
|
146
|
+
typeof entry === "string" || typeof entry === "number" || typeof entry === "boolean",
|
|
147
|
+
)
|
|
148
|
+
? value.map(valueText).join(", ")
|
|
149
|
+
: undefined;
|
|
102
150
|
const text =
|
|
103
|
-
|
|
104
|
-
?
|
|
105
|
-
:
|
|
106
|
-
? `${
|
|
107
|
-
:
|
|
151
|
+
compactList !== undefined
|
|
152
|
+
? compactList
|
|
153
|
+
: count !== undefined
|
|
154
|
+
? `${count.toLocaleString("en-US")} item${count === 1 ? "" : "s"}`
|
|
155
|
+
: safe && typeof safe === "object"
|
|
156
|
+
? `${Object.keys(safe).length} field${Object.keys(safe).length === 1 ? "" : "s"}`
|
|
157
|
+
: valueText(safe);
|
|
108
158
|
return {
|
|
109
159
|
path: fieldPointer(key, index),
|
|
110
160
|
label: bound(
|
|
@@ -115,7 +165,10 @@ export function toolReviewFields(
|
|
|
115
165
|
),
|
|
116
166
|
preview: bound(text, 240),
|
|
117
167
|
...(count !== undefined ? { count } : {}),
|
|
118
|
-
truncated:
|
|
168
|
+
truncated:
|
|
169
|
+
!hidden &&
|
|
170
|
+
(text.length > 240 ||
|
|
171
|
+
(compactList === undefined && typeof value === "object" && value !== null)),
|
|
119
172
|
...(hidden ? { protected: true } : {}),
|
|
120
173
|
};
|
|
121
174
|
}),
|
|
@@ -132,7 +185,14 @@ export function toolReviewAction(
|
|
|
132
185
|
"title" | "approveLabel" | "effects" | "consequence" | "selectionCount" | "selectionKind"
|
|
133
186
|
> {
|
|
134
187
|
const fallback = {
|
|
135
|
-
title:
|
|
188
|
+
title:
|
|
189
|
+
context?.title ??
|
|
190
|
+
bound(
|
|
191
|
+
toolReviewFieldLabel(
|
|
192
|
+
toolName.replace(/^mcp_[^_]+__/, "").replace(/^batch[_-](?=[a-z])/i, ""),
|
|
193
|
+
),
|
|
194
|
+
256,
|
|
195
|
+
),
|
|
136
196
|
approveLabel: "Approve action",
|
|
137
197
|
effects: [] as string[],
|
|
138
198
|
};
|
|
@@ -152,8 +212,10 @@ export function toolReviewAction(
|
|
|
152
212
|
const selectionCount = ids?.every((id) => typeof id === "string") ? new Set(ids).size : undefined;
|
|
153
213
|
const noun =
|
|
154
214
|
selectionCount === undefined
|
|
155
|
-
?
|
|
156
|
-
|
|
215
|
+
? thread
|
|
216
|
+
? "conversations"
|
|
217
|
+
: "messages"
|
|
218
|
+
: `${selectionCount.toLocaleString("en-US")} ${thread ? "conversation" : "message"}${selectionCount === 1 ? "" : "s"}`;
|
|
157
219
|
const addValues = toolName.startsWith("label_") ? args.labelIds : args.addLabelIds;
|
|
158
220
|
const adds = Array.isArray(addValues)
|
|
159
221
|
? addValues.filter((v): v is string => typeof v === "string")
|
|
@@ -200,7 +262,7 @@ export function toolReviewAction(
|
|
|
200
262
|
...(trash
|
|
201
263
|
? { consequence: "Messages stay recoverable in Trash until Gmail deletes them." }
|
|
202
264
|
: thread
|
|
203
|
-
? { consequence: "Applies to every message in the
|
|
265
|
+
? { consequence: "Applies to every message in the conversation." }
|
|
204
266
|
: {}),
|
|
205
267
|
};
|
|
206
268
|
}
|
|
@@ -12,6 +12,9 @@ export const TranscriptionRecordingErrorCode = z.enum([
|
|
|
12
12
|
"too_large",
|
|
13
13
|
"invalid_audio",
|
|
14
14
|
"unknown",
|
|
15
|
+
"insufficient_credits",
|
|
16
|
+
"allowance_exhausted",
|
|
17
|
+
"monthly_model_cost_limit",
|
|
15
18
|
]);
|
|
16
19
|
export type TranscriptionRecordingErrorCode = z.infer<typeof TranscriptionRecordingErrorCode>;
|
|
17
20
|
|