@skillcdn/console 0.6.2 → 0.6.3

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 (179) hide show
  1. package/README.md +13 -6
  2. package/SKILLCDN.md +3 -2
  3. package/dist/agent-page.d.ts +2 -0
  4. package/dist/agent-page.d.ts.map +1 -1
  5. package/dist/agent-page.js +40 -3
  6. package/dist/agent-page.js.map +1 -1
  7. package/dist/agent-state.d.ts +9 -0
  8. package/dist/agent-state.d.ts.map +1 -0
  9. package/dist/agent-state.js +28 -0
  10. package/dist/agent-state.js.map +1 -0
  11. package/dist/api.d.ts +4 -3
  12. package/dist/api.d.ts.map +1 -1
  13. package/dist/api.js +4 -3
  14. package/dist/api.js.map +1 -1
  15. package/dist/cli/cli.d.ts +2 -0
  16. package/dist/cli/cli.d.ts.map +1 -1
  17. package/dist/cli/cli.js +304 -130
  18. package/dist/cli/cli.js.map +1 -1
  19. package/dist/cli/format.d.ts +13 -4
  20. package/dist/cli/format.d.ts.map +1 -1
  21. package/dist/cli/format.js +43 -9
  22. package/dist/cli/format.js.map +1 -1
  23. package/dist/cli/help.d.ts +82 -9
  24. package/dist/cli/help.d.ts.map +1 -1
  25. package/dist/cli/help.js +780 -318
  26. package/dist/cli/help.js.map +1 -1
  27. package/dist/cli/pack.d.ts +2 -2
  28. package/dist/cli/pack.d.ts.map +1 -1
  29. package/dist/cli/pack.js +6 -4
  30. package/dist/cli/pack.js.map +1 -1
  31. package/dist/cli/runner-files.d.ts +16 -0
  32. package/dist/cli/runner-files.d.ts.map +1 -0
  33. package/dist/cli/runner-files.js +110 -0
  34. package/dist/cli/runner-files.js.map +1 -0
  35. package/dist/cli/runner-host.d.ts +7 -0
  36. package/dist/cli/runner-host.d.ts.map +1 -1
  37. package/dist/cli/runner-host.js +40 -2
  38. package/dist/cli/runner-host.js.map +1 -1
  39. package/dist/client.d.ts +16 -1
  40. package/dist/client.d.ts.map +1 -1
  41. package/dist/client.js +6 -1
  42. package/dist/client.js.map +1 -1
  43. package/dist/components/agent-page.d.ts +28 -3
  44. package/dist/components/agent-page.d.ts.map +1 -1
  45. package/dist/components/agent-page.js +48 -3
  46. package/dist/components/agent-page.js.map +1 -1
  47. package/dist/components/agents.d.ts +3 -2
  48. package/dist/components/agents.d.ts.map +1 -1
  49. package/dist/components/agents.js +9 -3
  50. package/dist/components/agents.js.map +1 -1
  51. package/dist/console.d.ts.map +1 -1
  52. package/dist/console.js +1 -1
  53. package/dist/console.js.map +1 -1
  54. package/dist/feed-words.d.ts.map +1 -1
  55. package/dist/feed-words.js +12 -1
  56. package/dist/feed-words.js.map +1 -1
  57. package/dist/i18n/en.d.ts +45 -1
  58. package/dist/i18n/en.d.ts.map +1 -1
  59. package/dist/i18n/en.js +36 -1
  60. package/dist/i18n/en.js.map +1 -1
  61. package/dist/i18n/ko.d.ts.map +1 -1
  62. package/dist/i18n/ko.js +28 -0
  63. package/dist/i18n/ko.js.map +1 -1
  64. package/dist/limits.d.ts +10 -0
  65. package/dist/limits.d.ts.map +1 -1
  66. package/dist/limits.js +10 -0
  67. package/dist/limits.js.map +1 -1
  68. package/dist/plugin/context.d.ts +39 -7
  69. package/dist/plugin/context.d.ts.map +1 -1
  70. package/dist/runner/acp.d.ts.map +1 -1
  71. package/dist/runner/acp.js +9 -3
  72. package/dist/runner/acp.js.map +1 -1
  73. package/dist/runner/claude.d.ts.map +1 -1
  74. package/dist/runner/claude.js +5 -1
  75. package/dist/runner/claude.js.map +1 -1
  76. package/dist/runner/codex.d.ts.map +1 -1
  77. package/dist/runner/codex.js +14 -2
  78. package/dist/runner/codex.js.map +1 -1
  79. package/dist/runner/config.d.ts +18 -0
  80. package/dist/runner/config.d.ts.map +1 -1
  81. package/dist/runner/config.js +77 -1
  82. package/dist/runner/config.js.map +1 -1
  83. package/dist/runner/desk.d.ts +7 -0
  84. package/dist/runner/desk.d.ts.map +1 -1
  85. package/dist/runner/desk.js +9 -0
  86. package/dist/runner/desk.js.map +1 -1
  87. package/dist/runner/message.d.ts +16 -22
  88. package/dist/runner/message.d.ts.map +1 -1
  89. package/dist/runner/message.js +72 -120
  90. package/dist/runner/message.js.map +1 -1
  91. package/dist/runner/runner.d.ts +25 -1
  92. package/dist/runner/runner.d.ts.map +1 -1
  93. package/dist/runner/runner.js +404 -19
  94. package/dist/runner/runner.js.map +1 -1
  95. package/dist/runner/slack-status.d.ts +19 -0
  96. package/dist/runner/slack-status.d.ts.map +1 -0
  97. package/dist/runner/slack-status.js +332 -0
  98. package/dist/runner/slack-status.js.map +1 -0
  99. package/dist/runner/slack.d.ts.map +1 -1
  100. package/dist/runner/slack.js +245 -57
  101. package/dist/runner/slack.js.map +1 -1
  102. package/dist/runner/types.d.ts +109 -15
  103. package/dist/runner/types.d.ts.map +1 -1
  104. package/dist/runner/types.js.map +1 -1
  105. package/dist/runner/usage.d.ts +6 -1
  106. package/dist/runner/usage.d.ts.map +1 -1
  107. package/dist/runner/usage.js +9 -2
  108. package/dist/runner/usage.js.map +1 -1
  109. package/dist/runner.d.ts +2 -2
  110. package/dist/runner.d.ts.map +1 -1
  111. package/dist/runner.js.map +1 -1
  112. package/dist/schemas.d.ts +160 -1
  113. package/dist/schemas.d.ts.map +1 -1
  114. package/dist/schemas.js +82 -5
  115. package/dist/schemas.js.map +1 -1
  116. package/dist/vocabulary.d.ts +7 -0
  117. package/dist/vocabulary.d.ts.map +1 -1
  118. package/dist/vocabulary.js +6 -0
  119. package/dist/vocabulary.js.map +1 -1
  120. package/dist/wake-text.d.ts +43 -0
  121. package/dist/wake-text.d.ts.map +1 -0
  122. package/dist/wake-text.js +115 -0
  123. package/dist/wake-text.js.map +1 -0
  124. package/docs/specs/cli.md +19 -11
  125. package/docs/specs/plugins.md +5 -5
  126. package/docs/specs/rest.md +10 -3
  127. package/docs/specs/runner.md +96 -20
  128. package/docs/start.md +26 -5
  129. package/package.json +3 -3
  130. package/skills/building-a-plugin/SKILL.md +2 -2
  131. package/skills/deploying-a-console/SKILL.md +3 -3
  132. package/skills/deploying-a-console/references/access.md +15 -1
  133. package/skills/deploying-a-console/references/resources.md +2 -2
  134. package/skills/deploying-a-console/scripts/github-app.mjs +593 -0
  135. package/skills/running-an-agent/SKILL.md +13 -10
  136. package/skills/running-an-agent/references/preparing-the-machine.md +1 -1
  137. package/skills/running-an-agent/references/slack-app.md +25 -8
  138. package/skills/running-an-agent/references/the-account-and-the-invitation.md +1 -1
  139. package/skills/running-an-agent/references/what-was-not-seen-run-yet.md +1 -1
  140. package/skills/running-an-agent/references/when-the-agent-could-not-go-on.md +1 -1
  141. package/skills/running-an-agent/references/your-first-task.md +7 -2
  142. package/skills/trying-a-console/SKILL.md +136 -0
  143. package/skills/trying-a-console/references/when-it-does-not-go.md +30 -0
  144. package/skills/working-the-board/SKILL.md +3 -3
  145. package/skills/working-the-board/references/the-pack.md +3 -3
  146. package/skills/working-the-board/references/what-they-were-told.md +1 -1
  147. package/src/agent-page.tsx +92 -1
  148. package/src/agent-state.ts +33 -0
  149. package/src/api.ts +16 -0
  150. package/src/cli/cli.ts +359 -137
  151. package/src/cli/format.ts +49 -9
  152. package/src/cli/help.ts +904 -359
  153. package/src/cli/pack.ts +6 -4
  154. package/src/cli/runner-files.ts +120 -0
  155. package/src/cli/runner-host.ts +48 -2
  156. package/src/client.ts +53 -0
  157. package/src/components/agent-page.tsx +150 -3
  158. package/src/components/agents.tsx +20 -5
  159. package/src/console.tsx +1 -0
  160. package/src/feed-words.ts +14 -1
  161. package/src/i18n/en.ts +39 -1
  162. package/src/i18n/ko.ts +32 -0
  163. package/src/limits.ts +10 -0
  164. package/src/plugin/context.ts +40 -7
  165. package/src/runner/acp.ts +9 -3
  166. package/src/runner/claude.ts +5 -1
  167. package/src/runner/codex.ts +14 -2
  168. package/src/runner/config.ts +114 -1
  169. package/src/runner/desk.ts +10 -0
  170. package/src/runner/message.ts +88 -126
  171. package/src/runner/runner.ts +487 -22
  172. package/src/runner/slack-status.ts +423 -0
  173. package/src/runner/slack.ts +293 -61
  174. package/src/runner/types.ts +108 -13
  175. package/src/runner/usage.ts +16 -3
  176. package/src/runner.ts +4 -0
  177. package/src/schemas.ts +97 -3
  178. package/src/vocabulary.ts +9 -0
  179. package/src/wake-text.ts +133 -0
package/src/cli/format.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { createHash } from "node:crypto";
2
+ import { reasonMoment } from "../agent-state.js";
2
3
  import { usageNear, usageSaidTogether, usageStanding, usedHundredths } from "../agent-usage.js";
3
4
  import { describeEvent } from "../feed-words.js";
4
5
  import { NOTIFICATION_KINDS, type NotificationKind } from "../notifications.js";
@@ -7,6 +8,7 @@ import type {
7
8
  RestAgent,
8
9
  RestAgentRunner,
9
10
  RestAgentSecret,
11
+ RestAgentSecretOffer,
10
12
  RestArtifact,
11
13
  RestCategory,
12
14
  RestComment,
@@ -290,21 +292,28 @@ export function formatOwnWakeLine(wake: RestOwnWake): string {
290
292
  }
291
293
 
292
294
  /**
293
- * How an agent account stands (ADR-0085), in a few words: the state, why, since when, until when
294
- * where its runner said, as when a usage limit resets (ADR-0150), and when its runner was last
295
- * heard from.
295
+ * How an agent account stands (ADR-0085), in a few words: the state, since when, until when
296
+ * where its runner said, as when a usage limit resets (ADR-0150), why, and when its runner was
297
+ * last heard from. The moment after `since` is the state's alone, and the reason stands apart
298
+ * from it, after `why:`: with when it was said where that is another moment than the state's,
299
+ * a turn that completed or a new conversation under a state that stayed, and with none where
300
+ * it came with the state or the console keeps no moment for it.
296
301
  */
297
302
  export function formatAgentState(agent: RestAgent): string {
298
303
  const state = agent.state ?? null;
299
304
  if (state === null) {
300
305
  return "no runner has been heard from yet";
301
306
  }
302
- const reason = state.reason === null ? "" : ` (${state.reason.replaceAll("_", " ")})`;
307
+ const said = reasonMoment(state);
303
308
  const until =
304
309
  state.until === undefined || state.until === null ? "" : `, until ${moment(state.until)}`;
310
+ const why =
311
+ state.reason === null
312
+ ? ""
313
+ : `; why: ${state.reason.replaceAll("_", " ")}${said === undefined ? "" : `, said ${moment(said)}`}`;
305
314
  const heard =
306
315
  state.heardAt === null ? "" : `; its runner was last heard from ${moment(state.heardAt)}`;
307
- return `${state.state}${reason} since ${moment(state.since)}${until}${heard}`;
316
+ return `${state.state} since ${moment(state.since)}${until}${why}${heard}`;
308
317
  }
309
318
 
310
319
  /**
@@ -341,6 +350,32 @@ export function formatSecretLine(secret: RestAgentSecret): string {
341
350
  return `${secret.name} (${facts.join(", ")})`;
342
351
  }
343
352
 
353
+ /**
354
+ * One secret offered to an agent account (ADR-0169): the offer's id, the name proposed, who
355
+ * offers it and through which agent, and how it stands; and, on a line of its own, what the
356
+ * offerer said it is for, as their words. Never its value.
357
+ */
358
+ export function formatSecretOffer(offer: RestAgentSecretOffer): string {
359
+ const who = offer.by === null ? "someone who is gone" : calledOf(offer.by);
360
+ const ended = moment(offer.decidedAt ?? offer.endsAt);
361
+ const stands =
362
+ offer.state === "waiting"
363
+ ? `waits until ${moment(offer.endsAt)}`
364
+ : offer.state === "taken"
365
+ ? `taken ${ended}${offer.takenAs === null || offer.takenAs === offer.name ? "" : ` as ${offer.takenAs}`}`
366
+ : offer.state === "left"
367
+ ? `left ${ended}`
368
+ : `ran out ${ended}`;
369
+ const facts = [
370
+ `from ${who}${offer.agent === null ? "" : ` through ${offer.agent}`}`,
371
+ `offered ${moment(offer.at)}`,
372
+ stands,
373
+ ...(offer.expiresOn === null ? [] : [`ends on ${offer.expiresOn}`]),
374
+ ];
375
+ const line = `${offer.id} ${offer.name} (${facts.join(", ")})`;
376
+ return offer.note === null ? line : `${line}\n ${who} says of it: ${offer.note}`;
377
+ }
378
+
344
379
  /** The provider a listing names, as people call it. */
345
380
  const HOST_NAMES = { gh: "GitHub", google: "Google" } as const;
346
381
 
@@ -372,7 +407,12 @@ export function formatWorkspace(workspace: RestWorkspace): string {
372
407
  ].join(", ")}`,
373
408
  )),
374
409
  `people visibility: ${visibility} (${visibility === "everyone" ? "everyone sees everyone" : "a member sees only the people they share a project with; an administrator sees everyone"})`,
375
- `week begins on: ${workspace.weekStart ?? "auto"} (auto: the system default, as each device has it)`,
410
+ // What `auto` means is said where the week is left to it, and not beside a day that was chosen.
411
+ `week begins on: ${
412
+ (workspace.weekStart ?? "auto") === "auto"
413
+ ? "auto (the system default, as each device has it)"
414
+ : workspace.weekStart
415
+ }`,
376
416
  `time zone: ${zone ?? "none"} (${zone === null ? "moments are printed as the API gives them, in UTC" : "moments are printed in it, as ISO 8601 with its offset"})`,
377
417
  `language: ${workspace.language ?? "none"} (${workspace.language == null ? "whoever has not chosen a language reads English, and the plugins write to them in it" : "whoever has not chosen a language reads it, and the plugins write to them in it"})`,
378
418
  `skills: ${workspace.skills.address ?? "no address of the organization's"} at ${workspace.skills.source}`,
@@ -684,7 +724,7 @@ export function formatRules(
684
724
  }
685
725
  // The mark ends the line bare, so that it is copied as it is.
686
726
  const later = parts.named
687
- ? ` A later take in this session leaves them out: console take <number> --rules ${mark}`
727
+ ? ` Now that they are read, a take in this session leaves them out: console take <number> --rules ${mark}`
688
728
  : "";
689
729
  return [
690
730
  `Rules ${mark}: ${follows}${later}`,
@@ -1358,8 +1398,8 @@ export function formatTaskFollow(
1358
1398
  ): string {
1359
1399
  const named = `Notifications of #${task.number} ${task.title} are ${follow.on ? "on" : "off"}`;
1360
1400
  const other = follow.on
1361
- ? `Turn them off: console mute ${task.number}`
1362
- : `Turn them on: console follow ${task.number}`;
1401
+ ? `Turn them off: console task mute ${task.number}`
1402
+ : `Turn them on: console task follow ${task.number}`;
1363
1403
  if (follow.on ? !follow.all : !follow.usual) {
1364
1404
  return `${named}, as your settings have it${follow.on ? ": you are told of it by the kinds you have on (console notify)" : ""}. ${other}`;
1365
1405
  }