@ishlabs/cli 0.8.1 → 0.8.3
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 +2 -12
- package/dist/lib/local-sim/install.js +22 -30
- 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 +3 -2
- 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
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ish tester-profile — Manage tester profiles.
|
|
3
|
-
*/
|
|
4
|
-
import { withClient, readJsonFileOrStdin } from "../lib/command-helpers.js";
|
|
5
|
-
import { resolveId, tagAlias, ALIAS_PREFIX } from "../lib/alias-store.js";
|
|
6
|
-
import { formatTesterProfileList, output } from "../lib/output.js";
|
|
7
|
-
export function registerTesterProfileCommands(program) {
|
|
8
|
-
const profile = program
|
|
9
|
-
.command("tester-profile")
|
|
10
|
-
.description("Manage tester profiles");
|
|
11
|
-
profile
|
|
12
|
-
.command("list")
|
|
13
|
-
.description("List tester profiles (defaults to simulatable AI profiles)")
|
|
14
|
-
.option("--workspace <id>", "Filter by workspace ID")
|
|
15
|
-
.option("--search <query>", "Search by name or bio")
|
|
16
|
-
.option("--type <type>", "Profile type: ai, human, all (default: ai)", "ai")
|
|
17
|
-
.option("--gender <gender>", "Filter by gender")
|
|
18
|
-
.option("--country <country>", "Filter by country code (e.g. US, GB, SE)")
|
|
19
|
-
.option("--min-age <n>", "Minimum age")
|
|
20
|
-
.option("--max-age <n>", "Maximum age")
|
|
21
|
-
.option("--limit <n>", "Max results (default 50)", "50")
|
|
22
|
-
.option("--offset <n>", "Offset for pagination", "0")
|
|
23
|
-
.addHelpText("after", `
|
|
24
|
-
Examples:
|
|
25
|
-
$ ish tester-profile list
|
|
26
|
-
$ ish tester-profile list --search "engineer" --country US
|
|
27
|
-
$ ish tester-profile list --gender female --min-age 25 --max-age 40
|
|
28
|
-
$ ish tester-profile list --type all --json`)
|
|
29
|
-
.action(async (opts, cmd) => {
|
|
30
|
-
await withClient(cmd, async (client, globals) => {
|
|
31
|
-
const params = {
|
|
32
|
-
limit: opts.limit,
|
|
33
|
-
offset: opts.offset,
|
|
34
|
-
};
|
|
35
|
-
if (opts.workspace)
|
|
36
|
-
params.product_id = opts.workspace;
|
|
37
|
-
if (opts.search)
|
|
38
|
-
params.search = opts.search;
|
|
39
|
-
if (opts.type !== "all")
|
|
40
|
-
params.type = opts.type;
|
|
41
|
-
if (opts.gender)
|
|
42
|
-
params.gender = opts.gender;
|
|
43
|
-
if (opts.country)
|
|
44
|
-
params.country = opts.country;
|
|
45
|
-
if (opts.minAge)
|
|
46
|
-
params.min_age = opts.minAge;
|
|
47
|
-
if (opts.maxAge)
|
|
48
|
-
params.max_age = opts.maxAge;
|
|
49
|
-
const data = await client.get("/tester-profiles", params);
|
|
50
|
-
formatTesterProfileList(data, globals.json, parseInt(opts.limit, 10));
|
|
51
|
-
});
|
|
52
|
-
});
|
|
53
|
-
profile
|
|
54
|
-
.command("create")
|
|
55
|
-
.description("Create a tester profile")
|
|
56
|
-
.requiredOption("--file <path>", "JSON file with profile data")
|
|
57
|
-
.addHelpText("after", "\nExamples:\n $ ish tester-profile create --file profile.json\n\n Expected JSON: { \"name\": \"...\", \"age\": 30, \"gender\": \"...\", \"country\": \"US\", \"occupation\": \"...\", \"bio\": \"...\" }")
|
|
58
|
-
.action(async (opts, cmd) => {
|
|
59
|
-
await withClient(cmd, async (client, globals) => {
|
|
60
|
-
const body = await readJsonFileOrStdin(opts.file);
|
|
61
|
-
const data = await client.post("/tester-profiles", body);
|
|
62
|
-
const result = data;
|
|
63
|
-
if (result.id)
|
|
64
|
-
result.alias = tagAlias(ALIAS_PREFIX.testerProfile, String(result.id));
|
|
65
|
-
output(result, globals.json);
|
|
66
|
-
});
|
|
67
|
-
});
|
|
68
|
-
profile
|
|
69
|
-
.command("get")
|
|
70
|
-
.description("Get tester profile details")
|
|
71
|
-
.argument("<id>", "Tester profile ID")
|
|
72
|
-
.addHelpText("after", "\nExamples:\n $ ish tester-profile get <id>\n $ ish tester-profile get <id> --json")
|
|
73
|
-
.action(async (id, _opts, cmd) => {
|
|
74
|
-
await withClient(cmd, async (client, globals) => {
|
|
75
|
-
const data = await client.get(`/tester-profiles/${resolveId(id)}`);
|
|
76
|
-
const result = data;
|
|
77
|
-
if (result.id)
|
|
78
|
-
result.alias = tagAlias(ALIAS_PREFIX.testerProfile, String(result.id));
|
|
79
|
-
output(result, globals.json);
|
|
80
|
-
});
|
|
81
|
-
});
|
|
82
|
-
profile
|
|
83
|
-
.command("update")
|
|
84
|
-
.description("Update a tester profile")
|
|
85
|
-
.argument("<id>", "Tester profile ID")
|
|
86
|
-
.requiredOption("--file <path>", "JSON file with update data")
|
|
87
|
-
.addHelpText("after", "\nExamples:\n $ ish tester-profile update <id> --file updates.json")
|
|
88
|
-
.action(async (id, opts, cmd) => {
|
|
89
|
-
await withClient(cmd, async (client, globals) => {
|
|
90
|
-
const body = await readJsonFileOrStdin(opts.file);
|
|
91
|
-
const data = await client.put(`/tester-profiles/${resolveId(id)}`, body);
|
|
92
|
-
const result = data;
|
|
93
|
-
if (result.id)
|
|
94
|
-
result.alias = tagAlias(ALIAS_PREFIX.testerProfile, String(result.id));
|
|
95
|
-
output(result, globals.json);
|
|
96
|
-
});
|
|
97
|
-
});
|
|
98
|
-
profile
|
|
99
|
-
.command("delete")
|
|
100
|
-
.description("Delete a tester profile")
|
|
101
|
-
.argument("<id>", "Tester profile ID")
|
|
102
|
-
.addHelpText("after", "\nExamples:\n $ ish tester-profile delete <id>")
|
|
103
|
-
.action(async (id, _opts, cmd) => {
|
|
104
|
-
await withClient(cmd, async (client, globals) => {
|
|
105
|
-
await client.del(`/tester-profiles/${resolveId(id)}`);
|
|
106
|
-
output({ message: "Tester profile deleted" }, globals.json);
|
|
107
|
-
});
|
|
108
|
-
});
|
|
109
|
-
}
|
package/dist/commands/tester.js
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ish tester — Manage testers (usually created via `simulation run`).
|
|
3
|
-
*/
|
|
4
|
-
import { withClient, readJsonFileOrStdin } from "../lib/command-helpers.js";
|
|
5
|
-
import { resolveId, tagAlias, ALIAS_PREFIX } from "../lib/alias-store.js";
|
|
6
|
-
import { formatTesterDetail, output } from "../lib/output.js";
|
|
7
|
-
export function registerTesterCommands(program) {
|
|
8
|
-
const tester = program
|
|
9
|
-
.command("tester")
|
|
10
|
-
.description("Manage testers (usually created via `simulation run`)");
|
|
11
|
-
tester
|
|
12
|
-
.command("create")
|
|
13
|
-
.description("Create a tester (low-level)")
|
|
14
|
-
.requiredOption("--iteration <id>", "Iteration ID")
|
|
15
|
-
.requiredOption("--profile <id>", "Tester profile ID")
|
|
16
|
-
.option("--language <lang>", "Language code (e.g. en, sv)")
|
|
17
|
-
.option("--platform <platform>", "Platform (browser, android, figma, code)")
|
|
18
|
-
.option("--tester-type <type>", "Tester type (ai, human)", "ai")
|
|
19
|
-
.addHelpText("after", "\nExamples:\n $ ish tester create --iteration <id> --profile <id>\n $ ish tester create --iteration <id> --profile <id> --platform android --json")
|
|
20
|
-
.action(async (opts, cmd) => {
|
|
21
|
-
await withClient(cmd, async (client, globals) => {
|
|
22
|
-
const body = {
|
|
23
|
-
tester_profile_id: resolveId(opts.profile),
|
|
24
|
-
tester_type: opts.testerType,
|
|
25
|
-
...(opts.language && { language: opts.language }),
|
|
26
|
-
...(opts.platform && { platform: opts.platform }),
|
|
27
|
-
};
|
|
28
|
-
const data = await client.post(`/iterations/${resolveId(opts.iteration)}/testers`, body);
|
|
29
|
-
const result = data;
|
|
30
|
-
if (result.id)
|
|
31
|
-
result.alias = tagAlias(ALIAS_PREFIX.tester, String(result.id));
|
|
32
|
-
output(result, globals.json);
|
|
33
|
-
});
|
|
34
|
-
});
|
|
35
|
-
tester
|
|
36
|
-
.command("batch-create")
|
|
37
|
-
.description("Create multiple testers from a JSON file (low-level)")
|
|
38
|
-
.requiredOption("--iteration <id>", "Iteration ID")
|
|
39
|
-
.requiredOption("--file <path>", "JSON file with testers array")
|
|
40
|
-
.addHelpText("after", "\nExamples:\n $ ish tester batch-create --iteration <id> --file testers.json\n\n Expected JSON: [{ \"tester_profile_id\": \"<id>\", \"platform\": \"browser\" }, ...]")
|
|
41
|
-
.action(async (opts, cmd) => {
|
|
42
|
-
await withClient(cmd, async (client, globals) => {
|
|
43
|
-
const body = await readJsonFileOrStdin(opts.file);
|
|
44
|
-
const data = await client.post(`/iterations/${resolveId(opts.iteration)}/testers/batch`, body);
|
|
45
|
-
output(data, globals.json);
|
|
46
|
-
});
|
|
47
|
-
});
|
|
48
|
-
tester
|
|
49
|
-
.command("get")
|
|
50
|
-
.description("Get tester details and results")
|
|
51
|
-
.argument("<id>", "Tester ID")
|
|
52
|
-
.addHelpText("after", "\nExamples:\n $ ish tester get <id>\n $ ish tester get <id> --json")
|
|
53
|
-
.action(async (id, _opts, cmd) => {
|
|
54
|
-
await withClient(cmd, async (client, globals) => {
|
|
55
|
-
const data = await client.get(`/testers/${resolveId(id)}`);
|
|
56
|
-
const result = data;
|
|
57
|
-
if (result.id)
|
|
58
|
-
result.alias = tagAlias(ALIAS_PREFIX.tester, String(result.id));
|
|
59
|
-
formatTesterDetail(result, globals.json);
|
|
60
|
-
});
|
|
61
|
-
});
|
|
62
|
-
tester
|
|
63
|
-
.command("delete")
|
|
64
|
-
.description("Delete a tester")
|
|
65
|
-
.argument("<id>", "Tester ID")
|
|
66
|
-
.addHelpText("after", "\nExamples:\n $ ish tester delete <id>")
|
|
67
|
-
.action(async (id, _opts, cmd) => {
|
|
68
|
-
await withClient(cmd, async (client, globals) => {
|
|
69
|
-
await client.del(`/testers/${resolveId(id)}`);
|
|
70
|
-
output({ message: "Tester deleted" }, globals.json);
|
|
71
|
-
});
|
|
72
|
-
});
|
|
73
|
-
}
|