@skillcdn/console 0.6.1 → 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 (230) hide show
  1. package/README.md +14 -7
  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 +77 -30
  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/agent-usage.d.ts +9 -6
  12. package/dist/agent-usage.d.ts.map +1 -1
  13. package/dist/agent-usage.js +38 -8
  14. package/dist/agent-usage.js.map +1 -1
  15. package/dist/api.d.ts +4 -3
  16. package/dist/api.d.ts.map +1 -1
  17. package/dist/api.js +4 -3
  18. package/dist/api.js.map +1 -1
  19. package/dist/cli/cli.d.ts +2 -0
  20. package/dist/cli/cli.d.ts.map +1 -1
  21. package/dist/cli/cli.js +369 -130
  22. package/dist/cli/cli.js.map +1 -1
  23. package/dist/cli/format.d.ts +13 -4
  24. package/dist/cli/format.d.ts.map +1 -1
  25. package/dist/cli/format.js +43 -9
  26. package/dist/cli/format.js.map +1 -1
  27. package/dist/cli/help.d.ts +82 -9
  28. package/dist/cli/help.d.ts.map +1 -1
  29. package/dist/cli/help.js +780 -318
  30. package/dist/cli/help.js.map +1 -1
  31. package/dist/cli/pack.d.ts +2 -2
  32. package/dist/cli/pack.d.ts.map +1 -1
  33. package/dist/cli/pack.js +6 -4
  34. package/dist/cli/pack.js.map +1 -1
  35. package/dist/cli/runner-files.d.ts +16 -0
  36. package/dist/cli/runner-files.d.ts.map +1 -0
  37. package/dist/cli/runner-files.js +110 -0
  38. package/dist/cli/runner-files.js.map +1 -0
  39. package/dist/cli/runner-host.d.ts +7 -0
  40. package/dist/cli/runner-host.d.ts.map +1 -1
  41. package/dist/cli/runner-host.js +40 -2
  42. package/dist/cli/runner-host.js.map +1 -1
  43. package/dist/client.d.ts +22 -1
  44. package/dist/client.d.ts.map +1 -1
  45. package/dist/client.js +7 -1
  46. package/dist/client.js.map +1 -1
  47. package/dist/components/agent-page.d.ts +61 -11
  48. package/dist/components/agent-page.d.ts.map +1 -1
  49. package/dist/components/agent-page.js +146 -35
  50. package/dist/components/agent-page.js.map +1 -1
  51. package/dist/components/agents.d.ts +3 -2
  52. package/dist/components/agents.d.ts.map +1 -1
  53. package/dist/components/agents.js +9 -3
  54. package/dist/components/agents.js.map +1 -1
  55. package/dist/components/calendar.d.ts +24 -4
  56. package/dist/components/calendar.d.ts.map +1 -1
  57. package/dist/components/calendar.js +78 -35
  58. package/dist/components/calendar.js.map +1 -1
  59. package/dist/console.d.ts.map +1 -1
  60. package/dist/console.js +40 -12
  61. package/dist/console.js.map +1 -1
  62. package/dist/data.d.ts +2 -0
  63. package/dist/data.d.ts.map +1 -1
  64. package/dist/data.js +4 -0
  65. package/dist/data.js.map +1 -1
  66. package/dist/desk-page.js +5 -5
  67. package/dist/desk-page.js.map +1 -1
  68. package/dist/feed-words.d.ts.map +1 -1
  69. package/dist/feed-words.js +18 -1
  70. package/dist/feed-words.js.map +1 -1
  71. package/dist/i18n/en.d.ts +51 -1
  72. package/dist/i18n/en.d.ts.map +1 -1
  73. package/dist/i18n/en.js +44 -2
  74. package/dist/i18n/en.js.map +1 -1
  75. package/dist/i18n/ko.d.ts.map +1 -1
  76. package/dist/i18n/ko.js +52 -17
  77. package/dist/i18n/ko.js.map +1 -1
  78. package/dist/index.d.ts +1 -1
  79. package/dist/index.d.ts.map +1 -1
  80. package/dist/index.js +1 -1
  81. package/dist/index.js.map +1 -1
  82. package/dist/limits.d.ts +10 -0
  83. package/dist/limits.d.ts.map +1 -1
  84. package/dist/limits.js +10 -0
  85. package/dist/limits.js.map +1 -1
  86. package/dist/plugin/capabilities.d.ts +1 -1
  87. package/dist/plugin/capabilities.d.ts.map +1 -1
  88. package/dist/plugin/capabilities.js +6 -1
  89. package/dist/plugin/capabilities.js.map +1 -1
  90. package/dist/plugin/context.d.ts +101 -8
  91. package/dist/plugin/context.d.ts.map +1 -1
  92. package/dist/plugin/limits.d.ts +7 -0
  93. package/dist/plugin/limits.d.ts.map +1 -1
  94. package/dist/plugin/limits.js +7 -0
  95. package/dist/plugin/limits.js.map +1 -1
  96. package/dist/plugin/testing.d.ts +2 -0
  97. package/dist/plugin/testing.d.ts.map +1 -1
  98. package/dist/plugin/testing.js +2 -0
  99. package/dist/plugin/testing.js.map +1 -1
  100. package/dist/rules.js +1 -1
  101. package/dist/rules.js.map +1 -1
  102. package/dist/runner/acp.d.ts.map +1 -1
  103. package/dist/runner/acp.js +9 -3
  104. package/dist/runner/acp.js.map +1 -1
  105. package/dist/runner/claude.d.ts.map +1 -1
  106. package/dist/runner/claude.js +143 -10
  107. package/dist/runner/claude.js.map +1 -1
  108. package/dist/runner/codex.d.ts.map +1 -1
  109. package/dist/runner/codex.js +14 -2
  110. package/dist/runner/codex.js.map +1 -1
  111. package/dist/runner/config.d.ts +18 -0
  112. package/dist/runner/config.d.ts.map +1 -1
  113. package/dist/runner/config.js +77 -1
  114. package/dist/runner/config.js.map +1 -1
  115. package/dist/runner/desk.d.ts +7 -0
  116. package/dist/runner/desk.d.ts.map +1 -1
  117. package/dist/runner/desk.js +20 -4
  118. package/dist/runner/desk.js.map +1 -1
  119. package/dist/runner/message.d.ts +26 -2
  120. package/dist/runner/message.d.ts.map +1 -1
  121. package/dist/runner/message.js +120 -32
  122. package/dist/runner/message.js.map +1 -1
  123. package/dist/runner/runner.d.ts +40 -2
  124. package/dist/runner/runner.d.ts.map +1 -1
  125. package/dist/runner/runner.js +533 -32
  126. package/dist/runner/runner.js.map +1 -1
  127. package/dist/runner/slack-status.d.ts +19 -0
  128. package/dist/runner/slack-status.d.ts.map +1 -0
  129. package/dist/runner/slack-status.js +332 -0
  130. package/dist/runner/slack-status.js.map +1 -0
  131. package/dist/runner/slack.d.ts +17 -11
  132. package/dist/runner/slack.d.ts.map +1 -1
  133. package/dist/runner/slack.js +1199 -109
  134. package/dist/runner/slack.js.map +1 -1
  135. package/dist/runner/types.d.ts +205 -6
  136. package/dist/runner/types.d.ts.map +1 -1
  137. package/dist/runner/types.js.map +1 -1
  138. package/dist/runner/usage.d.ts +6 -1
  139. package/dist/runner/usage.d.ts.map +1 -1
  140. package/dist/runner/usage.js +9 -2
  141. package/dist/runner/usage.js.map +1 -1
  142. package/dist/runner.d.ts +4 -4
  143. package/dist/runner.d.ts.map +1 -1
  144. package/dist/runner.js +3 -3
  145. package/dist/runner.js.map +1 -1
  146. package/dist/schemas.d.ts +263 -1
  147. package/dist/schemas.d.ts.map +1 -1
  148. package/dist/schemas.js +137 -5
  149. package/dist/schemas.js.map +1 -1
  150. package/dist/vocabulary.d.ts +7 -0
  151. package/dist/vocabulary.d.ts.map +1 -1
  152. package/dist/vocabulary.js +6 -0
  153. package/dist/vocabulary.js.map +1 -1
  154. package/dist/wake-text.d.ts +43 -0
  155. package/dist/wake-text.d.ts.map +1 -0
  156. package/dist/wake-text.js +115 -0
  157. package/dist/wake-text.js.map +1 -0
  158. package/docs/specs/cli.md +21 -12
  159. package/docs/specs/plugins.md +12 -7
  160. package/docs/specs/rest.md +14 -5
  161. package/docs/specs/runner.md +133 -26
  162. package/docs/start.md +26 -5
  163. package/package.json +3 -3
  164. package/skills/building-a-plugin/SKILL.md +3 -3
  165. package/skills/deploying-a-console/SKILL.md +3 -3
  166. package/skills/deploying-a-console/references/access.md +15 -1
  167. package/skills/deploying-a-console/references/resources.md +2 -2
  168. package/skills/deploying-a-console/scripts/github-app.mjs +593 -0
  169. package/skills/planning-the-board/references/setting-up.md +1 -1
  170. package/skills/running-an-agent/SKILL.md +18 -72
  171. package/skills/running-an-agent/references/preparing-the-machine.md +17 -0
  172. package/skills/running-an-agent/references/several-tasks.md +1 -1
  173. package/skills/running-an-agent/references/slack-app.md +55 -8
  174. package/skills/running-an-agent/references/the-account-and-the-invitation.md +5 -0
  175. package/skills/running-an-agent/references/what-was-not-seen-run-yet.md +3 -0
  176. package/skills/running-an-agent/references/when-the-agent-could-not-go-on.md +16 -0
  177. package/skills/running-an-agent/references/your-first-task.md +19 -0
  178. package/skills/trying-a-console/SKILL.md +136 -0
  179. package/skills/trying-a-console/references/when-it-does-not-go.md +30 -0
  180. package/skills/working-the-board/SKILL.md +11 -15
  181. package/skills/working-the-board/references/a-pack-skills-questions.md +3 -0
  182. package/skills/working-the-board/references/a-plugins-commands.md +3 -0
  183. package/skills/working-the-board/references/a-review.md +3 -0
  184. package/skills/working-the-board/references/an-open-run.md +3 -0
  185. package/skills/working-the-board/references/requirements.md +7 -0
  186. package/skills/working-the-board/references/the-pack.md +3 -3
  187. package/skills/working-the-board/references/what-they-were-told.md +3 -0
  188. package/skills/working-the-board/references/work-given-in-chat.md +5 -0
  189. package/src/agent-page.tsx +133 -41
  190. package/src/agent-state.ts +33 -0
  191. package/src/agent-usage.ts +55 -12
  192. package/src/api.ts +23 -0
  193. package/src/cli/cli.ts +443 -137
  194. package/src/cli/format.ts +49 -9
  195. package/src/cli/help.ts +904 -359
  196. package/src/cli/pack.ts +6 -4
  197. package/src/cli/runner-files.ts +120 -0
  198. package/src/cli/runner-host.ts +48 -2
  199. package/src/client.ts +64 -0
  200. package/src/components/agent-page.tsx +264 -39
  201. package/src/components/agents.tsx +20 -5
  202. package/src/components/calendar.tsx +92 -36
  203. package/src/console.tsx +47 -10
  204. package/src/data.ts +6 -0
  205. package/src/desk-page.tsx +5 -5
  206. package/src/feed-words.ts +20 -1
  207. package/src/i18n/en.ts +50 -2
  208. package/src/i18n/ko.ts +62 -17
  209. package/src/index.ts +2 -0
  210. package/src/limits.ts +10 -0
  211. package/src/plugin/capabilities.ts +8 -1
  212. package/src/plugin/context.ts +103 -7
  213. package/src/plugin/limits.ts +7 -0
  214. package/src/plugin/testing.ts +4 -0
  215. package/src/rules.ts +1 -1
  216. package/src/runner/acp.ts +9 -3
  217. package/src/runner/claude.ts +159 -10
  218. package/src/runner/codex.ts +14 -2
  219. package/src/runner/config.ts +114 -1
  220. package/src/runner/desk.ts +23 -4
  221. package/src/runner/message.ts +144 -35
  222. package/src/runner/runner.ts +658 -35
  223. package/src/runner/slack-status.ts +423 -0
  224. package/src/runner/slack.ts +1509 -128
  225. package/src/runner/types.ts +200 -5
  226. package/src/runner/usage.ts +16 -3
  227. package/src/runner.ts +20 -1
  228. package/src/schemas.ts +161 -3
  229. package/src/vocabulary.ts +9 -0
  230. package/src/wake-text.ts +133 -0
@@ -0,0 +1,133 @@
1
+ import { MAX_SIGNAL_LENGTH } from "./limits.js";
2
+
3
+ // A wake as the one text a signal carries (ADR-0163, ADR-0166): the lines of whoever raised it,
4
+ // a wake source or the console itself, apart from what someone else wrote, so that no word of a
5
+ // message or of a comment ever reads as a line of the console's. Written here once, for the
6
+ // runner, which writes what its wake sources raise and reads every such text back, and for the
7
+ // console, which writes a wake of the board's that carries a member's words. Pure: no I/O.
8
+
9
+ /**
10
+ * A part of a wake (ADR-0163): a line of the source's own, or what someone else wrote. The
11
+ * runner hands the agent each line under the session's mark and the words in a block of their
12
+ * own, so that nothing a message holds reads as a line of the source's. A line holds what the
13
+ * source says itself, an id and a moment among it, and never a word someone else wrote.
14
+ */
15
+ export type WakePart = { readonly says: string } | { readonly words: string };
16
+
17
+ /**
18
+ * The first version whose runner reads a wake of the board's, and one of the console's own
19
+ * (ADR-0169), in parts (ADR-0166): the console's
20
+ * lines under the session's mark, and what a member wrote, a comment say, in a block. A runner
21
+ * of before prints such a text whole under its header, as the console's own words, so the
22
+ * console writes one in parts only for an account whose runner last said this version or a
23
+ * later one.
24
+ */
25
+ export const BOARD_PARTS_FROM = "0.6.3";
26
+
27
+ /** A word of a header on one line, with nothing in it that ends the header early. */
28
+ export const inHeader = (text: string): string => text.replaceAll(/[[\]\r\n]+/g, " ").trim();
29
+
30
+ /**
31
+ * What a line of a wake's text begins with, as the console keeps the text (ADR-0163): a line of
32
+ * the wake source's own, and a line of someone else's words. Every line of someone's words is
33
+ * begun so where the text is written, so that no word of theirs is ever a line of the source's.
34
+ */
35
+ const SAYS = "#";
36
+ const WORDS = ">";
37
+ /** What a wake's text ends on where its parts came to more than a signal carries. */
38
+ const WAKE_CUT = "The wake came to more than a signal carries, and was cut here";
39
+
40
+ /** The first `most` characters of a text, never half of a character that takes two. */
41
+ function firstOf(text: string, most: number): string {
42
+ const last = text.charCodeAt(most - 1);
43
+ return text.slice(0, last >= 0xd800 && last <= 0xdbff ? most - 1 : most);
44
+ }
45
+
46
+ /**
47
+ * What someone wrote, a line each behind `>`. A line break of any spelling ends a line, so that
48
+ * none is left in one to end it for a reader.
49
+ */
50
+ export function quotedLines(words: string): string[] {
51
+ return words.split(/\r\n?|\n/).map((line) => (line === "" ? WORDS : `${WORDS} ${line}`));
52
+ }
53
+
54
+ /**
55
+ * The parts of a wake as the one text a signal carries: a line of the source's own behind `#`,
56
+ * and each line of someone else's words behind `>`, in the order given. The runner writes it so
57
+ * for every wake a source raises, whatever the source handed it, and reads it back so when the
58
+ * signal returns (`wakePartsOf`). Two runs of words with no line between them are parted by a
59
+ * line that says nothing. Within `most` characters, the most a signal carries: what comes to
60
+ * more is cut at the end of a line, or within a line of words, and the text's last line says so.
61
+ */
62
+ export function wakeTextOf(parts: readonly WakePart[], most = MAX_SIGNAL_LENGTH): string {
63
+ const lines: string[] = [];
64
+ let afterWords = false;
65
+ for (const part of parts) {
66
+ if ("says" in part) {
67
+ const says = inHeader(part.says);
68
+ if (says !== "") {
69
+ lines.push(`${SAYS} ${says}`);
70
+ afterWords = false;
71
+ }
72
+ continue;
73
+ }
74
+ if (part.words === "") {
75
+ continue;
76
+ }
77
+ if (afterWords) {
78
+ lines.push(SAYS);
79
+ }
80
+ lines.push(...quotedLines(part.words));
81
+ afterWords = true;
82
+ }
83
+ const whole = lines.join("\n");
84
+ if (whole.length <= most) {
85
+ return whole;
86
+ }
87
+ const cut = `${SAYS} ${WAKE_CUT}`;
88
+ const kept: string[] = [];
89
+ let room = most - cut.length;
90
+ for (const line of lines) {
91
+ if (line.length + 1 > room) {
92
+ // A line of words is carried as far as it goes; one of the source's own, whole or not at all.
93
+ if (line.startsWith(`${WORDS} `) && room > WORDS.length + 2) {
94
+ kept.push(firstOf(line, room - 1));
95
+ }
96
+ break;
97
+ }
98
+ kept.push(line);
99
+ room -= line.length + 1;
100
+ }
101
+ return [...kept, cut].join("\n");
102
+ }
103
+
104
+ /**
105
+ * The parts of a wake read back from its text, or nothing where the text is not written as
106
+ * `wakeTextOf` writes one: a wake raised by a runner of before, which is then carried whole as
107
+ * someone else's words, as it was.
108
+ */
109
+ export function wakePartsOf(text: string): readonly WakePart[] | undefined {
110
+ const parts: WakePart[] = [];
111
+ let words: string[] | undefined;
112
+ const close = (): void => {
113
+ if (words !== undefined) {
114
+ parts.push({ words: words.join("\n") });
115
+ words = undefined;
116
+ }
117
+ };
118
+ for (const line of text.split("\n")) {
119
+ if (line === WORDS || line.startsWith(`${WORDS} `)) {
120
+ words ??= [];
121
+ words.push(line.slice(WORDS.length + 1));
122
+ } else if (line === SAYS || line.startsWith(`${SAYS} `)) {
123
+ close();
124
+ if (line.length > SAYS.length + 1) {
125
+ parts.push({ says: line.slice(SAYS.length + 1) });
126
+ }
127
+ } else {
128
+ return undefined;
129
+ }
130
+ }
131
+ close();
132
+ return parts;
133
+ }