@skrr-ai/cli 0.1.72 → 0.1.74
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/commands/agents/releases/create.js +57 -11
- package/dist/commands/spaces/snapshot.d.ts +1 -0
- package/dist/commands/spaces/snapshot.js +7 -2
- package/dist/commands/store/install.js +15 -0
- package/dist/commands/store/installs.js +1 -2
- package/dist/commands/store/signals.js +3 -0
- package/dist/commands/store/uninstall.js +1 -1
- package/dist/commands/subscriptions/subscribe.js +2 -2
- package/dist/node_modules/@skrr-ai/data-provider/index.js +15 -9
- package/oclif.manifest.json +28102 -28094
- package/package.json +1 -1
|
@@ -3,6 +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
|
+
function betaWriteMayHaveCommitted(error) {
|
|
7
|
+
const failure = error;
|
|
8
|
+
const status = failure?.status ?? failure?.response?.status;
|
|
9
|
+
return status === 408 || (typeof status === 'number' && status >= 500) ||
|
|
10
|
+
['ECONNRESET', 'ETIMEDOUT', 'EAI_AGAIN', 'ENOTFOUND'].includes(failure?.code ?? '') ||
|
|
11
|
+
/fetch failed|socket hang up|timed? ?out/i.test(failure?.message ?? '');
|
|
12
|
+
}
|
|
6
13
|
class AgentsReleasesCreate extends base_command_1.BaseCommand {
|
|
7
14
|
static description = 'Create a private agent release';
|
|
8
15
|
static args = { agentId: core_1.Args.string({ required: true, ignoreStdin: true }) };
|
|
@@ -27,24 +34,63 @@ class AgentsReleasesCreate extends base_command_1.BaseCommand {
|
|
|
27
34
|
exit: 2,
|
|
28
35
|
});
|
|
29
36
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
let result;
|
|
38
|
+
let recoveredAfterTransportFailure = false;
|
|
39
|
+
if (flags.beta) {
|
|
40
|
+
try {
|
|
41
|
+
result = await data_provider_1.dataService.createBetaAgentRelease({
|
|
42
|
+
agentId: args.agentId,
|
|
43
|
+
changelog: flags.changelog,
|
|
44
|
+
versionMajor: flags['version-major'],
|
|
45
|
+
versionMinor: flags['version-minor'],
|
|
46
|
+
releaseId: flags['release-id'],
|
|
47
|
+
offerVersionId: flags['offer-version-id'],
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
catch (error) {
|
|
51
|
+
if (!betaWriteMayHaveCommitted(error))
|
|
52
|
+
throw error;
|
|
53
|
+
const releaseId = flags['release-id'];
|
|
54
|
+
let verification = 'unavailable';
|
|
55
|
+
try {
|
|
56
|
+
const releases = await data_provider_1.dataService.getAgentReleases(args.agentId);
|
|
57
|
+
const found = releases.data?.find((release) => release.id === releaseId);
|
|
58
|
+
if (found) {
|
|
59
|
+
result = found;
|
|
60
|
+
recoveredAfterTransportFailure = true;
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
63
|
+
verification = 'not_observed';
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
catch {
|
|
67
|
+
// A failed read cannot settle whether the write reached the server.
|
|
68
|
+
}
|
|
69
|
+
if (!result) {
|
|
70
|
+
const suggestion = `Run skrr agents releases list ${args.agentId} --json and check for ${releaseId} before retrying.`;
|
|
71
|
+
this.failWithCliError({
|
|
72
|
+
message: `The beta publish request ended before the server confirmed its outcome. ${suggestion}`,
|
|
73
|
+
code: 'BETA_RELEASE_OUTCOME_UNCONFIRMED',
|
|
74
|
+
exit: 1,
|
|
75
|
+
retryable: false,
|
|
76
|
+
details: { agentId: args.agentId, releaseId, verification, suggestion },
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
result = await data_provider_1.dataService.createPrivateAgentRelease({
|
|
40
83
|
agentId: args.agentId,
|
|
41
84
|
changelog: flags.changelog,
|
|
42
85
|
versionMajor: flags['version-major'],
|
|
43
86
|
versionMinor: flags['version-minor'],
|
|
44
87
|
});
|
|
88
|
+
}
|
|
45
89
|
this.log(flags.json
|
|
46
90
|
? this.agentJson(args.agentId, result)
|
|
47
|
-
:
|
|
91
|
+
: recoveredAfterTransportFailure
|
|
92
|
+
? `Beta release ${flags['release-id']} exists for agent ${args.agentId}; the publish response was interrupted.`
|
|
93
|
+
: `Created release for agent ${args.agentId}`);
|
|
48
94
|
if (!flags.json)
|
|
49
95
|
this.printAgentUrl(args.agentId);
|
|
50
96
|
}
|
|
@@ -8,6 +8,7 @@ export default class SpacesSnapshot extends BaseCommand {
|
|
|
8
8
|
static flags: {
|
|
9
9
|
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
10
10
|
'from-json': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
11
|
+
'update-template': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
11
12
|
title: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
12
13
|
description: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
13
14
|
'short-description': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
@@ -21,12 +21,13 @@ const CATEGORY_OPTIONS = [
|
|
|
21
21
|
'other',
|
|
22
22
|
];
|
|
23
23
|
class SpacesSnapshot extends base_command_1.BaseCommand {
|
|
24
|
-
static description = 'Create a
|
|
24
|
+
static description = 'Create or recapture a template from a space';
|
|
25
25
|
static examples = [
|
|
26
26
|
'<%= config.bin %> spaces snapshot <space-id> --title "Q2 Launch Template"',
|
|
27
27
|
'<%= config.bin %> spaces snapshot <space-id> --title "Support" --category engineering --public',
|
|
28
28
|
'<%= config.bin %> spaces snapshot <space-id> --from-json snapshot.json',
|
|
29
29
|
'<%= config.bin %> spaces snapshot <space-id> --from-json snapshot.json --title "Override"',
|
|
30
|
+
'<%= config.bin %> spaces snapshot <source-space-id> --update-template <template-id> --title "Q2 Launch v2"',
|
|
30
31
|
];
|
|
31
32
|
static args = {
|
|
32
33
|
id: core_1.Args.string({ description: 'Space ID', required: true, ignoreStdin: true }),
|
|
@@ -36,6 +37,9 @@ class SpacesSnapshot extends base_command_1.BaseCommand {
|
|
|
36
37
|
'from-json': core_1.Flags.string({
|
|
37
38
|
description: 'Path to a JSON file (or "-" for stdin) to use as the request body',
|
|
38
39
|
}),
|
|
40
|
+
'update-template': core_1.Flags.string({
|
|
41
|
+
description: 'Recapture this existing template from its original Space',
|
|
42
|
+
}),
|
|
39
43
|
title: core_1.Flags.string({ description: 'Snapshot title (required unless set via --from-json)' }),
|
|
40
44
|
description: core_1.Flags.string({ description: 'Snapshot description' }),
|
|
41
45
|
'short-description': core_1.Flags.string({ description: 'Short description (one liner)' }),
|
|
@@ -58,6 +62,7 @@ class SpacesSnapshot extends base_command_1.BaseCommand {
|
|
|
58
62
|
this.error(err.message, { exit: 1 });
|
|
59
63
|
}
|
|
60
64
|
const payload = (0, prompt_1.mergeDefined)(body, {
|
|
65
|
+
templateId: flags['update-template'],
|
|
61
66
|
title: flags.title,
|
|
62
67
|
description: flags.description,
|
|
63
68
|
shortDescription: flags['short-description'],
|
|
@@ -83,7 +88,7 @@ class SpacesSnapshot extends base_command_1.BaseCommand {
|
|
|
83
88
|
return;
|
|
84
89
|
}
|
|
85
90
|
const s = result;
|
|
86
|
-
this.log(`Snapshot created: ${s.id ?? s._id ?? '?'} — ${String(payload.title)}`);
|
|
91
|
+
this.log(`Snapshot ${payload.templateId ? 'updated' : 'created'}: ${s.id ?? s._id ?? '?'} — ${String(payload.title)}`);
|
|
87
92
|
}
|
|
88
93
|
}
|
|
89
94
|
exports.default = SpacesSnapshot;
|
|
@@ -69,6 +69,21 @@ class StoreInstall extends base_command_1.BaseCommand {
|
|
|
69
69
|
// A read failure must not block an install — the server re-checks anyway.
|
|
70
70
|
this.warn(`Could not check what you own (${err.message}); continuing.`);
|
|
71
71
|
}
|
|
72
|
+
if (alreadyInstalled) {
|
|
73
|
+
// A purchase survives uninstall. Only a usable copy is already installed;
|
|
74
|
+
// an uninstalled copy is restored by the install route. Keep the server
|
|
75
|
+
// as the final authority if this status read is unavailable.
|
|
76
|
+
try {
|
|
77
|
+
const status = await data_provider_1.dataService.getAgentPurchaseStatus(args.agentId);
|
|
78
|
+
if (status.purchased && status.stopReason === 'uninstalled') {
|
|
79
|
+
alreadyInstalled = false;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
catch (err) {
|
|
83
|
+
this.warn(`Could not check the installed copy (${err.message}); continuing.`);
|
|
84
|
+
alreadyInstalled = false;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
72
87
|
if (alreadyInstalled) {
|
|
73
88
|
this.error(`${args.agentId} is already installed. See it: skrr store updates, or update it: skrr store update ${args.agentId}`, { exit: 1 });
|
|
74
89
|
}
|
|
@@ -19,10 +19,9 @@ class StoreInstalls extends base_command_1.BaseCommand {
|
|
|
19
19
|
this.requireAuth();
|
|
20
20
|
const { flags } = await this.parse(StoreInstalls);
|
|
21
21
|
const workspaceId = await (0, workspaces_1.ambientWorkspaceId)();
|
|
22
|
-
(0, data_provider_1.setWorkspaceIdHeader)(workspaceId ?? null);
|
|
23
22
|
let response;
|
|
24
23
|
try {
|
|
25
|
-
response = await data_provider_1.dataService.getStoreInstalls();
|
|
24
|
+
response = await data_provider_1.dataService.getStoreInstalls(workspaceId);
|
|
26
25
|
}
|
|
27
26
|
catch (error) {
|
|
28
27
|
this.handleApiError(error);
|
|
@@ -34,6 +34,9 @@ class StoreSignals extends base_command_1.BaseCommand {
|
|
|
34
34
|
const fmt = (v) => `$${((v ?? 0) / 1_000_000).toFixed(4)}`;
|
|
35
35
|
this.log(`Run cost ${fmt(s.measuredRunCost.minCostMicros)}–${fmt(s.measuredRunCost.maxCostMicros)} per run (measured, ${s.measuredRunCost.cohorts} buyers, ${s.measuredRunCost.windowDays}d)`);
|
|
36
36
|
}
|
|
37
|
+
else {
|
|
38
|
+
this.log('Run cost Insufficient data (fewer than 5 independent buyers)');
|
|
39
|
+
}
|
|
37
40
|
}
|
|
38
41
|
catch (err) {
|
|
39
42
|
this.handleApiError(err);
|
|
@@ -42,7 +42,7 @@ function parseReceipt(body) {
|
|
|
42
42
|
: null;
|
|
43
43
|
}
|
|
44
44
|
class StoreUninstall extends base_command_1.BaseCommand {
|
|
45
|
-
static description = 'Uninstall
|
|
45
|
+
static description = 'Uninstall is reversible: reinstalling restores the Agent copy. --erase permanently removes its Memory and ends commitments; the Agent, purchase, and delivered tasks remain.';
|
|
46
46
|
static examples = [
|
|
47
47
|
'<%= config.bin %> store uninstall agent_abc123',
|
|
48
48
|
'<%= config.bin %> store uninstall agent_abc123 --erase',
|
|
@@ -5,7 +5,7 @@ const data_provider_1 = require("@skrr-ai/data-provider");
|
|
|
5
5
|
const base_command_1 = require("../../base-command");
|
|
6
6
|
const prompt_1 = require("../../lib/prompt");
|
|
7
7
|
class SubscriptionsSubscribe extends base_command_1.BaseCommand {
|
|
8
|
-
static description = 'Subscribe to a published Service
|
|
8
|
+
static description = 'Subscribe to a published Service. By default, this shows the first-period price before buying from your balance, installing a managed instance, and opening its delivery obligation. Use --trial for the Service\'s card-free trial instead.';
|
|
9
9
|
static examples = [
|
|
10
10
|
'<%= config.bin %> subscriptions subscribe agent_abc123',
|
|
11
11
|
'<%= config.bin %> subscriptions subscribe agent_abc123 --space space_xyz --yes --json',
|
|
@@ -29,7 +29,7 @@ class SubscriptionsSubscribe extends base_command_1.BaseCommand {
|
|
|
29
29
|
description: 'Activate a period that was already paid (its grant id) instead of buying one. Nothing is charged.',
|
|
30
30
|
}),
|
|
31
31
|
trial: core_1.Flags.boolean({
|
|
32
|
-
description: 'Start
|
|
32
|
+
description: 'Start this Service\'s card-free trial instead of buying. Its duration and compute terms are shown before confirmation; nothing is charged and it does not renew.',
|
|
33
33
|
}),
|
|
34
34
|
yes: core_1.Flags.boolean({
|
|
35
35
|
char: 'y',
|
|
@@ -41889,13 +41889,19 @@ function FE(e2, t2, n2, o2, r2) {
|
|
|
41889
41889
|
var a3, i2, s2, c2 = WE(e3.parts), l2 = (function(e4) {
|
|
41890
41890
|
var t4;
|
|
41891
41891
|
return null !== (t4 = e4.toolUseId) && void 0 !== t4 ? t4 : e4.requestId;
|
|
41892
|
-
})(t3), u2 = KE(c2, l2, t3.requestId), d2 =
|
|
41893
|
-
|
|
41894
|
-
var
|
|
41895
|
-
|
|
41896
|
-
|
|
41897
|
-
|
|
41898
|
-
|
|
41892
|
+
})(t3), u2 = KE(c2, l2, t3.requestId), d2 = u2 >= 0 ? u2 : (function(e4, t4) {
|
|
41893
|
+
if (t4.toolUseId || "exec_command" !== t4.toolName || !t4.inputPreview) return -1;
|
|
41894
|
+
var n4 = e4.flatMap(function(e5, n5) {
|
|
41895
|
+
return "tool" !== e5.kind || "exec_command" !== e5.name || qE(e5.state) || e5.permission || !e5.input || "object" != typeof e5.input ? [] : e5.input.command === t4.inputPreview ? [n5] : [];
|
|
41896
|
+
});
|
|
41897
|
+
return 1 === n4.length ? n4[0] : -1;
|
|
41898
|
+
})(c2, t3), p2 = S(S(S({ status: "pending", requestId: t3.requestId }, t3.toolUseId ? { toolUseId: t3.toolUseId } : {}), { requestedAt: r3 }), t3.inputPreview ? { reason: t3.inputPreview } : {});
|
|
41899
|
+
if (d2 >= 0) {
|
|
41900
|
+
var m2 = c2[d2], f2 = QE(c2, d2, S(S({}, m2), { name: null !== (a3 = t3.toolName) && void 0 !== a3 ? a3 : m2.name, input: VE(m2.input) ? m2.input : GE(t3), executionTarget: null !== (i2 = m2.executionTarget) && void 0 !== i2 ? i2 : XE(n3), permission: p2, state: HE(m2.state) }));
|
|
41901
|
+
return S(S({}, e3), { parts: f2, pending: BE(f2), updatedAt: r3 });
|
|
41902
|
+
}
|
|
41903
|
+
var g2 = { id: o3(), kind: "tool", callId: l2, name: null !== (s2 = t3.toolName) && void 0 !== s2 ? s2 : "tool", state: "pending", input: GE(t3), permission: p2, executionTarget: XE(n3) }, v2 = w(w([], c2, true), [g2], false);
|
|
41904
|
+
return S(S({}, e3), { parts: v2, pending: true, updatedAt: r3 });
|
|
41899
41905
|
})(e2, t2, n2, o2, r2);
|
|
41900
41906
|
case "permission-resolved":
|
|
41901
41907
|
return (function(e3, t3, n3, o3) {
|
|
@@ -44743,8 +44749,8 @@ var gR = Object.freeze({ __proto__: null, acceptAgentIntuition: function(e2, t2,
|
|
|
44743
44749
|
})(e2, t2));
|
|
44744
44750
|
}, getStoreCategories: function() {
|
|
44745
44751
|
return oR.get("".concat(er(), "/categories"));
|
|
44746
|
-
}, getStoreInstalls: function() {
|
|
44747
|
-
return oR.get("".concat(er(), "/installs"));
|
|
44752
|
+
}, getStoreInstalls: function(e2) {
|
|
44753
|
+
return oR.get("".concat(er(), "/installs"), e2 ? { headers: { "X-Workspace-Id": e2 } } : void 0);
|
|
44748
44754
|
}, getStoreListingSocial: function(e2) {
|
|
44749
44755
|
return oR.get((function(e3) {
|
|
44750
44756
|
return "".concat(er(), "/agents/").concat(encodeURIComponent(e3), "/social");
|