skedyul 0.1.59 → 0.1.61

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
- 1769032417341
1
+ 1769048098473
@@ -173,9 +173,15 @@ async function diffCommand(args) {
173
173
  // In a full implementation, this would fetch the current deployed config from the server
174
174
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
175
175
  const previousConfig = undefined;
176
- // Compare env schemas
177
- const globalEnvDiff = compareEnvSchemas(config.env, previousConfig?.env);
178
- const installEnvDiff = compareEnvSchemas(config.install?.env, previousConfig?.install?.env);
176
+ // Resolve provision if available (may be a Promise for dynamic imports)
177
+ const provision = config.provision && 'env' in config.provision
178
+ ? config.provision
179
+ : undefined;
180
+ const previousProvision = previousConfig?.provision && 'env' in previousConfig.provision
181
+ ? previousConfig.provision
182
+ : undefined;
183
+ // Compare env schemas (all env is now at provision level)
184
+ const envDiff = compareEnvSchemas(provision?.env, previousProvision?.env);
179
185
  // Compare tools if registry path provided
180
186
  let toolsDiff;
181
187
  const registryPath = (flags.registry || flags.r);
@@ -196,24 +202,17 @@ async function diffCommand(args) {
196
202
  }
197
203
  const result = {
198
204
  configPath,
199
- globalEnv: globalEnvDiff,
200
- installEnv: installEnvDiff,
205
+ env: envDiff,
201
206
  tools: toolsDiff,
202
207
  summary: {
203
- hasChanges: globalEnvDiff.added.length > 0 ||
204
- globalEnvDiff.removed.length > 0 ||
205
- globalEnvDiff.changed.length > 0 ||
206
- installEnvDiff.added.length > 0 ||
207
- installEnvDiff.removed.length > 0 ||
208
- installEnvDiff.changed.length > 0 ||
208
+ hasChanges: envDiff.added.length > 0 ||
209
+ envDiff.removed.length > 0 ||
210
+ envDiff.changed.length > 0 ||
209
211
  (toolsDiff?.added.length ?? 0) > 0 ||
210
212
  (toolsDiff?.removed.length ?? 0) > 0,
211
- globalEnvChanges: globalEnvDiff.added.length +
212
- globalEnvDiff.removed.length +
213
- globalEnvDiff.changed.length,
214
- installEnvChanges: installEnvDiff.added.length +
215
- installEnvDiff.removed.length +
216
- installEnvDiff.changed.length,
213
+ envChanges: envDiff.added.length +
214
+ envDiff.removed.length +
215
+ envDiff.changed.length,
217
216
  toolChanges: (toolsDiff?.added.length ?? 0) + (toolsDiff?.removed.length ?? 0),
218
217
  },
219
218
  };
@@ -231,34 +230,18 @@ async function diffCommand(args) {
231
230
  console.log('ℹ️ Comparing against empty state (new deployment)');
232
231
  console.log('');
233
232
  }
234
- // Global env diff
235
- if (result.summary.globalEnvChanges > 0) {
236
- console.log('Global Environment Variables:');
237
- for (const key of globalEnvDiff.added) {
238
- const def = config.env?.[key];
233
+ // Environment variables diff
234
+ if (result.summary.envChanges > 0) {
235
+ console.log('Environment Variables:');
236
+ for (const key of envDiff.added) {
237
+ const def = provision?.env?.[key];
239
238
  const required = def?.required ? ' (required)' : '';
240
239
  console.log(` + ${key}${required}`);
241
240
  }
242
- for (const key of globalEnvDiff.removed) {
241
+ for (const key of envDiff.removed) {
243
242
  console.log(` - ${key}`);
244
243
  }
245
- for (const item of globalEnvDiff.changed) {
246
- console.log(` ~ ${item.key}: ${item.changes.join(', ')}`);
247
- }
248
- console.log('');
249
- }
250
- // Install env diff
251
- if (result.summary.installEnvChanges > 0) {
252
- console.log('Install Environment Variables:');
253
- for (const key of installEnvDiff.added) {
254
- const def = config.install?.env?.[key];
255
- const required = def?.required ? ' (required)' : '';
256
- console.log(` + ${key}${required}`);
257
- }
258
- for (const key of installEnvDiff.removed) {
259
- console.log(` - ${key}`);
260
- }
261
- for (const item of installEnvDiff.changed) {
244
+ for (const item of envDiff.changed) {
262
245
  console.log(` ~ ${item.key}: ${item.changes.join(', ')}`);
263
246
  }
264
247
  console.log('');
@@ -277,11 +260,8 @@ async function diffCommand(args) {
277
260
  // Summary
278
261
  if (result.summary.hasChanges) {
279
262
  console.log('Summary:');
280
- if (result.summary.globalEnvChanges > 0) {
281
- console.log(` • ${result.summary.globalEnvChanges} global env var change(s)`);
282
- }
283
- if (result.summary.installEnvChanges > 0) {
284
- console.log(` • ${result.summary.installEnvChanges} install env var change(s)`);
263
+ if (result.summary.envChanges > 0) {
264
+ console.log(` • ${result.summary.envChanges} env var change(s)`);
285
265
  }
286
266
  if (result.summary.toolChanges > 0) {
287
267
  console.log(` • ${result.summary.toolChanges} tool change(s)`);
@@ -147,33 +147,27 @@ async function validateCommand(args) {
147
147
  warnings.push('No computeLayer specified. Will default to "dedicated".');
148
148
  }
149
149
  if (!config.tools) {
150
- warnings.push('No tools specified. Will default to "./src/registry.ts".');
150
+ warnings.push('No tools specified.');
151
151
  }
152
- if (!config.workflows) {
153
- warnings.push('No workflows path specified. Will default to "./workflows".');
154
- }
155
- // Check if tools file exists (only for string paths, not dynamic imports)
152
+ // Resolve provision if available (may be a Promise for dynamic imports)
153
+ const provision = config.provision && 'env' in config.provision
154
+ ? config.provision
155
+ : undefined;
156
+ // Check if tools is a dynamic import
156
157
  const toolsConfig = config.tools;
157
158
  const isToolsDynamicImport = toolsConfig !== undefined && typeof toolsConfig !== 'string';
158
- if (!isToolsDynamicImport) {
159
- const toolsPath = toolsConfig || './src/registry.ts';
160
- const absoluteToolsPath = path.resolve(path.dirname(configPath), toolsPath);
161
- if (!fs.existsSync(absoluteToolsPath)) {
162
- // Check for .js variant
163
- const jsToolsPath = absoluteToolsPath.replace(/\.ts$/, '.js');
164
- if (!fs.existsSync(jsToolsPath)) {
165
- warnings.push(`Tools file not found: ${toolsPath}`);
159
+ // Check workflow files exist (provision.workflows contains workflow definitions with paths)
160
+ if (provision?.workflows) {
161
+ for (const workflow of provision.workflows) {
162
+ if (workflow.path) {
163
+ const absoluteWorkflowPath = path.resolve(path.dirname(configPath), workflow.path);
164
+ if (!fs.existsSync(absoluteWorkflowPath)) {
165
+ warnings.push(`Workflow file not found: ${workflow.path}`);
166
+ }
166
167
  }
167
168
  }
168
169
  }
169
- // Check if workflows directory exists
170
- const workflowsPath = config.workflowsPath || './workflows';
171
- const absoluteWorkflowsPath = path.resolve(path.dirname(configPath), workflowsPath);
172
- if (!fs.existsSync(absoluteWorkflowsPath)) {
173
- warnings.push(`Workflows directory not found: ${workflowsPath}`);
174
- }
175
170
  const envKeys = (0, config_1.getAllEnvKeys)(config);
176
- const requiredInstallKeys = (0, config_1.getRequiredInstallEnvKeys)(config);
177
171
  const result = {
178
172
  valid: validation.valid,
179
173
  configPath,
@@ -181,12 +175,12 @@ async function validateCommand(args) {
181
175
  name: config.name,
182
176
  version: config.version,
183
177
  computeLayer: config.computeLayer,
184
- tools: isToolsDynamicImport ? 'dynamic-import' : toolsConfig,
185
- workflowsPath: config.workflowsPath,
186
- globalEnvKeys: envKeys.global,
187
- installEnvKeys: envKeys.install,
188
- requiredInstallEnvKeys: requiredInstallKeys,
189
- appModels: config.install?.appModels?.map((m) => m.entityHandle) || [],
178
+ tools: isToolsDynamicImport ? 'dynamic-import' : (toolsConfig ? 'object' : undefined),
179
+ envKeys: envKeys.global,
180
+ modelHandles: provision?.models?.map((m) => m.handle) || [],
181
+ channelHandles: provision?.channels?.map((c) => c.handle) || [],
182
+ workflowCount: provision?.workflows?.length || 0,
183
+ pageCount: provision?.pages?.length || 0,
190
184
  },
191
185
  errors: validation.errors,
192
186
  warnings,
@@ -204,15 +198,19 @@ async function validateCommand(args) {
204
198
  const toolsDisplay = isToolsDynamicImport
205
199
  ? 'dynamic import (import())'
206
200
  : (toolsConfig || './src/registry.ts (default)');
201
+ // Resolve provision if available (may be a Promise for dynamic imports)
202
+ const provision = config.provision && 'env' in config.provision
203
+ ? config.provision
204
+ : undefined;
207
205
  console.log('Configuration:');
208
206
  console.log(` Compute Layer: ${config.computeLayer || 'dedicated (default)'}`);
209
207
  console.log(` Tools: ${toolsDisplay}`);
210
- console.log(` Workflows: ${config.workflows || './workflows (default)'}`);
208
+ console.log(` Workflows: ${provision?.workflows?.length || 0} workflows`);
211
209
  console.log('');
212
210
  if (envKeys.global.length > 0) {
213
- console.log('Global Environment Variables:');
211
+ console.log('Environment Variables:');
214
212
  for (const key of envKeys.global) {
215
- const def = config.env?.[key];
213
+ const def = provision?.env?.[key];
216
214
  const required = def?.required ? ' (required)' : '';
217
215
  const visibility = def?.visibility === 'encrypted' ? ' 🔒' : '';
218
216
  console.log(` ${key}${required}${visibility}`);
@@ -221,22 +219,17 @@ async function validateCommand(args) {
221
219
  }
222
220
  console.log('');
223
221
  }
224
- if (envKeys.install.length > 0) {
225
- console.log('Install Environment Variables:');
226
- for (const key of envKeys.install) {
227
- const def = config.install?.env?.[key];
228
- const required = def?.required ? ' (required)' : '';
229
- const visibility = def?.visibility === 'encrypted' ? ' 🔒' : '';
230
- console.log(` ${key}${required}${visibility}`);
231
- if (def?.label)
232
- console.log(` └─ ${def.label}`);
222
+ if (provision?.models && provision.models.length > 0) {
223
+ console.log('Models:');
224
+ for (const model of provision.models) {
225
+ console.log(` ${model.handle}: ${model.name} (${model.scope})`);
233
226
  }
234
227
  console.log('');
235
228
  }
236
- if (config.install?.appModels && config.install.appModels.length > 0) {
237
- console.log('App Models:');
238
- for (const model of config.install.appModels) {
239
- console.log(` ${model.entityHandle}: ${model.label}`);
229
+ if (provision?.channels && provision.channels.length > 0) {
230
+ console.log('Channels:');
231
+ for (const channel of provision.channels) {
232
+ console.log(` ${channel.handle}: ${channel.name}`);
240
233
  }
241
234
  console.log('');
242
235
  }
@@ -261,10 +254,10 @@ async function validateCommand(args) {
261
254
  if (validation.valid) {
262
255
  console.log('✅ Config is valid');
263
256
  if (!verbose) {
264
- console.log(` ${envKeys.global.length} global env vars, ${envKeys.install.length} install env vars`);
265
- if (requiredInstallKeys.length > 0) {
266
- console.log(` ${requiredInstallKeys.length} required install vars: ${requiredInstallKeys.join(', ')}`);
267
- }
257
+ const modelCount = provision?.models?.length || 0;
258
+ const channelCount = provision?.channels?.length || 0;
259
+ const workflowCount = provision?.workflows?.length || 0;
260
+ console.log(` ${envKeys.global.length} env vars, ${modelCount} models, ${channelCount} channels, ${workflowCount} workflows`);
268
261
  }
269
262
  }
270
263
  else {