@kisev/agentomatic 11.0.2-dev.106.g6e5fddb22587 → 11.0.2-dev.108.g3b95bb17b845
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/assets/migration-inventory.json +2 -1
- package/dist/installer.d.ts +18 -0
- package/dist/installer.js +27 -7
- package/package.json +2 -2
package/dist/installer.d.ts
CHANGED
|
@@ -33,6 +33,23 @@ export type Plan = {
|
|
|
33
33
|
requires_restart: boolean;
|
|
34
34
|
digest: string;
|
|
35
35
|
};
|
|
36
|
+
type ManifestFile = {
|
|
37
|
+
sha256: string;
|
|
38
|
+
mode: number;
|
|
39
|
+
kind: "command" | "agent" | "plugin" | "state";
|
|
40
|
+
};
|
|
41
|
+
type Manifest = {
|
|
42
|
+
schema_version: 2;
|
|
43
|
+
package: string;
|
|
44
|
+
package_version: string;
|
|
45
|
+
version: string;
|
|
46
|
+
scope: Scope;
|
|
47
|
+
commands: string[];
|
|
48
|
+
agents: FixedAgentRole[];
|
|
49
|
+
plugins: SelectablePlugin[];
|
|
50
|
+
core_activation: boolean;
|
|
51
|
+
files: Record<string, ManifestFile>;
|
|
52
|
+
};
|
|
36
53
|
export type ArchiveCandidate = {
|
|
37
54
|
path: string;
|
|
38
55
|
record: {
|
|
@@ -46,6 +63,7 @@ export type ArchiveCandidate = {
|
|
|
46
63
|
export declare const SELECTABLE_PLUGINS: SelectablePlugin[];
|
|
47
64
|
export declare const SKILL_COMMANDS: string[];
|
|
48
65
|
export declare function defaultSelection(): InstallerSelection;
|
|
66
|
+
export declare function savedSelection(manifest: Pick<Manifest, "commands" | "agents" | "plugins">): Partial<InstallerSelection>;
|
|
49
67
|
export declare function installedSelection(scope: Scope, cwd?: string, home?: string, overrides?: Partial<InstallerSelection>): Promise<InstallerSelection | null>;
|
|
50
68
|
export declare function coreSelectionMutation(root: string, enabled: boolean): Promise<FileMutation | undefined>;
|
|
51
69
|
export declare function normalizeSelection(value?: Partial<InstallerSelection>): InstallerSelection;
|
package/dist/installer.js
CHANGED
|
@@ -15,8 +15,11 @@ const LEGACY_MANIFEST_NAME = ".skills-opencode-manifest.json";
|
|
|
15
15
|
const LEGACY_PACKAGE_NAME = "@kisev/skills-opencode";
|
|
16
16
|
const packageRoot = resolve(dirname(fileURLToPath(import.meta.url)), "..");
|
|
17
17
|
const assetsRoot = resolve(packageRoot, "dist", "assets");
|
|
18
|
+
function migrationInventory() {
|
|
19
|
+
return JSON.parse(readFileSync(resolve(assetsRoot, "migration-inventory.json"), "utf8"));
|
|
20
|
+
}
|
|
18
21
|
function retiredAssetPaths() {
|
|
19
|
-
const inventory =
|
|
22
|
+
const inventory = migrationInventory();
|
|
20
23
|
return new Set([
|
|
21
24
|
...Object.keys(inventory.retired_command_hashes ?? {}),
|
|
22
25
|
...Object.keys(inventory.retired_plugin_hashes ?? {}),
|
|
@@ -33,13 +36,32 @@ export function defaultSelection() {
|
|
|
33
36
|
core_activation: true,
|
|
34
37
|
};
|
|
35
38
|
}
|
|
39
|
+
const RENAME_CHAIN_LIMIT = 8;
|
|
40
|
+
function migrateSavedCommand(renamed, name) {
|
|
41
|
+
let current = name;
|
|
42
|
+
for (let depth = 0; depth < RENAME_CHAIN_LIMIT; depth += 1) {
|
|
43
|
+
const replacement = renamed[current];
|
|
44
|
+
if (replacement === undefined)
|
|
45
|
+
return current;
|
|
46
|
+
current = replacement;
|
|
47
|
+
}
|
|
48
|
+
return current;
|
|
49
|
+
}
|
|
50
|
+
export function savedSelection(manifest) {
|
|
51
|
+
const renamed = migrationInventory().renamed ?? {};
|
|
52
|
+
const requested = (manifest.commands ?? defaultSelection().commands).map((name) => migrateSavedCommand(renamed, name));
|
|
53
|
+
const commands = requested.filter((name) => SKILL_COMMANDS.includes(name));
|
|
54
|
+
const agents = (manifest.agents ?? FIXED_AGENT_ROLES).filter((role) => FIXED_AGENT_ROLES.includes(role));
|
|
55
|
+
const plugins = (manifest.plugins ?? ["rtk"]).filter((plugin) => SELECTABLE_PLUGINS.includes(plugin));
|
|
56
|
+
if (requested.join("\0") !== commands.join("\0"))
|
|
57
|
+
process.stderr.write(`Saved selection migrated to the current catalog: ${requested.join(", ")} -> ${commands.join(", ") || "none"}\n`);
|
|
58
|
+
return { commands, agents, plugins };
|
|
59
|
+
}
|
|
36
60
|
export async function installedSelection(scope, cwd = process.cwd(), home = homedir(), overrides = {}) {
|
|
37
61
|
const { manifest } = await currentManifest(deploymentRoot(scope, cwd, home));
|
|
38
62
|
return manifest
|
|
39
63
|
? normalizeSelection({
|
|
40
|
-
|
|
41
|
-
agents: manifest.agents,
|
|
42
|
-
plugins: manifest.plugins,
|
|
64
|
+
...savedSelection(manifest),
|
|
43
65
|
core_activation: manifest.core_activation,
|
|
44
66
|
...overrides,
|
|
45
67
|
})
|
|
@@ -355,9 +377,7 @@ async function build(action, scope, cwd = process.cwd(), home = homedir(), reque
|
|
|
355
377
|
const selection = normalizeSelection(requestedSelection ??
|
|
356
378
|
(owned.manifest
|
|
357
379
|
? {
|
|
358
|
-
|
|
359
|
-
agents: owned.manifest.agents,
|
|
360
|
-
plugins: owned.manifest.plugins,
|
|
380
|
+
...savedSelection(owned.manifest),
|
|
361
381
|
core_activation: owned.manifest.core_activation,
|
|
362
382
|
}
|
|
363
383
|
: undefined));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kisev/agentomatic",
|
|
3
|
-
"version": "11.0.2-dev.
|
|
3
|
+
"version": "11.0.2-dev.108.g3b95bb17b845",
|
|
4
4
|
"description": "OpenCode integration and opt-in installer for portable Agent Skills.",
|
|
5
5
|
"homepage": "https://github.com/kisev/skills#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"@clack/prompts": "^1.8.1",
|
|
49
|
-
"@kisev/safe-fs": "1.0.0-dev.
|
|
49
|
+
"@kisev/safe-fs": "1.0.0-dev.108.g3b95bb17b845",
|
|
50
50
|
"commander": "15.0.0",
|
|
51
51
|
"zod": "4.1.8"
|
|
52
52
|
},
|