@tankpkg/sdk 0.16.3 → 0.16.5
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/index.mjs +25 -12
- package/dist/install/pipeline.d.ts +10 -0
- package/dist/install/pipeline.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -6394,18 +6394,31 @@ function writeLockfileWithResolvedGraph(lock, nodes, downloaded, onProgress) {
|
|
|
6394
6394
|
lock.skills = sortedSkills;
|
|
6395
6395
|
return lock;
|
|
6396
6396
|
}
|
|
6397
|
-
|
|
6398
|
-
|
|
6399
|
-
|
|
6400
|
-
|
|
6401
|
-
|
|
6402
|
-
|
|
6403
|
-
|
|
6404
|
-
|
|
6405
|
-
|
|
6406
|
-
|
|
6407
|
-
|
|
6397
|
+
/**
|
|
6398
|
+
* Plan the ordered list of ancestor directories to create for `targetDir`,
|
|
6399
|
+
* from just below the filesystem root down to the leaf (the root itself is
|
|
6400
|
+
* never returned — it always exists and must not be `mkdir`'d).
|
|
6401
|
+
*
|
|
6402
|
+
* The path module is injectable so Windows drive/UNC root handling can be
|
|
6403
|
+
* verified on any host via `path.win32` without a real Windows machine.
|
|
6404
|
+
*/
|
|
6405
|
+
function planMkdirSegments(targetDir, pathMod = path) {
|
|
6406
|
+
const resolved = pathMod.resolve(targetDir);
|
|
6407
|
+
const { root } = pathMod.parse(resolved);
|
|
6408
|
+
const dirs = [];
|
|
6409
|
+
let current = root;
|
|
6410
|
+
for (const seg of resolved.slice(root.length).split(pathMod.sep).filter(Boolean)) {
|
|
6411
|
+
current = pathMod.join(current, seg);
|
|
6412
|
+
dirs.push(current);
|
|
6408
6413
|
}
|
|
6414
|
+
return dirs;
|
|
6415
|
+
}
|
|
6416
|
+
function mkdirSafeNoSymlinks(targetDir) {
|
|
6417
|
+
for (const current of planMkdirSegments(targetDir)) if (fs.existsSync(current)) {
|
|
6418
|
+
const stat = fs.lstatSync(current);
|
|
6419
|
+
if (stat.isSymbolicLink()) throw new TankIntegrityError(`Symlink in install path: ${current}`);
|
|
6420
|
+
if (!stat.isDirectory()) throw new TankIntegrityError(`Non-directory in install path: ${current}`);
|
|
6421
|
+
} else fs.mkdirSync(current);
|
|
6409
6422
|
}
|
|
6410
6423
|
function isDirNonEmpty(dir) {
|
|
6411
6424
|
try {
|
|
@@ -6665,4 +6678,4 @@ async function createSkillTools(client, skillNames) {
|
|
|
6665
6678
|
return tools;
|
|
6666
6679
|
}
|
|
6667
6680
|
//#endregion
|
|
6668
|
-
export { AGENT_PATHS, DEFAULT_CONFIG_DIR, DEFAULT_MAX_RETRIES, REGISTRY_URL as DEFAULT_REGISTRY_URL, DEFAULT_TIMEOUT_MS, LOCKFILE_FILENAME, MANIFEST_FILENAME, SDK_VERSION, SUPPORTED_AGENTS, TankAuthError, TankClient, TankConflictError, TankError, TankIntegrityError, TankNetworkError, TankNotFoundError, TankPermissionError, buildSkillKey, checkPermissionBudget, collectPermissionViolations, createSkillTool, createSkillTools, downloadAllParallel, extractSafely, getExtractDir, getGlobalExtractDir, getResolvedNodesInOrder, hasNativeAcceleration, isDomainAllowed, isPathAllowed, parseLockKey, parseVersionFromLockKey, readExtractedDependencies, resolveDependencyTree, verifyExtractedDependencies, writeLockfileWithResolvedGraph };
|
|
6681
|
+
export { AGENT_PATHS, DEFAULT_CONFIG_DIR, DEFAULT_MAX_RETRIES, REGISTRY_URL as DEFAULT_REGISTRY_URL, DEFAULT_TIMEOUT_MS, LOCKFILE_FILENAME, MANIFEST_FILENAME, SDK_VERSION, SUPPORTED_AGENTS, TankAuthError, TankClient, TankConflictError, TankError, TankIntegrityError, TankNetworkError, TankNotFoundError, TankPermissionError, buildSkillKey, checkPermissionBudget, collectPermissionViolations, createSkillTool, createSkillTools, downloadAllParallel, extractSafely, getExtractDir, getGlobalExtractDir, getResolvedNodesInOrder, hasNativeAcceleration, isDomainAllowed, isPathAllowed, parseLockKey, parseVersionFromLockKey, planMkdirSegments, readExtractedDependencies, resolveDependencyTree, verifyExtractedDependencies, writeLockfileWithResolvedGraph };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
1
2
|
import { type SkillsLock } from '@internals/schemas';
|
|
2
3
|
import { type ResolvedNode } from './resolver.js';
|
|
3
4
|
export declare function downloadAllParallel(nodes: ResolvedNode[], onProgress?: (msg: string) => void): Promise<Map<string, {
|
|
@@ -10,6 +11,15 @@ export declare function writeLockfileWithResolvedGraph(lock: SkillsLock, nodes:
|
|
|
10
11
|
buffer: Buffer;
|
|
11
12
|
integrity: string;
|
|
12
13
|
}>, onProgress?: (msg: string) => void): SkillsLock;
|
|
14
|
+
/**
|
|
15
|
+
* Plan the ordered list of ancestor directories to create for `targetDir`,
|
|
16
|
+
* from just below the filesystem root down to the leaf (the root itself is
|
|
17
|
+
* never returned — it always exists and must not be `mkdir`'d).
|
|
18
|
+
*
|
|
19
|
+
* The path module is injectable so Windows drive/UNC root handling can be
|
|
20
|
+
* verified on any host via `path.win32` without a real Windows machine.
|
|
21
|
+
*/
|
|
22
|
+
export declare function planMkdirSegments(targetDir: string, pathMod?: typeof path): string[];
|
|
13
23
|
export declare function extractSafely(tarball: Buffer, destDir: string): Promise<void>;
|
|
14
24
|
export declare function getExtractDir(projectDir: string, skillName: string): string;
|
|
15
25
|
export declare function getGlobalExtractDir(homedir: string, skillName: string): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline.d.ts","sourceRoot":"","sources":["../../src/install/pipeline.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"pipeline.d.ts","sourceRoot":"","sources":["../../src/install/pipeline.ts"],"names":[],"mappings":"AAGA,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAKL,KAAK,UAAU,EAChB,MAAM,oBAAoB,CAAC;AAI5B,OAAO,EAAiB,KAAK,YAAY,EAAE,MAAM,eAAe,CAAC;AAsBjE,wBAAsB,mBAAmB,CACvC,KAA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,MAAM,GAAG,MAAM,CAM3D;AAED,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,EAAE,YAAY,EAAE,MAAM,EAAE,GAAG,YAAY,EAAE,CAWhH"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tankpkg/sdk",
|
|
3
|
-
"version": "0.16.
|
|
3
|
+
"version": "0.16.5",
|
|
4
4
|
"description": "Official TypeScript SDK for the Tank registry — search, download, install, and audit AI agent skills programmatically",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"homepage": "https://github.com/tankpkg/tank",
|