@intra-mart/accel 0.5.0-dev.202608040843 → 0.5.0-dev.202608250608
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 +33 -31
- package/dist/asset/deployer.d.ts +2 -0
- package/dist/asset/deployer.js +11 -9
- package/dist/asset/git-provider.d.ts +1 -0
- package/dist/asset/git-provider.js +20 -9
- package/dist/asset/updater.d.ts +9 -2
- package/dist/asset/updater.js +12 -6
- package/dist/asset/walker.d.ts +2 -1
- package/dist/asset/walker.js +36 -0
- package/dist/commands/asset-provider.d.ts +1 -1
- package/dist/commands/asset-provider.js +2 -2
- package/dist/commands/attach.d.ts +116 -82
- package/dist/commands/attach.js +176 -145
- package/dist/commands/cache.js +11 -19
- package/dist/commands/deploy.d.ts +53 -32
- package/dist/commands/deploy.js +112 -75
- package/dist/commands/detach.d.ts +18 -0
- package/dist/commands/detach.js +69 -54
- package/dist/commands/init.d.ts +117 -83
- package/dist/commands/init.js +119 -98
- package/dist/commands/login.d.ts +12 -10
- package/dist/commands/login.js +14 -10
- package/dist/commands/preset.js +26 -33
- package/dist/commands/run-wrapper.d.ts +15 -0
- package/dist/commands/run-wrapper.js +62 -0
- package/dist/commands/switch.d.ts +48 -20
- package/dist/commands/switch.js +201 -176
- package/dist/commands/update.d.ts +142 -87
- package/dist/commands/update.js +342 -296
- package/dist/core/color-env.d.ts +1 -0
- package/dist/core/color-env.js +6 -0
- package/dist/core/constants.d.ts +0 -1
- package/dist/core/constants.js +0 -3
- package/dist/core/errors.d.ts +6 -0
- package/dist/core/errors.js +16 -0
- package/dist/core/logger.d.ts +15 -0
- package/dist/core/logger.js +1 -0
- package/dist/core/paths.d.ts +6 -0
- package/dist/core/paths.js +22 -0
- package/dist/core/types.d.ts +6 -1
- package/dist/core/validation.d.ts +34 -0
- package/dist/core/validation.js +87 -0
- package/dist/deploy/api-client.d.ts +1 -0
- package/dist/deploy/api-client.js +7 -1
- package/dist/git/config-file.d.ts +3 -0
- package/dist/git/config-file.js +178 -0
- package/dist/git/errors.d.ts +5 -0
- package/dist/git/errors.js +21 -2
- package/dist/git/git-objects.d.ts +11 -0
- package/dist/git/git-objects.js +49 -0
- package/dist/git/http.d.ts +2 -2
- package/dist/git/http.js +22 -10
- package/dist/git/index-file.d.ts +17 -0
- package/dist/git/index-file.js +111 -0
- package/dist/git/object-cache.d.ts +1 -0
- package/dist/git/object-cache.js +11 -15
- package/dist/git/object-store.d.ts +4 -0
- package/dist/git/object-store.js +82 -107
- package/dist/git/pack-parse.d.ts +19 -0
- package/dist/git/pack-parse.js +261 -0
- package/dist/git/pack-store.d.ts +20 -0
- package/dist/git/pack-store.js +144 -0
- package/dist/git/read-capped.d.ts +1 -0
- package/dist/git/read-capped.js +26 -0
- package/dist/git/redact-url.d.ts +1 -0
- package/dist/git/redact-url.js +14 -0
- package/dist/git/repo-layout.d.ts +5 -0
- package/dist/git/repo-layout.js +44 -0
- package/dist/git/smart-http.d.ts +3 -2
- package/dist/git/smart-http.js +5 -5
- package/dist/git/untracked.d.ts +11 -0
- package/dist/git/untracked.js +93 -0
- package/dist/git/worktree-status.d.ts +4 -0
- package/dist/git/worktree-status.js +140 -0
- package/dist/git/zlib-inflate.d.ts +7 -0
- package/dist/git/zlib-inflate.js +78 -0
- package/dist/i18n/en.js +12 -0
- package/dist/i18n/index.js +1 -1
- package/dist/i18n/ja.js +12 -0
- package/dist/i18n/zh_CN.js +12 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -2
- package/dist/interactive/asset-messages.d.ts +2 -1
- package/dist/interactive/asset-messages.js +4 -4
- package/dist/interactive/clack-logger.d.ts +2 -0
- package/dist/interactive/clack-logger.js +11 -0
- package/dist/interactive/credential-auth.d.ts +2 -0
- package/dist/interactive/credential-auth.js +7 -6
- package/dist/interactive/credentials-prompts.js +10 -6
- package/dist/interactive/next-steps.d.ts +2 -1
- package/dist/interactive/next-steps.js +3 -3
- package/dist/interactive/progress.d.ts +8 -1
- package/dist/interactive/progress.js +0 -0
- package/dist/interactive/prompts.d.ts +3 -33
- package/dist/interactive/prompts.js +23 -111
- package/dist/interactive/summary.d.ts +2 -1
- package/dist/interactive/summary.js +3 -3
- package/dist/juggling/resolve.d.ts +7 -0
- package/dist/juggling/resolve.js +18 -0
- package/dist/lib.d.ts +34 -0
- package/dist/lib.js +29 -0
- package/dist/utils/args.d.ts +4 -1
- package/dist/utils/args.js +26 -3
- package/dist/utils/githooks-sync.d.ts +3 -1
- package/dist/utils/githooks-sync.js +37 -37
- package/dist/utils/mcp-generate.d.ts +26 -0
- package/dist/utils/mcp-generate.js +313 -0
- package/dist/utils/preset-io.d.ts +1 -0
- package/dist/utils/preset-io.js +5 -2
- package/dist/utils/settings-io.d.ts +1 -0
- package/dist/utils/settings-io.js +1 -1
- package/package.json +21 -14
- package/dist/utils/mcp-sync.d.ts +0 -4
- package/dist/utils/mcp-sync.js +0 -103
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { readdir } from "node:fs/promises";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
import ignore from "ignore";
|
|
4
|
+
import { readTextFileCapped } from "./read-capped.js";
|
|
5
|
+
const MAX_DEPTH = 2048;
|
|
6
|
+
const MAX_PATTERN_LINE = 4096;
|
|
7
|
+
const MAX_WILDCARDS_PER_LINE = 6;
|
|
8
|
+
const MAX_IGNORE_FILE_BYTES = 8 * 1024 * 1024;
|
|
9
|
+
const wildcardCount = (line) => {
|
|
10
|
+
let count = 0;
|
|
11
|
+
for (let i = 0; i < line.length; i++) {
|
|
12
|
+
const ch = line[i];
|
|
13
|
+
if (ch === "*" || ch === "?")
|
|
14
|
+
count++;
|
|
15
|
+
}
|
|
16
|
+
return count;
|
|
17
|
+
};
|
|
18
|
+
export const asciiFold = (path) => path.replace(/[A-Z]+/g, (chars) => chars.toLowerCase());
|
|
19
|
+
const isIgnored = (levels, relPosix, isDir) => {
|
|
20
|
+
const probe = isDir ? `${relPosix}/` : relPosix;
|
|
21
|
+
let ignored = false;
|
|
22
|
+
for (const level of levels) {
|
|
23
|
+
if (!probe.startsWith(level.base))
|
|
24
|
+
continue;
|
|
25
|
+
let result;
|
|
26
|
+
try {
|
|
27
|
+
result = level.matcher.test(probe.slice(level.base.length));
|
|
28
|
+
}
|
|
29
|
+
catch {
|
|
30
|
+
continue;
|
|
31
|
+
}
|
|
32
|
+
if (result.ignored)
|
|
33
|
+
ignored = true;
|
|
34
|
+
else if (result.unignored)
|
|
35
|
+
ignored = false;
|
|
36
|
+
}
|
|
37
|
+
return ignored;
|
|
38
|
+
};
|
|
39
|
+
const scan = async (opts, stopAtFirst) => {
|
|
40
|
+
const found = [];
|
|
41
|
+
const matcherOf = (content) => ignore({ ignorecase: opts.ignorecase }).add(content
|
|
42
|
+
.split(/\r\n|\n|\r/)
|
|
43
|
+
.filter((line) => line.length <= MAX_PATTERN_LINE &&
|
|
44
|
+
wildcardCount(line) <= MAX_WILDCARDS_PER_LINE)
|
|
45
|
+
.join("\n"));
|
|
46
|
+
const baseLevels = opts.baselinePatterns.map((content) => ({
|
|
47
|
+
base: "",
|
|
48
|
+
matcher: matcherOf(content),
|
|
49
|
+
}));
|
|
50
|
+
const walk = async (dirAbs, relPrefix, levels, depth) => {
|
|
51
|
+
if (depth > MAX_DEPTH) {
|
|
52
|
+
throw new Error("untracked scan depth limit exceeded");
|
|
53
|
+
}
|
|
54
|
+
const gitignore = await readTextFileCapped(join(dirAbs, ".gitignore"), MAX_IGNORE_FILE_BYTES);
|
|
55
|
+
const currentLevels = gitignore === null
|
|
56
|
+
? levels
|
|
57
|
+
: [...levels, { base: relPrefix, matcher: matcherOf(gitignore) }];
|
|
58
|
+
const entries = await readdir(dirAbs, { withFileTypes: true }).catch(() => []);
|
|
59
|
+
for (const entry of entries) {
|
|
60
|
+
if (Date.now() > opts.deadline) {
|
|
61
|
+
throw new Error("untracked scan deadline exceeded");
|
|
62
|
+
}
|
|
63
|
+
if (entry.name === ".git")
|
|
64
|
+
continue;
|
|
65
|
+
const rel = relPrefix + entry.name;
|
|
66
|
+
if (entry.isDirectory()) {
|
|
67
|
+
const key = opts.ignorecase ? asciiFold(rel) : rel;
|
|
68
|
+
if (opts.trackedDirs.has(key))
|
|
69
|
+
continue;
|
|
70
|
+
if (isIgnored(currentLevels, rel, true))
|
|
71
|
+
continue;
|
|
72
|
+
const hit = await walk(join(dirAbs, entry.name), `${rel}/`, currentLevels, depth + 1);
|
|
73
|
+
if (hit && stopAtFirst)
|
|
74
|
+
return true;
|
|
75
|
+
}
|
|
76
|
+
else if (entry.isFile() || entry.isSymbolicLink()) {
|
|
77
|
+
const key = opts.ignorecase ? asciiFold(rel) : rel;
|
|
78
|
+
if (opts.trackedFiles.has(key))
|
|
79
|
+
continue;
|
|
80
|
+
if (isIgnored(currentLevels, rel, false))
|
|
81
|
+
continue;
|
|
82
|
+
found.push(rel);
|
|
83
|
+
if (stopAtFirst)
|
|
84
|
+
return true;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
return found.length > 0;
|
|
88
|
+
};
|
|
89
|
+
await walk(opts.worktreeDir, "", baseLevels, 0);
|
|
90
|
+
return found;
|
|
91
|
+
};
|
|
92
|
+
export const hasUntrackedFile = async (opts) => (await scan(opts, true)).length > 0;
|
|
93
|
+
export const collectUntrackedPaths = async (opts) => (await scan(opts, false)).sort();
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { lstat, readFile, readlink } from "node:fs/promises";
|
|
2
|
+
import { homedir } from "node:os";
|
|
3
|
+
import { join } from "node:path";
|
|
4
|
+
import { isSafeRelPath } from "../utils/safe-rel-path.js";
|
|
5
|
+
import { parseConfigBool, readConfigValue } from "./config-file.js";
|
|
6
|
+
import { hashObject, isGitlinkMode, isSymlinkMode } from "./git-objects.js";
|
|
7
|
+
import { readGitIndex } from "./index-file.js";
|
|
8
|
+
import { readTextFileCapped } from "./read-capped.js";
|
|
9
|
+
import { resolveRepoLayout } from "./repo-layout.js";
|
|
10
|
+
import { asciiFold, hasUntrackedFile } from "./untracked.js";
|
|
11
|
+
const MAX_HASH_SIZE = 64 * 1024 * 1024;
|
|
12
|
+
const blobSha1 = (content) => hashObject("blob", content);
|
|
13
|
+
const normalizeCrlf = (buf) => {
|
|
14
|
+
const out = Buffer.allocUnsafe(buf.length);
|
|
15
|
+
let outPos = 0;
|
|
16
|
+
for (let i = 0; i < buf.length; i++) {
|
|
17
|
+
if (buf[i] === 0x0d && buf[i + 1] === 0x0a)
|
|
18
|
+
continue;
|
|
19
|
+
out[outPos++] = buf[i];
|
|
20
|
+
}
|
|
21
|
+
return out.subarray(0, outPos);
|
|
22
|
+
};
|
|
23
|
+
const contentMatches = async (absPath, entry) => {
|
|
24
|
+
const content = await readFile(absPath);
|
|
25
|
+
if (blobSha1(content) === entry.oid)
|
|
26
|
+
return true;
|
|
27
|
+
const probe = content.subarray(0, 8000);
|
|
28
|
+
if (!probe.includes(0) && content.includes(0x0d)) {
|
|
29
|
+
return blobSha1(normalizeCrlf(content)) === entry.oid;
|
|
30
|
+
}
|
|
31
|
+
return false;
|
|
32
|
+
};
|
|
33
|
+
const isEntryModified = async (worktreeDir, entry, indexMtimeSec) => {
|
|
34
|
+
const absPath = join(worktreeDir, entry.path);
|
|
35
|
+
let stats;
|
|
36
|
+
try {
|
|
37
|
+
stats = await lstat(absPath, { bigint: true });
|
|
38
|
+
}
|
|
39
|
+
catch {
|
|
40
|
+
return true;
|
|
41
|
+
}
|
|
42
|
+
if (isSymlinkMode(entry.mode)) {
|
|
43
|
+
if (!stats.isSymbolicLink())
|
|
44
|
+
return true;
|
|
45
|
+
const target = await readlink(absPath, { encoding: "buffer" });
|
|
46
|
+
return blobSha1(target) !== entry.oid;
|
|
47
|
+
}
|
|
48
|
+
if (!stats.isFile())
|
|
49
|
+
return true;
|
|
50
|
+
const size = Number(stats.size);
|
|
51
|
+
if (size !== entry.size && !(entry.size === 0 && size !== 0))
|
|
52
|
+
return true;
|
|
53
|
+
const mtimeSec = Number(stats.mtimeNs / 1000000000n);
|
|
54
|
+
const mtimeNsec = Number(stats.mtimeNs % 1000000000n);
|
|
55
|
+
const mtimeMatches = mtimeSec === entry.mtimeSec &&
|
|
56
|
+
(entry.mtimeNsec === 0 || mtimeNsec === entry.mtimeNsec);
|
|
57
|
+
const racy = entry.mtimeSec >= indexMtimeSec;
|
|
58
|
+
if (mtimeMatches && !racy && !(entry.size === 0 && size !== 0))
|
|
59
|
+
return false;
|
|
60
|
+
if (size > MAX_HASH_SIZE)
|
|
61
|
+
return true;
|
|
62
|
+
return !(await contentMatches(absPath, entry));
|
|
63
|
+
};
|
|
64
|
+
const expandTilde = (path, home) => path === "~" ? home : path.startsWith("~/") ? join(home, path.slice(2)) : path;
|
|
65
|
+
const resolveExcludesFilePath = async (localConfigPath, env) => {
|
|
66
|
+
const home = env["HOME"] !== undefined && env["HOME"] !== "" ? env["HOME"] : homedir();
|
|
67
|
+
const xdgConfig = env["XDG_CONFIG_HOME"] !== undefined && env["XDG_CONFIG_HOME"] !== ""
|
|
68
|
+
? env["XDG_CONFIG_HOME"]
|
|
69
|
+
: join(home, ".config");
|
|
70
|
+
const globalOverride = env["GIT_CONFIG_GLOBAL"];
|
|
71
|
+
const userConfigPaths = globalOverride !== undefined && globalOverride !== ""
|
|
72
|
+
? [globalOverride]
|
|
73
|
+
: [join(xdgConfig, "git", "config"), join(home, ".gitconfig")];
|
|
74
|
+
let value;
|
|
75
|
+
for (const configPath of [...userConfigPaths, localConfigPath]) {
|
|
76
|
+
const found = await readConfigValue(configPath, "core", "excludesFile");
|
|
77
|
+
if (found !== undefined)
|
|
78
|
+
value = found;
|
|
79
|
+
}
|
|
80
|
+
return value === undefined
|
|
81
|
+
? join(xdgConfig, "git", "ignore")
|
|
82
|
+
: expandTilde(value, home);
|
|
83
|
+
};
|
|
84
|
+
const MAX_IGNORE_FILE_BYTES = 8 * 1024 * 1024;
|
|
85
|
+
export const isWorktreeDirty = async (projectDir, opts = {}) => {
|
|
86
|
+
try {
|
|
87
|
+
const env = opts.env ?? process.env;
|
|
88
|
+
const deadline = Date.now() + (opts.deadlineMs ?? 10_000);
|
|
89
|
+
const layout = await resolveRepoLayout(projectDir);
|
|
90
|
+
if (layout === null)
|
|
91
|
+
return false;
|
|
92
|
+
const index = await readGitIndex(layout.gitDir);
|
|
93
|
+
if (index === null)
|
|
94
|
+
return false;
|
|
95
|
+
const localConfigPath = join(layout.commonDir, "config");
|
|
96
|
+
const ignorecase = parseConfigBool(await readConfigValue(localConfigPath, "core", "ignoreCase"), false);
|
|
97
|
+
const trackedFiles = new Set();
|
|
98
|
+
const trackedDirs = new Set();
|
|
99
|
+
for (const entry of index.entries) {
|
|
100
|
+
if (entry.stage !== 0)
|
|
101
|
+
return true;
|
|
102
|
+
if (!isSafeRelPath(entry.path))
|
|
103
|
+
return true;
|
|
104
|
+
const key = ignorecase ? asciiFold(entry.path) : entry.path;
|
|
105
|
+
if (isGitlinkMode(entry.mode)) {
|
|
106
|
+
trackedDirs.add(key);
|
|
107
|
+
continue;
|
|
108
|
+
}
|
|
109
|
+
trackedFiles.add(key);
|
|
110
|
+
if (entry.assumeValid || entry.skipWorktree)
|
|
111
|
+
continue;
|
|
112
|
+
if (entry.intentToAdd)
|
|
113
|
+
return true;
|
|
114
|
+
if (Date.now() > deadline) {
|
|
115
|
+
throw new Error("dirty check deadline exceeded");
|
|
116
|
+
}
|
|
117
|
+
if (await isEntryModified(projectDir, entry, index.indexMtimeSec)) {
|
|
118
|
+
return true;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
const baselinePatterns = [];
|
|
122
|
+
const excludesContent = await readTextFileCapped(await resolveExcludesFilePath(localConfigPath, env), MAX_IGNORE_FILE_BYTES);
|
|
123
|
+
if (excludesContent !== null)
|
|
124
|
+
baselinePatterns.push(excludesContent);
|
|
125
|
+
const infoExclude = await readTextFileCapped(join(layout.commonDir, "info", "exclude"), MAX_IGNORE_FILE_BYTES);
|
|
126
|
+
if (infoExclude !== null)
|
|
127
|
+
baselinePatterns.push(infoExclude);
|
|
128
|
+
return await hasUntrackedFile({
|
|
129
|
+
worktreeDir: projectDir,
|
|
130
|
+
trackedFiles,
|
|
131
|
+
trackedDirs,
|
|
132
|
+
ignorecase,
|
|
133
|
+
baselinePatterns,
|
|
134
|
+
deadline,
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
catch {
|
|
138
|
+
return false;
|
|
139
|
+
}
|
|
140
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export type InflateSliceResult = {
|
|
2
|
+
data: Buffer;
|
|
3
|
+
bytesRead: number;
|
|
4
|
+
};
|
|
5
|
+
export declare const inflateSliceByProcessChunk: (buf: Buffer, offset: number, maxOutputLength?: number) => Promise<InflateSliceResult>;
|
|
6
|
+
export declare const inflateSliceByStream: (buf: Buffer, offset: number, maxOutputLength?: number) => Promise<InflateSliceResult>;
|
|
7
|
+
export declare const inflateSlice: (buf: Buffer, offset: number, maxOutputLength?: number) => Promise<InflateSliceResult>;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import zlib from "node:zlib";
|
|
2
|
+
const detachOutput = (out) => {
|
|
3
|
+
if (Array.isArray(out))
|
|
4
|
+
return Buffer.concat(out);
|
|
5
|
+
const isSlice = out.byteOffset !== 0 || out.byteLength !== out.buffer.byteLength;
|
|
6
|
+
return isSlice ? Buffer.from(out) : out;
|
|
7
|
+
};
|
|
8
|
+
const inflateSliceByProcessChunkSync = (buf, offset, maxOutputLength) => {
|
|
9
|
+
const InflateCtor = zlib
|
|
10
|
+
.Inflate;
|
|
11
|
+
const engine = new InflateCtor(maxOutputLength === undefined ? {} : { maxOutputLength });
|
|
12
|
+
try {
|
|
13
|
+
const out = engine._processChunk(buf.subarray(offset), zlib.constants.Z_FINISH);
|
|
14
|
+
const data = detachOutput(out);
|
|
15
|
+
if (maxOutputLength !== undefined && data.length > maxOutputLength) {
|
|
16
|
+
throw new Error("inflate output exceeds maxOutputLength");
|
|
17
|
+
}
|
|
18
|
+
return { data, bytesRead: engine.bytesWritten };
|
|
19
|
+
}
|
|
20
|
+
finally {
|
|
21
|
+
engine.close();
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
export const inflateSliceByProcessChunk = (buf, offset, maxOutputLength) => new Promise((resolve, reject) => {
|
|
25
|
+
try {
|
|
26
|
+
resolve(inflateSliceByProcessChunkSync(buf, offset, maxOutputLength));
|
|
27
|
+
}
|
|
28
|
+
catch (err) {
|
|
29
|
+
reject(err);
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
export const inflateSliceByStream = (buf, offset, maxOutputLength) => new Promise((resolve, reject) => {
|
|
33
|
+
const stream = zlib.createInflate();
|
|
34
|
+
const chunks = [];
|
|
35
|
+
let total = 0;
|
|
36
|
+
stream.on("data", (chunk) => {
|
|
37
|
+
total += chunk.length;
|
|
38
|
+
if (maxOutputLength !== undefined && total > maxOutputLength) {
|
|
39
|
+
stream.destroy(new Error("inflate output exceeds maxOutputLength"));
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
chunks.push(chunk);
|
|
43
|
+
});
|
|
44
|
+
stream.on("error", (err) => {
|
|
45
|
+
stream.close();
|
|
46
|
+
reject(err);
|
|
47
|
+
});
|
|
48
|
+
stream.on("end", () => {
|
|
49
|
+
const bytesRead = stream.bytesWritten;
|
|
50
|
+
stream.close();
|
|
51
|
+
resolve({ data: Buffer.concat(chunks), bytesRead });
|
|
52
|
+
});
|
|
53
|
+
stream.end(buf.subarray(offset));
|
|
54
|
+
});
|
|
55
|
+
const probeProcessChunk = () => {
|
|
56
|
+
try {
|
|
57
|
+
const original = Buffer.from("accel zlib probe payload 0123456789");
|
|
58
|
+
const deflated = zlib.deflateSync(original);
|
|
59
|
+
const padded = Buffer.concat([
|
|
60
|
+
deflated,
|
|
61
|
+
Buffer.from([0xde, 0xad, 0xbe, 0xef]),
|
|
62
|
+
]);
|
|
63
|
+
const result = inflateSliceByProcessChunkSync(padded, 0);
|
|
64
|
+
return result.bytesRead === deflated.length && result.data.equals(original);
|
|
65
|
+
}
|
|
66
|
+
catch {
|
|
67
|
+
return false;
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
let selectedImpl;
|
|
71
|
+
export const inflateSlice = (buf, offset, maxOutputLength) => {
|
|
72
|
+
if (selectedImpl === undefined) {
|
|
73
|
+
selectedImpl = probeProcessChunk()
|
|
74
|
+
? inflateSliceByProcessChunk
|
|
75
|
+
: inflateSliceByStream;
|
|
76
|
+
}
|
|
77
|
+
return selectedImpl(buf, offset, maxOutputLength);
|
|
78
|
+
};
|
package/dist/i18n/en.js
CHANGED
|
@@ -36,9 +36,12 @@ export const messages = {
|
|
|
36
36
|
"warning.moduleMismatch": "Specified modules differ from juggling.im. Using specified values.",
|
|
37
37
|
"warning.gitNotFound": "git command not found. Skipping Git initialization.",
|
|
38
38
|
"warning.fileExists": "File already exists, skipping: {path}",
|
|
39
|
+
"warning.pathRejected.project": "Excluded an asset whose deploy path points outside the project: {path}",
|
|
40
|
+
"warning.pathRejected.assetRepo": "Excluded an asset whose source path points outside the asset repository: {path}",
|
|
39
41
|
"warning.gitHooksUserFile": "Skipped placing the pre-commit hook because {path} is not managed by the CLI. To keep the token-leak check, integrate it into your existing hook manually.",
|
|
40
42
|
"warning.gitHooksPathConflict": "Skipped enabling the pre-commit hook because git core.hooksPath is set to {current}. Integrate the token-leak check (.githooks/pre-commit) into your existing hook setup manually.",
|
|
41
43
|
"warning.gitHooksForeignFiles": "Skipped setting core.hooksPath because .githooks contains files not managed by the CLI ({files}). After confirming they are safe, run git config core.hooksPath .githooks manually.",
|
|
44
|
+
"warning.gitHooksLayoutSuspicious": "Skipped setting core.hooksPath because the .git reference points to an unexpected location outside the project ({path}). Run git config core.hooksPath .githooks manually if needed.",
|
|
42
45
|
"attach.skipSummary": "{count} file(s) were skipped because they already exist.",
|
|
43
46
|
"attach.overwritePrompt": "{path} already exists. Overwrite?",
|
|
44
47
|
"attach.overwritePrompt.yes": "Yes (overwrite this file)",
|
|
@@ -167,6 +170,8 @@ export const messages = {
|
|
|
167
170
|
"error.gitAuthHint": "The repository requires authentication (HTTP 401/403). Private repositories that require authentication are not supported. Please specify the URL of a public repository.",
|
|
168
171
|
"error.gitServerUnsupported": "This server does not support the git features required to fetch assets (smart HTTP protocol v2 / filter). Please use a major git hosting service such as GitHub, GitLab, or Gitea.",
|
|
169
172
|
"error.gitUrlUnsupported": "Asset repository URLs must use HTTP(S) (SSH and file:// are not supported): {url}",
|
|
173
|
+
"error.gitProxyHint": "Failed to communicate with the proxy server. Check the https_proxy / http_proxy / no_proxy environment variables.",
|
|
174
|
+
"error.unknownFlags": "Unknown option(s): {flags}\nRun with --help to see the available options.",
|
|
170
175
|
"summary.heading": "Deployment settings",
|
|
171
176
|
"summary.label.name": "Project name",
|
|
172
177
|
"summary.label.artifactId": "Artifact ID",
|
|
@@ -211,6 +216,13 @@ export const messages = {
|
|
|
211
216
|
"credentials.verify.error.unexpected": "Failed to verify connection information (HTTP {status}).",
|
|
212
217
|
"login.intro": "Accel CLI - login",
|
|
213
218
|
"login.complete": "Connection information saved.",
|
|
219
|
+
"mcp.generated": "Generated or updated the MCP configuration: {path}",
|
|
220
|
+
"mcp.hint.loginRequired": "Run accel login to generate the MCP configuration for connecting to iAP.",
|
|
221
|
+
"mcp.detach.removed": "Removed CLI-managed entries from the MCP configuration: {path} ({count})",
|
|
222
|
+
"mcp.warning.unknownOutput": "Skipped MCP templates for an unsupported output path: {path}",
|
|
223
|
+
"mcp.warning.fragmentParse": "Skipped an MCP template that could not be read or parsed: {path}",
|
|
224
|
+
"mcp.warning.outputParse": "Skipped generating this file because the existing MCP configuration could not be parsed: {path}",
|
|
225
|
+
"mcp.warning.credentialEntryExcluded": "Some MCP entries could not be generated because the connection information could not be resolved: {path} ({names}). Check the connection information and the asset definition.",
|
|
214
226
|
"deploy.intro": "Accel CLI - deploy",
|
|
215
227
|
"deploy.progress.fetchingStagings": "Fetching staging environments...",
|
|
216
228
|
"deploy.progress.deploying": "Deploying...",
|
package/dist/i18n/index.js
CHANGED
|
@@ -11,7 +11,7 @@ export const getMessage = (key, locale, params) => {
|
|
|
11
11
|
let message = catalog[key] ?? catalogs["en"][key] ?? key;
|
|
12
12
|
if (params) {
|
|
13
13
|
for (const [paramKey, paramValue] of Object.entries(params)) {
|
|
14
|
-
message = message.replaceAll(`{${paramKey}}`, paramValue);
|
|
14
|
+
message = message.replaceAll(`{${paramKey}}`, () => paramValue);
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
return message;
|
package/dist/i18n/ja.js
CHANGED
|
@@ -36,9 +36,12 @@ export const messages = {
|
|
|
36
36
|
"warning.moduleMismatch": "指定されたモジュールとjuggling.imのモジュールが異なります。指定値を優先します。",
|
|
37
37
|
"warning.gitNotFound": "gitコマンドが見つかりません。Git初期化をスキップします。",
|
|
38
38
|
"warning.fileExists": "既存ファイルのためスキップ: {path}",
|
|
39
|
+
"warning.pathRejected.project": "配備先がプロジェクトの外を指しているため除外しました: {path}",
|
|
40
|
+
"warning.pathRejected.assetRepo": "取得元が資材リポジトリの外を指しているため除外しました: {path}",
|
|
39
41
|
"warning.gitHooksUserFile": "{path} はCLI管理外のファイルのため、pre-commitフックの配置をスキップしました。トークン漏洩防止のチェックが必要な場合は、既存のフックへ手動で組み込んでください。",
|
|
40
42
|
"warning.gitHooksPathConflict": "gitのcore.hooksPathが {current} に設定されているため、pre-commitフックの有効化をスキップしました。トークン漏洩防止のチェック (.githooks/pre-commit) を既存のフック機構へ手動で組み込んでください。",
|
|
41
43
|
"warning.gitHooksForeignFiles": ".githooks 配下にCLI管理外のファイル ({files}) が存在するため、core.hooksPathの自動設定をスキップしました。内容に問題がないことを確認した上で、git config core.hooksPath .githooks を手動で実行してください。",
|
|
44
|
+
"warning.gitHooksLayoutSuspicious": ".git の参照先 ({path}) がプロジェクトの外を指しているため、core.hooksPathの自動設定をスキップしました。必要な場合は git config core.hooksPath .githooks を手動で実行してください。",
|
|
42
45
|
"attach.skipSummary": "{count}件のファイルは既に存在したためスキップしました。",
|
|
43
46
|
"attach.overwritePrompt": "{path} は既に存在します。上書きしますか?",
|
|
44
47
|
"attach.overwritePrompt.yes": "Yes (このファイルを上書き)",
|
|
@@ -167,6 +170,8 @@ export const messages = {
|
|
|
167
170
|
"error.gitAuthHint": "リポジトリが認証を要求しました(HTTP 401/403)。認証が必要なプライベートリポジトリには対応していません。公開リポジトリの URL を指定してください。",
|
|
168
171
|
"error.gitServerUnsupported": "このサーバは資材の取得に必要な git 機能(smart HTTP protocol v2 / filter)に対応していません。GitHub / GitLab / Gitea などの主要 git ホスティングサービスをご利用ください。",
|
|
169
172
|
"error.gitUrlUnsupported": "資材リポジトリの URL は HTTP(S) のみ対応しています(SSH / file:// は利用できません): {url}",
|
|
173
|
+
"error.gitProxyHint": "プロキシサーバとの接続でエラーが発生しました。https_proxy / http_proxy / no_proxy 環境変数の設定を確認してください。",
|
|
174
|
+
"error.unknownFlags": "不明なオプションが指定されました: {flags}\n利用できるオプションは --help で確認できます。",
|
|
170
175
|
"summary.heading": "配備設定",
|
|
171
176
|
"summary.label.name": "プロジェクト名",
|
|
172
177
|
"summary.label.artifactId": "アーティファクトID",
|
|
@@ -211,6 +216,13 @@ export const messages = {
|
|
|
211
216
|
"credentials.verify.error.unexpected": "接続情報の確認に失敗しました(HTTP {status})。",
|
|
212
217
|
"login.intro": "Accel CLI - login",
|
|
213
218
|
"login.complete": "接続情報を保存しました。",
|
|
219
|
+
"mcp.generated": "MCP 設定を生成/更新しました: {path}",
|
|
220
|
+
"mcp.hint.loginRequired": "accel login を実行すると iAP 接続用の MCP 設定が生成されます。",
|
|
221
|
+
"mcp.detach.removed": "MCP 設定から CLI 管理のエントリを除去しました: {path}({count}件)",
|
|
222
|
+
"mcp.warning.unknownOutput": "生成対象外の出力先のため、MCP 設定テンプレートをスキップしました: {path}",
|
|
223
|
+
"mcp.warning.fragmentParse": "MCP 設定テンプレートを読み込めないか解析できないためスキップしました: {path}",
|
|
224
|
+
"mcp.warning.outputParse": "既存の MCP 設定を解析できないため、このファイルの生成をスキップしました: {path}",
|
|
225
|
+
"mcp.warning.credentialEntryExcluded": "接続情報を解決できないため、MCP 設定の一部エントリを生成できませんでした: {path}({names})。接続情報と資材の定義を確認してください。",
|
|
214
226
|
"deploy.intro": "Accel CLI - deploy",
|
|
215
227
|
"deploy.progress.fetchingStagings": "ステージング環境を取得しています...",
|
|
216
228
|
"deploy.progress.deploying": "デプロイしています...",
|
package/dist/i18n/zh_CN.js
CHANGED
|
@@ -36,9 +36,12 @@ export const messages = {
|
|
|
36
36
|
"warning.moduleMismatch": "指定的模块与juggling.im不同。将使用指定值。",
|
|
37
37
|
"warning.gitNotFound": "未找到git命令。跳过Git初始化。",
|
|
38
38
|
"warning.fileExists": "文件已存在,跳过: {path}",
|
|
39
|
+
"warning.pathRejected.project": "部署路径指向项目之外,已排除该资材: {path}",
|
|
40
|
+
"warning.pathRejected.assetRepo": "来源路径指向资源仓库之外,已排除该资材: {path}",
|
|
39
41
|
"warning.gitHooksUserFile": "由于 {path} 不是由 CLI 管理的文件,已跳过 pre-commit 钩子的部署。如需保留防止令牌泄露的检查,请手动将其集成到现有钩子中。",
|
|
40
42
|
"warning.gitHooksPathConflict": "由于 git 的 core.hooksPath 已设置为 {current},已跳过 pre-commit 钩子的启用。请手动将防止令牌泄露的检查(.githooks/pre-commit)集成到现有的钩子机制中。",
|
|
41
43
|
"warning.gitHooksForeignFiles": "由于 .githooks 下存在不由 CLI 管理的文件({files}),已跳过 core.hooksPath 的自动设置。请确认其内容没有问题后,手动执行 git config core.hooksPath .githooks。",
|
|
44
|
+
"warning.gitHooksLayoutSuspicious": "由于 .git 的引用指向项目外的异常位置({path}),已跳过 core.hooksPath 的自动设置。如有需要,请手动执行 git config core.hooksPath .githooks。",
|
|
42
45
|
"attach.skipSummary": "{count}个文件已存在,已跳过。",
|
|
43
46
|
"attach.overwritePrompt": "{path} 已存在。要覆盖吗?",
|
|
44
47
|
"attach.overwritePrompt.yes": "Yes (覆盖此文件)",
|
|
@@ -167,6 +170,8 @@ export const messages = {
|
|
|
167
170
|
"error.gitAuthHint": "仓库要求身份验证(HTTP 401/403)。不支持需要身份验证的私有仓库,请指定公开仓库的 URL。",
|
|
168
171
|
"error.gitServerUnsupported": "该服务器不支持获取资源所需的 git 功能(smart HTTP protocol v2 / filter)。请使用 GitHub / GitLab / Gitea 等主流 git 托管服务。",
|
|
169
172
|
"error.gitUrlUnsupported": "资源仓库 URL 仅支持 HTTP(S)(不支持 SSH / file://): {url}",
|
|
173
|
+
"error.gitProxyHint": "与代理服务器通信时发生错误。请检查 https_proxy / http_proxy / no_proxy 环境变量的设置。",
|
|
174
|
+
"error.unknownFlags": "指定了未知选项: {flags}\n可通过 --help 查看可用选项。",
|
|
170
175
|
"summary.heading": "部署设置",
|
|
171
176
|
"summary.label.name": "项目名称",
|
|
172
177
|
"summary.label.artifactId": "构件ID",
|
|
@@ -211,6 +216,13 @@ export const messages = {
|
|
|
211
216
|
"credentials.verify.error.unexpected": "确认连接信息失败(HTTP {status})。",
|
|
212
217
|
"login.intro": "Accel CLI - login",
|
|
213
218
|
"login.complete": "连接信息已保存。",
|
|
219
|
+
"mcp.generated": "已生成或更新 MCP 配置: {path}",
|
|
220
|
+
"mcp.hint.loginRequired": "执行 accel login 后将生成用于连接 iAP 的 MCP 配置。",
|
|
221
|
+
"mcp.detach.removed": "已从 MCP 配置中移除 CLI 管理的条目: {path}({count} 项)",
|
|
222
|
+
"mcp.warning.unknownOutput": "输出路径不在生成范围内,已跳过 MCP 配置模板: {path}",
|
|
223
|
+
"mcp.warning.fragmentParse": "无法读取或解析 MCP 配置模板,已跳过: {path}",
|
|
224
|
+
"mcp.warning.outputParse": "无法解析现有的 MCP 配置,已跳过该文件的生成: {path}",
|
|
225
|
+
"mcp.warning.credentialEntryExcluded": "由于无法解析连接信息,部分 MCP 条目未能生成: {path}({names})。请检查连接信息与资料的定义。",
|
|
214
226
|
"deploy.intro": "Accel CLI - deploy",
|
|
215
227
|
"deploy.progress.fetchingStagings": "正在获取暂存环境...",
|
|
216
228
|
"deploy.progress.deploying": "正在部署...",
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
2
|
+
import "./core/color-env.js";
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import "./core/color-env.js";
|
|
2
3
|
import { defineCommand, runMain } from "citty";
|
|
3
4
|
import { initCommand } from "./commands/init.js";
|
|
4
5
|
import { attachCommand } from "./commands/attach.js";
|
|
@@ -9,11 +10,11 @@ import { presetCommand } from "./commands/preset.js";
|
|
|
9
10
|
import { cacheCommand } from "./commands/cache.js";
|
|
10
11
|
import { loginCommand } from "./commands/login.js";
|
|
11
12
|
import { deployCommand } from "./commands/deploy.js";
|
|
12
|
-
import {
|
|
13
|
+
import { getCliVersion } from "./core/paths.js";
|
|
13
14
|
const main = defineCommand({
|
|
14
15
|
meta: {
|
|
15
16
|
name: "accel",
|
|
16
|
-
version:
|
|
17
|
+
version: getCliVersion(),
|
|
17
18
|
description: "CLI tool for intra-mart Accel Platform development",
|
|
18
19
|
},
|
|
19
20
|
subCommands: {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import type { AssetMessage } from "../asset/messages.js";
|
|
2
|
+
import type { Logger } from "../core/logger.js";
|
|
2
3
|
export declare const buildAssetMessageLines: (messages: AssetMessage[]) => AssetMessage[];
|
|
3
|
-
export declare const printAssetMessages: (messages: AssetMessage[]) => void;
|
|
4
|
+
export declare const printAssetMessages: (messages: AssetMessage[], logger?: Logger) => void;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import * as p from "@clack/prompts";
|
|
2
1
|
import { sanitizeDisplayText } from "../utils/sanitize-text.js";
|
|
2
|
+
import { createClackLogger } from "./clack-logger.js";
|
|
3
3
|
export const buildAssetMessageLines = (messages) => messages
|
|
4
4
|
.map((m) => ({ level: m.level, text: sanitizeDisplayText(m.text) }))
|
|
5
5
|
.filter((m) => m.text !== "");
|
|
6
|
-
export const printAssetMessages = (messages) => {
|
|
6
|
+
export const printAssetMessages = (messages, logger = createClackLogger()) => {
|
|
7
7
|
for (const message of buildAssetMessageLines(messages)) {
|
|
8
8
|
if (message.level === "warn") {
|
|
9
|
-
|
|
9
|
+
logger.warn(message.text);
|
|
10
10
|
}
|
|
11
11
|
else {
|
|
12
|
-
|
|
12
|
+
logger.info(message.text);
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
15
|
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as p from "@clack/prompts";
|
|
2
|
+
export const createClackLogger = () => ({
|
|
3
|
+
intro: (title) => p.intro(title),
|
|
4
|
+
outro: (msg) => p.outro(msg),
|
|
5
|
+
info: (msg) => p.log.info(msg),
|
|
6
|
+
warn: (msg) => p.log.warn(msg),
|
|
7
|
+
error: (msg) => p.log.error(msg),
|
|
8
|
+
success: (msg) => p.log.success(msg),
|
|
9
|
+
note: (msg, title) => p.note(msg, title),
|
|
10
|
+
spinner: () => p.spinner(),
|
|
11
|
+
});
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import type { AccelCredentials } from "../core/types.js";
|
|
2
|
+
import type { Logger } from "../core/logger.js";
|
|
2
3
|
import { type ApiClient } from "../deploy/api-client.js";
|
|
3
4
|
export declare const isRetryableCredentialError: (err: unknown) => boolean;
|
|
4
5
|
export type VerifyDeps = {
|
|
5
6
|
apiClientFactory: (endpoint: string, apiKey: string) => ApiClient;
|
|
6
7
|
repromptCredentials: (current: AccelCredentials, locale: string) => Promise<AccelCredentials>;
|
|
7
8
|
persistCredentials: (projectDir: string, creds: AccelCredentials) => Promise<void>;
|
|
9
|
+
logger?: Logger;
|
|
8
10
|
};
|
|
9
11
|
export declare const verifyCredentialsLoop: (projectDir: string, locale: string, initial: AccelCredentials, opts: {
|
|
10
12
|
dirty: boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import * as p from "@clack/prompts";
|
|
2
1
|
import { isDeployError } from "../deploy/api-client.js";
|
|
3
2
|
import { getMessage } from "../i18n/index.js";
|
|
3
|
+
import { createClackLogger } from "./clack-logger.js";
|
|
4
4
|
export const isRetryableCredentialError = (err) => isDeployError(err) &&
|
|
5
5
|
(err.kind === "network" || err.status === 401 || err.status === 404);
|
|
6
6
|
const formatRetryableError = (err, locale) => {
|
|
@@ -24,10 +24,11 @@ const formatTerminalError = (err, locale) => {
|
|
|
24
24
|
};
|
|
25
25
|
export const verifyCredentialsLoop = async (projectDir, locale, initial, opts, deps) => {
|
|
26
26
|
const interactive = opts.interactive ?? true;
|
|
27
|
+
const logger = deps.logger ?? createClackLogger();
|
|
27
28
|
let creds = initial;
|
|
28
29
|
let dirty = opts.dirty;
|
|
29
30
|
let api = deps.apiClientFactory(creds.endpoint, creds.apiKey);
|
|
30
|
-
const spin =
|
|
31
|
+
const spin = logger.spinner();
|
|
31
32
|
for (;;) {
|
|
32
33
|
spin.start(getMessage("credentials.verify.progress", locale));
|
|
33
34
|
try {
|
|
@@ -38,17 +39,17 @@ export const verifyCredentialsLoop = async (projectDir, locale, initial, opts, d
|
|
|
38
39
|
catch (err) {
|
|
39
40
|
spin.stop(getMessage("credentials.verify.progress", locale));
|
|
40
41
|
if (!interactive) {
|
|
41
|
-
|
|
42
|
+
logger.error(isRetryableCredentialError(err)
|
|
42
43
|
? formatRetryableError(err, locale)
|
|
43
44
|
: formatTerminalError(err, locale));
|
|
44
45
|
throw err;
|
|
45
46
|
}
|
|
46
47
|
if (!isRetryableCredentialError(err)) {
|
|
47
|
-
|
|
48
|
+
logger.error(formatTerminalError(err, locale));
|
|
48
49
|
throw err;
|
|
49
50
|
}
|
|
50
|
-
|
|
51
|
-
|
|
51
|
+
logger.error(formatRetryableError(err, locale));
|
|
52
|
+
logger.info(getMessage("credentials.verify.notice", locale));
|
|
52
53
|
creds = await deps.repromptCredentials(creds, locale);
|
|
53
54
|
api = deps.apiClientFactory(creds.endpoint, creds.apiKey);
|
|
54
55
|
dirty = true;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as p from "@clack/prompts";
|
|
2
|
+
import { createCancelledError } from "../core/errors.js";
|
|
2
3
|
import { readCredentials, normalizeEndpoint } from "../utils/credentials.js";
|
|
3
|
-
import {
|
|
4
|
+
import { persistCredentialsAndGenerateMcp } from "../utils/mcp-generate.js";
|
|
4
5
|
import { getMessage } from "../i18n/index.js";
|
|
5
6
|
import { withHint } from "./format.js";
|
|
6
7
|
const requiredValidator = (locale) => (value) => !value || value.trim().length === 0
|
|
@@ -17,7 +18,7 @@ export const ensureCredentials = async (projectDir, locale, seed = {}) => {
|
|
|
17
18
|
validate: requiredValidator(locale),
|
|
18
19
|
});
|
|
19
20
|
if (p.isCancel(input))
|
|
20
|
-
|
|
21
|
+
throw createCancelledError();
|
|
21
22
|
endpoint = input;
|
|
22
23
|
changed = true;
|
|
23
24
|
}
|
|
@@ -27,7 +28,7 @@ export const ensureCredentials = async (projectDir, locale, seed = {}) => {
|
|
|
27
28
|
validate: requiredValidator(locale),
|
|
28
29
|
});
|
|
29
30
|
if (p.isCancel(input))
|
|
30
|
-
|
|
31
|
+
throw createCancelledError();
|
|
31
32
|
apiKey = input;
|
|
32
33
|
changed = true;
|
|
33
34
|
}
|
|
@@ -36,7 +37,10 @@ export const ensureCredentials = async (projectDir, locale, seed = {}) => {
|
|
|
36
37
|
apiKey,
|
|
37
38
|
};
|
|
38
39
|
if (changed) {
|
|
39
|
-
await
|
|
40
|
+
await persistCredentialsAndGenerateMcp(projectDir, creds, {
|
|
41
|
+
info: (msg) => p.log.info(msg),
|
|
42
|
+
warn: (msg) => p.log.warning(msg),
|
|
43
|
+
});
|
|
40
44
|
}
|
|
41
45
|
return creds;
|
|
42
46
|
};
|
|
@@ -66,7 +70,7 @@ export const repromptCredentials = async (current, locale, seed = {}) => {
|
|
|
66
70
|
validate: requiredValidator(locale),
|
|
67
71
|
});
|
|
68
72
|
if (p.isCancel(endpointInput))
|
|
69
|
-
|
|
73
|
+
throw createCancelledError();
|
|
70
74
|
endpoint = endpointInput;
|
|
71
75
|
}
|
|
72
76
|
let apiKey = seed.apiKey;
|
|
@@ -76,7 +80,7 @@ export const repromptCredentials = async (current, locale, seed = {}) => {
|
|
|
76
80
|
validate: requiredValidator(locale),
|
|
77
81
|
});
|
|
78
82
|
if (p.isCancel(apiKeyInput))
|
|
79
|
-
|
|
83
|
+
throw createCancelledError();
|
|
80
84
|
apiKey = apiKeyInput;
|
|
81
85
|
}
|
|
82
86
|
return {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Logger } from "../core/logger.js";
|
|
1
2
|
export type NextStepsOptions = {
|
|
2
3
|
projectDir: string;
|
|
3
4
|
agents: string[];
|
|
@@ -5,4 +6,4 @@ export type NextStepsOptions = {
|
|
|
5
6
|
locale: string;
|
|
6
7
|
};
|
|
7
8
|
export declare const buildNextStepsBody: (opts: NextStepsOptions) => string;
|
|
8
|
-
export declare const printNextSteps: (opts: NextStepsOptions) => void;
|
|
9
|
+
export declare const printNextSteps: (opts: NextStepsOptions, logger?: Logger) => void;
|