@skillcdn/console 0.0.0-stage → 0.1.1

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 (128) hide show
  1. package/LICENSE.md +21 -0
  2. package/README.md +79 -2
  3. package/dist/api.d.ts +7 -0
  4. package/dist/api.d.ts.map +1 -0
  5. package/dist/api.js +11 -0
  6. package/dist/api.js.map +1 -0
  7. package/dist/cli/cli.d.ts +34 -0
  8. package/dist/cli/cli.d.ts.map +1 -0
  9. package/dist/cli/cli.js +557 -0
  10. package/dist/cli/cli.js.map +1 -0
  11. package/dist/cli/credentials.d.ts +16 -0
  12. package/dist/cli/credentials.d.ts.map +1 -0
  13. package/dist/cli/credentials.js +46 -0
  14. package/dist/cli/credentials.js.map +1 -0
  15. package/dist/cli/format.d.ts +16 -0
  16. package/dist/cli/format.d.ts.map +1 -0
  17. package/dist/cli/format.js +151 -0
  18. package/dist/cli/format.js.map +1 -0
  19. package/dist/cli/help.d.ts +16 -0
  20. package/dist/cli/help.d.ts.map +1 -0
  21. package/dist/cli/help.js +181 -0
  22. package/dist/cli/help.js.map +1 -0
  23. package/dist/cli/main.d.ts +3 -0
  24. package/dist/cli/main.d.ts.map +1 -0
  25. package/dist/cli/main.js +32 -0
  26. package/dist/cli/main.js.map +1 -0
  27. package/dist/cli/terminal.d.ts +12 -0
  28. package/dist/cli/terminal.d.ts.map +1 -0
  29. package/dist/cli/terminal.js +68 -0
  30. package/dist/cli/terminal.js.map +1 -0
  31. package/dist/client.d.ts +92 -0
  32. package/dist/client.d.ts.map +1 -0
  33. package/dist/client.js +117 -0
  34. package/dist/client.js.map +1 -0
  35. package/dist/components/board.d.ts +20 -0
  36. package/dist/components/board.d.ts.map +1 -0
  37. package/dist/components/board.js +19 -0
  38. package/dist/components/board.js.map +1 -0
  39. package/dist/components/decision-form.d.ts +13 -0
  40. package/dist/components/decision-form.d.ts.map +1 -0
  41. package/dist/components/decision-form.js +23 -0
  42. package/dist/components/decision-form.js.map +1 -0
  43. package/dist/components/decision-list.d.ts +22 -0
  44. package/dist/components/decision-list.d.ts.map +1 -0
  45. package/dist/components/decision-list.js +28 -0
  46. package/dist/components/decision-list.js.map +1 -0
  47. package/dist/components/event-feed.d.ts +13 -0
  48. package/dist/components/event-feed.d.ts.map +1 -0
  49. package/dist/components/event-feed.js +59 -0
  50. package/dist/components/event-feed.js.map +1 -0
  51. package/dist/components/markdown.d.ts +4 -0
  52. package/dist/components/markdown.d.ts.map +1 -0
  53. package/dist/components/markdown.js +34 -0
  54. package/dist/components/markdown.js.map +1 -0
  55. package/dist/components/people.d.ts +11 -0
  56. package/dist/components/people.d.ts.map +1 -0
  57. package/dist/components/people.js +7 -0
  58. package/dist/components/people.js.map +1 -0
  59. package/dist/components/runs.d.ts +27 -0
  60. package/dist/components/runs.d.ts.map +1 -0
  61. package/dist/components/runs.js +45 -0
  62. package/dist/components/runs.js.map +1 -0
  63. package/dist/components/shell.d.ts +22 -0
  64. package/dist/components/shell.d.ts.map +1 -0
  65. package/dist/components/shell.js +16 -0
  66. package/dist/components/shell.js.map +1 -0
  67. package/dist/components/sign-in.d.ts +11 -0
  68. package/dist/components/sign-in.d.ts.map +1 -0
  69. package/dist/components/sign-in.js +15 -0
  70. package/dist/components/sign-in.js.map +1 -0
  71. package/dist/components/skills.d.ts +7 -0
  72. package/dist/components/skills.d.ts.map +1 -0
  73. package/dist/components/skills.js +26 -0
  74. package/dist/components/skills.js.map +1 -0
  75. package/dist/components/task-form.d.ts +14 -0
  76. package/dist/components/task-form.d.ts.map +1 -0
  77. package/dist/components/task-form.js +34 -0
  78. package/dist/components/task-form.js.map +1 -0
  79. package/dist/components/task-view.d.ts +22 -0
  80. package/dist/components/task-view.d.ts.map +1 -0
  81. package/dist/components/task-view.js +32 -0
  82. package/dist/components/task-view.js.map +1 -0
  83. package/dist/components/tokens.d.ts +26 -0
  84. package/dist/components/tokens.d.ts.map +1 -0
  85. package/dist/components/tokens.js +42 -0
  86. package/dist/components/tokens.js.map +1 -0
  87. package/dist/components/ui.d.ts +61 -0
  88. package/dist/components/ui.d.ts.map +1 -0
  89. package/dist/components/ui.js +109 -0
  90. package/dist/components/ui.js.map +1 -0
  91. package/dist/console.css +1382 -0
  92. package/dist/console.d.ts +44 -0
  93. package/dist/console.d.ts.map +1 -0
  94. package/dist/console.js +181 -0
  95. package/dist/console.js.map +1 -0
  96. package/dist/data.d.ts +41 -0
  97. package/dist/data.d.ts.map +1 -0
  98. package/dist/data.js +208 -0
  99. package/dist/data.js.map +1 -0
  100. package/dist/index.d.ts +19 -0
  101. package/dist/index.d.ts.map +1 -0
  102. package/dist/index.js +23 -0
  103. package/dist/index.js.map +1 -0
  104. package/dist/limits.d.ts +37 -0
  105. package/dist/limits.d.ts.map +1 -0
  106. package/dist/limits.js +40 -0
  107. package/dist/limits.js.map +1 -0
  108. package/dist/router.d.ts +37 -0
  109. package/dist/router.d.ts.map +1 -0
  110. package/dist/router.js +55 -0
  111. package/dist/router.js.map +1 -0
  112. package/dist/routes.d.ts +47 -0
  113. package/dist/routes.d.ts.map +1 -0
  114. package/dist/routes.js +53 -0
  115. package/dist/routes.js.map +1 -0
  116. package/dist/schemas.d.ts +789 -0
  117. package/dist/schemas.d.ts.map +1 -0
  118. package/dist/schemas.js +341 -0
  119. package/dist/schemas.js.map +1 -0
  120. package/dist/text.d.ts +6 -0
  121. package/dist/text.d.ts.map +1 -0
  122. package/dist/text.js +31 -0
  123. package/dist/text.js.map +1 -0
  124. package/dist/vocabulary.d.ts +35 -0
  125. package/dist/vocabulary.d.ts.map +1 -0
  126. package/dist/vocabulary.js +57 -0
  127. package/dist/vocabulary.js.map +1 -0
  128. package/package.json +70 -3
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../src/schemas.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,UAAU,CAAC;AAsD9B,mFAAmF;AACnF,eAAO,MAAM,gBAAgB;;;;;;;;;iB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B,CAAC,CAAC;AAEpE,gFAAgF;AAChF,eAAO,MAAM,uBAAuB;;;iBAGlC,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAYxE;;;GAGG;AACH,eAAO,MAAM,mBAAmB;;;;iBAS9B,CAAC;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE,gGAAgG;AAChG,eAAO,MAAM,qBAAqB;;;;;;;iBAGhC,CAAC;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
@@ -0,0 +1,341 @@
1
+ // The mini build of zod: these schemas also run in the browser, where the full build would be
2
+ // most of what a page downloads. The server validates what it is sent with the input schemas
3
+ // and builds the output shapes; the pages and a custom console parse answers with the rest.
4
+ // Absent values are `null` on the wire, never missing keys. Changes within a version are additive.
5
+ import * as z from "zod/mini";
6
+ import { MAX_AGENT_LENGTH, MAX_BODY_LENGTH, MAX_FILE_NAME_LENGTH, MAX_LINK_LABEL_LENGTH, MAX_LINKS, MAX_NOTE_LENGTH, MAX_OPTION_LABEL_LENGTH, MAX_OPTIONS, MAX_QUESTION_LENGTH, MAX_SUMMARY_LENGTH, MAX_TITLE_LENGTH, MAX_TOKEN_DAYS, MAX_TOKEN_NAME_LENGTH, MAX_URL_LENGTH, MIN_OPTIONS, } from "./limits.js";
7
+ import { hasForbiddenCodePoint } from "./text.js";
8
+ import { ARTIFACT_KINDS, EVENT_KINDS, PERSON_ROLES, PROVIDER_KEYS, RUN_ENDINGS, RUN_STATUSES, SKILLS_STATUSES, TASK_PRIORITIES, TASK_STATES, } from "./vocabulary.js";
9
+ /** A line of text a person wrote: trimmed, bounded, and free of characters that hide. */
10
+ const line = (maxLength) => z.string().check(z.trim(), z.minLength(1), z.maxLength(maxLength), z.refine((value) => !hasForbiddenCodePoint(value), "must not contain control characters"));
11
+ /** A body in Markdown: bounded, with its line breaks, and otherwise the same rule. */
12
+ const body = z.string().check(z.maxLength(MAX_BODY_LENGTH), z.refine((value) => !hasForbiddenCodePoint(value, true), "must not contain control characters"));
13
+ /** A link a person adds to a task: the web, over https, and nothing that runs. */
14
+ const url = z.string().check(z.trim(), z.maxLength(MAX_URL_LENGTH), z.url({ protocol: /^https$/ }));
15
+ const uuid = z.uuid();
16
+ /** An ISO 8601 instant, as the server writes it. */
17
+ const instant = z.iso.datetime();
18
+ const count = z.int().check(z.nonnegative());
19
+ /** A person of the workspace, as the pages show them. Nothing here is a secret. */
20
+ export const restPersonSchema = z.object({
21
+ id: uuid,
22
+ /** What the account is called at its provider: a login at the git host, an address at Google. */
23
+ login: z.string(),
24
+ /** The name the account goes by at the host, or `null`. */
25
+ name: z.nullable(z.string()),
26
+ /** The account's picture as the host serves it: an https URL loaded by the browser, or `null`. */
27
+ avatar: z.nullable(z.string()),
28
+ /** An administrator configures the board; a member works on it. */
29
+ role: z.enum(PERSON_ROLES),
30
+ });
31
+ /** An identity provider people may sign in through, as the pages offer it. */
32
+ export const restProviderSchema = z.object({
33
+ key: z.enum(PROVIDER_KEYS),
34
+ /** What people read on the button. */
35
+ label: z.string(),
36
+ });
37
+ /**
38
+ * `GET /api/v1/me`: the workspace, who the session cookie says is signed in (or `null`), and
39
+ * the identity providers people sign in through, none where nobody can.
40
+ */
41
+ export const restMeSchema = z.object({
42
+ workspace: z.object({ name: z.string() }),
43
+ person: z.nullable(restPersonSchema),
44
+ signIn: z.array(restProviderSchema),
45
+ });
46
+ /** `GET /api/v1/people`: everyone who has signed in, by login. */
47
+ export const restPeopleSchema = z.object({ items: z.array(restPersonSchema) });
48
+ /** What `PATCH /api/v1/people/<id>` is sent, by an administrator: what the person is to be. */
49
+ export const restPersonPatchSchema = z.object({ role: z.enum(PERSON_ROLES) });
50
+ export const restTaskLinkSchema = z.object({
51
+ url: z.string(),
52
+ label: z.nullable(z.string()),
53
+ });
54
+ export const restTaskSchema = z.object({
55
+ id: uuid,
56
+ /** The task's number in the workspace, the one people say out loud. */
57
+ number: z.int().check(z.positive()),
58
+ title: z.string(),
59
+ /** Markdown. Shown as text or rendered to elements, never as HTML. */
60
+ body: z.string(),
61
+ state: z.enum(TASK_STATES),
62
+ priority: z.enum(TASK_PRIORITIES),
63
+ owner: restPersonSchema,
64
+ assignee: z.nullable(restPersonSchema),
65
+ /** The task this one is part of, or `null`. */
66
+ parentId: z.nullable(uuid),
67
+ links: z.array(restTaskLinkSchema),
68
+ /** How many decisions about this task wait for a person. */
69
+ openDecisions: count,
70
+ /** How many runs are at work on it, or waiting. */
71
+ openRuns: count,
72
+ createdAt: instant,
73
+ updatedAt: instant,
74
+ });
75
+ /** `GET /api/v1/tasks`: the board, newest first. */
76
+ export const restTasksSchema = z.object({ items: z.array(restTaskSchema) });
77
+ const taskLinkInput = z.object({
78
+ url,
79
+ label: z.optional(z.nullable(line(MAX_LINK_LABEL_LENGTH))),
80
+ });
81
+ /** What `POST /api/v1/tasks` is sent. Everything but the title has a default. */
82
+ export const restTaskInputSchema = z.object({
83
+ title: line(MAX_TITLE_LENGTH),
84
+ body: z.optional(body),
85
+ state: z.optional(z.enum(TASK_STATES)),
86
+ priority: z.optional(z.enum(TASK_PRIORITIES)),
87
+ assigneeId: z.optional(z.nullable(uuid)),
88
+ parentId: z.optional(z.nullable(uuid)),
89
+ links: z.optional(z.array(taskLinkInput).check(z.maxLength(MAX_LINKS))),
90
+ });
91
+ /** What `PATCH /api/v1/tasks/<id>` is sent: only what changes. */
92
+ export const restTaskPatchSchema = z.object({
93
+ title: z.optional(line(MAX_TITLE_LENGTH)),
94
+ body: z.optional(body),
95
+ state: z.optional(z.enum(TASK_STATES)),
96
+ priority: z.optional(z.enum(TASK_PRIORITIES)),
97
+ assigneeId: z.optional(z.nullable(uuid)),
98
+ parentId: z.optional(z.nullable(uuid)),
99
+ links: z.optional(z.array(taskLinkInput).check(z.maxLength(MAX_LINKS))),
100
+ });
101
+ export const restDecisionOptionSchema = z.object({
102
+ /** What an answer names: stable for the life of the decision. */
103
+ id: z.string(),
104
+ label: z.string(),
105
+ });
106
+ export const restDecisionSchema = z.object({
107
+ id: uuid,
108
+ question: z.string(),
109
+ /** Markdown: what a person needs to know to answer. */
110
+ body: z.string(),
111
+ options: z.array(restDecisionOptionSchema),
112
+ /** The task the decision is about, or `null`. */
113
+ taskId: z.nullable(uuid),
114
+ /** The task's number, when there is a task, or `null`. */
115
+ taskNumber: z.nullable(z.int()),
116
+ raisedBy: restPersonSchema,
117
+ /** The run that raised it, as the agent asked, or `null` when a person did. */
118
+ run: z.nullable(z.object({ id: uuid, agent: z.string() })),
119
+ /** The answer, with who gave it and when; `null` while the decision waits. */
120
+ answer: z.nullable(z.object({
121
+ /** The id of the chosen option. */
122
+ option: z.string(),
123
+ note: z.nullable(z.string()),
124
+ by: restPersonSchema,
125
+ at: instant,
126
+ })),
127
+ createdAt: instant,
128
+ updatedAt: instant,
129
+ });
130
+ /** `GET /api/v1/decisions`: the ones that wait first, newest first within each. */
131
+ export const restDecisionsSchema = z.object({ items: z.array(restDecisionSchema) });
132
+ /** What `POST /api/v1/decisions` is sent: the question, its context, and the options. */
133
+ export const restDecisionInputSchema = z.object({
134
+ question: line(MAX_QUESTION_LENGTH),
135
+ body: z.optional(body),
136
+ options: z
137
+ .array(z.object({ label: line(MAX_OPTION_LABEL_LENGTH) }))
138
+ .check(z.minLength(MIN_OPTIONS), z.maxLength(MAX_OPTIONS)),
139
+ taskId: z.optional(z.nullable(uuid)),
140
+ /** The run that asks, when an agent does: the decision is about its task, and it waits for the answer. */
141
+ runId: z.optional(z.nullable(uuid)),
142
+ });
143
+ /** What `POST /api/v1/decisions/<id>/answer` is sent: an option, and a word about it. */
144
+ export const restAnswerInputSchema = z.object({
145
+ option: z.string().check(z.minLength(1), z.maxLength(64)),
146
+ note: z.optional(z.string().check(z.maxLength(MAX_NOTE_LENGTH), z.refine((value) => !hasForbiddenCodePoint(value, true), "must not contain control characters"))),
147
+ });
148
+ /**
149
+ * What an event says about its subject, so that a feed can show a line without asking for the
150
+ * task or the decision: every field is there only when the kind has it.
151
+ */
152
+ export const restEventDataSchema = z.object({
153
+ number: z.optional(z.int()),
154
+ title: z.optional(z.string()),
155
+ /** For `task.updated`: which fields changed. */
156
+ fields: z.optional(z.array(z.string())),
157
+ /** For `task.moved`. */
158
+ from: z.optional(z.enum(TASK_STATES)),
159
+ to: z.optional(z.enum(TASK_STATES)),
160
+ question: z.optional(z.string()),
161
+ /** For `decision.answered`: the label of the chosen option. */
162
+ option: z.optional(z.string()),
163
+ /** For `person.role_changed`: whose role, and what it became. */
164
+ login: z.optional(z.string()),
165
+ role: z.optional(z.enum(PERSON_ROLES)),
166
+ /** For what an agent did: what it calls itself. */
167
+ agent: z.optional(z.string()),
168
+ /** For `run.ended`: how. */
169
+ status: z.optional(z.enum(RUN_STATUSES)),
170
+ /** For `run.handed_in`: what the artifact is called. */
171
+ label: z.optional(z.string()),
172
+ /** For `run.reported`: the first words of the report. */
173
+ excerpt: z.optional(z.string()),
174
+ });
175
+ export const restEventSchema = z.object({
176
+ /** Events are numbered in the order they were written; the feed is read from a number on. */
177
+ id: z.int().check(z.positive()),
178
+ kind: z.enum(EVENT_KINDS),
179
+ /** Who did it; `null` for the console itself. */
180
+ actor: z.nullable(restPersonSchema),
181
+ taskId: z.nullable(uuid),
182
+ decisionId: z.nullable(uuid),
183
+ runId: z.nullable(uuid),
184
+ data: restEventDataSchema,
185
+ createdAt: instant,
186
+ });
187
+ /** What an agent reported while at work: Markdown, shown as text or rendered to elements. */
188
+ export const restReportSchema = z.object({
189
+ id: uuid,
190
+ body: z.string(),
191
+ createdAt: instant,
192
+ });
193
+ /** A file a run handed in, as the console keeps it; its bytes are at `restPath("files", <artifact id>)`. */
194
+ export const restFileSchema = z.object({
195
+ /** What the agent called it: one line, without a path. */
196
+ name: z.string(),
197
+ /** In bytes. */
198
+ size: count,
199
+ /** The media type the agent said, or `application/octet-stream`. */
200
+ contentType: z.string(),
201
+ /** The SHA-256 of the bytes, in hex: what the console keeps them under. */
202
+ sha256: z.string(),
203
+ });
204
+ /** What a run handed in: a link to a branch, a pull request, a page; or a file the console keeps. */
205
+ export const restArtifactSchema = z.object({
206
+ id: uuid,
207
+ kind: z.enum(ARTIFACT_KINDS),
208
+ /** The link, for a link; `null` for a file. */
209
+ url: z.nullable(z.string()),
210
+ label: z.nullable(z.string()),
211
+ /** The file, for a file; `null` for a link. */
212
+ file: z.nullable(restFileSchema),
213
+ createdAt: instant,
214
+ });
215
+ /** One agent at work on one task for one person: what it did, and what it waits for. */
216
+ export const restRunSchema = z.object({
217
+ id: uuid,
218
+ taskId: uuid,
219
+ /** The task's number, as people say it. */
220
+ taskNumber: z.int().check(z.positive()),
221
+ /** The person the agent acts for. */
222
+ person: restPersonSchema,
223
+ /** What the agent calls itself. */
224
+ agent: z.string(),
225
+ status: z.enum(RUN_STATUSES),
226
+ startedAt: instant,
227
+ endedAt: z.nullable(instant),
228
+ /** What the agent said when the run ended, in Markdown, or `null`. */
229
+ summary: z.nullable(z.string()),
230
+ /** Oldest first. */
231
+ reports: z.array(restReportSchema),
232
+ artifacts: z.array(restArtifactSchema),
233
+ /** The id of the decision the run waits for, or `null`. */
234
+ waitingFor: z.nullable(uuid),
235
+ });
236
+ /** `GET /api/v1/runs?task=`: the runs, newest first. */
237
+ export const restRunsSchema = z.object({ items: z.array(restRunSchema) });
238
+ /** `GET /api/v1/events?after=`: what happened after that number, oldest first. */
239
+ export const restEventsSchema = z.object({
240
+ items: z.array(restEventSchema),
241
+ /** True when there is more after the last item than one page carries. */
242
+ more: z.boolean(),
243
+ });
244
+ /**
245
+ * A token a person made for an agent, a script or a console of their own, as their own page
246
+ * lists it. The secret itself is answered once, when the token is made, and never kept.
247
+ */
248
+ export const restTokenSchema = z.object({
249
+ id: uuid,
250
+ /** What the person calls it: the agent it is for, where it runs. */
251
+ name: z.string(),
252
+ createdAt: instant,
253
+ /** When it stops being good, or `null` for a token that does not expire. */
254
+ expiresAt: z.nullable(instant),
255
+ /** When it was last presented, or `null` if never. */
256
+ lastUsedAt: z.nullable(instant),
257
+ });
258
+ /** `GET /api/v1/tokens`: the tokens of whoever asks, newest first. */
259
+ export const restTokensSchema = z.object({ items: z.array(restTokenSchema) });
260
+ /** What `POST /api/v1/tokens` is sent: a name, and for how many days it is good. */
261
+ export const restTokenInputSchema = z.object({
262
+ name: line(MAX_TOKEN_NAME_LENGTH),
263
+ /** Left out: `DEFAULT_TOKEN_DAYS`. `null`: the token does not expire. */
264
+ expiresInDays: z.optional(z.nullable(z.int().check(z.gte(1), z.lte(MAX_TOKEN_DAYS)))),
265
+ });
266
+ /** What `POST /api/v1/tokens` answers: the token, and its secret, this once. */
267
+ export const restTokenCreatedSchema = z.object({
268
+ token: restTokenSchema,
269
+ /** Presented as `Authorization: Bearer <secret>`. The server keeps its hash, and never shows it again. */
270
+ secret: z.string(),
271
+ });
272
+ /** One of the organization's skills, as the SkillCDN deployment lists it at the console's address. */
273
+ export const restSkillSchema = z.object({
274
+ name: z.string(),
275
+ description: z.string(),
276
+ /** The skill's folder in the repository (`""` for the root), and the path of its `SKILL.md`. */
277
+ directory: z.string(),
278
+ path: z.string(),
279
+ /** Where a person reads the skill: its page at the deployment. */
280
+ page: z.string(),
281
+ /** What an agent loads the skill by, through its own SkillCDN connection; `null` when the path is not one. */
282
+ uri: z.nullable(z.string()),
283
+ /** The title and the description in other languages, by language tag, as the repository gives them. */
284
+ translations: z.record(z.string(), z.object({ title: z.nullable(z.string()), description: z.nullable(z.string()) })),
285
+ });
286
+ /** `GET /api/v1/skills`: the organization's skills, read by address through SkillCDN. */
287
+ export const restSkillsSchema = z.object({
288
+ /** The address, canonical, or `null` when the deployment has none configured. */
289
+ address: z.nullable(z.string()),
290
+ /** The origin of the SkillCDN deployment the skills are read through. */
291
+ source: z.string(),
292
+ /** Where a person browses the address, or `null` without one. */
293
+ page: z.nullable(z.string()),
294
+ status: z.enum(SKILLS_STATUSES),
295
+ /** The skills, when `ready`; empty otherwise. */
296
+ items: z.array(restSkillSchema),
297
+ });
298
+ export const restErrorSchema = z.object({
299
+ error: z.object({
300
+ /** Stable; what a client branches on. */
301
+ code: z.string(),
302
+ /** For a person, in English. */
303
+ message: z.string(),
304
+ }),
305
+ });
306
+ /** What an agent says when it ends a run: Markdown, bounded. */
307
+ const summary = z.string().check(z.maxLength(MAX_SUMMARY_LENGTH), z.refine((value) => !hasForbiddenCodePoint(value, true), "must not contain control characters"));
308
+ /** What `POST /api/v1/runs` is sent: the task to take, and what the agent calls itself. */
309
+ export const restRunInputSchema = z.object({
310
+ taskId: uuid,
311
+ /** Left out, the agent is called what its person called the token, or by the person's login. */
312
+ agent: z.optional(line(MAX_AGENT_LENGTH)),
313
+ });
314
+ /** What `POST /api/v1/runs/<id>/reports` is sent: how the work goes, in Markdown. */
315
+ export const restReportInputSchema = z.object({
316
+ body: body.check(z.refine((value) => value.trim().length > 0, "must say something")),
317
+ });
318
+ /** What `POST /api/v1/runs/<id>/artifacts` is sent: a link to what was made. */
319
+ export const restArtifactInputSchema = z.object({
320
+ url,
321
+ label: z.optional(line(MAX_LINK_LABEL_LENGTH)),
322
+ });
323
+ /** A media type as a client says one: `type/subtype`, lowercase, without parameters. */
324
+ const mediaType = z
325
+ .string()
326
+ .check(z.trim(), z.toLowerCase(), z.maxLength(120), z.regex(/^[a-z0-9][a-z0-9!#$&^_.+-]*\/[a-z0-9][a-z0-9!#$&^_.+-]*$/, "must be a media type"));
327
+ /**
328
+ * What `POST /api/v1/runs/<id>/files` is sent beside the bytes, as the parts of a form: the
329
+ * file's name and media type come with the `file` part, the `label` is a part of its own.
330
+ */
331
+ export const restFileInputSchema = z.object({
332
+ name: line(MAX_FILE_NAME_LENGTH).check(z.refine((value) => !/[\\/]/.test(value) && value !== "." && value !== "..", "must be a file name, not a path")),
333
+ contentType: z.optional(mediaType),
334
+ label: z.optional(line(MAX_LINK_LABEL_LENGTH)),
335
+ });
336
+ /** What `POST /api/v1/runs/<id>/end` is sent: how the run ended, and what was done and left. */
337
+ export const restRunEndInputSchema = z.object({
338
+ status: z.enum(RUN_ENDINGS),
339
+ summary: z.optional(summary),
340
+ });
341
+ //# sourceMappingURL=schemas.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemas.js","sourceRoot":"","sources":["../src/schemas.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,6FAA6F;AAC7F,4FAA4F;AAC5F,mGAAmG;AACnG,OAAO,KAAK,CAAC,MAAM,UAAU,CAAC;AAC9B,OAAO,EACL,gBAAgB,EAChB,eAAe,EACf,oBAAoB,EACpB,qBAAqB,EACrB,SAAS,EACT,eAAe,EACf,uBAAuB,EACvB,WAAW,EACX,mBAAmB,EACnB,kBAAkB,EAClB,gBAAgB,EAChB,cAAc,EACd,qBAAqB,EACrB,cAAc,EACd,WAAW,GACZ,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAClD,OAAO,EACL,cAAc,EACd,WAAW,EACX,YAAY,EACZ,aAAa,EACb,WAAW,EACX,YAAY,EACZ,eAAe,EACf,eAAe,EACf,WAAW,GACZ,MAAM,iBAAiB,CAAC;AAEzB,yFAAyF;AACzF,MAAM,IAAI,GAAG,CAAC,SAAiB,EAAE,EAAE,CACjC,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CACd,CAAC,CAAC,IAAI,EAAE,EACR,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EACd,CAAC,CAAC,SAAS,CAAC,SAAS,CAAC,EACtB,CAAC,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,qBAAqB,CAAC,KAAK,CAAC,EAAE,qCAAqC,CAAC,CAC1F,CAAC;AAEJ,sFAAsF;AACtF,MAAM,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAC3B,CAAC,CAAC,SAAS,CAAC,eAAe,CAAC,EAC5B,C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C,CAAC,CAAC;AAGH,gGAAgG;AAChG,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5C,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC;IAC3B,OAAO,EAAE,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC;CAC7B,CAAC,CAAC"}
package/dist/text.d.ts ADDED
@@ -0,0 +1,6 @@
1
+ /**
2
+ * True when the string is malformed UTF-16 or holds a forbidden code point. Linear in the input.
3
+ * With `multiline`, line breaks and tabs are allowed, as a body needs them.
4
+ */
5
+ export declare function hasForbiddenCodePoint(value: string, multiline?: boolean): boolean;
6
+ //# sourceMappingURL=text.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../src/text.ts"],"names":[],"mappings":"AAkBA;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,UAAQ,GAAG,OAAO,CAU/E"}
package/dist/text.js ADDED
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Code points that never belong in text the console accepts, stores or shows: control
3
+ * characters, and the invisible or direction-changing ones that make one string look like
4
+ * another. A body keeps its line breaks and tabs; a title has no use for them.
5
+ */
6
+ function isForbidden(codePoint, multiline) {
7
+ if (codePoint <= 0x1f) {
8
+ return !(multiline && (codePoint === 0x09 || codePoint === 0x0a || codePoint === 0x0d));
9
+ }
10
+ return ((codePoint >= 0x7f && codePoint <= 0x9f) ||
11
+ (codePoint >= 0x200b && codePoint <= 0x200f) ||
12
+ (codePoint >= 0x2028 && codePoint <= 0x202e) ||
13
+ (codePoint >= 0x2060 && codePoint <= 0x2069) ||
14
+ codePoint === 0xfeff);
15
+ }
16
+ /**
17
+ * True when the string is malformed UTF-16 or holds a forbidden code point. Linear in the input.
18
+ * With `multiline`, line breaks and tabs are allowed, as a body needs them.
19
+ */
20
+ export function hasForbiddenCodePoint(value, multiline = false) {
21
+ if (!value.isWellFormed()) {
22
+ return true;
23
+ }
24
+ for (const character of value) {
25
+ if (isForbidden(character.codePointAt(0) ?? 0, multiline)) {
26
+ return true;
27
+ }
28
+ }
29
+ return false;
30
+ }
31
+ //# sourceMappingURL=text.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"text.js","sourceRoot":"","sources":["../src/text.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,SAAS,WAAW,CAAC,SAAiB,EAAE,SAAkB;IACxD,IAAI,SAAS,IAAI,IAAI,EAAE,CAAC;QACtB,OAAO,CAAC,CAAC,SAAS,IAAI,CAAC,SAAS,KAAK,IAAI,IAAI,SAAS,KAAK,IAAI,IAAI,SAAS,KAAK,IAAI,CAAC,CAAC,CAAC;IAC1F,CAAC;IACD,OAAO,CACL,CAAC,SAAS,IAAI,IAAI,IAAI,SAAS,IAAI,IAAI,CAAC;QACxC,CAAC,SAAS,IAAI,MAAM,IAAI,SAAS,IAAI,MAAM,CAAC;QAC5C,CAAC,SAAS,IAAI,MAAM,IAAI,SAAS,IAAI,MAAM,CAAC;QAC5C,CAAC,SAAS,IAAI,MAAM,IAAI,SAAS,IAAI,MAAM,CAAC;QAC5C,SAAS,KAAK,MAAM,CACrB,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,qBAAqB,CAAC,KAAa,EAAE,SAAS,GAAG,KAAK;IACpE,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE,EAAE,CAAC;QAC1B,OAAO,IAAI,CAAC;IACd,CAAC;IACD,KAAK,MAAM,SAAS,IAAI,KAAK,EAAE,CAAC;QAC9B,IAAI,WAAW,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,SAAS,CAAC,EAAE,CAAC;YAC1D,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -0,0 +1,35 @@
1
+ /** The states a task moves through, in the order it usually does. */
2
+ export declare const TASK_STATES: readonly ["idea", "ready", "in_progress", "in_review", "done", "dropped"];
3
+ export type TaskState = (typeof TASK_STATES)[number];
4
+ /** How much a task matters next to the others, in rising order. */
5
+ export declare const TASK_PRIORITIES: readonly ["low", "normal", "high", "urgent"];
6
+ export type TaskPriority = (typeof TASK_PRIORITIES)[number];
7
+ /** The identity providers people may sign in through: the git host, and Google (Workspace). */
8
+ export declare const PROVIDER_KEYS: readonly ["gh", "google"];
9
+ export type ProviderKey = (typeof PROVIDER_KEYS)[number];
10
+ export declare function isProviderKey(value: string | null | undefined): value is ProviderKey;
11
+ /** What a person may do: an administrator configures the board, a member works on it. */
12
+ export declare const PERSON_ROLES: readonly ["admin", "member"];
13
+ export type PersonRole = (typeof PERSON_ROLES)[number];
14
+ /** What a run is doing: at work, waiting for a person's decision, or over in one of three ways. */
15
+ export declare const RUN_STATUSES: readonly ["running", "waiting", "finished", "failed", "abandoned"];
16
+ export type RunStatus = (typeof RUN_STATUSES)[number];
17
+ /** How a run is over, as the agent says: the work is done, it could not be, or it was left. */
18
+ export declare const RUN_ENDINGS: readonly ["finished", "failed", "abandoned"];
19
+ export type RunEnding = (typeof RUN_ENDINGS)[number];
20
+ /** What a run hands in: a link to the web, or a file the console keeps. */
21
+ export declare const ARTIFACT_KINDS: readonly ["link", "file"];
22
+ export type ArtifactKind = (typeof ARTIFACT_KINDS)[number];
23
+ /**
24
+ * What the console says of the organization's skills: that it has no address for them, or what
25
+ * the SkillCDN deployment answered for the address.
26
+ */
27
+ export declare const SKILLS_STATUSES: readonly ["none", "ready", "indexing", "failed", "not_found", "unavailable"];
28
+ export type SkillsStatus = (typeof SKILLS_STATUSES)[number];
29
+ /**
30
+ * What can happen to the board. Every change of state is one of these, written down once with
31
+ * who did it: the live feed shows them as they happen, and the audit trail keeps them.
32
+ */
33
+ export declare const EVENT_KINDS: readonly ["person.joined", "person.role_changed", "task.created", "task.updated", "task.moved", "decision.raised", "decision.answered", "run.started", "run.reported", "run.handed_in", "run.ended"];
34
+ export type E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,MAAM,SAAS,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC;AAErD,2EAA2E;AAC3E,eAAO,MAAM,cAAc,YAAI,MAAM,EAAE,MAAM,CAAU,CAAC;AAExD,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC;AAE3D;;;GAGG;AACH,eAAO,MAAM,eAAe,YAC1B,MAAM,EACN,OAAO,EACP,UAAU,EACV,QAAQ,EACR,WAAW,EACX,aAAa,CACL,CAAC;AAEX,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC;AAE5D;;;GAGG;AACH,eAAO,MAAM,WAAW,YACtB,eAAe,EACf,qBAAqB,EACrB,cAAc,EACd,cAAc,EACd,YAAY,EACZ,iBAAiB,EACjB,mBAAmB,EACnB,aAAa,EACb,cAAc,EACd,eAAe,EACf,WAAW,CACH,CAAC;AAEX,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC"}
@@ -0,0 +1,57 @@
1
+ // The concepts the schema, the API and the UI are named after (docs/architecture.md,
2
+ // "Vocabulary"). A list here is a check constraint in the database, an enum in the schemas, and
3
+ // a column or a badge on the board: one source for all three.
4
+ /** The states a task moves through, in the order it usually does. */
5
+ export const TASK_STATES = [
6
+ "idea",
7
+ "ready",
8
+ "in_progress",
9
+ "in_review",
10
+ "done",
11
+ "dropped",
12
+ ];
13
+ /** How much a task matters next to the others, in rising order. */
14
+ export const TASK_PRIORITIES = ["low", "normal", "high", "urgent"];
15
+ /** The identity providers people may sign in through: the git host, and Google (Workspace). */
16
+ export const PROVIDER_KEYS = ["gh", "google"];
17
+ export function isProviderKey(value) {
18
+ return PROVIDER_KEYS.includes(value ?? "");
19
+ }
20
+ /** What a person may do: an administrator configures the board, a member works on it. */
21
+ export const PERSON_ROLES = ["admin", "member"];
22
+ /** What a run is doing: at work, waiting for a person's decision, or over in one of three ways. */
23
+ export const RUN_STATUSES = ["running", "waiting", "finished", "failed", "abandoned"];
24
+ /** How a run is over, as the agent says: the work is done, it could not be, or it was left. */
25
+ export const RUN_ENDINGS = ["finished", "failed", "abandoned"];
26
+ /** What a run hands in: a link to the web, or a file the console keeps. */
27
+ export const ARTIFACT_KINDS = ["link", "file"];
28
+ /**
29
+ * What the console says of the organization's skills: that it has no address for them, or what
30
+ * the SkillCDN deployment answered for the address.
31
+ */
32
+ export const SKILLS_STATUSES = [
33
+ "none",
34
+ "ready",
35
+ "indexing",
36
+ "failed",
37
+ "not_found",
38
+ "unavailable",
39
+ ];
40
+ /**
41
+ * What can happen to the board. Every change of state is one of these, written down once with
42
+ * who did it: the live feed shows them as they happen, and the audit trail keeps them.
43
+ */
44
+ export const EVENT_KINDS = [
45
+ "person.joined",
46
+ "person.role_changed",
47
+ "task.created",
48
+ "task.updated",
49
+ "task.moved",
50
+ "decision.raised",
51
+ "decision.answered",
52
+ "run.started",
53
+ "run.reported",
54
+ "run.handed_in",
55
+ "run.ended",
56
+ ];
57
+ //# sourceMappingURL=vocabulary.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vocabulary.js","sourceRoot":"","sources":["../src/vocabulary.ts"],"names":[],"mappings":"AAAA,qFAAqF;AACrF,gGAAgG;AAChG,8DAA8D;AAE9D,qEAAqE;AACrE,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,MAAM;IACN,OAAO;IACP,aAAa;IACb,WAAW;IACX,MAAM;IACN,SAAS;CACD,CAAC;AAIX,mEAAmE;AACnE,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,CAAU,CAAC;AAI5E,+FAA+F;AAC/F,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,IAAI,EAAE,QAAQ,CAAU,CAAC;AAIvD,MAAM,UAAU,aAAa,CAAC,KAAgC;IAC5D,OAAQ,aAAmC,CAAC,QAAQ,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC;AACpE,CAAC;AAED,yFAAyF;AACzF,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,OAAO,EAAE,QAAQ,CAAU,CAAC;AAIzD,mGAAmG;AACnG,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,WAAW,CAAU,CAAC;AAI/F,+FAA+F;AAC/F,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,UAAU,EAAE,QAAQ,EAAE,WAAW,CAAU,CAAC;AAIxE,2EAA2E;AAC3E,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,MAAM,EAAE,MAAM,CAAU,CAAC;AAIxD;;;GAGG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,MAAM;IACN,OAAO;IACP,UAAU;IACV,QAAQ;IACR,WAAW;IACX,aAAa;CACL,CAAC;AAIX;;;GAGG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,eAAe;IACf,qBAAqB;IACrB,cAAc;IACd,cAAc;IACd,YAAY;IACZ,iBAAiB;IACjB,mBAAmB;IACnB,aAAa;IACb,cAAc;IACd,eAAe;IACf,WAAW;CACH,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,73 @@
1
1
  {
2
2
  "name": "@skillcdn/console",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.1.1",
4
+ "description": "What a custom SkillCDN console is built from: the API client and schemas, the components, the composition of the default console, and the console command agents work the board with.",
5
+ "license": "MIT",
6
+ "homepage": "https://github.com/skillcdn/console#readme",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/skillcdn/console.git",
10
+ "directory": "packages/console"
11
+ },
12
+ "bugs": "https://github.com/skillcdn/console/issues",
13
+ "keywords": [
14
+ "skillcdn",
15
+ "console",
16
+ "agents",
17
+ "cli"
18
+ ],
19
+ "type": "module",
20
+ "sideEffects": false,
21
+ "bin": {
22
+ "console": "./dist/cli/main.js"
23
+ },
24
+ "engines": {
25
+ "node": ">=24"
26
+ },
27
+ "exports": {
28
+ ".": {
29
+ "types": "./dist/index.d.ts",
30
+ "default": "./dist/index.js"
31
+ },
32
+ "./api": {
33
+ "types": "./dist/api.d.ts",
34
+ "default": "./dist/api.js"
35
+ },
36
+ "./cli": {
37
+ "types": "./dist/cli/cli.d.ts",
38
+ "default": "./dist/cli/cli.js"
39
+ },
40
+ "./console.css": "./dist/console.css"
41
+ },
42
+ "files": [
43
+ "dist",
44
+ "!dist/**/*.tsbuildinfo"
45
+ ],
46
+ "publishConfig": {
47
+ "access": "public"
48
+ },
49
+ "devDependencies": {
50
+ "@types/node": "^24.19.1",
51
+ "@types/react": "^19.3.0",
52
+ "@types/react-dom": "^19.3.0",
53
+ "react": "^19.3.0",
54
+ "react-dom": "^19.3.0",
55
+ "typescript": "^7.0.2",
56
+ "vitest": "^5.0.3"
57
+ },
58
+ "dependencies": {
59
+ "react-markdown": "^10.1.0",
60
+ "remark-gfm": "^4.0.1",
61
+ "zod": "^4.6.5"
62
+ },
63
+ "peerDependencies": {
64
+ "react": "^19.0.0",
65
+ "react-dom": "^19.0.0"
66
+ },
67
+ "scripts": {
68
+ "build": "tsc -b tsconfig.build.json && node -e \"fs.mkdirSync('dist',{recursive:true});fs.copyFileSync('src/styles/console.css','dist/console.css')\"",
69
+ "typecheck": "tsc -p tsconfig.json --noEmit",
70
+ "test": "vitest run --passWithNoTests",
71
+ "clean": "node -e \"fs.rmSync('dist',{recursive:true,force:true})\""
72
+ }
6
73
  }