@skrr-ai/cli 0.1.164 → 0.1.165
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/README.md +13 -0
- package/dist/base-command.d.ts +14 -1
- package/dist/base-command.js +166 -46
- package/dist/commands/agent/message/send.d.ts +1 -0
- package/dist/commands/agent/message/send.js +3 -0
- package/dist/commands/agents/mini-computer/app/set.js +1 -1
- package/dist/commands/agents/mini-computer/tasks-view.js +1 -1
- package/dist/commands/apps/check.js +3 -8
- package/dist/commands/apps/data/batch.d.ts +1 -0
- package/dist/commands/apps/data/batch.js +19 -2
- package/dist/commands/apps/data/delete.d.ts +1 -0
- package/dist/commands/apps/data/delete.js +14 -2
- package/dist/commands/apps/data/patch.d.ts +1 -0
- package/dist/commands/apps/data/patch.js +11 -2
- package/dist/commands/apps/data/put.d.ts +1 -0
- package/dist/commands/apps/data/put.js +17 -3
- package/dist/commands/apps/install.js +7 -2
- package/dist/commands/apps/installations/compatibility.d.ts +13 -0
- package/dist/commands/apps/installations/compatibility.js +60 -0
- package/dist/commands/apps/installations/show.js +9 -3
- package/dist/commands/apps/installations/snapshot.js +5 -2
- package/dist/commands/apps/operations/check.d.ts +16 -0
- package/dist/commands/apps/operations/check.js +127 -0
- package/dist/commands/apps/publish/propose.js +33 -4
- package/dist/commands/apps/reconsent.js +7 -1
- package/dist/commands/apps/reference.d.ts +4 -2
- package/dist/commands/apps/reference.js +7 -4
- package/dist/commands/apps/rollback.d.ts +9 -0
- package/dist/commands/apps/rollback.js +81 -2
- package/dist/commands/apps/upgrade.d.ts +8 -0
- package/dist/commands/apps/upgrade.js +67 -2
- package/dist/commands/apps/version/cat.d.ts +22 -0
- package/dist/commands/apps/version/cat.js +220 -0
- package/dist/commands/apps/version/show.js +3 -1
- package/dist/commands/commerce/incidents/release.d.ts +24 -0
- package/dist/commands/commerce/incidents/release.js +46 -0
- package/dist/commands/duties/cases.js +12 -1
- package/dist/commands/duties/hypotheses.js +10 -3
- package/dist/commands/duties/observations.d.ts +4 -0
- package/dist/commands/duties/observations.js +14 -3
- package/dist/commands/outbox/list.d.ts +11 -4
- package/dist/commands/outbox/list.js +56 -9
- package/dist/commands/outbox/retry.d.ts +8 -2
- package/dist/commands/outbox/retry.js +76 -16
- package/dist/commands/outbox/show.d.ts +20 -0
- package/dist/commands/outbox/show.js +83 -0
- package/dist/commands/proposals/list.js +13 -9
- package/dist/commands/requests/show.d.ts +12 -0
- package/dist/commands/requests/show.js +42 -23
- package/dist/commands/spaces/deletion/cancel.d.ts +21 -0
- package/dist/commands/spaces/deletion/cancel.js +70 -0
- package/dist/commands/spaces/workflows/run.js +12 -0
- package/dist/commands/widgets/check.d.ts +9 -0
- package/dist/commands/widgets/check.js +16 -3
- package/dist/generated/agent-guides.json +17 -17
- package/dist/lib/api-fetch.d.ts +5 -0
- package/dist/lib/api-fetch.js +53 -21
- package/dist/lib/appCompatibility.d.ts +31 -0
- package/dist/lib/appCompatibility.js +66 -0
- package/dist/lib/appData.d.ts +46 -4
- package/dist/lib/appData.js +156 -31
- package/dist/lib/appInstallations.d.ts +32 -5
- package/dist/lib/appInstallations.js +197 -34
- package/dist/lib/appVersionFile.d.ts +82 -0
- package/dist/lib/appVersionFile.js +195 -0
- package/dist/lib/apps-command.d.ts +14 -3
- package/dist/lib/apps-command.js +68 -60
- package/dist/lib/appsCheck.js +16 -2
- package/dist/lib/commerce.d.ts +6 -0
- package/dist/lib/commerce.js +9 -0
- package/dist/lib/duties.d.ts +15 -1
- package/dist/lib/duties.js +21 -3
- package/dist/lib/json-output.d.ts +2 -0
- package/dist/lib/json-output.js +8 -4
- package/dist/lib/node-adapter.d.ts +2 -0
- package/dist/lib/node-adapter.js +35 -8
- package/dist/lib/outbox.d.ts +110 -1
- package/dist/lib/outbox.js +261 -35
- package/dist/lib/space-deletion-cancel.d.ts +47 -0
- package/dist/lib/space-deletion-cancel.js +141 -0
- package/dist/lib/widgetCheck.js +1 -1
- package/dist/lib/widgetStaticScan.d.ts +11 -5
- package/dist/lib/widgetStaticScan.js +73 -165
- package/dist/lib/write-outcome.d.ts +74 -0
- package/dist/lib/write-outcome.js +176 -0
- package/dist/node_modules/@skrr-ai/data-provider/index.js +11839 -11318
- package/oclif.manifest.json +1940 -16
- package/package.json +9 -3
package/dist/lib/appData.js
CHANGED
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.PERSON_DATA_QUERY_LIMIT_MAX = exports.PERSON_DATA_CONFLICT_CODES = exports.PERSON_DATA_REFUSAL_CODES = exports.AppDataInputError = void 0;
|
|
4
|
+
exports.mintDataWriteKey = mintDataWriteKey;
|
|
5
|
+
exports.checkIdempotencyKey = checkIdempotencyKey;
|
|
6
|
+
exports.readOperationReference = readOperationReference;
|
|
7
|
+
exports.describeOperationReference = describeOperationReference;
|
|
8
|
+
exports.describeKeyedUnknown = describeKeyedUnknown;
|
|
4
9
|
exports.assertAppDataWriteResult = assertAppDataWriteResult;
|
|
5
10
|
exports.readDocumentInput = readDocumentInput;
|
|
6
11
|
exports.readWhereInput = readWhereInput;
|
|
12
|
+
exports.cursorRefusalReason = cursorRefusalReason;
|
|
7
13
|
exports.readPersonDataFailure = readPersonDataFailure;
|
|
8
14
|
exports.personDataFailureExit = personDataFailureExit;
|
|
9
15
|
exports.personDataFailureRetryable = personDataFailureRetryable;
|
|
@@ -37,6 +43,7 @@ exports.formatCollections = formatCollections;
|
|
|
37
43
|
* NEVER PRINTED: who wrote a row. The server returns the KIND of writer (`app`, `agent`, `person`) and never an id.
|
|
38
44
|
*/
|
|
39
45
|
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
46
|
+
const node_crypto_1 = require("node:crypto");
|
|
40
47
|
const appsFs_1 = require("./appsFs");
|
|
41
48
|
// eslint-disable-next-line no-control-regex, no-misleading-character-class -- the point of the pattern is to match control, combining and invisible characters
|
|
42
49
|
const SAFE_FOR_TERMINAL_RE =
|
|
@@ -59,6 +66,64 @@ function asPlainObject(value) {
|
|
|
59
66
|
? value
|
|
60
67
|
: null;
|
|
61
68
|
}
|
|
69
|
+
// ── the idempotency key of a write, and the operation receipt it may leave (step 4b) ───────────────
|
|
70
|
+
/**
|
|
71
|
+
* The server's grammar for a client idempotency key (`normalizeKey`): printable, up to 200 characters. A key outside it is not a key to the
|
|
72
|
+
* server: the write would be sent, answered, and leave no receipt, so a key the person asked for is refused here rather than quietly dropped.
|
|
73
|
+
*/
|
|
74
|
+
const IDEMPOTENCY_KEY_RE = /^[A-Za-z0-9._:/-]{1,200}$/;
|
|
75
|
+
/**
|
|
76
|
+
* A fresh key for ONE write the person just asked for. The CLI mints it itself (not the transport's per-call key) so that it can SAY it when
|
|
77
|
+
* the answer is lost: a terminal that cannot tell what happened must be able to ask the server by this key (`skrr apps operations check`),
|
|
78
|
+
* and to send the same write again under the same key (`--idempotency-key`), which the server answers from the receipt it kept, if it kept one.
|
|
79
|
+
*/
|
|
80
|
+
function mintDataWriteKey() {
|
|
81
|
+
return `skrr-data:${(0, node_crypto_1.randomUUID)()}`;
|
|
82
|
+
}
|
|
83
|
+
/** The key the person gave, or an error that names the rule. */
|
|
84
|
+
function checkIdempotencyKey(value) {
|
|
85
|
+
const key = value.trim();
|
|
86
|
+
if (!IDEMPOTENCY_KEY_RE.test(key)) {
|
|
87
|
+
throw new AppDataInputError('APP_DATA_IDEMPOTENCY_KEY', '--idempotency-key must be 1 to 200 characters from letters, digits and . _ : / - (anything else is not a key to the server, and no receipt would be kept).');
|
|
88
|
+
}
|
|
89
|
+
return key;
|
|
90
|
+
}
|
|
91
|
+
const OPERATION_ID_RE = /^opr_[0-9a-f]{48}$/;
|
|
92
|
+
/**
|
|
93
|
+
* The operation reference a write's answer carries, or nothing. `operationId` is a SUPPORT REFERENCE: it says a receipt exists for this
|
|
94
|
+
* write, and it is the one thing a person can quote about it. It is checked before it is printed (an answer is data, and what a terminal
|
|
95
|
+
* prints must not be whatever a server said). `replayed` says the answer is the stored outcome of an earlier identical request, which this
|
|
96
|
+
* run did not repeat.
|
|
97
|
+
*/
|
|
98
|
+
function readOperationReference(result) {
|
|
99
|
+
const record = asPlainObject(result);
|
|
100
|
+
if (!record ||
|
|
101
|
+
typeof record.operationId !== 'string' ||
|
|
102
|
+
!OPERATION_ID_RE.test(record.operationId)) {
|
|
103
|
+
return null;
|
|
104
|
+
}
|
|
105
|
+
return { operationId: record.operationId, replayed: record.replayed === true };
|
|
106
|
+
}
|
|
107
|
+
/** The line a successful write adds on STDERR (stdout stays what it was): the reference, and whether this run wrote anything. */
|
|
108
|
+
function describeOperationReference(reference) {
|
|
109
|
+
return reference.replayed
|
|
110
|
+
? `operation ${reference.operationId} (answered from the receipt of an earlier identical request; nothing was written again)`
|
|
111
|
+
: `operation ${reference.operationId} (a reference for support; the server kept a receipt of this write)`;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* What to say when the outcome of a write is unknown and a key was sent: how to ask, by that key. Honest in both directions: a receipt that
|
|
115
|
+
* exists proves the write landed, and the absence of one proves nothing (the server may keep none, the write may never have arrived, or it
|
|
116
|
+
* may have been refused).
|
|
117
|
+
*/
|
|
118
|
+
function describeKeyedUnknown(input) {
|
|
119
|
+
const where = input.verb === 'batch'
|
|
120
|
+
? 'batch'
|
|
121
|
+
: `${input.verb} ${safeForTerminal(input.collection ?? '<collection>')} ${safeForTerminal(input.id ?? '<id>')}`;
|
|
122
|
+
const check = `${input.bin} apps operations check ${safeForTerminal(input.installation)} ${where} --key ${input.key}`;
|
|
123
|
+
return (` This write was sent with the idempotency key ${input.key}. If the server keeps operation receipts, \`${check}\` says whether it was applied ("completed", with what it applied` +
|
|
124
|
+
`${input.verb === 'batch' ? ', including the IDs of documents the server named' : ''}); "unknown" there is NOT "not applied", it only means no receipt is on record. ` +
|
|
125
|
+
`Sending it again with --idempotency-key ${input.key} is answered from the receipt when there is one; without one, it writes again.`);
|
|
126
|
+
}
|
|
62
127
|
/** A 2xx is not a receipt unless its body identifies the requested operation. */
|
|
63
128
|
function assertAppDataWriteResult(value, target) {
|
|
64
129
|
const result = asPlainObject(value);
|
|
@@ -68,28 +133,47 @@ function assertAppDataWriteResult(value, target) {
|
|
|
68
133
|
let valid = false;
|
|
69
134
|
if (result && result.ok !== false) {
|
|
70
135
|
const outcome = target.verb === 'delete' ? result.deleted : result.written;
|
|
71
|
-
const contradictsSuccess = result.conflict != null ||
|
|
72
|
-
result.
|
|
136
|
+
const contradictsSuccess = result.conflict != null ||
|
|
137
|
+
result.error != null ||
|
|
138
|
+
result.code === 'conflict' ||
|
|
139
|
+
(target.verb === 'delete' ? result.written === true : result.deleted === true);
|
|
73
140
|
if (outcome === false) {
|
|
74
|
-
valid =
|
|
75
|
-
(result.
|
|
76
|
-
|
|
77
|
-
|
|
141
|
+
valid =
|
|
142
|
+
validConflict(result.conflict) &&
|
|
143
|
+
(result.currentRev === undefined || validRev(result.currentRev)) &&
|
|
144
|
+
(target.verb !== 'batch' ||
|
|
145
|
+
(Number.isSafeInteger(result.index) &&
|
|
146
|
+
result.index >= 0 &&
|
|
147
|
+
result.index < target.writes.length));
|
|
78
148
|
}
|
|
79
149
|
else if (outcome === true && !contradictsSuccess && target.verb === 'batch') {
|
|
80
|
-
valid =
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
150
|
+
valid =
|
|
151
|
+
target.writes.length > 0 &&
|
|
152
|
+
Array.isArray(result.results) &&
|
|
153
|
+
result.results.length === target.writes.length &&
|
|
154
|
+
result.results.every((entry, index) => {
|
|
155
|
+
const item = asPlainObject(entry);
|
|
156
|
+
const requested = target.writes[index];
|
|
157
|
+
return Boolean(item &&
|
|
158
|
+
['put', 'patch', 'delete'].includes(String(requested.op)) &&
|
|
159
|
+
typeof requested.collection === 'string' &&
|
|
160
|
+
requested.collection.length > 0 &&
|
|
161
|
+
item.op === requested.op &&
|
|
162
|
+
item.collection === requested.collection &&
|
|
163
|
+
validId(item.id) &&
|
|
164
|
+
(requested.id === undefined || item.id === requested.id) &&
|
|
165
|
+
validRev(item.rev));
|
|
166
|
+
});
|
|
89
167
|
}
|
|
90
168
|
else if (outcome === true && !contradictsSuccess && target.verb !== 'batch') {
|
|
91
|
-
valid =
|
|
92
|
-
|
|
169
|
+
valid =
|
|
170
|
+
result.id === target.id &&
|
|
171
|
+
validId(result.id) &&
|
|
172
|
+
validRev(result.rev) &&
|
|
173
|
+
(target.verb === 'delete' ||
|
|
174
|
+
(typeof result.created === 'boolean' &&
|
|
175
|
+
typeof result.updatedAt === 'string' &&
|
|
176
|
+
result.updatedAt.length > 0));
|
|
93
177
|
}
|
|
94
178
|
}
|
|
95
179
|
if (!valid) {
|
|
@@ -148,6 +232,22 @@ function readWhereInput(text) {
|
|
|
148
232
|
}
|
|
149
233
|
return checked.value.where;
|
|
150
234
|
}
|
|
235
|
+
/**
|
|
236
|
+
* The stable reason of one of the two cursor refusals (`invalid_cursor`: not a cursor this server handed out;
|
|
237
|
+
* `cursor_mismatch`: a cursor issued for another query), or `undefined`. Each constant is checked to be text first, so a
|
|
238
|
+
* contract build that predates one cannot make an absent reason read as a match.
|
|
239
|
+
*/
|
|
240
|
+
function cursorRefusalReason(reason) {
|
|
241
|
+
if (typeof data_provider_1.APP_STORE_CURSOR_INVALID_REASON === 'string' &&
|
|
242
|
+
reason === data_provider_1.APP_STORE_CURSOR_INVALID_REASON) {
|
|
243
|
+
return data_provider_1.APP_STORE_CURSOR_INVALID_REASON;
|
|
244
|
+
}
|
|
245
|
+
if (typeof data_provider_1.APP_STORE_CURSOR_MISMATCH_REASON === 'string' &&
|
|
246
|
+
reason === data_provider_1.APP_STORE_CURSOR_MISMATCH_REASON) {
|
|
247
|
+
return data_provider_1.APP_STORE_CURSOR_MISMATCH_REASON;
|
|
248
|
+
}
|
|
249
|
+
return undefined;
|
|
250
|
+
}
|
|
151
251
|
/**
|
|
152
252
|
* What the person channel answered, read out of an API error: a refusal (`{ error, code, message }`, the code from
|
|
153
253
|
* the contract's closed set) or a conflict (`409 { error: "conflict", conflict, currentRev? }`). `null` for anything
|
|
@@ -183,7 +283,8 @@ function readPersonDataFailure(error) {
|
|
|
183
283
|
...status,
|
|
184
284
|
...(typeof body.currentRev === 'number' ? { currentRev: body.currentRev } : {}),
|
|
185
285
|
...(typeof body.index === 'number' && Number.isSafeInteger(body.index) && body.index >= 0
|
|
186
|
-
? { index: body.index }
|
|
286
|
+
? { index: body.index }
|
|
287
|
+
: {}),
|
|
187
288
|
};
|
|
188
289
|
}
|
|
189
290
|
const code = data_provider_1.APP_PERSON_DATA_REFUSALS.includes(body.code)
|
|
@@ -198,11 +299,14 @@ function readPersonDataFailure(error) {
|
|
|
198
299
|
...status,
|
|
199
300
|
...(typeof body.message === 'string' ? { message: body.message } : {}),
|
|
200
301
|
...(code === 'unavailable' && body.reason === 'installation_suspended'
|
|
201
|
-
? { reason: 'installation_suspended' }
|
|
202
|
-
|
|
203
|
-
|
|
302
|
+
? { reason: 'installation_suspended' }
|
|
303
|
+
: {}),
|
|
304
|
+
...(code === 'schema' && cursorRefusalReason(body.reason) !== undefined
|
|
305
|
+
? { reason: cursorRefusalReason(body.reason) }
|
|
306
|
+
: {}),
|
|
204
307
|
...(typeof body.index === 'number' && Number.isInteger(body.index) && body.index >= 0
|
|
205
|
-
? { index: body.index }
|
|
308
|
+
? { index: body.index }
|
|
309
|
+
: {}),
|
|
206
310
|
...(typeof body.retryAfterMs === 'number' ? { retryAfterMs: body.retryAfterMs } : {}),
|
|
207
311
|
};
|
|
208
312
|
}
|
|
@@ -249,11 +353,21 @@ function describePersonDataRefusal(failure, bin, operation) {
|
|
|
249
353
|
return `This installation is paused, so the operation was not run. If you paused it, resume it with \`${bin} apps resume <installation>\`. A platform pause can only be lifted by the platform.`;
|
|
250
354
|
}
|
|
251
355
|
if (operation === 'query' && failure.code === 'schema') {
|
|
252
|
-
if (typeof data_provider_1.APP_STORE_CURSOR_INVALID_MESSAGE === 'string' &&
|
|
253
|
-
|
|
356
|
+
if (typeof data_provider_1.APP_STORE_CURSOR_INVALID_MESSAGE === 'string' &&
|
|
357
|
+
data_provider_1.APP_STORE_CURSOR_INVALID_MESSAGE.length > 0 &&
|
|
358
|
+
((typeof data_provider_1.APP_STORE_CURSOR_INVALID_REASON === 'string' &&
|
|
359
|
+
failure.reason === data_provider_1.APP_STORE_CURSOR_INVALID_REASON) ||
|
|
254
360
|
failure.message === data_provider_1.APP_STORE_CURSOR_INVALID_MESSAGE)) {
|
|
255
361
|
return data_provider_1.APP_STORE_CURSOR_INVALID_MESSAGE;
|
|
256
362
|
}
|
|
363
|
+
// a cursor that is fine but belongs to another query: say that, not "the query is invalid" (the query IS valid)
|
|
364
|
+
const cursorReason = cursorRefusalReason(failure.reason);
|
|
365
|
+
if (typeof data_provider_1.APP_STORE_CURSOR_MISMATCH_MESSAGE === 'string' &&
|
|
366
|
+
data_provider_1.APP_STORE_CURSOR_MISMATCH_MESSAGE.length > 0 &&
|
|
367
|
+
((cursorReason !== undefined && cursorReason === data_provider_1.APP_STORE_CURSOR_MISMATCH_REASON) ||
|
|
368
|
+
failure.message === data_provider_1.APP_STORE_CURSOR_MISMATCH_MESSAGE)) {
|
|
369
|
+
return data_provider_1.APP_STORE_CURSOR_MISMATCH_MESSAGE;
|
|
370
|
+
}
|
|
257
371
|
return 'The query is invalid. Check the collection and query options; --id cannot be combined with --where or --cursor.';
|
|
258
372
|
}
|
|
259
373
|
if (failure.code === 'schema' && failure.message?.trim()) {
|
|
@@ -279,13 +393,19 @@ function describePersonDataConflict(failure, target, bin) {
|
|
|
279
393
|
const verb = target.verb ?? 'put';
|
|
280
394
|
if (verb === 'batch') {
|
|
281
395
|
const index = Number.isSafeInteger(failure.index) && failure.index >= 0
|
|
282
|
-
? ` at index ${failure.index} (zero-based)`
|
|
396
|
+
? ` at index ${failure.index} (zero-based)`
|
|
397
|
+
: '';
|
|
283
398
|
const revision = Number.isSafeInteger(failure.currentRev) && failure.currentRev >= 0
|
|
284
|
-
? ` The server reported revision ${failure.currentRev}.`
|
|
285
|
-
|
|
286
|
-
|
|
399
|
+
? ` The server reported revision ${failure.currentRev}.`
|
|
400
|
+
: '';
|
|
401
|
+
const reason = failure.conflict === 'rev_mismatch'
|
|
402
|
+
? 'has changed'
|
|
403
|
+
: failure.conflict === 'exists'
|
|
404
|
+
? 'already exists'
|
|
405
|
+
: 'was not found';
|
|
287
406
|
const item = Number.isSafeInteger(failure.index) && failure.index >= 0
|
|
288
|
-
? target.batchTargets?.[failure.index]
|
|
407
|
+
? target.batchTargets?.[failure.index]
|
|
408
|
+
: undefined;
|
|
289
409
|
const label = (value) => typeof value === 'string' && value.length > 0
|
|
290
410
|
? safeForTerminal(JSON.stringify(value.slice(0, 128))) + (value.length > 128 ? '…' : '')
|
|
291
411
|
: null;
|
|
@@ -293,7 +413,11 @@ function describePersonDataConflict(failure, target, bin) {
|
|
|
293
413
|
const id = label(item?.id);
|
|
294
414
|
return [
|
|
295
415
|
`Nothing in the batch was written. The document for the write${index} ${reason}.${revision}`,
|
|
296
|
-
...(collection || id
|
|
416
|
+
...(collection || id
|
|
417
|
+
? [
|
|
418
|
+
` ${collection ? `collection ${collection}` : 'collection not provided'}; ${id ? `document ${id}` : 'document ID not provided'}.`,
|
|
419
|
+
]
|
|
420
|
+
: []),
|
|
297
421
|
'→ Inspect that write in your batch input. Use its collection and document ID to query the current data, then reconcile and update the affected operation before submitting the batch again.',
|
|
298
422
|
].join('\n');
|
|
299
423
|
}
|
|
@@ -460,7 +584,8 @@ function formatCollections(catalog) {
|
|
|
460
584
|
lines.push(` fields: ${fields || '(none named)'}${collection.schema.moreFields > 0 ? `, +${collection.schema.moreFields} more` : ''}${collection.schema.closed ? ' (other fields are refused)' : ''}`);
|
|
461
585
|
}
|
|
462
586
|
}
|
|
463
|
-
if (typeof catalog.notice !== 'string' ||
|
|
587
|
+
if (typeof catalog.notice !== 'string' ||
|
|
588
|
+
!catalog.notice.includes(data_provider_1.APP_DATA_WRITER_DECLARATION_NOTICE)) {
|
|
464
589
|
lines.push('Declared writers are not a permission check. Each call also depends on the current grant, installation state and caller permissions.');
|
|
465
590
|
}
|
|
466
591
|
lines.push(safeForTerminal(catalog.notice));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AppInstallationVersionsView, AppVersionDiff, AppDisclosureCheck, AppDisclosureFacts, AppHostUnsuitable, AppInstallationJobState, AppInstallationListItem, AppOperatorUnmet } from '@skrr-ai/data-provider';
|
|
1
|
+
import type { AppGrantReasonFacts, AppInstallationVersionsView, AppVersionDiff, AppDisclosureCheck, AppDisclosureFacts, AppHostUnsuitable, AppInstallationJobState, AppInstallationListItem, AppOperatorUnmet } from '@skrr-ai/data-provider';
|
|
2
2
|
import type { AppsRefusal } from './apps';
|
|
3
3
|
/**
|
|
4
4
|
* The words for an availability the contract names. One this CLI does not know (a server newer than the CLI) is said
|
|
@@ -30,8 +30,13 @@ export declare function describeJobScheduling(jobState: {
|
|
|
30
30
|
} | null;
|
|
31
31
|
/** The lines `skrr apps installations show` prints for the jobs' states: one per job, the reason and the next step under a job that is not scheduled. */
|
|
32
32
|
export declare function formatJobStates(jobStates: readonly AppInstallationJobState[] | undefined, installationId: string, jobTriggers?: Record<string, unknown>): string[];
|
|
33
|
-
/**
|
|
34
|
-
|
|
33
|
+
/**
|
|
34
|
+
* The words for each reason a grant stopped covering a version; a kind it does not know is said as it came. A reason that
|
|
35
|
+
* carries facts says them: `store_writers_expanded` lists, for each kind of writer a version adds, the collections it can now
|
|
36
|
+
* change (`digest:app` is "the app's own code ... "digest""), from the `items` the server sent, and says the neutral
|
|
37
|
+
* sentence when it sent none. All the store-writer reasons of a list are said together, once.
|
|
38
|
+
*/
|
|
39
|
+
export declare function describeGrantReasons(reasons: readonly AppGrantReasonFacts[]): string[];
|
|
35
40
|
/**
|
|
36
41
|
* A disclosure as the lines a person reads before they approve. `null` (a disclosure this CLI cannot read) is
|
|
37
42
|
* said plainly: "cannot show what you would be approving" is never "nothing to approve".
|
|
@@ -79,8 +84,30 @@ export declare function resolveInstallTarget(input: {
|
|
|
79
84
|
appId: string;
|
|
80
85
|
versionId?: string;
|
|
81
86
|
}): Promise<InstallTarget>;
|
|
82
|
-
/**
|
|
83
|
-
|
|
87
|
+
/**
|
|
88
|
+
* What the command that was refused knows, for the words of its refusal. Every field is optional: a command that knows
|
|
89
|
+
* less gets words that name less (a placeholder in angle brackets where an argument is unknown), never a command printed
|
|
90
|
+
* with a required argument missing and never an outcome it did not have.
|
|
91
|
+
*/
|
|
92
|
+
export interface InstallationConflictContext {
|
|
93
|
+
/** The installation the command was about (`appi_...`), when it was about one. */
|
|
94
|
+
subject?: string;
|
|
95
|
+
/** The version the command was installing, moving an installation to, or approving (`appv_...`). */
|
|
96
|
+
versionId?: string;
|
|
97
|
+
/** What the command was doing, so "nothing was ..." says what did not happen. */
|
|
98
|
+
action?: 'install' | 'reconsent' | 'upgrade';
|
|
99
|
+
/** For an install: who it was for (the signed-in person, or an agent). */
|
|
100
|
+
principal?: {
|
|
101
|
+
kind: 'agent' | 'user';
|
|
102
|
+
id: string;
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* The sentence for a refusal the server made on an installation call, or null for one that is not. `context` is what the
|
|
107
|
+
* command knows (the installation it was about, the version, what it was doing); a bare string is the installation, as
|
|
108
|
+
* the callers that only ever had that pass it.
|
|
109
|
+
*/
|
|
110
|
+
export declare function describeInstallationConflict(refusal: AppsRefusal, bin: string, context?: string | InstallationConflictContext): string | null;
|
|
84
111
|
/** The machine code of every installation refusal: `APP_<REASON>`. */
|
|
85
112
|
export declare const ALL_INSTALLATION_REFUSAL_CODES: Record<string, string>;
|
|
86
113
|
export declare const INSTALLATION_REFUSAL_CODES: Record<string, string>;
|