@vendian/cli 0.0.3 → 0.0.6

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/cli-wrapper.cjs +56 -3
  2. package/package.json +3 -2
package/cli-wrapper.cjs CHANGED
@@ -426,9 +426,41 @@ async function forwardToPythonVendian(args, { env = process.env, platform = proc
426
426
  throw new Error("Vendian is not set up yet. Run `vendian login` first.");
427
427
  }
428
428
  maybeAutoUpdateManagedEnv({ env, platform, venvPath });
429
- const code = await spawnForward(vendianPath, args, { env });
429
+ const config = loadConfig(env, platform);
430
+ const code = await spawnForward(vendianPath, args, {
431
+ env: {
432
+ ...env,
433
+ ...packageIndexEnv(config, env, platform)
434
+ }
435
+ });
430
436
  process.exitCode = code;
431
437
  }
438
+ function packageIndexEnv(config = {}, env = process.env, platform = process.platform) {
439
+ const registry = registryConfig(config, env, platform);
440
+ const indexes = buildIndexUrls(registry);
441
+ if (!indexes) {
442
+ return {};
443
+ }
444
+ const extraIndexUrls = joinIndexUrls([
445
+ indexes.runtimeIndexUrl,
446
+ "https://pypi.org/simple",
447
+ env.VENDIAN_PIP_EXTRA_INDEX_URL
448
+ ]);
449
+ const uvExtraIndexUrls = joinIndexUrls([
450
+ indexes.runtimeIndexUrl,
451
+ "https://pypi.org/simple",
452
+ env.VENDIAN_UV_EXTRA_INDEX_URL
453
+ ]);
454
+ return {
455
+ VENDIAN_PIP_INDEX_URL: indexes.sdkIndexUrl,
456
+ VENDIAN_PIP_EXTRA_INDEX_URL: extraIndexUrls,
457
+ VENDIAN_UV_INDEX_URL: indexes.sdkIndexUrl,
458
+ VENDIAN_UV_EXTRA_INDEX_URL: uvExtraIndexUrls
459
+ };
460
+ }
461
+ function joinIndexUrls(urls) {
462
+ return urls.flatMap((value) => String(value || "").split(/\s+/)).map((value) => value.trim()).filter(Boolean).filter((value, index, all) => all.indexOf(value) === index).join(" ");
463
+ }
432
464
  function maybeAutoUpdateManagedEnv({ env = process.env, platform = process.platform, venvPath = managedVenvPath(env, platform) } = {}) {
433
465
  if (env.VENDIAN_SKIP_AUTO_UPDATE === "1") {
434
466
  return false;
@@ -815,7 +847,11 @@ function cloudAuthLoginCommand({ backend, apiUrl } = {}) {
815
847
  var import_node_fs8 = __toESM(require("node:fs"), 1);
816
848
  var import_node_readline = __toESM(require("node:readline"), 1);
817
849
  var import_promises = __toESM(require("node:readline/promises"), 1);
818
- var CLI_VERSION = "0.0.1";
850
+
851
+ // src/version.js
852
+ var CLI_VERSION = true ? "0.0.6" : process.env.npm_package_version || "0.0.0-dev";
853
+
854
+ // src/tui.js
819
855
  var RESET = "\x1B[0m";
820
856
  var BOLD = "\x1B[1m";
821
857
  var DIM = "\x1B[2m";
@@ -935,6 +971,10 @@ async function runAction(action, { env, platform, input, output }) {
935
971
  }
936
972
  if (action === "serve") {
937
973
  const agentsDir = await prompt(input, output, "Agents directory", "./agents");
974
+ output.write(`${CLEAR}${SHOW_CURSOR}`);
975
+ output.write(`[vendian] Starting local agent server for ${agentsDir || "./agents"}
976
+
977
+ `);
938
978
  await forwardToPythonVendian(["cloud", "local", "serve", "--agents-dir", agentsDir || "./agents"], { env, platform });
939
979
  return true;
940
980
  }
@@ -1088,7 +1128,7 @@ async function main(argv) {
1088
1128
  return;
1089
1129
  }
1090
1130
  if (command === "--version" || command === "version") {
1091
- console.log("0.0.1");
1131
+ console.log(CLI_VERSION);
1092
1132
  return;
1093
1133
  }
1094
1134
  if (isBootstrapCommand(command)) {
@@ -1131,7 +1171,20 @@ function parseSetupOptions(args) {
1131
1171
  return options;
1132
1172
  }
1133
1173
 
1174
+ // src/terminal-title.js
1175
+ function setTerminalTitle(title, { output = process.stdout, processRef = process } = {}) {
1176
+ const safeTitle = String(title).replace(/[\x00-\x1f\x7f]/g, " ").trim();
1177
+ if (!safeTitle) {
1178
+ return;
1179
+ }
1180
+ processRef.title = safeTitle;
1181
+ if (output?.isTTY && typeof output.write === "function") {
1182
+ output.write(`\x1B]0;${safeTitle}\x07`);
1183
+ }
1184
+ }
1185
+
1134
1186
  // src/entry.js
1187
+ setTerminalTitle("Vendian CLI");
1135
1188
  main(process.argv.slice(2)).catch((error) => {
1136
1189
  const message = error && typeof error.message === "string" ? error.message : String(error);
1137
1190
  console.error(`[vendian] ${message}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vendian/cli",
3
- "version": "0.0.3",
3
+ "version": "0.0.6",
4
4
  "description": "Public Vendian CLI bootstrapper and launcher",
5
5
  "license": "UNLICENSED",
6
6
  "private": false,
@@ -21,7 +21,8 @@
21
21
  "scripts": {
22
22
  "build": "node scripts/build-package.mjs",
23
23
  "prepack": "npm run build",
24
- "prepublishOnly": "npm test",
24
+ "prepublishOnly": "npm run release:sync-version && npm test",
25
+ "release:sync-version": "node scripts/sync-release-version.mjs",
25
26
  "test": "node --test"
26
27
  },
27
28
  "engines": {