poe-code 3.0.146 → 3.0.147

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/index.js CHANGED
@@ -17968,6 +17968,30 @@ var init_require_comment_prefix = __esm({
17968
17968
  }
17969
17969
  });
17970
17970
 
17971
+ // packages/github-workflows/src/preflight.ts
17972
+ function runPreflightChecks(context) {
17973
+ checkRequiredEnvVar(context.env, "POE_API_KEY");
17974
+ checkNodeVersion(context.nodeVersion);
17975
+ }
17976
+ function checkRequiredEnvVar(env, key) {
17977
+ const value = env.get(key);
17978
+ if (value === void 0 || value === "") {
17979
+ throw new UserError(`Missing required environment variable: ${key}`);
17980
+ }
17981
+ }
17982
+ function checkNodeVersion(version) {
17983
+ const major = Number.parseInt(version.replace(/^v/, ""), 10);
17984
+ if (Number.isNaN(major) || major < 18) {
17985
+ throw new UserError(`Node.js 18 or later is required (current: ${version}).`);
17986
+ }
17987
+ }
17988
+ var init_preflight = __esm({
17989
+ "packages/github-workflows/src/preflight.ts"() {
17990
+ "use strict";
17991
+ init_src16();
17992
+ }
17993
+ });
17994
+
17971
17995
  // packages/github-workflows/src/setup-agent.ts
17972
17996
  function formatCommand2(command, args) {
17973
17997
  return [command, ...args].join(" ");
@@ -18269,6 +18293,7 @@ var init_commands = __esm({
18269
18293
  init_discover();
18270
18294
  init_check_user_allow();
18271
18295
  init_require_comment_prefix();
18296
+ init_preflight();
18272
18297
  init_setup_agent();
18273
18298
  UPSTREAM_REPO = "poe-platform/poe-code";
18274
18299
  builtInPromptsDirCandidates = [
@@ -18528,7 +18553,8 @@ var init_commands = __esm({
18528
18553
  name: S.String()
18529
18554
  }),
18530
18555
  scope: ["cli"],
18531
- handler: async ({ params }) => {
18556
+ handler: async ({ params, env }) => {
18557
+ runPreflightChecks({ env, nodeVersion: process.version });
18532
18558
  const cwd = resolveCwd();
18533
18559
  const automation = await loadNamedAutomation(params.name, cwd);
18534
18560
  const agent2 = await setupWorkflowAgent(automation, cwd);
@@ -31450,7 +31476,7 @@ var init_package = __esm({
31450
31476
  "package.json"() {
31451
31477
  package_default = {
31452
31478
  name: "poe-code",
31453
- version: "3.0.146",
31479
+ version: "3.0.147",
31454
31480
  description: "CLI tool to configure Poe API for developer workflows.",
31455
31481
  type: "module",
31456
31482
  main: "./dist/index.js",