akm-cli 0.0.16 → 0.0.18
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/README.md +61 -108
- package/dist/asset-spec.js +9 -9
- package/dist/cli.js +321 -118
- package/dist/common.js +0 -7
- package/dist/config-cli.js +43 -0
- package/dist/config.js +46 -26
- package/dist/file-context.js +3 -28
- package/dist/indexer.js +0 -30
- package/dist/llm.js +1 -1
- package/dist/matchers.js +4 -15
- package/dist/metadata.js +3 -3
- package/dist/provider-registry.js +8 -0
- package/dist/providers/skills-sh.js +165 -0
- package/dist/providers/static-index.js +340 -0
- package/dist/registry-install.js +5 -5
- package/dist/registry-provider.js +1 -0
- package/dist/registry-search.js +65 -226
- package/dist/renderers.js +1 -1
- package/dist/stash-add.js +2 -2
- package/dist/stash-ref.js +7 -9
- package/dist/stash-registry.js +6 -6
- package/dist/stash-resolve.js +7 -44
- package/dist/stash-search.js +8 -12
- package/dist/stash-show.js +1 -2
- package/dist/stash-source.js +6 -7
- package/dist/walker.js +1 -1
- package/package.json +1 -1
package/dist/stash-source.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import fs from "node:fs";
|
|
2
2
|
import path from "node:path";
|
|
3
|
-
import {
|
|
3
|
+
import { resolveStashDir } from "./common";
|
|
4
4
|
import { loadConfig } from "./config";
|
|
5
5
|
import { warn } from "./warn";
|
|
6
6
|
// ── Resolution ──────────────────────────────────────────────────────────────
|
|
@@ -11,7 +11,7 @@ import { warn } from "./warn";
|
|
|
11
11
|
* 3. Installed kit paths (cache-managed, from registry)
|
|
12
12
|
*
|
|
13
13
|
* The first entry is always the primary stash. Additional entries come
|
|
14
|
-
* from `searchPaths` config and `
|
|
14
|
+
* from `searchPaths` config and `installed` kit entries.
|
|
15
15
|
*/
|
|
16
16
|
export function resolveStashSources(overrideStashDir, existingConfig) {
|
|
17
17
|
const stashDir = overrideStashDir ?? resolveStashDir();
|
|
@@ -25,7 +25,7 @@ export function resolveStashSources(overrideStashDir, existingConfig) {
|
|
|
25
25
|
sources.push({ path: dir });
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
|
-
for (const entry of config.
|
|
28
|
+
for (const entry of config.installed ?? []) {
|
|
29
29
|
if (isSuspiciousStashRoot(entry.stashRoot)) {
|
|
30
30
|
warn(`Warning: stash root "${entry.stashRoot}" appears to be a system directory. This may be unintentional.`);
|
|
31
31
|
}
|
|
@@ -67,7 +67,7 @@ export function getPrimarySource(sources) {
|
|
|
67
67
|
* Determine whether a file is safe to edit in place.
|
|
68
68
|
*
|
|
69
69
|
* The only files that are NOT editable are those inside a cache directory
|
|
70
|
-
* managed by the package manager (`
|
|
70
|
+
* managed by the package manager (`installed[].cacheDir`). These
|
|
71
71
|
* will be overwritten by `akm update` without warning.
|
|
72
72
|
*
|
|
73
73
|
* Everything else — working stash, search paths, local project dirs — is
|
|
@@ -76,7 +76,7 @@ export function getPrimarySource(sources) {
|
|
|
76
76
|
export function isEditable(filePath, config) {
|
|
77
77
|
const cfg = config ?? loadConfig();
|
|
78
78
|
const resolved = path.resolve(filePath);
|
|
79
|
-
const cacheManaged = cfg.
|
|
79
|
+
const cacheManaged = cfg.installed ?? [];
|
|
80
80
|
const isWin = process.platform === "win32";
|
|
81
81
|
for (const entry of cacheManaged) {
|
|
82
82
|
// Local sources reference original paths — always editable
|
|
@@ -101,8 +101,7 @@ export function isEditable(filePath, config) {
|
|
|
101
101
|
* unconditionally returns the hint string.
|
|
102
102
|
*/
|
|
103
103
|
export function buildEditHint(_filePath, assetType, assetName, origin) {
|
|
104
|
-
const
|
|
105
|
-
const ref = origin ? `${origin}//${normalizedType}:${assetName}` : `${normalizedType}:${assetName}`;
|
|
104
|
+
const ref = origin ? `${origin}//${assetType}:${assetName}` : `${assetType}:${assetName}`;
|
|
106
105
|
return `This asset is managed by akm and may be overwritten on update. To edit, run: akm clone ${ref}`;
|
|
107
106
|
}
|
|
108
107
|
// ── Validation ──────────────────────────────────────────────────────────────
|
package/dist/walker.js
CHANGED
|
@@ -14,7 +14,7 @@ import { buildFileContext } from "./file-context";
|
|
|
14
14
|
* Walk a type root directory and return files grouped by their parent directory.
|
|
15
15
|
*
|
|
16
16
|
* Only files relevant to the given `assetType` are included (e.g. `.md` for
|
|
17
|
-
* commands, script extensions for
|
|
17
|
+
* commands, script extensions for scripts, `SKILL.md` for skills).
|
|
18
18
|
*/
|
|
19
19
|
export function walkStash(typeRoot, assetType) {
|
|
20
20
|
if (!fs.existsSync(typeRoot))
|