@papert-code/papert-code 0.3.2 → 0.3.3
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/cli.js +109 -82
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -15760,10 +15760,10 @@ var require_headers = __commonJS({
|
|
|
15760
15760
|
const lowercaseName = isLowerCase ? name3 : name3.toLowerCase();
|
|
15761
15761
|
const exists2 = this.headersMap.get(lowercaseName);
|
|
15762
15762
|
if (exists2) {
|
|
15763
|
-
const
|
|
15763
|
+
const delimiter3 = lowercaseName === "cookie" ? "; " : ", ";
|
|
15764
15764
|
this.headersMap.set(lowercaseName, {
|
|
15765
15765
|
name: exists2.name,
|
|
15766
|
-
value: `${exists2.value}${
|
|
15766
|
+
value: `${exists2.value}${delimiter3}${value}`
|
|
15767
15767
|
});
|
|
15768
15768
|
} else {
|
|
15769
15769
|
this.headersMap.set(lowercaseName, { name: name3, value });
|
|
@@ -23574,8 +23574,8 @@ var require_common2 = __commonJS({
|
|
|
23574
23574
|
return debug2;
|
|
23575
23575
|
}
|
|
23576
23576
|
__name(createDebug, "createDebug");
|
|
23577
|
-
function extend2(namespace,
|
|
23578
|
-
const newDebug = createDebug(this.namespace + (typeof
|
|
23577
|
+
function extend2(namespace, delimiter3) {
|
|
23578
|
+
const newDebug = createDebug(this.namespace + (typeof delimiter3 === "undefined" ? ":" : delimiter3) + namespace);
|
|
23579
23579
|
newDebug.log = this.log;
|
|
23580
23580
|
return newDebug;
|
|
23581
23581
|
}
|
|
@@ -94550,7 +94550,7 @@ import { fileURLToPath as fileURLToPath5 } from "node:url";
|
|
|
94550
94550
|
import path15 from "node:path";
|
|
94551
94551
|
async function getVersion() {
|
|
94552
94552
|
const pkgJson = await getPackageJson(__dirname3);
|
|
94553
|
-
return "0.3.
|
|
94553
|
+
return "0.3.3";
|
|
94554
94554
|
}
|
|
94555
94555
|
var __filename2, __dirname3;
|
|
94556
94556
|
var init_version2 = __esm({
|
|
@@ -154935,10 +154935,10 @@ async function* iterSSEChunks(iterator) {
|
|
|
154935
154935
|
yield data;
|
|
154936
154936
|
}
|
|
154937
154937
|
}
|
|
154938
|
-
function partition(str2,
|
|
154939
|
-
const index = str2.indexOf(
|
|
154938
|
+
function partition(str2, delimiter3) {
|
|
154939
|
+
const index = str2.indexOf(delimiter3);
|
|
154940
154940
|
if (index !== -1) {
|
|
154941
|
-
return [str2.substring(0, index),
|
|
154941
|
+
return [str2.substring(0, index), delimiter3, str2.substring(index + delimiter3.length)];
|
|
154942
154942
|
}
|
|
154943
154943
|
return [str2, "", ""];
|
|
154944
154944
|
}
|
|
@@ -165224,7 +165224,7 @@ function createContentGeneratorConfig(config2, authType, generationConfig) {
|
|
|
165224
165224
|
};
|
|
165225
165225
|
}
|
|
165226
165226
|
async function createContentGenerator(config2, gcConfig, isInitialAuth) {
|
|
165227
|
-
const version3 = "0.3.
|
|
165227
|
+
const version3 = "0.3.3";
|
|
165228
165228
|
const userAgent2 = `PapertCode/${version3} (${process.platform}; ${process.arch})`;
|
|
165229
165229
|
const baseHeaders = {
|
|
165230
165230
|
"User-Agent": userAgent2
|
|
@@ -291931,9 +291931,9 @@ var require_stringify3 = __commonJS({
|
|
|
291931
291931
|
type,
|
|
291932
291932
|
value
|
|
291933
291933
|
}) => {
|
|
291934
|
-
const
|
|
291934
|
+
const delimiter3 = inline2 ? SPACE2 : LF3 + deeper_gap;
|
|
291935
291935
|
is_line_comment = type === "LineComment";
|
|
291936
|
-
return prev +
|
|
291936
|
+
return prev + delimiter3 + comment_stringify(value, is_line_comment);
|
|
291937
291937
|
}, EMPTY2);
|
|
291938
291938
|
return display_block || is_line_comment ? str2 + LF3 + deeper_gap : str2;
|
|
291939
291939
|
}, "process_comments");
|
|
@@ -334076,10 +334076,28 @@ init_esbuild_shims();
|
|
|
334076
334076
|
// packages/cli/src/config/skill.ts
|
|
334077
334077
|
init_esbuild_shims();
|
|
334078
334078
|
import * as fs76 from "node:fs";
|
|
334079
|
-
import * as
|
|
334080
|
-
import * as
|
|
334079
|
+
import * as path85 from "node:path";
|
|
334080
|
+
import * as os26 from "node:os";
|
|
334081
334081
|
import { fileURLToPath as fileURLToPath13 } from "node:url";
|
|
334082
334082
|
|
|
334083
|
+
// packages/cli/src/utils/resolvePath.ts
|
|
334084
|
+
init_esbuild_shims();
|
|
334085
|
+
import * as os24 from "node:os";
|
|
334086
|
+
import * as path82 from "node:path";
|
|
334087
|
+
function resolvePath2(p) {
|
|
334088
|
+
if (!p) {
|
|
334089
|
+
return "";
|
|
334090
|
+
}
|
|
334091
|
+
let expandedPath = p;
|
|
334092
|
+
if (p.toLowerCase().startsWith("%userprofile%")) {
|
|
334093
|
+
expandedPath = os24.homedir() + p.substring("%userprofile%".length);
|
|
334094
|
+
} else if (p === "~" || p.startsWith("~/")) {
|
|
334095
|
+
expandedPath = os24.homedir() + p.substring(1);
|
|
334096
|
+
}
|
|
334097
|
+
return path82.normalize(expandedPath);
|
|
334098
|
+
}
|
|
334099
|
+
__name(resolvePath2, "resolvePath");
|
|
334100
|
+
|
|
334083
334101
|
// packages/cli/src/config/skills/github.ts
|
|
334084
334102
|
init_esbuild_shims();
|
|
334085
334103
|
init_esm12();
|
|
@@ -334133,10 +334151,10 @@ function skillUpdatesReducer(state, action) {
|
|
|
334133
334151
|
__name(skillUpdatesReducer, "skillUpdatesReducer");
|
|
334134
334152
|
|
|
334135
334153
|
// packages/cli/src/config/skills/github.ts
|
|
334136
|
-
import * as
|
|
334154
|
+
import * as os25 from "node:os";
|
|
334137
334155
|
import * as https5 from "node:https";
|
|
334138
334156
|
import * as fs74 from "node:fs";
|
|
334139
|
-
import * as
|
|
334157
|
+
import * as path83 from "node:path";
|
|
334140
334158
|
var import_extract_zip2 = __toESM(require_extract_zip(), 1);
|
|
334141
334159
|
function getGitHubToken2() {
|
|
334142
334160
|
return process.env["GITHUB_TOKEN"];
|
|
@@ -334231,7 +334249,7 @@ async function checkForSkillUpdate(skill, setSkillUpdateState, cwd8 = process.cw
|
|
|
334231
334249
|
}
|
|
334232
334250
|
try {
|
|
334233
334251
|
if (installMetadata.type === "git") {
|
|
334234
|
-
if (!fs74.existsSync(
|
|
334252
|
+
if (!fs74.existsSync(path83.join(skill.path, ".git"))) {
|
|
334235
334253
|
console.error(
|
|
334236
334254
|
`Skill "${skill.name}" was installed without git metadata and cannot be auto-updated.`
|
|
334237
334255
|
);
|
|
@@ -334329,9 +334347,9 @@ async function downloadFromGitHubRelease2(installMetadata, destination) {
|
|
|
334329
334347
|
`No assets found for release with tag ${releaseData.tag_name}`
|
|
334330
334348
|
);
|
|
334331
334349
|
}
|
|
334332
|
-
let downloadedAssetPath =
|
|
334350
|
+
let downloadedAssetPath = path83.join(
|
|
334333
334351
|
destination,
|
|
334334
|
-
|
|
334352
|
+
path83.basename(new URL(archiveUrl).pathname)
|
|
334335
334353
|
);
|
|
334336
334354
|
if (isTar && !downloadedAssetPath.endsWith(".tar.gz")) {
|
|
334337
334355
|
downloadedAssetPath += ".tar.gz";
|
|
@@ -334345,13 +334363,13 @@ async function downloadFromGitHubRelease2(installMetadata, destination) {
|
|
|
334345
334363
|
});
|
|
334346
334364
|
if (entries.length === 2) {
|
|
334347
334365
|
const lonelyDir = entries.find((entry) => entry.isDirectory());
|
|
334348
|
-
if (lonelyDir && fs74.existsSync(
|
|
334349
|
-
const dirPathToExtract =
|
|
334366
|
+
if (lonelyDir && fs74.existsSync(path83.join(destination, lonelyDir.name, SKILL_FILENAME))) {
|
|
334367
|
+
const dirPathToExtract = path83.join(destination, lonelyDir.name);
|
|
334350
334368
|
const extractedDirFiles = await fs74.promises.readdir(dirPathToExtract);
|
|
334351
334369
|
for (const file of extractedDirFiles) {
|
|
334352
334370
|
await fs74.promises.rename(
|
|
334353
|
-
|
|
334354
|
-
|
|
334371
|
+
path83.join(dirPathToExtract, file),
|
|
334372
|
+
path83.join(destination, file)
|
|
334355
334373
|
);
|
|
334356
334374
|
}
|
|
334357
334375
|
await fs74.promises.rmdir(dirPathToExtract);
|
|
@@ -334370,8 +334388,8 @@ async function downloadFromGitHubRelease2(installMetadata, destination) {
|
|
|
334370
334388
|
}
|
|
334371
334389
|
__name(downloadFromGitHubRelease2, "downloadFromGitHubRelease");
|
|
334372
334390
|
function findReleaseAsset2(assets) {
|
|
334373
|
-
const platform16 =
|
|
334374
|
-
const arch4 =
|
|
334391
|
+
const platform16 = os25.platform();
|
|
334392
|
+
const arch4 = os25.arch();
|
|
334375
334393
|
const platformArchPrefix = `${platform16}.${arch4}.`;
|
|
334376
334394
|
const platformPrefix = `${platform16}.`;
|
|
334377
334395
|
const platformArchAsset = assets.find(
|
|
@@ -334463,7 +334481,7 @@ __name(extractFile3, "extractFile");
|
|
|
334463
334481
|
// packages/cli/src/config/skills/skillEnablement.ts
|
|
334464
334482
|
init_esbuild_shims();
|
|
334465
334483
|
import fs75 from "node:fs";
|
|
334466
|
-
import
|
|
334484
|
+
import path84 from "node:path";
|
|
334467
334485
|
var Override2 = class _Override {
|
|
334468
334486
|
constructor(baseRule, isDisable, includeSubdirs) {
|
|
334469
334487
|
this.baseRule = baseRule;
|
|
@@ -334535,7 +334553,7 @@ var SkillEnablementManager = class {
|
|
|
334535
334553
|
enabledSkillNamesOverride;
|
|
334536
334554
|
constructor(configDir, enabledSkillNames) {
|
|
334537
334555
|
this.configDir = configDir;
|
|
334538
|
-
this.configFilePath =
|
|
334556
|
+
this.configFilePath = path84.join(configDir, "skill-enablement.json");
|
|
334539
334557
|
this.enabledSkillNamesOverride = enabledSkillNames?.map((name3) => name3.toLowerCase()) ?? [];
|
|
334540
334558
|
}
|
|
334541
334559
|
validateSkillOverrides(skills) {
|
|
@@ -334625,11 +334643,12 @@ var SkillEnablementManager = class {
|
|
|
334625
334643
|
};
|
|
334626
334644
|
|
|
334627
334645
|
// packages/cli/src/config/skill.ts
|
|
334628
|
-
var SKILLS_DIRECTORY_NAME =
|
|
334629
|
-
var WORKSPACE_SKILLS_DIRECTORY_NAME =
|
|
334646
|
+
var SKILLS_DIRECTORY_NAME = path85.join(PAPERT_DIR3, "skills");
|
|
334647
|
+
var WORKSPACE_SKILLS_DIRECTORY_NAME = path85.join(".agents", "skills");
|
|
334630
334648
|
var SKILL_FILENAME = "SKILL.md";
|
|
334631
334649
|
var SKILL_INSTALL_METADATA_FILENAME = ".papert-skill-install.json";
|
|
334632
|
-
var DEFAULT_SKILLS_DIR =
|
|
334650
|
+
var DEFAULT_SKILLS_DIR = path85.join("skills");
|
|
334651
|
+
var SKILLS_PATHS_ENV = "PAPERT_CODE_SKILLS_PATHS";
|
|
334633
334652
|
var SkillStorage = class _SkillStorage {
|
|
334634
334653
|
static {
|
|
334635
334654
|
__name(this, "SkillStorage");
|
|
@@ -334639,22 +334658,22 @@ var SkillStorage = class _SkillStorage {
|
|
|
334639
334658
|
this.skillName = skillName;
|
|
334640
334659
|
}
|
|
334641
334660
|
getSkillDir() {
|
|
334642
|
-
return
|
|
334661
|
+
return path85.join(_SkillStorage.getUserSkillsDir(), this.skillName);
|
|
334643
334662
|
}
|
|
334644
334663
|
getConfigPath() {
|
|
334645
|
-
return
|
|
334664
|
+
return path85.join(this.getSkillDir(), SKILL_FILENAME);
|
|
334646
334665
|
}
|
|
334647
334666
|
static getUserSkillsDir() {
|
|
334648
334667
|
return Storage.getUserSkillsDir();
|
|
334649
334668
|
}
|
|
334650
334669
|
static async createTmpDir() {
|
|
334651
|
-
return await fs76.promises.mkdtemp(
|
|
334670
|
+
return await fs76.promises.mkdtemp(path85.join(os26.tmpdir(), "papert-skill"));
|
|
334652
334671
|
}
|
|
334653
334672
|
};
|
|
334654
334673
|
function getBundledSkillsDir() {
|
|
334655
334674
|
try {
|
|
334656
|
-
const moduleDir =
|
|
334657
|
-
return
|
|
334675
|
+
const moduleDir = path85.dirname(fileURLToPath13(import.meta.url));
|
|
334676
|
+
return path85.join(moduleDir, "..", DEFAULT_SKILLS_DIR);
|
|
334658
334677
|
} catch {
|
|
334659
334678
|
return null;
|
|
334660
334679
|
}
|
|
@@ -334668,14 +334687,14 @@ function ensureBundledSkillsInstalled() {
|
|
|
334668
334687
|
const skillsDir = SkillStorage.getUserSkillsDir();
|
|
334669
334688
|
fs76.mkdirSync(skillsDir, { recursive: true });
|
|
334670
334689
|
for (const entry of fs76.readdirSync(bundledSkillsDir)) {
|
|
334671
|
-
const bundledSkillDir =
|
|
334690
|
+
const bundledSkillDir = path85.join(bundledSkillsDir, entry);
|
|
334672
334691
|
if (!fs76.statSync(bundledSkillDir).isDirectory()) {
|
|
334673
334692
|
continue;
|
|
334674
334693
|
}
|
|
334675
|
-
if (!fs76.existsSync(
|
|
334694
|
+
if (!fs76.existsSync(path85.join(bundledSkillDir, SKILL_FILENAME))) {
|
|
334676
334695
|
continue;
|
|
334677
334696
|
}
|
|
334678
|
-
const destinationPath =
|
|
334697
|
+
const destinationPath = path85.join(skillsDir, entry);
|
|
334679
334698
|
if (fs76.existsSync(destinationPath)) {
|
|
334680
334699
|
continue;
|
|
334681
334700
|
}
|
|
@@ -334684,10 +334703,10 @@ function ensureBundledSkillsInstalled() {
|
|
|
334684
334703
|
}
|
|
334685
334704
|
__name(ensureBundledSkillsInstalled, "ensureBundledSkillsInstalled");
|
|
334686
334705
|
function getWorkspaceSkills(workspaceDir) {
|
|
334687
|
-
if (
|
|
334706
|
+
if (path85.resolve(workspaceDir) === path85.resolve(os26.homedir())) {
|
|
334688
334707
|
return [];
|
|
334689
334708
|
}
|
|
334690
|
-
return loadSkillsFromDir(
|
|
334709
|
+
return loadSkillsFromDir(path85.join(workspaceDir, WORKSPACE_SKILLS_DIRECTORY_NAME), workspaceDir);
|
|
334691
334710
|
}
|
|
334692
334711
|
__name(getWorkspaceSkills, "getWorkspaceSkills");
|
|
334693
334712
|
async function copySkill(source2, destination) {
|
|
@@ -334697,6 +334716,10 @@ __name(copySkill, "copySkill");
|
|
|
334697
334716
|
function loadSkills(skillEnablementManager, workspaceDir = process.cwd()) {
|
|
334698
334717
|
const settings = loadSettings(workspaceDir).merged;
|
|
334699
334718
|
const allSkills = [...loadUserSkills()];
|
|
334719
|
+
const additionalSkillsDirs = getAdditionalSkillsDirs();
|
|
334720
|
+
for (const skillsDir of additionalSkillsDirs) {
|
|
334721
|
+
allSkills.push(...loadSkillsFromDir(skillsDir, workspaceDir));
|
|
334722
|
+
}
|
|
334700
334723
|
if (isWorkspaceTrusted(settings) ?? true) {
|
|
334701
334724
|
allSkills.push(...getWorkspaceSkills(workspaceDir));
|
|
334702
334725
|
}
|
|
@@ -334727,7 +334750,7 @@ function loadSkillsFromDir(dir, workspaceDir) {
|
|
|
334727
334750
|
}
|
|
334728
334751
|
const skills = [];
|
|
334729
334752
|
for (const subdir of fs76.readdirSync(dir)) {
|
|
334730
|
-
const skillDir =
|
|
334753
|
+
const skillDir = path85.join(dir, subdir);
|
|
334731
334754
|
const skill = loadSkill({
|
|
334732
334755
|
skillDir,
|
|
334733
334756
|
workspaceDir: workspaceDir || process.cwd()
|
|
@@ -334763,12 +334786,12 @@ function loadSkill(context2) {
|
|
|
334763
334786
|
])
|
|
334764
334787
|
);
|
|
334765
334788
|
}
|
|
334766
|
-
const contextFiles = getContextFileNames2(config2).map((contextFileName) =>
|
|
334789
|
+
const contextFiles = getContextFileNames2(config2).map((contextFileName) => path85.join(effectiveSkillPath, contextFileName)).filter((contextFilePath) => fs76.existsSync(contextFilePath));
|
|
334767
334790
|
const skill = {
|
|
334768
334791
|
path: effectiveSkillPath,
|
|
334769
334792
|
config: config2,
|
|
334770
334793
|
contextFiles: ensureSkillContextFilePath(
|
|
334771
|
-
|
|
334794
|
+
path85.join(effectiveSkillPath, SKILL_FILENAME),
|
|
334772
334795
|
contextFiles
|
|
334773
334796
|
),
|
|
334774
334797
|
installMetadata: installMetadata ?? void 0
|
|
@@ -334834,7 +334857,7 @@ function validateName2(name3) {
|
|
|
334834
334857
|
__name(validateName2, "validateName");
|
|
334835
334858
|
function loadSkillConfig(context2) {
|
|
334836
334859
|
const { skillDir, workspaceDir } = context2;
|
|
334837
|
-
const configFilePath2 =
|
|
334860
|
+
const configFilePath2 = path85.join(skillDir, SKILL_FILENAME);
|
|
334838
334861
|
if (!fs76.existsSync(configFilePath2)) {
|
|
334839
334862
|
throw new Error(
|
|
334840
334863
|
`Configuration file not found at ${configFilePath2}`
|
|
@@ -334846,10 +334869,10 @@ function loadSkillConfig(context2) {
|
|
|
334846
334869
|
const rawConfig = recursivelyHydrateStrings(frontmatter, {
|
|
334847
334870
|
extensionPath: skillDir,
|
|
334848
334871
|
workspacePath: workspaceDir,
|
|
334849
|
-
"/":
|
|
334850
|
-
pathSeparator:
|
|
334872
|
+
"/": path85.sep,
|
|
334873
|
+
pathSeparator: path85.sep
|
|
334851
334874
|
});
|
|
334852
|
-
const resolvedName = rawConfig.name ??
|
|
334875
|
+
const resolvedName = rawConfig.name ?? path85.basename(skillDir);
|
|
334853
334876
|
const config2 = {
|
|
334854
334877
|
...rawConfig,
|
|
334855
334878
|
name: resolvedName,
|
|
@@ -335031,7 +335054,7 @@ async function promptForConsentInteractive2(consentDescription, addSkillUpdateCo
|
|
|
335031
335054
|
}
|
|
335032
335055
|
__name(promptForConsentInteractive2, "promptForConsentInteractive");
|
|
335033
335056
|
function loadSkillInstallMetadata(skillDir) {
|
|
335034
|
-
const metadataFilePath =
|
|
335057
|
+
const metadataFilePath = path85.join(skillDir, SKILL_INSTALL_METADATA_FILENAME);
|
|
335035
335058
|
if (!fs76.existsSync(metadataFilePath)) {
|
|
335036
335059
|
return null;
|
|
335037
335060
|
}
|
|
@@ -335058,8 +335081,8 @@ async function installSkill(installMetadata, requestConsent, cwd8 = process.cwd(
|
|
|
335058
335081
|
}
|
|
335059
335082
|
const skillsDir = SkillStorage.getUserSkillsDir();
|
|
335060
335083
|
await fs76.promises.mkdir(skillsDir, { recursive: true });
|
|
335061
|
-
if (!
|
|
335062
|
-
installMetadata.source =
|
|
335084
|
+
if (!path85.isAbsolute(installMetadata.source) && (installMetadata.type === "local" || installMetadata.type === "link")) {
|
|
335085
|
+
installMetadata.source = path85.resolve(cwd8, installMetadata.source);
|
|
335063
335086
|
}
|
|
335064
335087
|
let tempDir;
|
|
335065
335088
|
if (installMetadata.type === "git" || installMetadata.type === "github-release") {
|
|
@@ -335085,7 +335108,7 @@ async function installSkill(installMetadata, requestConsent, cwd8 = process.cwd(
|
|
|
335085
335108
|
const resolvedSkillPaths = resolveSkillPaths(localSourcePath);
|
|
335086
335109
|
if (resolvedSkillPaths.length === 0) {
|
|
335087
335110
|
throw new Error(
|
|
335088
|
-
`Configuration file not found at ${
|
|
335111
|
+
`Configuration file not found at ${path85.join(localSourcePath, SKILL_FILENAME)}`
|
|
335089
335112
|
);
|
|
335090
335113
|
}
|
|
335091
335114
|
const skillCandidates = resolvedSkillPaths.map((resolvedSkillPath) => ({
|
|
@@ -335129,7 +335152,7 @@ async function installSkill(installMetadata, requestConsent, cwd8 = process.cwd(
|
|
|
335129
335152
|
source: resolvedSkillPath
|
|
335130
335153
|
} : installMetadata;
|
|
335131
335154
|
const metadataString = JSON.stringify(metadata, null, 2);
|
|
335132
|
-
const metadataPath =
|
|
335155
|
+
const metadataPath = path85.join(
|
|
335133
335156
|
destinationPath,
|
|
335134
335157
|
SKILL_INSTALL_METADATA_FILENAME
|
|
335135
335158
|
);
|
|
@@ -335161,16 +335184,16 @@ async function installSkill(installMetadata, requestConsent, cwd8 = process.cwd(
|
|
|
335161
335184
|
}
|
|
335162
335185
|
__name(installSkill, "installSkill");
|
|
335163
335186
|
function resolveSkillPaths(sourcePath) {
|
|
335164
|
-
const directSkillPath =
|
|
335187
|
+
const directSkillPath = path85.join(sourcePath, SKILL_FILENAME);
|
|
335165
335188
|
if (fs76.existsSync(directSkillPath)) {
|
|
335166
335189
|
return [sourcePath];
|
|
335167
335190
|
}
|
|
335168
|
-
const nestedSkillsDir =
|
|
335191
|
+
const nestedSkillsDir = path85.join(sourcePath, WORKSPACE_SKILLS_DIRECTORY_NAME);
|
|
335169
335192
|
const nestedEntries = listSkillDirs(nestedSkillsDir);
|
|
335170
335193
|
if (nestedEntries.length > 0) {
|
|
335171
335194
|
return nestedEntries;
|
|
335172
335195
|
}
|
|
335173
|
-
const skillsDir =
|
|
335196
|
+
const skillsDir = path85.join(sourcePath, "skills");
|
|
335174
335197
|
const skillsEntries = listSkillDirs(skillsDir);
|
|
335175
335198
|
if (skillsEntries.length > 0) {
|
|
335176
335199
|
return skillsEntries;
|
|
@@ -335190,7 +335213,7 @@ function listSkillDirs(rootDir) {
|
|
|
335190
335213
|
if (!stat8.isDirectory()) {
|
|
335191
335214
|
return [];
|
|
335192
335215
|
}
|
|
335193
|
-
return fs76.readdirSync(rootDir).map((entry) =>
|
|
335216
|
+
return fs76.readdirSync(rootDir).map((entry) => path85.join(rootDir, entry)).filter((entry) => fs76.existsSync(path85.join(entry, SKILL_FILENAME)));
|
|
335194
335217
|
}
|
|
335195
335218
|
__name(listSkillDirs, "listSkillDirs");
|
|
335196
335219
|
function skillConsentString(skillConfig) {
|
|
@@ -335251,7 +335274,7 @@ async function uninstallSkill(skillIdentifier, cwd8 = process.cwd()) {
|
|
|
335251
335274
|
__name(uninstallSkill, "uninstallSkill");
|
|
335252
335275
|
function toOutputString2(skill, workspaceDir) {
|
|
335253
335276
|
const manager = new SkillEnablementManager(SkillStorage.getUserSkillsDir());
|
|
335254
|
-
const userEnabled = manager.isEnabled(skill.config.name,
|
|
335277
|
+
const userEnabled = manager.isEnabled(skill.config.name, os26.homedir());
|
|
335255
335278
|
const workspaceEnabled = manager.isEnabled(skill.config.name, workspaceDir);
|
|
335256
335279
|
const status = workspaceEnabled ? source_default.green("\u2713") : source_default.red("\u2717");
|
|
335257
335280
|
let output = `${status} ${skill.config.name} (${skill.config.version})`;
|
|
@@ -335329,17 +335352,21 @@ function disableSkill(name3, scope, cwd8 = process.cwd()) {
|
|
|
335329
335352
|
}
|
|
335330
335353
|
__name(disableSkill, "disableSkill");
|
|
335331
335354
|
function scopePathForScope(scope, cwd8) {
|
|
335332
|
-
return scope === "User" /* User */ ?
|
|
335355
|
+
return scope === "User" /* User */ ? os26.homedir() : cwd8;
|
|
335333
335356
|
}
|
|
335334
335357
|
__name(scopePathForScope, "scopePathForScope");
|
|
335335
335358
|
function loadSkillByName(name3, workspaceDir) {
|
|
335336
|
-
const searchDirs = [
|
|
335359
|
+
const searchDirs = [
|
|
335360
|
+
SkillStorage.getUserSkillsDir(),
|
|
335361
|
+
...getAdditionalSkillsDirs(),
|
|
335362
|
+
path85.join(workspaceDir, WORKSPACE_SKILLS_DIRECTORY_NAME)
|
|
335363
|
+
];
|
|
335337
335364
|
for (const baseDir of searchDirs) {
|
|
335338
335365
|
if (!fs76.existsSync(baseDir)) {
|
|
335339
335366
|
continue;
|
|
335340
335367
|
}
|
|
335341
335368
|
for (const subdir of fs76.readdirSync(baseDir)) {
|
|
335342
|
-
const skillDir =
|
|
335369
|
+
const skillDir = path85.join(baseDir, subdir);
|
|
335343
335370
|
if (!fs76.statSync(skillDir).isDirectory()) {
|
|
335344
335371
|
continue;
|
|
335345
335372
|
}
|
|
@@ -335368,6 +335395,19 @@ function sanitizeEnvObject(env9) {
|
|
|
335368
335395
|
return sanitized;
|
|
335369
335396
|
}
|
|
335370
335397
|
__name(sanitizeEnvObject, "sanitizeEnvObject");
|
|
335398
|
+
function getAdditionalSkillsDirs() {
|
|
335399
|
+
const raw2 = process.env[SKILLS_PATHS_ENV];
|
|
335400
|
+
if (!raw2) {
|
|
335401
|
+
return [];
|
|
335402
|
+
}
|
|
335403
|
+
return parseSkillsPathList(raw2).map((entry) => resolvePath2(entry.trim())).filter((entry) => entry.length > 0);
|
|
335404
|
+
}
|
|
335405
|
+
__name(getAdditionalSkillsDirs, "getAdditionalSkillsDirs");
|
|
335406
|
+
function parseSkillsPathList(raw2) {
|
|
335407
|
+
const separator = new RegExp(`[${path85.delimiter},]`);
|
|
335408
|
+
return raw2.split(separator).map((entry) => entry.trim()).filter(Boolean);
|
|
335409
|
+
}
|
|
335410
|
+
__name(parseSkillsPathList, "parseSkillsPathList");
|
|
335371
335411
|
|
|
335372
335412
|
// packages/cli/src/commands/skills/install.ts
|
|
335373
335413
|
import { stat as stat4 } from "node:fs/promises";
|
|
@@ -335956,9 +335996,9 @@ var newCommand2 = {
|
|
|
335956
335996
|
init_esbuild_shims();
|
|
335957
335997
|
var import_semver3 = __toESM(require_semver3(), 1);
|
|
335958
335998
|
import * as fs78 from "node:fs";
|
|
335959
|
-
import * as
|
|
335999
|
+
import * as path86 from "node:path";
|
|
335960
336000
|
async function validateSkill(args) {
|
|
335961
|
-
const absoluteInputPath =
|
|
336001
|
+
const absoluteInputPath = path86.resolve(args.path);
|
|
335962
336002
|
const skillConfig = loadSkillConfig({
|
|
335963
336003
|
skillDir: absoluteInputPath,
|
|
335964
336004
|
workspaceDir: process.cwd()
|
|
@@ -335970,7 +336010,7 @@ async function validateSkill(args) {
|
|
|
335970
336010
|
if (contextFileNames.length > 0) {
|
|
335971
336011
|
const missingContextFiles = [];
|
|
335972
336012
|
for (const contextFilePath of contextFileNames) {
|
|
335973
|
-
const contextFileAbsolutePath =
|
|
336013
|
+
const contextFileAbsolutePath = path86.resolve(
|
|
335974
336014
|
absoluteInputPath,
|
|
335975
336015
|
contextFilePath
|
|
335976
336016
|
);
|
|
@@ -336040,24 +336080,6 @@ import * as fs79 from "node:fs";
|
|
|
336040
336080
|
import * as path88 from "node:path";
|
|
336041
336081
|
import { homedir as homedir16 } from "node:os";
|
|
336042
336082
|
|
|
336043
|
-
// packages/cli/src/utils/resolvePath.ts
|
|
336044
|
-
init_esbuild_shims();
|
|
336045
|
-
import * as os26 from "node:os";
|
|
336046
|
-
import * as path86 from "node:path";
|
|
336047
|
-
function resolvePath2(p) {
|
|
336048
|
-
if (!p) {
|
|
336049
|
-
return "";
|
|
336050
|
-
}
|
|
336051
|
-
let expandedPath = p;
|
|
336052
|
-
if (p.toLowerCase().startsWith("%userprofile%")) {
|
|
336053
|
-
expandedPath = os26.homedir() + p.substring("%userprofile%".length);
|
|
336054
|
-
} else if (p === "~" || p.startsWith("~/")) {
|
|
336055
|
-
expandedPath = os26.homedir() + p.substring(1);
|
|
336056
|
-
}
|
|
336057
|
-
return path86.normalize(expandedPath);
|
|
336058
|
-
}
|
|
336059
|
-
__name(resolvePath2, "resolvePath");
|
|
336060
|
-
|
|
336061
336083
|
// packages/cli/src/config/sandboxConfig.ts
|
|
336062
336084
|
init_esbuild_shims();
|
|
336063
336085
|
var import_command_exists = __toESM(require_command_exists2(), 1);
|
|
@@ -340243,7 +340265,7 @@ var formatDuration = /* @__PURE__ */ __name((milliseconds) => {
|
|
|
340243
340265
|
|
|
340244
340266
|
// packages/cli/src/generated/git-commit.ts
|
|
340245
340267
|
init_esbuild_shims();
|
|
340246
|
-
var GIT_COMMIT_INFO2 = "
|
|
340268
|
+
var GIT_COMMIT_INFO2 = "9cb0212";
|
|
340247
340269
|
|
|
340248
340270
|
// packages/cli/src/utils/systemInfo.ts
|
|
340249
340271
|
async function getNpmVersion() {
|
|
@@ -406087,7 +406109,7 @@ var GeminiAgent = class {
|
|
|
406087
406109
|
name: APPROVAL_MODE_INFO[mode].name,
|
|
406088
406110
|
description: APPROVAL_MODE_INFO[mode].description
|
|
406089
406111
|
}));
|
|
406090
|
-
const version3 = "0.3.
|
|
406112
|
+
const version3 = "0.3.3";
|
|
406091
406113
|
return {
|
|
406092
406114
|
protocolVersion: PROTOCOL_VERSION,
|
|
406093
406115
|
agentInfo: {
|
|
@@ -406631,6 +406653,11 @@ main().catch((error2) => {
|
|
|
406631
406653
|
* Copyright 2025 Papert Code
|
|
406632
406654
|
* SPDX-License-Identifier: Apache-2.0
|
|
406633
406655
|
*/
|
|
406656
|
+
/**
|
|
406657
|
+
* @license
|
|
406658
|
+
* Copyright 2026 Google LLC
|
|
406659
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
406660
|
+
*/
|
|
406634
406661
|
/**
|
|
406635
406662
|
* @license
|
|
406636
406663
|
* Copyright 2025 Papert Team
|