@skillcdn/console 0.6.0 → 0.6.2
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 +7 -7
- package/dist/agent-page.d.ts.map +1 -1
- package/dist/agent-page.js +58 -35
- package/dist/agent-page.js.map +1 -1
- package/dist/agent-usage.d.ts +51 -0
- package/dist/agent-usage.d.ts.map +1 -0
- package/dist/agent-usage.js +77 -0
- package/dist/agent-usage.js.map +1 -0
- package/dist/api.d.ts +4 -2
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +4 -2
- package/dist/api.js.map +1 -1
- package/dist/cli/cli.d.ts +9 -2
- package/dist/cli/cli.d.ts.map +1 -1
- package/dist/cli/cli.js +491 -125
- package/dist/cli/cli.js.map +1 -1
- package/dist/cli/format.d.ts +46 -4
- package/dist/cli/format.d.ts.map +1 -1
- package/dist/cli/format.js +163 -45
- package/dist/cli/format.js.map +1 -1
- package/dist/cli/help.d.ts.map +1 -1
- package/dist/cli/help.js +62 -13
- package/dist/cli/help.js.map +1 -1
- package/dist/cli/machine-check.d.ts +24 -5
- package/dist/cli/machine-check.d.ts.map +1 -1
- package/dist/cli/machine-check.js +128 -16
- package/dist/cli/machine-check.js.map +1 -1
- package/dist/cli/pack.d.ts +11 -8
- package/dist/cli/pack.d.ts.map +1 -1
- package/dist/cli/pack.js +63 -28
- package/dist/cli/pack.js.map +1 -1
- package/dist/cli/runner-host.d.ts +2 -0
- package/dist/cli/runner-host.d.ts.map +1 -1
- package/dist/cli/runner-host.js +1 -0
- package/dist/cli/runner-host.js.map +1 -1
- package/dist/cli/secret-notes.d.ts.map +1 -1
- package/dist/cli/secret-notes.js +9 -1
- package/dist/cli/secret-notes.js.map +1 -1
- package/dist/cli/terminal.d.ts +10 -2
- package/dist/cli/terminal.d.ts.map +1 -1
- package/dist/cli/terminal.js +16 -4
- package/dist/cli/terminal.js.map +1 -1
- package/dist/client.d.ts +30 -7
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +13 -1
- package/dist/client.js.map +1 -1
- package/dist/components/agent-page.d.ts +76 -18
- package/dist/components/agent-page.d.ts.map +1 -1
- package/dist/components/agent-page.js +183 -53
- package/dist/components/agent-page.js.map +1 -1
- package/dist/components/agents.d.ts +2 -0
- package/dist/components/agents.d.ts.map +1 -1
- package/dist/components/agents.js +6 -5
- package/dist/components/agents.js.map +1 -1
- package/dist/components/calendar.d.ts +24 -4
- package/dist/components/calendar.d.ts.map +1 -1
- package/dist/components/calendar.js +79 -36
- package/dist/components/calendar.js.map +1 -1
- package/dist/components/categories.js +2 -2
- package/dist/components/categories.js.map +1 -1
- package/dist/components/comments.js +2 -2
- package/dist/components/comments.js.map +1 -1
- package/dist/components/decision-list.d.ts.map +1 -1
- package/dist/components/decision-list.js +5 -5
- package/dist/components/decision-list.js.map +1 -1
- package/dist/components/documents.d.ts.map +1 -1
- package/dist/components/documents.js +4 -4
- package/dist/components/documents.js.map +1 -1
- package/dist/components/event-feed.d.ts +2 -3
- package/dist/components/event-feed.d.ts.map +1 -1
- package/dist/components/event-feed.js +4 -184
- package/dist/components/event-feed.js.map +1 -1
- package/dist/components/goals.d.ts.map +1 -1
- package/dist/components/goals.js +3 -3
- package/dist/components/goals.js.map +1 -1
- package/dist/components/home.js +9 -9
- package/dist/components/home.js.map +1 -1
- package/dist/components/icon.d.ts.map +1 -1
- package/dist/components/icon.js +11 -2
- package/dist/components/icon.js.map +1 -1
- package/dist/components/notifications.d.ts +65 -0
- package/dist/components/notifications.d.ts.map +1 -0
- package/dist/components/notifications.js +162 -0
- package/dist/components/notifications.js.map +1 -0
- package/dist/components/pack-connect.js +1 -1
- package/dist/components/pack-connect.js.map +1 -1
- package/dist/components/pack-token.js +1 -1
- package/dist/components/pack-token.js.map +1 -1
- package/dist/components/people.js +2 -2
- package/dist/components/people.js.map +1 -1
- package/dist/components/pictures.js +1 -1
- package/dist/components/pictures.js.map +1 -1
- package/dist/components/plugin-settings.d.ts +22 -1
- package/dist/components/plugin-settings.d.ts.map +1 -1
- package/dist/components/plugin-settings.js +63 -11
- package/dist/components/plugin-settings.js.map +1 -1
- package/dist/components/projects.js +1 -1
- package/dist/components/projects.js.map +1 -1
- package/dist/components/roadmap.js +2 -2
- package/dist/components/roadmap.js.map +1 -1
- package/dist/components/rules.js +2 -2
- package/dist/components/rules.js.map +1 -1
- package/dist/components/runs.d.ts.map +1 -1
- package/dist/components/runs.js +1 -1
- package/dist/components/runs.js.map +1 -1
- package/dist/components/sessions.js +1 -1
- package/dist/components/sessions.js.map +1 -1
- package/dist/components/shell.d.ts +2 -0
- package/dist/components/shell.d.ts.map +1 -1
- package/dist/components/shell.js +1 -1
- package/dist/components/shell.js.map +1 -1
- package/dist/components/sign-in.js +2 -2
- package/dist/components/sign-in.js.map +1 -1
- package/dist/components/skills.d.ts.map +1 -1
- package/dist/components/skills.js +1 -1
- package/dist/components/skills.js.map +1 -1
- package/dist/components/task-view.d.ts +6 -0
- package/dist/components/task-view.d.ts.map +1 -1
- package/dist/components/task-view.js +3 -2
- package/dist/components/task-view.js.map +1 -1
- package/dist/components/tokens.js +1 -1
- package/dist/components/tokens.js.map +1 -1
- package/dist/components/ui.d.ts +21 -2
- package/dist/components/ui.d.ts.map +1 -1
- package/dist/components/ui.js +24 -3
- package/dist/components/ui.js.map +1 -1
- package/dist/components/work.js +1 -1
- package/dist/components/work.js.map +1 -1
- package/dist/console.css +506 -289
- package/dist/console.d.ts.map +1 -1
- package/dist/console.js +193 -16
- package/dist/console.js.map +1 -1
- package/dist/data.d.ts +17 -1
- package/dist/data.d.ts.map +1 -1
- package/dist/data.js +31 -0
- package/dist/data.js.map +1 -1
- package/dist/desk-page.js +5 -5
- package/dist/desk-page.js.map +1 -1
- package/dist/feed-words.d.ts +5 -0
- package/dist/feed-words.d.ts.map +1 -0
- package/dist/feed-words.js +193 -0
- package/dist/feed-words.js.map +1 -0
- package/dist/i18n/en.d.ts +93 -1
- package/dist/i18n/en.d.ts.map +1 -1
- package/dist/i18n/en.js +103 -15
- package/dist/i18n/en.js.map +1 -1
- package/dist/i18n/ko.d.ts.map +1 -1
- package/dist/i18n/ko.js +105 -22
- package/dist/i18n/ko.js.map +1 -1
- package/dist/icons/glyphs.d.ts +370 -104
- package/dist/icons/glyphs.d.ts.map +1 -1
- package/dist/icons/glyphs.js +72 -66
- package/dist/icons/glyphs.js.map +1 -1
- package/dist/icons/index.d.ts.map +1 -1
- package/dist/icons/index.js +9 -1
- package/dist/icons/index.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 +7 -0
- package/dist/limits.d.ts.map +1 -1
- package/dist/limits.js +7 -0
- package/dist/limits.js.map +1 -1
- package/dist/notifications.d.ts +124 -0
- package/dist/notifications.d.ts.map +1 -0
- package/dist/notifications.js +147 -0
- package/dist/notifications.js.map +1 -0
- package/dist/onboarding.d.ts.map +1 -1
- package/dist/onboarding.js +7 -12
- package/dist/onboarding.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 +85 -1
- package/dist/plugin/context.d.ts.map +1 -1
- package/dist/plugin/limits.d.ts +7 -0
- package/dist/plugin/limits.d.ts.map +1 -1
- package/dist/plugin/limits.js +7 -0
- package/dist/plugin/limits.js.map +1 -1
- package/dist/plugin/manifest.d.ts +8 -0
- package/dist/plugin/manifest.d.ts.map +1 -1
- package/dist/plugin/manifest.js +13 -0
- package/dist/plugin/manifest.js.map +1 -1
- package/dist/plugin/rest-schemas.d.ts +22 -0
- package/dist/plugin/rest-schemas.d.ts.map +1 -1
- package/dist/plugin/rest-schemas.js +19 -3
- package/dist/plugin/rest-schemas.js.map +1 -1
- package/dist/plugin/testing.d.ts +2 -0
- package/dist/plugin/testing.d.ts.map +1 -1
- package/dist/plugin/testing.js +2 -0
- package/dist/plugin/testing.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 +6 -0
- package/dist/router.d.ts.map +1 -1
- package/dist/router.js +5 -0
- package/dist/router.js.map +1 -1
- package/dist/routes.d.ts +2 -0
- package/dist/routes.d.ts.map +1 -1
- package/dist/routes.js +2 -0
- package/dist/routes.js.map +1 -1
- package/dist/rules.js +1 -1
- package/dist/rules.js.map +1 -1
- package/dist/runner/acp.d.ts.map +1 -1
- package/dist/runner/acp.js +12 -97
- package/dist/runner/acp.js.map +1 -1
- package/dist/runner/browser.d.ts +50 -0
- package/dist/runner/browser.d.ts.map +1 -0
- package/dist/runner/browser.js +104 -0
- package/dist/runner/browser.js.map +1 -0
- package/dist/runner/claude.d.ts +1 -2
- package/dist/runner/claude.d.ts.map +1 -1
- package/dist/runner/claude.js +352 -13
- package/dist/runner/claude.js.map +1 -1
- package/dist/runner/codex.d.ts +9 -10
- package/dist/runner/codex.d.ts.map +1 -1
- package/dist/runner/codex.js +809 -346
- package/dist/runner/codex.js.map +1 -1
- package/dist/runner/config.d.ts +14 -3
- package/dist/runner/config.d.ts.map +1 -1
- package/dist/runner/config.js +27 -7
- package/dist/runner/config.js.map +1 -1
- package/dist/runner/desk.d.ts +3 -1
- package/dist/runner/desk.d.ts.map +1 -1
- package/dist/runner/desk.js +17 -5
- package/dist/runner/desk.js.map +1 -1
- package/dist/runner/message.d.ts +53 -3
- package/dist/runner/message.d.ts.map +1 -1
- package/dist/runner/message.js +201 -20
- package/dist/runner/message.js.map +1 -1
- package/dist/runner/registry.d.ts +6 -0
- package/dist/runner/registry.d.ts.map +1 -1
- package/dist/runner/registry.js.map +1 -1
- package/dist/runner/rpc.d.ts +31 -0
- package/dist/runner/rpc.d.ts.map +1 -0
- package/dist/runner/rpc.js +102 -0
- package/dist/runner/rpc.js.map +1 -0
- package/dist/runner/runner.d.ts +41 -1
- package/dist/runner/runner.d.ts.map +1 -1
- package/dist/runner/runner.js +695 -52
- package/dist/runner/runner.js.map +1 -1
- package/dist/runner/slack.d.ts +17 -8
- package/dist/runner/slack.d.ts.map +1 -1
- package/dist/runner/slack.js +1250 -78
- package/dist/runner/slack.js.map +1 -1
- package/dist/runner/types.d.ts +160 -8
- package/dist/runner/types.d.ts.map +1 -1
- package/dist/runner/types.js.map +1 -1
- package/dist/runner/usage.d.ts +105 -0
- package/dist/runner/usage.d.ts.map +1 -0
- package/dist/runner/usage.js +218 -0
- package/dist/runner/usage.js.map +1 -0
- package/dist/runner.d.ts +4 -4
- package/dist/runner.d.ts.map +1 -1
- package/dist/runner.js +3 -3
- package/dist/runner.js.map +1 -1
- package/dist/schemas.d.ts +673 -0
- package/dist/schemas.d.ts.map +1 -1
- package/dist/schemas.js +205 -1
- package/dist/schemas.js.map +1 -1
- package/dist/services.js +3 -3
- package/dist/services.js.map +1 -1
- package/dist/setup-guide.d.ts +4 -3
- package/dist/setup-guide.d.ts.map +1 -1
- package/dist/setup-guide.js +11 -13
- package/dist/setup-guide.js.map +1 -1
- package/dist/text.d.ts +7 -0
- package/dist/text.d.ts.map +1 -1
- package/dist/text.js +18 -0
- package/dist/text.js.map +1 -1
- package/dist/vocabulary.d.ts +4 -2
- package/dist/vocabulary.d.ts.map +1 -1
- package/dist/vocabulary.js +4 -1
- package/dist/vocabulary.js.map +1 -1
- package/docs/specs/cli.md +26 -19
- package/docs/specs/plugins.md +16 -10
- package/docs/specs/rest.md +28 -10
- package/docs/specs/runner.md +132 -44
- package/package.json +4 -4
- package/skills/building-a-console/SKILL.md +2 -2
- package/skills/building-a-console/references/configuring.md +1 -1
- package/skills/building-a-plugin/SKILL.md +4 -4
- package/skills/planning-the-board/SKILL.md +1 -1
- package/skills/planning-the-board/references/setting-up.md +2 -2
- package/skills/running-an-agent/SKILL.md +15 -64
- package/skills/running-an-agent/references/preparing-the-machine.md +17 -0
- package/skills/running-an-agent/references/several-tasks.md +37 -0
- package/skills/running-an-agent/references/slack-app.md +70 -13
- package/skills/running-an-agent/references/the-account-and-the-invitation.md +5 -0
- package/skills/running-an-agent/references/what-was-not-seen-run-yet.md +3 -0
- package/skills/running-an-agent/references/when-the-agent-could-not-go-on.md +16 -0
- package/skills/running-an-agent/references/your-first-task.md +14 -0
- package/skills/working-the-board/SKILL.md +9 -12
- package/skills/working-the-board/references/a-pack-skills-questions.md +3 -0
- package/skills/working-the-board/references/a-plugins-commands.md +3 -0
- package/skills/working-the-board/references/a-review.md +3 -0
- package/skills/working-the-board/references/an-open-run.md +3 -0
- package/skills/working-the-board/references/requirements.md +7 -0
- package/skills/working-the-board/references/the-pack.md +2 -2
- package/skills/working-the-board/references/what-they-were-told.md +3 -0
- package/skills/working-the-board/references/work-given-in-chat.md +5 -0
- package/src/agent-page.tsx +76 -47
- package/src/agent-usage.ts +113 -0
- package/src/api.ts +62 -0
- package/src/cli/cli.ts +634 -162
- package/src/cli/format.ts +190 -47
- package/src/cli/help.ts +77 -12
- package/src/cli/machine-check.ts +182 -29
- package/src/cli/pack.ts +81 -40
- package/src/cli/runner-host.ts +3 -0
- package/src/cli/secret-notes.ts +9 -1
- package/src/cli/terminal.ts +20 -4
- package/src/client.ts +94 -6
- package/src/components/agent-page.tsx +280 -63
- package/src/components/agents.tsx +23 -3
- package/src/components/calendar.tsx +93 -37
- package/src/components/categories.tsx +2 -2
- package/src/components/comments.tsx +5 -5
- package/src/components/decision-list.tsx +13 -10
- package/src/components/documents.tsx +13 -8
- package/src/components/event-feed.tsx +4 -203
- package/src/components/goals.tsx +6 -4
- package/src/components/home.tsx +12 -12
- package/src/components/icon.tsx +16 -3
- package/src/components/notifications.tsx +419 -0
- package/src/components/pack-connect.tsx +1 -1
- package/src/components/pack-token.tsx +5 -5
- package/src/components/people.tsx +3 -3
- package/src/components/pictures.tsx +1 -1
- package/src/components/plugin-settings.tsx +128 -23
- package/src/components/projects.tsx +1 -1
- package/src/components/roadmap.tsx +2 -2
- package/src/components/rules.tsx +2 -2
- package/src/components/runs.tsx +6 -3
- package/src/components/sessions.tsx +2 -2
- package/src/components/shell.tsx +3 -0
- package/src/components/sign-in.tsx +3 -3
- package/src/components/skills.tsx +5 -3
- package/src/components/task-view.tsx +18 -7
- package/src/components/tokens.tsx +2 -2
- package/src/components/ui.tsx +70 -5
- package/src/components/work.tsx +2 -2
- package/src/console.tsx +269 -12
- package/src/data.ts +54 -0
- package/src/desk-page.tsx +5 -5
- package/src/feed-words.ts +214 -0
- package/src/i18n/en.ts +114 -15
- package/src/i18n/ko.ts +115 -22
- package/src/icons/glyphs.ts +74 -68
- package/src/icons/index.ts +9 -1
- package/src/index.ts +11 -0
- package/src/limits.ts +7 -0
- package/src/notifications.ts +205 -0
- package/src/onboarding.ts +10 -14
- package/src/plugin/capabilities.ts +13 -0
- package/src/plugin/context.ts +87 -0
- package/src/plugin/limits.ts +7 -0
- package/src/plugin/manifest.ts +14 -0
- package/src/plugin/rest-schemas.ts +27 -3
- package/src/plugin/testing.ts +4 -0
- package/src/plugin.ts +2 -0
- package/src/router.ts +7 -0
- package/src/routes.ts +2 -0
- package/src/rules.ts +1 -1
- package/src/runner/acp.ts +12 -118
- package/src/runner/browser.ts +128 -0
- package/src/runner/claude.ts +399 -12
- package/src/runner/codex.ts +904 -400
- package/src/runner/config.ts +30 -7
- package/src/runner/desk.ts +22 -6
- package/src/runner/message.ts +251 -21
- package/src/runner/registry.ts +6 -0
- package/src/runner/rpc.ts +140 -0
- package/src/runner/runner.ts +863 -53
- package/src/runner/slack.ts +1535 -85
- package/src/runner/types.ts +150 -5
- package/src/runner/usage.ts +299 -0
- package/src/runner.ts +16 -1
- package/src/schemas.ts +249 -0
- package/src/services.ts +3 -3
- package/src/setup-guide.ts +12 -14
- package/src/styles/README.md +11 -7
- package/src/styles/console.css +2 -0
- package/src/styles/drawn-by-pages.json +7 -82
- package/src/styles/pages/agents.css +46 -35
- package/src/styles/pages/calendar.css +0 -1
- package/src/styles/pages/connect.css +0 -14
- package/src/styles/pages/decisions.css +2 -43
- package/src/styles/pages/documents.css +0 -29
- package/src/styles/pages/home.css +4 -16
- package/src/styles/pages/people.css +2 -17
- package/src/styles/pages/plugins.css +9 -12
- package/src/styles/pages/roadmap.css +0 -16
- package/src/styles/pages/settings.css +0 -28
- package/src/styles/pages/sign-in.css +2 -17
- package/src/styles/pages/thread.css +4 -50
- package/src/styles/pages/work.css +0 -5
- package/src/styles/parts/button.css +31 -0
- package/src/styles/parts/count.css +10 -0
- package/src/styles/parts/divider.css +17 -0
- package/src/styles/parts/frame.css +12 -0
- package/src/styles/parts/icon.css +39 -0
- package/src/styles/parts/menu.css +184 -0
- package/src/styles/parts/panel.css +7 -0
- package/src/styles/parts/progress.css +63 -0
- package/src/styles/parts/settings.css +2 -0
- package/src/styles/parts/sheet.css +28 -0
- package/src/styles/parts/text.css +34 -0
- package/src/text.ts +19 -0
- package/src/vocabulary.ts +4 -1
- package/template/plugin/package.json +1 -1
package/src/cli/format.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { createHash } from "node:crypto";
|
|
2
|
+
import { usageNear, usageSaidTogether, usageStanding, usedHundredths } from "../agent-usage.js";
|
|
3
|
+
import { describeEvent } from "../feed-words.js";
|
|
4
|
+
import { NOTIFICATION_KINDS, type NotificationKind } from "../notifications.js";
|
|
2
5
|
import { argUsage } from "../plugin/args.js";
|
|
3
6
|
import type {
|
|
4
7
|
RestAgent,
|
|
@@ -16,6 +19,9 @@ import type {
|
|
|
16
19
|
RestGoal,
|
|
17
20
|
RestListing,
|
|
18
21
|
RestMember,
|
|
22
|
+
RestNotification,
|
|
23
|
+
RestNotificationSettings,
|
|
24
|
+
RestNotifications,
|
|
19
25
|
RestOwnWake,
|
|
20
26
|
RestPerson,
|
|
21
27
|
RestPersonWork,
|
|
@@ -41,6 +47,7 @@ import type {
|
|
|
41
47
|
RestSignal,
|
|
42
48
|
RestTask,
|
|
43
49
|
RestTaskBrief,
|
|
50
|
+
RestTaskFollow,
|
|
44
51
|
RestTeam,
|
|
45
52
|
RestVersion,
|
|
46
53
|
RestVersionSummary,
|
|
@@ -190,11 +197,12 @@ const OWN_CHOICE = "the product's own";
|
|
|
190
197
|
* One agent account in full: its line, how it stands, what its runner last said of itself and
|
|
191
198
|
* what was chosen for it, where the asker is answered that, and whether they supervise it.
|
|
192
199
|
*/
|
|
193
|
-
export function formatAgent(agent: RestAgent): string {
|
|
200
|
+
export function formatAgent(agent: RestAgent, now: number): string {
|
|
194
201
|
const runner = agent.runner ?? null;
|
|
195
202
|
return [
|
|
196
203
|
formatAgentLine(agent),
|
|
197
204
|
`state: ${formatAgentState(agent)}`,
|
|
205
|
+
...formatAgentUsage(agent.usage, now),
|
|
198
206
|
...(runner === null
|
|
199
207
|
? []
|
|
200
208
|
: [
|
|
@@ -239,6 +247,32 @@ export function formatAgent(agent: RestAgent): string {
|
|
|
239
247
|
].join("\n");
|
|
240
248
|
}
|
|
241
249
|
|
|
250
|
+
/**
|
|
251
|
+
* What an agent account's product last said of what its subscription allows (ADR-0156), a line:
|
|
252
|
+
* each window that still stands with how much of it is used and when it resets, then when the
|
|
253
|
+
* product said so. Nothing where it has said none.
|
|
254
|
+
*/
|
|
255
|
+
export function formatAgentUsage(usage: RestAgent["usage"], now: number): string[] {
|
|
256
|
+
const standing = usageStanding(usage, now);
|
|
257
|
+
if (standing.length === 0) {
|
|
258
|
+
return [];
|
|
259
|
+
}
|
|
260
|
+
// When they were said: once where the product said them together, beside each where not.
|
|
261
|
+
const together = usageSaidTogether(standing);
|
|
262
|
+
const windows = standing.map((window) => {
|
|
263
|
+
const share =
|
|
264
|
+
window.used === null
|
|
265
|
+
? usageNear(window)
|
|
266
|
+
? "near its limit"
|
|
267
|
+
: "of a share its product did not say"
|
|
268
|
+
: `${usedHundredths(window.used)}% used${window.used < 1 && usageNear(window) ? ", near its limit" : ""}`;
|
|
269
|
+
return `${window.name} ${share}${window.resetsAt === null ? "" : `, resets ${moment(window.resetsAt)}`}${together === undefined ? `, said ${moment(window.at)}` : ""}`;
|
|
270
|
+
});
|
|
271
|
+
return [
|
|
272
|
+
`usage: ${windows.join("; ")}${together === undefined ? "" : ` (as its product said ${moment(together)})`}`,
|
|
273
|
+
];
|
|
274
|
+
}
|
|
275
|
+
|
|
242
276
|
/** A wake source as its runner last said it stands (ADR-0144): listening and since when, or not, and why. */
|
|
243
277
|
export function formatWakeSource(source: NonNullable<RestAgentRunner["sources"]>[number]): string {
|
|
244
278
|
const why = source.why === undefined ? "" : ` (${source.why})`;
|
|
@@ -255,16 +289,22 @@ export function formatOwnWakeLine(wake: RestOwnWake): string {
|
|
|
255
289
|
return `to come ${wake.key} ${moment(wake.at)}${said}`;
|
|
256
290
|
}
|
|
257
291
|
|
|
258
|
-
/**
|
|
292
|
+
/**
|
|
293
|
+
* How an agent account stands (ADR-0085), in a few words: the state, why, since when, until when
|
|
294
|
+
* where its runner said, as when a usage limit resets (ADR-0150), and when its runner was last
|
|
295
|
+
* heard from.
|
|
296
|
+
*/
|
|
259
297
|
export function formatAgentState(agent: RestAgent): string {
|
|
260
298
|
const state = agent.state ?? null;
|
|
261
299
|
if (state === null) {
|
|
262
300
|
return "no runner has been heard from yet";
|
|
263
301
|
}
|
|
264
302
|
const reason = state.reason === null ? "" : ` (${state.reason.replaceAll("_", " ")})`;
|
|
303
|
+
const until =
|
|
304
|
+
state.until === undefined || state.until === null ? "" : `, until ${moment(state.until)}`;
|
|
265
305
|
const heard =
|
|
266
306
|
state.heardAt === null ? "" : `; its runner was last heard from ${moment(state.heardAt)}`;
|
|
267
|
-
return `${state.state}${reason} since ${moment(state.since)}${heard}`;
|
|
307
|
+
return `${state.state}${reason} since ${moment(state.since)}${until}${heard}`;
|
|
268
308
|
}
|
|
269
309
|
|
|
270
310
|
/**
|
|
@@ -284,8 +324,8 @@ export function formatSignalLine(signal: RestSignal, delivered?: number): string
|
|
|
284
324
|
const said =
|
|
285
325
|
words.length === 0 ? "" : ` ${words.length > 120 ? `${words.slice(0, 119)}…` : words}`;
|
|
286
326
|
// Whether it is delivered, where the record says how far it is (ADR-0131): the product took
|
|
287
|
-
// it or the record says what became of it, or it waits for that.
|
|
288
|
-
// say,
|
|
327
|
+
// it or the record says what became of it, or it waits for that. An answer that does not
|
|
328
|
+
// say, the one to a signal just sent, has nothing said here.
|
|
289
329
|
const state =
|
|
290
330
|
delivered === undefined ? "" : signal.number <= delivered ? "delivered " : "waiting ";
|
|
291
331
|
return `#${signal.number} ${signal.kind} ${state}${who} ${moment(signal.at)}${set}${said}`;
|
|
@@ -413,6 +453,8 @@ export function formatTask(
|
|
|
413
453
|
comments?: readonly RestComment[],
|
|
414
454
|
/** The address of the task's page at the console, where the command knows it: what a person is given to open. */
|
|
415
455
|
page?: string,
|
|
456
|
+
/** Whether the task tells the member anything (ADR-0157), where the command read it. */
|
|
457
|
+
follow?: RestTaskFollow | null,
|
|
416
458
|
): string {
|
|
417
459
|
const lines = [
|
|
418
460
|
`#${task.number} ${task.title}`,
|
|
@@ -420,6 +462,9 @@ export function formatTask(
|
|
|
420
462
|
`id: ${task.id}${task.parentId === null ? "" : ` part of: ${task.parentId}`}`,
|
|
421
463
|
...(page === undefined ? [] : [pageLine(page)]),
|
|
422
464
|
...(task.agent == null ? [] : [`written through: ${task.agent}`]),
|
|
465
|
+
...(follow == null
|
|
466
|
+
? []
|
|
467
|
+
: [`notifications: ${follow.on ? "on" : "off"}, ${toldOfTask(follow)}`]),
|
|
423
468
|
...scheduleLines(task),
|
|
424
469
|
];
|
|
425
470
|
if (task.links.length > 0) {
|
|
@@ -475,7 +520,7 @@ export function formatComment(comment: RestComment): string {
|
|
|
475
520
|
|
|
476
521
|
export function formatRunLine(run: RestRunBrief): string {
|
|
477
522
|
// A run of a listing comes without its reports, counted (`?brief=true`); a run read whole,
|
|
478
|
-
//
|
|
523
|
+
// with them.
|
|
479
524
|
const notes = [plural(reportCountOf(run), "report"), plural(run.artifacts.length, "artifact")];
|
|
480
525
|
if (run.waitingFor !== null) {
|
|
481
526
|
notes.push(`waiting for decision ${run.waitingFor}`);
|
|
@@ -533,20 +578,6 @@ function rulesFacts(page: RestRules["page"]): string {
|
|
|
533
578
|
const formatRulesPart = (head: string, page: RestRules["page"], body: string): string =>
|
|
534
579
|
`${head}${rulesFacts(page)}:\n\n${body.trimEnd()}`;
|
|
535
580
|
|
|
536
|
-
/**
|
|
537
|
-
* The workspace's rules as a console of before the parts answers them (ADR-0120): whole, the
|
|
538
|
-
* console's own until an administrator writes the organization's in their place, which is
|
|
539
|
-
* what holds on such a console. No command is named for writing them: this one writes what an
|
|
540
|
-
* organization adds, and refuses to on a console that would keep it as the whole.
|
|
541
|
-
*/
|
|
542
|
-
function formatRulesWhole(rules: RestRules): string {
|
|
543
|
-
const head =
|
|
544
|
-
rules.source === "reference"
|
|
545
|
-
? "Rules of the workspace: the console's own, until an administrator writes the organization's."
|
|
546
|
-
: `Rules of the workspace${rulesFacts(rules.page) || " (written)"}:`;
|
|
547
|
-
return `${head}\n\n${(rules.body ?? "").trimEnd()}`;
|
|
548
|
-
}
|
|
549
|
-
|
|
550
581
|
/**
|
|
551
582
|
* The parts of the rules as they are printed for whoever reads them (ADR-0120): what the
|
|
552
583
|
* project adds where the command works in one and it adds something, the plugins' lines in the
|
|
@@ -570,10 +601,10 @@ function rulesParts(rules: RestProjectRules | RestRules, language: string | null
|
|
|
570
601
|
? undefined
|
|
571
602
|
: formatRulesPlugins(rules.plugins, language),
|
|
572
603
|
pluginCount: count,
|
|
573
|
-
/** What the organization adds, where it adds something
|
|
574
|
-
added:
|
|
575
|
-
/** The console's rules by themselves
|
|
576
|
-
console: workspace.own,
|
|
604
|
+
/** What the organization adds, where it adds something. */
|
|
605
|
+
added: added === null ? undefined : added,
|
|
606
|
+
/** The console's rules by themselves. */
|
|
607
|
+
console: workspace.own ?? "",
|
|
577
608
|
};
|
|
578
609
|
}
|
|
579
610
|
|
|
@@ -621,14 +652,8 @@ export function formatRules(
|
|
|
621
652
|
): string {
|
|
622
653
|
const parts = rulesParts(rules, language);
|
|
623
654
|
const mark = rulesMark(rules, language);
|
|
624
|
-
|
|
625
|
-
const
|
|
626
|
-
const last = whole
|
|
627
|
-
? `the workspace's (${charactersOf(parts.workspace.body)})`
|
|
628
|
-
: `the console's (${charactersOf(parts.console ?? null)})`;
|
|
629
|
-
const lastFollows = whole
|
|
630
|
-
? `the workspace's follow (${charactersOf(parts.workspace.body)})`
|
|
631
|
-
: `the console's follow (${charactersOf(parts.console ?? null)})`;
|
|
655
|
+
const last = `the console's (${charactersOf(parts.console)})`;
|
|
656
|
+
const lastFollows = `the console's follow (${charactersOf(parts.console)})`;
|
|
632
657
|
const plugins = `${parts.pluginCount} plugin${parts.pluginCount === 1 ? "" : "s"}`;
|
|
633
658
|
const HOLDS = "the earlier holding where they differ";
|
|
634
659
|
/** The organization's part and the last, after whatever stood before them. */
|
|
@@ -638,9 +663,9 @@ export function formatRules(
|
|
|
638
663
|
: `the organization's${first ? " additions first" : ""} (${charactersOf(parts.added.body)}), then ${last}`;
|
|
639
664
|
let follows: string;
|
|
640
665
|
if (parts.own !== undefined) {
|
|
641
|
-
follows = `this project's additions first (${charactersOf(parts.own.body)})${parts.plugins === undefined ? "" : ` with its ${plugins}`}, then ${rest(false)}, ${HOLDS}${
|
|
666
|
+
follows = `this project's additions first (${charactersOf(parts.own.body)})${parts.plugins === undefined ? "" : ` with its ${plugins}`}, then ${rest(false)}, ${HOLDS}${parts.added !== undefined ? "" : "; the organization adds nothing"}.`;
|
|
642
667
|
} else {
|
|
643
|
-
const nobody = parts.added === undefined
|
|
668
|
+
const nobody = parts.added === undefined;
|
|
644
669
|
const lead = parts.named
|
|
645
670
|
? nobody
|
|
646
671
|
? "this project and the organization add nothing; "
|
|
@@ -653,9 +678,7 @@ export function formatRules(
|
|
|
653
678
|
parts.plugins !== undefined
|
|
654
679
|
? `${theirs} first, then ${parts.added === undefined ? last : `the organization's additions (${charactersOf(parts.added.body)}), then ${last}, ${HOLDS}`}`
|
|
655
680
|
: parts.added === undefined
|
|
656
|
-
?
|
|
657
|
-
? lastFollows
|
|
658
|
-
: last
|
|
681
|
+
? lastFollows
|
|
659
682
|
: `${rest(true)}, ${HOLDS}`;
|
|
660
683
|
follows = `${lead}${body}${parts.named ? "." : "; no project is named here, and a project's additions stand before them where it has some."}`;
|
|
661
684
|
}
|
|
@@ -673,9 +696,7 @@ export function formatRules(
|
|
|
673
696
|
? []
|
|
674
697
|
: ["", formatRulesPart("What this organization adds", parts.added.page, parts.added.body)]),
|
|
675
698
|
"",
|
|
676
|
-
parts.console
|
|
677
|
-
? formatRulesWhole(parts.workspace)
|
|
678
|
-
: formatRulesPart("The console's rules, which always hold", null, parts.console),
|
|
699
|
+
formatRulesPart("The console's rules, which always hold", null, parts.console),
|
|
679
700
|
].join("\n");
|
|
680
701
|
}
|
|
681
702
|
|
|
@@ -1209,14 +1230,16 @@ function pluginEventSays(event: RestEvent): string {
|
|
|
1209
1230
|
return carried === "{}" ? "" : carried.length > 300 ? `${carried.slice(0, 300)}...` : carried;
|
|
1210
1231
|
}
|
|
1211
1232
|
|
|
1233
|
+
/** Who did what an event says, as a line names them: the member, with the agent they acted as, or the console. */
|
|
1234
|
+
const eventBy = (event: RestEvent): string =>
|
|
1235
|
+
event.actor === null
|
|
1236
|
+
? "the console"
|
|
1237
|
+
: `${calledOf(event.actor)}${event.agent === null ? "" : ` as ${event.agent}`}`;
|
|
1238
|
+
|
|
1212
1239
|
/** One event of a plugin in a line: its number, when, its kind, who did it and through what, and what it says. */
|
|
1213
1240
|
export function formatPluginEventLine(event: RestEvent): string {
|
|
1214
|
-
const who =
|
|
1215
|
-
event.actor === null
|
|
1216
|
-
? "the console"
|
|
1217
|
-
: `${calledOf(event.actor)}${event.agent === null ? "" : ` as ${event.agent}`}`;
|
|
1218
1241
|
const says = pluginEventSays(event);
|
|
1219
|
-
return `#${event.id} ${moment(event.createdAt)} ${event.kind} ${
|
|
1242
|
+
return `#${event.id} ${moment(event.createdAt)} ${event.kind} ${eventBy(event)}${says === "" ? "" : ` ${says}`}`;
|
|
1220
1243
|
}
|
|
1221
1244
|
|
|
1222
1245
|
/**
|
|
@@ -1239,6 +1262,110 @@ export function formatPluginEvents(
|
|
|
1239
1262
|
return `${page.items.map(formatPluginEventLine).join("\n")}${formatMore(page.more, asked.limit, asked.offset)}`;
|
|
1240
1263
|
}
|
|
1241
1264
|
|
|
1265
|
+
/**
|
|
1266
|
+
* One notification in a line (ADR-0157): its id, which `--read` takes; whether the member read
|
|
1267
|
+
* it; when; why they are told, the kind and that they turned the task on where that is why; the
|
|
1268
|
+
* project's key where it happened in one; and what happened, who did it and then the feed's own
|
|
1269
|
+
* sentence for the event. What an event carries is what someone wrote, so the line is kept one.
|
|
1270
|
+
* A task is named in the sentence by its number; a decision is not, so its id follows, which
|
|
1271
|
+
* the commands that read and answer it take.
|
|
1272
|
+
*/
|
|
1273
|
+
export function formatNotificationLine(notification: RestNotification): string {
|
|
1274
|
+
const { event, project } = notification;
|
|
1275
|
+
const why = `${notification.kind}${notification.followed ? " (followed)" : ""}`;
|
|
1276
|
+
const happened = `${eventBy(event)} ${describeEvent(event)}`.replaceAll(/\s+/g, " ");
|
|
1277
|
+
const decision = event.decisionId === null ? "" : ` (decision ${event.decisionId})`;
|
|
1278
|
+
return `${notification.id} ${notification.readAt === null ? "unread" : "read"} ${moment(notification.createdAt)} ${why} ${project === null ? "" : `${project.key} `}${happened}${decision}`;
|
|
1279
|
+
}
|
|
1280
|
+
|
|
1281
|
+
/**
|
|
1282
|
+
* A page of one's notifications, the newest first: a line each, then how many are not read
|
|
1283
|
+
* yet, with what marks them read where some are, and how the next page is asked for.
|
|
1284
|
+
*/
|
|
1285
|
+
export function formatNotifications(
|
|
1286
|
+
page: RestNotifications,
|
|
1287
|
+
asked: { readonly unread: boolean; readonly limit: number; readonly offset: number },
|
|
1288
|
+
): string {
|
|
1289
|
+
const more = formatMore(page.more, asked.limit, asked.offset);
|
|
1290
|
+
if (page.items.length === 0) {
|
|
1291
|
+
return `${asked.unread ? "No unread notifications" : "No notifications"}${asked.offset > 0 ? " that far back" : ""}.${more}`;
|
|
1292
|
+
}
|
|
1293
|
+
const unread =
|
|
1294
|
+
page.unread === 0
|
|
1295
|
+
? "None unread."
|
|
1296
|
+
: `${page.unread} unread. Mark read: console notifications --read <id> [<id>...], or --read-all.`;
|
|
1297
|
+
return `${page.items.map(formatNotificationLine).join("\n")}\n${unread}${more}`;
|
|
1298
|
+
}
|
|
1299
|
+
|
|
1300
|
+
/** What each kind of notification is of (`NOTIFICATION_KINDS`), in a few words said to the member. */
|
|
1301
|
+
const NOTIFICATION_KIND_WORDS: Readonly<Record<NotificationKind, string>> = {
|
|
1302
|
+
assigned: "a task was given to you, as its owner or to work on",
|
|
1303
|
+
ready: "a task you work on is ready to begin",
|
|
1304
|
+
moved: "a task you own went from one state to another",
|
|
1305
|
+
changed: "the title, the body or the days of a task of yours changed",
|
|
1306
|
+
commented: "someone wrote on a task of yours",
|
|
1307
|
+
archived: "a task of yours was put away",
|
|
1308
|
+
decision: "a decision waits for you",
|
|
1309
|
+
answered: "a decision you raised was answered",
|
|
1310
|
+
agent:
|
|
1311
|
+
"an agent account that reports to you stopped, was refused, failed or is not heard from, or runs again, or raised a decision for you",
|
|
1312
|
+
};
|
|
1313
|
+
|
|
1314
|
+
const onOrOff = (value: boolean): string => (value ? "on" : "off");
|
|
1315
|
+
|
|
1316
|
+
/**
|
|
1317
|
+
* What a member is told of (ADR-0157): a line per kind, on or off, with what it is of and, where
|
|
1318
|
+
* they chose otherwise, what it is for a member who chose nothing; then the projects they are
|
|
1319
|
+
* told nothing of, and whether what an agent of their own did as them counts. The kinds stand
|
|
1320
|
+
* in the vocabulary's order, and one a newer console answers after them, by its name alone.
|
|
1321
|
+
*/
|
|
1322
|
+
export function formatNotificationSettings(settings: RestNotificationSettings): string {
|
|
1323
|
+
const known: readonly string[] = NOTIFICATION_KINDS;
|
|
1324
|
+
const kinds = [
|
|
1325
|
+
...NOTIFICATION_KINDS.filter((kind) => Object.hasOwn(settings.kinds, kind)),
|
|
1326
|
+
...Object.keys(settings.kinds).filter((kind) => !known.includes(kind)),
|
|
1327
|
+
];
|
|
1328
|
+
const words: Readonly<Record<string, string | undefined>> = NOTIFICATION_KIND_WORDS;
|
|
1329
|
+
return [
|
|
1330
|
+
...kinds.map((kind) => {
|
|
1331
|
+
const told = settings.kinds[kind] === true;
|
|
1332
|
+
const usual = settings.defaults[kind];
|
|
1333
|
+
const what = words[kind];
|
|
1334
|
+
return `${kind} ${onOrOff(told)}${what === undefined ? "" : ` ${what}`}${usual === undefined || usual === told ? "" : ` (default: ${onOrOff(usual)})`}`;
|
|
1335
|
+
}),
|
|
1336
|
+
`projects off: ${settings.projectsOff.length === 0 ? "none" : settings.projectsOff.map((project) => `${project.key} (${project.name})`).join(", ")}`,
|
|
1337
|
+
`own agents: ${onOrOff(settings.ownAgents)} (${settings.ownAgents ? "what an agent of your own did as you is told to you too" : "what an agent of your own did as you is not told to you"})`,
|
|
1338
|
+
].join("\n");
|
|
1339
|
+
}
|
|
1340
|
+
|
|
1341
|
+
/** What holds of a task's notifications for a member (ADR-0157), in the words that follow on or off. */
|
|
1342
|
+
const toldOfTask = (follow: RestTaskFollow): string =>
|
|
1343
|
+
follow.on
|
|
1344
|
+
? follow.all
|
|
1345
|
+
? "turned on by you: you are told of everything that happens on it"
|
|
1346
|
+
: "as your settings have it"
|
|
1347
|
+
: follow.usual
|
|
1348
|
+
? "turned off by you: you are told of nothing of it"
|
|
1349
|
+
: "as your settings have it";
|
|
1350
|
+
|
|
1351
|
+
/**
|
|
1352
|
+
* Whether a task tells a member anything, once they turned its notifications on or off
|
|
1353
|
+
* (ADR-0157), in a line, with what turns them the other way.
|
|
1354
|
+
*/
|
|
1355
|
+
export function formatTaskFollow(
|
|
1356
|
+
task: Pick<RestTask, "number" | "title">,
|
|
1357
|
+
follow: RestTaskFollow,
|
|
1358
|
+
): string {
|
|
1359
|
+
const named = `Notifications of #${task.number} ${task.title} are ${follow.on ? "on" : "off"}`;
|
|
1360
|
+
const other = follow.on
|
|
1361
|
+
? `Turn them off: console mute ${task.number}`
|
|
1362
|
+
: `Turn them on: console follow ${task.number}`;
|
|
1363
|
+
if (follow.on ? !follow.all : !follow.usual) {
|
|
1364
|
+
return `${named}, as your settings have it${follow.on ? ": you are told of it by the kinds you have on (console notify)" : ""}. ${other}`;
|
|
1365
|
+
}
|
|
1366
|
+
return `${named}: ${follow.on ? "you are told of everything that happens on it" : "you are told of nothing of it"}. ${other}`;
|
|
1367
|
+
}
|
|
1368
|
+
|
|
1242
1369
|
/** One plugin in full: what it is, how it stands, what one may run, its skills and its settings. */
|
|
1243
1370
|
export function formatPlugin(
|
|
1244
1371
|
detail: RestPluginDetail,
|
|
@@ -1268,7 +1395,23 @@ export function formatPlugin(
|
|
|
1268
1395
|
if (detail.board !== null) {
|
|
1269
1396
|
lines.push(`Board project: ${detail.board.key} (${detail.board.name}).`);
|
|
1270
1397
|
} else if (detail.boardNeeds !== "none") {
|
|
1271
|
-
|
|
1398
|
+
// What `enable --board new` would make, where the plugin proposes one: its key and name,
|
|
1399
|
+
// and the mark it names for it (ADR-0155).
|
|
1400
|
+
const proposed = detail.boardDefaults;
|
|
1401
|
+
const mark =
|
|
1402
|
+
proposed === null
|
|
1403
|
+
? ""
|
|
1404
|
+
: [
|
|
1405
|
+
proposed.glyph == null ? undefined : `the icon ${proposed.glyph}`,
|
|
1406
|
+
proposed.color == null ? undefined : `on ${proposed.color}`,
|
|
1407
|
+
]
|
|
1408
|
+
.filter((word) => word !== undefined)
|
|
1409
|
+
.join(" ");
|
|
1410
|
+
lines.push(
|
|
1411
|
+
proposed === null
|
|
1412
|
+
? "Board project: none yet."
|
|
1413
|
+
: `Board project: none yet. enable --board new makes ${proposed.key} (${localized(proposed.name, language)})${mark === "" ? "" : `, marked with ${mark}`}.`,
|
|
1414
|
+
);
|
|
1272
1415
|
}
|
|
1273
1416
|
lines.push("");
|
|
1274
1417
|
if (detail.operations.length === 0) {
|
|
@@ -1289,7 +1432,7 @@ export function formatPlugin(
|
|
|
1289
1432
|
`Skills: console plugin ${detail.key} skills lists them; console plugin ${detail.key} skill <path> reads one. Read the one that fits before the first command.`,
|
|
1290
1433
|
);
|
|
1291
1434
|
}
|
|
1292
|
-
// A
|
|
1435
|
+
// A plugin without jobs has nothing printed of them, not an empty block.
|
|
1293
1436
|
if (detail.jobs !== undefined && detail.jobs.length > 0) {
|
|
1294
1437
|
lines.push(
|
|
1295
1438
|
"",
|