@composio/core 0.22.0 → 0.24.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.
Files changed (49) hide show
  1. package/dist/{CustomTool-CKBCElpT.d.mts → CustomTool-CNJysHMK.d.mts} +1 -1
  2. package/dist/{CustomTool-B-_VjWpy.mjs → CustomTool-CnJxXr07.mjs} +1 -1
  3. package/dist/{cancellation-DV8CIi52.mjs → cancellation-BQibgpRG.mjs} +166 -34
  4. package/dist/{composio-C-418N1P.d.mts → composio-BFTtZj82.d.mts} +62 -80
  5. package/dist/{customTool.types-CK408sI-.d.mts → customTool.types-D57QrTns.d.mts} +309 -204
  6. package/dist/docs/reference/sdk-reference/typescript/logs.mdx +4 -4
  7. package/dist/docs/reference/sdk-reference/typescript/remote-file.mdx +1 -1
  8. package/dist/docs/reference/sdk-reference/typescript/session.mdx +2 -2
  9. package/dist/docs/reference/sdk-reference/typescript/tools.mdx +2 -2
  10. package/dist/docs/reference/sdk-reference/typescript/usage.mdx +2 -2
  11. package/dist/{errors-Dyiu3ifQ.mjs → errors-BN15NcCW.mjs} +34 -2
  12. package/dist/experimental/index.d.mts +2 -2
  13. package/dist/experimental/index.mjs +1 -1
  14. package/dist/index.d.mts +66 -4
  15. package/dist/index.mjs +3321 -3103
  16. package/dist/platform/node.d.mts +1 -1
  17. package/dist/platform/node.mjs +13 -0
  18. package/dist/platform/workerd.d.mts +1 -1
  19. package/dist/platform/workerd.mjs +3 -0
  20. package/dist/{types-D5A2wzBl.d.mts → types-DuVZKrXO.d.mts} +2 -0
  21. package/dist/{types-RpMRVn4D.d.mts → types-q8TwAngA.d.mts} +2 -2
  22. package/dist/utils/config-defaults/ConfigDefaults.node.d.mts +1 -1
  23. package/dist/utils/config-defaults/ConfigDefaults.workerd.d.mts +1 -1
  24. package/dist/utils/modifiers/FileToolModifier.node.d.mts +1 -1
  25. package/dist/utils/modifiers/FileToolModifier.node.mjs +2 -2
  26. package/dist/utils/modifiers/FileToolModifier.workerd.d.mts +1 -1
  27. package/package.json +12 -9
  28. package/src/errors/ToolRouterErrors.ts +65 -0
  29. package/src/lib/toolRouterParams.ts +19 -13
  30. package/src/models/CustomToolkits.ts +1 -1
  31. package/src/models/MCP.ts +20 -1
  32. package/src/models/RemoteFile.ts +24 -5
  33. package/src/models/SessionContext.ts +24 -4
  34. package/src/models/ToolRouter.ts +6 -4
  35. package/src/models/ToolRouterSession.ts +95 -13
  36. package/src/models/Tools.ts +20 -36
  37. package/src/models/customToolExecution.ts +10 -0
  38. package/src/platform/node.ts +16 -0
  39. package/src/platform/types.ts +3 -0
  40. package/src/platform/workerd.ts +4 -0
  41. package/src/provider/BaseProvider.ts +2 -1
  42. package/src/types/tool.types.ts +5 -0
  43. package/src/types/toolRouter.types.ts +97 -26
  44. package/src/utils/jsonSchema.ts +191 -36
  45. package/src/utils/retries.ts +20 -0
  46. package/src/utils/safePath.ts +135 -54
  47. package/src/utils/session.ts +31 -2
  48. package/src/utils/transformers/toolRouterResponseTransform.ts +72 -27
  49. package/src/utils/transformers/usage.ts +1 -4
@@ -1,4 +1,4 @@
1
- import { a as CreateCustomToolkitParams, f as CustomToolkit, o as CustomTool, r as CreateCustomToolParams, t as AnyZodSchema } from "./customTool.types-CK408sI-.mjs";
1
+ import { a as CreateCustomToolkitParams, f as CustomToolkit, o as CustomTool, r as CreateCustomToolParams, t as AnyZodSchema } from "./customTool.types-D57QrTns.mjs";
2
2
  import { SessionCreateResponse } from "@composio/client/resources/tool-router/session/session.mjs";
3
3
  //#region src/models/CustomTool.d.ts
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { S as ValidationError } from "./errors-Dyiu3ifQ.mjs";
1
+ import { C as ValidationError } from "./errors-BN15NcCW.mjs";
2
2
  import { z as z$1 } from "zod/v3";
3
3
  import * as z4 from "zod/v4";
4
4
  import * as zodToJsonSchema from "zod-to-json-schema";
@@ -1,11 +1,13 @@
1
1
  import { i as logger } from "./SsrfErrors-DiQldIdC.mjs";
2
- import { b as JsonSchemaRefResolutionError, g as ComposioRequestCancelledError, x as JsonSchemaToZodError, y as isRequestAbortError } from "./errors-Dyiu3ifQ.mjs";
2
+ import { S as JsonSchemaToZodError, _ as ComposioRequestCancelledError, b as isRequestAbortError, x as JsonSchemaRefResolutionError } from "./errors-BN15NcCW.mjs";
3
3
  import { o as isPlainObject } from "./FileToolModifier.utils.neutral-DWFpnsj2.mjs";
4
4
  import { jsonSchemaToZod } from "@composio/json-schema-to-zod";
5
5
 
6
6
  //#region src/utils/jsonSchema.ts
7
7
  const MAX_REF_CHAIN_DEPTH = 100;
8
8
  const MAX_NODE_DEPTH = 512;
9
+ const MAX_NULL_CHECK_DEPTH = 64;
10
+ const MAX_NULL_CHECK_NODES = 2e3;
9
11
  const CYCLE_BREAK_SENTINEL = {
10
12
  type: "object",
11
13
  additionalProperties: true
@@ -384,25 +386,44 @@ function setOwn(target, key, value) {
384
386
  });
385
387
  }
386
388
  /**
387
- * Widens a property schema so that `null` is an accepted value, without
388
- * placing `type` beside `anyOf` (the API rejects that combination).
389
+ * The only keywords that can reject a `null` instance; every other keyword
390
+ * constrains strings, numbers, arrays or objects and ignores `null`.
389
391
  */
390
- function widenToNullable(node) {
391
- if (Array.isArray(node.anyOf)) return node.anyOf.some((branch) => isPlainObject(branch) && branch.type === "null") ? node : {
392
+ const NULL_CONSTRAINT_KEYWORDS = [
393
+ "type",
394
+ "enum",
395
+ "const",
396
+ "$ref",
397
+ "anyOf",
398
+ "oneOf",
399
+ "allOf",
400
+ "not",
401
+ "if",
402
+ "then",
403
+ "else"
404
+ ];
405
+ /**
406
+ * Widens a property schema so that `null` is an accepted value while keeping
407
+ * every other constraint it declares. A node whose only obstacle is `type` or
408
+ * `anyOf` is widened in place. Anything else is wrapped whole, because JSON
409
+ * Schema keywords apply together: adding `null` to `type` does not lift a
410
+ * sibling `enum`. `acceptsNull` must answer for the strict output.
411
+ */
412
+ function widenToNullable(node, acceptsNull) {
413
+ if (acceptsNull(node)) return node;
414
+ const constraints = NULL_CONSTRAINT_KEYWORDS.filter((key) => key in node);
415
+ if (constraints.length === 1 && constraints[0] === "type") {
416
+ const members = Array.isArray(node.type) ? node.type : [node.type];
417
+ return {
418
+ ...node,
419
+ type: [...members, "null"]
420
+ };
421
+ }
422
+ if (constraints.length === 1 && constraints[0] === "anyOf" && Array.isArray(node.anyOf)) return {
392
423
  ...node,
393
424
  anyOf: [...node.anyOf, { type: "null" }]
394
425
  };
395
- if (typeof node.type === "string") return node.type === "null" ? node : {
396
- ...node,
397
- type: [node.type, "null"]
398
- };
399
- if (Array.isArray(node.type)) return node.type.includes("null") ? node : {
400
- ...node,
401
- type: [...node.type, "null"]
402
- };
403
- if (Array.isArray(node.enum) && node.enum.includes(null) || node.const === null) return node;
404
426
  const { description, title, ...rest } = node;
405
- if (Object.keys(rest).length === 0) return node;
406
427
  return {
407
428
  ...description !== void 0 ? { description } : {},
408
429
  ...title !== void 0 ? { title } : {},
@@ -423,19 +444,117 @@ function resolveLocalRefs(node, root) {
423
444
  }
424
445
  return current;
425
446
  }
426
- /** Whether a schema node accepts `null` as an instance. */
427
- function schemaAcceptsNull(schema, root) {
428
- const node = resolveLocalRefs(schema, root);
429
- if (!isPlainObject(node)) return true;
430
- if (typeof node.type === "string") return node.type === "null";
431
- if (Array.isArray(node.type)) return node.type.includes("null");
432
- if (Array.isArray(node.enum)) return node.enum.includes(null);
433
- if ("const" in node) return node.const === null;
434
- for (const keyword of ["anyOf", "oneOf"]) {
435
- const branches = node[keyword];
436
- if (Array.isArray(branches)) return branches.some((branch) => schemaAcceptsNull(branch, root));
437
- }
438
- return true;
447
+ /**
448
+ * Creates the check for whether schemas of one document accept `null` as an
449
+ * instance: every keyword in `NULL_CONSTRAINT_KEYWORDS` that is present must
450
+ * accept it. This is the single definition of null acceptance; the strict
451
+ * rewrite and `omitNullToolArguments` both decide with it.
452
+ *
453
+ * `strictOutput` answers for the schema `toStrictJsonSchema` emits instead of
454
+ * the one it was given: the rewrite types every node that declares
455
+ * `properties` as an object, so such a node stops accepting null.
456
+ *
457
+ * One check serves a whole document, and an answer is computed once per node.
458
+ * A reference cycle never yields a null by itself, so a node met again while
459
+ * it is being evaluated counts as rejecting. An answer that leans on that is
460
+ * provisional until the node it leans on is done: it is kept if that node
461
+ * does reject null and discarded otherwise.
462
+ *
463
+ * Each check is bounded in depth and in nodes visited. A check that meets a
464
+ * bound proves nothing, so it rejects null whatever its other branches say,
465
+ * which costs at most a redundant null branch or a dropped null. The nodes it
466
+ * went through stay marked as unproven, so a later check that reaches one of
467
+ * them neither repeats the work nor trusts the answer.
468
+ */
469
+ function createNullCheck(root, strictOutput = false) {
470
+ const NOTHING = 65;
471
+ const A_BOUND = -1;
472
+ const answers = /* @__PURE__ */ new Map();
473
+ const provisional = [];
474
+ const path = /* @__PURE__ */ new Map();
475
+ const metAgain = /* @__PURE__ */ new Set();
476
+ let budget = 0;
477
+ let leansOn = NOTHING;
478
+ const accepts = (schema) => {
479
+ if (typeof schema === "boolean") return schema;
480
+ if (!isPlainObject(schema)) return true;
481
+ const remembered = answers.get(schema);
482
+ if (remembered !== void 0) {
483
+ if (path.size === 0) return remembered.answer && remembered.leansOn !== A_BOUND;
484
+ leansOn = Math.min(leansOn, remembered.leansOn);
485
+ return remembered.answer;
486
+ }
487
+ const onPath = path.get(schema);
488
+ if (onPath !== void 0) {
489
+ metAgain.add(onPath);
490
+ leansOn = Math.min(leansOn, onPath);
491
+ return false;
492
+ }
493
+ const depth = path.size;
494
+ if (depth === 0) budget = MAX_NULL_CHECK_NODES;
495
+ if (depth >= MAX_NULL_CHECK_DEPTH || budget <= 0) {
496
+ leansOn = A_BOUND;
497
+ return false;
498
+ }
499
+ budget -= 1;
500
+ const outer = leansOn;
501
+ leansOn = NOTHING;
502
+ const mark = provisional.length;
503
+ path.set(schema, depth);
504
+ let answer = keywordsAccept(schema);
505
+ path.delete(schema);
506
+ const own = leansOn;
507
+ const settled = own >= depth;
508
+ const below = provisional.splice(mark);
509
+ if (answer && metAgain.has(depth)) for (const other of below) answers.delete(other);
510
+ else for (const other of below) {
511
+ const entry = answers.get(other);
512
+ if (entry === void 0) continue;
513
+ if (settled) entry.leansOn = NOTHING;
514
+ else {
515
+ if (entry.leansOn >= depth) entry.leansOn = own;
516
+ provisional.push(other);
517
+ }
518
+ }
519
+ metAgain.delete(depth);
520
+ if (depth === 0 && own === A_BOUND) answer = false;
521
+ answers.set(schema, {
522
+ answer,
523
+ leansOn: settled ? NOTHING : own
524
+ });
525
+ if (!settled) provisional.push(schema);
526
+ leansOn = settled ? outer : Math.min(outer, own);
527
+ if (depth === 0) {
528
+ provisional.length = 0;
529
+ leansOn = NOTHING;
530
+ }
531
+ return answer;
532
+ };
533
+ const keywordsAccept = (node) => {
534
+ if (typeof node.type === "string" && node.type !== "null") return false;
535
+ if (Array.isArray(node.type) && !node.type.includes("null")) return false;
536
+ if (strictOutput && !("type" in node) && isPlainObject(node.properties)) return false;
537
+ if (Array.isArray(node.enum) && !node.enum.includes(null)) return false;
538
+ if ("const" in node && node.const !== null) return false;
539
+ if ("$ref" in node) {
540
+ const resolution = typeof node.$ref === "string" ? tryResolvePointer(root, node.$ref) : void 0;
541
+ if (resolution === void 0 || resolution.kind === "unresolved") return false;
542
+ if (!accepts(resolution.value)) return false;
543
+ }
544
+ if (Array.isArray(node.anyOf) && !node.anyOf.some(accepts)) return false;
545
+ if (Array.isArray(node.oneOf)) {
546
+ const matches = node.oneOf.filter(accepts).length;
547
+ if (matches === 0 || matches > 1 && !strictOutput) return false;
548
+ }
549
+ if (Array.isArray(node.allOf) && !node.allOf.every(accepts)) return false;
550
+ if ("not" in node && accepts(node.not)) return false;
551
+ if ("if" in node) {
552
+ const branch = accepts(node.if) ? "then" : "else";
553
+ if (branch in node && !accepts(node[branch])) return false;
554
+ }
555
+ return true;
556
+ };
557
+ return accepts;
439
558
  }
440
559
  /**
441
560
  * Normalizes a tool parameter schema for OpenAI structured outputs
@@ -470,12 +589,14 @@ function schemaAcceptsNull(schema, root) {
470
589
  function toStrictJsonSchema(schema) {
471
590
  const changes = [];
472
591
  const unsupported = [];
592
+ const references = [];
473
593
  let totalChanges = 0;
474
594
  const recordChange = (change) => {
475
595
  totalChanges += 1;
476
596
  if (changes.length < MAX_STRICT_CHANGES) changes.push(change);
477
597
  };
478
598
  const root = isPlainObject(schema) ? schema : {};
599
+ const acceptsNullInOutput = createNullCheck(root, true);
479
600
  function walkChildren(node, mode, depth, path) {
480
601
  const clone = {};
481
602
  for (const [key, child] of Object.entries(node)) {
@@ -559,6 +680,10 @@ function toStrictJsonSchema(schema) {
559
680
  keyword: "$ref",
560
681
  detail: `unresolved $ref "${node.$ref}"`
561
682
  });
683
+ else references.push({
684
+ path,
685
+ ref: node.$ref
686
+ });
562
687
  return out;
563
688
  }
564
689
  if (!(out.type === "object" || Array.isArray(out.type) && out.type.includes("object")) && !isPlainObject(out.properties)) return out;
@@ -576,7 +701,7 @@ function toStrictJsonSchema(schema) {
576
701
  continue;
577
702
  }
578
703
  if (declaredRequired.has(name) || !isPlainObject(propertySchema)) continue;
579
- setOwn(properties, name, widenToNullable(propertySchema));
704
+ setOwn(properties, name, widenToNullable(propertySchema, acceptsNullInOutput));
580
705
  recordChange({
581
706
  path: joinPath(path, `properties.${name}`),
582
707
  reason: "optional-property-nullable",
@@ -608,6 +733,13 @@ function toStrictJsonSchema(schema) {
608
733
  };
609
734
  }
610
735
  const normalized = walk(root, "schema", 0, "");
736
+ if (isPlainObject(normalized)) {
737
+ for (const { path, ref } of references) if (tryResolvePointer(normalized, ref).kind === "unresolved") unsupported.push({
738
+ path,
739
+ keyword: "$ref",
740
+ detail: `$ref "${ref}" target moved by the rewrite`
741
+ });
742
+ }
611
743
  if (!isPlainObject(normalized) || !isObjectType(normalized.type)) unsupported.push({
612
744
  path: "",
613
745
  keyword: "type",
@@ -639,7 +771,7 @@ function toStrictJsonSchema(schema) {
639
771
  */
640
772
  function omitNullToolArguments(args, schema) {
641
773
  const root = isPlainObject(schema) ? schema : {};
642
- return omitNulls(args, root, root, 0);
774
+ return omitNulls(args, root, root, 0, createNullCheck(root));
643
775
  }
644
776
  /**
645
777
  * Picks the composition branch that describes a value's shape: the first
@@ -665,12 +797,12 @@ function selectBranchFor(schema, value, root) {
665
797
  };
666
798
  return find(resolved, 0) ?? resolved;
667
799
  }
668
- function omitNulls(value, schema, root, depth) {
800
+ function omitNulls(value, schema, root, depth, acceptsNull) {
669
801
  if (depth > MAX_NODE_DEPTH) throw new RangeError(`Tool arguments exceed maximum nesting depth of ${MAX_NODE_DEPTH}`);
670
802
  const node = selectBranchFor(schema, value, root);
671
803
  if (Array.isArray(value)) {
672
804
  const items = node && isPlainObject(node.items) ? node.items : void 0;
673
- return value.map((item) => omitNulls(item, items, root, depth + 1));
805
+ return value.map((item) => omitNulls(item, items, root, depth + 1, acceptsNull));
674
806
  }
675
807
  if (!isPlainObject(value)) return value;
676
808
  const properties = node && isPlainObject(node.properties) ? node.properties : {};
@@ -678,10 +810,10 @@ function omitNulls(value, schema, root, depth) {
678
810
  for (const [key, child] of Object.entries(value)) {
679
811
  const propertySchema = Object.prototype.hasOwnProperty.call(properties, key) ? properties[key] : void 0;
680
812
  if (child === null) {
681
- if (propertySchema === void 0 || schemaAcceptsNull(propertySchema, root)) setOwn(clone, key, child);
813
+ if (propertySchema === void 0 || acceptsNull(propertySchema)) setOwn(clone, key, child);
682
814
  continue;
683
815
  }
684
- setOwn(clone, key, omitNulls(child, propertySchema, root, depth + 1));
816
+ setOwn(clone, key, omitNulls(child, propertySchema, root, depth + 1, acceptsNull));
685
817
  }
686
818
  return clone;
687
819
  }
@@ -1,4 +1,4 @@
1
- import { $r as McpServerGetResponse, An as ConnectedAccountRetrieveResponse, Cn as ConnectedAccountListParams, D as Session, Ea as ToolExecuteResponse, Fa as ToolRetrievalOptions, Ha as ToolkitVersionParam, M as SessionWithoutMcp, Mn as ConnectedAccountRevokeResponse, Na as ToolProxyParams, Oa as ToolList, On as ConnectedAccountRefreshOptions, Sa as ToolExecuteMetaParams, Tn as ConnectedAccountListResponse, Un as CreateConnectedAccountLinkOptions, _n as ConnectedAccountCompleteAuthResponse, ar as BaseComposioProvider, ba as SchemaModifierOptions, ci as ExecuteToolFnOptions, er as UpdateConnectedAccountAclParams, et as ToolRouterSessionDeleteResponse, f as CustomToolkit, fi as ToolCallSession, hn as ConnectedAccountCompleteAuthParams, ia as ExecuteToolModifiers, ii as McpUrlResponse, ka as ToolListParams, nr as UpdateConnectedAccountParams, o as CustomTool, oa as ProviderOptions, on as ComposioRequestOptions, or as BaseNonAgenticProvider, qn as CreateConnectedAccountOptions, sa as SessionExecuteMetaModifiers, sn as ConnectionRequest, wa as ToolExecuteParams, xa as Tool, z as ToolRouterCreateSessionConfig } from "./customTool.types-CK408sI-.mjs";
1
+ import { Aa as ToolExecuteResponse, D as Session, Dn as ConnectedAccountListParams, Ea as ToolExecuteMetaParams, In as ConnectedAccountRevokeResponse, Ka as ToolkitVersionParam, La as ToolProxyParams, M as SessionWithoutMcp, Ma as ToolList, Mn as ConnectedAccountRefreshOptions, Na as ToolListParams, Oa as ToolExecuteParams, Pn as ConnectedAccountRetrieveResponse, Ta as Tool, Zn as CreateConnectedAccountOptions, ca as ExecuteToolModifiers, ci as McpUrlResponse, da as SessionExecuteMetaModifiers, dn as ConnectionRequest, f as CustomToolkit, fi as ExecuteToolFnOptions, gi as ToolCallSession, ir as UpdateConnectedAccountAclParams, kn as ConnectedAccountListResponse, lr as BaseComposioProvider, nt as ToolRouterSessionDeleteResponse, o as CustomTool, or as UpdateConnectedAccountParams, qn as CreateConnectedAccountLinkOptions, ri as McpServerGetResponse, ua as ProviderOptions, un as ComposioRequestOptions, ur as BaseNonAgenticProvider, wa as SchemaModifierOptions, xn as ConnectedAccountCompleteAuthResponse, yn as ConnectedAccountCompleteAuthParams, z as ToolRouterCreateSessionConfig, za as ToolRetrievalOptions } from "./customTool.types-D57QrTns.mjs";
2
2
  import ComposioClient, { Composio } from "@composio/client";
3
3
  import z, { z as z$1 } from "zod/v3";
4
4
  import { Files } from "#files";
@@ -28,26 +28,7 @@ declare class Tools<TToolCollection, TTool, TProvider extends BaseComposioProvid
28
28
  * Scoped per-instance so a fresh `Composio` starts with a clean slate.
29
29
  */
30
30
  private readonly warnedAutoUploadDisabledForTool;
31
- /**
32
- * Lazily-built sibling client with retries disabled; see `clientWithoutRetries`.
33
- */
34
- private clientWithoutRetriesCache?;
35
31
  constructor(client: ComposioClient, config?: ComposioConfig<TProvider>);
36
- /**
37
- * A cached sibling client that never retries requests, mirroring Python's
38
- * `client.without_retries`.
39
- *
40
- * Used for non-idempotent writes (`tools.execute` / `tools.proxy`), where a
41
- * silent retry after a read timeout can duplicate a side effect (e.g. send an
42
- * email twice). Reads keep the default retry behaviour, and so do other writes
43
- * (`toolRouter.session.execute`, auth-config and connected-account mutations):
44
- * the durable fix there is backend-honoured idempotency keys, tracked
45
- * separately.
46
- *
47
- * Cached rather than rebuilt per call because `withOptions` constructs a fresh
48
- * client; its options never change, so one per `Tools` instance suffices.
49
- */
50
- private get clientWithoutRetries();
51
32
  /**
52
33
  * Transforms tool data from snake_case API format to camelCase for internal SDK use.
53
34
  *
@@ -510,6 +491,7 @@ declare class Tools<TToolCollection, TTool, TProvider extends BaseComposioProvid
510
491
  * @param {string} body.endpoint - Path relative to the toolkit's base URL, or an absolute URL
511
492
  * @param {'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH'} body.method - HTTP method
512
493
  * @param {string} [body.connectedAccountId] - The connected account to authenticate as
494
+ * @param {string} [body.userId] - The user the connected account belongs to. Projects with 2FA enabled check it against the connected account and may require it
513
495
  * @param {unknown} [body.body] - JSON request body
514
496
  * @param {Array<{ in: 'query' | 'header'; name: string; value: string | number }>} [body.parameters] - Extra query parameters or headers
515
497
  * @returns {Promise<ToolProxyResponse>} The upstream status, headers, and parsed body
@@ -4241,16 +4223,16 @@ declare const VerifyWebhookParamsSchema: z$1.ZodObject<{
4241
4223
  tolerance: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodNumber>>;
4242
4224
  }, "strip", z$1.ZodTypeAny, {
4243
4225
  id: string;
4226
+ secret: string;
4244
4227
  payload: string;
4245
4228
  timestamp: string;
4246
- secret: string;
4247
4229
  signature: string;
4248
4230
  tolerance: number;
4249
4231
  }, {
4250
4232
  id: string;
4233
+ secret: string;
4251
4234
  payload: string;
4252
4235
  timestamp: string;
4253
- secret: string;
4254
4236
  signature: string;
4255
4237
  tolerance?: number | undefined;
4256
4238
  }>;
@@ -5267,24 +5249,24 @@ declare const UsageBreakdownParamsSchema: z$1.ZodObject<{
5267
5249
  }>>;
5268
5250
  }, "strip", z$1.ZodTypeAny, {
5269
5251
  limit?: number | undefined;
5270
- orderBy?: "key" | "total_quantity" | "event_count" | undefined;
5271
5252
  from?: number | undefined;
5272
5253
  to?: number | undefined;
5273
5254
  filters?: {
5274
5255
  userId?: string[] | null | undefined;
5275
5256
  sessionId?: string[] | null | undefined;
5276
5257
  } | undefined;
5258
+ orderBy?: "key" | "total_quantity" | "event_count" | undefined;
5277
5259
  groupBy?: string | undefined;
5278
5260
  orderDirection?: "asc" | "desc" | undefined;
5279
5261
  }, {
5280
5262
  limit?: number | undefined;
5281
- orderBy?: "key" | "total_quantity" | "event_count" | undefined;
5282
5263
  from?: number | undefined;
5283
5264
  to?: number | undefined;
5284
5265
  filters?: {
5285
5266
  userId?: string[] | null | undefined;
5286
5267
  sessionId?: string[] | null | undefined;
5287
5268
  } | undefined;
5269
+ orderBy?: "key" | "total_quantity" | "event_count" | undefined;
5288
5270
  groupBy?: string | undefined;
5289
5271
  orderDirection?: "asc" | "desc" | undefined;
5290
5272
  }>;
@@ -7678,41 +7660,41 @@ declare const SessionConfigPolicySchema: z$1.ZodObject<{
7678
7660
  disable: string[];
7679
7661
  }>, z$1.ZodObject<{
7680
7662
  tags: z$1.ZodObject<{
7681
- enable: z$1.ZodOptional<z$1.ZodArray<z$1.ZodEnum<["readOnlyHint", "destructiveHint", "idempotentHint", "openWorldHint"]>, "many">>;
7682
- disable: z$1.ZodOptional<z$1.ZodArray<z$1.ZodEnum<["readOnlyHint", "destructiveHint", "idempotentHint", "openWorldHint"]>, "many">>;
7663
+ enable: z$1.ZodOptional<z$1.ZodArray<z$1.ZodEnum<["readOnlyHint", "createHint", "updateHint", "destructiveHint", "idempotentHint", "openWorldHint"]>, "many">>;
7664
+ disable: z$1.ZodOptional<z$1.ZodArray<z$1.ZodEnum<["readOnlyHint", "createHint", "updateHint", "destructiveHint", "idempotentHint", "openWorldHint"]>, "many">>;
7683
7665
  }, "strip", z$1.ZodTypeAny, {
7684
- disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
7685
- enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
7666
+ disable?: ("readOnlyHint" | "createHint" | "updateHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
7667
+ enable?: ("readOnlyHint" | "createHint" | "updateHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
7686
7668
  }, {
7687
- disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
7688
- enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
7669
+ disable?: ("readOnlyHint" | "createHint" | "updateHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
7670
+ enable?: ("readOnlyHint" | "createHint" | "updateHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
7689
7671
  }>;
7690
7672
  }, "strip", z$1.ZodTypeAny, {
7691
7673
  tags: {
7692
- disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
7693
- enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
7674
+ disable?: ("readOnlyHint" | "createHint" | "updateHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
7675
+ enable?: ("readOnlyHint" | "createHint" | "updateHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
7694
7676
  };
7695
7677
  }, {
7696
7678
  tags: {
7697
- disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
7698
- enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
7679
+ disable?: ("readOnlyHint" | "createHint" | "updateHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
7680
+ enable?: ("readOnlyHint" | "createHint" | "updateHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
7699
7681
  };
7700
7682
  }>]>>>;
7701
7683
  /** Global tag policy. */
7702
7684
  tags: z$1.ZodOptional<z$1.ZodObject<{
7703
- enable: z$1.ZodOptional<z$1.ZodArray<z$1.ZodEnum<["readOnlyHint", "destructiveHint", "idempotentHint", "openWorldHint"]>, "many">>;
7704
- disable: z$1.ZodOptional<z$1.ZodArray<z$1.ZodEnum<["readOnlyHint", "destructiveHint", "idempotentHint", "openWorldHint"]>, "many">>;
7685
+ enable: z$1.ZodOptional<z$1.ZodArray<z$1.ZodEnum<["readOnlyHint", "createHint", "updateHint", "destructiveHint", "idempotentHint", "openWorldHint"]>, "many">>;
7686
+ disable: z$1.ZodOptional<z$1.ZodArray<z$1.ZodEnum<["readOnlyHint", "createHint", "updateHint", "destructiveHint", "idempotentHint", "openWorldHint"]>, "many">>;
7705
7687
  }, "strip", z$1.ZodTypeAny, {
7706
- disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
7707
- enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
7688
+ disable?: ("readOnlyHint" | "createHint" | "updateHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
7689
+ enable?: ("readOnlyHint" | "createHint" | "updateHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
7708
7690
  }, {
7709
- disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
7710
- enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
7691
+ disable?: ("readOnlyHint" | "createHint" | "updateHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
7692
+ enable?: ("readOnlyHint" | "createHint" | "updateHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
7711
7693
  }>>;
7712
7694
  }, "strip", z$1.ZodTypeAny, {
7713
7695
  tags?: {
7714
- disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
7715
- enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
7696
+ disable?: ("readOnlyHint" | "createHint" | "updateHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
7697
+ enable?: ("readOnlyHint" | "createHint" | "updateHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
7716
7698
  } | undefined;
7717
7699
  tools?: Record<string, {
7718
7700
  enable: string[];
@@ -7720,8 +7702,8 @@ declare const SessionConfigPolicySchema: z$1.ZodObject<{
7720
7702
  disable: string[];
7721
7703
  } | {
7722
7704
  tags: {
7723
- disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
7724
- enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
7705
+ disable?: ("readOnlyHint" | "createHint" | "updateHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
7706
+ enable?: ("readOnlyHint" | "createHint" | "updateHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
7725
7707
  };
7726
7708
  }> | undefined;
7727
7709
  toolkits?: {
@@ -7731,8 +7713,8 @@ declare const SessionConfigPolicySchema: z$1.ZodObject<{
7731
7713
  } | undefined;
7732
7714
  }, {
7733
7715
  tags?: {
7734
- disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
7735
- enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
7716
+ disable?: ("readOnlyHint" | "createHint" | "updateHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
7717
+ enable?: ("readOnlyHint" | "createHint" | "updateHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
7736
7718
  } | undefined;
7737
7719
  tools?: Record<string, {
7738
7720
  enable: string[];
@@ -7740,8 +7722,8 @@ declare const SessionConfigPolicySchema: z$1.ZodObject<{
7740
7722
  disable: string[];
7741
7723
  } | {
7742
7724
  tags: {
7743
- disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
7744
- enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
7725
+ disable?: ("readOnlyHint" | "createHint" | "updateHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
7726
+ enable?: ("readOnlyHint" | "createHint" | "updateHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
7745
7727
  };
7746
7728
  }> | undefined;
7747
7729
  toolkits?: {
@@ -7796,41 +7778,41 @@ declare const SessionConfigSchema: z$1.ZodObject<{
7796
7778
  disable: string[];
7797
7779
  }>, z$1.ZodObject<{
7798
7780
  tags: z$1.ZodObject<{
7799
- enable: z$1.ZodOptional<z$1.ZodArray<z$1.ZodEnum<["readOnlyHint", "destructiveHint", "idempotentHint", "openWorldHint"]>, "many">>;
7800
- disable: z$1.ZodOptional<z$1.ZodArray<z$1.ZodEnum<["readOnlyHint", "destructiveHint", "idempotentHint", "openWorldHint"]>, "many">>;
7781
+ enable: z$1.ZodOptional<z$1.ZodArray<z$1.ZodEnum<["readOnlyHint", "createHint", "updateHint", "destructiveHint", "idempotentHint", "openWorldHint"]>, "many">>;
7782
+ disable: z$1.ZodOptional<z$1.ZodArray<z$1.ZodEnum<["readOnlyHint", "createHint", "updateHint", "destructiveHint", "idempotentHint", "openWorldHint"]>, "many">>;
7801
7783
  }, "strip", z$1.ZodTypeAny, {
7802
- disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
7803
- enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
7784
+ disable?: ("readOnlyHint" | "createHint" | "updateHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
7785
+ enable?: ("readOnlyHint" | "createHint" | "updateHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
7804
7786
  }, {
7805
- disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
7806
- enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
7787
+ disable?: ("readOnlyHint" | "createHint" | "updateHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
7788
+ enable?: ("readOnlyHint" | "createHint" | "updateHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
7807
7789
  }>;
7808
7790
  }, "strip", z$1.ZodTypeAny, {
7809
7791
  tags: {
7810
- disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
7811
- enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
7792
+ disable?: ("readOnlyHint" | "createHint" | "updateHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
7793
+ enable?: ("readOnlyHint" | "createHint" | "updateHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
7812
7794
  };
7813
7795
  }, {
7814
7796
  tags: {
7815
- disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
7816
- enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
7797
+ disable?: ("readOnlyHint" | "createHint" | "updateHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
7798
+ enable?: ("readOnlyHint" | "createHint" | "updateHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
7817
7799
  };
7818
7800
  }>]>>>;
7819
7801
  /** Global tag policy. */
7820
7802
  tags: z$1.ZodOptional<z$1.ZodObject<{
7821
- enable: z$1.ZodOptional<z$1.ZodArray<z$1.ZodEnum<["readOnlyHint", "destructiveHint", "idempotentHint", "openWorldHint"]>, "many">>;
7822
- disable: z$1.ZodOptional<z$1.ZodArray<z$1.ZodEnum<["readOnlyHint", "destructiveHint", "idempotentHint", "openWorldHint"]>, "many">>;
7803
+ enable: z$1.ZodOptional<z$1.ZodArray<z$1.ZodEnum<["readOnlyHint", "createHint", "updateHint", "destructiveHint", "idempotentHint", "openWorldHint"]>, "many">>;
7804
+ disable: z$1.ZodOptional<z$1.ZodArray<z$1.ZodEnum<["readOnlyHint", "createHint", "updateHint", "destructiveHint", "idempotentHint", "openWorldHint"]>, "many">>;
7823
7805
  }, "strip", z$1.ZodTypeAny, {
7824
- disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
7825
- enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
7806
+ disable?: ("readOnlyHint" | "createHint" | "updateHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
7807
+ enable?: ("readOnlyHint" | "createHint" | "updateHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
7826
7808
  }, {
7827
- disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
7828
- enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
7809
+ disable?: ("readOnlyHint" | "createHint" | "updateHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
7810
+ enable?: ("readOnlyHint" | "createHint" | "updateHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
7829
7811
  }>>;
7830
7812
  }, "strip", z$1.ZodTypeAny, {
7831
7813
  tags?: {
7832
- disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
7833
- enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
7814
+ disable?: ("readOnlyHint" | "createHint" | "updateHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
7815
+ enable?: ("readOnlyHint" | "createHint" | "updateHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
7834
7816
  } | undefined;
7835
7817
  tools?: Record<string, {
7836
7818
  enable: string[];
@@ -7838,8 +7820,8 @@ declare const SessionConfigSchema: z$1.ZodObject<{
7838
7820
  disable: string[];
7839
7821
  } | {
7840
7822
  tags: {
7841
- disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
7842
- enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
7823
+ disable?: ("readOnlyHint" | "createHint" | "updateHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
7824
+ enable?: ("readOnlyHint" | "createHint" | "updateHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
7843
7825
  };
7844
7826
  }> | undefined;
7845
7827
  toolkits?: {
@@ -7849,8 +7831,8 @@ declare const SessionConfigSchema: z$1.ZodObject<{
7849
7831
  } | undefined;
7850
7832
  }, {
7851
7833
  tags?: {
7852
- disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
7853
- enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
7834
+ disable?: ("readOnlyHint" | "createHint" | "updateHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
7835
+ enable?: ("readOnlyHint" | "createHint" | "updateHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
7854
7836
  } | undefined;
7855
7837
  tools?: Record<string, {
7856
7838
  enable: string[];
@@ -7858,8 +7840,8 @@ declare const SessionConfigSchema: z$1.ZodObject<{
7858
7840
  disable: string[];
7859
7841
  } | {
7860
7842
  tags: {
7861
- disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
7862
- enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
7843
+ disable?: ("readOnlyHint" | "createHint" | "updateHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
7844
+ enable?: ("readOnlyHint" | "createHint" | "updateHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
7863
7845
  };
7864
7846
  }> | undefined;
7865
7847
  toolkits?: {
@@ -7876,8 +7858,8 @@ declare const SessionConfigSchema: z$1.ZodObject<{
7876
7858
  updatedAt: string;
7877
7859
  config: {
7878
7860
  tags?: {
7879
- disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
7880
- enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
7861
+ disable?: ("readOnlyHint" | "createHint" | "updateHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
7862
+ enable?: ("readOnlyHint" | "createHint" | "updateHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
7881
7863
  } | undefined;
7882
7864
  tools?: Record<string, {
7883
7865
  enable: string[];
@@ -7885,8 +7867,8 @@ declare const SessionConfigSchema: z$1.ZodObject<{
7885
7867
  disable: string[];
7886
7868
  } | {
7887
7869
  tags: {
7888
- disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
7889
- enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
7870
+ disable?: ("readOnlyHint" | "createHint" | "updateHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
7871
+ enable?: ("readOnlyHint" | "createHint" | "updateHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
7890
7872
  };
7891
7873
  }> | undefined;
7892
7874
  toolkits?: {
@@ -7904,8 +7886,8 @@ declare const SessionConfigSchema: z$1.ZodObject<{
7904
7886
  updatedAt: string;
7905
7887
  config: {
7906
7888
  tags?: {
7907
- disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
7908
- enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
7889
+ disable?: ("readOnlyHint" | "createHint" | "updateHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
7890
+ enable?: ("readOnlyHint" | "createHint" | "updateHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
7909
7891
  } | undefined;
7910
7892
  tools?: Record<string, {
7911
7893
  enable: string[];
@@ -7913,8 +7895,8 @@ declare const SessionConfigSchema: z$1.ZodObject<{
7913
7895
  disable: string[];
7914
7896
  } | {
7915
7897
  tags: {
7916
- disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
7917
- enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
7898
+ disable?: ("readOnlyHint" | "createHint" | "updateHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
7899
+ enable?: ("readOnlyHint" | "createHint" | "updateHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
7918
7900
  };
7919
7901
  }> | undefined;
7920
7902
  toolkits?: {