@keystrokehq/cli 0.1.5 → 0.1.9

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 (43) hide show
  1. package/README.md +8 -9
  2. package/dist/dist-BPdyQaUt.mjs +19268 -0
  3. package/dist/dist-BPdyQaUt.mjs.map +1 -0
  4. package/dist/dist-Dz6iW5q5.mjs +3 -0
  5. package/dist/{dist-B9XaHV_2.mjs → dist-IOphuHYN.mjs} +57 -20
  6. package/dist/dist-IOphuHYN.mjs.map +1 -0
  7. package/dist/{dist-C3YClLXV.mjs → dist-YV-kApfg.mjs} +790 -73
  8. package/dist/dist-YV-kApfg.mjs.map +1 -0
  9. package/dist/index.mjs +559 -225
  10. package/dist/index.mjs.map +1 -1
  11. package/dist/{maybe-auto-update-DHt-mVf1.mjs → maybe-auto-update-BiR_kXZX.mjs} +2 -2
  12. package/dist/{maybe-auto-update-DHt-mVf1.mjs.map → maybe-auto-update-BiR_kXZX.mjs.map} +1 -1
  13. package/dist/pack-artifact-DVnIKrsg-BtNTTQcz.mjs +112 -0
  14. package/dist/pack-artifact-DVnIKrsg-BtNTTQcz.mjs.map +1 -0
  15. package/dist/skills-bundle/_AGENTS.md +7 -7
  16. package/dist/skills-bundle/skills/keystroke-actions/SKILL.md +39 -7
  17. package/dist/skills-bundle/skills/keystroke-actions/references/catalog-and-imports.md +25 -19
  18. package/dist/skills-bundle/skills/keystroke-agents/SKILL.md +7 -5
  19. package/dist/skills-bundle/skills/keystroke-apps/SKILL.md +133 -0
  20. package/dist/skills-bundle/skills/keystroke-apps/references/cli-and-catalog.md +66 -0
  21. package/dist/skills-bundle/skills/keystroke-cli/SKILL.md +3 -3
  22. package/dist/skills-bundle/skills/keystroke-cli/references/api-targets.md +6 -5
  23. package/dist/skills-bundle/skills/keystroke-deploy/SKILL.md +2 -2
  24. package/dist/skills-bundle/skills/keystroke-files/SKILL.md +6 -5
  25. package/dist/skills-bundle/skills/keystroke-gateways/SKILL.md +2 -2
  26. package/dist/skills-bundle/skills/keystroke-gateways/references/slack-setup.md +1 -1
  27. package/dist/skills-bundle/skills/keystroke-skills/SKILL.md +1 -1
  28. package/dist/skills-bundle/skills/keystroke-workflows/SKILL.md +1 -1
  29. package/dist/skills-bundle/skills/keystroke-workflows/references/authoring.md +2 -2
  30. package/dist/templates/hello-world/.env.example +1 -15
  31. package/dist/templates/hello-world/README.md +1 -1
  32. package/dist/templates/hello-world/package.json +1 -1
  33. package/dist/{version-BOm_5ar9.mjs → version-BGuC7Cpu.mjs} +10 -14
  34. package/dist/version-BGuC7Cpu.mjs.map +1 -0
  35. package/package.json +8 -2
  36. package/dist/dist-B9XaHV_2.mjs.map +0 -1
  37. package/dist/dist-C3YClLXV.mjs.map +0 -1
  38. package/dist/dist-D_-88U7y.mjs +0 -1887
  39. package/dist/dist-D_-88U7y.mjs.map +0 -1
  40. package/dist/dist-iKd6nzBK.mjs +0 -3
  41. package/dist/skills-bundle/skills/keystroke-credentials/SKILL.md +0 -108
  42. package/dist/skills-bundle/skills/keystroke-credentials/references/cli-and-oauth.md +0 -51
  43. package/dist/version-BOm_5ar9.mjs.map +0 -1
@@ -1,6 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/core.js
3
3
  var _a$1;
4
+ /** A special constant with type `never` */
5
+ const NEVER = /* @__PURE__ */ Object.freeze({ status: "aborted" });
4
6
  function $constructor(name, initializer, params) {
5
7
  function init(inst, def) {
6
8
  if (!inst._zod) Object.defineProperty(inst, "_zod", {
@@ -607,6 +609,7 @@ const string$1 = (params) => {
607
609
  const integer = /^-?\d+$/;
608
610
  const number$2 = /^-?\d+(?:\.\d+)?$/;
609
611
  const boolean$1 = /^(?:true|false)$/i;
612
+ const _null$2 = /^null$/i;
610
613
  const lowercase = /^[^A-Z]*$/;
611
614
  const uppercase = /^[^a-z]*$/;
612
615
  //#endregion
@@ -1419,6 +1422,26 @@ const $ZodBoolean = /* @__PURE__ */ $constructor("$ZodBoolean", (inst, def) => {
1419
1422
  return payload;
1420
1423
  };
1421
1424
  });
1425
+ const $ZodNull = /* @__PURE__ */ $constructor("$ZodNull", (inst, def) => {
1426
+ $ZodType.init(inst, def);
1427
+ inst._zod.pattern = _null$2;
1428
+ inst._zod.values = new Set([null]);
1429
+ inst._zod.parse = (payload, _ctx) => {
1430
+ const input = payload.value;
1431
+ if (input === null) return payload;
1432
+ payload.issues.push({
1433
+ expected: "null",
1434
+ code: "invalid_type",
1435
+ input,
1436
+ inst
1437
+ });
1438
+ return payload;
1439
+ };
1440
+ });
1441
+ const $ZodAny = /* @__PURE__ */ $constructor("$ZodAny", (inst, def) => {
1442
+ $ZodType.init(inst, def);
1443
+ inst._zod.parse = (payload) => payload;
1444
+ });
1422
1445
  const $ZodUnknown = /* @__PURE__ */ $constructor("$ZodUnknown", (inst, def) => {
1423
1446
  $ZodType.init(inst, def);
1424
1447
  inst._zod.parse = (payload) => payload;
@@ -2340,6 +2363,9 @@ function handlePipeResult(left, next, ctx) {
2340
2363
  fallback: left.fallback
2341
2364
  }, ctx);
2342
2365
  }
2366
+ const $ZodPreprocess = /* @__PURE__ */ $constructor("$ZodPreprocess", (inst, def) => {
2367
+ $ZodPipe.init(inst, def);
2368
+ });
2343
2369
  const $ZodReadonly = /* @__PURE__ */ $constructor("$ZodReadonly", (inst, def) => {
2344
2370
  $ZodType.init(inst, def);
2345
2371
  defineLazy(inst._zod, "propValues", () => def.innerType._zod.propValues);
@@ -2805,6 +2831,17 @@ function _boolean(Class, params) {
2805
2831
  });
2806
2832
  }
2807
2833
  /* @__NO_SIDE_EFFECTS__ */
2834
+ function _null$1(Class, params) {
2835
+ return new Class({
2836
+ type: "null",
2837
+ ...normalizeParams(params)
2838
+ });
2839
+ }
2840
+ /* @__NO_SIDE_EFFECTS__ */
2841
+ function _any(Class) {
2842
+ return new Class({ type: "any" });
2843
+ }
2844
+ /* @__NO_SIDE_EFFECTS__ */
2808
2845
  function _unknown(Class) {
2809
2846
  return new Class({ type: "unknown" });
2810
2847
  }
@@ -3038,7 +3075,7 @@ function initializeContext(params) {
3038
3075
  external: params?.external ?? void 0
3039
3076
  };
3040
3077
  }
3041
- function process(schema, ctx, _params = {
3078
+ function process$1(schema, ctx, _params = {
3042
3079
  path: [],
3043
3080
  schemaPath: []
3044
3081
  }) {
@@ -3075,7 +3112,7 @@ function process(schema, ctx, _params = {
3075
3112
  const parent = schema._zod.parent;
3076
3113
  if (parent) {
3077
3114
  if (!result.ref) result.ref = parent;
3078
- process(parent, ctx, params);
3115
+ process$1(parent, ctx, params);
3079
3116
  ctx.seen.get(parent).isParent = true;
3080
3117
  }
3081
3118
  }
@@ -3295,7 +3332,7 @@ const createToJSONSchemaMethod = (schema, processors = {}) => (params) => {
3295
3332
  ...params,
3296
3333
  processors
3297
3334
  });
3298
- process(schema, ctx);
3335
+ process$1(schema, ctx);
3299
3336
  extractDefs(ctx, schema);
3300
3337
  return finalize(ctx, schema);
3301
3338
  };
@@ -3307,7 +3344,7 @@ const createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params)
3307
3344
  io,
3308
3345
  processors
3309
3346
  });
3310
- process(schema, ctx);
3347
+ process$1(schema, ctx);
3311
3348
  extractDefs(ctx, schema);
3312
3349
  return finalize(ctx, schema);
3313
3350
  };
@@ -3473,7 +3510,7 @@ const arrayProcessor = (schema, ctx, _json, params) => {
3473
3510
  if (typeof minimum === "number") json.minItems = minimum;
3474
3511
  if (typeof maximum === "number") json.maxItems = maximum;
3475
3512
  json.type = "array";
3476
- json.items = process(def.element, ctx, {
3513
+ json.items = process$1(def.element, ctx, {
3477
3514
  ...params,
3478
3515
  path: [...params.path, "items"]
3479
3516
  });
@@ -3484,7 +3521,7 @@ const objectProcessor = (schema, ctx, _json, params) => {
3484
3521
  json.type = "object";
3485
3522
  json.properties = {};
3486
3523
  const shape = def.shape;
3487
- for (const key in shape) json.properties[key] = process(shape[key], ctx, {
3524
+ for (const key in shape) json.properties[key] = process$1(shape[key], ctx, {
3488
3525
  ...params,
3489
3526
  path: [
3490
3527
  ...params.path,
@@ -3502,7 +3539,7 @@ const objectProcessor = (schema, ctx, _json, params) => {
3502
3539
  if (def.catchall?._zod.def.type === "never") json.additionalProperties = false;
3503
3540
  else if (!def.catchall) {
3504
3541
  if (ctx.io === "output") json.additionalProperties = false;
3505
- } else if (def.catchall) json.additionalProperties = process(def.catchall, ctx, {
3542
+ } else if (def.catchall) json.additionalProperties = process$1(def.catchall, ctx, {
3506
3543
  ...params,
3507
3544
  path: [...params.path, "additionalProperties"]
3508
3545
  });
@@ -3510,7 +3547,7 @@ const objectProcessor = (schema, ctx, _json, params) => {
3510
3547
  const unionProcessor = (schema, ctx, json, params) => {
3511
3548
  const def = schema._zod.def;
3512
3549
  const isExclusive = def.inclusive === false;
3513
- const options = def.options.map((x, i) => process(x, ctx, {
3550
+ const options = def.options.map((x, i) => process$1(x, ctx, {
3514
3551
  ...params,
3515
3552
  path: [
3516
3553
  ...params.path,
@@ -3523,7 +3560,7 @@ const unionProcessor = (schema, ctx, json, params) => {
3523
3560
  };
3524
3561
  const intersectionProcessor = (schema, ctx, json, params) => {
3525
3562
  const def = schema._zod.def;
3526
- const a = process(def.left, ctx, {
3563
+ const a = process$1(def.left, ctx, {
3527
3564
  ...params,
3528
3565
  path: [
3529
3566
  ...params.path,
@@ -3531,7 +3568,7 @@ const intersectionProcessor = (schema, ctx, json, params) => {
3531
3568
  0
3532
3569
  ]
3533
3570
  });
3534
- const b = process(def.right, ctx, {
3571
+ const b = process$1(def.right, ctx, {
3535
3572
  ...params,
3536
3573
  path: [
3537
3574
  ...params.path,
@@ -3548,7 +3585,7 @@ const tupleProcessor = (schema, ctx, _json, params) => {
3548
3585
  json.type = "array";
3549
3586
  const prefixPath = ctx.target === "draft-2020-12" ? "prefixItems" : "items";
3550
3587
  const restPath = ctx.target === "draft-2020-12" ? "items" : ctx.target === "openapi-3.0" ? "items" : "additionalItems";
3551
- const prefixItems = def.items.map((x, i) => process(x, ctx, {
3588
+ const prefixItems = def.items.map((x, i) => process$1(x, ctx, {
3552
3589
  ...params,
3553
3590
  path: [
3554
3591
  ...params.path,
@@ -3556,7 +3593,7 @@ const tupleProcessor = (schema, ctx, _json, params) => {
3556
3593
  i
3557
3594
  ]
3558
3595
  }));
3559
- const rest = def.rest ? process(def.rest, ctx, {
3596
+ const rest = def.rest ? process$1(def.rest, ctx, {
3560
3597
  ...params,
3561
3598
  path: [
3562
3599
  ...params.path,
@@ -3587,7 +3624,7 @@ const recordProcessor = (schema, ctx, _json, params) => {
3587
3624
  const keyType = def.keyType;
3588
3625
  const patterns = keyType._zod.bag?.patterns;
3589
3626
  if (def.mode === "loose" && patterns && patterns.size > 0) {
3590
- const valueSchema = process(def.valueType, ctx, {
3627
+ const valueSchema = process$1(def.valueType, ctx, {
3591
3628
  ...params,
3592
3629
  path: [
3593
3630
  ...params.path,
@@ -3598,11 +3635,11 @@ const recordProcessor = (schema, ctx, _json, params) => {
3598
3635
  json.patternProperties = {};
3599
3636
  for (const pattern of patterns) json.patternProperties[pattern.source] = valueSchema;
3600
3637
  } else {
3601
- if (ctx.target === "draft-07" || ctx.target === "draft-2020-12") json.propertyNames = process(def.keyType, ctx, {
3638
+ if (ctx.target === "draft-07" || ctx.target === "draft-2020-12") json.propertyNames = process$1(def.keyType, ctx, {
3602
3639
  ...params,
3603
3640
  path: [...params.path, "propertyNames"]
3604
3641
  });
3605
- json.additionalProperties = process(def.valueType, ctx, {
3642
+ json.additionalProperties = process$1(def.valueType, ctx, {
3606
3643
  ...params,
3607
3644
  path: [...params.path, "additionalProperties"]
3608
3645
  });
@@ -3615,7 +3652,7 @@ const recordProcessor = (schema, ctx, _json, params) => {
3615
3652
  };
3616
3653
  const nullableProcessor = (schema, ctx, json, params) => {
3617
3654
  const def = schema._zod.def;
3618
- const inner = process(def.innerType, ctx, params);
3655
+ const inner = process$1(def.innerType, ctx, params);
3619
3656
  const seen = ctx.seen.get(schema);
3620
3657
  if (ctx.target === "openapi-3.0") {
3621
3658
  seen.ref = def.innerType;
@@ -3624,27 +3661,27 @@ const nullableProcessor = (schema, ctx, json, params) => {
3624
3661
  };
3625
3662
  const nonoptionalProcessor = (schema, ctx, _json, params) => {
3626
3663
  const def = schema._zod.def;
3627
- process(def.innerType, ctx, params);
3664
+ process$1(def.innerType, ctx, params);
3628
3665
  const seen = ctx.seen.get(schema);
3629
3666
  seen.ref = def.innerType;
3630
3667
  };
3631
3668
  const defaultProcessor = (schema, ctx, json, params) => {
3632
3669
  const def = schema._zod.def;
3633
- process(def.innerType, ctx, params);
3670
+ process$1(def.innerType, ctx, params);
3634
3671
  const seen = ctx.seen.get(schema);
3635
3672
  seen.ref = def.innerType;
3636
3673
  json.default = JSON.parse(JSON.stringify(def.defaultValue));
3637
3674
  };
3638
3675
  const prefaultProcessor = (schema, ctx, json, params) => {
3639
3676
  const def = schema._zod.def;
3640
- process(def.innerType, ctx, params);
3677
+ process$1(def.innerType, ctx, params);
3641
3678
  const seen = ctx.seen.get(schema);
3642
3679
  seen.ref = def.innerType;
3643
3680
  if (ctx.io === "input") json._prefault = JSON.parse(JSON.stringify(def.defaultValue));
3644
3681
  };
3645
3682
  const catchProcessor = (schema, ctx, json, params) => {
3646
3683
  const def = schema._zod.def;
3647
- process(def.innerType, ctx, params);
3684
+ process$1(def.innerType, ctx, params);
3648
3685
  const seen = ctx.seen.get(schema);
3649
3686
  seen.ref = def.innerType;
3650
3687
  let catchValue;
@@ -3659,32 +3696,32 @@ const pipeProcessor = (schema, ctx, _json, params) => {
3659
3696
  const def = schema._zod.def;
3660
3697
  const inIsTransform = def.in._zod.traits.has("$ZodTransform");
3661
3698
  const innerType = ctx.io === "input" ? inIsTransform ? def.out : def.in : def.out;
3662
- process(innerType, ctx, params);
3699
+ process$1(innerType, ctx, params);
3663
3700
  const seen = ctx.seen.get(schema);
3664
3701
  seen.ref = innerType;
3665
3702
  };
3666
3703
  const readonlyProcessor = (schema, ctx, json, params) => {
3667
3704
  const def = schema._zod.def;
3668
- process(def.innerType, ctx, params);
3705
+ process$1(def.innerType, ctx, params);
3669
3706
  const seen = ctx.seen.get(schema);
3670
3707
  seen.ref = def.innerType;
3671
3708
  json.readOnly = true;
3672
3709
  };
3673
3710
  const promiseProcessor = (schema, ctx, _json, params) => {
3674
3711
  const def = schema._zod.def;
3675
- process(def.innerType, ctx, params);
3712
+ process$1(def.innerType, ctx, params);
3676
3713
  const seen = ctx.seen.get(schema);
3677
3714
  seen.ref = def.innerType;
3678
3715
  };
3679
3716
  const optionalProcessor = (schema, ctx, _json, params) => {
3680
3717
  const def = schema._zod.def;
3681
- process(def.innerType, ctx, params);
3718
+ process$1(def.innerType, ctx, params);
3682
3719
  const seen = ctx.seen.get(schema);
3683
3720
  seen.ref = def.innerType;
3684
3721
  };
3685
3722
  const lazyProcessor = (schema, ctx, _json, params) => {
3686
3723
  const innerType = schema._zod.innerType;
3687
- process(innerType, ctx, params);
3724
+ process$1(innerType, ctx, params);
3688
3725
  const seen = ctx.seen.get(schema);
3689
3726
  seen.ref = innerType;
3690
3727
  };
@@ -3739,7 +3776,7 @@ function toJSONSchema(input, params) {
3739
3776
  const defs = {};
3740
3777
  for (const entry of registry._idmap.entries()) {
3741
3778
  const [_, schema] = entry;
3742
- process(schema, ctx);
3779
+ process$1(schema, ctx);
3743
3780
  }
3744
3781
  const schemas = {};
3745
3782
  ctx.external = {
@@ -3759,7 +3796,7 @@ function toJSONSchema(input, params) {
3759
3796
  ...params,
3760
3797
  processors: allProcessors
3761
3798
  });
3762
- process(input, ctx);
3799
+ process$1(input, ctx);
3763
3800
  extractDefs(ctx, input);
3764
3801
  return finalize(ctx, input);
3765
3802
  }
@@ -4247,6 +4284,22 @@ const ZodBoolean = /* @__PURE__ */ $constructor("ZodBoolean", (inst, def) => {
4247
4284
  function boolean(params) {
4248
4285
  return /* @__PURE__ */ _boolean(ZodBoolean, params);
4249
4286
  }
4287
+ const ZodNull = /* @__PURE__ */ $constructor("ZodNull", (inst, def) => {
4288
+ $ZodNull.init(inst, def);
4289
+ ZodType.init(inst, def);
4290
+ inst._zod.processJSONSchema = (ctx, json, params) => nullProcessor(inst, ctx, json, params);
4291
+ });
4292
+ function _null(params) {
4293
+ return /* @__PURE__ */ _null$1(ZodNull, params);
4294
+ }
4295
+ const ZodAny = /* @__PURE__ */ $constructor("ZodAny", (inst, def) => {
4296
+ $ZodAny.init(inst, def);
4297
+ ZodType.init(inst, def);
4298
+ inst._zod.processJSONSchema = (ctx, json, params) => void 0;
4299
+ });
4300
+ function any() {
4301
+ return /* @__PURE__ */ _any(ZodAny);
4302
+ }
4250
4303
  const ZodUnknown = /* @__PURE__ */ $constructor("ZodUnknown", (inst, def) => {
4251
4304
  $ZodUnknown.init(inst, def);
4252
4305
  ZodType.init(inst, def);
@@ -4360,6 +4413,14 @@ function object(shape, params) {
4360
4413
  ...normalizeParams(params)
4361
4414
  });
4362
4415
  }
4416
+ function looseObject(shape, params) {
4417
+ return new ZodObject({
4418
+ type: "object",
4419
+ shape,
4420
+ catchall: unknown(),
4421
+ ...normalizeParams(params)
4422
+ });
4423
+ }
4363
4424
  const ZodUnion = /* @__PURE__ */ $constructor("ZodUnion", (inst, def) => {
4364
4425
  $ZodUnion.init(inst, def);
4365
4426
  ZodType.init(inst, def);
@@ -4632,6 +4693,10 @@ function pipe(in_, out) {
4632
4693
  out
4633
4694
  });
4634
4695
  }
4696
+ const ZodPreprocess = /* @__PURE__ */ $constructor("ZodPreprocess", (inst, def) => {
4697
+ ZodPipe.init(inst, def);
4698
+ $ZodPreprocess.init(inst, def);
4699
+ });
4635
4700
  const ZodReadonly = /* @__PURE__ */ $constructor("ZodReadonly", (inst, def) => {
4636
4701
  $ZodReadonly.init(inst, def);
4637
4702
  ZodType.init(inst, def);
@@ -4670,6 +4735,13 @@ function refine(fn, _params = {}) {
4670
4735
  function superRefine(fn, params) {
4671
4736
  return /* @__PURE__ */ _superRefine(fn, params);
4672
4737
  }
4738
+ function preprocess(fn, schema) {
4739
+ return new ZodPreprocess({
4740
+ type: "pipe",
4741
+ in: transform(fn),
4742
+ out: schema
4743
+ });
4744
+ }
4673
4745
  //#endregion
4674
4746
  //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/coerce.js
4675
4747
  function number(params) {
@@ -5053,6 +5125,7 @@ const LEGAL_TRUST_SLUGS = [
5053
5125
  "compliance",
5054
5126
  "cookie-policy",
5055
5127
  "cookies",
5128
+ "data-use",
5056
5129
  "disclose",
5057
5130
  "dpa",
5058
5131
  "eula",
@@ -5292,6 +5365,7 @@ const OrganizationSchema = object({
5292
5365
  id: string(),
5293
5366
  name: string(),
5294
5367
  slug: OrganizationSlugSchema,
5368
+ verified: boolean(),
5295
5369
  createdAt: isoDateTime$5,
5296
5370
  updatedAt: isoDateTime$5
5297
5371
  });
@@ -5380,6 +5454,15 @@ function listenPortFromPublicUrl(value, fallback) {
5380
5454
  return fallback;
5381
5455
  }
5382
5456
  }
5457
+ const LOCAL_PLATFORM_ORIGIN = "http://localhost:3002";
5458
+ /** Reads `PUBLIC_PLATFORM_URL` when explicitly set. */
5459
+ function resolveExplicitPublicPlatformOrigin(env = process.env) {
5460
+ return env.PUBLIC_PLATFORM_URL?.replace(/\/$/, "") || void 0;
5461
+ }
5462
+ /** `PUBLIC_PLATFORM_URL` origin; falls back to {@link LOCAL_PLATFORM_ORIGIN} when unset. */
5463
+ function resolvePublicPlatformOrigin(env = process.env) {
5464
+ return resolveExplicitPublicPlatformOrigin(env) ?? "http://localhost:3002";
5465
+ }
5383
5466
  /** On-disk path under the project root (packed in deploy artifacts when present). */
5384
5467
  const ROUTE_MANIFEST_REL_PATH = "dist/.keystroke/route-manifest.json";
5385
5468
  const StoredRouteManifestSkillSchema = object({
@@ -5392,6 +5475,10 @@ const attachmentSchemasSchema = record(string(), object({
5392
5475
  requestSchema: record(string(), unknown()),
5393
5476
  filterSchema: record(string(), unknown()).optional()
5394
5477
  }));
5478
+ const attachmentMetaSchema = record(string(), object({
5479
+ name: string().optional(),
5480
+ description: string().optional()
5481
+ }));
5395
5482
  const storedRouteManifestEntryV2Schema = discriminatedUnion("kind", [
5396
5483
  object({ kind: literal("health") }),
5397
5484
  object({
@@ -5403,7 +5490,9 @@ const storedRouteManifestEntryV2Schema = discriminatedUnion("kind", [
5403
5490
  model: string(),
5404
5491
  systemPrompt: string(),
5405
5492
  toolCount: number$1().int().nonnegative(),
5406
- credentialCount: number$1().int().nonnegative()
5493
+ credentialCount: number$1().int().nonnegative(),
5494
+ appSlugs: array(string()).default([]),
5495
+ toolSlugs: array(string()).default([])
5407
5496
  }),
5408
5497
  object({
5409
5498
  kind: literal("workflow"),
@@ -5419,13 +5508,20 @@ const storedRouteManifestEntryV2Schema = discriminatedUnion("kind", [
5419
5508
  endpoint: string(),
5420
5509
  attachmentIds: array(string()),
5421
5510
  moduleFile: string(),
5422
- attachmentSchemas: attachmentSchemasSchema
5511
+ /** sha256 of the trigger source file, baked at build time for overview change-detection. */
5512
+ sourceHash: string().optional(),
5513
+ attachmentSchemas: attachmentSchemasSchema,
5514
+ attachmentMeta: attachmentMetaSchema.optional()
5423
5515
  }),
5424
5516
  object({
5425
5517
  kind: literal("trigger-poll"),
5426
5518
  attachmentId: string(),
5519
+ attachmentIds: array(string()),
5427
5520
  moduleFile: string(),
5428
- schedule: string()
5521
+ sourceHash: string().optional(),
5522
+ schedule: string(),
5523
+ name: string().optional(),
5524
+ description: string().optional()
5429
5525
  }),
5430
5526
  object({
5431
5527
  kind: literal("trigger-poll-group"),
@@ -5437,16 +5533,180 @@ const storedRouteManifestEntryV2Schema = discriminatedUnion("kind", [
5437
5533
  object({
5438
5534
  kind: literal("cron-schedule"),
5439
5535
  attachmentId: string(),
5536
+ attachmentIds: array(string()),
5440
5537
  moduleFile: string(),
5441
- schedule: string()
5538
+ sourceHash: string().optional(),
5539
+ schedule: string(),
5540
+ name: string().optional(),
5541
+ description: string().optional()
5442
5542
  })
5443
5543
  ]);
5444
- const StoredRouteManifestSchema = object({
5544
+ const storedRouteManifestV2Schema = object({
5445
5545
  version: literal(2),
5446
5546
  entries: array(storedRouteManifestEntryV2Schema),
5447
5547
  skills: array(StoredRouteManifestSkillSchema).default([]),
5448
5548
  integrations: array(string()).optional()
5449
5549
  });
5550
+ const DERIVED_ENTRY_KINDS = new Set([
5551
+ "agent-sessions-list",
5552
+ "agent-session-detail",
5553
+ "workflow-runs-list",
5554
+ "workflow-run-detail",
5555
+ "trigger-runs-list",
5556
+ "trigger-run-detail"
5557
+ ]);
5558
+ function webhookEndpointFromPath(path) {
5559
+ return path.replace(/^\/triggers\//, "").replace(/^\/+|\/+$/g, "");
5560
+ }
5561
+ function legacyAgentAppSlugs(entry) {
5562
+ if (Array.isArray(entry.appSlugs)) return entry.appSlugs;
5563
+ if (Array.isArray(entry.credentialSlugs)) return entry.credentialSlugs;
5564
+ if (Array.isArray(entry.credentialKeys)) return entry.credentialKeys;
5565
+ return [];
5566
+ }
5567
+ /** TODO remove after all artifacts rebuilt — upcasts legacy v1 manifests to v2. */
5568
+ function normalizeEntryToV2(entry) {
5569
+ const kind = entry.kind;
5570
+ if (typeof kind !== "string") return null;
5571
+ if (DERIVED_ENTRY_KINDS.has(kind) || kind === "plugin") return null;
5572
+ if (kind === "health") return { kind: "health" };
5573
+ if (kind === "agent") {
5574
+ const slug = typeof entry.slug === "string" ? entry.slug : typeof entry.agentSlug === "string" ? entry.agentSlug : void 0;
5575
+ if (!slug || typeof entry.moduleFile !== "string") return null;
5576
+ return {
5577
+ kind: "agent",
5578
+ slug,
5579
+ moduleFile: entry.moduleFile,
5580
+ ...typeof entry.name === "string" ? { name: entry.name } : {},
5581
+ ...typeof entry.description === "string" ? { description: entry.description } : {},
5582
+ model: typeof entry.model === "string" ? entry.model : "",
5583
+ systemPrompt: typeof entry.systemPrompt === "string" ? entry.systemPrompt : "",
5584
+ toolCount: typeof entry.toolCount === "number" ? entry.toolCount : 0,
5585
+ credentialCount: typeof entry.credentialCount === "number" ? entry.credentialCount : 0,
5586
+ appSlugs: legacyAgentAppSlugs(entry),
5587
+ toolSlugs: Array.isArray(entry.toolSlugs) ? entry.toolSlugs : []
5588
+ };
5589
+ }
5590
+ if (kind === "workflow") {
5591
+ const slug = typeof entry.slug === "string" ? entry.slug : typeof entry.workflowSlug === "string" ? entry.workflowSlug : void 0;
5592
+ if (!slug || typeof entry.moduleFile !== "string") return null;
5593
+ const name = typeof entry.name === "string" ? entry.name : typeof entry.workflowName === "string" ? entry.workflowName : void 0;
5594
+ return {
5595
+ kind: "workflow",
5596
+ slug,
5597
+ moduleFile: entry.moduleFile,
5598
+ ...name ? { name } : {},
5599
+ ...typeof entry.description === "string" ? { description: entry.description } : {},
5600
+ subscribable: entry.subscribable === true,
5601
+ requestSchema: entry.requestSchema && typeof entry.requestSchema === "object" ? entry.requestSchema : {}
5602
+ };
5603
+ }
5604
+ if (kind === "trigger-webhook") {
5605
+ if (typeof entry.moduleFile !== "string" || !Array.isArray(entry.attachmentIds)) return null;
5606
+ const endpoint = typeof entry.endpoint === "string" ? entry.endpoint : typeof entry.path === "string" ? webhookEndpointFromPath(entry.path) : void 0;
5607
+ if (!endpoint) return null;
5608
+ return {
5609
+ kind: "trigger-webhook",
5610
+ endpoint,
5611
+ attachmentIds: entry.attachmentIds,
5612
+ moduleFile: entry.moduleFile,
5613
+ ...typeof entry.sourceHash === "string" ? { sourceHash: entry.sourceHash } : {},
5614
+ attachmentSchemas: entry.attachmentSchemas && typeof entry.attachmentSchemas === "object" ? entry.attachmentSchemas : {},
5615
+ ...entry.attachmentMeta && typeof entry.attachmentMeta === "object" ? { attachmentMeta: entry.attachmentMeta } : {}
5616
+ };
5617
+ }
5618
+ if (kind === "trigger-poll") {
5619
+ if (typeof entry.attachmentId !== "string" || typeof entry.moduleFile !== "string" || typeof entry.schedule !== "string") return null;
5620
+ return {
5621
+ kind: "trigger-poll",
5622
+ attachmentId: entry.attachmentId,
5623
+ attachmentIds: Array.isArray(entry.attachmentIds) ? entry.attachmentIds : [entry.attachmentId],
5624
+ moduleFile: entry.moduleFile,
5625
+ ...typeof entry.sourceHash === "string" ? { sourceHash: entry.sourceHash } : {},
5626
+ schedule: entry.schedule,
5627
+ ...typeof entry.name === "string" ? { name: entry.name } : {},
5628
+ ...typeof entry.description === "string" ? { description: entry.description } : {}
5629
+ };
5630
+ }
5631
+ if (kind === "trigger-poll-group") {
5632
+ if (typeof entry.pollId !== "string" || typeof entry.moduleFile !== "string" || typeof entry.schedule !== "string" || !Array.isArray(entry.attachmentIds)) return null;
5633
+ return {
5634
+ kind: "trigger-poll-group",
5635
+ pollId: entry.pollId,
5636
+ attachmentIds: entry.attachmentIds,
5637
+ moduleFile: entry.moduleFile,
5638
+ schedule: entry.schedule
5639
+ };
5640
+ }
5641
+ if (kind === "cron-schedule") {
5642
+ if (typeof entry.attachmentId !== "string" || typeof entry.moduleFile !== "string" || typeof entry.schedule !== "string") return null;
5643
+ return {
5644
+ kind: "cron-schedule",
5645
+ attachmentId: entry.attachmentId,
5646
+ attachmentIds: Array.isArray(entry.attachmentIds) ? entry.attachmentIds : [entry.attachmentId],
5647
+ moduleFile: entry.moduleFile,
5648
+ ...typeof entry.sourceHash === "string" ? { sourceHash: entry.sourceHash } : {},
5649
+ schedule: entry.schedule,
5650
+ ...typeof entry.name === "string" ? { name: entry.name } : {},
5651
+ ...typeof entry.description === "string" ? { description: entry.description } : {}
5652
+ };
5653
+ }
5654
+ return null;
5655
+ }
5656
+ /** TODO remove after all artifacts rebuilt — upcasts legacy v1 manifests to v2. */
5657
+ function normalizeV2ManifestInput(value) {
5658
+ if (!value || typeof value !== "object") return value;
5659
+ const raw = value;
5660
+ if (raw.version !== 2 || !Array.isArray(raw.entries)) return value;
5661
+ return {
5662
+ ...raw,
5663
+ entries: raw.entries.map((entry) => {
5664
+ if (!entry || typeof entry !== "object") return entry;
5665
+ const kind = entry.kind;
5666
+ if (kind === "trigger-poll" || kind === "cron-schedule" || kind === "trigger-webhook" || kind === "trigger-poll-group") {
5667
+ const trigger = entry;
5668
+ if (Array.isArray(trigger.attachmentIds)) return entry;
5669
+ return {
5670
+ ...trigger,
5671
+ attachmentIds: typeof trigger.attachmentId === "string" ? [trigger.attachmentId] : []
5672
+ };
5673
+ }
5674
+ if (kind !== "agent") return entry;
5675
+ const agent = entry;
5676
+ if (Array.isArray(agent.appSlugs)) return entry;
5677
+ const appSlugs = legacyAgentAppSlugs(agent);
5678
+ if (appSlugs.length === 0) return entry;
5679
+ const { credentialKeys: _credentialKeys, credentialSlugs: _credentialSlugs, ...rest } = agent;
5680
+ return {
5681
+ ...rest,
5682
+ appSlugs,
5683
+ toolSlugs: Array.isArray(agent.toolSlugs) ? agent.toolSlugs : []
5684
+ };
5685
+ })
5686
+ };
5687
+ }
5688
+ /** TODO remove after all artifacts rebuilt — upcasts legacy v1 manifests to v2. */
5689
+ function normalizeStoredRouteManifestToV2(value) {
5690
+ if (!value || typeof value !== "object") throw new Error("Invalid route manifest");
5691
+ const raw = value;
5692
+ if (raw.version === 2) return storedRouteManifestV2Schema.parse(normalizeV2ManifestInput(value));
5693
+ const entriesRaw = Array.isArray(raw.entries) ? raw.entries : [];
5694
+ const entries = [];
5695
+ for (const entry of entriesRaw) {
5696
+ if (!entry || typeof entry !== "object") continue;
5697
+ const normalized = normalizeEntryToV2(entry);
5698
+ if (normalized) entries.push(normalized);
5699
+ }
5700
+ return storedRouteManifestV2Schema.parse({
5701
+ version: 2,
5702
+ entries,
5703
+ skills: raw.skills ?? [],
5704
+ integrations: raw.integrations
5705
+ });
5706
+ }
5707
+ function parseStoredRouteManifest(value) {
5708
+ return normalizeStoredRouteManifestToV2(value);
5709
+ }
5450
5710
  /** Messaging platforms that support agent gateway bindings. */
5451
5711
  const ChannelPlatformKeySchema = _enum(["slack"]);
5452
5712
  const ChannelReactionSupportSchema = _enum([
@@ -5495,6 +5755,8 @@ const AppGatewaySchema = object({
5495
5755
  }),
5496
5756
  supportsChannelDirectory: boolean(),
5497
5757
  webhookPathHint: string().min(1),
5758
+ /** Composio/keystroke app slug for Connect when it differs from the gateway platform key (e.g. slack → slackbot). */
5759
+ connectAppId: string().min(1).optional(),
5498
5760
  docsUrl: string().url().optional(),
5499
5761
  tagline: string().min(1).optional()
5500
5762
  });
@@ -5506,7 +5768,11 @@ const ChannelPlatformSchema = object({
5506
5768
  fallbackDomain: string().min(1),
5507
5769
  description: string().min(1),
5508
5770
  tagline: string().min(1),
5509
- authKind: _enum(["oauth", "api_key"]),
5771
+ authKind: _enum([
5772
+ "oauth",
5773
+ "api_key",
5774
+ "keystroke"
5775
+ ]),
5510
5776
  credentialFields: array(object({
5511
5777
  key: string().min(1),
5512
5778
  label: string().min(1),
@@ -5528,6 +5794,7 @@ const ChannelPlatformSchema = object({
5528
5794
  }),
5529
5795
  webhookPathHint: string().min(1),
5530
5796
  supportsChannelDirectory: boolean(),
5797
+ connectAppId: string().min(1).optional(),
5531
5798
  docsUrl: string().url().optional()
5532
5799
  });
5533
5800
  const ChannelBindingSchema = object({
@@ -5581,11 +5848,38 @@ const UpdateChannelBindingBodySchema = object({ patch: object({
5581
5848
  mode: ChannelListenModeSchema.optional(),
5582
5849
  subscribeOnMention: boolean().optional()
5583
5850
  }) });
5851
+ /**
5852
+ * Where a manual MCP API key is injected on each request. MCP servers don't
5853
+ * advertise API-key support in a discoverable way, so the user picks the
5854
+ * placement: a request header (optionally prefixed, e.g. `Bearer `) or a query
5855
+ * param (e.g. Exa's `exaApiKey`).
5856
+ */
5857
+ const McpApiKeyPlacementSchema = discriminatedUnion("kind", [object({
5858
+ kind: literal("header"),
5859
+ name: string().trim().min(1),
5860
+ /** Prepended to the token, e.g. `"Bearer "` for `Authorization: Bearer <token>`. */
5861
+ prefix: string().optional()
5862
+ }), object({
5863
+ kind: literal("query"),
5864
+ name: string().trim().min(1)
5865
+ })]);
5866
+ object({
5867
+ token: string().trim().min(1),
5868
+ placement: McpApiKeyPlacementSchema.default({
5869
+ kind: "header",
5870
+ name: "Authorization",
5871
+ prefix: "Bearer "
5872
+ })
5873
+ });
5584
5874
  /** Metadata for one vault field on a custom api_key app. */
5585
5875
  const AppCredentialFieldSchema = object({
5586
5876
  label: string().trim().min(1).optional(),
5587
5877
  secret: boolean().optional(),
5588
- optional: boolean().optional()
5878
+ optional: boolean().optional(),
5879
+ description: string().trim().min(1).optional(),
5880
+ default: string().optional(),
5881
+ /** For direct MCP api-key apps: where this field's value is injected on the request. */
5882
+ placement: McpApiKeyPlacementSchema.optional()
5589
5883
  });
5590
5884
  /** Credential template keyed by vault field name. */
5591
5885
  const AppCredentialFieldsSchema = record(string().regex(/^[a-zA-Z][a-zA-Z0-9_]*$/), AppCredentialFieldSchema).refine((fields) => Object.keys(fields).length > 0, { message: "At least one credential field is required" }).refine((fields) => Object.values(fields).some((field) => field.optional !== true), { message: "At least one credential field must be required" });
@@ -5602,6 +5896,13 @@ const AppAuthKindSchema = _enum([
5602
5896
  "api_key",
5603
5897
  "keystroke"
5604
5898
  ]);
5899
+ /** Composio auth scheme for API-key style connections. */
5900
+ const AppCredentialSchemeSchema = _enum([
5901
+ "API_KEY",
5902
+ "BEARER_TOKEN",
5903
+ "BASIC",
5904
+ "BASIC_WITH_JWT"
5905
+ ]);
5605
5906
  /**
5606
5907
  * Where app metadata and execution are sourced (e.g. native, composio, pipedream, custom).
5607
5908
  * Opaque string — cloud/hosted entrypoints choose values; keystroke stays provider-agnostic.
@@ -5615,7 +5916,11 @@ object({
5615
5916
  logo: string().url().optional(),
5616
5917
  authKind: AppAuthKindSchema,
5617
5918
  oauthScopes: array(OAuthScopeOptionSchema)
5618
- }).extend({ source: AppSourceSchema });
5919
+ }).extend({
5920
+ source: AppSourceSchema,
5921
+ credentialFields: AppCredentialFieldsSchema.optional(),
5922
+ credentialScheme: AppCredentialSchemeSchema.optional()
5923
+ });
5619
5924
  const customAppNameSchema = string().trim().min(1, "Name is required");
5620
5925
  const AppSlugAvailabilityReasonSchema = ProjectSlugAvailabilityReasonSchema;
5621
5926
  const AppSlugAvailabilityResponseSchema = object({
@@ -5625,12 +5930,44 @@ const AppSlugAvailabilityResponseSchema = object({
5625
5930
  suggestion: AppSlugSchema.optional()
5626
5931
  });
5627
5932
  object({ slug: string().trim().min(1) });
5628
- /** Request body for creating an org custom api_key app. */
5933
+ /** Request body for creating an org custom app (api_key or direct MCP). */
5934
+ const optionalCredentialFieldsSchema = record(string().regex(/^[a-zA-Z][a-zA-Z0-9_]*$/), AppCredentialFieldSchema);
5629
5935
  const CreateCustomAppRequestSchema = object({
5630
5936
  name: customAppNameSchema,
5631
5937
  slug: AppSlugSchema,
5632
5938
  description: string().trim().min(1),
5633
- fields: AppCredentialFieldsSchema
5939
+ source: _enum([
5940
+ "custom",
5941
+ "mcp",
5942
+ "openapi",
5943
+ "graphql"
5944
+ ]).default("custom"),
5945
+ url: string().url().optional(),
5946
+ authKind: AppAuthKindSchema.optional(),
5947
+ fields: optionalCredentialFieldsSchema.optional(),
5948
+ credentialScheme: AppCredentialSchemeSchema.optional(),
5949
+ oauthScopes: array(OAuthScopeOptionSchema).optional()
5950
+ }).superRefine((data, ctx) => {
5951
+ if ((data.source === "mcp" || data.source === "openapi" || data.source === "graphql") && !data.url) ctx.addIssue({
5952
+ code: "custom",
5953
+ message: "url is required for this app source",
5954
+ path: ["url"]
5955
+ });
5956
+ if (!(data.authKind ?? (data.source === "custom" ? "api_key" : void 0))) {
5957
+ ctx.addIssue({
5958
+ code: "custom",
5959
+ message: "authKind is required",
5960
+ path: ["authKind"]
5961
+ });
5962
+ return;
5963
+ }
5964
+ if (data.source === "custom") {
5965
+ const parsed = AppCredentialFieldsSchema.safeParse(data.fields ?? {});
5966
+ if (!parsed.success) for (const issue of parsed.error.issues) ctx.addIssue({
5967
+ ...issue,
5968
+ path: ["fields", ...issue.path]
5969
+ });
5970
+ }
5634
5971
  });
5635
5972
  /** Full custom app detail returned by GET (includes credential template for sync). */
5636
5973
  const CustomAppDetailSchema = object({
@@ -5639,9 +5976,12 @@ const CustomAppDetailSchema = object({
5639
5976
  name: string().min(1),
5640
5977
  description: string().min(1),
5641
5978
  category: string().min(1),
5642
- authKind: literal("api_key"),
5643
- source: literal("custom"),
5644
- credentialFields: AppCredentialFieldsSchema,
5979
+ authKind: AppAuthKindSchema,
5980
+ source: AppSourceSchema,
5981
+ url: string().url().nullable().optional(),
5982
+ credentialFields: optionalCredentialFieldsSchema.optional(),
5983
+ credentialScheme: AppCredentialSchemeSchema.optional(),
5984
+ oauthScopes: array(OAuthScopeOptionSchema).optional(),
5645
5985
  createdAt: string().min(1),
5646
5986
  updatedAt: string().min(1)
5647
5987
  });
@@ -5659,6 +5999,8 @@ object({
5659
5999
  oauthScopes: array(OAuthScopeOptionSchema),
5660
6000
  source: AppSourceSchema,
5661
6001
  credentialFields: AppCredentialFieldsSchema.optional(),
6002
+ credentialScheme: AppCredentialSchemeSchema.optional(),
6003
+ url: string().url().nullable().optional(),
5662
6004
  createdAt: string().min(1),
5663
6005
  updatedAt: string().min(1)
5664
6006
  });
@@ -5675,9 +6017,87 @@ const ListAppsResponseSchema = array(object({
5675
6017
  source: AppSourceSchema,
5676
6018
  /** Custom api_key apps — vault field template for connect UI and sync. */
5677
6019
  credentialFields: AppCredentialFieldsSchema.optional(),
6020
+ /** Composio auth scheme when credentialFields are present. */
6021
+ credentialScheme: AppCredentialSchemeSchema.optional(),
6022
+ /** Endpoint URL for MCP, OpenAPI, or GraphQL custom apps. */
6023
+ url: string().url().nullable().optional(),
5678
6024
  /** When present, the app supports agent gateway bindings (external channels). */
5679
6025
  gateway: AppGatewaySchema.optional()
5680
6026
  }));
6027
+ const McpAuthProbeModeSchema = _enum([
6028
+ "none",
6029
+ "token",
6030
+ "oauth"
6031
+ ]);
6032
+ const McpAuthProbeOAuthSchema = object({
6033
+ issuer: string().optional(),
6034
+ authorizationEndpoint: string().url(),
6035
+ tokenEndpoint: string().url(),
6036
+ registrationEndpoint: string().url().optional(),
6037
+ scopes: array(string()),
6038
+ resource: string().optional(),
6039
+ /** Human-readable label from OAuth protected-resource metadata (RFC 9728). */
6040
+ resourceName: string().optional()
6041
+ });
6042
+ object({
6043
+ url: string().url(),
6044
+ mode: McpAuthProbeModeSchema,
6045
+ unauthenticatedStatus: number$1().int().optional(),
6046
+ scheme: AppCredentialSchemeSchema.optional(),
6047
+ oauth: McpAuthProbeOAuthSchema.optional()
6048
+ });
6049
+ object({ url: string().url() });
6050
+ const McpDiscoverResponseSchema = object({
6051
+ detected: boolean(),
6052
+ template: object({
6053
+ authKind: AppAuthKindSchema,
6054
+ credentialFields: record(string(), AppCredentialFieldSchema).optional(),
6055
+ credentialScheme: AppCredentialSchemeSchema.optional(),
6056
+ oauthScopes: array(OAuthScopeOptionSchema),
6057
+ url: string().url(),
6058
+ oauth: McpAuthProbeOAuthSchema.optional(),
6059
+ serverName: string().optional(),
6060
+ serverDescription: string().optional()
6061
+ })
6062
+ });
6063
+ const StartMcpOAuthConnectionInputSchema = object({
6064
+ appSlug: string().trim().min(1),
6065
+ projects: array(string().trim().min(1)).optional(),
6066
+ createOrganizationCredential: boolean().optional(),
6067
+ createUserProvidedCredential: boolean().optional(),
6068
+ label: string().trim().min(1).optional(),
6069
+ credentialInstanceId: string().trim().min(1).optional(),
6070
+ scopes: array(string()).optional()
6071
+ });
6072
+ const StartMcpOAuthConnectionResultSchema = object({ authorizeUrl: string().url() });
6073
+ object({ url: string().url() });
6074
+ const OpenApiDiscoverResponseSchema = object({
6075
+ detected: boolean(),
6076
+ template: object({
6077
+ authKind: AppAuthKindSchema,
6078
+ credentialFields: record(string(), AppCredentialFieldSchema).optional(),
6079
+ credentialScheme: AppCredentialSchemeSchema.optional(),
6080
+ oauthScopes: array(OAuthScopeOptionSchema),
6081
+ url: string().url(),
6082
+ name: string().optional(),
6083
+ description: string().optional(),
6084
+ homepageUrl: string().optional()
6085
+ })
6086
+ });
6087
+ object({ url: string().url() });
6088
+ const GraphqlDiscoverResponseSchema = object({
6089
+ detected: boolean(),
6090
+ template: object({
6091
+ authKind: AppAuthKindSchema,
6092
+ credentialFields: record(string(), AppCredentialFieldSchema).optional(),
6093
+ credentialScheme: AppCredentialSchemeSchema.optional(),
6094
+ oauthScopes: array(OAuthScopeOptionSchema),
6095
+ url: string().url(),
6096
+ name: string().optional(),
6097
+ description: string().optional(),
6098
+ homepageUrl: string().optional()
6099
+ })
6100
+ });
5681
6101
  const CatalogAppsPageSchema = object({
5682
6102
  items: array(object({
5683
6103
  name: string(),
@@ -5734,6 +6154,12 @@ function parseAppSlug(slug) {
5734
6154
  slug: trimmed
5735
6155
  };
5736
6156
  }
6157
+ /** Web URL that opens the org apps page with a connect dialog for the given app. */
6158
+ function buildConnectDeeplink(options) {
6159
+ const base = options.webUrl.replace(/\/+$/, "");
6160
+ const params = new URLSearchParams({ connect: options.appSlug });
6161
+ return `${base}/${options.orgSlug}/apps?${params.toString()}`;
6162
+ }
5737
6163
  /** How a credential instance is stored (`credential_instances.auth_kind`). */
5738
6164
  const CredentialAuthKindSchema = _enum([
5739
6165
  "api_key",
@@ -5792,7 +6218,7 @@ const AppCredentialSummarySchema = object({
5792
6218
  });
5793
6219
  const credentialSecretValueSchema = record(string(), unknown()).refine((value) => Object.keys(value).length > 0, { message: "value must be a non-empty object" });
5794
6220
  function hasCredentialTarget(input) {
5795
- return input.projects.length > 0 || input.createOrganizationCredential || input.createUserProvidedCredential;
6221
+ return input.projects.length > 0 || input.createOrganizationCredential || input.createUserProvidedCredential || Boolean(input.credentialInstanceId?.trim());
5796
6222
  }
5797
6223
  function addMissingCredentialTargetIssue(ctx, path = ["projects"]) {
5798
6224
  ctx.addIssue({
@@ -5807,7 +6233,9 @@ const CredentialTargetsFieldsSchema = object({
5807
6233
  createOrganizationCredential: boolean().default(false),
5808
6234
  createUserProvidedCredential: boolean().default(false),
5809
6235
  /** Display label for created credential instances (apps table / detail page). */
5810
- label: string().trim().min(1).optional()
6236
+ label: string().trim().min(1).optional(),
6237
+ /** When set, update this credential instance in place (reconnect) instead of creating a new row. */
6238
+ credentialInstanceId: string().trim().min(1).optional()
5811
6239
  });
5812
6240
  /** Input for starting an OAuth connection (connect dialog / CLI connect). */
5813
6241
  const StartOAuthConnectionInputSchema = CredentialTargetsFieldsSchema.extend({
@@ -5820,25 +6248,22 @@ const StartOAuthConnectionResultSchema = object({
5820
6248
  status: _enum(["connected", "redirecting"]),
5821
6249
  authorizeUrl: string().url().nullable()
5822
6250
  });
5823
- /** Input for starting a Composio/keystroke connection (connect dialog). */
5824
- const StartKeystrokeConnectionInputSchema = object({
6251
+ /** Input for starting a keystroke connection (connect dialog). */
6252
+ const StartKeystrokeConnectionInputSchema = CredentialTargetsFieldsSchema.extend({
5825
6253
  app: string().trim().min(1),
5826
- scopeType: AppCredentialScopeSchema,
5827
- projectSlug: string().trim().min(1).optional(),
5828
- label: string().trim().min(1).optional()
6254
+ value: credentialSecretValueSchema.optional()
5829
6255
  }).superRefine((input, ctx) => {
5830
- if (input.scopeType === "project" && !input.projectSlug?.trim()) ctx.addIssue({
5831
- code: "custom",
5832
- message: "projectSlug is required for project scope",
5833
- path: ["projectSlug"]
5834
- });
6256
+ if (!hasCredentialTarget(input)) addMissingCredentialTargetIssue(ctx);
5835
6257
  });
5836
- /** Result of starting a Composio/keystroke connection. */
5837
- const StartKeystrokeConnectionResultSchema = object({
5838
- status: _enum(["redirecting"]),
6258
+ /** Result of starting a keystroke connection. */
6259
+ const StartKeystrokeConnectionResultSchema = discriminatedUnion("status", [object({
6260
+ status: literal("connected"),
6261
+ connectionId: string().min(1)
6262
+ }), object({
6263
+ status: literal("redirecting"),
5839
6264
  authorizeUrl: string().url(),
5840
- connectionId: string()
5841
- });
6265
+ connectionId: string().min(1)
6266
+ })]);
5842
6267
  /** Request body for `POST /api/credentials` (manual api-key fan-out). */
5843
6268
  const CreateCredentialsRequestSchema = CredentialTargetsFieldsSchema.extend({
5844
6269
  appId: string().min(1),
@@ -5867,6 +6292,44 @@ const UpdateCredentialRequestSchema = object({
5867
6292
  const ListCredentialsResponseSchema = array(AppCredentialSummarySchema);
5868
6293
  const GetCredentialResponseSchema = AppCredentialSummarySchema;
5869
6294
  const CreateCredentialsResponseSchema = array(AppCredentialSummarySchema);
6295
+ const CredentialAssignmentTargetTypeSchema = _enum(["workflow", "agent"]);
6296
+ const CredentialAssignmentRecordSchema = object({
6297
+ id: string(),
6298
+ targetType: CredentialAssignmentTargetTypeSchema,
6299
+ targetKey: string(),
6300
+ consumerId: string(),
6301
+ credentialSlug: string(),
6302
+ instanceId: string(),
6303
+ credential: string().optional(),
6304
+ scopeType: _enum([
6305
+ "organization",
6306
+ "project",
6307
+ "user"
6308
+ ]).optional(),
6309
+ createdAt: string(),
6310
+ updatedAt: string()
6311
+ });
6312
+ const CredentialAssignmentListResponseSchema = object({ assignments: array(CredentialAssignmentRecordSchema) });
6313
+ const AssignCredentialBodySchema = object({
6314
+ targetType: CredentialAssignmentTargetTypeSchema,
6315
+ targetKey: string().min(1),
6316
+ /** Omit or '*' for wildcard assignment. */
6317
+ consumerId: string().optional(),
6318
+ credential: string().min(1)
6319
+ });
6320
+ const CredentialAssignmentListQuerySchema = object({
6321
+ targetType: CredentialAssignmentTargetTypeSchema,
6322
+ targetKey: string().min(1)
6323
+ });
6324
+ const CredentialConsumerListQuerySchema = object({
6325
+ targetType: CredentialAssignmentTargetTypeSchema,
6326
+ targetKey: string().min(1)
6327
+ });
6328
+ const CredentialConsumerListResponseSchema = object({ consumers: array(object({
6329
+ consumerId: string(),
6330
+ label: string(),
6331
+ appSlugs: array(string())
6332
+ })) });
5870
6333
  const McpConnectionStatusSchema = _enum([
5871
6334
  "INITIATED",
5872
6335
  "ACTIVE",
@@ -5887,22 +6350,60 @@ object({
5887
6350
  entityId: string(),
5888
6351
  instanceId: string()
5889
6352
  });
6353
+ const McpCredentialAssignmentTargetSchema = object({
6354
+ type: CredentialAssignmentTargetTypeSchema,
6355
+ key: string().trim().min(1)
6356
+ });
5890
6357
  object({
5891
6358
  app: string().trim().min(1),
5892
6359
  tool: string().trim().min(1),
5893
6360
  arguments: record(string(), unknown()).default({}),
5894
6361
  /** Pinned provider toolkit version, sourced from the app definition; forwarded to the provider. */
5895
- version: string().trim().min(1)
6362
+ version: string().trim().min(1),
6363
+ /** When set, platform MCP resolve checks credential assignments before scope defaults. */
6364
+ assignmentTarget: McpCredentialAssignmentTargetSchema.optional(),
6365
+ /** Tool/step consumer id for assignment lookup (action slug or workflow step correlation id). */
6366
+ consumerId: string().trim().min(1).optional()
6367
+ });
6368
+ object({
6369
+ error: _enum([
6370
+ "not_found",
6371
+ "forbidden",
6372
+ "mcp_execute_failed"
6373
+ ]),
6374
+ message: string()
5896
6375
  });
5897
6376
  const SubmitTeamRequestRequestSchema = object({
5898
6377
  type: _enum([
5899
6378
  "org-deletion",
5900
6379
  "contact",
5901
- "enterprise-upgrade"
6380
+ "enterprise-upgrade",
6381
+ "verification"
5902
6382
  ]),
5903
6383
  message: string().trim().max(5e3).optional()
5904
6384
  });
5905
6385
  object({ ok: literal(true) });
6386
+ const MarketingContactCompanySizeSchema = _enum([
6387
+ "1-10",
6388
+ "11-50",
6389
+ "51-200",
6390
+ "201-500",
6391
+ "500+"
6392
+ ]);
6393
+ const SubmitMarketingContactRequestSchema = object({
6394
+ fullName: string().trim().min(1, "Full name is required").max(200),
6395
+ workEmail: string().trim().email("Enter a valid email address").max(320),
6396
+ companySize: MarketingContactCompanySizeSchema,
6397
+ message: string().trim().min(1, "Message is required").max(5e3),
6398
+ /** Honeypot — must stay empty; bots that fill it are ignored silently. */
6399
+ companyWebsite: string().optional()
6400
+ });
6401
+ function isCredentialInput(value) {
6402
+ if (typeof value !== "object" || value === null) return false;
6403
+ const candidate = value;
6404
+ return typeof candidate.key === "string" && CredentialAuthKindSchema.safeParse(candidate.kind).success && candidate.schema instanceof ZodType;
6405
+ }
6406
+ const credentialInputSchema = custom((value) => isCredentialInput(value), "must be a credential requirement");
5906
6407
  function normalizeCredentialList(list) {
5907
6408
  return list.map((item) => toCredentialRequirement(item));
5908
6409
  }
@@ -5923,7 +6424,7 @@ const ValidationErrorDetailSchema = object({
5923
6424
  message: string()
5924
6425
  });
5925
6426
  /** Machine-readable codes returned in standard API error bodies. */
5926
- const ErrorResponseCodeSchema = OrganizationSlugErrorCodeSchema.or(_enum(["needs_org_selection"]));
6427
+ const ErrorResponseCodeSchema = OrganizationSlugErrorCodeSchema.or(_enum(["needs_org_selection", "org_unverified"]));
5927
6428
  /** Standard JSON error body returned by the HTTP API. */
5928
6429
  const ErrorResponseSchema = object({
5929
6430
  error: string(),
@@ -5983,13 +6484,16 @@ const ConnectProvidersResponseSchema = object({ providers: array(object({
5983
6484
  })) });
5984
6485
  const ConnectAuthorizeUrlResponseSchema = object({ url: string() });
5985
6486
  const QueuedRunResponseSchema = object({ runId: string() });
5986
- const QueuedAgentPromptResponseSchema = object({ sessionId: string() });
6487
+ const QueuedAgentPromptResponseSchema = object({
6488
+ sessionId: string(),
6489
+ runId: string()
6490
+ });
5987
6491
  object({
5988
6492
  workflows: array(string().min(1)).optional(),
5989
6493
  attachments: array(string().min(1)).optional()
5990
6494
  });
5991
6495
  const PollRunMultiResponseSchema = object({ results: array(object({
5992
- attachmentKey: string(),
6496
+ attachmentSlug: string(),
5993
6497
  workflowKey: string(),
5994
6498
  runId: string().optional(),
5995
6499
  body: unknown().optional(),
@@ -6013,6 +6517,33 @@ object({
6013
6517
  kind: RunSourceKindSchema,
6014
6518
  id: string().nullable()
6015
6519
  });
6520
+ const AgentTriggerOriginSchema = _enum(["project", "ephemeral"]);
6521
+ const AgentTriggerStatusSchema = _enum([
6522
+ "active",
6523
+ "disabled",
6524
+ "completed"
6525
+ ]);
6526
+ const AgentTriggerTypeSchema = _enum([
6527
+ "webhook",
6528
+ "cron",
6529
+ "poll"
6530
+ ]);
6531
+ const AgentTriggerSummaryListResponseSchema = array(object({
6532
+ id: string(),
6533
+ label: string(),
6534
+ name: string().nullable().optional(),
6535
+ description: string().nullable().optional(),
6536
+ type: AgentTriggerTypeSchema,
6537
+ schedule: string().nullable(),
6538
+ endpoint: string().nullable(),
6539
+ origin: AgentTriggerOriginSchema,
6540
+ prompt: string().nullable(),
6541
+ status: AgentTriggerStatusSchema,
6542
+ executionCount: number$1().int().nonnegative(),
6543
+ until: string().nullable(),
6544
+ attachmentId: string(),
6545
+ attachmentSlug: string()
6546
+ }));
6016
6547
  const WorkflowRunStatusSchema = _enum([
6017
6548
  "pending",
6018
6549
  "running",
@@ -6090,7 +6621,7 @@ _enum([
6090
6621
  object({ include: string().optional() });
6091
6622
  const TriggerRunDetailSchema = object({
6092
6623
  id: string(),
6093
- attachmentId: string(),
6624
+ triggerId: string(),
6094
6625
  attachmentSlug: string().nullable(),
6095
6626
  triggerType: _enum([
6096
6627
  "cron",
@@ -6172,6 +6703,10 @@ const AgentSessionSummarySchema = object({
6172
6703
  status: AgentSessionStatusSchema,
6173
6704
  source: RunSourceKindSchema,
6174
6705
  sourceId: string().nullable(),
6706
+ title: string().nullable(),
6707
+ ranByUserName: string().nullable(),
6708
+ gatewayPlatform: string().nullable(),
6709
+ triggerType: AgentTriggerTypeSchema.nullable(),
6175
6710
  createdAt: string(),
6176
6711
  updatedAt: string(),
6177
6712
  messageCount: number$1()
@@ -6225,6 +6760,12 @@ const AgentSessionDetailResponseSchema = object({
6225
6760
  events: array(AgentEventSchema),
6226
6761
  trace: TraceResponseSchema.nullable()
6227
6762
  });
6763
+ object({ sinceSeq: number().int().min(0).optional() });
6764
+ const AgentSessionChatStateResponseSchema = object({
6765
+ status: AgentSessionStatusSchema,
6766
+ messages: array(record(string(), unknown())),
6767
+ live: record(string(), unknown()).nullable()
6768
+ });
6228
6769
  const SlackGatewayModeSchema = _enum([
6229
6770
  "mention",
6230
6771
  "channel",
@@ -6339,7 +6880,7 @@ const HistoryTraceTriggerSchema = object({
6339
6880
  workflowKey: string().optional(),
6340
6881
  agentKey: string().optional(),
6341
6882
  attachmentId: string().nullable().optional(),
6342
- attachmentKey: string().nullable().optional(),
6883
+ attachmentSlug: string().nullable().optional(),
6343
6884
  route: string().optional(),
6344
6885
  sourcePath: string().nullable().optional()
6345
6886
  }).nullable();
@@ -6379,7 +6920,7 @@ const HistoryRunDetailSchema = discriminatedUnion("kind", [object({
6379
6920
  }),
6380
6921
  trigger: object({
6381
6922
  id: string(),
6382
- attachmentKey: string().nullable(),
6923
+ attachmentSlug: string().nullable(),
6383
6924
  triggerType: string(),
6384
6925
  sourcePath: string().nullable(),
6385
6926
  payload: unknown().nullable(),
@@ -6411,7 +6952,7 @@ const HistoryRunDetailSchema = discriminatedUnion("kind", [object({
6411
6952
  }),
6412
6953
  gateway: object({
6413
6954
  threadId: string(),
6414
- attachmentKey: string().nullable()
6955
+ attachmentSlug: string().nullable()
6415
6956
  }).nullable(),
6416
6957
  messages: array(record(string(), unknown())),
6417
6958
  trace: HistoryTraceSchema.nullable(),
@@ -6440,7 +6981,9 @@ object({
6440
6981
  });
6441
6982
  const CredentialInstanceRecordSchema = object({
6442
6983
  id: string(),
6443
- key: string(),
6984
+ appSlug: string(),
6985
+ slug: string(),
6986
+ name: string().nullable(),
6444
6987
  scopeType: CredentialScopeTypeSchema,
6445
6988
  scopeId: string().nullable(),
6446
6989
  label: string().nullable(),
@@ -6450,6 +6993,8 @@ const CredentialInstanceRecordSchema = object({
6450
6993
  const CredentialInstanceListResponseSchema = object({ instances: array(CredentialInstanceRecordSchema) });
6451
6994
  const CreateCredentialInstanceBodySchema = object({
6452
6995
  key: string().min(1),
6996
+ slug: string().min(1).optional(),
6997
+ name: string().nullable().optional(),
6453
6998
  scopeType: CredentialScopeTypeSchema,
6454
6999
  scopeId: string().nullable().optional(),
6455
7000
  label: string().nullable().optional(),
@@ -6457,6 +7002,8 @@ const CreateCredentialInstanceBodySchema = object({
6457
7002
  value: record(string(), unknown()).refine((value) => Object.keys(value).length > 0, { message: "value must be a non-empty object" })
6458
7003
  });
6459
7004
  const UpdateCredentialInstanceBodySchema = object({
7005
+ slug: string().min(1).optional(),
7006
+ name: string().nullable().optional(),
6460
7007
  label: string().nullable().optional(),
6461
7008
  isDefault: boolean().optional(),
6462
7009
  value: record(string(), unknown()).refine((value) => Object.keys(value).length > 0, { message: "value must be a non-empty object" }).optional()
@@ -6466,6 +7013,18 @@ const TriggerRunTypeSchema = _enum([
6466
7013
  "webhook",
6467
7014
  "poll"
6468
7015
  ]);
7016
+ const TriggerRunOutcomeSchema = _enum([
7017
+ "dispatched",
7018
+ "skipped",
7019
+ "failed"
7020
+ ]);
7021
+ const TriggerRunReasonSchema = _enum([
7022
+ "filter_rejected",
7023
+ "transform_undefined",
7024
+ "invalid_payload",
7025
+ "source_error",
7026
+ "handler_error"
7027
+ ]);
6469
7028
  const TriggerRunWorkflowSummarySchema = object({
6470
7029
  id: string(),
6471
7030
  status: WorkflowRunStatusSchema,
@@ -6480,15 +7039,23 @@ const TriggerRunSummarySchema = object({
6480
7039
  triggerType: TriggerRunTypeSchema,
6481
7040
  triggeredAt: string(),
6482
7041
  sourcePath: string().nullable(),
6483
- workflowRun: TriggerRunWorkflowSummarySchema.nullable(),
6484
- agentSession: TriggerRunAgentSessionSummarySchema.nullable()
7042
+ outcome: TriggerRunOutcomeSchema,
7043
+ reason: TriggerRunReasonSchema.nullable(),
7044
+ detail: string().nullable(),
7045
+ /** Workflow runs dispatched by this fire (fan-out → one per matched workflow attachment). */
7046
+ workflowRuns: array(TriggerRunWorkflowSummarySchema),
7047
+ /** Agent sessions dispatched by this fire (fan-out → one per matched agent attachment). */
7048
+ agentSessions: array(TriggerRunAgentSessionSummarySchema)
6485
7049
  });
6486
7050
  const TriggerRunRecordSchema = object({
6487
7051
  id: string(),
6488
- attachmentId: string(),
7052
+ triggerId: string(),
6489
7053
  attachmentSlug: string(),
6490
7054
  triggerType: TriggerRunTypeSchema,
6491
7055
  sourcePath: string().nullable(),
7056
+ outcome: TriggerRunOutcomeSchema,
7057
+ reason: TriggerRunReasonSchema.nullable(),
7058
+ detail: string().nullable(),
6492
7059
  payload: unknown().nullable(),
6493
7060
  triggeredAt: string()
6494
7061
  });
@@ -6523,9 +7090,16 @@ const TriggerTypeSchema = _enum([
6523
7090
  "cron"
6524
7091
  ]);
6525
7092
  const TriggerTargetKindSchema = _enum(["workflow", "agent"]);
7093
+ const TriggerStatusSchema = _enum(["active", "disabled"]);
7094
+ const TriggerAttachmentStatusSchema = _enum(["active", "disabled"]);
6526
7095
  const TriggerListItemSchema = object({
6527
- key: string(),
7096
+ slug: string(),
7097
+ name: string().optional(),
7098
+ description: string().optional(),
6528
7099
  type: TriggerTypeSchema,
7100
+ status: TriggerStatusSchema.optional(),
7101
+ schedule: string().nullable().optional(),
7102
+ sourcePath: string().optional(),
6529
7103
  route: string().optional(),
6530
7104
  webhookUrl: string().url().optional(),
6531
7105
  targetKind: TriggerTargetKindSchema,
@@ -6535,6 +7109,136 @@ const TriggerListItemSchema = object({
6535
7109
  const TriggerListResponseSchema = object({ triggers: array(TriggerListItemSchema) });
6536
7110
  object({ endpoint: string().min(1).optional() });
6537
7111
  const TriggerDetailResponseSchema = TriggerListItemSchema;
7112
+ const TriggerAssignmentSchema = object({
7113
+ kind: TriggerTargetKindSchema,
7114
+ id: string(),
7115
+ slug: string(),
7116
+ name: string(),
7117
+ attachmentId: string(),
7118
+ attachmentSlug: string(),
7119
+ status: TriggerAttachmentStatusSchema,
7120
+ disabledAt: string().nullable()
7121
+ });
7122
+ /** Status of the downstream run/session a dispatched fire produced. */
7123
+ const WorkspaceTriggerRunStatusSchema = _enum([
7124
+ "completed",
7125
+ "running",
7126
+ "failed"
7127
+ ]);
7128
+ /**
7129
+ * Categorical reason a fire was recorded but produced no downstream run. These map
7130
+ * from the persisted `trigger_runs.reason` enum onto the labels the UI renders.
7131
+ */
7132
+ const WorkspaceTriggerSkipReasonSchema = _enum([
7133
+ "filtered",
7134
+ "no_new_data",
7135
+ "transform_undefined"
7136
+ ]);
7137
+ /**
7138
+ * A single downstream run/session a dispatched fire produced. A fan-out fire can
7139
+ * dispatch several of these (multiple workflows and/or agents off one source event).
7140
+ */
7141
+ const WorkspaceTriggerRunTargetSchema = discriminatedUnion("kind", [object({
7142
+ kind: literal("workflow"),
7143
+ runId: string(),
7144
+ workflowId: string(),
7145
+ status: WorkspaceTriggerRunStatusSchema,
7146
+ name: string()
7147
+ }), object({
7148
+ kind: literal("agent"),
7149
+ sessionId: string(),
7150
+ agentId: string(),
7151
+ status: WorkspaceTriggerRunStatusSchema,
7152
+ name: string()
7153
+ })]);
7154
+ /**
7155
+ * Outcome of a single trigger fire — drives the run-history row presentation. Every
7156
+ * recorded fire either dispatched one or more workflow/agent targets, was skipped by
7157
+ * trigger logic, or failed before any target ran.
7158
+ */
7159
+ const WorkspaceTriggerRunOutcomeSchema = discriminatedUnion("kind", [
7160
+ object({
7161
+ kind: literal("dispatched"),
7162
+ targets: array(WorkspaceTriggerRunTargetSchema)
7163
+ }),
7164
+ object({
7165
+ kind: literal("skipped"),
7166
+ reason: WorkspaceTriggerSkipReasonSchema
7167
+ }),
7168
+ object({
7169
+ kind: literal("failed"),
7170
+ error: string()
7171
+ })
7172
+ ]);
7173
+ const WorkspaceTriggerSummarySchema = object({
7174
+ /** `triggers.id` UUID for the trigger row. */
7175
+ id: string(),
7176
+ slug: string(),
7177
+ name: string(),
7178
+ description: string().nullable(),
7179
+ type: TriggerTypeSchema,
7180
+ status: TriggerStatusSchema,
7181
+ projectId: string(),
7182
+ projectName: string(),
7183
+ /** Webhook ingress URL (webhook triggers only). */
7184
+ webhookUrl: string().nullable(),
7185
+ /** Cron expression or poll cadence label (cron/poll triggers only). */
7186
+ schedule: string().nullable(),
7187
+ /** Workflows + agents currently bound to this source. */
7188
+ assignments: array(TriggerAssignmentSchema),
7189
+ lastFiredAt: string().nullable(),
7190
+ fireCount: number$1().int().nonnegative(),
7191
+ createdAt: string()
7192
+ });
7193
+ const WorkspaceTriggerDetailSchema = WorkspaceTriggerSummarySchema.extend({
7194
+ /** Source module file path, relative to the project root. */
7195
+ sourcePath: string() });
7196
+ const WorkspaceTriggerListResponseSchema = array(WorkspaceTriggerSummarySchema);
7197
+ const WorkspaceTriggerRunListResponseSchema = object({
7198
+ items: array(object({
7199
+ id: string(),
7200
+ triggerType: TriggerTypeSchema,
7201
+ triggeredAt: string(),
7202
+ /** Poll/webhook source path or endpoint that produced the fire. */
7203
+ sourcePath: string().nullable(),
7204
+ outcome: WorkspaceTriggerRunOutcomeSchema
7205
+ })),
7206
+ nextCursor: string().nullable()
7207
+ });
7208
+ const WorkspaceTriggerFileSchema = object({
7209
+ path: string(),
7210
+ contents: string()
7211
+ });
7212
+ /** LLM-generated markdown overview envelope served to the web dashboard. */
7213
+ const WorkspaceTriggerOverviewSchema = object({
7214
+ status: _enum([
7215
+ "generating",
7216
+ "ready",
7217
+ "failed"
7218
+ ]),
7219
+ markdown: string(),
7220
+ hash: string(),
7221
+ generatedAt: string().nullable(),
7222
+ model: string()
7223
+ });
7224
+ /** Inputs the worker feeds the LLM to generate a trigger overview. */
7225
+ const TriggerOverviewInputSchema = object({
7226
+ name: string(),
7227
+ description: string().nullable(),
7228
+ type: TriggerTypeSchema,
7229
+ schedule: string().nullable(),
7230
+ sourcePath: string(),
7231
+ sourceContents: string(),
7232
+ assignments: array(TriggerAssignmentSchema)
7233
+ });
7234
+ object({
7235
+ triggerId: string(),
7236
+ projectId: string(),
7237
+ triggerHash: string(),
7238
+ model: string(),
7239
+ input: TriggerOverviewInputSchema
7240
+ });
7241
+ object({ enabled: boolean() });
6538
7242
  const OrganizationMemberRoleSchema = _enum([
6539
7243
  "owner",
6540
7244
  "admin",
@@ -6781,8 +7485,13 @@ const AgentSummarySchema = object({
6781
7485
  description: string().optional(),
6782
7486
  sourcePath: string().min(1).optional(),
6783
7487
  model: string().optional(),
7488
+ systemPrompt: string().optional(),
6784
7489
  toolCount: optionalCount,
6785
7490
  credentialCount: optionalCount,
7491
+ apps: array(object({
7492
+ id: string(),
7493
+ label: string()
7494
+ })).optional(),
6786
7495
  lastRunAt: optionalTimestamp
6787
7496
  });
6788
7497
  const WorkflowSummarySchema = object({
@@ -6895,7 +7604,15 @@ object({
6895
7604
  })),
6896
7605
  generatedAt: isoDateTime
6897
7606
  });
7607
+ const ListAgentMemoryFilesResponseSchema = object({ files: array(object({
7608
+ id: string(),
7609
+ path: string().min(1)
7610
+ })) });
7611
+ const ListAgentWorkspaceFilesResponseSchema = object({ files: array(object({
7612
+ id: string(),
7613
+ path: string().min(1)
7614
+ })) });
6898
7615
  //#endregion
6899
- export { ListCredentialsResponseSchema as $, UpsertGatewayAttachmentBodySchema as $t, CreateOrganizationResponseSchema as A, SlugAvailabilityResponseSchema as At, GetCredentialResponseSchema as B, TriggerRunListResponseSchema as Bt, CreateApiKeyResponseSchema as C, toJSONSchema as Cn, PromptResponseSchema as Ct, CreateCustomAppRequestSchema as D, RecentResourceListResponseSchema as Dt, CreateCredentialsResponseSchema as E, ROUTE_MANIFEST_REL_PATH as Et, CredentialInstanceRecordSchema as F, StoredRouteManifestSchema as Ft, HistoryRunListQuerySchema as G, UpdateOrganizationMemberResponseSchema as Gt, HealthResponseSchema as H, UpdateCredentialInstanceBodySchema as Ht, DeclineOrganizationInvitationResponseSchema as I, SubmitTeamRequestRequestSchema as It, InviteOrganizationMembersResponseSchema as J, UpdateProjectMemberResponseSchema as Jt, HistoryRunListResponseSchema as K, UpdateOrganizationRequestSchema as Kt, DownloadActiveProjectArtifactResponseSchema as L, TriggerDetailResponseSchema as Lt, CreateProjectRequestSchema as M, StartKeystrokeConnectionResultSchema as Mt, CreateProjectResponseSchema as N, StartOAuthConnectionInputSchema as Nt, CreateCustomAppResponseSchema as O, SkillSummaryDetailResponseSchema as Ot, CredentialInstanceListResponseSchema as P, StartOAuthConnectionResultSchema as Pt, ListAppsResponseSchema as Q, UploadProjectSourceResponseSchema as Qt, ErrorResponseSchema as R, TriggerListResponseSchema as Rt, CreateApiKeyRequestSchema as S, union as Sn, PromptInputSchema as St, CreateCredentialsRequestSchema as T, QueuedRunResponseSchema as Tt, HistoryRunCancelResponseSchema as U, UpdateCredentialRequestSchema as Ut, GetCustomAppResponseSchema as V, UpdateChannelBindingBodySchema as Vt, HistoryRunDetailResponseSchema as W, UpdateOrganizationMemberRequestSchema as Wt, InviteProjectMembersResponseSchema as X, UpdateProjectSettingsRequestSchema as Xt, InviteProjectMembersRequestSchema as Y, UpdateProjectRequestSchema as Yt, ListApiKeysResponseSchema as Z, UploadProjectSourceManifestRequestSchema as Zt, ChannelDirectoryListResponseSchema as _, custom as _n, PresignUserAvatarResponseSchema as _t, AgentSessionListResponseSchema as a, WorkflowRunListResponseSchema as an, ListProjectMembersResponseSchema as at, ConnectAuthorizeUrlResponseSchema as b, object as bn, ProjectSettingsResponseSchema as bt, AppSlugAvailabilityResponseSchema as c, listenPortFromPublicUrl as cn, OrganizationSidebarBrandingPatchSchema as ct, CatalogActionsPageResponseSchema as d, parseAppSlug as dn, PollRunResponseSchema as dt, UserAvatarPatchSchema as en, ListOrganizationInvitationsResponseSchema as et, CatalogAppDetailResponseSchema as f, parseErrorResponse as fn, PresignOrgLogoRequestSchema as ft, ChannelConnectionSchema as g, array as gn, PresignUserAvatarRequestSchema as gt, ChannelConnectionListResponseSchema as h, _function as hn, PresignProjectSourceResponseSchema as ht, AgentSessionDetailResponseSchema as i, WorkflowRunDetailResponseSchema as in, ListProjectFilesResponseSchema as it, CreateProjectArtifactResponseSchema as j, StartKeystrokeConnectionInputSchema as jt, CreateOrganizationRequestSchema as k, SkillSummaryListResponseSchema as kt, BindChannelBodySchema as l, normalizeCredentialList as ln, OrganizationSidebarBrandingSchema as lt, ChannelAccountListResponseSchema as m, ZodType as mn, PresignProjectSourceRequestSchema as mt, AcceptOrganizationInvitationResponseSchema as n, UserPreferencesPatchSchema as nn, ListOrganizationsResponseSchema as nt, AgentSummaryDetailResponseSchema as o, WorkflowSummaryDetailResponseSchema as on, ListProjectMetricsResponseSchema as ot, CatalogAppsPageResponseSchema as p, slugifyAppName as pn, PresignOrgLogoResponseSchema as pt, InviteOrganizationMembersRequestSchema as q, UpdateProjectMemberRequestSchema as qt, ActiveOrganizationResponseSchema as r, UserPreferencesSchema as rn, ListProjectDeploymentsResponseSchema as rt, AgentSummaryListResponseSchema as s, WorkflowSummaryListResponseSchema as sn, ListProjectsResponseSchema as st, ACTIVE_ORG_HEADER as t, UserAvatarSchema as tn, ListOrganizationMembersResponseSchema as tt, CatalogActionDetailResponseSchema as u, originFromPublicUrl as un, PROJECT_REACHABILITY_REQUEST_TIMEOUT_MS as ut, ChannelPlatformSchema as v, discriminatedUnion as vn, ProjectReachabilityResponseSchema as vt, CreateCredentialInstanceBodySchema as w, QueuedAgentPromptResponseSchema as wt, ConnectProvidersResponseSchema as x, string as xn, ProjectSlugAvailabilityResponseSchema as xt, CompleteProjectArtifactResponseSchema as y, literal as yn, ProjectResponseSchema as yt, GatewayAttachmentRecordSchema as z, TriggerRunDetailResponseSchema as zt };
7616
+ export { HistoryRunDetailResponseSchema as $, object as $n, TriggerDetailResponseSchema as $t, CreateCustomAppRequestSchema as A, credentialInputSchema as An, PresignUserAvatarRequestSchema as At, CredentialConsumerListQuerySchema as B, ZodType as Bn, ROUTE_MANIFEST_REL_PATH as Bt, ConnectAuthorizeUrlResponseSchema as C, WorkflowSummaryListResponseSchema as Cn, OrganizationSidebarBrandingSchema as Ct, CreateCredentialInstanceBodySchema as D, WorkspaceTriggerOverviewSchema as Dn, PresignOrgLogoResponseSchema as Dt, CreateApiKeyResponseSchema as E, WorkspaceTriggerListResponseSchema as En, PresignOrgLogoRequestSchema as Et, CreateProjectRequestSchema as F, parseErrorResponse as Fn, ProjectSlugAvailabilityResponseSchema as Ft, DownloadActiveProjectArtifactResponseSchema as G, array as Gn, StartKeystrokeConnectionInputSchema as Gt, CredentialInstanceListResponseSchema as H, _function as Hn, SkillSummaryDetailResponseSchema as Ht, CreateProjectResponseSchema as I, parseStoredRouteManifest as In, PromptInputSchema as It, GetCredentialResponseSchema as J, discriminatedUnion as Jn, StartMcpOAuthConnectionResultSchema as Jt, ErrorResponseSchema as K, boolean as Kn, StartKeystrokeConnectionResultSchema as Kt, CredentialAssignmentListQuerySchema as L, resolvePublicPlatformOrigin as Ln, PromptResponseSchema as Lt, CreateOrganizationRequestSchema as M, normalizeCredentialList as Mn, ProjectReachabilityResponseSchema as Mt, CreateOrganizationResponseSchema as N, originFromPublicUrl as Nn, ProjectResponseSchema as Nt, CreateCredentialsRequestSchema as O, WorkspaceTriggerRunListResponseSchema as On, PresignProjectSourceRequestSchema as Ot, CreateProjectArtifactResponseSchema as P, parseAppSlug as Pn, ProjectSettingsResponseSchema as Pt, HistoryRunCancelResponseSchema as Q, number$1 as Qn, SubmitTeamRequestRequestSchema as Qt, CredentialAssignmentListResponseSchema as R, slugifyAppName as Rn, QueuedAgentPromptResponseSchema as Rt, CompleteProjectArtifactResponseSchema as S, WorkflowSummaryDetailResponseSchema as Sn, OrganizationSidebarBrandingPatchSchema as St, CreateApiKeyRequestSchema as T, WorkspaceTriggerFileSchema as Tn, PollRunResponseSchema as Tt, CredentialInstanceRecordSchema as U, _null as Un, SkillSummaryListResponseSchema as Ut, CredentialConsumerListResponseSchema as V, _enum as Vn, RecentResourceListResponseSchema as Vt, DeclineOrganizationInvitationResponseSchema as W, any as Wn, SlugAvailabilityResponseSchema as Wt, GraphqlDiscoverResponseSchema as X, literal as Xn, StartOAuthConnectionResultSchema as Xt, GetCustomAppResponseSchema as Y, intersection as Yn, StartOAuthConnectionInputSchema as Yt, HealthResponseSchema as Z, looseObject as Zn, SubmitMarketingContactRequestSchema as Zt, ChannelAccountListResponseSchema as _, UserAvatarSchema as _n, ListProjectMembersResponseSchema as _t, AgentSessionDetailResponseSchema as a, UpdateCredentialRequestSchema as an, unknown as ar, InviteProjectMembersResponseSchema as at, ChannelDirectoryListResponseSchema as b, WorkflowRunDetailResponseSchema as bn, McpDiscoverResponseSchema as bt, AgentSummaryListResponseSchema as c, UpdateOrganizationRequestSchema as cn, toJSONSchema as cr, ListAgentWorkspaceFilesResponseSchema as ct, AssignCredentialBodySchema as d, UpdateProjectRequestSchema as dn, ListCredentialsResponseSchema as dt, TriggerListResponseSchema as en, optional as er, HistoryRunListQuerySchema as et, BindChannelBodySchema as f, UpdateProjectSettingsRequestSchema as fn, ListOrganizationInvitationsResponseSchema as ft, CatalogAppsPageResponseSchema as g, UserAvatarPatchSchema as gn, ListProjectFilesResponseSchema as gt, CatalogAppDetailResponseSchema as h, UpsertGatewayAttachmentBodySchema as hn, ListProjectDeploymentsResponseSchema as ht, AgentSessionChatStateResponseSchema as i, UpdateCredentialInstanceBodySchema as in, union as ir, InviteProjectMembersRequestSchema as it, CreateCustomAppResponseSchema as j, listenPortFromPublicUrl as jn, PresignUserAvatarResponseSchema as jt, CreateCredentialsResponseSchema as k, buildConnectDeeplink as kn, PresignProjectSourceResponseSchema as kt, AgentTriggerSummaryListResponseSchema as l, UpdateProjectMemberRequestSchema as ln, NEVER as lr, ListApiKeysResponseSchema as lt, CatalogActionsPageResponseSchema as m, UploadProjectSourceResponseSchema as mn, ListOrganizationsResponseSchema as mt, AcceptOrganizationInvitationResponseSchema as n, TriggerRunListResponseSchema as nn, record as nr, InviteOrganizationMembersRequestSchema as nt, AgentSessionListResponseSchema as o, UpdateOrganizationMemberRequestSchema as on, url as or, LOCAL_PLATFORM_ORIGIN as ot, CatalogActionDetailResponseSchema as p, UploadProjectSourceManifestRequestSchema as pn, ListOrganizationMembersResponseSchema as pt, GatewayAttachmentRecordSchema as q, custom as qn, StartMcpOAuthConnectionInputSchema as qt, ActiveOrganizationResponseSchema as r, UpdateChannelBindingBodySchema as rn, string as rr, InviteOrganizationMembersResponseSchema as rt, AgentSummaryDetailResponseSchema as s, UpdateOrganizationMemberResponseSchema as sn, datetime as sr, ListAgentMemoryFilesResponseSchema as st, ACTIVE_ORG_HEADER as t, TriggerRunDetailResponseSchema as tn, preprocess as tr, HistoryRunListResponseSchema as tt, AppSlugAvailabilityResponseSchema as u, UpdateProjectMemberResponseSchema as un, ListAppsResponseSchema as ut, ChannelConnectionListResponseSchema as v, UserPreferencesPatchSchema as vn, ListProjectMetricsResponseSchema as vt, ConnectProvidersResponseSchema as w, WorkspaceTriggerDetailSchema as wn, PROJECT_REACHABILITY_REQUEST_TIMEOUT_MS as wt, ChannelPlatformSchema as x, WorkflowRunListResponseSchema as xn, OpenApiDiscoverResponseSchema as xt, ChannelConnectionSchema as y, UserPreferencesSchema as yn, ListProjectsResponseSchema as yt, CredentialAssignmentRecordSchema as z, number as zn, QueuedRunResponseSchema as zt };
6900
7617
 
6901
- //# sourceMappingURL=dist-C3YClLXV.mjs.map
7618
+ //# sourceMappingURL=dist-YV-kApfg.mjs.map