@skillcdn/console 0.4.4 → 0.4.6
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.
- package/README.md +3 -3
- package/dist/api.d.ts +3 -3
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +3 -3
- package/dist/api.js.map +1 -1
- package/dist/cli/cli.d.ts.map +1 -1
- package/dist/cli/cli.js +180 -22
- package/dist/cli/cli.js.map +1 -1
- package/dist/cli/format.d.ts +24 -4
- package/dist/cli/format.d.ts.map +1 -1
- package/dist/cli/format.js +78 -21
- package/dist/cli/format.js.map +1 -1
- package/dist/cli/help.d.ts.map +1 -1
- package/dist/cli/help.js +43 -10
- package/dist/cli/help.js.map +1 -1
- package/dist/client.d.ts +30 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +13 -2
- package/dist/client.js.map +1 -1
- package/dist/compat.js +1 -1
- package/dist/components/board.d.ts.map +1 -1
- package/dist/components/board.js +46 -15
- package/dist/components/board.js.map +1 -1
- package/dist/components/decision-form.d.ts +0 -3
- package/dist/components/decision-form.d.ts.map +1 -1
- package/dist/components/decision-form.js +3 -15
- package/dist/components/decision-form.js.map +1 -1
- package/dist/components/event-feed.d.ts.map +1 -1
- package/dist/components/event-feed.js +30 -10
- package/dist/components/event-feed.js.map +1 -1
- package/dist/components/my-decisions.d.ts +20 -3
- package/dist/components/my-decisions.d.ts.map +1 -1
- package/dist/components/my-decisions.js +14 -1
- package/dist/components/my-decisions.js.map +1 -1
- package/dist/components/people.d.ts +43 -1
- package/dist/components/people.d.ts.map +1 -1
- package/dist/components/people.js +117 -9
- package/dist/components/people.js.map +1 -1
- package/dist/components/picker.d.ts +8 -0
- package/dist/components/picker.d.ts.map +1 -1
- package/dist/components/picker.js +2 -2
- package/dist/components/picker.js.map +1 -1
- package/dist/components/plugin-frame.d.ts +0 -1
- package/dist/components/plugin-frame.d.ts.map +1 -1
- package/dist/components/plugin-frame.js +38 -4
- package/dist/components/plugin-frame.js.map +1 -1
- package/dist/components/plugin-settings.d.ts +5 -1
- package/dist/components/plugin-settings.d.ts.map +1 -1
- package/dist/components/plugin-settings.js +143 -30
- package/dist/components/plugin-settings.js.map +1 -1
- package/dist/components/projects.d.ts.map +1 -1
- package/dist/components/projects.js +3 -1
- package/dist/components/projects.js.map +1 -1
- package/dist/components/searches.d.ts +11 -0
- package/dist/components/searches.d.ts.map +1 -0
- package/dist/components/searches.js +30 -0
- package/dist/components/searches.js.map +1 -0
- package/dist/components/task-form.d.ts.map +1 -1
- package/dist/components/task-form.js +6 -5
- package/dist/components/task-form.js.map +1 -1
- package/dist/components/ui.d.ts +16 -0
- package/dist/components/ui.d.ts.map +1 -1
- package/dist/components/ui.js +10 -0
- package/dist/components/ui.js.map +1 -1
- package/dist/console.css +362 -67
- package/dist/console.d.ts +2 -1
- package/dist/console.d.ts.map +1 -1
- package/dist/console.js +90 -14
- package/dist/console.js.map +1 -1
- package/dist/data.d.ts +14 -1
- package/dist/data.d.ts.map +1 -1
- package/dist/data.js +36 -1
- package/dist/data.js.map +1 -1
- package/dist/i18n/en.d.ts +89 -0
- package/dist/i18n/en.d.ts.map +1 -1
- package/dist/i18n/en.js +87 -2
- package/dist/i18n/en.js.map +1 -1
- package/dist/i18n/ko.d.ts.map +1 -1
- package/dist/i18n/ko.js +87 -3
- package/dist/i18n/ko.js.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/limits.d.ts +6 -0
- package/dist/limits.d.ts.map +1 -1
- package/dist/limits.js +6 -0
- package/dist/limits.js.map +1 -1
- package/dist/plugin/args.d.ts +6 -1
- package/dist/plugin/args.d.ts.map +1 -1
- package/dist/plugin/args.js +16 -11
- package/dist/plugin/args.js.map +1 -1
- package/dist/plugin/bridge.d.ts +21 -1
- package/dist/plugin/bridge.d.ts.map +1 -1
- package/dist/plugin/bridge.js +28 -0
- package/dist/plugin/bridge.js.map +1 -1
- package/dist/plugin/capabilities.d.ts +1 -1
- package/dist/plugin/capabilities.d.ts.map +1 -1
- package/dist/plugin/capabilities.js +10 -0
- package/dist/plugin/capabilities.js.map +1 -1
- package/dist/plugin/context.d.ts +165 -14
- package/dist/plugin/context.d.ts.map +1 -1
- package/dist/plugin/define.d.ts +13 -1
- package/dist/plugin/define.d.ts.map +1 -1
- package/dist/plugin/define.js +17 -1
- package/dist/plugin/define.js.map +1 -1
- package/dist/plugin/limits.d.ts +4 -0
- package/dist/plugin/limits.d.ts.map +1 -1
- package/dist/plugin/limits.js +4 -0
- package/dist/plugin/limits.js.map +1 -1
- package/dist/plugin/manifest.d.ts +15 -0
- package/dist/plugin/manifest.d.ts.map +1 -1
- package/dist/plugin/manifest.js +61 -4
- package/dist/plugin/manifest.js.map +1 -1
- package/dist/plugin/rest-schemas.d.ts +44 -0
- package/dist/plugin/rest-schemas.d.ts.map +1 -1
- package/dist/plugin/rest-schemas.js +55 -3
- package/dist/plugin/rest-schemas.js.map +1 -1
- package/dist/plugin/testing.d.ts +15 -1
- package/dist/plugin/testing.d.ts.map +1 -1
- package/dist/plugin/testing.js +40 -4
- package/dist/plugin/testing.js.map +1 -1
- package/dist/plugin/web.d.ts +19 -0
- package/dist/plugin/web.d.ts.map +1 -1
- package/dist/plugin/web.js +17 -1
- package/dist/plugin/web.js.map +1 -1
- package/dist/plugin.d.ts +1 -1
- package/dist/plugin.d.ts.map +1 -1
- package/dist/plugin.js +1 -1
- package/dist/plugin.js.map +1 -1
- package/dist/router.d.ts +19 -0
- package/dist/router.d.ts.map +1 -1
- package/dist/router.js +18 -0
- package/dist/router.js.map +1 -1
- package/dist/routes.d.ts +11 -2
- package/dist/routes.d.ts.map +1 -1
- package/dist/routes.js +14 -1
- package/dist/routes.js.map +1 -1
- package/dist/schemas.d.ts +367 -0
- package/dist/schemas.d.ts.map +1 -1
- package/dist/schemas.js +62 -2
- package/dist/schemas.js.map +1 -1
- package/dist/vocabulary.d.ts +1 -1
- package/dist/vocabulary.d.ts.map +1 -1
- package/dist/vocabulary.js +6 -0
- package/dist/vocabulary.js.map +1 -1
- package/docs/specs/cli.md +8 -5
- package/docs/specs/plugins.md +62 -42
- package/docs/specs/rest.md +23 -6
- package/package.json +1 -1
- package/skills/building-a-plugin/SKILL.md +8 -6
- package/skills/working-the-board/SKILL.md +1 -1
- package/src/api.ts +17 -0
- package/src/cli/cli.ts +227 -19
- package/src/cli/format.ts +96 -21
- package/src/cli/help.ts +47 -10
- package/src/client.ts +74 -0
- package/src/compat.ts +1 -1
- package/src/components/board.tsx +83 -42
- package/src/components/decision-form.tsx +13 -32
- package/src/components/event-feed.tsx +36 -9
- package/src/components/my-decisions.tsx +50 -5
- package/src/components/people.tsx +394 -37
- package/src/components/picker.tsx +11 -2
- package/src/components/plugin-frame.tsx +39 -3
- package/src/components/plugin-settings.tsx +346 -137
- package/src/components/projects.tsx +14 -14
- package/src/components/searches.ts +47 -0
- package/src/components/task-form.tsx +23 -28
- package/src/components/ui.tsx +36 -0
- package/src/console.tsx +229 -40
- package/src/data.ts +53 -1
- package/src/i18n/en.ts +98 -2
- package/src/i18n/ko.ts +95 -3
- package/src/index.ts +11 -0
- package/src/limits.ts +6 -0
- package/src/plugin/args.ts +16 -11
- package/src/plugin/bridge.ts +46 -0
- package/src/plugin/capabilities.ts +11 -0
- package/src/plugin/context.ts +177 -11
- package/src/plugin/define.ts +34 -0
- package/src/plugin/limits.ts +4 -0
- package/src/plugin/manifest.ts +74 -3
- package/src/plugin/rest-schemas.ts +62 -5
- package/src/plugin/testing.ts +61 -5
- package/src/plugin/web.ts +34 -0
- package/src/plugin.ts +1 -0
- package/src/router.ts +25 -0
- package/src/routes.ts +17 -2
- package/src/schemas.ts +81 -2
- package/src/styles/console.css +362 -67
- package/src/vocabulary.ts +6 -0
|
@@ -13,9 +13,10 @@ import {
|
|
|
13
13
|
} from "../api.js";
|
|
14
14
|
import { useWords } from "../i18n/index.js";
|
|
15
15
|
import { isPicture, placing, unusedName } from "./files.js";
|
|
16
|
-
import { Picker
|
|
16
|
+
import { Picker } from "./picker.js";
|
|
17
|
+
import { peopleSearch } from "./searches.js";
|
|
17
18
|
import { type TaskSearch, taskLabel } from "./task-form.js";
|
|
18
|
-
import { Button, formatBytes, PersonChip, personName } from "./ui.js";
|
|
19
|
+
import { Button, Chip, formatBytes, PersonChip, personName } from "./ui.js";
|
|
19
20
|
|
|
20
21
|
// Raising a decision: the question, what a person needs to know, the options to choose from,
|
|
21
22
|
// and who is to answer (ADR-0042): the person raising it, unless they name another of the
|
|
@@ -57,23 +58,6 @@ export function decidersInput(
|
|
|
57
58
|
return ids.length === 1 ? { deciderId: first } : { deciderId: first, deciderIds: ids };
|
|
58
59
|
}
|
|
59
60
|
|
|
60
|
-
/** The people of the project found by the words typed, a page at a time, as a picker searches. */
|
|
61
|
-
export function peopleSearch(people: readonly RestPerson[]): PickerSearch<RestPerson> {
|
|
62
|
-
return async (query, page) => {
|
|
63
|
-
const words = query.trim().toLowerCase();
|
|
64
|
-
const found = people.filter(
|
|
65
|
-
(person) =>
|
|
66
|
-
words.length === 0 ||
|
|
67
|
-
personName(person).toLowerCase().includes(words) ||
|
|
68
|
-
person.login.toLowerCase().includes(words),
|
|
69
|
-
);
|
|
70
|
-
return {
|
|
71
|
-
items: found.slice(page.offset, page.offset + page.limit),
|
|
72
|
-
more: found.length > page.offset + page.limit,
|
|
73
|
-
};
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
|
|
77
61
|
export function DecisionForm(props: DecisionFormProps) {
|
|
78
62
|
const words = useWords();
|
|
79
63
|
const form = words.decisions.form;
|
|
@@ -228,25 +212,22 @@ export function DecisionForm(props: DecisionFormProps) {
|
|
|
228
212
|
<legend className="sc-field-label">{form.decider}</legend>
|
|
229
213
|
<div className="sc-chips">
|
|
230
214
|
{deciders.map((person) => (
|
|
231
|
-
<
|
|
215
|
+
<Chip
|
|
216
|
+
key={person.id}
|
|
217
|
+
onRemove={() =>
|
|
218
|
+
setDeciders((current) => current.filter((chosen) => chosen.id !== person.id))
|
|
219
|
+
}
|
|
220
|
+
removeLabel={`${words.common.remove}: ${personName(person)}`}
|
|
221
|
+
disabled={props.busy}
|
|
222
|
+
>
|
|
232
223
|
<PersonChip person={person} />
|
|
233
224
|
{person.id === props.me?.id && <span className="sc-muted"> {form.me}</span>}
|
|
234
|
-
|
|
235
|
-
type="button"
|
|
236
|
-
className="sc-chip-remove"
|
|
237
|
-
aria-label={`${words.common.remove}: ${personName(person)}`}
|
|
238
|
-
disabled={props.busy}
|
|
239
|
-
onClick={() =>
|
|
240
|
-
setDeciders((current) => current.filter((chosen) => chosen.id !== person.id))
|
|
241
|
-
}
|
|
242
|
-
>
|
|
243
|
-
<span aria-hidden="true">×</span>
|
|
244
|
-
</button>
|
|
245
|
-
</span>
|
|
225
|
+
</Chip>
|
|
246
226
|
))}
|
|
247
227
|
{deciders.length === 0 && <span className="sc-muted">{form.deciderPlaceholder}</span>}
|
|
248
228
|
{deciders.length < MAX_DECIDERS && (
|
|
249
229
|
<Picker
|
|
230
|
+
className="sc-picker-add"
|
|
250
231
|
value={undefined}
|
|
251
232
|
search={findDeciders}
|
|
252
233
|
keyOf={(person) => person.id}
|
|
@@ -45,11 +45,15 @@ function sentenceOf(event: RestEvent, words: Messages): string {
|
|
|
45
45
|
const grantee =
|
|
46
46
|
data.everyone === true
|
|
47
47
|
? feed.everyone
|
|
48
|
-
: data.
|
|
49
|
-
? data.
|
|
50
|
-
: data.
|
|
51
|
-
? feed.
|
|
52
|
-
:
|
|
48
|
+
: data.grantee !== undefined
|
|
49
|
+
? feed.thePlugin(data.grantee)
|
|
50
|
+
: data.team !== undefined
|
|
51
|
+
? feed.theTeam(data.team)
|
|
52
|
+
: data.login !== undefined
|
|
53
|
+
? data.login
|
|
54
|
+
: data.key !== undefined
|
|
55
|
+
? feed.membersOf(data.name ?? data.key)
|
|
56
|
+
: feed.someone;
|
|
53
57
|
switch (event.kind) {
|
|
54
58
|
case "person.joined":
|
|
55
59
|
return feed.event.personJoined();
|
|
@@ -67,6 +71,18 @@ function sentenceOf(event: RestEvent, words: Messages): string {
|
|
|
67
71
|
return data.manager === null || data.manager === undefined
|
|
68
72
|
? feed.event.managerCleared(login)
|
|
69
73
|
: feed.event.managerChanged(login, data.manager);
|
|
74
|
+
case "person.email_changed":
|
|
75
|
+
return data.set === true ? feed.event.emailChanged(login) : feed.event.emailCleared(login);
|
|
76
|
+
case "team.created":
|
|
77
|
+
return feed.event.teamCreated(data.team ?? feed.aTeam);
|
|
78
|
+
case "team.renamed":
|
|
79
|
+
return feed.event.teamRenamed(data.name ?? feed.aTeam, data.team ?? feed.aTeam);
|
|
80
|
+
case "team.removed":
|
|
81
|
+
return feed.event.teamRemoved(data.team ?? feed.aTeam);
|
|
82
|
+
case "team.member_added":
|
|
83
|
+
return feed.event.teamMemberAdded(login, data.team ?? feed.aTeam);
|
|
84
|
+
case "team.member_removed":
|
|
85
|
+
return feed.event.teamMemberRemoved(login, data.team ?? feed.aTeam);
|
|
70
86
|
case "workspace.updated":
|
|
71
87
|
return feed.event.workspaceUpdated(fields);
|
|
72
88
|
case "project.created":
|
|
@@ -140,9 +156,11 @@ function sentenceOf(event: RestEvent, words: Messages): string {
|
|
|
140
156
|
case "plugin.disabled":
|
|
141
157
|
return feed.event.pluginDisabled(plugin);
|
|
142
158
|
case "plugin.configured":
|
|
143
|
-
return data.capabilities
|
|
144
|
-
? feed.event.
|
|
145
|
-
:
|
|
159
|
+
return data.capabilities !== undefined
|
|
160
|
+
? feed.event.pluginConsented(plugin)
|
|
161
|
+
: data.source !== undefined && data.source !== "administrator"
|
|
162
|
+
? feed.event.pluginSealed(fields, plugin, data.source)
|
|
163
|
+
: feed.event.pluginConfigured(fields, plugin);
|
|
146
164
|
case "plugin.granted":
|
|
147
165
|
return feed.event.pluginGranted(data.role ?? feed.role.other, grantee, plugin);
|
|
148
166
|
case "plugin.revoked":
|
|
@@ -195,7 +213,11 @@ function formatFeedDay(day: string, language: string, now: Date = new Date()): s
|
|
|
195
213
|
|
|
196
214
|
/** Whether two events were done by the same person as the same agent, so the name is said once. */
|
|
197
215
|
function sameHands(a: RestEvent, b: RestEvent): boolean {
|
|
198
|
-
return (
|
|
216
|
+
return (
|
|
217
|
+
(a.actor?.id ?? null) === (b.actor?.id ?? null) &&
|
|
218
|
+
a.agent === b.agent &&
|
|
219
|
+
(a.via ?? null) === (b.via ?? null)
|
|
220
|
+
);
|
|
199
221
|
}
|
|
200
222
|
|
|
201
223
|
/** The hour of an event, for a row whose day is in the heading above it. */
|
|
@@ -266,6 +288,11 @@ export function EventFeed(props: EventFeedProps) {
|
|
|
266
288
|
{words.feed.as(agentLabel(run.actor.agent))}
|
|
267
289
|
</span>
|
|
268
290
|
)}
|
|
291
|
+
{run.actor.via !== null && run.actor.via !== undefined && (
|
|
292
|
+
<span className="sc-feed-agent" title={words.feed.viaTitle}>
|
|
293
|
+
{words.feed.via(run.actor.via)}
|
|
294
|
+
</span>
|
|
295
|
+
)}
|
|
269
296
|
</span>
|
|
270
297
|
<ol className="sc-feed-run-list">
|
|
271
298
|
{run.events.map((event) => {
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import type { ReactNode } from "react";
|
|
2
|
-
import
|
|
2
|
+
import {
|
|
3
|
+
decisionFilePath,
|
|
4
|
+
type RestAnswerInput,
|
|
5
|
+
type RestDecision,
|
|
6
|
+
type RestMyDecisions,
|
|
7
|
+
type RestReachedDecision,
|
|
8
|
+
} from "../api.js";
|
|
3
9
|
import { useWords } from "../i18n/index.js";
|
|
4
10
|
import { DecisionCard, DecisionLog } from "./decision-list.js";
|
|
5
11
|
import { ProjectMark } from "./projects.js";
|
|
@@ -11,7 +17,9 @@ import { Button } from "./ui.js";
|
|
|
11
17
|
// whom they wait for; in the second the record, the answered ones of both kinds, newest first.
|
|
12
18
|
// Every card and row names the project, and who asked and who answers, as the cards do
|
|
13
19
|
// everywhere. Takes its data as props and nothing from the network; the page reads more when
|
|
14
|
-
// asked.
|
|
20
|
+
// asked. A decision here may be in a project the person may not see (ADR-0068), so the files
|
|
21
|
+
// put on it are read at the decision's own address, which serves them to whoever the decision
|
|
22
|
+
// reaches, and not at the project's.
|
|
15
23
|
|
|
16
24
|
/** One kind of a person's decisions, a page at a time. */
|
|
17
25
|
export interface DecisionsPage {
|
|
@@ -27,8 +35,14 @@ export interface MyDecisionsProps {
|
|
|
27
35
|
/** The decisions the person asked of someone else: waiting and answered. */
|
|
28
36
|
readonly raised: DecisionsPage;
|
|
29
37
|
readonly decisionHref: (projectKey: string, decisionId: string) => string;
|
|
30
|
-
/**
|
|
31
|
-
|
|
38
|
+
/**
|
|
39
|
+
* Where a file put on a decision is read (ADR-0055), by the project's key, the file's id and
|
|
40
|
+
* the decision's; left out, at the decision's own address, `decisionFilePath`, which serves it
|
|
41
|
+
* to whoever the decision reaches, in a project they may see or not (ADR-0068).
|
|
42
|
+
*/
|
|
43
|
+
readonly fileHref?:
|
|
44
|
+
| ((projectKey: string, fileId: string, decisionId: string) => string)
|
|
45
|
+
| undefined;
|
|
32
46
|
/** Called with the person's answer on a decision of theirs, in its project. Left out, a waiting decision is answered on its own page. */
|
|
33
47
|
readonly onAnswer?:
|
|
34
48
|
| ((projectKey: string, decision: RestDecision, input: RestAnswerInput) => void)
|
|
@@ -82,7 +96,11 @@ export function MyDecisions(props: MyDecisionsProps) {
|
|
|
82
96
|
decision={item.decision}
|
|
83
97
|
href={props.decisionHref(item.project.key, item.decision.id)}
|
|
84
98
|
project={<InProject project={item.project} />}
|
|
85
|
-
fileHref={
|
|
99
|
+
fileHref={(fileId) =>
|
|
100
|
+
fileHref === undefined
|
|
101
|
+
? decisionFilePath(item.decision.id, fileId)
|
|
102
|
+
: fileHref(item.project.key, fileId, item.decision.id)
|
|
103
|
+
}
|
|
86
104
|
onAnswer={
|
|
87
105
|
answerable && onAnswer !== undefined
|
|
88
106
|
? (decision, input) => onAnswer(item.project.key, decision, input)
|
|
@@ -139,3 +157,30 @@ export function MyDecisions(props: MyDecisionsProps) {
|
|
|
139
157
|
</div>
|
|
140
158
|
);
|
|
141
159
|
}
|
|
160
|
+
|
|
161
|
+
export interface ReachedDecisionProps {
|
|
162
|
+
/** The decision as the person reaches it (ADR-0068): its project, the decision, and whether they may answer it. */
|
|
163
|
+
readonly reached: RestReachedDecision;
|
|
164
|
+
/** Called with the person's answer; the decision is answered here only where `mayAnswer` says they may. */
|
|
165
|
+
readonly onAnswer?: ((decision: RestDecision, input: RestAnswerInput) => void) | undefined;
|
|
166
|
+
readonly busy?: boolean | undefined;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* One decision wherever it is (ADR-0068), on its own page: the card with its project named, the
|
|
171
|
+
* files put on it read at the decision's own address, since the project may be one the person
|
|
172
|
+
* may not see, and the way to answer it where they may.
|
|
173
|
+
*/
|
|
174
|
+
export function ReachedDecision(props: ReachedDecisionProps) {
|
|
175
|
+
const { reached } = props;
|
|
176
|
+
const { decision } = reached;
|
|
177
|
+
return (
|
|
178
|
+
<DecisionCard
|
|
179
|
+
decision={decision}
|
|
180
|
+
project={<InProject project={reached.project} />}
|
|
181
|
+
fileHref={(fileId) => decisionFilePath(decision.id, fileId)}
|
|
182
|
+
onAnswer={reached.mayAnswer === true ? props.onAnswer : undefined}
|
|
183
|
+
busy={props.busy}
|
|
184
|
+
/>
|
|
185
|
+
);
|
|
186
|
+
}
|