@funnycode/myclaude 0.1.52 → 0.1.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.
- package/dist/myclaude.js +885 -696
- package/dist/myclaude.mjs +885 -696
- package/package.json +3 -1
package/dist/myclaude.mjs
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
// MACRO - build-time constants (injected by build.ts)
|
|
5
5
|
// MACRO injected by build script
|
|
6
6
|
globalThis.MACRO = {
|
|
7
|
-
VERSION: "0.1.
|
|
8
|
-
BUILD_TIME: "2026-06-
|
|
7
|
+
VERSION: "0.1.54",
|
|
8
|
+
BUILD_TIME: "2026-06-29T13:05:24.446Z",
|
|
9
9
|
PACKAGE_URL: "@funnycode/myclaude",
|
|
10
10
|
NATIVE_PACKAGE_URL: "@funnycode/myclaude",
|
|
11
11
|
VERSION_CHANGELOG: '',
|
|
@@ -347605,7 +347605,7 @@ var init_bashProvider = __esm(() => {
|
|
|
347605
347605
|
init_sessionEnvVars();
|
|
347606
347606
|
init_tmuxSocket();
|
|
347607
347607
|
init_windowsPaths();
|
|
347608
|
-
BASH_SPAWN_SEMAPHORE = createSpawnSemaphore(getPlatform() === "windows" ?
|
|
347608
|
+
BASH_SPAWN_SEMAPHORE = createSpawnSemaphore(getPlatform() === "windows" ? 4 : Infinity);
|
|
347609
347609
|
});
|
|
347610
347610
|
|
|
347611
347611
|
// src/utils/shell/powershellDetection.ts
|
|
@@ -347833,8 +347833,8 @@ async function exec3(command, abortSignal, shellType, options) {
|
|
|
347833
347833
|
const shellArgs = isSandboxedPowerShell ? ["-c", commandString] : provider.getSpawnArgs(commandString);
|
|
347834
347834
|
const envOverrides = await provider.getEnvironmentOverrides(command);
|
|
347835
347835
|
const isGitBash = shellType === "bash" && getPlatform() === "windows" && !isSandboxedPowerShell;
|
|
347836
|
-
const MAX_GITBASH_RETRIES =
|
|
347837
|
-
const GITBASH_RETRY_BASE_MS =
|
|
347836
|
+
const MAX_GITBASH_RETRIES = 5;
|
|
347837
|
+
const GITBASH_RETRY_BASE_MS = 1000;
|
|
347838
347838
|
function isGitBashPtyExhaustion(err2) {
|
|
347839
347839
|
const msg = errorMessage(err2).toLowerCase();
|
|
347840
347840
|
return msg.includes("no available terminals") || msg.includes("cannot fork") || msg.includes("resource temporarily unavailable");
|
|
@@ -407632,6 +407632,580 @@ var init_color3 = __esm(() => {
|
|
|
407632
407632
|
color_default = color2;
|
|
407633
407633
|
});
|
|
407634
407634
|
|
|
407635
|
+
// src/achievements/storage.ts
|
|
407636
|
+
function getUnlockedAchievements() {
|
|
407637
|
+
const config4 = getGlobalConfig();
|
|
407638
|
+
return new Set(config4.unlockedAchievements ?? []);
|
|
407639
|
+
}
|
|
407640
|
+
function hasAchievement(id) {
|
|
407641
|
+
return getUnlockedAchievements().has(id);
|
|
407642
|
+
}
|
|
407643
|
+
function unlockAchievement(id) {
|
|
407644
|
+
const unlocked = getUnlockedAchievements();
|
|
407645
|
+
if (unlocked.has(id))
|
|
407646
|
+
return false;
|
|
407647
|
+
unlocked.add(id);
|
|
407648
|
+
saveGlobalConfig((current) => ({
|
|
407649
|
+
...current,
|
|
407650
|
+
unlockedAchievements: [...unlocked]
|
|
407651
|
+
}));
|
|
407652
|
+
return true;
|
|
407653
|
+
}
|
|
407654
|
+
function incrementCounter(key2) {
|
|
407655
|
+
const config4 = getGlobalConfig();
|
|
407656
|
+
const counters = config4.achievementCounters ?? {};
|
|
407657
|
+
const current = (counters[key2] ?? 0) + 1;
|
|
407658
|
+
saveGlobalConfig((cfg) => ({
|
|
407659
|
+
...cfg,
|
|
407660
|
+
achievementCounters: { ...counters, [key2]: current }
|
|
407661
|
+
}));
|
|
407662
|
+
return current;
|
|
407663
|
+
}
|
|
407664
|
+
var init_storage = __esm(() => {
|
|
407665
|
+
init_config();
|
|
407666
|
+
});
|
|
407667
|
+
|
|
407668
|
+
// src/achievements/types.ts
|
|
407669
|
+
function getAchievementsByCategory() {
|
|
407670
|
+
return CATEGORIES.map((cat2) => ({
|
|
407671
|
+
category: cat2,
|
|
407672
|
+
achievements: Object.values(ACHIEVEMENTS).filter((a2) => a2.category === cat2.key)
|
|
407673
|
+
}));
|
|
407674
|
+
}
|
|
407675
|
+
var ACHIEVEMENTS, CATEGORIES;
|
|
407676
|
+
var init_types11 = __esm(() => {
|
|
407677
|
+
ACHIEVEMENTS = {
|
|
407678
|
+
first_hatch: {
|
|
407679
|
+
id: "first_hatch",
|
|
407680
|
+
name: "New Friend",
|
|
407681
|
+
description: "Hatch your first companion",
|
|
407682
|
+
icon: "\uD83E\uDD5A",
|
|
407683
|
+
category: "onboarding"
|
|
407684
|
+
},
|
|
407685
|
+
first_commit: {
|
|
407686
|
+
id: "first_commit",
|
|
407687
|
+
name: "First Commit",
|
|
407688
|
+
description: "Generate your first git commit message",
|
|
407689
|
+
icon: "\uD83D\uDCDD",
|
|
407690
|
+
category: "onboarding"
|
|
407691
|
+
},
|
|
407692
|
+
first_review: {
|
|
407693
|
+
id: "first_review",
|
|
407694
|
+
name: "Code Reviewer",
|
|
407695
|
+
description: "Run your first code review",
|
|
407696
|
+
icon: "\uD83D\uDD0D",
|
|
407697
|
+
category: "onboarding"
|
|
407698
|
+
},
|
|
407699
|
+
first_plugin: {
|
|
407700
|
+
id: "first_plugin",
|
|
407701
|
+
name: "Extensible",
|
|
407702
|
+
description: "Install your first plugin",
|
|
407703
|
+
icon: "\uD83D\uDD0C",
|
|
407704
|
+
category: "onboarding"
|
|
407705
|
+
},
|
|
407706
|
+
first_skill: {
|
|
407707
|
+
id: "first_skill",
|
|
407708
|
+
name: "Skillful",
|
|
407709
|
+
description: "Use your first skill command",
|
|
407710
|
+
icon: "\uD83C\uDFAF",
|
|
407711
|
+
category: "onboarding"
|
|
407712
|
+
},
|
|
407713
|
+
streak_3: {
|
|
407714
|
+
id: "streak_3",
|
|
407715
|
+
name: "Getting Started",
|
|
407716
|
+
description: "Use myclaude for 3 consecutive days",
|
|
407717
|
+
icon: "\uD83D\uDD25",
|
|
407718
|
+
category: "streak"
|
|
407719
|
+
},
|
|
407720
|
+
streak_7: {
|
|
407721
|
+
id: "streak_7",
|
|
407722
|
+
name: "Week Warrior",
|
|
407723
|
+
description: "Use myclaude for 7 consecutive days",
|
|
407724
|
+
icon: "\uD83D\uDD25",
|
|
407725
|
+
category: "streak"
|
|
407726
|
+
},
|
|
407727
|
+
streak_30: {
|
|
407728
|
+
id: "streak_30",
|
|
407729
|
+
name: "Dedicated",
|
|
407730
|
+
description: "Use myclaude for 30 consecutive days",
|
|
407731
|
+
icon: "\uD83D\uDD25",
|
|
407732
|
+
category: "streak"
|
|
407733
|
+
},
|
|
407734
|
+
commits_10: {
|
|
407735
|
+
id: "commits_10",
|
|
407736
|
+
name: "Regular Committer",
|
|
407737
|
+
description: "Generate 10 commit messages",
|
|
407738
|
+
icon: "\uD83D\uDCDD",
|
|
407739
|
+
category: "usage"
|
|
407740
|
+
},
|
|
407741
|
+
commits_100: {
|
|
407742
|
+
id: "commits_100",
|
|
407743
|
+
name: "Commit Machine",
|
|
407744
|
+
description: "Generate 100 commit messages",
|
|
407745
|
+
icon: "\uD83D\uDE80",
|
|
407746
|
+
category: "usage"
|
|
407747
|
+
},
|
|
407748
|
+
chat_100: {
|
|
407749
|
+
id: "chat_100",
|
|
407750
|
+
name: "Conversationalist",
|
|
407751
|
+
description: "Send 100 messages in chat",
|
|
407752
|
+
icon: "\uD83D\uDCAC",
|
|
407753
|
+
category: "usage"
|
|
407754
|
+
},
|
|
407755
|
+
chat_1000: {
|
|
407756
|
+
id: "chat_1000",
|
|
407757
|
+
name: "Power User",
|
|
407758
|
+
description: "Send 1000 messages in chat",
|
|
407759
|
+
icon: "\uD83D\uDCAC",
|
|
407760
|
+
category: "usage"
|
|
407761
|
+
},
|
|
407762
|
+
model_switched: {
|
|
407763
|
+
id: "model_switched",
|
|
407764
|
+
name: "Model Hopper",
|
|
407765
|
+
description: "Switch AI model at least once",
|
|
407766
|
+
icon: "\uD83D\uDD04",
|
|
407767
|
+
category: "usage"
|
|
407768
|
+
},
|
|
407769
|
+
config_changed: {
|
|
407770
|
+
id: "config_changed",
|
|
407771
|
+
name: "Tinkerer",
|
|
407772
|
+
description: "Change a configuration setting",
|
|
407773
|
+
icon: "⚙️",
|
|
407774
|
+
category: "usage"
|
|
407775
|
+
},
|
|
407776
|
+
buddy_hatched: {
|
|
407777
|
+
id: "buddy_hatched",
|
|
407778
|
+
name: "Buddy Up",
|
|
407779
|
+
description: "Hatch a companion",
|
|
407780
|
+
icon: "\uD83D\uDC23",
|
|
407781
|
+
category: "buddy"
|
|
407782
|
+
},
|
|
407783
|
+
buddy_pet_10: {
|
|
407784
|
+
id: "buddy_pet_10",
|
|
407785
|
+
name: "Pet Lover",
|
|
407786
|
+
description: "Pet your companion 10 times",
|
|
407787
|
+
icon: "\uD83D\uDD90️",
|
|
407788
|
+
category: "buddy"
|
|
407789
|
+
},
|
|
407790
|
+
buddy_pet_100: {
|
|
407791
|
+
id: "buddy_pet_100",
|
|
407792
|
+
name: "Best Friend",
|
|
407793
|
+
description: "Pet your companion 100 times",
|
|
407794
|
+
icon: "\uD83D\uDC96",
|
|
407795
|
+
category: "buddy"
|
|
407796
|
+
},
|
|
407797
|
+
buddy_legendary: {
|
|
407798
|
+
id: "buddy_legendary",
|
|
407799
|
+
name: "Legendary Bond",
|
|
407800
|
+
description: "Hatch a legendary companion (1% chance)",
|
|
407801
|
+
icon: "⭐",
|
|
407802
|
+
category: "buddy"
|
|
407803
|
+
},
|
|
407804
|
+
buddy_shiny: {
|
|
407805
|
+
id: "buddy_shiny",
|
|
407806
|
+
name: "Shiny Hunter",
|
|
407807
|
+
description: "Hatch a shiny companion (1% chance)",
|
|
407808
|
+
icon: "✨",
|
|
407809
|
+
category: "buddy"
|
|
407810
|
+
},
|
|
407811
|
+
mcp_added: {
|
|
407812
|
+
id: "mcp_added",
|
|
407813
|
+
name: "Plugin Architect",
|
|
407814
|
+
description: "Add an MCP server",
|
|
407815
|
+
icon: "\uD83D\uDD17",
|
|
407816
|
+
category: "power"
|
|
407817
|
+
}
|
|
407818
|
+
};
|
|
407819
|
+
CATEGORIES = [
|
|
407820
|
+
{ key: "onboarding", label: "Getting Started", icon: "\uD83C\uDF1F" },
|
|
407821
|
+
{ key: "usage", label: "Usage", icon: "\uD83D\uDCCA" },
|
|
407822
|
+
{ key: "streak", label: "Streaks", icon: "\uD83D\uDD25" },
|
|
407823
|
+
{ key: "buddy", label: "Buddy", icon: "\uD83D\uDC3E" },
|
|
407824
|
+
{ key: "power", label: "Power", icon: "⚡" }
|
|
407825
|
+
];
|
|
407826
|
+
});
|
|
407827
|
+
|
|
407828
|
+
// src/buddy/milestones.ts
|
|
407829
|
+
function getMilestones() {
|
|
407830
|
+
return getGlobalConfig().buddyMilestones ?? [];
|
|
407831
|
+
}
|
|
407832
|
+
function addMilestone(type) {
|
|
407833
|
+
const milestones = getMilestones();
|
|
407834
|
+
if (milestones.some((m2) => m2.type === type))
|
|
407835
|
+
return false;
|
|
407836
|
+
const def = MILESTONE_DEFS[type];
|
|
407837
|
+
const milestone = { type, ...def, achievedAt: Date.now() };
|
|
407838
|
+
saveGlobalConfig((cfg) => ({
|
|
407839
|
+
...cfg,
|
|
407840
|
+
buddyMilestones: [...milestones, milestone].sort((a2, b3) => a2.achievedAt - b3.achievedAt)
|
|
407841
|
+
}));
|
|
407842
|
+
return true;
|
|
407843
|
+
}
|
|
407844
|
+
function formatMilestones() {
|
|
407845
|
+
const milestones = getMilestones();
|
|
407846
|
+
if (milestones.length === 0)
|
|
407847
|
+
return "No milestones yet.";
|
|
407848
|
+
return milestones.map((m2) => {
|
|
407849
|
+
const date6 = new Date(m2.achievedAt);
|
|
407850
|
+
const dateStr = `${date6.getFullYear()}-${String(date6.getMonth() + 1).padStart(2, "0")}-${String(date6.getDate()).padStart(2, "0")}`;
|
|
407851
|
+
return ` ${m2.icon} ${m2.label} (${dateStr})`;
|
|
407852
|
+
}).join(`
|
|
407853
|
+
`);
|
|
407854
|
+
}
|
|
407855
|
+
var MILESTONE_DEFS;
|
|
407856
|
+
var init_milestones = __esm(() => {
|
|
407857
|
+
init_config();
|
|
407858
|
+
MILESTONE_DEFS = {
|
|
407859
|
+
first_hatch: { label: "First companion hatched", icon: "\uD83E\uDD5A" },
|
|
407860
|
+
first_commit: { label: "First AI commit", icon: "\uD83D\uDCDD" },
|
|
407861
|
+
first_review: { label: "First code review", icon: "\uD83D\uDD0D" },
|
|
407862
|
+
first_plugin: { label: "First plugin installed", icon: "\uD83D\uDD0C" },
|
|
407863
|
+
first_skill: { label: "First skill used", icon: "\uD83C\uDFAF" },
|
|
407864
|
+
level_5: { label: "Buddy reached level 5", icon: "⭐" },
|
|
407865
|
+
level_10: { label: "Buddy reached level 10", icon: "\uD83C\uDF1F" },
|
|
407866
|
+
level_25: { label: "Buddy reached level 25", icon: "\uD83D\uDCAB" },
|
|
407867
|
+
level_50: { label: "Buddy reached max level 50", icon: "\uD83D\uDC51" },
|
|
407868
|
+
streak_7: { label: "7-day streak achieved", icon: "\uD83D\uDD25" },
|
|
407869
|
+
streak_30: { label: "30-day streak achieved", icon: "\uD83D\uDD25" },
|
|
407870
|
+
achievement_5: { label: "5 achievements unlocked", icon: "\uD83C\uDFC6" },
|
|
407871
|
+
achievement_10: { label: "10 achievements unlocked", icon: "\uD83C\uDFC6" },
|
|
407872
|
+
achievement_20: { label: "All achievements unlocked", icon: "\uD83C\uDFC6" },
|
|
407873
|
+
commits_10: { label: "10 commits generated", icon: "\uD83D\uDCDD" },
|
|
407874
|
+
commits_100: { label: "100 commits generated", icon: "\uD83D\uDE80" },
|
|
407875
|
+
pet_50: { label: "50 times pet your buddy", icon: "\uD83D\uDD90️" },
|
|
407876
|
+
pet_100: { label: "100 times pet your buddy", icon: "\uD83D\uDC96" }
|
|
407877
|
+
};
|
|
407878
|
+
});
|
|
407879
|
+
|
|
407880
|
+
// src/buddy/evolution/index.ts
|
|
407881
|
+
function getBuddyState() {
|
|
407882
|
+
return getGlobalConfig().buddyState ?? DEFAULT_STATE;
|
|
407883
|
+
}
|
|
407884
|
+
function saveBuddyState(update) {
|
|
407885
|
+
const current = getBuddyState();
|
|
407886
|
+
const next = { ...current, ...update };
|
|
407887
|
+
saveGlobalConfig((cfg) => ({ ...cfg, buddyState: next }));
|
|
407888
|
+
return next;
|
|
407889
|
+
}
|
|
407890
|
+
function getLevel() {
|
|
407891
|
+
return getBuddyState().level;
|
|
407892
|
+
}
|
|
407893
|
+
function getXp() {
|
|
407894
|
+
return getBuddyState().xp;
|
|
407895
|
+
}
|
|
407896
|
+
function getXpForNextLevel() {
|
|
407897
|
+
const state = getBuddyState();
|
|
407898
|
+
return state.level * XP_PER_LEVEL;
|
|
407899
|
+
}
|
|
407900
|
+
function getEvolutionStage() {
|
|
407901
|
+
return getBuddyState().evolutionStage;
|
|
407902
|
+
}
|
|
407903
|
+
function addXp(amount) {
|
|
407904
|
+
const events2 = [];
|
|
407905
|
+
let state = getBuddyState();
|
|
407906
|
+
let newXp = state.xp + amount;
|
|
407907
|
+
while (newXp >= state.level * XP_PER_LEVEL && state.level < MAX_LEVEL) {
|
|
407908
|
+
newXp -= state.level * XP_PER_LEVEL;
|
|
407909
|
+
state.level++;
|
|
407910
|
+
events2.push({ type: "level_up", level: state.level });
|
|
407911
|
+
const newStage = getEvolutionForLevel(state.level, state.evolutionStage);
|
|
407912
|
+
if (newStage > state.evolutionStage) {
|
|
407913
|
+
state.evolutionStage = newStage;
|
|
407914
|
+
events2.push({ type: "evolution", stage: newStage });
|
|
407915
|
+
}
|
|
407916
|
+
if (state.level === 5)
|
|
407917
|
+
addMilestone("level_5");
|
|
407918
|
+
if (state.level === 10)
|
|
407919
|
+
addMilestone("level_10");
|
|
407920
|
+
if (state.level === 25)
|
|
407921
|
+
addMilestone("level_25");
|
|
407922
|
+
if (state.level === 50)
|
|
407923
|
+
addMilestone("level_50");
|
|
407924
|
+
}
|
|
407925
|
+
state.xp = Math.min(newXp, MAX_LEVEL * XP_PER_LEVEL);
|
|
407926
|
+
state = saveBuddyState(state);
|
|
407927
|
+
return events2;
|
|
407928
|
+
}
|
|
407929
|
+
function getEvolutionForLevel(level, currentStage) {
|
|
407930
|
+
const companion = getCompanion();
|
|
407931
|
+
if (!companion)
|
|
407932
|
+
return 0;
|
|
407933
|
+
const rule = EVOLUTIONS.find((e) => e.base === companion.species);
|
|
407934
|
+
if (!rule)
|
|
407935
|
+
return 0;
|
|
407936
|
+
if (currentStage < 1 && level >= rule.level)
|
|
407937
|
+
return 1;
|
|
407938
|
+
if (currentStage < 2 && level >= rule.maxLevel)
|
|
407939
|
+
return 2;
|
|
407940
|
+
return currentStage;
|
|
407941
|
+
}
|
|
407942
|
+
function getEvolvedSpecies(species, stage) {
|
|
407943
|
+
if (stage === 0)
|
|
407944
|
+
return species;
|
|
407945
|
+
const rule = EVOLUTIONS.find((e) => e.base === species);
|
|
407946
|
+
if (!rule)
|
|
407947
|
+
return species;
|
|
407948
|
+
return stage >= 2 ? rule.maxEvolved : rule.evolved;
|
|
407949
|
+
}
|
|
407950
|
+
function incrementFeed() {
|
|
407951
|
+
const state = getBuddyState();
|
|
407952
|
+
const count4 = state.feedCount + 1;
|
|
407953
|
+
saveBuddyState({ feedCount: count4 });
|
|
407954
|
+
return count4;
|
|
407955
|
+
}
|
|
407956
|
+
function incrementPlay() {
|
|
407957
|
+
const state = getBuddyState();
|
|
407958
|
+
const count4 = state.playCount + 1;
|
|
407959
|
+
saveBuddyState({ playCount: count4 });
|
|
407960
|
+
return count4;
|
|
407961
|
+
}
|
|
407962
|
+
function getInteractionCounts() {
|
|
407963
|
+
const state = getBuddyState();
|
|
407964
|
+
return { feed: state.feedCount, play: state.playCount };
|
|
407965
|
+
}
|
|
407966
|
+
var XP_PER_LEVEL = 100, MAX_LEVEL = 50, DEFAULT_STATE, EVOLUTIONS, XP_REWARDS;
|
|
407967
|
+
var init_evolution = __esm(() => {
|
|
407968
|
+
init_config();
|
|
407969
|
+
init_companion();
|
|
407970
|
+
init_milestones();
|
|
407971
|
+
DEFAULT_STATE = {
|
|
407972
|
+
xp: 0,
|
|
407973
|
+
level: 1,
|
|
407974
|
+
evolutionStage: 0,
|
|
407975
|
+
feedCount: 0,
|
|
407976
|
+
playCount: 0
|
|
407977
|
+
};
|
|
407978
|
+
EVOLUTIONS = [
|
|
407979
|
+
{ base: "duck", evolved: "goose", maxEvolved: "goose", level: 10, maxLevel: 25 },
|
|
407980
|
+
{ base: "blob", evolved: "ghost", maxEvolved: "ghost", level: 10, maxLevel: 25 },
|
|
407981
|
+
{ base: "cat", evolved: "chonk", maxEvolved: "chonk", level: 12, maxLevel: 28 },
|
|
407982
|
+
{ base: "turtle", evolved: "snail", maxEvolved: "snail", level: 15, maxLevel: 30 }
|
|
407983
|
+
];
|
|
407984
|
+
XP_REWARDS = {
|
|
407985
|
+
BUDDY_HATCH: 50,
|
|
407986
|
+
BUDDY_PET: 5,
|
|
407987
|
+
BUDDY_FEED: 15,
|
|
407988
|
+
BUDDY_PLAY: 20,
|
|
407989
|
+
COMMIT: 10,
|
|
407990
|
+
REVIEW: 25,
|
|
407991
|
+
PLUGIN_INSTALL: 30,
|
|
407992
|
+
SKILL_USE: 5,
|
|
407993
|
+
DAILY_LOGIN: 20,
|
|
407994
|
+
ACHIEVEMENT_UNLOCK: 100
|
|
407995
|
+
};
|
|
407996
|
+
});
|
|
407997
|
+
|
|
407998
|
+
// src/stats/usageStats.ts
|
|
407999
|
+
function getUsageStats() {
|
|
408000
|
+
return getGlobalConfig().usageStats ?? DEFAULT_STATS;
|
|
408001
|
+
}
|
|
408002
|
+
function saveStats(update) {
|
|
408003
|
+
const current = getUsageStats();
|
|
408004
|
+
const next = { ...current, ...update };
|
|
408005
|
+
saveGlobalConfig((cfg) => ({ ...cfg, usageStats: next }));
|
|
408006
|
+
return next;
|
|
408007
|
+
}
|
|
408008
|
+
function trackDailyLogin() {
|
|
408009
|
+
const stats = getUsageStats();
|
|
408010
|
+
const today = new Date().toISOString().slice(0, 10);
|
|
408011
|
+
if (stats.lastActiveDate === today)
|
|
408012
|
+
return;
|
|
408013
|
+
const yesterday = new Date(Date.now() - 86400000).toISOString().slice(0, 10);
|
|
408014
|
+
const streak = stats.lastActiveDate === yesterday ? stats.consecutiveDays + 1 : 1;
|
|
408015
|
+
saveStats({
|
|
408016
|
+
lastActiveDate: today,
|
|
408017
|
+
consecutiveDays: streak,
|
|
408018
|
+
totalSessions: stats.totalSessions + 1
|
|
408019
|
+
});
|
|
408020
|
+
}
|
|
408021
|
+
function trackCommit() {
|
|
408022
|
+
const stats = getUsageStats();
|
|
408023
|
+
saveStats({ totalCommits: stats.totalCommits + 1 });
|
|
408024
|
+
}
|
|
408025
|
+
function trackReview() {
|
|
408026
|
+
const stats = getUsageStats();
|
|
408027
|
+
saveStats({ totalReviews: stats.totalReviews + 1 });
|
|
408028
|
+
}
|
|
408029
|
+
function trackPluginInstall() {
|
|
408030
|
+
const stats = getUsageStats();
|
|
408031
|
+
saveStats({ totalPluginsInstalled: stats.totalPluginsInstalled + 1 });
|
|
408032
|
+
}
|
|
408033
|
+
function trackSkillUse() {
|
|
408034
|
+
const stats = getUsageStats();
|
|
408035
|
+
saveStats({ totalSkillsUsed: stats.totalSkillsUsed + 1 });
|
|
408036
|
+
}
|
|
408037
|
+
function trackBuddyInteraction() {
|
|
408038
|
+
const stats = getUsageStats();
|
|
408039
|
+
saveStats({ totalBuddyInteractions: stats.totalBuddyInteractions + 1 });
|
|
408040
|
+
}
|
|
408041
|
+
var DEFAULT_STATS;
|
|
408042
|
+
var init_usageStats = __esm(() => {
|
|
408043
|
+
init_config();
|
|
408044
|
+
DEFAULT_STATS = {
|
|
408045
|
+
firstUsedAt: Date.now(),
|
|
408046
|
+
totalSessions: 0,
|
|
408047
|
+
totalCommands: 0,
|
|
408048
|
+
totalCommits: 0,
|
|
408049
|
+
totalReviews: 0,
|
|
408050
|
+
totalChatMessages: 0,
|
|
408051
|
+
totalPluginsInstalled: 0,
|
|
408052
|
+
totalSkillsUsed: 0,
|
|
408053
|
+
totalBuddyInteractions: 0,
|
|
408054
|
+
lastActiveDate: new Date().toISOString().slice(0, 10),
|
|
408055
|
+
consecutiveDays: 1,
|
|
408056
|
+
languagesUsed: []
|
|
408057
|
+
};
|
|
408058
|
+
});
|
|
408059
|
+
|
|
408060
|
+
// src/achievements/checker.ts
|
|
408061
|
+
var exports_checker = {};
|
|
408062
|
+
__export(exports_checker, {
|
|
408063
|
+
getPendingAchievements: () => getPendingAchievements,
|
|
408064
|
+
clearPendingAchievements: () => clearPendingAchievements,
|
|
408065
|
+
checkOnSkillUse: () => checkOnSkillUse,
|
|
408066
|
+
checkOnReview: () => checkOnReview,
|
|
408067
|
+
checkOnPluginInstall: () => checkOnPluginInstall,
|
|
408068
|
+
checkOnModelSwitch: () => checkOnModelSwitch,
|
|
408069
|
+
checkOnMcpAdd: () => checkOnMcpAdd,
|
|
408070
|
+
checkOnDailyUse: () => checkOnDailyUse,
|
|
408071
|
+
checkOnConfigChange: () => checkOnConfigChange,
|
|
408072
|
+
checkOnCommit: () => checkOnCommit,
|
|
408073
|
+
checkOnBuddyPet: () => checkOnBuddyPet,
|
|
408074
|
+
checkOnBuddyHatch: () => checkOnBuddyHatch
|
|
408075
|
+
});
|
|
408076
|
+
function getPendingAchievements() {
|
|
408077
|
+
try {
|
|
408078
|
+
const raw = JSON.parse(typeof process !== "undefined" ? process.env.__ACHIEVEMENT_PENDING__ || "[]" : "[]");
|
|
408079
|
+
return Array.isArray(raw) ? raw : [];
|
|
408080
|
+
} catch {
|
|
408081
|
+
return [];
|
|
408082
|
+
}
|
|
408083
|
+
}
|
|
408084
|
+
function clearPendingAchievements() {
|
|
408085
|
+
if (typeof process !== "undefined") {
|
|
408086
|
+
process.env.__ACHIEVEMENT_PENDING__ = "[]";
|
|
408087
|
+
}
|
|
408088
|
+
}
|
|
408089
|
+
function notify2(id) {
|
|
408090
|
+
if (typeof process !== "undefined") {
|
|
408091
|
+
try {
|
|
408092
|
+
const pending = JSON.parse(process.env.__ACHIEVEMENT_PENDING__ || "[]");
|
|
408093
|
+
pending.push(id);
|
|
408094
|
+
process.env.__ACHIEVEMENT_PENDING__ = JSON.stringify(pending);
|
|
408095
|
+
} catch {
|
|
408096
|
+
process.env.__ACHIEVEMENT_PENDING__ = JSON.stringify([id]);
|
|
408097
|
+
}
|
|
408098
|
+
}
|
|
408099
|
+
}
|
|
408100
|
+
function checkOnBuddyHatch() {
|
|
408101
|
+
tryUnlock("buddy_hatched");
|
|
408102
|
+
const companion = getCompanion();
|
|
408103
|
+
if (companion?.rarity === "legendary") {
|
|
408104
|
+
tryUnlock("buddy_legendary");
|
|
408105
|
+
}
|
|
408106
|
+
if (companion?.shiny) {
|
|
408107
|
+
tryUnlock("buddy_shiny");
|
|
408108
|
+
}
|
|
408109
|
+
}
|
|
408110
|
+
function checkOnBuddyPet() {
|
|
408111
|
+
const count4 = incrementCounter("buddy_pet");
|
|
408112
|
+
tryUnlock("buddy_pet_10", count4 >= 10);
|
|
408113
|
+
tryUnlock("buddy_pet_100", count4 >= 100);
|
|
408114
|
+
}
|
|
408115
|
+
function checkOnCommit() {
|
|
408116
|
+
tryUnlock("first_commit");
|
|
408117
|
+
const count4 = incrementCounter("commits");
|
|
408118
|
+
tryUnlock("commits_10", count4 >= 10);
|
|
408119
|
+
tryUnlock("commits_100", count4 >= 100);
|
|
408120
|
+
addXp(XP_REWARDS.COMMIT);
|
|
408121
|
+
trackCommit();
|
|
408122
|
+
if (count4 === 1)
|
|
408123
|
+
addMilestone("first_commit");
|
|
408124
|
+
if (count4 === 10)
|
|
408125
|
+
addMilestone("commits_10");
|
|
408126
|
+
if (count4 === 100)
|
|
408127
|
+
addMilestone("commits_100");
|
|
408128
|
+
}
|
|
408129
|
+
function checkOnReview() {
|
|
408130
|
+
tryUnlock("first_review");
|
|
408131
|
+
addXp(XP_REWARDS.REVIEW);
|
|
408132
|
+
trackReview();
|
|
408133
|
+
addMilestone("first_review");
|
|
408134
|
+
}
|
|
408135
|
+
function checkOnPluginInstall() {
|
|
408136
|
+
tryUnlock("first_plugin");
|
|
408137
|
+
addXp(XP_REWARDS.PLUGIN_INSTALL);
|
|
408138
|
+
trackPluginInstall();
|
|
408139
|
+
addMilestone("first_plugin");
|
|
408140
|
+
}
|
|
408141
|
+
function checkOnSkillUse() {
|
|
408142
|
+
tryUnlock("first_skill");
|
|
408143
|
+
addXp(XP_REWARDS.SKILL_USE);
|
|
408144
|
+
trackSkillUse();
|
|
408145
|
+
addMilestone("first_skill");
|
|
408146
|
+
}
|
|
408147
|
+
function checkOnMcpAdd() {
|
|
408148
|
+
tryUnlock("mcp_added");
|
|
408149
|
+
}
|
|
408150
|
+
function checkOnModelSwitch() {
|
|
408151
|
+
tryUnlock("model_switched");
|
|
408152
|
+
}
|
|
408153
|
+
function checkOnConfigChange() {
|
|
408154
|
+
tryUnlock("config_changed");
|
|
408155
|
+
}
|
|
408156
|
+
function checkOnDailyUse() {
|
|
408157
|
+
trackDailyLogin();
|
|
408158
|
+
const config4 = getGlobalConfig();
|
|
408159
|
+
const today = new Date().toISOString().slice(0, 10);
|
|
408160
|
+
const lastSeen = config4.achievementLastSeenDate;
|
|
408161
|
+
saveGlobalConfig((current) => ({
|
|
408162
|
+
...current,
|
|
408163
|
+
achievementLastSeenDate: today
|
|
408164
|
+
}));
|
|
408165
|
+
if (lastSeen !== today) {
|
|
408166
|
+
const streak = incrementCounter("daily_streak");
|
|
408167
|
+
tryUnlock("streak_3", streak >= 3);
|
|
408168
|
+
tryUnlock("streak_7", streak >= 7);
|
|
408169
|
+
tryUnlock("streak_30", streak >= 30);
|
|
408170
|
+
addXp(XP_REWARDS.DAILY_LOGIN);
|
|
408171
|
+
if (streak === 7)
|
|
408172
|
+
addMilestone("streak_7");
|
|
408173
|
+
if (streak === 30)
|
|
408174
|
+
addMilestone("streak_30");
|
|
408175
|
+
}
|
|
408176
|
+
}
|
|
408177
|
+
function tryUnlock(id, condition = true) {
|
|
408178
|
+
if (!condition)
|
|
408179
|
+
return;
|
|
408180
|
+
if (hasAchievement(id))
|
|
408181
|
+
return;
|
|
408182
|
+
if (unlockAchievement(id)) {
|
|
408183
|
+
addXp(XP_REWARDS.ACHIEVEMENT_UNLOCK);
|
|
408184
|
+
const unlocked = getUnlockedAchievements();
|
|
408185
|
+
if (unlocked.size === 5)
|
|
408186
|
+
addMilestone("achievement_5");
|
|
408187
|
+
if (unlocked.size === 10)
|
|
408188
|
+
addMilestone("achievement_10");
|
|
408189
|
+
if (unlocked.size === 20)
|
|
408190
|
+
addMilestone("achievement_20");
|
|
408191
|
+
const achievement = ACHIEVEMENTS[id];
|
|
408192
|
+
console.error(`
|
|
408193
|
+
\uD83C\uDFC6 ${achievement.icon} Achievement Unlocked: ${achievement.name}`);
|
|
408194
|
+
console.error(` ${achievement.description}
|
|
408195
|
+
`);
|
|
408196
|
+
notify2(id);
|
|
408197
|
+
}
|
|
408198
|
+
}
|
|
408199
|
+
var init_checker = __esm(() => {
|
|
408200
|
+
init_storage();
|
|
408201
|
+
init_types11();
|
|
408202
|
+
init_companion();
|
|
408203
|
+
init_evolution();
|
|
408204
|
+
init_milestones();
|
|
408205
|
+
init_usageStats();
|
|
408206
|
+
init_config();
|
|
408207
|
+
});
|
|
408208
|
+
|
|
407635
408209
|
// src/commands/commit.ts
|
|
407636
408210
|
function getPromptContent() {
|
|
407637
408211
|
const { commit: commitAttribution } = getAttributionTexts();
|
|
@@ -407683,6 +408257,7 @@ var init_commit = __esm(() => {
|
|
|
407683
408257
|
init_attribution();
|
|
407684
408258
|
init_promptShellExecution();
|
|
407685
408259
|
init_undercover();
|
|
408260
|
+
init_checker();
|
|
407686
408261
|
ALLOWED_TOOLS = [
|
|
407687
408262
|
"Bash(git add:*)",
|
|
407688
408263
|
"Bash(git status:*)",
|
|
@@ -407697,6 +408272,7 @@ var init_commit = __esm(() => {
|
|
|
407697
408272
|
progressMessage: "creating commit",
|
|
407698
408273
|
source: "builtin",
|
|
407699
408274
|
async getPromptForCommand(_args, context) {
|
|
408275
|
+
checkOnCommit();
|
|
407700
408276
|
const promptContent = getPromptContent();
|
|
407701
408277
|
const finalContent = await executeShellCommandsInPrompt(promptContent, {
|
|
407702
408278
|
...context,
|
|
@@ -455401,6 +455977,7 @@ var CCR_TERMS_URL = "https://code.claude.com/docs/en/claude-code-on-the-web", LO
|
|
|
455401
455977
|
`, review, ultrareview, review_default;
|
|
455402
455978
|
var init_review = __esm(() => {
|
|
455403
455979
|
init_ultrareviewEnabled();
|
|
455980
|
+
init_checker();
|
|
455404
455981
|
review = {
|
|
455405
455982
|
type: "prompt",
|
|
455406
455983
|
name: "review",
|
|
@@ -455409,6 +455986,7 @@ var init_review = __esm(() => {
|
|
|
455409
455986
|
contentLength: 0,
|
|
455410
455987
|
source: "builtin",
|
|
455411
455988
|
async getPromptForCommand(args) {
|
|
455989
|
+
checkOnReview();
|
|
455412
455990
|
return [{ type: "text", text: LOCAL_REVIEW_PROMPT(args) }];
|
|
455413
455991
|
}
|
|
455414
455992
|
};
|
|
@@ -456108,7 +456686,7 @@ var init_teammateViewHelpers = __esm(() => {
|
|
|
456108
456686
|
|
|
456109
456687
|
// src/bridge/types.ts
|
|
456110
456688
|
var DEFAULT_SESSION_TIMEOUT_MS, BRIDGE_LOGIN_INSTRUCTION = "Remote Control is only available with claude.ai subscriptions. Please use `/login` to sign in with your claude.ai account.", BRIDGE_LOGIN_ERROR, REMOTE_CONTROL_DISCONNECTED_MSG = "Remote Control disconnected.";
|
|
456111
|
-
var
|
|
456689
|
+
var init_types12 = __esm(() => {
|
|
456112
456690
|
DEFAULT_SESSION_TIMEOUT_MS = 24 * 60 * 60 * 1000;
|
|
456113
456691
|
BRIDGE_LOGIN_ERROR = `Error: You must be logged in to use Remote Control.
|
|
456114
456692
|
|
|
@@ -456637,7 +457215,7 @@ var ULTRAPLAN_TIMEOUT_MS, CCR_TERMS_URL2 = "https://code.claude.com/docs/en/clau
|
|
|
456637
457215
|
return null;
|
|
456638
457216
|
}, ultraplan_default;
|
|
456639
457217
|
var init_ultraplan = __esm(() => {
|
|
456640
|
-
|
|
457218
|
+
init_types12();
|
|
456641
457219
|
init_figures2();
|
|
456642
457220
|
init_growthbook();
|
|
456643
457221
|
init_analytics();
|
|
@@ -468870,7 +469448,7 @@ var init_agentDisplay = __esm(() => {
|
|
|
468870
469448
|
|
|
468871
469449
|
// src/components/agents/types.ts
|
|
468872
469450
|
var AGENT_PATHS;
|
|
468873
|
-
var
|
|
469451
|
+
var init_types13 = __esm(() => {
|
|
468874
469452
|
AGENT_PATHS = {
|
|
468875
469453
|
project: ".claude/agents",
|
|
468876
469454
|
user: "~/.claude/agents"
|
|
@@ -469017,7 +469595,7 @@ var init_agentFileUtils = __esm(() => {
|
|
|
469017
469595
|
init_cwd2();
|
|
469018
469596
|
init_envUtils();
|
|
469019
469597
|
init_errors();
|
|
469020
|
-
|
|
469598
|
+
init_types13();
|
|
469021
469599
|
});
|
|
469022
469600
|
|
|
469023
469601
|
// src/components/agents/AgentDetail.tsx
|
|
@@ -474756,7 +475334,7 @@ var init_plugin2 = __esm(() => {
|
|
|
474756
475334
|
|
|
474757
475335
|
// src/services/settingsSync/types.ts
|
|
474758
475336
|
var UserSyncContentSchema, UserSyncDataSchema;
|
|
474759
|
-
var
|
|
475337
|
+
var init_types14 = __esm(() => {
|
|
474760
475338
|
init_v4();
|
|
474761
475339
|
UserSyncContentSchema = lazySchema(() => exports_external.object({
|
|
474762
475340
|
entries: exports_external.record(exports_external.string(), exports_external.string())
|
|
@@ -474788,7 +475366,7 @@ var init_settingsSync = __esm(() => {
|
|
|
474788
475366
|
init_growthbook();
|
|
474789
475367
|
init_analytics();
|
|
474790
475368
|
init_withRetry();
|
|
474791
|
-
|
|
475369
|
+
init_types14();
|
|
474792
475370
|
MAX_FILE_SIZE_BYTES3 = 500 * 1024;
|
|
474793
475371
|
});
|
|
474794
475372
|
|
|
@@ -475412,7 +475990,7 @@ var BETA_HEADER = "environments-2025-11-01", SAFE_ID_PATTERN, BridgeFatalError;
|
|
|
475412
475990
|
var init_bridgeApi = __esm(() => {
|
|
475413
475991
|
init_axios2();
|
|
475414
475992
|
init_debugUtils();
|
|
475415
|
-
|
|
475993
|
+
init_types12();
|
|
475416
475994
|
SAFE_ID_PATTERN = /^[a-zA-Z0-9_-]+$/;
|
|
475417
475995
|
BridgeFatalError = class BridgeFatalError extends Error {
|
|
475418
475996
|
status;
|
|
@@ -475667,199 +476245,6 @@ var init_summary = __esm(() => {
|
|
|
475667
476245
|
summary_default = { isEnabled: () => false, isHidden: true, name: "stub" };
|
|
475668
476246
|
});
|
|
475669
476247
|
|
|
475670
|
-
// src/achievements/storage.ts
|
|
475671
|
-
function getUnlockedAchievements() {
|
|
475672
|
-
const config5 = getGlobalConfig();
|
|
475673
|
-
return new Set(config5.unlockedAchievements ?? []);
|
|
475674
|
-
}
|
|
475675
|
-
function hasAchievement(id) {
|
|
475676
|
-
return getUnlockedAchievements().has(id);
|
|
475677
|
-
}
|
|
475678
|
-
function unlockAchievement(id) {
|
|
475679
|
-
const unlocked = getUnlockedAchievements();
|
|
475680
|
-
if (unlocked.has(id))
|
|
475681
|
-
return false;
|
|
475682
|
-
unlocked.add(id);
|
|
475683
|
-
saveGlobalConfig((current) => ({
|
|
475684
|
-
...current,
|
|
475685
|
-
unlockedAchievements: [...unlocked]
|
|
475686
|
-
}));
|
|
475687
|
-
return true;
|
|
475688
|
-
}
|
|
475689
|
-
function incrementCounter(key2) {
|
|
475690
|
-
const config5 = getGlobalConfig();
|
|
475691
|
-
const counters = config5.achievementCounters ?? {};
|
|
475692
|
-
const current = (counters[key2] ?? 0) + 1;
|
|
475693
|
-
saveGlobalConfig((cfg) => ({
|
|
475694
|
-
...cfg,
|
|
475695
|
-
achievementCounters: { ...counters, [key2]: current }
|
|
475696
|
-
}));
|
|
475697
|
-
return current;
|
|
475698
|
-
}
|
|
475699
|
-
var init_storage = __esm(() => {
|
|
475700
|
-
init_config();
|
|
475701
|
-
});
|
|
475702
|
-
|
|
475703
|
-
// src/achievements/types.ts
|
|
475704
|
-
function getAchievementsByCategory() {
|
|
475705
|
-
return CATEGORIES.map((cat2) => ({
|
|
475706
|
-
category: cat2,
|
|
475707
|
-
achievements: Object.values(ACHIEVEMENTS).filter((a2) => a2.category === cat2.key)
|
|
475708
|
-
}));
|
|
475709
|
-
}
|
|
475710
|
-
var ACHIEVEMENTS, CATEGORIES;
|
|
475711
|
-
var init_types14 = __esm(() => {
|
|
475712
|
-
ACHIEVEMENTS = {
|
|
475713
|
-
first_hatch: {
|
|
475714
|
-
id: "first_hatch",
|
|
475715
|
-
name: "New Friend",
|
|
475716
|
-
description: "Hatch your first companion",
|
|
475717
|
-
icon: "\uD83E\uDD5A",
|
|
475718
|
-
category: "onboarding"
|
|
475719
|
-
},
|
|
475720
|
-
first_commit: {
|
|
475721
|
-
id: "first_commit",
|
|
475722
|
-
name: "First Commit",
|
|
475723
|
-
description: "Generate your first git commit message",
|
|
475724
|
-
icon: "\uD83D\uDCDD",
|
|
475725
|
-
category: "onboarding"
|
|
475726
|
-
},
|
|
475727
|
-
first_review: {
|
|
475728
|
-
id: "first_review",
|
|
475729
|
-
name: "Code Reviewer",
|
|
475730
|
-
description: "Run your first code review",
|
|
475731
|
-
icon: "\uD83D\uDD0D",
|
|
475732
|
-
category: "onboarding"
|
|
475733
|
-
},
|
|
475734
|
-
first_plugin: {
|
|
475735
|
-
id: "first_plugin",
|
|
475736
|
-
name: "Extensible",
|
|
475737
|
-
description: "Install your first plugin",
|
|
475738
|
-
icon: "\uD83D\uDD0C",
|
|
475739
|
-
category: "onboarding"
|
|
475740
|
-
},
|
|
475741
|
-
first_skill: {
|
|
475742
|
-
id: "first_skill",
|
|
475743
|
-
name: "Skillful",
|
|
475744
|
-
description: "Use your first skill command",
|
|
475745
|
-
icon: "\uD83C\uDFAF",
|
|
475746
|
-
category: "onboarding"
|
|
475747
|
-
},
|
|
475748
|
-
streak_3: {
|
|
475749
|
-
id: "streak_3",
|
|
475750
|
-
name: "Getting Started",
|
|
475751
|
-
description: "Use myclaude for 3 consecutive days",
|
|
475752
|
-
icon: "\uD83D\uDD25",
|
|
475753
|
-
category: "streak"
|
|
475754
|
-
},
|
|
475755
|
-
streak_7: {
|
|
475756
|
-
id: "streak_7",
|
|
475757
|
-
name: "Week Warrior",
|
|
475758
|
-
description: "Use myclaude for 7 consecutive days",
|
|
475759
|
-
icon: "\uD83D\uDD25",
|
|
475760
|
-
category: "streak"
|
|
475761
|
-
},
|
|
475762
|
-
streak_30: {
|
|
475763
|
-
id: "streak_30",
|
|
475764
|
-
name: "Dedicated",
|
|
475765
|
-
description: "Use myclaude for 30 consecutive days",
|
|
475766
|
-
icon: "\uD83D\uDD25",
|
|
475767
|
-
category: "streak"
|
|
475768
|
-
},
|
|
475769
|
-
commits_10: {
|
|
475770
|
-
id: "commits_10",
|
|
475771
|
-
name: "Regular Committer",
|
|
475772
|
-
description: "Generate 10 commit messages",
|
|
475773
|
-
icon: "\uD83D\uDCDD",
|
|
475774
|
-
category: "usage"
|
|
475775
|
-
},
|
|
475776
|
-
commits_100: {
|
|
475777
|
-
id: "commits_100",
|
|
475778
|
-
name: "Commit Machine",
|
|
475779
|
-
description: "Generate 100 commit messages",
|
|
475780
|
-
icon: "\uD83D\uDE80",
|
|
475781
|
-
category: "usage"
|
|
475782
|
-
},
|
|
475783
|
-
chat_100: {
|
|
475784
|
-
id: "chat_100",
|
|
475785
|
-
name: "Conversationalist",
|
|
475786
|
-
description: "Send 100 messages in chat",
|
|
475787
|
-
icon: "\uD83D\uDCAC",
|
|
475788
|
-
category: "usage"
|
|
475789
|
-
},
|
|
475790
|
-
chat_1000: {
|
|
475791
|
-
id: "chat_1000",
|
|
475792
|
-
name: "Power User",
|
|
475793
|
-
description: "Send 1000 messages in chat",
|
|
475794
|
-
icon: "\uD83D\uDCAC",
|
|
475795
|
-
category: "usage"
|
|
475796
|
-
},
|
|
475797
|
-
model_switched: {
|
|
475798
|
-
id: "model_switched",
|
|
475799
|
-
name: "Model Hopper",
|
|
475800
|
-
description: "Switch AI model at least once",
|
|
475801
|
-
icon: "\uD83D\uDD04",
|
|
475802
|
-
category: "usage"
|
|
475803
|
-
},
|
|
475804
|
-
config_changed: {
|
|
475805
|
-
id: "config_changed",
|
|
475806
|
-
name: "Tinkerer",
|
|
475807
|
-
description: "Change a configuration setting",
|
|
475808
|
-
icon: "⚙️",
|
|
475809
|
-
category: "usage"
|
|
475810
|
-
},
|
|
475811
|
-
buddy_hatched: {
|
|
475812
|
-
id: "buddy_hatched",
|
|
475813
|
-
name: "Buddy Up",
|
|
475814
|
-
description: "Hatch a companion",
|
|
475815
|
-
icon: "\uD83D\uDC23",
|
|
475816
|
-
category: "buddy"
|
|
475817
|
-
},
|
|
475818
|
-
buddy_pet_10: {
|
|
475819
|
-
id: "buddy_pet_10",
|
|
475820
|
-
name: "Pet Lover",
|
|
475821
|
-
description: "Pet your companion 10 times",
|
|
475822
|
-
icon: "\uD83D\uDD90️",
|
|
475823
|
-
category: "buddy"
|
|
475824
|
-
},
|
|
475825
|
-
buddy_pet_100: {
|
|
475826
|
-
id: "buddy_pet_100",
|
|
475827
|
-
name: "Best Friend",
|
|
475828
|
-
description: "Pet your companion 100 times",
|
|
475829
|
-
icon: "\uD83D\uDC96",
|
|
475830
|
-
category: "buddy"
|
|
475831
|
-
},
|
|
475832
|
-
buddy_legendary: {
|
|
475833
|
-
id: "buddy_legendary",
|
|
475834
|
-
name: "Legendary Bond",
|
|
475835
|
-
description: "Hatch a legendary companion (1% chance)",
|
|
475836
|
-
icon: "⭐",
|
|
475837
|
-
category: "buddy"
|
|
475838
|
-
},
|
|
475839
|
-
buddy_shiny: {
|
|
475840
|
-
id: "buddy_shiny",
|
|
475841
|
-
name: "Shiny Hunter",
|
|
475842
|
-
description: "Hatch a shiny companion (1% chance)",
|
|
475843
|
-
icon: "✨",
|
|
475844
|
-
category: "buddy"
|
|
475845
|
-
},
|
|
475846
|
-
mcp_added: {
|
|
475847
|
-
id: "mcp_added",
|
|
475848
|
-
name: "Plugin Architect",
|
|
475849
|
-
description: "Add an MCP server",
|
|
475850
|
-
icon: "\uD83D\uDD17",
|
|
475851
|
-
category: "power"
|
|
475852
|
-
}
|
|
475853
|
-
};
|
|
475854
|
-
CATEGORIES = [
|
|
475855
|
-
{ key: "onboarding", label: "Getting Started", icon: "\uD83C\uDF1F" },
|
|
475856
|
-
{ key: "usage", label: "Usage", icon: "\uD83D\uDCCA" },
|
|
475857
|
-
{ key: "streak", label: "Streaks", icon: "\uD83D\uDD25" },
|
|
475858
|
-
{ key: "buddy", label: "Buddy", icon: "\uD83D\uDC3E" },
|
|
475859
|
-
{ key: "power", label: "Power", icon: "⚡" }
|
|
475860
|
-
];
|
|
475861
|
-
});
|
|
475862
|
-
|
|
475863
476248
|
// src/commands/achievements/achievements.ts
|
|
475864
476249
|
var exports_achievements = {};
|
|
475865
476250
|
__export(exports_achievements, {
|
|
@@ -475924,7 +476309,7 @@ var call57 = async (args) => {
|
|
|
475924
476309
|
};
|
|
475925
476310
|
var init_achievements = __esm(() => {
|
|
475926
476311
|
init_storage();
|
|
475927
|
-
|
|
476312
|
+
init_types11();
|
|
475928
476313
|
});
|
|
475929
476314
|
|
|
475930
476315
|
// src/commands/achievements/index.ts
|
|
@@ -475941,209 +476326,6 @@ var init_achievements2 = __esm(() => {
|
|
|
475941
476326
|
achievements_default = achievementsCmd;
|
|
475942
476327
|
});
|
|
475943
476328
|
|
|
475944
|
-
// src/stats/usageStats.ts
|
|
475945
|
-
function getUsageStats() {
|
|
475946
|
-
return getGlobalConfig().usageStats ?? DEFAULT_STATS;
|
|
475947
|
-
}
|
|
475948
|
-
function saveStats(update) {
|
|
475949
|
-
const current = getUsageStats();
|
|
475950
|
-
const next = { ...current, ...update };
|
|
475951
|
-
saveGlobalConfig((cfg) => ({ ...cfg, usageStats: next }));
|
|
475952
|
-
return next;
|
|
475953
|
-
}
|
|
475954
|
-
function trackBuddyInteraction() {
|
|
475955
|
-
const stats = getUsageStats();
|
|
475956
|
-
saveStats({ totalBuddyInteractions: stats.totalBuddyInteractions + 1 });
|
|
475957
|
-
}
|
|
475958
|
-
var DEFAULT_STATS;
|
|
475959
|
-
var init_usageStats = __esm(() => {
|
|
475960
|
-
init_config();
|
|
475961
|
-
DEFAULT_STATS = {
|
|
475962
|
-
firstUsedAt: Date.now(),
|
|
475963
|
-
totalSessions: 0,
|
|
475964
|
-
totalCommands: 0,
|
|
475965
|
-
totalCommits: 0,
|
|
475966
|
-
totalReviews: 0,
|
|
475967
|
-
totalChatMessages: 0,
|
|
475968
|
-
totalPluginsInstalled: 0,
|
|
475969
|
-
totalSkillsUsed: 0,
|
|
475970
|
-
totalBuddyInteractions: 0,
|
|
475971
|
-
lastActiveDate: new Date().toISOString().slice(0, 10),
|
|
475972
|
-
consecutiveDays: 1,
|
|
475973
|
-
languagesUsed: []
|
|
475974
|
-
};
|
|
475975
|
-
});
|
|
475976
|
-
|
|
475977
|
-
// src/buddy/milestones.ts
|
|
475978
|
-
function getMilestones() {
|
|
475979
|
-
return getGlobalConfig().buddyMilestones ?? [];
|
|
475980
|
-
}
|
|
475981
|
-
function addMilestone(type) {
|
|
475982
|
-
const milestones = getMilestones();
|
|
475983
|
-
if (milestones.some((m2) => m2.type === type))
|
|
475984
|
-
return false;
|
|
475985
|
-
const def = MILESTONE_DEFS[type];
|
|
475986
|
-
const milestone = { type, ...def, achievedAt: Date.now() };
|
|
475987
|
-
saveGlobalConfig((cfg) => ({
|
|
475988
|
-
...cfg,
|
|
475989
|
-
buddyMilestones: [...milestones, milestone].sort((a2, b3) => a2.achievedAt - b3.achievedAt)
|
|
475990
|
-
}));
|
|
475991
|
-
return true;
|
|
475992
|
-
}
|
|
475993
|
-
function formatMilestones() {
|
|
475994
|
-
const milestones = getMilestones();
|
|
475995
|
-
if (milestones.length === 0)
|
|
475996
|
-
return "No milestones yet.";
|
|
475997
|
-
return milestones.map((m2) => {
|
|
475998
|
-
const date6 = new Date(m2.achievedAt);
|
|
475999
|
-
const dateStr = `${date6.getFullYear()}-${String(date6.getMonth() + 1).padStart(2, "0")}-${String(date6.getDate()).padStart(2, "0")}`;
|
|
476000
|
-
return ` ${m2.icon} ${m2.label} (${dateStr})`;
|
|
476001
|
-
}).join(`
|
|
476002
|
-
`);
|
|
476003
|
-
}
|
|
476004
|
-
var MILESTONE_DEFS;
|
|
476005
|
-
var init_milestones = __esm(() => {
|
|
476006
|
-
init_config();
|
|
476007
|
-
MILESTONE_DEFS = {
|
|
476008
|
-
first_hatch: { label: "First companion hatched", icon: "\uD83E\uDD5A" },
|
|
476009
|
-
first_commit: { label: "First AI commit", icon: "\uD83D\uDCDD" },
|
|
476010
|
-
first_review: { label: "First code review", icon: "\uD83D\uDD0D" },
|
|
476011
|
-
first_plugin: { label: "First plugin installed", icon: "\uD83D\uDD0C" },
|
|
476012
|
-
first_skill: { label: "First skill used", icon: "\uD83C\uDFAF" },
|
|
476013
|
-
level_5: { label: "Buddy reached level 5", icon: "⭐" },
|
|
476014
|
-
level_10: { label: "Buddy reached level 10", icon: "\uD83C\uDF1F" },
|
|
476015
|
-
level_25: { label: "Buddy reached level 25", icon: "\uD83D\uDCAB" },
|
|
476016
|
-
level_50: { label: "Buddy reached max level 50", icon: "\uD83D\uDC51" },
|
|
476017
|
-
streak_7: { label: "7-day streak achieved", icon: "\uD83D\uDD25" },
|
|
476018
|
-
streak_30: { label: "30-day streak achieved", icon: "\uD83D\uDD25" },
|
|
476019
|
-
achievement_5: { label: "5 achievements unlocked", icon: "\uD83C\uDFC6" },
|
|
476020
|
-
achievement_10: { label: "10 achievements unlocked", icon: "\uD83C\uDFC6" },
|
|
476021
|
-
achievement_20: { label: "All achievements unlocked", icon: "\uD83C\uDFC6" },
|
|
476022
|
-
commits_10: { label: "10 commits generated", icon: "\uD83D\uDCDD" },
|
|
476023
|
-
commits_100: { label: "100 commits generated", icon: "\uD83D\uDE80" },
|
|
476024
|
-
pet_50: { label: "50 times pet your buddy", icon: "\uD83D\uDD90️" },
|
|
476025
|
-
pet_100: { label: "100 times pet your buddy", icon: "\uD83D\uDC96" }
|
|
476026
|
-
};
|
|
476027
|
-
});
|
|
476028
|
-
|
|
476029
|
-
// src/buddy/evolution/index.ts
|
|
476030
|
-
function getBuddyState() {
|
|
476031
|
-
return getGlobalConfig().buddyState ?? DEFAULT_STATE;
|
|
476032
|
-
}
|
|
476033
|
-
function saveBuddyState(update) {
|
|
476034
|
-
const current = getBuddyState();
|
|
476035
|
-
const next = { ...current, ...update };
|
|
476036
|
-
saveGlobalConfig((cfg) => ({ ...cfg, buddyState: next }));
|
|
476037
|
-
return next;
|
|
476038
|
-
}
|
|
476039
|
-
function getLevel() {
|
|
476040
|
-
return getBuddyState().level;
|
|
476041
|
-
}
|
|
476042
|
-
function getXp() {
|
|
476043
|
-
return getBuddyState().xp;
|
|
476044
|
-
}
|
|
476045
|
-
function getXpForNextLevel() {
|
|
476046
|
-
const state = getBuddyState();
|
|
476047
|
-
return state.level * XP_PER_LEVEL;
|
|
476048
|
-
}
|
|
476049
|
-
function getEvolutionStage() {
|
|
476050
|
-
return getBuddyState().evolutionStage;
|
|
476051
|
-
}
|
|
476052
|
-
function addXp(amount) {
|
|
476053
|
-
const events2 = [];
|
|
476054
|
-
let state = getBuddyState();
|
|
476055
|
-
let newXp = state.xp + amount;
|
|
476056
|
-
while (newXp >= state.level * XP_PER_LEVEL && state.level < MAX_LEVEL) {
|
|
476057
|
-
newXp -= state.level * XP_PER_LEVEL;
|
|
476058
|
-
state.level++;
|
|
476059
|
-
events2.push({ type: "level_up", level: state.level });
|
|
476060
|
-
const newStage = getEvolutionForLevel(state.level, state.evolutionStage);
|
|
476061
|
-
if (newStage > state.evolutionStage) {
|
|
476062
|
-
state.evolutionStage = newStage;
|
|
476063
|
-
events2.push({ type: "evolution", stage: newStage });
|
|
476064
|
-
}
|
|
476065
|
-
if (state.level === 5)
|
|
476066
|
-
addMilestone("level_5");
|
|
476067
|
-
if (state.level === 10)
|
|
476068
|
-
addMilestone("level_10");
|
|
476069
|
-
if (state.level === 25)
|
|
476070
|
-
addMilestone("level_25");
|
|
476071
|
-
if (state.level === 50)
|
|
476072
|
-
addMilestone("level_50");
|
|
476073
|
-
}
|
|
476074
|
-
state.xp = Math.min(newXp, MAX_LEVEL * XP_PER_LEVEL);
|
|
476075
|
-
state = saveBuddyState(state);
|
|
476076
|
-
return events2;
|
|
476077
|
-
}
|
|
476078
|
-
function getEvolutionForLevel(level, currentStage) {
|
|
476079
|
-
const companion = getCompanion();
|
|
476080
|
-
if (!companion)
|
|
476081
|
-
return 0;
|
|
476082
|
-
const rule = EVOLUTIONS.find((e) => e.base === companion.species);
|
|
476083
|
-
if (!rule)
|
|
476084
|
-
return 0;
|
|
476085
|
-
if (currentStage < 1 && level >= rule.level)
|
|
476086
|
-
return 1;
|
|
476087
|
-
if (currentStage < 2 && level >= rule.maxLevel)
|
|
476088
|
-
return 2;
|
|
476089
|
-
return currentStage;
|
|
476090
|
-
}
|
|
476091
|
-
function getEvolvedSpecies(species, stage) {
|
|
476092
|
-
if (stage === 0)
|
|
476093
|
-
return species;
|
|
476094
|
-
const rule = EVOLUTIONS.find((e) => e.base === species);
|
|
476095
|
-
if (!rule)
|
|
476096
|
-
return species;
|
|
476097
|
-
return stage >= 2 ? rule.maxEvolved : rule.evolved;
|
|
476098
|
-
}
|
|
476099
|
-
function incrementFeed() {
|
|
476100
|
-
const state = getBuddyState();
|
|
476101
|
-
const count4 = state.feedCount + 1;
|
|
476102
|
-
saveBuddyState({ feedCount: count4 });
|
|
476103
|
-
return count4;
|
|
476104
|
-
}
|
|
476105
|
-
function incrementPlay() {
|
|
476106
|
-
const state = getBuddyState();
|
|
476107
|
-
const count4 = state.playCount + 1;
|
|
476108
|
-
saveBuddyState({ playCount: count4 });
|
|
476109
|
-
return count4;
|
|
476110
|
-
}
|
|
476111
|
-
function getInteractionCounts() {
|
|
476112
|
-
const state = getBuddyState();
|
|
476113
|
-
return { feed: state.feedCount, play: state.playCount };
|
|
476114
|
-
}
|
|
476115
|
-
var XP_PER_LEVEL = 100, MAX_LEVEL = 50, DEFAULT_STATE, EVOLUTIONS, XP_REWARDS;
|
|
476116
|
-
var init_evolution = __esm(() => {
|
|
476117
|
-
init_config();
|
|
476118
|
-
init_companion();
|
|
476119
|
-
init_milestones();
|
|
476120
|
-
DEFAULT_STATE = {
|
|
476121
|
-
xp: 0,
|
|
476122
|
-
level: 1,
|
|
476123
|
-
evolutionStage: 0,
|
|
476124
|
-
feedCount: 0,
|
|
476125
|
-
playCount: 0
|
|
476126
|
-
};
|
|
476127
|
-
EVOLUTIONS = [
|
|
476128
|
-
{ base: "duck", evolved: "goose", maxEvolved: "goose", level: 10, maxLevel: 25 },
|
|
476129
|
-
{ base: "blob", evolved: "ghost", maxEvolved: "ghost", level: 10, maxLevel: 25 },
|
|
476130
|
-
{ base: "cat", evolved: "chonk", maxEvolved: "chonk", level: 12, maxLevel: 28 },
|
|
476131
|
-
{ base: "turtle", evolved: "snail", maxEvolved: "snail", level: 15, maxLevel: 30 }
|
|
476132
|
-
];
|
|
476133
|
-
XP_REWARDS = {
|
|
476134
|
-
BUDDY_HATCH: 50,
|
|
476135
|
-
BUDDY_PET: 5,
|
|
476136
|
-
BUDDY_FEED: 15,
|
|
476137
|
-
BUDDY_PLAY: 20,
|
|
476138
|
-
COMMIT: 10,
|
|
476139
|
-
REVIEW: 25,
|
|
476140
|
-
PLUGIN_INSTALL: 30,
|
|
476141
|
-
SKILL_USE: 5,
|
|
476142
|
-
DAILY_LOGIN: 20,
|
|
476143
|
-
ACHIEVEMENT_UNLOCK: 100
|
|
476144
|
-
};
|
|
476145
|
-
});
|
|
476146
|
-
|
|
476147
476329
|
// src/skills/suggestions.ts
|
|
476148
476330
|
function getSuggestions(maxCount = 5) {
|
|
476149
476331
|
const stats = getUsageStats();
|
|
@@ -476374,7 +476556,7 @@ var init_mystats = __esm(() => {
|
|
|
476374
476556
|
init_evolution();
|
|
476375
476557
|
init_companion();
|
|
476376
476558
|
init_storage();
|
|
476377
|
-
|
|
476559
|
+
init_types11();
|
|
476378
476560
|
init_suggestions();
|
|
476379
476561
|
init_tips();
|
|
476380
476562
|
});
|
|
@@ -478789,10 +478971,67 @@ var init_frontend_tdd = __esm(() => {
|
|
|
478789
478971
|
frontend_tdd_default = frontendTdd;
|
|
478790
478972
|
});
|
|
478791
478973
|
|
|
478974
|
+
// src/commands/remember.ts
|
|
478975
|
+
import { appendFile as appendFile5, mkdir as mkdir34 } from "fs/promises";
|
|
478976
|
+
import { join as join129 } from "path";
|
|
478977
|
+
function formatEntry(content) {
|
|
478978
|
+
const now2 = new Date;
|
|
478979
|
+
const ts = now2.toISOString().replace("T", " ").slice(0, 19);
|
|
478980
|
+
return `
|
|
478981
|
+
<!-- remembered at ${ts} -->
|
|
478982
|
+
${content.trim()}
|
|
478983
|
+
`;
|
|
478984
|
+
}
|
|
478985
|
+
var call63 = async (args) => {
|
|
478986
|
+
const text2 = args.trim();
|
|
478987
|
+
if (!text2) {
|
|
478988
|
+
return {
|
|
478989
|
+
type: "text",
|
|
478990
|
+
value: `Usage: /remember <what to remember>
|
|
478991
|
+
|
|
478992
|
+
Saves important information to your memory file (~/.claude/CLAUDE.md) so it's available in future sessions.
|
|
478993
|
+
|
|
478994
|
+
Examples:
|
|
478995
|
+
/remember The project uses pnpm, not npm
|
|
478996
|
+
/remember The CI pipeline runs on GitHub Actions with Node 20
|
|
478997
|
+
/remember My local dev server runs on port 5173`
|
|
478998
|
+
};
|
|
478999
|
+
}
|
|
479000
|
+
try {
|
|
479001
|
+
const homeDir = getClaudeConfigHomeDir();
|
|
479002
|
+
await mkdir34(homeDir, { recursive: true });
|
|
479003
|
+
const memFile = join129(homeDir, "CLAUDE.md");
|
|
479004
|
+
const entry = formatEntry(text2);
|
|
479005
|
+
await appendFile5(memFile, entry, "utf-8");
|
|
479006
|
+
return {
|
|
479007
|
+
type: "text",
|
|
479008
|
+
value: `✅ Remembered! Saved to ~/.claude/CLAUDE.md
|
|
479009
|
+
|
|
479010
|
+
This information will be available in all future sessions.
|
|
479011
|
+
|
|
479012
|
+
Use /memory to view or edit all saved memories.`
|
|
479013
|
+
};
|
|
479014
|
+
} catch (err2) {
|
|
479015
|
+
return { type: "text", value: `Error saving memory: ${err2}` };
|
|
479016
|
+
}
|
|
479017
|
+
}, remember, remember_default;
|
|
479018
|
+
var init_remember = __esm(() => {
|
|
479019
|
+
init_envUtils();
|
|
479020
|
+
remember = {
|
|
479021
|
+
type: "local",
|
|
479022
|
+
name: "remember",
|
|
479023
|
+
description: "Save important information to memory for reuse in future sessions",
|
|
479024
|
+
argumentHint: "<what to remember>",
|
|
479025
|
+
supportsNonInteractive: true,
|
|
479026
|
+
load: async () => ({ call: call63 })
|
|
479027
|
+
};
|
|
479028
|
+
remember_default = remember;
|
|
479029
|
+
});
|
|
479030
|
+
|
|
478792
479031
|
// src/skills/bundledSkills.ts
|
|
478793
479032
|
import { constants as fsConstants5 } from "fs";
|
|
478794
|
-
import { mkdir as
|
|
478795
|
-
import { dirname as dirname56, isAbsolute as isAbsolute26, join as
|
|
479033
|
+
import { mkdir as mkdir35, open as open12 } from "fs/promises";
|
|
479034
|
+
import { dirname as dirname56, isAbsolute as isAbsolute26, join as join130, normalize as normalize13, sep as pathSep2 } from "path";
|
|
478796
479035
|
function registerBundledSkill(definition) {
|
|
478797
479036
|
const { files: files3 } = definition;
|
|
478798
479037
|
let skillRoot;
|
|
@@ -478840,7 +479079,7 @@ function getBundledSkills() {
|
|
|
478840
479079
|
return [...bundledSkills];
|
|
478841
479080
|
}
|
|
478842
479081
|
function getBundledSkillExtractDir(skillName) {
|
|
478843
|
-
return
|
|
479082
|
+
return join130(getBundledSkillsRoot(), skillName);
|
|
478844
479083
|
}
|
|
478845
479084
|
async function extractBundledSkillFiles(skillName, files3) {
|
|
478846
479085
|
const dir = getBundledSkillExtractDir(skillName);
|
|
@@ -478865,7 +479104,7 @@ async function writeSkillFiles(dir, files3) {
|
|
|
478865
479104
|
byParent.set(parent2, [entry]);
|
|
478866
479105
|
}
|
|
478867
479106
|
await Promise.all([...byParent].map(async ([parent2, entries]) => {
|
|
478868
|
-
await
|
|
479107
|
+
await mkdir35(parent2, { recursive: true, mode: 448 });
|
|
478869
479108
|
await Promise.all(entries.map(([p, c6]) => safeWriteFile(p, c6)));
|
|
478870
479109
|
}));
|
|
478871
479110
|
}
|
|
@@ -478882,7 +479121,7 @@ function resolveSkillFilePath(baseDir, relPath) {
|
|
|
478882
479121
|
if (isAbsolute26(normalized) || normalized.split(pathSep2).includes("..") || normalized.split("/").includes("..")) {
|
|
478883
479122
|
throw new Error(`bundled skill file path escapes skill dir: ${relPath}`);
|
|
478884
479123
|
}
|
|
478885
|
-
return
|
|
479124
|
+
return join130(baseDir, normalized);
|
|
478886
479125
|
}
|
|
478887
479126
|
function prependBaseDir(blocks, baseDir) {
|
|
478888
479127
|
const prefix = `Base directory for this skill: ${baseDir}
|
|
@@ -479198,12 +479437,12 @@ var init_ExitFlow = __esm(() => {
|
|
|
479198
479437
|
// src/commands/exit/exit.tsx
|
|
479199
479438
|
var exports_exit = {};
|
|
479200
479439
|
__export(exports_exit, {
|
|
479201
|
-
call: () =>
|
|
479440
|
+
call: () => call64
|
|
479202
479441
|
});
|
|
479203
479442
|
function getRandomGoodbyeMessage2() {
|
|
479204
479443
|
return sample_default(GOODBYE_MESSAGES2) ?? "Goodbye!";
|
|
479205
479444
|
}
|
|
479206
|
-
async function
|
|
479445
|
+
async function call64(onDone) {
|
|
479207
479446
|
if (false) {}
|
|
479208
479447
|
const showWorktree = getCurrentWorktreeSession() !== null;
|
|
479209
479448
|
if (showWorktree) {
|
|
@@ -479243,7 +479482,7 @@ var init_exit2 = __esm(() => {
|
|
|
479243
479482
|
});
|
|
479244
479483
|
|
|
479245
479484
|
// src/components/ExportDialog.tsx
|
|
479246
|
-
import { join as
|
|
479485
|
+
import { join as join131 } from "path";
|
|
479247
479486
|
function ExportDialog({
|
|
479248
479487
|
content,
|
|
479249
479488
|
defaultFilename,
|
|
@@ -479276,7 +479515,7 @@ function ExportDialog({
|
|
|
479276
479515
|
};
|
|
479277
479516
|
const handleFilenameSubmit = () => {
|
|
479278
479517
|
const finalFilename = filename.endsWith(".txt") ? filename : filename.replace(/\.[^.]+$/, "") + ".txt";
|
|
479279
|
-
const filepath =
|
|
479518
|
+
const filepath = join131(getCwd(), finalFilename);
|
|
479280
479519
|
try {
|
|
479281
479520
|
writeFileSync_DEPRECATED(filepath, content, {
|
|
479282
479521
|
encoding: "utf-8",
|
|
@@ -479497,9 +479736,9 @@ var exports_export = {};
|
|
|
479497
479736
|
__export(exports_export, {
|
|
479498
479737
|
sanitizeFilename: () => sanitizeFilename,
|
|
479499
479738
|
extractFirstPrompt: () => extractFirstPrompt,
|
|
479500
|
-
call: () =>
|
|
479739
|
+
call: () => call65
|
|
479501
479740
|
});
|
|
479502
|
-
import { join as
|
|
479741
|
+
import { join as join132 } from "path";
|
|
479503
479742
|
function formatTimestamp(date6) {
|
|
479504
479743
|
const year = date6.getFullYear();
|
|
479505
479744
|
const month = String(date6.getMonth() + 1).padStart(2, "0");
|
|
@@ -479538,12 +479777,12 @@ async function exportWithReactRenderer(context2) {
|
|
|
479538
479777
|
const tools = context2.options.tools || [];
|
|
479539
479778
|
return renderMessagesToPlainText(context2.messages, tools);
|
|
479540
479779
|
}
|
|
479541
|
-
async function
|
|
479780
|
+
async function call65(onDone, context2, args) {
|
|
479542
479781
|
const content = await exportWithReactRenderer(context2);
|
|
479543
479782
|
const filename = args.trim();
|
|
479544
479783
|
if (filename) {
|
|
479545
479784
|
const finalFilename = filename.endsWith(".txt") ? filename : filename.replace(/\.[^.]+$/, "") + ".txt";
|
|
479546
|
-
const filepath =
|
|
479785
|
+
const filepath = join132(getCwd(), finalFilename);
|
|
479547
479786
|
try {
|
|
479548
479787
|
writeFileSync_DEPRECATED(filepath, content, {
|
|
479549
479788
|
encoding: "utf-8",
|
|
@@ -479598,7 +479837,7 @@ var init_export2 = __esm(() => {
|
|
|
479598
479837
|
// src/commands/model/model.tsx
|
|
479599
479838
|
var exports_model2 = {};
|
|
479600
479839
|
__export(exports_model2, {
|
|
479601
|
-
call: () =>
|
|
479840
|
+
call: () => call66
|
|
479602
479841
|
});
|
|
479603
479842
|
function ModelPickerWrapper(t0) {
|
|
479604
479843
|
const $3 = import_compiler_runtime269.c(17);
|
|
@@ -479846,7 +480085,7 @@ function renderModelLabel(model) {
|
|
|
479846
480085
|
const rendered = renderDefaultModelSetting(model ?? getDefaultMainLoopModelSetting());
|
|
479847
480086
|
return model === null ? `${rendered} (default)` : rendered;
|
|
479848
480087
|
}
|
|
479849
|
-
var import_compiler_runtime269, React107, jsx_dev_runtime347,
|
|
480088
|
+
var import_compiler_runtime269, React107, jsx_dev_runtime347, call66 = async (onDone, _context, args) => {
|
|
479850
480089
|
args = args?.trim() || "";
|
|
479851
480090
|
if (COMMON_INFO_ARGS.includes(args)) {
|
|
479852
480091
|
logEvent("tengu_model_command_inline_help", {
|
|
@@ -479915,7 +480154,7 @@ var init_model3 = __esm(() => {
|
|
|
479915
480154
|
// src/commands/tag/tag.tsx
|
|
479916
480155
|
var exports_tag = {};
|
|
479917
480156
|
__export(exports_tag, {
|
|
479918
|
-
call: () =>
|
|
480157
|
+
call: () => call67
|
|
479919
480158
|
});
|
|
479920
480159
|
function ConfirmRemoveTag(t0) {
|
|
479921
480160
|
const $3 = import_compiler_runtime270.c(11);
|
|
@@ -480139,7 +480378,7 @@ Examples:
|
|
|
480139
480378
|
React108.useEffect(t1, t2);
|
|
480140
480379
|
return null;
|
|
480141
480380
|
}
|
|
480142
|
-
async function
|
|
480381
|
+
async function call67(onDone, _context, args) {
|
|
480143
480382
|
args = args?.trim() || "";
|
|
480144
480383
|
if (COMMON_INFO_ARGS.includes(args) || COMMON_HELP_ARGS.includes(args)) {
|
|
480145
480384
|
return /* @__PURE__ */ jsx_dev_runtime348.jsxDEV(ShowHelp, {
|
|
@@ -480187,9 +480426,9 @@ var init_tag2 = __esm(() => {
|
|
|
480187
480426
|
// src/commands/output-style/output-style.tsx
|
|
480188
480427
|
var exports_output_style = {};
|
|
480189
480428
|
__export(exports_output_style, {
|
|
480190
|
-
call: () =>
|
|
480429
|
+
call: () => call68
|
|
480191
480430
|
});
|
|
480192
|
-
async function
|
|
480431
|
+
async function call68(onDone) {
|
|
480193
480432
|
onDone("/output-style has been deprecated. Use /config to change your output style, or set it in your settings file. Changes take effect on the next session.", {
|
|
480194
480433
|
display: "system"
|
|
480195
480434
|
});
|
|
@@ -480708,9 +480947,9 @@ var init_RemoteEnvironmentDialog = __esm(() => {
|
|
|
480708
480947
|
// src/commands/remote-env/remote-env.tsx
|
|
480709
480948
|
var exports_remote_env = {};
|
|
480710
480949
|
__export(exports_remote_env, {
|
|
480711
|
-
call: () =>
|
|
480950
|
+
call: () => call69
|
|
480712
480951
|
});
|
|
480713
|
-
async function
|
|
480952
|
+
async function call69(onDone) {
|
|
480714
480953
|
return /* @__PURE__ */ jsx_dev_runtime350.jsxDEV(RemoteEnvironmentDialog, {
|
|
480715
480954
|
onDone
|
|
480716
480955
|
}, undefined, false, undefined, this);
|
|
@@ -480740,9 +480979,9 @@ var init_remote_env2 = __esm(() => {
|
|
|
480740
480979
|
// src/commands/upgrade/upgrade.tsx
|
|
480741
480980
|
var exports_upgrade = {};
|
|
480742
480981
|
__export(exports_upgrade, {
|
|
480743
|
-
call: () =>
|
|
480982
|
+
call: () => call70
|
|
480744
480983
|
});
|
|
480745
|
-
async function
|
|
480984
|
+
async function call70(onDone, context2) {
|
|
480746
480985
|
try {
|
|
480747
480986
|
if (isClaudeAISubscriber()) {
|
|
480748
480987
|
const tokens = getClaudeAIOAuthTokens();
|
|
@@ -480802,7 +481041,7 @@ var init_upgrade2 = __esm(() => {
|
|
|
480802
481041
|
// src/commands/rate-limit-options/rate-limit-options.tsx
|
|
480803
481042
|
var exports_rate_limit_options = {};
|
|
480804
481043
|
__export(exports_rate_limit_options, {
|
|
480805
|
-
call: () =>
|
|
481044
|
+
call: () => call71
|
|
480806
481045
|
});
|
|
480807
481046
|
function RateLimitOptionsMenu(t0) {
|
|
480808
481047
|
const $3 = import_compiler_runtime272.c(25);
|
|
@@ -480936,7 +481175,7 @@ function RateLimitOptionsMenu(t0) {
|
|
|
480936
481175
|
t5 = function handleSelect2(value) {
|
|
480937
481176
|
if (value === "upgrade") {
|
|
480938
481177
|
logEvent("tengu_rate_limit_options_menu_select_upgrade", {});
|
|
480939
|
-
|
|
481178
|
+
call70(onDone, context2).then((jsx) => {
|
|
480940
481179
|
if (jsx) {
|
|
480941
481180
|
setSubCommandJSX(jsx);
|
|
480942
481181
|
}
|
|
@@ -480996,7 +481235,7 @@ function RateLimitOptionsMenu(t0) {
|
|
|
480996
481235
|
}
|
|
480997
481236
|
return t7;
|
|
480998
481237
|
}
|
|
480999
|
-
async function
|
|
481238
|
+
async function call71(onDone, context2) {
|
|
481000
481239
|
return /* @__PURE__ */ jsx_dev_runtime352.jsxDEV(RateLimitOptionsMenu, {
|
|
481001
481240
|
onDone,
|
|
481002
481241
|
context: context2
|
|
@@ -481070,7 +481309,7 @@ var exports_effort = {};
|
|
|
481070
481309
|
__export(exports_effort, {
|
|
481071
481310
|
showCurrentEffort: () => showCurrentEffort,
|
|
481072
481311
|
executeEffort: () => executeEffort,
|
|
481073
|
-
call: () =>
|
|
481312
|
+
call: () => call72
|
|
481074
481313
|
});
|
|
481075
481314
|
function setEffortValue(effortValue) {
|
|
481076
481315
|
const persistable = toPersistableEffort(effortValue);
|
|
@@ -481221,7 +481460,7 @@ function ApplyEffortAndClose(t0) {
|
|
|
481221
481460
|
React110.useEffect(t1, t2);
|
|
481222
481461
|
return null;
|
|
481223
481462
|
}
|
|
481224
|
-
async function
|
|
481463
|
+
async function call72(onDone, _context, args) {
|
|
481225
481464
|
args = args?.trim() || "";
|
|
481226
481465
|
if (COMMON_HELP_ARGS2.includes(args)) {
|
|
481227
481466
|
onDone(`Usage: /effort [low|medium|high|max|auto]
|
|
@@ -481374,7 +481613,7 @@ var require_asciichart = __commonJS((exports) => {
|
|
|
481374
481613
|
// src/utils/statsCache.ts
|
|
481375
481614
|
import { randomBytes as randomBytes18 } from "crypto";
|
|
481376
481615
|
import { open as open13 } from "fs/promises";
|
|
481377
|
-
import { join as
|
|
481616
|
+
import { join as join133 } from "path";
|
|
481378
481617
|
async function withStatsCacheLock(fn) {
|
|
481379
481618
|
while (statsCacheLockPromise) {
|
|
481380
481619
|
await statsCacheLockPromise;
|
|
@@ -481391,7 +481630,7 @@ async function withStatsCacheLock(fn) {
|
|
|
481391
481630
|
}
|
|
481392
481631
|
}
|
|
481393
481632
|
function getStatsCachePath() {
|
|
481394
|
-
return
|
|
481633
|
+
return join133(getClaudeConfigHomeDir(), STATS_CACHE_FILENAME);
|
|
481395
481634
|
}
|
|
481396
481635
|
function getEmptyCache() {
|
|
481397
481636
|
return {
|
|
@@ -482057,14 +482296,14 @@ var init_ansiToPng = __esm(() => {
|
|
|
482057
482296
|
});
|
|
482058
482297
|
|
|
482059
482298
|
// src/utils/screenshotClipboard.ts
|
|
482060
|
-
import { mkdir as
|
|
482299
|
+
import { mkdir as mkdir36, unlink as unlink16, writeFile as writeFile39 } from "fs/promises";
|
|
482061
482300
|
import { tmpdir as tmpdir11 } from "os";
|
|
482062
|
-
import { join as
|
|
482301
|
+
import { join as join134 } from "path";
|
|
482063
482302
|
async function copyAnsiToClipboard(ansiText, options) {
|
|
482064
482303
|
try {
|
|
482065
|
-
const tempDir =
|
|
482066
|
-
await
|
|
482067
|
-
const pngPath =
|
|
482304
|
+
const tempDir = join134(tmpdir11(), "claude-code-screenshots");
|
|
482305
|
+
await mkdir36(tempDir, { recursive: true });
|
|
482306
|
+
const pngPath = join134(tempDir, `screenshot-${Date.now()}.png`);
|
|
482068
482307
|
const pngBuffer = ansiToPng(ansiText, options);
|
|
482069
482308
|
await writeFile39(pngPath, pngBuffer);
|
|
482070
482309
|
const result = await copyPngToClipboard(pngPath);
|
|
@@ -482135,7 +482374,7 @@ var init_screenshotClipboard = __esm(() => {
|
|
|
482135
482374
|
|
|
482136
482375
|
// src/utils/stats.ts
|
|
482137
482376
|
import { open as open14 } from "fs/promises";
|
|
482138
|
-
import { basename as basename41, join as
|
|
482377
|
+
import { basename as basename41, join as join135, sep as sep33 } from "path";
|
|
482139
482378
|
async function processSessionFiles(sessionFiles, options = {}) {
|
|
482140
482379
|
const { fromDate, toDate } = options;
|
|
482141
482380
|
const fs11 = getFsImplementation();
|
|
@@ -482313,17 +482552,17 @@ async function getAllSessionFiles() {
|
|
|
482313
482552
|
return [];
|
|
482314
482553
|
throw e;
|
|
482315
482554
|
}
|
|
482316
|
-
const projectDirs = allEntries.filter((dirent) => dirent.isDirectory()).map((dirent) =>
|
|
482555
|
+
const projectDirs = allEntries.filter((dirent) => dirent.isDirectory()).map((dirent) => join135(projectsDir, dirent.name));
|
|
482317
482556
|
const projectResults = await Promise.all(projectDirs.map(async (projectDir) => {
|
|
482318
482557
|
try {
|
|
482319
482558
|
const entries = await fs11.readdir(projectDir);
|
|
482320
|
-
const mainFiles = entries.filter((dirent) => dirent.isFile() && dirent.name.endsWith(".jsonl")).map((dirent) =>
|
|
482559
|
+
const mainFiles = entries.filter((dirent) => dirent.isFile() && dirent.name.endsWith(".jsonl")).map((dirent) => join135(projectDir, dirent.name));
|
|
482321
482560
|
const sessionDirs = entries.filter((dirent) => dirent.isDirectory());
|
|
482322
482561
|
const subagentResults = await Promise.all(sessionDirs.map(async (sessionDir) => {
|
|
482323
|
-
const subagentsDir =
|
|
482562
|
+
const subagentsDir = join135(projectDir, sessionDir.name, "subagents");
|
|
482324
482563
|
try {
|
|
482325
482564
|
const subagentEntries = await fs11.readdir(subagentsDir);
|
|
482326
|
-
return subagentEntries.filter((dirent) => dirent.isFile() && dirent.name.endsWith(".jsonl") && dirent.name.startsWith("agent-")).map((dirent) =>
|
|
482565
|
+
return subagentEntries.filter((dirent) => dirent.isFile() && dirent.name.endsWith(".jsonl") && dirent.name.startsWith("agent-")).map((dirent) => join135(subagentsDir, dirent.name));
|
|
482327
482566
|
} catch {
|
|
482328
482567
|
return [];
|
|
482329
482568
|
}
|
|
@@ -484130,9 +484369,9 @@ var init_Stats = __esm(() => {
|
|
|
484130
484369
|
// src/commands/stats/stats.tsx
|
|
484131
484370
|
var exports_stats = {};
|
|
484132
484371
|
__export(exports_stats, {
|
|
484133
|
-
call: () =>
|
|
484372
|
+
call: () => call73
|
|
484134
484373
|
});
|
|
484135
|
-
var jsx_dev_runtime355,
|
|
484374
|
+
var jsx_dev_runtime355, call73 = async (onDone) => {
|
|
484136
484375
|
return /* @__PURE__ */ jsx_dev_runtime355.jsxDEV(Stats2, {
|
|
484137
484376
|
onClose: onDone
|
|
484138
484377
|
}, undefined, false, undefined, this);
|
|
@@ -484681,64 +484920,6 @@ var init_sprites = __esm(() => {
|
|
|
484681
484920
|
};
|
|
484682
484921
|
});
|
|
484683
484922
|
|
|
484684
|
-
// src/achievements/checker.ts
|
|
484685
|
-
function notify2(id) {
|
|
484686
|
-
if (typeof process !== "undefined") {
|
|
484687
|
-
try {
|
|
484688
|
-
const pending = JSON.parse(process.env.__ACHIEVEMENT_PENDING__ || "[]");
|
|
484689
|
-
pending.push(id);
|
|
484690
|
-
process.env.__ACHIEVEMENT_PENDING__ = JSON.stringify(pending);
|
|
484691
|
-
} catch {
|
|
484692
|
-
process.env.__ACHIEVEMENT_PENDING__ = JSON.stringify([id]);
|
|
484693
|
-
}
|
|
484694
|
-
}
|
|
484695
|
-
}
|
|
484696
|
-
function checkOnBuddyHatch() {
|
|
484697
|
-
tryUnlock("buddy_hatched");
|
|
484698
|
-
const companion = getCompanion();
|
|
484699
|
-
if (companion?.rarity === "legendary") {
|
|
484700
|
-
tryUnlock("buddy_legendary");
|
|
484701
|
-
}
|
|
484702
|
-
if (companion?.shiny) {
|
|
484703
|
-
tryUnlock("buddy_shiny");
|
|
484704
|
-
}
|
|
484705
|
-
}
|
|
484706
|
-
function checkOnBuddyPet() {
|
|
484707
|
-
const count4 = incrementCounter("buddy_pet");
|
|
484708
|
-
tryUnlock("buddy_pet_10", count4 >= 10);
|
|
484709
|
-
tryUnlock("buddy_pet_100", count4 >= 100);
|
|
484710
|
-
}
|
|
484711
|
-
function tryUnlock(id, condition = true) {
|
|
484712
|
-
if (!condition)
|
|
484713
|
-
return;
|
|
484714
|
-
if (hasAchievement(id))
|
|
484715
|
-
return;
|
|
484716
|
-
if (unlockAchievement(id)) {
|
|
484717
|
-
addXp(XP_REWARDS.ACHIEVEMENT_UNLOCK);
|
|
484718
|
-
const unlocked = getUnlockedAchievements();
|
|
484719
|
-
if (unlocked.size === 5)
|
|
484720
|
-
addMilestone("achievement_5");
|
|
484721
|
-
if (unlocked.size === 10)
|
|
484722
|
-
addMilestone("achievement_10");
|
|
484723
|
-
if (unlocked.size === 20)
|
|
484724
|
-
addMilestone("achievement_20");
|
|
484725
|
-
const achievement = ACHIEVEMENTS[id];
|
|
484726
|
-
console.error(`
|
|
484727
|
-
\uD83C\uDFC6 ${achievement.icon} Achievement Unlocked: ${achievement.name}`);
|
|
484728
|
-
console.error(` ${achievement.description}
|
|
484729
|
-
`);
|
|
484730
|
-
notify2(id);
|
|
484731
|
-
}
|
|
484732
|
-
}
|
|
484733
|
-
var init_checker = __esm(() => {
|
|
484734
|
-
init_storage();
|
|
484735
|
-
init_types14();
|
|
484736
|
-
init_companion();
|
|
484737
|
-
init_evolution();
|
|
484738
|
-
init_milestones();
|
|
484739
|
-
init_usageStats();
|
|
484740
|
-
});
|
|
484741
|
-
|
|
484742
484923
|
// src/events/calendar.ts
|
|
484743
484924
|
function getTodayEvent() {
|
|
484744
484925
|
const now2 = new Date;
|
|
@@ -484785,7 +484966,7 @@ var init_calendar = __esm(() => {
|
|
|
484785
484966
|
// src/commands/buddy/buddy.ts
|
|
484786
484967
|
var exports_buddy = {};
|
|
484787
484968
|
__export(exports_buddy, {
|
|
484788
|
-
call: () =>
|
|
484969
|
+
call: () => call74
|
|
484789
484970
|
});
|
|
484790
484971
|
function getXpBar(current, needed) {
|
|
484791
484972
|
const filled = Math.floor(current / needed * 10);
|
|
@@ -484988,7 +485169,7 @@ Subcommands:
|
|
|
484988
485169
|
mute Mute companion
|
|
484989
485170
|
unmute Unmute companion
|
|
484990
485171
|
|
|
484991
|
-
XP is earned through interactions. Level up to evolve your companion!`,
|
|
485172
|
+
XP is earned through interactions. Level up to evolve your companion!`, call74 = async (args) => {
|
|
484992
485173
|
const [subcommand] = args.trim().toLowerCase().split(/\s+/);
|
|
484993
485174
|
switch (subcommand) {
|
|
484994
485175
|
case "hatch":
|
|
@@ -485072,7 +485253,7 @@ import { execFileSync as execFileSync3 } from "child_process";
|
|
|
485072
485253
|
import { constants as fsConstants6 } from "fs";
|
|
485073
485254
|
import {
|
|
485074
485255
|
copyFile as copyFile10,
|
|
485075
|
-
mkdir as
|
|
485256
|
+
mkdir as mkdir37,
|
|
485076
485257
|
mkdtemp as mkdtemp3,
|
|
485077
485258
|
readdir as readdir26,
|
|
485078
485259
|
readFile as readFile46,
|
|
@@ -485081,7 +485262,7 @@ import {
|
|
|
485081
485262
|
writeFile as writeFile40
|
|
485082
485263
|
} from "fs/promises";
|
|
485083
485264
|
import { tmpdir as tmpdir12 } from "os";
|
|
485084
|
-
import { extname as extname14, join as
|
|
485265
|
+
import { extname as extname14, join as join136 } from "path";
|
|
485085
485266
|
function getAnalysisModel() {
|
|
485086
485267
|
return getDefaultSonnetModel();
|
|
485087
485268
|
}
|
|
@@ -485089,13 +485270,13 @@ function getInsightsModel() {
|
|
|
485089
485270
|
return getDefaultSonnetModel();
|
|
485090
485271
|
}
|
|
485091
485272
|
function getDataDir() {
|
|
485092
|
-
return
|
|
485273
|
+
return join136(getClaudeConfigHomeDir(), "usage-data");
|
|
485093
485274
|
}
|
|
485094
485275
|
function getFacetsDir() {
|
|
485095
|
-
return
|
|
485276
|
+
return join136(getDataDir(), "facets");
|
|
485096
485277
|
}
|
|
485097
485278
|
function getSessionMetaDir() {
|
|
485098
|
-
return
|
|
485279
|
+
return join136(getDataDir(), "session-meta");
|
|
485099
485280
|
}
|
|
485100
485281
|
function getLanguageFromPath(filePath) {
|
|
485101
485282
|
const ext = extname14(filePath).toLowerCase();
|
|
@@ -485440,7 +485621,7 @@ async function formatTranscriptWithSummarization(log) {
|
|
|
485440
485621
|
`);
|
|
485441
485622
|
}
|
|
485442
485623
|
async function loadCachedFacets(sessionId) {
|
|
485443
|
-
const facetPath =
|
|
485624
|
+
const facetPath = join136(getFacetsDir(), `${sessionId}.json`);
|
|
485444
485625
|
try {
|
|
485445
485626
|
const content = await readFile46(facetPath, { encoding: "utf-8" });
|
|
485446
485627
|
const parsed = jsonParse(content);
|
|
@@ -485457,16 +485638,16 @@ async function loadCachedFacets(sessionId) {
|
|
|
485457
485638
|
}
|
|
485458
485639
|
async function saveFacets(facets) {
|
|
485459
485640
|
try {
|
|
485460
|
-
await
|
|
485641
|
+
await mkdir37(getFacetsDir(), { recursive: true });
|
|
485461
485642
|
} catch {}
|
|
485462
|
-
const facetPath =
|
|
485643
|
+
const facetPath = join136(getFacetsDir(), `${facets.session_id}.json`);
|
|
485463
485644
|
await writeFile40(facetPath, jsonStringify(facets, null, 2), {
|
|
485464
485645
|
encoding: "utf-8",
|
|
485465
485646
|
mode: 384
|
|
485466
485647
|
});
|
|
485467
485648
|
}
|
|
485468
485649
|
async function loadCachedSessionMeta(sessionId) {
|
|
485469
|
-
const metaPath =
|
|
485650
|
+
const metaPath = join136(getSessionMetaDir(), `${sessionId}.json`);
|
|
485470
485651
|
try {
|
|
485471
485652
|
const content = await readFile46(metaPath, { encoding: "utf-8" });
|
|
485472
485653
|
return jsonParse(content);
|
|
@@ -485476,9 +485657,9 @@ async function loadCachedSessionMeta(sessionId) {
|
|
|
485476
485657
|
}
|
|
485477
485658
|
async function saveSessionMeta(meta3) {
|
|
485478
485659
|
try {
|
|
485479
|
-
await
|
|
485660
|
+
await mkdir37(getSessionMetaDir(), { recursive: true });
|
|
485480
485661
|
} catch {}
|
|
485481
|
-
const metaPath =
|
|
485662
|
+
const metaPath = join136(getSessionMetaDir(), `${meta3.session_id}.json`);
|
|
485482
485663
|
await writeFile40(metaPath, jsonStringify(meta3, null, 2), {
|
|
485483
485664
|
encoding: "utf-8",
|
|
485484
485665
|
mode: 384
|
|
@@ -486586,7 +486767,7 @@ async function scanAllSessions() {
|
|
|
486586
486767
|
} catch {
|
|
486587
486768
|
return [];
|
|
486588
486769
|
}
|
|
486589
|
-
const projectDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) =>
|
|
486770
|
+
const projectDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) => join136(projectsDir, dirent.name));
|
|
486590
486771
|
const allSessions = [];
|
|
486591
486772
|
for (let i3 = 0;i3 < projectDirs.length; i3++) {
|
|
486592
486773
|
const sessionFiles = await getSessionFilesWithMtime(projectDirs[i3]);
|
|
@@ -486608,7 +486789,7 @@ async function scanAllSessions() {
|
|
|
486608
486789
|
async function generateUsageReport(options) {
|
|
486609
486790
|
let remoteStats;
|
|
486610
486791
|
if (process.env.USER_TYPE === "ant" && options?.collectRemote) {
|
|
486611
|
-
const destDir =
|
|
486792
|
+
const destDir = join136(getClaudeConfigHomeDir(), "projects");
|
|
486612
486793
|
const { hosts, totalCopied } = await collectAllRemoteHostData(destDir);
|
|
486613
486794
|
remoteStats = { hosts, totalCopied };
|
|
486614
486795
|
}
|
|
@@ -486745,9 +486926,9 @@ async function generateUsageReport(options) {
|
|
|
486745
486926
|
const insights = await generateParallelInsights(aggregated, facets);
|
|
486746
486927
|
const htmlReport = generateHtmlReport(aggregated, insights);
|
|
486747
486928
|
try {
|
|
486748
|
-
await
|
|
486929
|
+
await mkdir37(getDataDir(), { recursive: true });
|
|
486749
486930
|
} catch {}
|
|
486750
|
-
const htmlPath =
|
|
486931
|
+
const htmlPath = join136(getDataDir(), "report.html");
|
|
486751
486932
|
await writeFile40(htmlPath, htmlReport, {
|
|
486752
486933
|
encoding: "utf-8",
|
|
486753
486934
|
mode: 384
|
|
@@ -486843,13 +487024,13 @@ var init_insights = __esm(() => {
|
|
|
486843
487024
|
} : async () => 0;
|
|
486844
487025
|
collectFromRemoteHost = process.env.USER_TYPE === "ant" ? async (homespace, destDir) => {
|
|
486845
487026
|
const result = { copied: 0, skipped: 0 };
|
|
486846
|
-
const tempDir = await mkdtemp3(
|
|
487027
|
+
const tempDir = await mkdtemp3(join136(tmpdir12(), "claude-hs-"));
|
|
486847
487028
|
try {
|
|
486848
487029
|
const scpResult = await execFileNoThrow("scp", ["-rq", `${homespace}.coder:/root/.claude/projects/`, tempDir], { timeout: 300000 });
|
|
486849
487030
|
if (scpResult.code !== 0) {
|
|
486850
487031
|
return result;
|
|
486851
487032
|
}
|
|
486852
|
-
const projectsDir =
|
|
487033
|
+
const projectsDir = join136(tempDir, "projects");
|
|
486853
487034
|
let projectDirents;
|
|
486854
487035
|
try {
|
|
486855
487036
|
projectDirents = await readdir26(projectsDir, { withFileTypes: true });
|
|
@@ -486858,13 +487039,13 @@ var init_insights = __esm(() => {
|
|
|
486858
487039
|
}
|
|
486859
487040
|
await Promise.all(projectDirents.map(async (dirent) => {
|
|
486860
487041
|
const projectName = dirent.name;
|
|
486861
|
-
const projectPath =
|
|
487042
|
+
const projectPath = join136(projectsDir, projectName);
|
|
486862
487043
|
if (!dirent.isDirectory())
|
|
486863
487044
|
return;
|
|
486864
487045
|
const destProjectName = `${projectName}__${homespace}`;
|
|
486865
|
-
const destProjectPath =
|
|
487046
|
+
const destProjectPath = join136(destDir, destProjectName);
|
|
486866
487047
|
try {
|
|
486867
|
-
await
|
|
487048
|
+
await mkdir37(destProjectPath, { recursive: true });
|
|
486868
487049
|
} catch {}
|
|
486869
487050
|
let files3;
|
|
486870
487051
|
try {
|
|
@@ -486876,8 +487057,8 @@ var init_insights = __esm(() => {
|
|
|
486876
487057
|
const fileName = fileDirent.name;
|
|
486877
487058
|
if (!fileName.endsWith(".jsonl"))
|
|
486878
487059
|
return;
|
|
486879
|
-
const srcFile =
|
|
486880
|
-
const destFile =
|
|
487060
|
+
const srcFile = join136(projectPath, fileName);
|
|
487061
|
+
const destFile = join136(destProjectPath, fileName);
|
|
486881
487062
|
try {
|
|
486882
487063
|
await copyFile10(srcFile, destFile, fsConstants6.COPYFILE_EXCL);
|
|
486883
487064
|
result.copied++;
|
|
@@ -487498,6 +487679,7 @@ var init_commands2 = __esm(() => {
|
|
|
487498
487679
|
init_advisor2();
|
|
487499
487680
|
init_git_flow();
|
|
487500
487681
|
init_frontend_tdd();
|
|
487682
|
+
init_remember();
|
|
487501
487683
|
init_log3();
|
|
487502
487684
|
init_errors();
|
|
487503
487685
|
init_debug();
|
|
@@ -487602,6 +487784,7 @@ var init_commands2 = __esm(() => {
|
|
|
487602
487784
|
install_slack_app_default,
|
|
487603
487785
|
mcp_default,
|
|
487604
487786
|
memory_default,
|
|
487787
|
+
remember_default,
|
|
487605
487788
|
mobile_default,
|
|
487606
487789
|
model_default,
|
|
487607
487790
|
mystats_default,
|
|
@@ -487828,14 +488011,14 @@ import { closeSync as closeSync4, fstatSync, openSync as openSync4, readSync as
|
|
|
487828
488011
|
import {
|
|
487829
488012
|
appendFile as fsAppendFile,
|
|
487830
488013
|
open as fsOpen2,
|
|
487831
|
-
mkdir as
|
|
488014
|
+
mkdir as mkdir38,
|
|
487832
488015
|
readdir as readdir27,
|
|
487833
488016
|
readFile as readFile47,
|
|
487834
488017
|
stat as stat41,
|
|
487835
488018
|
unlink as unlink18,
|
|
487836
488019
|
writeFile as writeFile41
|
|
487837
488020
|
} from "fs/promises";
|
|
487838
|
-
import { basename as basename42, dirname as dirname58, join as
|
|
488021
|
+
import { basename as basename42, dirname as dirname58, join as join137 } from "path";
|
|
487839
488022
|
function isTranscriptMessage(entry) {
|
|
487840
488023
|
return entry.type === "user" || entry.type === "assistant" || entry.type === "attachment" || entry.type === "system";
|
|
487841
488024
|
}
|
|
@@ -487849,18 +488032,18 @@ function isEphemeralToolProgress(dataType) {
|
|
|
487849
488032
|
return typeof dataType === "string" && EPHEMERAL_PROGRESS_TYPES.has(dataType);
|
|
487850
488033
|
}
|
|
487851
488034
|
function getProjectsDir2() {
|
|
487852
|
-
return
|
|
488035
|
+
return join137(getClaudeConfigHomeDir(), "projects");
|
|
487853
488036
|
}
|
|
487854
488037
|
function getTranscriptPath() {
|
|
487855
488038
|
const projectDir = getSessionProjectDir() ?? getProjectDir2(getOriginalCwd());
|
|
487856
|
-
return
|
|
488039
|
+
return join137(projectDir, `${getSessionId()}.jsonl`);
|
|
487857
488040
|
}
|
|
487858
488041
|
function getTranscriptPathForSession(sessionId) {
|
|
487859
488042
|
if (sessionId === getSessionId()) {
|
|
487860
488043
|
return getTranscriptPath();
|
|
487861
488044
|
}
|
|
487862
488045
|
const projectDir = getProjectDir2(getOriginalCwd());
|
|
487863
|
-
return
|
|
488046
|
+
return join137(projectDir, `${sessionId}.jsonl`);
|
|
487864
488047
|
}
|
|
487865
488048
|
function setAgentTranscriptSubdir(agentId, subdir) {
|
|
487866
488049
|
agentTranscriptSubdirs.set(agentId, subdir);
|
|
@@ -487872,15 +488055,15 @@ function getAgentTranscriptPath(agentId) {
|
|
|
487872
488055
|
const projectDir = getSessionProjectDir() ?? getProjectDir2(getOriginalCwd());
|
|
487873
488056
|
const sessionId = getSessionId();
|
|
487874
488057
|
const subdir = agentTranscriptSubdirs.get(agentId);
|
|
487875
|
-
const base2 = subdir ?
|
|
487876
|
-
return
|
|
488058
|
+
const base2 = subdir ? join137(projectDir, sessionId, "subagents", subdir) : join137(projectDir, sessionId, "subagents");
|
|
488059
|
+
return join137(base2, `agent-${agentId}.jsonl`);
|
|
487877
488060
|
}
|
|
487878
488061
|
function getAgentMetadataPath(agentId) {
|
|
487879
488062
|
return getAgentTranscriptPath(agentId).replace(/\.jsonl$/, ".meta.json");
|
|
487880
488063
|
}
|
|
487881
488064
|
async function writeAgentMetadata(agentId, metadata) {
|
|
487882
488065
|
const path22 = getAgentMetadataPath(agentId);
|
|
487883
|
-
await
|
|
488066
|
+
await mkdir38(dirname58(path22), { recursive: true });
|
|
487884
488067
|
await writeFile41(path22, JSON.stringify(metadata));
|
|
487885
488068
|
}
|
|
487886
488069
|
async function readAgentMetadata(agentId) {
|
|
@@ -487896,14 +488079,14 @@ async function readAgentMetadata(agentId) {
|
|
|
487896
488079
|
}
|
|
487897
488080
|
function getRemoteAgentsDir() {
|
|
487898
488081
|
const projectDir = getSessionProjectDir() ?? getProjectDir2(getOriginalCwd());
|
|
487899
|
-
return
|
|
488082
|
+
return join137(projectDir, getSessionId(), "remote-agents");
|
|
487900
488083
|
}
|
|
487901
488084
|
function getRemoteAgentMetadataPath(taskId) {
|
|
487902
|
-
return
|
|
488085
|
+
return join137(getRemoteAgentsDir(), `remote-agent-${taskId}.meta.json`);
|
|
487903
488086
|
}
|
|
487904
488087
|
async function writeRemoteAgentMetadata(taskId, metadata) {
|
|
487905
488088
|
const path22 = getRemoteAgentMetadataPath(taskId);
|
|
487906
|
-
await
|
|
488089
|
+
await mkdir38(dirname58(path22), { recursive: true });
|
|
487907
488090
|
await writeFile41(path22, JSON.stringify(metadata));
|
|
487908
488091
|
}
|
|
487909
488092
|
async function readRemoteAgentMetadata(taskId) {
|
|
@@ -487942,7 +488125,7 @@ async function listRemoteAgentMetadata() {
|
|
|
487942
488125
|
if (!entry.isFile() || !entry.name.endsWith(".meta.json"))
|
|
487943
488126
|
continue;
|
|
487944
488127
|
try {
|
|
487945
|
-
const raw = await readFile47(
|
|
488128
|
+
const raw = await readFile47(join137(dir, entry.name), "utf-8");
|
|
487946
488129
|
results.push(JSON.parse(raw));
|
|
487947
488130
|
} catch (e) {
|
|
487948
488131
|
logForDebugging(`listRemoteAgentMetadata: skipping ${entry.name}: ${String(e)}`);
|
|
@@ -487952,7 +488135,7 @@ async function listRemoteAgentMetadata() {
|
|
|
487952
488135
|
}
|
|
487953
488136
|
function sessionIdExists(sessionId) {
|
|
487954
488137
|
const projectDir = getProjectDir2(getOriginalCwd());
|
|
487955
|
-
const sessionFile =
|
|
488138
|
+
const sessionFile = join137(projectDir, `${sessionId}.jsonl`);
|
|
487956
488139
|
const fs11 = getFsImplementation();
|
|
487957
488140
|
try {
|
|
487958
488141
|
fs11.statSync(sessionFile);
|
|
@@ -488092,7 +488275,7 @@ class Project {
|
|
|
488092
488275
|
try {
|
|
488093
488276
|
await fsAppendFile(filePath, data, { mode: 384 });
|
|
488094
488277
|
} catch {
|
|
488095
|
-
await
|
|
488278
|
+
await mkdir38(dirname58(filePath), { recursive: true, mode: 448 });
|
|
488096
488279
|
await fsAppendFile(filePath, data, { mode: 384 });
|
|
488097
488280
|
}
|
|
488098
488281
|
}
|
|
@@ -488633,7 +488816,7 @@ async function hydrateRemoteSession(sessionId, ingressUrl) {
|
|
|
488633
488816
|
try {
|
|
488634
488817
|
const remoteLogs = await getSessionLogs(sessionId, ingressUrl) || [];
|
|
488635
488818
|
const projectDir = getProjectDir2(getOriginalCwd());
|
|
488636
|
-
await
|
|
488819
|
+
await mkdir38(projectDir, { recursive: true, mode: 448 });
|
|
488637
488820
|
const sessionFile = getTranscriptPathForSession(sessionId);
|
|
488638
488821
|
const content = remoteLogs.map((e) => jsonStringify(e) + `
|
|
488639
488822
|
`).join("");
|
|
@@ -488665,7 +488848,7 @@ async function hydrateFromCCRv2InternalEvents(sessionId) {
|
|
|
488665
488848
|
return false;
|
|
488666
488849
|
}
|
|
488667
488850
|
const projectDir = getProjectDir2(getOriginalCwd());
|
|
488668
|
-
await
|
|
488851
|
+
await mkdir38(projectDir, { recursive: true, mode: 448 });
|
|
488669
488852
|
const sessionFile = getTranscriptPathForSession(sessionId);
|
|
488670
488853
|
const fgContent = events2.map((e) => jsonStringify(e.payload) + `
|
|
488671
488854
|
`).join("");
|
|
@@ -488691,7 +488874,7 @@ async function hydrateFromCCRv2InternalEvents(sessionId) {
|
|
|
488691
488874
|
}
|
|
488692
488875
|
for (const [agentId, entries] of byAgent) {
|
|
488693
488876
|
const agentFile = getAgentTranscriptPath(asAgentId(agentId));
|
|
488694
|
-
await
|
|
488877
|
+
await mkdir38(dirname58(agentFile), { recursive: true, mode: 448 });
|
|
488695
488878
|
const agentContent = entries.map((p) => jsonStringify(p) + `
|
|
488696
488879
|
`).join("");
|
|
488697
488880
|
await writeFile41(agentFile, agentContent, {
|
|
@@ -489921,7 +490104,7 @@ async function loadTranscriptFile(filePath, opts) {
|
|
|
489921
490104
|
};
|
|
489922
490105
|
}
|
|
489923
490106
|
async function loadSessionFile(sessionId) {
|
|
489924
|
-
const sessionFile =
|
|
490107
|
+
const sessionFile = join137(getSessionProjectDir() ?? getProjectDir2(getOriginalCwd()), `${sessionId}.jsonl`);
|
|
489925
490108
|
return loadTranscriptFile(sessionFile);
|
|
489926
490109
|
}
|
|
489927
490110
|
function clearSessionMessagesCache() {
|
|
@@ -489989,7 +490172,7 @@ async function loadAllProjectsMessageLogsFull(limit) {
|
|
|
489989
490172
|
} catch {
|
|
489990
490173
|
return [];
|
|
489991
490174
|
}
|
|
489992
|
-
const projectDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) =>
|
|
490175
|
+
const projectDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) => join137(projectsDir, dirent.name));
|
|
489993
490176
|
const logsPerProject = await Promise.all(projectDirs.map((projectDir) => getLogsWithoutIndex(projectDir, limit)));
|
|
489994
490177
|
const allLogs = logsPerProject.flat();
|
|
489995
490178
|
const deduped = new Map;
|
|
@@ -490014,7 +490197,7 @@ async function loadAllProjectsMessageLogsProgressive(limit, initialEnrichCount =
|
|
|
490014
490197
|
} catch {
|
|
490015
490198
|
return { logs: [], allStatLogs: [], nextIndex: 0 };
|
|
490016
490199
|
}
|
|
490017
|
-
const projectDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) =>
|
|
490200
|
+
const projectDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) => join137(projectsDir, dirent.name));
|
|
490018
490201
|
const rawLogs = [];
|
|
490019
490202
|
for (const projectDir of projectDirs) {
|
|
490020
490203
|
rawLogs.push(...await getSessionFilesLite(projectDir, limit));
|
|
@@ -490075,7 +490258,7 @@ async function getStatOnlyLogsForWorktrees(worktreePaths, limit) {
|
|
|
490075
490258
|
for (const { path: wtPath, prefix } of indexed) {
|
|
490076
490259
|
if (dirName === prefix || dirName.startsWith(prefix + "-")) {
|
|
490077
490260
|
seenDirs.add(dirName);
|
|
490078
|
-
allLogs.push(...await getSessionFilesLite(
|
|
490261
|
+
allLogs.push(...await getSessionFilesLite(join137(projectsDir, dirent.name), undefined, wtPath));
|
|
490079
490262
|
break;
|
|
490080
490263
|
}
|
|
490081
490264
|
}
|
|
@@ -490144,7 +490327,7 @@ async function loadSubagentTranscripts(agentIds) {
|
|
|
490144
490327
|
return transcripts;
|
|
490145
490328
|
}
|
|
490146
490329
|
async function loadAllSubagentTranscriptsFromDisk() {
|
|
490147
|
-
const subagentsDir =
|
|
490330
|
+
const subagentsDir = join137(getSessionProjectDir() ?? getProjectDir2(getOriginalCwd()), getSessionId(), "subagents");
|
|
490148
490331
|
let entries;
|
|
490149
490332
|
try {
|
|
490150
490333
|
entries = await readdir27(subagentsDir, { withFileTypes: true });
|
|
@@ -490272,7 +490455,7 @@ async function getSessionFilesWithMtime(projectDir) {
|
|
|
490272
490455
|
const sessionId = validateUuid2(basename42(dirent.name, ".jsonl"));
|
|
490273
490456
|
if (!sessionId)
|
|
490274
490457
|
continue;
|
|
490275
|
-
candidates.push({ sessionId, filePath:
|
|
490458
|
+
candidates.push({ sessionId, filePath: join137(projectDir, dirent.name) });
|
|
490276
490459
|
}
|
|
490277
490460
|
await Promise.all(candidates.map(async ({ sessionId, filePath }) => {
|
|
490278
490461
|
try {
|
|
@@ -490670,7 +490853,7 @@ var init_sessionStorage = __esm(() => {
|
|
|
490670
490853
|
MAX_TRANSCRIPT_READ_BYTES = 50 * 1024 * 1024;
|
|
490671
490854
|
agentTranscriptSubdirs = new Map;
|
|
490672
490855
|
getProjectDir2 = memoize_default((projectDir) => {
|
|
490673
|
-
return
|
|
490856
|
+
return join137(getProjectsDir2(), sanitizePath2(projectDir));
|
|
490674
490857
|
});
|
|
490675
490858
|
METADATA_TYPE_MARKERS = [
|
|
490676
490859
|
'"type":"summary"',
|
|
@@ -490908,41 +491091,41 @@ var init_memdir = __esm(() => {
|
|
|
490908
491091
|
});
|
|
490909
491092
|
|
|
490910
491093
|
// src/tools/AgentTool/agentMemory.ts
|
|
490911
|
-
import { join as
|
|
491094
|
+
import { join as join138, normalize as normalize14, sep as sep34 } from "path";
|
|
490912
491095
|
function sanitizeAgentTypeForPath(agentType) {
|
|
490913
491096
|
return agentType.replace(/:/g, "-");
|
|
490914
491097
|
}
|
|
490915
491098
|
function getLocalAgentMemoryDir(dirName) {
|
|
490916
491099
|
if (process.env.CLAUDE_CODE_REMOTE_MEMORY_DIR) {
|
|
490917
|
-
return
|
|
491100
|
+
return join138(process.env.CLAUDE_CODE_REMOTE_MEMORY_DIR, "projects", sanitizePath2(findCanonicalGitRoot(getProjectRoot()) ?? getProjectRoot()), "agent-memory-local", dirName) + sep34;
|
|
490918
491101
|
}
|
|
490919
|
-
return
|
|
491102
|
+
return join138(getCwd(), ".claude", "agent-memory-local", dirName) + sep34;
|
|
490920
491103
|
}
|
|
490921
491104
|
function getAgentMemoryDir(agentType, scope) {
|
|
490922
491105
|
const dirName = sanitizeAgentTypeForPath(agentType);
|
|
490923
491106
|
switch (scope) {
|
|
490924
491107
|
case "project":
|
|
490925
|
-
return
|
|
491108
|
+
return join138(getCwd(), ".claude", "agent-memory", dirName) + sep34;
|
|
490926
491109
|
case "local":
|
|
490927
491110
|
return getLocalAgentMemoryDir(dirName);
|
|
490928
491111
|
case "user":
|
|
490929
|
-
return
|
|
491112
|
+
return join138(getMemoryBaseDir(), "agent-memory", dirName) + sep34;
|
|
490930
491113
|
}
|
|
490931
491114
|
}
|
|
490932
491115
|
function isAgentMemoryPath(absolutePath) {
|
|
490933
491116
|
const normalizedPath = normalize14(absolutePath);
|
|
490934
491117
|
const memoryBase = getMemoryBaseDir();
|
|
490935
|
-
if (normalizedPath.startsWith(
|
|
491118
|
+
if (normalizedPath.startsWith(join138(memoryBase, "agent-memory") + sep34)) {
|
|
490936
491119
|
return true;
|
|
490937
491120
|
}
|
|
490938
|
-
if (normalizedPath.startsWith(
|
|
491121
|
+
if (normalizedPath.startsWith(join138(getCwd(), ".claude", "agent-memory") + sep34)) {
|
|
490939
491122
|
return true;
|
|
490940
491123
|
}
|
|
490941
491124
|
if (process.env.CLAUDE_CODE_REMOTE_MEMORY_DIR) {
|
|
490942
|
-
if (normalizedPath.includes(sep34 + "agent-memory-local" + sep34) && normalizedPath.startsWith(
|
|
491125
|
+
if (normalizedPath.includes(sep34 + "agent-memory-local" + sep34) && normalizedPath.startsWith(join138(process.env.CLAUDE_CODE_REMOTE_MEMORY_DIR, "projects") + sep34)) {
|
|
490943
491126
|
return true;
|
|
490944
491127
|
}
|
|
490945
|
-
} else if (normalizedPath.startsWith(
|
|
491128
|
+
} else if (normalizedPath.startsWith(join138(getCwd(), ".claude", "agent-memory-local") + sep34)) {
|
|
490946
491129
|
return true;
|
|
490947
491130
|
}
|
|
490948
491131
|
return false;
|
|
@@ -490950,7 +491133,7 @@ function isAgentMemoryPath(absolutePath) {
|
|
|
490950
491133
|
function getMemoryScopeDisplay(memory2) {
|
|
490951
491134
|
switch (memory2) {
|
|
490952
491135
|
case "user":
|
|
490953
|
-
return `User (${
|
|
491136
|
+
return `User (${join138(getMemoryBaseDir(), "agent-memory")}/)`;
|
|
490954
491137
|
case "project":
|
|
490955
491138
|
return "Project (.claude/agent-memory/)";
|
|
490956
491139
|
case "local":
|
|
@@ -490993,7 +491176,7 @@ var init_agentMemory = __esm(() => {
|
|
|
490993
491176
|
// src/utils/permissions/filesystem.ts
|
|
490994
491177
|
import { randomBytes as randomBytes19 } from "crypto";
|
|
490995
491178
|
import { homedir as homedir33, tmpdir as tmpdir13 } from "os";
|
|
490996
|
-
import { join as
|
|
491179
|
+
import { join as join139, normalize as normalize15, posix as posix8, sep as sep35 } from "path";
|
|
490997
491180
|
function normalizeCaseForComparison2(path22) {
|
|
490998
491181
|
return path22.toLowerCase();
|
|
490999
491182
|
}
|
|
@@ -491002,11 +491185,11 @@ function getClaudeSkillScope(filePath) {
|
|
|
491002
491185
|
const absolutePathLower = normalizeCaseForComparison2(absolutePath);
|
|
491003
491186
|
const bases = [
|
|
491004
491187
|
{
|
|
491005
|
-
dir: expandPath(
|
|
491188
|
+
dir: expandPath(join139(getOriginalCwd(), ".claude", "skills")),
|
|
491006
491189
|
prefix: "/.claude/skills/"
|
|
491007
491190
|
},
|
|
491008
491191
|
{
|
|
491009
|
-
dir: expandPath(
|
|
491192
|
+
dir: expandPath(join139(homedir33(), ".claude", "skills")),
|
|
491010
491193
|
prefix: "~/.claude/skills/"
|
|
491011
491194
|
}
|
|
491012
491195
|
];
|
|
@@ -491061,21 +491244,21 @@ function isClaudeConfigFilePath(filePath) {
|
|
|
491061
491244
|
if (isClaudeSettingsPath(filePath)) {
|
|
491062
491245
|
return true;
|
|
491063
491246
|
}
|
|
491064
|
-
const commandsDir =
|
|
491065
|
-
const agentsDir =
|
|
491066
|
-
const skillsDir =
|
|
491247
|
+
const commandsDir = join139(getOriginalCwd(), ".claude", "commands");
|
|
491248
|
+
const agentsDir = join139(getOriginalCwd(), ".claude", "agents");
|
|
491249
|
+
const skillsDir = join139(getOriginalCwd(), ".claude", "skills");
|
|
491067
491250
|
return pathInWorkingPath(filePath, commandsDir) || pathInWorkingPath(filePath, agentsDir) || pathInWorkingPath(filePath, skillsDir);
|
|
491068
491251
|
}
|
|
491069
491252
|
function isSessionPlanFile(absolutePath) {
|
|
491070
|
-
const expectedPrefix =
|
|
491253
|
+
const expectedPrefix = join139(getPlansDirectory(), getPlanSlug());
|
|
491071
491254
|
const normalizedPath = normalize15(absolutePath);
|
|
491072
491255
|
return normalizedPath.startsWith(expectedPrefix) && normalizedPath.endsWith(".md");
|
|
491073
491256
|
}
|
|
491074
491257
|
function getSessionMemoryDir() {
|
|
491075
|
-
return
|
|
491258
|
+
return join139(getProjectDir2(getCwd()), getSessionId(), "session-memory") + sep35;
|
|
491076
491259
|
}
|
|
491077
491260
|
function getSessionMemoryPath() {
|
|
491078
|
-
return
|
|
491261
|
+
return join139(getSessionMemoryDir(), "summary.md");
|
|
491079
491262
|
}
|
|
491080
491263
|
function isSessionMemoryPath(absolutePath) {
|
|
491081
491264
|
const normalizedPath = normalize15(absolutePath);
|
|
@@ -491097,10 +491280,10 @@ function getClaudeTempDirName() {
|
|
|
491097
491280
|
return `claude-${uid}`;
|
|
491098
491281
|
}
|
|
491099
491282
|
function getProjectTempDir() {
|
|
491100
|
-
return
|
|
491283
|
+
return join139(getClaudeTempDir(), sanitizePath2(getOriginalCwd())) + sep35;
|
|
491101
491284
|
}
|
|
491102
491285
|
function getScratchpadDir() {
|
|
491103
|
-
return
|
|
491286
|
+
return join139(getProjectTempDir(), getSessionId(), "scratchpad");
|
|
491104
491287
|
}
|
|
491105
491288
|
async function ensureScratchpadDir() {
|
|
491106
491289
|
if (!isScratchpadEnabled()) {
|
|
@@ -491678,7 +491861,7 @@ function checkEditableInternalPath(absolutePath, input) {
|
|
|
491678
491861
|
}
|
|
491679
491862
|
};
|
|
491680
491863
|
}
|
|
491681
|
-
if (normalizeCaseForComparison2(normalizedPath) === normalizeCaseForComparison2(
|
|
491864
|
+
if (normalizeCaseForComparison2(normalizedPath) === normalizeCaseForComparison2(join139(getOriginalCwd(), ".claude", "launch.json"))) {
|
|
491682
491865
|
return {
|
|
491683
491866
|
behavior: "allow",
|
|
491684
491867
|
updatedInput: input,
|
|
@@ -491775,7 +491958,7 @@ function checkReadableInternalPath(absolutePath, input) {
|
|
|
491775
491958
|
}
|
|
491776
491959
|
};
|
|
491777
491960
|
}
|
|
491778
|
-
const tasksDir =
|
|
491961
|
+
const tasksDir = join139(getClaudeConfigHomeDir(), "tasks") + sep35;
|
|
491779
491962
|
if (normalizedPath === tasksDir.slice(0, -1) || normalizedPath.startsWith(tasksDir)) {
|
|
491780
491963
|
return {
|
|
491781
491964
|
behavior: "allow",
|
|
@@ -491786,7 +491969,7 @@ function checkReadableInternalPath(absolutePath, input) {
|
|
|
491786
491969
|
}
|
|
491787
491970
|
};
|
|
491788
491971
|
}
|
|
491789
|
-
const teamsReadDir =
|
|
491972
|
+
const teamsReadDir = join139(getClaudeConfigHomeDir(), "teams") + sep35;
|
|
491790
491973
|
if (normalizedPath === teamsReadDir.slice(0, -1) || normalizedPath.startsWith(teamsReadDir)) {
|
|
491791
491974
|
return {
|
|
491792
491975
|
behavior: "allow",
|
|
@@ -491859,11 +492042,11 @@ var init_filesystem = __esm(() => {
|
|
|
491859
492042
|
try {
|
|
491860
492043
|
resolvedBaseTmpDir = fs11.realpathSync(baseTmpDir);
|
|
491861
492044
|
} catch {}
|
|
491862
|
-
return
|
|
492045
|
+
return join139(resolvedBaseTmpDir, getClaudeTempDirName()) + sep35;
|
|
491863
492046
|
});
|
|
491864
492047
|
getBundledSkillsRoot = memoize_default(function getBundledSkillsRoot2() {
|
|
491865
492048
|
const nonce = randomBytes19(16).toString("hex");
|
|
491866
|
-
return
|
|
492049
|
+
return join139(getClaudeTempDir(), "bundled-skills", MACRO.VERSION, nonce);
|
|
491867
492050
|
});
|
|
491868
492051
|
getResolvedWorkingDirPaths = memoize_default(getPathsForPermissionCheck);
|
|
491869
492052
|
});
|
|
@@ -491871,24 +492054,24 @@ var init_filesystem = __esm(() => {
|
|
|
491871
492054
|
// src/utils/task/diskOutput.ts
|
|
491872
492055
|
import { constants as fsConstants7 } from "fs";
|
|
491873
492056
|
import {
|
|
491874
|
-
mkdir as
|
|
492057
|
+
mkdir as mkdir39,
|
|
491875
492058
|
open as open15,
|
|
491876
492059
|
stat as stat42,
|
|
491877
492060
|
symlink as symlink4,
|
|
491878
492061
|
unlink as unlink19
|
|
491879
492062
|
} from "fs/promises";
|
|
491880
|
-
import { join as
|
|
492063
|
+
import { join as join140 } from "path";
|
|
491881
492064
|
function getTaskOutputDir() {
|
|
491882
492065
|
if (_taskOutputDir === undefined) {
|
|
491883
|
-
_taskOutputDir =
|
|
492066
|
+
_taskOutputDir = join140(getProjectTempDir(), getSessionId(), "tasks");
|
|
491884
492067
|
}
|
|
491885
492068
|
return _taskOutputDir;
|
|
491886
492069
|
}
|
|
491887
492070
|
async function ensureOutputDir() {
|
|
491888
|
-
await
|
|
492071
|
+
await mkdir39(getTaskOutputDir(), { recursive: true });
|
|
491889
492072
|
}
|
|
491890
492073
|
function getTaskOutputPath(taskId) {
|
|
491891
|
-
return
|
|
492074
|
+
return join140(getTaskOutputDir(), `${taskId}.output`);
|
|
491892
492075
|
}
|
|
491893
492076
|
function track(p) {
|
|
491894
492077
|
_pendingOps.add(p);
|
|
@@ -496149,14 +496332,14 @@ __export(exports_worktree, {
|
|
|
496149
496332
|
import { spawnSync as spawnSync5 } from "child_process";
|
|
496150
496333
|
import {
|
|
496151
496334
|
copyFile as copyFile11,
|
|
496152
|
-
mkdir as
|
|
496335
|
+
mkdir as mkdir40,
|
|
496153
496336
|
readdir as readdir28,
|
|
496154
496337
|
readFile as readFile48,
|
|
496155
496338
|
stat as stat44,
|
|
496156
496339
|
symlink as symlink5,
|
|
496157
496340
|
utimes as utimes2
|
|
496158
496341
|
} from "fs/promises";
|
|
496159
|
-
import { basename as basename44, dirname as dirname59, join as
|
|
496342
|
+
import { basename as basename44, dirname as dirname59, join as join141 } from "path";
|
|
496160
496343
|
function validateWorktreeSlug(slug) {
|
|
496161
496344
|
if (slug.length > MAX_WORKTREE_SLUG_LENGTH) {
|
|
496162
496345
|
throw new Error(`Invalid worktree name: must be ${MAX_WORKTREE_SLUG_LENGTH} characters or fewer (got ${slug.length})`);
|
|
@@ -496171,7 +496354,7 @@ function validateWorktreeSlug(slug) {
|
|
|
496171
496354
|
}
|
|
496172
496355
|
}
|
|
496173
496356
|
async function mkdirRecursive(dirPath) {
|
|
496174
|
-
await
|
|
496357
|
+
await mkdir40(dirPath, { recursive: true });
|
|
496175
496358
|
}
|
|
496176
496359
|
async function symlinkDirectories(repoRootPath, worktreePath, dirsToSymlink) {
|
|
496177
496360
|
for (const dir of dirsToSymlink) {
|
|
@@ -496179,8 +496362,8 @@ async function symlinkDirectories(repoRootPath, worktreePath, dirsToSymlink) {
|
|
|
496179
496362
|
logForDebugging(`Skipping symlink for "${dir}": path traversal detected`, { level: "warn" });
|
|
496180
496363
|
continue;
|
|
496181
496364
|
}
|
|
496182
|
-
const sourcePath =
|
|
496183
|
-
const destPath =
|
|
496365
|
+
const sourcePath = join141(repoRootPath, dir);
|
|
496366
|
+
const destPath = join141(worktreePath, dir);
|
|
496184
496367
|
try {
|
|
496185
496368
|
await symlink5(sourcePath, destPath, "dir");
|
|
496186
496369
|
logForDebugging(`Symlinked ${dir} from main repository to worktree to avoid disk bloat`);
|
|
@@ -496204,7 +496387,7 @@ function generateTmuxSessionName(repoPath, branch2) {
|
|
|
496204
496387
|
return combined.replace(/[/.]/g, "_");
|
|
496205
496388
|
}
|
|
496206
496389
|
function worktreesDir(repoRoot) {
|
|
496207
|
-
return
|
|
496390
|
+
return join141(repoRoot, ".claude", "worktrees");
|
|
496208
496391
|
}
|
|
496209
496392
|
function flattenSlug(slug) {
|
|
496210
496393
|
return slug.replaceAll("/", "+");
|
|
@@ -496213,7 +496396,7 @@ function worktreeBranchName(slug) {
|
|
|
496213
496396
|
return `worktree-${flattenSlug(slug)}`;
|
|
496214
496397
|
}
|
|
496215
496398
|
function worktreePathFor(repoRoot, slug) {
|
|
496216
|
-
return
|
|
496399
|
+
return join141(worktreesDir(repoRoot), flattenSlug(slug));
|
|
496217
496400
|
}
|
|
496218
496401
|
async function getOrCreateWorktree(repoRoot, slug, options) {
|
|
496219
496402
|
const worktreePath = worktreePathFor(repoRoot, slug);
|
|
@@ -496227,7 +496410,7 @@ async function getOrCreateWorktree(repoRoot, slug, options) {
|
|
|
496227
496410
|
existed: true
|
|
496228
496411
|
};
|
|
496229
496412
|
}
|
|
496230
|
-
await
|
|
496413
|
+
await mkdir40(worktreesDir(repoRoot), { recursive: true });
|
|
496231
496414
|
const fetchEnv = { ...process.env, ...GIT_NO_PROMPT_ENV2 };
|
|
496232
496415
|
let baseBranch;
|
|
496233
496416
|
let baseSha = null;
|
|
@@ -496294,7 +496477,7 @@ async function getOrCreateWorktree(repoRoot, slug, options) {
|
|
|
496294
496477
|
async function copyWorktreeIncludeFiles(repoRoot, worktreePath) {
|
|
496295
496478
|
let includeContent;
|
|
496296
496479
|
try {
|
|
496297
|
-
includeContent = await readFile48(
|
|
496480
|
+
includeContent = await readFile48(join141(repoRoot, ".worktreeinclude"), "utf-8");
|
|
496298
496481
|
} catch {
|
|
496299
496482
|
return [];
|
|
496300
496483
|
}
|
|
@@ -496349,10 +496532,10 @@ async function copyWorktreeIncludeFiles(repoRoot, worktreePath) {
|
|
|
496349
496532
|
}
|
|
496350
496533
|
const copied = [];
|
|
496351
496534
|
for (const relativePath2 of files3) {
|
|
496352
|
-
const srcPath =
|
|
496353
|
-
const destPath =
|
|
496535
|
+
const srcPath = join141(repoRoot, relativePath2);
|
|
496536
|
+
const destPath = join141(worktreePath, relativePath2);
|
|
496354
496537
|
try {
|
|
496355
|
-
await
|
|
496538
|
+
await mkdir40(dirname59(destPath), { recursive: true });
|
|
496356
496539
|
await copyFile11(srcPath, destPath);
|
|
496357
496540
|
copied.push(relativePath2);
|
|
496358
496541
|
} catch (e) {
|
|
@@ -496366,9 +496549,9 @@ async function copyWorktreeIncludeFiles(repoRoot, worktreePath) {
|
|
|
496366
496549
|
}
|
|
496367
496550
|
async function performPostCreationSetup(repoRoot, worktreePath) {
|
|
496368
496551
|
const localSettingsRelativePath = getRelativeSettingsFilePathForSource("localSettings");
|
|
496369
|
-
const sourceSettingsLocal =
|
|
496552
|
+
const sourceSettingsLocal = join141(repoRoot, localSettingsRelativePath);
|
|
496370
496553
|
try {
|
|
496371
|
-
const destSettingsLocal =
|
|
496554
|
+
const destSettingsLocal = join141(worktreePath, localSettingsRelativePath);
|
|
496372
496555
|
await mkdirRecursive(dirname59(destSettingsLocal));
|
|
496373
496556
|
await copyFile11(sourceSettingsLocal, destSettingsLocal);
|
|
496374
496557
|
logForDebugging(`Copied settings.local.json to worktree: ${destSettingsLocal}`);
|
|
@@ -496378,8 +496561,8 @@ async function performPostCreationSetup(repoRoot, worktreePath) {
|
|
|
496378
496561
|
logForDebugging(`Failed to copy settings.local.json: ${e.message}`, { level: "warn" });
|
|
496379
496562
|
}
|
|
496380
496563
|
}
|
|
496381
|
-
const huskyPath =
|
|
496382
|
-
const gitHooksPath =
|
|
496564
|
+
const huskyPath = join141(repoRoot, ".husky");
|
|
496565
|
+
const gitHooksPath = join141(repoRoot, ".git", "hooks");
|
|
496383
496566
|
let hooksPath = null;
|
|
496384
496567
|
for (const candidatePath of [huskyPath, gitHooksPath]) {
|
|
496385
496568
|
try {
|
|
@@ -496654,7 +496837,7 @@ async function cleanupStaleAgentWorktrees(cutoffDate) {
|
|
|
496654
496837
|
if (!EPHEMERAL_WORKTREE_PATTERNS.some((p) => p.test(slug))) {
|
|
496655
496838
|
continue;
|
|
496656
496839
|
}
|
|
496657
|
-
const worktreePath =
|
|
496840
|
+
const worktreePath = join141(dir, slug);
|
|
496658
496841
|
if (currentPath === worktreePath) {
|
|
496659
496842
|
continue;
|
|
496660
496843
|
}
|
|
@@ -500004,9 +500187,9 @@ __export(exports_chromeNativeHost, {
|
|
|
500004
500187
|
runChromeNativeHost: () => runChromeNativeHost
|
|
500005
500188
|
});
|
|
500006
500189
|
import {
|
|
500007
|
-
appendFile as
|
|
500190
|
+
appendFile as appendFile6,
|
|
500008
500191
|
chmod as chmod11,
|
|
500009
|
-
mkdir as
|
|
500192
|
+
mkdir as mkdir41,
|
|
500010
500193
|
readdir as readdir29,
|
|
500011
500194
|
rmdir as rmdir3,
|
|
500012
500195
|
stat as stat45,
|
|
@@ -500014,14 +500197,14 @@ import {
|
|
|
500014
500197
|
} from "fs/promises";
|
|
500015
500198
|
import { createServer as createServer7 } from "net";
|
|
500016
500199
|
import { homedir as homedir34, platform as platform5 } from "os";
|
|
500017
|
-
import { join as
|
|
500200
|
+
import { join as join142 } from "path";
|
|
500018
500201
|
function log(message, ...args) {
|
|
500019
500202
|
if (LOG_FILE) {
|
|
500020
500203
|
const timestamp = new Date().toISOString();
|
|
500021
500204
|
const formattedArgs = args.length > 0 ? " " + jsonStringify(args) : "";
|
|
500022
500205
|
const logLine2 = `[${timestamp}] [Claude Chrome Native Host] ${message}${formattedArgs}
|
|
500023
500206
|
`;
|
|
500024
|
-
|
|
500207
|
+
appendFile6(LOG_FILE, logLine2).catch(() => {});
|
|
500025
500208
|
}
|
|
500026
500209
|
console.error(`[Claude Chrome Native Host] ${message}`, ...args);
|
|
500027
500210
|
}
|
|
@@ -500066,7 +500249,7 @@ class ChromeNativeHost {
|
|
|
500066
500249
|
await unlink20(socketDir);
|
|
500067
500250
|
}
|
|
500068
500251
|
} catch {}
|
|
500069
|
-
await
|
|
500252
|
+
await mkdir41(socketDir, { recursive: true, mode: 448 });
|
|
500070
500253
|
await chmod11(socketDir, 448).catch(() => {});
|
|
500071
500254
|
try {
|
|
500072
500255
|
const files3 = await readdir29(socketDir);
|
|
@@ -500081,7 +500264,7 @@ class ChromeNativeHost {
|
|
|
500081
500264
|
try {
|
|
500082
500265
|
process.kill(pid, 0);
|
|
500083
500266
|
} catch {
|
|
500084
|
-
await unlink20(
|
|
500267
|
+
await unlink20(join142(socketDir, file2)).catch(() => {});
|
|
500085
500268
|
log(`Removed stale socket for PID ${pid}`);
|
|
500086
500269
|
}
|
|
500087
500270
|
}
|
|
@@ -500352,7 +500535,7 @@ var init_chromeNativeHost = __esm(() => {
|
|
|
500352
500535
|
init_slowOperations();
|
|
500353
500536
|
init_common3();
|
|
500354
500537
|
MAX_MESSAGE_SIZE = 1024 * 1024;
|
|
500355
|
-
LOG_FILE = process.env.USER_TYPE === "ant" ?
|
|
500538
|
+
LOG_FILE = process.env.USER_TYPE === "ant" ? join142(homedir34(), ".claude", "debug", "chrome-native-host.txt") : undefined;
|
|
500356
500539
|
messageSchema = lazySchema(() => exports_external.object({
|
|
500357
500540
|
type: exports_external.string()
|
|
500358
500541
|
}).passthrough());
|
|
@@ -503090,9 +503273,9 @@ __export(exports_upstreamproxy, {
|
|
|
503090
503273
|
getUpstreamProxyEnv: () => getUpstreamProxyEnv,
|
|
503091
503274
|
SESSION_TOKEN_PATH: () => SESSION_TOKEN_PATH
|
|
503092
503275
|
});
|
|
503093
|
-
import { mkdir as
|
|
503276
|
+
import { mkdir as mkdir42, readFile as readFile49, unlink as unlink21, writeFile as writeFile42 } from "fs/promises";
|
|
503094
503277
|
import { homedir as homedir35 } from "os";
|
|
503095
|
-
import { join as
|
|
503278
|
+
import { join as join143 } from "path";
|
|
503096
503279
|
async function initUpstreamProxy(opts) {
|
|
503097
503280
|
if (!isEnvTruthy(process.env.CLAUDE_CODE_REMOTE)) {
|
|
503098
503281
|
return state;
|
|
@@ -503113,7 +503296,7 @@ async function initUpstreamProxy(opts) {
|
|
|
503113
503296
|
}
|
|
503114
503297
|
setNonDumpable();
|
|
503115
503298
|
const baseUrl = opts?.ccrBaseUrl ?? process.env.ANTHROPIC_BASE_URL ?? "https://api.anthropic.com";
|
|
503116
|
-
const caBundlePath = opts?.caBundlePath ??
|
|
503299
|
+
const caBundlePath = opts?.caBundlePath ?? join143(homedir35(), ".ccr", "ca-bundle.crt");
|
|
503117
503300
|
const caOk = await downloadCaBundle(baseUrl, opts?.systemCaPath ?? SYSTEM_CA_BUNDLE, caBundlePath);
|
|
503118
503301
|
if (!caOk)
|
|
503119
503302
|
return state;
|
|
@@ -503213,7 +503396,7 @@ async function downloadCaBundle(baseUrl, systemCaPath, outPath) {
|
|
|
503213
503396
|
}
|
|
503214
503397
|
const ccrCa = await resp.text();
|
|
503215
503398
|
const systemCa = await readFile49(systemCaPath, "utf8").catch(() => "");
|
|
503216
|
-
await
|
|
503399
|
+
await mkdir42(join143(outPath, ".."), { recursive: true });
|
|
503217
503400
|
await writeFile42(outPath, systemCa + `
|
|
503218
503401
|
` + ccrCa, "utf8");
|
|
503219
503402
|
return true;
|
|
@@ -503648,6 +503831,8 @@ var init_init3 = __esm(() => {
|
|
|
503648
503831
|
duration_ms: Date.now() - scratchpadStart
|
|
503649
503832
|
});
|
|
503650
503833
|
}
|
|
503834
|
+
const { checkOnDailyUse: checkOnDailyUse2 } = await Promise.resolve().then(() => (init_checker(), exports_checker));
|
|
503835
|
+
checkOnDailyUse2();
|
|
503651
503836
|
logForDiagnosticsNoPII("info", "init_completed", {
|
|
503652
503837
|
duration_ms: Date.now() - initStartTime
|
|
503653
503838
|
});
|
|
@@ -511375,7 +511560,7 @@ var init_ShowInIDEPrompt = __esm(() => {
|
|
|
511375
511560
|
|
|
511376
511561
|
// src/components/permissions/FilePermissionDialog/permissionOptions.tsx
|
|
511377
511562
|
import { homedir as homedir36 } from "os";
|
|
511378
|
-
import { basename as basename48, join as
|
|
511563
|
+
import { basename as basename48, join as join144, sep as sep36 } from "path";
|
|
511379
511564
|
function isInClaudeFolder(filePath) {
|
|
511380
511565
|
const absolutePath = expandPath(filePath);
|
|
511381
511566
|
const claudeFolderPath = expandPath(`${getOriginalCwd()}/.claude`);
|
|
@@ -511385,7 +511570,7 @@ function isInClaudeFolder(filePath) {
|
|
|
511385
511570
|
}
|
|
511386
511571
|
function isInGlobalClaudeFolder(filePath) {
|
|
511387
511572
|
const absolutePath = expandPath(filePath);
|
|
511388
|
-
const globalClaudeFolderPath =
|
|
511573
|
+
const globalClaudeFolderPath = join144(homedir36(), ".claude");
|
|
511389
511574
|
const normalizedAbsolutePath = normalizeCaseForComparison2(absolutePath);
|
|
511390
511575
|
const normalizedGlobalClaudeFolderPath = normalizeCaseForComparison2(globalClaudeFolderPath);
|
|
511391
511576
|
return normalizedAbsolutePath.startsWith(normalizedGlobalClaudeFolderPath + sep36.toLowerCase()) || normalizedAbsolutePath.startsWith(normalizedGlobalClaudeFolderPath + "/");
|
|
@@ -533615,9 +533800,9 @@ function initSkillImprovement() {
|
|
|
533615
533800
|
async function applySkillImprovement(skillName, updates) {
|
|
533616
533801
|
if (!skillName)
|
|
533617
533802
|
return;
|
|
533618
|
-
const { join:
|
|
533803
|
+
const { join: join145 } = await import("path");
|
|
533619
533804
|
const fs11 = await import("fs/promises");
|
|
533620
|
-
const filePath =
|
|
533805
|
+
const filePath = join145(getCwd(), ".claude", "skills", skillName, "SKILL.md");
|
|
533621
533806
|
let currentContent;
|
|
533622
533807
|
try {
|
|
533623
533808
|
currentContent = await fs11.readFile(filePath, "utf-8");
|
|
@@ -533771,7 +533956,7 @@ function useMoreRight(_args) {
|
|
|
533771
533956
|
// src/utils/cleanup.ts
|
|
533772
533957
|
import * as fs11 from "fs/promises";
|
|
533773
533958
|
import { homedir as homedir37 } from "os";
|
|
533774
|
-
import { join as
|
|
533959
|
+
import { join as join145 } from "path";
|
|
533775
533960
|
function getCutoffDate() {
|
|
533776
533961
|
const settings = getSettings_DEPRECATED() || {};
|
|
533777
533962
|
const cleanupPeriodDays = settings.cleanupPeriodDays ?? DEFAULT_CLEANUP_PERIOD_DAYS;
|
|
@@ -533796,7 +533981,7 @@ async function cleanupOldFilesInDirectory(dirPath, cutoffDate, isMessagePath) {
|
|
|
533796
533981
|
try {
|
|
533797
533982
|
const timestamp = convertFileNameToDate(file2.name);
|
|
533798
533983
|
if (timestamp < cutoffDate) {
|
|
533799
|
-
await getFsImplementation().unlink(
|
|
533984
|
+
await getFsImplementation().unlink(join145(dirPath, file2.name));
|
|
533800
533985
|
if (isMessagePath) {
|
|
533801
533986
|
result.messages++;
|
|
533802
533987
|
} else {
|
|
@@ -533827,7 +534012,7 @@ async function cleanupOldMessageFiles() {
|
|
|
533827
534012
|
} catch {
|
|
533828
534013
|
return result;
|
|
533829
534014
|
}
|
|
533830
|
-
const mcpLogDirs = dirents.filter((dirent) => dirent.isDirectory() && dirent.name.startsWith("mcp-logs-")).map((dirent) =>
|
|
534015
|
+
const mcpLogDirs = dirents.filter((dirent) => dirent.isDirectory() && dirent.name.startsWith("mcp-logs-")).map((dirent) => join145(baseCachePath, dirent.name));
|
|
533831
534016
|
for (const mcpLogDir of mcpLogDirs) {
|
|
533832
534017
|
result = addCleanupResults(result, await cleanupOldFilesInDirectory(mcpLogDir, cutoffDate, true));
|
|
533833
534018
|
await tryRmdir(mcpLogDir, fsImpl);
|
|
@@ -533866,7 +534051,7 @@ async function cleanupOldSessionFiles() {
|
|
|
533866
534051
|
for (const projectDirent of projectDirents) {
|
|
533867
534052
|
if (!projectDirent.isDirectory())
|
|
533868
534053
|
continue;
|
|
533869
|
-
const projectDir =
|
|
534054
|
+
const projectDir = join145(projectsDir, projectDirent.name);
|
|
533870
534055
|
let entries;
|
|
533871
534056
|
try {
|
|
533872
534057
|
entries = await fsImpl.readdir(projectDir);
|
|
@@ -533880,15 +534065,15 @@ async function cleanupOldSessionFiles() {
|
|
|
533880
534065
|
continue;
|
|
533881
534066
|
}
|
|
533882
534067
|
try {
|
|
533883
|
-
if (await unlinkIfOld(
|
|
534068
|
+
if (await unlinkIfOld(join145(projectDir, entry.name), cutoffDate, fsImpl)) {
|
|
533884
534069
|
result.messages++;
|
|
533885
534070
|
}
|
|
533886
534071
|
} catch {
|
|
533887
534072
|
result.errors++;
|
|
533888
534073
|
}
|
|
533889
534074
|
} else if (entry.isDirectory()) {
|
|
533890
|
-
const sessionDir =
|
|
533891
|
-
const toolResultsDir =
|
|
534075
|
+
const sessionDir = join145(projectDir, entry.name);
|
|
534076
|
+
const toolResultsDir = join145(sessionDir, TOOL_RESULTS_SUBDIR);
|
|
533892
534077
|
let toolDirs;
|
|
533893
534078
|
try {
|
|
533894
534079
|
toolDirs = await fsImpl.readdir(toolResultsDir);
|
|
@@ -533899,14 +534084,14 @@ async function cleanupOldSessionFiles() {
|
|
|
533899
534084
|
for (const toolEntry of toolDirs) {
|
|
533900
534085
|
if (toolEntry.isFile()) {
|
|
533901
534086
|
try {
|
|
533902
|
-
if (await unlinkIfOld(
|
|
534087
|
+
if (await unlinkIfOld(join145(toolResultsDir, toolEntry.name), cutoffDate, fsImpl)) {
|
|
533903
534088
|
result.messages++;
|
|
533904
534089
|
}
|
|
533905
534090
|
} catch {
|
|
533906
534091
|
result.errors++;
|
|
533907
534092
|
}
|
|
533908
534093
|
} else if (toolEntry.isDirectory()) {
|
|
533909
|
-
const toolDirPath =
|
|
534094
|
+
const toolDirPath = join145(toolResultsDir, toolEntry.name);
|
|
533910
534095
|
let toolFiles;
|
|
533911
534096
|
try {
|
|
533912
534097
|
toolFiles = await fsImpl.readdir(toolDirPath);
|
|
@@ -533917,7 +534102,7 @@ async function cleanupOldSessionFiles() {
|
|
|
533917
534102
|
if (!tf.isFile())
|
|
533918
534103
|
continue;
|
|
533919
534104
|
try {
|
|
533920
|
-
if (await unlinkIfOld(
|
|
534105
|
+
if (await unlinkIfOld(join145(toolDirPath, tf.name), cutoffDate, fsImpl)) {
|
|
533921
534106
|
result.messages++;
|
|
533922
534107
|
}
|
|
533923
534108
|
} catch {
|
|
@@ -533949,7 +534134,7 @@ async function cleanupSingleDirectory(dirPath, extension2, removeEmptyDir = true
|
|
|
533949
534134
|
if (!dirent.isFile() || !dirent.name.endsWith(extension2))
|
|
533950
534135
|
continue;
|
|
533951
534136
|
try {
|
|
533952
|
-
if (await unlinkIfOld(
|
|
534137
|
+
if (await unlinkIfOld(join145(dirPath, dirent.name), cutoffDate, fsImpl)) {
|
|
533953
534138
|
result.messages++;
|
|
533954
534139
|
}
|
|
533955
534140
|
} catch {
|
|
@@ -533962,7 +534147,7 @@ async function cleanupSingleDirectory(dirPath, extension2, removeEmptyDir = true
|
|
|
533962
534147
|
return result;
|
|
533963
534148
|
}
|
|
533964
534149
|
function cleanupOldPlanFiles() {
|
|
533965
|
-
const plansDir =
|
|
534150
|
+
const plansDir = join145(getClaudeConfigHomeDir(), "plans");
|
|
533966
534151
|
return cleanupSingleDirectory(plansDir, ".md");
|
|
533967
534152
|
}
|
|
533968
534153
|
async function cleanupOldFileHistoryBackups() {
|
|
@@ -533971,14 +534156,14 @@ async function cleanupOldFileHistoryBackups() {
|
|
|
533971
534156
|
const fsImpl = getFsImplementation();
|
|
533972
534157
|
try {
|
|
533973
534158
|
const configDir = getClaudeConfigHomeDir();
|
|
533974
|
-
const fileHistoryStorageDir =
|
|
534159
|
+
const fileHistoryStorageDir = join145(configDir, "file-history");
|
|
533975
534160
|
let dirents;
|
|
533976
534161
|
try {
|
|
533977
534162
|
dirents = await fsImpl.readdir(fileHistoryStorageDir);
|
|
533978
534163
|
} catch {
|
|
533979
534164
|
return result;
|
|
533980
534165
|
}
|
|
533981
|
-
const fileHistorySessionsDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) =>
|
|
534166
|
+
const fileHistorySessionsDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) => join145(fileHistoryStorageDir, dirent.name));
|
|
533982
534167
|
await Promise.all(fileHistorySessionsDirs.map(async (fileHistorySessionDir) => {
|
|
533983
534168
|
try {
|
|
533984
534169
|
const stats2 = await fsImpl.stat(fileHistorySessionDir);
|
|
@@ -534005,14 +534190,14 @@ async function cleanupOldSessionEnvDirs() {
|
|
|
534005
534190
|
const fsImpl = getFsImplementation();
|
|
534006
534191
|
try {
|
|
534007
534192
|
const configDir = getClaudeConfigHomeDir();
|
|
534008
|
-
const sessionEnvBaseDir =
|
|
534193
|
+
const sessionEnvBaseDir = join145(configDir, "session-env");
|
|
534009
534194
|
let dirents;
|
|
534010
534195
|
try {
|
|
534011
534196
|
dirents = await fsImpl.readdir(sessionEnvBaseDir);
|
|
534012
534197
|
} catch {
|
|
534013
534198
|
return result;
|
|
534014
534199
|
}
|
|
534015
|
-
const sessionEnvDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) =>
|
|
534200
|
+
const sessionEnvDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) => join145(sessionEnvBaseDir, dirent.name));
|
|
534016
534201
|
for (const sessionEnvDir of sessionEnvDirs) {
|
|
534017
534202
|
try {
|
|
534018
534203
|
const stats2 = await fsImpl.stat(sessionEnvDir);
|
|
@@ -534034,7 +534219,7 @@ async function cleanupOldDebugLogs() {
|
|
|
534034
534219
|
const cutoffDate = getCutoffDate();
|
|
534035
534220
|
const result = { messages: 0, errors: 0 };
|
|
534036
534221
|
const fsImpl = getFsImplementation();
|
|
534037
|
-
const debugDir =
|
|
534222
|
+
const debugDir = join145(getClaudeConfigHomeDir(), "debug");
|
|
534038
534223
|
let dirents;
|
|
534039
534224
|
try {
|
|
534040
534225
|
dirents = await fsImpl.readdir(debugDir);
|
|
@@ -534046,7 +534231,7 @@ async function cleanupOldDebugLogs() {
|
|
|
534046
534231
|
continue;
|
|
534047
534232
|
}
|
|
534048
534233
|
try {
|
|
534049
|
-
if (await unlinkIfOld(
|
|
534234
|
+
if (await unlinkIfOld(join145(debugDir, dirent.name), cutoffDate, fsImpl)) {
|
|
534050
534235
|
result.messages++;
|
|
534051
534236
|
}
|
|
534052
534237
|
} catch {
|
|
@@ -534056,7 +534241,7 @@ async function cleanupOldDebugLogs() {
|
|
|
534056
534241
|
return result;
|
|
534057
534242
|
}
|
|
534058
534243
|
async function cleanupNpmCacheForAnthropicPackages() {
|
|
534059
|
-
const markerPath =
|
|
534244
|
+
const markerPath = join145(getClaudeConfigHomeDir(), ".npm-cache-cleanup");
|
|
534060
534245
|
try {
|
|
534061
534246
|
const stat47 = await fs11.stat(markerPath);
|
|
534062
534247
|
if (Date.now() - stat47.mtimeMs < ONE_DAY_MS) {
|
|
@@ -534071,7 +534256,7 @@ async function cleanupNpmCacheForAnthropicPackages() {
|
|
|
534071
534256
|
return;
|
|
534072
534257
|
}
|
|
534073
534258
|
logForDebugging("npm cache cleanup: starting");
|
|
534074
|
-
const npmCachePath =
|
|
534259
|
+
const npmCachePath = join145(homedir37(), ".npm", "_cacache");
|
|
534075
534260
|
const NPM_CACHE_RETENTION_COUNT = 5;
|
|
534076
534261
|
const startTime = Date.now();
|
|
534077
534262
|
try {
|
|
@@ -534126,7 +534311,7 @@ async function cleanupNpmCacheForAnthropicPackages() {
|
|
|
534126
534311
|
}
|
|
534127
534312
|
}
|
|
534128
534313
|
async function cleanupOldVersionsThrottled() {
|
|
534129
|
-
const markerPath =
|
|
534314
|
+
const markerPath = join145(getClaudeConfigHomeDir(), ".version-cleanup");
|
|
534130
534315
|
try {
|
|
534131
534316
|
const stat47 = await fs11.stat(markerPath);
|
|
534132
534317
|
if (Date.now() - stat47.mtimeMs < ONE_DAY_MS) {
|
|
@@ -537356,8 +537541,8 @@ __export(exports_asciicast, {
|
|
|
537356
537541
|
flushAsciicastRecorder: () => flushAsciicastRecorder,
|
|
537357
537542
|
_resetRecordingStateForTesting: () => _resetRecordingStateForTesting
|
|
537358
537543
|
});
|
|
537359
|
-
import { appendFile as
|
|
537360
|
-
import { basename as basename57, dirname as dirname60, join as
|
|
537544
|
+
import { appendFile as appendFile7, rename as rename10 } from "fs/promises";
|
|
537545
|
+
import { basename as basename57, dirname as dirname60, join as join147 } from "path";
|
|
537361
537546
|
function getRecordFilePath() {
|
|
537362
537547
|
if (recordingState.filePath !== null) {
|
|
537363
537548
|
return recordingState.filePath;
|
|
@@ -537368,10 +537553,10 @@ function getRecordFilePath() {
|
|
|
537368
537553
|
if (!isEnvTruthy(process.env.CLAUDE_CODE_TERMINAL_RECORDING)) {
|
|
537369
537554
|
return null;
|
|
537370
537555
|
}
|
|
537371
|
-
const projectsDir =
|
|
537372
|
-
const projectDir =
|
|
537556
|
+
const projectsDir = join147(getClaudeConfigHomeDir(), "projects");
|
|
537557
|
+
const projectDir = join147(projectsDir, sanitizePath2(getOriginalCwd()));
|
|
537373
537558
|
recordingState.timestamp = Date.now();
|
|
537374
|
-
recordingState.filePath =
|
|
537559
|
+
recordingState.filePath = join147(projectDir, `${getSessionId()}-${recordingState.timestamp}.cast`);
|
|
537375
537560
|
return recordingState.filePath;
|
|
537376
537561
|
}
|
|
537377
537562
|
function _resetRecordingStateForTesting() {
|
|
@@ -537380,13 +537565,13 @@ function _resetRecordingStateForTesting() {
|
|
|
537380
537565
|
}
|
|
537381
537566
|
function getSessionRecordingPaths() {
|
|
537382
537567
|
const sessionId = getSessionId();
|
|
537383
|
-
const projectsDir =
|
|
537384
|
-
const projectDir =
|
|
537568
|
+
const projectsDir = join147(getClaudeConfigHomeDir(), "projects");
|
|
537569
|
+
const projectDir = join147(projectsDir, sanitizePath2(getOriginalCwd()));
|
|
537385
537570
|
try {
|
|
537386
537571
|
const entries = getFsImplementation().readdirSync(projectDir);
|
|
537387
537572
|
const names = typeof entries[0] === "string" ? entries : entries.map((e) => e.name);
|
|
537388
537573
|
const files3 = names.filter((f) => f.startsWith(sessionId) && f.endsWith(".cast")).sort();
|
|
537389
|
-
return files3.map((f) =>
|
|
537574
|
+
return files3.map((f) => join147(projectDir, f));
|
|
537390
537575
|
} catch {
|
|
537391
537576
|
return [];
|
|
537392
537577
|
}
|
|
@@ -537396,9 +537581,9 @@ async function renameRecordingForSession() {
|
|
|
537396
537581
|
if (!oldPath || recordingState.timestamp === 0) {
|
|
537397
537582
|
return;
|
|
537398
537583
|
}
|
|
537399
|
-
const projectsDir =
|
|
537400
|
-
const projectDir =
|
|
537401
|
-
const newPath =
|
|
537584
|
+
const projectsDir = join147(getClaudeConfigHomeDir(), "projects");
|
|
537585
|
+
const projectDir = join147(projectsDir, sanitizePath2(getOriginalCwd()));
|
|
537586
|
+
const newPath = join147(projectDir, `${getSessionId()}-${recordingState.timestamp}.cast`);
|
|
537402
537587
|
if (oldPath === newPath) {
|
|
537403
537588
|
return;
|
|
537404
537589
|
}
|
|
@@ -537450,7 +537635,7 @@ function installAsciicastRecorder() {
|
|
|
537450
537635
|
if (!currentPath) {
|
|
537451
537636
|
return;
|
|
537452
537637
|
}
|
|
537453
|
-
pendingWrite2 = pendingWrite2.then(() =>
|
|
537638
|
+
pendingWrite2 = pendingWrite2.then(() => appendFile7(currentPath, content)).catch(() => {});
|
|
537454
537639
|
},
|
|
537455
537640
|
flushIntervalMs: 500,
|
|
537456
537641
|
maxBufferSize: 50,
|
|
@@ -540286,7 +540471,7 @@ var init_useChromeExtensionNotification = __esm(() => {
|
|
|
540286
540471
|
});
|
|
540287
540472
|
|
|
540288
540473
|
// src/utils/plugins/officialMarketplaceStartupCheck.ts
|
|
540289
|
-
import { join as
|
|
540474
|
+
import { join as join148 } from "path";
|
|
540290
540475
|
function isOfficialMarketplaceAutoInstallDisabled() {
|
|
540291
540476
|
return isEnvTruthy(process.env.CLAUDE_CODE_DISABLE_OFFICIAL_MARKETPLACE_AUTOINSTALL);
|
|
540292
540477
|
}
|
|
@@ -540369,7 +540554,7 @@ async function checkAndInstallOfficialMarketplace() {
|
|
|
540369
540554
|
return { installed: false, skipped: true, reason: "policy_blocked" };
|
|
540370
540555
|
}
|
|
540371
540556
|
const cacheDir = getMarketplacesCacheDir();
|
|
540372
|
-
const installLocation =
|
|
540557
|
+
const installLocation = join148(cacheDir, OFFICIAL_MARKETPLACE_NAME);
|
|
540373
540558
|
const gcsSha = await fetchOfficialMarketplaceFromGcs(installLocation, cacheDir);
|
|
540374
540559
|
if (gcsSha !== null) {
|
|
540375
540560
|
const known = await loadKnownMarketplacesConfig();
|
|
@@ -543390,7 +543575,7 @@ var init_usePluginRecommendationBase = __esm(() => {
|
|
|
543390
543575
|
});
|
|
543391
543576
|
|
|
543392
543577
|
// src/hooks/useLspPluginRecommendation.tsx
|
|
543393
|
-
import { extname as extname16, join as
|
|
543578
|
+
import { extname as extname16, join as join149 } from "path";
|
|
543394
543579
|
function useLspPluginRecommendation() {
|
|
543395
543580
|
const $3 = import_compiler_runtime355.c(12);
|
|
543396
543581
|
const trackedFiles = useAppState(_temp234);
|
|
@@ -543475,7 +543660,7 @@ function useLspPluginRecommendation() {
|
|
|
543475
543660
|
case "yes": {
|
|
543476
543661
|
installPluginAndNotify(pluginId, pluginName, "lsp-plugin", addNotification, async (pluginData) => {
|
|
543477
543662
|
logForDebugging(`[useLspPluginRecommendation] Installing plugin: ${pluginId}`);
|
|
543478
|
-
const localSourcePath = typeof pluginData.entry.source === "string" ?
|
|
543663
|
+
const localSourcePath = typeof pluginData.entry.source === "string" ? join149(pluginData.marketplaceInstallLocation, pluginData.entry.source) : undefined;
|
|
543479
543664
|
await cacheAndRegisterPlugin(pluginId, pluginData.entry, "user", undefined, localSourcePath);
|
|
543480
543665
|
const settings = getSettingsForSource("userSettings");
|
|
543481
543666
|
updateSettingsForSource("userSettings", {
|
|
@@ -546295,7 +546480,7 @@ var exports_REPL = {};
|
|
|
546295
546480
|
__export(exports_REPL, {
|
|
546296
546481
|
REPL: () => REPL
|
|
546297
546482
|
});
|
|
546298
|
-
import { dirname as dirname62, join as
|
|
546483
|
+
import { dirname as dirname62, join as join150 } from "path";
|
|
546299
546484
|
import { tmpdir as tmpdir14 } from "os";
|
|
546300
546485
|
import { writeFile as writeFile44 } from "fs/promises";
|
|
546301
546486
|
import { randomUUID as randomUUID45 } from "crypto";
|
|
@@ -548907,7 +549092,7 @@ Note: ctrl + z now suspends myclaude, ctrl + _ undoes input.
|
|
|
548907
549092
|
const w2 = Math.max(80, (process.stdout.columns ?? 80) - 6);
|
|
548908
549093
|
const raw = await renderMessagesToPlainText(deferredMessages, tools, w2);
|
|
548909
549094
|
const text2 = raw.replace(/[ \t]+$/gm, "");
|
|
548910
|
-
const path24 =
|
|
549095
|
+
const path24 = join150(tmpdir14(), `cc-transcript-${Date.now()}.txt`);
|
|
548911
549096
|
await writeFile44(path24, text2);
|
|
548912
549097
|
const opened = openFileInExternalEditor(path24);
|
|
548913
549098
|
setStatus(opened ? `opening ${path24}` : `wrote ${path24} · no $VISUAL/$EDITOR set`);
|
|
@@ -554886,16 +555071,16 @@ var init_codegraphCheck = __esm(() => {
|
|
|
554886
555071
|
|
|
554887
555072
|
// src/plugins/bundled/eccBuiltin.ts
|
|
554888
555073
|
import { readdirSync as readdirSync6, readFileSync as readFileSync18, existsSync as existsSync11 } from "fs";
|
|
554889
|
-
import { join as
|
|
555074
|
+
import { join as join151, dirname as dirname64, basename as basename58, extname as extname17 } from "path";
|
|
554890
555075
|
import { fileURLToPath as fileURLToPath9 } from "url";
|
|
554891
555076
|
function resolveSeedDir() {
|
|
554892
555077
|
if (process.env.CLAUDE_CODE_PLUGIN_SEED_DIR) {
|
|
554893
555078
|
return process.env.CLAUDE_CODE_PLUGIN_SEED_DIR;
|
|
554894
555079
|
}
|
|
554895
|
-
const candidate =
|
|
555080
|
+
const candidate = join151(__dirname3, "..", "..", "..", "seed");
|
|
554896
555081
|
if (existsSync11(candidate))
|
|
554897
555082
|
return candidate;
|
|
554898
|
-
const bundleCandidate =
|
|
555083
|
+
const bundleCandidate = join151(__dirname3, "..", "seed");
|
|
554899
555084
|
if (existsSync11(bundleCandidate))
|
|
554900
555085
|
return bundleCandidate;
|
|
554901
555086
|
return candidate;
|
|
@@ -554931,9 +555116,9 @@ var init_eccBuiltin = __esm(() => {
|
|
|
554931
555116
|
__filename3 = fileURLToPath9(import.meta.url);
|
|
554932
555117
|
__dirname3 = dirname64(__filename3);
|
|
554933
555118
|
SEED_DIR = resolveSeedDir();
|
|
554934
|
-
ECC_DIR =
|
|
554935
|
-
ECC_COMMANDS_DIR =
|
|
554936
|
-
ECC_SKILLS_DIR =
|
|
555119
|
+
ECC_DIR = join151(SEED_DIR, "marketplaces", "ecc");
|
|
555120
|
+
ECC_COMMANDS_DIR = join151(ECC_DIR, "commands");
|
|
555121
|
+
ECC_SKILLS_DIR = join151(ECC_DIR, "skills");
|
|
554937
555122
|
try {
|
|
554938
555123
|
if (!existsSync11(ECC_DIR)) {
|
|
554939
555124
|
process._ecc_registered = 0;
|
|
@@ -554945,15 +555130,15 @@ var init_eccBuiltin = __esm(() => {
|
|
|
554945
555130
|
if (extname17(file2) !== ".md")
|
|
554946
555131
|
continue;
|
|
554947
555132
|
const name = basename58(file2, ".md");
|
|
554948
|
-
const content = readFileSync18(
|
|
554949
|
-
registerMarkdownSkill(name,
|
|
555133
|
+
const content = readFileSync18(join151(ECC_COMMANDS_DIR, file2), "utf-8");
|
|
555134
|
+
registerMarkdownSkill(name, join151(ECC_COMMANDS_DIR, file2), content, "Custom command");
|
|
554950
555135
|
count4++;
|
|
554951
555136
|
}
|
|
554952
555137
|
}
|
|
554953
555138
|
if (existsSync11(ECC_SKILLS_DIR)) {
|
|
554954
555139
|
const dirs = readdirSync6(ECC_SKILLS_DIR);
|
|
554955
555140
|
for (const dir of dirs) {
|
|
554956
|
-
const skillFile =
|
|
555141
|
+
const skillFile = join151(ECC_SKILLS_DIR, dir, "SKILL.md");
|
|
554957
555142
|
if (!existsSync11(skillFile))
|
|
554958
555143
|
continue;
|
|
554959
555144
|
const content = readFileSync18(skillFile, "utf-8");
|
|
@@ -556181,7 +556366,7 @@ ${args}`;
|
|
|
556181
556366
|
}
|
|
556182
556367
|
});
|
|
556183
556368
|
}
|
|
556184
|
-
var
|
|
556369
|
+
var init_remember2 = __esm(() => {
|
|
556185
556370
|
init_paths();
|
|
556186
556371
|
init_bundledSkills();
|
|
556187
556372
|
});
|
|
@@ -557089,7 +557274,7 @@ var init_bundled2 = __esm(() => {
|
|
|
557089
557274
|
init_debug2();
|
|
557090
557275
|
init_keybindings3();
|
|
557091
557276
|
init_loremIpsum();
|
|
557092
|
-
|
|
557277
|
+
init_remember2();
|
|
557093
557278
|
init_simplify();
|
|
557094
557279
|
init_skillify();
|
|
557095
557280
|
init_stuck();
|
|
@@ -557298,6 +557483,7 @@ Warning: The command "${actualCommand}" looks like a URL, but is being interpret
|
|
|
557298
557483
|
} catch (error49) {
|
|
557299
557484
|
cliError(error49.message);
|
|
557300
557485
|
}
|
|
557486
|
+
checkOnMcpAdd();
|
|
557301
557487
|
});
|
|
557302
557488
|
}
|
|
557303
557489
|
var init_addCommand = __esm(() => {
|
|
@@ -557309,6 +557495,7 @@ var init_addCommand = __esm(() => {
|
|
|
557309
557495
|
init_xaaIdpLogin();
|
|
557310
557496
|
init_envUtils();
|
|
557311
557497
|
init_slowOperations();
|
|
557498
|
+
init_checker();
|
|
557312
557499
|
});
|
|
557313
557500
|
|
|
557314
557501
|
// src/commands/mcp/xaaIdpCommand.ts
|
|
@@ -557801,12 +557988,12 @@ var init_createDirectConnectSession = __esm(() => {
|
|
|
557801
557988
|
});
|
|
557802
557989
|
|
|
557803
557990
|
// src/utils/errorLogSink.ts
|
|
557804
|
-
import { dirname as dirname65, join as
|
|
557991
|
+
import { dirname as dirname65, join as join152 } from "path";
|
|
557805
557992
|
function getErrorsPath() {
|
|
557806
|
-
return
|
|
557993
|
+
return join152(CACHE_PATHS.errors(), DATE + ".jsonl");
|
|
557807
557994
|
}
|
|
557808
557995
|
function getMCPLogsPath(serverName) {
|
|
557809
|
-
return
|
|
557996
|
+
return join152(CACHE_PATHS.mcpLogs(serverName), DATE + ".jsonl");
|
|
557810
557997
|
}
|
|
557811
557998
|
function createJsonlWriter(options) {
|
|
557812
557999
|
const writer = createBufferedWriter(options);
|
|
@@ -558149,7 +558336,7 @@ var init_sessionMemory = __esm(() => {
|
|
|
558149
558336
|
// src/utils/iTermBackup.ts
|
|
558150
558337
|
import { copyFile as copyFile12, stat as stat49 } from "fs/promises";
|
|
558151
558338
|
import { homedir as homedir39 } from "os";
|
|
558152
|
-
import { join as
|
|
558339
|
+
import { join as join153 } from "path";
|
|
558153
558340
|
function markITerm2SetupComplete() {
|
|
558154
558341
|
saveGlobalConfig((current) => ({
|
|
558155
558342
|
...current,
|
|
@@ -558164,7 +558351,7 @@ function getIterm2RecoveryInfo() {
|
|
|
558164
558351
|
};
|
|
558165
558352
|
}
|
|
558166
558353
|
function getITerm2PlistPath() {
|
|
558167
|
-
return
|
|
558354
|
+
return join153(homedir39(), "Library", "Preferences", "com.googlecode.iterm2.plist");
|
|
558168
558355
|
}
|
|
558169
558356
|
async function checkAndRestoreITerm2Backup() {
|
|
558170
558357
|
const { inProgress, backupPath } = getIterm2RecoveryInfo();
|
|
@@ -561528,8 +561715,8 @@ var init_idleTimeout = __esm(() => {
|
|
|
561528
561715
|
|
|
561529
561716
|
// src/bridge/inboundAttachments.ts
|
|
561530
561717
|
import { randomUUID as randomUUID48 } from "crypto";
|
|
561531
|
-
import { mkdir as
|
|
561532
|
-
import { basename as basename59, join as
|
|
561718
|
+
import { mkdir as mkdir43, writeFile as writeFile46 } from "fs/promises";
|
|
561719
|
+
import { basename as basename59, join as join154 } from "path";
|
|
561533
561720
|
function debug3(msg) {
|
|
561534
561721
|
logForDebugging(`[bridge:inbound-attach] ${msg}`);
|
|
561535
561722
|
}
|
|
@@ -561545,7 +561732,7 @@ function sanitizeFileName(name) {
|
|
|
561545
561732
|
return base2 || "attachment";
|
|
561546
561733
|
}
|
|
561547
561734
|
function uploadsDir() {
|
|
561548
|
-
return
|
|
561735
|
+
return join154(getClaudeConfigHomeDir(), "uploads", getSessionId());
|
|
561549
561736
|
}
|
|
561550
561737
|
async function resolveOne(att) {
|
|
561551
561738
|
const token = getBridgeAccessToken();
|
|
@@ -561574,9 +561761,9 @@ async function resolveOne(att) {
|
|
|
561574
561761
|
const safeName = sanitizeFileName(att.file_name);
|
|
561575
561762
|
const prefix = (att.file_uuid.slice(0, 8) || randomUUID48().slice(0, 8)).replace(/[^a-zA-Z0-9_-]/g, "_");
|
|
561576
561763
|
const dir = uploadsDir();
|
|
561577
|
-
const outPath =
|
|
561764
|
+
const outPath = join154(dir, `${prefix}-${safeName}`);
|
|
561578
561765
|
try {
|
|
561579
|
-
await
|
|
561766
|
+
await mkdir43(dir, { recursive: true });
|
|
561580
561767
|
await writeFile46(outPath, data);
|
|
561581
561768
|
} catch (e) {
|
|
561582
561769
|
debug3(`write ${outPath} failed: ${e}`);
|
|
@@ -561674,7 +561861,7 @@ var init_sessionUrl = __esm(() => {
|
|
|
561674
561861
|
|
|
561675
561862
|
// src/utils/plugins/zipCacheAdapters.ts
|
|
561676
561863
|
import { readFile as readFile51 } from "fs/promises";
|
|
561677
|
-
import { join as
|
|
561864
|
+
import { join as join155 } from "path";
|
|
561678
561865
|
async function readZipCacheKnownMarketplaces() {
|
|
561679
561866
|
try {
|
|
561680
561867
|
const content = await readFile51(getZipCacheKnownMarketplacesPath(), "utf-8");
|
|
@@ -561699,13 +561886,13 @@ async function saveMarketplaceJsonToZipCache(marketplaceName, installLocation) {
|
|
|
561699
561886
|
const content = await readMarketplaceJsonContent(installLocation);
|
|
561700
561887
|
if (content !== null) {
|
|
561701
561888
|
const relPath = getMarketplaceJsonRelativePath(marketplaceName);
|
|
561702
|
-
await atomicWriteToZipCache(
|
|
561889
|
+
await atomicWriteToZipCache(join155(zipCachePath, relPath), content);
|
|
561703
561890
|
}
|
|
561704
561891
|
}
|
|
561705
561892
|
async function readMarketplaceJsonContent(dir) {
|
|
561706
561893
|
const candidates = [
|
|
561707
|
-
|
|
561708
|
-
|
|
561894
|
+
join155(dir, ".claude-plugin", "marketplace.json"),
|
|
561895
|
+
join155(dir, "marketplace.json"),
|
|
561709
561896
|
dir
|
|
561710
561897
|
];
|
|
561711
561898
|
for (const candidate of candidates) {
|
|
@@ -562163,15 +562350,15 @@ __export(exports_bridgePointer, {
|
|
|
562163
562350
|
clearBridgePointer: () => clearBridgePointer,
|
|
562164
562351
|
BRIDGE_POINTER_TTL_MS: () => BRIDGE_POINTER_TTL_MS
|
|
562165
562352
|
});
|
|
562166
|
-
import { mkdir as
|
|
562167
|
-
import { dirname as dirname66, join as
|
|
562353
|
+
import { mkdir as mkdir44, readFile as readFile52, stat as stat50, unlink as unlink22, writeFile as writeFile47 } from "fs/promises";
|
|
562354
|
+
import { dirname as dirname66, join as join156 } from "path";
|
|
562168
562355
|
function getBridgePointerPath(dir) {
|
|
562169
|
-
return
|
|
562356
|
+
return join156(getProjectsDir(), sanitizePath2(dir), "bridge-pointer.json");
|
|
562170
562357
|
}
|
|
562171
562358
|
async function writeBridgePointer(dir, pointer) {
|
|
562172
562359
|
const path24 = getBridgePointerPath(dir);
|
|
562173
562360
|
try {
|
|
562174
|
-
await
|
|
562361
|
+
await mkdir44(dirname66(path24), { recursive: true });
|
|
562175
562362
|
await writeFile47(path24, jsonStringify(pointer), "utf8");
|
|
562176
562363
|
logForDebugging(`[bridge:pointer] wrote ${path24}`);
|
|
562177
562364
|
} catch (err2) {
|
|
@@ -564893,6 +565080,7 @@ function runHeadlessStreaming(structuredIO, mcpClients, commands, tools, initial
|
|
|
564893
565080
|
const scheduleProactiveTick = undefined;
|
|
564894
565081
|
subscribeToCommandQueue(() => {
|
|
564895
565082
|
if (abortController && getCommandsByMaxPriority("now").length > 0) {
|
|
565083
|
+
logForDebugging("[print.ts] Interrupting turn due to priority command");
|
|
564896
565084
|
abortController.abort("interrupt");
|
|
564897
565085
|
}
|
|
564898
565086
|
});
|
|
@@ -566058,6 +566246,7 @@ ${m2.text}
|
|
|
566058
566246
|
structuredIO.injectControlResponse(response);
|
|
566059
566247
|
},
|
|
566060
566248
|
onInterrupt() {
|
|
566249
|
+
logForDebugging("[print.ts] Turn interrupted via bridge onInterrupt");
|
|
566061
566250
|
abortController?.abort();
|
|
566062
566251
|
},
|
|
566063
566252
|
onSetModel(model) {
|
|
@@ -568103,14 +568292,14 @@ __export(exports_claudeDesktop, {
|
|
|
568103
568292
|
});
|
|
568104
568293
|
import { readdir as readdir30, readFile as readFile54, stat as stat52 } from "fs/promises";
|
|
568105
568294
|
import { homedir as homedir40 } from "os";
|
|
568106
|
-
import { join as
|
|
568295
|
+
import { join as join157 } from "path";
|
|
568107
568296
|
async function getClaudeDesktopConfigPath() {
|
|
568108
568297
|
const platform6 = getPlatform();
|
|
568109
568298
|
if (!SUPPORTED_PLATFORMS.includes(platform6)) {
|
|
568110
568299
|
throw new Error(`Unsupported platform: ${platform6} - Claude Desktop integration only works on macOS and WSL.`);
|
|
568111
568300
|
}
|
|
568112
568301
|
if (platform6 === "macos") {
|
|
568113
|
-
return
|
|
568302
|
+
return join157(homedir40(), "Library", "Application Support", "Claude", "claude_desktop_config.json");
|
|
568114
568303
|
}
|
|
568115
568304
|
const windowsHome = process.env.USERPROFILE ? process.env.USERPROFILE.replace(/\\/g, "/") : null;
|
|
568116
568305
|
if (windowsHome) {
|
|
@@ -568129,7 +568318,7 @@ async function getClaudeDesktopConfigPath() {
|
|
|
568129
568318
|
if (user.name === "Public" || user.name === "Default" || user.name === "Default User" || user.name === "All Users") {
|
|
568130
568319
|
continue;
|
|
568131
568320
|
}
|
|
568132
|
-
const potentialConfigPath =
|
|
568321
|
+
const potentialConfigPath = join157(usersDir, user.name, "AppData", "Roaming", "Claude", "claude_desktop_config.json");
|
|
568133
568322
|
try {
|
|
568134
568323
|
await stat52(potentialConfigPath);
|
|
568135
568324
|
return potentialConfigPath;
|
|
@@ -569038,12 +569227,12 @@ __export(exports_install, {
|
|
|
569038
569227
|
install: () => install
|
|
569039
569228
|
});
|
|
569040
569229
|
import { homedir as homedir41 } from "node:os";
|
|
569041
|
-
import { join as
|
|
569230
|
+
import { join as join158 } from "node:path";
|
|
569042
569231
|
function getInstallationPath2() {
|
|
569043
569232
|
const isWindows2 = env4.platform === "win32";
|
|
569044
569233
|
const homeDir = homedir41();
|
|
569045
569234
|
if (isWindows2) {
|
|
569046
|
-
const windowsPath =
|
|
569235
|
+
const windowsPath = join158(homeDir, ".local", "bin", "claude.exe");
|
|
569047
569236
|
return windowsPath.replace(/\//g, "\\");
|
|
569048
569237
|
}
|
|
569049
569238
|
return "~/.local/bin/claude";
|
|
@@ -569937,7 +570126,7 @@ __export(exports_main, {
|
|
|
569937
570126
|
main: () => main
|
|
569938
570127
|
});
|
|
569939
570128
|
import { readFileSync as readFileSync19 } from "fs";
|
|
569940
|
-
import { resolve as resolve46, join as
|
|
570129
|
+
import { resolve as resolve46, join as join159, dirname as dirname69 } from "path";
|
|
569941
570130
|
import { fileURLToPath as fileURLToPath10 } from "url";
|
|
569942
570131
|
import { existsSync as existsSync12 } from "fs";
|
|
569943
570132
|
function logManagedSettings() {
|
|
@@ -572407,7 +572596,7 @@ var init_main3 = __esm(() => {
|
|
|
572407
572596
|
if (!process.env.CLAUDE_CODE_PLUGIN_SEED_DIR) {
|
|
572408
572597
|
const __filename_main = fileURLToPath10(import.meta.url);
|
|
572409
572598
|
const __dirname_main = dirname69(__filename_main);
|
|
572410
|
-
const candidateSeed =
|
|
572599
|
+
const candidateSeed = join159(__dirname_main, "..", "seed");
|
|
572411
572600
|
if (existsSync12(candidateSeed)) {
|
|
572412
572601
|
process.env.CLAUDE_CODE_PLUGIN_SEED_DIR = candidateSeed;
|
|
572413
572602
|
}
|