@skillcdn/console 0.1.13 → 0.1.15
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 +5 -4
- package/SKILLCDN.md +2 -0
- package/dist/agent-name.d.ts +3 -0
- package/dist/agent-name.d.ts.map +1 -0
- package/dist/agent-name.js +9 -0
- package/dist/agent-name.js.map +1 -0
- package/dist/api.d.ts +6 -4
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +6 -4
- package/dist/api.js.map +1 -1
- package/dist/cli/cli.d.ts +2 -0
- package/dist/cli/cli.d.ts.map +1 -1
- package/dist/cli/cli.js +215 -22
- package/dist/cli/cli.js.map +1 -1
- package/dist/cli/format.d.ts +14 -4
- package/dist/cli/format.d.ts.map +1 -1
- package/dist/cli/format.js +59 -10
- package/dist/cli/format.js.map +1 -1
- package/dist/cli/help.d.ts.map +1 -1
- package/dist/cli/help.js +27 -11
- package/dist/cli/help.js.map +1 -1
- package/dist/cli/main.js +5 -0
- package/dist/cli/main.js.map +1 -1
- package/dist/client.d.ts +20 -2
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +11 -2
- package/dist/client.js.map +1 -1
- package/dist/components/calendar.d.ts +15 -0
- package/dist/components/calendar.d.ts.map +1 -1
- package/dist/components/calendar.js +78 -41
- package/dist/components/calendar.js.map +1 -1
- package/dist/components/connect.d.ts +4 -1
- package/dist/components/connect.d.ts.map +1 -1
- package/dist/components/connect.js +7 -3
- package/dist/components/connect.js.map +1 -1
- package/dist/components/decision-list.d.ts.map +1 -1
- package/dist/components/decision-list.js +3 -3
- package/dist/components/decision-list.js.map +1 -1
- package/dist/components/documents.d.ts +5 -0
- package/dist/components/documents.d.ts.map +1 -1
- package/dist/components/documents.js +3 -2
- package/dist/components/documents.js.map +1 -1
- package/dist/components/event-feed.d.ts +1 -1
- package/dist/components/event-feed.d.ts.map +1 -1
- package/dist/components/event-feed.js +10 -1
- package/dist/components/event-feed.js.map +1 -1
- package/dist/components/people.d.ts +24 -1
- package/dist/components/people.d.ts.map +1 -1
- package/dist/components/people.js +35 -3
- package/dist/components/people.js.map +1 -1
- package/dist/components/projects.d.ts +6 -0
- package/dist/components/projects.d.ts.map +1 -1
- package/dist/components/projects.js +3 -3
- package/dist/components/projects.js.map +1 -1
- package/dist/components/rules.d.ts +40 -0
- package/dist/components/rules.d.ts.map +1 -0
- package/dist/components/rules.js +46 -0
- package/dist/components/rules.js.map +1 -0
- package/dist/components/runs.d.ts +1 -1
- package/dist/components/runs.d.ts.map +1 -1
- package/dist/components/runs.js +2 -1
- package/dist/components/runs.js.map +1 -1
- package/dist/components/skills.d.ts.map +1 -1
- package/dist/components/skills.js +5 -1
- package/dist/components/skills.js.map +1 -1
- package/dist/components/tokens.d.ts.map +1 -1
- package/dist/components/tokens.js +2 -9
- package/dist/components/tokens.js.map +1 -1
- package/dist/components/ui.d.ts +7 -2
- package/dist/components/ui.d.ts.map +1 -1
- package/dist/components/ui.js +13 -0
- package/dist/components/ui.js.map +1 -1
- package/dist/components/work.d.ts +9 -1
- package/dist/components/work.d.ts.map +1 -1
- package/dist/components/work.js +8 -3
- package/dist/components/work.js.map +1 -1
- package/dist/connect-page.d.ts.map +1 -1
- package/dist/connect-page.js +1 -1
- package/dist/connect-page.js.map +1 -1
- package/dist/console.css +253 -13
- package/dist/console.d.ts.map +1 -1
- package/dist/console.js +203 -49
- package/dist/console.js.map +1 -1
- package/dist/data.d.ts +19 -2
- package/dist/data.d.ts.map +1 -1
- package/dist/data.js +27 -1
- package/dist/data.js.map +1 -1
- package/dist/dates.d.ts +4 -0
- package/dist/dates.d.ts.map +1 -1
- package/dist/dates.js +26 -0
- package/dist/dates.js.map +1 -1
- package/dist/i18n/en.d.ts +90 -28
- package/dist/i18n/en.d.ts.map +1 -1
- package/dist/i18n/en.js +89 -31
- package/dist/i18n/en.js.map +1 -1
- package/dist/i18n/ko.d.ts.map +1 -1
- package/dist/i18n/ko.js +89 -31
- package/dist/i18n/ko.js.map +1 -1
- package/dist/index.d.ts +6 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -5
- package/dist/index.js.map +1 -1
- package/dist/limits.d.ts +4 -0
- package/dist/limits.d.ts.map +1 -1
- package/dist/limits.js +4 -0
- package/dist/limits.js.map +1 -1
- package/dist/router.d.ts +34 -2
- package/dist/router.d.ts.map +1 -1
- package/dist/router.js +55 -7
- package/dist/router.js.map +1 -1
- package/dist/routes.d.ts +14 -4
- package/dist/routes.d.ts.map +1 -1
- package/dist/routes.js +17 -2
- package/dist/routes.js.map +1 -1
- package/dist/rules.d.ts +28 -0
- package/dist/rules.d.ts.map +1 -0
- package/dist/rules.js +102 -0
- package/dist/rules.js.map +1 -0
- package/dist/schemas.d.ts +652 -4
- package/dist/schemas.d.ts.map +1 -1
- package/dist/schemas.js +96 -6
- package/dist/schemas.js.map +1 -1
- package/dist/vocabulary.d.ts +21 -1
- package/dist/vocabulary.d.ts.map +1 -1
- package/dist/vocabulary.js +21 -0
- package/dist/vocabulary.js.map +1 -1
- package/docs/specs/cli.md +13 -9
- package/docs/specs/rest.md +32 -8
- package/package.json +1 -1
- package/skills/building-a-console/SKILL.md +1 -1
- package/skills/deploying-a-console/SKILL.md +5 -5
- package/skills/deploying-a-console/assets/secrets.example.json +2 -1
- package/skills/deploying-a-console/references/access.md +10 -6
- package/skills/deploying-a-console/references/resources.md +10 -7
- package/skills/working-the-board/SKILL.md +10 -9
- package/skills/working-the-board/references/project-rules.md +36 -0
- package/src/agent-name.ts +9 -0
- package/src/api.ts +37 -0
- package/src/cli/cli.ts +253 -24
- package/src/cli/format.ts +74 -10
- package/src/cli/help.ts +30 -10
- package/src/cli/main.ts +5 -0
- package/src/client.ts +47 -1
- package/src/components/calendar.tsx +242 -101
- package/src/components/connect.tsx +12 -6
- package/src/components/decision-list.tsx +2 -2
- package/src/components/documents.tsx +7 -3
- package/src/components/event-feed.tsx +16 -3
- package/src/components/people.tsx +244 -35
- package/src/components/projects.tsx +31 -8
- package/src/components/rules.tsx +167 -0
- package/src/components/runs.tsx +4 -2
- package/src/components/skills.tsx +22 -11
- package/src/components/tokens.tsx +2 -14
- package/src/components/ui.tsx +25 -2
- package/src/components/work.tsx +69 -43
- package/src/connect-page.tsx +0 -1
- package/src/console.tsx +531 -67
- package/src/data.ts +52 -2
- package/src/dates.ts +28 -0
- package/src/i18n/en.ts +99 -38
- package/src/i18n/ko.ts +95 -38
- package/src/index.ts +21 -1
- package/src/limits.ts +4 -0
- package/src/router.ts +77 -12
- package/src/routes.ts +23 -3
- package/src/rules.ts +109 -0
- package/src/schemas.ts +121 -4
- package/src/styles/console.css +253 -13
- package/src/vocabulary.ts +30 -0
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
type RestTokenInput,
|
|
7
7
|
} from "../api.js";
|
|
8
8
|
import { useWords } from "../i18n/index.js";
|
|
9
|
-
import { Button, Callout, Time } from "./ui.js";
|
|
9
|
+
import { Button, Callout, CopyButton, Time } from "./ui.js";
|
|
10
10
|
|
|
11
11
|
// The tokens a person holds for their agents, scripts and consoles of their own, shown as the
|
|
12
12
|
// agents that hold them: the list, the way to make one by hand, and the one just made, whose
|
|
@@ -180,16 +180,6 @@ export interface NewTokenProps {
|
|
|
180
180
|
export function NewToken(props: NewTokenProps) {
|
|
181
181
|
const words = useWords();
|
|
182
182
|
const fresh = words.agents.fresh;
|
|
183
|
-
const [copied, setCopied] = useState(false);
|
|
184
|
-
const copy = () => {
|
|
185
|
-
if (typeof navigator === "undefined" || navigator.clipboard === undefined) {
|
|
186
|
-
return;
|
|
187
|
-
}
|
|
188
|
-
void navigator.clipboard.writeText(props.secret).then(
|
|
189
|
-
() => setCopied(true),
|
|
190
|
-
() => setCopied(false),
|
|
191
|
-
);
|
|
192
|
-
};
|
|
193
183
|
return (
|
|
194
184
|
<Callout
|
|
195
185
|
tone="warning"
|
|
@@ -203,9 +193,7 @@ export function NewToken(props: NewTokenProps) {
|
|
|
203
193
|
<p>{fresh.copyNow}</p>
|
|
204
194
|
<p className="sc-secret">
|
|
205
195
|
<code className="sc-secret-value">{props.secret}</code>
|
|
206
|
-
<
|
|
207
|
-
{copied ? fresh.copied : fresh.copy}
|
|
208
|
-
</Button>
|
|
196
|
+
<CopyButton text={props.secret} size="sm" />
|
|
209
197
|
</p>
|
|
210
198
|
<p>
|
|
211
199
|
{fresh.useIt}{" "}
|
package/src/components/ui.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ButtonHTMLAttributes, type ReactNode, useState } from "react";
|
|
2
2
|
import {
|
|
3
3
|
type CategoryColor,
|
|
4
4
|
type GoalState,
|
|
@@ -87,7 +87,10 @@ export function personName(person: {
|
|
|
87
87
|
* A person's picture as the git host serves it: loaded lazily, without a referrer, and gone as
|
|
88
88
|
* a whole when there is none or it cannot be loaded, leaving the initial of the name instead.
|
|
89
89
|
*/
|
|
90
|
-
export function Avatar(props: {
|
|
90
|
+
export function Avatar(props: {
|
|
91
|
+
readonly person: RestPerson;
|
|
92
|
+
readonly size?: "xs" | "sm" | "md" | "lg";
|
|
93
|
+
}) {
|
|
91
94
|
const size = props.size ?? "md";
|
|
92
95
|
const initial = personName(props.person).slice(0, 1).toUpperCase();
|
|
93
96
|
if (props.person.avatar === null) {
|
|
@@ -112,6 +115,26 @@ export function Avatar(props: { readonly person: RestPerson; readonly size?: "sm
|
|
|
112
115
|
);
|
|
113
116
|
}
|
|
114
117
|
|
|
118
|
+
/** Puts a text on the clipboard, where the browser offers one, and says so once it is there. */
|
|
119
|
+
export function CopyButton(props: { readonly text: string; readonly size?: "md" | "sm" }) {
|
|
120
|
+
const words = useWords().common;
|
|
121
|
+
const [copied, setCopied] = useState(false);
|
|
122
|
+
const copy = () => {
|
|
123
|
+
if (typeof navigator === "undefined" || navigator.clipboard === undefined) {
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
void navigator.clipboard.writeText(props.text).then(
|
|
127
|
+
() => setCopied(true),
|
|
128
|
+
() => setCopied(false),
|
|
129
|
+
);
|
|
130
|
+
};
|
|
131
|
+
return (
|
|
132
|
+
<Button size={props.size ?? "md"} onClick={copy}>
|
|
133
|
+
{copied ? words.copied : words.copy}
|
|
134
|
+
</Button>
|
|
135
|
+
);
|
|
136
|
+
}
|
|
137
|
+
|
|
115
138
|
/** A person, as a picture and their name, wherever one is named; the login is there on hover. */
|
|
116
139
|
export function PersonChip(props: { readonly person: RestPerson; readonly size?: "sm" | "md" }) {
|
|
117
140
|
return (
|
package/src/components/work.tsx
CHANGED
|
@@ -1,20 +1,30 @@
|
|
|
1
1
|
import type { RestTask, RestWork } from "../api.js";
|
|
2
2
|
import { addDays, today as todayOf } from "../dates.js";
|
|
3
3
|
import { useWords } from "../i18n/index.js";
|
|
4
|
+
import { Week } from "./calendar.js";
|
|
4
5
|
import { ProjectMark } from "./projects.js";
|
|
5
6
|
import { TaskList } from "./task-list.js";
|
|
6
7
|
import { PersonChip, Time } from "./ui.js";
|
|
7
8
|
|
|
8
|
-
// What is on a person's plate (ADR-0019), across the projects they may see: the
|
|
9
|
-
// assigned to them
|
|
10
|
-
// data as props and nothing from
|
|
9
|
+
// What is on a person's plate (ADR-0019), across the projects they may see: the week at the
|
|
10
|
+
// top, with the open tasks assigned to them on its days; below, the same tasks by when they
|
|
11
|
+
// are due, and the decisions that wait for a person. Takes its data as props and nothing from
|
|
12
|
+
// the network; the week shown is the address's (ADR-0010).
|
|
11
13
|
|
|
12
14
|
export interface WorkListProps {
|
|
13
|
-
|
|
15
|
+
/** The tasks on the plate; and the decisions waiting on the person's own plate, left out on another's. */
|
|
16
|
+
readonly work: {
|
|
17
|
+
readonly tasks: RestWork["tasks"];
|
|
18
|
+
readonly decisions?: RestWork["decisions"] | undefined;
|
|
19
|
+
};
|
|
14
20
|
/** The day to count from; the browser's today when left out. */
|
|
15
21
|
readonly today?: string | undefined;
|
|
22
|
+
/** A day of the week shown at the top; today's week when left out. */
|
|
23
|
+
readonly week?: string | undefined;
|
|
16
24
|
readonly taskHref: (projectKey: string, task: RestTask) => string;
|
|
17
25
|
readonly decisionHref: (projectKey: string, decisionId: string) => string;
|
|
26
|
+
/** Where the page is with the week of a day at the top. */
|
|
27
|
+
readonly weekHref: (day: string) => string;
|
|
18
28
|
}
|
|
19
29
|
|
|
20
30
|
export function WorkList(props: WorkListProps) {
|
|
@@ -25,6 +35,10 @@ export function WorkList(props: WorkListProps) {
|
|
|
25
35
|
const { tasks, decisions } = props.work;
|
|
26
36
|
const projectOf = new Map(tasks.map((item) => [item.task.id, item.project]));
|
|
27
37
|
const hrefOf = (task: RestTask) => props.taskHref(projectOf.get(task.id)?.key ?? "", task);
|
|
38
|
+
const markOf = (task: RestTask) => {
|
|
39
|
+
const project = projectOf.get(task.id);
|
|
40
|
+
return project === undefined ? undefined : <ProjectMark project={project} size="sm" />;
|
|
41
|
+
};
|
|
28
42
|
const nameOf = (task: RestTask) => {
|
|
29
43
|
const project = projectOf.get(task.id);
|
|
30
44
|
return project === undefined ? undefined : (
|
|
@@ -45,49 +59,61 @@ export function WorkList(props: WorkListProps) {
|
|
|
45
59
|
}
|
|
46
60
|
return (
|
|
47
61
|
<div className="sc-work">
|
|
48
|
-
|
|
49
|
-
.
|
|
50
|
-
.
|
|
51
|
-
|
|
62
|
+
<Week
|
|
63
|
+
tasks={tasks.map((item) => item.task)}
|
|
64
|
+
day={props.week}
|
|
65
|
+
today={now}
|
|
66
|
+
taskHref={hrefOf}
|
|
67
|
+
weekHref={props.weekHref}
|
|
68
|
+
markOf={markOf}
|
|
69
|
+
/>
|
|
70
|
+
<div className="sc-work-lists">
|
|
71
|
+
{groups
|
|
72
|
+
.filter((group) => group.tasks.length > 0)
|
|
73
|
+
.map((group) => (
|
|
74
|
+
<section key={group.title} className="sc-task-section" aria-label={group.title}>
|
|
75
|
+
<h2 className="sc-section-title">
|
|
76
|
+
{group.title} <span className="sc-column-count">{group.tasks.length}</span>
|
|
77
|
+
</h2>
|
|
78
|
+
<TaskList
|
|
79
|
+
tasks={group.tasks}
|
|
80
|
+
taskHref={hrefOf}
|
|
81
|
+
projectOf={nameOf}
|
|
82
|
+
showState
|
|
83
|
+
today={now}
|
|
84
|
+
/>
|
|
85
|
+
</section>
|
|
86
|
+
))}
|
|
87
|
+
{decisions !== undefined && (
|
|
88
|
+
<section className="sc-task-section" aria-label={work.decisions}>
|
|
52
89
|
<h2 className="sc-section-title">
|
|
53
|
-
{
|
|
90
|
+
{work.decisions} <span className="sc-column-count">{decisions.length}</span>
|
|
54
91
|
</h2>
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
92
|
+
{decisions.length === 0 ? (
|
|
93
|
+
<p className="sc-muted">{work.noDecisions}</p>
|
|
94
|
+
) : (
|
|
95
|
+
<ol className="sc-decision-log">
|
|
96
|
+
{decisions.map(({ project, decision }) => (
|
|
97
|
+
<li key={decision.id} className="sc-decision-row">
|
|
98
|
+
<a
|
|
99
|
+
className="sc-decision-row-question"
|
|
100
|
+
href={props.decisionHref(project.key, decision.id)}
|
|
101
|
+
>
|
|
102
|
+
{decision.question}
|
|
103
|
+
</a>
|
|
104
|
+
<span className="sc-task-row-project">
|
|
105
|
+
<ProjectMark project={project} size="sm" /> {work.inProject(project.name)}
|
|
106
|
+
</span>
|
|
107
|
+
<span className="sc-decision-row-meta">
|
|
108
|
+
<PersonChip person={decision.raisedBy} /> <Time iso={decision.createdAt} />
|
|
109
|
+
</span>
|
|
110
|
+
</li>
|
|
111
|
+
))}
|
|
112
|
+
</ol>
|
|
113
|
+
)}
|
|
62
114
|
</section>
|
|
63
|
-
))}
|
|
64
|
-
<section className="sc-task-section" aria-label={work.decisions}>
|
|
65
|
-
<h2 className="sc-section-title">
|
|
66
|
-
{work.decisions} <span className="sc-column-count">{decisions.length}</span>
|
|
67
|
-
</h2>
|
|
68
|
-
{decisions.length === 0 ? (
|
|
69
|
-
<p className="sc-muted">{work.noDecisions}</p>
|
|
70
|
-
) : (
|
|
71
|
-
<ol className="sc-decision-log">
|
|
72
|
-
{decisions.map(({ project, decision }) => (
|
|
73
|
-
<li key={decision.id} className="sc-decision-row">
|
|
74
|
-
<a
|
|
75
|
-
className="sc-decision-row-question"
|
|
76
|
-
href={props.decisionHref(project.key, decision.id)}
|
|
77
|
-
>
|
|
78
|
-
{decision.question}
|
|
79
|
-
</a>
|
|
80
|
-
<span className="sc-task-row-project">
|
|
81
|
-
<ProjectMark project={project} size="sm" /> {work.inProject(project.name)}
|
|
82
|
-
</span>
|
|
83
|
-
<span className="sc-decision-row-meta">
|
|
84
|
-
<PersonChip person={decision.raisedBy} /> <Time iso={decision.createdAt} />
|
|
85
|
-
</span>
|
|
86
|
-
</li>
|
|
87
|
-
))}
|
|
88
|
-
</ol>
|
|
89
115
|
)}
|
|
90
|
-
</
|
|
116
|
+
</div>
|
|
91
117
|
</div>
|
|
92
118
|
);
|
|
93
119
|
}
|
package/src/connect-page.tsx
CHANGED
|
@@ -70,7 +70,6 @@ export function ConnectPage(props: ConnectPageProps) {
|
|
|
70
70
|
);
|
|
71
71
|
const ask = (
|
|
72
72
|
<>
|
|
73
|
-
<p className="sc-lead">{words.lead}</p>
|
|
74
73
|
<section className="sc-panel" aria-label={words.aria}>
|
|
75
74
|
<ConnectCodeForm busy={busy} onSubmit={(typed) => navigation.go(connectHref(typed))} />
|
|
76
75
|
</section>
|