@skrr-ai/cli 0.1.162 → 0.1.163

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.
Files changed (82) hide show
  1. package/dist/base-command.d.ts +5 -2
  2. package/dist/base-command.js +96 -39
  3. package/dist/commands/activity/list.d.ts +7 -0
  4. package/dist/commands/activity/list.js +17 -0
  5. package/dist/commands/activity/scan-older.d.ts +2 -2
  6. package/dist/commands/activity/scan-older.js +6 -5
  7. package/dist/commands/activity/show.d.ts +0 -2
  8. package/dist/commands/activity/show.js +21 -42
  9. package/dist/commands/agents/always-on/release-run.d.ts +3 -3
  10. package/dist/commands/agents/always-on/release-run.js +5 -6
  11. package/dist/commands/agents/mini-computer/app/reset.d.ts +1 -0
  12. package/dist/commands/agents/mini-computer/app/reset.js +5 -2
  13. package/dist/commands/agents/mini-computer/app/set.js +1 -1
  14. package/dist/commands/agents/mini-computer/show.js +4 -2
  15. package/dist/commands/agents/mini-computer/tasks-view.js +2 -2
  16. package/dist/commands/agents/triggers/replay.js +1 -1
  17. package/dist/commands/agents/triggers/runs.d.ts +2 -3
  18. package/dist/commands/agents/triggers/runs.js +4 -5
  19. package/dist/commands/apps/auto-apply.js +31 -10
  20. package/dist/commands/apps/check.js +8 -0
  21. package/dist/commands/apps/data/batch.js +16 -5
  22. package/dist/commands/apps/data/collections.js +1 -1
  23. package/dist/commands/apps/data/delete.js +12 -4
  24. package/dist/commands/apps/data/patch.js +11 -4
  25. package/dist/commands/apps/data/put.js +13 -6
  26. package/dist/commands/apps/data/query.js +3 -3
  27. package/dist/commands/apps/install.js +24 -7
  28. package/dist/commands/apps/installations/events.d.ts +1 -0
  29. package/dist/commands/apps/installations/events.js +63 -10
  30. package/dist/commands/apps/installations/show.js +26 -5
  31. package/dist/commands/apps/installations/snapshot.js +1 -1
  32. package/dist/commands/apps/installations/versions.js +25 -9
  33. package/dist/commands/apps/logs.js +4 -1
  34. package/dist/commands/apps/push.js +10 -2
  35. package/dist/commands/apps/reconsent.js +7 -1
  36. package/dist/commands/apps/rollback.js +2 -2
  37. package/dist/commands/apps/settings/set.js +81 -4
  38. package/dist/commands/apps/settings/show.js +38 -7
  39. package/dist/commands/duties/status.js +20 -15
  40. package/dist/commands/outbox/drop.js +21 -15
  41. package/dist/commands/outbox/list.d.ts +2 -1
  42. package/dist/commands/outbox/list.js +20 -11
  43. package/dist/commands/outbox/retry.d.ts +8 -11
  44. package/dist/commands/outbox/retry.js +135 -92
  45. package/dist/commands/spaces/create.js +1 -1
  46. package/dist/commands/tasks/comments/add.js +1 -1
  47. package/dist/commands/triggers/audit.js +3 -5
  48. package/dist/commands/triggers/fire-detail.js +7 -1
  49. package/dist/commands/triggers/replay.js +1 -1
  50. package/dist/commands/triggers/runs.d.ts +2 -4
  51. package/dist/commands/triggers/runs.js +3 -5
  52. package/dist/generated/agent-guides.json +19 -19
  53. package/dist/lib/agent-activity.d.ts +21 -1
  54. package/dist/lib/agent-activity.js +98 -29
  55. package/dist/lib/api-fetch.d.ts +2 -0
  56. package/dist/lib/api-fetch.js +5 -5
  57. package/dist/lib/appData.d.ts +43 -5
  58. package/dist/lib/appData.js +117 -25
  59. package/dist/lib/appInstallations.d.ts +5 -5
  60. package/dist/lib/appInstallations.js +211 -74
  61. package/dist/lib/appSettings.d.ts +2 -0
  62. package/dist/lib/appSettings.js +36 -3
  63. package/dist/lib/apps-command.d.ts +9 -0
  64. package/dist/lib/apps-command.js +191 -7
  65. package/dist/lib/appsCheck.js +29 -3
  66. package/dist/lib/appsFs.d.ts +1 -1
  67. package/dist/lib/json-output.d.ts +4 -0
  68. package/dist/lib/json-output.js +38 -0
  69. package/dist/lib/miniComputer.js +9 -2
  70. package/dist/lib/node-adapter.js +35 -2
  71. package/dist/lib/outbox.d.ts +20 -5
  72. package/dist/lib/outbox.js +233 -76
  73. package/dist/lib/rate-limit-retry.d.ts +3 -2
  74. package/dist/lib/rate-limit-retry.js +3 -2
  75. package/dist/lib/roles.d.ts +1 -1
  76. package/dist/lib/triggers.d.ts +3 -0
  77. package/dist/lib/triggers.js +10 -0
  78. package/dist/lib/widgetStaticScan.d.ts +3 -1
  79. package/dist/lib/widgetStaticScan.js +182 -47
  80. package/dist/node_modules/@skrr-ai/data-provider/index.js +10416 -9520
  81. package/oclif.manifest.json +137 -44
  82. package/package.json +4 -3
@@ -1,6 +1,7 @@
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.assertAppDataWriteResult = assertAppDataWriteResult;
4
5
  exports.readDocumentInput = readDocumentInput;
5
6
  exports.readWhereInput = readWhereInput;
6
7
  exports.readPersonDataFailure = readPersonDataFailure;
@@ -58,6 +59,43 @@ function asPlainObject(value) {
58
59
  ? value
59
60
  : null;
60
61
  }
62
+ /** A 2xx is not a receipt unless its body identifies the requested operation. */
63
+ function assertAppDataWriteResult(value, target) {
64
+ const result = asPlainObject(value);
65
+ const validRev = (rev) => typeof rev === 'number' && Number.isSafeInteger(rev) && rev >= 0;
66
+ const validId = (id) => typeof id === 'string' && id.length > 0;
67
+ const validConflict = (conflict) => data_provider_1.APP_STORE_CONFLICTS.includes(conflict);
68
+ let valid = false;
69
+ if (result && result.ok !== false) {
70
+ const outcome = target.verb === 'delete' ? result.deleted : result.written;
71
+ const contradictsSuccess = result.conflict != null || result.error != null ||
72
+ result.code === 'conflict' || (target.verb === 'delete' ? result.written === true : result.deleted === true);
73
+ if (outcome === false) {
74
+ valid = validConflict(result.conflict) &&
75
+ (result.currentRev === undefined || validRev(result.currentRev)) &&
76
+ (target.verb !== 'batch' || (Number.isSafeInteger(result.index) &&
77
+ result.index >= 0 && result.index < target.writes.length));
78
+ }
79
+ else if (outcome === true && !contradictsSuccess && target.verb === 'batch') {
80
+ valid = target.writes.length > 0 && Array.isArray(result.results) && result.results.length === target.writes.length &&
81
+ result.results.every((entry, index) => {
82
+ const item = asPlainObject(entry);
83
+ const requested = target.writes[index];
84
+ return Boolean(item && ['put', 'patch', 'delete'].includes(String(requested.op)) &&
85
+ typeof requested.collection === 'string' && requested.collection.length > 0 &&
86
+ item.op === requested.op && item.collection === requested.collection &&
87
+ validId(item.id) && (requested.id === undefined || item.id === requested.id) && validRev(item.rev));
88
+ });
89
+ }
90
+ else if (outcome === true && !contradictsSuccess && target.verb !== 'batch') {
91
+ valid = result.id === target.id && validId(result.id) && validRev(result.rev) &&
92
+ (target.verb === 'delete' || (typeof result.created === 'boolean' && typeof result.updatedAt === 'string' && result.updatedAt.length > 0));
93
+ }
94
+ }
95
+ if (!valid) {
96
+ throw Object.assign(new Error('The app data write response did not confirm the requested operation.'), { code: 'APP_DATA_UNCONFIRMED_RESPONSE' });
97
+ }
98
+ }
61
99
  /**
62
100
  * The document the person gave, from exactly one of `--doc`, `--from-file` and `--stdin`. A file is read the way the
63
101
  * authoring commands read one (a symbolic link is refused, never followed). The error names the problem and never
@@ -91,7 +129,7 @@ async function readDocumentInput(input) {
91
129
  }
92
130
  return object;
93
131
  }
94
- /** The `--where` of a read: a JSON object. What it may hold is the server's parser's to say, once, for every client. */
132
+ /** Validate `--where` with the same parser the server uses. */
95
133
  function readWhereInput(text) {
96
134
  let parsed;
97
135
  try {
@@ -104,7 +142,11 @@ function readWhereInput(text) {
104
142
  if (!object) {
105
143
  throw new AppDataInputError('APP_DATA_WHERE', '--where must be a JSON object of equalities on top-level fields, for example \'{"status":"open"}\'.');
106
144
  }
107
- return object;
145
+ const checked = (0, data_provider_1.appStoreQueryFromParams)('probe', { where: JSON.stringify(object) });
146
+ if (!checked.ok || checked.value.where === undefined) {
147
+ throw new AppDataInputError('APP_DATA_WHERE', '--where supports equality on top-level field names with scalar text, number, boolean or null values; nested operators are not supported. Check field names and size limits too.');
148
+ }
149
+ return checked.value.where;
108
150
  }
109
151
  /**
110
152
  * What the person channel answered, read out of an API error: a refusal (`{ error, code, message }`, the code from
@@ -140,7 +182,8 @@ function readPersonDataFailure(error) {
140
182
  conflict,
141
183
  ...status,
142
184
  ...(typeof body.currentRev === 'number' ? { currentRev: body.currentRev } : {}),
143
- ...(typeof body.index === 'number' ? { index: body.index } : {}),
185
+ ...(typeof body.index === 'number' && Number.isSafeInteger(body.index) && body.index >= 0
186
+ ? { index: body.index } : {}),
144
187
  };
145
188
  }
146
189
  const code = data_provider_1.APP_PERSON_DATA_REFUSALS.includes(body.code)
@@ -154,6 +197,12 @@ function readPersonDataFailure(error) {
154
197
  code,
155
198
  ...status,
156
199
  ...(typeof body.message === 'string' ? { message: body.message } : {}),
200
+ ...(code === 'unavailable' && body.reason === 'installation_suspended'
201
+ ? { reason: 'installation_suspended' } : {}),
202
+ ...(code === 'schema' && typeof data_provider_1.APP_STORE_CURSOR_INVALID_REASON === 'string' && body.reason === data_provider_1.APP_STORE_CURSOR_INVALID_REASON
203
+ ? { reason: data_provider_1.APP_STORE_CURSOR_INVALID_REASON } : {}),
204
+ ...(typeof body.index === 'number' && Number.isInteger(body.index) && body.index >= 0
205
+ ? { index: body.index } : {}),
157
206
  ...(typeof body.retryAfterMs === 'number' ? { retryAfterMs: body.retryAfterMs } : {}),
158
207
  };
159
208
  }
@@ -179,9 +228,9 @@ exports.PERSON_DATA_CONFLICT_CODES = {
179
228
  function personDataFailureExit(failure) {
180
229
  return failure.kind === 'refusal' && failure.code === 'not_found' ? 4 : 1;
181
230
  }
182
- /** Can the same call work a moment later? A busy server and a rate limit can; the rest need something changed. */
231
+ /** Automatic retry is only advised when the refusal proves it is safe to retry. */
183
232
  function personDataFailureRetryable(failure) {
184
- return failure.kind === 'refusal' && (failure.code === 'rate' || failure.code === 'unavailable');
233
+ return failure.kind === 'refusal' && failure.code === 'rate';
185
234
  }
186
235
  const REFUSAL_WORDS = {
187
236
  human_only: (bin) => `Only a signed-in person, or an Agent's credential on a machine (the one the platform gives a harness it launched, or a Hosted Machine's own sign-in), can use an app's data this way. This credential is neither (an access token). Sign in as yourself with \`${bin} login\`.`,
@@ -189,14 +238,34 @@ const REFUSAL_WORDS = {
189
238
  not_granted: () => 'This credential may not write this collection here. The running version must list it in capabilities.store and name the writer you are in its write list ("person" for a signed-in person, "agent" for an Agent\'s credential), and the person who installed the app must have approved that. Nothing was written.',
190
239
  forbidden_by_viewer: () => 'You do not have permission to do this on the agent this app is installed on (writing needs edit access, reading needs view access). Nothing was written.',
191
240
  grant_stale: (bin) => `This app changed since it was approved. Approve it again with \`${bin} apps reconsent <installation>\` and try again.`,
192
- schema: () => 'The request does not fit this operation (the collection name, the document id, the document, or a query parameter). Nothing was written.',
193
- quota: () => `That would go over a limit (a document is at most ${data_provider_1.APP_STORE_LIMITS.docMaxChars} characters of JSON, a collection holds at most ${data_provider_1.APP_STORE_LIMITS.docsPerCollectionMax} documents, an installation at most ${data_provider_1.APP_STORE_LIMITS.installationMaxBytes} bytes). Nothing was written; nothing is ever trimmed to fit.`,
241
+ schema: (bin) => `The request does not fit this operation (the collection name, the document id, or the document). Nothing was written. To inspect the collection's top-level schema summary, run \`${bin} apps data collections <installation>\`.`,
242
+ quota: () => `That would go over a limit. This CLI documents a maximum of ${data_provider_1.APP_STORE_LIMITS.docMaxChars} characters of JSON per document, ${data_provider_1.APP_STORE_LIMITS.docsPerCollectionMax} documents per collection and ${data_provider_1.APP_STORE_LIMITS.installationMaxBytes} bytes per installation; the server's limits may differ. Nothing was written; nothing is ever trimmed to fit.`,
194
243
  rate: () => 'Too many writes in a short time. Wait a moment and try again.',
195
- unavailable: () => 'This is not available right now: the installation may be paused, or the server is busy. Check `apps installations show <installation>`, then try again.',
244
+ unavailable: (bin) => `This is not available right now; the cause is unknown. Check \`${bin} apps installations show <installation>\`. If you attempted a write, read the current data and revision before retrying.`,
196
245
  };
197
- /** The words for a refusal. The server's own sentence, when it sent one, is added after ours and never replaces it. */
198
- function describePersonDataRefusal(failure, bin) {
246
+ /** The words for a refusal. Keep specific server diagnostics alongside the general guidance. */
247
+ function describePersonDataRefusal(failure, bin, operation) {
248
+ if (failure.code === 'unavailable' && failure.reason === 'installation_suspended') {
249
+ 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
+ }
251
+ if (operation === 'query' && failure.code === 'schema') {
252
+ if (typeof data_provider_1.APP_STORE_CURSOR_INVALID_MESSAGE === 'string' && data_provider_1.APP_STORE_CURSOR_INVALID_MESSAGE.length > 0 &&
253
+ ((typeof data_provider_1.APP_STORE_CURSOR_INVALID_REASON === 'string' && failure.reason === data_provider_1.APP_STORE_CURSOR_INVALID_REASON) ||
254
+ failure.message === data_provider_1.APP_STORE_CURSOR_INVALID_MESSAGE)) {
255
+ return data_provider_1.APP_STORE_CURSOR_INVALID_MESSAGE;
256
+ }
257
+ return 'The query is invalid. Check the collection and query options; --id cannot be combined with --where or --cursor.';
258
+ }
259
+ if (failure.code === 'schema' && failure.message?.trim()) {
260
+ // The server's diagnostic may contain app-authored field names. Keep it
261
+ // terminal-safe, then give recovery guidance without guessing other causes.
262
+ const message = safeForTerminal(failure.message.trim().slice(0, 1000));
263
+ return `${message}\nNothing was written. To inspect the collection's top-level schema summary, run \`${bin} apps data collections <installation>\`.`;
264
+ }
199
265
  const lines = [REFUSAL_WORDS[failure.code](bin)];
266
+ if (failure.code === 'quota' && failure.message?.trim()) {
267
+ lines.unshift(safeForTerminal(failure.message.trim().slice(0, 1000)));
268
+ }
200
269
  if (failure.code === 'rate' && failure.retryAfterMs !== undefined) {
201
270
  lines.push(`→ Try again in ${Math.max(1, Math.ceil(failure.retryAfterMs / 1000))} s.`);
202
271
  }
@@ -207,27 +276,44 @@ function describePersonDataRefusal(failure, bin) {
207
276
  * wrote the document first, so read it again, merge, and retry with the revision it is at now. Nothing was written.
208
277
  */
209
278
  function describePersonDataConflict(failure, target, bin) {
210
- const read = `${bin} apps data query ${target.installation} ${target.collection} --id ${target.id}`;
211
279
  const verb = target.verb ?? 'put';
212
- const where = verb === 'batch'
213
- ? `write number ${failure.index ?? '(unknown)'} of the batch`
214
- : `${target.collection}/${target.id}`;
215
- const nothing = verb === 'batch' ? 'Nothing in the batch was written.' : '';
280
+ if (verb === 'batch') {
281
+ const index = Number.isSafeInteger(failure.index) && failure.index >= 0
282
+ ? ` at index ${failure.index} (zero-based)` : '';
283
+ const revision = Number.isSafeInteger(failure.currentRev) && failure.currentRev >= 0
284
+ ? ` The server reported revision ${failure.currentRev}.` : '';
285
+ const reason = failure.conflict === 'rev_mismatch' ? 'has changed'
286
+ : failure.conflict === 'exists' ? 'already exists' : 'was not found';
287
+ const item = Number.isSafeInteger(failure.index) && failure.index >= 0
288
+ ? target.batchTargets?.[failure.index] : undefined;
289
+ const label = (value) => typeof value === 'string' && value.length > 0
290
+ ? safeForTerminal(JSON.stringify(value.slice(0, 128))) + (value.length > 128 ? '…' : '')
291
+ : null;
292
+ const collection = label(item?.collection);
293
+ const id = label(item?.id);
294
+ return [
295
+ `Nothing in the batch was written. The document for the write${index} ${reason}.${revision}`,
296
+ ...(collection || id ? [` ${collection ? `collection ${collection}` : 'collection not provided'}; ${id ? `document ${id}` : 'document ID not provided'}.`] : []),
297
+ '→ 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
+ ].join('\n');
299
+ }
300
+ const read = `${bin} apps data query ${target.installation} ${target.collection} --id ${target.id}`;
301
+ const where = `${target.collection}/${target.id}`;
216
302
  switch (failure.conflict) {
217
303
  case 'rev_mismatch':
218
304
  return [
219
- `Not ${verb === 'delete' ? 'deleted' : 'written'}: ${where} is at revision ${failure.currentRev ?? '(unknown)'}, not the one you named. ${nothing}`.trim(),
305
+ `Not ${verb === 'delete' ? 'deleted' : 'written'}: ${where} is at revision ${failure.currentRev ?? '(unknown)'}, not the one you named.`,
220
306
  `→ Read it again (\`${read}\`), ${verb === 'delete' ? 'check it is still the one you mean' : 'merge'}, and retry with --expected-rev ${failure.currentRev ?? '<its revision>'}.`,
221
307
  ].join('\n');
222
308
  case 'exists':
223
309
  return [
224
- `Not written: ${where} already exists${failure.currentRev === undefined ? '' : ` (revision ${failure.currentRev})`}, and --expected-rev 0 only creates. ${nothing}`.trim(),
310
+ `Not written: ${where} already exists${failure.currentRev === undefined ? '' : ` (revision ${failure.currentRev})`}, and --expected-rev 0 only creates.`,
225
311
  `→ Read it (\`${read}\`) and replace it with --expected-rev ${failure.currentRev ?? '<its revision>'}, or leave --expected-rev out to overwrite whatever is there.`,
226
312
  ].join('\n');
227
313
  case 'not_found':
228
- return verb === 'put' || verb === 'batch'
314
+ return verb === 'put'
229
315
  ? [
230
- `Not written: there is no document ${where} to replace. ${nothing}`.trim(),
316
+ `Not written: there is no document ${where} to replace.`,
231
317
  `→ Create it with --expected-rev 0, or leave --expected-rev out.`,
232
318
  ].join('\n')
233
319
  : [
@@ -330,17 +416,20 @@ function formatDocument(doc) {
330
416
  return [head, ` ${shown}`];
331
417
  }
332
418
  /** A page of documents, in lines; an empty page says so, and a page that ends early says how to ask for the rest. */
333
- function formatQueryResult(result, target, bin) {
419
+ function formatQueryResult(result, target, _bin) {
334
420
  const lines = [];
335
421
  const total = result.total === undefined ? '' : ` of ${result.total}`;
336
422
  lines.push(result.docs.length === 0
337
- ? `No documents in ${target.collection}.`
423
+ ? `No documents on this page in ${target.collection}.${result.total === undefined ? '' : ` ${result.total} document${result.total === 1 ? ' matches' : 's match'} the query.`}`
338
424
  : `${result.docs.length} document${result.docs.length === 1 ? '' : 's'}${total} in ${target.collection}:`);
339
425
  for (const doc of result.docs) {
340
426
  lines.push(...formatDocument(doc));
341
427
  }
428
+ if (result.truncated === true) {
429
+ lines.push('This page ended early because the response reached its capacity limit.');
430
+ }
342
431
  if (result.nextCursor) {
343
- lines.push(`→ More: \`${bin} apps data query ${target.installation} ${target.collection} --cursor ${result.nextCursor}\` (same filters).`);
432
+ lines.push(`→ Next page: run the same query with --cursor set to ${safeForTerminal(result.nextCursor)} (replace any previous cursor); keep its filters and sort.`);
344
433
  }
345
434
  return lines;
346
435
  }
@@ -354,13 +443,13 @@ exports.PERSON_DATA_QUERY_LIMIT_MAX = data_provider_1.APP_STORE_LIMITS.queryLimi
354
443
  function formatCollections(catalog) {
355
444
  const lines = [];
356
445
  const { installation } = catalog;
357
- lines.push(`${safeForTerminal(installation.name ?? installation.id)} (${installation.id}, ${installation.state}${installation.usable ? '' : ', the data tools refuse it right now'})`);
446
+ lines.push(`${safeForTerminal(installation.name ?? installation.id)} (${installation.id}, ${installation.state}${installation.usable ? '' : ', agent data tools are unavailable under this installation state or grant'})`);
358
447
  if (catalog.collections.length === 0) {
359
448
  lines.push(' no collections');
360
449
  }
361
450
  for (const collection of catalog.collections) {
362
- const writers = collection.writers.join(', ');
363
- lines.push(` ${safeForTerminal(collection.name)} ${collection.documents} document${collection.documents === 1 ? '' : 's'} written by: ${writers}${collection.agentMayWrite ? ' (an agent may write it)' : ''}${collection.inStore ? '' : ' (not read by the window)'}`);
451
+ const writers = collection.writers.map((writer) => safeForTerminal(writer)).join(', ');
452
+ lines.push(` ${safeForTerminal(collection.name)} ${collection.documents} document${collection.documents === 1 ? '' : 's'} declared writers: ${writers}${collection.inStore ? '' : ' (not declared for window store access)'}`);
364
453
  if (collection.description) {
365
454
  lines.push(` ${safeForTerminal(collection.description)}`);
366
455
  }
@@ -371,6 +460,9 @@ function formatCollections(catalog) {
371
460
  lines.push(` fields: ${fields || '(none named)'}${collection.schema.moreFields > 0 ? `, +${collection.schema.moreFields} more` : ''}${collection.schema.closed ? ' (other fields are refused)' : ''}`);
372
461
  }
373
462
  }
463
+ if (typeof catalog.notice !== 'string' || !catalog.notice.includes(data_provider_1.APP_DATA_WRITER_DECLARATION_NOTICE)) {
464
+ lines.push('Declared writers are not a permission check. Each call also depends on the current grant, installation state and caller permissions.');
465
+ }
374
466
  lines.push(safeForTerminal(catalog.notice));
375
467
  return lines;
376
468
  }
@@ -29,7 +29,7 @@ export declare function describeJobScheduling(jobState: {
29
29
  next: string | null;
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
- export declare function formatJobStates(jobStates: readonly AppInstallationJobState[] | undefined, installationId: string): string[];
32
+ export declare function formatJobStates(jobStates: readonly AppInstallationJobState[] | undefined, installationId: string, jobTriggers?: Record<string, unknown>): string[];
33
33
  /** The words for each reason a grant stopped covering a version; a kind it does not know is said as it came. */
34
34
  export declare function describeGrantReasons(kinds: readonly string[]): string[];
35
35
  /**
@@ -80,7 +80,7 @@ export declare function resolveInstallTarget(input: {
80
80
  versionId?: string;
81
81
  }): Promise<InstallTarget>;
82
82
  /** The sentence for a refusal the server made on an installation call, or null for one that is not. */
83
- export declare function describeInstallationConflict(refusal: AppsRefusal, bin: string): string | null;
83
+ export declare function describeInstallationConflict(refusal: AppsRefusal, bin: string, subject?: string): string | null;
84
84
  /** The machine code of every installation refusal: `APP_<REASON>`. */
85
85
  export declare const ALL_INSTALLATION_REFUSAL_CODES: Record<string, string>;
86
86
  export declare const INSTALLATION_REFUSAL_CODES: Record<string, string>;
@@ -116,10 +116,10 @@ export declare function describeReportRefusal(refusal: AppsRefusal, bin: string)
116
116
  /** The exit of a refusal that says "that is not there for you": the same one an unknown app gets. */
117
117
  export declare function installationRefusalExit(conflict: string): number;
118
118
  /**
119
- * What the versions view says, as lines a person reads: which version runs, what is waiting and what it needs, the opt-in
120
- * and where a rollback goes. `needs_reconsent` is said as "asks for more than you approved", never as a verdict on the
119
+ * What the versions view says, as lines a person reads: which version is installed, what is waiting and what it needs,
120
+ * the opt-in and the currently observed rollback target. `needs_reconsent` is said as "asks for more than you approved", never as a verdict on the
121
121
  * version, and nothing here says an automatic check makes a version safe.
122
122
  */
123
- export declare function formatInstallationVersions(view: AppInstallationVersionsView, bin: string): string[];
123
+ export declare function formatInstallationVersions(view: AppInstallationVersionsView, bin: string, requestedInstallationId: string): string[] | null;
124
124
  /** A diff between two versions, as lines: the capability and job changes first (they are what needs deciding), then the files. */
125
125
  export declare function formatVersionDiff(diff: AppVersionDiff): string[];