@vapi-network/core 0.8.0 → 0.9.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.
Files changed (89) hide show
  1. package/README.md +14 -1
  2. package/dist/agent-link.d.ts.map +1 -1
  3. package/dist/agent-link.js +6 -1
  4. package/dist/agent-link.js.map +1 -1
  5. package/dist/agent-profile.d.ts +4 -0
  6. package/dist/agent-profile.d.ts.map +1 -1
  7. package/dist/api-key.js +47 -0
  8. package/dist/api-key.js.map +1 -1
  9. package/dist/backup.d.ts +2 -0
  10. package/dist/backup.d.ts.map +1 -1
  11. package/dist/backup.js +65 -0
  12. package/dist/backup.js.map +1 -1
  13. package/dist/call-contracts-wire.d.ts +48 -12
  14. package/dist/call-contracts-wire.d.ts.map +1 -1
  15. package/dist/call-contracts.d.ts +7 -1
  16. package/dist/call-contracts.d.ts.map +1 -1
  17. package/dist/cloud-backup.js +71 -1
  18. package/dist/cloud-backup.js.map +1 -1
  19. package/dist/config.d.ts +9 -0
  20. package/dist/config.d.ts.map +1 -1
  21. package/dist/docs.d.ts +40 -0
  22. package/dist/docs.d.ts.map +1 -0
  23. package/dist/funding-policy.d.ts +29 -0
  24. package/dist/funding-policy.d.ts.map +1 -0
  25. package/dist/index.d.ts +5 -1
  26. package/dist/index.d.ts.map +1 -1
  27. package/dist/index.js +1521 -795
  28. package/dist/index.js.map +3 -3
  29. package/dist/marketplace-contracts.d.ts +22 -10
  30. package/dist/marketplace-contracts.d.ts.map +1 -1
  31. package/dist/router-client.js +230 -33
  32. package/dist/router-client.js.map +2 -2
  33. package/dist/searches.d.ts +1 -0
  34. package/dist/searches.d.ts.map +1 -1
  35. package/dist/secrets.js +29 -1
  36. package/dist/secrets.js.map +1 -1
  37. package/dist/spend-policy.d.ts +41 -7
  38. package/dist/spend-policy.d.ts.map +1 -1
  39. package/dist/support-report.d.ts +1 -1
  40. package/dist/tasks/actions.d.ts +152 -0
  41. package/dist/tasks/actions.d.ts.map +1 -0
  42. package/dist/tasks/canonical-json.d.ts +6 -0
  43. package/dist/tasks/canonical-json.d.ts.map +1 -0
  44. package/dist/tasks/chain-error.d.ts +6 -0
  45. package/dist/tasks/chain-error.d.ts.map +1 -0
  46. package/dist/tasks/chain-port.d.ts +90 -0
  47. package/dist/tasks/chain-port.d.ts.map +1 -0
  48. package/dist/tasks/chain-verification.d.ts +36 -0
  49. package/dist/tasks/chain-verification.d.ts.map +1 -0
  50. package/dist/tasks/chain.d.ts +22 -0
  51. package/dist/tasks/chain.d.ts.map +1 -0
  52. package/dist/tasks/client.d.ts +76 -0
  53. package/dist/tasks/client.d.ts.map +1 -0
  54. package/dist/tasks/delivery-manifest.d.ts +24 -0
  55. package/dist/tasks/delivery-manifest.d.ts.map +1 -0
  56. package/dist/tasks/dispute-fee.d.ts +4 -0
  57. package/dist/tasks/dispute-fee.d.ts.map +1 -0
  58. package/dist/tasks/index.d.ts +23 -0
  59. package/dist/tasks/index.d.ts.map +1 -0
  60. package/dist/tasks/money.d.ts +17 -0
  61. package/dist/tasks/money.d.ts.map +1 -0
  62. package/dist/tasks/operation-support.d.ts +127 -0
  63. package/dist/tasks/operation-support.d.ts.map +1 -0
  64. package/dist/tasks/operations.d.ts +777 -0
  65. package/dist/tasks/operations.d.ts.map +1 -0
  66. package/dist/tasks/pending-transactions.d.ts +52 -0
  67. package/dist/tasks/pending-transactions.d.ts.map +1 -0
  68. package/dist/tasks/plan-guard.d.ts +326 -0
  69. package/dist/tasks/plan-guard.d.ts.map +1 -0
  70. package/dist/tasks/rpc.d.ts +8 -0
  71. package/dist/tasks/rpc.d.ts.map +1 -0
  72. package/dist/tasks/scope-bindings.d.ts +20 -0
  73. package/dist/tasks/scope-bindings.d.ts.map +1 -0
  74. package/dist/tasks/scope-terms.d.ts +75 -0
  75. package/dist/tasks/scope-terms.d.ts.map +1 -0
  76. package/dist/tasks/trusted-deployments.d.ts +14 -0
  77. package/dist/tasks/trusted-deployments.d.ts.map +1 -0
  78. package/dist/tasks/types.d.ts +4439 -0
  79. package/dist/tasks/types.d.ts.map +1 -0
  80. package/dist/tasks/verbs.d.ts +4 -0
  81. package/dist/tasks/verbs.d.ts.map +1 -0
  82. package/dist/tasks/wait.d.ts +18 -0
  83. package/dist/tasks/wait.d.ts.map +1 -0
  84. package/dist/tasks.js +44108 -0
  85. package/dist/tasks.js.map +6 -0
  86. package/dist/transfer.d.ts.map +1 -1
  87. package/dist/x402-networks.d.ts +1 -0
  88. package/dist/x402-networks.d.ts.map +1 -1
  89. package/package.json +5 -1
@@ -60,13 +60,19 @@ export declare const discoveryEndpointSchema: z.ZodObject<{
60
60
  responseContentType: z.ZodOptional<z.ZodString>;
61
61
  pathTemplate: z.ZodOptional<z.ZodString>;
62
62
  pathParameters: z.ZodOptional<z.ZodArray<z.ZodString>>;
63
- payment: z.ZodOptional<z.ZodObject<{
63
+ payment: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
64
64
  scheme: z.ZodLiteral<"exact">;
65
65
  network: z.ZodString;
66
66
  asset: z.ZodString;
67
67
  payTo: z.ZodString;
68
68
  checkedAt: z.ZodISODateTime;
69
- }, z.core.$loose>>;
69
+ }, z.core.$loose>, z.ZodObject<{
70
+ scheme: z.ZodLiteral<"exact">;
71
+ network: z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdpKuc147dw2N9d">]>;
72
+ asset: z.ZodString;
73
+ payTo: z.ZodString;
74
+ checkedAt: z.ZodISODateTime;
75
+ }, z.core.$loose>]>>;
70
76
  }, z.core.$loose>;
71
77
  export type DiscoveryEndpoint = z.infer<typeof discoveryEndpointSchema>;
72
78
  export declare const serviceSummarySchema: z.ZodObject<{
@@ -86,13 +92,19 @@ export declare const serviceSummarySchema: z.ZodObject<{
86
92
  responseContentType: z.ZodOptional<z.ZodString>;
87
93
  pathTemplate: z.ZodOptional<z.ZodString>;
88
94
  pathParameters: z.ZodOptional<z.ZodArray<z.ZodString>>;
89
- payment: z.ZodOptional<z.ZodObject<{
95
+ payment: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
90
96
  scheme: z.ZodLiteral<"exact">;
91
97
  network: z.ZodString;
92
98
  asset: z.ZodString;
93
99
  payTo: z.ZodString;
94
100
  checkedAt: z.ZodISODateTime;
95
- }, z.core.$loose>>;
101
+ }, z.core.$loose>, z.ZodObject<{
102
+ scheme: z.ZodLiteral<"exact">;
103
+ network: z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdpKuc147dw2N9d">]>;
104
+ asset: z.ZodString;
105
+ payTo: z.ZodString;
106
+ checkedAt: z.ZodISODateTime;
107
+ }, z.core.$loose>]>>;
96
108
  }, z.core.$loose>>;
97
109
  group: z.ZodOptional<z.ZodEnum<{
98
110
  external: "external";
@@ -168,13 +180,19 @@ export declare const searchServicesResponseSchema: z.ZodObject<{
168
180
  responseContentType: z.ZodOptional<z.ZodString>;
169
181
  pathTemplate: z.ZodOptional<z.ZodString>;
170
182
  pathParameters: z.ZodOptional<z.ZodArray<z.ZodString>>;
171
- payment: z.ZodOptional<z.ZodObject<{
183
+ payment: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
172
184
  scheme: z.ZodLiteral<"exact">;
173
185
  network: z.ZodString;
174
186
  asset: z.ZodString;
175
187
  payTo: z.ZodString;
176
188
  checkedAt: z.ZodISODateTime;
177
- }, z.core.$loose>>;
189
+ }, z.core.$loose>, z.ZodObject<{
190
+ scheme: z.ZodLiteral<"exact">;
191
+ network: z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdpKuc147dw2N9d">]>;
192
+ asset: z.ZodString;
193
+ payTo: z.ZodString;
194
+ checkedAt: z.ZodISODateTime;
195
+ }, z.core.$loose>]>>;
178
196
  }, z.core.$loose>>;
179
197
  group: z.ZodOptional<z.ZodEnum<{
180
198
  external: "external";
@@ -251,13 +269,19 @@ export declare const listServicesResponseSchema: z.ZodObject<{
251
269
  responseContentType: z.ZodOptional<z.ZodString>;
252
270
  pathTemplate: z.ZodOptional<z.ZodString>;
253
271
  pathParameters: z.ZodOptional<z.ZodArray<z.ZodString>>;
254
- payment: z.ZodOptional<z.ZodObject<{
272
+ payment: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
255
273
  scheme: z.ZodLiteral<"exact">;
256
274
  network: z.ZodString;
257
275
  asset: z.ZodString;
258
276
  payTo: z.ZodString;
259
277
  checkedAt: z.ZodISODateTime;
260
- }, z.core.$loose>>;
278
+ }, z.core.$loose>, z.ZodObject<{
279
+ scheme: z.ZodLiteral<"exact">;
280
+ network: z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdpKuc147dw2N9d">]>;
281
+ asset: z.ZodString;
282
+ payTo: z.ZodString;
283
+ checkedAt: z.ZodISODateTime;
284
+ }, z.core.$loose>]>>;
261
285
  }, z.core.$loose>>;
262
286
  group: z.ZodOptional<z.ZodEnum<{
263
287
  external: "external";
@@ -333,13 +357,19 @@ export declare const discoveryServiceSchema: z.ZodObject<{
333
357
  responseContentType: z.ZodOptional<z.ZodString>;
334
358
  pathTemplate: z.ZodOptional<z.ZodString>;
335
359
  pathParameters: z.ZodOptional<z.ZodArray<z.ZodString>>;
336
- payment: z.ZodOptional<z.ZodObject<{
360
+ payment: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
337
361
  scheme: z.ZodLiteral<"exact">;
338
362
  network: z.ZodString;
339
363
  asset: z.ZodString;
340
364
  payTo: z.ZodString;
341
365
  checkedAt: z.ZodISODateTime;
342
- }, z.core.$loose>>;
366
+ }, z.core.$loose>, z.ZodObject<{
367
+ scheme: z.ZodLiteral<"exact">;
368
+ network: z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdpKuc147dw2N9d">]>;
369
+ asset: z.ZodString;
370
+ payTo: z.ZodString;
371
+ checkedAt: z.ZodISODateTime;
372
+ }, z.core.$loose>]>>;
343
373
  }, z.core.$loose>>;
344
374
  group: z.ZodOptional<z.ZodEnum<{
345
375
  external: "external";
@@ -415,13 +445,19 @@ export declare const discoveryResponseSchema: z.ZodObject<{
415
445
  responseContentType: z.ZodOptional<z.ZodString>;
416
446
  pathTemplate: z.ZodOptional<z.ZodString>;
417
447
  pathParameters: z.ZodOptional<z.ZodArray<z.ZodString>>;
418
- payment: z.ZodOptional<z.ZodObject<{
448
+ payment: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
419
449
  scheme: z.ZodLiteral<"exact">;
420
450
  network: z.ZodString;
421
451
  asset: z.ZodString;
422
452
  payTo: z.ZodString;
423
453
  checkedAt: z.ZodISODateTime;
424
- }, z.core.$loose>>;
454
+ }, z.core.$loose>, z.ZodObject<{
455
+ scheme: z.ZodLiteral<"exact">;
456
+ network: z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdpKuc147dw2N9d">]>;
457
+ asset: z.ZodString;
458
+ payTo: z.ZodString;
459
+ checkedAt: z.ZodISODateTime;
460
+ }, z.core.$loose>]>>;
425
461
  }, z.core.$loose>>;
426
462
  group: z.ZodOptional<z.ZodEnum<{
427
463
  external: "external";
@@ -1 +1 @@
1
- {"version":3,"file":"call-contracts-wire.d.ts","sourceRoot":"","sources":["../src/call-contracts-wire.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,aAAa,EAAG,OAAgB,CAAC;AAC9C,eAAO,MAAM,mBAAmB,wDAAyD,CAAC;AAE1F,eAAO,MAAM,sBAAsB;;;;;;EAA8B,CAAC;AAClE,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAKtE,eAAO,MAAM,oBAAoB,iEAA6C,CA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export type DiscoveryCatalogErrorCode = "no_endpoint" | "ambiguous_default" | "malformed_url" | "blank_method" | "invalid_endpoint_name" | "duplicate_endpoint_name" | "service_not_found" | "endpoint_not_found" | "invalid_discovery";
4
4
  export declare class DiscoveryCatalogError extends Error {
5
+ /** Present when every candidate endpoint declares a payment network. */
6
+ readonly paymentNetworks?: readonly string[] | undefined;
5
7
  readonly name = "DiscoveryCatalogError";
6
8
  readonly code: DiscoveryCatalogErrorCode;
7
9
  readonly serviceId: string | undefined;
8
- constructor(code: DiscoveryCatalogErrorCode, message: string, serviceId?: string);
10
+ constructor(code: DiscoveryCatalogErrorCode, message: string, serviceId?: string,
11
+ /** Present when every candidate endpoint declares a payment network. */
12
+ paymentNetworks?: readonly string[] | undefined);
9
13
  }
14
+ /** Bundled interface packages can carry separate copies of the error class. */
15
+ export declare function isDiscoveryCatalogError(error: unknown): error is DiscoveryCatalogError;
10
16
  /**
11
17
  * A resolved endpoint plus the service record that carried it. Listing-level
12
18
  * disclosures such as `group` and `fee` live on the service, not the endpoint,
@@ -1 +1 @@
1
- {"version":3,"file":"call-contracts.d.ts","sourceRoot":"","sources":["../src/call-contracts.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACtB,MAAM,0BAA0B,CAAC;AAElC,MAAM,MAAM,UAAU,GAAG,iBAAiB,CAAC;AAE3C,MAAM,MAAM,yBAAyB,GACjC,aAAa,GACb,mBAAmB,GACnB,eAAe,GACf,cAAc,GACd,uBAAuB,GACvB,yBAAyB,GACzB,mBAAmB,GACnB,oBAAoB,GACpB,mBAAmB,CAAC;AAExB,qBAAa,qBAAsB,SAAQ,KAAK;IAC9C,QAAQ,CAAC,IAAI,2BAA2B;IACxC,QAAQ,CAAC,IAAI,EAAE,yBAAyB,CAAC;IACzC,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;gBAE3B,IAAI,EAAE,yBAAyB,EAAE,OAAO,EAAE,MAAM,E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/E,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,qBAAqB,CActF;AAED;;;;GAIG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B,OAAO,EAAE,gBAAgB,CAAC;IAC1B,QAAQ,EAAE,UAAU,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,EAAE,gBAAgB,EAAE,CAAC;IAC7B,OAAO,CAAC,SAAS,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM,GAAG,UAAU,CAAC;IAC9D,cAAc,CAAC,SAAS,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM,GAAG,eAAe,CAAC;CAC3E,CAAC;AAEF,wBAAgB,cAAc,CAAC,GAAG,EAAE,OAAO,GAAG,gBAAgB,CAsC7D"}
@@ -46109,6 +46109,8 @@ var DEFAULT_SPEND_CAPS = {
46109
46109
  perCallAtomic: "100000",
46110
46110
  perDayAtomic: "1000000"
46111
46111
  };
46112
+ var DEFAULT_MAX_PER_TASK_USD = 100;
46113
+ var DEFAULT_AUTO_RELEASE_BELOW_USD = 25;
46112
46114
  var DEFAULT_CEILING_ATOMIC = 5000000n;
46113
46115
  var atomicString = external_exports.string().regex(/^\d+$/, "Expected non-negative atomic units.");
46114
46116
  var spendCapsSchema = external_exports.object({
@@ -46125,6 +46127,14 @@ var configSchema = external_exports.object({
46125
46127
  })
46126
46128
  ).optional(),
46127
46129
  allowPrivateNetwork: external_exports.boolean().default(false).optional(),
46130
+ tasksEscrowDurationOverrides: external_exports.record(
46131
+ external_exports.string().regex(/^\d+$/),
46132
+ external_exports.object({
46133
+ workDurationSeconds: external_exports.number().int().positive().max(Number.MAX_SAFE_INTEGER).optional(),
46134
+ reviewWindowSeconds: external_exports.number().int().positive().max(Number.MAX_SAFE_INTEGER).optional()
46135
+ }).strict()
46136
+ ).optional(),
46137
+ tasksEscrowFactoryOverrides: external_exports.record(external_exports.string().regex(/^\d+$/), external_exports.string()).optional(),
46128
46138
  networks: external_exports.record(
46129
46139
  external_exports.string().refine((network) => isSupportedPaymentNetwork(network), {
46130
46140
  message: "Expected a supported eip155:<chainId> or Solana network identifier."
@@ -46143,6 +46153,17 @@ var configSchema = external_exports.object({
46143
46153
  spendCaps: spendCapsSchema,
46144
46154
  device: external_exports.string().regex(/^[a-z0-9][a-z0-9-]{0,31}$/).optional()
46145
46155
  }).superRefine((config2, context) => {
46156
+ for (const [chainId, factory] of Object.entries(config2.tasksEscrowFactoryOverrides ?? {})) {
46157
+ try {
46158
+ getAddress(factory);
46159
+ } catch {
46160
+ context.addIssue({
46161
+ code: "custom",
46162
+ path: ["tasksEscrowFactoryOverrides", chainId],
46163
+ message: "Expected a valid EVM escrow factory address."
46164
+ });
46165
+ }
46166
+ }
46146
46167
  for (const [network, configured] of Object.entries(config2.networks)) {
46147
46168
  if (isSolanaNetwork(network)) {
46148
46169
  if (configured.usdc !== NETWORKS[SOLANA_MAINNET_CAIP2].usdc) {
@@ -46288,6 +46309,7 @@ function getDefaultConfig(source = process.env, options = {}) {
46288
46309
  const registry2 = registryEndpoints(source.VAPI_REGISTRY_URL?.trim() || DEFAULT_REGISTRY_URL);
46289
46310
  const requested = new Set(options.networks ?? ["base"]);
46290
46311
  const networks = {};
46312
+ const tasksEscrowFactoryOverrides = tasksFactoryOverridesFromEnv(source);
46291
46313
  if (requested.has("base") || requested.has(BASE_MAINNET_CAIP2)) {
46292
46314
  networks[BASE_MAINNET_CAIP2] = {
46293
46315
  rpcUrl: source.BASE_RPC_URL?.trim() || NETWORKS[BASE_MAINNET_CAIP2].publicRpcUrl,
@@ -46325,6 +46347,8 @@ function getDefaultConfig(source = process.env, options = {}) {
46325
46347
  marketplaceDiscoveryUrl: source.VAPI_MARKETPLACE_DISCOVERY_URL?.trim() || registry2.marketplaceDiscoveryUrl,
46326
46348
  registryFallbacks: DEFAULT_REGISTRY_FALLBACKS.map((fallback) => ({ ...fallback })),
46327
46349
  allowPrivateNetwork: false,
46350
+ tasksEscrowFactoryOverrides,
46351
+ tasksEscrowDurationOverrides: tasksDurationOverridesFromEnv(source),
46328
46352
  networks,
46329
46353
  spendCaps: { ...DEFAULT_SPEND_CAPS }
46330
46354
  };
@@ -46342,8 +46366,10 @@ async function loadConfig(path = getVapiPaths().config, source = process.env, op
46342
46366
  }
46343
46367
  const parsed = configSchema.parse(JSON.parse(raw));
46344
46368
  parsed.registryFallbacks ??= DEFAULT_REGISTRY_FALLBACKS.map((fallback) => ({ ...fallback }));
46369
+ parsed.tasksEscrowFactoryOverrides ??= {};
46345
46370
  const migrated = rewriteLegacyRegistryUrls(parsed);
46346
46371
  const config2 = migrated.config;
46372
+ config2.tasksEscrowFactoryOverrides ??= {};
46347
46373
  if (migrated.changes.length > 0 && options.notice) {
46348
46374
  options.notice(
46349
46375
  `${formatLegacyRegistryRewrites(migrated.changes)}
@@ -46357,6 +46383,14 @@ Run vapi init to write the new URLs to ${path}.`
46357
46383
  const discoveryUrl = source.VAPI_DISCOVERY_URL?.trim();
46358
46384
  const marketplaceDiscoveryUrl = source.VAPI_MARKETPLACE_DISCOVERY_URL?.trim();
46359
46385
  const registryUrl = source.VAPI_REGISTRY_URL?.trim();
46386
+ Object.assign(config2.tasksEscrowFactoryOverrides, tasksFactoryOverridesFromEnv(source));
46387
+ config2.tasksEscrowDurationOverrides ??= {};
46388
+ for (const [chainId, overrides] of Object.entries(tasksDurationOverridesFromEnv(source))) {
46389
+ config2.tasksEscrowDurationOverrides[chainId] = {
46390
+ ...config2.tasksEscrowDurationOverrides[chainId],
46391
+ ...overrides
46392
+ };
46393
+ }
46360
46394
  if (config2.networks[BASE_MAINNET_CAIP2] && baseRpcUrl) {
46361
46395
  config2.networks[BASE_MAINNET_CAIP2].rpcUrl = baseRpcUrl;
46362
46396
  }
@@ -46397,6 +46431,31 @@ Run vapi init to write the new URLs to ${path}.`
46397
46431
  }
46398
46432
  return config2;
46399
46433
  }
46434
+ function tasksDurationOverridesFromEnv(source) {
46435
+ const result = {};
46436
+ for (const [name, raw] of Object.entries(source)) {
46437
+ const match = /^VAPI_TASKS_(WORK_DURATION|REVIEW_WINDOW)_SECONDS_(\d+)$/.exec(name);
46438
+ const value = raw?.trim();
46439
+ if (!match || !value) continue;
46440
+ const seconds = Number(value);
46441
+ if (!/^\d+$/.test(value) || !Number.isSafeInteger(seconds) || seconds <= 0)
46442
+ throw new Error(`Invalid trusted Tasks duration ${name}.`);
46443
+ const entry = result[match[2]] ??= {};
46444
+ if (match[1] === "WORK_DURATION") entry.workDurationSeconds = seconds;
46445
+ else entry.reviewWindowSeconds = seconds;
46446
+ }
46447
+ return result;
46448
+ }
46449
+ function tasksFactoryOverridesFromEnv(source) {
46450
+ const overrides = {};
46451
+ for (const [name, raw] of Object.entries(source)) {
46452
+ const match = /^VAPI_TASKS_ESCROW_FACTORY_(\d+)$/.exec(name);
46453
+ const value = raw?.trim();
46454
+ if (!match || !value) continue;
46455
+ overrides[match[1]] = getAddress(value);
46456
+ }
46457
+ return overrides;
46458
+ }
46400
46459
  function registryEndpoints(baseUrl) {
46401
46460
  const base = new URL(baseUrl);
46402
46461
  base.search = "";
@@ -46443,6 +46502,8 @@ var agentProfileShape = {
46443
46502
  instructions: external_exports.string().max(2e4),
46444
46503
  verifiedOnly: external_exports.boolean().default(true),
46445
46504
  approveAboveUsd: external_exports.number().min(0).default(0.5),
46505
+ maxPerTaskUsd: external_exports.number().min(0).default(DEFAULT_MAX_PER_TASK_USD),
46506
+ autoReleaseBelowUsd: external_exports.number().min(0).default(DEFAULT_AUTO_RELEASE_BELOW_USD),
46446
46507
  maxSteps: external_exports.number().int().min(1).max(50).default(12),
46447
46508
  paused: external_exports.boolean().default(false),
46448
46509
  grants: external_exports.array(external_exports.enum(AGENT_GRANTS)).default([]),
@@ -46917,7 +46978,12 @@ var AgentLinkError = class extends Error {
46917
46978
  code;
46918
46979
  };
46919
46980
  var DEFAULT_AGENT_SCOPES = ["mcp:call", "router.use"];
46920
- var ALLOWED_AGENT_SCOPES = /* @__PURE__ */ new Set([...DEFAULT_AGENT_SCOPES, "call.publish"]);
46981
+ var ALLOWED_AGENT_SCOPES = /* @__PURE__ */ new Set([
46982
+ ...DEFAULT_AGENT_SCOPES,
46983
+ "call.publish",
46984
+ "tasks:read",
46985
+ "tasks:write"
46986
+ ]);
46921
46987
  var publicFetch = createPublicFetch({ allowPrivateNetwork: false });
46922
46988
  var agentSecretAccounts = (wallet) => ({
46923
46989
  tokens: `vapi.agent.${wallet}.tokens`,
@@ -48569,6 +48635,8 @@ var backupAgentProfileSchema = external_exports.strictObject({
48569
48635
  instructions: external_exports.string().max(2e4),
48570
48636
  verifiedOnly: external_exports.boolean(),
48571
48637
  approveAboveUsd: external_exports.number().min(0),
48638
+ maxPerTaskUsd: external_exports.number().min(0).optional(),
48639
+ autoReleaseBelowUsd: external_exports.number().min(0).optional(),
48572
48640
  maxSteps: external_exports.number().int().min(1).max(50),
48573
48641
  paused: external_exports.boolean(),
48574
48642
  createdAt: external_exports.string(),
@@ -49995,6 +50063,8 @@ function copyAgentProfile(profile) {
49995
50063
  instructions: profile.instructions,
49996
50064
  verifiedOnly: profile.verifiedOnly,
49997
50065
  approveAboveUsd: profile.approveAboveUsd,
50066
+ ...profile.maxPerTaskUsd === void 0 ? {} : { maxPerTaskUsd: profile.maxPerTaskUsd },
50067
+ ...profile.autoReleaseBelowUsd === void 0 ? {} : { autoReleaseBelowUsd: profile.autoReleaseBelowUsd },
49998
50068
  maxSteps: profile.maxSteps,
49999
50069
  paused: profile.paused,
50000
50070
  createdAt: profile.createdAt,