@hyperwindmill/caretaker-cli 0.11.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.
- package/LICENSE +110 -0
- package/README.md +25 -0
- package/dist/agents/dispatch.d.ts +35 -0
- package/dist/agents/dispatch.d.ts.map +1 -0
- package/dist/agents/dispatch.js +108 -0
- package/dist/agents/sync.d.ts +10 -0
- package/dist/agents/sync.d.ts.map +1 -0
- package/dist/agents/sync.js +95 -0
- package/dist/cli/index.d.ts +2 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +50 -0
- package/dist/cli/run.d.ts +11 -0
- package/dist/cli/run.d.ts.map +1 -0
- package/dist/cli/run.js +89 -0
- package/dist/cli/web/fs.d.ts +3 -0
- package/dist/cli/web/fs.d.ts.map +1 -0
- package/dist/cli/web/fs.js +35 -0
- package/dist/cli/web/mcp_bridge.d.ts +7 -0
- package/dist/cli/web/mcp_bridge.d.ts.map +1 -0
- package/dist/cli/web/mcp_bridge.js +86 -0
- package/dist/cli/web/scheduler/heartbeat.d.ts +16 -0
- package/dist/cli/web/scheduler/heartbeat.d.ts.map +1 -0
- package/dist/cli/web/scheduler/heartbeat.js +181 -0
- package/dist/cli/web/scheduler/locks.d.ts +8 -0
- package/dist/cli/web/scheduler/locks.d.ts.map +1 -0
- package/dist/cli/web/scheduler/locks.js +7 -0
- package/dist/cli/web/scheduler/logs.d.ts +21 -0
- package/dist/cli/web/scheduler/logs.d.ts.map +1 -0
- package/dist/cli/web/scheduler/logs.js +62 -0
- package/dist/cli/web/scheduler/strategy.d.ts +6 -0
- package/dist/cli/web/scheduler/strategy.d.ts.map +1 -0
- package/dist/cli/web/scheduler/strategy.js +1 -0
- package/dist/cli/web/scheduler/task_review.d.ts +18 -0
- package/dist/cli/web/scheduler/task_review.d.ts.map +1 -0
- package/dist/cli/web/scheduler/task_review.js +77 -0
- package/dist/cli/web/scheduler/task_roles.d.ts +22 -0
- package/dist/cli/web/scheduler/task_roles.d.ts.map +1 -0
- package/dist/cli/web/scheduler/task_roles.js +70 -0
- package/dist/cli/web/scheduler/task_strategy.d.ts +2 -0
- package/dist/cli/web/scheduler/task_strategy.d.ts.map +1 -0
- package/dist/cli/web/scheduler/task_strategy.js +437 -0
- package/dist/cli/web/scheduler/telegram.d.ts +7 -0
- package/dist/cli/web/scheduler/telegram.d.ts.map +1 -0
- package/dist/cli/web/scheduler/telegram.js +393 -0
- package/dist/cli/web/scheduler.d.ts +15 -0
- package/dist/cli/web/scheduler.d.ts.map +1 -0
- package/dist/cli/web/scheduler.js +60 -0
- package/dist/cli/web/server.d.ts +38 -0
- package/dist/cli/web/server.d.ts.map +1 -0
- package/dist/cli/web/server.js +970 -0
- package/dist/commands/loader.d.ts +37 -0
- package/dist/commands/loader.d.ts.map +1 -0
- package/dist/commands/loader.js +110 -0
- package/dist/harness/claude_code_runner.d.ts +47 -0
- package/dist/harness/claude_code_runner.d.ts.map +1 -0
- package/dist/harness/claude_code_runner.js +325 -0
- package/dist/harness/claude_code_stream.d.ts +32 -0
- package/dist/harness/claude_code_stream.d.ts.map +1 -0
- package/dist/harness/claude_code_stream.js +121 -0
- package/dist/harness/context_files.d.ts +23 -0
- package/dist/harness/context_files.d.ts.map +1 -0
- package/dist/harness/context_files.js +126 -0
- package/dist/harness/history.d.ts +4 -0
- package/dist/harness/history.d.ts.map +1 -0
- package/dist/harness/history.js +120 -0
- package/dist/harness/index.d.ts +8 -0
- package/dist/harness/index.d.ts.map +1 -0
- package/dist/harness/index.js +8 -0
- package/dist/harness/loop.d.ts +73 -0
- package/dist/harness/loop.d.ts.map +1 -0
- package/dist/harness/loop.js +373 -0
- package/dist/harness/model_limits.d.ts +25 -0
- package/dist/harness/model_limits.d.ts.map +1 -0
- package/dist/harness/model_limits.js +67 -0
- package/dist/harness/models.d.ts +9 -0
- package/dist/harness/models.d.ts.map +1 -0
- package/dist/harness/models.js +38 -0
- package/dist/harness/prelude.d.ts +21 -0
- package/dist/harness/prelude.d.ts.map +1 -0
- package/dist/harness/prelude.js +41 -0
- package/dist/harness/provider.d.ts +87 -0
- package/dist/harness/provider.d.ts.map +1 -0
- package/dist/harness/provider.js +140 -0
- package/dist/harness/runtime_info.d.ts +7 -0
- package/dist/harness/runtime_info.d.ts.map +1 -0
- package/dist/harness/runtime_info.js +15 -0
- package/dist/harness/think_tag_splitter.d.ts +33 -0
- package/dist/harness/think_tag_splitter.d.ts.map +1 -0
- package/dist/harness/think_tag_splitter.js +70 -0
- package/dist/harness/title.d.ts +17 -0
- package/dist/harness/title.d.ts.map +1 -0
- package/dist/harness/title.js +75 -0
- package/dist/harness/tools/builtin/bash.d.ts +3 -0
- package/dist/harness/tools/builtin/bash.d.ts.map +1 -0
- package/dist/harness/tools/builtin/bash.js +137 -0
- package/dist/harness/tools/builtin/edit.d.ts +6 -0
- package/dist/harness/tools/builtin/edit.d.ts.map +1 -0
- package/dist/harness/tools/builtin/edit.js +85 -0
- package/dist/harness/tools/builtin/fetch.d.ts +3 -0
- package/dist/harness/tools/builtin/fetch.d.ts.map +1 -0
- package/dist/harness/tools/builtin/fetch.js +75 -0
- package/dist/harness/tools/builtin/get_agent_context.d.ts +3 -0
- package/dist/harness/tools/builtin/get_agent_context.d.ts.map +1 -0
- package/dist/harness/tools/builtin/get_agent_context.js +76 -0
- package/dist/harness/tools/builtin/glob.d.ts +3 -0
- package/dist/harness/tools/builtin/glob.d.ts.map +1 -0
- package/dist/harness/tools/builtin/glob.js +52 -0
- package/dist/harness/tools/builtin/grep.d.ts +3 -0
- package/dist/harness/tools/builtin/grep.d.ts.map +1 -0
- package/dist/harness/tools/builtin/grep.js +126 -0
- package/dist/harness/tools/builtin/index.d.ts +23 -0
- package/dist/harness/tools/builtin/index.d.ts.map +1 -0
- package/dist/harness/tools/builtin/index.js +74 -0
- package/dist/harness/tools/builtin/invoke_agent.d.ts +3 -0
- package/dist/harness/tools/builtin/invoke_agent.d.ts.map +1 -0
- package/dist/harness/tools/builtin/invoke_agent.js +106 -0
- package/dist/harness/tools/builtin/invoke_command.d.ts +3 -0
- package/dist/harness/tools/builtin/invoke_command.d.ts.map +1 -0
- package/dist/harness/tools/builtin/invoke_command.js +42 -0
- package/dist/harness/tools/builtin/list_agents.d.ts +3 -0
- package/dist/harness/tools/builtin/list_agents.d.ts.map +1 -0
- package/dist/harness/tools/builtin/list_agents.js +32 -0
- package/dist/harness/tools/builtin/list_commands.d.ts +3 -0
- package/dist/harness/tools/builtin/list_commands.d.ts.map +1 -0
- package/dist/harness/tools/builtin/list_commands.js +27 -0
- package/dist/harness/tools/builtin/list_skills.d.ts +3 -0
- package/dist/harness/tools/builtin/list_skills.d.ts.map +1 -0
- package/dist/harness/tools/builtin/list_skills.js +24 -0
- package/dist/harness/tools/builtin/multiedit.d.ts +3 -0
- package/dist/harness/tools/builtin/multiedit.d.ts.map +1 -0
- package/dist/harness/tools/builtin/multiedit.js +88 -0
- package/dist/harness/tools/builtin/read_attachment.d.ts +3 -0
- package/dist/harness/tools/builtin/read_attachment.d.ts.map +1 -0
- package/dist/harness/tools/builtin/read_attachment.js +128 -0
- package/dist/harness/tools/builtin/read_document.d.ts +37 -0
- package/dist/harness/tools/builtin/read_document.d.ts.map +1 -0
- package/dist/harness/tools/builtin/read_document.js +238 -0
- package/dist/harness/tools/builtin/read_file.d.ts +3 -0
- package/dist/harness/tools/builtin/read_file.d.ts.map +1 -0
- package/dist/harness/tools/builtin/read_file.js +141 -0
- package/dist/harness/tools/builtin/read_image.d.ts +3 -0
- package/dist/harness/tools/builtin/read_image.d.ts.map +1 -0
- package/dist/harness/tools/builtin/read_image.js +80 -0
- package/dist/harness/tools/builtin/read_skill.d.ts +3 -0
- package/dist/harness/tools/builtin/read_skill.d.ts.map +1 -0
- package/dist/harness/tools/builtin/read_skill.js +30 -0
- package/dist/harness/tools/builtin/shell-env.d.ts +55 -0
- package/dist/harness/tools/builtin/shell-env.d.ts.map +1 -0
- package/dist/harness/tools/builtin/shell-env.js +181 -0
- package/dist/harness/tools/builtin/task_tools.d.ts +21 -0
- package/dist/harness/tools/builtin/task_tools.d.ts.map +1 -0
- package/dist/harness/tools/builtin/task_tools.js +708 -0
- package/dist/harness/tools/builtin/write.d.ts +3 -0
- package/dist/harness/tools/builtin/write.d.ts.map +1 -0
- package/dist/harness/tools/builtin/write.js +56 -0
- package/dist/harness/tools/index.d.ts +6 -0
- package/dist/harness/tools/index.d.ts.map +1 -0
- package/dist/harness/tools/index.js +7 -0
- package/dist/harness/tools/instance.d.ts +3 -0
- package/dist/harness/tools/instance.d.ts.map +1 -0
- package/dist/harness/tools/instance.js +19 -0
- package/dist/harness/tools/registry.d.ts +21 -0
- package/dist/harness/tools/registry.d.ts.map +1 -0
- package/dist/harness/tools/registry.js +33 -0
- package/dist/harness/tools/resolve.d.ts +5 -0
- package/dist/harness/tools/resolve.d.ts.map +1 -0
- package/dist/harness/tools/resolve.js +60 -0
- package/dist/harness/tools/sandbox.d.ts +6 -0
- package/dist/harness/tools/sandbox.d.ts.map +1 -0
- package/dist/harness/tools/sandbox.js +23 -0
- package/dist/harness/tools/types.d.ts +80 -0
- package/dist/harness/tools/types.d.ts.map +1 -0
- package/dist/harness/tools/types.js +16 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +46 -0
- package/dist/lib/encryption.d.ts +24 -0
- package/dist/lib/encryption.d.ts.map +1 -0
- package/dist/lib/encryption.js +163 -0
- package/dist/lib/open_url.d.ts +9 -0
- package/dist/lib/open_url.d.ts.map +1 -0
- package/dist/lib/open_url.js +23 -0
- package/dist/lib/task_git.d.ts +11 -0
- package/dist/lib/task_git.d.ts.map +1 -0
- package/dist/lib/task_git.js +100 -0
- package/dist/mcp/adapter.d.ts +9 -0
- package/dist/mcp/adapter.d.ts.map +1 -0
- package/dist/mcp/adapter.js +74 -0
- package/dist/mcp/client.d.ts +50 -0
- package/dist/mcp/client.d.ts.map +1 -0
- package/dist/mcp/client.js +243 -0
- package/dist/mcp/oauth.d.ts +30 -0
- package/dist/mcp/oauth.d.ts.map +1 -0
- package/dist/mcp/oauth.js +171 -0
- package/dist/mcp/oauth_callback.d.ts +9 -0
- package/dist/mcp/oauth_callback.d.ts.map +1 -0
- package/dist/mcp/oauth_callback.js +51 -0
- package/dist/mcp/oauth_store.d.ts +22 -0
- package/dist/mcp/oauth_store.d.ts.map +1 -0
- package/dist/mcp/oauth_store.js +40 -0
- package/dist/mcp/server_manager.d.ts +49 -0
- package/dist/mcp/server_manager.d.ts.map +1 -0
- package/dist/mcp/server_manager.js +271 -0
- package/dist/plugins/fetchers/git.d.ts +67 -0
- package/dist/plugins/fetchers/git.d.ts.map +1 -0
- package/dist/plugins/fetchers/git.js +130 -0
- package/dist/plugins/fetchers/path.d.ts +4 -0
- package/dist/plugins/fetchers/path.d.ts.map +1 -0
- package/dist/plugins/fetchers/path.js +22 -0
- package/dist/plugins/loader.d.ts +31 -0
- package/dist/plugins/loader.d.ts.map +1 -0
- package/dist/plugins/loader.js +146 -0
- package/dist/plugins/manifest.d.ts +56 -0
- package/dist/plugins/manifest.d.ts.map +1 -0
- package/dist/plugins/manifest.js +389 -0
- package/dist/plugins/refresh_on_start.d.ts +7 -0
- package/dist/plugins/refresh_on_start.d.ts.map +1 -0
- package/dist/plugins/refresh_on_start.js +35 -0
- package/dist/plugins/source_manager.d.ts +27 -0
- package/dist/plugins/source_manager.d.ts.map +1 -0
- package/dist/plugins/source_manager.js +211 -0
- package/dist/plugins/types.d.ts +41 -0
- package/dist/plugins/types.d.ts.map +1 -0
- package/dist/plugins/types.js +11 -0
- package/dist/session/context_usage.d.ts +13 -0
- package/dist/session/context_usage.d.ts.map +1 -0
- package/dist/session/context_usage.js +25 -0
- package/dist/session/index.d.ts +7 -0
- package/dist/session/index.d.ts.map +1 -0
- package/dist/session/index.js +5 -0
- package/dist/session/store.d.ts +68 -0
- package/dist/session/store.d.ts.map +1 -0
- package/dist/session/store.js +268 -0
- package/dist/session/types.d.ts +60 -0
- package/dist/session/types.d.ts.map +1 -0
- package/dist/session/types.js +11 -0
- package/dist/store/db.d.ts +64 -0
- package/dist/store/db.d.ts.map +1 -0
- package/dist/store/db.js +91 -0
- package/dist/store/json.d.ts +21 -0
- package/dist/store/json.d.ts.map +1 -0
- package/dist/store/json.js +135 -0
- package/dist/tui/agents.d.ts +4 -0
- package/dist/tui/agents.d.ts.map +1 -0
- package/dist/tui/agents.js +616 -0
- package/dist/tui/app.d.ts +2 -0
- package/dist/tui/app.d.ts.map +1 -0
- package/dist/tui/app.js +32 -0
- package/dist/tui/chat.d.ts +10 -0
- package/dist/tui/chat.d.ts.map +1 -0
- package/dist/tui/chat.js +258 -0
- package/dist/tui/logo.d.ts +2 -0
- package/dist/tui/logo.d.ts.map +1 -0
- package/dist/tui/logo.js +10 -0
- package/dist/tui/mcp_servers.d.ts +4 -0
- package/dist/tui/mcp_servers.d.ts.map +1 -0
- package/dist/tui/mcp_servers.js +287 -0
- package/dist/tui/plugins.d.ts +4 -0
- package/dist/tui/plugins.d.ts.map +1 -0
- package/dist/tui/plugins.js +234 -0
- package/dist/tui/providers.d.ts +4 -0
- package/dist/tui/providers.d.ts.map +1 -0
- package/dist/tui/providers.js +178 -0
- package/dist/tui/tool_picker_state.d.ts +9 -0
- package/dist/tui/tool_picker_state.d.ts.map +1 -0
- package/dist/tui/tool_picker_state.js +37 -0
- package/dist/types.d.ts +2 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +1 -0
- package/dist/webview/index.html +22 -0
- package/dist/webview/standalone.css +2732 -0
- package/dist/webview/standalone.css.map +7 -0
- package/dist/webview/standalone.js +20641 -0
- package/dist/webview/standalone.js.map +7 -0
- package/package.json +120 -0
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import * as fs from 'node:fs';
|
|
2
|
+
import type { FetchResult } from '../types.js';
|
|
3
|
+
export interface GitFetchInput {
|
|
4
|
+
url: string;
|
|
5
|
+
ref: string | null;
|
|
6
|
+
authToken: string | null;
|
|
7
|
+
}
|
|
8
|
+
type OnAuth = () => {
|
|
9
|
+
username: string;
|
|
10
|
+
password: string;
|
|
11
|
+
};
|
|
12
|
+
export interface GitClient {
|
|
13
|
+
clone(args: {
|
|
14
|
+
fs: unknown;
|
|
15
|
+
http: unknown;
|
|
16
|
+
dir: string;
|
|
17
|
+
url: string;
|
|
18
|
+
ref?: string;
|
|
19
|
+
singleBranch: boolean;
|
|
20
|
+
depth: number;
|
|
21
|
+
onAuth?: OnAuth;
|
|
22
|
+
}): Promise<void>;
|
|
23
|
+
fetch(args: {
|
|
24
|
+
fs: unknown;
|
|
25
|
+
http: unknown;
|
|
26
|
+
dir: string;
|
|
27
|
+
url: string;
|
|
28
|
+
ref?: string;
|
|
29
|
+
singleBranch: boolean;
|
|
30
|
+
depth: number;
|
|
31
|
+
onAuth?: OnAuth;
|
|
32
|
+
}): Promise<unknown>;
|
|
33
|
+
checkout(args: {
|
|
34
|
+
fs: unknown;
|
|
35
|
+
dir: string;
|
|
36
|
+
ref: string;
|
|
37
|
+
force: boolean;
|
|
38
|
+
}): Promise<void>;
|
|
39
|
+
resolveRef(args: {
|
|
40
|
+
fs: unknown;
|
|
41
|
+
dir: string;
|
|
42
|
+
ref: string;
|
|
43
|
+
}): Promise<string>;
|
|
44
|
+
currentBranch(args: {
|
|
45
|
+
fs: unknown;
|
|
46
|
+
dir: string;
|
|
47
|
+
}): Promise<string | undefined | void>;
|
|
48
|
+
}
|
|
49
|
+
/** Testing seam: inject a mock GitClient. Pass `null` to restore the real isomorphic-git client. */
|
|
50
|
+
export declare function __setGitClient(impl: GitClient | null): void;
|
|
51
|
+
/**
|
|
52
|
+
* isomorphic-git materializes a tracked symlink (git mode 120000) with
|
|
53
|
+
* `fs.symlink`. On Windows without SeCreateSymbolicLinkPrivilege (admin or
|
|
54
|
+
* Developer Mode) that throws EPERM, which aborts the whole clone/checkout for
|
|
55
|
+
* any repo that tracks a symlink — e.g. a plugin whose `CLAUDE.md` points at
|
|
56
|
+
* `AGENTS.md`. Git's own fallback when symlinks aren't supported
|
|
57
|
+
* (`core.symlinks=false`, the Windows default) writes the link as a plain file
|
|
58
|
+
* whose contents are the target path. Mirror that here: try a real symlink
|
|
59
|
+
* first, degrade to a plain file only when the OS refuses. Real symlinks still
|
|
60
|
+
* win everywhere they're permitted (Linux, macOS, Windows Dev Mode); the
|
|
61
|
+
* degraded file is harmless for our use — caretaker reads plugin manifests,
|
|
62
|
+
* SKILL.md, agents/ and commands/, never a plugin's root CLAUDE.md.
|
|
63
|
+
*/
|
|
64
|
+
export declare function symlinkFallbackFs(base?: typeof fs): typeof fs;
|
|
65
|
+
export declare function fetchGit(input: GitFetchInput, cacheDir: string): Promise<FetchResult>;
|
|
66
|
+
export {};
|
|
67
|
+
//# sourceMappingURL=git.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git.d.ts","sourceRoot":"","sources":["../../../src/plugins/fetchers/git.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAM9B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/C,MAAM,WAAW,aAAa;IAC5B,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAED,KAAK,MAAM,GAAG,MAAM;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC;AAE3D,MAAM,WAAW,SAAS;IACxB,KAAK,CAAC,IAAI,EAAE;QACV,EAAE,EAAE,OAAO,CAAC;QACZ,IAAI,EAAE,OAAO,CAAC;QACd,GAAG,EAAE,MAAM,CAAC;QACZ,GAAG,EAAE,MAAM,CAAC;QACZ,GAAG,CAAC,EAAE,MAAM,CAAC;QACb,YAAY,EAAE,OAAO,CAAC;QACtB,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAClB,KAAK,CAAC,IAAI,EAAE;QACV,EAAE,EAAE,OAAO,CAAC;QACZ,IAAI,EAAE,OAAO,CAAC;QACd,GAAG,EAAE,MAAM,CAAC;QACZ,GAAG,EAAE,MAAM,CAAC;QACZ,GAAG,CAAC,EAAE,MAAM,CAAC;QACb,YAAY,EAAE,OAAO,CAAC;QACtB,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACrB,QAAQ,CAAC,IAAI,EAAE;QAAE,EAAE,EAAE,OAAO,CAAC;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,OAAO,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACzF,UAAU,CAAC,IAAI,EAAE;QAAE,EAAE,EAAE,OAAO,CAAC;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAC7E,aAAa,CAAC,IAAI,EAAE;QAAE,EAAE,EAAE,OAAO,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC,CAAC;CACvF;AAYD,oGAAoG;AACpG,wBAAgB,cAAc,CAAC,IAAI,EAAE,SAAS,GAAG,IAAI,GAAG,IAAI,CAE3D;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,GAAE,OAAO,EAAO,GAAG,OAAO,EAAE,CAgBjE;AAwBD,wBAAsB,QAAQ,CAAC,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAsD3F"}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
// Git source fetcher for plugin sources. Each source has its own cache dir
|
|
2
|
+
// at ~/.caretaker/plugin-cache/<sourceId> (UUID, no collision with the
|
|
3
|
+
// caretaker server's numeric ids if both run on the same host).
|
|
4
|
+
//
|
|
5
|
+
// Auth tokens stored in the source row are decrypted on demand via
|
|
6
|
+
// lib/encryption.ts; for legacy / unencrypted entries the value is used as-is.
|
|
7
|
+
import * as fs from 'node:fs';
|
|
8
|
+
import { mkdir, rm, stat } from 'node:fs/promises';
|
|
9
|
+
import * as path from 'node:path';
|
|
10
|
+
import git from 'isomorphic-git';
|
|
11
|
+
import http from 'isomorphic-git/http/node';
|
|
12
|
+
import { decrypt, isEncrypted } from '../../lib/encryption.js';
|
|
13
|
+
const realIsomorphicGitClient = {
|
|
14
|
+
clone: (args) => git.clone(args),
|
|
15
|
+
fetch: (args) => git.fetch(args),
|
|
16
|
+
checkout: (args) => git.checkout(args),
|
|
17
|
+
resolveRef: (args) => git.resolveRef(args),
|
|
18
|
+
currentBranch: (args) => git.currentBranch(args),
|
|
19
|
+
};
|
|
20
|
+
let gitImpl = realIsomorphicGitClient;
|
|
21
|
+
/** Testing seam: inject a mock GitClient. Pass `null` to restore the real isomorphic-git client. */
|
|
22
|
+
export function __setGitClient(impl) {
|
|
23
|
+
gitImpl = impl ?? realIsomorphicGitClient;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* isomorphic-git materializes a tracked symlink (git mode 120000) with
|
|
27
|
+
* `fs.symlink`. On Windows without SeCreateSymbolicLinkPrivilege (admin or
|
|
28
|
+
* Developer Mode) that throws EPERM, which aborts the whole clone/checkout for
|
|
29
|
+
* any repo that tracks a symlink — e.g. a plugin whose `CLAUDE.md` points at
|
|
30
|
+
* `AGENTS.md`. Git's own fallback when symlinks aren't supported
|
|
31
|
+
* (`core.symlinks=false`, the Windows default) writes the link as a plain file
|
|
32
|
+
* whose contents are the target path. Mirror that here: try a real symlink
|
|
33
|
+
* first, degrade to a plain file only when the OS refuses. Real symlinks still
|
|
34
|
+
* win everywhere they're permitted (Linux, macOS, Windows Dev Mode); the
|
|
35
|
+
* degraded file is harmless for our use — caretaker reads plugin manifests,
|
|
36
|
+
* SKILL.md, agents/ and commands/, never a plugin's root CLAUDE.md.
|
|
37
|
+
*/
|
|
38
|
+
export function symlinkFallbackFs(base = fs) {
|
|
39
|
+
const symlink = async (target, linkPath, type) => {
|
|
40
|
+
try {
|
|
41
|
+
await base.promises.symlink(target, linkPath, type);
|
|
42
|
+
}
|
|
43
|
+
catch (err) {
|
|
44
|
+
const code = err.code;
|
|
45
|
+
if (code === 'EPERM' || code === 'EACCES') {
|
|
46
|
+
await base.promises.writeFile(linkPath, target.toString());
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
throw err;
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
// isomorphic-git binds fs.promises only when `promises` is an enumerable own
|
|
53
|
+
// property; an object literal gives us exactly that.
|
|
54
|
+
return { ...base, promises: { ...base.promises, symlink } };
|
|
55
|
+
}
|
|
56
|
+
const gitFs = symlinkFallbackFs();
|
|
57
|
+
function plainToken(authToken) {
|
|
58
|
+
return isEncrypted(authToken) ? decrypt(authToken) : authToken;
|
|
59
|
+
}
|
|
60
|
+
function buildOnAuth(authToken) {
|
|
61
|
+
if (!authToken)
|
|
62
|
+
return undefined;
|
|
63
|
+
const password = plainToken(authToken);
|
|
64
|
+
return () => ({ username: 'x-access-token', password });
|
|
65
|
+
}
|
|
66
|
+
async function dirExists(p) {
|
|
67
|
+
try {
|
|
68
|
+
const st = await stat(p);
|
|
69
|
+
return st.isDirectory();
|
|
70
|
+
}
|
|
71
|
+
catch (err) {
|
|
72
|
+
if (err.code === 'ENOENT')
|
|
73
|
+
return false;
|
|
74
|
+
throw err;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
export async function fetchGit(input, cacheDir) {
|
|
78
|
+
const onAuth = buildOnAuth(input.authToken);
|
|
79
|
+
const gitDir = path.join(cacheDir, '.git');
|
|
80
|
+
const alreadyCloned = await dirExists(gitDir);
|
|
81
|
+
if (!alreadyCloned) {
|
|
82
|
+
await mkdir(cacheDir, { recursive: true });
|
|
83
|
+
await gitImpl.clone({
|
|
84
|
+
fs: gitFs,
|
|
85
|
+
http,
|
|
86
|
+
dir: cacheDir,
|
|
87
|
+
url: input.url,
|
|
88
|
+
ref: input.ref ?? undefined,
|
|
89
|
+
singleBranch: true,
|
|
90
|
+
depth: 1,
|
|
91
|
+
onAuth,
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
try {
|
|
96
|
+
// Pass URL explicitly so cache moves between hosts (e.g. URL change in
|
|
97
|
+
// plugins.json) work without us editing the repo's stored remote config.
|
|
98
|
+
await gitImpl.fetch({
|
|
99
|
+
fs: gitFs,
|
|
100
|
+
http,
|
|
101
|
+
dir: cacheDir,
|
|
102
|
+
url: input.url,
|
|
103
|
+
ref: input.ref ?? undefined,
|
|
104
|
+
singleBranch: true,
|
|
105
|
+
depth: 1,
|
|
106
|
+
onAuth,
|
|
107
|
+
});
|
|
108
|
+
const target = input.ref ??
|
|
109
|
+
(await gitImpl.currentBranch({ fs: gitFs, dir: cacheDir })) ??
|
|
110
|
+
'HEAD';
|
|
111
|
+
await gitImpl.checkout({ fs: gitFs, dir: cacheDir, ref: target, force: true });
|
|
112
|
+
}
|
|
113
|
+
catch {
|
|
114
|
+
// ponytail: iso-git's in-place update is unreliable on Windows — it reports
|
|
115
|
+
// the working tree as dirty (filemode/stat mismatch, or locked files) and
|
|
116
|
+
// throws CheckoutConflictError even with force:true, where Linux succeeds.
|
|
117
|
+
// Don't fight the dirty-detection: nuke the cache and reclone (shallow, so
|
|
118
|
+
// cheap). Platform-agnostic, self-heals corrupted caches too. The reclone
|
|
119
|
+
// path has no catch, so a genuine clone/network failure still propagates.
|
|
120
|
+
//
|
|
121
|
+
// maxRetries/retryDelay: on Windows, Defender/indexer/host handles briefly
|
|
122
|
+
// lock cache files; rm's built-in retry rides out the transient
|
|
123
|
+
// EPERM/EBUSY (same lock class the store's atomic-write retry handles).
|
|
124
|
+
await rm(cacheDir, { recursive: true, force: true, maxRetries: 5, retryDelay: 100 });
|
|
125
|
+
return fetchGit(input, cacheDir);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
const sha = await gitImpl.resolveRef({ fs: gitFs, dir: cacheDir, ref: 'HEAD' });
|
|
129
|
+
return { root: cacheDir, sha };
|
|
130
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"path.d.ts","sourceRoot":"","sources":["../../../src/plugins/fetchers/path.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/C,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAIrD;AAED,wBAAsB,SAAS,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAa1E"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { stat } from 'node:fs/promises';
|
|
2
|
+
import * as path from 'node:path';
|
|
3
|
+
export function validatePathInput(input) {
|
|
4
|
+
if (!path.isAbsolute(input)) {
|
|
5
|
+
throw new Error(`PATH source must be absolute, got: ${input}`);
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
export async function fetchPath(absolutePath) {
|
|
9
|
+
validatePathInput(absolutePath);
|
|
10
|
+
let st;
|
|
11
|
+
try {
|
|
12
|
+
st = await stat(absolutePath);
|
|
13
|
+
}
|
|
14
|
+
catch (err) {
|
|
15
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
16
|
+
throw new Error(`PATH source not found: ${absolutePath} (${msg})`);
|
|
17
|
+
}
|
|
18
|
+
if (!st.isDirectory()) {
|
|
19
|
+
throw new Error(`PATH source is not a directory: ${absolutePath}`);
|
|
20
|
+
}
|
|
21
|
+
return { root: absolutePath, sha: null };
|
|
22
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export interface SkillSummary {
|
|
2
|
+
name: string;
|
|
3
|
+
description: string;
|
|
4
|
+
/** Plugin that contributes the skill — surfaced so the model (and the
|
|
5
|
+
* user, in error messages) can see where a skill comes from. */
|
|
6
|
+
plugin: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Resolve the absolute filesystem path of a plugin by id, or null when the
|
|
10
|
+
* plugin (or its source) is not registered. Used by the MCP layer to expand
|
|
11
|
+
* `${CLAUDE_PLUGIN_ROOT}` placeholders at connect time.
|
|
12
|
+
*/
|
|
13
|
+
export declare function pluginAbsoluteRoot(pluginId: string): Promise<string | null>;
|
|
14
|
+
/**
|
|
15
|
+
* Catalog of skills available to the agent. One entry per SkillSpec across
|
|
16
|
+
* all active plugins. Order: agent.plugins ordering, then per-plugin
|
|
17
|
+
* declaration order. On collision (two active plugins both declaring a
|
|
18
|
+
* skill named e.g. `brainstorming`), the first plugin in `agent.plugins`
|
|
19
|
+
* wins; the rest are dropped silently.
|
|
20
|
+
*/
|
|
21
|
+
export declare function listActiveSkills(activeNames: string[]): Promise<SkillSummary[]>;
|
|
22
|
+
/**
|
|
23
|
+
* Read the SKILL.md content of one active skill by scoped name. Returns
|
|
24
|
+
* null when the skill is unknown to the agent (no such name in any active
|
|
25
|
+
* plugin), the file is missing, or the file exceeds the size cap.
|
|
26
|
+
*
|
|
27
|
+
* Sandbox: we resolve `<sourceRoot>/<plugin.relPath>/<spec.relPath>` and
|
|
28
|
+
* reject any path that escapes the source root.
|
|
29
|
+
*/
|
|
30
|
+
export declare function readActiveSkill(name: string, activeNames: string[]): Promise<string | null>;
|
|
31
|
+
//# sourceMappingURL=loader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../src/plugins/loader.ts"],"names":[],"mappings":"AAkBA,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB;qEACiE;IACjE,MAAM,EAAE,MAAM,CAAC;CAChB;AAiBD;;;;GAIG;AACH,wBAAsB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAYjF;AAgCD;;;;;;GAMG;AACH,wBAAsB,gBAAgB,CAAC,WAAW,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC,CAiBrF;AAED;;;;;;;GAOG;AACH,wBAAsB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAmCjG"}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
// Skill resolution at chat time. Skills live on PluginRecord.skills (one
|
|
2
|
+
// entry per `**/SKILL.md` file inside the plugin), gated per-agent by
|
|
3
|
+
// AgentConfig.plugins. Mirrors the commands/loader pattern: PluginRecord
|
|
4
|
+
// is the source of truth, no separate store.
|
|
5
|
+
//
|
|
6
|
+
// Granularity is **per file** since 2c47a72: a cc-plugin pack like
|
|
7
|
+
// `superpowers` exposes each `skills/<name>/SKILL.md` as its own entry,
|
|
8
|
+
// not a concatenated blob. The model's `list_skills` shows individual
|
|
9
|
+
// skill names; `read_skill` reads exactly one file.
|
|
10
|
+
import { readFile, stat } from 'node:fs/promises';
|
|
11
|
+
import * as path from 'node:path';
|
|
12
|
+
import * as os from 'node:os';
|
|
13
|
+
import { loadPlugins } from '../store/json.js';
|
|
14
|
+
const SKILL_FILE_BYTE_CAP = 100_000;
|
|
15
|
+
function isInside(root, candidate) {
|
|
16
|
+
const resolvedRoot = path.resolve(root);
|
|
17
|
+
const resolvedCandidate = path.resolve(root, candidate);
|
|
18
|
+
const rel = path.relative(resolvedRoot, resolvedCandidate);
|
|
19
|
+
return !rel.startsWith('..') && !path.isAbsolute(rel);
|
|
20
|
+
}
|
|
21
|
+
function pluginCacheRoot() {
|
|
22
|
+
return process.env.PLUGIN_CACHE_DIR ?? path.join(os.homedir(), '.caretaker', 'plugin-cache');
|
|
23
|
+
}
|
|
24
|
+
function rootForSource(src) {
|
|
25
|
+
return src.kind === 'git' ? path.join(pluginCacheRoot(), src.id) : src.url;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Resolve the absolute filesystem path of a plugin by id, or null when the
|
|
29
|
+
* plugin (or its source) is not registered. Used by the MCP layer to expand
|
|
30
|
+
* `${CLAUDE_PLUGIN_ROOT}` placeholders at connect time.
|
|
31
|
+
*/
|
|
32
|
+
export async function pluginAbsoluteRoot(pluginId) {
|
|
33
|
+
let file;
|
|
34
|
+
try {
|
|
35
|
+
file = await loadPlugins();
|
|
36
|
+
}
|
|
37
|
+
catch {
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
40
|
+
const plugin = file.plugins.find((p) => p.id === pluginId);
|
|
41
|
+
if (!plugin)
|
|
42
|
+
return null;
|
|
43
|
+
const source = file.sources.find((s) => s.id === plugin.sourceId);
|
|
44
|
+
if (!source)
|
|
45
|
+
return null;
|
|
46
|
+
return path.join(rootForSource(source), plugin.relPath);
|
|
47
|
+
}
|
|
48
|
+
async function activePluginRecords(activeNames) {
|
|
49
|
+
const wanted = activeNames.map((n) => n.trim()).filter(Boolean);
|
|
50
|
+
if (wanted.length === 0)
|
|
51
|
+
return [];
|
|
52
|
+
let file;
|
|
53
|
+
try {
|
|
54
|
+
file = await loadPlugins();
|
|
55
|
+
}
|
|
56
|
+
catch (err) {
|
|
57
|
+
console.error('[plugin loader] failed to read plugins.json:', err);
|
|
58
|
+
return [];
|
|
59
|
+
}
|
|
60
|
+
// Preserve `agent.plugins` ordering so the first-wins rule on collision
|
|
61
|
+
// is deterministic and user-controlled (mirrors commands/loader).
|
|
62
|
+
const sourceById = new Map(file.sources.map((s) => [s.id, s]));
|
|
63
|
+
const byName = new Map();
|
|
64
|
+
for (const p of file.plugins)
|
|
65
|
+
byName.set(p.name, p);
|
|
66
|
+
const out = [];
|
|
67
|
+
for (const name of wanted) {
|
|
68
|
+
const plugin = byName.get(name);
|
|
69
|
+
if (!plugin)
|
|
70
|
+
continue;
|
|
71
|
+
const source = sourceById.get(plugin.sourceId);
|
|
72
|
+
if (!source)
|
|
73
|
+
continue;
|
|
74
|
+
out.push({ plugin, source });
|
|
75
|
+
}
|
|
76
|
+
return out;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Catalog of skills available to the agent. One entry per SkillSpec across
|
|
80
|
+
* all active plugins. Order: agent.plugins ordering, then per-plugin
|
|
81
|
+
* declaration order. On collision (two active plugins both declaring a
|
|
82
|
+
* skill named e.g. `brainstorming`), the first plugin in `agent.plugins`
|
|
83
|
+
* wins; the rest are dropped silently.
|
|
84
|
+
*/
|
|
85
|
+
export async function listActiveSkills(activeNames) {
|
|
86
|
+
const records = await activePluginRecords(activeNames);
|
|
87
|
+
const seen = new Set();
|
|
88
|
+
const out = [];
|
|
89
|
+
for (const { plugin } of records) {
|
|
90
|
+
if (!plugin.skills)
|
|
91
|
+
continue;
|
|
92
|
+
for (const [scopedName, spec] of Object.entries(plugin.skills)) {
|
|
93
|
+
if (seen.has(scopedName))
|
|
94
|
+
continue;
|
|
95
|
+
seen.add(scopedName);
|
|
96
|
+
out.push({
|
|
97
|
+
name: scopedName,
|
|
98
|
+
description: spec.description ?? '',
|
|
99
|
+
plugin: plugin.name,
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
return out;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Read the SKILL.md content of one active skill by scoped name. Returns
|
|
107
|
+
* null when the skill is unknown to the agent (no such name in any active
|
|
108
|
+
* plugin), the file is missing, or the file exceeds the size cap.
|
|
109
|
+
*
|
|
110
|
+
* Sandbox: we resolve `<sourceRoot>/<plugin.relPath>/<spec.relPath>` and
|
|
111
|
+
* reject any path that escapes the source root.
|
|
112
|
+
*/
|
|
113
|
+
export async function readActiveSkill(name, activeNames) {
|
|
114
|
+
const trimmed = name.trim();
|
|
115
|
+
if (!trimmed)
|
|
116
|
+
return null;
|
|
117
|
+
const records = await activePluginRecords(activeNames);
|
|
118
|
+
for (const { plugin, source } of records) {
|
|
119
|
+
const spec = plugin.skills?.[trimmed];
|
|
120
|
+
if (!spec)
|
|
121
|
+
continue;
|
|
122
|
+
const sourceRoot = rootForSource(source);
|
|
123
|
+
if (!isInside(sourceRoot, plugin.relPath)) {
|
|
124
|
+
console.warn(`[plugin loader] rejecting out-of-root relPath for ${plugin.name}`);
|
|
125
|
+
return null;
|
|
126
|
+
}
|
|
127
|
+
const pluginRoot = path.join(sourceRoot, plugin.relPath);
|
|
128
|
+
if (!isInside(pluginRoot, spec.relPath)) {
|
|
129
|
+
console.warn(`[plugin loader] rejecting out-of-root skill relPath for ${plugin.name}/${trimmed}`);
|
|
130
|
+
return null;
|
|
131
|
+
}
|
|
132
|
+
const skillFile = path.join(pluginRoot, spec.relPath);
|
|
133
|
+
try {
|
|
134
|
+
const { size } = await stat(skillFile);
|
|
135
|
+
if (size > SKILL_FILE_BYTE_CAP) {
|
|
136
|
+
console.warn(`[plugin loader] skipping ${plugin.name}/${trimmed}: SKILL.md > ${SKILL_FILE_BYTE_CAP} bytes`);
|
|
137
|
+
return null;
|
|
138
|
+
}
|
|
139
|
+
return await readFile(skillFile, 'utf-8');
|
|
140
|
+
}
|
|
141
|
+
catch {
|
|
142
|
+
return null;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
return null;
|
|
146
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { type DiscoveredPlugin } from './types.js';
|
|
2
|
+
import type { AgentSpec, CommandSpec, McpServerSpec, PluginManifestKind, SkillSpec } from '../types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Read `<pluginRoot>/.mcp.json` and return the declared MCP server specs.
|
|
5
|
+
* Two shapes are observed in the wild and both are accepted:
|
|
6
|
+
* - `{ "mcpServers": { name: { … } } }` (lh-youtrack, official spec)
|
|
7
|
+
* - `{ name: { … } }` (claude-plugins-official examples)
|
|
8
|
+
*
|
|
9
|
+
* Returns `undefined` when the file is absent, malformed, or contains zero
|
|
10
|
+
* usable entries — the caller treats that as "this plugin declares no MCP
|
|
11
|
+
* servers" and the row stays clean. Path traversal is guarded by the
|
|
12
|
+
* caller; we only read the resolved absolute path.
|
|
13
|
+
*/
|
|
14
|
+
export declare function discoverPluginMcpServers(pluginRoot: string): Promise<Record<string, McpServerSpec> | undefined>;
|
|
15
|
+
export declare function discoverPlugins(root: string): Promise<DiscoveredPlugin[]>;
|
|
16
|
+
/**
|
|
17
|
+
* Read every `<pluginRoot>/agents/*.md` and parse it as a sub-agent spec:
|
|
18
|
+
* YAML frontmatter contributes `name`, `description`, `model`; the body
|
|
19
|
+
* (everything after the closing `---`) becomes the system prompt.
|
|
20
|
+
*
|
|
21
|
+
* The frontmatter `tools:` field is intentionally ignored — its vocabulary
|
|
22
|
+
* is Anthropic's tool surface (Read, Bash, Glob, …) which doesn't map 1:1
|
|
23
|
+
* to ours, and a wrong mapping would silently grant or deny tools. The
|
|
24
|
+
* user wires allowedTools via the agent form after the row is materialized.
|
|
25
|
+
*
|
|
26
|
+
* The map is keyed by the filename basename (without `.md`), which becomes
|
|
27
|
+
* the plugin-scoped name during sync. Files without parseable frontmatter
|
|
28
|
+
* are skipped silently. Returns undefined when the directory is missing or
|
|
29
|
+
* empty so the discovered plugin row stays clean.
|
|
30
|
+
*/
|
|
31
|
+
export declare function discoverPluginAgents(pluginRoot: string): Promise<Record<string, AgentSpec> | undefined>;
|
|
32
|
+
/**
|
|
33
|
+
* Read every `<pluginRoot>/commands/*.md` and return slash-command specs.
|
|
34
|
+
* Frontmatter contributes `description` and `argument-hint` (kebab-case
|
|
35
|
+
* matches the official Claude Code convention); the body below the
|
|
36
|
+
* frontmatter is the prompt template with `$1`/`$2`/`$ARGUMENTS`
|
|
37
|
+
* placeholders. Files without a body are skipped.
|
|
38
|
+
*
|
|
39
|
+
* Map keys are filename basenames so `commands/foo.md` becomes `/foo` at
|
|
40
|
+
* chat time.
|
|
41
|
+
*/
|
|
42
|
+
export declare function discoverPluginCommands(pluginRoot: string): Promise<Record<string, CommandSpec> | undefined>;
|
|
43
|
+
/**
|
|
44
|
+
* Enumerate the SKILL.md files inside a plugin and return one SkillSpec
|
|
45
|
+
* per file. For `skill-glob` plugins (the plugin's own root IS the skill)
|
|
46
|
+
* the function looks at `<pluginRoot>/SKILL.md` only. For `cc-plugin` /
|
|
47
|
+
* `cc-marketplace` plugins it globs every `**\/SKILL.md` so a pack like
|
|
48
|
+
* superpowers surfaces each of its sub-skills individually.
|
|
49
|
+
*
|
|
50
|
+
* The scoped name (= map key) comes from the frontmatter `name`, falling
|
|
51
|
+
* back to the basename of the directory containing SKILL.md, falling back
|
|
52
|
+
* to `pluginNameFallback` (used only for the rare `skill-glob` SKILL.md
|
|
53
|
+
* sitting at the plugin root with no frontmatter).
|
|
54
|
+
*/
|
|
55
|
+
export declare function discoverPluginSkills(pluginRoot: string, manifestKind: PluginManifestKind, pluginNameFallback: string): Promise<Record<string, SkillSpec> | undefined>;
|
|
56
|
+
//# sourceMappingURL=manifest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../../src/plugins/manifest.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAuB,KAAK,gBAAgB,EAAE,MAAM,YAAY,CAAC;AACxE,OAAO,KAAK,EACV,SAAS,EACT,WAAW,EACX,aAAa,EACb,kBAAkB,EAClB,SAAS,EACV,MAAM,aAAa,CAAC;AA0DrB;;;;;;;;;;GAUG;AACH,wBAAsB,wBAAwB,CAC5C,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,GAAG,SAAS,CAAC,CAgBpD;AA0FD,wBAAsB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAQ/E;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,oBAAoB,CACxC,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,SAAS,CAAC,CAyDhD;AAED;;;;;;;;;GASG;AACH,wBAAsB,sBAAsB,CAC1C,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,GAAG,SAAS,CAAC,CAmDlD;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,oBAAoB,CACxC,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,kBAAkB,EAChC,kBAAkB,EAAE,MAAM,GACzB,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,SAAS,CAAC,CAoDhD"}
|