@skrr-ai/cli 0.1.208 → 0.1.209

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 (87) hide show
  1. package/dist/commands/agent/message/no-reply.js +1 -1
  2. package/dist/commands/agent/message/react.d.ts +23 -0
  3. package/dist/commands/agent/message/react.js +125 -0
  4. package/dist/commands/agent/message/resolve.js +1 -1
  5. package/dist/commands/agent/message/retract.js +1 -1
  6. package/dist/commands/agent/message/send.d.ts +8 -1
  7. package/dist/commands/agent/message/send.js +58 -4
  8. package/dist/commands/agents/access/approve.js +1 -1
  9. package/dist/commands/agents/access/deny.js +1 -1
  10. package/dist/commands/agents/access/list.js +3 -1
  11. package/dist/commands/agents/access/reach.js +1 -1
  12. package/dist/commands/agents/access/revoke.js +1 -1
  13. package/dist/commands/agents/always-on/recovery-review.d.ts +5 -0
  14. package/dist/commands/agents/always-on/recovery-review.js +16 -0
  15. package/dist/commands/agents/chat.d.ts +8 -0
  16. package/dist/commands/agents/chat.js +369 -90
  17. package/dist/commands/agents/import.js +3 -3
  18. package/dist/commands/agents/manager/status.js +7 -6
  19. package/dist/commands/agents/not-for-task.d.ts +24 -0
  20. package/dist/commands/agents/not-for-task.js +60 -0
  21. package/dist/commands/agents/schedule-overview.d.ts +20 -0
  22. package/dist/commands/agents/schedule-overview.js +35 -2
  23. package/dist/commands/agents/shared-memory.js +1 -1
  24. package/dist/commands/agents/stop.d.ts +23 -0
  25. package/dist/commands/agents/stop.js +61 -0
  26. package/dist/commands/agents/update.d.ts +7 -0
  27. package/dist/commands/agents/update.js +45 -2
  28. package/dist/commands/convos/messages.js +5 -0
  29. package/dist/commands/convos/transcript.js +2 -2
  30. package/dist/commands/daemon/logs.d.ts +3 -1
  31. package/dist/commands/daemon/logs.js +6 -2
  32. package/dist/commands/duties/advance-next.js +1 -1
  33. package/dist/commands/duties/preflight.js +17 -13
  34. package/dist/commands/followups/watch-pr.js +2 -1
  35. package/dist/commands/harnesses/evaluations/evidence.js +2 -2
  36. package/dist/commands/harnesses/evaluations/grant.js +1 -1
  37. package/dist/commands/harnesses/evaluations/revoke.js +1 -1
  38. package/dist/commands/harnesses/evaluations/show.js +1 -1
  39. package/dist/commands/harnesses/rollouts/grant.js +1 -1
  40. package/dist/commands/harnesses/rollouts/revoke.js +1 -1
  41. package/dist/commands/machines/hosted/identity-evaluations/revoke.js +1 -1
  42. package/dist/commands/machines/hosted/identity-evaluations/show.js +1 -1
  43. package/dist/commands/memory/consolidation/undo.js +1 -0
  44. package/dist/commands/messages/list.js +9 -1
  45. package/dist/commands/slack/mutes.js +1 -1
  46. package/dist/commands/slack/unmute.js +1 -1
  47. package/dist/commands/tasks/actionability.js +1 -0
  48. package/dist/commands/tasks/ask.js +1 -1
  49. package/dist/commands/tasks/bulk-update.js +12 -0
  50. package/dist/commands/tasks/input/show.js +2 -2
  51. package/dist/commands/tasks/list.d.ts +8 -0
  52. package/dist/commands/tasks/list.js +50 -9
  53. package/dist/commands/tasks/move.d.ts +2 -10
  54. package/dist/commands/tasks/move.js +7 -18
  55. package/dist/commands/tasks/result/show.js +19 -7
  56. package/dist/commands/tasks/show.d.ts +4 -3
  57. package/dist/commands/tasks/show.js +20 -8
  58. package/dist/commands/tasks/start.js +35 -16
  59. package/dist/commands/tasks/update.js +3 -0
  60. package/dist/commands/tasks/wait.js +2 -2
  61. package/dist/generated/agent-guides.json +433 -133
  62. package/dist/lib/chat-stop.d.ts +17 -0
  63. package/dist/lib/chat-stop.js +70 -0
  64. package/dist/lib/cloud-reply.d.ts +21 -0
  65. package/dist/lib/cloud-reply.js +52 -0
  66. package/dist/lib/duties.js +24 -4
  67. package/dist/lib/duty-ledgers.js +19 -2
  68. package/dist/lib/file-mime.js +8 -0
  69. package/dist/lib/inbound-messages.d.ts +156 -0
  70. package/dist/lib/inbound-messages.js +375 -0
  71. package/dist/lib/message-intent.d.ts +18 -2
  72. package/dist/lib/message-intent.js +23 -1
  73. package/dist/lib/preflight-copy.d.ts +16 -1
  74. package/dist/lib/preflight-copy.js +33 -1
  75. package/dist/lib/task-operations.d.ts +2 -0
  76. package/dist/lib/task-operations.js +28 -4
  77. package/dist/lib/task-preflight.js +1 -0
  78. package/dist/lib/task-review-notice.d.ts +21 -0
  79. package/dist/lib/task-review-notice.js +46 -0
  80. package/dist/lib/task-version.d.ts +9 -0
  81. package/dist/lib/task-version.js +16 -0
  82. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/credentialEnvelopeBridge.js +6 -1
  83. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/credentialEnvelopeBridge.js +45 -15
  84. package/dist/node_modules/@skrr-ai/auth-core/package.json +1 -1
  85. package/dist/node_modules/@skrr-ai/data-provider/index.js +11969 -11728
  86. package/oclif.manifest.json +290 -12
  87. package/package.json +6 -2
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ /**
3
+ * What a move into review means when no Review is owed.
4
+ *
5
+ * Review is where a Review the Task's own `reviewPolicy` requires is waited for. Under `none`
6
+ * (the default) nobody owes one, so a Task parked there waits on a person who was never asked:
7
+ * thousands sat in review that way (OSK-33196). The move still lands; this says what it means,
8
+ * at the moment an agent made it.
9
+ *
10
+ * Every CLI door that moves a Task reads it from here. It used to live in `tasks move` alone,
11
+ * and `tasks bulk-update` moved 181 finished Tasks into review in one session without a word
12
+ * (OSK-33194).
13
+ */
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.waitsForUnowedReview = waitsForUnowedReview;
16
+ exports.unowedReviewNotice = unowedReviewNotice;
17
+ exports.unowedReviewSummary = unowedReviewSummary;
18
+ /** True when the moved Task now waits in review for a Review nobody owes it. */
19
+ function waitsForUnowedReview(task) {
20
+ const t = (task ?? {});
21
+ return t.statusType === 'review' && t.reviewPolicy !== 'required';
22
+ }
23
+ /** The notice for one Task, or null when it is not waiting for an unowed Review. */
24
+ function unowedReviewNotice(task, bin) {
25
+ if (!waitsForUnowedReview(task))
26
+ return null;
27
+ return ('Nobody owes this Task a Review: its reviewPolicy is not `required`, so it waits in review ' +
28
+ `for a person who was never asked. Close finished work with \`${bin} tasks complete\`.`);
29
+ }
30
+ /**
31
+ * One notice for several moved Tasks, naming them, or null when none waits for an unowed Review.
32
+ * A bulk move says it once rather than once per row.
33
+ */
34
+ function unowedReviewSummary(labels, bin) {
35
+ if (labels.length === 0)
36
+ return null;
37
+ if (labels.length === 1) {
38
+ return (`Nobody owes ${labels[0]} a Review: its reviewPolicy is not \`required\`, so it waits in ` +
39
+ `review for a person who was never asked. Close finished work with \`${bin} tasks complete\`.`);
40
+ }
41
+ const shown = labels.slice(0, 10).join(', ');
42
+ const more = labels.length > 10 ? ` and ${labels.length - 10} more` : '';
43
+ return (`Nobody owes these ${labels.length} Tasks a Review (${shown}${more}): their reviewPolicy is ` +
44
+ 'not `required`, so they wait in review for a person who was never asked. Close finished ' +
45
+ `work with \`${bin} tasks complete\`.`);
46
+ }
@@ -23,6 +23,15 @@ export type TaskVersionConflict = {
23
23
  };
24
24
  /** The version a Task reports, with an absent field read as 0 (the server's own reading). */
25
25
  export declare function taskVersionOf(task: Record<string, unknown> | null | undefined): number;
26
+ /** The `Version:` line `tasks show` prints, with the flag that uses it. */
27
+ export declare function taskVersionLine(version: number): string;
28
+ /**
29
+ * The same line after a write, from the version the server answered with, or
30
+ * null when it answered without one. Every user edit moves the version, fenced
31
+ * or not, so the version a caller read before its own write is already stale:
32
+ * this is the one to fence the next write on.
33
+ */
34
+ export declare function writtenTaskVersionLine(task: Record<string, unknown> | null | undefined): string | null;
26
35
  /** The two versions of a `TASK_VERSION_CONFLICT` refusal, or null for any other error. */
27
36
  export declare function taskVersionConflictOf(err: unknown): TaskVersionConflict | null;
28
37
  /**
@@ -2,6 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.EXPECTED_VERSION_FLAG_HELP = exports.TASK_VERSION_FENCE_UNSUPPORTED = exports.TASK_VERSION_CONFLICT_CODE = void 0;
4
4
  exports.taskVersionOf = taskVersionOf;
5
+ exports.taskVersionLine = taskVersionLine;
6
+ exports.writtenTaskVersionLine = writtenTaskVersionLine;
5
7
  exports.taskVersionConflictOf = taskVersionConflictOf;
6
8
  exports.describeTaskVersionConflict = describeTaskVersionConflict;
7
9
  exports.taskVersionFenceRefusal = taskVersionFenceRefusal;
@@ -33,6 +35,20 @@ function versionOf(value) {
33
35
  function taskVersionOf(task) {
34
36
  return versionOf(task?.version) ?? 0;
35
37
  }
38
+ /** The `Version:` line `tasks show` prints, with the flag that uses it. */
39
+ function taskVersionLine(version) {
40
+ return `Version: ${version} (update only from this read: --expected-version ${version})`;
41
+ }
42
+ /**
43
+ * The same line after a write, from the version the server answered with, or
44
+ * null when it answered without one. Every user edit moves the version, fenced
45
+ * or not, so the version a caller read before its own write is already stale:
46
+ * this is the one to fence the next write on.
47
+ */
48
+ function writtenTaskVersionLine(task) {
49
+ const version = versionOf(task?.version);
50
+ return version === undefined ? null : taskVersionLine(version);
51
+ }
36
52
  /** The two versions of a `TASK_VERSION_CONFLICT` refusal, or null for any other error. */
37
53
  function taskVersionConflictOf(err) {
38
54
  const refusal = (0, base_command_1.apiRefusal)(err);
@@ -365,7 +365,12 @@ async function initNewIndependentCredEnvelope(profile) {
365
365
  if (!stat.isDirectory() || stat.isSymbolicLink() || (stat.mode & 63) !== 0 || typeof process.getuid === "function" && stat.uid !== process.getuid()) {
366
366
  throw new Error("Background credential enrollment is unavailable");
367
367
  }
368
- const artifacts = ["device-private-key", "device-public-key.jwk", "auth-binding.json", "auth.json"];
368
+ const artifacts = [
369
+ "device-private-key",
370
+ "device-public-key.jwk",
371
+ "auth-binding.json",
372
+ "auth.json"
373
+ ];
369
374
  const artifactDirs = [dir, ...resolved.legacyDir ? [resolved.legacyDir] : []];
370
375
  const assertEmpty = () => {
371
376
  if (paths.some(present) || artifactDirs.some((root) => artifacts.some((name) => present(import_node_path.default.join(root, name)))) || wrappedDekFilePath(profile) !== resolved.canonicalPath) {
@@ -208,7 +208,7 @@ async function withCredEnvelopeLock(profile, body) {
208
208
  /**
209
209
  * Sticky record of the last consolidation refusal for this process — two usable
210
210
  * and DIFFERENT wrapped DEKs for one profile. Surfaced through
211
- * `describeCredEnvelopeState()` so `skrr status` / `oversky status` can say so:
211
+ * `describeCredEnvelopeState()` so `skrr whoami` and `skrrd status` can say so:
212
212
  * the split cannot be repaired here (each side's secrets live in its own
213
213
  * keychain namespace, sealed under its own DEK, and re-sealing them is not
214
214
  * auth-core's to do), so being loud about it IS the remedy.
@@ -501,8 +501,12 @@ export async function initExistingCredEnvelope(profile) {
501
501
  const target = wrappedDekFilePath(profile);
502
502
  fd = fs.openSync(target, fs.constants.O_RDONLY | (fs.constants.O_NOFOLLOW ?? 0));
503
503
  const before = fs.fstatSync(fd);
504
- const safe = (stat) => stat.isFile() && stat.nlink === 1 && stat.size > 0 && stat.size <= 65_536 &&
505
- (stat.mode & 0o077) === 0 && (typeof process.getuid !== 'function' || stat.uid === process.getuid());
504
+ const safe = (stat) => stat.isFile() &&
505
+ stat.nlink === 1 &&
506
+ stat.size > 0 &&
507
+ stat.size <= 65_536 &&
508
+ (stat.mode & 0o077) === 0 &&
509
+ (typeof process.getuid !== 'function' || stat.uid === process.getuid());
506
510
  if (!safe(before))
507
511
  throw new Error('unsafe envelope');
508
512
  const readBounded = () => {
@@ -529,18 +533,32 @@ export async function initExistingCredEnvelope(profile) {
529
533
  throw new Error('changed envelope');
530
534
  const after = fs.fstatSync(fd);
531
535
  const current = fs.lstatSync(target);
532
- if (!safe(after) || !safe(current) || before.dev !== after.dev || before.ino !== after.ino ||
533
- before.dev !== current.dev || before.ino !== current.ino || before.size !== after.size ||
534
- before.size !== current.size || before.mtimeMs !== after.mtimeMs || before.ctimeMs !== after.ctimeMs ||
535
- before.mtimeMs !== current.mtimeMs || before.ctimeMs !== current.ctimeMs ||
536
- wrappedDekFilePath(profile) !== target || _state.kind !== 'uninit') {
536
+ if (!safe(after) ||
537
+ !safe(current) ||
538
+ before.dev !== after.dev ||
539
+ before.ino !== after.ino ||
540
+ before.dev !== current.dev ||
541
+ before.ino !== current.ino ||
542
+ before.size !== after.size ||
543
+ before.size !== current.size ||
544
+ before.mtimeMs !== after.mtimeMs ||
545
+ before.ctimeMs !== after.ctimeMs ||
546
+ before.mtimeMs !== current.mtimeMs ||
547
+ before.ctimeMs !== current.ctimeMs ||
548
+ wrappedDekFilePath(profile) !== target ||
549
+ _state.kind !== 'uninit') {
537
550
  throw new Error('changed envelope');
538
551
  }
539
552
  for (const old of _retiredDeks)
540
553
  old.fill(0);
541
554
  _retiredDeks = [];
542
- _state = { kind: 'active', dek: candidate, kekId: kek.id,
543
- kekKind: typeof kek.kind === 'string' || kek.kind === null ? (kek.kind ?? null) : null, profile };
555
+ _state = {
556
+ kind: 'active',
557
+ dek: candidate,
558
+ kekId: kek.id,
559
+ kekKind: typeof kek.kind === 'string' || kek.kind === null ? (kek.kind ?? null) : null,
560
+ profile,
561
+ };
544
562
  candidate = undefined;
545
563
  }
546
564
  catch {
@@ -582,14 +600,22 @@ export async function initNewIndependentCredEnvelope(profile) {
582
600
  // recovery, not first enrollment, even if a retried caller says otherwise.
583
601
  const dir = resolved.canonicalDir;
584
602
  const stat = fs.lstatSync(dir);
585
- if (!stat.isDirectory() || stat.isSymbolicLink() || (stat.mode & 0o077) !== 0 ||
603
+ if (!stat.isDirectory() ||
604
+ stat.isSymbolicLink() ||
605
+ (stat.mode & 0o077) !== 0 ||
586
606
  (typeof process.getuid === 'function' && stat.uid !== process.getuid())) {
587
607
  throw new Error('Background credential enrollment is unavailable');
588
608
  }
589
- const artifacts = ['device-private-key', 'device-public-key.jwk', 'auth-binding.json', 'auth.json'];
609
+ const artifacts = [
610
+ 'device-private-key',
611
+ 'device-public-key.jwk',
612
+ 'auth-binding.json',
613
+ 'auth.json',
614
+ ];
590
615
  const artifactDirs = [dir, ...(resolved.legacyDir ? [resolved.legacyDir] : [])];
591
616
  const assertEmpty = () => {
592
- if (paths.some(present) || artifactDirs.some((root) => artifacts.some((name) => present(path.join(root, name)))) ||
617
+ if (paths.some(present) ||
618
+ artifactDirs.some((root) => artifacts.some((name) => present(path.join(root, name)))) ||
593
619
  wrappedDekFilePath(profile) !== resolved.canonicalPath) {
594
620
  throw new Error('Background credential enrollment needs recovery');
595
621
  }
@@ -612,7 +638,9 @@ export async function initNewIndependentCredEnvelope(profile) {
612
638
  return await initExistingCredEnvelope(profile);
613
639
  assertEmpty();
614
640
  const temporaryPath = path.join(dir, `.cred-dek-enrollment.${randomBytes(12).toString('hex')}.tmp`);
615
- const fd = fs.openSync(temporaryPath, fs.constants.O_WRONLY | fs.constants.O_CREAT | fs.constants.O_EXCL |
641
+ const fd = fs.openSync(temporaryPath, fs.constants.O_WRONLY |
642
+ fs.constants.O_CREAT |
643
+ fs.constants.O_EXCL |
616
644
  (fs.constants.O_NOFOLLOW ?? 0), 0o600);
617
645
  temp = temporaryPath;
618
646
  try {
@@ -834,7 +862,9 @@ export async function initCredEnvelope(profile) {
834
862
  // was sealed under it.
835
863
  if (unwrapAttemptedAndFailed && dek === null) {
836
864
  _kekRotationDetected = true;
837
- const keptAs = unreadableWrapped ? keepUnreadableWrappedDek(profile, unreadableWrapped) : null;
865
+ const keptAs = unreadableWrapped
866
+ ? keepUnreadableWrappedDek(profile, unreadableWrapped)
867
+ : null;
838
868
  emit('cred_envelope.kek_rotated', false, {
839
869
  kekId: kek.id,
840
870
  kekKind: captureKind(),
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skrr-ai/auth-core",
3
- "version": "0.4.38",
3
+ "version": "0.4.39",
4
4
  "main": "dist/cjs/index.js",
5
5
  "types": "dist/esm/index.d.ts",
6
6
  "exports": {