@opencow-ai/opencow-agent-sdk 0.4.22 → 0.4.23
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/capabilities/lsp/LSPServerManager.d.ts +2 -1
- package/dist/capabilities/mcp/types.d.ts +3 -3
- package/dist/capabilities/plugins/loadPluginAgents.d.ts +6 -0
- package/dist/capabilities/plugins/loadPluginCommands.d.ts +10 -0
- package/dist/capabilities/plugins/loadPluginHooks.d.ts +5 -0
- package/dist/capabilities/plugins/loadPluginOutputStyles.d.ts +6 -0
- package/dist/capabilities/plugins/lspPluginIntegration.d.ts +1 -0
- package/dist/capabilities/plugins/mcpPluginIntegration.d.ts +1 -0
- package/dist/capabilities/plugins/pluginOptionsStorage.d.ts +1 -0
- package/dist/capabilities/plugins/schemas.d.ts +4 -4
- package/dist/capabilities/plugins/sdkPluginRuntime.d.ts +35 -0
- package/dist/capabilities/todo/types.d.ts +2 -2
- package/dist/capabilities/tools/AgentTool/AgentTool.d.ts +8 -8
- package/dist/capabilities/tools/AgentTool/inputSchema.d.ts +3 -3
- package/dist/capabilities/tools/AgentTool/loadAgentsDir.d.ts +1 -0
- package/dist/capabilities/tools/TodoWriteTool/TodoWriteTool.d.ts +10 -10
- package/dist/cli.mjs +546 -333
- package/dist/client.d.ts +2 -0
- package/dist/client.js +5992 -819
- package/dist/entrypoints/sdk/controlSchemas.d.ts +139 -139
- package/dist/entrypoints/sdk/coreSchemas.d.ts +57 -57
- package/dist/entrypoints/sdk/runtimeTypes.d.ts +82 -1
- package/dist/permissions/PermissionMode.d.ts +2 -2
- package/dist/permissions/PermissionPromptToolResultSchema.d.ts +1 -1
- package/dist/permissions/PermissionUpdateSchema.d.ts +1 -1
- package/dist/providers/anthropic/teleport/api.d.ts +3 -3
- package/dist/sdk.js +5992 -819
- package/dist/session/layout/schemas.d.ts +12 -12
- package/dist/session/settings/types.d.ts +3 -3
- package/dist/session/state/index.d.ts +1 -1
- package/dist/session/state/registries.d.ts +4 -0
- package/dist/session/state/types.d.ts +4 -0
- package/dist/session/tasks.d.ts +2 -2
- package/dist/session/teammateMailbox.d.ts +2 -2
- package/dist/types/command.d.ts +2 -0
- package/dist/types/plugin.d.ts +2 -0
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -33074,7 +33074,10 @@ var init_schemas3 = __esm(() => {
|
|
|
33074
33074
|
NO_AUTO_UPDATE_OFFICIAL_MARKETPLACES = new Set(["knowledge-work-plugins"]);
|
|
33075
33075
|
BLOCKED_OFFICIAL_NAME_PATTERN = /(?:official[^a-z0-9]*(anthropic|claude)|(?:anthropic|claude)[^a-z0-9]*official|^(?:anthropic|claude)[^a-z0-9]*(marketplace|plugins|official))/i;
|
|
33076
33076
|
NON_ASCII_PATTERN = /[^\u0020-\u007E]/;
|
|
33077
|
-
RelativePath = lazySchema(() => exports_external.string().
|
|
33077
|
+
RelativePath = lazySchema(() => exports_external.string().min(1).refine((path9) => {
|
|
33078
|
+
const normalized = path9.replaceAll("\\", "/");
|
|
33079
|
+
return !normalized.includes("\x00") && !normalized.startsWith("/") && !/^[a-z][a-z0-9+.-]*:/i.test(normalized) && normalized.split("/").every((segment) => segment !== "..");
|
|
33080
|
+
}, "Path must be relative and remain within the plugin root"));
|
|
33078
33081
|
RelativeJSONPath = lazySchema(() => RelativePath().endsWith(".json"));
|
|
33079
33082
|
McpbPath = lazySchema(() => exports_external.union([
|
|
33080
33083
|
RelativePath().refine((path9) => path9.endsWith(".mcpb") || path9.endsWith(".dxt"), {
|
|
@@ -88740,7 +88743,11 @@ function buildQueryContextFromSdk(options) {
|
|
|
88740
88743
|
agentColorIndex: 0,
|
|
88741
88744
|
systemPromptSectionCache: new Map,
|
|
88742
88745
|
cachedClaudeMdContent: null,
|
|
88743
|
-
settingsCache: {
|
|
88746
|
+
settingsCache: {
|
|
88747
|
+
session: null,
|
|
88748
|
+
perSource: new Map,
|
|
88749
|
+
parseFile: new Map
|
|
88750
|
+
},
|
|
88744
88751
|
memoryExtractionState: {
|
|
88745
88752
|
config: {
|
|
88746
88753
|
minimumMessageTokensToInit: 1e4,
|
|
@@ -88761,7 +88768,9 @@ function buildQueryContextFromSdk(options) {
|
|
|
88761
88768
|
conditional: new Map,
|
|
88762
88769
|
activatedConditional: new Set,
|
|
88763
88770
|
loaded: createSignal()
|
|
88764
|
-
}
|
|
88771
|
+
},
|
|
88772
|
+
pluginDataPaths: new Map,
|
|
88773
|
+
lspManager: null
|
|
88765
88774
|
},
|
|
88766
88775
|
diagnostics: createFreshDiagnostics(),
|
|
88767
88776
|
provider: options.provider ?? resolveProviderFromEnv(freezeEnvMap(options.env)),
|
|
@@ -89425,6 +89434,25 @@ function resetSdkInitState() {
|
|
|
89425
89434
|
r.initJsonSchema = null;
|
|
89426
89435
|
r.registeredHooks = null;
|
|
89427
89436
|
}
|
|
89437
|
+
function setExplicitPluginRuntimeContext(dataPaths, lspManager) {
|
|
89438
|
+
const registries2 = getQueryContext().registries;
|
|
89439
|
+
registries2.pluginDataPaths = new Map(dataPaths);
|
|
89440
|
+
registries2.lspManager = lspManager;
|
|
89441
|
+
}
|
|
89442
|
+
function tryGetExplicitPluginDataPath(pluginId) {
|
|
89443
|
+
try {
|
|
89444
|
+
return getQueryContext().registries.pluginDataPaths.get(pluginId);
|
|
89445
|
+
} catch {
|
|
89446
|
+
return;
|
|
89447
|
+
}
|
|
89448
|
+
}
|
|
89449
|
+
function tryGetSessionLspManager() {
|
|
89450
|
+
try {
|
|
89451
|
+
return getQueryContext().registries.lspManager ?? undefined;
|
|
89452
|
+
} catch {
|
|
89453
|
+
return;
|
|
89454
|
+
}
|
|
89455
|
+
}
|
|
89428
89456
|
function addInvokedSkill(skillName, skillPath, content, agentId = null) {
|
|
89429
89457
|
const key = `${agentId ?? ""}:${skillName}`;
|
|
89430
89458
|
getQueryContext().registries.invokedSkills.set(key, {
|
|
@@ -89876,6 +89904,7 @@ __export(exports_state, {
|
|
|
89876
89904
|
setCwdState: () => setCwdState,
|
|
89877
89905
|
setDirectConnectServerUrl: () => setDirectConnectServerUrl,
|
|
89878
89906
|
setEnvVar: () => setEnvVar,
|
|
89907
|
+
setExplicitPluginRuntimeContext: () => setExplicitPluginRuntimeContext,
|
|
89879
89908
|
setFastModeHeaderLatched: () => setFastModeHeaderLatched,
|
|
89880
89909
|
setFlagSettingsInline: () => setFlagSettingsInline,
|
|
89881
89910
|
setHasDevChannels: () => setHasDevChannels,
|
|
@@ -89910,7 +89939,9 @@ __export(exports_state, {
|
|
|
89910
89939
|
setThinkingClearLatched: () => setThinkingClearLatched,
|
|
89911
89940
|
snapshotOutputTokensForTurn: () => snapshotOutputTokensForTurn,
|
|
89912
89941
|
switchSession: () => switchSession,
|
|
89942
|
+
tryGetExplicitPluginDataPath: () => tryGetExplicitPluginDataPath,
|
|
89913
89943
|
tryGetQueryContext: () => tryGetQueryContext,
|
|
89944
|
+
tryGetSessionLspManager: () => tryGetSessionLspManager,
|
|
89914
89945
|
unregisterCreatedTeam: () => unregisterCreatedTeam
|
|
89915
89946
|
});
|
|
89916
89947
|
var init_state = __esm(() => {
|
|
@@ -92241,9 +92272,7 @@ function createBootQueryContext() {
|
|
|
92241
92272
|
resolvedCwd = "";
|
|
92242
92273
|
}
|
|
92243
92274
|
const sessionId = randomUUID3();
|
|
92244
|
-
const {
|
|
92245
|
-
computeSessionPaths: computeSessionPaths2
|
|
92246
|
-
} = (init_paths(), __toCommonJS(exports_paths));
|
|
92275
|
+
const { computeSessionPaths: computeSessionPaths2 } = (init_paths(), __toCommonJS(exports_paths));
|
|
92247
92276
|
const { resolveLayoutProfile: resolveLayoutProfile2, DEFAULT_LAYOUT_PROFILE: DEFAULT_LAYOUT_PROFILE2 } = (init_LayoutProfile(), __toCommonJS(exports_LayoutProfile));
|
|
92248
92277
|
const { getManagedFilePath: getManagedFilePath2 } = (init_managedPath(), __toCommonJS(exports_managedPath));
|
|
92249
92278
|
const { homedir: homedir11 } = __require("node:os");
|
|
@@ -92323,7 +92352,11 @@ function createBootQueryContext() {
|
|
|
92323
92352
|
agentColorIndex: 0,
|
|
92324
92353
|
systemPromptSectionCache: new Map,
|
|
92325
92354
|
cachedClaudeMdContent: null,
|
|
92326
|
-
settingsCache: {
|
|
92355
|
+
settingsCache: {
|
|
92356
|
+
session: null,
|
|
92357
|
+
perSource: new Map,
|
|
92358
|
+
parseFile: new Map
|
|
92359
|
+
},
|
|
92327
92360
|
memoryExtractionState: {
|
|
92328
92361
|
config: {
|
|
92329
92362
|
minimumMessageTokensToInit: 1e4,
|
|
@@ -92344,7 +92377,9 @@ function createBootQueryContext() {
|
|
|
92344
92377
|
conditional: new Map,
|
|
92345
92378
|
activatedConditional: new Set,
|
|
92346
92379
|
loaded: createSignal()
|
|
92347
|
-
}
|
|
92380
|
+
},
|
|
92381
|
+
pluginDataPaths: new Map,
|
|
92382
|
+
lspManager: null
|
|
92348
92383
|
},
|
|
92349
92384
|
diagnostics: createFreshDiagnostics(),
|
|
92350
92385
|
provider: (() => {
|
|
@@ -92414,7 +92449,11 @@ function deriveSubagentRegistries(parent) {
|
|
|
92414
92449
|
agentColorIndex: parent.agentColorIndex,
|
|
92415
92450
|
systemPromptSectionCache: new Map,
|
|
92416
92451
|
cachedClaudeMdContent: null,
|
|
92417
|
-
settingsCache: {
|
|
92452
|
+
settingsCache: {
|
|
92453
|
+
session: null,
|
|
92454
|
+
perSource: new Map,
|
|
92455
|
+
parseFile: new Map
|
|
92456
|
+
},
|
|
92418
92457
|
memoryExtractionState: {
|
|
92419
92458
|
config: {
|
|
92420
92459
|
minimumMessageTokensToInit: 1e4,
|
|
@@ -92429,7 +92468,9 @@ function deriveSubagentRegistries(parent) {
|
|
|
92429
92468
|
systemPromptInjection: null,
|
|
92430
92469
|
sentSkillNames: new Set,
|
|
92431
92470
|
skillListingSuppressNext: false,
|
|
92432
|
-
dynamicSkills: parent.dynamicSkills
|
|
92471
|
+
dynamicSkills: parent.dynamicSkills,
|
|
92472
|
+
pluginDataPaths: parent.pluginDataPaths,
|
|
92473
|
+
lspManager: parent.lspManager
|
|
92433
92474
|
};
|
|
92434
92475
|
}
|
|
92435
92476
|
function cloneHookRegistry(registry2) {
|
|
@@ -94777,7 +94818,7 @@ function printStartupScreen() {
|
|
|
94777
94818
|
const sLen = ` ● ${sL} Ready — type /help to begin`.length;
|
|
94778
94819
|
out.push(boxRow(sRow, W2, sLen));
|
|
94779
94820
|
out.push(`${rgb(...BORDER)}╚${"═".repeat(W2 - 2)}╝${RESET}`);
|
|
94780
|
-
out.push(` ${DIM}${rgb(...DIMCOL)}opencow ${RESET}${rgb(...ACCENT)}v${"0.4.
|
|
94821
|
+
out.push(` ${DIM}${rgb(...DIMCOL)}opencow ${RESET}${rgb(...ACCENT)}v${"0.4.23"}${RESET}`);
|
|
94781
94822
|
out.push("");
|
|
94782
94823
|
process.stdout.write(out.join(`
|
|
94783
94824
|
`) + `
|
|
@@ -144752,7 +144793,7 @@ function pluginDataDirPath(pluginId) {
|
|
|
144752
144793
|
return join46(getPluginsDirectory(), "data", sanitizePluginId(pluginId));
|
|
144753
144794
|
}
|
|
144754
144795
|
function getPluginDataDir(pluginId) {
|
|
144755
|
-
const dir = pluginDataDirPath(pluginId);
|
|
144796
|
+
const dir = tryGetExplicitPluginDataPath(pluginId) ?? pluginDataDirPath(pluginId);
|
|
144756
144797
|
getFsImplementation().mkdirSync(dir, { recursive: true });
|
|
144757
144798
|
return dir;
|
|
144758
144799
|
}
|
|
@@ -144760,7 +144801,9 @@ async function getPluginDataDirSize(pluginId) {
|
|
|
144760
144801
|
const dir = pluginDataDirPath(pluginId);
|
|
144761
144802
|
let bytes = 0;
|
|
144762
144803
|
const walk = async (p) => {
|
|
144763
|
-
for (const entry of await getFsImplementation().readdir(p, {
|
|
144804
|
+
for (const entry of await getFsImplementation().readdir(p, {
|
|
144805
|
+
withFileTypes: true
|
|
144806
|
+
})) {
|
|
144764
144807
|
const full = join46(p, entry.name);
|
|
144765
144808
|
if (entry.isDirectory()) {
|
|
144766
144809
|
await walk(full);
|
|
@@ -144921,7 +144964,7 @@ function substitutePluginVariables(value, plugin) {
|
|
|
144921
144964
|
let out = value.replace(/\$\{CLAUDE_PLUGIN_ROOT\}/g, () => normalize10(plugin.path));
|
|
144922
144965
|
if (plugin.source) {
|
|
144923
144966
|
const source = plugin.source;
|
|
144924
|
-
out = out.replace(/\$\{CLAUDE_PLUGIN_DATA\}/g, () => normalize10(getPluginDataDir(source)));
|
|
144967
|
+
out = out.replace(/\$\{CLAUDE_PLUGIN_DATA\}/g, () => normalize10(plugin.dataPath ?? getPluginDataDir(source)));
|
|
144925
144968
|
}
|
|
144926
144969
|
return out;
|
|
144927
144970
|
}
|
|
@@ -144955,7 +144998,10 @@ var init_pluginOptionsStorage = __esm(() => {
|
|
|
144955
144998
|
init_settings2();
|
|
144956
144999
|
init_mcpbHandler();
|
|
144957
145000
|
init_pluginDirectories();
|
|
145001
|
+
init_state();
|
|
144958
145002
|
loadPluginOptions = memoize_default((pluginId) => {
|
|
145003
|
+
if (tryGetExplicitPluginDataPath(pluginId))
|
|
145004
|
+
return {};
|
|
144959
145005
|
const settings = getSettings_DEPRECATED();
|
|
144960
145006
|
const nonSensitive = settings.pluginConfigs?.[pluginId]?.options ?? {};
|
|
144961
145007
|
const storage = getSecureStorage();
|
|
@@ -145018,7 +145064,7 @@ async function loadMcpServersFromMcpb(plugin, mcpbPath, errors4) {
|
|
|
145018
145064
|
}
|
|
145019
145065
|
async function loadPluginMcpServers(plugin, errors4 = []) {
|
|
145020
145066
|
let servers = {};
|
|
145021
|
-
const defaultMcpServers = await loadMcpServersFromFile(plugin.path, PATH_SEGMENTS.settings.mcpProjectConfig);
|
|
145067
|
+
const defaultMcpServers = await loadMcpServersFromFile(plugin.path, PATH_SEGMENTS.settings.mcpProjectConfig, errors4, plugin, false);
|
|
145022
145068
|
if (defaultMcpServers) {
|
|
145023
145069
|
servers = { ...servers, ...defaultMcpServers };
|
|
145024
145070
|
}
|
|
@@ -145031,7 +145077,7 @@ async function loadPluginMcpServers(plugin, errors4 = []) {
|
|
|
145031
145077
|
servers = { ...servers, ...mcpbServers };
|
|
145032
145078
|
}
|
|
145033
145079
|
} else {
|
|
145034
|
-
const mcpServers = await loadMcpServersFromFile(plugin.path, mcpServersSpec);
|
|
145080
|
+
const mcpServers = await loadMcpServersFromFile(plugin.path, mcpServersSpec, errors4, plugin, true);
|
|
145035
145081
|
if (mcpServers) {
|
|
145036
145082
|
servers = { ...servers, ...mcpServers };
|
|
145037
145083
|
}
|
|
@@ -145043,11 +145089,18 @@ async function loadPluginMcpServers(plugin, errors4 = []) {
|
|
|
145043
145089
|
if (isMcpbSource(spec)) {
|
|
145044
145090
|
return await loadMcpServersFromMcpb(plugin, spec, errors4);
|
|
145045
145091
|
}
|
|
145046
|
-
return await loadMcpServersFromFile(plugin.path, spec);
|
|
145092
|
+
return await loadMcpServersFromFile(plugin.path, spec, errors4, plugin, true);
|
|
145047
145093
|
}
|
|
145048
145094
|
return spec;
|
|
145049
145095
|
} catch (e) {
|
|
145050
145096
|
logForDebugging2(`Failed to load MCP servers from spec for plugin ${plugin.name}: ${e}`, { level: "error" });
|
|
145097
|
+
errors4.push({
|
|
145098
|
+
type: "mcp-config-invalid",
|
|
145099
|
+
source: plugin.source,
|
|
145100
|
+
plugin: plugin.name,
|
|
145101
|
+
serverName: "manifest",
|
|
145102
|
+
validationError: errorMessage(e)
|
|
145103
|
+
});
|
|
145051
145104
|
return null;
|
|
145052
145105
|
}
|
|
145053
145106
|
}));
|
|
@@ -145062,19 +145115,26 @@ async function loadPluginMcpServers(plugin, errors4 = []) {
|
|
|
145062
145115
|
}
|
|
145063
145116
|
return Object.keys(servers).length > 0 ? servers : undefined;
|
|
145064
145117
|
}
|
|
145065
|
-
async function loadMcpServersFromFile(pluginPath, relativePath) {
|
|
145118
|
+
async function loadMcpServersFromFile(pluginPath, relativePath, errors4, plugin, required2) {
|
|
145066
145119
|
const fs2 = getFsImplementation();
|
|
145067
145120
|
const filePath = join47(pluginPath, relativePath);
|
|
145068
145121
|
let content;
|
|
145069
145122
|
try {
|
|
145070
145123
|
content = await fs2.readFile(filePath, { encoding: "utf-8" });
|
|
145071
145124
|
} catch (e) {
|
|
145072
|
-
if (isENOENT(e)) {
|
|
145125
|
+
if (isENOENT(e) && !required2) {
|
|
145073
145126
|
return null;
|
|
145074
145127
|
}
|
|
145075
145128
|
logForDebugging2(`Failed to load MCP servers from ${filePath}: ${e}`, {
|
|
145076
145129
|
level: "error"
|
|
145077
145130
|
});
|
|
145131
|
+
errors4.push({
|
|
145132
|
+
type: "mcp-config-invalid",
|
|
145133
|
+
source: plugin.source,
|
|
145134
|
+
plugin: plugin.name,
|
|
145135
|
+
serverName: relativePath,
|
|
145136
|
+
validationError: errorMessage(e)
|
|
145137
|
+
});
|
|
145078
145138
|
return null;
|
|
145079
145139
|
}
|
|
145080
145140
|
try {
|
|
@@ -145087,6 +145147,13 @@ async function loadMcpServersFromFile(pluginPath, relativePath) {
|
|
|
145087
145147
|
validatedServers[name] = result.data;
|
|
145088
145148
|
} else {
|
|
145089
145149
|
logForDebugging2(`Invalid MCP server config for ${name} in ${filePath}: ${result.error.message}`, { level: "error" });
|
|
145150
|
+
errors4.push({
|
|
145151
|
+
type: "mcp-config-invalid",
|
|
145152
|
+
source: plugin.source,
|
|
145153
|
+
plugin: plugin.name,
|
|
145154
|
+
serverName: name,
|
|
145155
|
+
validationError: result.error.message
|
|
145156
|
+
});
|
|
145090
145157
|
}
|
|
145091
145158
|
}
|
|
145092
145159
|
return validatedServers;
|
|
@@ -145094,6 +145161,13 @@ async function loadMcpServersFromFile(pluginPath, relativePath) {
|
|
|
145094
145161
|
logForDebugging2(`Failed to load MCP servers from ${filePath}: ${error41}`, {
|
|
145095
145162
|
level: "error"
|
|
145096
145163
|
});
|
|
145164
|
+
errors4.push({
|
|
145165
|
+
type: "mcp-config-invalid",
|
|
145166
|
+
source: plugin.source,
|
|
145167
|
+
plugin: plugin.name,
|
|
145168
|
+
serverName: relativePath,
|
|
145169
|
+
validationError: errorMessage(error41)
|
|
145170
|
+
});
|
|
145097
145171
|
return null;
|
|
145098
145172
|
}
|
|
145099
145173
|
}
|
|
@@ -145171,7 +145245,7 @@ function resolvePluginMcpEnvironment(config2, plugin, userConfig, errors4, plugi
|
|
|
145171
145245
|
}
|
|
145172
145246
|
const resolvedEnv = {
|
|
145173
145247
|
CLAUDE_PLUGIN_ROOT: plugin.path,
|
|
145174
|
-
CLAUDE_PLUGIN_DATA: getPluginDataDir(plugin.source),
|
|
145248
|
+
CLAUDE_PLUGIN_DATA: plugin.dataPath ?? getPluginDataDir(plugin.source),
|
|
145175
145249
|
...stdioConfig.env || {}
|
|
145176
145250
|
};
|
|
145177
145251
|
for (const [key, value] of Object.entries(resolvedEnv)) {
|
|
@@ -145633,16 +145707,16 @@ var init_walkPluginMarkdown = __esm(() => {
|
|
|
145633
145707
|
|
|
145634
145708
|
// src/capabilities/plugins/loadPluginAgents.ts
|
|
145635
145709
|
import { basename as basename9 } from "path";
|
|
145636
|
-
async function loadAgentsFromDirectory(agentsPath, pluginName, sourceName, pluginPath, pluginManifest, loadedPaths) {
|
|
145710
|
+
async function loadAgentsFromDirectory(agentsPath, pluginName, sourceName, pluginPath, dataPath, pluginManifest, loadedPaths, strict = false) {
|
|
145637
145711
|
const agents = [];
|
|
145638
145712
|
await walkPluginMarkdown(agentsPath, async (fullPath, namespace) => {
|
|
145639
|
-
const agent = await loadAgentFromFile(fullPath, pluginName, namespace, sourceName, pluginPath, pluginManifest, loadedPaths);
|
|
145713
|
+
const agent = await loadAgentFromFile(fullPath, pluginName, namespace, sourceName, pluginPath, dataPath, pluginManifest, loadedPaths, strict);
|
|
145640
145714
|
if (agent)
|
|
145641
145715
|
agents.push(agent);
|
|
145642
145716
|
}, { logLabel: "agents" });
|
|
145643
145717
|
return agents;
|
|
145644
145718
|
}
|
|
145645
|
-
async function loadAgentFromFile(filePath, pluginName, namespace, sourceName, pluginPath, pluginManifest, loadedPaths) {
|
|
145719
|
+
async function loadAgentFromFile(filePath, pluginName, namespace, sourceName, pluginPath, dataPath, pluginManifest, loadedPaths, strict = false) {
|
|
145646
145720
|
const fs2 = getFsImplementation();
|
|
145647
145721
|
if (isDuplicatePath(fs2, filePath, loadedPaths)) {
|
|
145648
145722
|
return null;
|
|
@@ -145667,7 +145741,8 @@ async function loadAgentFromFile(filePath, pluginName, namespace, sourceName, pl
|
|
|
145667
145741
|
const background = backgroundRaw === "true" || backgroundRaw === true ? true : undefined;
|
|
145668
145742
|
let systemPrompt = substitutePluginVariables(markdownContent.trim(), {
|
|
145669
145743
|
path: pluginPath,
|
|
145670
|
-
source: sourceName
|
|
145744
|
+
source: sourceName,
|
|
145745
|
+
dataPath
|
|
145671
145746
|
});
|
|
145672
145747
|
if (pluginManifest.userConfig) {
|
|
145673
145748
|
systemPrompt = substituteUserConfigInContent(systemPrompt, loadPluginOptions(sourceName), pluginManifest.userConfig);
|
|
@@ -145730,6 +145805,7 @@ async function loadAgentFromFile(filePath, pluginName, namespace, sourceName, pl
|
|
|
145730
145805
|
color,
|
|
145731
145806
|
model,
|
|
145732
145807
|
filename: baseAgentName,
|
|
145808
|
+
sourcePath: filePath,
|
|
145733
145809
|
plugin: sourceName,
|
|
145734
145810
|
...background ? { background } : {},
|
|
145735
145811
|
...memory ? { memory } : {},
|
|
@@ -145738,12 +145814,68 @@ async function loadAgentFromFile(filePath, pluginName, namespace, sourceName, pl
|
|
|
145738
145814
|
...maxTurns !== undefined ? { maxTurns } : {}
|
|
145739
145815
|
};
|
|
145740
145816
|
} catch (error41) {
|
|
145817
|
+
if (strict)
|
|
145818
|
+
throw error41;
|
|
145741
145819
|
logForDebugging2(`Failed to load agent from ${filePath}: ${error41}`, {
|
|
145742
145820
|
level: "error"
|
|
145743
145821
|
});
|
|
145744
145822
|
return null;
|
|
145745
145823
|
}
|
|
145746
145824
|
}
|
|
145825
|
+
async function loadPluginAgentsFromPlugins(enabled, options2 = {}) {
|
|
145826
|
+
const strict = options2.strict ?? false;
|
|
145827
|
+
const perPluginAgents = await Promise.all(enabled.map(async (plugin) => {
|
|
145828
|
+
const loadedPaths = new Set;
|
|
145829
|
+
const pluginAgents = [];
|
|
145830
|
+
if (plugin.agentsPath) {
|
|
145831
|
+
try {
|
|
145832
|
+
const agents = await loadAgentsFromDirectory(plugin.agentsPath, plugin.name, plugin.source, plugin.path, plugin.dataPath, plugin.manifest, loadedPaths, strict);
|
|
145833
|
+
pluginAgents.push(...agents);
|
|
145834
|
+
if (agents.length > 0) {
|
|
145835
|
+
logForDebugging2(`Loaded ${agents.length} agents from plugin ${plugin.name} default directory`);
|
|
145836
|
+
}
|
|
145837
|
+
} catch (error41) {
|
|
145838
|
+
if (strict)
|
|
145839
|
+
throw error41;
|
|
145840
|
+
logForDebugging2(`Failed to load agents from plugin ${plugin.name} default directory: ${error41}`, { level: "error" });
|
|
145841
|
+
}
|
|
145842
|
+
}
|
|
145843
|
+
if (plugin.agentsPaths) {
|
|
145844
|
+
const pathResults = await Promise.all(plugin.agentsPaths.map(async (agentPath) => {
|
|
145845
|
+
try {
|
|
145846
|
+
const fs2 = getFsImplementation();
|
|
145847
|
+
const stats = await fs2.stat(agentPath);
|
|
145848
|
+
if (stats.isDirectory()) {
|
|
145849
|
+
const agents = await loadAgentsFromDirectory(agentPath, plugin.name, plugin.source, plugin.path, plugin.dataPath, plugin.manifest, loadedPaths, strict);
|
|
145850
|
+
if (agents.length > 0) {
|
|
145851
|
+
logForDebugging2(`Loaded ${agents.length} agents from plugin ${plugin.name} custom path: ${agentPath}`);
|
|
145852
|
+
}
|
|
145853
|
+
return agents;
|
|
145854
|
+
} else if (stats.isFile() && agentPath.endsWith(".md")) {
|
|
145855
|
+
const agent = await loadAgentFromFile(agentPath, plugin.name, [], plugin.source, plugin.path, plugin.dataPath, plugin.manifest, loadedPaths, strict);
|
|
145856
|
+
if (agent) {
|
|
145857
|
+
logForDebugging2(`Loaded agent from plugin ${plugin.name} custom file: ${agentPath}`);
|
|
145858
|
+
return [agent];
|
|
145859
|
+
}
|
|
145860
|
+
}
|
|
145861
|
+
return [];
|
|
145862
|
+
} catch (error41) {
|
|
145863
|
+
if (strict)
|
|
145864
|
+
throw error41;
|
|
145865
|
+
logForDebugging2(`Failed to load agents from plugin ${plugin.name} custom path ${agentPath}: ${error41}`, { level: "error" });
|
|
145866
|
+
return [];
|
|
145867
|
+
}
|
|
145868
|
+
}));
|
|
145869
|
+
for (const agents of pathResults) {
|
|
145870
|
+
pluginAgents.push(...agents);
|
|
145871
|
+
}
|
|
145872
|
+
}
|
|
145873
|
+
return pluginAgents;
|
|
145874
|
+
}));
|
|
145875
|
+
const allAgents = perPluginAgents.flat();
|
|
145876
|
+
logForDebugging2(`Total plugin agents loaded: ${allAgents.length}`);
|
|
145877
|
+
return allAgents;
|
|
145878
|
+
}
|
|
145747
145879
|
function clearPluginAgentCache() {
|
|
145748
145880
|
loadPluginAgents.cache?.clear?.();
|
|
145749
145881
|
}
|
|
@@ -145766,53 +145898,7 @@ var init_loadPluginAgents = __esm(() => {
|
|
|
145766
145898
|
if (errors4.length > 0) {
|
|
145767
145899
|
logForDebugging2(`Plugin loading errors: ${errors4.map((e) => getPluginErrorMessage(e)).join(", ")}`);
|
|
145768
145900
|
}
|
|
145769
|
-
|
|
145770
|
-
const loadedPaths = new Set;
|
|
145771
|
-
const pluginAgents = [];
|
|
145772
|
-
if (plugin.agentsPath) {
|
|
145773
|
-
try {
|
|
145774
|
-
const agents = await loadAgentsFromDirectory(plugin.agentsPath, plugin.name, plugin.source, plugin.path, plugin.manifest, loadedPaths);
|
|
145775
|
-
pluginAgents.push(...agents);
|
|
145776
|
-
if (agents.length > 0) {
|
|
145777
|
-
logForDebugging2(`Loaded ${agents.length} agents from plugin ${plugin.name} default directory`);
|
|
145778
|
-
}
|
|
145779
|
-
} catch (error41) {
|
|
145780
|
-
logForDebugging2(`Failed to load agents from plugin ${plugin.name} default directory: ${error41}`, { level: "error" });
|
|
145781
|
-
}
|
|
145782
|
-
}
|
|
145783
|
-
if (plugin.agentsPaths) {
|
|
145784
|
-
const pathResults = await Promise.all(plugin.agentsPaths.map(async (agentPath) => {
|
|
145785
|
-
try {
|
|
145786
|
-
const fs2 = getFsImplementation();
|
|
145787
|
-
const stats = await fs2.stat(agentPath);
|
|
145788
|
-
if (stats.isDirectory()) {
|
|
145789
|
-
const agents = await loadAgentsFromDirectory(agentPath, plugin.name, plugin.source, plugin.path, plugin.manifest, loadedPaths);
|
|
145790
|
-
if (agents.length > 0) {
|
|
145791
|
-
logForDebugging2(`Loaded ${agents.length} agents from plugin ${plugin.name} custom path: ${agentPath}`);
|
|
145792
|
-
}
|
|
145793
|
-
return agents;
|
|
145794
|
-
} else if (stats.isFile() && agentPath.endsWith(".md")) {
|
|
145795
|
-
const agent = await loadAgentFromFile(agentPath, plugin.name, [], plugin.source, plugin.path, plugin.manifest, loadedPaths);
|
|
145796
|
-
if (agent) {
|
|
145797
|
-
logForDebugging2(`Loaded agent from plugin ${plugin.name} custom file: ${agentPath}`);
|
|
145798
|
-
return [agent];
|
|
145799
|
-
}
|
|
145800
|
-
}
|
|
145801
|
-
return [];
|
|
145802
|
-
} catch (error41) {
|
|
145803
|
-
logForDebugging2(`Failed to load agents from plugin ${plugin.name} custom path ${agentPath}: ${error41}`, { level: "error" });
|
|
145804
|
-
return [];
|
|
145805
|
-
}
|
|
145806
|
-
}));
|
|
145807
|
-
for (const agents of pathResults) {
|
|
145808
|
-
pluginAgents.push(...agents);
|
|
145809
|
-
}
|
|
145810
|
-
}
|
|
145811
|
-
return pluginAgents;
|
|
145812
|
-
}));
|
|
145813
|
-
const allAgents = perPluginAgents.flat();
|
|
145814
|
-
logForDebugging2(`Total plugin agents loaded: ${allAgents.length}`);
|
|
145815
|
-
return allAgents;
|
|
145901
|
+
return loadPluginAgentsFromPlugins(enabled);
|
|
145816
145902
|
});
|
|
145817
145903
|
});
|
|
145818
145904
|
|
|
@@ -244805,7 +244891,7 @@ function getAnthropicEnvMetadata() {
|
|
|
244805
244891
|
function getBuildAgeMinutes() {
|
|
244806
244892
|
if (false)
|
|
244807
244893
|
;
|
|
244808
|
-
const buildTime = new Date("2026-08-
|
|
244894
|
+
const buildTime = new Date("2026-08-28T10:03:59.640Z").getTime();
|
|
244809
244895
|
if (isNaN(buildTime))
|
|
244810
244896
|
return;
|
|
244811
244897
|
return Math.floor((Date.now() - buildTime) / 60000);
|
|
@@ -266822,7 +266908,7 @@ function resolvePluginLspEnvironment(config2, plugin, userConfig, _errors) {
|
|
|
266822
266908
|
}
|
|
266823
266909
|
const resolvedEnv = {
|
|
266824
266910
|
CLAUDE_PLUGIN_ROOT: plugin.path,
|
|
266825
|
-
CLAUDE_PLUGIN_DATA: getPluginDataDir(plugin.source),
|
|
266911
|
+
CLAUDE_PLUGIN_DATA: plugin.dataPath ?? getPluginDataDir(plugin.source),
|
|
266826
266912
|
...resolved.env || {}
|
|
266827
266913
|
};
|
|
266828
266914
|
for (const [key, value] of Object.entries(resolvedEnv)) {
|
|
@@ -270678,14 +270764,14 @@ var init_LSPServerInstance = __esm(() => {
|
|
|
270678
270764
|
// src/capabilities/lsp/LSPServerManager.ts
|
|
270679
270765
|
import * as path12 from "path";
|
|
270680
270766
|
import { pathToFileURL as pathToFileURL2 } from "url";
|
|
270681
|
-
function createLSPServerManager() {
|
|
270767
|
+
function createLSPServerManager(explicitServerConfigs) {
|
|
270682
270768
|
const servers = new Map;
|
|
270683
270769
|
const extensionMap = new Map;
|
|
270684
270770
|
const openedFiles = new Map;
|
|
270685
270771
|
async function initialize3() {
|
|
270686
270772
|
let serverConfigs;
|
|
270687
270773
|
try {
|
|
270688
|
-
const result = await getAllLspServers();
|
|
270774
|
+
const result = explicitServerConfigs ? { servers: { ...explicitServerConfigs } } : await getAllLspServers();
|
|
270689
270775
|
serverConfigs = result.servers;
|
|
270690
270776
|
logForDebugging2(`[LSP SERVER MANAGER] getAllLspServers returned ${Object.keys(serverConfigs).length} server(s)`);
|
|
270691
270777
|
} catch (error41) {
|
|
@@ -271050,6 +271136,9 @@ var init_passiveFeedback = __esm(() => {
|
|
|
271050
271136
|
|
|
271051
271137
|
// src/capabilities/lsp/manager.ts
|
|
271052
271138
|
function getLspServerManager() {
|
|
271139
|
+
const sessionManager = tryGetSessionLspManager();
|
|
271140
|
+
if (sessionManager)
|
|
271141
|
+
return sessionManager;
|
|
271053
271142
|
if (initializationState === "failed") {
|
|
271054
271143
|
return;
|
|
271055
271144
|
}
|
|
@@ -271071,8 +271160,6 @@ function getInitializationStatus() {
|
|
|
271071
271160
|
return { status: "success" };
|
|
271072
271161
|
}
|
|
271073
271162
|
function isLspConnected() {
|
|
271074
|
-
if (initializationState === "failed")
|
|
271075
|
-
return false;
|
|
271076
271163
|
const manager = getLspServerManager();
|
|
271077
271164
|
if (!manager)
|
|
271078
271165
|
return false;
|
|
@@ -271170,6 +271257,7 @@ var init_manager = __esm(() => {
|
|
|
271170
271257
|
init_log3();
|
|
271171
271258
|
init_LSPServerManager();
|
|
271172
271259
|
init_passiveFeedback();
|
|
271260
|
+
init_registries2();
|
|
271173
271261
|
});
|
|
271174
271262
|
|
|
271175
271263
|
// src/capabilities/tools/shared/teamMemorySync/teamMemSecretGuard.ts
|
|
@@ -284046,20 +284134,20 @@ function transformPluginSkillFiles(files) {
|
|
|
284046
284134
|
}
|
|
284047
284135
|
return result;
|
|
284048
284136
|
}
|
|
284049
|
-
async function loadCommandsFromDirectory(commandsPath, pluginName, sourceName, pluginManifest, pluginPath, config2 = { isSkillMode: false }, loadedPaths = new Set) {
|
|
284137
|
+
async function loadCommandsFromDirectory(commandsPath, pluginName, sourceName, pluginManifest, pluginPath, config2 = { isSkillMode: false }, loadedPaths = new Set, pluginDataPath, strict = false) {
|
|
284050
284138
|
const markdownFiles = await collectMarkdownFiles(commandsPath, commandsPath, loadedPaths);
|
|
284051
284139
|
const processedFiles = transformPluginSkillFiles(markdownFiles);
|
|
284052
284140
|
const commands = [];
|
|
284053
284141
|
for (const file2 of processedFiles) {
|
|
284054
284142
|
const commandName = getCommandNameFromFile(file2.filePath, file2.baseDir, pluginName);
|
|
284055
|
-
const command = createPluginCommand(commandName, file2, sourceName, pluginManifest, pluginPath, isSkillFile(file2.filePath), config2);
|
|
284143
|
+
const command = createPluginCommand(commandName, file2, sourceName, pluginManifest, pluginPath, isSkillFile(file2.filePath), config2, pluginDataPath, strict);
|
|
284056
284144
|
if (command) {
|
|
284057
284145
|
commands.push(command);
|
|
284058
284146
|
}
|
|
284059
284147
|
}
|
|
284060
284148
|
return commands;
|
|
284061
284149
|
}
|
|
284062
|
-
function createPluginCommand(commandName, file2, sourceName, pluginManifest, pluginPath, isSkill, config2 = { isSkillMode: false }) {
|
|
284150
|
+
function createPluginCommand(commandName, file2, sourceName, pluginManifest, pluginPath, isSkill, config2 = { isSkillMode: false }, pluginDataPath, strict = false) {
|
|
284063
284151
|
try {
|
|
284064
284152
|
const { frontmatter, content } = file2;
|
|
284065
284153
|
const validatedDescription = coerceDescriptionToString(frontmatter.description, commandName);
|
|
@@ -284067,10 +284155,12 @@ function createPluginCommand(commandName, file2, sourceName, pluginManifest, plu
|
|
|
284067
284155
|
const rawAllowedTools = frontmatter["allowed-tools"];
|
|
284068
284156
|
const substitutedAllowedTools = typeof rawAllowedTools === "string" ? substitutePluginVariables(rawAllowedTools, {
|
|
284069
284157
|
path: pluginPath,
|
|
284070
|
-
source: sourceName
|
|
284158
|
+
source: sourceName,
|
|
284159
|
+
dataPath: pluginDataPath
|
|
284071
284160
|
}) : Array.isArray(rawAllowedTools) ? rawAllowedTools.map((tool) => typeof tool === "string" ? substitutePluginVariables(tool, {
|
|
284072
284161
|
path: pluginPath,
|
|
284073
|
-
source: sourceName
|
|
284162
|
+
source: sourceName,
|
|
284163
|
+
dataPath: pluginDataPath
|
|
284074
284164
|
}) : tool) : rawAllowedTools;
|
|
284075
284165
|
const allowedTools = parseSlashCommandToolsFromFrontmatter(substitutedAllowedTools);
|
|
284076
284166
|
const argumentHint = frontmatter["argument-hint"];
|
|
@@ -284091,6 +284181,7 @@ function createPluginCommand(commandName, file2, sourceName, pluginManifest, plu
|
|
|
284091
284181
|
return {
|
|
284092
284182
|
type: "prompt",
|
|
284093
284183
|
name: commandName,
|
|
284184
|
+
sourcePath: file2.filePath,
|
|
284094
284185
|
description,
|
|
284095
284186
|
hasUserSpecifiedDescription: validatedDescription !== null,
|
|
284096
284187
|
allowedTools,
|
|
@@ -284115,13 +284206,20 @@ function createPluginCommand(commandName, file2, sourceName, pluginManifest, plu
|
|
|
284115
284206
|
return displayName || commandName;
|
|
284116
284207
|
},
|
|
284117
284208
|
async getPromptForCommand(args, context4) {
|
|
284118
|
-
|
|
284209
|
+
const sourceContext = [
|
|
284210
|
+
`Source file: ${file2.filePath}`,
|
|
284211
|
+
`Plugin root: ${pluginPath}`,
|
|
284212
|
+
...config2.isSkillMode ? [`Base directory for this skill: ${dirname29(file2.filePath)}`] : []
|
|
284213
|
+
];
|
|
284214
|
+
let finalContent = `${sourceContext.join(`
|
|
284215
|
+
`)}
|
|
284119
284216
|
|
|
284120
|
-
${content}
|
|
284217
|
+
${content}`;
|
|
284121
284218
|
finalContent = substituteArguments(finalContent, args, true, argumentNames);
|
|
284122
284219
|
finalContent = substitutePluginVariables(finalContent, {
|
|
284123
284220
|
path: pluginPath,
|
|
284124
|
-
source: sourceName
|
|
284221
|
+
source: sourceName,
|
|
284222
|
+
dataPath: pluginDataPath
|
|
284125
284223
|
});
|
|
284126
284224
|
if (pluginManifest.userConfig) {
|
|
284127
284225
|
finalContent = substituteUserConfigInContent(finalContent, loadPluginOptions(sourceName), pluginManifest.userConfig);
|
|
@@ -284152,16 +284250,161 @@ ${content}` : content;
|
|
|
284152
284250
|
}
|
|
284153
284251
|
};
|
|
284154
284252
|
} catch (error41) {
|
|
284253
|
+
if (strict)
|
|
284254
|
+
throw error41;
|
|
284155
284255
|
logForDebugging2(`Failed to create command from ${file2.filePath}: ${error41}`, {
|
|
284156
284256
|
level: "error"
|
|
284157
284257
|
});
|
|
284158
284258
|
return null;
|
|
284159
284259
|
}
|
|
284160
284260
|
}
|
|
284261
|
+
async function loadPluginCommandsFromPlugins(enabled, options2 = {}) {
|
|
284262
|
+
const strict = options2.strict ?? false;
|
|
284263
|
+
const perPluginCommands = await Promise.all(enabled.map(async (plugin) => {
|
|
284264
|
+
const loadedPaths = new Set;
|
|
284265
|
+
const pluginCommands = [];
|
|
284266
|
+
if (plugin.commandsPath) {
|
|
284267
|
+
try {
|
|
284268
|
+
const commands = await loadCommandsFromDirectory(plugin.commandsPath, plugin.name, plugin.source, plugin.manifest, plugin.path, { isSkillMode: false }, loadedPaths, plugin.dataPath, strict);
|
|
284269
|
+
pluginCommands.push(...commands);
|
|
284270
|
+
if (commands.length > 0) {
|
|
284271
|
+
logForDebugging2(`Loaded ${commands.length} commands from plugin ${plugin.name} default directory`);
|
|
284272
|
+
}
|
|
284273
|
+
} catch (error41) {
|
|
284274
|
+
if (strict)
|
|
284275
|
+
throw error41;
|
|
284276
|
+
logForDebugging2(`Failed to load commands from plugin ${plugin.name} default directory: ${error41}`, { level: "error" });
|
|
284277
|
+
}
|
|
284278
|
+
}
|
|
284279
|
+
if (plugin.commandsPaths) {
|
|
284280
|
+
logForDebugging2(`Plugin ${plugin.name} has commandsPaths: ${plugin.commandsPaths.join(", ")}`);
|
|
284281
|
+
const pathResults = await Promise.all(plugin.commandsPaths.map(async (commandPath) => {
|
|
284282
|
+
try {
|
|
284283
|
+
const fs2 = getFsImplementation();
|
|
284284
|
+
const stats = await fs2.stat(commandPath);
|
|
284285
|
+
logForDebugging2(`Checking commandPath ${commandPath} - isDirectory: ${stats.isDirectory()}, isFile: ${stats.isFile()}`);
|
|
284286
|
+
if (stats.isDirectory()) {
|
|
284287
|
+
const commands = await loadCommandsFromDirectory(commandPath, plugin.name, plugin.source, plugin.manifest, plugin.path, { isSkillMode: false }, loadedPaths, plugin.dataPath, strict);
|
|
284288
|
+
if (commands.length > 0) {
|
|
284289
|
+
logForDebugging2(`Loaded ${commands.length} commands from plugin ${plugin.name} custom path: ${commandPath}`);
|
|
284290
|
+
} else {
|
|
284291
|
+
logForDebugging2(`Warning: No commands found in plugin ${plugin.name} custom directory: ${commandPath}. Expected .md files or SKILL.md in subdirectories.`, { level: "warn" });
|
|
284292
|
+
}
|
|
284293
|
+
return commands;
|
|
284294
|
+
} else if (stats.isFile() && commandPath.endsWith(".md")) {
|
|
284295
|
+
if (isDuplicatePath(fs2, commandPath, loadedPaths)) {
|
|
284296
|
+
return [];
|
|
284297
|
+
}
|
|
284298
|
+
const content = await fs2.readFile(commandPath, {
|
|
284299
|
+
encoding: "utf-8"
|
|
284300
|
+
});
|
|
284301
|
+
const { frontmatter, content: markdownContent } = parseFrontmatter(content, commandPath);
|
|
284302
|
+
let commandName;
|
|
284303
|
+
let metadataOverride;
|
|
284304
|
+
if (plugin.commandsMetadata) {
|
|
284305
|
+
for (const [name, metadata] of Object.entries(plugin.commandsMetadata)) {
|
|
284306
|
+
if (metadata.source) {
|
|
284307
|
+
const fullMetadataPath = join62(plugin.path, metadata.source);
|
|
284308
|
+
if (commandPath === fullMetadataPath) {
|
|
284309
|
+
commandName = `${plugin.name}:${name}`;
|
|
284310
|
+
metadataOverride = metadata;
|
|
284311
|
+
break;
|
|
284312
|
+
}
|
|
284313
|
+
}
|
|
284314
|
+
}
|
|
284315
|
+
}
|
|
284316
|
+
if (!commandName) {
|
|
284317
|
+
commandName = `${plugin.name}:${basename16(commandPath).replace(/\.md$/, "")}`;
|
|
284318
|
+
}
|
|
284319
|
+
const finalFrontmatter = metadataOverride ? {
|
|
284320
|
+
...frontmatter,
|
|
284321
|
+
...metadataOverride.description && {
|
|
284322
|
+
description: metadataOverride.description
|
|
284323
|
+
},
|
|
284324
|
+
...metadataOverride.argumentHint && {
|
|
284325
|
+
"argument-hint": metadataOverride.argumentHint
|
|
284326
|
+
},
|
|
284327
|
+
...metadataOverride.model && {
|
|
284328
|
+
model: metadataOverride.model
|
|
284329
|
+
},
|
|
284330
|
+
...metadataOverride.allowedTools && {
|
|
284331
|
+
"allowed-tools": metadataOverride.allowedTools.join(",")
|
|
284332
|
+
}
|
|
284333
|
+
} : frontmatter;
|
|
284334
|
+
const file2 = {
|
|
284335
|
+
filePath: commandPath,
|
|
284336
|
+
baseDir: dirname29(commandPath),
|
|
284337
|
+
frontmatter: finalFrontmatter,
|
|
284338
|
+
content: markdownContent
|
|
284339
|
+
};
|
|
284340
|
+
const command = createPluginCommand(commandName, file2, plugin.source, plugin.manifest, plugin.path, false, { isSkillMode: false }, plugin.dataPath, strict);
|
|
284341
|
+
if (command) {
|
|
284342
|
+
logForDebugging2(`Loaded command from plugin ${plugin.name} custom file: ${commandPath}${metadataOverride ? " (with metadata override)" : ""}`);
|
|
284343
|
+
return [command];
|
|
284344
|
+
}
|
|
284345
|
+
}
|
|
284346
|
+
return [];
|
|
284347
|
+
} catch (error41) {
|
|
284348
|
+
if (strict)
|
|
284349
|
+
throw error41;
|
|
284350
|
+
logForDebugging2(`Failed to load commands from plugin ${plugin.name} custom path ${commandPath}: ${error41}`, { level: "error" });
|
|
284351
|
+
return [];
|
|
284352
|
+
}
|
|
284353
|
+
}));
|
|
284354
|
+
for (const commands of pathResults) {
|
|
284355
|
+
pluginCommands.push(...commands);
|
|
284356
|
+
}
|
|
284357
|
+
}
|
|
284358
|
+
if (plugin.commandsMetadata) {
|
|
284359
|
+
for (const [name, metadata] of Object.entries(plugin.commandsMetadata)) {
|
|
284360
|
+
if (metadata.content && !metadata.source) {
|
|
284361
|
+
try {
|
|
284362
|
+
const { frontmatter, content: markdownContent } = parseFrontmatter(metadata.content, `<inline:${plugin.name}:${name}>`);
|
|
284363
|
+
const finalFrontmatter = {
|
|
284364
|
+
...frontmatter,
|
|
284365
|
+
...metadata.description && {
|
|
284366
|
+
description: metadata.description
|
|
284367
|
+
},
|
|
284368
|
+
...metadata.argumentHint && {
|
|
284369
|
+
"argument-hint": metadata.argumentHint
|
|
284370
|
+
},
|
|
284371
|
+
...metadata.model && {
|
|
284372
|
+
model: metadata.model
|
|
284373
|
+
},
|
|
284374
|
+
...metadata.allowedTools && {
|
|
284375
|
+
"allowed-tools": metadata.allowedTools.join(",")
|
|
284376
|
+
}
|
|
284377
|
+
};
|
|
284378
|
+
const commandName = `${plugin.name}:${name}`;
|
|
284379
|
+
const file2 = {
|
|
284380
|
+
filePath: `<inline:${commandName}>`,
|
|
284381
|
+
baseDir: plugin.path,
|
|
284382
|
+
frontmatter: finalFrontmatter,
|
|
284383
|
+
content: markdownContent
|
|
284384
|
+
};
|
|
284385
|
+
const command = createPluginCommand(commandName, file2, plugin.source, plugin.manifest, plugin.path, false, { isSkillMode: false }, plugin.dataPath, strict);
|
|
284386
|
+
if (command) {
|
|
284387
|
+
pluginCommands.push(command);
|
|
284388
|
+
logForDebugging2(`Loaded inline content command from plugin ${plugin.name}: ${commandName}`);
|
|
284389
|
+
}
|
|
284390
|
+
} catch (error41) {
|
|
284391
|
+
if (strict)
|
|
284392
|
+
throw error41;
|
|
284393
|
+
logForDebugging2(`Failed to load inline content command ${name} from plugin ${plugin.name}: ${error41}`, { level: "error" });
|
|
284394
|
+
}
|
|
284395
|
+
}
|
|
284396
|
+
}
|
|
284397
|
+
}
|
|
284398
|
+
return pluginCommands;
|
|
284399
|
+
}));
|
|
284400
|
+
const allCommands = perPluginCommands.flat();
|
|
284401
|
+
logForDebugging2(`Total plugin commands loaded: ${allCommands.length}`);
|
|
284402
|
+
return allCommands;
|
|
284403
|
+
}
|
|
284161
284404
|
function clearPluginCommandCache() {
|
|
284162
284405
|
getPluginCommands.cache?.clear?.();
|
|
284163
284406
|
}
|
|
284164
|
-
async function loadSkillsFromDirectory(skillsPath, pluginName, sourceName, pluginManifest, pluginPath, loadedPaths) {
|
|
284407
|
+
async function loadSkillsFromDirectory(skillsPath, pluginName, sourceName, pluginManifest, pluginPath, loadedPaths, pluginDataPath, strict = false) {
|
|
284165
284408
|
const fs2 = getFsImplementation();
|
|
284166
284409
|
const skills = [];
|
|
284167
284410
|
const directSkillPath = join62(skillsPath, "SKILL.md");
|
|
@@ -284172,6 +284415,8 @@ async function loadSkillsFromDirectory(skillsPath, pluginName, sourceName, plugi
|
|
|
284172
284415
|
});
|
|
284173
284416
|
} catch (e) {
|
|
284174
284417
|
if (!isENOENT(e)) {
|
|
284418
|
+
if (strict)
|
|
284419
|
+
throw e;
|
|
284175
284420
|
logForDebugging2(`Failed to load skill from ${directSkillPath}: ${e}`, {
|
|
284176
284421
|
level: "error"
|
|
284177
284422
|
});
|
|
@@ -284191,11 +284436,13 @@ async function loadSkillsFromDirectory(skillsPath, pluginName, sourceName, plugi
|
|
|
284191
284436
|
frontmatter,
|
|
284192
284437
|
content: markdownContent
|
|
284193
284438
|
};
|
|
284194
|
-
const skill = createPluginCommand(skillName, file2, sourceName, pluginManifest, pluginPath, true, { isSkillMode: true });
|
|
284439
|
+
const skill = createPluginCommand(skillName, file2, sourceName, pluginManifest, pluginPath, true, { isSkillMode: true }, pluginDataPath, strict);
|
|
284195
284440
|
if (skill) {
|
|
284196
284441
|
skills.push(skill);
|
|
284197
284442
|
}
|
|
284198
284443
|
} catch (error41) {
|
|
284444
|
+
if (strict)
|
|
284445
|
+
throw error41;
|
|
284199
284446
|
logForDebugging2(`Failed to load skill from ${directSkillPath}: ${error41}`, {
|
|
284200
284447
|
level: "error"
|
|
284201
284448
|
});
|
|
@@ -284207,6 +284454,8 @@ async function loadSkillsFromDirectory(skillsPath, pluginName, sourceName, plugi
|
|
|
284207
284454
|
entries = await fs2.readdir(skillsPath);
|
|
284208
284455
|
} catch (e) {
|
|
284209
284456
|
if (!isENOENT(e)) {
|
|
284457
|
+
if (strict)
|
|
284458
|
+
throw e;
|
|
284210
284459
|
logForDebugging2(`Failed to load skills from directory ${skillsPath}: ${e}`, { level: "error" });
|
|
284211
284460
|
}
|
|
284212
284461
|
return skills;
|
|
@@ -284222,6 +284471,8 @@ async function loadSkillsFromDirectory(skillsPath, pluginName, sourceName, plugi
|
|
|
284222
284471
|
content = await fs2.readFile(skillFilePath, { encoding: "utf-8" });
|
|
284223
284472
|
} catch (e) {
|
|
284224
284473
|
if (!isENOENT(e)) {
|
|
284474
|
+
if (strict)
|
|
284475
|
+
throw e;
|
|
284225
284476
|
logForDebugging2(`Failed to load skill from ${skillFilePath}: ${e}`, {
|
|
284226
284477
|
level: "error"
|
|
284227
284478
|
});
|
|
@@ -284240,16 +284491,61 @@ async function loadSkillsFromDirectory(skillsPath, pluginName, sourceName, plugi
|
|
|
284240
284491
|
frontmatter,
|
|
284241
284492
|
content: markdownContent
|
|
284242
284493
|
};
|
|
284243
|
-
const skill = createPluginCommand(skillName, file2, sourceName, pluginManifest, pluginPath, true, { isSkillMode: true });
|
|
284494
|
+
const skill = createPluginCommand(skillName, file2, sourceName, pluginManifest, pluginPath, true, { isSkillMode: true }, pluginDataPath, strict);
|
|
284244
284495
|
if (skill) {
|
|
284245
284496
|
skills.push(skill);
|
|
284246
284497
|
}
|
|
284247
284498
|
} catch (error41) {
|
|
284499
|
+
if (strict)
|
|
284500
|
+
throw error41;
|
|
284248
284501
|
logForDebugging2(`Failed to load skill from ${skillFilePath}: ${error41}`, { level: "error" });
|
|
284249
284502
|
}
|
|
284250
284503
|
}));
|
|
284251
284504
|
return skills;
|
|
284252
284505
|
}
|
|
284506
|
+
async function loadPluginSkillsFromPlugins(enabled, options2 = {}) {
|
|
284507
|
+
const strict = options2.strict ?? false;
|
|
284508
|
+
const perPluginSkills = await Promise.all(enabled.map(async (plugin) => {
|
|
284509
|
+
const loadedPaths = new Set;
|
|
284510
|
+
const pluginSkills = [];
|
|
284511
|
+
logForDebugging2(`Checking plugin ${plugin.name}: skillsPath=${plugin.skillsPath ? "exists" : "none"}, skillsPaths=${plugin.skillsPaths ? plugin.skillsPaths.length : 0} paths`);
|
|
284512
|
+
if (plugin.skillsPath) {
|
|
284513
|
+
logForDebugging2(`Attempting to load skills from plugin ${plugin.name} default skillsPath: ${plugin.skillsPath}`);
|
|
284514
|
+
try {
|
|
284515
|
+
const skills = await loadSkillsFromDirectory(plugin.skillsPath, plugin.name, plugin.source, plugin.manifest, plugin.path, loadedPaths, plugin.dataPath, strict);
|
|
284516
|
+
pluginSkills.push(...skills);
|
|
284517
|
+
logForDebugging2(`Loaded ${skills.length} skills from plugin ${plugin.name} default directory`);
|
|
284518
|
+
} catch (error41) {
|
|
284519
|
+
if (strict)
|
|
284520
|
+
throw error41;
|
|
284521
|
+
logForDebugging2(`Failed to load skills from plugin ${plugin.name} default directory: ${error41}`, { level: "error" });
|
|
284522
|
+
}
|
|
284523
|
+
}
|
|
284524
|
+
if (plugin.skillsPaths) {
|
|
284525
|
+
logForDebugging2(`Attempting to load skills from plugin ${plugin.name} skillsPaths: ${plugin.skillsPaths.join(", ")}`);
|
|
284526
|
+
const pathResults = await Promise.all(plugin.skillsPaths.map(async (skillPath) => {
|
|
284527
|
+
try {
|
|
284528
|
+
logForDebugging2(`Loading from skillPath: ${skillPath} for plugin ${plugin.name}`);
|
|
284529
|
+
const skills = await loadSkillsFromDirectory(skillPath, plugin.name, plugin.source, plugin.manifest, plugin.path, loadedPaths, plugin.dataPath, strict);
|
|
284530
|
+
logForDebugging2(`Loaded ${skills.length} skills from plugin ${plugin.name} custom path: ${skillPath}`);
|
|
284531
|
+
return skills;
|
|
284532
|
+
} catch (error41) {
|
|
284533
|
+
if (strict)
|
|
284534
|
+
throw error41;
|
|
284535
|
+
logForDebugging2(`Failed to load skills from plugin ${plugin.name} custom path ${skillPath}: ${error41}`, { level: "error" });
|
|
284536
|
+
return [];
|
|
284537
|
+
}
|
|
284538
|
+
}));
|
|
284539
|
+
for (const skills of pathResults) {
|
|
284540
|
+
pluginSkills.push(...skills);
|
|
284541
|
+
}
|
|
284542
|
+
}
|
|
284543
|
+
return pluginSkills;
|
|
284544
|
+
}));
|
|
284545
|
+
const allSkills = perPluginSkills.flat();
|
|
284546
|
+
logForDebugging2(`Total plugin skills loaded: ${allSkills.length}`);
|
|
284547
|
+
return allSkills;
|
|
284548
|
+
}
|
|
284253
284549
|
function clearPluginSkillsCache() {
|
|
284254
284550
|
getPluginSkills.cache?.clear?.();
|
|
284255
284551
|
}
|
|
@@ -284278,140 +284574,7 @@ var init_loadPluginCommands = __esm(() => {
|
|
|
284278
284574
|
if (errors4.length > 0) {
|
|
284279
284575
|
logForDebugging2(`Plugin loading errors: ${errors4.map((e) => getPluginErrorMessage(e)).join(", ")}`);
|
|
284280
284576
|
}
|
|
284281
|
-
|
|
284282
|
-
const loadedPaths = new Set;
|
|
284283
|
-
const pluginCommands = [];
|
|
284284
|
-
if (plugin.commandsPath) {
|
|
284285
|
-
try {
|
|
284286
|
-
const commands = await loadCommandsFromDirectory(plugin.commandsPath, plugin.name, plugin.source, plugin.manifest, plugin.path, { isSkillMode: false }, loadedPaths);
|
|
284287
|
-
pluginCommands.push(...commands);
|
|
284288
|
-
if (commands.length > 0) {
|
|
284289
|
-
logForDebugging2(`Loaded ${commands.length} commands from plugin ${plugin.name} default directory`);
|
|
284290
|
-
}
|
|
284291
|
-
} catch (error41) {
|
|
284292
|
-
logForDebugging2(`Failed to load commands from plugin ${plugin.name} default directory: ${error41}`, { level: "error" });
|
|
284293
|
-
}
|
|
284294
|
-
}
|
|
284295
|
-
if (plugin.commandsPaths) {
|
|
284296
|
-
logForDebugging2(`Plugin ${plugin.name} has commandsPaths: ${plugin.commandsPaths.join(", ")}`);
|
|
284297
|
-
const pathResults = await Promise.all(plugin.commandsPaths.map(async (commandPath) => {
|
|
284298
|
-
try {
|
|
284299
|
-
const fs2 = getFsImplementation();
|
|
284300
|
-
const stats = await fs2.stat(commandPath);
|
|
284301
|
-
logForDebugging2(`Checking commandPath ${commandPath} - isDirectory: ${stats.isDirectory()}, isFile: ${stats.isFile()}`);
|
|
284302
|
-
if (stats.isDirectory()) {
|
|
284303
|
-
const commands = await loadCommandsFromDirectory(commandPath, plugin.name, plugin.source, plugin.manifest, plugin.path, { isSkillMode: false }, loadedPaths);
|
|
284304
|
-
if (commands.length > 0) {
|
|
284305
|
-
logForDebugging2(`Loaded ${commands.length} commands from plugin ${plugin.name} custom path: ${commandPath}`);
|
|
284306
|
-
} else {
|
|
284307
|
-
logForDebugging2(`Warning: No commands found in plugin ${plugin.name} custom directory: ${commandPath}. Expected .md files or SKILL.md in subdirectories.`, { level: "warn" });
|
|
284308
|
-
}
|
|
284309
|
-
return commands;
|
|
284310
|
-
} else if (stats.isFile() && commandPath.endsWith(".md")) {
|
|
284311
|
-
if (isDuplicatePath(fs2, commandPath, loadedPaths)) {
|
|
284312
|
-
return [];
|
|
284313
|
-
}
|
|
284314
|
-
const content = await fs2.readFile(commandPath, {
|
|
284315
|
-
encoding: "utf-8"
|
|
284316
|
-
});
|
|
284317
|
-
const { frontmatter, content: markdownContent } = parseFrontmatter(content, commandPath);
|
|
284318
|
-
let commandName;
|
|
284319
|
-
let metadataOverride;
|
|
284320
|
-
if (plugin.commandsMetadata) {
|
|
284321
|
-
for (const [name, metadata] of Object.entries(plugin.commandsMetadata)) {
|
|
284322
|
-
if (metadata.source) {
|
|
284323
|
-
const fullMetadataPath = join62(plugin.path, metadata.source);
|
|
284324
|
-
if (commandPath === fullMetadataPath) {
|
|
284325
|
-
commandName = `${plugin.name}:${name}`;
|
|
284326
|
-
metadataOverride = metadata;
|
|
284327
|
-
break;
|
|
284328
|
-
}
|
|
284329
|
-
}
|
|
284330
|
-
}
|
|
284331
|
-
}
|
|
284332
|
-
if (!commandName) {
|
|
284333
|
-
commandName = `${plugin.name}:${basename16(commandPath).replace(/\.md$/, "")}`;
|
|
284334
|
-
}
|
|
284335
|
-
const finalFrontmatter = metadataOverride ? {
|
|
284336
|
-
...frontmatter,
|
|
284337
|
-
...metadataOverride.description && {
|
|
284338
|
-
description: metadataOverride.description
|
|
284339
|
-
},
|
|
284340
|
-
...metadataOverride.argumentHint && {
|
|
284341
|
-
"argument-hint": metadataOverride.argumentHint
|
|
284342
|
-
},
|
|
284343
|
-
...metadataOverride.model && {
|
|
284344
|
-
model: metadataOverride.model
|
|
284345
|
-
},
|
|
284346
|
-
...metadataOverride.allowedTools && {
|
|
284347
|
-
"allowed-tools": metadataOverride.allowedTools.join(",")
|
|
284348
|
-
}
|
|
284349
|
-
} : frontmatter;
|
|
284350
|
-
const file2 = {
|
|
284351
|
-
filePath: commandPath,
|
|
284352
|
-
baseDir: dirname29(commandPath),
|
|
284353
|
-
frontmatter: finalFrontmatter,
|
|
284354
|
-
content: markdownContent
|
|
284355
|
-
};
|
|
284356
|
-
const command = createPluginCommand(commandName, file2, plugin.source, plugin.manifest, plugin.path, false);
|
|
284357
|
-
if (command) {
|
|
284358
|
-
logForDebugging2(`Loaded command from plugin ${plugin.name} custom file: ${commandPath}${metadataOverride ? " (with metadata override)" : ""}`);
|
|
284359
|
-
return [command];
|
|
284360
|
-
}
|
|
284361
|
-
}
|
|
284362
|
-
return [];
|
|
284363
|
-
} catch (error41) {
|
|
284364
|
-
logForDebugging2(`Failed to load commands from plugin ${plugin.name} custom path ${commandPath}: ${error41}`, { level: "error" });
|
|
284365
|
-
return [];
|
|
284366
|
-
}
|
|
284367
|
-
}));
|
|
284368
|
-
for (const commands of pathResults) {
|
|
284369
|
-
pluginCommands.push(...commands);
|
|
284370
|
-
}
|
|
284371
|
-
}
|
|
284372
|
-
if (plugin.commandsMetadata) {
|
|
284373
|
-
for (const [name, metadata] of Object.entries(plugin.commandsMetadata)) {
|
|
284374
|
-
if (metadata.content && !metadata.source) {
|
|
284375
|
-
try {
|
|
284376
|
-
const { frontmatter, content: markdownContent } = parseFrontmatter(metadata.content, `<inline:${plugin.name}:${name}>`);
|
|
284377
|
-
const finalFrontmatter = {
|
|
284378
|
-
...frontmatter,
|
|
284379
|
-
...metadata.description && {
|
|
284380
|
-
description: metadata.description
|
|
284381
|
-
},
|
|
284382
|
-
...metadata.argumentHint && {
|
|
284383
|
-
"argument-hint": metadata.argumentHint
|
|
284384
|
-
},
|
|
284385
|
-
...metadata.model && {
|
|
284386
|
-
model: metadata.model
|
|
284387
|
-
},
|
|
284388
|
-
...metadata.allowedTools && {
|
|
284389
|
-
"allowed-tools": metadata.allowedTools.join(",")
|
|
284390
|
-
}
|
|
284391
|
-
};
|
|
284392
|
-
const commandName = `${plugin.name}:${name}`;
|
|
284393
|
-
const file2 = {
|
|
284394
|
-
filePath: `<inline:${commandName}>`,
|
|
284395
|
-
baseDir: plugin.path,
|
|
284396
|
-
frontmatter: finalFrontmatter,
|
|
284397
|
-
content: markdownContent
|
|
284398
|
-
};
|
|
284399
|
-
const command = createPluginCommand(commandName, file2, plugin.source, plugin.manifest, plugin.path, false);
|
|
284400
|
-
if (command) {
|
|
284401
|
-
pluginCommands.push(command);
|
|
284402
|
-
logForDebugging2(`Loaded inline content command from plugin ${plugin.name}: ${commandName}`);
|
|
284403
|
-
}
|
|
284404
|
-
} catch (error41) {
|
|
284405
|
-
logForDebugging2(`Failed to load inline content command ${name} from plugin ${plugin.name}: ${error41}`, { level: "error" });
|
|
284406
|
-
}
|
|
284407
|
-
}
|
|
284408
|
-
}
|
|
284409
|
-
}
|
|
284410
|
-
return pluginCommands;
|
|
284411
|
-
}));
|
|
284412
|
-
const allCommands = perPluginCommands.flat();
|
|
284413
|
-
logForDebugging2(`Total plugin commands loaded: ${allCommands.length}`);
|
|
284414
|
-
return allCommands;
|
|
284577
|
+
return loadPluginCommandsFromPlugins(enabled);
|
|
284415
284578
|
});
|
|
284416
284579
|
getPluginSkills = memoize_default(async () => {
|
|
284417
284580
|
if (isBareMode() && getInlinePlugins().length === 0) {
|
|
@@ -284422,48 +284585,14 @@ var init_loadPluginCommands = __esm(() => {
|
|
|
284422
284585
|
logForDebugging2(`Plugin loading errors: ${errors4.map((e) => getPluginErrorMessage(e)).join(", ")}`);
|
|
284423
284586
|
}
|
|
284424
284587
|
logForDebugging2(`getPluginSkills: Processing ${enabled.length} enabled plugins`);
|
|
284425
|
-
|
|
284426
|
-
const loadedPaths = new Set;
|
|
284427
|
-
const pluginSkills = [];
|
|
284428
|
-
logForDebugging2(`Checking plugin ${plugin.name}: skillsPath=${plugin.skillsPath ? "exists" : "none"}, skillsPaths=${plugin.skillsPaths ? plugin.skillsPaths.length : 0} paths`);
|
|
284429
|
-
if (plugin.skillsPath) {
|
|
284430
|
-
logForDebugging2(`Attempting to load skills from plugin ${plugin.name} default skillsPath: ${plugin.skillsPath}`);
|
|
284431
|
-
try {
|
|
284432
|
-
const skills = await loadSkillsFromDirectory(plugin.skillsPath, plugin.name, plugin.source, plugin.manifest, plugin.path, loadedPaths);
|
|
284433
|
-
pluginSkills.push(...skills);
|
|
284434
|
-
logForDebugging2(`Loaded ${skills.length} skills from plugin ${plugin.name} default directory`);
|
|
284435
|
-
} catch (error41) {
|
|
284436
|
-
logForDebugging2(`Failed to load skills from plugin ${plugin.name} default directory: ${error41}`, { level: "error" });
|
|
284437
|
-
}
|
|
284438
|
-
}
|
|
284439
|
-
if (plugin.skillsPaths) {
|
|
284440
|
-
logForDebugging2(`Attempting to load skills from plugin ${plugin.name} skillsPaths: ${plugin.skillsPaths.join(", ")}`);
|
|
284441
|
-
const pathResults = await Promise.all(plugin.skillsPaths.map(async (skillPath) => {
|
|
284442
|
-
try {
|
|
284443
|
-
logForDebugging2(`Loading from skillPath: ${skillPath} for plugin ${plugin.name}`);
|
|
284444
|
-
const skills = await loadSkillsFromDirectory(skillPath, plugin.name, plugin.source, plugin.manifest, plugin.path, loadedPaths);
|
|
284445
|
-
logForDebugging2(`Loaded ${skills.length} skills from plugin ${plugin.name} custom path: ${skillPath}`);
|
|
284446
|
-
return skills;
|
|
284447
|
-
} catch (error41) {
|
|
284448
|
-
logForDebugging2(`Failed to load skills from plugin ${plugin.name} custom path ${skillPath}: ${error41}`, { level: "error" });
|
|
284449
|
-
return [];
|
|
284450
|
-
}
|
|
284451
|
-
}));
|
|
284452
|
-
for (const skills of pathResults) {
|
|
284453
|
-
pluginSkills.push(...skills);
|
|
284454
|
-
}
|
|
284455
|
-
}
|
|
284456
|
-
return pluginSkills;
|
|
284457
|
-
}));
|
|
284458
|
-
const allSkills = perPluginSkills.flat();
|
|
284459
|
-
logForDebugging2(`Total plugin skills loaded: ${allSkills.length}`);
|
|
284460
|
-
return allSkills;
|
|
284588
|
+
return loadPluginSkillsFromPlugins(enabled);
|
|
284461
284589
|
});
|
|
284462
284590
|
});
|
|
284463
284591
|
|
|
284464
284592
|
// src/capabilities/plugins/loadPluginHooks.ts
|
|
284465
284593
|
var exports_loadPluginHooks = {};
|
|
284466
284594
|
__export(exports_loadPluginHooks, {
|
|
284595
|
+
buildExplicitPluginHookMatchers: () => buildExplicitPluginHookMatchers,
|
|
284467
284596
|
clearPluginHookCache: () => clearPluginHookCache,
|
|
284468
284597
|
getPluginAffectingSettingsSnapshot: () => getPluginAffectingSettingsSnapshot,
|
|
284469
284598
|
loadPluginHooks: () => loadPluginHooks,
|
|
@@ -284471,6 +284600,33 @@ __export(exports_loadPluginHooks, {
|
|
|
284471
284600
|
resetHotReloadState: () => resetHotReloadState,
|
|
284472
284601
|
setupPluginHookHotReload: () => setupPluginHookHotReload
|
|
284473
284602
|
});
|
|
284603
|
+
function buildExplicitPluginHookMatchers(plugins) {
|
|
284604
|
+
const result = {};
|
|
284605
|
+
for (const event of PLUGIN_HOOK_EVENTS)
|
|
284606
|
+
result[event] = [];
|
|
284607
|
+
for (const plugin of plugins) {
|
|
284608
|
+
if (!plugin.hooksConfig)
|
|
284609
|
+
continue;
|
|
284610
|
+
for (const [event, matchers] of Object.entries(plugin.hooksConfig)) {
|
|
284611
|
+
if (!PLUGIN_HOOK_EVENTS.includes(event))
|
|
284612
|
+
continue;
|
|
284613
|
+
const hookEvent = event;
|
|
284614
|
+
const target = result[hookEvent];
|
|
284615
|
+
for (const matcher of matchers ?? []) {
|
|
284616
|
+
if (matcher.hooks.length === 0)
|
|
284617
|
+
continue;
|
|
284618
|
+
target.push({
|
|
284619
|
+
matcher: matcher.matcher,
|
|
284620
|
+
hooks: matcher.hooks,
|
|
284621
|
+
pluginRoot: plugin.path,
|
|
284622
|
+
pluginName: plugin.name,
|
|
284623
|
+
pluginId: plugin.source
|
|
284624
|
+
});
|
|
284625
|
+
}
|
|
284626
|
+
}
|
|
284627
|
+
}
|
|
284628
|
+
return result;
|
|
284629
|
+
}
|
|
284474
284630
|
function convertPluginHooksToMatchers(plugin) {
|
|
284475
284631
|
const pluginMatchers = {
|
|
284476
284632
|
PreToolUse: [],
|
|
@@ -284579,7 +284735,7 @@ function setupPluginHookHotReload() {
|
|
|
284579
284735
|
}
|
|
284580
284736
|
});
|
|
284581
284737
|
}
|
|
284582
|
-
var hotReloadSubscribed = false, lastPluginSettingsSnapshot, loadPluginHooks;
|
|
284738
|
+
var hotReloadSubscribed = false, lastPluginSettingsSnapshot, PLUGIN_HOOK_EVENTS, loadPluginHooks;
|
|
284583
284739
|
var init_loadPluginHooks = __esm(() => {
|
|
284584
284740
|
init_memoize();
|
|
284585
284741
|
init_state2();
|
|
@@ -284588,6 +284744,35 @@ var init_loadPluginHooks = __esm(() => {
|
|
|
284588
284744
|
init_settings2();
|
|
284589
284745
|
init_slowOperations();
|
|
284590
284746
|
init_pluginLoader();
|
|
284747
|
+
PLUGIN_HOOK_EVENTS = [
|
|
284748
|
+
"PreToolUse",
|
|
284749
|
+
"PostToolUse",
|
|
284750
|
+
"PostToolUseFailure",
|
|
284751
|
+
"PermissionDenied",
|
|
284752
|
+
"Notification",
|
|
284753
|
+
"UserPromptSubmit",
|
|
284754
|
+
"SessionStart",
|
|
284755
|
+
"SessionEnd",
|
|
284756
|
+
"Stop",
|
|
284757
|
+
"StopFailure",
|
|
284758
|
+
"SubagentStart",
|
|
284759
|
+
"SubagentStop",
|
|
284760
|
+
"PreCompact",
|
|
284761
|
+
"PostCompact",
|
|
284762
|
+
"PermissionRequest",
|
|
284763
|
+
"Setup",
|
|
284764
|
+
"TeammateIdle",
|
|
284765
|
+
"TaskCreated",
|
|
284766
|
+
"TaskCompleted",
|
|
284767
|
+
"Elicitation",
|
|
284768
|
+
"ElicitationResult",
|
|
284769
|
+
"ConfigChange",
|
|
284770
|
+
"WorktreeCreate",
|
|
284771
|
+
"WorktreeRemove",
|
|
284772
|
+
"InstructionsLoaded",
|
|
284773
|
+
"CwdChanged",
|
|
284774
|
+
"FileChanged"
|
|
284775
|
+
];
|
|
284591
284776
|
loadPluginHooks = memoize_default(async () => {
|
|
284592
284777
|
const { enabled } = await loadAllPluginsCacheOnly();
|
|
284593
284778
|
const allPluginHooks = {
|
|
@@ -284638,16 +284823,16 @@ var init_loadPluginHooks = __esm(() => {
|
|
|
284638
284823
|
|
|
284639
284824
|
// src/capabilities/plugins/loadPluginOutputStyles.ts
|
|
284640
284825
|
import { basename as basename17 } from "path";
|
|
284641
|
-
async function loadOutputStylesFromDirectory(outputStylesPath, pluginName, loadedPaths) {
|
|
284826
|
+
async function loadOutputStylesFromDirectory(outputStylesPath, pluginName, sourceName, loadedPaths, strict = false) {
|
|
284642
284827
|
const styles4 = [];
|
|
284643
284828
|
await walkPluginMarkdown(outputStylesPath, async (fullPath) => {
|
|
284644
|
-
const style = await loadOutputStyleFromFile(fullPath, pluginName, loadedPaths);
|
|
284829
|
+
const style = await loadOutputStyleFromFile(fullPath, pluginName, sourceName, loadedPaths, strict);
|
|
284645
284830
|
if (style)
|
|
284646
284831
|
styles4.push(style);
|
|
284647
284832
|
}, { logLabel: "output-styles" });
|
|
284648
284833
|
return styles4;
|
|
284649
284834
|
}
|
|
284650
|
-
async function loadOutputStyleFromFile(filePath, pluginName, loadedPaths) {
|
|
284835
|
+
async function loadOutputStyleFromFile(filePath, pluginName, sourceName, loadedPaths, strict = false) {
|
|
284651
284836
|
const fs2 = getFsImplementation();
|
|
284652
284837
|
if (isDuplicatePath(fs2, filePath, loadedPaths)) {
|
|
284653
284838
|
return null;
|
|
@@ -284666,15 +284851,65 @@ async function loadOutputStyleFromFile(filePath, pluginName, loadedPaths) {
|
|
|
284666
284851
|
description,
|
|
284667
284852
|
prompt: markdownContent.trim(),
|
|
284668
284853
|
source: "plugin",
|
|
284854
|
+
plugin: sourceName,
|
|
284669
284855
|
forceForPlugin
|
|
284670
284856
|
};
|
|
284671
284857
|
} catch (error41) {
|
|
284858
|
+
if (strict)
|
|
284859
|
+
throw error41;
|
|
284672
284860
|
logForDebugging2(`Failed to load output style from ${filePath}: ${error41}`, {
|
|
284673
284861
|
level: "error"
|
|
284674
284862
|
});
|
|
284675
284863
|
return null;
|
|
284676
284864
|
}
|
|
284677
284865
|
}
|
|
284866
|
+
async function loadPluginOutputStylesFromPlugins(enabled, options2 = {}) {
|
|
284867
|
+
const strict = options2.strict ?? false;
|
|
284868
|
+
const allStyles = [];
|
|
284869
|
+
for (const plugin of enabled) {
|
|
284870
|
+
const loadedPaths = new Set;
|
|
284871
|
+
if (plugin.outputStylesPath) {
|
|
284872
|
+
try {
|
|
284873
|
+
const styles4 = await loadOutputStylesFromDirectory(plugin.outputStylesPath, plugin.name, plugin.source, loadedPaths, strict);
|
|
284874
|
+
allStyles.push(...styles4);
|
|
284875
|
+
if (styles4.length > 0) {
|
|
284876
|
+
logForDebugging2(`Loaded ${styles4.length} output styles from plugin ${plugin.name} default directory`);
|
|
284877
|
+
}
|
|
284878
|
+
} catch (error41) {
|
|
284879
|
+
if (strict)
|
|
284880
|
+
throw error41;
|
|
284881
|
+
logForDebugging2(`Failed to load output styles from plugin ${plugin.name} default directory: ${error41}`, { level: "error" });
|
|
284882
|
+
}
|
|
284883
|
+
}
|
|
284884
|
+
if (plugin.outputStylesPaths) {
|
|
284885
|
+
for (const stylePath of plugin.outputStylesPaths) {
|
|
284886
|
+
try {
|
|
284887
|
+
const fs2 = getFsImplementation();
|
|
284888
|
+
const stats = await fs2.stat(stylePath);
|
|
284889
|
+
if (stats.isDirectory()) {
|
|
284890
|
+
const styles4 = await loadOutputStylesFromDirectory(stylePath, plugin.name, plugin.source, loadedPaths, strict);
|
|
284891
|
+
allStyles.push(...styles4);
|
|
284892
|
+
if (styles4.length > 0) {
|
|
284893
|
+
logForDebugging2(`Loaded ${styles4.length} output styles from plugin ${plugin.name} custom path: ${stylePath}`);
|
|
284894
|
+
}
|
|
284895
|
+
} else if (stats.isFile() && stylePath.endsWith(".md")) {
|
|
284896
|
+
const style = await loadOutputStyleFromFile(stylePath, plugin.name, plugin.source, loadedPaths, strict);
|
|
284897
|
+
if (style) {
|
|
284898
|
+
allStyles.push(style);
|
|
284899
|
+
logForDebugging2(`Loaded output style from plugin ${plugin.name} custom file: ${stylePath}`);
|
|
284900
|
+
}
|
|
284901
|
+
}
|
|
284902
|
+
} catch (error41) {
|
|
284903
|
+
if (strict)
|
|
284904
|
+
throw error41;
|
|
284905
|
+
logForDebugging2(`Failed to load output styles from plugin ${plugin.name} custom path ${stylePath}: ${error41}`, { level: "error" });
|
|
284906
|
+
}
|
|
284907
|
+
}
|
|
284908
|
+
}
|
|
284909
|
+
}
|
|
284910
|
+
logForDebugging2(`Total plugin output styles loaded: ${allStyles.length}`);
|
|
284911
|
+
return allStyles;
|
|
284912
|
+
}
|
|
284678
284913
|
function clearPluginOutputStyleCache() {
|
|
284679
284914
|
loadPluginOutputStyles.cache?.clear?.();
|
|
284680
284915
|
}
|
|
@@ -284689,49 +284924,10 @@ var init_loadPluginOutputStyles = __esm(() => {
|
|
|
284689
284924
|
init_walkPluginMarkdown();
|
|
284690
284925
|
loadPluginOutputStyles = memoize_default(async () => {
|
|
284691
284926
|
const { enabled, errors: errors4 } = await loadAllPluginsCacheOnly();
|
|
284692
|
-
const allStyles = [];
|
|
284693
284927
|
if (errors4.length > 0) {
|
|
284694
284928
|
logForDebugging2(`Plugin loading errors: ${errors4.map((e) => getPluginErrorMessage(e)).join(", ")}`);
|
|
284695
284929
|
}
|
|
284696
|
-
|
|
284697
|
-
const loadedPaths = new Set;
|
|
284698
|
-
if (plugin.outputStylesPath) {
|
|
284699
|
-
try {
|
|
284700
|
-
const styles4 = await loadOutputStylesFromDirectory(plugin.outputStylesPath, plugin.name, loadedPaths);
|
|
284701
|
-
allStyles.push(...styles4);
|
|
284702
|
-
if (styles4.length > 0) {
|
|
284703
|
-
logForDebugging2(`Loaded ${styles4.length} output styles from plugin ${plugin.name} default directory`);
|
|
284704
|
-
}
|
|
284705
|
-
} catch (error41) {
|
|
284706
|
-
logForDebugging2(`Failed to load output styles from plugin ${plugin.name} default directory: ${error41}`, { level: "error" });
|
|
284707
|
-
}
|
|
284708
|
-
}
|
|
284709
|
-
if (plugin.outputStylesPaths) {
|
|
284710
|
-
for (const stylePath of plugin.outputStylesPaths) {
|
|
284711
|
-
try {
|
|
284712
|
-
const fs2 = getFsImplementation();
|
|
284713
|
-
const stats = await fs2.stat(stylePath);
|
|
284714
|
-
if (stats.isDirectory()) {
|
|
284715
|
-
const styles4 = await loadOutputStylesFromDirectory(stylePath, plugin.name, loadedPaths);
|
|
284716
|
-
allStyles.push(...styles4);
|
|
284717
|
-
if (styles4.length > 0) {
|
|
284718
|
-
logForDebugging2(`Loaded ${styles4.length} output styles from plugin ${plugin.name} custom path: ${stylePath}`);
|
|
284719
|
-
}
|
|
284720
|
-
} else if (stats.isFile() && stylePath.endsWith(".md")) {
|
|
284721
|
-
const style = await loadOutputStyleFromFile(stylePath, plugin.name, loadedPaths);
|
|
284722
|
-
if (style) {
|
|
284723
|
-
allStyles.push(style);
|
|
284724
|
-
logForDebugging2(`Loaded output style from plugin ${plugin.name} custom file: ${stylePath}`);
|
|
284725
|
-
}
|
|
284726
|
-
}
|
|
284727
|
-
} catch (error41) {
|
|
284728
|
-
logForDebugging2(`Failed to load output styles from plugin ${plugin.name} custom path ${stylePath}: ${error41}`, { level: "error" });
|
|
284729
|
-
}
|
|
284730
|
-
}
|
|
284731
|
-
}
|
|
284732
|
-
}
|
|
284733
|
-
logForDebugging2(`Total plugin output styles loaded: ${allStyles.length}`);
|
|
284734
|
-
return allStyles;
|
|
284930
|
+
return loadPluginOutputStylesFromPlugins(enabled);
|
|
284735
284931
|
});
|
|
284736
284932
|
});
|
|
284737
284933
|
|
|
@@ -287606,7 +287802,7 @@ var init_pluginInstallationHelpers = __esm(() => {
|
|
|
287606
287802
|
});
|
|
287607
287803
|
|
|
287608
287804
|
// src/capabilities/plugins/pluginLoader.ts
|
|
287609
|
-
import { basename as basename20, dirname as dirname35, join as join69, relative as relative11, resolve as resolve29, sep as sep20 } from "path";
|
|
287805
|
+
import { basename as basename20, dirname as dirname35, isAbsolute as isAbsolute21, join as join69, relative as relative11, resolve as resolve29, sep as sep20 } from "path";
|
|
287610
287806
|
function getPluginCachePath() {
|
|
287611
287807
|
return join69(getPluginsDirectory(), "cache");
|
|
287612
287808
|
}
|
|
@@ -288103,14 +288299,31 @@ async function loadPluginHooks2(hooksConfigPath, pluginName) {
|
|
|
288103
288299
|
return validatedPluginHooks.hooks;
|
|
288104
288300
|
}
|
|
288105
288301
|
async function validatePluginPaths(relPaths, pluginPath, pluginName, source, component, componentLabel, contextLabel, errors4) {
|
|
288302
|
+
const fs2 = getFsImplementation();
|
|
288303
|
+
const pluginRoot = await fs2.realpath(pluginPath);
|
|
288106
288304
|
const checks4 = await Promise.all(relPaths.map(async (relPath) => {
|
|
288107
|
-
const fullPath =
|
|
288108
|
-
|
|
288305
|
+
const fullPath = resolve29(pluginPath, relPath);
|
|
288306
|
+
if (!await pathExists(fullPath)) {
|
|
288307
|
+
return { relPath, fullPath, exists: false, escaped: false };
|
|
288308
|
+
}
|
|
288309
|
+
const realPath = await fs2.realpath(fullPath);
|
|
288310
|
+
const pathFromRoot = relative11(pluginRoot, realPath);
|
|
288311
|
+
const escaped = pathFromRoot === ".." || pathFromRoot.startsWith(`..${sep20}`) || isAbsolute21(pathFromRoot);
|
|
288312
|
+
return { relPath, fullPath, exists: true, escaped };
|
|
288109
288313
|
}));
|
|
288110
288314
|
const validPaths = [];
|
|
288111
|
-
for (const { relPath, fullPath, exists } of checks4) {
|
|
288112
|
-
if (exists) {
|
|
288315
|
+
for (const { relPath, fullPath, exists, escaped } of checks4) {
|
|
288316
|
+
if (exists && !escaped) {
|
|
288113
288317
|
validPaths.push(fullPath);
|
|
288318
|
+
} else if (escaped) {
|
|
288319
|
+
errors4.push({
|
|
288320
|
+
type: "component-load-failed",
|
|
288321
|
+
source,
|
|
288322
|
+
plugin: pluginName,
|
|
288323
|
+
path: fullPath,
|
|
288324
|
+
component,
|
|
288325
|
+
reason: "Path resolves outside the plugin root"
|
|
288326
|
+
});
|
|
288114
288327
|
} else {
|
|
288115
288328
|
logForDebugging2(`${componentLabel} path ${relPath} ${contextLabel} not found at ${fullPath} for ${pluginName}`, { level: "warn" });
|
|
288116
288329
|
logError2(new Error(`Plugin component file not found: ${fullPath} for ${pluginName}`));
|
|
@@ -305546,7 +305759,7 @@ var builders = null;
|
|
|
305546
305759
|
import {
|
|
305547
305760
|
basename as basename22,
|
|
305548
305761
|
dirname as dirname39,
|
|
305549
|
-
isAbsolute as
|
|
305762
|
+
isAbsolute as isAbsolute22,
|
|
305550
305763
|
join as join78,
|
|
305551
305764
|
sep as pathSep2,
|
|
305552
305765
|
relative as relative13
|
|
@@ -306029,8 +306242,8 @@ function activateConditionalSkillsForPaths(filePaths, cwd) {
|
|
|
306029
306242
|
}
|
|
306030
306243
|
const skillIgnore = import_ignore2.default().add(skill.paths);
|
|
306031
306244
|
for (const filePath of filePaths) {
|
|
306032
|
-
const relativePath =
|
|
306033
|
-
if (!relativePath || relativePath.startsWith("..") ||
|
|
306245
|
+
const relativePath = isAbsolute22(filePath) ? relative13(cwd, filePath) : filePath;
|
|
306246
|
+
if (!relativePath || relativePath.startsWith("..") || isAbsolute22(relativePath)) {
|
|
306034
306247
|
continue;
|
|
306035
306248
|
}
|
|
306036
306249
|
if (skillIgnore.ignores(relativePath)) {
|
|
@@ -342619,14 +342832,14 @@ var init_measure_text = __esm(() => {
|
|
|
342619
342832
|
});
|
|
342620
342833
|
|
|
342621
342834
|
// src/cli/ink/node-cache.ts
|
|
342622
|
-
function addPendingClear(parent, rect,
|
|
342835
|
+
function addPendingClear(parent, rect, isAbsolute23) {
|
|
342623
342836
|
const existing = pendingClears.get(parent);
|
|
342624
342837
|
if (existing) {
|
|
342625
342838
|
existing.push(rect);
|
|
342626
342839
|
} else {
|
|
342627
342840
|
pendingClears.set(parent, [rect]);
|
|
342628
342841
|
}
|
|
342629
|
-
if (
|
|
342842
|
+
if (isAbsolute23) {
|
|
342630
342843
|
absoluteNodeRemoved = true;
|
|
342631
342844
|
}
|
|
342632
342845
|
}
|
|
@@ -343008,17 +343221,17 @@ function collectRemovedRects(parent, removed, underAbsolute = false) {
|
|
|
343008
343221
|
if (!removed || removed.nodeName === "#text")
|
|
343009
343222
|
return;
|
|
343010
343223
|
const elem = removed;
|
|
343011
|
-
const
|
|
343224
|
+
const isAbsolute23 = underAbsolute || elem.style?.position === "absolute";
|
|
343012
343225
|
const cached3 = nodeCache.get(elem);
|
|
343013
343226
|
if (cached3) {
|
|
343014
|
-
addPendingClear(parent, cached3,
|
|
343227
|
+
addPendingClear(parent, cached3, isAbsolute23);
|
|
343015
343228
|
nodeCache.delete(elem);
|
|
343016
343229
|
}
|
|
343017
343230
|
const childNodes = Array.isArray(elem.childNodes) ? [...elem.childNodes] : [];
|
|
343018
343231
|
for (const child of childNodes) {
|
|
343019
343232
|
if (!child)
|
|
343020
343233
|
continue;
|
|
343021
|
-
collectRemovedRects(parent, child,
|
|
343234
|
+
collectRemovedRects(parent, child, isAbsolute23);
|
|
343022
343235
|
}
|
|
343023
343236
|
}
|
|
343024
343237
|
function stylesEqual(a2, b) {
|
|
@@ -349480,16 +349693,16 @@ function renderChildren(node, output, offsetX, offsetY, hasRemovedChild, prevScr
|
|
|
349480
349693
|
}
|
|
349481
349694
|
const childElem = childNode;
|
|
349482
349695
|
const wasDirty = childElem.dirty;
|
|
349483
|
-
const
|
|
349696
|
+
const isAbsolute23 = childElem.style.position === "absolute";
|
|
349484
349697
|
renderNodeToOutput(childElem, output, {
|
|
349485
349698
|
offsetX,
|
|
349486
349699
|
offsetY,
|
|
349487
349700
|
prevScreen: hasRemovedChild || seenDirtyChild ? undefined : prevScreen,
|
|
349488
|
-
skipSelfBlit: seenDirtyClipped &&
|
|
349701
|
+
skipSelfBlit: seenDirtyClipped && isAbsolute23 && !childElem.style.opaque && childElem.style.backgroundColor === undefined,
|
|
349489
349702
|
inheritedBackgroundColor
|
|
349490
349703
|
});
|
|
349491
349704
|
if (wasDirty && !seenDirtyChild) {
|
|
349492
|
-
if (!clipsBothAxes(childElem) ||
|
|
349705
|
+
if (!clipsBothAxes(childElem) || isAbsolute23) {
|
|
349493
349706
|
seenDirtyChild = true;
|
|
349494
349707
|
} else {
|
|
349495
349708
|
seenDirtyClipped = true;
|
|
@@ -353657,7 +353870,7 @@ var init_ink3 = __esm(() => {
|
|
|
353657
353870
|
|
|
353658
353871
|
// src/capabilities/imagePaste.ts
|
|
353659
353872
|
import { randomBytes as randomBytes12 } from "crypto";
|
|
353660
|
-
import { basename as basename27, extname as extname8, isAbsolute as
|
|
353873
|
+
import { basename as basename27, extname as extname8, isAbsolute as isAbsolute23, join as join85 } from "path";
|
|
353661
353874
|
function buildLinuxClipboardCheckCommand() {
|
|
353662
353875
|
const mimePattern = LINUX_CLIPBOARD_IMAGE_MIME_TYPES.map((mimeType) => mimeType.replace("/", "\\/")).join("|");
|
|
353663
353876
|
return `xclip -selection clipboard -t TARGETS -o 2>/dev/null | grep -E "${mimePattern}" || wl-paste -l 2>/dev/null | grep -E "${mimePattern}"`;
|
|
@@ -353804,7 +354017,7 @@ async function tryReadImageFromPath(text) {
|
|
|
353804
354017
|
const imagePath = cleanedPath;
|
|
353805
354018
|
let imageBuffer;
|
|
353806
354019
|
try {
|
|
353807
|
-
if (
|
|
354020
|
+
if (isAbsolute23(imagePath)) {
|
|
353808
354021
|
imageBuffer = getFsImplementation().readFileBytesSync(imagePath);
|
|
353809
354022
|
} else {
|
|
353810
354023
|
const clipboardPath = await getImagePathFromClipboard();
|
|
@@ -482433,7 +482646,7 @@ var init_usePluginAutoupdateNotification = __esm(() => {
|
|
|
482433
482646
|
});
|
|
482434
482647
|
|
|
482435
482648
|
// src/capabilities/plugins/reconciler.ts
|
|
482436
|
-
import { isAbsolute as
|
|
482649
|
+
import { isAbsolute as isAbsolute24, resolve as resolve37 } from "path";
|
|
482437
482650
|
function diffMarketplaces(declared, materialized, opts) {
|
|
482438
482651
|
const missing = [];
|
|
482439
482652
|
const sourceChanged = [];
|
|
@@ -482541,7 +482754,7 @@ async function reconcileMarketplaces(opts) {
|
|
|
482541
482754
|
return { installed, updated, failed, upToDate: diff2.upToDate, skipped };
|
|
482542
482755
|
}
|
|
482543
482756
|
function normalizeSource(source, projectRoot) {
|
|
482544
|
-
if ((source.source === "directory" || source.source === "file") && !
|
|
482757
|
+
if ((source.source === "directory" || source.source === "file") && !isAbsolute24(source.path)) {
|
|
482545
482758
|
const base2 = projectRoot ?? getOriginalCwd();
|
|
482546
482759
|
const canonicalRoot = findCanonicalGitRoot(base2);
|
|
482547
482760
|
return {
|
|
@@ -492185,7 +492398,7 @@ function buildPrimarySection() {
|
|
|
492185
492398
|
}, undefined, false, undefined, this);
|
|
492186
492399
|
return [{
|
|
492187
492400
|
label: "Version",
|
|
492188
|
-
value: "0.4.
|
|
492401
|
+
value: "0.4.23"
|
|
492189
492402
|
}, {
|
|
492190
492403
|
label: "Session name",
|
|
492191
492404
|
value: nameValue
|
|
@@ -540327,7 +540540,7 @@ var init_bridge_kick = __esm(() => {
|
|
|
540327
540540
|
var call58 = async () => {
|
|
540328
540541
|
return {
|
|
540329
540542
|
type: "text",
|
|
540330
|
-
value: `${"99.0.0"} (built ${"2026-08-
|
|
540543
|
+
value: `${"99.0.0"} (built ${"2026-08-28T10:03:59.640Z"})`
|
|
540331
540544
|
};
|
|
540332
540545
|
}, version2, version_default;
|
|
540333
540546
|
var init_version = __esm(() => {
|
|
@@ -553010,7 +553223,7 @@ __export(exports_UI12, {
|
|
|
553010
553223
|
renderToolUseRejectedMessage: () => renderToolUseRejectedMessage14,
|
|
553011
553224
|
userFacingName: () => userFacingName11
|
|
553012
553225
|
});
|
|
553013
|
-
import { isAbsolute as
|
|
553226
|
+
import { isAbsolute as isAbsolute25, relative as relative31, resolve as resolve41 } from "path";
|
|
553014
553227
|
function countLines(content) {
|
|
553015
553228
|
const parts = content.split(EOL5);
|
|
553016
553229
|
return content.endsWith(EOL5) ? parts.length - 1 : parts.length;
|
|
@@ -553334,7 +553547,7 @@ function WriteRejectionBody(t0) {
|
|
|
553334
553547
|
}
|
|
553335
553548
|
async function loadRejectionDiff2(filePath, content) {
|
|
553336
553549
|
try {
|
|
553337
|
-
const fullFilePath =
|
|
553550
|
+
const fullFilePath = isAbsolute25(filePath) ? filePath : resolve41(getCwd2(), filePath);
|
|
553338
553551
|
const handle = await openForScan(fullFilePath);
|
|
553339
553552
|
if (handle === null)
|
|
553340
553553
|
return {
|
|
@@ -558094,7 +558307,7 @@ function WelcomeV2() {
|
|
|
558094
558307
|
dimColor: true,
|
|
558095
558308
|
children: [
|
|
558096
558309
|
"v",
|
|
558097
|
-
"0.4.
|
|
558310
|
+
"0.4.23",
|
|
558098
558311
|
" "
|
|
558099
558312
|
]
|
|
558100
558313
|
}, undefined, true, undefined, this)
|
|
@@ -558294,7 +558507,7 @@ function WelcomeV2() {
|
|
|
558294
558507
|
dimColor: true,
|
|
558295
558508
|
children: [
|
|
558296
558509
|
"v",
|
|
558297
|
-
"0.4.
|
|
558510
|
+
"0.4.23",
|
|
558298
558511
|
" "
|
|
558299
558512
|
]
|
|
558300
558513
|
}, undefined, true, undefined, this)
|
|
@@ -558520,7 +558733,7 @@ function AppleTerminalWelcomeV2(t0) {
|
|
|
558520
558733
|
dimColor: true,
|
|
558521
558734
|
children: [
|
|
558522
558735
|
"v",
|
|
558523
|
-
"0.4.
|
|
558736
|
+
"0.4.23",
|
|
558524
558737
|
" "
|
|
558525
558738
|
]
|
|
558526
558739
|
}, undefined, true, undefined, this);
|
|
@@ -558774,7 +558987,7 @@ function AppleTerminalWelcomeV2(t0) {
|
|
|
558774
558987
|
dimColor: true,
|
|
558775
558988
|
children: [
|
|
558776
558989
|
"v",
|
|
558777
|
-
"0.4.
|
|
558990
|
+
"0.4.23",
|
|
558778
558991
|
" "
|
|
558779
558992
|
]
|
|
558780
558993
|
}, undefined, true, undefined, this);
|
|
@@ -579759,7 +579972,7 @@ Usage: claude --remote "your task description"`, () => gracefulShutdown(1));
|
|
|
579759
579972
|
pendingHookMessages
|
|
579760
579973
|
}, renderAndRun);
|
|
579761
579974
|
}
|
|
579762
|
-
}).version("0.4.
|
|
579975
|
+
}).version("0.4.23 (OpenCow)", "-v, --version", "Output the version number");
|
|
579763
579976
|
program2.option("-w, --worktree [name]", "Create a new git worktree for this session (optionally specify a name)");
|
|
579764
579977
|
program2.option("--tmux", "Create a tmux session for the worktree (requires --worktree). Uses iTerm2 native panes when available; use --tmux=classic for traditional tmux.");
|
|
579765
579978
|
if (canUserConfigureAdvisor()) {
|
|
@@ -580404,7 +580617,7 @@ if (false) {}
|
|
|
580404
580617
|
async function main2() {
|
|
580405
580618
|
const args = process.argv.slice(2);
|
|
580406
580619
|
if (args.length === 1 && (args[0] === "--version" || args[0] === "-v" || args[0] === "-V")) {
|
|
580407
|
-
console.log(`${"0.4.
|
|
580620
|
+
console.log(`${"0.4.23"} (OpenCow)`);
|
|
580408
580621
|
return;
|
|
580409
580622
|
}
|
|
580410
580623
|
if (args.includes("--provider")) {
|
|
@@ -580522,4 +580735,4 @@ async function main2() {
|
|
|
580522
580735
|
}
|
|
580523
580736
|
main2();
|
|
580524
580737
|
|
|
580525
|
-
//# debugId=
|
|
580738
|
+
//# debugId=76BE00AA5948715464756E2164756E21
|