@kodycodes/cli 3.47.0 → 3.48.1
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 +23 -0
- package/dist/app-check/browser-tools.d.ts +72 -0
- package/dist/app-check/report.d.ts +109 -0
- package/dist/app-check/run-app-check.d.ts +25 -0
- package/dist/bin.js +1 -1
- package/dist/cached-npm-install.d.ts +30 -0
- package/dist/{chunk-XGYBIVUK.js → chunk-3DKGYN4Q.js} +2 -2
- package/dist/{chunk-2NSRT4L5.js → chunk-47DJTN4E.js} +2 -2
- package/dist/{chunk-F5GC4QLC.js → chunk-47RGMUXL.js} +84 -15
- package/dist/chunk-47RGMUXL.js.map +6 -0
- package/dist/{chunk-VEFYSWT4.js → chunk-B5WXOPD6.js} +8 -2
- package/dist/{chunk-VEFYSWT4.js.map → chunk-B5WXOPD6.js.map} +1 -1
- package/dist/{chunk-M5L4EUF2.js → chunk-DT3SAUMT.js} +2 -2
- package/dist/chunk-GKW646CF.js +170 -0
- package/dist/chunk-GKW646CF.js.map +6 -0
- package/dist/{chunk-WRCYQJ57.js → chunk-L4ORHUZF.js} +16 -146
- package/dist/chunk-L4ORHUZF.js.map +6 -0
- package/dist/{chunk-S3MKSHYO.js → chunk-LDCAJZWH.js} +5 -3
- package/dist/chunk-LDCAJZWH.js.map +6 -0
- package/dist/cli.d.ts +2 -1
- package/dist/cli.js +1 -1
- package/dist/{commands-PEKGP2T7.js → commands-SSJJEDFD.js} +2 -2
- package/dist/{dev-command-CO2LJ5H6.js → dev-command-RWMILJXZ.js} +7 -6
- package/dist/dev-command-RWMILJXZ.js.map +6 -0
- package/dist/{execute-local-package-LBUVTXNQ.js → execute-local-package-TPS5PA5Y.js} +5 -4
- package/dist/execute-local-package-TPS5PA5Y.js.map +6 -0
- package/dist/{local-execute-WU2VVDEQ.js → local-execute-XG2GEGTQ.js} +3 -2
- package/dist/local-execute-XG2GEGTQ.js.map +6 -0
- package/dist/{local-kody-JHFC4YKZ.js → local-kody-EQCQHPKF.js} +4 -3
- package/dist/{local-package-run-JYHWVV77.js → local-package-run-JREJCWDW.js} +4 -3
- package/dist/{local-publish-build-UNITM4LN.js → local-publish-build-U2PR24QC.js} +2 -2
- package/dist/mock/ensure-msw.d.ts +0 -6
- package/dist/{mock-fetch-gateway-3QFVMR6R.js → mock-fetch-gateway-N5IKHGZM.js} +3 -2
- package/dist/{mock-server-TZLF3XME.js → mock-server-S5C3IINS.js} +4 -3
- package/dist/publish-builder.js +7 -4
- package/dist/{publish-offload-BVDWUYEF.js → publish-offload-SUF6QAL3.js} +2 -2
- package/dist/run-app-check-QDQQY4LU.js +800 -0
- package/dist/run-app-check-QDQQY4LU.js.map +6 -0
- package/dist/{run-executor-H7WSZMLV.js → run-executor-2VCOIORN.js} +3 -3
- package/package.json +1 -1
- package/dist/chunk-F5GC4QLC.js.map +0 -6
- package/dist/chunk-S3MKSHYO.js.map +0 -6
- package/dist/chunk-WRCYQJ57.js.map +0 -6
- package/dist/dev-command-CO2LJ5H6.js.map +0 -6
- package/dist/execute-local-package-LBUVTXNQ.js.map +0 -6
- package/dist/local-execute-WU2VVDEQ.js.map +0 -6
- /package/dist/{chunk-XGYBIVUK.js.map → chunk-3DKGYN4Q.js.map} +0 -0
- /package/dist/{chunk-2NSRT4L5.js.map → chunk-47DJTN4E.js.map} +0 -0
- /package/dist/{chunk-M5L4EUF2.js.map → chunk-DT3SAUMT.js.map} +0 -0
- /package/dist/{commands-PEKGP2T7.js.map → commands-SSJJEDFD.js.map} +0 -0
- /package/dist/{local-kody-JHFC4YKZ.js.map → local-kody-EQCQHPKF.js.map} +0 -0
- /package/dist/{local-package-run-JYHWVV77.js.map → local-package-run-JREJCWDW.js.map} +0 -0
- /package/dist/{local-publish-build-UNITM4LN.js.map → local-publish-build-U2PR24QC.js.map} +0 -0
- /package/dist/{mock-fetch-gateway-3QFVMR6R.js.map → mock-fetch-gateway-N5IKHGZM.js.map} +0 -0
- /package/dist/{mock-server-TZLF3XME.js.map → mock-server-S5C3IINS.js.map} +0 -0
- /package/dist/{publish-offload-BVDWUYEF.js.map → publish-offload-SUF6QAL3.js.map} +0 -0
- /package/dist/{run-executor-H7WSZMLV.js.map → run-executor-2VCOIORN.js.map} +0 -0
package/README.md
CHANGED
|
@@ -299,6 +299,7 @@ kody dev emit demo.event --body ./event.json # subscription delivery shape
|
|
|
299
299
|
kody dev check # local bundles + snapshot membership + publish checks (needs login)
|
|
300
300
|
kody dev check --offline # local bundles + snapshot membership only; publish can still refuse
|
|
301
301
|
kody dev check --debug # also print the publish checks call: HTTP status, error code, request id
|
|
302
|
+
kody app check # screenshots, accessibility, Lighthouse, console errors -> .kody/app-check/
|
|
302
303
|
|
|
303
304
|
# Four surfaces against mock then prod:
|
|
304
305
|
kody execute --target mock --invoke ./greet --params '{"name":"kent"}'
|
|
@@ -308,6 +309,28 @@ kody execute --local --invoke kody:@scope/pkg/export --params '{}'
|
|
|
308
309
|
kody search --target mock local
|
|
309
310
|
```
|
|
310
311
|
|
|
312
|
+
### Checking app quality (`kody app check`)
|
|
313
|
+
|
|
314
|
+
Run `kody app check` during development and fix what it shows. It starts the
|
|
315
|
+
`kody dev` preview for the package in the current directory (or the directory
|
|
316
|
+
you pass), then writes `app-check.md` (a short summary), `app-check.json` (full
|
|
317
|
+
results), and desktop and mobile screenshots in light and dark to
|
|
318
|
+
`<package>/.kody/app-check/`:
|
|
319
|
+
|
|
320
|
+
```bash
|
|
321
|
+
kody app check # this package; default --target mock
|
|
322
|
+
kody app check ./my-package --out ./reports/app-check
|
|
323
|
+
kody app check --json # one JSON line: result, summary, report paths
|
|
324
|
+
```
|
|
325
|
+
|
|
326
|
+
The report covers accessibility violations (axe-core), Lighthouse scores, and
|
|
327
|
+
console errors from the browser and the dev server. Pass or fail is in the
|
|
328
|
+
report; the command exits non-zero only when the preview or the browser cannot
|
|
329
|
+
start. The first run installs Playwright, axe-core, Lighthouse, and the
|
|
330
|
+
Playwright Chromium browser into the Kody cache (`KODY_CACHE_DIR`) and reuses
|
|
331
|
+
them after that, so nothing extra ships with the CLI. See
|
|
332
|
+
[Check app quality](https://kody.codes/docs/package-apps#check-app-quality-with-kody-app-check).
|
|
333
|
+
|
|
311
334
|
### Testing from other devices (`--host`)
|
|
312
335
|
|
|
313
336
|
`kody dev serve` listens on `127.0.0.1` by default. `--host` applies to serve
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The browser stack `kody app check` needs, installed into the Kody user cache
|
|
3
|
+
* the first time the check runs and reused after that (the same on-demand
|
|
4
|
+
* pattern as MSW for `--target mock`). Playwright drives the pages, axe-core
|
|
5
|
+
* finds accessibility violations, and Lighthouse scores the page. None of them
|
|
6
|
+
* are CLI install-time dependencies, and the types below are structural so the
|
|
7
|
+
* published bundle never imports them.
|
|
8
|
+
*/
|
|
9
|
+
export type PlaywrightPage = {
|
|
10
|
+
goto: (url: string, options: {
|
|
11
|
+
waitUntil: 'load';
|
|
12
|
+
timeout: number;
|
|
13
|
+
}) => Promise<{
|
|
14
|
+
status: () => number;
|
|
15
|
+
} | null>;
|
|
16
|
+
waitForLoadState: (state: 'networkidle', options: {
|
|
17
|
+
timeout: number;
|
|
18
|
+
}) => Promise<void>;
|
|
19
|
+
screenshot: (options: {
|
|
20
|
+
path: string;
|
|
21
|
+
fullPage: boolean;
|
|
22
|
+
}) => Promise<unknown>;
|
|
23
|
+
addScriptTag: (options: {
|
|
24
|
+
content: string;
|
|
25
|
+
}) => Promise<unknown>;
|
|
26
|
+
evaluate: <T>(fn: () => Promise<T>) => Promise<T>;
|
|
27
|
+
on: (event: string, listener: (value: never) => void) => void;
|
|
28
|
+
};
|
|
29
|
+
type PlaywrightContext = {
|
|
30
|
+
newPage: () => Promise<PlaywrightPage>;
|
|
31
|
+
close: () => Promise<void>;
|
|
32
|
+
};
|
|
33
|
+
export type PlaywrightBrowser = {
|
|
34
|
+
newContext: (options: Record<string, unknown>) => Promise<PlaywrightContext>;
|
|
35
|
+
close: () => Promise<void>;
|
|
36
|
+
};
|
|
37
|
+
export type AppCheckTools = {
|
|
38
|
+
chromium: {
|
|
39
|
+
launch: (options: Record<string, unknown>) => Promise<PlaywrightBrowser>;
|
|
40
|
+
executablePath: () => string;
|
|
41
|
+
};
|
|
42
|
+
/** axe-core's browser source, injected into each page. */
|
|
43
|
+
axeSource: string;
|
|
44
|
+
lighthouse: (url: string, flags: Record<string, unknown>) => Promise<{
|
|
45
|
+
lhr: LighthouseResult;
|
|
46
|
+
} | undefined>;
|
|
47
|
+
launchChrome: (options: {
|
|
48
|
+
chromePath: string;
|
|
49
|
+
chromeFlags: Array<string>;
|
|
50
|
+
}) => Promise<{
|
|
51
|
+
port: number;
|
|
52
|
+
kill: () => void | Promise<void>;
|
|
53
|
+
}>;
|
|
54
|
+
};
|
|
55
|
+
type LighthouseResult = {
|
|
56
|
+
categories: Record<string, {
|
|
57
|
+
score: number | null;
|
|
58
|
+
} | undefined>;
|
|
59
|
+
runtimeError?: {
|
|
60
|
+
code?: string;
|
|
61
|
+
message?: string;
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
/**
|
|
65
|
+
* Install the pinned packages and the Playwright Chromium build (first run
|
|
66
|
+
* only), then import them from the cache.
|
|
67
|
+
*/
|
|
68
|
+
export declare function loadAppCheckTools(input: {
|
|
69
|
+
env?: NodeJS.ProcessEnv;
|
|
70
|
+
onStatus: (message: string) => void;
|
|
71
|
+
}): Promise<AppCheckTools>;
|
|
72
|
+
export {};
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `kody app check` report: a short `app-check.md` for an agent's context
|
|
3
|
+
* window and an uncapped `app-check.json` sidecar for programmatic use. The
|
|
4
|
+
* result is pass or fail in the report; the command still exits 0 for it.
|
|
5
|
+
*/
|
|
6
|
+
export type AppCheckViewport = 'desktop' | 'mobile';
|
|
7
|
+
export type AppCheckColorScheme = 'light' | 'dark';
|
|
8
|
+
export type AxeImpact = 'critical' | 'serious' | 'moderate' | 'minor';
|
|
9
|
+
export type AppCheckScreenshot = {
|
|
10
|
+
viewport: AppCheckViewport;
|
|
11
|
+
colorScheme: AppCheckColorScheme;
|
|
12
|
+
path: string;
|
|
13
|
+
status: number | null;
|
|
14
|
+
};
|
|
15
|
+
type AxeNode = {
|
|
16
|
+
target: Array<string>;
|
|
17
|
+
html: string;
|
|
18
|
+
failureSummary: string;
|
|
19
|
+
};
|
|
20
|
+
/** One axe rule result from one rendered variant. */
|
|
21
|
+
export type AxeViolation = {
|
|
22
|
+
id: string;
|
|
23
|
+
impact: AxeImpact | null;
|
|
24
|
+
help: string;
|
|
25
|
+
helpUrl: string;
|
|
26
|
+
description: string;
|
|
27
|
+
nodes: Array<AxeNode>;
|
|
28
|
+
};
|
|
29
|
+
export type AppCheckVariantAxe = {
|
|
30
|
+
viewport: AppCheckViewport;
|
|
31
|
+
colorScheme: AppCheckColorScheme;
|
|
32
|
+
violations: Array<AxeViolation>;
|
|
33
|
+
error?: string;
|
|
34
|
+
};
|
|
35
|
+
/** A rule merged across the four variants it was checked in. */
|
|
36
|
+
type AppCheckAccessibilityRule = {
|
|
37
|
+
id: string;
|
|
38
|
+
impact: AxeImpact;
|
|
39
|
+
help: string;
|
|
40
|
+
helpUrl: string;
|
|
41
|
+
selectors: Array<string>;
|
|
42
|
+
variants: Array<`${AppCheckViewport}-${AppCheckColorScheme}`>;
|
|
43
|
+
};
|
|
44
|
+
export type LighthouseCategory = 'performance' | 'accessibility' | 'best-practices' | 'seo';
|
|
45
|
+
export declare const lighthouseCategories: ReadonlyArray<LighthouseCategory>;
|
|
46
|
+
export type AppCheckLighthouse = {
|
|
47
|
+
scores: Record<LighthouseCategory, number | null>;
|
|
48
|
+
error?: string;
|
|
49
|
+
};
|
|
50
|
+
type AppCheckConsoleSource = 'browser' | 'page' | 'server';
|
|
51
|
+
export type AppCheckConsoleEntry = {
|
|
52
|
+
source: AppCheckConsoleSource;
|
|
53
|
+
message: string;
|
|
54
|
+
viewport?: AppCheckViewport;
|
|
55
|
+
colorScheme?: AppCheckColorScheme;
|
|
56
|
+
url?: string;
|
|
57
|
+
};
|
|
58
|
+
type AppCheckConsoleError = {
|
|
59
|
+
message: string;
|
|
60
|
+
sources: Array<AppCheckConsoleSource>;
|
|
61
|
+
count: number;
|
|
62
|
+
};
|
|
63
|
+
type AppCheckIssue = {
|
|
64
|
+
kind: 'page_status' | 'console' | 'accessibility' | 'lighthouse';
|
|
65
|
+
message: string;
|
|
66
|
+
};
|
|
67
|
+
export type AppCheckReport = {
|
|
68
|
+
version: 1;
|
|
69
|
+
result: 'pass' | 'fail';
|
|
70
|
+
summary: string;
|
|
71
|
+
package: {
|
|
72
|
+
name: string;
|
|
73
|
+
root: string;
|
|
74
|
+
};
|
|
75
|
+
url: string;
|
|
76
|
+
target: string;
|
|
77
|
+
checkedAt: string;
|
|
78
|
+
outputDir: string;
|
|
79
|
+
issues: Array<AppCheckIssue>;
|
|
80
|
+
screenshots: Array<AppCheckScreenshot>;
|
|
81
|
+
accessibility: {
|
|
82
|
+
rules: Array<AppCheckAccessibilityRule>;
|
|
83
|
+
variants: Array<AppCheckVariantAxe>;
|
|
84
|
+
};
|
|
85
|
+
lighthouse: AppCheckLighthouse & {
|
|
86
|
+
thresholds: Record<LighthouseCategory, number>;
|
|
87
|
+
};
|
|
88
|
+
console: {
|
|
89
|
+
errors: Array<AppCheckConsoleError>;
|
|
90
|
+
entries: Array<AppCheckConsoleEntry>;
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
export declare function buildAppCheckReport(input: {
|
|
94
|
+
package: {
|
|
95
|
+
name: string;
|
|
96
|
+
root: string;
|
|
97
|
+
};
|
|
98
|
+
url: string;
|
|
99
|
+
target: string;
|
|
100
|
+
checkedAt: string;
|
|
101
|
+
outputDir: string;
|
|
102
|
+
screenshots: Array<AppCheckScreenshot>;
|
|
103
|
+
axe: Array<AppCheckVariantAxe>;
|
|
104
|
+
lighthouse: AppCheckLighthouse;
|
|
105
|
+
consoleEntries: Array<AppCheckConsoleEntry>;
|
|
106
|
+
}): AppCheckReport;
|
|
107
|
+
/** `app-check.md`: capped lists so it fits an agent's context window. */
|
|
108
|
+
export declare function formatAppCheckMarkdown(report: AppCheckReport): string;
|
|
109
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `kody app check`: start the package's `kody dev serve` preview, render it in
|
|
3
|
+
* a cached Playwright Chromium at desktop and mobile sizes in light and dark,
|
|
4
|
+
* run axe-core and Lighthouse against it, collect console errors from the
|
|
5
|
+
* browser and the dev server, and write `app-check.md` plus `app-check.json`.
|
|
6
|
+
*
|
|
7
|
+
* Quality findings are reported as pass or fail in those files. The command
|
|
8
|
+
* only fails for real problems: the preview or browser could not start.
|
|
9
|
+
*/
|
|
10
|
+
import type { KodyTarget } from '../target.js';
|
|
11
|
+
type AppCheckIo = {
|
|
12
|
+
stdout: (text: string) => void;
|
|
13
|
+
stderr: (text: string) => void;
|
|
14
|
+
};
|
|
15
|
+
export declare function runAppCheck(input: {
|
|
16
|
+
/** Package directory (defaults to the current directory). */
|
|
17
|
+
packageDir?: string;
|
|
18
|
+
outputDir?: string;
|
|
19
|
+
target: KodyTarget;
|
|
20
|
+
org?: string;
|
|
21
|
+
json?: boolean;
|
|
22
|
+
io: AppCheckIo;
|
|
23
|
+
env?: NodeJS.ProcessEnv;
|
|
24
|
+
}): Promise<number>;
|
|
25
|
+
export {};
|
package/dist/bin.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { createRequire as __createRequire } from 'node:module'; const require = __createRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
runCli
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-47RGMUXL.js";
|
|
6
6
|
import "./chunk-NKQRWYSY.js";
|
|
7
7
|
import "./chunk-E4R3Y6MM.js";
|
|
8
8
|
import "./chunk-KIC65VM5.js";
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Install pinned npm packages into the Kody user cache on demand, for tools
|
|
3
|
+
* the CLI only needs on some paths (MSW for `--target mock`, the browser
|
|
4
|
+
* stack for `kody app check`). Nothing is installed into the user project or
|
|
5
|
+
* the global prefix, and nothing becomes a CLI install-time dependency.
|
|
6
|
+
*/
|
|
7
|
+
/** True when every package in `names` has a `package.json` under `root`. */
|
|
8
|
+
export declare function cachedPackagesInstalled(root: string, names: ReadonlyArray<string>): boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Install `dependencies` into `root` (`root/node_modules/...`) unless they are
|
|
11
|
+
* already there. Installs into a sibling staging dir and renames it into
|
|
12
|
+
* place, so an interrupted install never leaves a half-filled cache.
|
|
13
|
+
* Throws a plain Error naming the reason; callers wrap it in their own fix.
|
|
14
|
+
*/
|
|
15
|
+
export declare function ensureCachedNpmPackages(input: {
|
|
16
|
+
root: string;
|
|
17
|
+
dependencies: Record<string, string>;
|
|
18
|
+
env: NodeJS.ProcessEnv;
|
|
19
|
+
timeoutMs?: number;
|
|
20
|
+
/** Called once when an install is about to start. */
|
|
21
|
+
onInstall?: () => void;
|
|
22
|
+
/** Replaces `npm install` into the staging directory. */
|
|
23
|
+
installInto?: (stagingDir: string) => Promise<void>;
|
|
24
|
+
}): Promise<void>;
|
|
25
|
+
/**
|
|
26
|
+
* Minimal env for the on-demand install: keep PATH/home/proxy/certs, drop user
|
|
27
|
+
* `npm_config_*` so verbose/json logging cannot flood or change behavior.
|
|
28
|
+
* Registry/cache overrides are re-applied when set (tests / offline mirrors).
|
|
29
|
+
*/
|
|
30
|
+
export declare function npmInstallEnv(env: NodeJS.ProcessEnv): NodeJS.ProcessEnv;
|
|
@@ -252,7 +252,7 @@ async function resolveLocalKodySession(input) {
|
|
|
252
252
|
input.onStatus?.(
|
|
253
253
|
"Starting one-shot local Kody with the package dev-state store."
|
|
254
254
|
);
|
|
255
|
-
const local = await import("./local-kody-
|
|
255
|
+
const local = await import("./local-kody-EQCQHPKF.js");
|
|
256
256
|
const kody = await local.startLocalKody({
|
|
257
257
|
manifest: input.manifest,
|
|
258
258
|
packageAppPort: defaultDevPort(input.manifest.kodyId),
|
|
@@ -299,4 +299,4 @@ export {
|
|
|
299
299
|
devCallUnavailable,
|
|
300
300
|
resolveLocalKodySession
|
|
301
301
|
};
|
|
302
|
-
//# sourceMappingURL=chunk-
|
|
302
|
+
//# sourceMappingURL=chunk-3DKGYN4Q.js.map
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
import {
|
|
9
9
|
resolveMockFetchGateway,
|
|
10
10
|
tryHandleMockGatewayFetchCall
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-L4ORHUZF.js";
|
|
12
12
|
import {
|
|
13
13
|
parseKodyPackageSpecifier,
|
|
14
14
|
tryLoadSelfManifest
|
|
@@ -1131,4 +1131,4 @@ export {
|
|
|
1131
1131
|
resolveLocalPackageBinding,
|
|
1132
1132
|
packageIdMatchesLocalPackage
|
|
1133
1133
|
};
|
|
1134
|
-
//# sourceMappingURL=chunk-
|
|
1134
|
+
//# sourceMappingURL=chunk-47DJTN4E.js.map
|
|
@@ -593,6 +593,33 @@ var commandHelpTree = [
|
|
|
593
593
|
}
|
|
594
594
|
]
|
|
595
595
|
},
|
|
596
|
+
{
|
|
597
|
+
name: "app",
|
|
598
|
+
summary: "Check a package app in a real browser",
|
|
599
|
+
usage: ["kody app <command> [flags]"],
|
|
600
|
+
subcommands: [
|
|
601
|
+
{
|
|
602
|
+
name: "check",
|
|
603
|
+
summary: "Screenshot the kody dev preview and report accessibility, Lighthouse, and console errors",
|
|
604
|
+
usage: [
|
|
605
|
+
"kody app check [<package-dir>] [--out <dir>] [--target prod|mock] [--org <slug>] [--json]"
|
|
606
|
+
],
|
|
607
|
+
notes: [
|
|
608
|
+
"Writes app-check.md and app-check.json to <package>/.kody/app-check/ (or --out). Pass or fail is in the report; the exit code is 0 unless the preview or browser cannot start.",
|
|
609
|
+
"The first run installs Playwright, axe-core, Lighthouse, and Chromium into the Kody cache and reuses them after that."
|
|
610
|
+
],
|
|
611
|
+
flags: [
|
|
612
|
+
[
|
|
613
|
+
"--out <dir>",
|
|
614
|
+
"Write the report and screenshots here (default <package>/.kody/app-check)"
|
|
615
|
+
],
|
|
616
|
+
devTargetFlag,
|
|
617
|
+
orgFlag,
|
|
618
|
+
jsonFlag
|
|
619
|
+
]
|
|
620
|
+
}
|
|
621
|
+
]
|
|
622
|
+
},
|
|
596
623
|
{
|
|
597
624
|
name: "install",
|
|
598
625
|
summary: "Add Kody as an MCP server to local agent clients",
|
|
@@ -1198,6 +1225,7 @@ Usage:
|
|
|
1198
1225
|
kody dev webhook <name> --body <file.json> [--target prod|mock] [--dry-run] [--json]
|
|
1199
1226
|
kody dev emit <event> --body <event.json> [--target prod|mock] [--dry-run] [--json]
|
|
1200
1227
|
kody dev check [--target prod|mock] [--build local] [--offline] [--debug] [--json]
|
|
1228
|
+
kody app check [<package-dir>] [--out <dir>] [--target prod|mock] [--org <slug>] [--json]
|
|
1201
1229
|
kody install [--mcp-url <url>] [--clients <ids>] [--yes] [--project] [--json]
|
|
1202
1230
|
kody skill install [--project]
|
|
1203
1231
|
|
|
@@ -1565,6 +1593,19 @@ ${orgBlock}
|
|
|
1565
1593
|
ready-to-paste MSW handler stub pointing at
|
|
1566
1594
|
\`.kody/mocks.ts\`. Share previews are out of scope.
|
|
1567
1595
|
|
|
1596
|
+
kody app check
|
|
1597
|
+
Optional quality check for a package app. Starts the
|
|
1598
|
+
\`kody dev\` preview, renders it in Chromium at desktop and
|
|
1599
|
+
mobile sizes in light and dark, and runs axe-core and
|
|
1600
|
+
Lighthouse. Writes \`app-check.md\` (short summary for agents)
|
|
1601
|
+
and \`app-check.json\` (full results) to
|
|
1602
|
+
\`<package>/.kody/app-check/\` (or \`--out <dir>\`). Pass or fail
|
|
1603
|
+
is in the report; the command exits non-zero only when the
|
|
1604
|
+
preview or browser cannot start. The first run installs
|
|
1605
|
+
Playwright, axe-core, Lighthouse, and Chromium into the Kody
|
|
1606
|
+
cache (\`KODY_CACHE_DIR\`) and reuses them after that. Run it
|
|
1607
|
+
during development and fix what it shows.
|
|
1608
|
+
|
|
1568
1609
|
Environment:
|
|
1569
1610
|
KODY_MCP_URL Override the default MCP URL (${defaultMcpUrl})
|
|
1570
1611
|
${orgEnvVar} Default org slug for org-scoped commands (overridden by --org)
|
|
@@ -1903,6 +1944,7 @@ var orgScopedCommands = /* @__PURE__ */ new Set([
|
|
|
1903
1944
|
"package",
|
|
1904
1945
|
"execute",
|
|
1905
1946
|
"dev",
|
|
1947
|
+
"app",
|
|
1906
1948
|
"auth"
|
|
1907
1949
|
]);
|
|
1908
1950
|
function commandUsesStoredActiveOrg(input) {
|
|
@@ -1935,6 +1977,7 @@ function commandUsesStoredActiveOrg(input) {
|
|
|
1935
1977
|
case "package":
|
|
1936
1978
|
case "execute":
|
|
1937
1979
|
case "dev":
|
|
1980
|
+
case "app":
|
|
1938
1981
|
case "auth":
|
|
1939
1982
|
case "secret":
|
|
1940
1983
|
case "run":
|
|
@@ -2019,6 +2062,7 @@ var cliFlagOptions = {
|
|
|
2019
2062
|
clock: { type: "string" },
|
|
2020
2063
|
"cpu-limit-ms": { type: "string" },
|
|
2021
2064
|
"ready-file": { type: "string" },
|
|
2065
|
+
out: { type: "string" },
|
|
2022
2066
|
"no-attach": { type: "boolean" },
|
|
2023
2067
|
method: { type: "string" },
|
|
2024
2068
|
body: { type: "string" },
|
|
@@ -2069,6 +2113,7 @@ function resolveCommand(argv) {
|
|
|
2069
2113
|
case "package":
|
|
2070
2114
|
case "execute":
|
|
2071
2115
|
case "dev":
|
|
2116
|
+
case "app":
|
|
2072
2117
|
case "install":
|
|
2073
2118
|
case "skill":
|
|
2074
2119
|
case "help":
|
|
@@ -2202,7 +2247,7 @@ async function dispatch(parsed, write, writeErr, stdoutIsTTY) {
|
|
|
2202
2247
|
const orgFlag2 = typeof parsed.values.org === "string" ? parsed.values.org : void 0;
|
|
2203
2248
|
if (orgFlag2 !== void 0 && !orgScopedCommands.has(parsed.command)) {
|
|
2204
2249
|
throw new Error(
|
|
2205
|
-
`\`--org\` is not used with \`kody ${parsed.command}\`. Use it with login, logout, whoami, search, api, package, execute, or auth.`
|
|
2250
|
+
`\`--org\` is not used with \`kody ${parsed.command}\`. Use it with login, logout, whoami, search, api, package, execute, dev, app, or auth.`
|
|
2206
2251
|
);
|
|
2207
2252
|
}
|
|
2208
2253
|
if (parsed.command === "version") {
|
|
@@ -2240,7 +2285,7 @@ async function dispatch(parsed, write, writeErr, stdoutIsTTY) {
|
|
|
2240
2285
|
case "connect":
|
|
2241
2286
|
case "update": {
|
|
2242
2287
|
const apiUrl = earlyApiUrl;
|
|
2243
|
-
const { runExecutionContextCommand } = await import("./commands-
|
|
2288
|
+
const { runExecutionContextCommand } = await import("./commands-SSJJEDFD.js");
|
|
2244
2289
|
return await runExecutionContextCommand({
|
|
2245
2290
|
command: parsed.command,
|
|
2246
2291
|
positionals: parsed.positionals,
|
|
@@ -2556,7 +2601,7 @@ async function dispatch(parsed, write, writeErr, stdoutIsTTY) {
|
|
|
2556
2601
|
apiUrl: typeof parsed.values["api-url"] === "string" ? parsed.values["api-url"] : void 0
|
|
2557
2602
|
});
|
|
2558
2603
|
if (target === "mock") {
|
|
2559
|
-
const { ensureMockTarget } = await import("./mock-server-
|
|
2604
|
+
const { ensureMockTarget } = await import("./mock-server-S5C3IINS.js");
|
|
2560
2605
|
const mock = await ensureMockTarget({
|
|
2561
2606
|
resetStorage: parsed.values["reset-storage"] === true,
|
|
2562
2607
|
...org ? { orgSlug: org } : {}
|
|
@@ -2615,7 +2660,7 @@ async function dispatch(parsed, write, writeErr, stdoutIsTTY) {
|
|
|
2615
2660
|
let closeMock;
|
|
2616
2661
|
try {
|
|
2617
2662
|
if (target === "mock") {
|
|
2618
|
-
const { ensureMockTarget } = await import("./mock-server-
|
|
2663
|
+
const { ensureMockTarget } = await import("./mock-server-S5C3IINS.js");
|
|
2619
2664
|
const mock = await ensureMockTarget({
|
|
2620
2665
|
resetStorage: parsed.values["reset-storage"] === true
|
|
2621
2666
|
});
|
|
@@ -2739,7 +2784,7 @@ async function dispatch(parsed, write, writeErr, stdoutIsTTY) {
|
|
|
2739
2784
|
apiUrl: typeof parsed.values["api-url"] === "string" ? parsed.values["api-url"] : void 0
|
|
2740
2785
|
});
|
|
2741
2786
|
let apiUrl = prodApiUrl;
|
|
2742
|
-
const { parsePassthroughHosts } = await import("./mock-fetch-gateway-
|
|
2787
|
+
const { parsePassthroughHosts } = await import("./mock-fetch-gateway-N5IKHGZM.js");
|
|
2743
2788
|
const passthroughHosts = parsePassthroughHosts(
|
|
2744
2789
|
typeof parsed.values.passthrough === "string" ? parsed.values.passthrough : void 0
|
|
2745
2790
|
);
|
|
@@ -2767,7 +2812,7 @@ async function dispatch(parsed, write, writeErr, stdoutIsTTY) {
|
|
|
2767
2812
|
}
|
|
2768
2813
|
try {
|
|
2769
2814
|
if (local && target === "mock" && modulePath !== void 0) {
|
|
2770
|
-
const { findLocalPackageExport, executeLocalPackageExport } = await import("./execute-local-package-
|
|
2815
|
+
const { findLocalPackageExport, executeLocalPackageExport } = await import("./execute-local-package-TPS5PA5Y.js");
|
|
2771
2816
|
const localExport = await findLocalPackageExport({
|
|
2772
2817
|
modulePath,
|
|
2773
2818
|
...localPackageInvoke && invoke ? { exportKey: invoke } : {}
|
|
@@ -2789,7 +2834,7 @@ async function dispatch(parsed, write, writeErr, stdoutIsTTY) {
|
|
|
2789
2834
|
}
|
|
2790
2835
|
}
|
|
2791
2836
|
if (target === "mock") {
|
|
2792
|
-
const { ensureMockTarget } = await import("./mock-server-
|
|
2837
|
+
const { ensureMockTarget } = await import("./mock-server-S5C3IINS.js");
|
|
2793
2838
|
const mock = await ensureMockTarget({
|
|
2794
2839
|
resetStorage: parsed.values["reset-storage"] === true,
|
|
2795
2840
|
packageId: localPackageRun ? `local:${localPackageRun.kodyId}` : void 0,
|
|
@@ -2808,7 +2853,7 @@ async function dispatch(parsed, write, writeErr, stdoutIsTTY) {
|
|
|
2808
2853
|
});
|
|
2809
2854
|
}
|
|
2810
2855
|
if (localPackageRun) {
|
|
2811
|
-
const { buildLocalPackageContext, runLocalPackageModule } = await import("./local-package-run-
|
|
2856
|
+
const { buildLocalPackageContext, runLocalPackageModule } = await import("./local-package-run-JREJCWDW.js");
|
|
2812
2857
|
const result2 = await runLocalPackageModule({
|
|
2813
2858
|
modulePath: localPackageRun.modulePath,
|
|
2814
2859
|
params: args.params,
|
|
@@ -2853,7 +2898,7 @@ async function dispatch(parsed, write, writeErr, stdoutIsTTY) {
|
|
|
2853
2898
|
packageRootForMocks = void 0;
|
|
2854
2899
|
}
|
|
2855
2900
|
}
|
|
2856
|
-
const result = local ? await (await import("./local-execute-
|
|
2901
|
+
const result = local ? await (await import("./local-execute-XG2GEGTQ.js")).runLocalExecute({
|
|
2857
2902
|
code: args.code,
|
|
2858
2903
|
...modulePath !== void 0 ? { modulePath } : {},
|
|
2859
2904
|
params: args.params,
|
|
@@ -2927,6 +2972,30 @@ async function dispatch(parsed, write, writeErr, stdoutIsTTY) {
|
|
|
2927
2972
|
await closeMock?.();
|
|
2928
2973
|
}
|
|
2929
2974
|
}
|
|
2975
|
+
case "app": {
|
|
2976
|
+
const [subcommand, packageDir, ...extra] = parsed.positionals;
|
|
2977
|
+
if (subcommand !== "check" || extra.length > 0) {
|
|
2978
|
+
throw new Error(
|
|
2979
|
+
"Usage: kody app check [<package-dir>] [--out <dir>] [--target prod|mock] [--json]"
|
|
2980
|
+
);
|
|
2981
|
+
}
|
|
2982
|
+
const [{ resolveTarget }, { runAppCheck }] = await Promise.all([
|
|
2983
|
+
import("./target-LQ247AM3.js"),
|
|
2984
|
+
import("./run-app-check-QDQQY4LU.js")
|
|
2985
|
+
]);
|
|
2986
|
+
const target = resolveTarget({
|
|
2987
|
+
command: "dev",
|
|
2988
|
+
flag: typeof parsed.values.target === "string" ? parsed.values.target : void 0
|
|
2989
|
+
});
|
|
2990
|
+
return await runAppCheck({
|
|
2991
|
+
target,
|
|
2992
|
+
json,
|
|
2993
|
+
io: { stdout: write, stderr: writeErr },
|
|
2994
|
+
...packageDir ? { packageDir } : {},
|
|
2995
|
+
...typeof parsed.values.out === "string" ? { outputDir: parsed.values.out } : {},
|
|
2996
|
+
...org ? { org } : {}
|
|
2997
|
+
});
|
|
2998
|
+
}
|
|
2930
2999
|
case "dev": {
|
|
2931
3000
|
const { resolveTarget } = await import("./target-LQ247AM3.js");
|
|
2932
3001
|
const {
|
|
@@ -2941,7 +3010,7 @@ async function dispatch(parsed, write, writeErr, stdoutIsTTY) {
|
|
|
2941
3010
|
runDevServe,
|
|
2942
3011
|
runDevWebhook,
|
|
2943
3012
|
tryAttachedDevFetch
|
|
2944
|
-
} = await import("./dev-command-
|
|
3013
|
+
} = await import("./dev-command-RWMILJXZ.js");
|
|
2945
3014
|
const target = resolveTarget({
|
|
2946
3015
|
command: "dev",
|
|
2947
3016
|
flag: typeof parsed.values.target === "string" ? parsed.values.target : void 0
|
|
@@ -2990,7 +3059,7 @@ async function dispatch(parsed, write, writeErr, stdoutIsTTY) {
|
|
|
2990
3059
|
}
|
|
2991
3060
|
] = await Promise.all([
|
|
2992
3061
|
import("./open-api-client-DRJJFK2G.js"),
|
|
2993
|
-
import("./dev-command-
|
|
3062
|
+
import("./dev-command-RWMILJXZ.js"),
|
|
2994
3063
|
import("./package-run-FO2LQL5J.js")
|
|
2995
3064
|
]);
|
|
2996
3065
|
let token2;
|
|
@@ -3117,7 +3186,7 @@ async function dispatch(parsed, write, writeErr, stdoutIsTTY) {
|
|
|
3117
3186
|
mcpUrl,
|
|
3118
3187
|
...org ? { org } : {}
|
|
3119
3188
|
}) : void 0;
|
|
3120
|
-
const { parsePassthroughHosts } = await import("./mock-fetch-gateway-
|
|
3189
|
+
const { parsePassthroughHosts } = await import("./mock-fetch-gateway-N5IKHGZM.js");
|
|
3121
3190
|
const passthroughHosts = parsePassthroughHosts(
|
|
3122
3191
|
typeof parsed.values.passthrough === "string" ? parsed.values.passthrough : void 0
|
|
3123
3192
|
);
|
|
@@ -3168,7 +3237,7 @@ async function dispatch(parsed, write, writeErr, stdoutIsTTY) {
|
|
|
3168
3237
|
...typeof parsed.values["ready-file"] === "string" ? { readyFile: parsed.values["ready-file"] } : {},
|
|
3169
3238
|
...target === "mock" && process.env.KODY_DEV_STUB_RUNTIME !== "1" ? {
|
|
3170
3239
|
startLocalKody: async (manifest, packageAppPort) => {
|
|
3171
|
-
const local = await import("./local-kody-
|
|
3240
|
+
const local = await import("./local-kody-EQCQHPKF.js");
|
|
3172
3241
|
const kody = await local.startLocalKody({
|
|
3173
3242
|
manifest,
|
|
3174
3243
|
packageAppPort,
|
|
@@ -3429,7 +3498,7 @@ ${packageCollaboratorUsage}`
|
|
|
3429
3498
|
});
|
|
3430
3499
|
const buildMode = typeof parsed.values.build === "string" ? parsed.values.build : null;
|
|
3431
3500
|
const publishTarget = await resolvePackagePublishTarget(params, call);
|
|
3432
|
-
const { runPublishWithBuild } = await import("./publish-offload-
|
|
3501
|
+
const { runPublishWithBuild } = await import("./publish-offload-SUF6QAL3.js");
|
|
3433
3502
|
const {
|
|
3434
3503
|
abortOnInterrupt,
|
|
3435
3504
|
followPackageRun,
|
|
@@ -3839,4 +3908,4 @@ export {
|
|
|
3839
3908
|
resolvePackagePublishTarget,
|
|
3840
3909
|
supersedeStoredApiTokenAfterLogin
|
|
3841
3910
|
};
|
|
3842
|
-
//# sourceMappingURL=chunk-
|
|
3911
|
+
//# sourceMappingURL=chunk-47RGMUXL.js.map
|