agent-cloud-kit 1.0.0-rc.7 → 1.0.0-rc.8
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 +14 -0
- package/dist/block.js +76 -0
- package/dist/cli.js +67 -45
- package/dist/config.js +12 -11
- package/dist/docker.js +5 -6
- package/dist/doctor.js +39 -28
- package/dist/init.js +13 -12
- package/dist/installers.js +7 -6
- package/dist/lang.js +84 -0
- package/dist/launcher.js +2 -1
- package/dist/manual.js +13 -10
- package/dist/messages/en.js +226 -0
- package/dist/messages/es.js +234 -0
- package/dist/messages/index.js +75 -0
- package/dist/prepare/banner.js +18 -18
- package/dist/prepare/detect.js +8 -6
- package/dist/prepare/index.js +101 -61
- package/dist/prepare/ui.js +0 -27
- package/dist/run.js +3 -2
- package/dist/select.js +3 -2
- package/dist/session.js +11 -14
- package/dist/setup.js +10 -9
- package/dist/skill.js +7 -6
- package/dist/steps.js +2 -3
- package/package.json +1 -1
package/dist/skill.js
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { cpSync, existsSync, lstatSync, mkdirSync, readFileSync, realpathSync, renameSync, rmSync, symlinkSync, writeFileSync } from "node:fs";
|
|
6
6
|
import { dirname, join } from "node:path";
|
|
7
|
+
import { t } from "./messages/index.js";
|
|
7
8
|
/** Repo-relative directory of the `cloud-ready` skill. */
|
|
8
9
|
export const SKILL_DIR = ".agents/skills/cloud-ready";
|
|
9
10
|
/** Directory of the skill inside this package. */
|
|
@@ -74,19 +75,19 @@ function withVersion(text, version) {
|
|
|
74
75
|
* @param repo - Repo root.
|
|
75
76
|
* @param packageRoot - Root of this package, which holds `skills/cloud-ready`.
|
|
76
77
|
* @param packageVersion - Version of this package.
|
|
77
|
-
* @returns A line describing the outcome.
|
|
78
|
+
* @returns A line describing the outcome, and whether it did something (`ok`) or found it there (`same`).
|
|
78
79
|
* @throws When the package has no skill or the copy fails (the installed skill is kept).
|
|
79
80
|
* @example
|
|
80
81
|
* installSkill("/home/user/app", "/usr/lib/node_modules/agent-cloud-kit", "1.0.0");
|
|
81
|
-
* // "se instaló .agents/skills/cloud-ready 1.0.0"
|
|
82
|
+
* // { kind: "ok", text: "se instaló .agents/skills/cloud-ready 1.0.0" }
|
|
82
83
|
*/
|
|
83
84
|
export function installSkill(repo, packageRoot, packageVersion) {
|
|
84
85
|
const current = skillVersion(repo);
|
|
85
86
|
if (current === packageVersion)
|
|
86
|
-
return
|
|
87
|
+
return { kind: "same", text: t().skill.current(SKILL_DIR, packageVersion) };
|
|
87
88
|
const source = join(packageRoot, PACKAGE_SKILL_DIR);
|
|
88
89
|
if (!existsSync(join(source, "SKILL.md")))
|
|
89
|
-
throw new Error(
|
|
90
|
+
throw new Error(t().skill.missing(PACKAGE_SKILL_DIR, packageRoot));
|
|
90
91
|
const target = join(repo, SKILL_DIR);
|
|
91
92
|
const temp = `${target}.${process.pid}.tmp`;
|
|
92
93
|
const old = `${target}.${process.pid}.old`;
|
|
@@ -107,7 +108,7 @@ export function installSkill(repo, packageRoot, packageVersion) {
|
|
|
107
108
|
throw err;
|
|
108
109
|
}
|
|
109
110
|
rmSync(old, { recursive: true, force: true });
|
|
110
|
-
return current === undefined ?
|
|
111
|
+
return { kind: "ok", text: current === undefined ? t().skill.installed(SKILL_DIR, packageVersion) : t().skill.updated(SKILL_DIR, current, packageVersion) };
|
|
111
112
|
}
|
|
112
113
|
/**
|
|
113
114
|
* Tells whether a path exists, counting a broken symlink as existing.
|
|
@@ -144,5 +145,5 @@ export function linkSkill(repo) {
|
|
|
144
145
|
return undefined;
|
|
145
146
|
mkdirSync(claudeSkills, { recursive: true });
|
|
146
147
|
symlinkSync(SKILL_LINK_TARGET, link);
|
|
147
|
-
return
|
|
148
|
+
return t().skill.linked(SKILL_LINK, SKILL_DIR);
|
|
148
149
|
}
|
package/dist/steps.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file Step results: runs one unit of work and reports its outcome without ever throwing.
|
|
3
3
|
*/
|
|
4
|
+
import { STEP } from "./messages/index.js";
|
|
4
5
|
/**
|
|
5
6
|
* Runs a step, timing it and converting any failure into a result.
|
|
6
7
|
*
|
|
@@ -21,8 +22,6 @@ export async function step(name, fn) {
|
|
|
21
22
|
return { name, ok: false, ms: Date.now() - start, error };
|
|
22
23
|
}
|
|
23
24
|
}
|
|
24
|
-
/** Prefix of the name given to a lane whose function rejected. */
|
|
25
|
-
const LANE_NAME_PREFIX = "lane ";
|
|
26
25
|
/**
|
|
27
26
|
* Runs lanes of steps concurrently and joins their results in lane order.
|
|
28
27
|
*
|
|
@@ -39,7 +38,7 @@ export async function lanes(...laneFns) {
|
|
|
39
38
|
}
|
|
40
39
|
catch (err) {
|
|
41
40
|
const error = err instanceof Error ? err.message : String(err);
|
|
42
|
-
return [{ name: `${
|
|
41
|
+
return [{ name: `${STEP.lane}${index}`, ok: false, ms: Date.now() - start, error }];
|
|
43
42
|
}
|
|
44
43
|
}));
|
|
45
44
|
return groups.flat();
|