@skrr-ai/cli 0.1.207 → 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 (168) 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.d.ts +31 -0
  5. package/dist/commands/agent/message/resolve.js +111 -0
  6. package/dist/commands/agent/message/retract.js +1 -1
  7. package/dist/commands/agent/message/send.d.ts +25 -6
  8. package/dist/commands/agent/message/send.js +135 -30
  9. package/dist/commands/agent/request/list.d.ts +15 -0
  10. package/dist/commands/agent/request/list.js +82 -0
  11. package/dist/commands/agent/request/send.d.ts +18 -0
  12. package/dist/commands/agent/request/send.js +56 -0
  13. package/dist/commands/agents/access/approve.d.ts +17 -0
  14. package/dist/commands/agents/access/approve.js +94 -0
  15. package/dist/commands/agents/access/deny.d.ts +10 -0
  16. package/dist/commands/agents/access/deny.js +36 -0
  17. package/dist/commands/agents/access/list.d.ts +10 -0
  18. package/dist/commands/agents/access/list.js +55 -0
  19. package/dist/commands/agents/access/reach.d.ts +13 -0
  20. package/dist/commands/agents/access/reach.js +53 -0
  21. package/dist/commands/agents/access/revoke.d.ts +13 -0
  22. package/dist/commands/agents/access/revoke.js +50 -0
  23. package/dist/commands/agents/always-on/recovery-review.d.ts +5 -0
  24. package/dist/commands/agents/always-on/recovery-review.js +16 -0
  25. package/dist/commands/agents/chat.d.ts +8 -0
  26. package/dist/commands/agents/chat.js +369 -90
  27. package/dist/commands/agents/import.d.ts +15 -1
  28. package/dist/commands/agents/import.js +212 -24
  29. package/dist/commands/agents/intuitions/accept.d.ts +0 -1
  30. package/dist/commands/agents/intuitions/accept.js +22 -7
  31. package/dist/commands/agents/intuitions/generate.d.ts +0 -1
  32. package/dist/commands/agents/intuitions/generate.js +4 -16
  33. package/dist/commands/agents/intuitions/list.js +9 -3
  34. package/dist/commands/agents/intuitions/resume.d.ts +11 -0
  35. package/dist/commands/agents/intuitions/resume.js +37 -0
  36. package/dist/commands/agents/manager/status.js +7 -6
  37. package/dist/commands/agents/not-for-task.d.ts +24 -0
  38. package/dist/commands/agents/not-for-task.js +60 -0
  39. package/dist/commands/agents/schedule-overview.d.ts +20 -0
  40. package/dist/commands/agents/schedule-overview.js +35 -2
  41. package/dist/commands/agents/shared-memory.d.ts +24 -0
  42. package/dist/commands/agents/shared-memory.js +67 -0
  43. package/dist/commands/agents/stop.d.ts +23 -0
  44. package/dist/commands/agents/stop.js +61 -0
  45. package/dist/commands/agents/update.d.ts +7 -0
  46. package/dist/commands/agents/update.js +45 -2
  47. package/dist/commands/agents/visibility.d.ts +1 -0
  48. package/dist/commands/agents/visibility.js +14 -0
  49. package/dist/commands/code/migrate.js +3 -1
  50. package/dist/commands/convos/messages.js +5 -0
  51. package/dist/commands/convos/transcript.js +2 -2
  52. package/dist/commands/daemon/logs.d.ts +3 -1
  53. package/dist/commands/daemon/logs.js +6 -2
  54. package/dist/commands/duties/advance-next.js +16 -7
  55. package/dist/commands/duties/preflight.js +17 -13
  56. package/dist/commands/followups/show.js +9 -0
  57. package/dist/commands/followups/watch-pr.d.ts +27 -0
  58. package/dist/commands/followups/watch-pr.js +124 -0
  59. package/dist/commands/harnesses/evaluations/evidence.js +2 -2
  60. package/dist/commands/harnesses/evaluations/grant.js +1 -1
  61. package/dist/commands/harnesses/evaluations/revoke.js +1 -1
  62. package/dist/commands/harnesses/evaluations/show.js +1 -1
  63. package/dist/commands/harnesses/rollouts/grant.js +1 -1
  64. package/dist/commands/harnesses/rollouts/revoke.js +1 -1
  65. package/dist/commands/machines/hosted/identity-evaluations/revoke.js +1 -1
  66. package/dist/commands/machines/hosted/identity-evaluations/show.js +1 -1
  67. package/dist/commands/memory/consolidation/index.d.ts +20 -0
  68. package/dist/commands/memory/consolidation/index.js +78 -0
  69. package/dist/commands/memory/consolidation/resume.d.ts +14 -0
  70. package/dist/commands/memory/consolidation/resume.js +46 -0
  71. package/dist/commands/memory/consolidation/undo.d.ts +18 -0
  72. package/dist/commands/memory/consolidation/undo.js +61 -0
  73. package/dist/commands/messages/list.js +9 -1
  74. package/dist/commands/slack/mutes.d.ts +10 -0
  75. package/dist/commands/slack/mutes.js +62 -0
  76. package/dist/commands/slack/unmute.d.ts +12 -0
  77. package/dist/commands/slack/unmute.js +44 -0
  78. package/dist/commands/tasks/actionability.js +10 -0
  79. package/dist/commands/tasks/ask.d.ts +50 -0
  80. package/dist/commands/tasks/ask.js +190 -0
  81. package/dist/commands/tasks/bulk-update.js +12 -0
  82. package/dist/commands/tasks/handover.js +14 -0
  83. package/dist/commands/tasks/input/answer.js +8 -2
  84. package/dist/commands/tasks/input/show.d.ts +26 -0
  85. package/dist/commands/tasks/input/show.js +185 -17
  86. package/dist/commands/tasks/list.d.ts +8 -0
  87. package/dist/commands/tasks/list.js +50 -9
  88. package/dist/commands/tasks/move.d.ts +3 -0
  89. package/dist/commands/tasks/move.js +71 -1
  90. package/dist/commands/tasks/result/show.js +19 -7
  91. package/dist/commands/tasks/result/submit.js +3 -0
  92. package/dist/commands/tasks/runs.d.ts +4 -1
  93. package/dist/commands/tasks/runs.js +22 -3
  94. package/dist/commands/tasks/show.d.ts +4 -3
  95. package/dist/commands/tasks/show.js +40 -7
  96. package/dist/commands/tasks/start.js +35 -16
  97. package/dist/commands/tasks/update.d.ts +1 -0
  98. package/dist/commands/tasks/update.js +55 -1
  99. package/dist/commands/tasks/updates/add.js +3 -0
  100. package/dist/commands/tasks/wait.d.ts +20 -0
  101. package/dist/commands/tasks/wait.js +103 -2
  102. package/dist/generated/agent-guides.json +892 -183
  103. package/dist/generated/managed-instruction-guides.json +1 -1
  104. package/dist/lib/agent-access-command.d.ts +19 -0
  105. package/dist/lib/agent-access-command.js +44 -0
  106. package/dist/lib/agent-access.d.ts +18 -0
  107. package/dist/lib/agent-access.js +48 -0
  108. package/dist/lib/agent-import/apply.d.ts +50 -0
  109. package/dist/lib/agent-import/apply.js +85 -0
  110. package/dist/lib/agent-import/plan.d.ts +132 -0
  111. package/dist/lib/agent-import/plan.js +504 -0
  112. package/dist/lib/agent-import/reader.d.ts +94 -0
  113. package/dist/lib/agent-import/reader.js +326 -0
  114. package/dist/lib/agent-import/schedule.d.ts +46 -0
  115. package/dist/lib/agent-import/schedule.js +220 -0
  116. package/dist/lib/agent-import/sources.d.ts +124 -0
  117. package/dist/lib/agent-import/sources.js +797 -0
  118. package/dist/lib/chat-stop.d.ts +17 -0
  119. package/dist/lib/chat-stop.js +70 -0
  120. package/dist/lib/cloud-reply.d.ts +21 -0
  121. package/dist/lib/cloud-reply.js +52 -0
  122. package/dist/lib/duties.js +24 -4
  123. package/dist/lib/duty-ledgers.js +19 -2
  124. package/dist/lib/file-mime.js +8 -0
  125. package/dist/lib/followups.d.ts +61 -0
  126. package/dist/lib/followups.js +39 -0
  127. package/dist/lib/handover-interview.d.ts +18 -0
  128. package/dist/lib/handover-interview.js +53 -0
  129. package/dist/lib/inbound-messages.d.ts +156 -0
  130. package/dist/lib/inbound-messages.js +375 -0
  131. package/dist/lib/input-queue.js +2 -1
  132. package/dist/lib/intuition-look.d.ts +10 -0
  133. package/dist/lib/intuition-look.js +64 -0
  134. package/dist/lib/message-intent.d.ts +18 -2
  135. package/dist/lib/message-intent.js +23 -1
  136. package/dist/lib/preflight-copy.d.ts +16 -1
  137. package/dist/lib/preflight-copy.js +33 -1
  138. package/dist/lib/record-output.d.ts +1 -1
  139. package/dist/lib/record-output.js +2 -0
  140. package/dist/lib/skill-import.d.ts +19 -0
  141. package/dist/lib/skill-import.js +34 -0
  142. package/dist/lib/slack-thread-mutes.d.ts +25 -0
  143. package/dist/lib/slack-thread-mutes.js +12 -0
  144. package/dist/lib/task-carriers.d.ts +18 -0
  145. package/dist/lib/task-carriers.js +43 -0
  146. package/dist/lib/task-extras.d.ts +5 -0
  147. package/dist/lib/task-extras.js +5 -0
  148. package/dist/lib/task-operations.d.ts +2 -0
  149. package/dist/lib/task-operations.js +28 -4
  150. package/dist/lib/task-preflight.js +1 -0
  151. package/dist/lib/task-recurrence-summary.d.ts +15 -0
  152. package/dist/lib/task-recurrence-summary.js +22 -0
  153. package/dist/lib/task-review-notice.d.ts +21 -0
  154. package/dist/lib/task-review-notice.js +46 -0
  155. package/dist/lib/task-version.d.ts +53 -0
  156. package/dist/lib/task-version.js +89 -0
  157. package/dist/lib/task-write-attribution.d.ts +7 -0
  158. package/dist/lib/task-write-attribution.js +14 -0
  159. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/credentialEnvelopeBridge.js +6 -1
  160. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/turnPacing.d.ts +75 -0
  161. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/turnPacing.js +124 -0
  162. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/credentialEnvelopeBridge.js +45 -15
  163. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/turnPacing.d.ts +75 -0
  164. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/turnPacing.js +141 -0
  165. package/dist/node_modules/@skrr-ai/auth-core/package.json +11 -1
  166. package/dist/node_modules/@skrr-ai/data-provider/index.js +13492 -12505
  167. package/oclif.manifest.json +2090 -132
  168. package/package.json +9 -2
@@ -0,0 +1,141 @@
1
+ /**
2
+ * Turn pacing: a reminder, inside a long chat turn, that the person has not heard from it for a
3
+ * while (OSK-33221).
4
+ *
5
+ * A model working through a half-hour turn has no clock. It can be told "a time you gave is a
6
+ * promise" and still not notice that twenty minutes have passed, because nothing in its context
7
+ * moves with time. The conversation context now carries the server's measurement
8
+ * (`currentTurn.elapsedMs` / `quietForMs`), but only when the model thinks to read it. This module
9
+ * is the other half: the harness that runs the turn watches the gap and, once it reaches the
10
+ * threshold, adds one sentence to the next tool result.
11
+ *
12
+ * Shared by the two harnesses that can do that, so the policy and the words exist once:
13
+ * - the daemon's Claude Agent SDK engine, through a PostToolUse hook, on a chat turn whose
14
+ * request carried `turnPacing` (sent only to a daemon announcing `TURN_PACING_CAPABILITY`);
15
+ * - the cloud Agent Worker, through its own PostToolUse hook, on a turn that has `send_message`.
16
+ *
17
+ * It is evaluated on tool activity, never on a timer: a turn that is not calling tools has nobody
18
+ * to tell, and a timer would be a fourth scheduling mechanism the scheduling architecture forbids.
19
+ * It never sends, delays or refuses anything. It says the gap once per quiet window and leaves the
20
+ * judgement to the Agent: "if they would be wondering", never "send now". A schedule is exactly
21
+ * what the doctrine tells the Agent not to keep, so the reminder may not become one.
22
+ */
23
+ /** A daemon that announces this reads `turnPacing` on a session request and acts on it. */
24
+ export const TURN_PACING_CAPABILITY = 'session_turn_pacing_v1';
25
+ /** Bounds on the threshold a request may carry: a minute, and six hours. */
26
+ export const TURN_PACING_LIMITS = Object.freeze({
27
+ minQuietReminderAfterMs: 60_000,
28
+ maxQuietReminderAfterMs: 6 * 60 * 60 * 1000,
29
+ });
30
+ /** The default threshold: ten minutes of a turn the person has heard nothing from. */
31
+ export const DEFAULT_QUIET_REMINDER_AFTER_MS = 10 * 60 * 1000;
32
+ /** A strict read of the wire field. Anything it does not understand is no pacing at all. */
33
+ export function readTurnPacing(value) {
34
+ if (!value || typeof value !== 'object' || Array.isArray(value))
35
+ return null;
36
+ const record = value;
37
+ const keys = Object.keys(record);
38
+ if (keys.some((key) => key !== 'version' && key !== 'quietReminderAfterMs'))
39
+ return null;
40
+ const after = record.quietReminderAfterMs;
41
+ if (record.version !== 1 || typeof after !== 'number' || !Number.isSafeInteger(after))
42
+ return null;
43
+ if (after < TURN_PACING_LIMITS.minQuietReminderAfterMs ||
44
+ after > TURN_PACING_LIMITS.maxQuietReminderAfterMs) {
45
+ return null;
46
+ }
47
+ return { version: 1, quietReminderAfterMs: after };
48
+ }
49
+ const OFF_VALUES = new Set(['off', '0', 'false', 'no', 'disabled']);
50
+ /**
51
+ * The threshold a deployment configured: `SKRR_TURN_QUIET_REMINDER_MS` (milliseconds), `off` to
52
+ * turn the reminder off, unset for the default. A value outside the limits is the default, not an
53
+ * error: a typo must not turn the reminder into a stream of them, nor silently off.
54
+ */
55
+ export function resolveQuietReminderAfterMs(raw) {
56
+ const value = String(raw ?? '')
57
+ .trim()
58
+ .toLowerCase();
59
+ if (!value)
60
+ return DEFAULT_QUIET_REMINDER_AFTER_MS;
61
+ if (OFF_VALUES.has(value))
62
+ return null;
63
+ const parsed = Number(value);
64
+ if (!Number.isSafeInteger(parsed) ||
65
+ parsed < TURN_PACING_LIMITS.minQuietReminderAfterMs ||
66
+ parsed > TURN_PACING_LIMITS.maxQuietReminderAfterMs) {
67
+ return DEFAULT_QUIET_REMINDER_AFTER_MS;
68
+ }
69
+ return parsed;
70
+ }
71
+ /**
72
+ * Whether a shell command sends the person a message: `skrr agent message send`, the one
73
+ * sanctioned path from a daemon session. Read from the command the harness ran, because the send
74
+ * goes from the CLI straight to the server and leaves nothing on the machine to read. `--help` is
75
+ * not a send. A command that only mentions the words in a string can read as one; the cost is one
76
+ * reminder too few, never one too many.
77
+ */
78
+ const SEND_COMMAND = /(?:^|[\s;&|(`])(?:[^\s;&|()`]*\/)?skrr\s+agent\s+message\s+send(?=\s|$)/g;
79
+ const HELP_FLAG = /(?:^|\s)(?:--help|-h)(?=\s|$)/;
80
+ export function isAgentMessageSendCommand(command) {
81
+ if (typeof command !== 'string')
82
+ return false;
83
+ for (const match of command.matchAll(SEND_COMMAND)) {
84
+ // This invocation's own arguments: up to the next command separator.
85
+ const args = command.slice(match.index + match[0].length).split(/[;&|\n]/, 1)[0] ?? '';
86
+ if (!HELP_FLAG.test(args))
87
+ return true;
88
+ }
89
+ return false;
90
+ }
91
+ const minutes = (ms) => Math.max(1, Math.floor(ms / 60_000));
92
+ const plural = (n) => (n === 1 ? '1 minute' : `${n} minutes`);
93
+ /**
94
+ * The reminder, in one short paragraph. It states the gap, names the two reasons a person would
95
+ * want to hear (they would be wondering; a time you gave is close), and says it will not repeat,
96
+ * so ignoring it when nothing would help is a legitimate answer. No example message: an example
97
+ * in a reminder is copied (C14, recommendation 5).
98
+ */
99
+ export function renderQuietTurnReminder({ quietForMs, elapsedMs, sentDuringTurn, surface, }) {
100
+ const gap = sentDuringTurn
101
+ ? `This turn has run ${plural(minutes(elapsedMs))}, and the person last heard from it ${plural(minutes(quietForMs))} ago.`
102
+ : `This turn has run ${plural(minutes(elapsedMs))} and has not sent the person anything yet.`;
103
+ const how = surface === 'cli'
104
+ ? 'one short status with `skrr agent message send` (keep one --status-key, so it replaces the last)'
105
+ : 'one short status with send_message (keep one statusKey, so it replaces the last)';
106
+ return [
107
+ `[skrr] ${gap}`,
108
+ `If they would be wondering by now, or a time you gave is close, ${how} keeps them confident: what is newly true and when you expect to finish.`,
109
+ 'If nothing would help them, carry on. This reminder does not repeat until this turn sends a message.',
110
+ ].join(' ');
111
+ }
112
+ /**
113
+ * One turn's quiet window. It opens when the turn starts and again at every message the turn
114
+ * sends; it reminds once per window, when the gap first reaches the threshold.
115
+ */
116
+ export function createQuietTurnMonitor({ startedAt, quietReminderAfterMs, surface, now = Date.now, }) {
117
+ let lastHeardAt = startedAt;
118
+ let sentDuringTurn = false;
119
+ let remindedThisWindow = false;
120
+ return {
121
+ noteSent(at = now()) {
122
+ lastHeardAt = Math.max(lastHeardAt, at);
123
+ sentDuringTurn = true;
124
+ remindedThisWindow = false;
125
+ },
126
+ check(at = now()) {
127
+ if (remindedThisWindow)
128
+ return null;
129
+ const quietForMs = at - lastHeardAt;
130
+ if (!(quietForMs >= quietReminderAfterMs))
131
+ return null;
132
+ remindedThisWindow = true;
133
+ return renderQuietTurnReminder({
134
+ quietForMs,
135
+ elapsedMs: at - startedAt,
136
+ sentDuringTurn,
137
+ surface,
138
+ });
139
+ },
140
+ };
141
+ }
@@ -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": {
@@ -387,6 +387,16 @@
387
387
  "default": "./dist/cjs/toolOperationOutcome.js"
388
388
  }
389
389
  },
390
+ "./turn-pacing": {
391
+ "import": {
392
+ "types": "./dist/esm/turnPacing.d.ts",
393
+ "default": "./dist/esm/turnPacing.js"
394
+ },
395
+ "require": {
396
+ "types": "./dist/cjs/turnPacing.d.ts",
397
+ "default": "./dist/cjs/turnPacing.js"
398
+ }
399
+ },
390
400
  "./local-session-import-limits": {
391
401
  "import": {
392
402
  "types": "./dist/esm/localSessionImportLimits.d.ts",