@diafunc/cli 0.14.0 → 0.15.0

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.
@@ -4,13 +4,13 @@ import {
4
4
  PromptCancelled,
5
5
  createProgram,
6
6
  handleError
7
- } from "../chunk-V3EXWLZP.js";
7
+ } from "../chunk-XK2UUCKV.js";
8
8
  import {
9
9
  getUpdateNotice
10
- } from "../chunk-XXWRNCTW.js";
10
+ } from "../chunk-37PYSRXA.js";
11
11
  import {
12
12
  package_default
13
- } from "../chunk-5VMDFBM6.js";
13
+ } from "../chunk-VL7FZNQK.js";
14
14
 
15
15
  // bin/diafunc.ts
16
16
  import chalk2 from "chalk";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  package_default
3
- } from "./chunk-5VMDFBM6.js";
3
+ } from "./chunk-VL7FZNQK.js";
4
4
 
5
5
  // src/util/update-check.ts
6
6
  import * as fs from "fs";
@@ -72,4 +72,4 @@ async function getUpdateNotice() {
72
72
  export {
73
73
  getUpdateNotice
74
74
  };
75
- //# sourceMappingURL=chunk-XXWRNCTW.js.map
75
+ //# sourceMappingURL=chunk-37PYSRXA.js.map
@@ -1,7 +1,7 @@
1
1
  // package.json
2
2
  var package_default = {
3
3
  name: "@diafunc/cli",
4
- version: "0.14.0",
4
+ version: "0.15.0",
5
5
  description: "Diafunc CLI: the command-line interface for the Diafunc platform",
6
6
  type: "module",
7
7
  bin: {
@@ -62,4 +62,4 @@ var package_default = {
62
62
  export {
63
63
  package_default
64
64
  };
65
- //# sourceMappingURL=chunk-5VMDFBM6.js.map
65
+ //# sourceMappingURL=chunk-VL7FZNQK.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../package.json"],"sourcesContent":["{\n \"name\": \"@diafunc/cli\",\n \"version\": \"0.14.0\",\n \"description\": \"Diafunc CLI: the command-line interface for the Diafunc platform\",\n \"type\": \"module\",\n \"bin\": {\n \"diafunc\": \"./dist/bin/diafunc.js\"\n },\n \"homepage\": \"https://diafunc.com\",\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"git+https://gitlab.com/diafunc/cli.git\"\n },\n \"bugs\": {\n \"url\": \"https://gitlab.com/diafunc/cli/-/issues\"\n },\n \"author\": \"Markus Pollak <markus.pollak@diafunc.com>\",\n \"scripts\": {\n \"build\": \"tsup && node -e \\\"const fs=require('fs');const f='dist/bin/diafunc.js';fs.writeFileSync(f,'#!/usr/bin/env node\\\\n'+fs.readFileSync(f,'utf8'))\\\"\",\n \"dev\": \"tsup --watch\",\n \"test\": \"vitest run\",\n \"test:watch\": \"vitest\",\n \"lint\": \"tsc --noEmit\",\n \"start\": \"node dist/bin/diafunc.js\",\n \"prepublishOnly\": \"npm run lint && npm test && npm run build\"\n },\n \"files\": [\n \"dist\",\n \"LICENSE\",\n \"README.md\"\n ],\n \"keywords\": [\n \"diafunc\",\n \"cli\",\n \"data-science\",\n \"symbolic-regression\"\n ],\n \"license\": \"Apache-2.0\",\n \"publishConfig\": {\n \"access\": \"public\",\n \"registry\": \"https://registry.npmjs.org/\"\n },\n \"engines\": {\n \"node\": \">=20.0.0\"\n },\n \"dependencies\": {\n \"@inquirer/prompts\": \"^7.0.0\",\n \"chalk\": \"^5.4.0\",\n \"cli-table3\": \"^0.6.5\",\n \"commander\": \"^12.1.0\",\n \"ora\": \"^8.1.0\"\n },\n \"devDependencies\": {\n \"@types/node\": \"^22.0.0\",\n \"tsup\": \"^8.3.0\",\n \"typescript\": \"^5.6.0\",\n \"vitest\": \"^2.1.0\"\n }\n}\n"],"mappings":";AAAA;AAAA,EACE,MAAQ;AAAA,EACR,SAAW;AAAA,EACX,aAAe;AAAA,EACf,MAAQ;AAAA,EACR,KAAO;AAAA,IACL,SAAW;AAAA,EACb;AAAA,EACA,UAAY;AAAA,EACZ,YAAc;AAAA,IACZ,MAAQ;AAAA,IACR,KAAO;AAAA,EACT;AAAA,EACA,MAAQ;AAAA,IACN,KAAO;AAAA,EACT;AAAA,EACA,QAAU;AAAA,EACV,SAAW;AAAA,IACT,OAAS;AAAA,IACT,KAAO;AAAA,IACP,MAAQ;AAAA,IACR,cAAc;AAAA,IACd,MAAQ;AAAA,IACR,OAAS;AAAA,IACT,gBAAkB;AAAA,EACpB;AAAA,EACA,OAAS;AAAA,IACP;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAAA,EACA,UAAY;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAAA,EACA,SAAW;AAAA,EACX,eAAiB;AAAA,IACf,QAAU;AAAA,IACV,UAAY;AAAA,EACd;AAAA,EACA,SAAW;AAAA,IACT,MAAQ;AAAA,EACV;AAAA,EACA,cAAgB;AAAA,IACd,qBAAqB;AAAA,IACrB,OAAS;AAAA,IACT,cAAc;AAAA,IACd,WAAa;AAAA,IACb,KAAO;AAAA,EACT;AAAA,EACA,iBAAmB;AAAA,IACjB,eAAe;AAAA,IACf,MAAQ;AAAA,IACR,YAAc;AAAA,IACd,QAAU;AAAA,EACZ;AACF;","names":[]}
1
+ {"version":3,"sources":["../package.json"],"sourcesContent":["{\n \"name\": \"@diafunc/cli\",\n \"version\": \"0.15.0\",\n \"description\": \"Diafunc CLI: the command-line interface for the Diafunc platform\",\n \"type\": \"module\",\n \"bin\": {\n \"diafunc\": \"./dist/bin/diafunc.js\"\n },\n \"homepage\": \"https://diafunc.com\",\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"git+https://gitlab.com/diafunc/cli.git\"\n },\n \"bugs\": {\n \"url\": \"https://gitlab.com/diafunc/cli/-/issues\"\n },\n \"author\": \"Markus Pollak <markus.pollak@diafunc.com>\",\n \"scripts\": {\n \"build\": \"tsup && node -e \\\"const fs=require('fs');const f='dist/bin/diafunc.js';fs.writeFileSync(f,'#!/usr/bin/env node\\\\n'+fs.readFileSync(f,'utf8'))\\\"\",\n \"dev\": \"tsup --watch\",\n \"test\": \"vitest run\",\n \"test:watch\": \"vitest\",\n \"lint\": \"tsc --noEmit\",\n \"start\": \"node dist/bin/diafunc.js\",\n \"prepublishOnly\": \"npm run lint && npm test && npm run build\"\n },\n \"files\": [\n \"dist\",\n \"LICENSE\",\n \"README.md\"\n ],\n \"keywords\": [\n \"diafunc\",\n \"cli\",\n \"data-science\",\n \"symbolic-regression\"\n ],\n \"license\": \"Apache-2.0\",\n \"publishConfig\": {\n \"access\": \"public\",\n \"registry\": \"https://registry.npmjs.org/\"\n },\n \"engines\": {\n \"node\": \">=20.0.0\"\n },\n \"dependencies\": {\n \"@inquirer/prompts\": \"^7.0.0\",\n \"chalk\": \"^5.4.0\",\n \"cli-table3\": \"^0.6.5\",\n \"commander\": \"^12.1.0\",\n \"ora\": \"^8.1.0\"\n },\n \"devDependencies\": {\n \"@types/node\": \"^22.0.0\",\n \"tsup\": \"^8.3.0\",\n \"typescript\": \"^5.6.0\",\n \"vitest\": \"^2.1.0\"\n }\n}\n"],"mappings":";AAAA;AAAA,EACE,MAAQ;AAAA,EACR,SAAW;AAAA,EACX,aAAe;AAAA,EACf,MAAQ;AAAA,EACR,KAAO;AAAA,IACL,SAAW;AAAA,EACb;AAAA,EACA,UAAY;AAAA,EACZ,YAAc;AAAA,IACZ,MAAQ;AAAA,IACR,KAAO;AAAA,EACT;AAAA,EACA,MAAQ;AAAA,IACN,KAAO;AAAA,EACT;AAAA,EACA,QAAU;AAAA,EACV,SAAW;AAAA,IACT,OAAS;AAAA,IACT,KAAO;AAAA,IACP,MAAQ;AAAA,IACR,cAAc;AAAA,IACd,MAAQ;AAAA,IACR,OAAS;AAAA,IACT,gBAAkB;AAAA,EACpB;AAAA,EACA,OAAS;AAAA,IACP;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAAA,EACA,UAAY;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAAA,EACA,SAAW;AAAA,EACX,eAAiB;AAAA,IACf,QAAU;AAAA,IACV,UAAY;AAAA,EACd;AAAA,EACA,SAAW;AAAA,IACT,MAAQ;AAAA,EACV;AAAA,EACA,cAAgB;AAAA,IACd,qBAAqB;AAAA,IACrB,OAAS;AAAA,IACT,cAAc;AAAA,IACd,WAAa;AAAA,IACb,KAAO;AAAA,EACT;AAAA,EACA,iBAAmB;AAAA,IACjB,eAAe;AAAA,IACf,MAAQ;AAAA,IACR,YAAc;AAAA,IACd,QAAU;AAAA,EACZ;AACF;","names":[]}
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  package_default
3
- } from "./chunk-5VMDFBM6.js";
3
+ } from "./chunk-VL7FZNQK.js";
4
4
 
5
5
  // src/index.ts
6
6
  import chalk36 from "chalk";
@@ -270,6 +270,7 @@ ${bodyPreview}`));
270
270
  body = JSON.stringify(opts.body);
271
271
  }
272
272
  headers["User-Agent"] = `diafunc-cli/${package_default.version} (${process.platform}; node ${process.versions.node})`;
273
+ headers["X-Diafunc-Client"] = `cli/${package_default.version}`;
273
274
  const retryable = RETRYABLE_METHODS.has(opts.method);
274
275
  const maxAttempts = retryable ? MAX_ATTEMPTS : 1;
275
276
  let lastError;
@@ -3170,6 +3171,25 @@ function percent(fraction) {
3170
3171
  const clamped = Math.max(0, Math.min(1, Number.isFinite(fraction) ? fraction : 0));
3171
3172
  return `${Math.round(clamped * 100)}%`.padStart(4);
3172
3173
  }
3174
+ var QUALITY_MAX_DECIMALS = 4;
3175
+ function qualityPercent(quality) {
3176
+ const unit = Math.max(0, Math.min(Number.isFinite(quality) ? quality : 0, 1));
3177
+ if (unit >= 1) return "100%";
3178
+ let decimals = 1;
3179
+ let shown = flooredPercent(unit, decimals);
3180
+ while (decimals < QUALITY_MAX_DECIMALS && /\.9+$/.test(shown)) {
3181
+ decimals++;
3182
+ shown = flooredPercent(unit, decimals);
3183
+ }
3184
+ return `${decimals > 1 ? shown.replace(/0+$/, "") : shown}%`;
3185
+ }
3186
+ function flooredPercent(unit, decimals) {
3187
+ return (shift(Math.floor(shift(unit, decimals + 2)), -(decimals + 2)) * 100).toFixed(decimals);
3188
+ }
3189
+ function shift(value, exponent) {
3190
+ const [mantissa, magnitude] = value.toExponential().split("e");
3191
+ return Number(`${mantissa}e${Number(magnitude) + exponent}`);
3192
+ }
3173
3193
 
3174
3194
  // src/commands/bundle-helpers.ts
3175
3195
  async function streamResponseToFile(response, outFile) {
@@ -3391,6 +3411,11 @@ Showing ${capped.length} of ${projects.length}. Pass --limit 0 to see them all.`
3391
3411
  language: options.language,
3392
3412
  active: true
3393
3413
  });
3414
+ await api.storage.createProjectBranch({
3415
+ projectId: p.projectId,
3416
+ sourceProjectBranch: null,
3417
+ targetProjectBranch: "main"
3418
+ });
3394
3419
  if (outputFormat === "human") {
3395
3420
  success("Project created.");
3396
3421
  console.log(` Project ID: ${chalk12.bold(p.projectId)}`);
@@ -6121,7 +6146,7 @@ var HELP = [
6121
6146
  ];
6122
6147
  async function runChatRepl(options) {
6123
6148
  const { input: promptInput } = await import("@inquirer/prompts");
6124
- const { getUpdateNotice } = await import("./update-check-3ZDZSY7M.js");
6149
+ const { getUpdateNotice } = await import("./update-check-2GASRVMF.js");
6125
6150
  let sessionId = options.session;
6126
6151
  let lastReportedSession;
6127
6152
  console.log(chalk19.bold("Diafunc chat") + chalk19.dim(" \xB7 /help for commands, /quit to exit"));
@@ -7010,7 +7035,7 @@ function phaseDetail(run) {
7010
7035
  parts.push(`generation ${formatNumber(run.fitGeneration)}`);
7011
7036
  }
7012
7037
  if (run.fitQuality !== null && run.fitQuality !== void 0) {
7013
- parts.push(`quality ${Math.floor(Math.max(0, Math.min(run.fitQuality, 1)) * 100)}%`);
7038
+ parts.push(`quality ${qualityPercent(run.fitQuality)}`);
7014
7039
  }
7015
7040
  if (run.fitBudgetFraction !== null && run.fitBudgetFraction !== void 0) {
7016
7041
  parts.push(`${Math.round(run.fitBudgetFraction * 100)}% of budget used`);
@@ -9496,7 +9521,7 @@ function registerShellCommand(program) {
9496
9521
  });
9497
9522
  const api = createApiClient();
9498
9523
  const { input: promptInput } = await import("@inquirer/prompts");
9499
- const { getUpdateNotice } = await import("./update-check-3ZDZSY7M.js");
9524
+ const { getUpdateNotice } = await import("./update-check-2GASRVMF.js");
9500
9525
  const resolvedLanguage = await resolveLanguage(api, fnRef.projectId, options.language);
9501
9526
  console.log(chalk31.bold("Diafunc shell") + chalk31.dim(` \xB7 function ${fnRef.entityId} \xB7 ${resolvedLanguage}`));
9502
9527
  console.log(chalk31.dim(`Endpoint: ${config.profiles[config.currentProfile]?.endpoint}`));
@@ -10541,4 +10566,4 @@ export {
10541
10566
  PromptCancelled,
10542
10567
  createProgram
10543
10568
  };
10544
- //# sourceMappingURL=chunk-V3EXWLZP.js.map
10569
+ //# sourceMappingURL=chunk-XK2UUCKV.js.map