@intra-mart/accel 0.4.0 → 0.5.0-dev.202608040843

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.
Files changed (41) hide show
  1. package/README.md +140 -4
  2. package/dist/asset/deployer.js +3 -4
  3. package/dist/asset/git-provider.js +53 -25
  4. package/dist/asset/installer.d.ts +4 -1
  5. package/dist/asset/installer.js +13 -0
  6. package/dist/asset/updater.d.ts +6 -1
  7. package/dist/asset/updater.js +122 -23
  8. package/dist/commands/cache.d.ts +1 -0
  9. package/dist/commands/cache.js +74 -0
  10. package/dist/commands/preset.d.ts +31 -0
  11. package/dist/commands/preset.js +396 -0
  12. package/dist/commands/switch.d.ts +28 -0
  13. package/dist/commands/switch.js +262 -0
  14. package/dist/commands/update.d.ts +4 -0
  15. package/dist/commands/update.js +75 -23
  16. package/dist/core/constants.d.ts +1 -1
  17. package/dist/core/constants.js +1 -1
  18. package/dist/core/types.d.ts +8 -0
  19. package/dist/core/validators.d.ts +2 -0
  20. package/dist/core/validators.js +7 -0
  21. package/dist/git/object-cache.d.ts +12 -0
  22. package/dist/git/object-cache.js +95 -0
  23. package/dist/git/object-store.d.ts +3 -1
  24. package/dist/git/object-store.js +49 -9
  25. package/dist/i18n/en.js +59 -0
  26. package/dist/i18n/ja.js +59 -0
  27. package/dist/i18n/zh_CN.js +59 -0
  28. package/dist/index.js +6 -0
  29. package/dist/interactive/prompts.d.ts +4 -1
  30. package/dist/interactive/prompts.js +51 -43
  31. package/dist/utils/concurrency.d.ts +1 -0
  32. package/dist/utils/concurrency.js +1 -0
  33. package/dist/utils/hash.d.ts +1 -0
  34. package/dist/utils/hash.js +5 -0
  35. package/dist/utils/preset-io.d.ts +23 -0
  36. package/dist/utils/preset-io.js +164 -0
  37. package/dist/utils/safe-rel-path.d.ts +1 -0
  38. package/dist/utils/safe-rel-path.js +5 -0
  39. package/dist/utils/settings-io.d.ts +1 -0
  40. package/dist/utils/settings-io.js +4 -2
  41. package/package.json +1 -1
@@ -14,6 +14,7 @@ import { printAssetMessages } from "../interactive/asset-messages.js";
14
14
  import { mergeFile } from "../utils/merge-file.js";
15
15
  import { getInstallCmds, runInstallBuild } from "../asset/installer.js";
16
16
  import { readSettingsSafe, readHashsum, writeSettings, writeHashsum, } from "../utils/settings-io.js";
17
+ import { loadAndValidatePreset, listPresetSummaries, buildPresetSelectOptions, parsePresetChoice, } from "../utils/preset-io.js";
17
18
  import { getMessage } from "../i18n/index.js";
18
19
  import { detectLocale } from "../utils/locale-detect.js";
19
20
  import { printSummary } from "../interactive/summary.js";
@@ -74,7 +75,7 @@ const resolveFallbackMode = async (opts) => {
74
75
  }
75
76
  return { keepEdited: choice === "keep" };
76
77
  };
77
- const resolveInteractiveSettings = async (promptOpts, cliOnlyOpts, releaseIdFallback) => {
78
+ const resolveInteractiveSettings = async (promptOpts, cliOnlyOpts, releaseIdFallback, presets, projectDir, presetSpecified) => {
78
79
  const locale = promptOpts.locale;
79
80
  const cliErrors = collectSettingsErrors(cliOnlyOpts, locale, releaseIdFallback);
80
81
  if (cliErrors.length > 0) {
@@ -88,20 +89,51 @@ const resolveInteractiveSettings = async (promptOpts, cliOnlyOpts, releaseIdFall
88
89
  }));
89
90
  return runPrompts({ ...promptOpts, skipIntro: true, skipValidation: true });
90
91
  }
91
- const useExisting = await p.confirm({
92
- message: withHint("prompt.useExistingSettings", locale),
93
- initialValue: true,
92
+ const useExistingPath = (overrides = {}) => runPrompts({
93
+ ...promptOpts,
94
+ jugglingProject: cliOnlyOpts.jugglingProject,
95
+ noInteraction: true,
96
+ ...overrides,
94
97
  });
95
- if (p.isCancel(useExisting))
98
+ const reenterPath = () => runPrompts({ ...promptOpts, skipIntro: true });
99
+ if (presetSpecified)
100
+ return useExistingPath();
101
+ if (presets.length === 0) {
102
+ const useExisting = await p.confirm({
103
+ message: withHint("prompt.useExistingSettings", locale),
104
+ initialValue: true,
105
+ });
106
+ if (p.isCancel(useExisting))
107
+ process.exit(0);
108
+ return useExisting ? useExistingPath() : reenterPath();
109
+ }
110
+ const choice = await p.select({
111
+ message: getMessage("preset.prompt.updateSelect", locale),
112
+ options: [
113
+ {
114
+ value: "__existing__",
115
+ label: getMessage("preset.prompt.updateSelect.existing", locale),
116
+ },
117
+ ...buildPresetSelectOptions(presets, locale),
118
+ {
119
+ value: "__reenter__",
120
+ label: getMessage("preset.prompt.updateSelect.reenter", locale),
121
+ },
122
+ ],
123
+ initialValue: "__existing__",
124
+ });
125
+ if (p.isCancel(choice))
96
126
  process.exit(0);
97
- return useExisting
98
- ?
99
- runPrompts({
100
- ...promptOpts,
101
- jugglingProject: cliOnlyOpts.jugglingProject,
102
- noInteraction: true,
103
- })
104
- : runPrompts({ ...promptOpts, skipIntro: true });
127
+ const presetName = parsePresetChoice(choice);
128
+ if (presetName === undefined) {
129
+ return choice === "__reenter__" ? reenterPath() : useExistingPath();
130
+ }
131
+ const preset = await loadAndValidatePreset(projectDir, presetName, promptOpts.accelplatformVersion ?? releaseIdFallback, locale);
132
+ return useExistingPath({
133
+ module: preset.modules,
134
+ feature: preset.features,
135
+ agent: preset.agents,
136
+ });
105
137
  };
106
138
  const printResult = (summary, locale, installGuide) => {
107
139
  const lines = [
@@ -210,6 +242,10 @@ export const updateCommand = defineCommand({
210
242
  type: "string",
211
243
  description: "Agent type",
212
244
  },
245
+ preset: {
246
+ type: "string",
247
+ description: "Configuration preset name to apply (mutually exclusive with --module / --feature / --agent)",
248
+ },
213
249
  locale: {
214
250
  type: "string",
215
251
  description: "Locale (ja, en, zh_CN)",
@@ -266,6 +302,14 @@ export const updateCommand = defineCommand({
266
302
  p.log.error(getMessage("update.error.keepEditedWithoutAllow", locale));
267
303
  process.exit(1);
268
304
  }
305
+ const presetArg = args.preset;
306
+ if (presetArg !== undefined &&
307
+ (args.module !== undefined ||
308
+ args.feature !== undefined ||
309
+ args.agent !== undefined)) {
310
+ p.log.error(getMessage("preset.error.conflictingFlags", locale));
311
+ process.exit(1);
312
+ }
269
313
  const assetSource = settings.assetSource;
270
314
  if (!assetSource) {
271
315
  p.log.error(getMessage("update.error.legacyProject", locale));
@@ -283,6 +327,17 @@ export const updateCommand = defineCommand({
283
327
  const targetUrl = args["asset-server-url"] ?? source.url;
284
328
  const targetRef = args["asset-ref"] ?? source.ref;
285
329
  const isInteractive = !args["non-interactive"];
330
+ let presetValues;
331
+ if (presetArg !== undefined) {
332
+ try {
333
+ presetValues = await loadAndValidatePreset(projectDir, presetArg, args["accelplatform-version"] ??
334
+ settings.accelplatformVersion.label, locale);
335
+ }
336
+ catch (err) {
337
+ p.log.error(err instanceof Error ? err.message : String(err));
338
+ process.exit(1);
339
+ }
340
+ }
286
341
  if (!(await confirmDirtyWorktree(projectDir, locale, isInteractive))) {
287
342
  p.log.info(getMessage("update.cancelled", locale));
288
343
  process.exit(0);
@@ -292,20 +347,17 @@ export const updateCommand = defineCommand({
292
347
  artifactId: args["artifact-id"],
293
348
  jugglingProject: args["juggling-project"],
294
349
  accelplatformVersion: args["accelplatform-version"],
295
- module: args.module
296
- ?.split(",")
297
- .map((m) => m.trim()),
298
- feature: args.feature
299
- ?.split(",")
300
- .map((f) => f.trim()),
350
+ module: presetValues?.modules ??
351
+ args.module?.split(",").map((m) => m.trim()),
352
+ feature: presetValues?.features ??
353
+ args.feature?.split(",").map((f) => f.trim()),
301
354
  group: args.group,
302
355
  projectVersion: args["project-version"],
303
356
  description: args.description,
304
357
  database: args.database,
305
358
  javascript: args.javascript,
306
- agent: args.agent
307
- ?.split(",")
308
- .map((a) => a.trim()),
359
+ agent: presetValues?.agents ??
360
+ args.agent?.split(",").map((a) => a.trim()),
309
361
  packageManager: args["package-manager"],
310
362
  locale,
311
363
  isInit: false,
@@ -333,7 +385,7 @@ export const updateCommand = defineCommand({
333
385
  let resolved;
334
386
  try {
335
387
  resolved = isInteractive
336
- ? await resolveInteractiveSettings(promptOpts, cliOnlyOpts, settings.accelplatformVersion.label)
388
+ ? await resolveInteractiveSettings(promptOpts, cliOnlyOpts, settings.accelplatformVersion.label, presetArg !== undefined ? [] : await listPresetSummaries(projectDir), projectDir, presetArg !== undefined)
337
389
  : await runPrompts(promptOpts);
338
390
  }
339
391
  catch (err) {
@@ -9,5 +9,5 @@ export type LocaleOption = (typeof LOCALE_OPTIONS)[number];
9
9
  export declare const PACKAGE_MANAGER_OPTIONS: readonly ["bun", "npm", "yarn", "pnpm"];
10
10
  export type PackageManagerOption = (typeof PACKAGE_MANAGER_OPTIONS)[number];
11
11
  export declare const DEFAULT_ASSET_REPO_URL = "https://github.com/accelplatform/skills";
12
- export declare const DEFAULT_ASSET_REF = "2026-08-01-release";
12
+ export declare const DEFAULT_ASSET_REF = "experiment";
13
13
  export declare const DEFAULT_SETTINGS: Omit<AccelSettings, "cliVersion" | "createdAt" | "deployedAssets" | "assetSource">;
@@ -11,7 +11,7 @@ export const PACKAGE_MANAGER_OPTIONS = [
11
11
  "pnpm",
12
12
  ];
13
13
  export const DEFAULT_ASSET_REPO_URL = "https://github.com/accelplatform/skills";
14
- export const DEFAULT_ASSET_REF = "2026-08-01-release";
14
+ export const DEFAULT_ASSET_REF = "experiment";
15
15
  export const DEFAULT_SETTINGS = {
16
16
  name: "my-accel-project",
17
17
  artifactId: "",
@@ -112,6 +112,14 @@ export type AccelSettings = {
112
112
  assetSource?: AssetSourceInfo;
113
113
  deployedAssets: Record<string, string>;
114
114
  };
115
+ export type AccelPreset = {
116
+ name: string;
117
+ label?: string;
118
+ description?: string;
119
+ modules: string[];
120
+ features: string[];
121
+ agents: string[];
122
+ };
115
123
  export type HashsumEntry = {
116
124
  filePath: string;
117
125
  version: string;
@@ -15,4 +15,6 @@ export type ReleaseValidators = {
15
15
  feature: Validator;
16
16
  };
17
17
  export declare const createValidators: (locale: string) => Validators;
18
+ export declare const PRESET_NAME_PATTERN: RegExp;
19
+ export declare const createPresetNameValidator: (locale: string) => Validator;
18
20
  export declare const createReleaseValidators: (locale: string, release: Release) => ReleaseValidators;
@@ -75,6 +75,13 @@ export const createValidators = (locale) => ({
75
75
  });
76
76
  },
77
77
  });
78
+ export const PRESET_NAME_PATTERN = /^[A-Za-z0-9_-]+$/;
79
+ export const createPresetNameValidator = (locale) => (value) => {
80
+ const v = value ?? "";
81
+ return PRESET_NAME_PATTERN.test(v)
82
+ ? undefined
83
+ : getMessage("preset.error.invalidName", locale, { value: v });
84
+ };
78
85
  export const createReleaseValidators = (locale, release) => ({
79
86
  module: (value) => {
80
87
  const v = value ?? "";
@@ -0,0 +1,12 @@
1
+ export declare const normalizeRepoUrl: (url: string) => string;
2
+ export declare const resolveCacheRoot: (env?: NodeJS.ProcessEnv) => string;
3
+ export declare const cacheReposDir: (cacheRoot: string) => string;
4
+ export declare const repoStoreDir: (cacheRoot: string, repoUrl: string) => string;
5
+ export declare const ensureUrlSidecar: (storeDir: string, repoUrl: string) => Promise<void>;
6
+ export type CacheRepoEntry = {
7
+ dir: string;
8
+ url: string | null;
9
+ size: number;
10
+ };
11
+ export declare const directorySize: (dir: string) => Promise<number>;
12
+ export declare const listCacheRepos: (cacheRoot: string) => Promise<CacheRepoEntry[]>;
@@ -0,0 +1,95 @@
1
+ import { randomBytes } from "node:crypto";
2
+ import { lstat, mkdir, readdir, readFile, rename, stat, writeFile, } from "node:fs/promises";
3
+ import { homedir } from "node:os";
4
+ import { join, resolve } from "node:path";
5
+ import { computeSha256 } from "../utils/hash.js";
6
+ const REPOS_DIR = "repos";
7
+ const URL_SIDECAR = "url";
8
+ const STORE_KEY_PATTERN = /^[0-9a-f]{16}$/;
9
+ export const normalizeRepoUrl = (url) => {
10
+ let normalized = url.replace(/\/+$/, "").replace(/\.git$/, "");
11
+ try {
12
+ const parsed = new URL(normalized);
13
+ if (parsed.username || parsed.password) {
14
+ parsed.username = "";
15
+ parsed.password = "";
16
+ normalized = parsed.toString().replace(/\/+$/, "");
17
+ }
18
+ }
19
+ catch {
20
+ }
21
+ return normalized;
22
+ };
23
+ export const resolveCacheRoot = (env = process.env) => {
24
+ const override = env["ACCEL_CACHE_DIR"];
25
+ if (override && override.trim() !== "")
26
+ return resolve(override);
27
+ return join(homedir(), ".accel", "cache");
28
+ };
29
+ export const cacheReposDir = (cacheRoot) => join(cacheRoot, REPOS_DIR);
30
+ export const repoStoreDir = (cacheRoot, repoUrl) => join(cacheReposDir(cacheRoot), computeSha256(normalizeRepoUrl(repoUrl)).slice(0, 16));
31
+ export const ensureUrlSidecar = async (storeDir, repoUrl) => {
32
+ const target = join(storeDir, URL_SIDECAR);
33
+ try {
34
+ await stat(target);
35
+ return;
36
+ }
37
+ catch {
38
+ }
39
+ await mkdir(storeDir, { recursive: true, mode: 0o700 });
40
+ const tmp = `${target}.tmp-${randomBytes(4).toString("hex")}`;
41
+ await writeFile(tmp, normalizeRepoUrl(repoUrl) + "\n", "utf-8");
42
+ await rename(tmp, target);
43
+ };
44
+ export const directorySize = async (dir) => {
45
+ let entries;
46
+ try {
47
+ entries = await readdir(dir, { recursive: true, withFileTypes: true });
48
+ }
49
+ catch {
50
+ return 0;
51
+ }
52
+ let total = 0;
53
+ for (const entry of entries) {
54
+ if (!entry.isFile())
55
+ continue;
56
+ try {
57
+ total += (await stat(join(entry.parentPath, entry.name))).size;
58
+ }
59
+ catch {
60
+ }
61
+ }
62
+ return total;
63
+ };
64
+ export const listCacheRepos = async (cacheRoot) => {
65
+ const reposDir = cacheReposDir(cacheRoot);
66
+ let names;
67
+ try {
68
+ names = await readdir(reposDir);
69
+ }
70
+ catch {
71
+ return [];
72
+ }
73
+ const entries = [];
74
+ for (const name of names.sort()) {
75
+ if (!STORE_KEY_PATTERN.test(name))
76
+ continue;
77
+ const dir = join(reposDir, name);
78
+ try {
79
+ if (!(await lstat(dir)).isDirectory())
80
+ continue;
81
+ }
82
+ catch {
83
+ continue;
84
+ }
85
+ let url = null;
86
+ try {
87
+ url = (await readFile(join(dir, URL_SIDECAR), "utf-8")).trim() || null;
88
+ }
89
+ catch {
90
+ url = null;
91
+ }
92
+ entries.push({ dir, url, size: await directorySize(dir) });
93
+ }
94
+ return entries;
95
+ };
@@ -12,4 +12,6 @@ export type ObjectStore = {
12
12
  hasObject: (oid: string) => boolean;
13
13
  cleanup: () => Promise<void>;
14
14
  };
15
- export declare const createObjectStore: () => Promise<ObjectStore>;
15
+ export declare const createObjectStore: (options?: {
16
+ dir?: string;
17
+ }) => Promise<ObjectStore>;
@@ -1,5 +1,6 @@
1
1
  import fs from "node:fs";
2
- import { mkdtemp, mkdir, rm, writeFile } from "node:fs/promises";
2
+ import { randomBytes } from "node:crypto";
3
+ import { mkdtemp, mkdir, readdir, readFile, rename, rm, writeFile, } from "node:fs/promises";
3
4
  import { tmpdir } from "node:os";
4
5
  import { join } from "node:path";
5
6
  import git, { Errors } from "isomorphic-git";
@@ -8,13 +9,38 @@ const topSegmentOf = (filepath) => {
8
9
  const slash = filepath.indexOf("/");
9
10
  return slash === -1 ? filepath : filepath.slice(0, slash);
10
11
  };
11
- export const createObjectStore = async () => {
12
- const dir = await mkdtemp(join(tmpdir(), "accel-assets-"));
13
- await git.init({ fs, dir, defaultBranch: "main" });
14
- await mkdir(join(dir, ".git", "objects", "pack"), { recursive: true });
12
+ export const createObjectStore = async (options = {}) => {
13
+ const persistent = options.dir !== undefined;
14
+ const dir = options.dir ?? (await mkdtemp(join(tmpdir(), "accel-assets-")));
15
+ const packDir = join(dir, ".git", "objects", "pack");
16
+ if (persistent) {
17
+ await mkdir(dir, { recursive: true, mode: 0o700 });
18
+ }
19
+ if (!fs.existsSync(join(dir, ".git", "config"))) {
20
+ await git.init({ fs, dir, defaultBranch: "main" });
21
+ }
22
+ await mkdir(packDir, { recursive: true });
23
+ const storeUid = `${process.pid.toString(36)}-${randomBytes(4).toString("hex")}`;
24
+ let packSeq = 0;
15
25
  const cache = {};
16
26
  const indexByCommit = new Map();
17
27
  const knownOids = new Set();
28
+ if (persistent) {
29
+ const names = await readdir(packDir).catch(() => []);
30
+ for (const name of names) {
31
+ if (!name.endsWith(".oids"))
32
+ continue;
33
+ try {
34
+ const content = await readFile(join(packDir, name), "utf-8");
35
+ for (const line of content.split("\n")) {
36
+ if (line.length === 40)
37
+ knownOids.add(line);
38
+ }
39
+ }
40
+ catch {
41
+ }
42
+ }
43
+ }
18
44
  const indexOf = (commitOid) => {
19
45
  let index = indexByCommit.get(commitOid);
20
46
  if (!index) {
@@ -128,9 +154,21 @@ export const createObjectStore = async () => {
128
154
  return {
129
155
  dir,
130
156
  writePack: async (pack, label) => {
131
- const rel = join(".git", "objects", "pack", `pack-${label}.pack`);
132
- await writeFile(join(dir, rel), pack);
133
- const { oids } = await git.indexPack({ fs, dir, filepath: rel });
157
+ const name = `pack-${label}-${storeUid}-${packSeq++}`;
158
+ const stagingRel = join(".git", "objects", "accel-tmp", name);
159
+ const stagingDir = join(dir, stagingRel);
160
+ await mkdir(stagingDir, { recursive: true });
161
+ await writeFile(join(stagingDir, `${name}.pack`), pack);
162
+ const { oids } = await git.indexPack({
163
+ fs,
164
+ dir,
165
+ filepath: join(stagingRel, `${name}.pack`),
166
+ });
167
+ await writeFile(join(stagingDir, `${name}.oids`), oids.join("\n") + "\n", "utf-8");
168
+ for (const ext of [".pack", ".idx", ".oids"]) {
169
+ await rename(join(stagingDir, `${name}${ext}`), join(packDir, `${name}${ext}`));
170
+ }
171
+ await rm(stagingDir, { recursive: true, force: true }).catch(() => { });
134
172
  for (const oid of oids)
135
173
  knownOids.add(oid);
136
174
  },
@@ -155,7 +193,9 @@ export const createObjectStore = async () => {
155
193
  },
156
194
  hasObject: (oid) => knownOids.has(oid),
157
195
  cleanup: async () => {
158
- await rm(dir, { recursive: true, force: true }).catch(() => { });
196
+ if (!persistent) {
197
+ await rm(dir, { recursive: true, force: true }).catch(() => { });
198
+ }
159
199
  },
160
200
  };
161
201
  };
package/dist/i18n/en.js CHANGED
@@ -89,6 +89,65 @@ export const messages = {
89
89
  "update.result.redeployedWarn": "Redeployed: {path} (you had deleted it, but upstream changes could not be determined without the base commit)",
90
90
  "update.result.skippedEdited": "Kept: {path} (edited; skipped without applying upstream changes)",
91
91
  "update.fallback.skippedSummary": "Skipped {count} edited file(s) without applying upstream changes:",
92
+ "intro.switch": "Switches only the module / feature / agent configuration while keeping the recorded commit pinned.\nNo download occurs and repository-side updates are not pulled in.\nFiles you have edited are never modified.",
93
+ "switch.error.legacyProject": "This project was created with a CLI version that does not support switch.",
94
+ "switch.error.notGitSource": "Only projects deployed from a git source can be switched (this project was deployed from a local directory).",
95
+ "switch.confirmApply": "Switch assets with these settings?",
96
+ "switch.cancelled": "Switch cancelled.",
97
+ "switch.progress": "Switching assets... ({sha})",
98
+ "switch.result.updated": "Updated: {path}",
99
+ "switch.result.added": "Added: {path}",
100
+ "switch.result.deleted": "Deleted: {path} (out of configuration)",
101
+ "switch.result.adopted": "Adopted: {path}",
102
+ "switch.result.skippedEdited": "Skipped: {path} (edited by user)",
103
+ "switch.result.skippedDeleted": "Skipped: {path} (user deletion respected)",
104
+ "switch.result.skippedOutOfScope": "Skipped: {path} (out of configuration but edited, kept)",
105
+ "switch.result.skippedUnmanaged": "Skipped: {path} (unmanaged existing file kept)",
106
+ "switch.upToDate": "Nothing to change.",
107
+ "switch.complete": "Switch completed. Updated {updated}, added {added}, deleted {deleted} file(s).",
108
+ "switch.skippedSummary": "Skipped {count} edited file(s). The switch has not been applied to them:",
109
+ "switch.installFailedHint": "install / build failed. The skipped edited files may be incompatible with the new configuration.",
110
+ "cache.info.dir": "Cache directory: {path}",
111
+ "cache.info.overridden": "(overridden by the ACCEL_CACHE_DIR environment variable)",
112
+ "cache.info.total": "Total size: {size}",
113
+ "cache.info.empty": "The cache is empty.",
114
+ "cache.clear.done": "Cache cleared. Freed {size}.",
115
+ "cache.clear.empty": "There is no cache to clear.",
116
+ "intro.preset": "Register combinations of modules, features, and agents as configuration presets.\nPresets are saved under .accel/presets/ and shared with your team once committed.\nRegistered presets can be used with accel update / accel switch.",
117
+ "preset.prompt.name": "Enter preset name (ID)",
118
+ "preset.prompt.name.hint": "Used as the file name (.accel/presets/<name>.json) and as the value for --preset\nOnly alphanumerics, - and _ are allowed (e.g. server-side, ui, workflow)",
119
+ "preset.prompt.label": "Enter display name (optional)",
120
+ "preset.prompt.label.hint": "Shown in lists and selection prompts; any characters (e.g. Japanese) are allowed\nLeave empty to display the preset name (ID) as is",
121
+ "preset.prompt.description": "Enter preset description (optional)",
122
+ "preset.prompt.description.hint": "A short note on which development case this preset is for. Shown in lists and selection prompts",
123
+ "preset.prompt.overwrite": "Preset {name} already exists. Overwrite?",
124
+ "preset.prompt.continue": "Create another preset?",
125
+ "preset.prompt.delete": "Delete preset {name}. Are you sure?",
126
+ "preset.prompt.updateSelect": "How would you like to determine the settings?",
127
+ "preset.prompt.updateSelect.existing": "Use the existing settings",
128
+ "preset.prompt.updateSelect.reenter": "Re-enter the settings",
129
+ "preset.prompt.switchSelect": "Use a preset?",
130
+ "preset.prompt.switchSelect.none": "Do not use a preset (select individually)",
131
+ "preset.prompt.select.usePreset": "Use preset {name}",
132
+ "preset.created": "Saved preset {name}.",
133
+ "preset.deleted": "Deleted preset {name}.",
134
+ "preset.cancelled": "Cancelled.",
135
+ "preset.list.empty": "No presets registered. Create one with accel preset create.",
136
+ "preset.show.label": "Display name",
137
+ "preset.show.description": "Description",
138
+ "preset.show.modules": "Modules",
139
+ "preset.show.features": "Features",
140
+ "preset.show.agents": "Agents",
141
+ "preset.error.noSettings": ".accel directory not found. Run this inside a project that has been initialized with init or attach.",
142
+ "preset.error.missingName": "Preset name is not specified. Provide it as an argument (e.g., accel preset {command} my-preset)",
143
+ "preset.error.notFound": "Preset not found: {name}",
144
+ "preset.error.exists": "Preset {name} already exists. Pass --force to overwrite it.",
145
+ "preset.error.invalidName": "Preset names may only contain alphanumerics, - and _: {value}",
146
+ "preset.error.invalid": "Preset {name} is invalid:\n{errors}",
147
+ "preset.error.parse": "Cannot be parsed as JSON: {message}",
148
+ "preset.error.field": "Field {field} is missing or is not an array of strings",
149
+ "preset.error.nameMismatch": "The name value ({value}) does not match the file name ({name})",
150
+ "preset.error.conflictingFlags": "--preset cannot be combined with --module / --feature / --agent.",
92
151
  "error.directoryExists": "Directory already exists: {path}",
93
152
  "error.accelExists": ".accel directory already exists",
94
153
  "error.accelNotFound": ".accel directory not found",
package/dist/i18n/ja.js CHANGED
@@ -89,6 +89,65 @@ export const messages = {
89
89
  "update.result.redeployedWarn": "再配置: {path} (ユーザーが削除していましたが、上流変更の有無を判定できないため再配置しました)",
90
90
  "update.result.skippedEdited": "保持: {path} (編集済みのためスキップ。上流の変更は取り込まれていません)",
91
91
  "update.fallback.skippedSummary": "{count}件の編集済みファイルをスキップしました。上流の変更は取り込まれていません:",
92
+ "intro.switch": "記録されたコミットを固定したまま、モジュール・機能・エージェントの構成のみを切り替えます。\nリポジトリからのダウンロードは発生せず、リポジトリ側の更新も取り込みません。\nユーザーが編集したファイルには変更を加えません。",
93
+ "switch.error.legacyProject": "このプロジェクトは switch 未対応のCLIバージョンで作成されています。",
94
+ "switch.error.notGitSource": "gitソースから配備されたプロジェクトのみ switch できます(このプロジェクトはローカルディレクトリから配備されています)。",
95
+ "switch.confirmApply": "この設定で資材を切り替えますか?",
96
+ "switch.cancelled": "switchをキャンセルしました。",
97
+ "switch.progress": "資材を切り替えています... ({sha})",
98
+ "switch.result.updated": "更新: {path}",
99
+ "switch.result.added": "追加: {path}",
100
+ "switch.result.deleted": "削除: {path} (構成対象外)",
101
+ "switch.result.adopted": "取り込み: {path}",
102
+ "switch.result.skippedEdited": "スキップ: {path} (ユーザー編集あり)",
103
+ "switch.result.skippedDeleted": "スキップ: {path} (ユーザー削除を尊重)",
104
+ "switch.result.skippedOutOfScope": "スキップ: {path} (構成対象外だが編集済みのため保持)",
105
+ "switch.result.skippedUnmanaged": "スキップ: {path} (管理外の既存ファイルを保持)",
106
+ "switch.upToDate": "変更はありません。",
107
+ "switch.complete": "switchが完了しました。{updated}件を更新、{added}件を追加、{deleted}件を削除しました。",
108
+ "switch.skippedSummary": "{count}件の編集済みファイルをスキップしました。切り替えは適用されていません:",
109
+ "switch.installFailedHint": "install / build が失敗しました。スキップされた編集済みファイルが新しい構成と互換でない可能性があります。",
110
+ "cache.info.dir": "キャッシュディレクトリ: {path}",
111
+ "cache.info.overridden": "(環境変数 ACCEL_CACHE_DIR で上書きされています)",
112
+ "cache.info.total": "合計サイズ: {size}",
113
+ "cache.info.empty": "キャッシュは空です。",
114
+ "cache.clear.done": "キャッシュを削除しました。{size} を解放しました。",
115
+ "cache.clear.empty": "削除対象のキャッシュはありません。",
116
+ "intro.preset": "モジュール・機能・エージェントの組み合わせを構成プリセットとして登録します。\nプリセットは .accel/presets/ に保存され、コミットするとチームで共有できます。\n登録したプリセットは accel update / accel switch で利用できます。",
117
+ "preset.prompt.name": "プリセット名(ID)を入力してください",
118
+ "preset.prompt.name.hint": "ファイル名(.accel/presets/<名前>.json)と --preset での指定に使われます\n英数字と - _ のみ使用できます(例: server-side, ui, workflow)",
119
+ "preset.prompt.label": "表示名を入力してください(省略可)",
120
+ "preset.prompt.label.hint": "一覧や選択肢に表示される名前。日本語なども使用できます\n空のまま確定するとプリセット名(ID)をそのまま表示します",
121
+ "preset.prompt.description": "プリセットの説明を入力してください(省略可)",
122
+ "preset.prompt.description.hint": "このプリセットがどの開発ケース向けかの簡潔な説明。一覧や選択肢に表示されます",
123
+ "preset.prompt.overwrite": "プリセット {name} は既に存在します。上書きしますか?",
124
+ "preset.prompt.continue": "続けて別のプリセットを作成しますか?",
125
+ "preset.prompt.delete": "プリセット {name} を削除します。よろしいですか?",
126
+ "preset.prompt.updateSelect": "設定の決め方を選択してください",
127
+ "preset.prompt.updateSelect.existing": "既存の設定を利用する",
128
+ "preset.prompt.updateSelect.reenter": "設定を再入力する",
129
+ "preset.prompt.switchSelect": "プリセットを利用しますか?",
130
+ "preset.prompt.switchSelect.none": "プリセットを使わない(個別に選択する)",
131
+ "preset.prompt.select.usePreset": "プリセット {name} を利用する",
132
+ "preset.created": "プリセット {name} を保存しました。",
133
+ "preset.deleted": "プリセット {name} を削除しました。",
134
+ "preset.cancelled": "キャンセルしました。",
135
+ "preset.list.empty": "プリセットはありません。accel preset create で作成できます。",
136
+ "preset.show.label": "表示名",
137
+ "preset.show.description": "説明",
138
+ "preset.show.modules": "モジュール",
139
+ "preset.show.features": "機能",
140
+ "preset.show.agents": "エージェント",
141
+ "preset.error.noSettings": ".accelディレクトリが見つかりません。init または attach 済みのプロジェクト内で実行してください。",
142
+ "preset.error.missingName": "プリセット名が指定されていません。引数で指定してください(例: accel preset {command} my-preset)",
143
+ "preset.error.notFound": "プリセットが見つかりません: {name}",
144
+ "preset.error.exists": "プリセット {name} は既に存在します。上書きするには --force を指定してください。",
145
+ "preset.error.invalidName": "プリセット名に使用できるのは英数字と - _ のみです: {value}",
146
+ "preset.error.invalid": "プリセット {name} が不正です:\n{errors}",
147
+ "preset.error.parse": "JSONとして解析できません: {message}",
148
+ "preset.error.field": "フィールド {field} が存在しないか、文字列の配列ではありません",
149
+ "preset.error.nameMismatch": "name の値 ({value}) がファイル名 ({name}) と一致しません",
150
+ "preset.error.conflictingFlags": "--preset と --module / --feature / --agent は同時に指定できません。",
92
151
  "error.directoryExists": "ディレクトリが既に存在します: {path}",
93
152
  "error.accelExists": ".accelディレクトリが既に存在します",
94
153
  "error.accelNotFound": ".accelディレクトリが見つかりません",
@@ -89,6 +89,65 @@ export const messages = {
89
89
  "update.result.redeployedWarn": "重新部署: {path}(您已删除该文件,但由于缺少基准提交无法判定上游变更)",
90
90
  "update.result.skippedEdited": "保留: {path}(已编辑,跳过且未应用上游变更)",
91
91
  "update.fallback.skippedSummary": "已跳过{count}个已编辑的文件,未应用上游变更:",
92
+ "intro.switch": "在固定已记录提交的前提下,仅切换模块・功能・代理的配置。\n不会发生下载,也不会引入仓库端的更新。\n不会修改您编辑过的文件。",
93
+ "switch.error.legacyProject": "此项目由不支持 switch 的CLI版本创建。",
94
+ "switch.error.notGitSource": "仅可切换从git源部署的项目(此项目从本地目录部署)。",
95
+ "switch.confirmApply": "使用这些设置切换资源吗?",
96
+ "switch.cancelled": "切换已取消。",
97
+ "switch.progress": "正在切换资源... ({sha})",
98
+ "switch.result.updated": "更新: {path}",
99
+ "switch.result.added": "添加: {path}",
100
+ "switch.result.deleted": "删除: {path}(不在配置范围内)",
101
+ "switch.result.adopted": "纳入管理: {path}",
102
+ "switch.result.skippedEdited": "跳过: {path}(用户已编辑)",
103
+ "switch.result.skippedDeleted": "跳过: {path}(尊重用户删除)",
104
+ "switch.result.skippedOutOfScope": "跳过: {path}(不在配置范围内但已编辑,予以保留)",
105
+ "switch.result.skippedUnmanaged": "跳过: {path}(保留未管理的现有文件)",
106
+ "switch.upToDate": "没有变更。",
107
+ "switch.complete": "switch已完成。更新{updated}个、添加{added}个、删除{deleted}个文件。",
108
+ "switch.skippedSummary": "已跳过{count}个已编辑的文件。切换未应用于这些文件:",
109
+ "switch.installFailedHint": "install / build 失败。跳过的已编辑文件可能与新配置不兼容。",
110
+ "cache.info.dir": "缓存目录: {path}",
111
+ "cache.info.overridden": "(已被环境变量 ACCEL_CACHE_DIR 覆盖)",
112
+ "cache.info.total": "总大小: {size}",
113
+ "cache.info.empty": "缓存为空。",
114
+ "cache.clear.done": "缓存已删除。释放了 {size}。",
115
+ "cache.clear.empty": "没有可删除的缓存。",
116
+ "intro.preset": "将模块・功能・代理的组合注册为配置预设。\n预设保存在 .accel/presets/ 中,提交后即可与团队共享。\n注册的预设可在 accel update / accel switch 中使用。",
117
+ "preset.prompt.name": "请输入预设名称(ID)",
118
+ "preset.prompt.name.hint": "用作文件名(.accel/presets/<名称>.json)以及 --preset 的指定值\n仅可使用字母数字和 - _(例如: server-side, ui, workflow)",
119
+ "preset.prompt.label": "请输入显示名称(可选)",
120
+ "preset.prompt.label.hint": "在列表和选项中显示的名称,可使用中文等任意字符\n留空确认则直接显示预设名称(ID)",
121
+ "preset.prompt.description": "请输入预设的描述(可选)",
122
+ "preset.prompt.description.hint": "简要说明此预设适用于哪种开发场景。会显示在列表和选项中",
123
+ "preset.prompt.overwrite": "预设 {name} 已存在。要覆盖吗?",
124
+ "preset.prompt.continue": "继续创建另一个预设吗?",
125
+ "preset.prompt.delete": "将删除预设 {name}。确定吗?",
126
+ "preset.prompt.updateSelect": "请选择设置的确定方式",
127
+ "preset.prompt.updateSelect.existing": "使用现有设置",
128
+ "preset.prompt.updateSelect.reenter": "重新输入设置",
129
+ "preset.prompt.switchSelect": "要使用预设吗?",
130
+ "preset.prompt.switchSelect.none": "不使用预设(逐项选择)",
131
+ "preset.prompt.select.usePreset": "使用预设 {name}",
132
+ "preset.created": "已保存预设 {name}。",
133
+ "preset.deleted": "已删除预设 {name}。",
134
+ "preset.cancelled": "已取消。",
135
+ "preset.list.empty": "没有预设。可通过 accel preset create 创建。",
136
+ "preset.show.label": "显示名称",
137
+ "preset.show.description": "描述",
138
+ "preset.show.modules": "模块",
139
+ "preset.show.features": "功能",
140
+ "preset.show.agents": "代理",
141
+ "preset.error.noSettings": "未找到.accel目录。请在已执行 init 或 attach 的项目内运行。",
142
+ "preset.error.missingName": "未指定预设名称。请作为参数指定(例如: accel preset {command} my-preset)",
143
+ "preset.error.notFound": "未找到预设: {name}",
144
+ "preset.error.exists": "预设 {name} 已存在。要覆盖请指定 --force。",
145
+ "preset.error.invalidName": "预设名称仅可使用字母数字和 - _: {value}",
146
+ "preset.error.invalid": "预设 {name} 无效:\n{errors}",
147
+ "preset.error.parse": "无法解析为JSON: {message}",
148
+ "preset.error.field": "字段 {field} 不存在或不是字符串数组",
149
+ "preset.error.nameMismatch": "name 的值 ({value}) 与文件名 ({name}) 不一致",
150
+ "preset.error.conflictingFlags": "--preset 不能与 --module / --feature / --agent 同时指定。",
92
151
  "error.directoryExists": "目录已存在: {path}",
93
152
  "error.accelExists": ".accel目录已存在",
94
153
  "error.accelNotFound": "未找到.accel目录",
package/dist/index.js CHANGED
@@ -4,6 +4,9 @@ import { initCommand } from "./commands/init.js";
4
4
  import { attachCommand } from "./commands/attach.js";
5
5
  import { detachCommand } from "./commands/detach.js";
6
6
  import { updateCommand } from "./commands/update.js";
7
+ import { switchCommand } from "./commands/switch.js";
8
+ import { presetCommand } from "./commands/preset.js";
9
+ import { cacheCommand } from "./commands/cache.js";
7
10
  import { loginCommand } from "./commands/login.js";
8
11
  import { deployCommand } from "./commands/deploy.js";
9
12
  import { CLI_VERSION } from "./core/constants.js";
@@ -18,6 +21,9 @@ const main = defineCommand({
18
21
  attach: attachCommand,
19
22
  detach: detachCommand,
20
23
  update: updateCommand,
24
+ switch: switchCommand,
25
+ preset: presetCommand,
26
+ cache: cacheCommand,
21
27
  login: loginCommand,
22
28
  deploy: deployCommand,
23
29
  },