skedyul 1.7.11 → 1.7.14

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.
package/dist/.build-stamp CHANGED
@@ -1 +1 @@
1
- 1786058725534
1
+ 1786097937910
package/dist/cli/index.js CHANGED
@@ -1151,6 +1151,12 @@ function parseEnvFieldsFromBlock(envBlock) {
1151
1151
  if (descMatch) field.description = descMatch[1];
1152
1152
  const scopeMatch = varContent.match(/scope\s*:\s*['"`](provision|install)['"`]/);
1153
1153
  if (scopeMatch) field.scope = scopeMatch[1];
1154
+ const installPhaseMatch = varContent.match(
1155
+ /installPhase\s*:\s*['"`](pre_install|post_install)['"`]/
1156
+ );
1157
+ if (installPhaseMatch) {
1158
+ field.installPhase = installPhaseMatch[1];
1159
+ }
1154
1160
  envVars[varName] = field;
1155
1161
  }
1156
1162
  return envVars;
@@ -1258,11 +1264,25 @@ function buildInstallEnvForSync(legacyInstall, provisionConfig) {
1258
1264
  }
1259
1265
  }
1260
1266
  }
1261
- return Object.keys(installEnv).length > 0 ? installEnv : void 0;
1267
+ if (Object.keys(installEnv).length === 0) {
1268
+ return void 0;
1269
+ }
1270
+ const pre = {};
1271
+ const post = {};
1272
+ for (const [key, def] of Object.entries(installEnv)) {
1273
+ if (def.installPhase === "post_install") {
1274
+ post[key] = def;
1275
+ } else {
1276
+ pre[key] = def;
1277
+ }
1278
+ }
1279
+ return { pre, post };
1262
1280
  }
1263
1281
  function filterEnvForInstallWorkflow(env, installConfig) {
1264
1282
  const installKeys = new Set(
1265
- Object.entries(installConfig?.env ?? {}).filter(([, def]) => def.scope === "install").map(([key]) => key)
1283
+ Object.entries(installConfig?.env ?? {}).filter(
1284
+ ([, def]) => def.scope === "install" && def.installPhase !== "post_install"
1285
+ ).map(([key]) => key)
1266
1286
  );
1267
1287
  if (installKeys.size === 0) {
1268
1288
  return {};
@@ -1321,7 +1341,7 @@ async function buildExecutableSyncConfig(registry, inputSchemaToJson, projectDir
1321
1341
  env: buildProvisionEnvFromInstallConfig(legacyInstallConfig.env)
1322
1342
  };
1323
1343
  }
1324
- const installEnv = buildInstallEnvForSync(legacyInstallConfig, provisionConfig ?? null);
1344
+ const installEnvSplit = buildInstallEnvForSync(legacyInstallConfig, provisionConfig ?? null);
1325
1345
  return {
1326
1346
  name: appConfig?.name,
1327
1347
  handle: appConfig?.handle,
@@ -1329,7 +1349,8 @@ async function buildExecutableSyncConfig(registry, inputSchemaToJson, projectDir
1329
1349
  tools,
1330
1350
  ...webhooks.length > 0 ? { webhooks } : {},
1331
1351
  ...provision ? { provision } : {},
1332
- ...installEnv ? { install: { env: installEnv } } : {},
1352
+ ...installEnvSplit && Object.keys(installEnvSplit.pre).length > 0 ? { install: { env: installEnvSplit.pre } } : {},
1353
+ ...installEnvSplit && Object.keys(installEnvSplit.post).length > 0 ? { installPost: { env: installEnvSplit.post } } : {},
1333
1354
  syncedAt: (/* @__PURE__ */ new Date()).toISOString()
1334
1355
  };
1335
1356
  }
@@ -10113,6 +10134,7 @@ var ThreadEventTypeSchema = import_v44.z.enum([
10113
10134
  // Message events
10114
10135
  "thread.message.received",
10115
10136
  "thread.message.sent",
10137
+ "thread.attachment.received",
10116
10138
  // Participant events
10117
10139
  "thread.participant.joined",
10118
10140
  "thread.participant.left",
@@ -23,6 +23,7 @@ export interface InstallEnvField {
23
23
  placeholder?: string;
24
24
  description?: string;
25
25
  scope?: 'provision' | 'install';
26
+ installPhase?: 'pre_install' | 'post_install';
26
27
  }
27
28
  export interface InstallConfigData {
28
29
  env?: Record<string, InstallEnvField>;
@@ -45,7 +46,7 @@ export declare function loadInstallHandler(projectDir?: string): Promise<((ctx:
45
46
  export declare function filterInstallScopedEnv(env: Record<string, InstallEnvField & {
46
47
  scope?: string;
47
48
  }>): Record<string, InstallEnvField>;
48
- /** Env vars passed to the install workflow (install-scoped only). */
49
+ /** Env vars passed to the install workflow (pre_install install-scoped only). */
49
50
  export declare function filterEnvForInstallWorkflow(env: Record<string, string>, installConfig: InstallConfigData | null): Record<string, string>;
50
51
  /**
51
52
  * Load provision config (env, models, pages) directly from src/provision/index.ts.
@@ -0,0 +1,13 @@
1
+ import type { EnvSchema, EnvVariable, InstallPhase } from './types/env';
2
+ export type { InstallPhase };
3
+ /** Default install collection phase when omitted on install-scoped vars. */
4
+ export declare const DEFAULT_INSTALL_PHASE: InstallPhase;
5
+ export declare function resolveInstallPhase(def: Pick<EnvVariable, 'scope' | 'installPhase' | 'required'>): InstallPhase | null;
6
+ export declare function isPreInstallEnvVar(def: Pick<EnvVariable, 'scope' | 'installPhase' | 'required'>): boolean;
7
+ export declare function isPostInstallEnvVar(def: Pick<EnvVariable, 'scope' | 'installPhase' | 'required'>): boolean;
8
+ export declare function filterEnvSchemaByInstallPhase(env: EnvSchema | undefined, phase: InstallPhase): EnvSchema;
9
+ export declare function splitProvisionEnvSchema(env: EnvSchema | undefined): {
10
+ global: EnvSchema;
11
+ preInstall: EnvSchema;
12
+ postInstall: EnvSchema;
13
+ };
@@ -15,3 +15,4 @@ export { defineModel, defineEntity, defineChannel, definePage, defineWorkflow, d
15
15
  export { SCHEMA_FILE_EXTENSIONS, loadSchema, saveSchema, serializeSchemaToJson, serializeSchemaToTypeScript, transformToBackendSchema, transformFromBackendSchema, type LoadSchemaOptions, type LoadSchemaResult, type SerializeSchemaOptions, type BackendModelDefinition, type BackendFieldDefinition, type BackendRelationshipDefinition, type BackendDesiredSchema, } from './schema-loader';
16
16
  export { loadAndResolveConfig, serializeResolvedConfig, type ResolvedConfig } from './resolver';
17
17
  export { getAllEnvKeys, getRequiredInstallEnvKeys } from './utils';
18
+ export { DEFAULT_INSTALL_PHASE, resolveInstallPhase, isPreInstallEnvVar, isPostInstallEnvVar, filterEnvSchemaByInstallPhase, splitProvisionEnvSchema, type InstallPhase, } from './env-phase';
@@ -12,6 +12,12 @@ import type { Visibility } from './base';
12
12
  * - 'install': User-configured during app installation
13
13
  */
14
14
  export type EnvScope = 'provision' | 'install';
15
+ /**
16
+ * When an install-scoped variable is collected from the user vs set by the app/platform.
17
+ * - 'pre_install': user fills on the install page before Install is clicked
18
+ * - 'post_install': set by OAuth callback, install handler, or runtime (never on pre-install form)
19
+ */
20
+ export type InstallPhase = 'pre_install' | 'post_install';
15
21
  /**
16
22
  * Environment variable definition.
17
23
  */
@@ -20,6 +26,8 @@ export interface EnvVariable {
20
26
  label: string;
21
27
  /** Scope: 'provision' (developer) or 'install' (user) */
22
28
  scope?: EnvScope;
29
+ /** When to collect install-scoped vars (default: 'pre_install') */
30
+ installPhase?: InstallPhase;
23
31
  /** Whether this variable is required */
24
32
  required?: boolean;
25
33
  /** Visibility setting: 'visible' or 'encrypted' */
@@ -192,6 +192,42 @@ export declare const communicationChannel: {
192
192
  receiveMessage(input: ReceiveMessageInput): Promise<{
193
193
  messageId: string;
194
194
  }>;
195
+ /**
196
+ * Attach uploaded files to a message created via {@link receiveMessage}.
197
+ *
198
+ * Safe to call before or after the inbox processor creates the ThreadMessage:
199
+ * - Before: attachments are stashed on MessageInbox and linked when the message is created
200
+ * - After: rows are created immediately and `thread.attachment.received` is emitted
201
+ *
202
+ * Typical flow for email/MMS: `receiveMessage` → `file.upload` → `attachFilesToMessage`.
203
+ *
204
+ * @example
205
+ * ```ts
206
+ * const { messageId } = await communicationChannel.receiveMessage({ ... })
207
+ * const uploaded = await file.upload({ content, name, mimeType })
208
+ * await communicationChannel.attachFilesToMessage({
209
+ * messageId,
210
+ * attachments: [{
211
+ * fileId: uploaded.id,
212
+ * name: uploaded.name,
213
+ * mimeType: 'audio/mpeg',
214
+ * size: content.length,
215
+ * }],
216
+ * })
217
+ * ```
218
+ */
219
+ attachFilesToMessage(input: {
220
+ messageId: string;
221
+ attachments: Array<{
222
+ fileId: string;
223
+ name?: string;
224
+ mimeType?: string;
225
+ size?: number;
226
+ }>;
227
+ }): Promise<{
228
+ success: boolean;
229
+ attachmentCount: number;
230
+ }>;
195
231
  /**
196
232
  * Update a communication channel's properties.
197
233
  *
@@ -490,6 +490,7 @@ var ThreadEventTypeSchema = z4.enum([
490
490
  // Message events
491
491
  "thread.message.received",
492
492
  "thread.message.sent",
493
+ "thread.attachment.received",
493
494
  // Participant events
494
495
  "thread.participant.joined",
495
496
  "thread.participant.left",
@@ -1167,8 +1168,11 @@ var AgentYAMLV3Schema = z7.object({
1167
1168
 
1168
1169
  // src/schemas.ts
1169
1170
  var EnvVisibilitySchema = z8.enum(["visible", "encrypted"]);
1171
+ var InstallPhaseSchema = z8.enum(["pre_install", "post_install"]);
1170
1172
  var EnvVariableDefinitionSchema = z8.object({
1171
1173
  label: z8.string(),
1174
+ scope: z8.enum(["provision", "install"]).optional(),
1175
+ installPhase: InstallPhaseSchema.optional(),
1172
1176
  required: z8.boolean().optional(),
1173
1177
  visibility: EnvVisibilitySchema.optional(),
1174
1178
  default: z8.string().optional(),
@@ -2593,6 +2597,40 @@ var communicationChannel = {
2593
2597
  });
2594
2598
  return data;
2595
2599
  },
2600
+ /**
2601
+ * Attach uploaded files to a message created via {@link receiveMessage}.
2602
+ *
2603
+ * Safe to call before or after the inbox processor creates the ThreadMessage:
2604
+ * - Before: attachments are stashed on MessageInbox and linked when the message is created
2605
+ * - After: rows are created immediately and `thread.attachment.received` is emitted
2606
+ *
2607
+ * Typical flow for email/MMS: `receiveMessage` → `file.upload` → `attachFilesToMessage`.
2608
+ *
2609
+ * @example
2610
+ * ```ts
2611
+ * const { messageId } = await communicationChannel.receiveMessage({ ... })
2612
+ * const uploaded = await file.upload({ content, name, mimeType })
2613
+ * await communicationChannel.attachFilesToMessage({
2614
+ * messageId,
2615
+ * attachments: [{
2616
+ * fileId: uploaded.id,
2617
+ * name: uploaded.name,
2618
+ * mimeType: 'audio/mpeg',
2619
+ * size: content.length,
2620
+ * }],
2621
+ * })
2622
+ * ```
2623
+ */
2624
+ async attachFilesToMessage(input) {
2625
+ const { data } = await callCore(
2626
+ "communicationChannel.attachFilesToMessage",
2627
+ {
2628
+ messageId: input.messageId,
2629
+ attachments: input.attachments
2630
+ }
2631
+ );
2632
+ return data;
2633
+ },
2596
2634
  /**
2597
2635
  * Update a communication channel's properties.
2598
2636
  *
@@ -6262,6 +6300,24 @@ import * as os from "os";
6262
6300
  import * as fs5 from "fs";
6263
6301
  import * as path5 from "path";
6264
6302
 
6303
+ // src/config/env-phase.ts
6304
+ var DEFAULT_INSTALL_PHASE = "pre_install";
6305
+ function resolveInstallPhase(def) {
6306
+ if (def.scope === "provision") {
6307
+ return null;
6308
+ }
6309
+ if (def.installPhase === "post_install" || def.installPhase === "pre_install") {
6310
+ return def.installPhase;
6311
+ }
6312
+ if (def.scope === "install") {
6313
+ return def.required ? "pre_install" : "post_install";
6314
+ }
6315
+ return DEFAULT_INSTALL_PHASE;
6316
+ }
6317
+ function isPreInstallEnvVar(def) {
6318
+ return resolveInstallPhase(def) === "pre_install";
6319
+ }
6320
+
6265
6321
  // src/config/utils.ts
6266
6322
  function getAllEnvKeys(config) {
6267
6323
  const provision = config.provision && "env" in config.provision ? config.provision : void 0;
@@ -6274,7 +6330,7 @@ function getAllEnvKeys(config) {
6274
6330
  function getRequiredInstallEnvKeys(config) {
6275
6331
  const provision = config.provision && "env" in config.provision ? config.provision : void 0;
6276
6332
  if (!provision?.env) return [];
6277
- return Object.entries(provision.env).filter(([, def]) => def.required).map(([key]) => key);
6333
+ return Object.entries(provision.env).filter(([, def]) => def.scope === "install" && isPreInstallEnvVar(def) && def.required).map(([key]) => key);
6278
6334
  }
6279
6335
 
6280
6336
  // src/ratelimit/resolve-queue-key.ts
@@ -8779,6 +8835,7 @@ export {
8779
8835
  InputMappingSchema,
8780
8836
  InstallConfigSchema,
8781
8837
  InstallError,
8838
+ InstallPhaseSchema,
8782
8839
  InvalidConfigurationError,
8783
8840
  LegacyFormBlockDefinitionSchema,
8784
8841
  ListBlockDefinitionSchema,
@@ -6,6 +6,7 @@ import { z } from 'zod/v4';
6
6
  export declare const ThreadEventTypeSchema: z.ZodEnum<{
7
7
  "thread.message.received": "thread.message.received";
8
8
  "thread.message.sent": "thread.message.sent";
9
+ "thread.attachment.received": "thread.attachment.received";
9
10
  "thread.participant.joined": "thread.participant.joined";
10
11
  "thread.participant.left": "thread.participant.left";
11
12
  "thread.participant.mentioned": "thread.participant.mentioned";
@@ -32,6 +33,7 @@ export type CustomEventType = z.infer<typeof CustomEventTypeSchema>;
32
33
  export declare const EventTypeSchema: z.ZodUnion<readonly [z.ZodEnum<{
33
34
  "thread.message.received": "thread.message.received";
34
35
  "thread.message.sent": "thread.message.sent";
36
+ "thread.attachment.received": "thread.attachment.received";
35
37
  "thread.participant.joined": "thread.participant.joined";
36
38
  "thread.participant.left": "thread.participant.left";
37
39
  "thread.participant.mentioned": "thread.participant.mentioned";
@@ -274,6 +276,7 @@ export declare const ThreadEventSchema: z.ZodObject<{
274
276
  type: z.ZodUnion<readonly [z.ZodEnum<{
275
277
  "thread.message.received": "thread.message.received";
276
278
  "thread.message.sent": "thread.message.sent";
279
+ "thread.attachment.received": "thread.attachment.received";
277
280
  "thread.participant.joined": "thread.participant.joined";
278
281
  "thread.participant.left": "thread.participant.left";
279
282
  "thread.participant.mentioned": "thread.participant.mentioned";
@@ -380,6 +383,7 @@ export declare const CreateThreadEventInputSchema: z.ZodObject<{
380
383
  type: z.ZodUnion<readonly [z.ZodEnum<{
381
384
  "thread.message.received": "thread.message.received";
382
385
  "thread.message.sent": "thread.message.sent";
386
+ "thread.attachment.received": "thread.attachment.received";
383
387
  "thread.participant.joined": "thread.participant.joined";
384
388
  "thread.participant.left": "thread.participant.left";
385
389
  "thread.participant.mentioned": "thread.participant.mentioned";
@@ -404,6 +408,7 @@ export declare const EventSubscriptionSchema: z.ZodObject<{
404
408
  subscribes: z.ZodArray<z.ZodUnion<readonly [z.ZodEnum<{
405
409
  "thread.message.received": "thread.message.received";
406
410
  "thread.message.sent": "thread.message.sent";
411
+ "thread.attachment.received": "thread.attachment.received";
407
412
  "thread.participant.joined": "thread.participant.joined";
408
413
  "thread.participant.left": "thread.participant.left";
409
414
  "thread.participant.mentioned": "thread.participant.mentioned";
@@ -421,6 +426,7 @@ export declare const EventSubscriptionSchema: z.ZodObject<{
421
426
  cancels: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodEnum<{
422
427
  "thread.message.received": "thread.message.received";
423
428
  "thread.message.sent": "thread.message.sent";
429
+ "thread.attachment.received": "thread.attachment.received";
424
430
  "thread.participant.joined": "thread.participant.joined";
425
431
  "thread.participant.left": "thread.participant.left";
426
432
  "thread.participant.mentioned": "thread.participant.mentioned";
@@ -444,6 +450,7 @@ export declare const EventWaitSchema: z.ZodObject<{
444
450
  event: z.ZodUnion<readonly [z.ZodEnum<{
445
451
  "thread.message.received": "thread.message.received";
446
452
  "thread.message.sent": "thread.message.sent";
453
+ "thread.attachment.received": "thread.attachment.received";
447
454
  "thread.participant.joined": "thread.participant.joined";
448
455
  "thread.participant.left": "thread.participant.left";
449
456
  "thread.participant.mentioned": "thread.participant.mentioned";
@@ -468,6 +475,7 @@ export declare const EventsConfigSchema: z.ZodObject<{
468
475
  subscribes: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodEnum<{
469
476
  "thread.message.received": "thread.message.received";
470
477
  "thread.message.sent": "thread.message.sent";
478
+ "thread.attachment.received": "thread.attachment.received";
471
479
  "thread.participant.joined": "thread.participant.joined";
472
480
  "thread.participant.left": "thread.participant.left";
473
481
  "thread.participant.mentioned": "thread.participant.mentioned";
@@ -485,6 +493,7 @@ export declare const EventsConfigSchema: z.ZodObject<{
485
493
  emits: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodEnum<{
486
494
  "thread.message.received": "thread.message.received";
487
495
  "thread.message.sent": "thread.message.sent";
496
+ "thread.attachment.received": "thread.attachment.received";
488
497
  "thread.participant.joined": "thread.participant.joined";
489
498
  "thread.participant.left": "thread.participant.left";
490
499
  "thread.participant.mentioned": "thread.participant.mentioned";
@@ -502,6 +511,7 @@ export declare const EventsConfigSchema: z.ZodObject<{
502
511
  event: z.ZodUnion<readonly [z.ZodEnum<{
503
512
  "thread.message.received": "thread.message.received";
504
513
  "thread.message.sent": "thread.message.sent";
514
+ "thread.attachment.received": "thread.attachment.received";
505
515
  "thread.participant.joined": "thread.participant.joined";
506
516
  "thread.participant.left": "thread.participant.left";
507
517
  "thread.participant.mentioned": "thread.participant.mentioned";
@@ -521,6 +531,7 @@ export declare const EventsConfigSchema: z.ZodObject<{
521
531
  cancels: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodEnum<{
522
532
  "thread.message.received": "thread.message.received";
523
533
  "thread.message.sent": "thread.message.sent";
534
+ "thread.attachment.received": "thread.attachment.received";
524
535
  "thread.participant.joined": "thread.participant.joined";
525
536
  "thread.participant.left": "thread.participant.left";
526
537
  "thread.participant.mentioned": "thread.participant.mentioned";
package/dist/index.js CHANGED
@@ -125,6 +125,7 @@ __export(index_exports, {
125
125
  InputMappingSchema: () => InputMappingSchema,
126
126
  InstallConfigSchema: () => InstallConfigSchema,
127
127
  InstallError: () => InstallError,
128
+ InstallPhaseSchema: () => InstallPhaseSchema,
128
129
  InvalidConfigurationError: () => InvalidConfigurationError,
129
130
  LegacyFormBlockDefinitionSchema: () => LegacyFormBlockDefinitionSchema,
130
131
  ListBlockDefinitionSchema: () => ListBlockDefinitionSchema,
@@ -871,6 +872,7 @@ var ThreadEventTypeSchema = import_v44.z.enum([
871
872
  // Message events
872
873
  "thread.message.received",
873
874
  "thread.message.sent",
875
+ "thread.attachment.received",
874
876
  // Participant events
875
877
  "thread.participant.joined",
876
878
  "thread.participant.left",
@@ -1548,8 +1550,11 @@ var AgentYAMLV3Schema = import_v47.z.object({
1548
1550
 
1549
1551
  // src/schemas.ts
1550
1552
  var EnvVisibilitySchema = import_v48.z.enum(["visible", "encrypted"]);
1553
+ var InstallPhaseSchema = import_v48.z.enum(["pre_install", "post_install"]);
1551
1554
  var EnvVariableDefinitionSchema = import_v48.z.object({
1552
1555
  label: import_v48.z.string(),
1556
+ scope: import_v48.z.enum(["provision", "install"]).optional(),
1557
+ installPhase: InstallPhaseSchema.optional(),
1553
1558
  required: import_v48.z.boolean().optional(),
1554
1559
  visibility: EnvVisibilitySchema.optional(),
1555
1560
  default: import_v48.z.string().optional(),
@@ -2974,6 +2979,40 @@ var communicationChannel = {
2974
2979
  });
2975
2980
  return data;
2976
2981
  },
2982
+ /**
2983
+ * Attach uploaded files to a message created via {@link receiveMessage}.
2984
+ *
2985
+ * Safe to call before or after the inbox processor creates the ThreadMessage:
2986
+ * - Before: attachments are stashed on MessageInbox and linked when the message is created
2987
+ * - After: rows are created immediately and `thread.attachment.received` is emitted
2988
+ *
2989
+ * Typical flow for email/MMS: `receiveMessage` → `file.upload` → `attachFilesToMessage`.
2990
+ *
2991
+ * @example
2992
+ * ```ts
2993
+ * const { messageId } = await communicationChannel.receiveMessage({ ... })
2994
+ * const uploaded = await file.upload({ content, name, mimeType })
2995
+ * await communicationChannel.attachFilesToMessage({
2996
+ * messageId,
2997
+ * attachments: [{
2998
+ * fileId: uploaded.id,
2999
+ * name: uploaded.name,
3000
+ * mimeType: 'audio/mpeg',
3001
+ * size: content.length,
3002
+ * }],
3003
+ * })
3004
+ * ```
3005
+ */
3006
+ async attachFilesToMessage(input) {
3007
+ const { data } = await callCore(
3008
+ "communicationChannel.attachFilesToMessage",
3009
+ {
3010
+ messageId: input.messageId,
3011
+ attachments: input.attachments
3012
+ }
3013
+ );
3014
+ return data;
3015
+ },
2977
3016
  /**
2978
3017
  * Update a communication channel's properties.
2979
3018
  *
@@ -6643,6 +6682,24 @@ var os = __toESM(require("os"));
6643
6682
  var fs5 = __toESM(require("fs"));
6644
6683
  var path5 = __toESM(require("path"));
6645
6684
 
6685
+ // src/config/env-phase.ts
6686
+ var DEFAULT_INSTALL_PHASE = "pre_install";
6687
+ function resolveInstallPhase(def) {
6688
+ if (def.scope === "provision") {
6689
+ return null;
6690
+ }
6691
+ if (def.installPhase === "post_install" || def.installPhase === "pre_install") {
6692
+ return def.installPhase;
6693
+ }
6694
+ if (def.scope === "install") {
6695
+ return def.required ? "pre_install" : "post_install";
6696
+ }
6697
+ return DEFAULT_INSTALL_PHASE;
6698
+ }
6699
+ function isPreInstallEnvVar(def) {
6700
+ return resolveInstallPhase(def) === "pre_install";
6701
+ }
6702
+
6646
6703
  // src/config/utils.ts
6647
6704
  function getAllEnvKeys(config) {
6648
6705
  const provision = config.provision && "env" in config.provision ? config.provision : void 0;
@@ -6655,7 +6712,7 @@ function getAllEnvKeys(config) {
6655
6712
  function getRequiredInstallEnvKeys(config) {
6656
6713
  const provision = config.provision && "env" in config.provision ? config.provision : void 0;
6657
6714
  if (!provision?.env) return [];
6658
- return Object.entries(provision.env).filter(([, def]) => def.required).map(([key]) => key);
6715
+ return Object.entries(provision.env).filter(([, def]) => def.scope === "install" && isPreInstallEnvVar(def) && def.required).map(([key]) => key);
6659
6716
  }
6660
6717
 
6661
6718
  // src/ratelimit/resolve-queue-key.ts
@@ -9161,6 +9218,7 @@ var index_default = { z: import_v414.z };
9161
9218
  InputMappingSchema,
9162
9219
  InstallConfigSchema,
9163
9220
  InstallError,
9221
+ InstallPhaseSchema,
9164
9222
  InvalidConfigurationError,
9165
9223
  LegacyFormBlockDefinitionSchema,
9166
9224
  ListBlockDefinitionSchema,
@@ -528,6 +528,7 @@ export declare const AgentYAMLV3Schema: z.ZodObject<{
528
528
  subscribes: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodEnum<{
529
529
  "thread.message.received": "thread.message.received";
530
530
  "thread.message.sent": "thread.message.sent";
531
+ "thread.attachment.received": "thread.attachment.received";
531
532
  "thread.participant.joined": "thread.participant.joined";
532
533
  "thread.participant.left": "thread.participant.left";
533
534
  "thread.participant.mentioned": "thread.participant.mentioned";
@@ -545,6 +546,7 @@ export declare const AgentYAMLV3Schema: z.ZodObject<{
545
546
  emits: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodEnum<{
546
547
  "thread.message.received": "thread.message.received";
547
548
  "thread.message.sent": "thread.message.sent";
549
+ "thread.attachment.received": "thread.attachment.received";
548
550
  "thread.participant.joined": "thread.participant.joined";
549
551
  "thread.participant.left": "thread.participant.left";
550
552
  "thread.participant.mentioned": "thread.participant.mentioned";
@@ -562,6 +564,7 @@ export declare const AgentYAMLV3Schema: z.ZodObject<{
562
564
  event: z.ZodUnion<readonly [z.ZodEnum<{
563
565
  "thread.message.received": "thread.message.received";
564
566
  "thread.message.sent": "thread.message.sent";
567
+ "thread.attachment.received": "thread.attachment.received";
565
568
  "thread.participant.joined": "thread.participant.joined";
566
569
  "thread.participant.left": "thread.participant.left";
567
570
  "thread.participant.mentioned": "thread.participant.mentioned";
@@ -581,6 +584,7 @@ export declare const AgentYAMLV3Schema: z.ZodObject<{
581
584
  cancels: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodEnum<{
582
585
  "thread.message.received": "thread.message.received";
583
586
  "thread.message.sent": "thread.message.sent";
587
+ "thread.attachment.received": "thread.attachment.received";
584
588
  "thread.participant.joined": "thread.participant.joined";
585
589
  "thread.participant.left": "thread.participant.left";
586
590
  "thread.participant.mentioned": "thread.participant.mentioned";
@@ -62,6 +62,7 @@ var ThreadEventTypeSchema = import_v4.z.enum([
62
62
  // Message events
63
63
  "thread.message.received",
64
64
  "thread.message.sent",
65
+ "thread.attachment.received",
65
66
  // Participant events
66
67
  "thread.participant.joined",
67
68
  "thread.participant.left",
@@ -9,6 +9,7 @@ var ThreadEventTypeSchema = z.enum([
9
9
  // Message events
10
10
  "thread.message.received",
11
11
  "thread.message.sent",
12
+ "thread.attachment.received",
12
13
  // Participant events
13
14
  "thread.participant.joined",
14
15
  "thread.participant.left",
package/dist/schemas.d.ts CHANGED
@@ -3,8 +3,20 @@ export declare const EnvVisibilitySchema: z.ZodEnum<{
3
3
  visible: "visible";
4
4
  encrypted: "encrypted";
5
5
  }>;
6
+ export declare const InstallPhaseSchema: z.ZodEnum<{
7
+ pre_install: "pre_install";
8
+ post_install: "post_install";
9
+ }>;
6
10
  export declare const EnvVariableDefinitionSchema: z.ZodObject<{
7
11
  label: z.ZodString;
12
+ scope: z.ZodOptional<z.ZodEnum<{
13
+ provision: "provision";
14
+ install: "install";
15
+ }>>;
16
+ installPhase: z.ZodOptional<z.ZodEnum<{
17
+ pre_install: "pre_install";
18
+ post_install: "post_install";
19
+ }>>;
8
20
  required: z.ZodOptional<z.ZodBoolean>;
9
21
  visibility: z.ZodOptional<z.ZodEnum<{
10
22
  visible: "visible";
@@ -16,6 +28,14 @@ export declare const EnvVariableDefinitionSchema: z.ZodObject<{
16
28
  }, z.core.$strip>;
17
29
  export declare const EnvSchemaSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
18
30
  label: z.ZodString;
31
+ scope: z.ZodOptional<z.ZodEnum<{
32
+ provision: "provision";
33
+ install: "install";
34
+ }>>;
35
+ installPhase: z.ZodOptional<z.ZodEnum<{
36
+ pre_install: "pre_install";
37
+ post_install: "post_install";
38
+ }>>;
19
39
  required: z.ZodOptional<z.ZodBoolean>;
20
40
  visibility: z.ZodOptional<z.ZodEnum<{
21
41
  visible: "visible";
@@ -329,6 +349,14 @@ export declare const ModelDefinitionSchema: z.ZodObject<{
329
349
  page: z.ZodOptional<z.ZodString>;
330
350
  env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
331
351
  label: z.ZodString;
352
+ scope: z.ZodOptional<z.ZodEnum<{
353
+ provision: "provision";
354
+ install: "install";
355
+ }>>;
356
+ installPhase: z.ZodOptional<z.ZodEnum<{
357
+ pre_install: "pre_install";
358
+ post_install: "post_install";
359
+ }>>;
332
360
  required: z.ZodOptional<z.ZodBoolean>;
333
361
  visibility: z.ZodOptional<z.ZodEnum<{
334
362
  visible: "visible";
@@ -3202,6 +3230,14 @@ export type AgentDefinition = z.infer<typeof AgentDefinitionSchema>;
3202
3230
  export declare const InstallConfigSchema: z.ZodObject<{
3203
3231
  env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
3204
3232
  label: z.ZodString;
3233
+ scope: z.ZodOptional<z.ZodEnum<{
3234
+ provision: "provision";
3235
+ install: "install";
3236
+ }>>;
3237
+ installPhase: z.ZodOptional<z.ZodEnum<{
3238
+ pre_install: "pre_install";
3239
+ post_install: "post_install";
3240
+ }>>;
3205
3241
  required: z.ZodOptional<z.ZodBoolean>;
3206
3242
  visibility: z.ZodOptional<z.ZodEnum<{
3207
3243
  visible: "visible";
@@ -3301,6 +3337,14 @@ export declare const InstallConfigSchema: z.ZodObject<{
3301
3337
  page: z.ZodOptional<z.ZodString>;
3302
3338
  env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
3303
3339
  label: z.ZodString;
3340
+ scope: z.ZodOptional<z.ZodEnum<{
3341
+ provision: "provision";
3342
+ install: "install";
3343
+ }>>;
3344
+ installPhase: z.ZodOptional<z.ZodEnum<{
3345
+ pre_install: "pre_install";
3346
+ post_install: "post_install";
3347
+ }>>;
3304
3348
  required: z.ZodOptional<z.ZodBoolean>;
3305
3349
  visibility: z.ZodOptional<z.ZodEnum<{
3306
3350
  visible: "visible";
@@ -3410,6 +3454,14 @@ export declare const BatchOperationDefinitionSchema: z.ZodObject<{
3410
3454
  export declare const ProvisionConfigSchema: z.ZodObject<{
3411
3455
  env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
3412
3456
  label: z.ZodString;
3457
+ scope: z.ZodOptional<z.ZodEnum<{
3458
+ provision: "provision";
3459
+ install: "install";
3460
+ }>>;
3461
+ installPhase: z.ZodOptional<z.ZodEnum<{
3462
+ pre_install: "pre_install";
3463
+ post_install: "post_install";
3464
+ }>>;
3413
3465
  required: z.ZodOptional<z.ZodBoolean>;
3414
3466
  visibility: z.ZodOptional<z.ZodEnum<{
3415
3467
  visible: "visible";
@@ -3509,6 +3561,14 @@ export declare const ProvisionConfigSchema: z.ZodObject<{
3509
3561
  page: z.ZodOptional<z.ZodString>;
3510
3562
  env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
3511
3563
  label: z.ZodString;
3564
+ scope: z.ZodOptional<z.ZodEnum<{
3565
+ provision: "provision";
3566
+ install: "install";
3567
+ }>>;
3568
+ installPhase: z.ZodOptional<z.ZodEnum<{
3569
+ pre_install: "pre_install";
3570
+ post_install: "post_install";
3571
+ }>>;
3512
3572
  required: z.ZodOptional<z.ZodBoolean>;
3513
3573
  visibility: z.ZodOptional<z.ZodEnum<{
3514
3574
  visible: "visible";
@@ -4243,6 +4303,14 @@ export declare const SkedyulConfigSchema: z.ZodObject<{
4243
4303
  provision: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
4244
4304
  env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
4245
4305
  label: z.ZodString;
4306
+ scope: z.ZodOptional<z.ZodEnum<{
4307
+ provision: "provision";
4308
+ install: "install";
4309
+ }>>;
4310
+ installPhase: z.ZodOptional<z.ZodEnum<{
4311
+ pre_install: "pre_install";
4312
+ post_install: "post_install";
4313
+ }>>;
4246
4314
  required: z.ZodOptional<z.ZodBoolean>;
4247
4315
  visibility: z.ZodOptional<z.ZodEnum<{
4248
4316
  visible: "visible";
@@ -4342,6 +4410,14 @@ export declare const SkedyulConfigSchema: z.ZodObject<{
4342
4410
  page: z.ZodOptional<z.ZodString>;
4343
4411
  env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
4344
4412
  label: z.ZodString;
4413
+ scope: z.ZodOptional<z.ZodEnum<{
4414
+ provision: "provision";
4415
+ install: "install";
4416
+ }>>;
4417
+ installPhase: z.ZodOptional<z.ZodEnum<{
4418
+ pre_install: "pre_install";
4419
+ post_install: "post_install";
4420
+ }>>;
4345
4421
  required: z.ZodOptional<z.ZodBoolean>;
4346
4422
  visibility: z.ZodOptional<z.ZodEnum<{
4347
4423
  visible: "visible";
@@ -62,6 +62,7 @@ export declare const TriggerContextSchema: z.ZodObject<{
62
62
  type: z.ZodUnion<readonly [z.ZodEnum<{
63
63
  "thread.message.received": "thread.message.received";
64
64
  "thread.message.sent": "thread.message.sent";
65
+ "thread.attachment.received": "thread.attachment.received";
65
66
  "thread.participant.joined": "thread.participant.joined";
66
67
  "thread.participant.left": "thread.participant.left";
67
68
  "thread.participant.mentioned": "thread.participant.mentioned";
@@ -189,6 +190,7 @@ export declare const ResolvedTriggerSchema: z.ZodObject<{
189
190
  subscribes: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodEnum<{
190
191
  "thread.message.received": "thread.message.received";
191
192
  "thread.message.sent": "thread.message.sent";
193
+ "thread.attachment.received": "thread.attachment.received";
192
194
  "thread.participant.joined": "thread.participant.joined";
193
195
  "thread.participant.left": "thread.participant.left";
194
196
  "thread.participant.mentioned": "thread.participant.mentioned";
@@ -211,6 +213,7 @@ export declare const ResolvedTriggerSchema: z.ZodObject<{
211
213
  type: z.ZodUnion<readonly [z.ZodEnum<{
212
214
  "thread.message.received": "thread.message.received";
213
215
  "thread.message.sent": "thread.message.sent";
216
+ "thread.attachment.received": "thread.attachment.received";
214
217
  "thread.participant.joined": "thread.participant.joined";
215
218
  "thread.participant.left": "thread.participant.left";
216
219
  "thread.participant.mentioned": "thread.participant.mentioned";
@@ -71,6 +71,7 @@ export declare const WorkflowYAMLSchema: z.ZodObject<{
71
71
  subscribes: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodEnum<{
72
72
  "thread.message.received": "thread.message.received";
73
73
  "thread.message.sent": "thread.message.sent";
74
+ "thread.attachment.received": "thread.attachment.received";
74
75
  "thread.participant.joined": "thread.participant.joined";
75
76
  "thread.participant.left": "thread.participant.left";
76
77
  "thread.participant.mentioned": "thread.participant.mentioned";
@@ -88,6 +89,7 @@ export declare const WorkflowYAMLSchema: z.ZodObject<{
88
89
  emits: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodEnum<{
89
90
  "thread.message.received": "thread.message.received";
90
91
  "thread.message.sent": "thread.message.sent";
92
+ "thread.attachment.received": "thread.attachment.received";
91
93
  "thread.participant.joined": "thread.participant.joined";
92
94
  "thread.participant.left": "thread.participant.left";
93
95
  "thread.participant.mentioned": "thread.participant.mentioned";
@@ -105,6 +107,7 @@ export declare const WorkflowYAMLSchema: z.ZodObject<{
105
107
  event: z.ZodUnion<readonly [z.ZodEnum<{
106
108
  "thread.message.received": "thread.message.received";
107
109
  "thread.message.sent": "thread.message.sent";
110
+ "thread.attachment.received": "thread.attachment.received";
108
111
  "thread.participant.joined": "thread.participant.joined";
109
112
  "thread.participant.left": "thread.participant.left";
110
113
  "thread.participant.mentioned": "thread.participant.mentioned";
@@ -124,6 +127,7 @@ export declare const WorkflowYAMLSchema: z.ZodObject<{
124
127
  cancels: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodEnum<{
125
128
  "thread.message.received": "thread.message.received";
126
129
  "thread.message.sent": "thread.message.sent";
130
+ "thread.attachment.received": "thread.attachment.received";
127
131
  "thread.participant.joined": "thread.participant.joined";
128
132
  "thread.participant.left": "thread.participant.left";
129
133
  "thread.participant.mentioned": "thread.participant.mentioned";
@@ -185,6 +189,7 @@ export declare const WorkflowMetadataSchema: z.ZodObject<{
185
189
  subscribes: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodEnum<{
186
190
  "thread.message.received": "thread.message.received";
187
191
  "thread.message.sent": "thread.message.sent";
192
+ "thread.attachment.received": "thread.attachment.received";
188
193
  "thread.participant.joined": "thread.participant.joined";
189
194
  "thread.participant.left": "thread.participant.left";
190
195
  "thread.participant.mentioned": "thread.participant.mentioned";
@@ -202,6 +207,7 @@ export declare const WorkflowMetadataSchema: z.ZodObject<{
202
207
  emits: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodEnum<{
203
208
  "thread.message.received": "thread.message.received";
204
209
  "thread.message.sent": "thread.message.sent";
210
+ "thread.attachment.received": "thread.attachment.received";
205
211
  "thread.participant.joined": "thread.participant.joined";
206
212
  "thread.participant.left": "thread.participant.left";
207
213
  "thread.participant.mentioned": "thread.participant.mentioned";
@@ -219,6 +225,7 @@ export declare const WorkflowMetadataSchema: z.ZodObject<{
219
225
  event: z.ZodUnion<readonly [z.ZodEnum<{
220
226
  "thread.message.received": "thread.message.received";
221
227
  "thread.message.sent": "thread.message.sent";
228
+ "thread.attachment.received": "thread.attachment.received";
222
229
  "thread.participant.joined": "thread.participant.joined";
223
230
  "thread.participant.left": "thread.participant.left";
224
231
  "thread.participant.mentioned": "thread.participant.mentioned";
@@ -238,6 +245,7 @@ export declare const WorkflowMetadataSchema: z.ZodObject<{
238
245
  cancels: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodEnum<{
239
246
  "thread.message.received": "thread.message.received";
240
247
  "thread.message.sent": "thread.message.sent";
248
+ "thread.attachment.received": "thread.attachment.received";
241
249
  "thread.participant.joined": "thread.participant.joined";
242
250
  "thread.participant.left": "thread.participant.left";
243
251
  "thread.participant.mentioned": "thread.participant.mentioned";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "skedyul",
3
- "version": "1.7.11",
3
+ "version": "1.7.14",
4
4
  "description": "The Skedyul SDK for Node.js",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",