@kisev/agentomatic 11.0.0-dev.46.gfbe1e4c6992e
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 +95 -0
- package/README.ru.md +98 -0
- package/dist/agent-profiles.d.ts +125 -0
- package/dist/agent-profiles.js +820 -0
- package/dist/assets/agents/architect.md +67 -0
- package/dist/assets/agents/critic.md +55 -0
- package/dist/assets/agents/manager.md +40 -0
- package/dist/assets/agents/mapper.md +33 -0
- package/dist/assets/agents/review.md +37 -0
- package/dist/assets/agents/worker.md +78 -0
- package/dist/assets/commands/agents-md.md +10 -0
- package/dist/assets/commands/askme.md +10 -0
- package/dist/assets/commands/ast-grep.md +10 -0
- package/dist/assets/commands/briefing.md +10 -0
- package/dist/assets/commands/code-explain.md +10 -0
- package/dist/assets/commands/code-review.md +10 -0
- package/dist/assets/commands/commit-msg.md +10 -0
- package/dist/assets/commands/docs-prepare.md +10 -0
- package/dist/assets/commands/docs-review.md +10 -0
- package/dist/assets/commands/goal.md +10 -0
- package/dist/assets/commands/humanize.md +10 -0
- package/dist/assets/commands/mattermost-triage.md +10 -0
- package/dist/assets/commands/mattermost.md +10 -0
- package/dist/assets/commands/mr-prepare.md +10 -0
- package/dist/assets/commands/release-prepare.md +10 -0
- package/dist/assets/commands/release-review.md +10 -0
- package/dist/assets/commands/rtk-stats.md +13 -0
- package/dist/assets/commands/rtk.md +10 -0
- package/dist/assets/commands/skill-improve.md +10 -0
- package/dist/assets/commands/slides-prompts-prepare.md +10 -0
- package/dist/assets/commands/spec-manage.md +13 -0
- package/dist/assets/commands/stopit.md +10 -0
- package/dist/assets/commands/task-prepare.md +10 -0
- package/dist/assets/commands/task-review.md +10 -0
- package/dist/assets/commands/task-triage.md +10 -0
- package/dist/assets/commands/taskmatic.md +10 -0
- package/dist/assets/commands/team-retro.md +10 -0
- package/dist/assets/commands/team-roadmap.md +10 -0
- package/dist/assets/commands/team-sprint-close.md +10 -0
- package/dist/assets/commands/team-sprint-start.md +10 -0
- package/dist/assets/lsp-catalog.json +30 -0
- package/dist/assets/migration-inventory.json +301 -0
- package/dist/assets/plugins/memomatic.js +3 -0
- package/dist/assets/plugins/rtk.js +3 -0
- package/dist/assets/plugins/rules-injector.js +3 -0
- package/dist/assets/plugins/zed-bell.js +3 -0
- package/dist/catalog.d.ts +8 -0
- package/dist/catalog.js +39 -0
- package/dist/cli-output.d.ts +27 -0
- package/dist/cli-output.js +296 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +1135 -0
- package/dist/config-setup.d.ts +71 -0
- package/dist/config-setup.js +438 -0
- package/dist/contracts.d.ts +52 -0
- package/dist/contracts.js +102 -0
- package/dist/doctor.d.ts +44 -0
- package/dist/doctor.js +638 -0
- package/dist/generate-assets.d.ts +1 -0
- package/dist/generate-assets.js +54 -0
- package/dist/index.d.ts +125 -0
- package/dist/index.js +141 -0
- package/dist/installer.d.ts +56 -0
- package/dist/installer.js +710 -0
- package/dist/jsonc.d.ts +56 -0
- package/dist/jsonc.js +432 -0
- package/dist/lifecycle.d.ts +77 -0
- package/dist/lifecycle.js +736 -0
- package/dist/package-metadata.d.ts +4 -0
- package/dist/package-metadata.js +42 -0
- package/dist/plugins/memomatic.d.ts +76 -0
- package/dist/plugins/memomatic.js +101 -0
- package/dist/plugins/rtk.d.ts +41 -0
- package/dist/plugins/rtk.js +177 -0
- package/dist/plugins/rules-injector.d.ts +22 -0
- package/dist/plugins/rules-injector.js +131 -0
- package/dist/plugins/zed-bell.d.ts +13 -0
- package/dist/plugins/zed-bell.js +14 -0
- package/dist/reconcile.d.ts +47 -0
- package/dist/reconcile.js +490 -0
- package/dist/registry.d.ts +21 -0
- package/dist/registry.js +92 -0
- package/dist/routing.d.ts +133 -0
- package/dist/routing.js +578 -0
- package/dist/runtime/state.d.ts +9 -0
- package/dist/runtime/state.js +193 -0
- package/dist/runtime/worktree.d.ts +33 -0
- package/dist/runtime/worktree.js +220 -0
- package/dist/terminal-wizard.d.ts +3 -0
- package/dist/terminal-wizard.js +237 -0
- package/package.json +72 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { copyFile, cp, mkdir, readFile, readdir, unlink, writeFile } from "node:fs/promises";
|
|
2
|
+
import { dirname, resolve } from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
import { COMMAND_REGISTRY, renderCommand } from "./registry.js";
|
|
5
|
+
const packageRoot = resolve(dirname(fileURLToPath(import.meta.url)), "..");
|
|
6
|
+
const arguments_ = process.argv.slice(2);
|
|
7
|
+
const rootIndex = arguments_.indexOf("--root");
|
|
8
|
+
if (rootIndex !== -1 && !arguments_[rootIndex + 1])
|
|
9
|
+
throw new Error("--root requires a path");
|
|
10
|
+
const commandsRoot = rootIndex === -1
|
|
11
|
+
? resolve(packageRoot, "dist", "assets", "commands")
|
|
12
|
+
: resolve(arguments_[rootIndex + 1] ?? "");
|
|
13
|
+
const check = arguments_.includes("--check");
|
|
14
|
+
const expectedNames = new Set(COMMAND_REGISTRY.map((command) => `${command.name}.md`));
|
|
15
|
+
if (!check)
|
|
16
|
+
await mkdir(commandsRoot, { recursive: true });
|
|
17
|
+
const entries = await readdir(commandsRoot, { withFileTypes: true }).catch(() => []);
|
|
18
|
+
for (const entry of entries) {
|
|
19
|
+
if (entry.isFile() && !expectedNames.has(entry.name)) {
|
|
20
|
+
if (check)
|
|
21
|
+
throw new Error(`unexpected generated asset: ${entry.name}`);
|
|
22
|
+
await unlink(resolve(commandsRoot, entry.name));
|
|
23
|
+
}
|
|
24
|
+
else if (!entry.isFile()) {
|
|
25
|
+
throw new Error(`unexpected entry in generated assets: ${entry.name}`);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
for (const command of COMMAND_REGISTRY) {
|
|
29
|
+
const destination = resolve(commandsRoot, `${command.name}.md`);
|
|
30
|
+
const expected = renderCommand(command);
|
|
31
|
+
if (check) {
|
|
32
|
+
const actual = await readFile(destination, "utf8").catch(() => "");
|
|
33
|
+
if (actual !== expected)
|
|
34
|
+
throw new Error(`generated asset drift: ${command.name}.md`);
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
await writeFile(destination, expected, "utf8");
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
if (rootIndex === -1) {
|
|
41
|
+
const catalog = resolve(packageRoot, "..", "..", "shared", "references", "lsp-catalog.json");
|
|
42
|
+
const destination = resolve(packageRoot, "dist", "assets", "lsp-catalog.json");
|
|
43
|
+
if (check) {
|
|
44
|
+
if ((await readFile(destination).catch(() => Buffer.alloc(0))).compare(await readFile(catalog)) !== 0)
|
|
45
|
+
throw new Error("generated asset drift: lsp-catalog.json");
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
await mkdir(dirname(destination), { recursive: true });
|
|
49
|
+
await copyFile(catalog, destination);
|
|
50
|
+
await cp(resolve(packageRoot, "assets", "agents"), resolve(packageRoot, "dist", "assets", "agents"), { recursive: true });
|
|
51
|
+
await cp(resolve(packageRoot, "assets", "plugins"), resolve(packageRoot, "dist", "assets", "plugins"), { recursive: true });
|
|
52
|
+
await copyFile(resolve(packageRoot, "assets", "migration-inventory.json"), resolve(packageRoot, "dist", "assets", "migration-inventory.json"));
|
|
53
|
+
}
|
|
54
|
+
}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { type PluginInput } from "@opencode-ai/plugin";
|
|
2
|
+
import rulesInjector, { type RulesInjectorOptions } from "./plugins/rules-injector.js";
|
|
3
|
+
import rtk, { type RtkOptions } from "./plugins/rtk.js";
|
|
4
|
+
import zedBell, { type ZedBellOptions } from "./plugins/zed-bell.js";
|
|
5
|
+
import memomatic, { type MemomaticOptions } from "./plugins/memomatic.js";
|
|
6
|
+
export { rulesInjector, rtk, zedBell, memomatic };
|
|
7
|
+
export type OpenCodeOptions = {
|
|
8
|
+
rulesInjector?: RulesInjectorOptions;
|
|
9
|
+
rtk?: RtkOptions;
|
|
10
|
+
zedBell?: ZedBellOptions;
|
|
11
|
+
memomatic?: MemomaticOptions;
|
|
12
|
+
};
|
|
13
|
+
declare const plugin: (input: PluginInput) => Promise<{
|
|
14
|
+
tool: {
|
|
15
|
+
route: {
|
|
16
|
+
description: string;
|
|
17
|
+
args: {
|
|
18
|
+
action: import("zod").ZodEnum<{
|
|
19
|
+
dispatch: "dispatch";
|
|
20
|
+
preview: "preview";
|
|
21
|
+
}>;
|
|
22
|
+
category: import("zod").ZodEnum<{
|
|
23
|
+
architecture: "architecture";
|
|
24
|
+
exploration: "exploration";
|
|
25
|
+
implementation: "implementation";
|
|
26
|
+
review: "review";
|
|
27
|
+
}>;
|
|
28
|
+
task: import("zod").ZodString;
|
|
29
|
+
requirements: import("zod").ZodDefault<import("zod").ZodArray<import("zod").ZodString>>;
|
|
30
|
+
execution_card: import("zod").ZodOptional<import("zod").ZodAny>;
|
|
31
|
+
override: import("zod").ZodOptional<import("zod").ZodString>;
|
|
32
|
+
trusted_override: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
33
|
+
budget: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
34
|
+
cost_class: import("zod").ZodOptional<import("zod").ZodString>;
|
|
35
|
+
latency_class: import("zod").ZodOptional<import("zod").ZodString>;
|
|
36
|
+
}, import("zod/v4/core").$strip>>;
|
|
37
|
+
decision: import("zod").ZodOptional<import("zod").ZodAny>;
|
|
38
|
+
};
|
|
39
|
+
execute(args: {
|
|
40
|
+
action: "dispatch" | "preview";
|
|
41
|
+
category: "architecture" | "exploration" | "implementation" | "review";
|
|
42
|
+
task: string;
|
|
43
|
+
requirements: string[];
|
|
44
|
+
execution_card?: any;
|
|
45
|
+
override?: string | undefined;
|
|
46
|
+
trusted_override?: boolean | undefined;
|
|
47
|
+
budget?: {
|
|
48
|
+
cost_class?: string | undefined;
|
|
49
|
+
latency_class?: string | undefined;
|
|
50
|
+
} | undefined;
|
|
51
|
+
decision?: any;
|
|
52
|
+
}, context: import("@opencode-ai/plugin").ToolContext): Promise<import("@opencode-ai/plugin").ToolResult>;
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
"tool.execute.before": (input: {
|
|
56
|
+
tool: string;
|
|
57
|
+
sessionID: string;
|
|
58
|
+
}, output: {
|
|
59
|
+
args: unknown;
|
|
60
|
+
}) => Promise<void>;
|
|
61
|
+
"tool.execute.after": (input: {
|
|
62
|
+
tool: string;
|
|
63
|
+
sessionID: string;
|
|
64
|
+
args: unknown;
|
|
65
|
+
}, output: {
|
|
66
|
+
output: string;
|
|
67
|
+
}) => Promise<void>;
|
|
68
|
+
}>;
|
|
69
|
+
export declare const server: (input: PluginInput) => Promise<{
|
|
70
|
+
tool: {
|
|
71
|
+
route: {
|
|
72
|
+
description: string;
|
|
73
|
+
args: {
|
|
74
|
+
action: import("zod").ZodEnum<{
|
|
75
|
+
dispatch: "dispatch";
|
|
76
|
+
preview: "preview";
|
|
77
|
+
}>;
|
|
78
|
+
category: import("zod").ZodEnum<{
|
|
79
|
+
architecture: "architecture";
|
|
80
|
+
exploration: "exploration";
|
|
81
|
+
implementation: "implementation";
|
|
82
|
+
review: "review";
|
|
83
|
+
}>;
|
|
84
|
+
task: import("zod").ZodString;
|
|
85
|
+
requirements: import("zod").ZodDefault<import("zod").ZodArray<import("zod").ZodString>>;
|
|
86
|
+
execution_card: import("zod").ZodOptional<import("zod").ZodAny>;
|
|
87
|
+
override: import("zod").ZodOptional<import("zod").ZodString>;
|
|
88
|
+
trusted_override: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
89
|
+
budget: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
90
|
+
cost_class: import("zod").ZodOptional<import("zod").ZodString>;
|
|
91
|
+
latency_class: import("zod").ZodOptional<import("zod").ZodString>;
|
|
92
|
+
}, import("zod/v4/core").$strip>>;
|
|
93
|
+
decision: import("zod").ZodOptional<import("zod").ZodAny>;
|
|
94
|
+
};
|
|
95
|
+
execute(args: {
|
|
96
|
+
action: "dispatch" | "preview";
|
|
97
|
+
category: "architecture" | "exploration" | "implementation" | "review";
|
|
98
|
+
task: string;
|
|
99
|
+
requirements: string[];
|
|
100
|
+
execution_card?: any;
|
|
101
|
+
override?: string | undefined;
|
|
102
|
+
trusted_override?: boolean | undefined;
|
|
103
|
+
budget?: {
|
|
104
|
+
cost_class?: string | undefined;
|
|
105
|
+
latency_class?: string | undefined;
|
|
106
|
+
} | undefined;
|
|
107
|
+
decision?: any;
|
|
108
|
+
}, context: import("@opencode-ai/plugin").ToolContext): Promise<import("@opencode-ai/plugin").ToolResult>;
|
|
109
|
+
};
|
|
110
|
+
};
|
|
111
|
+
"tool.execute.before": (input: {
|
|
112
|
+
tool: string;
|
|
113
|
+
sessionID: string;
|
|
114
|
+
}, output: {
|
|
115
|
+
args: unknown;
|
|
116
|
+
}) => Promise<void>;
|
|
117
|
+
"tool.execute.after": (input: {
|
|
118
|
+
tool: string;
|
|
119
|
+
sessionID: string;
|
|
120
|
+
args: unknown;
|
|
121
|
+
}, output: {
|
|
122
|
+
output: string;
|
|
123
|
+
}) => Promise<void>;
|
|
124
|
+
}>;
|
|
125
|
+
export default plugin;
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { tool } from "@opencode-ai/plugin";
|
|
2
|
+
import { CATEGORIES, RoutingGate, } from "./routing.js";
|
|
3
|
+
import rulesInjector from "./plugins/rules-injector.js";
|
|
4
|
+
import rtk from "./plugins/rtk.js";
|
|
5
|
+
import zedBell from "./plugins/zed-bell.js";
|
|
6
|
+
import memomatic from "./plugins/memomatic.js";
|
|
7
|
+
import { digest } from "./lifecycle.js";
|
|
8
|
+
export { rulesInjector, rtk, zedBell, memomatic };
|
|
9
|
+
const plugin = (async (input) => {
|
|
10
|
+
const gate = new RoutingGate();
|
|
11
|
+
const hostInventory = async () => {
|
|
12
|
+
if (!input.client?.app?.agents)
|
|
13
|
+
throw new Error("Resolved OpenCode agent inventory is unavailable");
|
|
14
|
+
const response = await input.client.app.agents({ query: { directory: input.directory } });
|
|
15
|
+
const raw = response.data;
|
|
16
|
+
if (!Array.isArray(raw))
|
|
17
|
+
throw new Error("Resolved OpenCode agent inventory is malformed");
|
|
18
|
+
const capabilities = {
|
|
19
|
+
mapper: ["read", "search"],
|
|
20
|
+
architect: ["read", "architecture"],
|
|
21
|
+
worker: ["read", "write", "verify"],
|
|
22
|
+
review: ["read", "review"],
|
|
23
|
+
critic: ["read", "review"],
|
|
24
|
+
};
|
|
25
|
+
const agents = raw.map((value) => {
|
|
26
|
+
const agent = value;
|
|
27
|
+
if (typeof agent.name !== "string" || !agent.name)
|
|
28
|
+
throw new Error("Resolved OpenCode agent has no name");
|
|
29
|
+
return {
|
|
30
|
+
agent: agent.name,
|
|
31
|
+
available: true,
|
|
32
|
+
capabilities: capabilities[agent.name] ??
|
|
33
|
+
(/^critic-[a-z0-9]+(?:-[a-z0-9]+)*$/.test(agent.name) ? ["read", "review"] : ["read"]),
|
|
34
|
+
tools: [
|
|
35
|
+
"read",
|
|
36
|
+
...(agent.permission?.edit !== "deny" ? ["edit"] : []),
|
|
37
|
+
...Object.entries(agent.tools ?? {})
|
|
38
|
+
.filter(([, enabled]) => enabled)
|
|
39
|
+
.map(([name]) => name),
|
|
40
|
+
...Object.entries(agent.permission?.bash ?? {})
|
|
41
|
+
.filter(([, mode]) => mode !== "deny")
|
|
42
|
+
.map(() => "bash"),
|
|
43
|
+
].filter((name, index, list) => list.indexOf(name) === index),
|
|
44
|
+
};
|
|
45
|
+
});
|
|
46
|
+
return { agents, revision: digest(raw) };
|
|
47
|
+
};
|
|
48
|
+
const route = tool({
|
|
49
|
+
description: "Resolve a capability category and dispatch one eligible agent through a one-use Task receipt gate.",
|
|
50
|
+
args: {
|
|
51
|
+
action: tool.schema.enum(["preview", "dispatch"]),
|
|
52
|
+
category: tool.schema.enum(CATEGORIES),
|
|
53
|
+
task: tool.schema.string(),
|
|
54
|
+
requirements: tool.schema.array(tool.schema.string()).default([]),
|
|
55
|
+
execution_card: tool.schema.any().optional(),
|
|
56
|
+
override: tool.schema.string().optional(),
|
|
57
|
+
trusted_override: tool.schema.boolean().optional(),
|
|
58
|
+
budget: tool.schema
|
|
59
|
+
.object({
|
|
60
|
+
cost_class: tool.schema.string().optional(),
|
|
61
|
+
latency_class: tool.schema.string().optional(),
|
|
62
|
+
})
|
|
63
|
+
.optional(),
|
|
64
|
+
decision: tool.schema.any().optional(),
|
|
65
|
+
},
|
|
66
|
+
async execute(args, context) {
|
|
67
|
+
const inventory = await hostInventory();
|
|
68
|
+
const input = {
|
|
69
|
+
category: args.category,
|
|
70
|
+
task: args.task,
|
|
71
|
+
requirements: args.requirements,
|
|
72
|
+
agents: inventory.agents,
|
|
73
|
+
inventory_revision: inventory.revision,
|
|
74
|
+
execution_card: args.execution_card,
|
|
75
|
+
override: args.override,
|
|
76
|
+
trusted_override: args.trusted_override,
|
|
77
|
+
budget: args.budget,
|
|
78
|
+
};
|
|
79
|
+
if (args.action === "preview")
|
|
80
|
+
return JSON.stringify(gate.preview(input));
|
|
81
|
+
const decision = gate.dispatch(input, args.decision);
|
|
82
|
+
if (decision.agent === "worker" && args.execution_card === undefined)
|
|
83
|
+
throw new Error("implementation dispatch requires a confirmed execution card");
|
|
84
|
+
const receipt = gate.grant(context.sessionID, decision, {
|
|
85
|
+
task: args.task,
|
|
86
|
+
requirements: args.requirements,
|
|
87
|
+
card: args.execution_card,
|
|
88
|
+
});
|
|
89
|
+
return JSON.stringify({ decision, receipt, status: "routed" });
|
|
90
|
+
},
|
|
91
|
+
});
|
|
92
|
+
return {
|
|
93
|
+
tool: { route },
|
|
94
|
+
"tool.execute.before": async (input, output) => {
|
|
95
|
+
if (input.tool !== "task")
|
|
96
|
+
return;
|
|
97
|
+
const args = output.args && typeof output.args === "object"
|
|
98
|
+
? output.args
|
|
99
|
+
: {};
|
|
100
|
+
const agent = typeof args.agent === "string"
|
|
101
|
+
? args.agent
|
|
102
|
+
: typeof args.subagent_type === "string"
|
|
103
|
+
? args.subagent_type
|
|
104
|
+
: undefined;
|
|
105
|
+
if (!agent)
|
|
106
|
+
throw new Error("Native Task requires an explicit agent and an active routing receipt");
|
|
107
|
+
const hasBinding = "task" in args || "requirements" in args || "execution_card" in args;
|
|
108
|
+
if (!hasBinding)
|
|
109
|
+
gate.consume(input.sessionID, agent);
|
|
110
|
+
else {
|
|
111
|
+
const task = typeof args.task === "string" ? args.task : "";
|
|
112
|
+
const requirements = Array.isArray(args.requirements)
|
|
113
|
+
? args.requirements
|
|
114
|
+
: [];
|
|
115
|
+
gate.consume(input.sessionID, agent, { task, requirements, card: args.execution_card });
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
"tool.execute.after": async (input, output) => {
|
|
119
|
+
if (input.tool !== "task")
|
|
120
|
+
return;
|
|
121
|
+
const args = input.args && typeof input.args === "object" ? input.args : {};
|
|
122
|
+
const agent = typeof args.agent === "string"
|
|
123
|
+
? args.agent
|
|
124
|
+
: typeof args.subagent_type === "string"
|
|
125
|
+
? args.subagent_type
|
|
126
|
+
: undefined;
|
|
127
|
+
if (!agent)
|
|
128
|
+
throw new Error("Task result requires an explicit agent");
|
|
129
|
+
let result;
|
|
130
|
+
try {
|
|
131
|
+
result = JSON.parse(output.output);
|
|
132
|
+
}
|
|
133
|
+
catch {
|
|
134
|
+
throw new Error("Task result must be JSON structured report");
|
|
135
|
+
}
|
|
136
|
+
gate.complete(input.sessionID, agent, result);
|
|
137
|
+
},
|
|
138
|
+
};
|
|
139
|
+
});
|
|
140
|
+
export const server = plugin;
|
|
141
|
+
export default plugin;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { LifecycleError, type FileMutation, type Scope, type SupersededPlan, type TransactionOptions } from "./lifecycle.js";
|
|
2
|
+
import { CATALOG } from "./catalog.js";
|
|
3
|
+
import { type FixedAgentRole } from "./agent-profiles.js";
|
|
4
|
+
export type { Scope } from "./lifecycle.js";
|
|
5
|
+
export type Action = "install" | "uninstall";
|
|
6
|
+
export type Operation = "create" | "update" | "remove" | "unchanged" | "missing" | "conflict" | "archive-pending";
|
|
7
|
+
export type PlanItem = {
|
|
8
|
+
path: string;
|
|
9
|
+
operation: Operation;
|
|
10
|
+
reason?: string;
|
|
11
|
+
sha256?: string;
|
|
12
|
+
};
|
|
13
|
+
export type SelectablePlugin = (typeof CATALOG.plugins)[number];
|
|
14
|
+
export type InstallerSelection = {
|
|
15
|
+
commands: string[];
|
|
16
|
+
agents: FixedAgentRole[];
|
|
17
|
+
plugins: SelectablePlugin[];
|
|
18
|
+
core_activation: boolean;
|
|
19
|
+
};
|
|
20
|
+
export type Plan = {
|
|
21
|
+
schema_version: 2;
|
|
22
|
+
action: Action;
|
|
23
|
+
scope: Scope;
|
|
24
|
+
root: string;
|
|
25
|
+
package_version: string;
|
|
26
|
+
selection: InstallerSelection;
|
|
27
|
+
operations: PlanItem[];
|
|
28
|
+
plan_digest: string;
|
|
29
|
+
confirmation_digest?: string;
|
|
30
|
+
superseded_plan?: SupersededPlan;
|
|
31
|
+
digest: string;
|
|
32
|
+
receipt_expires_at?: string;
|
|
33
|
+
requires_restart: boolean;
|
|
34
|
+
};
|
|
35
|
+
type ManifestFile = {
|
|
36
|
+
sha256: string;
|
|
37
|
+
mode: number;
|
|
38
|
+
kind: "command" | "agent" | "plugin" | "state";
|
|
39
|
+
};
|
|
40
|
+
export type ArchiveCandidate = {
|
|
41
|
+
path: string;
|
|
42
|
+
record: ManifestFile;
|
|
43
|
+
content: Buffer;
|
|
44
|
+
reason: string;
|
|
45
|
+
kind: "command" | "agent" | "plugin" | "state";
|
|
46
|
+
};
|
|
47
|
+
export declare const SELECTABLE_PLUGINS: SelectablePlugin[];
|
|
48
|
+
export declare const SKILL_COMMANDS: string[];
|
|
49
|
+
export declare function defaultSelection(): InstallerSelection;
|
|
50
|
+
export declare function normalizeSelection(value?: Partial<InstallerSelection>): InstallerSelection;
|
|
51
|
+
export declare class InstallerError extends LifecycleError {
|
|
52
|
+
}
|
|
53
|
+
export declare function archiveMutations(candidates: readonly ArchiveCandidate[], scope: Scope, cwd: string, home: string, sourceVersion: string): Promise<FileMutation[]>;
|
|
54
|
+
export declare function preview(action: Action, scope: Scope, cwd?: string, home?: string, selection?: Partial<InstallerSelection>): Promise<Plan>;
|
|
55
|
+
export declare function apply(action: Action, scope: Scope, confirmationDigest: string, cwd?: string, home?: string, options?: TransactionOptions, selection?: Partial<InstallerSelection>): Promise<Plan>;
|
|
56
|
+
export declare function result(plan: Plan, applied: boolean): string;
|