@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
|
@@ -3,11 +3,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const core_1 = require("@oclif/core");
|
|
4
4
|
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
5
5
|
const base_command_1 = require("../../base-command");
|
|
6
|
+
const prompt_1 = require("../../lib/prompt");
|
|
6
7
|
class SubscriptionsSubscribe extends base_command_1.BaseCommand {
|
|
7
|
-
static description = 'Subscribe to a published
|
|
8
|
+
static description = 'Subscribe to a published Service — pays its first period from your balance, installs your own managed instance, and opens the obligation it is delivered through. Shows the price and asks you to confirm first.';
|
|
8
9
|
static examples = [
|
|
9
10
|
'<%= config.bin %> subscriptions subscribe agent_abc123',
|
|
10
|
-
'<%= config.bin %> subscriptions subscribe agent_abc123 --
|
|
11
|
+
'<%= config.bin %> subscriptions subscribe agent_abc123 --space space_xyz --yes --json',
|
|
12
|
+
'<%= config.bin %> subscriptions subscribe agent_abc123 --grant cegrant_abc',
|
|
11
13
|
'<%= config.bin %> subscriptions subscribe agent_abc123 --space space_xyz --json',
|
|
12
14
|
];
|
|
13
15
|
static args = {
|
|
@@ -19,24 +21,75 @@ class SubscriptionsSubscribe extends base_command_1.BaseCommand {
|
|
|
19
21
|
};
|
|
20
22
|
static flags = {
|
|
21
23
|
json: core_1.Flags.boolean({ description: 'Output as JSON' }),
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}),
|
|
26
|
-
'expires-at': core_1.Flags.string({ description: 'Paid-through date (ISO 8601)' }),
|
|
24
|
+
// No --billing-mode and no --expires-at: who pays for the compute is
|
|
25
|
+
// declared by the Service's offer, and the term and price are resolved
|
|
26
|
+
// server-side — a caller-sent one is refused (C11, OSK-12276).
|
|
27
27
|
space: core_1.Flags.string({ description: 'Space the service should work in' }),
|
|
28
|
+
grant: core_1.Flags.string({
|
|
29
|
+
description: 'Activate a period that was already paid (its grant id) instead of buying one. Nothing is charged.',
|
|
30
|
+
}),
|
|
31
|
+
trial: core_1.Flags.boolean({
|
|
32
|
+
description: 'Start the card-free trial instead of buying: 7 days, nothing charged, does not renew (OSK-12281).',
|
|
33
|
+
}),
|
|
34
|
+
yes: core_1.Flags.boolean({
|
|
35
|
+
char: 'y',
|
|
36
|
+
description: 'Confirm the purchase without prompting. The price and refund terms are still printed.',
|
|
37
|
+
}),
|
|
28
38
|
};
|
|
29
39
|
async run() {
|
|
30
40
|
this.requireAuth();
|
|
31
41
|
const { args, flags } = await this.parse(SubscriptionsSubscribe);
|
|
42
|
+
if (flags.trial) {
|
|
43
|
+
return this.startTrial(args.agentId, flags);
|
|
44
|
+
}
|
|
45
|
+
let pin;
|
|
46
|
+
if (!flags.grant) {
|
|
47
|
+
// What subscribing would charge NOW, resolved by the server the way the
|
|
48
|
+
// purchase resolves it. The purchase then pins what was shown, so a
|
|
49
|
+
// Service whose price moved in between is refused rather than charged.
|
|
50
|
+
let quote;
|
|
51
|
+
try {
|
|
52
|
+
quote = await data_provider_1.dataService.getStoreAgentServiceOffer(args.agentId);
|
|
53
|
+
}
|
|
54
|
+
catch (err) {
|
|
55
|
+
this.handleApiError(err);
|
|
56
|
+
}
|
|
57
|
+
if (!quote) {
|
|
58
|
+
this.error('Could not read the price of this Service, so nothing was bought.', {
|
|
59
|
+
exit: 1,
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
const name = quote.listingName || args.agentId;
|
|
63
|
+
const version = quote.versionLabel ? ` v${quote.versionLabel}` : '';
|
|
64
|
+
const price = (0, data_provider_1.formatStoreServicePrice)(quote.price, quote.interval);
|
|
65
|
+
// Printed before any prompt and even with --yes, so a scripted purchase
|
|
66
|
+
// still leaves the terms it agreed to in its own output.
|
|
67
|
+
this.logToStderr(`${name}${version} is a Service.`);
|
|
68
|
+
this.logToStderr(` Price: ${price} (${quote.currency})`);
|
|
69
|
+
this.logToStderr(` Billing: charged from your balance now, then every ${quote.interval} until you cancel`);
|
|
70
|
+
this.logToStderr(` Refunds: ${(0, data_provider_1.describeStoreAcquisitionRefundTerms)(quote.refundTerms)}`);
|
|
71
|
+
this.logToStderr(` Buyer terms: ${quote.buyerTerms
|
|
72
|
+
? `${quote.buyerTerms.termsVersion} — ${quote.buyerTerms.artifactUri}`
|
|
73
|
+
: 'not configured'}`);
|
|
74
|
+
this.logToStderr(` Offer: ${quote.offerVersionId}`);
|
|
75
|
+
if (!quote.purchasable) {
|
|
76
|
+
this.error('Service subscriptions are not open for purchase yet. Nothing was bought.', {
|
|
77
|
+
exit: 1,
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
const confirmed = await (0, prompt_1.confirmDestructive)(`Subscribe to ${name} for ${price} and accept the buyer terms?`, flags.yes).catch((err) => this.error(err.message, { exit: err.exit ?? 1 }));
|
|
81
|
+
if (!confirmed) {
|
|
82
|
+
this.log('Cancelled. Nothing was bought.');
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
pin = { expectedOfferVersionId: quote.offerVersionId, expectedPrice: quote.price };
|
|
86
|
+
}
|
|
32
87
|
let response;
|
|
33
88
|
try {
|
|
34
89
|
response = await data_provider_1.dataService.subscribeToStoreAgent(args.agentId, {
|
|
35
|
-
...(flags['billing-mode']
|
|
36
|
-
? { billingMode: flags['billing-mode'] }
|
|
37
|
-
: {}),
|
|
38
|
-
...(flags['expires-at'] ? { expiresAt: flags['expires-at'] } : {}),
|
|
39
90
|
...(flags.space ? { spaceId: flags.space } : {}),
|
|
91
|
+
...(flags.grant ? { grantId: flags.grant } : {}),
|
|
92
|
+
...(pin ?? {}),
|
|
40
93
|
});
|
|
41
94
|
}
|
|
42
95
|
catch (err) {
|
|
@@ -48,7 +101,10 @@ class SubscriptionsSubscribe extends base_command_1.BaseCommand {
|
|
|
48
101
|
}
|
|
49
102
|
this.log(`Subscribed. Entitlement ${response?.entitlementId}`);
|
|
50
103
|
this.log(`Your instance: ${response?.instanceAgentId ?? '-'}`);
|
|
51
|
-
|
|
104
|
+
if (response?.expiresAt) {
|
|
105
|
+
this.log(`Paid through: ${response.expiresAt}`);
|
|
106
|
+
}
|
|
107
|
+
this.log(`Compute paid by: ${(0, data_provider_1.describeStoreComputePayer)(response?.computePayer)}`);
|
|
52
108
|
if (response?.commitmentId) {
|
|
53
109
|
// The commitment is the thing you can hold the service to — surface it,
|
|
54
110
|
// because "is it working" is answered there and nowhere else.
|
|
@@ -59,5 +115,78 @@ class SubscriptionsSubscribe extends base_command_1.BaseCommand {
|
|
|
59
115
|
this.log('Note: the subscription is live but its obligation has not been created yet. It is resumable and refundable; retry to finish opening it.');
|
|
60
116
|
}
|
|
61
117
|
}
|
|
118
|
+
/**
|
|
119
|
+
* The card-free trial path (OSK-12281). The trial's own terms — days, the
|
|
120
|
+
* platform compute budget — come from the quote's `trial` block the server
|
|
121
|
+
* computed for this caller, so what is printed is what the write will do.
|
|
122
|
+
*/
|
|
123
|
+
async startTrial(agentId, flags) {
|
|
124
|
+
let quote;
|
|
125
|
+
try {
|
|
126
|
+
quote = await data_provider_1.dataService.getStoreAgentServiceOffer(agentId);
|
|
127
|
+
}
|
|
128
|
+
catch (err) {
|
|
129
|
+
this.handleApiError(err);
|
|
130
|
+
}
|
|
131
|
+
const trial = quote?.trial;
|
|
132
|
+
if (!quote || !trial) {
|
|
133
|
+
this.error('This Service does not offer a trial, or yours cannot be read. Nothing happened.', {
|
|
134
|
+
exit: 1,
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
const name = quote.listingName || agentId;
|
|
138
|
+
if (trial.state === 'active_trial') {
|
|
139
|
+
this.logToStderr(`Your trial of ${name} is already running — it ends ${trial.endsAt}.`);
|
|
140
|
+
}
|
|
141
|
+
else if (trial.requiresPaymentMethod) {
|
|
142
|
+
this.error('This Service\u2019s trial requires a payment method — the card-free trial cannot start it.', {
|
|
143
|
+
exit: 1,
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
else if (trial.state !== 'eligible') {
|
|
147
|
+
const TRIAL_BLOCKED_REASONS = {
|
|
148
|
+
already_used: 'you already used your trial for this product family',
|
|
149
|
+
subscribed: 'you already subscribe to this Service',
|
|
150
|
+
purchased: 'you already bought this Service',
|
|
151
|
+
copy_owned: 'you already own a copy of this agent in this workspace',
|
|
152
|
+
};
|
|
153
|
+
const why = TRIAL_BLOCKED_REASONS[trial.state] ||
|
|
154
|
+
'the server did not name a reason this trial is closed to you';
|
|
155
|
+
this.error(`This trial cannot be started: ${why}.`, { exit: 1 });
|
|
156
|
+
}
|
|
157
|
+
// Printed before any prompt and even with --yes: the terms it agreed to.
|
|
158
|
+
this.logToStderr(`${name} offers a ${trial.durationDays}-day free trial.`);
|
|
159
|
+
this.logToStderr(' Card: not required — nothing is charged');
|
|
160
|
+
this.logToStderr(' Renewal: none — it stops working when the trial ends');
|
|
161
|
+
this.logToStderr(` Compute: covered by the platform${trial.computeBudgetMicros
|
|
162
|
+
? `, up to ${(0, data_provider_1.formatStoreAcquisitionPrice)(trial.computeBudgetMicros)}`
|
|
163
|
+
: ''}`);
|
|
164
|
+
this.logToStderr(' Limit: one trial per product family');
|
|
165
|
+
const confirmed = await (0, prompt_1.confirmDestructive)(`Start the ${trial.durationDays}-day free trial of ${name}?`, flags.yes ?? false).catch((err) => this.error(err.message, { exit: err.exit ?? 1 }));
|
|
166
|
+
if (!confirmed) {
|
|
167
|
+
this.log('Cancelled. Nothing was started.');
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
170
|
+
let response;
|
|
171
|
+
try {
|
|
172
|
+
response = await data_provider_1.dataService.startStoreAgentServiceTrial(agentId, {
|
|
173
|
+
...(flags.space ? { spaceId: flags.space } : {}),
|
|
174
|
+
expectedOfferVersionId: quote.offerVersionId,
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
catch (err) {
|
|
178
|
+
this.handleApiError(err);
|
|
179
|
+
}
|
|
180
|
+
if (flags.json) {
|
|
181
|
+
this.log(JSON.stringify(response, null, 2));
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
this.log(`Trial started. Entitlement ${response?.entitlementId}`);
|
|
185
|
+
this.log(`Your instance: ${response?.instanceAgentId ?? '-'}`);
|
|
186
|
+
if (response?.expiresAt) {
|
|
187
|
+
this.log(`Trial ends: ${response.expiresAt} (it does not renew)`);
|
|
188
|
+
}
|
|
189
|
+
this.log(`Compute paid by: ${(0, data_provider_1.describeStoreComputePayer)(response?.computePayer)}`);
|
|
190
|
+
}
|
|
62
191
|
}
|
|
63
192
|
exports.default = SubscriptionsSubscribe;
|
|
@@ -4,6 +4,7 @@ const core_1 = require("@oclif/core");
|
|
|
4
4
|
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
5
5
|
const base_command_1 = require("../../../base-command");
|
|
6
6
|
const format_1 = require("../../../lib/format");
|
|
7
|
+
const principal_display_1 = require("../../../lib/principal-display");
|
|
7
8
|
const task_resolver_1 = require("../../../lib/task-resolver");
|
|
8
9
|
class TasksCommentsList extends base_command_1.BaseCommand {
|
|
9
10
|
static description = 'List comments on a task';
|
|
@@ -67,9 +68,16 @@ class TasksCommentsList extends base_command_1.BaseCommand {
|
|
|
67
68
|
this.log('No comments.');
|
|
68
69
|
return;
|
|
69
70
|
}
|
|
71
|
+
// The AUTHOR column is for "who" — resolve ids to names where the task's
|
|
72
|
+
// space roster (or the caller's own record) can see them; ids that cannot
|
|
73
|
+
// resolve print unchanged.
|
|
74
|
+
const principalNames = await (0, principal_display_1.resolvePrincipalNames)(items.map((c) => c.authorAgentId ?? c.authorUserId ?? c.author));
|
|
70
75
|
const rows = items.map((c) => ({
|
|
71
76
|
time: (0, format_1.localTime)(c.createdAt),
|
|
72
|
-
|
|
77
|
+
// The server enriches authors directly (_authorUserName/_authorAgentName);
|
|
78
|
+
// the roster lookup is the fallback for a deployment that predates it.
|
|
79
|
+
author: String(c._authorUserName ?? c._authorAgentName ?? '') ||
|
|
80
|
+
(0, principal_display_1.displayPrincipal)(c.authorAgentId ?? c.authorUserId ?? c.author, principalNames),
|
|
73
81
|
body: (0, format_1.truncate)(String(c.body ?? c.content ?? '-'), 60),
|
|
74
82
|
id: String(c.id ?? c._id ?? '-'),
|
|
75
83
|
}));
|
|
@@ -60,6 +60,18 @@ class TasksLabelsAttach extends base_command_1.BaseCommand {
|
|
|
60
60
|
this.error(err.message, { exit: 1 });
|
|
61
61
|
this.handleApiError(err);
|
|
62
62
|
}
|
|
63
|
+
// Output names labels, not ids — the reader wants "what", not "which uuid".
|
|
64
|
+
// resolveLabelRefs already fetched the vocabulary; fetching again here costs
|
|
65
|
+
// one request and keeps the failure mode (unreadable vocabulary → ids) safe.
|
|
66
|
+
let nameById;
|
|
67
|
+
try {
|
|
68
|
+
const vocabulary = await (0, label_ref_1.collectLabelVocabulary)({ applicableTo: 'task' });
|
|
69
|
+
nameById = new Map(vocabulary.map((row) => [row.id, row.name]));
|
|
70
|
+
}
|
|
71
|
+
catch {
|
|
72
|
+
nameById = undefined;
|
|
73
|
+
}
|
|
74
|
+
const nameFor = (id) => nameById?.get(id) ?? id;
|
|
63
75
|
let current;
|
|
64
76
|
try {
|
|
65
77
|
current = await data_provider_1.dataService.getTask(args.id, { enrich: false });
|
|
@@ -72,7 +84,8 @@ class TasksLabelsAttach extends base_command_1.BaseCommand {
|
|
|
72
84
|
// genuinely-new ids in the order they were passed.
|
|
73
85
|
const merged = Array.from(new Set([...existing, ...incoming]));
|
|
74
86
|
if (merged.length === existing.length) {
|
|
75
|
-
|
|
87
|
+
const names = incoming.map((id) => nameFor(id));
|
|
88
|
+
this.log(`No change — labels already attached: ${names.join(', ')}`);
|
|
76
89
|
if (flags.json)
|
|
77
90
|
this.log(JSON.stringify(current, null, 2));
|
|
78
91
|
return;
|
|
@@ -93,7 +106,7 @@ class TasksLabelsAttach extends base_command_1.BaseCommand {
|
|
|
93
106
|
}
|
|
94
107
|
const t = updated;
|
|
95
108
|
const ref = t.identifier ?? (t.taskNumber ? `#${t.taskNumber}` : '');
|
|
96
|
-
this.log(`Attached ${merged.length - existing.length} label(s) to task ${t.id ?? args.id}${ref ? ` (${ref})` : ''} — now: ${merged.join(', ')}`);
|
|
109
|
+
this.log(`Attached ${merged.length - existing.length} label(s) to task ${t.id ?? args.id}${ref ? ` (${ref})` : ''} — now: ${merged.map(nameFor).join(', ')}`);
|
|
97
110
|
}
|
|
98
111
|
}
|
|
99
112
|
exports.default = TasksLabelsAttach;
|
|
@@ -16,6 +16,7 @@ const task_resolver_1 = require("../../lib/task-resolver");
|
|
|
16
16
|
const web_url_1 = require("../../lib/web-url");
|
|
17
17
|
const html_text_1 = require("../../lib/html-text");
|
|
18
18
|
const label_ref_1 = require("../../lib/label-ref");
|
|
19
|
+
const principal_display_1 = require("../../lib/principal-display");
|
|
19
20
|
const format_1 = require("../../lib/format");
|
|
20
21
|
/**
|
|
21
22
|
* Where to look next — as COMMANDS, not as facts about the task.
|
|
@@ -472,10 +473,21 @@ class TasksShow extends base_command_1.BaseCommand {
|
|
|
472
473
|
}
|
|
473
474
|
}
|
|
474
475
|
this.log(`Labels: ${labelsLine(labelIds, labelNames)}`);
|
|
475
|
-
|
|
476
|
+
// Principals print as names, not ObjectIds — same rule as labels above: a
|
|
477
|
+
// roster that cannot be read prints ids rather than failing the command.
|
|
478
|
+
const principalIds = [
|
|
479
|
+
t.author,
|
|
480
|
+
t.dri?.resolved?.id,
|
|
481
|
+
...(Array.isArray(t.assigneeAgentIds) ? t.assigneeAgentIds : []),
|
|
482
|
+
...(Array.isArray(t.assigneeUserIds) ? t.assigneeUserIds : []),
|
|
483
|
+
];
|
|
484
|
+
const principalNames = await (0, principal_display_1.resolvePrincipalNames)(principalIds, {
|
|
485
|
+
spaceId: t.spaceId ?? null,
|
|
486
|
+
});
|
|
487
|
+
this.log(`Author: ${t.authorDisplayName || (0, principal_display_1.displayPrincipal)(t.author, principalNames)}`);
|
|
476
488
|
const dri = t.dri;
|
|
477
489
|
if (dri?.resolved) {
|
|
478
|
-
this.log(`DRI: ${String(dri.resolved.kind ?? '-')} ${
|
|
490
|
+
this.log(`DRI: ${String(dri.resolved.kind ?? '-')} ${(0, principal_display_1.displayPrincipal)(dri.resolved.id, principalNames)} (${String(dri.source ?? '-')})`);
|
|
479
491
|
}
|
|
480
492
|
else {
|
|
481
493
|
this.log('DRI: -');
|
|
@@ -484,7 +496,9 @@ class TasksShow extends base_command_1.BaseCommand {
|
|
|
484
496
|
// live. It was only reachable via `--json | jq .conversationId`, so the
|
|
485
497
|
// transcript was effectively undiscoverable from the human view.
|
|
486
498
|
this.log(`Convo: ${t.conversationId ?? '-'}`);
|
|
487
|
-
this.log(`Assignees: ${agents.length} agent(s), ${users.length} user(s)${agents.length + users.length > 0
|
|
499
|
+
this.log(`Assignees: ${agents.length} agent(s), ${users.length} user(s)${agents.length + users.length > 0
|
|
500
|
+
? ` — ${[...agents, ...users].map((id) => (0, principal_display_1.displayPrincipal)(id, principalNames)).join(', ')}`
|
|
501
|
+
: ''}`);
|
|
488
502
|
const actionability = t.actionability;
|
|
489
503
|
if (actionability) {
|
|
490
504
|
this.log(`Next action: ${actionability.nextActor ?? '-'} · ${actionability.state ?? '-'} · ${actionability.reasonCode ?? '-'}`);
|
|
@@ -277,9 +277,12 @@ class TasksUpdate extends base_command_1.BaseCommand {
|
|
|
277
277
|
body.expectations !== undefined ||
|
|
278
278
|
flags.description !== undefined ||
|
|
279
279
|
body.description !== undefined;
|
|
280
|
+
// Hoisted so the post-write notice can still say how much the edit cost
|
|
281
|
+
// when `--yes` skipped the prompt — the revocation happens either way.
|
|
282
|
+
let settledSpecAssessments = 0;
|
|
283
|
+
let acceptanceUnreadable = false;
|
|
280
284
|
if (changesSpec) {
|
|
281
285
|
let settled = [];
|
|
282
|
-
let unreadable = false;
|
|
283
286
|
try {
|
|
284
287
|
const acceptance = await data_provider_1.dataService.getTaskAcceptance(taskIdentity.id);
|
|
285
288
|
settled = acceptance.expectations.filter((e) => e.assessmentId);
|
|
@@ -287,11 +290,12 @@ class TasksUpdate extends base_command_1.BaseCommand {
|
|
|
287
290
|
catch {
|
|
288
291
|
// An unreadable acceptance is not a reason to refuse the edit. Warn
|
|
289
292
|
// without a number rather than inventing one or blocking the write.
|
|
290
|
-
|
|
293
|
+
acceptanceUnreadable = true;
|
|
291
294
|
}
|
|
292
|
-
|
|
295
|
+
settledSpecAssessments = settled.length;
|
|
296
|
+
if ((acceptanceUnreadable || settled.length > 0) && !flags.yes) {
|
|
293
297
|
const noun = settled.length === 1 ? 'assessment' : 'assessments';
|
|
294
|
-
const count =
|
|
298
|
+
const count = acceptanceUnreadable ? 'Any existing' : `${settled.length} existing`;
|
|
295
299
|
const field = expectationsPatch !== undefined || body.expectations !== undefined
|
|
296
300
|
? 'Changing Expectations'
|
|
297
301
|
: 'Changing the description';
|
|
@@ -478,6 +482,13 @@ class TasksUpdate extends base_command_1.BaseCommand {
|
|
|
478
482
|
const t = updated;
|
|
479
483
|
const ref = t.identifier ?? (t.taskNumber ? `#${t.taskNumber}` : '');
|
|
480
484
|
this.log(`Updated task ${t.id ?? t._id ?? taskIdentity.id}${ref ? ` (${ref})` : ''} — ${t.title ?? '(no title)'}`);
|
|
485
|
+
// `--yes` asserts the revocation; it does not erase that it happened.
|
|
486
|
+
// Report the cost after the write too, or the evidence is silently gone.
|
|
487
|
+
if (changesSpec && flags.yes && (settledSpecAssessments > 0 || acceptanceUnreadable)) {
|
|
488
|
+
this.log(`Specification advanced — ${settledSpecAssessments > 0
|
|
489
|
+
? `${settledSpecAssessments} recorded assessment(s) no longer count`
|
|
490
|
+
: 'any recorded assessments no longer count'} and must be recorded again.`);
|
|
491
|
+
}
|
|
481
492
|
}
|
|
482
493
|
}
|
|
483
494
|
exports.default = TasksUpdate;
|
|
@@ -179,7 +179,11 @@ class TasksUpdatesAdd extends base_command_1.BaseCommand {
|
|
|
179
179
|
}
|
|
180
180
|
if (flags.json)
|
|
181
181
|
return this.log(JSON.stringify(result, null, 2));
|
|
182
|
-
|
|
182
|
+
// A replayed idempotency key answers the SAME stored record — say so,
|
|
183
|
+
// otherwise a retried write reads as a second write.
|
|
184
|
+
this.log(result?.idempotent
|
|
185
|
+
? `Update already recorded on ${task.id} (idempotent replay — no new write).`
|
|
186
|
+
: `Recorded ${flags.type} Update on ${task.id}${result?.resumePoint ? ' with a Resume Point' : ''}.`);
|
|
183
187
|
}
|
|
184
188
|
}
|
|
185
189
|
exports.default = TasksUpdatesAdd;
|
package/dist/lib/agent-config.js
CHANGED
|
@@ -77,6 +77,7 @@ function mergeAgentConfigFlags(body, flags) {
|
|
|
77
77
|
'model-parameters': 'model_parameters',
|
|
78
78
|
'agent-ids': 'agent_ids',
|
|
79
79
|
'network-agent-ids': 'network_agent_ids',
|
|
80
|
+
'network-shell-write-agent-ids': 'network_shell_write_agent_ids',
|
|
80
81
|
'agent-actions': 'agentActions',
|
|
81
82
|
skills: 'skills',
|
|
82
83
|
'tool-policy': 'toolPolicy',
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `skrr agents eval` — the pure half (OSK-12303): reading a case file, choosing
|
|
3
|
+
* the release, and rendering what the platform reports back.
|
|
4
|
+
*
|
|
5
|
+
* The CLI never grades anything. It uploads the cases once, then asks the API
|
|
6
|
+
* to run each planned trial; the API executes, grades and prices every trial
|
|
7
|
+
* itself, so nothing printed here is a number the CLI computed from its own
|
|
8
|
+
* observations.
|
|
9
|
+
*/
|
|
10
|
+
import type { AgentRelease, AgentReleaseEval, GetAgentReleaseEvalOptions, ReleaseEvalBaselineKind, ReleaseEvalCase, ReleaseEvalTrial, ReleaseEvalTrialPlanEntry, RunAgentReleaseEvalTrialResponse } from '@skrr-ai/data-provider';
|
|
11
|
+
/** CLI spelling → API spelling. */
|
|
12
|
+
export declare const EVAL_BASELINE_FLAG_VALUES: Record<string, ReleaseEvalBaselineKind>;
|
|
13
|
+
/**
|
|
14
|
+
* Read `--cases`: a JSON file (a list, `{cases: [...]}`, or one case) or a
|
|
15
|
+
* directory of such files, read in name order — so the repo's golden set
|
|
16
|
+
* directory is a valid argument as-is.
|
|
17
|
+
*/
|
|
18
|
+
export declare function readEvalCases(casesPath: string): ReleaseEvalCase[];
|
|
19
|
+
/**
|
|
20
|
+
* `--release`: an id, a version label (`1.2` or `v1.2`), or omitted for the
|
|
21
|
+
* newest release. Releases arrive newest first.
|
|
22
|
+
*/
|
|
23
|
+
export declare function pickRelease(releases: AgentRelease[], wanted?: string): AgentRelease | undefined;
|
|
24
|
+
/** The planned trials that have no graded result yet, in run order. */
|
|
25
|
+
export declare function pendingTrials(evaluation: AgentReleaseEval): ReleaseEvalTrialPlanEntry[];
|
|
26
|
+
export declare function describeTrialLine(evaluation: AgentReleaseEval, trial: ReleaseEvalTrial, position: number, total: number, replayed?: boolean): string;
|
|
27
|
+
export declare function describeEvalHeader(evaluation: AgentReleaseEval): string[];
|
|
28
|
+
/** The comparison, the per-case table, and the provenance lines. */
|
|
29
|
+
export declare function describeEvalReport(evaluation: AgentReleaseEval): string[];
|
|
30
|
+
/**
|
|
31
|
+
* The two calls one trial needs. Injected so the loop is testable without a
|
|
32
|
+
* server: `start` is `dataService.runAgentReleaseEvalTrial`, `observe` is
|
|
33
|
+
* `dataService.getAgentReleaseEval` with `{ trial, waitMs }`.
|
|
34
|
+
*/
|
|
35
|
+
export type EvalTrialClient = {
|
|
36
|
+
start: (entry: ReleaseEvalTrialPlanEntry) => Promise<RunAgentReleaseEvalTrialResponse>;
|
|
37
|
+
observe: (options: GetAgentReleaseEvalOptions) => Promise<AgentReleaseEval>;
|
|
38
|
+
sleep?: (ms: number) => Promise<void>;
|
|
39
|
+
now?: () => number;
|
|
40
|
+
};
|
|
41
|
+
export type EvalTrialOutcome = {
|
|
42
|
+
trial: ReleaseEvalTrial;
|
|
43
|
+
evaluation: AgentReleaseEval;
|
|
44
|
+
replayed: boolean;
|
|
45
|
+
};
|
|
46
|
+
/** A trial that ended without a result; `message` is the server's reason. */
|
|
47
|
+
export declare class EvalTrialFailedError extends Error {
|
|
48
|
+
readonly key: string;
|
|
49
|
+
constructor(key: string, message: string);
|
|
50
|
+
}
|
|
51
|
+
/** How long one trial is observed before the CLI gives up and says how to resume. */
|
|
52
|
+
export declare const EVAL_TRIAL_OBSERVE_LIMIT_MS: number;
|
|
53
|
+
/**
|
|
54
|
+
* Whether a failed START may still have started the trial, or found it
|
|
55
|
+
* running: an edge timeout or dropped connection (the request may have landed),
|
|
56
|
+
* or the server saying another run holds it. Either way the answer is to
|
|
57
|
+
* observe the trial, not to give up — or to start a second run.
|
|
58
|
+
*/
|
|
59
|
+
export declare function isTrialStillRunningError(error: unknown): boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Run ONE planned trial to a graded result: start it, then observe it with
|
|
62
|
+
* bounded reads until it is graded. No request waits on the run itself.
|
|
63
|
+
*
|
|
64
|
+
* - A trial already graded comes back at once (`replayed`).
|
|
65
|
+
* - A start that fails in a way that may have started it (an edge 504, a
|
|
66
|
+
* dropped connection) or that finds it running elsewhere is observed.
|
|
67
|
+
* - A run that errors is recorded by the server; that reason is thrown as an
|
|
68
|
+
* `EvalTrialFailedError`, and a re-run is the caller's choice (`--resume`).
|
|
69
|
+
* - A claim whose run is gone (`stale`) is started again, which retakes it.
|
|
70
|
+
*/
|
|
71
|
+
export declare function runEvalTrial(client: EvalTrialClient, entry: ReleaseEvalTrialPlanEntry): Promise<EvalTrialOutcome>;
|