@skrr-ai/cli 0.1.159 → 0.1.160
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 +6 -0
- package/dist/commands/activity/list.js +1 -1
- package/dist/commands/activity/scan-older.js +1 -0
- package/dist/commands/activity/show.js +3 -3
- package/dist/lib/apps-command.js +14 -0
- package/dist/lib/apps.d.ts +13 -0
- package/dist/lib/apps.js +35 -1
- package/dist/lib/usage-discovery.d.ts +3 -0
- package/dist/lib/usage-discovery.js +4 -0
- package/oclif.manifest.json +1 -1
- package/package.json +2 -2
package/dist/base-command.js
CHANGED
|
@@ -2690,6 +2690,12 @@ const TERMINAL_ERROR_CODES = new Set([
|
|
|
2690
2690
|
'TASK_RESULT_CHANGES_REQUESTED',
|
|
2691
2691
|
'TASK_RESULT_REVIEW_REQUIRED',
|
|
2692
2692
|
'TASK_DELIVERY_NOT_INTEGRATED',
|
|
2693
|
+
// The drafting target's runtime cannot draft privately: a configuration
|
|
2694
|
+
// state, so a retry of the same request cannot change the answer. (An
|
|
2695
|
+
// OFFLINE target is deliberately not here: it can come back.)
|
|
2696
|
+
'DUTY_PLANNER_RUNTIME_UNSUPPORTED',
|
|
2697
|
+
// Same for a target that needs the owner's permission first: waiting grants none.
|
|
2698
|
+
'DUTY_PLANNER_TARGET_CONSENT_REQUIRED',
|
|
2693
2699
|
]);
|
|
2694
2700
|
/**
|
|
2695
2701
|
* Whether an automated retry of the IDENTICAL request could plausibly succeed.
|
|
@@ -38,7 +38,7 @@ class ActivityList extends base_command_1.BaseCommand {
|
|
|
38
38
|
}, this.resolvedCredential);
|
|
39
39
|
// Standard list envelope (`data`, `has_more`, `next_cursor`); per-source `coverage` is kept.
|
|
40
40
|
if (flags.json)
|
|
41
|
-
this.
|
|
41
|
+
this.printJsonResult((0, list_output_1.listResult)(response, 'items'));
|
|
42
42
|
else
|
|
43
43
|
(0, agent_activity_1.renderAgentActivity)(response, (line) => this.log(line));
|
|
44
44
|
}
|
|
@@ -24,6 +24,7 @@ class ActivityScanOlder extends base_command_1.BaseCommand {
|
|
|
24
24
|
source: core_1.Args.string({
|
|
25
25
|
description: 'Which scan: chat (your own chat replies from your Agents) or group-chat (replies in Groups you can read)',
|
|
26
26
|
required: true,
|
|
27
|
+
ignoreStdin: true,
|
|
27
28
|
options: ['chat', 'group-chat'],
|
|
28
29
|
}),
|
|
29
30
|
};
|
|
@@ -167,7 +167,7 @@ class ActivityShow extends base_command_1.BaseCommand {
|
|
|
167
167
|
this.handleApiError(err);
|
|
168
168
|
}
|
|
169
169
|
if (flags.json) {
|
|
170
|
-
this.
|
|
170
|
+
this.printJsonResult(detail);
|
|
171
171
|
return;
|
|
172
172
|
}
|
|
173
173
|
const parsed = (0, agent_activity_1.parseGroupChatActivityDetail)(detail);
|
|
@@ -205,14 +205,14 @@ class ActivityShow extends base_command_1.BaseCommand {
|
|
|
205
205
|
...(flags.cursor ? { cursor: flags.cursor } : {}),
|
|
206
206
|
});
|
|
207
207
|
if (flags.json)
|
|
208
|
-
this.
|
|
208
|
+
this.printJsonResult(trace);
|
|
209
209
|
else
|
|
210
210
|
(0, duties_1.renderDutyTrace)(trace, (line) => this.log(terminalText(line)));
|
|
211
211
|
return;
|
|
212
212
|
}
|
|
213
213
|
const detail = await triggers_1.triggerApi.fireDetail(flags.trigger, flags.fire);
|
|
214
214
|
if (flags.json)
|
|
215
|
-
this.
|
|
215
|
+
this.printJsonResult(detail);
|
|
216
216
|
else {
|
|
217
217
|
const row = detail;
|
|
218
218
|
for (const line of (0, fire_detail_1.describeFireAuditDetail)(row, flags.fire, flags.trigger))
|
package/dist/lib/apps-command.js
CHANGED
|
@@ -155,6 +155,20 @@ class AppsCommand extends base_command_1.BaseCommand {
|
|
|
155
155
|
details: refusal.retryAfterMs === undefined ? {} : { retryAfterMs: refusal.retryAfterMs },
|
|
156
156
|
});
|
|
157
157
|
}
|
|
158
|
+
if (refusal && (0, apps_1.isAssetQuotaRefusal)(refusal)) {
|
|
159
|
+
// the account holds as many uploaded images and fonts as it may: nothing turns it by itself, so not retryable now (the words say what frees space)
|
|
160
|
+
return this.failWithCliError({
|
|
161
|
+
message: (0, apps_1.describeAppsRefusal)(refusal, this.config.bin),
|
|
162
|
+
code: apps_1.APP_ASSET_QUOTA_CODE,
|
|
163
|
+
...(refusal.status === undefined ? {} : { status: refusal.status }),
|
|
164
|
+
exit: 1,
|
|
165
|
+
retryable: false,
|
|
166
|
+
details: {
|
|
167
|
+
...(refusal.heldBytes === undefined ? {} : { heldBytes: refusal.heldBytes }),
|
|
168
|
+
...(refusal.capBytes === undefined ? {} : { capBytes: refusal.capBytes }),
|
|
169
|
+
},
|
|
170
|
+
});
|
|
171
|
+
}
|
|
158
172
|
if (refusal && refusal.error && apps_1.APPS_REFUSAL_CODES[refusal.error]) {
|
|
159
173
|
return this.failWithCliError({
|
|
160
174
|
message: (0, apps_1.describeAppsRefusal)(refusal, this.config.bin),
|
package/dist/lib/apps.d.ts
CHANGED
|
@@ -23,6 +23,9 @@ export interface AppsRefusal {
|
|
|
23
23
|
reason?: string;
|
|
24
24
|
/** On a `rate`: how long until the allowance turns, in milliseconds (the upload door's daily allowance of new bytes). */
|
|
25
25
|
retryAfterMs?: number;
|
|
26
|
+
/** On a `limit` whose `reason` is `asset_quota`: what the account holds in uploaded images and fonts, and the most it may hold. */
|
|
27
|
+
heldBytes?: number;
|
|
28
|
+
capBytes?: number;
|
|
26
29
|
docCount?: number;
|
|
27
30
|
installationId?: string;
|
|
28
31
|
current?: {
|
|
@@ -49,6 +52,16 @@ export declare const APPS_REFUSAL_CODES: Record<string, string>;
|
|
|
49
52
|
export declare const APP_UPLOAD_BUDGET_REASON = "upload_budget";
|
|
50
53
|
export declare const APP_UPLOAD_BUDGET_CODE = "APP_UPLOAD_BUDGET";
|
|
51
54
|
export declare function isUploadBudgetRefusal(refusal: AppsRefusal): boolean;
|
|
55
|
+
/**
|
|
56
|
+
* The account holds as many uploaded images and fonts as it may (`apps push`). The server says it as a `limit` refusal whose `reason`
|
|
57
|
+
* is this (the draft's own 2 MiB is a `limit` without it). Its own machine code because the answer is different from the daily
|
|
58
|
+
* allowance's: there is no wait that turns it, only freeing space, which the server does for files no draft or version of the
|
|
59
|
+
* account's names any more, after 24 hours, when the account is next at its cap. So it is not retryable now. The reason is the
|
|
60
|
+
* API's own literal (`Apps/AppAuthoring/assetHolds.js`); a spec in the API reads this file to hold the two together.
|
|
61
|
+
*/
|
|
62
|
+
export declare const APP_ASSET_QUOTA_REASON = "asset_quota";
|
|
63
|
+
export declare const APP_ASSET_QUOTA_CODE = "APP_ASSET_QUOTA";
|
|
64
|
+
export declare function isAssetQuotaRefusal(refusal: AppsRefusal): boolean;
|
|
52
65
|
/** The words for a refusal: what it was, the revision to retry from, each problem, what to do. */
|
|
53
66
|
export declare function describeAppsRefusal(refusal: AppsRefusal, bin: string): string;
|
|
54
67
|
/** A table row of the apps a person can edit. */
|
package/dist/lib/apps.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.APP_UPLOAD_BUDGET_CODE = exports.APP_UPLOAD_BUDGET_REASON = exports.APPS_REFUSAL_CODES = exports.AppRefError = void 0;
|
|
3
|
+
exports.APP_ASSET_QUOTA_CODE = exports.APP_ASSET_QUOTA_REASON = exports.APP_UPLOAD_BUDGET_CODE = exports.APP_UPLOAD_BUDGET_REASON = exports.APPS_REFUSAL_CODES = exports.AppRefError = void 0;
|
|
4
4
|
exports.resolveAppRef = resolveAppRef;
|
|
5
5
|
exports.readAppsRefusal = readAppsRefusal;
|
|
6
6
|
exports.isUploadBudgetRefusal = isUploadBudgetRefusal;
|
|
7
|
+
exports.isAssetQuotaRefusal = isAssetQuotaRefusal;
|
|
7
8
|
exports.describeAppsRefusal = describeAppsRefusal;
|
|
8
9
|
exports.formatAppRow = formatAppRow;
|
|
9
10
|
exports.formatEntryLine = formatEntryLine;
|
|
@@ -76,6 +77,12 @@ function readAppsRefusal(error) {
|
|
|
76
77
|
...(typeof body.retryAfterMs === 'number' && Number.isFinite(body.retryAfterMs)
|
|
77
78
|
? { retryAfterMs: body.retryAfterMs }
|
|
78
79
|
: {}),
|
|
80
|
+
...(typeof body.heldBytes === 'number' && Number.isFinite(body.heldBytes)
|
|
81
|
+
? { heldBytes: body.heldBytes }
|
|
82
|
+
: {}),
|
|
83
|
+
...(typeof body.capBytes === 'number' && Number.isFinite(body.capBytes)
|
|
84
|
+
? { capBytes: body.capBytes }
|
|
85
|
+
: {}),
|
|
79
86
|
...(typeof body.docCount === 'number' ? { docCount: body.docCount } : {}),
|
|
80
87
|
...(typeof body.installationId === 'string' ? { installationId: body.installationId } : {}),
|
|
81
88
|
...(body.current && typeof body.current === 'object'
|
|
@@ -117,6 +124,27 @@ exports.APP_UPLOAD_BUDGET_CODE = 'APP_UPLOAD_BUDGET';
|
|
|
117
124
|
function isUploadBudgetRefusal(refusal) {
|
|
118
125
|
return refusal.error === 'rate' && refusal.reason === exports.APP_UPLOAD_BUDGET_REASON;
|
|
119
126
|
}
|
|
127
|
+
/**
|
|
128
|
+
* The account holds as many uploaded images and fonts as it may (`apps push`). The server says it as a `limit` refusal whose `reason`
|
|
129
|
+
* is this (the draft's own 2 MiB is a `limit` without it). Its own machine code because the answer is different from the daily
|
|
130
|
+
* allowance's: there is no wait that turns it, only freeing space, which the server does for files no draft or version of the
|
|
131
|
+
* account's names any more, after 24 hours, when the account is next at its cap. So it is not retryable now. The reason is the
|
|
132
|
+
* API's own literal (`Apps/AppAuthoring/assetHolds.js`); a spec in the API reads this file to hold the two together.
|
|
133
|
+
*/
|
|
134
|
+
exports.APP_ASSET_QUOTA_REASON = 'asset_quota';
|
|
135
|
+
exports.APP_ASSET_QUOTA_CODE = 'APP_ASSET_QUOTA';
|
|
136
|
+
function isAssetQuotaRefusal(refusal) {
|
|
137
|
+
return refusal.error === 'limit' && refusal.reason === exports.APP_ASSET_QUOTA_REASON;
|
|
138
|
+
}
|
|
139
|
+
/** A size as a person says it: "256 MiB", "1.5 MiB", "12 KiB". Rounds a size under a MiB up, so it is never smaller than it is. */
|
|
140
|
+
function describeBytes(bytes) {
|
|
141
|
+
const mib = 1024 * 1024;
|
|
142
|
+
if (bytes >= mib) {
|
|
143
|
+
const value = bytes / mib;
|
|
144
|
+
return `${Number.isInteger(value) ? value : value.toFixed(1)} MiB`;
|
|
145
|
+
}
|
|
146
|
+
return `${Math.max(1, Math.ceil(bytes / 1024))} KiB`;
|
|
147
|
+
}
|
|
120
148
|
/** A wait as a person says it: "5 minutes", "7 hours". Rounds up, so it is never shorter than the wait. */
|
|
121
149
|
function describeWait(ms) {
|
|
122
150
|
const minutes = Math.max(1, Math.ceil(ms / 60_000));
|
|
@@ -141,6 +169,12 @@ function describeAppsRefusal(refusal, bin) {
|
|
|
141
169
|
if (isUploadBudgetRefusal(refusal)) {
|
|
142
170
|
lines.push(`→ ${refusal.retryAfterMs === undefined ? 'Try again later' : `Try again in about ${describeWait(refusal.retryAfterMs)}`}. Files already sent stay in the draft: read its revision again (\`${bin} apps file ls <app>\` shows \`rev\`) and run the push again, and it sends only what the draft does not hold.`);
|
|
143
171
|
}
|
|
172
|
+
if (isAssetQuotaRefusal(refusal)) {
|
|
173
|
+
const held = refusal.heldBytes !== undefined && refusal.capBytes !== undefined
|
|
174
|
+
? ` (${describeBytes(refusal.heldBytes)} of ${describeBytes(refusal.capBytes)})`
|
|
175
|
+
: '';
|
|
176
|
+
lines.push(`→ This is the account's total${held}, not a wait: nothing turns it by itself. A file is released when no draft or version of your apps names it (after 24 hours, the next time the account is at its cap), so remove the images and fonts you no longer use with \`${bin} apps file rm <app> <path>\` and push again. Files already sent stay in the draft: read its revision again (\`${bin} apps file ls <app>\` shows \`rev\`) and run the push again, and it sends only what the draft does not hold.`);
|
|
177
|
+
}
|
|
144
178
|
for (const problem of (refusal.problems ?? []).slice(0, 10)) {
|
|
145
179
|
lines.push(` - ${problem.path ? `${problem.path}: ` : ''}${problem.message}`);
|
|
146
180
|
}
|
|
@@ -37,6 +37,9 @@ export declare const USAGE_OVERVIEW_TOKEN_BUDGET = 240;
|
|
|
37
37
|
* `instructions` (version-pinned blocks for local CLAUDE.md / AGENTS.md), aimed at another target. The overview
|
|
38
38
|
* read 245 once `skrr guide` joined it, and `guide` stays a line of its own because it is where every operation
|
|
39
39
|
* guide is read.
|
|
40
|
+
* `activity` (what an agent, a duty or a chat did, linked to its source) is the read side of what the `worklog` domain
|
|
41
|
+
* writes, and is the topic that took the overview to 241. Folded there, `skrr usage activity` resolves to the
|
|
42
|
+
* `worklog` pages, which name it in `Includes:`; every `skrr activity ...` command keeps its id.
|
|
40
43
|
*/
|
|
41
44
|
export declare const USAGE_DOMAIN_FOLDS: Readonly<Record<string, string>>;
|
|
42
45
|
export declare const USAGE_DOMAIN_TOKEN_BUDGET = 500;
|
|
@@ -50,11 +50,15 @@ exports.USAGE_OVERVIEW_TOKEN_BUDGET = 240;
|
|
|
50
50
|
* `instructions` (version-pinned blocks for local CLAUDE.md / AGENTS.md), aimed at another target. The overview
|
|
51
51
|
* read 245 once `skrr guide` joined it, and `guide` stays a line of its own because it is where every operation
|
|
52
52
|
* guide is read.
|
|
53
|
+
* `activity` (what an agent, a duty or a chat did, linked to its source) is the read side of what the `worklog` domain
|
|
54
|
+
* writes, and is the topic that took the overview to 241. Folded there, `skrr usage activity` resolves to the
|
|
55
|
+
* `worklog` pages, which name it in `Includes:`; every `skrr activity ...` command keeps its id.
|
|
53
56
|
*/
|
|
54
57
|
exports.USAGE_DOMAIN_FOLDS = {
|
|
55
58
|
proposals: 'inbox',
|
|
56
59
|
apps: 'widgets',
|
|
57
60
|
'instruction-blocks': 'instructions',
|
|
61
|
+
activity: 'worklog',
|
|
58
62
|
};
|
|
59
63
|
exports.USAGE_DOMAIN_TOKEN_BUDGET = 500;
|
|
60
64
|
const GENERIC_FLAGS = new Set(['bare', 'help', 'json', 'token', 'workspace']);
|
package/oclif.manifest.json
CHANGED
|
@@ -147027,5 +147027,5 @@
|
|
|
147027
147027
|
]
|
|
147028
147028
|
}
|
|
147029
147029
|
},
|
|
147030
|
-
"version": "0.1.
|
|
147030
|
+
"version": "0.1.160"
|
|
147031
147031
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@skrr-ai/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.160",
|
|
4
4
|
"description": "Command-line interface for skrr",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"author": "skrr",
|
|
@@ -690,5 +690,5 @@
|
|
|
690
690
|
"engines": {
|
|
691
691
|
"node": ">=20.0.0"
|
|
692
692
|
},
|
|
693
|
-
"gitHead": "
|
|
693
|
+
"gitHead": "5f7e6ef570a35154d6001a82b2d10a729e1025bb"
|
|
694
694
|
}
|