@kisev/agentomatic 11.0.0-dev.55.g6d90f51aeff6 → 11.0.0-dev.56.gb561d6a5e919
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/config-setup.d.ts +4 -1
- package/dist/config-setup.js +15 -1
- package/dist/doctor.js +13 -0
- package/dist/self-install.d.ts +2 -0
- package/dist/self-install.js +30 -1
- package/package.json +3 -3
package/dist/config-setup.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type DependencyRunner } from "./self-install.js";
|
|
1
2
|
import { LifecycleError, type Scope } from "./lifecycle.js";
|
|
2
3
|
export declare class ConfigSetupError extends LifecycleError {
|
|
3
4
|
}
|
|
@@ -63,4 +64,6 @@ export type ConfigSetupPlan = {
|
|
|
63
64
|
export declare function normalizeConfigSelection(scope: Scope, value?: Partial<ConfigSetupSelection>): ConfigSetupSelection;
|
|
64
65
|
export declare function defaultConfigSelection(scope: Scope, cwd?: string, home?: string): Promise<ConfigSetupSelection>;
|
|
65
66
|
export declare function previewConfigSetup(selection: ConfigSetupSelection, scope: Scope, cwd?: string, home?: string): Promise<ConfigSetupPlan>;
|
|
66
|
-
export declare function applyConfigSetup(selection: ConfigSetupSelection, scope: Scope, cwd?: string, home?: string
|
|
67
|
+
export declare function applyConfigSetup(selection: ConfigSetupSelection, scope: Scope, cwd?: string, home?: string, options?: {
|
|
68
|
+
dependencyRunner?: DependencyRunner;
|
|
69
|
+
}): Promise<ConfigSetupPlan>;
|
package/dist/config-setup.js
CHANGED
|
@@ -3,6 +3,7 @@ import { homedir } from "node:os";
|
|
|
3
3
|
import { dirname, join, resolve } from "node:path";
|
|
4
4
|
import { fileURLToPath } from "node:url";
|
|
5
5
|
import { requirePackageVersion } from "./package-metadata.js";
|
|
6
|
+
import { ensureDependency, planDependency } from "./self-install.js";
|
|
6
7
|
import { applyTransaction, deploymentRoot, LifecycleError, lifecycleRoot, readRegular, recoverTransaction, sha256, withLifecycleLock, } from "./lifecycle.js";
|
|
7
8
|
import { applyJsoncEdits, parseJsonc } from "./jsonc.js";
|
|
8
9
|
const PACKAGE_NAME = "@kisev/agentomatic";
|
|
@@ -385,7 +386,7 @@ export async function previewConfigSetup(selection, scope, cwd = process.cwd(),
|
|
|
385
386
|
throw error;
|
|
386
387
|
}
|
|
387
388
|
}
|
|
388
|
-
export async function applyConfigSetup(selection, scope, cwd = process.cwd(), home = homedir()) {
|
|
389
|
+
export async function applyConfigSetup(selection, scope, cwd = process.cwd(), home = homedir(), options = {}) {
|
|
389
390
|
const stateRoot = lifecycleRoot(scope, cwd, home);
|
|
390
391
|
const root = deploymentRoot(scope, cwd, home);
|
|
391
392
|
try {
|
|
@@ -407,6 +408,19 @@ export async function applyConfigSetup(selection, scope, cwd = process.cwd(), ho
|
|
|
407
408
|
}
|
|
408
409
|
},
|
|
409
410
|
});
|
|
411
|
+
const corePluginApplied = built.plan.operations.some((item) => item.target === "opencode" &&
|
|
412
|
+
item.fragment === "core-plugin" &&
|
|
413
|
+
item.operation !== "conflict");
|
|
414
|
+
if (corePluginApplied) {
|
|
415
|
+
try {
|
|
416
|
+
await ensureDependency(planDependency(scope, cwd, home), options.dependencyRunner);
|
|
417
|
+
}
|
|
418
|
+
catch (error) {
|
|
419
|
+
if (error instanceof LifecycleError)
|
|
420
|
+
throw new ConfigSetupError(error.code, error.message);
|
|
421
|
+
throw error;
|
|
422
|
+
}
|
|
423
|
+
}
|
|
410
424
|
return built.plan;
|
|
411
425
|
});
|
|
412
426
|
}
|
package/dist/doctor.js
CHANGED
|
@@ -11,6 +11,7 @@ import { listAgentProfiles } from "./agent-profiles.js";
|
|
|
11
11
|
import { archiveRoot, assertSafePath, deploymentRoot, lifecycleRoot, } from "./lifecycle.js";
|
|
12
12
|
import { inspectReconcile } from "./reconcile.js";
|
|
13
13
|
import { readPackageVersion } from "./package-metadata.js";
|
|
14
|
+
import { planDependency } from "./self-install.js";
|
|
14
15
|
import { readRtkStats, rtkCharsSaved, rtkStatsPath, rtkTokensSavedEstimate, } from "./plugins/rtk.js";
|
|
15
16
|
import { stateRoot } from "./runtime/state.js";
|
|
16
17
|
const run = promisify(execFile);
|
|
@@ -492,6 +493,18 @@ export async function collectDoctorFacts(scope, cwd = process.cwd(), home = home
|
|
|
492
493
|
"Inspect OpenCode configuration without exposing secrets.",
|
|
493
494
|
"Local plugin wrappers in the deployment plugins directory load automatically without a plugin array entry.",
|
|
494
495
|
]));
|
|
496
|
+
const wired = (config.projection?.enabled_plugins ?? []).includes(packageName) ||
|
|
497
|
+
(hostConfig?.enabled_plugins ?? []).includes(packageName);
|
|
498
|
+
if (wired) {
|
|
499
|
+
const dependency = planDependency(scope, project, homeRoot);
|
|
500
|
+
const dependencyStatus = dependency.status === "satisfied" ? "pass" : dependency.status === "manual" ? "warn" : "fail";
|
|
501
|
+
checks.push(check("config.plugin-dependency", dependencyStatus, "The configured plugin package is pinned in the owning npm project", {
|
|
502
|
+
project_dir: dependency.dir ?? "none",
|
|
503
|
+
pinned: dependency.status === "satisfied",
|
|
504
|
+
expected_version: dependency.version,
|
|
505
|
+
status: dependency.status,
|
|
506
|
+
}, ["Run config with the core-plugin fragment to provision the persistent npm dependency."]));
|
|
507
|
+
}
|
|
495
508
|
const rtkWrapper = await regular(join(deployment, "plugins", "rtk.js"));
|
|
496
509
|
const rtkDeployed = rtkWrapper.status === "present";
|
|
497
510
|
let rtkStats = undefined;
|
package/dist/self-install.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { LifecycleError } from "@kisev/safe-fs";
|
|
2
2
|
export declare const SELF_PACKAGE_NAME = "@kisev/agentomatic";
|
|
3
|
+
export declare const LEGACY_SELF_PACKAGE_NAME = "@kisev/skills-opencode";
|
|
3
4
|
export type DependencyRunner = (command: string, args: string[], options: {
|
|
4
5
|
cwd: string;
|
|
5
6
|
timeout: number;
|
|
@@ -18,6 +19,7 @@ export type DependencyPlan = {
|
|
|
18
19
|
export declare class SelfInstallError extends LifecycleError {
|
|
19
20
|
}
|
|
20
21
|
export declare function owningProjectDir(scope: "project" | "global", cwd?: string, home?: string): string | null;
|
|
22
|
+
export declare function legacyDependencyPresent(dir: string): boolean;
|
|
21
23
|
export declare function planDependency(scope: "project" | "global", cwd?: string, home?: string, version?: string): DependencyPlan;
|
|
22
24
|
export declare function ensureDependency(plan: DependencyPlan, runner?: DependencyRunner): Promise<DependencyPlan & {
|
|
23
25
|
applied: "changed" | "unchanged" | "skipped";
|
package/dist/self-install.js
CHANGED
|
@@ -7,6 +7,7 @@ import { LifecycleError, writeAtomic } from "@kisev/safe-fs";
|
|
|
7
7
|
import { requirePackageVersion } from "./package-metadata.js";
|
|
8
8
|
const execFileAsync = promisify(execFile);
|
|
9
9
|
export const SELF_PACKAGE_NAME = "@kisev/agentomatic";
|
|
10
|
+
export const LEGACY_SELF_PACKAGE_NAME = "@kisev/skills-opencode";
|
|
10
11
|
const NPM_INSTALL_TIMEOUT_MS = 180_000;
|
|
11
12
|
export class SelfInstallError extends LifecycleError {
|
|
12
13
|
}
|
|
@@ -38,6 +39,20 @@ function readDependencyVersion(dir) {
|
|
|
38
39
|
return null;
|
|
39
40
|
}
|
|
40
41
|
}
|
|
42
|
+
export function legacyDependencyPresent(dir) {
|
|
43
|
+
try {
|
|
44
|
+
const value = JSON.parse(readFileSync(join(dir, "package.json"), "utf8"));
|
|
45
|
+
if (!value || typeof value !== "object" || Array.isArray(value))
|
|
46
|
+
return false;
|
|
47
|
+
const dependency = value.dependencies;
|
|
48
|
+
if (!dependency || typeof dependency !== "object" || Array.isArray(dependency))
|
|
49
|
+
return false;
|
|
50
|
+
return typeof dependency[LEGACY_SELF_PACKAGE_NAME] === "string";
|
|
51
|
+
}
|
|
52
|
+
catch {
|
|
53
|
+
return false;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
41
56
|
export function planDependency(scope, cwd = process.cwd(), home = homedir(), version = requirePackageVersion()) {
|
|
42
57
|
if (scope === "global") {
|
|
43
58
|
const dir = join(home, ".config", "opencode");
|
|
@@ -96,5 +111,19 @@ export async function ensureDependency(plan, runner = execFileAsync) {
|
|
|
96
111
|
const detail = error instanceof Error ? error.message.split("\n").slice(-6).join("\n") : "";
|
|
97
112
|
throw new SelfInstallError("npm_dependency_failed", `npm install for ${plan.name}@${plan.version} in ${dir} failed: ${detail}`);
|
|
98
113
|
}
|
|
99
|
-
|
|
114
|
+
let removedLegacy = false;
|
|
115
|
+
if (legacyDependencyPresent(dir)) {
|
|
116
|
+
try {
|
|
117
|
+
await runner("npm", ["rm", LEGACY_SELF_PACKAGE_NAME, "--no-audit", "--no-fund"], {
|
|
118
|
+
cwd: dir,
|
|
119
|
+
timeout: NPM_INSTALL_TIMEOUT_MS,
|
|
120
|
+
});
|
|
121
|
+
removedLegacy = true;
|
|
122
|
+
}
|
|
123
|
+
catch (error) {
|
|
124
|
+
const detail = error instanceof Error ? error.message.split("\n").slice(-6).join("\n") : "";
|
|
125
|
+
throw new SelfInstallError("npm_dependency_failed", `npm rm for ${LEGACY_SELF_PACKAGE_NAME} in ${dir} failed: ${detail}`);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
return { ...plan, applied: "changed", ...(removedLegacy ? { removed_legacy: true } : {}) };
|
|
100
129
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kisev/agentomatic",
|
|
3
|
-
"version": "11.0.0-dev.
|
|
3
|
+
"version": "11.0.0-dev.56.gb561d6a5e919",
|
|
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": {
|
|
@@ -49,8 +49,8 @@
|
|
|
49
49
|
"pack:check": "node test/pack-allowlist.mjs"
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@kisev/memomatic": "1.0.0-dev.
|
|
53
|
-
"@kisev/safe-fs": "1.0.0-dev.
|
|
52
|
+
"@kisev/memomatic": "1.0.0-dev.56.gb561d6a5e919",
|
|
53
|
+
"@kisev/safe-fs": "1.0.0-dev.56.gb561d6a5e919"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@opencode-ai/plugin": "1.18.29",
|