@ishlabs/cli 0.8.1 → 0.8.2
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 +323 -21
- package/dist/auth.d.ts +17 -1
- package/dist/auth.js +62 -9
- package/dist/commands/ask.d.ts +5 -0
- package/dist/commands/ask.js +722 -0
- package/dist/commands/config.js +25 -1
- package/dist/commands/docs.d.ts +17 -0
- package/dist/commands/docs.js +147 -0
- package/dist/commands/init.d.ts +16 -0
- package/dist/commands/init.js +182 -0
- package/dist/commands/iteration.d.ts +5 -1
- package/dist/commands/iteration.js +243 -31
- package/dist/commands/profile.d.ts +5 -0
- package/dist/commands/profile.js +313 -0
- package/dist/commands/source.d.ts +10 -0
- package/dist/commands/source.js +78 -0
- package/dist/commands/study-run.d.ts +11 -0
- package/dist/commands/study-run.js +552 -0
- package/dist/commands/study-tester.d.ts +8 -0
- package/dist/commands/study-tester.js +149 -0
- package/dist/commands/study.js +145 -70
- package/dist/commands/workspace.js +193 -7
- package/dist/config.d.ts +3 -1
- package/dist/config.js +10 -10
- package/dist/connect.d.ts +4 -1
- package/dist/connect.js +127 -94
- package/dist/index.js +82 -34
- package/dist/lib/alias-store.d.ts +3 -0
- package/dist/lib/alias-store.js +9 -7
- package/dist/lib/api-client.d.ts +9 -6
- package/dist/lib/api-client.js +87 -26
- package/dist/lib/ask-questions.d.ts +9 -0
- package/dist/lib/ask-questions.js +35 -0
- package/dist/lib/ask-variants.d.ts +48 -0
- package/dist/lib/ask-variants.js +236 -0
- package/dist/lib/auth.d.ts +1 -1
- package/dist/lib/auth.js +24 -8
- package/dist/lib/colors.d.ts +30 -0
- package/dist/lib/colors.js +48 -0
- package/dist/lib/command-helpers.d.ts +74 -0
- package/dist/lib/command-helpers.js +232 -6
- package/dist/lib/docs.d.ts +32 -0
- package/dist/lib/docs.js +930 -0
- package/dist/lib/local-sim/browser.d.ts +0 -1
- package/dist/lib/local-sim/browser.js +0 -2
- package/dist/lib/local-sim/install.d.ts +4 -7
- package/dist/lib/local-sim/install.js +6 -21
- package/dist/lib/output.d.ts +25 -3
- package/dist/lib/output.js +465 -20
- package/dist/lib/paths.d.ts +14 -0
- package/dist/lib/paths.js +36 -0
- package/dist/lib/profile-sources.d.ts +55 -0
- package/dist/lib/profile-sources.js +157 -0
- package/dist/lib/site-access.d.ts +80 -0
- package/dist/lib/site-access.js +188 -0
- package/dist/lib/skill-content.d.ts +31 -0
- package/dist/lib/skill-content.js +462 -0
- package/dist/lib/study-inputs.d.ts +20 -0
- package/dist/lib/study-inputs.js +72 -0
- package/dist/lib/types.d.ts +207 -9
- package/dist/lib/types.js +7 -0
- package/dist/lib/upload.js +2 -2
- package/dist/upgrade.js +11 -1
- package/package.json +1 -1
- package/dist/commands/simulation.d.ts +0 -10
- package/dist/commands/simulation.js +0 -647
- package/dist/commands/tester-profile.d.ts +0 -5
- package/dist/commands/tester-profile.js +0 -109
- package/dist/commands/tester.d.ts +0 -5
- package/dist/commands/tester.js +0 -73
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { type Browser, type BrowserContext, type Page } from "playwright-core";
|
|
9
9
|
import type { LocalSimBrowserOptions, TreeData } from "./types.js";
|
|
10
|
-
import "./install.js";
|
|
11
10
|
export interface BrowserSession {
|
|
12
11
|
browser: Browser;
|
|
13
12
|
context: BrowserContext;
|
|
@@ -6,8 +6,6 @@
|
|
|
6
6
|
* with single-space indentation per level.
|
|
7
7
|
*/
|
|
8
8
|
import { chromium } from "playwright-core";
|
|
9
|
-
// Import install module for side-effect: sets PLAYWRIGHT_BROWSERS_PATH
|
|
10
|
-
import "./install.js";
|
|
11
9
|
// Viewport presets matching backend (app/simulation/computers/config.py)
|
|
12
10
|
const VIEWPORT_PRESETS = {
|
|
13
11
|
desktop: { width: 1440, height: 900 },
|
|
@@ -1,18 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Browser installation management for local simulations.
|
|
3
|
-
* Uses playwright-core to download and manage Chromium
|
|
3
|
+
* Uses playwright-core to download and manage Chromium in Playwright's
|
|
4
|
+
* default cache (`~/Library/Caches/ms-playwright` on macOS, etc.).
|
|
4
5
|
*/
|
|
5
6
|
/**
|
|
6
|
-
*
|
|
7
|
-
*/
|
|
8
|
-
export declare function getBrowsersPath(): string;
|
|
9
|
-
/**
|
|
10
|
-
* Check if Chromium is installed in the ish browsers directory.
|
|
7
|
+
* Check if Chromium is installed in Playwright's default cache.
|
|
11
8
|
*/
|
|
12
9
|
export declare function isBrowserInstalled(): boolean;
|
|
13
10
|
/**
|
|
14
11
|
* Install Chromium browser for local simulations.
|
|
15
|
-
* Downloads ~120 MB on first use.
|
|
12
|
+
* Downloads ~120 MB on first use into Playwright's default cache.
|
|
16
13
|
*/
|
|
17
14
|
export declare function installBrowser(quiet?: boolean): Promise<void>;
|
|
18
15
|
/**
|
|
@@ -1,27 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Browser installation management for local simulations.
|
|
3
|
-
* Uses playwright-core to download and manage Chromium
|
|
3
|
+
* Uses playwright-core to download and manage Chromium in Playwright's
|
|
4
|
+
* default cache (`~/Library/Caches/ms-playwright` on macOS, etc.).
|
|
4
5
|
*/
|
|
5
6
|
import { execSync } from "node:child_process";
|
|
6
7
|
import { existsSync } from "node:fs";
|
|
7
|
-
import { join } from "node:path";
|
|
8
|
-
import { homedir } from "node:os";
|
|
9
8
|
import { chromium } from "playwright-core";
|
|
10
|
-
const BROWSERS_DIR = join(homedir(), ".ish", "browsers");
|
|
11
|
-
// Set env at module load so all playwright-core calls use our directory
|
|
12
|
-
process.env.PLAYWRIGHT_BROWSERS_PATH = BROWSERS_DIR;
|
|
13
9
|
/**
|
|
14
|
-
*
|
|
15
|
-
*/
|
|
16
|
-
export function getBrowsersPath() {
|
|
17
|
-
return BROWSERS_DIR;
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Check if Chromium is installed in the ish browsers directory.
|
|
10
|
+
* Check if Chromium is installed in Playwright's default cache.
|
|
21
11
|
*/
|
|
22
12
|
export function isBrowserInstalled() {
|
|
23
13
|
try {
|
|
24
|
-
// Try to get the executable path - if it throws, browser isn't installed
|
|
25
14
|
const execPath = chromium.executablePath();
|
|
26
15
|
return existsSync(execPath);
|
|
27
16
|
}
|
|
@@ -31,7 +20,7 @@ export function isBrowserInstalled() {
|
|
|
31
20
|
}
|
|
32
21
|
/**
|
|
33
22
|
* Install Chromium browser for local simulations.
|
|
34
|
-
* Downloads ~120 MB on first use.
|
|
23
|
+
* Downloads ~120 MB on first use into Playwright's default cache.
|
|
35
24
|
*/
|
|
36
25
|
export async function installBrowser(quiet = false) {
|
|
37
26
|
const log = (msg) => { if (!quiet)
|
|
@@ -40,16 +29,12 @@ export async function installBrowser(quiet = false) {
|
|
|
40
29
|
try {
|
|
41
30
|
execSync("npx playwright-core install chromium", {
|
|
42
31
|
stdio: quiet ? "ignore" : "inherit",
|
|
43
|
-
env: {
|
|
44
|
-
...process.env,
|
|
45
|
-
PLAYWRIGHT_BROWSERS_PATH: BROWSERS_DIR,
|
|
46
|
-
},
|
|
47
32
|
});
|
|
48
33
|
log("Chromium installed successfully.");
|
|
49
34
|
}
|
|
50
35
|
catch (err) {
|
|
51
36
|
throw new Error(`Failed to install Chromium. You can install manually:\n` +
|
|
52
|
-
`
|
|
37
|
+
` npx playwright-core install chromium`);
|
|
53
38
|
}
|
|
54
39
|
}
|
|
55
40
|
/**
|
|
@@ -65,7 +50,7 @@ export async function ensureBrowser(opts = {}) {
|
|
|
65
50
|
const answer = await rl.question("Chromium browser not found. Download (~120 MB) for local simulations? [Y/n] ");
|
|
66
51
|
rl.close();
|
|
67
52
|
if (answer && !["y", "yes", ""].includes(answer.toLowerCase().trim())) {
|
|
68
|
-
throw new Error("Local simulation requires Chromium.
|
|
53
|
+
throw new Error("Local simulation requires Chromium. Re-run `ish study run --local` to install and retry.");
|
|
69
54
|
}
|
|
70
55
|
}
|
|
71
56
|
await installBrowser(opts.quiet);
|
package/dist/lib/output.d.ts
CHANGED
|
@@ -9,7 +9,22 @@
|
|
|
9
9
|
/** Set by withClient() based on global flags. */
|
|
10
10
|
export declare function setVerbose(v: boolean): void;
|
|
11
11
|
export declare function setFields(fields?: string[]): void;
|
|
12
|
-
|
|
12
|
+
/** Per-call output options for stable JSON contracts. */
|
|
13
|
+
export interface OutputOptions {
|
|
14
|
+
/**
|
|
15
|
+
* Write-path responses (create/update/delete) preserve canonical identifiers
|
|
16
|
+
* (id, *_id) regardless of --verbose. Agents need the UUID handle to chain
|
|
17
|
+
* follow-up calls without having to discover --verbose.
|
|
18
|
+
*/
|
|
19
|
+
writePath?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Set when the formatter has already projected the data to a known field
|
|
22
|
+
* set. Skips the lean-JSON pass (which would strip e.g. `created_at`) but
|
|
23
|
+
* still applies `--fields` so callers can narrow the projection further.
|
|
24
|
+
*/
|
|
25
|
+
preProjected?: boolean;
|
|
26
|
+
}
|
|
27
|
+
export declare function output(data: unknown, json: boolean, options?: OutputOptions): void;
|
|
13
28
|
export declare function outputList(rows: unknown[], json: boolean): void;
|
|
14
29
|
/**
|
|
15
30
|
* Error with valid options — used for content_type and similar validation.
|
|
@@ -23,12 +38,19 @@ export declare function outputError(err: unknown, json: boolean): void;
|
|
|
23
38
|
export declare function printTable(headers: string[], rows: string[][]): void;
|
|
24
39
|
export declare function printKeyValue(obj: Record<string, unknown>, indent?: string): void;
|
|
25
40
|
export declare function formatWorkspaceList(workspaces: Record<string, unknown>[], json: boolean): void;
|
|
26
|
-
export declare function formatWorkspaceDetail(workspace: Record<string, unknown>, json: boolean): void;
|
|
41
|
+
export declare function formatWorkspaceDetail(workspace: Record<string, unknown>, json: boolean, options?: OutputOptions): void;
|
|
42
|
+
export declare function formatSiteAccessStatus(summary: import("./site-access.js").SiteAccessSummary, json: boolean): void;
|
|
27
43
|
export declare function formatStudyList(studies: Record<string, unknown>[], json: boolean): void;
|
|
28
|
-
export declare function formatStudyDetail(study: Record<string, unknown>, json: boolean): void;
|
|
44
|
+
export declare function formatStudyDetail(study: Record<string, unknown>, json: boolean, options?: OutputOptions): void;
|
|
29
45
|
export declare function formatStudyResults(study: Record<string, unknown>, json: boolean): void;
|
|
30
46
|
export declare function formatIterationList(iterations: Record<string, unknown>[], json: boolean): void;
|
|
31
47
|
export declare function formatTesterDetail(tester: Record<string, unknown>, json: boolean): void;
|
|
32
48
|
export declare function formatTesterProfileList(profiles: unknown, json: boolean, limit?: number): void;
|
|
49
|
+
export declare function formatAudienceSource(source: Record<string, unknown>, json: boolean): void;
|
|
50
|
+
export declare function formatGeneratedProfileList(profiles: unknown, json: boolean): void;
|
|
33
51
|
export declare function formatSimulationPoll(results: Record<string, unknown>[], json: boolean, isMedia?: boolean): void;
|
|
52
|
+
export declare function formatAskList(asks: Record<string, unknown>[], json: boolean): void;
|
|
53
|
+
export declare function formatAskDetail(ask: Record<string, unknown>, json: boolean): void;
|
|
54
|
+
export declare function formatRoundDetail(round: Record<string, unknown>, json: boolean): void;
|
|
55
|
+
export declare function formatAskResults(ask: Record<string, unknown>, json: boolean, roundFilter?: number): void;
|
|
34
56
|
export declare function formatConfigList(configs: Record<string, unknown>[], json: boolean): void;
|