@ganju/utils 0.0.15 → 0.0.17

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 (77) hide show
  1. package/dist/constants.d.ts +26 -0
  2. package/dist/constants.d.ts.map +1 -1
  3. package/dist/constants.js +107 -9
  4. package/dist/customCodeToken.d.ts +11 -0
  5. package/dist/customCodeToken.d.ts.map +1 -1
  6. package/dist/customCodeToken.js +41 -1
  7. package/dist/data.d.ts +13 -0
  8. package/dist/data.d.ts.map +1 -0
  9. package/dist/data.js +103 -0
  10. package/dist/dataApi.d.ts +578 -0
  11. package/dist/dataApi.d.ts.map +1 -0
  12. package/dist/dataApi.js +399 -0
  13. package/dist/dataCompiler.d.ts +68 -0
  14. package/dist/dataCompiler.d.ts.map +1 -0
  15. package/dist/dataCompiler.js +730 -0
  16. package/dist/dataCsv.d.ts +20 -0
  17. package/dist/dataCsv.d.ts.map +1 -0
  18. package/dist/dataCsv.js +102 -0
  19. package/dist/dataDdl.d.ts +29 -0
  20. package/dist/dataDdl.d.ts.map +1 -0
  21. package/dist/dataDdl.js +354 -0
  22. package/dist/dataEngine.d.ts +143 -0
  23. package/dist/dataEngine.d.ts.map +1 -0
  24. package/dist/dataEngine.js +2042 -0
  25. package/dist/dataIdentifiers.d.ts +8 -0
  26. package/dist/dataIdentifiers.d.ts.map +1 -0
  27. package/dist/dataIdentifiers.js +55 -0
  28. package/dist/dataImport.d.ts +79 -0
  29. package/dist/dataImport.d.ts.map +1 -0
  30. package/dist/dataImport.js +453 -0
  31. package/dist/dataQueries.d.ts +73 -0
  32. package/dist/dataQueries.d.ts.map +1 -0
  33. package/dist/dataQueries.js +513 -0
  34. package/dist/dataRpc.d.ts +150 -0
  35. package/dist/dataRpc.d.ts.map +1 -0
  36. package/dist/dataRpc.js +2 -0
  37. package/dist/dataTools.d.ts +40 -0
  38. package/dist/dataTools.d.ts.map +1 -0
  39. package/dist/dataTools.js +280 -0
  40. package/dist/dataTypes.d.ts +159 -0
  41. package/dist/dataTypes.d.ts.map +1 -0
  42. package/dist/dataTypes.js +160 -0
  43. package/dist/index.d.ts +394 -8
  44. package/dist/index.d.ts.map +1 -1
  45. package/dist/index.js +4 -0
  46. package/dist/oauth.d.ts +14 -0
  47. package/dist/oauth.d.ts.map +1 -1
  48. package/dist/oauth.js +42 -2
  49. package/dist/resourceRerank.d.ts +3 -2
  50. package/dist/resourceRerank.d.ts.map +1 -1
  51. package/dist/resourceRerank.js +5 -2
  52. package/dist/schema.d.ts +376 -4
  53. package/dist/schema.d.ts.map +1 -1
  54. package/dist/schema.js +268 -1
  55. package/dist/sdkConstants.d.ts +1 -0
  56. package/dist/sdkConstants.d.ts.map +1 -1
  57. package/dist/sdkConstants.js +2 -1
  58. package/package.json +17 -2
  59. package/src/constants.ts +121 -9
  60. package/src/customCodeToken.ts +74 -0
  61. package/src/data.ts +108 -0
  62. package/src/dataApi.ts +479 -0
  63. package/src/dataCompiler.ts +952 -0
  64. package/src/dataCsv.ts +99 -0
  65. package/src/dataDdl.ts +419 -0
  66. package/src/dataEngine.ts +2773 -0
  67. package/src/dataIdentifiers.ts +63 -0
  68. package/src/dataImport.ts +557 -0
  69. package/src/dataQueries.ts +730 -0
  70. package/src/dataRpc.ts +132 -0
  71. package/src/dataTools.ts +338 -0
  72. package/src/dataTypes.ts +318 -0
  73. package/src/index.ts +13 -1
  74. package/src/oauth.ts +42 -1
  75. package/src/resourceRerank.ts +5 -2
  76. package/src/schema.ts +315 -1
  77. package/src/sdkConstants.ts +1 -0
package/dist/schema.js CHANGED
@@ -10,6 +10,7 @@ const reservedToolName_1 = require("./reservedToolName");
10
10
  const slugifyTitle_1 = require("./slugifyTitle");
11
11
  const toolConfirmation_1 = require("./toolConfirmation");
12
12
  const channelCustomer_1 = require("./channelCustomer");
13
+ const dataTypes_1 = require("./dataTypes");
13
14
  // A prompt title becomes a slash command; it must not collide with a command
14
15
  // the channel runner handles itself (e.g. `/link`).
15
16
  const PROMPT_TITLE = zod_1.z
@@ -427,6 +428,222 @@ const ARTIFACT_REMOVE_RESOURCE = zod_1.z.object({
427
428
  userId: zod_1.z.uuid(),
428
429
  organizationId: zod_1.z.uuid()
429
430
  });
431
+ const DATA_DATABASE_GET = zod_1.z.object({
432
+ projectId: zod_1.z.uuid(),
433
+ userId: zod_1.z.uuid(),
434
+ organizationId: zod_1.z.uuid()
435
+ });
436
+ // The name is what the owner types to delete it; it defaults to the
437
+ // project's slug. `replaceDeleted` starts over while a deleted database is
438
+ // still in its grace period, giving up the chance to restore it.
439
+ const DATA_DATABASE_CREATE = DATA_DATABASE_GET.extend({
440
+ name: zod_1.z.string().trim().min(1).max(100).optional(),
441
+ replaceDeleted: zod_1.z.boolean().optional()
442
+ });
443
+ const DATA_DATABASE_DELETE = DATA_DATABASE_GET.extend({
444
+ confirmName: zod_1.z.string().min(1)
445
+ });
446
+ // The bodies and query strings of the Data API. Each one is what a client
447
+ // sends; the route schemas below add the path's ids. The database object
448
+ // checks every rule again (names, types, relations), so these describe the
449
+ // shape and leave the meaning to it.
450
+ const DATA_IDENTIFIER = zod_1.z.string().min(1).max(63);
451
+ const DATA_DEFAULT_VALUE = zod_1.z.union([
452
+ zod_1.z.string(),
453
+ zod_1.z.number(),
454
+ zod_1.z.boolean(),
455
+ zod_1.z.null()
456
+ ]);
457
+ const DATA_TEXT = (max) => zod_1.z.string().max(max).nullable().optional();
458
+ const DATA_COLUMN_INPUT = zod_1.z.strictObject({
459
+ name: DATA_IDENTIFIER,
460
+ type: zod_1.z.enum(dataTypes_1.DATA_COLUMN_TYPES),
461
+ label: DATA_TEXT(dataTypes_1.DATA_MAX_LABEL),
462
+ description: DATA_TEXT(dataTypes_1.DATA_MAX_DESCRIPTION),
463
+ required: zod_1.z.boolean().optional(),
464
+ unique: zod_1.z.boolean().optional(),
465
+ filterable: zod_1.z.boolean().optional(),
466
+ searchable: zod_1.z.boolean().optional(),
467
+ personal: zod_1.z.boolean().optional(),
468
+ values: zod_1.z.array(zod_1.z.string().min(1)).max(dataTypes_1.DATA_MAX_ENUM_VALUES).optional(),
469
+ table: DATA_IDENTIFIER.optional(),
470
+ onDelete: zod_1.z.enum(dataTypes_1.DATA_ON_DELETE).optional(),
471
+ min: zod_1.z.number().nullable().optional(),
472
+ default: DATA_DEFAULT_VALUE.optional()
473
+ });
474
+ // The CLI's schema file holds a list of these.
475
+ const DATA_TABLE_INPUT = zod_1.z.strictObject({
476
+ name: DATA_IDENTIFIER,
477
+ label: DATA_TEXT(dataTypes_1.DATA_MAX_LABEL),
478
+ description: DATA_TEXT(dataTypes_1.DATA_MAX_DESCRIPTION),
479
+ displayColumn: DATA_IDENTIFIER.nullable().optional(),
480
+ access: zod_1.z.enum(dataTypes_1.DATA_ACCESS_LEVELS).optional(),
481
+ customerScoped: zod_1.z.boolean().optional(),
482
+ history: zod_1.z.boolean().optional(),
483
+ columns: zod_1.z.array(DATA_COLUMN_INPUT).max(dataTypes_1.DATA_MAX_COLUMNS)
484
+ });
485
+ const DATA_TABLE_PATCH = DATA_TABLE_INPUT.omit({ columns: true }).partial();
486
+ // A null puts the setting back to its default.
487
+ const DATA_COLUMN_PATCH = DATA_COLUMN_INPUT.partial();
488
+ const DATA_TABLE_DROP_BODY = zod_1.z.strictObject({ confirmName: zod_1.z.string().min(1) });
489
+ const DATA_ROW_VALUES = zod_1.z.record(zod_1.z.string(), zod_1.z.unknown());
490
+ // A JSON value carried in a query string, e.g. `where={"status":"open"}`.
491
+ const DATA_JSON_PARAM = zod_1.z.string().transform((text, ctx) => {
492
+ try {
493
+ return JSON.parse(text);
494
+ }
495
+ catch {
496
+ ctx.addIssue({
497
+ code: 'custom',
498
+ message: 'This is JSON, e.g. {"status":"open"}'
499
+ });
500
+ return zod_1.z.NEVER;
501
+ }
502
+ });
503
+ // A comma-separated list in a query string: `sort=-created_at,name`.
504
+ const DATA_LIST_PARAM = zod_1.z.string().transform(text => text
505
+ .split(',')
506
+ .map(item => item.trim())
507
+ .filter(Boolean));
508
+ const DATA_ROW_LIST_QUERY = zod_1.z.strictObject({
509
+ where: DATA_JSON_PARAM.optional(),
510
+ sort: DATA_LIST_PARAM.optional(),
511
+ include: DATA_LIST_PARAM.optional(),
512
+ limit: zod_1.z.coerce.number().int().min(1).max(dataTypes_1.DATA_MAX_PAGE).optional(),
513
+ cursor: zod_1.z.string().max(2000).optional(),
514
+ q: zod_1.z.string().max(500).optional(),
515
+ timeZone: zod_1.z.string().max(64).optional()
516
+ });
517
+ const DATA_ROW_GET_QUERY = DATA_ROW_LIST_QUERY.pick({
518
+ include: true,
519
+ timeZone: true
520
+ });
521
+ const DATA_ROW_CREATE_BODY = zod_1.z.union([
522
+ zod_1.z.strictObject({ values: DATA_ROW_VALUES }),
523
+ zod_1.z.strictObject({
524
+ rows: zod_1.z.array(DATA_ROW_VALUES).min(1).max(dataTypes_1.DATA_MAX_INSERT_ROWS)
525
+ })
526
+ ]);
527
+ const DATA_ROW_VERSION = zod_1.z.number().int().min(1);
528
+ // `set` takes values, or relative changes such as { "stock": { "decrement": 2 } }.
529
+ const DATA_ROW_UPDATE_BODY = zod_1.z.strictObject({
530
+ set: DATA_ROW_VALUES,
531
+ version: DATA_ROW_VERSION.optional()
532
+ });
533
+ const DATA_ROW_DELETE_BODY = zod_1.z.strictObject({
534
+ version: DATA_ROW_VERSION.optional()
535
+ });
536
+ const DATA_ROW_ID = zod_1.z.coerce.number().int().min(1);
537
+ // Without `ids`, every row of the table.
538
+ const DATA_DELETE_PREVIEW_BODY = zod_1.z.strictObject({
539
+ ids: zod_1.z.array(zod_1.z.number().int().min(1)).min(1).max(dataTypes_1.DATA_IMPACT_MAX_IDS).optional()
540
+ });
541
+ const DATA_WRITE_TARGET = {
542
+ table: DATA_IDENTIFIER,
543
+ id: zod_1.z
544
+ .union([
545
+ zod_1.z.number().int().min(1),
546
+ zod_1.z.strictObject({ $ref: zod_1.z.number().int().min(0) })
547
+ ])
548
+ .optional(),
549
+ where: zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()).optional(),
550
+ expect: zod_1.z.number().int().min(0).optional(),
551
+ version: DATA_ROW_VERSION.optional()
552
+ };
553
+ // Applied together or not at all. A later step can use an earlier insert's
554
+ // id as { "$ref": <step> }.
555
+ const DATA_WRITE_OPERATION = zod_1.z.discriminatedUnion('op', [
556
+ zod_1.z.strictObject({
557
+ op: zod_1.z.literal('insert'),
558
+ table: DATA_IDENTIFIER,
559
+ values: DATA_ROW_VALUES.optional(),
560
+ rows: zod_1.z.array(DATA_ROW_VALUES).min(1).max(dataTypes_1.DATA_MAX_INSERT_ROWS).optional()
561
+ }),
562
+ zod_1.z.strictObject({
563
+ op: zod_1.z.literal('update'),
564
+ ...DATA_WRITE_TARGET,
565
+ set: DATA_ROW_VALUES
566
+ }),
567
+ zod_1.z.strictObject({ op: zod_1.z.literal('delete'), ...DATA_WRITE_TARGET })
568
+ ]);
569
+ const DATA_WRITE_BODY = zod_1.z.strictObject({
570
+ operations: zod_1.z
571
+ .array(DATA_WRITE_OPERATION)
572
+ .min(1)
573
+ .max(dataTypes_1.DATA_MAX_WRITE_OPERATIONS)
574
+ });
575
+ const DATA_ROW_HISTORY_QUERY = zod_1.z.strictObject({
576
+ limit: zod_1.z.coerce.number().int().min(1).max(100).optional(),
577
+ cursor: zod_1.z.coerce.number().int().min(1).optional(),
578
+ timeZone: zod_1.z.string().max(64).optional()
579
+ });
580
+ // A time within the last 30 days, or a bookmark this API handed out (a drop,
581
+ // a type change, or the restore to undo).
582
+ const DATA_RESTORE_POINT_BODY = zod_1.z.union([
583
+ zod_1.z.strictObject({
584
+ timestamp: zod_1.z.union([zod_1.z.iso.datetime({ offset: true }), zod_1.z.number().int()])
585
+ }),
586
+ zod_1.z.strictObject({ bookmark: zod_1.z.string().min(1).max(200) })
587
+ ]);
588
+ // The database's own settings. `timeZone` is an IANA zone (America/Bogota),
589
+ // or null for UTC: datetimes come back in it for callers that send none.
590
+ const DATA_DATABASE_PATCH = zod_1.z.strictObject({
591
+ timeZone: zod_1.z
592
+ .string()
593
+ .max(100)
594
+ .refine(zone => {
595
+ try {
596
+ new Intl.DateTimeFormat('en-US', { timeZone: zone });
597
+ return true;
598
+ }
599
+ catch {
600
+ return false;
601
+ }
602
+ }, 'Use an IANA time zone, such as America/Bogota.')
603
+ .nullable()
604
+ });
605
+ const DATA_EXPORT_BODY = zod_1.z.strictObject({
606
+ format: zod_1.z.enum(['jsonl', 'csv']).optional()
607
+ });
608
+ const DATA_EXPORT_QUERY = zod_1.z.strictObject({
609
+ exportId: zod_1.z.uuid().optional()
610
+ });
611
+ // Without `table`, the export's schema.json.
612
+ const DATA_EXPORT_FILE_QUERY = zod_1.z.strictObject({
613
+ exportId: zod_1.z.uuid(),
614
+ table: DATA_IDENTIFIER.optional()
615
+ });
616
+ const DATA_CHANGE_LIST_QUERY = zod_1.z.strictObject({
617
+ limit: zod_1.z.coerce.number().int().min(1).max(100).optional(),
618
+ cursor: zod_1.z.uuid().optional()
619
+ });
620
+ // Named queries: a SELECT the owner writes once, with named parameters
621
+ // (`:from`), checked to only read when it is saved.
622
+ const DATA_QUERY_PARAM = zod_1.z.strictObject({
623
+ name: DATA_IDENTIFIER,
624
+ type: zod_1.z.enum(['text', 'integer', 'decimal', 'boolean', 'date', 'datetime']),
625
+ description: zod_1.z.string().max(300).nullish(),
626
+ required: zod_1.z.boolean().optional()
627
+ });
628
+ const DATA_QUERY_INPUT = zod_1.z.strictObject({
629
+ name: DATA_IDENTIFIER,
630
+ description: zod_1.z.string().max(300).nullish(),
631
+ sql: zod_1.z.string().min(1).max(10_000),
632
+ params: zod_1.z.array(DATA_QUERY_PARAM).max(20).optional(),
633
+ // Channel bots may run it from data-query.
634
+ assistant: zod_1.z.boolean().optional()
635
+ });
636
+ const DATA_QUERY_RUN_BODY = zod_1.z.strictObject({
637
+ params: zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()).optional(),
638
+ limit: zod_1.z.number().int().min(1).max(500).optional(),
639
+ timeZone: zod_1.z.string().max(100).optional()
640
+ });
641
+ const DATA_TABLE_PARAMS = DATA_DATABASE_GET.extend({ table: DATA_IDENTIFIER });
642
+ const DATA_COLUMN_PARAMS = DATA_TABLE_PARAMS.extend({
643
+ column: DATA_IDENTIFIER
644
+ });
645
+ const DATA_ROW_PARAMS = DATA_TABLE_PARAMS.extend({ id: DATA_ROW_ID });
646
+ const DATA_QUERY_PATH_PARAMS = DATA_DATABASE_GET.extend({ name: DATA_IDENTIFIER });
430
647
  const ARTIFACT_UPLOAD_RESOURCE_FILE = zod_1.z.object({
431
648
  resourceId: zod_1.z.uuid(),
432
649
  projectId: zod_1.z.uuid(),
@@ -975,7 +1192,17 @@ const CUSTOM_CODE_TOOL = zod_1.z.object({
975
1192
  description: zod_1.z.string().max(2000).optional(),
976
1193
  inputSchema: SCHEMA_DEFINITION.default({ type: 'object', properties: {} }),
977
1194
  outputSchema: SCHEMA_DEFINITION.optional(),
978
- annotations: TOOL_ANNOTATIONS.optional()
1195
+ annotations: TOOL_ANNOTATIONS.optional(),
1196
+ // What this function may do through ctx.data. Absent means everything: it
1197
+ // is the owner's code. Narrowing matters most for a function a channel bot
1198
+ // calls after reading customer text, and the broker enforces it, since
1199
+ // anything in the script can be edited.
1200
+ data: zod_1.z
1201
+ .strictObject({
1202
+ access: zod_1.z.enum(['read', 'write']).optional(),
1203
+ tables: zod_1.z.array(zod_1.z.string().min(1).max(63)).max(50).optional()
1204
+ })
1205
+ .optional()
979
1206
  });
980
1207
  // The manifest a `ganju deploy` (or the dashboard) uploads alongside a bundle.
981
1208
  // Names must be unique within one script: apps/mcp registers them into a single
@@ -1201,6 +1428,15 @@ const CUSTOM_CODE_BROKER_SECRET = zod_1.z.object({
1201
1428
  // (they carry no id inside the script). See CREDENTIAL_PROVIDER_CUSTOM_CODE.
1202
1429
  name: zod_1.z.string().min(1).max(200)
1203
1430
  });
1431
+ // One ctx.data call. `call` is the token the dispatcher signed for the
1432
+ // function being run, which the script hands back: the broker reads the
1433
+ // function's name from it, never from the script, and applies that
1434
+ // function's `data` narrowing.
1435
+ const CUSTOM_CODE_BROKER_DATA = zod_1.z.object({
1436
+ call: zod_1.z.string().min(1).max(4000),
1437
+ op: zod_1.z.enum(['describe', 'query', 'write', 'run']),
1438
+ args: zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()).default({})
1439
+ });
1204
1440
  const CUSTOM_CODE_BROKER_RESOURCE_SEARCH = zod_1.z.object({
1205
1441
  query: zod_1.z.string().min(1).max(2000),
1206
1442
  limit: zod_1.z.number().int().positive().max(20).default(5)
@@ -1505,6 +1741,36 @@ exports.Schema = {
1505
1741
  ARTIFACT_UPDATE_RESOURCE_VIEW,
1506
1742
  ARTIFACT_GET_RESOURCE,
1507
1743
  ARTIFACT_GET_RESOURCE_BY_ID,
1744
+ DATA_DATABASE_GET,
1745
+ DATA_DATABASE_CREATE,
1746
+ DATA_DATABASE_DELETE,
1747
+ DATA_COLUMN_INPUT,
1748
+ DATA_TABLE_INPUT,
1749
+ DATA_TABLE_PATCH,
1750
+ DATA_COLUMN_PATCH,
1751
+ DATA_TABLE_DROP_BODY,
1752
+ DATA_ROW_LIST_QUERY,
1753
+ DATA_ROW_GET_QUERY,
1754
+ DATA_ROW_CREATE_BODY,
1755
+ DATA_ROW_UPDATE_BODY,
1756
+ DATA_ROW_DELETE_BODY,
1757
+ DATA_DELETE_PREVIEW_BODY,
1758
+ DATA_WRITE_OPERATION,
1759
+ DATA_WRITE_BODY,
1760
+ DATA_ROW_HISTORY_QUERY,
1761
+ DATA_RESTORE_POINT_BODY,
1762
+ DATA_EXPORT_BODY,
1763
+ DATA_EXPORT_QUERY,
1764
+ DATA_EXPORT_FILE_QUERY,
1765
+ DATA_CHANGE_LIST_QUERY,
1766
+ DATA_TABLE_PARAMS,
1767
+ DATA_DATABASE_PATCH,
1768
+ DATA_QUERY_PARAM,
1769
+ DATA_QUERY_INPUT,
1770
+ DATA_QUERY_RUN_BODY,
1771
+ DATA_QUERY_PATH_PARAMS,
1772
+ DATA_COLUMN_PARAMS,
1773
+ DATA_ROW_PARAMS,
1508
1774
  ARTIFACT_REMOVE_RESOURCE,
1509
1775
  ARTIFACT_UPLOAD_RESOURCE_FILE,
1510
1776
  ARTIFACT_DOWNLOAD_RESOURCE_FILE,
@@ -1566,6 +1832,7 @@ exports.Schema = {
1566
1832
  CUSTOM_CODE_INVOKE_RESPONSE,
1567
1833
  CUSTOM_CODE_BROKER_CONNECTION,
1568
1834
  CUSTOM_CODE_BROKER_SECRET,
1835
+ CUSTOM_CODE_BROKER_DATA,
1569
1836
  CUSTOM_CODE_BROKER_RESOURCE_SEARCH,
1570
1837
  CUSTOM_CODE_BROKER_RESOURCE_READ,
1571
1838
  CUSTOM_CODE_BROKER_RESOURCE_CREATE,
@@ -9,6 +9,7 @@ export declare const CUSTOM_CODE_BROKER_PATH_RESOURCES_LIST = "/resources/list";
9
9
  export declare const CUSTOM_CODE_BROKER_PATH_RESOURCES_CREATE = "/resources/create";
10
10
  export declare const CUSTOM_CODE_BROKER_PATH_RESOURCES_DELETE = "/resources/delete";
11
11
  export declare const CUSTOM_CODE_BROKER_PATH_SEND_FILE = "/send-file";
12
+ export declare const CUSTOM_CODE_BROKER_PATH_DATA = "/data";
12
13
  export declare const CUSTOM_CODE_BINDING_VERSION = "GANJU_SCRIPT_VERSION";
13
14
  export declare const CUSTOM_CODE_HEALTH_TOOL = "__ganju_health";
14
15
  export declare const CUSTOM_CODE_MAX_LOGS = 50;
@@ -1 +1 @@
1
- {"version":3,"file":"sdkConstants.d.ts","sourceRoot":"","sources":["../src/sdkConstants.ts"],"names":[],"mappings":"AAgBA,eAAO,MAAM,yBAAyB,qBAAqB,CAAC;AAC5D,eAAO,MAAM,0BAA0B,iBAAiB,CAAC;AAKzD,eAAO,MAAM,yBAAyB,kCAAkC,CAAC;AACzE,eAAO,MAAM,kCAAkC,gBAAgB,CAAC;AAChE,eAAO,MAAM,8BAA8B,YAAY,CAAC;AACxD,eAAO,MAAM,wCAAwC,sBAAsB,CAAC;AAC5E,eAAO,MAAM,sCAAsC,oBAAoB,CAAC;AACxE,eAAO,MAAM,sCAAsC,oBAAoB,CAAC;AACxE,eAAO,MAAM,wCAAwC,sBAAsB,CAAC;AAC5E,eAAO,MAAM,wCAAwC,sBAAsB,CAAC;AAC5E,eAAO,MAAM,iCAAiC,eAAe,CAAC;AAY9D,eAAO,MAAM,2BAA2B,yBAAyB,CAAC;AAOlE,eAAO,MAAM,uBAAuB,mBAAmB,CAAC;AAKxD,eAAO,MAAM,oBAAoB,KAAK,CAAC;AACvC,eAAO,MAAM,0BAA0B,OAAQ,CAAC"}
1
+ {"version":3,"file":"sdkConstants.d.ts","sourceRoot":"","sources":["../src/sdkConstants.ts"],"names":[],"mappings":"AAgBA,eAAO,MAAM,yBAAyB,qBAAqB,CAAC;AAC5D,eAAO,MAAM,0BAA0B,iBAAiB,CAAC;AAKzD,eAAO,MAAM,yBAAyB,kCAAkC,CAAC;AACzE,eAAO,MAAM,kCAAkC,gBAAgB,CAAC;AAChE,eAAO,MAAM,8BAA8B,YAAY,CAAC;AACxD,eAAO,MAAM,wCAAwC,sBAAsB,CAAC;AAC5E,eAAO,MAAM,sCAAsC,oBAAoB,CAAC;AACxE,eAAO,MAAM,sCAAsC,oBAAoB,CAAC;AACxE,eAAO,MAAM,wCAAwC,sBAAsB,CAAC;AAC5E,eAAO,MAAM,wCAAwC,sBAAsB,CAAC;AAC5E,eAAO,MAAM,iCAAiC,eAAe,CAAC;AAC9D,eAAO,MAAM,4BAA4B,UAAU,CAAC;AAYpD,eAAO,MAAM,2BAA2B,yBAAyB,CAAC;AAOlE,eAAO,MAAM,uBAAuB,mBAAmB,CAAC;AAKxD,eAAO,MAAM,oBAAoB,KAAK,CAAC;AACvC,eAAO,MAAM,0BAA0B,OAAQ,CAAC"}
@@ -11,7 +11,7 @@
11
11
  // The rule for this file: nothing lands here unless the SDK reads it at runtime,
12
12
  // and it imports nothing.
13
13
  Object.defineProperty(exports, "__esModule", { value: true });
14
- exports.CUSTOM_CODE_MAX_LOG_LENGTH = exports.CUSTOM_CODE_MAX_LOGS = exports.CUSTOM_CODE_HEALTH_TOOL = exports.CUSTOM_CODE_BINDING_VERSION = exports.CUSTOM_CODE_BROKER_PATH_SEND_FILE = exports.CUSTOM_CODE_BROKER_PATH_RESOURCES_DELETE = exports.CUSTOM_CODE_BROKER_PATH_RESOURCES_CREATE = exports.CUSTOM_CODE_BROKER_PATH_RESOURCES_LIST = exports.CUSTOM_CODE_BROKER_PATH_RESOURCES_READ = exports.CUSTOM_CODE_BROKER_PATH_RESOURCES_SEARCH = exports.CUSTOM_CODE_BROKER_PATH_SECRET = exports.CUSTOM_CODE_BROKER_PATH_CONNECTION = exports.CUSTOM_CODE_BROKER_ORIGIN = exports.CUSTOM_CODE_BINDING_BROKER = exports.CUSTOM_CODE_BINDING_TOKEN = void 0;
14
+ exports.CUSTOM_CODE_MAX_LOG_LENGTH = exports.CUSTOM_CODE_MAX_LOGS = exports.CUSTOM_CODE_HEALTH_TOOL = exports.CUSTOM_CODE_BINDING_VERSION = exports.CUSTOM_CODE_BROKER_PATH_DATA = exports.CUSTOM_CODE_BROKER_PATH_SEND_FILE = exports.CUSTOM_CODE_BROKER_PATH_RESOURCES_DELETE = exports.CUSTOM_CODE_BROKER_PATH_RESOURCES_CREATE = exports.CUSTOM_CODE_BROKER_PATH_RESOURCES_LIST = exports.CUSTOM_CODE_BROKER_PATH_RESOURCES_READ = exports.CUSTOM_CODE_BROKER_PATH_RESOURCES_SEARCH = exports.CUSTOM_CODE_BROKER_PATH_SECRET = exports.CUSTOM_CODE_BROKER_PATH_CONNECTION = exports.CUSTOM_CODE_BROKER_ORIGIN = exports.CUSTOM_CODE_BINDING_BROKER = exports.CUSTOM_CODE_BINDING_TOKEN = void 0;
15
15
  // Bindings injected into every user script at upload time. The token is a
16
16
  // secret_text binding rotated on each publish; the broker is a service binding.
17
17
  // Names are part of the SDK's contract with the script, so they can't be
@@ -30,6 +30,7 @@ exports.CUSTOM_CODE_BROKER_PATH_RESOURCES_LIST = '/resources/list';
30
30
  exports.CUSTOM_CODE_BROKER_PATH_RESOURCES_CREATE = '/resources/create';
31
31
  exports.CUSTOM_CODE_BROKER_PATH_RESOURCES_DELETE = '/resources/delete';
32
32
  exports.CUSTOM_CODE_BROKER_PATH_SEND_FILE = '/send-file';
33
+ exports.CUSTOM_CODE_BROKER_PATH_DATA = '/data';
33
34
  // Injected at upload time and echoed back by the health probe below. Uploading a
34
35
  // script into the dispatch namespace is not read-your-writes: dispatching to the
35
36
  // name immediately afterwards can still reach the previous edition. Tool names
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ganju/utils",
3
- "version": "0.0.15",
3
+ "version": "0.0.17",
4
4
  "description": "Shared constants, schemas and helpers for Ganju",
5
5
  "license": "Apache-2.0",
6
6
  "author": "MontoyaAndres <andresmontoyafcb@gmail.com>",
@@ -62,11 +62,26 @@
62
62
  "types": "./dist/sdkConstants.d.ts",
63
63
  "import": "./dist/sdkConstants.js",
64
64
  "require": "./dist/sdkConstants.js"
65
+ },
66
+ "./data": {
67
+ "types": "./dist/data.d.ts",
68
+ "import": "./dist/data.js",
69
+ "require": "./dist/data.js"
70
+ },
71
+ "./dataApi": {
72
+ "types": "./dist/dataApi.d.ts",
73
+ "import": "./dist/dataApi.js",
74
+ "require": "./dist/dataApi.js"
75
+ },
76
+ "./dataImport": {
77
+ "types": "./dist/dataImport.d.ts",
78
+ "import": "./dist/dataImport.js",
79
+ "require": "./dist/dataImport.js"
65
80
  }
66
81
  },
67
82
  "scripts": {
68
83
  "build": "tsc",
69
- "test": "node --import ./test/resolveSourceImports.mjs --test --disable-warning=MODULE_TYPELESS_PACKAGE_JSON 'test/**/*.test.ts'",
84
+ "test": "TZ=UTC node --import ./test/resolveSourceImports.mjs --test --disable-warning=MODULE_TYPELESS_PACKAGE_JSON 'test/**/*.test.ts'",
70
85
  "prepublishOnly": "npm run build",
71
86
  "clean": "rm -rf dist && rm -rf node_modules"
72
87
  },
package/src/constants.ts CHANGED
@@ -22,6 +22,7 @@ import {
22
22
  CUSTOM_CODE_BROKER_PATH_RESOURCES_CREATE,
23
23
  CUSTOM_CODE_BROKER_PATH_RESOURCES_DELETE,
24
24
  CUSTOM_CODE_BROKER_PATH_SEND_FILE,
25
+ CUSTOM_CODE_BROKER_PATH_DATA,
25
26
  CUSTOM_CODE_HEALTH_TOOL,
26
27
  CUSTOM_CODE_MAX_LOGS,
27
28
  CUSTOM_CODE_MAX_LOG_LENGTH
@@ -144,6 +145,11 @@ const OAUTH_TOKEN_URLS: Record<string, string> = {
144
145
  // MCP-proxy OAuth, in both apps/api and apps/mcp).
145
146
  const CREDENTIAL_REFRESH_BUFFER_MS = 60 * 1000;
146
147
 
148
+ // A refresh the token endpoint rejects (4xx) without a reauth code still flags
149
+ // the credential once its access token has been expired this long, so the
150
+ // owner sees it as expired instead of every call failing behind "Connected".
151
+ const CREDENTIAL_REFRESH_GIVE_UP_MS = 60 * 60 * 1000;
152
+
147
153
  const GOOGLE_CALENDAR_API_BASE = 'https://www.googleapis.com/calendar/v3';
148
154
 
149
155
  const GOOGLE_DRIVE_API_BASE = 'https://www.googleapis.com/drive/v3';
@@ -228,7 +234,18 @@ const ONE_DRIVE_TAB_LABELS: ReadonlyArray<{
228
234
  { value: ONE_DRIVE_TAB_DRIVES, label: ONE_DRIVE_TAB_LABEL_DRIVES }
229
235
  ];
230
236
 
231
- const REAUTH_ERROR_CODES = ['invalid_grant', 'invalid_token'];
237
+ // Token-endpoint error codes that mean the stored refresh token is dead and
238
+ // only a reconnect brings it back. `unauthorized_client` is Google's answer
239
+ // when a token no longer belongs to the app it is refreshed with.
240
+ const REAUTH_ERROR_CODES = [
241
+ 'invalid_grant',
242
+ 'invalid_token',
243
+ 'unauthorized_client'
244
+ ];
245
+
246
+ // Token-endpoint error codes that are about our own client id / secret, not
247
+ // the user's token: a reconnect can't fix them, so they never flag one.
248
+ const OAUTH_CLIENT_ERROR_CODES = ['invalid_client'];
232
249
 
233
250
  const RESOURCE_TYPE_TOOLTIP_MIN_WIDTH = 300;
234
251
 
@@ -992,10 +1009,14 @@ const RESOURCE_SEARCH_RRF_K = 60;
992
1009
  // keeps its words.
993
1010
  const RESOURCE_SEARCH_COMMON_TERM_DIVISOR = 10;
994
1011
  const RESOURCE_SEARCH_COMMON_TERM_MIN = 5;
995
- // Second stage, on wherever the Worker has an AI binding: the top fused
996
- // candidates are re-scored by a cross-encoder, which reads query and chunk
997
- // together instead of comparing two independently computed vectors. One model
998
- // call per search; a failure falls back to the fused order.
1012
+ // Second stage: the top fused candidates re-scored by a cross-encoder, which
1013
+ // reads query and chunk together instead of comparing two independently
1014
+ // computed vectors. One model call per search; a failure falls back to the
1015
+ // fused order. Off by default: on the golden sets (Spanish and English) the
1016
+ // fused order matched or beat it on every set — 10 cases better, 5 worse — and
1017
+ // it added 0.5–0.9 s a search plus a ~6 s cold start. The search eval can
1018
+ // still turn it on per request to re-measure.
1019
+ const RESOURCE_SEARCH_RERANK_ENABLED = false;
999
1020
  const RESOURCE_SEARCH_RERANK_CANDIDATES = 30;
1000
1021
  const RESOURCE_SEARCH_RERANK_MODEL = '@cf/baai/bge-reranker-base';
1001
1022
  // An identifier in the query (a code mixing letters and digits, a snake_case
@@ -1554,7 +1575,10 @@ const RESERVED_TOOL_NAME_PREFIXES = [
1554
1575
  'slack-',
1555
1576
  CALENDAR_TOOL_KEY_PREFIX,
1556
1577
  CALCOM_TOOL_KEY_PREFIX,
1557
- WEB_TOOL_KEY_PREFIX
1578
+ WEB_TOOL_KEY_PREFIX,
1579
+ // data-describe, data-query, data-write and data-admin, registered for a
1580
+ // project with a database.
1581
+ 'data-'
1558
1582
  ];
1559
1583
 
1560
1584
  // The keys that don't belong to a prefixed group: the RAG core the channel
@@ -1834,6 +1858,10 @@ const MCP_AUTH_KINDS = [MCP_AUTH_KIND_JWT, MCP_AUTH_KIND_INTERNAL];
1834
1858
  const MCP_SESSION_HEADER = 'mcp-session-id';
1835
1859
 
1836
1860
  const MCP_INTERNAL_HEADER = 'x-ganju-internal-secret';
1861
+ // Sent with the internal secret by the search eval to measure the reranker:
1862
+ // `on` or `off` overrides RESOURCE_SEARCH_RERANK_ENABLED for that request.
1863
+ // Ignored on any other request.
1864
+ const MCP_EVAL_RERANK_HEADER = 'x-ganju-eval-rerank';
1837
1865
  const MCP_CHANNEL_ID_HEADER = 'x-ganju-channel-id';
1838
1866
  const MCP_CHANNEL_PLATFORM_HEADER = 'x-ganju-channel-platform';
1839
1867
  // The conversation a channel turn belongs to. The MCP worker files that turn's
@@ -1841,6 +1869,11 @@ const MCP_CHANNEL_PLATFORM_HEADER = 'x-ganju-channel-platform';
1841
1869
  // the chat it ran in.
1842
1870
  const MCP_CHANNEL_CONVERSATION_HEADER = 'x-ganju-channel-conversation-id';
1843
1871
  const MCP_CHANNEL_CLIENT_USER_AGENT = 'ganju-channel/0.0.1';
1872
+ // The participant a channel turn is for: customer-scoped tables fill and
1873
+ // filter their rows with it. Trusted only on the channel's own auth paths.
1874
+ const MCP_CHANNEL_PARTICIPANT_HEADER = 'x-ganju-channel-participant-id';
1875
+ // The zone the channel resolves dates in; the data tools answer in it.
1876
+ const MCP_CHANNEL_TIME_ZONE_HEADER = 'x-ganju-channel-time-zone';
1844
1877
  const JWKS_KV_KEY = 'jwks:v1';
1845
1878
  const JWKS_TTL_SECONDS = 600;
1846
1879
 
@@ -2127,6 +2160,40 @@ const PRICING_TOOL_CALL_PER_M_USD = 5;
2127
2160
  const PRICING_TOOL_CALL_HARD_CAP = 20_000_000;
2128
2161
  const PRICING_CUSTOM_DOMAIN_USD = 15;
2129
2162
 
2163
+ // Project data (one SQLite Durable Object per artifact). Cloudflare caps a
2164
+ // database at 10 GB; we stop writes that add data at 9 GB so there is room to
2165
+ // delete, archive and export.
2166
+ const DATA_MAX_DATABASE_BYTES = 9 * GB;
2167
+ const DATA_MAX_TABLES_PER_DATABASE = 50;
2168
+ const DATA_TRIGGER_RUN_HARD_CAP = 5_000_000;
2169
+ // A deleted database can be restored for this long before its storage is
2170
+ // freed.
2171
+ const DATA_DELETE_GRACE_DAYS = 7;
2172
+ const ARTIFACT_DATABASE_STATUS_CREATING = 'CREATING' as 'CREATING';
2173
+ const ARTIFACT_DATABASE_STATUS_READY = 'READY' as 'READY';
2174
+ const ARTIFACT_DATABASE_STATUS_FAILED = 'FAILED' as 'FAILED';
2175
+ const ARTIFACT_DATABASE_STATUS_DELETING = 'DELETING' as 'DELETING';
2176
+ // The hourly purge has claimed the row and is emptying the object; a restore
2177
+ // can no longer take it back.
2178
+ const ARTIFACT_DATABASE_STATUS_PURGING = 'PURGING' as 'PURGING';
2179
+ const ARTIFACT_DATABASE_STATUS_DELETED = 'DELETED' as 'DELETED';
2180
+ const ARTIFACT_DATABASE_STATUSES = [
2181
+ ARTIFACT_DATABASE_STATUS_CREATING,
2182
+ ARTIFACT_DATABASE_STATUS_READY,
2183
+ ARTIFACT_DATABASE_STATUS_FAILED,
2184
+ ARTIFACT_DATABASE_STATUS_DELETING,
2185
+ ARTIFACT_DATABASE_STATUS_PURGING,
2186
+ ARTIFACT_DATABASE_STATUS_DELETED
2187
+ ];
2188
+ // A purge that claimed a row and never finished (the Worker died) is picked
2189
+ // up again after this long.
2190
+ const DATA_PURGE_STALE_MS = 60 * 60 * 1000;
2191
+ // Rows purged per hourly run: each is a call to its database object.
2192
+ const DATA_PURGE_BATCH = 20;
2193
+ // last_read_at / last_write_at move at most this often, so they aren't a
2194
+ // Postgres write per query.
2195
+ const DATA_ACTIVITY_THROTTLE_MS = 60 * 60 * 1000;
2196
+
2130
2197
  interface PlanLimits {
2131
2198
  // null on any field means "no hard limit" for that plan.
2132
2199
  maxProjects: number | null;
@@ -2192,6 +2259,16 @@ interface PlanLimits {
2192
2259
  autoSyncIntervals: ReadonlyArray<
2193
2260
  typeof RESOURCE_SYNC_INTERVAL_DAILY | typeof RESOURCE_SYNC_INTERVAL_WEEKLY
2194
2261
  >;
2262
+ // Whether a project may create a database (tables and rows). Paid-only: the
2263
+ // rows live in a Durable Object we pay storage and rows for. An org that
2264
+ // downgrades keeps its databases, read-only.
2265
+ canUseData: boolean;
2266
+ // Writes that add data stop here, under Cloudflare's 10 GB per database, so
2267
+ // the owner meets a readable "database full" rather than SQLITE_FULL.
2268
+ maxDataBytes: number | null;
2269
+ maxDataTablesPerDatabase: number | null;
2270
+ // Abuse backstop on data trigger runs a month. `null` = no backstop.
2271
+ triggerRunHardCap: number | null;
2195
2272
  }
2196
2273
 
2197
2274
  const PLAN_LIMITS: Record<
@@ -2232,7 +2309,11 @@ const PLAN_LIMITS: Record<
2232
2309
  toolCallHardCap: 10_000,
2233
2310
  includedMessages: 100,
2234
2311
  includedEmbeddedBytes: 5 * MB,
2235
- autoSyncIntervals: []
2312
+ autoSyncIntervals: [],
2313
+ canUseData: false,
2314
+ maxDataBytes: null,
2315
+ maxDataTablesPerDatabase: null,
2316
+ triggerRunHardCap: 0
2236
2317
  },
2237
2318
  PRO: {
2238
2319
  maxProjects: null,
@@ -2259,7 +2340,11 @@ const PLAN_LIMITS: Record<
2259
2340
  autoSyncIntervals: [
2260
2341
  RESOURCE_SYNC_INTERVAL_DAILY,
2261
2342
  RESOURCE_SYNC_INTERVAL_WEEKLY
2262
- ]
2343
+ ],
2344
+ canUseData: true,
2345
+ maxDataBytes: DATA_MAX_DATABASE_BYTES,
2346
+ maxDataTablesPerDatabase: DATA_MAX_TABLES_PER_DATABASE,
2347
+ triggerRunHardCap: DATA_TRIGGER_RUN_HARD_CAP
2263
2348
  },
2264
2349
  ENTERPRISE: {
2265
2350
  maxProjects: null,
@@ -2286,7 +2371,11 @@ const PLAN_LIMITS: Record<
2286
2371
  autoSyncIntervals: [
2287
2372
  RESOURCE_SYNC_INTERVAL_DAILY,
2288
2373
  RESOURCE_SYNC_INTERVAL_WEEKLY
2289
- ]
2374
+ ],
2375
+ canUseData: true,
2376
+ maxDataBytes: DATA_MAX_DATABASE_BYTES,
2377
+ maxDataTablesPerDatabase: DATA_MAX_TABLES_PER_DATABASE,
2378
+ triggerRunHardCap: null
2290
2379
  }
2291
2380
  };
2292
2381
 
@@ -2306,6 +2395,7 @@ const PLAN_FEATURE_EMBEDDED_STORAGE = 'embeddedStorage' as 'embeddedStorage';
2306
2395
  const PLAN_FEATURE_MESSAGE = 'message' as 'message';
2307
2396
  const PLAN_FEATURE_TOOL_CALL = 'toolCall' as 'toolCall';
2308
2397
  const PLAN_FEATURE_RESOURCE_SYNC = 'resourceSync' as 'resourceSync';
2398
+ const PLAN_FEATURE_DATA = 'data' as 'data';
2309
2399
 
2310
2400
  // Stable code returned on a quota block so clients can branch on it (402).
2311
2401
  const PLAN_LIMIT_ERROR_CODE = 'PLAN_LIMIT_EXCEEDED';
@@ -2475,6 +2565,20 @@ export const constants = {
2475
2565
  PRICING_TOOL_CALL_PER_M_USD,
2476
2566
  PRICING_TOOL_CALL_HARD_CAP,
2477
2567
  PRICING_CUSTOM_DOMAIN_USD,
2568
+ DATA_MAX_DATABASE_BYTES,
2569
+ DATA_MAX_TABLES_PER_DATABASE,
2570
+ DATA_TRIGGER_RUN_HARD_CAP,
2571
+ DATA_DELETE_GRACE_DAYS,
2572
+ DATA_PURGE_BATCH,
2573
+ DATA_ACTIVITY_THROTTLE_MS,
2574
+ ARTIFACT_DATABASE_STATUS_CREATING,
2575
+ ARTIFACT_DATABASE_STATUS_READY,
2576
+ ARTIFACT_DATABASE_STATUS_FAILED,
2577
+ ARTIFACT_DATABASE_STATUS_DELETING,
2578
+ ARTIFACT_DATABASE_STATUS_PURGING,
2579
+ ARTIFACT_DATABASE_STATUS_DELETED,
2580
+ DATA_PURGE_STALE_MS,
2581
+ ARTIFACT_DATABASE_STATUSES,
2478
2582
  PLAN_FEATURE_ORGANIZATION,
2479
2583
  PLAN_FEATURE_PROJECT,
2480
2584
  PLAN_FEATURE_TOOL,
@@ -2489,6 +2593,7 @@ export const constants = {
2489
2593
  PLAN_FEATURE_MESSAGE,
2490
2594
  PLAN_FEATURE_TOOL_CALL,
2491
2595
  PLAN_FEATURE_RESOURCE_SYNC,
2596
+ PLAN_FEATURE_DATA,
2492
2597
  PLAN_LIMIT_ERROR_CODE,
2493
2598
  BILLING_METER_MESSAGES,
2494
2599
  BILLING_METER_SHARED_MESSAGES,
@@ -2577,6 +2682,7 @@ export const constants = {
2577
2682
  SLACK_OAUTH_TOKEN_URL,
2578
2683
  OAUTH_TOKEN_URLS,
2579
2684
  CREDENTIAL_REFRESH_BUFFER_MS,
2685
+ CREDENTIAL_REFRESH_GIVE_UP_MS,
2580
2686
  GOOGLE_CALENDAR_API_BASE,
2581
2687
  GOOGLE_DRIVE_API_BASE,
2582
2688
  GOOGLE_DRIVE_DEFAULT_PAGE_SIZE,
@@ -2612,6 +2718,7 @@ export const constants = {
2612
2718
  ONE_DRIVE_TAB_LABEL_DRIVES,
2613
2719
  ONE_DRIVE_TAB_LABELS,
2614
2720
  REAUTH_ERROR_CODES,
2721
+ OAUTH_CLIENT_ERROR_CODES,
2615
2722
  RESOURCE_TYPE_TOOLTIP_MIN_WIDTH,
2616
2723
  SEARCH_DEBOUNCE_MS,
2617
2724
  GOOGLE_DRIVE_EXPORT_MIME_TYPES,
@@ -2840,6 +2947,7 @@ export const constants = {
2840
2947
  RESOURCE_SEARCH_RRF_K,
2841
2948
  RESOURCE_SEARCH_COMMON_TERM_DIVISOR,
2842
2949
  RESOURCE_SEARCH_COMMON_TERM_MIN,
2950
+ RESOURCE_SEARCH_RERANK_ENABLED,
2843
2951
  RESOURCE_SEARCH_RERANK_CANDIDATES,
2844
2952
  RESOURCE_SEARCH_RERANK_MODEL,
2845
2953
  RESOURCE_SEARCH_EXACT_MAX_RESOURCES,
@@ -2988,6 +3096,7 @@ export const constants = {
2988
3096
  CUSTOM_CODE_BROKER_PATH_RESOURCES_CREATE,
2989
3097
  CUSTOM_CODE_BROKER_PATH_RESOURCES_DELETE,
2990
3098
  CUSTOM_CODE_BROKER_PATH_SEND_FILE,
3099
+ CUSTOM_CODE_BROKER_PATH_DATA,
2991
3100
  CUSTOM_CODE_OUTBOUND_PARAM_ARTIFACT_ID,
2992
3101
  CUSTOM_CODE_OUTBOUND_PARAM_ALLOWED_HOSTS,
2993
3102
  CUSTOM_CODE_PLATFORM_HOSTS,
@@ -3025,10 +3134,13 @@ export const constants = {
3025
3134
  CUSTOM_CODE_RESOURCE_FILE_TOO_LARGE_MESSAGE,
3026
3135
  RESERVED_SLUGS,
3027
3136
  MCP_INTERNAL_HEADER,
3137
+ MCP_EVAL_RERANK_HEADER,
3028
3138
  MCP_CHANNEL_ID_HEADER,
3029
3139
  MCP_CHANNEL_PLATFORM_HEADER,
3030
3140
  MCP_CHANNEL_CONVERSATION_HEADER,
3031
3141
  MCP_CHANNEL_CLIENT_USER_AGENT,
3142
+ MCP_CHANNEL_PARTICIPANT_HEADER,
3143
+ MCP_CHANNEL_TIME_ZONE_HEADER,
3032
3144
  MCP_SESSION_HEADER,
3033
3145
  MCP_REQUEST_METHOD_INITIALIZE,
3034
3146
  MCP_REQUEST_METHOD_PING,