@cat-factory/cli 0.10.3 → 0.10.5

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/bin.js CHANGED
@@ -4,6 +4,10 @@ import { fileURLToPath } from 'node:url';
4
4
  import { ArgError, HELP_TEXT, parseArgs } from './args.js';
5
5
  import { bootstrap } from './bootstrap.js';
6
6
  import { generateEnv } from './envCommand.js';
7
+ // Kernel's describer, COPIED into this package rather than imported: `@cat-factory/kernel` is a
8
+ // devDependency here and this file is the published `bin`, so a runtime import would resolve
9
+ // through pnpm's workspace link locally and fail with ERR_MODULE_NOT_FOUND off the registry.
10
+ import { getErrorMessage } from './errorText.js';
7
11
  import { setupK3s } from './k3s.js';
8
12
  import { supervise } from './superviseCommand.js';
9
13
  function readVersion() {
@@ -51,7 +55,9 @@ async function main() {
51
55
  await bootstrap(options);
52
56
  }
53
57
  main().catch((err) => {
54
- process.stderr.write(`\ncat-factory: ${err instanceof Error ? err.message : String(err)}\n`);
58
+ // An error that describes itself as nothing (an empty message with no cause) says so as an
59
+ // empty string, so the fallback is what stops the last line of a failed run being a bare prefix.
60
+ process.stderr.write(`\ncat-factory: ${getErrorMessage(err) || 'failed for an unreported reason'}\n`);
55
61
  process.exit(1);
56
62
  });
57
63
  //# sourceMappingURL=bin.js.map
package/dist/bin.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"bin.js","sourceRoot":"","sources":["../src/bin.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AACxC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM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AC,OAAO,CAAC,CAAA;QACvB,OAAM;IACR,CAAC;IACD,IAAI,OAAO,CAAC,OAAO,KAAK,WAAW,EAAE,CAAC;QACpC,MAAM,SAAS,CAAC,OAAO,CAAC,CAAA;QACxB,OAAM;IACR,CAAC;IAED,MAAM,SAAS,CAAC,OAAO,CAAC,CAAA;AAC1B,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAY,EAAE,EAAE;IAC5B,2FAA2F;IAC3F,iGAAiG;IACjG,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,kBAAkB,eAAe,CAAC,GAAG,CAAC,IAAI,iCAAiC,IAAI,CAChF,CAAA;IACD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;AACjB,CAAC,CAAC,CAAA"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * A thrown value as ONE line: its own message, then each cause beneath it, scrubbed and capped.
3
+ * Byte-for-byte kernel's `getErrorMessage` — see the header, and the conformity test beside it.
4
+ */
5
+ export declare function getErrorMessage(error: unknown): string;
6
+ //# sourceMappingURL=errorText.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errorText.d.ts","sourceRoot":"","sources":["../src/errorText.ts"],"names":[],"mappings":"AA4KA;;;GAGG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAQtD"}
@@ -0,0 +1,175 @@
1
+ // How the CLI turns a THROWN VALUE into the one line it writes to stderr before exiting.
2
+ //
3
+ // This is a deliberate COPY of `getErrorMessage` in `@cat-factory/kernel`
4
+ // (`src/shared/error-chain.logic.ts` over `src/shared/redact-secrets.logic.ts`), for the same
5
+ // reason the executor-harness copies `hostMarkdown`: this package is PUBLISHED and stays runtime
6
+ // dependency-free (its only `dependencies` entry is `@clack/prompts`), so a `workspace:*` package
7
+ // it imports at runtime would resolve locally through pnpm's link and be missing the moment
8
+ // someone runs `npx cat-factory` off the registry. `errorText.conformity.test.ts` pins the two to
9
+ // byte-identical output over a shared corpus, so the copy cannot drift: change one, change the
10
+ // other. Kernel stays a devDependency, which is what lets that test import it.
11
+ //
12
+ // Why the CLI wants the chain at all: on Node a transport failure IS a bare `TypeError: fetch
13
+ // failed`, and what actually happened (`connect ECONNREFUSED`, `self-signed certificate`,
14
+ // `getaddrinfo ENOTFOUND`) hangs off `.cause`. `cat-factory` bootstraps against GitHub, a Docker
15
+ // daemon and a k3s cluster, so "fetch failed" as the last thing a failed bootstrap prints is the
16
+ // least useful sentence available.
17
+ const REPLACEMENT = '[REDACTED]';
18
+ const PEM_PRIVATE_KEY_BEGIN = /-----BEGIN[ A-Z0-9]*PRIVATE KEY[ A-Z0-9]*-----/g;
19
+ const PEM_PRIVATE_KEY_END = /-----END[ A-Z0-9]*PRIVATE KEY[ A-Z0-9]*-----/g;
20
+ /** Drop PEM-armored private keys pasted verbatim, block and all (kernel's `redactPrivateKeyBlocks`). */
21
+ function redactPrivateKeyBlocks(value) {
22
+ PEM_PRIVATE_KEY_BEGIN.lastIndex = 0;
23
+ let begin = PEM_PRIVATE_KEY_BEGIN.exec(value);
24
+ if (begin === null)
25
+ return value;
26
+ let out = '';
27
+ let copiedTo = 0;
28
+ while (begin !== null) {
29
+ PEM_PRIVATE_KEY_END.lastIndex = begin.index + begin[0].length;
30
+ const end = PEM_PRIVATE_KEY_END.exec(value);
31
+ if (end === null)
32
+ break;
33
+ out += value.slice(copiedTo, begin.index) + REPLACEMENT;
34
+ copiedTo = end.index + end[0].length;
35
+ PEM_PRIVATE_KEY_BEGIN.lastIndex = copiedTo;
36
+ begin = PEM_PRIVATE_KEY_BEGIN.exec(value);
37
+ }
38
+ return copiedTo === 0 ? value : out + value.slice(copiedTo);
39
+ }
40
+ const ENV_VAR_NAME = /^[A-Z][A-Z0-9]*(?:_[A-Z0-9]+)+$/;
41
+ const PROSE_WORD = /^(?:[a-z]+|[A-Z]+|[A-Z][a-z]+)$/;
42
+ const MIN_ALPHABETIC_SECRET_CHARS = 16;
43
+ /** Whether a field-name rule's captured value is a credential rather than the next word of a sentence. */
44
+ function looksLikeSecretValue(value) {
45
+ if (ENV_VAR_NAME.test(value))
46
+ return false;
47
+ return !(value.length < MIN_ALPHABETIC_SECRET_CHARS && PROSE_WORD.test(value));
48
+ }
49
+ const RULES = [
50
+ {
51
+ pattern: /\b(bearer|basic|token)\s+([A-Za-z0-9._+/=~-]{8,})/gi,
52
+ replace: (m) => (looksLikeSecretValue(m[2] ?? '') ? `${m[1]} ${REPLACEMENT}` : (m[0] ?? '')),
53
+ },
54
+ {
55
+ pattern: /\b(authorization|x-api-key|x-auth-token|proxy-authorization)(["']?\s*[:=]\s*["']?)([^\s"',}]+)/gi,
56
+ replace: (m) => `${m[1]}${m[2]}${REPLACEMENT}`,
57
+ },
58
+ {
59
+ pattern: /(?<=[a-z][a-z0-9+.-]{0,39}:\/\/)([^/\s:@]+):([^/\s@]+)@/gi,
60
+ replace: (m) => `${m[1]}:${REPLACEMENT}@`,
61
+ },
62
+ {
63
+ pattern: /\b((?:access[_-]?)?(?:api[_-]?)?(?:client[_-]?)?(?:token|secret|password|passwd|pwd|sig|signature|key|apikey|auth))(["']?\s*[:=]\s*["']?)([^\s"',&}@/]{4,})/gi,
64
+ replace: (m) => looksLikeSecretValue(m[3] ?? '') ? `${m[1]}${m[2]}${REPLACEMENT}` : (m[0] ?? ''),
65
+ },
66
+ { pattern: /\b(sk|rk|pk)-[A-Za-z0-9_-]{16,}/g, replace: () => REPLACEMENT },
67
+ { pattern: /\bgh[pousr]_[A-Za-z0-9]{20,}/g, replace: () => REPLACEMENT },
68
+ { pattern: /\bgithub_pat_[A-Za-z0-9_]{20,}/g, replace: () => REPLACEMENT },
69
+ { pattern: /\bxox[baprs]-[A-Za-z0-9-]{10,}/g, replace: () => REPLACEMENT },
70
+ { pattern: /\bAKIA[0-9A-Z]{16}\b/g, replace: () => REPLACEMENT },
71
+ {
72
+ pattern: /\beyJ[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/g,
73
+ replace: () => REPLACEMENT,
74
+ },
75
+ ];
76
+ /** Best-effort scrub of credentials from a string (kernel's `redactSecrets`, non-null input only). */
77
+ function redactSecrets(value) {
78
+ let out = redactPrivateKeyBlocks(value);
79
+ for (const rule of RULES) {
80
+ out = out.replace(rule.pattern, (...args) => {
81
+ const groups = args.slice(0, -2);
82
+ return rule.replace(groups);
83
+ });
84
+ }
85
+ return out;
86
+ }
87
+ const MAX_ERROR_CHAIN_CHARS = 400;
88
+ const MAX_CHAIN_DEPTH = 6;
89
+ const MAX_AGGREGATE_BRANCHES = 8;
90
+ const TRANSPORT_CODE = /^[A-Z][A-Z0-9_]*$/;
91
+ function readProperty(value, key) {
92
+ if (value === null || (typeof value !== 'object' && typeof value !== 'function'))
93
+ return undefined;
94
+ try {
95
+ return value[key];
96
+ }
97
+ catch {
98
+ return undefined;
99
+ }
100
+ }
101
+ function safeText(value) {
102
+ try {
103
+ return String(value);
104
+ }
105
+ catch {
106
+ return '';
107
+ }
108
+ }
109
+ function errorCode(error) {
110
+ const code = readProperty(error, 'code');
111
+ return typeof code === 'string' && code ? code : undefined;
112
+ }
113
+ function aggregated(error) {
114
+ const errors = readProperty(error, 'errors');
115
+ return Array.isArray(errors) ? errors : [];
116
+ }
117
+ function flattenErrorChain(error, depth = 0, out = [], seen = new Set()) {
118
+ if (error === null || error === undefined || depth > MAX_CHAIN_DEPTH)
119
+ return out;
120
+ if (typeof error === 'object') {
121
+ if (seen.has(error))
122
+ return out;
123
+ seen.add(error);
124
+ }
125
+ out.push(error);
126
+ const branches = aggregated(error);
127
+ for (const branch of branches.slice(0, MAX_AGGREGATE_BRANCHES))
128
+ flattenErrorChain(branch, depth + 1, out, seen);
129
+ if (branches.length > MAX_AGGREGATE_BRANCHES)
130
+ out.push(`[…${branches.length - MAX_AGGREGATE_BRANCHES} more branches not read]`);
131
+ flattenErrorChain(readProperty(error, 'cause'), depth + 1, out, seen);
132
+ return out;
133
+ }
134
+ function describeErrorLink(link) {
135
+ const message = link instanceof Error ? readProperty(link, 'message') : link;
136
+ const code = errorCode(link);
137
+ const text = safeText(message ?? '').trim();
138
+ if (!code || !TRANSPORT_CODE.test(code))
139
+ return text || code || '';
140
+ if (!text)
141
+ return code;
142
+ return text.includes(code) ? text : `${text} (${code})`;
143
+ }
144
+ function renderErrorChainLinks(links) {
145
+ const counts = new Map();
146
+ for (const link of links) {
147
+ const text = describeErrorLink(link);
148
+ if (!text)
149
+ continue;
150
+ counts.set(text, (counts.get(text) ?? 0) + 1);
151
+ }
152
+ return [...counts].map(([text, count]) => (count > 1 ? `${text} (x${count})` : text));
153
+ }
154
+ function joinErrorChain(parts) {
155
+ const text = redactSecrets(parts.join(': '));
156
+ if (text.length <= MAX_ERROR_CHAIN_CHARS)
157
+ return text;
158
+ const dropped = text.length - MAX_ERROR_CHAIN_CHARS;
159
+ return `${text.slice(0, MAX_ERROR_CHAIN_CHARS)} […${dropped} more characters of the cause chain]`;
160
+ }
161
+ /**
162
+ * A thrown value as ONE line: its own message, then each cause beneath it, scrubbed and capped.
163
+ * Byte-for-byte kernel's `getErrorMessage` — see the header, and the conformity test beside it.
164
+ */
165
+ export function getErrorMessage(error) {
166
+ const parts = renderErrorChainLinks(flattenErrorChain(error));
167
+ if (parts.length > 0)
168
+ return joinErrorChain(parts);
169
+ if (error instanceof Error) {
170
+ const name = readProperty(error, 'name');
171
+ return typeof name === 'string' && name && name !== Error.name ? joinErrorChain([name]) : '';
172
+ }
173
+ return joinErrorChain([safeText(error)]);
174
+ }
175
+ //# sourceMappingURL=errorText.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errorText.js","sourceRoot":"","sources":["../src/errorText.ts"],"names":[],"mappings":"AAAA,yFAAyF;AACzF,EAAE;AACF,0EAA0E;AAC1E,8FAA8F;AAC9F,iGAAiG;AACjG,kGAAkG;AAClG,4FAA4F;AAC5F,kGAAkG;AAClG,+FAA+F;AAC/F,+EAA+E;AAC/E,EAAE;AACF,8FAA8F;AAC9F,0F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,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;IAC9F,CAAC;IACD,OAAO,cAAc,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;AAC1C,CAAC"}
package/dist/io.d.ts CHANGED
@@ -20,6 +20,41 @@ export interface Io {
20
20
  /** Open a URL in the user's default browser (best-effort; resolves even if it can't). */
21
21
  openBrowser(url: string): Promise<void>;
22
22
  }
23
+ /** How to spawn the OS's URL opener: the command, its argv, and Windows' verbatim-argv flag. */
24
+ export interface OpenBrowserCommand {
25
+ cmd: string;
26
+ args: string[];
27
+ /**
28
+ * Windows only: hand the joined argv to `CreateProcess` unchanged instead of re-quoting each
29
+ * argument for `CommandLineToArgvW`, whose rules `cmd` does not follow.
30
+ */
31
+ windowsVerbatimArguments?: boolean;
32
+ }
33
+ /**
34
+ * The OS-appropriate command for opening a URL in the default browser.
35
+ *
36
+ * Windows goes through `cmd`, and cmd splits an UNQUOTED command line on `&` before the `start`
37
+ * builtin ever sees it. Every URL we open carries more than one query parameter, so this used to
38
+ * open the browser at everything up to the first `&` and then try to RUN each remaining parameter
39
+ * as a command: `cat-factory k3s` landed on a bare `?infraSetup=local-k3s` with none of the values
40
+ * the connect form prefills from, and the PAT links dropped their `scopes`.
41
+ *
42
+ * So the URL is quoted, which is also why `start`'s first argument is an empty quoted window title
43
+ * (it reads a leading quoted token as one). The quotes have to reach cmd verbatim, hence the flag.
44
+ *
45
+ * The quoting holds only while the URL carries no `"` of its own, so this SERIALIZES the input
46
+ * rather than trusting the caller to have done it: WHATWG serialization percent-encodes `"` in
47
+ * every component that can carry one and rejects it in a host, so no argument can close the quote
48
+ * and have cmd read the rest as a second command. Input that is not a URL at all throws, rather
49
+ * than reaching a shell as a command line whose meaning nobody has checked; `openBrowser` is
50
+ * best-effort and both call sites print the link before opening it. Inside the quotes cmd still
51
+ * expands a `%NAME%` reference, but the expansion is literal text there: quotes make `&` and its
52
+ * friends inert, and no Windows environment value can contain a `"` to close them, so the worst
53
+ * case is a wrong URL, never a second command.
54
+ *
55
+ * @throws {TypeError} if `url` is not a parsable absolute URL.
56
+ */
57
+ export declare function openCommand(url: string, platform: NodeJS.Platform): OpenBrowserCommand;
23
58
  /** The real, console-backed {@link Io}, implemented with `@clack/prompts`. */
24
59
  export declare function createConsoleIo(): Io;
25
60
  //# sourceMappingURL=io.d.ts.map
package/dist/io.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"io.d.ts","sourceRoot":"","sources":["../src/io.ts"],"names":[],"mappings":"AAYA;;;;GAIG;AACH,MAAM,WAAW,EAAE;IACjB,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;IAC3B,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;IAC3B,gFAAgF;IAChF,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;IAChE,+DAA+D;IAC/D,MAAM,CAAC,CAAC,SAAS,MAAM,EACrB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,SAAS;QAAE,KAAK,EAAE,CAAC,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,EAC/C,YAAY,EAAE,CAAC,GACd,OAAO,CAAC,CAAC,CAAC,CAAA;IACb,yFAAyF;IACzF,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;IACvC,qBAAqB;IACrB,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;IAChE,yFAAyF;IACzF,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CACxC;AAwBD,8EAA8E;AAC9E,wBAAgB,eAAe,IAAI,EAAE,CAwDpC"}
1
+ {"version":3,"file":"io.d.ts","sourceR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 'node:child_process';
2
2
  import { cancel, confirm as clackConfirm, isCancel, log, password, select as clackSelect, text, } from '@clack/prompts';
3
- /** The OS-appropriate command for opening a URL in the default browser. */
4
- function openCommand(url) {
5
- switch (process.platform) {
3
+ /**
4
+ * The OS-appropriate command for opening a URL in the default browser.
5
+ *
6
+ * Windows goes through `cmd`, and cmd splits an UNQUOTED command line on `&` before the `start`
7
+ * builtin ever sees it. Every URL we open carries more than one query parameter, so this used to
8
+ * open the browser at everything up to the first `&` and then try to RUN each remaining parameter
9
+ * as a command: `cat-factory k3s` landed on a bare `?infraSetup=local-k3s` with none of the values
10
+ * the connect form prefills from, and the PAT links dropped their `scopes`.
11
+ *
12
+ * So the URL is quoted, which is also why `start`'s first argument is an empty quoted window title
13
+ * (it reads a leading quoted token as one). The quotes have to reach cmd verbatim, hence the flag.
14
+ *
15
+ * The quoting holds only while the URL carries no `"` of its own, so this SERIALIZES the input
16
+ * rather than trusting the caller to have done it: WHATWG serialization percent-encodes `"` in
17
+ * every component that can carry one and rejects it in a host, so no argument can close the quote
18
+ * and have cmd read the rest as a second command. Input that is not a URL at all throws, rather
19
+ * than reaching a shell as a command line whose meaning nobody has checked; `openBrowser` is
20
+ * best-effort and both call sites print the link before opening it. Inside the quotes cmd still
21
+ * expands a `%NAME%` reference, but the expansion is literal text there: quotes make `&` and its
22
+ * friends inert, and no Windows environment value can contain a `"` to close them, so the worst
23
+ * case is a wrong URL, never a second command.
24
+ *
25
+ * @throws {TypeError} if `url` is not a parsable absolute URL.
26
+ */
27
+ export function openCommand(url, platform) {
28
+ const href = new URL(url).href;
29
+ switch (platform) {
6
30
  case 'darwin':
7
- return { cmd: 'open', args: [url] };
31
+ return { cmd: 'open', args: [href] };
8
32
  case 'win32':
9
- // `start` is a cmd builtin; the empty "" is the window title arg it requires.
10
- return { cmd: 'cmd', args: ['/c', 'start', '', url] };
33
+ return {
34
+ cmd: 'cmd',
35
+ args: ['/c', 'start', '""', `"${href}"`],
36
+ windowsVerbatimArguments: true,
37
+ };
11
38
  default:
12
- return { cmd: 'xdg-open', args: [url] };
39
+ return { cmd: 'xdg-open', args: [href] };
13
40
  }
14
41
  }
15
42
  /** A clack prompt resolved to a cancel symbol (Ctrl-C / Esc): print a notice and exit cleanly. */
@@ -58,8 +85,12 @@ export function createConsoleIo() {
58
85
  openBrowser(url) {
59
86
  return new Promise((resolve) => {
60
87
  try {
61
- const { cmd, args } = openCommand(url);
62
- const child = spawn(cmd, args, { stdio: 'ignore', detached: true });
88
+ const { cmd, args, windowsVerbatimArguments } = openCommand(url, process.platform);
89
+ const child = spawn(cmd, args, {
90
+ stdio: 'ignore',
91
+ detached: true,
92
+ windowsVerbatimArguments,
93
+ });
63
94
  child.on('error', () => resolve());
64
95
  child.unref();
65
96
  resolve();
package/dist/io.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"io.js","sourceRoot":"","sources":["../src/io.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA;AAC1C,OAAO,EACL,MAAM,EACN,OAAO,IAAI,YAAY,EACvB,QAAQ,EACR,GAAG,EAEH,QAAQ,EACR,MAAM,IAAI,WAAW,EACrB,IAAI,GACL,MAAM,gBAAgB,CAAA;AA0BvB,2EAA2E;AAC3E,SAAS,WAAW,CAAC,GAAW;IAC9B,QAAQ,OAAO,CAAC,QAAQ,EAAE,CAAC;QACzB,KAAK,QAAQ;YACX,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,GAAG,CAAC,EAAE,CAAA;QACrC,KAAK,OAAO;YACV,8EAA8E;YAC9E,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE,GAAG,CAAC,EAAE,CAAA;QACvD;YACE,OAAO,EAAE,GAAG,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,GAAG,CAAC,EAAE,CAAA;IAC3C,CAAC;AACH,CAAC;AAED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AC,GAAG,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAA;oBAClF,MAAM,KAAK,GAAG,KAAK,CAAC,GAAG,EAAE,IAAI,EAAE;wBAC7B,KAAK,EAAE,QAAQ;wBACf,QAAQ,EAAE,IAAI;wBACd,wBAAwB;qBACzB,CAAC,CAAA;oBACF,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,EAAE,CAAC,CAAA;oBAClC,KAAK,CAAC,KAAK,EAAE,CAAA;oBACb,OAAO,EAAE,CAAA;gBACX,CAAC;gBAAC,MAAM,CAAC;oBACP,OAAO,EAAE,CAAA;gBACX,CAAC;YACH,CAAC,CAAC,CAAA;QACJ,CAAC;KACF,CAAA;AACH,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cat-factory/cli",
3
- "version": "0.10.3",
3
+ "version": "0.10.5",
4
4
  "description": "Bootstrap CLI for the Agent Architecture Board: scaffold a local-mode deployment (Node/local backend + frontend SPA) on your own machine — generates the crypto secrets, populates and gitignores the .env files, and mints a GitHub/GitLab personal access token by opening the browser at the right pre-scoped URL.",
5
5
  "keywords": [
6
6
  "bootstrap",
@@ -41,8 +41,8 @@
41
41
  "typescript": "7.0.2",
42
42
  "valibot": "^1.4.2",
43
43
  "vitest": "^4.1.10",
44
- "@cat-factory/contracts": "0.292.1",
45
- "@cat-factory/kernel": "0.285.2"
44
+ "@cat-factory/contracts": "0.293.0",
45
+ "@cat-factory/kernel": "0.286.1"
46
46
  },
47
47
  "scripts": {
48
48
  "build": "tsc -b tsconfig.build.json",