veryfront 0.1.535 → 0.1.537

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.
@@ -4,7 +4,7 @@
4
4
 
5
5
  // See https://github.com/facebook/react/blob/main/packages/react-dom/client.js to see how the exports are declared,
6
6
 
7
- import React = require("https://esm.sh/@types/react@19.2.14/index.d.ts");
7
+ import React = require("https://esm.sh/@types/react@19.2.3/index.d.ts");
8
8
 
9
9
  export {};
10
10
 
@@ -30,7 +30,9 @@ const extSandboxShellTools: ExtensionFactory = () => ({
30
30
  contracts: {
31
31
  provides: [SandboxShellToolsProviderName],
32
32
  },
33
- capabilities: [],
33
+ capabilities: [
34
+ { type: "sandbox:execute", tools: ["bash"] },
35
+ ],
34
36
  setup(ctx) {
35
37
  ctx.provide(SandboxShellToolsProviderName, provider);
36
38
  ctx.logger.info("[ext-sandbox-shell-tools] Sandbox shell tools provider registered");
@@ -20,6 +20,8 @@ export interface ProviderToolCompatOptions {
20
20
  }
21
21
 
22
22
  const OPENAI_MAX_TOOLS = 128;
23
+ const PROVIDER_TOOL_PROPERTY_KEY_PATTERN = /^[a-zA-Z0-9_.-]{1,64}$/;
24
+
23
25
  const GOOGLE_UNSUPPORTED_SCHEMA_KEYS = new Set([
24
26
  "$id",
25
27
  "$ref",
@@ -51,7 +53,7 @@ export function getProviderToolProfile(model?: string): ProviderToolProfile {
51
53
  }
52
54
 
53
55
  if (provider === "anthropic") {
54
- return { provider: "anthropic", sanitizeSchema: false };
56
+ return { provider: "anthropic", sanitizeSchema: true };
55
57
  }
56
58
 
57
59
  if (provider === "moonshot") {
@@ -184,6 +186,44 @@ function getGoogleCompatibleSchemaType(type: unknown): unknown {
184
186
  return nonNullTypes.length === 1 ? nonNullTypes[0] : undefined;
185
187
  }
186
188
 
189
+ function sanitizeProviderSchemaPropertyKeys(value: unknown): unknown {
190
+ if (Array.isArray(value)) {
191
+ return value.map((item) => sanitizeProviderSchemaPropertyKeys(item));
192
+ }
193
+
194
+ if (!isPlainRecord(value)) {
195
+ return value;
196
+ }
197
+
198
+ const sanitized: Record<string, unknown> = {};
199
+ const rawProperties = isPlainRecord(value.properties) ? value.properties : undefined;
200
+ const retainedPropertyNames = rawProperties ? new Set<string>() : undefined;
201
+
202
+ for (const [key, child] of Object.entries(value)) {
203
+ if (key === "properties" && rawProperties) {
204
+ const properties: Record<string, unknown> = {};
205
+ for (const [propertyName, propertySchema] of Object.entries(rawProperties)) {
206
+ if (!PROVIDER_TOOL_PROPERTY_KEY_PATTERN.test(propertyName)) continue;
207
+ retainedPropertyNames?.add(propertyName);
208
+ properties[propertyName] = sanitizeProviderSchemaPropertyKeys(propertySchema);
209
+ }
210
+ sanitized.properties = properties;
211
+ continue;
212
+ }
213
+
214
+ if (key === "required" && Array.isArray(child)) {
215
+ sanitized.required = retainedPropertyNames
216
+ ? child.filter((item) => typeof item === "string" && retainedPropertyNames.has(item))
217
+ : child.filter((item) => typeof item === "string");
218
+ continue;
219
+ }
220
+
221
+ sanitized[key] = sanitizeProviderSchemaPropertyKeys(child);
222
+ }
223
+
224
+ return sanitized;
225
+ }
226
+
187
227
  function sanitizeGoogleSchemaValue(value: unknown): unknown {
188
228
  if (Array.isArray(value)) {
189
229
  return value.map((item) => sanitizeGoogleSchemaValue(item));
@@ -254,5 +294,11 @@ export function sanitizeProviderToolSchema(
254
294
  const profile = getProviderToolProfile(options.model);
255
295
  if (!profile.sanitizeSchema) return schema;
256
296
 
257
- return sanitizeGoogleSchemaValue(schema) as JsonSchema;
297
+ const propertyKeySafeSchema = sanitizeProviderSchemaPropertyKeys(schema);
298
+
299
+ if (profile.provider === "google") {
300
+ return sanitizeGoogleSchemaValue(propertyKeySafeSchema) as JsonSchema;
301
+ }
302
+
303
+ return propertyKeySafeSchema as JsonSchema;
258
304
  }
@@ -27,6 +27,7 @@ export {
27
27
  type DurableRunCanaryApiClient,
28
28
  type DurableRunCanaryApiConfig,
29
29
  type DurableRunCanaryCase,
30
+ type DurableRunCanaryCliCaseFactoryInput,
30
31
  type DurableRunCanaryCreateRootRunInput,
31
32
  type DurableRunCanaryEnvironment,
32
33
  type DurableRunCanaryMessage,
@@ -41,6 +42,8 @@ export {
41
42
  getDurableRunCanaryMessageSchema,
42
43
  parseDurableRunCanaryRunSummary,
43
44
  resolveDurableRunCanaryEnvironment,
45
+ runDurableRunCanaryCli,
46
+ type RunDurableRunCanaryCliInput,
44
47
  stringifyUnknown,
45
48
  } from "./durable-run-canaries/index.js";
46
49
 
@@ -86,6 +89,8 @@ export {
86
89
  type LiveEvalCaseSelectionInput,
87
90
  type LiveEvalCaseSurface,
88
91
  type LiveEvalCaseTagRule,
92
+ type LiveEvalCliCaseFactoryInput,
93
+ type LiveEvalCliCaseGroups,
89
94
  type LiveEvalContext,
90
95
  type LiveEvalConversationInput,
91
96
  type LiveEvalCreateConversationInput,
@@ -112,6 +117,8 @@ export {
112
117
  printRuntimeConfidencePreflight,
113
118
  resolveLiveEvalEnvironment,
114
119
  resolveLiveEvalRequestedCaseIds,
120
+ runLiveEvalCli,
121
+ type RunLiveEvalCliInput,
115
122
  type RuntimeConfidencePreflightResult,
116
123
  type RuntimePerformanceSummary,
117
124
  selectLiveEvalCases,
@@ -278,14 +278,14 @@ function normalizeCallToolResult(result: unknown): unknown {
278
278
  rawContent.filter((item): item is JsonRpcCallToolContentItem => isRecord(item)),
279
279
  );
280
280
 
281
- if (hasToolExecutionErrorMarker(result)) {
282
- return parseJsonText(text) ?? { error: "tool_error", message: text };
283
- }
284
-
285
281
  if ("structuredContent" in result) {
286
282
  return result.structuredContent;
287
283
  }
288
284
 
285
+ if (hasToolExecutionErrorMarker(result)) {
286
+ return parseJsonText(text) ?? { error: "tool_error", message: text };
287
+ }
288
+
289
289
  return parseJsonText(text) ?? text;
290
290
  }
291
291
 
@@ -1,3 +1,3 @@
1
1
  // Keep in sync with deno.json version.
2
2
  // scripts/release.ts updates this constant during releases.
3
- export const VERSION = "0.1.535";
3
+ export const VERSION = "0.1.537";