opencode-skill-autodiscovery 2.0.0 → 2.1.0

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.
@@ -0,0 +1,161 @@
1
+ import { createHash } from "node:crypto";
2
+ import { mkdirSync, readdirSync, readFileSync, renameSync, statSync, writeFileSync } from "node:fs";
3
+ import { dirname, join, relative } from "node:path";
4
+ import { pluginCacheRoot } from "./cache.js";
5
+ // findPluginRoots' real walk is the expensive part of a scan: at every
6
+ // directory it calls hasPluginLayout -> hasRootAgentFiles, which reads every
7
+ // flat *.md file's content to check its frontmatter (cache.ts's cachedRead
8
+ // avoids re-parsing an unchanged file's bytes, but the walk still visits
9
+ // every directory and opens every candidate file on every single run). For a
10
+ // large, mostly-unchanged tree (a synced Claude/VS Code plugin marketplace),
11
+ // that per-directory cost dominates opencode's startup time.
12
+ //
13
+ // This module is a second, coarser cache layer in front of the walk itself:
14
+ // fingerprint the subtree cheaply (readdirSync + statSync only, no content
15
+ // reads, no containment/symlink-resolution overhead) and let the caller skip
16
+ // the real walk entirely when the fingerprint matches the last run's. Pure
17
+ // primitives only — no dependency on discovery.ts's walk functions, so
18
+ // discovery.ts can depend on this module without a cycle; the glue that
19
+ // actually runs findPluginRoots on a miss lives in discovery.ts itself.
20
+ const CACHE_FILE_NAME = "discovery-root-cache.json";
21
+ // Bumped from 1 to 2 when the per-entry field storing the cached value was
22
+ // renamed from `packages` (PluginPackage[]-only) to the generic `value`
23
+ // (any JSON-serializable result — readAgents' cache reuses this same store).
24
+ // A version-1 file on disk is now correctly treated as absent rather than
25
+ // misread with the wrong field name.
26
+ const CACHE_VERSION = 2;
27
+ // Mirrors discovery.ts's MAX_WALK_DEPTH: this is a separate, cheaper walk
28
+ // (see fingerprintTree below), but it must bound depth the same way for the
29
+ // same reason — a pathological or cyclic tree must not grow this pass
30
+ // unboundedly, even though (unlike the real walk) it does not resolve
31
+ // symlinks to detect cycles precisely. A cycle just gets fingerprinted up to
32
+ // this depth and then stops, exactly like the real walk's own documented
33
+ // "belt-and-braces, not load-bearing" depth cap.
34
+ const MAX_FINGERPRINT_DEPTH = 16;
35
+ let store = null;
36
+ let dirty = false;
37
+ function cacheFilePath() {
38
+ return join(pluginCacheRoot(), CACHE_FILE_NAME);
39
+ }
40
+ function loadStore() {
41
+ if (store)
42
+ return store;
43
+ try {
44
+ const raw = JSON.parse(readFileSync(cacheFilePath(), "utf8"));
45
+ store =
46
+ raw && raw.version === CACHE_VERSION && raw.entries && typeof raw.entries === "object"
47
+ ? raw.entries
48
+ : {};
49
+ }
50
+ catch {
51
+ store = {};
52
+ }
53
+ return store;
54
+ }
55
+ // Test-only seam, same rationale as cache.ts's _resetFileCacheForTests: one
56
+ // opencode process makes one config() call, so the module-level singleton is
57
+ // the right scope in production; tests need to force a reload between cases
58
+ // that reuse the same HOME.
59
+ export function _resetDiscoveryCacheForTests() {
60
+ store = null;
61
+ dirty = false;
62
+ }
63
+ // A cheap, content-free signature of everything a full walk of `root` would
64
+ // visit: every directory's direct children, keyed by (path relative to root,
65
+ // file-or-dir, mtimeMs, size), hashed. Any add, remove, rename, or content
66
+ // edit anywhere in the subtree changes at least one child's stat (a write
67
+ // changes the file's own mtime/size; an add/remove/rename changes its parent
68
+ // directory's mtime) and so changes this hash — there is no staleness
69
+ // window, only a cheaper way to notice nothing changed.
70
+ //
71
+ // Deliberately skips realpathSync: that is precisely the overhead the real
72
+ // walk pays for its containment/symlink-cycle guarantees, and this pass does
73
+ // not need those guarantees — it only decides whether to trust a cached
74
+ // *result* of the real (fully-guarded) walk, never emits a path itself.
75
+ export function fingerprintTree(root) {
76
+ const parts = [];
77
+ walkFingerprint(root, root, parts, 0);
78
+ parts.sort();
79
+ const hash = createHash("sha1");
80
+ for (const part of parts)
81
+ hash.update(part).update("\n");
82
+ return hash.digest("hex");
83
+ }
84
+ function walkFingerprint(root, dir, parts, depth) {
85
+ if (depth > MAX_FINGERPRINT_DEPTH)
86
+ return;
87
+ let entries;
88
+ try {
89
+ entries = readdirSync(dir);
90
+ }
91
+ catch {
92
+ return;
93
+ }
94
+ for (const entry of entries) {
95
+ if (entry === ".git" || entry === "node_modules")
96
+ continue;
97
+ const full = join(dir, entry);
98
+ let st;
99
+ try {
100
+ st = statSync(full);
101
+ }
102
+ catch {
103
+ continue;
104
+ }
105
+ const isDir = st.isDirectory();
106
+ parts.push(`${relative(root, full)}:${isDir ? "d" : "f"}:${st.mtimeMs}:${st.size}`);
107
+ if (isDir)
108
+ walkFingerprint(root, full, parts, depth + 1);
109
+ }
110
+ }
111
+ // Returns the packages cached for `key` when its stored fingerprint matches
112
+ // `fingerprint`, or null on a miss (not cached yet, or the subtree changed).
113
+ export function getCachedPackages(key, fingerprint) {
114
+ return getCachedValue(key, fingerprint);
115
+ }
116
+ // Records `packages` as the result for `key` at `fingerprint`, so the next
117
+ // call with an unchanged fingerprint gets them back from getCachedPackages
118
+ // without re-walking.
119
+ export function setCachedPackages(key, fingerprint, packages) {
120
+ setCachedValue(key, fingerprint, packages);
121
+ }
122
+ // Generic form of the same fingerprint-gated cache, for any JSON-serializable
123
+ // result of a per-directory computation — not just a package list. Used by
124
+ // readAgents (agents.ts) to cache a whole package's extracted agents keyed by
125
+ // a fingerprint of that package's own root: a marketplace layout with few
126
+ // packages but many flat *.md files per package (the exact shape that caused
127
+ // the original hang) would otherwise re-run readdirSync + the per-file
128
+ // containment check for every file, every run, even once the top-level walk
129
+ // itself is fully cached — package roots are typically far smaller subtrees
130
+ // than the marketplace root, so fingerprinting one is cheap.
131
+ export function getCachedValue(key, fingerprint) {
132
+ const cached = loadStore()[key];
133
+ return cached && cached.fingerprint === fingerprint ? cached.value : null;
134
+ }
135
+ export function setCachedValue(key, fingerprint, value) {
136
+ loadStore()[key] = { fingerprint, value, cachedAt: new Date().toISOString() };
137
+ dirty = true;
138
+ }
139
+ // Persists the in-memory cache to disk when it changed, atomically (write to
140
+ // a pid-suffixed temp file, then rename over the real path) so a process
141
+ // killed mid-write can never leave a half-written cache file behind for the
142
+ // next run to trip over. Best-effort, like every other filesystem side
143
+ // effect in this codebase: a failed write is swallowed, and the next run
144
+ // just re-walks.
145
+ export function flushDiscoveryCache() {
146
+ if (!dirty || !store)
147
+ return;
148
+ try {
149
+ const path = cacheFilePath();
150
+ mkdirSync(dirname(path), { recursive: true });
151
+ const payload = { version: CACHE_VERSION, entries: store };
152
+ const tmp = `${path}.${process.pid}.tmp`;
153
+ writeFileSync(tmp, JSON.stringify(payload));
154
+ renameSync(tmp, path);
155
+ dirty = false;
156
+ }
157
+ catch {
158
+ // Non-fatal: the next run just re-walks and rebuilds the cache.
159
+ }
160
+ }
161
+ //# sourceMappingURL=discovery-cache.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"discovery-cache.js","sourceRoot":"","sources":["../src/discovery-cache.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACpG,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAG7C,uEAAuE;AACvE,6EAA6E;AAC7E,2EAA2E;AAC3E,yEAAyE;AACzE,6EAA6E;AAC7E,6EAA6E;AAC7E,6DAA6D;AAC7D,EAAE;AACF,4EAA4E;AAC5E,2EAA2E;AAC3E,6EAA6E;AAC7E,2EAA2E;AAC3E,uEAAuE;AACvE,wEAAwE;AACxE,wEAAwE;AAExE,MAAM,eAAe,GAAG,2BAA2B,CAAC;AACpD,2EAA2E;AAC3E,wEAAwE;AACxE,6EAA6E;AAC7E,0EAA0E;AAC1E,qCAAqC;AACrC,MAAM,aAAa,GAAG,CAAC,CAAC;AACxB,0EAA0E;AAC1E,4EAA4E;AAC5E,sEAAsE;AACtE,sEAAsE;A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E,CAAC,CAAC;QAC9C,MAAM,OAAO,GAAc,EAAE,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;QACtE,MAAM,GAAG,GAAG,GAAG,IAAI,IAAI,OAAO,CAAC,GAAG,MAAM,CAAC;QACzC,aAAa,CAAC,GAAG,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC;QAC5C,UAAU,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QACtB,KAAK,GAAG,KAAK,CAAC;IAChB,CAAC;IAAC,MAAM,CAAC;QACP,gEAAgE;IAClE,CAAC;AACH,CAAC"}
@@ -9,9 +9,10 @@ export type PluginPackage = {
9
9
  source: PackageSource;
10
10
  /**
11
11
  * Two-tier trust model. True when the content was installed or fetched
12
- * deliberately via a host tool or opencode itself (claude/vscode manifests,
13
- * opencode's package cache). False when present merely as a side effect
14
- * (project node_modules, manifest-less walks over user-supplied extra roots).
12
+ * deliberately via a host tool or opencode itself (claude/vscode manifests
13
+ * under home roots, opencode's package cache). False when present merely as
14
+ * a side effect (project node_modules, manifest-less walks, and any package
15
+ * reached through a user-supplied extra root).
15
16
  */
16
17
  trusted: boolean;
17
18
  name: string;
@@ -28,18 +29,25 @@ export type SkillInfo = {
28
29
  };
29
30
  export type ConfigPatch = {
30
31
  skillPaths: string[];
32
+ skillTrust: Array<{
33
+ dir: string;
34
+ trusted: boolean;
35
+ }>;
31
36
  commands: Array<{
32
37
  name: string;
33
38
  description: string;
34
39
  template: string;
40
+ trusted: boolean;
35
41
  }>;
36
42
  mcp: Array<{
37
43
  key: string;
38
44
  entry: McpEntry;
45
+ trusted: boolean;
39
46
  }>;
40
47
  agents: Array<{
41
48
  name: string;
42
49
  agent: AgentConfig;
50
+ trusted: boolean;
43
51
  }>;
44
52
  };
45
53
  export type ConfigLike = {
@@ -54,15 +62,16 @@ export type ConfigLike = {
54
62
  agent?: Record<string, AgentConfig | undefined>;
55
63
  };
56
64
  export declare function contains(parent: string, child: string): boolean;
65
+ export declare function resolveContained(root: string, candidate: string): string | null;
57
66
  export declare function readSkillInfo(dir: string): SkillInfo | null;
58
67
  export declare function readPackage(root: string, source: PackageSource, trusted?: boolean): PluginPackage | null;
59
68
  export declare function findSkillDirs(root: string, out: Set<string>, seen: Set<string>): void;
60
69
  export declare function findPluginRoots(root: string, out: string[]): void;
61
70
  export declare function packageFromDir(root: string, source: PackageSource, trusted?: boolean): PluginPackage | null;
62
- export declare function collectVscodeManifest(out: PluginPackage[], installedJson: string, exclude?: string[]): void;
63
- export declare function collectVscodeCache(out: PluginPackage[], cacheJson: string, exclude?: string[]): void;
71
+ export declare function collectVscodeManifest(out: PluginPackage[], installedJson: string, exclude?: string[], trusted?: boolean): void;
72
+ export declare function collectVscodeCache(out: PluginPackage[], cacheJson: string, exclude?: string[], trusted?: boolean): void;
64
73
  export declare function collectVscode(out: PluginPackage[], extra: string[], exclude?: string[]): void;
65
- export declare function collectClaudeManifest(out: PluginPackage[], installedJson: string, exclude?: string[]): void;
74
+ export declare function collectClaudeManifest(out: PluginPackage[], installedJson: string, exclude?: string[], trusted?: boolean): void;
66
75
  export declare function collectClaude(out: PluginPackage[], exclude?: string[]): void;
67
76
  export declare function opencodeCacheRoot(): string;
68
77
  export declare function collectOpencodeCache(packagesRoot: string, out: PluginPackage[], exclude?: string[]): void;
@@ -74,6 +83,9 @@ export declare function planConfig(packages: PluginPackage[], taken?: {
74
83
  }, enabled?: {
75
84
  mcp?: boolean;
76
85
  agents?: boolean;
86
+ }, consent?: {
87
+ mcp?: Iterable<string>;
88
+ agents?: Iterable<string>;
77
89
  }): ConfigPatch;
78
90
  export declare function applyConfigPatch(config: ConfigLike, plan: ConfigPatch, enabled: {
79
91
  mcp: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"discovery.d.ts","sourceRoot":"","sources":["../src/discovery.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,KA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