@skillcdn/console 0.3.2 → 0.4.0

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 (146) hide show
  1. package/README.md +3 -3
  2. package/dist/api.d.ts +1 -1
  3. package/dist/api.d.ts.map +1 -1
  4. package/dist/api.js +1 -1
  5. package/dist/api.js.map +1 -1
  6. package/dist/cli/cli.d.ts.map +1 -1
  7. package/dist/cli/cli.js +96 -7
  8. package/dist/cli/cli.js.map +1 -1
  9. package/dist/cli/format.d.ts.map +1 -1
  10. package/dist/cli/format.js +6 -4
  11. package/dist/cli/format.js.map +1 -1
  12. package/dist/cli/help.d.ts.map +1 -1
  13. package/dist/cli/help.js +48 -17
  14. package/dist/cli/help.js.map +1 -1
  15. package/dist/cli/pack.d.ts +7 -2
  16. package/dist/cli/pack.d.ts.map +1 -1
  17. package/dist/cli/pack.js +16 -2
  18. package/dist/cli/pack.js.map +1 -1
  19. package/dist/client.d.ts +7 -2
  20. package/dist/client.d.ts.map +1 -1
  21. package/dist/client.js +7 -1
  22. package/dist/client.js.map +1 -1
  23. package/dist/compat.d.ts +1 -1
  24. package/dist/compat.js +2 -2
  25. package/dist/components/board.d.ts +12 -1
  26. package/dist/components/board.d.ts.map +1 -1
  27. package/dist/components/board.js +52 -4
  28. package/dist/components/board.js.map +1 -1
  29. package/dist/components/calendar.d.ts +4 -0
  30. package/dist/components/calendar.d.ts.map +1 -1
  31. package/dist/components/calendar.js +61 -22
  32. package/dist/components/calendar.js.map +1 -1
  33. package/dist/components/decision-form.d.ts +12 -4
  34. package/dist/components/decision-form.d.ts.map +1 -1
  35. package/dist/components/decision-form.js +24 -6
  36. package/dist/components/decision-form.js.map +1 -1
  37. package/dist/components/decision-list.d.ts +4 -0
  38. package/dist/components/decision-list.d.ts.map +1 -1
  39. package/dist/components/decision-list.js +9 -6
  40. package/dist/components/decision-list.js.map +1 -1
  41. package/dist/components/documents.d.ts.map +1 -1
  42. package/dist/components/documents.js +3 -3
  43. package/dist/components/documents.js.map +1 -1
  44. package/dist/components/event-feed.d.ts.map +1 -1
  45. package/dist/components/event-feed.js +63 -8
  46. package/dist/components/event-feed.js.map +1 -1
  47. package/dist/components/my-decisions.d.ts +20 -0
  48. package/dist/components/my-decisions.d.ts.map +1 -0
  49. package/dist/components/my-decisions.js +36 -0
  50. package/dist/components/my-decisions.js.map +1 -0
  51. package/dist/components/people.d.ts.map +1 -1
  52. package/dist/components/people.js +1 -1
  53. package/dist/components/people.js.map +1 -1
  54. package/dist/components/projects.d.ts.map +1 -1
  55. package/dist/components/projects.js +3 -3
  56. package/dist/components/projects.js.map +1 -1
  57. package/dist/components/roadmap.js +1 -1
  58. package/dist/components/roadmap.js.map +1 -1
  59. package/dist/components/runs.d.ts.map +1 -1
  60. package/dist/components/runs.js +1 -1
  61. package/dist/components/runs.js.map +1 -1
  62. package/dist/components/shell.d.ts.map +1 -1
  63. package/dist/components/shell.js +36 -1
  64. package/dist/components/shell.js.map +1 -1
  65. package/dist/components/task-list.js +1 -1
  66. package/dist/components/task-list.js.map +1 -1
  67. package/dist/components/task-view.d.ts.map +1 -1
  68. package/dist/components/task-view.js +2 -2
  69. package/dist/components/task-view.js.map +1 -1
  70. package/dist/components/ui.d.ts +10 -0
  71. package/dist/components/ui.d.ts.map +1 -1
  72. package/dist/components/ui.js +15 -11
  73. package/dist/components/ui.js.map +1 -1
  74. package/dist/console.css +1642 -433
  75. package/dist/console.d.ts.map +1 -1
  76. package/dist/console.js +70 -7
  77. package/dist/console.js.map +1 -1
  78. package/dist/data.d.ts +11 -1
  79. package/dist/data.d.ts.map +1 -1
  80. package/dist/data.js +2 -0
  81. package/dist/data.js.map +1 -1
  82. package/dist/i18n/en.d.ts +34 -0
  83. package/dist/i18n/en.d.ts.map +1 -1
  84. package/dist/i18n/en.js +36 -2
  85. package/dist/i18n/en.js.map +1 -1
  86. package/dist/i18n/ko.d.ts.map +1 -1
  87. package/dist/i18n/ko.js +37 -3
  88. package/dist/i18n/ko.js.map +1 -1
  89. package/dist/index.d.ts +3 -2
  90. package/dist/index.d.ts.map +1 -1
  91. package/dist/index.js +3 -2
  92. package/dist/index.js.map +1 -1
  93. package/dist/router.d.ts +9 -1
  94. package/dist/router.d.ts.map +1 -1
  95. package/dist/router.js +12 -0
  96. package/dist/router.js.map +1 -1
  97. package/dist/routes.d.ts +3 -1
  98. package/dist/routes.d.ts.map +1 -1
  99. package/dist/routes.js +3 -1
  100. package/dist/routes.js.map +1 -1
  101. package/dist/rules.js +1 -1
  102. package/dist/rules.js.map +1 -1
  103. package/dist/schemas.d.ts +242 -3
  104. package/dist/schemas.d.ts.map +1 -1
  105. package/dist/schemas.js +18 -4
  106. package/dist/schemas.js.map +1 -1
  107. package/docs/specs/cli.md +6 -5
  108. package/docs/specs/rest.md +11 -6
  109. package/package.json +2 -2
  110. package/skills/building-a-console/SKILL.md +3 -3
  111. package/skills/building-a-console/references/the-default-console.md +4 -4
  112. package/skills/building-a-console/references/the-look-from-a-website.md +5 -5
  113. package/skills/working-the-board/SKILL.md +6 -4
  114. package/skills/working-the-board/references/terms.md +1 -1
  115. package/src/api.ts +2 -0
  116. package/src/cli/cli.ts +123 -7
  117. package/src/cli/format.ts +11 -4
  118. package/src/cli/help.ts +49 -16
  119. package/src/cli/pack.ts +17 -1
  120. package/src/client.ts +21 -1
  121. package/src/compat.ts +2 -2
  122. package/src/components/board.tsx +114 -21
  123. package/src/components/calendar.tsx +207 -102
  124. package/src/components/decision-form.tsx +71 -23
  125. package/src/components/decision-list.tsx +30 -3
  126. package/src/components/documents.tsx +27 -11
  127. package/src/components/event-feed.tsx +116 -33
  128. package/src/components/my-decisions.tsx +138 -0
  129. package/src/components/people.tsx +3 -1
  130. package/src/components/projects.tsx +7 -5
  131. package/src/components/roadmap.tsx +1 -1
  132. package/src/components/runs.tsx +5 -1
  133. package/src/components/shell.tsx +36 -1
  134. package/src/components/task-list.tsx +1 -1
  135. package/src/components/task-view.tsx +48 -47
  136. package/src/components/ui.tsx +64 -11
  137. package/src/console.tsx +129 -27
  138. package/src/data.ts +17 -0
  139. package/src/i18n/en.ts +38 -2
  140. package/src/i18n/ko.ts +39 -3
  141. package/src/index.ts +3 -0
  142. package/src/router.ts +18 -1
  143. package/src/routes.ts +3 -1
  144. package/src/rules.ts +1 -1
  145. package/src/schemas.ts +20 -4
  146. package/src/styles/console.css +1642 -433
package/src/router.ts CHANGED
@@ -21,15 +21,20 @@ export type DocsView =
21
21
  /**
22
22
  * What the board is narrowed to (ADR-0019), from the query: a category by its key (`""` for
23
23
  * the tasks with none), a goal by its id (`""` for the tasks with none), a person by their id,
24
- * or the person's own.
24
+ * the person's own, or words (`q`), as they are typed, each of which a task's title, number,
25
+ * owner, worker or category must contain.
25
26
  */
26
27
  export interface BoardFilter {
27
28
  readonly category?: string | undefined;
28
29
  readonly goal?: string | undefined;
29
30
  readonly person?: string | undefined;
30
31
  readonly mine?: boolean | undefined;
32
+ readonly words?: string | undefined;
31
33
  }
32
34
 
35
+ /** As much of the words as the address keeps: enough for any search, bounded as every input is. */
36
+ const BOARD_WORDS_LENGTH = 200;
37
+
33
38
  export type Route =
34
39
  | { readonly name: "projects" }
35
40
  | { readonly name: "new-project" }
@@ -100,6 +105,8 @@ export type Route =
100
105
  /** What is on the person's plate across their projects. */
101
106
  /** What is on the person's plate: a day of the week shown at the top, or today's when the address names none. */
102
107
  | { readonly name: "work"; readonly week: string | undefined }
108
+ /** The decisions addressed to the person (ADR-0042), across the projects they may see. */
109
+ | { readonly name: "my-decisions" }
103
110
  /** The categories tasks are sorted into; an administrator keeps them here. */
104
111
  | { readonly name: "categories" }
105
112
  /** Where a person approves an agent's connection, by the code it showed, or types one. */
@@ -136,6 +143,8 @@ export const PATHS = {
136
143
  newProject: "/projects/new",
137
144
  /** What is on the person's plate, across the projects they may see. */
138
145
  work: "/work",
146
+ /** The decisions addressed to the person (ADR-0042), across the projects they may see. */
147
+ decisions: "/decisions",
139
148
  people: "/people",
140
149
  /** The form where an administrator lets someone in by login. */
141
150
  newListing: "/people/new",
@@ -187,11 +196,13 @@ const boardFilterOf = (params: URLSearchParams): BoardFilter => {
187
196
  const category = params.get("category");
188
197
  const goal = params.get("goal");
189
198
  const person = params.get("person");
199
+ const q = params.get("q");
190
200
  return {
191
201
  ...(category !== null && (category === "" || PROJECT_KEY.test(category)) ? { category } : {}),
192
202
  ...(goal !== null && (goal === "" || UUID.test(goal)) ? { goal } : {}),
193
203
  ...(person !== null && UUID.test(person) ? { person } : {}),
194
204
  ...(params.has("mine") ? { mine: true } : {}),
205
+ ...(q !== null && q.trim() !== "" ? { words: q.slice(0, BOARD_WORDS_LENGTH) } : {}),
195
206
  };
196
207
  };
197
208
 
@@ -239,6 +250,9 @@ export function matchRoute(pathname: string, search = ""): Route {
239
250
  const shown = weekShown(params);
240
251
  return shown === undefined ? NOT_FOUND : { name: "work", ...shown };
241
252
  }
253
+ if (path === PATHS.decisions) {
254
+ return { name: "my-decisions" };
255
+ }
242
256
  if (path === PATHS.people) {
243
257
  return { name: "people" };
244
258
  }
@@ -462,6 +476,9 @@ function filterParts(filter: BoardFilter): string[] {
462
476
  if (filter.mine === true) {
463
477
  parts.push("mine");
464
478
  }
479
+ if (filter.words !== undefined) {
480
+ parts.push(`q=${encodeURIComponent(filter.words)}`);
481
+ }
465
482
  return parts;
466
483
  }
467
484
 
package/src/routes.ts CHANGED
@@ -27,8 +27,10 @@ export const REST_ROUTES = {
27
27
  connect: "/api/v1/connect",
28
28
  /** The categories tasks are sorted into (ADR-0019): the workspace's vocabulary, kept by an administrator. */
29
29
  categories: "/api/v1/categories",
30
- /** What is on the asker's plate across the projects they may see: their open tasks, and the decisions waiting. */
30
+ /** What is on the asker's plate across the projects they may see: their open tasks, and the decisions waiting for them. */
31
31
  work: "/api/v1/work",
32
+ /** The decisions addressed to the asker (ADR-0042) across the projects they may see: the waiting first, then the record. */
33
+ decisions: "/api/v1/decisions",
32
34
  /** The rules of the board (ADR-0023): the console's own until an administrator writes the organization's. */
33
35
  rules: "/api/v1/rules",
34
36
  } as const;
package/src/rules.ts CHANGED
@@ -41,7 +41,7 @@ export const REFERENCE_RULES = [
41
41
  "",
42
42
  "## Decide alone, or ask",
43
43
  "",
44
- "Alone: how to do what the task settles, which skill to load, what to write on pages, and a commit or a push where the repository's agreement allows it. On the board, with `console ask`: a trade-off the task leaves open, a change of scope or of the plan, anything that costs money, anything that deletes. Answered once, never asked again.",
44
+ "Alone: how to do what the task settles, which skill to load, what to write on pages, and a commit or a push where the repository's agreement allows it. On the board, with `console ask`: a trade-off the task leaves open, a change of scope or of the plan, anything that costs money, anything that deletes. Answered once, never asked again. A decision is the record of a choice that is a person's to make, wherever they make it: an answer given to you in chat, in a meeting or by changing the task is written on the decision in the person's name (`console answer`), with where it was said, so that the board shows as waiting only what is still open and a run waits on the record, not on memory. Asked what is on a person's plate, or for a briefing, start from the decisions waiting for their answer (`console work`), each with what waits on it and since when, before the tasks.",
45
45
  "",
46
46
  "## Reports",
47
47
  "",
package/src/schemas.ts CHANGED
@@ -652,6 +652,8 @@ export const restDecisionSchema = z.object({
652
652
  /** The task's number, when there is a task, or `null`. */
653
653
  taskNumber: z.nullable(z.int()),
654
654
  raisedBy: restPersonSchema,
655
+ /** Who is to answer (ADR-0042): the raiser, unless another person of the project was named. */
656
+ decider: restPersonSchema,
655
657
  /** The run that raised it, as the agent asked, or `null` when a person did. */
656
658
  run: z.nullable(z.object({ id: uuid, agent: z.string() })),
657
659
  /** The answer, with who gave it and when; `null` while the decision waits. */
@@ -690,9 +692,9 @@ const projectRef = z.object({
690
692
 
691
693
  /**
692
694
  * `GET /api/v1/work`: what is on the asker's plate across the projects they may see (ADR-0019):
693
- * the open tasks they work on, and the decisions that wait for a person, each with its
694
- * project; and, for the week on the plate, `closed`, the tasks they work on that are done
695
- * or dropped and not yet put away. Left out by a console older than it.
695
+ * the open tasks they work on, and the decisions that wait for their answer (ADR-0042), each
696
+ * with its project; and, for the week on the plate, `closed`, the tasks they work on that are
697
+ * done or dropped and not yet put away. Left out by a console older than it.
696
698
  */
697
699
  export const restWorkSchema = z.object({
698
700
  tasks: z.array(z.object({ project: projectRef, task: restTaskSchema })),
@@ -701,6 +703,17 @@ export const restWorkSchema = z.object({
701
703
  });
702
704
  export type RestWork = z.infer<typeof restWorkSchema>;
703
705
 
706
+ /**
707
+ * `GET /api/v1/decisions`: a page of the decisions addressed to the asker (ADR-0042) across the
708
+ * projects they may see, each with its project: the ones that wait first, oldest first among
709
+ * them, then the answered, newest first; and whether there is more.
710
+ */
711
+ export const restMyDecisionsSchema = z.object({
712
+ items: z.array(z.object({ project: projectRef, decision: restDecisionSchema })),
713
+ more: z.boolean(),
714
+ });
715
+ export type RestMyDecisions = z.infer<typeof restMyDecisionsSchema>;
716
+
704
717
  /**
705
718
  * What `GET /api/v1/people/<id>/work` answers: another person's open tasks, and their closed
706
719
  * ones for the week, within the projects the asker may see, for whoever oversees them. No
@@ -722,6 +735,8 @@ export const restDecisionInputSchema = z.object({
722
735
  taskId: z.optional(z.nullable(uuid)),
723
736
  /** The run that asks, when an agent does: the decision is about its task, and it waits for the answer. */
724
737
  runId: z.optional(z.nullable(uuid)),
738
+ /** Who is to answer (ADR-0042): a person who may work in the project; the asker when left out. */
739
+ deciderId: z.optional(uuid),
725
740
  });
726
741
  export type RestDecisionInput = z.infer<typeof restDecisionInputSchema>;
727
742
 
@@ -779,8 +794,9 @@ export const restEventDataSchema = z.object({
779
794
  name: z.optional(z.string()),
780
795
  /** For what an agent did: what it calls itself. */
781
796
  agent: z.optional(z.string()),
782
- /** For `run.ended`: how. */
797
+ /** For `run.ended`: how, and, when the console ended the run itself, why (ADR-0041). */
783
798
  status: z.optional(z.enum(RUN_STATUSES)),
799
+ reason: z.optional(z.literal("unheard")),
784
800
  /** For `run.handed_in`: what the artifact is called. */
785
801
  label: z.optional(z.string()),
786
802
  /** For `run.reported` and `task.commented`: the first words of what was written. */