@eigenpal/cli 0.7.0 → 0.7.2

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/cli.js CHANGED
@@ -64331,6 +64331,66 @@ var init_git_source = __esm(() => {
64331
64331
  init_secrets();
64332
64332
  });
64333
64333
 
64334
+ // ../types/src/automation/triggers.ts
64335
+ function workflowMethodEnabled(methods, type) {
64336
+ return methods.some((method) => method.type === type);
64337
+ }
64338
+ function triggersFromWorkflowDefinition(definition) {
64339
+ if (definition.kind === "block")
64340
+ return [];
64341
+ const methods = getTriggerMethods(definition);
64342
+ return [
64343
+ { type: "api", enabled: workflowMethodEnabled(methods, "api") },
64344
+ { type: "manual", enabled: workflowMethodEnabled(methods, "manual") },
64345
+ { type: "email", enabled: workflowMethodEnabled(methods, "email") },
64346
+ { type: "cron", enabled: false }
64347
+ ];
64348
+ }
64349
+ function triggersFromGitManifest(triggers) {
64350
+ const emailEnabled = triggers?.email?.enabled ?? (triggers?.email?.aliases?.length ?? 0) > 0;
64351
+ return [
64352
+ { type: "api", enabled: triggers?.api ?? true },
64353
+ { type: "email", enabled: emailEnabled },
64354
+ { type: "manual", enabled: true },
64355
+ { type: "cron", enabled: false }
64356
+ ];
64357
+ }
64358
+ function isAgentEmailExplicitlyDisabled(config2) {
64359
+ if (!config2 || typeof config2 !== "object" || Array.isArray(config2))
64360
+ return false;
64361
+ const triggers = config2.triggers;
64362
+ if (!triggers || typeof triggers !== "object" || Array.isArray(triggers))
64363
+ return false;
64364
+ const email3 = triggers.email;
64365
+ if (!email3 || typeof email3 !== "object" || Array.isArray(email3))
64366
+ return false;
64367
+ if (!("enabled" in email3))
64368
+ return false;
64369
+ return email3.enabled === false;
64370
+ }
64371
+ function triggersFromAgentConfig(input) {
64372
+ const triggers = workflowTriggerConfigSchema.parse(input.config && typeof input.config === "object" && !Array.isArray(input.config) ? input.config.triggers : undefined);
64373
+ const emailEnabled = input.hasActiveEmailAliases && !isAgentEmailExplicitlyDisabled(input.config);
64374
+ return [
64375
+ { type: "api", enabled: triggers.api.enabled },
64376
+ {
64377
+ type: "email",
64378
+ enabled: emailEnabled
64379
+ },
64380
+ { type: "manual", enabled: true },
64381
+ { type: "cron", enabled: false }
64382
+ ];
64383
+ }
64384
+ function isAutomationTriggerEnabled(rows, type) {
64385
+ return rows.find((row) => row.type === type)?.enabled ?? false;
64386
+ }
64387
+ var AUTOMATION_TRIGGER_TYPES;
64388
+ var init_triggers = __esm(() => {
64389
+ init_email_trigger();
64390
+ init_workflow();
64391
+ AUTOMATION_TRIGGER_TYPES = ["api", "email", "manual", "cron"];
64392
+ });
64393
+
64334
64394
  // ../types/src/api/display-path.ts
64335
64395
  function displayApiPath(path) {
64336
64396
  return path.replace(/\{([^{}/]+)\}/g, ":$1");
@@ -64642,6 +64702,9 @@ __export(exports_src, {
64642
64702
  validateOutput: () => validateOutput,
64643
64703
  validateInput: () => validateInput,
64644
64704
  validateConfig: () => validateConfig,
64705
+ triggersFromWorkflowDefinition: () => triggersFromWorkflowDefinition,
64706
+ triggersFromGitManifest: () => triggersFromGitManifest,
64707
+ triggersFromAgentConfig: () => triggersFromAgentConfig,
64645
64708
  toJsonSchema: () => toJsonSchema,
64646
64709
  suppressRequiredMissingErrorsForSchemaFileFields: () => suppressRequiredMissingErrorsForSchemaFileFields,
64647
64710
  suggestWorkflowName: () => suggestWorkflowName,
@@ -64693,6 +64756,8 @@ __export(exports_src, {
64693
64756
  isLocalAgentResourcePath: () => isLocalAgentResourcePath,
64694
64757
  isFilePathDescriptor: () => isFilePathDescriptor,
64695
64758
  isFileOutput: () => isFileOutput,
64759
+ isAutomationTriggerEnabled: () => isAutomationTriggerEnabled,
64760
+ isAgentEmailExplicitlyDisabled: () => isAgentEmailExplicitlyDisabled,
64696
64761
  hasTriggerMethod: () => hasTriggerMethod,
64697
64762
  goldenFileSatisfiedInResult: () => goldenFileSatisfiedInResult,
64698
64763
  getTriggerMethods: () => getTriggerMethods,
@@ -65008,6 +65073,7 @@ __export(exports_src, {
65008
65073
  ActionInvokeWorkflowConfigSchema: () => ActionInvokeWorkflowConfigSchema,
65009
65074
  ActionHttpOutputSchema: () => ActionHttpOutputSchema,
65010
65075
  ActionHttpConfigSchema: () => ActionHttpConfigSchema,
65076
+ AUTOMATION_TRIGGER_TYPES: () => AUTOMATION_TRIGGER_TYPES,
65011
65077
  AIStepSchema: () => AIStepSchema,
65012
65078
  ACTION_TYPES: () => ACTION_TYPES
65013
65079
  });
@@ -65024,6 +65090,7 @@ var init_src = __esm(() => {
65024
65090
  init_workflow2();
65025
65091
  init_eval();
65026
65092
  init_git_source();
65093
+ init_triggers();
65027
65094
  init_typed_script();
65028
65095
  });
65029
65096
 
@@ -186661,7 +186728,7 @@ import { fileURLToPath as fileURLToPath8 } from "url";
186661
186728
  // package.json
186662
186729
  var package_default = {
186663
186730
  name: "@eigenpal/cli",
186664
- version: "0.7.0",
186731
+ version: "0.7.2",
186665
186732
  description: "Eigenpal CLI — author and run document workflows from your terminal. Agent-ready.",
186666
186733
  keywords: [
186667
186734
  "eigenpal",
@@ -42,8 +42,10 @@ Required. Each entry is an object that adds an invocation surface:
42
42
  - `{ type: manual }` — the workflow can be started manually
43
43
  - `{ type: email, whitelist?: ... }` — inbound email
44
44
 
45
- If `{ type: api }` is missing, `eigenpal run workflows.<slug>` rejects with a
46
- 403 / "Workflow does not have API trigger enabled."
45
+ If `{ type: api }` is missing, `eigenpal run workflows.<slug>` rejects with
46
+ `403` / issue code `api_trigger_disabled` — enable the API trigger in the
47
+ workflow editor or dashboard settings. Runtime gates read the
48
+ `automation_triggers` projection (synced on workflow publish).
47
49
 
48
50
  ### `inputs`
49
51
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eigenpal/cli",
3
- "version": "0.7.0",
3
+ "version": "0.7.2",
4
4
  "description": "Eigenpal CLI — author and run document workflows from your terminal. Agent-ready.",
5
5
  "keywords": [
6
6
  "eigenpal",