@vm0/cli 9.109.0 → 9.110.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.
@@ -34652,7 +34652,7 @@ if (DSN) {
34652
34652
  Sentry.init({
34653
34653
  dsn: DSN,
34654
34654
  environment: process.env.SENTRY_ENVIRONMENT ?? "production",
34655
- release: "9.109.0",
34655
+ release: "9.110.0",
34656
34656
  sendDefaultPii: false,
34657
34657
  tracesSampleRate: 0,
34658
34658
  shutdownTimeout: 500,
@@ -34671,7 +34671,7 @@ if (DSN) {
34671
34671
  }
34672
34672
  });
34673
34673
  Sentry.setContext("cli", {
34674
- version: "9.109.0",
34674
+ version: "9.110.0",
34675
34675
  command: process.argv.slice(2).join(" ")
34676
34676
  });
34677
34677
  Sentry.setContext("runtime", {
@@ -69537,6 +69537,34 @@ var webhookStoragesCommitContract = c6.router({
69537
69537
  summary: "Commit uploaded storage from sandbox"
69538
69538
  }
69539
69539
  });
69540
+ var webhookUsageContract = c6.router({
69541
+ send: {
69542
+ method: "POST",
69543
+ path: "/api/webhooks/agent/usage",
69544
+ headers: authHeadersSchema,
69545
+ body: external_exports.object({
69546
+ runId: external_exports.string().min(1, "runId is required"),
69547
+ usage: external_exports.object({
69548
+ model: external_exports.string().optional(),
69549
+ input_tokens: external_exports.number().optional(),
69550
+ output_tokens: external_exports.number().optional(),
69551
+ cache_read_input_tokens: external_exports.number().optional(),
69552
+ cache_creation_input_tokens: external_exports.number().optional(),
69553
+ web_search_requests: external_exports.number().optional()
69554
+ }).strict()
69555
+ }),
69556
+ responses: {
69557
+ 200: external_exports.object({
69558
+ success: external_exports.boolean()
69559
+ }),
69560
+ 400: apiErrorSchema,
69561
+ 401: apiErrorSchema,
69562
+ 404: apiErrorSchema,
69563
+ 500: apiErrorSchema
69564
+ },
69565
+ summary: "Receive proxy-extracted usage data from sandbox"
69566
+ }
69567
+ });
69540
69568
 
69541
69569
  // ../../packages/core/src/contracts/cli-auth.ts
69542
69570
  init_esm_shims();
@@ -70029,7 +70057,7 @@ function mpFirewall(type, authHeader, placeholderValue) {
70029
70057
  const headerValue = authHeader.valuePrefix ? `${authHeader.valuePrefix} ${secretRef}` : secretRef;
70030
70058
  return {
70031
70059
  name: `model-provider:${type}`,
70032
- ref: "__auto__",
70060
+ ref: `model-provider:${type}`,
70033
70061
  apis: [
70034
70062
  {
70035
70063
  base: getFirewallBaseUrl(type),
@@ -70761,7 +70789,7 @@ function parseGraphQLRule(rest) {
70761
70789
  const suffixParts = rest.slice(gqlIdx + 1).split(/\s+/);
70762
70790
  let typeFilter = null;
70763
70791
  let opFilter = null;
70764
- let fieldFilter = null;
70792
+ let fieldFilters = null;
70765
70793
  for (let i = 1; i < suffixParts.length; i++) {
70766
70794
  const part = suffixParts[i];
70767
70795
  if (part.startsWith("type:")) {
@@ -70769,10 +70797,10 @@ function parseGraphQLRule(rest) {
70769
70797
  } else if (part.startsWith("operationName:")) {
70770
70798
  opFilter = part.slice(14);
70771
70799
  } else if (part.startsWith("field:")) {
70772
- fieldFilter = part.slice(6);
70800
+ fieldFilters = part.slice(6).split(",");
70773
70801
  }
70774
70802
  }
70775
- return { path: path2, typeFilter, opFilter, fieldFilter };
70803
+ return { path: path2, typeFilter, opFilter, fieldFilters };
70776
70804
  }
70777
70805
  function matchWildcard(value, pattern) {
70778
70806
  if (pattern.endsWith("*")) {
@@ -70780,7 +70808,7 @@ function matchWildcard(value, pattern) {
70780
70808
  }
70781
70809
  return value === pattern;
70782
70810
  }
70783
- function matchGraphQLBody(body, typeFilter, opFilter, fieldFilter) {
70811
+ function matchGraphQLBody(body, typeFilter, opFilter, fieldFilters) {
70784
70812
  if (!body) return false;
70785
70813
  if (typeFilter !== null && body.type !== typeFilter) {
70786
70814
  return false;
@@ -70790,11 +70818,13 @@ function matchGraphQLBody(body, typeFilter, opFilter, fieldFilter) {
70790
70818
  if (!opName) return false;
70791
70819
  if (!matchWildcard(opName, opFilter)) return false;
70792
70820
  }
70793
- if (fieldFilter !== null) {
70821
+ if (fieldFilters !== null) {
70794
70822
  const fields = body.fields;
70795
70823
  if (!fields || fields.length === 0) return false;
70796
- if (!fields.some((f) => {
70797
- return matchWildcard(f, fieldFilter);
70824
+ if (!fieldFilters.some((pattern) => {
70825
+ return fields.some((f) => {
70826
+ return matchWildcard(f, pattern);
70827
+ });
70798
70828
  }))
70799
70829
  return false;
70800
70830
  }
@@ -70816,11 +70846,11 @@ function findMatchingPermissions(method, path2, config2, graphqlBody) {
70816
70846
  const gql = parseGraphQLRule(rest);
70817
70847
  const rulePath = gql ? gql.path : rest;
70818
70848
  if (matchFirewallPath(path2, rulePath) !== null) {
70819
- if (gql && (gql.typeFilter !== null || gql.opFilter !== null || gql.fieldFilter !== null) && !matchGraphQLBody(
70849
+ if (gql && (gql.typeFilter !== null || gql.opFilter !== null || gql.fieldFilters !== null) && !matchGraphQLBody(
70820
70850
  graphqlBody,
70821
70851
  gql.typeFilter,
70822
70852
  gql.opFilter,
70823
- gql.fieldFilter
70853
+ gql.fieldFilters
70824
70854
  )) {
70825
70855
  continue;
70826
70856
  }
@@ -72022,6 +72052,7 @@ var runContextFirewallSchema = external_exports.object({
72022
72052
  var runContextResponseSchema = external_exports.object({
72023
72053
  prompt: external_exports.string(),
72024
72054
  appendSystemPrompt: external_exports.string().nullable(),
72055
+ sessionId: external_exports.string().nullable(),
72025
72056
  secretNames: external_exports.array(external_exports.string()),
72026
72057
  vars: external_exports.record(external_exports.string(), external_exports.string()).nullable(),
72027
72058
  environment: external_exports.record(external_exports.string(), external_exports.string()),
@@ -75922,4 +75953,4 @@ undici/lib/web/fetch/body.js:
75922
75953
  undici/lib/web/websocket/frame.js:
75923
75954
  (*! ws. MIT License. Einar Otto Stangvik <einaros@gmail.com> *)
75924
75955
  */
75925
- //# sourceMappingURL=chunk-WJ6BDJIT.js.map
75956
+ //# sourceMappingURL=chunk-XBIXXD2C.js.map