stratagem-x7 0.3.8 → 0.3.10

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/cli.mjs +117 -17
  2. package/package.json +2 -1
package/dist/cli.mjs CHANGED
@@ -156292,6 +156292,25 @@ import { existsSync as existsSync7 } from "fs";
156292
156292
  import { homedir as homedir12 } from "os";
156293
156293
  import * as path10 from "path";
156294
156294
  import { fileURLToPath as fileURLToPath3 } from "url";
156295
+ function getVscodeRipgrepPath() {
156296
+ try {
156297
+ const rgBin = process.platform === "win32" ? "rg.exe" : "rg";
156298
+ const candidates = [
156299
+ path10.resolve(__dirname2, "node_modules", "@vscode", "ripgrep", "bin", rgBin),
156300
+ path10.resolve(__dirname2, "..", "node_modules", "@vscode", "ripgrep", "bin", rgBin),
156301
+ path10.resolve(__dirname2, "..", "..", "node_modules", "@vscode", "ripgrep", "bin", rgBin),
156302
+ path10.resolve(__dirname2, "..", "..", "..", "node_modules", "@vscode", "ripgrep", "bin", rgBin)
156303
+ ];
156304
+ for (const candidate of candidates) {
156305
+ if (existsSync7(candidate)) {
156306
+ return candidate;
156307
+ }
156308
+ }
156309
+ return null;
156310
+ } catch {
156311
+ return null;
156312
+ }
156313
+ }
156295
156314
  function isErrnoException(error41) {
156296
156315
  return error41 instanceof Error;
156297
156316
  }
@@ -156301,6 +156320,7 @@ function resolveRipgrepConfig({
156301
156320
  builtinCommand,
156302
156321
  builtinExists,
156303
156322
  systemExecutablePath,
156323
+ vscodeRipgrepPath,
156304
156324
  processExecPath = process.execPath
156305
156325
  }) {
156306
156326
  if (userWantsSystemRipgrep && systemExecutablePath !== "rg") {
@@ -156317,9 +156337,15 @@ function resolveRipgrepConfig({
156317
156337
  if (builtinExists) {
156318
156338
  return { mode: "builtin", command: builtinCommand, args: [] };
156319
156339
  }
156340
+ if (vscodeRipgrepPath && existsSync7(vscodeRipgrepPath)) {
156341
+ return { mode: "builtin", command: vscodeRipgrepPath, args: [] };
156342
+ }
156320
156343
  if (systemExecutablePath !== "rg") {
156321
156344
  return { mode: "system", command: "rg", args: [] };
156322
156345
  }
156346
+ if (vscodeRipgrepPath) {
156347
+ return { mode: "builtin", command: vscodeRipgrepPath, args: [] };
156348
+ }
156323
156349
  return { mode: "builtin", command: builtinCommand, args: [] };
156324
156350
  }
156325
156351
  function ripgrepCommand() {
@@ -156582,12 +156608,14 @@ var init_ripgrep = __esm(() => {
156582
156608
  const builtinCommand = process.platform === "win32" ? path10.resolve(rgRoot, `${process.arch}-win32`, "rg.exe") : path10.resolve(rgRoot, `${process.arch}-${process.platform}`, "rg");
156583
156609
  const builtinExists = existsSync7(builtinCommand);
156584
156610
  const { cmd: systemExecutablePath } = findExecutable("rg", []);
156611
+ const vscodeRipgrepPath = getVscodeRipgrepPath();
156585
156612
  return resolveRipgrepConfig({
156586
156613
  userWantsSystemRipgrep,
156587
156614
  bundledMode,
156588
156615
  builtinCommand,
156589
156616
  builtinExists,
156590
- systemExecutablePath
156617
+ systemExecutablePath,
156618
+ vscodeRipgrepPath
156591
156619
  });
156592
156620
  });
156593
156621
  RipgrepTimeoutError = class RipgrepTimeoutError extends Error {
@@ -281068,6 +281096,8 @@ function ProviderManager({ mode, onDone }) {
281068
281096
  const [ollamaSelection, setOllamaSelection] = React25.useState({
281069
281097
  state: "idle"
281070
281098
  });
281099
+ const [discoveredModels, setDiscoveredModels] = React25.useState(null);
281100
+ const [modelDiscoveryLoading, setModelDiscoveryLoading] = React25.useState(false);
281071
281101
  const currentStep = FORM_STEPS[formStepIndex] ?? FORM_STEPS[0];
281072
281102
  const currentStepKey = currentStep.key;
281073
281103
  const currentValue = draft[currentStepKey];
@@ -281558,6 +281588,46 @@ function ProviderManager({ mode, onDone }) {
281558
281588
  }
281559
281589
  returnToMenu();
281560
281590
  }
281591
+ React25.useEffect(() => {
281592
+ if (screen !== "form" || formStepIndex !== 3) {
281593
+ return;
281594
+ }
281595
+ const baseUrl = draft.baseUrl?.trim();
281596
+ if (!baseUrl) {
281597
+ setDiscoveredModels(null);
281598
+ return;
281599
+ }
281600
+ let cancelled = false;
281601
+ setModelDiscoveryLoading(true);
281602
+ setDiscoveredModels(null);
281603
+ (async () => {
281604
+ try {
281605
+ const normalizedBase = baseUrl.replace(/\/+$/, "");
281606
+ const modelsUrl = normalizedBase.endsWith("/v1") ? `${normalizedBase}/models` : `${normalizedBase}/v1/models`;
281607
+ const headers = {};
281608
+ if (draft.apiKey?.trim()) {
281609
+ headers.Authorization = `Bearer ${draft.apiKey.trim()}`;
281610
+ }
281611
+ const response = await axios_default.get(modelsUrl, {
281612
+ headers,
281613
+ timeout: 5000
281614
+ });
281615
+ if (cancelled)
281616
+ return;
281617
+ const models = (response.data?.data ?? []).map((m) => m.id ?? "").filter((id) => id.length > 0);
281618
+ setDiscoveredModels(models.length > 0 ? models : null);
281619
+ } catch {
281620
+ if (!cancelled)
281621
+ setDiscoveredModels(null);
281622
+ } finally {
281623
+ if (!cancelled)
281624
+ setModelDiscoveryLoading(false);
281625
+ }
281626
+ })();
281627
+ return () => {
281628
+ cancelled = true;
281629
+ };
281630
+ }, [screen, formStepIndex, draft.baseUrl, draft.apiKey]);
281561
281631
  useKeybinding("confirm:no", handleBackFromForm, {
281562
281632
  context: "Settings",
281563
281633
  isActive: screen === "form"
@@ -281759,6 +281829,8 @@ function ProviderManager({ mode, onDone }) {
281759
281829
  }, undefined, true, undefined, this);
281760
281830
  }
281761
281831
  function renderForm() {
281832
+ const isModelStep = formStepIndex === 3 && currentStepKey === "model";
281833
+ const showModelPicker = isModelStep && discoveredModels && discoveredModels.length > 0;
281762
281834
  return /* @__PURE__ */ jsx_dev_runtime63.jsxDEV(ThemedBox_default, {
281763
281835
  flexDirection: "column",
281764
281836
  gap: 1,
@@ -281791,7 +281863,34 @@ function ProviderManager({ mode, onDone }) {
281791
281863
  currentStep.label
281792
281864
  ]
281793
281865
  }, undefined, true, undefined, this),
281794
- /* @__PURE__ */ jsx_dev_runtime63.jsxDEV(ThemedBox_default, {
281866
+ isModelStep && modelDiscoveryLoading ? /* @__PURE__ */ jsx_dev_runtime63.jsxDEV(ThemedText, {
281867
+ dimColor: true,
281868
+ children: "Fetching available models from endpoint…"
281869
+ }, undefined, false, undefined, this) : showModelPicker ? /* @__PURE__ */ jsx_dev_runtime63.jsxDEV(ThemedBox_default, {
281870
+ flexDirection: "column",
281871
+ children: /* @__PURE__ */ jsx_dev_runtime63.jsxDEV(Select, {
281872
+ options: [
281873
+ ...discoveredModels.map((m) => ({
281874
+ value: m,
281875
+ label: m
281876
+ })),
281877
+ {
281878
+ value: "__manual__",
281879
+ label: "✎ Enter manually…",
281880
+ description: "Type a model name instead"
281881
+ }
281882
+ ],
281883
+ onChange: (value) => {
281884
+ if (value === "__manual__") {
281885
+ setDiscoveredModels(null);
281886
+ return;
281887
+ }
281888
+ handleFormSubmit(value);
281889
+ },
281890
+ onCancel: handleBackFromForm,
281891
+ visibleOptionCount: Math.min(12, discoveredModels.length + 1)
281892
+ }, undefined, false, undefined, this)
281893
+ }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime63.jsxDEV(ThemedBox_default, {
281795
281894
  flexDirection: "row",
281796
281895
  gap: 1,
281797
281896
  children: [
@@ -281820,7 +281919,7 @@ function ProviderManager({ mode, onDone }) {
281820
281919
  }, undefined, false, undefined, this),
281821
281920
  /* @__PURE__ */ jsx_dev_runtime63.jsxDEV(ThemedText, {
281822
281921
  dimColor: true,
281823
- children: "Press Enter to continue. Press Esc to go back."
281922
+ children: showModelPicker ? "Select a model. Press Esc to go back." : "Press Enter to continue. Press Esc to go back."
281824
281923
  }, undefined, false, undefined, this)
281825
281924
  ]
281826
281925
  }, undefined, true, undefined, this);
@@ -282153,6 +282252,7 @@ function ProviderManager({ mode, onDone }) {
282153
282252
  }
282154
282253
  var React25, jsx_dev_runtime63, FORM_STEPS, GITHUB_PROVIDER_ID = "__github_models__", GITHUB_PROVIDER_LABEL = "GitHub Models", GITHUB_PROVIDER_DEFAULT_MODEL = "github:copilot", GITHUB_PROVIDER_DEFAULT_BASE_URL = "https://models.github.ai/inference", CODEX_OAUTH_PROVIDER_NAME = "Codex OAuth", CODEX_OAUTH_PROVIDER_MODEL = "codexplan";
282155
282254
  var init_ProviderManager = __esm(() => {
282255
+ init_axios2();
282156
282256
  init_figures();
282157
282257
  init_providerConfig();
282158
282258
  init_ink2();
@@ -282185,18 +282285,18 @@ var init_ProviderManager = __esm(() => {
282185
282285
  placeholder: "e.g. http://localhost:11434/v1",
282186
282286
  helpText: "API base URL used for this provider profile."
282187
282287
  },
282188
- {
282189
- key: "model",
282190
- label: "Default model",
282191
- placeholder: "e.g. llama3.1:8b or glm-4.7, glm-4.7-flash",
282192
- helpText: "Model name(s) to use. Separate multiple with commas; first is default."
282193
- },
282194
282288
  {
282195
282289
  key: "apiKey",
282196
282290
  label: "API key",
282197
282291
  placeholder: "Leave empty if your provider does not require one",
282198
282292
  helpText: "Optional. Press Enter with empty value to skip.",
282199
282293
  optional: true
282294
+ },
282295
+ {
282296
+ key: "model",
282297
+ label: "Default model",
282298
+ placeholder: "e.g. llama3.1:8b or glm-4.7, glm-4.7-flash",
282299
+ helpText: "Model name(s) to use. Separate multiple with commas; first is default."
282200
282300
  }
282201
282301
  ];
282202
282302
  });
@@ -382818,7 +382918,7 @@ function getAnthropicEnvMetadata() {
382818
382918
  function getBuildAgeMinutes() {
382819
382919
  if (false)
382820
382920
  ;
382821
- const buildTime = new Date("2026-04-25T02:59:14.373Z").getTime();
382921
+ const buildTime = new Date("2026-04-25T03:57:28.614Z").getTime();
382822
382922
  if (isNaN(buildTime))
382823
382923
  return;
382824
382924
  return Math.floor((Date.now() - buildTime) / 60000);
@@ -409997,7 +410097,7 @@ function buildPrimarySection() {
409997
410097
  }, undefined, false, undefined, this);
409998
410098
  return [{
409999
410099
  label: "Version",
410000
- value: "0.3.8"
410100
+ value: "0.3.10"
410001
410101
  }, {
410002
410102
  label: "Session name",
410003
410103
  value: nameValue
@@ -449624,7 +449724,7 @@ function getStartupLines(termWidth) {
449624
449724
  const sLen = ` ● ${sL} buffer ready — /help for breach controls`.length;
449625
449725
  out.push(centerAnsiLine(boxRow(sRow, W2, sLen), tw));
449626
449726
  out.push(centerAnsiLine(`${rgb3(...BORDER)}└${"─".repeat(W2 - 2)}┘${RESET2}`, tw));
449627
- out.push(centerAnsiLine(`${rgb3(...DIMCOL)}STRATAGEM X7${RESET2} ${rgb3(...ACCENT)}v${"0.3.8"}${RESET2} ${rgb3(...CYAN)}// breach link stable${RESET2}`, tw));
449727
+ out.push(centerAnsiLine(`${rgb3(...DIMCOL)}STRATAGEM X7${RESET2} ${rgb3(...ACCENT)}v${"0.3.10"}${RESET2} ${rgb3(...CYAN)}// breach link stable${RESET2}`, tw));
449628
449728
  out.push("");
449629
449729
  return out;
449630
449730
  }
@@ -478173,7 +478273,7 @@ var init_bridge_kick = __esm(() => {
478173
478273
  var call60 = async () => {
478174
478274
  return {
478175
478275
  type: "text",
478176
- value: `${"99.0.0"} (built ${"2026-04-25T02:59:14.373Z"})`
478276
+ value: `${"99.0.0"} (built ${"2026-04-25T03:57:28.614Z"})`
478177
478277
  };
478178
478278
  }, version2, version_default;
478179
478279
  var init_version = __esm(() => {
@@ -553564,7 +553664,7 @@ function WelcomeV2() {
553564
553664
  dimColor: true,
553565
553665
  children: [
553566
553666
  "v",
553567
- "0.3.8",
553667
+ "0.3.10",
553568
553668
  " "
553569
553669
  ]
553570
553670
  }, undefined, true, undefined, this)
@@ -573582,7 +573682,7 @@ Usage: stx7 --remote "your task description"`, () => gracefulShutdown(1));
573582
573682
  pendingHookMessages
573583
573683
  }, renderAndRun);
573584
573684
  }
573585
- }).version("0.3.8 (STRATAGEM X7)", "-v, --version", "Output the version number");
573685
+ }).version("0.3.10 (STRATAGEM X7)", "-v, --version", "Output the version number");
573586
573686
  program2.option("-w, --worktree [name]", "Create a new git worktree for this session (optionally specify a name)");
573587
573687
  program2.option("--tmux", "Create a tmux session for the worktree (requires --worktree). Uses iTerm2 native panes when available; use --tmux=classic for traditional tmux.");
573588
573688
  if (canUserConfigureAdvisor()) {
@@ -574111,7 +574211,7 @@ if (false) {}
574111
574211
  async function main2() {
574112
574212
  const args = process.argv.slice(2);
574113
574213
  if (args.length === 1 && (args[0] === "--version" || args[0] === "-v" || args[0] === "-V")) {
574114
- console.log(`${"0.3.8"} (STRATAGEM X7)`);
574214
+ console.log(`${"0.3.10"} (STRATAGEM X7)`);
574115
574215
  return;
574116
574216
  }
574117
574217
  if (args.includes("--provider")) {
@@ -574233,4 +574333,4 @@ async function main2() {
574233
574333
  }
574234
574334
  main2();
574235
574335
 
574236
- //# debugId=D065746CFBCE51A064756E2164756E21
574336
+ //# debugId=24F1E7F0EBCDF2AE64756E2164756E21
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "stratagem-x7",
3
- "version": "0.3.8",
3
+ "version": "0.3.10",
4
4
  "description": "STRATAGEM X7 is a cyberpunk coding-agent CLI for cloud and local model providers",
5
5
  "type": "module",
6
6
  "bin": {
@@ -75,6 +75,7 @@
75
75
  "@opentelemetry/sdk-trace-base": "2.6.1",
76
76
  "@opentelemetry/sdk-trace-node": "2.6.1",
77
77
  "@opentelemetry/semantic-conventions": "1.40.0",
78
+ "@vscode/ripgrep": "^1.17.1",
78
79
  "ajv": "8.18.0",
79
80
  "auto-bind": "5.0.1",
80
81
  "axios": "1.15.0",