agentloom 0.1.0 → 0.1.1
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 +91 -72
- package/bin/cli.mjs +3 -2
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +149 -17
- package/dist/commands/add.d.ts +7 -0
- package/dist/commands/add.js +122 -31
- package/dist/commands/agent.d.ts +2 -0
- package/dist/commands/agent.js +85 -0
- package/dist/commands/command.d.ts +2 -0
- package/dist/commands/command.js +98 -0
- package/dist/commands/delete.d.ts +9 -0
- package/dist/commands/delete.js +444 -0
- package/dist/commands/entity-utils.d.ts +13 -0
- package/dist/commands/entity-utils.js +58 -0
- package/dist/commands/find.d.ts +21 -0
- package/dist/commands/find.js +944 -0
- package/dist/commands/mcp.js +133 -55
- package/dist/commands/skills.d.ts +2 -1
- package/dist/commands/skills.js +105 -9
- package/dist/commands/sync.d.ts +6 -0
- package/dist/commands/sync.js +12 -10
- package/dist/commands/update.d.ts +7 -0
- package/dist/commands/update.js +286 -21
- package/dist/core/argv.d.ts +2 -1
- package/dist/core/argv.js +42 -2
- package/dist/core/commands.d.ts +13 -0
- package/dist/core/commands.js +65 -0
- package/dist/core/copy.d.ts +6 -0
- package/dist/core/copy.js +126 -65
- package/dist/core/importer.d.ts +28 -1
- package/dist/core/importer.js +1104 -41
- package/dist/core/lockfile.js +86 -3
- package/dist/core/manage-agents-bootstrap.d.ts +10 -0
- package/dist/core/manage-agents-bootstrap.js +40 -0
- package/dist/core/manifest.js +7 -1
- package/dist/core/router.d.ts +16 -0
- package/dist/core/router.js +66 -0
- package/dist/core/scope.d.ts +1 -1
- package/dist/core/scope.js +12 -8
- package/dist/core/settings.d.ts +4 -3
- package/dist/core/settings.js +10 -8
- package/dist/core/skills.d.ts +23 -0
- package/dist/core/skills.js +328 -0
- package/dist/core/sources.d.ts +3 -1
- package/dist/core/sources.js +31 -1
- package/dist/core/telemetry.d.ts +26 -0
- package/dist/core/telemetry.js +124 -0
- package/dist/sync/index.d.ts +7 -1
- package/dist/sync/index.js +395 -131
- package/dist/types.d.ts +16 -1
- package/package.json +5 -4
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { getStringArrayFlag, parseProvidersFlag } from "../core/argv.js";
|
|
2
|
+
import { resolveScope } from "../core/scope.js";
|
|
3
|
+
import { getGlobalSettingsPath, updateLastScope, updateLastScopeBestEffort, } from "../core/settings.js";
|
|
4
|
+
import { formatSyncSummary, syncFromCanonical } from "../sync/index.js";
|
|
5
|
+
export function isInteractiveSession() {
|
|
6
|
+
return Boolean(process.stdin.isTTY && process.stdout.isTTY);
|
|
7
|
+
}
|
|
8
|
+
export function getNonInteractiveMode(argv) {
|
|
9
|
+
if (argv.yes)
|
|
10
|
+
return true;
|
|
11
|
+
return !isInteractiveSession();
|
|
12
|
+
}
|
|
13
|
+
export async function resolvePathsForCommand(argv, cwd) {
|
|
14
|
+
const paths = await resolveScope({
|
|
15
|
+
cwd,
|
|
16
|
+
global: Boolean(argv.global),
|
|
17
|
+
local: Boolean(argv.local),
|
|
18
|
+
interactive: !getNonInteractiveMode(argv),
|
|
19
|
+
});
|
|
20
|
+
const globalSettingsPath = getGlobalSettingsPath(paths.homeDir);
|
|
21
|
+
updateLastScopeBestEffort(globalSettingsPath, paths.scope);
|
|
22
|
+
return paths;
|
|
23
|
+
}
|
|
24
|
+
export function getEntitySelectors(argv, entity) {
|
|
25
|
+
const argsRecord = argv;
|
|
26
|
+
if (entity === "agent") {
|
|
27
|
+
return getStringArrayFlag(argsRecord.agents, getStringArrayFlag(argv.agent));
|
|
28
|
+
}
|
|
29
|
+
if (entity === "command") {
|
|
30
|
+
return getStringArrayFlag(argsRecord.commands, getStringArrayFlag(argsRecord.command));
|
|
31
|
+
}
|
|
32
|
+
if (entity === "mcp") {
|
|
33
|
+
return getStringArrayFlag(argsRecord.mcps, getStringArrayFlag(argsRecord.mcp));
|
|
34
|
+
}
|
|
35
|
+
return getStringArrayFlag(argsRecord.skills, getStringArrayFlag(argsRecord.skill));
|
|
36
|
+
}
|
|
37
|
+
export async function runPostMutationSync(options) {
|
|
38
|
+
markScopeAsUsed(options.paths);
|
|
39
|
+
if (options.argv["no-sync"])
|
|
40
|
+
return;
|
|
41
|
+
const summary = await syncFromCanonical({
|
|
42
|
+
paths: options.paths,
|
|
43
|
+
providers: options.providers ?? parseProvidersFlag(options.argv.providers),
|
|
44
|
+
yes: Boolean(options.argv.yes),
|
|
45
|
+
nonInteractive: getNonInteractiveMode(options.argv),
|
|
46
|
+
dryRun: Boolean(options.argv["dry-run"]),
|
|
47
|
+
target: options.target,
|
|
48
|
+
});
|
|
49
|
+
console.log("");
|
|
50
|
+
console.log(formatSyncSummary(summary, options.paths.agentsRoot));
|
|
51
|
+
}
|
|
52
|
+
export function markScopeAsUsed(paths) {
|
|
53
|
+
updateLastScope(paths.settingsPath, paths.scope);
|
|
54
|
+
const globalSettingsPath = getGlobalSettingsPath(paths.homeDir);
|
|
55
|
+
if (paths.settingsPath !== globalSettingsPath) {
|
|
56
|
+
updateLastScopeBestEffort(globalSettingsPath, paths.scope);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ParsedArgs } from "minimist";
|
|
2
|
+
import type { EntityType } from "../types.js";
|
|
3
|
+
type AgentSearchClient = (query: string, limit: number) => Promise<FoundAgent[] | SearchAgentsResult>;
|
|
4
|
+
export type FoundAgent = {
|
|
5
|
+
repo: string;
|
|
6
|
+
agentName: string;
|
|
7
|
+
filePath: string;
|
|
8
|
+
fileUrl: string;
|
|
9
|
+
source?: string;
|
|
10
|
+
stars: number;
|
|
11
|
+
subdir?: string;
|
|
12
|
+
};
|
|
13
|
+
export type SearchAgentsResult = {
|
|
14
|
+
agents: FoundAgent[];
|
|
15
|
+
failures: string[];
|
|
16
|
+
};
|
|
17
|
+
export declare function runFindCommand(argv: ParsedArgs, searchClient?: AgentSearchClient): Promise<void>;
|
|
18
|
+
export declare function runScopedFindCommand(argv: ParsedArgs, target: EntityType | "all", searchClient?: AgentSearchClient): Promise<void>;
|
|
19
|
+
export declare function searchAgents(query: string, limit?: number, apiBase?: string): Promise<FoundAgent[]>;
|
|
20
|
+
export declare function searchAgentsWithDiagnostics(query: string, limit?: number, apiBase?: string): Promise<SearchAgentsResult>;
|
|
21
|
+
export {};
|