stratagem-x7 0.3.5 → 0.3.7

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 +72 -40
  2. package/package.json +1 -1
package/dist/cli.mjs CHANGED
@@ -218864,6 +218864,9 @@ function convertContentBlocks(content) {
218864
218864
  function isGeminiMode() {
218865
218865
  return isEnvTruthy(process.env.CLAUDE_CODE_USE_GEMINI) || hasGeminiApiHost(process.env.OPENAI_BASE_URL);
218866
218866
  }
218867
+ function sanitizeToolId(id) {
218868
+ return id.replace(/[^a-zA-Z0-9_-]/g, "_");
218869
+ }
218867
218870
  function convertMessages(messages, system) {
218868
218871
  const result = [];
218869
218872
  const sysText = convertSystemPrompt2(system);
@@ -218881,7 +218884,7 @@ function convertMessages(messages, system) {
218881
218884
  for (const tr of toolResults) {
218882
218885
  result.push({
218883
218886
  role: "tool",
218884
- tool_call_id: tr.tool_use_id ?? "unknown",
218887
+ tool_call_id: sanitizeToolId(tr.tool_use_id ?? "unknown"),
218885
218888
  content: convertToolResultContent(tr.content, tr.is_error)
218886
218889
  });
218887
218890
  }
@@ -218909,10 +218912,13 @@ function convertMessages(messages, system) {
218909
218912
  return typeof c6 === "string" ? c6 : Array.isArray(c6) ? c6.map((p) => p.text ?? "").join("") : "";
218910
218913
  })()
218911
218914
  };
218915
+ if (thinkingBlock && thinkingBlock.thinking) {
218916
+ assistantMsg.reasoning_content = thinkingBlock.thinking;
218917
+ }
218912
218918
  if (toolUses.length > 0) {
218913
218919
  assistantMsg.tool_calls = toolUses.map((tu, index) => {
218914
218920
  const toolCall = {
218915
- id: tu.id ?? `call_${crypto.randomUUID().replace(/-/g, "")}`,
218921
+ id: sanitizeToolId(tu.id ?? `call_${crypto.randomUUID().replace(/-/g, "")}`),
218916
218922
  type: "function",
218917
218923
  function: {
218918
218924
  name: tu.name ?? "unknown",
@@ -292456,7 +292462,7 @@ function AssistantTextMessage(t0) {
292456
292462
  let t6;
292457
292463
  if ($2[27] !== t4 || $2[28] !== t5) {
292458
292464
  t6 = /* @__PURE__ */ jsx_dev_runtime77.jsxDEV(ThemedBox_default, {
292459
- flexDirection: "row",
292465
+ flexDirection: "column",
292460
292466
  borderStyle: "single",
292461
292467
  borderColor: "claude",
292462
292468
  borderLeft: true,
@@ -292465,8 +292471,21 @@ function AssistantTextMessage(t0) {
292465
292471
  borderBottom: false,
292466
292472
  paddingLeft: 1,
292467
292473
  children: [
292468
- t4,
292469
- t5
292474
+ /* @__PURE__ */ jsx_dev_runtime77.jsxDEV(ThemedBox_default, {
292475
+ marginBottom: 1,
292476
+ children: /* @__PURE__ */ jsx_dev_runtime77.jsxDEV(ThemedText, {
292477
+ color: "claude",
292478
+ italic: true,
292479
+ children: "STRATAGEM"
292480
+ }, undefined, false, undefined, this)
292481
+ }, undefined, false, undefined, this),
292482
+ /* @__PURE__ */ jsx_dev_runtime77.jsxDEV(ThemedBox_default, {
292483
+ flexDirection: "row",
292484
+ children: [
292485
+ t4,
292486
+ t5
292487
+ ]
292488
+ }, undefined, true, undefined, this)
292470
292489
  ]
292471
292490
  }, undefined, true, undefined, this);
292472
292491
  $2[27] = t4;
@@ -292546,7 +292565,7 @@ function AssistantThinkingMessage(t0) {
292546
292565
  let t52;
292547
292566
  if ($2[0] === Symbol.for("react.memo_cache_sentinel")) {
292548
292567
  t52 = /* @__PURE__ */ jsx_dev_runtime78.jsxDEV(ThemedText, {
292549
- color: "promptBorder",
292568
+ dimColor: true,
292550
292569
  italic: true,
292551
292570
  children: [
292552
292571
  "TRACE // COGNITION",
@@ -292563,7 +292582,7 @@ function AssistantThinkingMessage(t0) {
292563
292582
  t62 = /* @__PURE__ */ jsx_dev_runtime78.jsxDEV(ThemedBox_default, {
292564
292583
  marginTop: t42,
292565
292584
  borderStyle: "single",
292566
- borderColor: "promptBorder",
292585
+ borderColor: "dim",
292567
292586
  borderLeft: true,
292568
292587
  borderTop: false,
292569
292588
  borderRight: false,
@@ -292582,7 +292601,7 @@ function AssistantThinkingMessage(t0) {
292582
292601
  let t5;
292583
292602
  if ($2[3] === Symbol.for("react.memo_cache_sentinel")) {
292584
292603
  t5 = /* @__PURE__ */ jsx_dev_runtime78.jsxDEV(ThemedText, {
292585
- color: "promptBorder",
292604
+ dimColor: true,
292586
292605
  italic: true,
292587
292606
  children: [
292588
292607
  "TRACE // COGNITION",
@@ -292615,7 +292634,7 @@ function AssistantThinkingMessage(t0) {
292615
292634
  marginTop: t4,
292616
292635
  width: "100%",
292617
292636
  borderStyle: "single",
292618
- borderColor: "promptBorder",
292637
+ borderColor: "dim",
292619
292638
  borderLeft: true,
292620
292639
  borderTop: false,
292621
292640
  borderRight: false,
@@ -294749,12 +294768,22 @@ ${tail}`;
294749
294768
  borderTop: false,
294750
294769
  borderRight: false,
294751
294770
  borderBottom: false,
294752
- children: /* @__PURE__ */ jsx_dev_runtime92.jsxDEV(HighlightedThinkingText, {
294753
- text: displayText,
294754
- useBriefLayout,
294755
- timestamp: useBriefLayout ? timestamp : undefined
294756
- }, undefined, false, undefined, this)
294757
- }, undefined, false, undefined, this);
294771
+ children: [
294772
+ !useBriefLayout && /* @__PURE__ */ jsx_dev_runtime92.jsxDEV(ThemedBox_default, {
294773
+ marginBottom: 1,
294774
+ children: /* @__PURE__ */ jsx_dev_runtime92.jsxDEV(ThemedText, {
294775
+ color: "promptBorder",
294776
+ italic: true,
294777
+ children: "USER"
294778
+ }, undefined, false, undefined, this)
294779
+ }, undefined, false, undefined, this),
294780
+ /* @__PURE__ */ jsx_dev_runtime92.jsxDEV(HighlightedThinkingText, {
294781
+ text: displayText,
294782
+ useBriefLayout,
294783
+ timestamp: useBriefLayout ? timestamp : undefined
294784
+ }, undefined, false, undefined, this)
294785
+ ]
294786
+ }, undefined, true, undefined, this);
294758
294787
  }
294759
294788
  var import_react70, jsx_dev_runtime92, MAX_DISPLAY_CHARS = 1e4, TRUNCATE_HEAD_CHARS = 2500, TRUNCATE_TAIL_CHARS = 2500;
294760
294789
  var init_UserPromptMessage = __esm(() => {
@@ -373529,11 +373558,11 @@ function collapseReadSearchGroups(messages, tools) {
373529
373558
  if (currentGroup.messages.length === 0) {
373530
373559
  return;
373531
373560
  }
373532
- result.push(createCollapsedGroup(currentGroup));
373533
373561
  for (const deferred of deferredSkippable) {
373534
373562
  result.push(deferred);
373535
373563
  }
373536
373564
  deferredSkippable = [];
373565
+ result.push(createCollapsedGroup(currentGroup));
373537
373566
  currentGroup = createEmptyGroup();
373538
373567
  }
373539
373568
  for (const msg of messages) {
@@ -373621,7 +373650,11 @@ function collapseReadSearchGroups(messages, tools) {
373621
373650
  currentGroup.relevantMemories ??= [];
373622
373651
  currentGroup.relevantMemories.push(...msg.attachment.memories);
373623
373652
  } else if (shouldSkipMessage(msg)) {
373624
- if (currentGroup.messages.length > 0 && !(msg.type === "attachment" && msg.attachment.type === "nested_memory")) {
373653
+ const isThinking = msg.type === "assistant" && (msg.message.content[0]?.type === "thinking" || msg.message.content[0]?.type === "redacted_thinking");
373654
+ if (isThinking && currentGroup.messages.length > 0) {
373655
+ flushGroup();
373656
+ result.push(msg);
373657
+ } else if (currentGroup.messages.length > 0 && !(msg.type === "attachment" && msg.attachment.type === "nested_memory")) {
373625
373658
  deferredSkippable.push(msg);
373626
373659
  } else {
373627
373660
  result.push(msg);
@@ -382788,7 +382821,7 @@ function getAnthropicEnvMetadata() {
382788
382821
  function getBuildAgeMinutes() {
382789
382822
  if (false)
382790
382823
  ;
382791
- const buildTime = new Date("2026-04-24T10:50:02.487Z").getTime();
382824
+ const buildTime = new Date("2026-04-25T02:55:34.826Z").getTime();
382792
382825
  if (isNaN(buildTime))
382793
382826
  return;
382794
382827
  return Math.floor((Date.now() - buildTime) / 60000);
@@ -407057,7 +407090,7 @@ var init_feedback2 = __esm(() => {
407057
407090
  aliases: ["bug"],
407058
407091
  type: "local-jsx",
407059
407092
  name: "feedback",
407060
- description: `Submit feedback about Claude Code`,
407093
+ description: `Submit feedback about Stratagem`,
407061
407094
  argumentHint: "[report]",
407062
407095
  isEnabled: () => !(isEnvTruthy(process.env.CLAUDE_CODE_USE_BEDROCK) || isEnvTruthy(process.env.CLAUDE_CODE_USE_VERTEX) || isEnvTruthy(process.env.CLAUDE_CODE_USE_FOUNDRY) || isEnvTruthy(process.env.DISABLE_FEEDBACK_COMMAND) || isEnvTruthy(process.env.DISABLE_BUG_COMMAND) || isEssentialTrafficOnly() || process.env.USER_TYPE === "ant" || !isPolicyAllowed("allow_product_feedback")),
407063
407096
  load: () => Promise.resolve().then(() => (init_feedback(), exports_feedback))
@@ -409967,7 +410000,7 @@ function buildPrimarySection() {
409967
410000
  }, undefined, false, undefined, this);
409968
410001
  return [{
409969
410002
  label: "Version",
409970
- value: "0.3.5"
410003
+ value: "0.3.7"
409971
410004
  }, {
409972
410005
  label: "Session name",
409973
410006
  value: nameValue
@@ -421564,7 +421597,7 @@ var init_doctor2 = __esm(() => {
421564
421597
  init_envUtils();
421565
421598
  doctor = {
421566
421599
  name: "doctor",
421567
- description: "Diagnose and verify your Claude Code installation and settings",
421600
+ description: "Diagnose and verify your Stratagem installation and settings",
421568
421601
  isEnabled: () => !isEnvTruthy(process.env.DISABLE_DOCTOR_COMMAND),
421569
421602
  type: "local-jsx",
421570
421603
  load: () => Promise.resolve().then(() => (init_doctor(), exports_doctor))
@@ -421918,7 +421951,7 @@ var init_memoryFileSelectorPaths = __esm(() => {
421918
421951
 
421919
421952
  // src/components/memory/MemoryFileSelector.tsx
421920
421953
  import { mkdir as mkdir29 } from "fs/promises";
421921
- import { basename as basename36, join as join112 } from "path";
421954
+ import { basename as basename36 } from "path";
421922
421955
  function MemoryFileSelector(t0) {
421923
421956
  const $2 = import_react_compiler_runtime156.c(58);
421924
421957
  const {
@@ -421927,7 +421960,7 @@ function MemoryFileSelector(t0) {
421927
421960
  } = t0;
421928
421961
  const existingMemoryFiles = import_react121.use(getMemoryFiles());
421929
421962
  const originalCwd = getOriginalCwd();
421930
- const userMemoryPath = join112(getClaudeConfigHomeDir(), "CLAUDE.md");
421963
+ const userMemoryPath = getAutoMemEntrypoint();
421931
421964
  const projectMemoryPath = getProjectMemoryPathForSelector(existingMemoryFiles, originalCwd);
421932
421965
  const projectMemoryFileName = basename36(projectMemoryPath);
421933
421966
  const hasUserMemory = existingMemoryFiles.some((f) => f.path === userMemoryPath);
@@ -421967,7 +422000,7 @@ function MemoryFileSelector(t0) {
421967
422000
  let description;
421968
422001
  const isGit = projectIsInGitRepo(originalCwd);
421969
422002
  if (file2.type === "User" && !file2.isNested) {
421970
- description = "Saved in ~/.claude/CLAUDE.md";
422003
+ description = `Saved in ${getDisplayPath(userMemoryPath)}`;
421971
422004
  } else {
421972
422005
  if (file2.type === "Project" && !file2.isNested && file2.path === projectMemoryPath) {
421973
422006
  description = `${isGit ? "Checked in at" : "Saved in"} ./${projectMemoryFileName}`;
@@ -422379,7 +422412,6 @@ var init_MemoryFileSelector = __esm(() => {
422379
422412
  init_agentMemory();
422380
422413
  init_browser();
422381
422414
  init_claudemd();
422382
- init_envUtils();
422383
422415
  init_file();
422384
422416
  init_format2();
422385
422417
  init_versions3();
@@ -422714,7 +422746,7 @@ ${editorHint}`, {
422714
422746
  children: [
422715
422747
  "Learn more: ",
422716
422748
  /* @__PURE__ */ jsx_dev_runtime207.jsxDEV(Link, {
422717
- url: "https://code.claude.com/docs/en/memory"
422749
+ url: "https://github.com/EstarinAzx/STRATAGEM"
422718
422750
  }, undefined, false, undefined, this)
422719
422751
  ]
422720
422752
  }, undefined, true, undefined, this)
@@ -422750,7 +422782,7 @@ var init_memory2 = __esm(() => {
422750
422782
  memory = {
422751
422783
  type: "local-jsx",
422752
422784
  name: "memory",
422753
- description: "Edit Claude memory files",
422785
+ description: "Edit memory files",
422754
422786
  load: () => Promise.resolve().then(() => (init_memory(), exports_memory))
422755
422787
  };
422756
422788
  memory_default = memory;
@@ -448150,7 +448182,7 @@ var init_mobile2 = __esm(() => {
448150
448182
  type: "local-jsx",
448151
448183
  name: "mobile",
448152
448184
  aliases: ["ios", "android"],
448153
- description: "Show QR code to download the Claude mobile app",
448185
+ description: "Show QR code to download the mobile app",
448154
448186
  load: () => Promise.resolve().then(() => (init_mobile(), exports_mobile))
448155
448187
  };
448156
448188
  mobile_default = mobile;
@@ -449595,7 +449627,7 @@ function getStartupLines(termWidth) {
449595
449627
  const sLen = ` ● ${sL} buffer ready — /help for breach controls`.length;
449596
449628
  out.push(centerAnsiLine(boxRow(sRow, W2, sLen), tw));
449597
449629
  out.push(centerAnsiLine(`${rgb3(...BORDER)}└${"─".repeat(W2 - 2)}┘${RESET2}`, tw));
449598
- out.push(centerAnsiLine(`${rgb3(...DIMCOL)}STRATAGEM X7${RESET2} ${rgb3(...ACCENT)}v${"0.3.5"}${RESET2} ${rgb3(...CYAN)}// breach link stable${RESET2}`, tw));
449630
+ out.push(centerAnsiLine(`${rgb3(...DIMCOL)}STRATAGEM X7${RESET2} ${rgb3(...ACCENT)}v${"0.3.7"}${RESET2} ${rgb3(...CYAN)}// breach link stable${RESET2}`, tw));
449599
449631
  out.push("");
449600
449632
  return out;
449601
449633
  }
@@ -457030,7 +457062,7 @@ var init_status3 = __esm(() => {
457030
457062
  status = {
457031
457063
  type: "local-jsx",
457032
457064
  name: "status",
457033
- description: "Show Claude Code status including version, model, account, API connectivity, and tool statuses",
457065
+ description: "Show Stratagem status including version, model, account, API connectivity, and tool statuses",
457034
457066
  immediate: true,
457035
457067
  load: () => Promise.resolve().then(() => (init_status2(), exports_status))
457036
457068
  };
@@ -477235,7 +477267,7 @@ var init_plugin2 = __esm(() => {
477235
477267
  type: "local-jsx",
477236
477268
  name: "plugin",
477237
477269
  aliases: ["plugins", "marketplace"],
477238
- description: "Manage Claude Code plugins",
477270
+ description: "Manage Stratagem plugins",
477239
477271
  immediate: true,
477240
477272
  load: () => Promise.resolve().then(() => (init_plugin(), exports_plugin))
477241
477273
  };
@@ -478144,7 +478176,7 @@ var init_bridge_kick = __esm(() => {
478144
478176
  var call60 = async () => {
478145
478177
  return {
478146
478178
  type: "text",
478147
- value: `${"99.0.0"} (built ${"2026-04-24T10:50:02.487Z"})`
478179
+ value: `${"99.0.0"} (built ${"2026-04-25T02:55:34.826Z"})`
478148
478180
  };
478149
478181
  }, version2, version_default;
478150
478182
  var init_version = __esm(() => {
@@ -480624,7 +480656,7 @@ var init_stickers2 = __esm(() => {
480624
480656
  stickers = {
480625
480657
  type: "local",
480626
480658
  name: "stickers",
480627
- description: "Order Claude Code stickers",
480659
+ description: "Order Stratagem stickers",
480628
480660
  supportsNonInteractive: false,
480629
480661
  load: () => Promise.resolve().then(() => (init_stickers(), exports_stickers))
480630
480662
  };
@@ -482143,7 +482175,7 @@ var init_model3 = __esm(() => {
482143
482175
  type: "local-jsx",
482144
482176
  name: "model",
482145
482177
  get description() {
482146
- return `Set the AI model for Claude Code (currently ${renderModelName(getMainLoopModel())})`;
482178
+ return `Set the AI model for Stratagem (currently ${renderModelName(getMainLoopModel())})`;
482147
482179
  },
482148
482180
  argumentHint: "[model]",
482149
482181
  get immediate() {
@@ -486499,7 +486531,7 @@ var init_stats3 = __esm(() => {
486499
486531
  stats = {
486500
486532
  type: "local-jsx",
486501
486533
  name: "stats",
486502
- description: "Show your Claude Code usage statistics and activity",
486534
+ description: "Show your Stratagem usage statistics and activity",
486503
486535
  load: () => Promise.resolve().then(() => (init_stats2(), exports_stats))
486504
486536
  };
486505
486537
  stats_default = stats;
@@ -553535,7 +553567,7 @@ function WelcomeV2() {
553535
553567
  dimColor: true,
553536
553568
  children: [
553537
553569
  "v",
553538
- "0.3.5",
553570
+ "0.3.7",
553539
553571
  " "
553540
553572
  ]
553541
553573
  }, undefined, true, undefined, this)
@@ -557620,7 +557652,7 @@ function generateSettingsSchema() {
557620
557652
  function registerUpdateConfigSkill() {
557621
557653
  registerBundledSkill({
557622
557654
  name: "update-config",
557623
- description: 'Use this skill to configure the Claude Code harness via settings.json. Automated behaviors ("from now on when X", "each time X", "whenever X", "before/after X") require hooks configured in settings.json - the harness executes these, not Claude, so memory/preferences cannot fulfill them. Also use for: permissions ("allow X", "add permission", "move permission to"), env vars ("set X=Y"), hook troubleshooting, or any changes to settings.json/settings.local.json files. Examples: "allow npm commands", "add bq permission to global settings", "move permission to user settings", "set DEBUG=true", "when claude stops show X". For simple settings like theme/model, use Config tool.',
557655
+ description: 'Use this skill to configure the Stratagem harness via settings.json. Automated behaviors ("from now on when X", "each time X", "whenever X", "before/after X") require hooks configured in settings.json - the harness executes these, not the agent, so memory/preferences cannot fulfill them. Also use for: permissions ("allow X", "add permission", "move permission to"), env vars ("set X=Y"), hook troubleshooting, or any changes to settings.json/settings.local.json files. Examples: "allow npm commands", "add bq permission to global settings", "move permission to user settings", "set DEBUG=true", "when claude stops show X". For simple settings like theme/model, use Config tool.',
557624
557656
  allowedTools: ["Read"],
557625
557657
  userInvocable: true,
557626
557658
  async getPromptForCommand(args) {
@@ -573553,7 +573585,7 @@ Usage: stx7 --remote "your task description"`, () => gracefulShutdown(1));
573553
573585
  pendingHookMessages
573554
573586
  }, renderAndRun);
573555
573587
  }
573556
- }).version("0.3.5 (STRATAGEM X7)", "-v, --version", "Output the version number");
573588
+ }).version("0.3.7 (STRATAGEM X7)", "-v, --version", "Output the version number");
573557
573589
  program2.option("-w, --worktree [name]", "Create a new git worktree for this session (optionally specify a name)");
573558
573590
  program2.option("--tmux", "Create a tmux session for the worktree (requires --worktree). Uses iTerm2 native panes when available; use --tmux=classic for traditional tmux.");
573559
573591
  if (canUserConfigureAdvisor()) {
@@ -574082,7 +574114,7 @@ if (false) {}
574082
574114
  async function main2() {
574083
574115
  const args = process.argv.slice(2);
574084
574116
  if (args.length === 1 && (args[0] === "--version" || args[0] === "-v" || args[0] === "-V")) {
574085
- console.log(`${"0.3.5"} (STRATAGEM X7)`);
574117
+ console.log(`${"0.3.7"} (STRATAGEM X7)`);
574086
574118
  return;
574087
574119
  }
574088
574120
  if (args.includes("--provider")) {
@@ -574204,4 +574236,4 @@ async function main2() {
574204
574236
  }
574205
574237
  main2();
574206
574238
 
574207
- //# debugId=652CAA3C920DAF9864756E2164756E21
574239
+ //# debugId=A66062B0C691B01264756E2164756E21
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "stratagem-x7",
3
- "version": "0.3.5",
3
+ "version": "0.3.7",
4
4
  "description": "STRATAGEM X7 is a cyberpunk coding-agent CLI for cloud and local model providers",
5
5
  "type": "module",
6
6
  "bin": {