@mutagent/cli 0.1.4 → 0.1.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/cli.js +32 -20
- package/dist/bin/cli.js.map +4 -4
- package/dist/index.js +16 -14
- package/dist/index.js.map +3 -3
- package/package.json +2 -2
package/dist/bin/cli.js
CHANGED
|
@@ -13446,19 +13446,21 @@ class SDKClientWrapper {
|
|
|
13446
13446
|
}
|
|
13447
13447
|
async updatePrompt(id, data) {
|
|
13448
13448
|
try {
|
|
13449
|
-
const
|
|
13450
|
-
|
|
13451
|
-
|
|
13452
|
-
|
|
13453
|
-
|
|
13454
|
-
|
|
13455
|
-
|
|
13456
|
-
|
|
13457
|
-
|
|
13458
|
-
|
|
13459
|
-
|
|
13460
|
-
|
|
13461
|
-
}
|
|
13449
|
+
const body = {
|
|
13450
|
+
description: data.description ?? undefined,
|
|
13451
|
+
isLatest: data.isLatest ?? undefined,
|
|
13452
|
+
systemPrompt: data.systemPrompt ?? undefined,
|
|
13453
|
+
humanPrompt: data.humanPrompt ?? undefined,
|
|
13454
|
+
rawPrompt: data.rawPrompt ?? undefined,
|
|
13455
|
+
outputSchema: data.outputSchema,
|
|
13456
|
+
metadata: data.metadata,
|
|
13457
|
+
tags: data.tags ?? undefined
|
|
13458
|
+
};
|
|
13459
|
+
if (data.name !== undefined) {
|
|
13460
|
+
body.name = data.name;
|
|
13461
|
+
}
|
|
13462
|
+
const updateArgs = { id: parseInt(id, 10), body };
|
|
13463
|
+
const response = await this.sdk.prompt.updatePrompt(updateArgs);
|
|
13462
13464
|
return response;
|
|
13463
13465
|
} catch (error) {
|
|
13464
13466
|
this.handleError(error);
|
|
@@ -14645,10 +14647,10 @@ Prompt Input Methods (pick one):
|
|
|
14645
14647
|
}
|
|
14646
14648
|
const client = getSDKClient();
|
|
14647
14649
|
const prompt = await client.createPrompt(data);
|
|
14648
|
-
output.success(`Created prompt: ${prompt.name}`);
|
|
14649
14650
|
if (isJson) {
|
|
14650
14651
|
output.output({ ...prompt, _links: promptLinks(prompt.id) });
|
|
14651
14652
|
} else {
|
|
14653
|
+
output.success(`Created prompt: ${prompt.name}`);
|
|
14652
14654
|
output.output(prompt);
|
|
14653
14655
|
output.info(`View: ${APP_URL}/prompts/${String(prompt.id)}`);
|
|
14654
14656
|
}
|
|
@@ -14701,8 +14703,12 @@ Examples:
|
|
|
14701
14703
|
}
|
|
14702
14704
|
const client = getSDKClient();
|
|
14703
14705
|
const prompt = await client.updatePrompt(id, data);
|
|
14704
|
-
|
|
14705
|
-
|
|
14706
|
+
if (isJson) {
|
|
14707
|
+
output.output({ ...prompt, _links: promptLinks(prompt.id) });
|
|
14708
|
+
} else {
|
|
14709
|
+
output.success(`Updated prompt: ${prompt.name}`);
|
|
14710
|
+
output.output(prompt);
|
|
14711
|
+
}
|
|
14706
14712
|
} catch (error) {
|
|
14707
14713
|
handleError(error, isJson);
|
|
14708
14714
|
}
|
|
@@ -14772,7 +14778,9 @@ ${chalk4.dim("Supported formats: JSONL, CSV")}
|
|
|
14772
14778
|
const content = readFileSync2(options.file, "utf-8");
|
|
14773
14779
|
const client = getSDKClient();
|
|
14774
14780
|
const datasetResult = await client.addDataset(promptId, content);
|
|
14775
|
-
|
|
14781
|
+
if (!isJson) {
|
|
14782
|
+
output.success(`Added dataset to prompt: ${promptId}`);
|
|
14783
|
+
}
|
|
14776
14784
|
output.output(datasetResult);
|
|
14777
14785
|
} catch (error) {
|
|
14778
14786
|
handleError(error, isJson);
|
|
@@ -14826,7 +14834,9 @@ ${chalk4.dim("Tip: Get the dataset ID from: mutagent prompts dataset list <promp
|
|
|
14826
14834
|
try {
|
|
14827
14835
|
const client = getSDKClient();
|
|
14828
14836
|
const evalRun = await client.runEvaluation(promptId, options.dataset);
|
|
14829
|
-
|
|
14837
|
+
if (!isJson) {
|
|
14838
|
+
output.success(`Started evaluation: ${String(evalRun.id)}`);
|
|
14839
|
+
}
|
|
14830
14840
|
output.output(evalRun);
|
|
14831
14841
|
} catch (error) {
|
|
14832
14842
|
handleError(error, isJson);
|
|
@@ -14867,7 +14877,9 @@ ${chalk4.dim("Tip: Monitor progress with: mutagent prompts optimize status <job-
|
|
|
14867
14877
|
try {
|
|
14868
14878
|
const client = getSDKClient();
|
|
14869
14879
|
const job = await client.startOptimization(promptId, options.dataset);
|
|
14870
|
-
|
|
14880
|
+
if (!isJson) {
|
|
14881
|
+
output.success(`Started optimization job: ${job.jobId}`);
|
|
14882
|
+
}
|
|
14871
14883
|
output.output(job);
|
|
14872
14884
|
} catch (error) {
|
|
14873
14885
|
handleError(error, isJson);
|
|
@@ -17237,5 +17249,5 @@ program.addCommand(createWorkspacesCommand());
|
|
|
17237
17249
|
program.addCommand(createProvidersCommand());
|
|
17238
17250
|
program.parse();
|
|
17239
17251
|
|
|
17240
|
-
//# debugId=
|
|
17252
|
+
//# debugId=3C8E76A3ACED3E0764756E2164756E21
|
|
17241
17253
|
//# sourceMappingURL=cli.js.map
|