@skrr-ai/cli 0.1.85 → 0.1.86
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/endpoint/enable.js +6 -0
- package/dist/commands/store/acquisitions/approve.js +3 -0
- package/dist/lib/agent-endpoints.d.ts +19 -5
- package/dist/lib/agent-endpoints.js +11 -0
- package/dist/lib/store-acquisition.js +11 -3
- package/dist/node_modules/@skrr-ai/data-provider/index.js +5139 -5029
- package/oclif.manifest.json +42650 -42650
- package/package.json +5 -2
|
@@ -40,6 +40,12 @@ class AgentsEndpointEnable extends base_command_1.BaseCommand {
|
|
|
40
40
|
}
|
|
41
41
|
(0, agent_endpoints_1.printAgentEndpoint)(this, endpoint);
|
|
42
42
|
this.log('');
|
|
43
|
+
if (!(0, agent_endpoints_1.endpointWillRun)(endpoint)) {
|
|
44
|
+
// On is not the same as runnable: say so rather than end on a connect
|
|
45
|
+
// line that leads to a refused first call (OSK-13521).
|
|
46
|
+
this.log(endpoint.notice ||
|
|
47
|
+
`The endpoint is on, but it will not run a turn until ${endpoint.blocked_by?.code ?? 'its blocker'} clears.`);
|
|
48
|
+
}
|
|
43
49
|
this.log('Connect a client with: skrr agents endpoint connect ' + args.id + ' --space <space-id>');
|
|
44
50
|
}
|
|
45
51
|
}
|
|
@@ -66,6 +66,9 @@ class StoreAcquisitionsApprove extends base_command_1.BaseCommand {
|
|
|
66
66
|
exit: 1,
|
|
67
67
|
});
|
|
68
68
|
}
|
|
69
|
+
if (request.invalidReason === 'buyer_terms_missing') {
|
|
70
|
+
this.error(`This request was recorded without buyer terms, so it cannot be approved. Decline it with \`skrr store acquisitions decline ${request.id}\`; the agent's next attempt opens a new request that carries the terms.`, { exit: 1 });
|
|
71
|
+
}
|
|
69
72
|
if (!request.buyerTerms) {
|
|
70
73
|
this.error('Buyer terms are not configured, so this purchase cannot be approved.', {
|
|
71
74
|
exit: 1,
|
|
@@ -23,11 +23,14 @@ export interface AgentEndpoint {
|
|
|
23
23
|
enabled_at?: string | null;
|
|
24
24
|
switchable: boolean;
|
|
25
25
|
ready: boolean;
|
|
26
|
-
/**
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
26
|
+
/**
|
|
27
|
+
* The gate that would refuse a turn right now (see docs/cli/SKRR_AGENT_ENDPOINTS.md).
|
|
28
|
+
* Includes the agent-worker runtime admission endpoint turns run on — e.g.
|
|
29
|
+
* `RUNTIME_METERING_BACKLOG_BLOCKED` — with the next step in `remedy`.
|
|
30
|
+
*/
|
|
31
|
+
blocked_by: AgentEndpointBlocker | null;
|
|
32
|
+
/** Set by `enable` when the endpoint is on but a turn would still be refused. */
|
|
33
|
+
notice?: string;
|
|
31
34
|
release?: {
|
|
32
35
|
id: string;
|
|
33
36
|
version_label: string | null;
|
|
@@ -44,6 +47,12 @@ export interface AgentEndpoint {
|
|
|
44
47
|
};
|
|
45
48
|
workspace_id?: string | null;
|
|
46
49
|
}
|
|
50
|
+
export interface AgentEndpointBlocker {
|
|
51
|
+
code: string;
|
|
52
|
+
message: string;
|
|
53
|
+
remedy?: string | null;
|
|
54
|
+
details?: Record<string, unknown>;
|
|
55
|
+
}
|
|
47
56
|
export declare function getAgentEndpoint(agentId: string): Promise<AgentEndpoint>;
|
|
48
57
|
/** Turn a Store instance's endpoint on or off. Owner only, enforced server-side. */
|
|
49
58
|
export declare function setAgentEndpointEnabled(agentId: string, enabled: boolean): Promise<AgentEndpoint>;
|
|
@@ -56,6 +65,11 @@ export declare const AGENT_ENDPOINT_SCOPE = "agents:invoke";
|
|
|
56
65
|
export declare function mcpClientCommand(endpoint: AgentEndpoint, secret: string): string;
|
|
57
66
|
/** One human line for the state an endpoint is in. */
|
|
58
67
|
export declare function describeEndpointState(endpoint: AgentEndpoint): string;
|
|
68
|
+
/**
|
|
69
|
+
* Whether the endpoint would run a turn now. `ready` alone is the answer; this
|
|
70
|
+
* exists so a caller never reads `enabled` as "it works" (OSK-13521).
|
|
71
|
+
*/
|
|
72
|
+
export declare function endpointWillRun(endpoint: AgentEndpoint): boolean;
|
|
59
73
|
/** The human rendering every `agents endpoint` command prints. */
|
|
60
74
|
export declare function printAgentEndpoint(cmd: {
|
|
61
75
|
log: (line: string) => void;
|
|
@@ -5,6 +5,7 @@ exports.getAgentEndpoint = getAgentEndpoint;
|
|
|
5
5
|
exports.setAgentEndpointEnabled = setAgentEndpointEnabled;
|
|
6
6
|
exports.mcpClientCommand = mcpClientCommand;
|
|
7
7
|
exports.describeEndpointState = describeEndpointState;
|
|
8
|
+
exports.endpointWillRun = endpointWillRun;
|
|
8
9
|
exports.printAgentEndpoint = printAgentEndpoint;
|
|
9
10
|
const api_fetch_1 = require("./api-fetch");
|
|
10
11
|
async function getAgentEndpoint(agentId) {
|
|
@@ -40,11 +41,21 @@ function describeEndpointState(endpoint) {
|
|
|
40
41
|
}
|
|
41
42
|
return 'on';
|
|
42
43
|
}
|
|
44
|
+
/**
|
|
45
|
+
* Whether the endpoint would run a turn now. `ready` alone is the answer; this
|
|
46
|
+
* exists so a caller never reads `enabled` as "it works" (OSK-13521).
|
|
47
|
+
*/
|
|
48
|
+
function endpointWillRun(endpoint) {
|
|
49
|
+
return endpoint.enabled && endpoint.ready && !endpoint.blocked_by;
|
|
50
|
+
}
|
|
43
51
|
/** The human rendering every `agents endpoint` command prints. */
|
|
44
52
|
function printAgentEndpoint(cmd, endpoint) {
|
|
45
53
|
cmd.log(`Agent ${endpoint.agent_id}${endpoint.agent_name ? ` (${endpoint.agent_name})` : ''}`);
|
|
46
54
|
cmd.log(`Kind ${endpoint.kind.replace(/_/g, ' ')}`);
|
|
47
55
|
cmd.log(`Endpoint ${describeEndpointState(endpoint)}`);
|
|
56
|
+
if (endpoint.blocked_by?.remedy) {
|
|
57
|
+
cmd.log(`Next step ${endpoint.blocked_by.remedy}`);
|
|
58
|
+
}
|
|
48
59
|
if (endpoint.url) {
|
|
49
60
|
cmd.log(`URL ${endpoint.url} (MCP, ${endpoint.transport})`);
|
|
50
61
|
cmd.log(`Key scope ${endpoint.scope}`);
|
|
@@ -3,6 +3,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.describeAcquisitionRequestLines = describeAcquisitionRequestLines;
|
|
4
4
|
exports.describeAcquisitionRequestRow = describeAcquisitionRequestRow;
|
|
5
5
|
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
6
|
+
function describeBuyerTerms(request) {
|
|
7
|
+
if (request.buyerTerms) {
|
|
8
|
+
return `${request.buyerTerms.termsVersion} — ${request.buyerTerms.artifactUri}`;
|
|
9
|
+
}
|
|
10
|
+
if (request.invalidReason === 'buyer_terms_missing') {
|
|
11
|
+
// Stored before OSK-13520 refused to open a request without terms.
|
|
12
|
+
return 'missing — this request was recorded without buyer terms, so it can only be declined';
|
|
13
|
+
}
|
|
14
|
+
return 'not configured, so this purchase cannot be approved';
|
|
15
|
+
}
|
|
6
16
|
/**
|
|
7
17
|
* A purchase an agent asked to make, as the lines a terminal shows (OSK-12240).
|
|
8
18
|
*
|
|
@@ -22,9 +32,7 @@ function describeAcquisitionRequestLines(request) {
|
|
|
22
32
|
` Status: ${status.label}${status.detail ? ` — ${status.detail}` : ''}`,
|
|
23
33
|
` Price: ${(0, data_provider_1.formatStoreAcquisitionPrice)(request.price)} ${request.currency}`,
|
|
24
34
|
` Refunds: ${(0, data_provider_1.describeStoreAcquisitionRefundTerms)(request.refundTerms)}`,
|
|
25
|
-
` Buyer terms: ${request
|
|
26
|
-
? `${request.buyerTerms.termsVersion} — ${request.buyerTerms.artifactUri}`
|
|
27
|
-
: 'not configured, so this purchase cannot be approved'}`,
|
|
35
|
+
` Buyer terms: ${describeBuyerTerms(request)}`,
|
|
28
36
|
` Offer: ${request.offerVersionId}`,
|
|
29
37
|
` Capabilities: ${(0, data_provider_1.describeStoreAcquisitionCapabilities)(request.capabilities, request.capabilityCount)}`,
|
|
30
38
|
];
|