@cat-factory/cli 0.10.5 → 0.12.0
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 +8 -0
- package/dist/args.d.ts +16 -1
- package/dist/args.d.ts.map +1 -1
- package/dist/args.js +44 -14
- package/dist/args.js.map +1 -1
- package/dist/host-shell.d.ts +26 -0
- package/dist/host-shell.d.ts.map +1 -1
- package/dist/host-shell.js +19 -0
- package/dist/host-shell.js.map +1 -1
- package/dist/index.d.ts +5 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +14 -3
- package/dist/index.js.map +1 -1
- package/dist/k3s-handler.d.ts +35 -20
- package/dist/k3s-handler.d.ts.map +1 -1
- package/dist/k3s-handler.js +54 -26
- package/dist/k3s-handler.js.map +1 -1
- package/dist/k3s-ingress.d.ts +259 -0
- package/dist/k3s-ingress.d.ts.map +1 -0
- package/dist/k3s-ingress.js +372 -0
- package/dist/k3s-ingress.js.map +1 -0
- package/dist/k3s-probe.d.ts +38 -3
- package/dist/k3s-probe.d.ts.map +1 -1
- package/dist/k3s-probe.js +93 -5
- package/dist/k3s-probe.js.map +1 -1
- package/dist/k3s-provision.d.ts +92 -18
- package/dist/k3s-provision.d.ts.map +1 -1
- package/dist/k3s-provision.js +280 -28
- package/dist/k3s-provision.js.map +1 -1
- package/dist/k3s.d.ts +3 -0
- package/dist/k3s.d.ts.map +1 -1
- package/dist/k3s.js +149 -24
- package/dist/k3s.js.map +1 -1
- package/package.json +3 -3
package/dist/k3s.d.ts
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { type CliOptions } from './args.js';
|
|
2
2
|
import { type HostShell } from './host-shell.js';
|
|
3
3
|
import { type Io } from './io.js';
|
|
4
|
+
import { type TcpProbe } from './k3s-ingress.js';
|
|
4
5
|
import { type HostState, type OfferId } from './k3s-probe.js';
|
|
5
6
|
import { type ResolvedConnection } from './k3s-provision.js';
|
|
6
7
|
/** The k3s command's injectable dependencies (defaults to the real console IO + host shell). */
|
|
7
8
|
export interface K3sDeps {
|
|
8
9
|
io?: Io;
|
|
9
10
|
shell?: HostShell;
|
|
11
|
+
/** TCP reachability seam for the ingress host-port probe. */
|
|
12
|
+
tcp?: TcpProbe;
|
|
10
13
|
/** Host platform, injected so the k3s-install guidance is deterministic in tests. */
|
|
11
14
|
platform?: NodeJS.Platform;
|
|
12
15
|
}
|
package/dist/k3s.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"k3s.d.ts","sourceRoot":"","sources":["../src/k3s.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAmB,MAAM,WAAW,CAAA;AAE5D,OAAO,EAAmB,KAAK,SAAS,
|
|
1
|
+
{"version":3,"file":"k3s.d.ts","sourceRoot":"","sources":["../src/k3s.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAmB,MAAM,WAAW,CAAA;AAE5D,OAAO,EAAmB,KAAK,SAAS,EAAqB,MAAM,iBAAiB,CAAA;AACpF,OAAO,EAAmB,KAAK,EAAE,EAAE,MAAM,SAAS,CAAA;AAClD,OAAO,EAML,KAAK,QAAQ,EACd,MAAM,kBAAkB,CAAA;AACzB,OAAO,EACL,KAAK,SAAS,EAEd,KAAK,OAAO,EAGb,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAML,KAAK,kBAAkB,EAExB,MAAM,oBAAoB,CAAA;AAE3B,gGAAgG;AAChG,MAAM,WAAW,OAAO;IACtB,EAAE,CAAC,EAAE,EAAE,CAAA;IACP,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,6DAA6D;IAC7D,GAAG,CAAC,EAAE,QAAQ,CAAA;IACd,qFAAqF;IACrF,QAAQ,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAA;CAC3B;AAED,qFAAqF;AACrF,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,SAAS,CAAA;IAChB,MAAM,EAAE,OAAO,CAAA;IACf,gGAAgG;IAChG,UAAU,CAAC,EAAE,kBAAkB,CAAA;CAChC;AAED,wFAAwF;AACxF,eAAO,MAAM,mBAAmB,wCAAwC,CAAA;AAExE;;;;;;;;GAQG;AACH,wBAAsB,QAAQ,CAAC,OAAO,EAAE,UAAU,EAAE,IAAI,GAAE,OAAY,GAAG,OAAO,CAAC,SAAS,CAAC,CAuC1F"}
|
package/dist/k3s.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { OPTION_DEFAULTS } from './args.js';
|
|
2
|
-
import {
|
|
3
|
-
import { createNodeShell } from './host-shell.js';
|
|
2
|
+
import { buildK3sSetupUrl } from './k3s-handler.js';
|
|
3
|
+
import { createNodeShell, renderCommandLine } from './host-shell.js';
|
|
4
4
|
import { createConsoleIo } from './io.js';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { createNodeTcpProbe, ingressHostTemplate, ingressRemedies, ingressUrlPort, } from './k3s-ingress.js';
|
|
6
|
+
import { probeHost, recreateOfferFor, } from './k3s-probe.js';
|
|
7
|
+
import { CAT_FACTORY_NAMESPACE, clusterCreateCommand, provisionCluster, ProvisionError, resolveIngressPort, SERVICE_ACCOUNT_NAME, } from './k3s-provision.js';
|
|
7
8
|
/** The one-liner k3s install command (needs sudo — printed, never run for the user). */
|
|
8
9
|
export const K3S_INSTALL_COMMAND = 'curl -sfL https://get.k3s.io | sh -';
|
|
9
10
|
/**
|
|
@@ -18,24 +19,26 @@ export const K3S_INSTALL_COMMAND = 'curl -sfL https://get.k3s.io | sh -';
|
|
|
18
19
|
export async function setupK3s(options, deps = {}) {
|
|
19
20
|
const io = deps.io ?? createConsoleIo();
|
|
20
21
|
const shell = deps.shell ?? createNodeShell();
|
|
22
|
+
const tcp = deps.tcp ?? createNodeTcpProbe();
|
|
21
23
|
const platform = deps.platform ?? process.platform;
|
|
22
24
|
const preferred = options.k3sRuntime ?? OPTION_DEFAULTS.k3sRuntime;
|
|
25
|
+
const clusterName = options.clusterName ?? OPTION_DEFAULTS.k3sClusterName;
|
|
23
26
|
io.info('\ncat-factory — guided local k3s / k3d setup\n');
|
|
24
27
|
io.info('Probing your machine for a usable Kubernetes cluster…');
|
|
25
|
-
const state = await probeHost(shell, preferred, platform);
|
|
28
|
+
const state = await probeHost(shell, preferred, platform, clusterName);
|
|
26
29
|
io.info(renderReport(state));
|
|
27
30
|
const chosen = await chooseOffer(state, options, io);
|
|
28
|
-
// The k3s install needs sudo
|
|
31
|
+
// The k3s install needs sudo, so we only ever print the command, never provision for the user.
|
|
29
32
|
if (chosen === 'install-k3s') {
|
|
30
|
-
printInstallGuidance(state, io, platform);
|
|
33
|
+
printInstallGuidance(state, io, platform, clusterName, resolveIngressPort(options));
|
|
31
34
|
return { state, chosen };
|
|
32
35
|
}
|
|
33
36
|
let connection;
|
|
34
37
|
try {
|
|
35
|
-
connection = await provisionCluster(chosen, state, options, { io, shell });
|
|
38
|
+
connection = await provisionCluster(chosen, state, options, { io, shell, tcp });
|
|
36
39
|
}
|
|
37
40
|
catch (err) {
|
|
38
|
-
// A declined confirm or a failed command is an expected, non-fatal outcome
|
|
41
|
+
// A declined confirm or a failed command is an expected, non-fatal outcome: report and stop.
|
|
39
42
|
if (err instanceof ProvisionError) {
|
|
40
43
|
io.warn(err.message);
|
|
41
44
|
return { state, chosen };
|
|
@@ -51,15 +54,15 @@ export async function setupK3s(options, deps = {}) {
|
|
|
51
54
|
* Guide the SECOND half of a working Kubernetes test environment: the DEPLOY RUNNER. The connection
|
|
52
55
|
* we just provisioned only says WHERE to deploy (the apiserver + namespace); a test environment
|
|
53
56
|
* ALSO needs a runner to actually render + apply its manifests, or standing one up fails with "no
|
|
54
|
-
* deploy runner wired". That runner is a local-backend env var, NOT part of the cluster connection
|
|
57
|
+
* deploy runner wired". That runner is a local-backend env var, NOT part of the cluster connection,
|
|
55
58
|
* so a user who wires only the connection hits the failure mid-run. Surface it here, now that it is
|
|
56
59
|
* a one-liner: `LOCAL_DEPLOY_RUNTIME=container` works out of the box (the deploy-harness image is
|
|
57
|
-
* resolved automatically to the version the backend supports
|
|
60
|
+
* resolved automatically to the version the backend supports, with no image ref to hunt down).
|
|
58
61
|
*/
|
|
59
62
|
function printDeployRunnerGuidance(io) {
|
|
60
63
|
io.info([
|
|
61
64
|
'',
|
|
62
|
-
'One more step
|
|
65
|
+
'One more step, the DEPLOY RUNNER. The cluster connection above says WHERE to deploy; a test',
|
|
63
66
|
'environment also needs a runner to render + apply its manifests (kubectl/kustomize/helm), or',
|
|
64
67
|
'standing it up fails with "no deploy runner wired". Enable it in your local backend .env:',
|
|
65
68
|
'',
|
|
@@ -78,10 +81,13 @@ function printDeployRunnerGuidance(io) {
|
|
|
78
81
|
*/
|
|
79
82
|
async function handOff(connection, options, io) {
|
|
80
83
|
const spaUrl = options.appUrl ?? OPTION_DEFAULTS.appUrl;
|
|
81
|
-
const
|
|
84
|
+
const verified = connection.ingress.status === 'ready';
|
|
85
|
+
const link = buildK3sSetupUrl(spaUrl, connection);
|
|
82
86
|
io.info([
|
|
83
87
|
'',
|
|
84
|
-
|
|
88
|
+
verified
|
|
89
|
+
? 'Open the pre-filled Local k3s connect form (everything except the token is filled in):'
|
|
90
|
+
: 'Open the pre-filled Local k3s connect form (the environment URL is left for you to pick, see above):',
|
|
85
91
|
'',
|
|
86
92
|
` ${link}`,
|
|
87
93
|
].join('\n'));
|
|
@@ -116,8 +122,35 @@ function renderReport(state) {
|
|
|
116
122
|
lines.push(` • existing kind clusters: ${d.kindClusters.join(', ')}`);
|
|
117
123
|
return lines.join('\n');
|
|
118
124
|
}
|
|
119
|
-
/**
|
|
125
|
+
/**
|
|
126
|
+
* Pick an offer: `--recreate` names one outright, `--yes` takes the recommendation, otherwise
|
|
127
|
+
* prompt over the available offers.
|
|
128
|
+
*
|
|
129
|
+
* `--recreate` is resolved FIRST and never falls back. A destructive request that cannot be
|
|
130
|
+
* honoured must refuse with the reason rather than quietly doing the nearest safe thing: an
|
|
131
|
+
* operator who asked for a fresh cluster and got the old one reused would carry on believing the
|
|
132
|
+
* flags they passed had taken effect. The refusal escapes to `bin.ts` (a non-zero exit) rather
|
|
133
|
+
* than joining the warn-and-carry-on path a DECLINED confirm takes, because those are opposite
|
|
134
|
+
* facts: one is the operator changing their mind, this one is the command unable to obey.
|
|
135
|
+
*
|
|
136
|
+
* The target is resolved through `recreateOfferFor`, which answers `null` for a runtime that HAS no
|
|
137
|
+
* recreate. `--runtime` has three members and only two of them name a cluster this CLI can rebuild,
|
|
138
|
+
* so a two-way ternary silently folded `--runtime k3s` into the k3d branch and destroyed a k3d
|
|
139
|
+
* cluster the operator never named.
|
|
140
|
+
*/
|
|
120
141
|
async function chooseOffer(state, options, io) {
|
|
142
|
+
if (options.recreate) {
|
|
143
|
+
const runtime = options.k3sRuntime ?? OPTION_DEFAULTS.k3sRuntime;
|
|
144
|
+
const id = recreateOfferFor(runtime);
|
|
145
|
+
if (id === null) {
|
|
146
|
+
throw new ProvisionError(`Cannot recreate a "${runtime}" cluster: --recreate deletes and rebuilds a k3d or kind cluster, and k3s is a host service this command never installs or removes. Re-run with --runtime k3d or --runtime kind to target one of those.`);
|
|
147
|
+
}
|
|
148
|
+
const offer = state.offers.find((o) => o.id === id);
|
|
149
|
+
if (!offer?.available) {
|
|
150
|
+
throw new ProvisionError(`Cannot recreate: ${offer?.reason ?? 'no such cluster'}. --recreate only ever targets a k3d/kind cluster this command can name and build again.`);
|
|
151
|
+
}
|
|
152
|
+
return id;
|
|
153
|
+
}
|
|
121
154
|
const available = state.offers.filter((o) => o.available);
|
|
122
155
|
// `install-k3s` is always available, so `available` is never empty.
|
|
123
156
|
if (options.yes || available.length === 1)
|
|
@@ -137,9 +170,14 @@ function offerLabel(o) {
|
|
|
137
170
|
* Print the k3s install guidance. cat-factory never provisions k3s for the user, so this only ever
|
|
138
171
|
* PRINTS instructions. The copy is platform-aware: k3s is Linux-only, so on Windows/macOS it steers
|
|
139
172
|
* to the k3d (k3s-in-Docker) path rather than a `curl | sh` install that can't run there.
|
|
173
|
+
*
|
|
174
|
+
* The k3d recipe is RENDERED from the same planner the create path runs, never written out here.
|
|
175
|
+
* Hand-written, it had lost the `-p` publish flag, so the one create this CLI hands to a human built
|
|
176
|
+
* exactly the cluster whose missing host port the next run then asked them to recreate. A published
|
|
177
|
+
* host port is create-time-only, which is what makes that omission unrecoverable rather than untidy.
|
|
140
178
|
*/
|
|
141
|
-
function printInstallGuidance(state, io, platform) {
|
|
142
|
-
// Don't tell a user who already has k3s to re-install it
|
|
179
|
+
function printInstallGuidance(state, io, platform, clusterName, ingressPort) {
|
|
180
|
+
// Don't tell a user who already has k3s to re-install it: point them at starting the service.
|
|
143
181
|
if (state.detections.k3s.installed) {
|
|
144
182
|
io.info([
|
|
145
183
|
'',
|
|
@@ -147,7 +185,7 @@ function printInstallGuidance(state, io, platform) {
|
|
|
147
185
|
'',
|
|
148
186
|
' sudo systemctl start k3s # or: sudo k3s server',
|
|
149
187
|
'',
|
|
150
|
-
'Then re-run `cat-factory k3s
|
|
188
|
+
'Then re-run `cat-factory k3s`: it will detect the running cluster and provision the handler.',
|
|
151
189
|
].join('\n'));
|
|
152
190
|
return;
|
|
153
191
|
}
|
|
@@ -165,21 +203,109 @@ function printInstallGuidance(state, io, platform) {
|
|
|
165
203
|
'',
|
|
166
204
|
` ${install}`,
|
|
167
205
|
'',
|
|
168
|
-
'
|
|
206
|
+
` ${renderCommandLine(clusterCreateCommand('k3d', clusterName, ingressPort))}`,
|
|
207
|
+
'',
|
|
208
|
+
`The \`-p\` publishes host port ${ingressPort} into the cluster's ingress controller. It can only be`,
|
|
209
|
+
'set when the cluster is created, so a cluster built without it can never serve an',
|
|
210
|
+
'ingress-derived environment URL without being created again.',
|
|
169
211
|
'',
|
|
170
|
-
'Then re-run `cat-factory k3s
|
|
212
|
+
'Then re-run `cat-factory k3s`: it will detect the new k3d cluster and provision the handler.',
|
|
171
213
|
].join('\n'));
|
|
172
214
|
return;
|
|
173
215
|
}
|
|
174
216
|
io.info([
|
|
175
217
|
'',
|
|
176
|
-
'Install k3s (single-node)
|
|
218
|
+
'Install k3s (single-node). Run this yourself (needs sudo):',
|
|
177
219
|
'',
|
|
178
220
|
` ${K3S_INSTALL_COMMAND}`,
|
|
179
221
|
'',
|
|
180
|
-
'Then re-run `cat-factory k3s
|
|
222
|
+
'Then re-run `cat-factory k3s`: it will detect the new cluster and provision the handler.',
|
|
181
223
|
].join('\n'));
|
|
182
224
|
}
|
|
225
|
+
/**
|
|
226
|
+
* The environment-URL half of the summary, rendered from the PROBE rather than from a fixed
|
|
227
|
+
* script. This is the line the whole change turns on: it used to state "Ingress host template" +
|
|
228
|
+
* `{{branch}}.127.0.0.1.nip.io` unconditionally, including on a reused cluster the command had
|
|
229
|
+
* never looked at, and an operator who typed it got an environment whose URL answered nothing.
|
|
230
|
+
*
|
|
231
|
+
* Three outcomes, three different things to say, per the degrade-loudly rule: verified working,
|
|
232
|
+
* verified missing (with the fix), and could-not-tell (which is NOT the same as missing, and must
|
|
233
|
+
* not send someone to rebuild a cluster that was fine).
|
|
234
|
+
*
|
|
235
|
+
* The template itself comes from `ingressHostTemplate`, the same function the handler and deep link
|
|
236
|
+
* read. Re-deriving it here (with its own hard-coded default port) is how the printed line and the
|
|
237
|
+
* link it sits above could disagree about the very value the operator is told to type.
|
|
238
|
+
*/
|
|
239
|
+
function renderUrlSourceLines(connection) {
|
|
240
|
+
const { ingress } = connection;
|
|
241
|
+
if (ingress.status === 'ready') {
|
|
242
|
+
const port = ingressUrlPort(ingress);
|
|
243
|
+
return [
|
|
244
|
+
` • Environment URL source: Ingress host template`,
|
|
245
|
+
` • Host template: ${ingressHostTemplate(ingress)}`,
|
|
246
|
+
...(port === null ? [] : [` • Ingress port: ${port}`]),
|
|
247
|
+
` • URL scheme: http`,
|
|
248
|
+
'',
|
|
249
|
+
...verifiedLines(ingress),
|
|
250
|
+
];
|
|
251
|
+
}
|
|
252
|
+
const headline = ingress.status === 'missing'
|
|
253
|
+
? ` This cluster CANNOT serve an ingress-derived environment URL (${describeGaps(ingress)}).`
|
|
254
|
+
: ` Could NOT establish whether this cluster serves an ingress-derived environment URL: ${ingress.probeFailure}.`;
|
|
255
|
+
return [
|
|
256
|
+
` • Environment URL source: leave this for now, see below`,
|
|
257
|
+
'',
|
|
258
|
+
headline,
|
|
259
|
+
' So the connect form is NOT pre-filled with an ingress host template: entering one would',
|
|
260
|
+
' give every test environment a URL that resolves to nothing, and the failure would surface',
|
|
261
|
+
' much later, at the tester step, long after provisioning reported success.',
|
|
262
|
+
...ingressRemedies(ingress, remedyContext(connection)).map((line) => line.startsWith(' ') ? ` ${line}` : ` - ${line}`),
|
|
263
|
+
];
|
|
264
|
+
}
|
|
265
|
+
/**
|
|
266
|
+
* What the probe established about a READY ingress, claimed no more strongly than it was checked.
|
|
267
|
+
*
|
|
268
|
+
* A TCP connect proves that something listens, not that the cluster's controller is what listens:
|
|
269
|
+
* an unrelated web server on the same host port answers identically. Where the container runtime
|
|
270
|
+
* confirmed the cluster publishes that port, the claim is whole; where it could not be asked, the
|
|
271
|
+
* residual is stated, because an operator who then gets a 404 from the wrong server has no other
|
|
272
|
+
* way to know that is even possible.
|
|
273
|
+
*/
|
|
274
|
+
function verifiedLines(ingress) {
|
|
275
|
+
if (ingress.attribution === 'cluster') {
|
|
276
|
+
return [
|
|
277
|
+
` Verified: the cluster runs the "${ingress.controller}" ingress controller and publishes host port ${ingress.port} into it.`,
|
|
278
|
+
];
|
|
279
|
+
}
|
|
280
|
+
return [
|
|
281
|
+
` Verified: the cluster runs the "${ingress.controller}" ingress controller, and host port ${ingress.port} answers.`,
|
|
282
|
+
` Not checked: whether the process answering on ${ingress.port} IS this cluster (that read needs a`,
|
|
283
|
+
' container runtime this could ask). If an environment URL 404s, check what else is bound there.',
|
|
284
|
+
];
|
|
285
|
+
}
|
|
286
|
+
/** The remedy context: the distribution for wording, plus a recreate command that would WORK. */
|
|
287
|
+
function remedyContext(connection) {
|
|
288
|
+
const target = connection.recreateTarget;
|
|
289
|
+
return {
|
|
290
|
+
...((connection.runtime ?? target?.runtime)
|
|
291
|
+
? { runtime: connection.runtime ?? target?.runtime }
|
|
292
|
+
: {}),
|
|
293
|
+
...(target
|
|
294
|
+
? {
|
|
295
|
+
recreateCommand: `cat-factory k3s --recreate --runtime ${target.runtime} --cluster-name ${target.clusterName} --ingress-port ${connection.ingress.port}`,
|
|
296
|
+
}
|
|
297
|
+
: {}),
|
|
298
|
+
};
|
|
299
|
+
}
|
|
300
|
+
/** Name the missing halves the way the fix splits: a controller and a published host port. */
|
|
301
|
+
function describeGaps(ingress) {
|
|
302
|
+
const parts = ingress.gaps.map((gap) => gap === 'controller'
|
|
303
|
+
? 'it runs no ingress controller'
|
|
304
|
+
: ingress.publishedOn !== undefined
|
|
305
|
+
? `it publishes its ingress controller on host port ${ingress.publishedOn}, not ${ingress.port}`
|
|
306
|
+
: `nothing on the host serves port ${ingress.port} for it`);
|
|
307
|
+
return parts.join('; ');
|
|
308
|
+
}
|
|
183
309
|
/**
|
|
184
310
|
* Print the resolved connection so the user can wire it into the Settings → Infrastructure →
|
|
185
311
|
* Local k3s form (Test → Save), as the fallback for anyone who does not follow the deep-link
|
|
@@ -205,8 +331,7 @@ function printConnectionSummary(connection, io) {
|
|
|
205
331
|
` • API server URL: ${connection.apiServerUrl}`,
|
|
206
332
|
` • Skip TLS verification: yes (local self-signed cert)`,
|
|
207
333
|
` • Namespace template: cf-env-{{pullNumber}}`,
|
|
208
|
-
|
|
209
|
-
` • Host template: {{branch}}.127.0.0.1.nip.io`,
|
|
334
|
+
...renderUrlSourceLines(connection),
|
|
210
335
|
'',
|
|
211
336
|
'Then paste this ServiceAccount token into the "ServiceAccount token" field and click Test → Save:',
|
|
212
337
|
'',
|
package/dist/k3s.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"k3s.js","sourceRoot":"","sources":["../src/k3s.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,eAAe,EAAE,MAAM,WAAW,C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AS,OAAO,CAAC,IAAI,EAAE;YAChG,CAAC,CAAC,mCAAmC,OAAO,CAAC,IAAI,SAAS,CAC/D,CAAA;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AACzB,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,SAAS,sBAAsB,CAAC,UAA8B,EAAE,EAAM;IACpE,EAAE,CAAC,IAAI,CACL;QACE,EAAE;QACF,UAAU,CAAC,WAAW;YACpB,CAAC,CAAC,YAAY,UAAU,CAAC,WAAW,uCAAuC;YAC3E,CAAC,CAAC,gDAAgD;QACpD,EAAE;QACF,oEAAoE;QACpE,gCAAgC,UAAU,CAAC,YAAY,EAAE;QACzD,2DAA2D;QAC3D,oDAAoD;QACpD,GAAG,oBAAoB,CAAC,UAAU,CAAC;QACnC,EAAE;QACF,mGAAmG;QACnG,EAAE;QACF,KAAK,UAAU,CAAC,QAAQ,EAAE;QAC1B,EAAE;QACF,2FAA2F;QAC3F,yEAAyE;QACzE,EAAE;QACF,uCAAuC,qBAAqB,IAAI,oBAAoB,kBAAkB;QACtG,uFAAuF;QACvF,8DAA8D;QAC9D,EAAE;QACF,0BAA0B,oBAAoB,OAAO,qBAAqB,kBAAkB;QAC5F,EAAE;QACF,iEAAiE;KAClE,CAAC,IAAI,CAAC,IAAI,CAAC,CACb,CAAA;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cat-factory/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.0",
|
|
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.
|
|
45
|
-
"@cat-factory/kernel": "0.286.
|
|
44
|
+
"@cat-factory/contracts": "0.295.0",
|
|
45
|
+
"@cat-factory/kernel": "0.286.3"
|
|
46
46
|
},
|
|
47
47
|
"scripts": {
|
|
48
48
|
"build": "tsc -b tsconfig.build.json",
|