@eve-horizon/cli 0.2.52 → 0.2.54

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 (2) hide show
  1. package/dist/index.js +28 -99
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -57671,7 +57671,9 @@ var JobHintsSchema = external_exports.object({
57671
57671
  thread_id: external_exports.string(),
57672
57672
  dispatch_mode: external_exports.string().optional()
57673
57673
  }).optional(),
57674
- gates: external_exports.array(external_exports.string()).optional()
57674
+ gates: external_exports.array(external_exports.string()).optional(),
57675
+ // App API awareness: names of project APIs the agent should have access to
57676
+ app_apis: external_exports.array(external_exports.string()).optional()
57675
57677
  }).passthrough();
57676
57678
  var JobTargetSchema = external_exports.object({
57677
57679
  agent_slug: external_exports.string().optional(),
@@ -58835,10 +58837,17 @@ var WorkflowInvokeRequestSchema = external_exports.object({
58835
58837
  input: external_exports.record(external_exports.unknown()).optional()
58836
58838
  // User's workflow input payload
58837
58839
  }).optional();
58840
+ var WorkflowStepJobSchema = external_exports.object({
58841
+ job_id: external_exports.string(),
58842
+ step_name: external_exports.string(),
58843
+ depends_on: external_exports.array(external_exports.string()).optional()
58844
+ });
58838
58845
  var WorkflowInvokeResponseSchema = external_exports.object({
58839
58846
  job_id: external_exports.string(),
58840
- status: external_exports.string()
58841
- // Job phase
58847
+ status: external_exports.string(),
58848
+ // Job phase (root job)
58849
+ step_jobs: external_exports.array(WorkflowStepJobSchema).optional()
58850
+ // Child step jobs in the DAG
58842
58851
  });
58843
58852
  var WorkflowInvokeResultSchema = external_exports.object({
58844
58853
  job_id: external_exports.string(),
@@ -62903,87 +62912,12 @@ async function handleCreate(flags, context2, json) {
62903
62912
  }
62904
62913
  if (withApis) {
62905
62914
  const apiNames = withApis.split(",").map((n) => n.trim()).filter(Boolean);
62906
- const apiListResponse = await requestJson(
62907
- context2,
62908
- `/projects/${resolvedProjectId}/apis`
62909
- );
62910
- const availableApis = new Map(
62911
- (apiListResponse.data || []).map((a) => [a.name, { type: a.type, base_url: a.base_url }])
62912
- );
62913
- const missing2 = apiNames.filter((name) => !availableApis.has(name));
62914
- if (missing2.length > 0) {
62915
- throw new Error(
62916
- `APIs not found in project: ${missing2.join(", ")}
62917
- Available APIs: ${[...availableApis.keys()].join(", ") || "(none)"}`
62918
- );
62919
- }
62920
- const contextArgs = [`--project ${resolvedProjectId}`];
62921
- if (envName) {
62922
- contextArgs.push(`--env ${envName}`);
62923
- }
62924
- const contextSuffix = contextArgs.join(" ");
62925
- const apiLines = apiNames.map((name) => {
62926
- const info = availableApis.get(name);
62927
- const type = info?.type ?? "openapi";
62928
- const baseUrl = info?.base_url || "<base_url>";
62929
- return `- \`${name}\` (${type})
62930
- - Use this runtime-safe Node helper for in-job API calls (no extra tools required).
62931
- \`\`\`bash
62932
- API_URL="${baseUrl}" node - <<'NODE'
62933
- const fs = require("fs");
62934
- const tokenFromJob = process.env.EVE_JOB_TOKEN;
62935
- const tokenFromCreds = () => {
62936
- const credsPath = \`\${process.env.HOME}/.eve/credentials.json\`;
62937
- if (!fs.existsSync(credsPath)) {
62938
- return undefined;
62939
- }
62940
- const creds = JSON.parse(fs.readFileSync(credsPath, "utf8"));
62941
- const apiKey = \`\${(process.env.EVE_API_URL || "").replace(/\\/+$/, "")}\`;
62942
- return creds.tokens?.[apiKey]?.access_token;
62943
- };
62944
- const token = tokenFromJob ?? tokenFromCreds();
62945
- const apiUrl = process.env.API_URL;
62946
- if (!apiUrl) {
62947
- throw new Error("Set API_URL before running the script.");
62948
- }
62949
- const method = process.env.EVE_APP_API_METHOD ?? "GET";
62950
- const path = process.env.EVE_APP_API_PATH ?? "/";
62951
- const bodyArg = process.env.EVE_APP_API_BODY;
62952
- if (!token) {
62953
- throw new Error("Missing token. Set EVE_JOB_TOKEN or keep ~/.eve/credentials.json for external shells.");
62954
- }
62955
- const options = {
62956
- method: method.toUpperCase(),
62957
- headers: {
62958
- Authorization: \`Bearer \${token}\`,
62959
- "Content-Type": "application/json",
62960
- },
62961
- };
62962
- if (bodyArg) {
62963
- options.body = bodyArg;
62964
- }
62965
- (async () => {
62966
- const response = await fetch(new URL(path, apiUrl).toString(), options);
62967
- const text = await response.text();
62968
- console.log(text);
62969
- if (!response.ok) {
62970
- process.exitCode = 1;
62915
+ if (apiNames.length > 0) {
62916
+ if (!body.hints || typeof body.hints !== "object") {
62917
+ body.hints = {};
62971
62918
  }
62972
- })().catch((error) => {
62973
- console.error(error);
62974
- process.exit(1);
62975
- });
62976
- NODE
62977
- # Example:
62978
- # API_URL="${baseUrl}" EVE_APP_API_METHOD=GET EVE_APP_API_PATH=/api/auth-config node - <<'NODE'
62979
- \`\`\`
62980
- - Discover endpoints with \`eve api spec ${name} ${contextSuffix}\` in your own shell (outside the job runtime).`;
62981
- });
62982
- body.description = body.description + `
62983
-
62984
- ---
62985
- **Available App APIs:**
62986
- ${apiLines.join("\n")}`;
62919
+ body.hints.app_apis = apiNames;
62920
+ }
62987
62921
  }
62988
62922
  const response = await requestJson(context2, `/projects/${resolvedProjectId}/jobs`, {
62989
62923
  method: "POST",
@@ -73656,27 +73590,22 @@ async function handleInstall(positionals, flags) {
73656
73590
  return;
73657
73591
  }
73658
73592
  const packsInstalled = installPackSkills(skillsBin, projectRoot);
73659
- if (packsInstalled) {
73660
- ensureSkillsSymlink(projectRoot);
73661
- console.log("Skills install complete (from packs)");
73662
- return;
73663
- }
73664
73593
  const manifest = parseSkillsManifest(manifestPath);
73665
- if (manifest.length === 0) {
73666
- console.log("No skills.txt found or empty; nothing to install");
73594
+ if (manifest.length > 0) {
73595
+ const toInstall = skipInstalled ? manifest.filter((s) => !getInstalledSkills(skillsDir).has(s.name)) : manifest;
73596
+ if (toInstall.length > 0) {
73597
+ console.log(`Installing ${toInstall.length} skill(s) from skills.txt...`);
73598
+ for (const skill of toInstall) {
73599
+ installSkill(skillsBin, skill, projectRoot);
73600
+ }
73601
+ }
73602
+ }
73603
+ if (!packsInstalled && manifest.length === 0) {
73604
+ console.log("No packs or skills.txt found; nothing to install");
73667
73605
  console.log("Usage: eve skills install <source>");
73668
73606
  console.log(" e.g. eve skills install https://github.com/org/skillpack");
73669
73607
  return;
73670
73608
  }
73671
- const toInstall = skipInstalled ? manifest.filter((s) => !getInstalledSkills(skillsDir).has(s.name)) : manifest;
73672
- if (toInstall.length === 0) {
73673
- console.log("All skills already installed (use without --skip-installed to update)");
73674
- } else {
73675
- console.log(`Installing ${toInstall.length} skill(s)...`);
73676
- for (const skill of toInstall) {
73677
- installSkill(skillsBin, skill, projectRoot);
73678
- }
73679
- }
73680
73609
  ensureSkillsSymlink(projectRoot);
73681
73610
  console.log("Skills install complete");
73682
73611
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eve-horizon/cli",
3
- "version": "0.2.52",
3
+ "version": "0.2.54",
4
4
  "description": "Eve Horizon CLI",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -32,8 +32,8 @@
32
32
  "esbuild": "^0.27.3",
33
33
  "postgres": "^3.4.0",
34
34
  "typescript": "^5.7.0",
35
- "@eve/shared": "0.0.1",
36
- "@eve/migrate": "0.0.1"
35
+ "@eve/migrate": "0.0.1",
36
+ "@eve/shared": "0.0.1"
37
37
  },
38
38
  "scripts": {
39
39
  "build": "rm -rf dist && esbuild src/index.ts --bundle --platform=node --target=node22 --outfile=dist/index.js --format=cjs --external:yaml"