@skrr-ai/cli 0.1.60 → 0.1.62
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/base-command.js +16 -0
- package/dist/commands/agents/create.d.ts +1 -0
- package/dist/commands/agents/create.js +8 -1
- package/dist/commands/agents/delete.d.ts +14 -0
- package/dist/commands/agents/delete.js +52 -4
- package/dist/commands/agents/eval/index.d.ts +38 -0
- package/dist/commands/agents/eval/index.js +157 -0
- package/dist/commands/agents/eval/list.d.ts +13 -0
- package/dist/commands/agents/eval/list.js +53 -0
- package/dist/commands/agents/eval/show.d.ts +13 -0
- package/dist/commands/agents/eval/show.js +36 -0
- package/dist/commands/agents/import.d.ts +37 -0
- package/dist/commands/agents/import.js +233 -0
- package/dist/commands/agents/pull.d.ts +27 -0
- package/dist/commands/agents/pull.js +82 -0
- package/dist/commands/agents/push.d.ts +28 -0
- package/dist/commands/agents/push.js +112 -0
- package/dist/commands/agents/releases/ci-publish.d.ts +32 -0
- package/dist/commands/agents/releases/ci-publish.js +99 -0
- package/dist/commands/agents/releases/create.d.ts +3 -0
- package/dist/commands/agents/releases/create.js +27 -6
- package/dist/commands/agents/releases/known-issues/add.d.ts +19 -0
- package/dist/commands/agents/releases/known-issues/add.js +43 -0
- package/dist/commands/agents/releases/known-issues/list.d.ts +17 -0
- package/dist/commands/agents/releases/known-issues/list.js +55 -0
- package/dist/commands/agents/releases/known-issues/update.d.ts +18 -0
- package/dist/commands/agents/releases/known-issues/update.js +47 -0
- package/dist/commands/agents/releases/list.js +25 -3
- package/dist/commands/agents/releases/rollback.js +12 -4
- package/dist/commands/agents/releases/test-install.d.ts +22 -0
- package/dist/commands/agents/releases/test-install.js +70 -0
- package/dist/commands/agents/releases/trusted-publishers/list.d.ts +17 -0
- package/dist/commands/agents/releases/trusted-publishers/list.js +55 -0
- package/dist/commands/agents/releases/trusted-publishers/remove.d.ts +17 -0
- package/dist/commands/agents/releases/trusted-publishers/remove.js +45 -0
- package/dist/commands/agents/releases/trusted-publishers/set.d.ts +27 -0
- package/dist/commands/agents/releases/trusted-publishers/set.js +82 -0
- package/dist/commands/agents/update.d.ts +1 -0
- package/dist/commands/agents/update.js +8 -1
- package/dist/commands/agents/usage-cap.d.ts +20 -0
- package/dist/commands/agents/usage-cap.js +76 -0
- package/dist/commands/agents/validate.d.ts +22 -0
- package/dist/commands/agents/validate.js +66 -0
- package/dist/commands/agents/visibility.d.ts +13 -0
- package/dist/commands/agents/visibility.js +84 -2
- package/dist/commands/commerce/fees/show.d.ts +19 -0
- package/dist/commands/commerce/fees/show.js +75 -0
- package/dist/commands/earnings/index.d.ts +15 -0
- package/dist/commands/earnings/index.js +46 -0
- package/dist/commands/earnings/payouts.d.ts +12 -0
- package/dist/commands/earnings/payouts.js +39 -0
- package/dist/commands/earnings/statements.d.ts +19 -0
- package/dist/commands/earnings/statements.js +70 -0
- package/dist/commands/goals/key-results/create.d.ts +1 -1
- package/dist/commands/goals/key-results/create.js +5 -1
- package/dist/commands/harnesses/show.js +11 -1
- package/dist/commands/logout.js +31 -0
- package/dist/commands/machines/show.js +10 -1
- package/dist/commands/managed-execution/show.d.ts +10 -0
- package/dist/commands/managed-execution/show.js +60 -0
- package/dist/commands/spaces/show.js +35 -1
- package/dist/commands/step-up.d.ts +23 -0
- package/dist/commands/step-up.js +96 -0
- package/dist/commands/store/acquisitions/approve.d.ts +30 -0
- package/dist/commands/store/acquisitions/approve.js +100 -0
- package/dist/commands/store/acquisitions/decline.d.ts +17 -0
- package/dist/commands/store/acquisitions/decline.js +47 -0
- package/dist/commands/store/acquisitions/show.d.ts +16 -0
- package/dist/commands/store/acquisitions/show.js +49 -0
- package/dist/commands/store/admissions/approve.d.ts +19 -0
- package/dist/commands/store/admissions/approve.js +50 -0
- package/dist/commands/store/admissions/list.d.ts +15 -0
- package/dist/commands/store/admissions/list.js +60 -0
- package/dist/commands/store/admissions/refuse.d.ts +18 -0
- package/dist/commands/store/admissions/refuse.js +49 -0
- package/dist/commands/store/advisories/artifact.d.ts +15 -0
- package/dist/commands/store/advisories/artifact.js +25 -0
- package/dist/commands/store/advisories/cancel.d.ts +13 -0
- package/dist/commands/store/advisories/cancel.js +34 -0
- package/dist/commands/store/advisories/close.d.ts +18 -0
- package/dist/commands/store/advisories/close.js +51 -0
- package/dist/commands/store/advisories/confirm.d.ts +17 -0
- package/dist/commands/store/advisories/confirm.js +40 -0
- package/dist/commands/store/advisories/issue.d.ts +20 -0
- package/dist/commands/store/advisories/issue.js +59 -0
- package/dist/commands/store/advisories/list.d.ts +15 -0
- package/dist/commands/store/advisories/list.js +49 -0
- package/dist/commands/store/advisories/show.d.ts +13 -0
- package/dist/commands/store/advisories/show.js +34 -0
- package/dist/commands/store/artifacts/release.d.ts +16 -0
- package/dist/commands/store/artifacts/release.js +31 -0
- package/dist/commands/store/artifacts/used-by.d.ts +12 -0
- package/dist/commands/store/artifacts/used-by.js +20 -0
- package/dist/commands/store/browse.d.ts +5 -0
- package/dist/commands/store/browse.js +28 -1
- package/dist/commands/store/channel.d.ts +21 -0
- package/dist/commands/store/channel.js +62 -0
- package/dist/commands/store/follow.d.ts +14 -0
- package/dist/commands/store/follow.js +45 -0
- package/dist/commands/store/governance/policy.d.ts +18 -5
- package/dist/commands/store/governance/policy.js +80 -12
- package/dist/commands/store/governance/requests.d.ts +28 -0
- package/dist/commands/store/governance/requests.js +116 -0
- package/dist/commands/store/install.d.ts +3 -0
- package/dist/commands/store/install.js +101 -2
- package/dist/commands/store/issues.d.ts +26 -0
- package/dist/commands/store/issues.js +118 -0
- package/dist/commands/store/maintainers/add.d.ts +13 -0
- package/dist/commands/store/maintainers/add.js +23 -0
- package/dist/commands/store/maintainers/remove.d.ts +13 -0
- package/dist/commands/store/maintainers/remove.js +22 -0
- package/dist/commands/store/publishers/approve.d.ts +11 -0
- package/dist/commands/store/publishers/approve.js +25 -0
- package/dist/commands/store/publishers/claim.d.ts +12 -0
- package/dist/commands/store/publishers/claim.js +20 -0
- package/dist/commands/store/publishers/confirm.d.ts +11 -0
- package/dist/commands/store/publishers/confirm.js +17 -0
- package/dist/commands/store/publishers/domains/begin.d.ts +12 -0
- package/dist/commands/store/publishers/domains/begin.js +20 -0
- package/dist/commands/store/publishers/domains/list.d.ts +9 -0
- package/dist/commands/store/publishers/domains/list.js +19 -0
- package/dist/commands/store/publishers/domains/verify.d.ts +12 -0
- package/dist/commands/store/publishers/domains/verify.js +20 -0
- package/dist/commands/store/publishers/namespaces.d.ts +8 -0
- package/dist/commands/store/publishers/namespaces.js +16 -0
- package/dist/commands/store/publishers/verified.d.ts +11 -0
- package/dist/commands/store/publishers/verified.js +34 -0
- package/dist/commands/store/refund.d.ts +22 -0
- package/dist/commands/store/refund.js +80 -0
- package/dist/commands/store/report.d.ts +20 -0
- package/dist/commands/store/report.js +59 -0
- package/dist/commands/store/reports.d.ts +11 -0
- package/dist/commands/store/reports.js +52 -0
- package/dist/commands/store/signals.d.ts +18 -0
- package/dist/commands/store/signals.js +43 -0
- package/dist/commands/store/star.d.ts +17 -0
- package/dist/commands/store/star.js +41 -0
- package/dist/commands/store/stars.d.ts +10 -0
- package/dist/commands/store/stars.js +33 -0
- package/dist/commands/store/trial.d.ts +11 -0
- package/dist/commands/store/trial.js +17 -0
- package/dist/commands/store/uninstall.d.ts +19 -0
- package/dist/commands/store/uninstall.js +118 -0
- package/dist/commands/store/update.d.ts +2 -0
- package/dist/commands/store/update.js +60 -2
- package/dist/commands/store/updates.d.ts +10 -4
- package/dist/commands/store/updates.js +60 -39
- package/dist/commands/store/watch.d.ts +18 -0
- package/dist/commands/store/watch.js +44 -0
- package/dist/commands/subscriptions/health.d.ts +12 -0
- package/dist/commands/subscriptions/health.js +39 -0
- package/dist/commands/subscriptions/list.js +3 -2
- package/dist/commands/subscriptions/status.js +7 -1
- package/dist/commands/subscriptions/subscribe.d.ts +9 -2
- package/dist/commands/subscriptions/subscribe.js +141 -12
- package/dist/commands/tasks/comments/list.js +9 -1
- package/dist/commands/tasks/labels/attach.js +15 -2
- package/dist/commands/tasks/show.js +17 -3
- package/dist/commands/tasks/update.js +15 -4
- package/dist/commands/tasks/updates/add.js +5 -1
- package/dist/lib/agent-config.js +1 -0
- package/dist/lib/agent-evals.d.ts +71 -0
- package/dist/lib/agent-evals.js +359 -0
- package/dist/lib/agent-spec.d.ts +28 -0
- package/dist/lib/agent-spec.js +58 -0
- package/dist/lib/auth-storage.d.ts +12 -0
- package/dist/lib/auth-storage.js +0 -33
- package/dist/lib/commerce.d.ts +8 -0
- package/dist/lib/commerce.js +10 -0
- package/dist/lib/earnings.d.ts +36 -0
- package/dist/lib/earnings.js +164 -0
- package/dist/lib/github-oidc.d.ts +13 -0
- package/dist/lib/github-oidc.js +41 -0
- package/dist/lib/governed-store.d.ts +43 -2
- package/dist/lib/governed-store.js +25 -1
- package/dist/lib/label-ref.js +16 -0
- package/dist/lib/managed-execution.d.ts +10 -0
- package/dist/lib/managed-execution.js +43 -0
- package/dist/lib/principal-display.d.ts +20 -0
- package/dist/lib/principal-display.js +64 -0
- package/dist/lib/space-template-source.d.ts +14 -0
- package/dist/lib/space-template-source.js +41 -0
- package/dist/lib/step-up.d.ts +21 -0
- package/dist/lib/step-up.js +44 -0
- package/dist/lib/store-acquisition.d.ts +11 -0
- package/dist/lib/store-acquisition.js +40 -0
- package/dist/lib/store-advisories.d.ts +50 -0
- package/dist/lib/store-advisories.js +62 -0
- package/dist/lib/task-closure.js +1 -1
- package/dist/lib/web-url.d.ts +11 -0
- package/dist/lib/web-url.js +14 -0
- package/dist/node_modules/@skrr-ai/data-provider/index.js +25471 -24177
- package/oclif.manifest.json +38931 -34119
- package/package.json +21 -3
package/dist/base-command.js
CHANGED
|
@@ -51,6 +51,7 @@ const auth_storage_1 = require("./lib/auth-storage");
|
|
|
51
51
|
const update_check_1 = require("./lib/update-check");
|
|
52
52
|
const web_url_1 = require("./lib/web-url");
|
|
53
53
|
const edge_error_page_1 = require("./lib/edge-error-page");
|
|
54
|
+
const step_up_1 = require("./lib/step-up");
|
|
54
55
|
const delegated_cli_1 = require("./lib/delegated-cli");
|
|
55
56
|
const dedicated_guest_1 = require("./lib/dedicated-guest");
|
|
56
57
|
const tasks_1 = require("./lib/tasks");
|
|
@@ -1074,6 +1075,21 @@ class BaseCommand extends core_1.Command {
|
|
|
1074
1075
|
retryable: false,
|
|
1075
1076
|
});
|
|
1076
1077
|
}
|
|
1078
|
+
else if (bodyCode && bodyCode === data_provider_1.STEP_UP_REQUIRED_CODE) {
|
|
1079
|
+
// Publishing a Store release, or moving the one buyers are served,
|
|
1080
|
+
// needs a recent step-up from THIS login (OSK-12275). A 403 read by
|
|
1081
|
+
// the generic branch would say "forbidden" and leave the publisher to
|
|
1082
|
+
// guess whether they lack permission, 2FA, or a fresh verification —
|
|
1083
|
+
// each of which has a different remedy, named by the body's reason.
|
|
1084
|
+
this.failWithCliError({
|
|
1085
|
+
message: say((0, step_up_1.describeStepUpRequired)((0, data_provider_1.stepUpChallengeFromBody)(body), this.config.bin)),
|
|
1086
|
+
code: bodyCode,
|
|
1087
|
+
status: e.status,
|
|
1088
|
+
exit: 2,
|
|
1089
|
+
retryable: false,
|
|
1090
|
+
details: body ?? undefined,
|
|
1091
|
+
});
|
|
1092
|
+
}
|
|
1077
1093
|
else if (bodyCode === 'AGENT_RUNTIME_UNAVAILABLE') {
|
|
1078
1094
|
// A specific agent's runtime is offline — not a platform outage, even
|
|
1079
1095
|
// though the server returns 503. Intercept before the 503→outage
|
|
@@ -94,6 +94,7 @@ export default class AgentsCreate extends BaseCommand {
|
|
|
94
94
|
'agent-ids': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
95
95
|
'network-mode': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
96
96
|
'network-agent-ids': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
97
|
+
'network-shell-write-agent-ids': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
97
98
|
'network-include-public': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
98
99
|
'character-3d-id': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
99
100
|
'scene-background': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
@@ -214,6 +214,11 @@ class AgentsCreate extends base_command_1.BaseCommand {
|
|
|
214
214
|
'agent-ids': core_1.Flags.string({ description: 'Delegated agent IDs JSON array' }),
|
|
215
215
|
'network-mode': core_1.Flags.string({ description: 'Agent network mode' }),
|
|
216
216
|
'network-agent-ids': core_1.Flags.string({ description: 'Network agent IDs JSON array' }),
|
|
217
|
+
'network-shell-write-agent-ids': core_1.Flags.string({
|
|
218
|
+
description: 'JSON array of agents in the Specific network that may run commands and create or edit ' +
|
|
219
|
+
"files when delegated to. Agents someone else wrote, and Store installs, can't unless " +
|
|
220
|
+
'listed here. Author only; [] clears.',
|
|
221
|
+
}),
|
|
217
222
|
'network-include-public': core_1.Flags.boolean({ description: 'Include public agents in network' }),
|
|
218
223
|
'character-3d-id': core_1.Flags.string({ description: '3D character ID' }),
|
|
219
224
|
'scene-background': core_1.Flags.string({ description: agent_visual_refs_1.SCENE_BACKGROUND_FLAG_HELP }),
|
|
@@ -227,7 +232,9 @@ class AgentsCreate extends base_command_1.BaseCommand {
|
|
|
227
232
|
'agent-actions': core_1.Flags.string({ description: 'Embedded actions JSON array' }),
|
|
228
233
|
'tool-policy': core_1.Flags.string({ description: 'Tool policy JSON object' }),
|
|
229
234
|
artifacts: core_1.Flags.string({ description: 'Artifacts JSON value' }),
|
|
230
|
-
'support-contact': core_1.Flags.string({
|
|
235
|
+
'support-contact': core_1.Flags.string({
|
|
236
|
+
description: 'Support contact JSON object: {"name","email","security_email"}. The Store listing shows the email and security_email of the published release.',
|
|
237
|
+
}),
|
|
231
238
|
'install-first-contact': core_1.Flags.string({ description: 'First-contact config JSON value' }),
|
|
232
239
|
'end-after-tools': core_1.Flags.boolean({ description: 'End turn after tools' }),
|
|
233
240
|
'hide-sequential-outputs': core_1.Flags.boolean({ description: 'Hide sequential outputs' }),
|
|
@@ -1,4 +1,13 @@
|
|
|
1
|
+
import type { AgentRemovalKind, DeleteAgentResponse } from '@skrr-ai/data-provider';
|
|
1
2
|
import { BaseCommand } from '../../base-command';
|
|
3
|
+
/**
|
|
4
|
+
* The confirmation question. Deleting an agent installed from the store only
|
|
5
|
+
* uninstalls it, and this used to call that irreversible (OSK-12246). `null`
|
|
6
|
+
* means the agent could not be read first, so the question covers both cases.
|
|
7
|
+
*/
|
|
8
|
+
export declare function agentRemovalQuestion(agentId: string, kind: AgentRemovalKind | null): string;
|
|
9
|
+
/** What happened, read from the server's response rather than predicted. */
|
|
10
|
+
export declare function agentRemovalReport(agentId: string, response: DeleteAgentResponse | undefined): string;
|
|
2
11
|
export default class AgentsDelete extends BaseCommand {
|
|
3
12
|
static description: string;
|
|
4
13
|
static examples: string[];
|
|
@@ -8,5 +17,10 @@ export default class AgentsDelete extends BaseCommand {
|
|
|
8
17
|
static flags: {
|
|
9
18
|
yes: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
10
19
|
};
|
|
20
|
+
/**
|
|
21
|
+
* Which of the two the request is about to do, so the prompt can say so. A
|
|
22
|
+
* failed read is not a reason to refuse: the delete reports its own error.
|
|
23
|
+
*/
|
|
24
|
+
private predictRemoval;
|
|
11
25
|
run(): Promise<void>;
|
|
12
26
|
}
|
|
@@ -1,11 +1,45 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.agentRemovalQuestion = agentRemovalQuestion;
|
|
4
|
+
exports.agentRemovalReport = agentRemovalReport;
|
|
3
5
|
const core_1 = require("@oclif/core");
|
|
4
6
|
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
5
7
|
const base_command_1 = require("../../base-command");
|
|
6
8
|
const prompt_1 = require("../../lib/prompt");
|
|
9
|
+
/**
|
|
10
|
+
* The confirmation question. Deleting an agent installed from the store only
|
|
11
|
+
* uninstalls it, and this used to call that irreversible (OSK-12246). `null`
|
|
12
|
+
* means the agent could not be read first, so the question covers both cases.
|
|
13
|
+
*/
|
|
14
|
+
function agentRemovalQuestion(agentId, kind) {
|
|
15
|
+
switch (kind) {
|
|
16
|
+
case 'deleted':
|
|
17
|
+
return `Delete agent ${agentId}? This cannot be undone.`;
|
|
18
|
+
case 'uninstalled':
|
|
19
|
+
return `Uninstall agent ${agentId}? It was installed from the store, so it is uninstalled, not deleted. Reinstalling it restores it.`;
|
|
20
|
+
case 'team_uninstalled':
|
|
21
|
+
return `Uninstall agent ${agentId}? It was installed as part of a team, so the whole team is uninstalled, not deleted. Reinstalling the team restores it.`;
|
|
22
|
+
default:
|
|
23
|
+
return `Delete agent ${agentId}? If you created it, this cannot be undone. If you installed it from the store, it is uninstalled instead, and reinstalling restores it.`;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
/** What happened, read from the server's response rather than predicted. */
|
|
27
|
+
function agentRemovalReport(agentId, response) {
|
|
28
|
+
switch ((0, data_provider_1.agentRemovalKind)(response)) {
|
|
29
|
+
case 'uninstalled':
|
|
30
|
+
return `Uninstalled agent ${agentId}. It was not deleted: reinstall it from the store to restore it.`;
|
|
31
|
+
case 'team_uninstalled': {
|
|
32
|
+
const result = response?.result;
|
|
33
|
+
const ids = result?.entityType === 'team' ? (result.installedAgentIds ?? []) : [];
|
|
34
|
+
const scope = ids.length > 0 ? ` (${ids.length} agents)` : '';
|
|
35
|
+
return `Uninstalled the team agent ${agentId} was installed with${scope}. Nothing was deleted: reinstall the team from the store to restore it.`;
|
|
36
|
+
}
|
|
37
|
+
default:
|
|
38
|
+
return `Deleted agent ${agentId}`;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
7
41
|
class AgentsDelete extends base_command_1.BaseCommand {
|
|
8
|
-
static description = 'Delete an agent (irreversible)';
|
|
42
|
+
static description = 'Delete an agent you created (irreversible), or uninstall one installed from the store (reinstalling restores it)';
|
|
9
43
|
static examples = [
|
|
10
44
|
'<%= config.bin %> agents delete <agent-id>',
|
|
11
45
|
'<%= config.bin %> agents delete <agent-id> --yes',
|
|
@@ -16,12 +50,25 @@ class AgentsDelete extends base_command_1.BaseCommand {
|
|
|
16
50
|
static flags = {
|
|
17
51
|
yes: core_1.Flags.boolean({ char: 'y', description: 'Skip confirmation prompt' }),
|
|
18
52
|
};
|
|
53
|
+
/**
|
|
54
|
+
* Which of the two the request is about to do, so the prompt can say so. A
|
|
55
|
+
* failed read is not a reason to refuse: the delete reports its own error.
|
|
56
|
+
*/
|
|
57
|
+
async predictRemoval(agentId) {
|
|
58
|
+
try {
|
|
59
|
+
return (0, data_provider_1.agentRemovalKindForAgent)(await data_provider_1.dataService.getExpandedAgentById({ agent_id: agentId }));
|
|
60
|
+
}
|
|
61
|
+
catch {
|
|
62
|
+
return null;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
19
65
|
async run() {
|
|
20
66
|
this.requireAuth();
|
|
21
67
|
const { args, flags } = await this.parse(AgentsDelete);
|
|
22
68
|
let ok;
|
|
23
69
|
try {
|
|
24
|
-
|
|
70
|
+
const predicted = flags.yes ? null : await this.predictRemoval(args.id);
|
|
71
|
+
ok = await (0, prompt_1.confirmDestructive)(agentRemovalQuestion(args.id, predicted), flags.yes);
|
|
25
72
|
}
|
|
26
73
|
catch (err) {
|
|
27
74
|
const e = err;
|
|
@@ -34,13 +81,14 @@ class AgentsDelete extends base_command_1.BaseCommand {
|
|
|
34
81
|
this.log('Cancelled.');
|
|
35
82
|
return;
|
|
36
83
|
}
|
|
84
|
+
let response;
|
|
37
85
|
try {
|
|
38
|
-
await data_provider_1.dataService.deleteAgent({ agent_id: args.id });
|
|
86
|
+
response = await data_provider_1.dataService.deleteAgent({ agent_id: args.id });
|
|
39
87
|
}
|
|
40
88
|
catch (err) {
|
|
41
89
|
this.handleApiError(err);
|
|
42
90
|
}
|
|
43
|
-
this.log(
|
|
91
|
+
this.log(agentRemovalReport(args.id, response));
|
|
44
92
|
}
|
|
45
93
|
}
|
|
46
94
|
exports.default = AgentsDelete;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { BaseCommand } from '../../../base-command';
|
|
2
|
+
/**
|
|
3
|
+
* `skrr agents eval <agent-id>` — evaluate one release against a baseline
|
|
4
|
+
* (OSK-12303).
|
|
5
|
+
*
|
|
6
|
+
* The platform runs every case several times against the release and against
|
|
7
|
+
* the baseline (no agent, or the previous release), grades each trial with the
|
|
8
|
+
* deterministic assertions in your case file, and prices it from the tokens it
|
|
9
|
+
* used. Every trial runs from the release configuration alone — none of your
|
|
10
|
+
* account's memory, persona or tone — and the no-agent baseline is the
|
|
11
|
+
* platform's default assistant. Trials run on the platform and are billed to
|
|
12
|
+
* your account; this command only decides which planned trial runs next,
|
|
13
|
+
* starts it, and waits for its result in short reads (a trial can outlast any
|
|
14
|
+
* one HTTP request), so an interrupted run continues with `--resume`.
|
|
15
|
+
*
|
|
16
|
+
* An evaluation is evidence, never a publish gate. `--list` puts it on the
|
|
17
|
+
* store listing — decided now, before any trial runs, and it cannot be taken
|
|
18
|
+
* back. The listing shows its progress at once and a result once every trial
|
|
19
|
+
* is graded, beside how many evaluations were listed and how many never
|
|
20
|
+
* finished.
|
|
21
|
+
*/
|
|
22
|
+
export default class AgentsEval extends BaseCommand {
|
|
23
|
+
static description: string;
|
|
24
|
+
static examples: string[];
|
|
25
|
+
static args: {
|
|
26
|
+
agentId: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
27
|
+
};
|
|
28
|
+
static flags: {
|
|
29
|
+
cases: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
30
|
+
release: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
31
|
+
baseline: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
32
|
+
trials: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
33
|
+
list: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
34
|
+
resume: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
35
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
36
|
+
};
|
|
37
|
+
run(): Promise<void>;
|
|
38
|
+
}
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
4
|
+
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
5
|
+
const base_command_1 = require("../../../base-command");
|
|
6
|
+
const agent_evals_1 = require("../../../lib/agent-evals");
|
|
7
|
+
/**
|
|
8
|
+
* `skrr agents eval <agent-id>` — evaluate one release against a baseline
|
|
9
|
+
* (OSK-12303).
|
|
10
|
+
*
|
|
11
|
+
* The platform runs every case several times against the release and against
|
|
12
|
+
* the baseline (no agent, or the previous release), grades each trial with the
|
|
13
|
+
* deterministic assertions in your case file, and prices it from the tokens it
|
|
14
|
+
* used. Every trial runs from the release configuration alone — none of your
|
|
15
|
+
* account's memory, persona or tone — and the no-agent baseline is the
|
|
16
|
+
* platform's default assistant. Trials run on the platform and are billed to
|
|
17
|
+
* your account; this command only decides which planned trial runs next,
|
|
18
|
+
* starts it, and waits for its result in short reads (a trial can outlast any
|
|
19
|
+
* one HTTP request), so an interrupted run continues with `--resume`.
|
|
20
|
+
*
|
|
21
|
+
* An evaluation is evidence, never a publish gate. `--list` puts it on the
|
|
22
|
+
* store listing — decided now, before any trial runs, and it cannot be taken
|
|
23
|
+
* back. The listing shows its progress at once and a result once every trial
|
|
24
|
+
* is graded, beside how many evaluations were listed and how many never
|
|
25
|
+
* finished.
|
|
26
|
+
*/
|
|
27
|
+
class AgentsEval extends base_command_1.BaseCommand {
|
|
28
|
+
static description = 'Run your cases against a release and a baseline on the platform; report pass rates and cost';
|
|
29
|
+
static examples = [
|
|
30
|
+
'<%= config.bin %> agents eval agent_abc --cases cases.json',
|
|
31
|
+
'<%= config.bin %> agents eval agent_abc --cases ./cases --release 1.2 --baseline previous-release --trials 5',
|
|
32
|
+
'<%= config.bin %> agents eval agent_abc --cases cases.json --list',
|
|
33
|
+
'<%= config.bin %> agents eval agent_abc --resume 6f1c…',
|
|
34
|
+
];
|
|
35
|
+
static args = {
|
|
36
|
+
agentId: core_1.Args.string({ required: true, ignoreStdin: true, description: 'Agent ID' }),
|
|
37
|
+
};
|
|
38
|
+
static flags = {
|
|
39
|
+
cases: core_1.Flags.string({
|
|
40
|
+
description: 'Case file (JSON list, {"cases": [...]}, or one case) or a directory of JSON case files',
|
|
41
|
+
exclusive: ['resume'],
|
|
42
|
+
}),
|
|
43
|
+
release: core_1.Flags.string({
|
|
44
|
+
description: 'Release id or version label (default: the newest release)',
|
|
45
|
+
exclusive: ['resume'],
|
|
46
|
+
}),
|
|
47
|
+
baseline: core_1.Flags.string({
|
|
48
|
+
description: 'What the release is compared against',
|
|
49
|
+
options: Object.keys(agent_evals_1.EVAL_BASELINE_FLAG_VALUES),
|
|
50
|
+
default: 'no-agent',
|
|
51
|
+
}),
|
|
52
|
+
trials: core_1.Flags.integer({
|
|
53
|
+
description: `Trials per case on each side (default ${data_provider_1.RELEASE_EVAL_LIMITS.defaultTrialsPerCase})`,
|
|
54
|
+
min: 1,
|
|
55
|
+
max: data_provider_1.RELEASE_EVAL_LIMITS.maxTrialsPerCase,
|
|
56
|
+
}),
|
|
57
|
+
list: core_1.Flags.boolean({
|
|
58
|
+
description: 'Show this evaluation on the store listing now, with a result once every trial is graded (fixed before any trial runs)',
|
|
59
|
+
default: false,
|
|
60
|
+
}),
|
|
61
|
+
resume: core_1.Flags.string({ description: 'Continue (or show) an existing evaluation by id' }),
|
|
62
|
+
json: core_1.Flags.boolean({ description: 'Output JSON' }),
|
|
63
|
+
};
|
|
64
|
+
async run() {
|
|
65
|
+
this.requireAuth();
|
|
66
|
+
const { args, flags } = await this.parse(AgentsEval);
|
|
67
|
+
const agentId = args.agentId;
|
|
68
|
+
if (!flags.cases && !flags.resume) {
|
|
69
|
+
this.error('Pass --cases <file|dir> to start an evaluation, or --resume <eval-id>.', {
|
|
70
|
+
exit: 2,
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
let evaluation;
|
|
74
|
+
try {
|
|
75
|
+
if (flags.resume) {
|
|
76
|
+
evaluation = await data_provider_1.dataService.getAgentReleaseEval(agentId, flags.resume);
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
let cases;
|
|
80
|
+
try {
|
|
81
|
+
cases = (0, agent_evals_1.readEvalCases)(flags.cases);
|
|
82
|
+
}
|
|
83
|
+
catch (error) {
|
|
84
|
+
this.error(error.message, { exit: 2 });
|
|
85
|
+
}
|
|
86
|
+
const releases = await data_provider_1.dataService.getAgentReleases(agentId);
|
|
87
|
+
const release = (0, agent_evals_1.pickRelease)(releases.data ?? [], flags.release);
|
|
88
|
+
if (!release) {
|
|
89
|
+
this.error(flags.release
|
|
90
|
+
? `No release "${flags.release}" on agent ${agentId}. See: skrr agents releases list ${agentId}`
|
|
91
|
+
: `Agent ${agentId} has no release yet. Create one with: skrr agents releases create ${agentId}`, { exit: 2 });
|
|
92
|
+
}
|
|
93
|
+
evaluation = await data_provider_1.dataService.createAgentReleaseEval({
|
|
94
|
+
agentId,
|
|
95
|
+
releaseId: release.id,
|
|
96
|
+
cases,
|
|
97
|
+
baseline: agent_evals_1.EVAL_BASELINE_FLAG_VALUES[flags.baseline],
|
|
98
|
+
trialsPerCase: flags.trials,
|
|
99
|
+
listed: flags.list,
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
catch (error) {
|
|
104
|
+
this.handleApiError(error, { subject: `agent ${agentId}` });
|
|
105
|
+
}
|
|
106
|
+
const pending = (0, agent_evals_1.pendingTrials)(evaluation);
|
|
107
|
+
const total = evaluation.summary.expectedTrials;
|
|
108
|
+
if (!flags.json) {
|
|
109
|
+
for (const line of (0, agent_evals_1.describeEvalHeader)(evaluation))
|
|
110
|
+
this.log(line);
|
|
111
|
+
if (pending.length > 0) {
|
|
112
|
+
this.log(`\nRunning ${pending.length} trial(s) on the platform, billed to your account. Interrupted? Continue with:\n skrr agents eval ${agentId} --resume ${evaluation.id}\n`);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
const evalId = evaluation.id;
|
|
116
|
+
const client = {
|
|
117
|
+
start: (entry) => data_provider_1.dataService.runAgentReleaseEvalTrial({
|
|
118
|
+
agentId,
|
|
119
|
+
evalId,
|
|
120
|
+
arm: entry.arm,
|
|
121
|
+
caseId: entry.caseId,
|
|
122
|
+
trialIndex: entry.trialIndex,
|
|
123
|
+
}),
|
|
124
|
+
observe: (options) => data_provider_1.dataService.getAgentReleaseEval(agentId, evalId, options),
|
|
125
|
+
};
|
|
126
|
+
let position = total - pending.length;
|
|
127
|
+
for (const entry of pending) {
|
|
128
|
+
position += 1;
|
|
129
|
+
try {
|
|
130
|
+
const result = await (0, agent_evals_1.runEvalTrial)(client, entry);
|
|
131
|
+
evaluation = result.evaluation;
|
|
132
|
+
if (!flags.json) {
|
|
133
|
+
this.log((0, agent_evals_1.describeTrialLine)(evaluation, result.trial, position, total, result.replayed));
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
catch (error) {
|
|
137
|
+
const resumeHint = `Graded trials are kept; continue with:\n skrr agents eval ${agentId} --resume ${evalId}`;
|
|
138
|
+
if (error instanceof agent_evals_1.EvalTrialFailedError) {
|
|
139
|
+
this.error(`${error.message}\n${resumeHint}`, { exit: 1 });
|
|
140
|
+
}
|
|
141
|
+
if (!flags.json) {
|
|
142
|
+
this.logToStderr(`\nStopped at ${entry.key}. ${resumeHint}`);
|
|
143
|
+
}
|
|
144
|
+
this.handleApiError(error, { subject: `evaluation ${evalId}` });
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
if (flags.json) {
|
|
148
|
+
this.log(this.agentJson(agentId, evaluation));
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
this.log('');
|
|
152
|
+
for (const line of (0, agent_evals_1.describeEvalReport)(evaluation))
|
|
153
|
+
this.log(line);
|
|
154
|
+
this.printAgentUrl(agentId);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
exports.default = AgentsEval;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { BaseCommand } from '../../../base-command';
|
|
2
|
+
/** `skrr agents eval list <agent-id>` — this agent's evaluations, newest first. */
|
|
3
|
+
export default class AgentsEvalList extends BaseCommand {
|
|
4
|
+
static description: string;
|
|
5
|
+
static args: {
|
|
6
|
+
agentId: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
7
|
+
};
|
|
8
|
+
static flags: {
|
|
9
|
+
release: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
10
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
11
|
+
};
|
|
12
|
+
run(): Promise<void>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
4
|
+
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
5
|
+
const base_command_1 = require("../../../base-command");
|
|
6
|
+
/** `skrr agents eval list <agent-id>` — this agent's evaluations, newest first. */
|
|
7
|
+
class AgentsEvalList extends base_command_1.BaseCommand {
|
|
8
|
+
static description = "List an agent's release evaluations";
|
|
9
|
+
static args = {
|
|
10
|
+
agentId: core_1.Args.string({ required: true, ignoreStdin: true, description: 'Agent ID' }),
|
|
11
|
+
};
|
|
12
|
+
static flags = {
|
|
13
|
+
release: core_1.Flags.string({ description: 'Only evaluations of this release id' }),
|
|
14
|
+
json: core_1.Flags.boolean({ description: 'Output JSON' }),
|
|
15
|
+
};
|
|
16
|
+
async run() {
|
|
17
|
+
this.requireAuth();
|
|
18
|
+
const { args, flags } = await this.parse(AgentsEvalList);
|
|
19
|
+
let result;
|
|
20
|
+
try {
|
|
21
|
+
result = flags.release
|
|
22
|
+
? await data_provider_1.dataService.listAgentReleaseEvals(args.agentId, flags.release)
|
|
23
|
+
: await data_provider_1.dataService.listAgentEvals(args.agentId);
|
|
24
|
+
}
|
|
25
|
+
catch (error) {
|
|
26
|
+
this.handleApiError(error, { subject: `agent ${args.agentId}` });
|
|
27
|
+
}
|
|
28
|
+
if (flags.json) {
|
|
29
|
+
this.log(this.agentJson(args.agentId, result));
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
const rows = result.data ?? [];
|
|
33
|
+
if (rows.length === 0) {
|
|
34
|
+
this.log(`No evaluations yet. Start one with: skrr agents eval ${args.agentId} --cases <file>`);
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
for (const evaluation of rows) {
|
|
38
|
+
const { summary } = evaluation;
|
|
39
|
+
this.log([
|
|
40
|
+
evaluation.id,
|
|
41
|
+
`v${evaluation.versionLabel ?? '?'} vs ${(0, data_provider_1.describeReleaseEvalBaseline)(evaluation.baseline)}`,
|
|
42
|
+
evaluation.status === 'running'
|
|
43
|
+
? `running (${summary.recordedTrials}/${summary.expectedTrials} trials)`
|
|
44
|
+
: 'completed',
|
|
45
|
+
`${(0, data_provider_1.formatReleaseEvalPassRate)(summary.candidate.passRate)} vs ${(0, data_provider_1.formatReleaseEvalPassRate)(summary.baseline.passRate)}`,
|
|
46
|
+
`${(0, data_provider_1.formatReleaseEvalCostMicros)(summary.candidate.meanCostMicros)}/run`,
|
|
47
|
+
evaluation.listed ? 'listed' : 'private',
|
|
48
|
+
].join(' '));
|
|
49
|
+
}
|
|
50
|
+
this.printAgentUrl(args.agentId);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
exports.default = AgentsEvalList;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { BaseCommand } from '../../../base-command';
|
|
2
|
+
/** `skrr agents eval show <agent-id> <eval-id>` — one evaluation's comparison and cost. */
|
|
3
|
+
export default class AgentsEvalShow extends BaseCommand {
|
|
4
|
+
static description: string;
|
|
5
|
+
static args: {
|
|
6
|
+
agentId: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
7
|
+
evalId: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
8
|
+
};
|
|
9
|
+
static flags: {
|
|
10
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
11
|
+
};
|
|
12
|
+
run(): Promise<void>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
4
|
+
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
5
|
+
const base_command_1 = require("../../../base-command");
|
|
6
|
+
const agent_evals_1 = require("../../../lib/agent-evals");
|
|
7
|
+
/** `skrr agents eval show <agent-id> <eval-id>` — one evaluation's comparison and cost. */
|
|
8
|
+
class AgentsEvalShow extends base_command_1.BaseCommand {
|
|
9
|
+
static description = 'Show one release evaluation: pass rates, baseline, per-case results and cost';
|
|
10
|
+
static args = {
|
|
11
|
+
agentId: core_1.Args.string({ required: true, ignoreStdin: true, description: 'Agent ID' }),
|
|
12
|
+
evalId: core_1.Args.string({ required: true, ignoreStdin: true, description: 'Evaluation ID' }),
|
|
13
|
+
};
|
|
14
|
+
static flags = {
|
|
15
|
+
json: core_1.Flags.boolean({ description: 'Output JSON' }),
|
|
16
|
+
};
|
|
17
|
+
async run() {
|
|
18
|
+
this.requireAuth();
|
|
19
|
+
const { args, flags } = await this.parse(AgentsEvalShow);
|
|
20
|
+
let evaluation;
|
|
21
|
+
try {
|
|
22
|
+
evaluation = await data_provider_1.dataService.getAgentReleaseEval(args.agentId, args.evalId);
|
|
23
|
+
}
|
|
24
|
+
catch (error) {
|
|
25
|
+
this.handleApiError(error, { subject: `evaluation ${args.evalId}` });
|
|
26
|
+
}
|
|
27
|
+
if (flags.json) {
|
|
28
|
+
this.log(this.agentJson(args.agentId, evaluation));
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
for (const line of (0, agent_evals_1.describeEvalReport)(evaluation))
|
|
32
|
+
this.log(line);
|
|
33
|
+
this.printAgentUrl(args.agentId);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
exports.default = AgentsEvalShow;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { BaseCommand } from '../../base-command';
|
|
2
|
+
/**
|
|
3
|
+
* Bring a Claude Code asset in: a subagent (`.claude/agents/<name>.md`) or a
|
|
4
|
+
* skill (`SKILL.md`, or the directory holding one).
|
|
5
|
+
*
|
|
6
|
+
* A subagent becomes an agent spec document — printed or written with
|
|
7
|
+
* `--output`, or pushed onto an existing agent with `--agent` (the same push
|
|
8
|
+
* as `agents push`). A skill becomes a skill in your library, attached to
|
|
9
|
+
* `--agent` when given.
|
|
10
|
+
*
|
|
11
|
+
* Either way, `hooks` and MCP server commands are NEVER carried: they run on
|
|
12
|
+
* the machine that loads the file, and a portable spec is read on machines
|
|
13
|
+
* that are not yours. What was left out is printed, one line per key, so the
|
|
14
|
+
* import says what it did not do.
|
|
15
|
+
*/
|
|
16
|
+
export default class AgentsImport extends BaseCommand {
|
|
17
|
+
static description: string;
|
|
18
|
+
static examples: string[];
|
|
19
|
+
static args: {
|
|
20
|
+
path: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
21
|
+
};
|
|
22
|
+
static flags: {
|
|
23
|
+
agent: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
24
|
+
output: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
25
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
26
|
+
};
|
|
27
|
+
run(): Promise<void>;
|
|
28
|
+
private convert;
|
|
29
|
+
private printDropped;
|
|
30
|
+
/**
|
|
31
|
+
* @param sourceLabel - how messages name the source
|
|
32
|
+
* @param filePath - the file, when there is one; its name is the fallback
|
|
33
|
+
* agent name. stdin has none, so its frontmatter must carry `name`.
|
|
34
|
+
*/
|
|
35
|
+
private importAgent;
|
|
36
|
+
private importSkill;
|
|
37
|
+
}
|