@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/dist/cli/format.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { RestAgent, RestAgentRunner, RestAgentSecret, RestArtifact, RestCategory, RestComment, RestDecision, RestDocument, RestDocumentSummary, RestDocuments, RestEvent, RestEvents, RestGoal, RestListing, RestMember, RestOwnWake, RestPerson, RestPersonWork, RestPlugin, RestPluginDetail, RestPluginGrant, RestPluginInvocation, RestPluginJob, RestPluginOperation, RestPluginRecord, RestPluginRecordPage, RestPluginRecordRead, RestPluginRecordVersions, RestPluginSetting, RestPlugins, RestProject, RestProjectRules, RestRules, RestRulesPlugin, RestRun, RestRunBrief, RestSignal, RestTask, RestTaskBrief, RestTeam, RestVersion, RestVersionSummary, RestWork, RestWorkspace } from "../schemas.js";
|
|
1
|
+
import type { RestAgent, RestAgentRunner, RestAgentSecret, RestArtifact, RestCategory, RestComment, RestDecision, RestDocument, RestDocumentSummary, RestDocuments, RestEvent, RestEvents, RestGoal, RestListing, RestMember, RestNotification, RestNotificationSettings, RestNotifications, RestOwnWake, RestPerson, RestPersonWork, RestPlugin, RestPluginDetail, RestPluginGrant, RestPluginInvocation, RestPluginJob, RestPluginOperation, RestPluginRecord, RestPluginRecordPage, RestPluginRecordRead, RestPluginRecordVersions, RestPluginSetting, RestPlugins, RestProject, RestProjectRules, RestRules, RestRulesPlugin, RestRun, RestRunBrief, RestSignal, RestTask, RestTaskBrief, RestTaskFollow, RestTeam, RestVersion, RestVersionSummary, RestWork, RestWorkspace } from "../schemas.js";
|
|
2
2
|
/** Says which time zone the moments printed from now on are in, or none. */
|
|
3
3
|
export declare function setMomentZone(zone: string | undefined): void;
|
|
4
4
|
/**
|
|
@@ -22,12 +22,22 @@ export declare function formatAgentLine(agent: RestAgent): string;
|
|
|
22
22
|
* One agent account in full: its line, how it stands, what its runner last said of itself and
|
|
23
23
|
* what was chosen for it, where the asker is answered that, and whether they supervise it.
|
|
24
24
|
*/
|
|
25
|
-
export declare function formatAgent(agent: RestAgent): string;
|
|
25
|
+
export declare function formatAgent(agent: RestAgent, now: number): string;
|
|
26
|
+
/**
|
|
27
|
+
* What an agent account's product last said of what its subscription allows (ADR-0156), a line:
|
|
28
|
+
* each window that still stands with how much of it is used and when it resets, then when the
|
|
29
|
+
* product said so. Nothing where it has said none.
|
|
30
|
+
*/
|
|
31
|
+
export declare function formatAgentUsage(usage: RestAgent["usage"], now: number): string[];
|
|
26
32
|
/** A wake source as its runner last said it stands (ADR-0144): listening and since when, or not, and why. */
|
|
27
33
|
export declare function formatWakeSource(source: NonNullable<RestAgentRunner["sources"]>[number]): string;
|
|
28
34
|
/** A wake an agent account keeps for later (ADR-0145): what it is called, when it is raised, and the first words of what it says. */
|
|
29
35
|
export declare function formatOwnWakeLine(wake: RestOwnWake): string;
|
|
30
|
-
/**
|
|
36
|
+
/**
|
|
37
|
+
* How an agent account stands (ADR-0085), in a few words: the state, why, since when, until when
|
|
38
|
+
* where its runner said, as when a usage limit resets (ADR-0150), and when its runner was last
|
|
39
|
+
* heard from.
|
|
40
|
+
*/
|
|
31
41
|
export declare function formatAgentState(agent: RestAgent): string;
|
|
32
42
|
/**
|
|
33
43
|
* One signal of an agent account's record (ADR-0085): its number, its kind, who sent it or where
|
|
@@ -54,7 +64,9 @@ export declare function formatTaskLine(task: RestTaskBrief): string;
|
|
|
54
64
|
/** One task in full; with the decisions about it and the runs on it, when given. */
|
|
55
65
|
export declare function formatTask(task: RestTask, decisions?: readonly RestDecision[], runs?: readonly RestRunBrief[], comments?: readonly RestComment[],
|
|
56
66
|
/** The address of the task's page at the console, where the command knows it: what a person is given to open. */
|
|
57
|
-
page?: string
|
|
67
|
+
page?: string,
|
|
68
|
+
/** Whether the task tells the member anything (ADR-0157), where the command read it. */
|
|
69
|
+
follow?: RestTaskFollow | null): string;
|
|
58
70
|
/**
|
|
59
71
|
* One comment of the discussion, indented under the list: who said it, through which agent,
|
|
60
72
|
* when, the whole word, and each file put in it with the command that reads it.
|
|
@@ -182,6 +194,36 @@ export declare function formatPluginEvents(key: string, page: RestEvents, asked:
|
|
|
182
194
|
readonly limit: number;
|
|
183
195
|
readonly offset: number;
|
|
184
196
|
}): string;
|
|
197
|
+
/**
|
|
198
|
+
* One notification in a line (ADR-0157): its id, which `--read` takes; whether the member read
|
|
199
|
+
* it; when; why they are told, the kind and that they turned the task on where that is why; the
|
|
200
|
+
* project's key where it happened in one; and what happened, who did it and then the feed's own
|
|
201
|
+
* sentence for the event. What an event carries is what someone wrote, so the line is kept one.
|
|
202
|
+
* A task is named in the sentence by its number; a decision is not, so its id follows, which
|
|
203
|
+
* the commands that read and answer it take.
|
|
204
|
+
*/
|
|
205
|
+
export declare function formatNotificationLine(notification: RestNotification): string;
|
|
206
|
+
/**
|
|
207
|
+
* A page of one's notifications, the newest first: a line each, then how many are not read
|
|
208
|
+
* yet, with what marks them read where some are, and how the next page is asked for.
|
|
209
|
+
*/
|
|
210
|
+
export declare function formatNotifications(page: RestNotifications, asked: {
|
|
211
|
+
readonly unread: boolean;
|
|
212
|
+
readonly limit: number;
|
|
213
|
+
readonly offset: number;
|
|
214
|
+
}): string;
|
|
215
|
+
/**
|
|
216
|
+
* What a member is told of (ADR-0157): a line per kind, on or off, with what it is of and, where
|
|
217
|
+
* they chose otherwise, what it is for a member who chose nothing; then the projects they are
|
|
218
|
+
* told nothing of, and whether what an agent of their own did as them counts. The kinds stand
|
|
219
|
+
* in the vocabulary's order, and one a newer console answers after them, by its name alone.
|
|
220
|
+
*/
|
|
221
|
+
export declare function formatNotificationSettings(settings: RestNotificationSettings): string;
|
|
222
|
+
/**
|
|
223
|
+
* Whether a task tells a member anything, once they turned its notifications on or off
|
|
224
|
+
* (ADR-0157), in a line, with what turns them the other way.
|
|
225
|
+
*/
|
|
226
|
+
export declare function formatTaskFollow(task: Pick<RestTask, "number" | "title">, follow: RestTaskFollow): string;
|
|
185
227
|
/** One plugin in full: what it is, how it stands, what one may run, its skills and its settings. */
|
|
186
228
|
export declare function formatPlugin(detail: RestPluginDetail, language: string | null | undefined): string;
|
|
187
229
|
/**
|
package/dist/cli/format.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../src/cli/format.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../src/cli/format.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,SAAS,EACT,eAAe,EACf,eAAe,EACf,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,mBAAmB,EACnB,aAAa,EACb,SAAS,EACT,UAAU,EACV,QAAQ,EACR,WAAW,EACX,UAAU,EACV,gBAAgB,EAChB,wBAAwB,EACxB,iBAAiB,EACjB,WAAW,EACX,UAAU,EACV,cAAc,EACd,UAAU,EAEV,gBAAgB,EAChB,eAAe,EACf,oBAAoB,EACpB,aAAa,EACb,mBAAmB,EACnB,gBAAgB,EAChB,oBAAoB,EACpB,oBAAoB,EAC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kB,CAAC,MAAM,EAAE,oBAAoB,GAAG,MAAM,CAqBvE;AAED,2DAA2D;AAC3D,wBAAgB,0BAA0B,CAAC,QAAQ,EAAE,wBAAwB,GAAG,MAAM,CAUrF;AAED,uGAAuG;AACvG,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,SAAS,eAAe,EAAE,EACnC,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAClC,MAAM,CASR"}
|
package/dist/cli/format.js
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 } from "../notifications.js";
|
|
2
5
|
import { argUsage } from "../plugin/args.js";
|
|
3
6
|
import { reportCountOf } from "../schemas.js";
|
|
4
7
|
// What the command prints: one line per thing in a list, a few lines for one thing in full.
|
|
@@ -123,11 +126,12 @@ const OWN_CHOICE = "the product's own";
|
|
|
123
126
|
* One agent account in full: its line, how it stands, what its runner last said of itself and
|
|
124
127
|
* what was chosen for it, where the asker is answered that, and whether they supervise it.
|
|
125
128
|
*/
|
|
126
|
-
export function formatAgent(agent) {
|
|
129
|
+
export function formatAgent(agent, now) {
|
|
127
130
|
const runner = agent.runner ?? null;
|
|
128
131
|
return [
|
|
129
132
|
formatAgentLine(agent),
|
|
130
133
|
`state: ${formatAgentState(agent)}`,
|
|
134
|
+
...formatAgentUsage(agent.usage, now),
|
|
131
135
|
...(runner === null
|
|
132
136
|
? []
|
|
133
137
|
: [
|
|
@@ -171,6 +175,30 @@ export function formatAgent(agent) {
|
|
|
171
175
|
: "You do not supervise it.",
|
|
172
176
|
].join("\n");
|
|
173
177
|
}
|
|
178
|
+
/**
|
|
179
|
+
* What an agent account's product last said of what its subscription allows (ADR-0156), a line:
|
|
180
|
+
* each window that still stands with how much of it is used and when it resets, then when the
|
|
181
|
+
* product said so. Nothing where it has said none.
|
|
182
|
+
*/
|
|
183
|
+
export function formatAgentUsage(usage, now) {
|
|
184
|
+
const standing = usageStanding(usage, now);
|
|
185
|
+
if (standing.length === 0) {
|
|
186
|
+
return [];
|
|
187
|
+
}
|
|
188
|
+
// When they were said: once where the product said them together, beside each where not.
|
|
189
|
+
const together = usageSaidTogether(standing);
|
|
190
|
+
const windows = standing.map((window) => {
|
|
191
|
+
const share = window.used === null
|
|
192
|
+
? usageNear(window)
|
|
193
|
+
? "near its limit"
|
|
194
|
+
: "of a share its product did not say"
|
|
195
|
+
: `${usedHundredths(window.used)}% used${window.used < 1 && usageNear(window) ? ", near its limit" : ""}`;
|
|
196
|
+
return `${window.name} ${share}${window.resetsAt === null ? "" : `, resets ${moment(window.resetsAt)}`}${together === undefined ? `, said ${moment(window.at)}` : ""}`;
|
|
197
|
+
});
|
|
198
|
+
return [
|
|
199
|
+
`usage: ${windows.join("; ")}${together === undefined ? "" : ` (as its product said ${moment(together)})`}`,
|
|
200
|
+
];
|
|
201
|
+
}
|
|
174
202
|
/** A wake source as its runner last said it stands (ADR-0144): listening and since when, or not, and why. */
|
|
175
203
|
export function formatWakeSource(source) {
|
|
176
204
|
const why = source.why === undefined ? "" : ` (${source.why})`;
|
|
@@ -184,15 +212,20 @@ export function formatOwnWakeLine(wake) {
|
|
|
184
212
|
const said = words.length === 0 ? "" : ` ${words.length > 120 ? `${words.slice(0, 119)}…` : words}`;
|
|
185
213
|
return `to come ${wake.key} ${moment(wake.at)}${said}`;
|
|
186
214
|
}
|
|
187
|
-
/**
|
|
215
|
+
/**
|
|
216
|
+
* How an agent account stands (ADR-0085), in a few words: the state, why, since when, until when
|
|
217
|
+
* where its runner said, as when a usage limit resets (ADR-0150), and when its runner was last
|
|
218
|
+
* heard from.
|
|
219
|
+
*/
|
|
188
220
|
export function formatAgentState(agent) {
|
|
189
221
|
const state = agent.state ?? null;
|
|
190
222
|
if (state === null) {
|
|
191
223
|
return "no runner has been heard from yet";
|
|
192
224
|
}
|
|
193
225
|
const reason = state.reason === null ? "" : ` (${state.reason.replaceAll("_", " ")})`;
|
|
226
|
+
const until = state.until === undefined || state.until === null ? "" : `, until ${moment(state.until)}`;
|
|
194
227
|
const heard = state.heardAt === null ? "" : `; its runner was last heard from ${moment(state.heardAt)}`;
|
|
195
|
-
return `${state.state}${reason} since ${moment(state.since)}${heard}`;
|
|
228
|
+
return `${state.state}${reason} since ${moment(state.since)}${until}${heard}`;
|
|
196
229
|
}
|
|
197
230
|
/**
|
|
198
231
|
* One signal of an agent account's record (ADR-0085): its number, its kind, who sent it or where
|
|
@@ -208,8 +241,8 @@ export function formatSignalLine(signal, delivered) {
|
|
|
208
241
|
const words = signal.text.replaceAll(/\s+/g, " ").trim();
|
|
209
242
|
const said = words.length === 0 ? "" : ` ${words.length > 120 ? `${words.slice(0, 119)}…` : words}`;
|
|
210
243
|
// Whether it is delivered, where the record says how far it is (ADR-0131): the product took
|
|
211
|
-
// it or the record says what became of it, or it waits for that.
|
|
212
|
-
// say,
|
|
244
|
+
// it or the record says what became of it, or it waits for that. An answer that does not
|
|
245
|
+
// say, the one to a signal just sent, has nothing said here.
|
|
213
246
|
const state = delivered === undefined ? "" : signal.number <= delivered ? "delivered " : "waiting ";
|
|
214
247
|
return `#${signal.number} ${signal.kind} ${state}${who} ${moment(signal.at)}${set}${said}`;
|
|
215
248
|
}
|
|
@@ -314,13 +347,18 @@ function scheduleLines(task) {
|
|
|
314
347
|
/** One task in full; with the decisions about it and the runs on it, when given. */
|
|
315
348
|
export function formatTask(task, decisions, runs, comments,
|
|
316
349
|
/** The address of the task's page at the console, where the command knows it: what a person is given to open. */
|
|
317
|
-
page
|
|
350
|
+
page,
|
|
351
|
+
/** Whether the task tells the member anything (ADR-0157), where the command read it. */
|
|
352
|
+
follow) {
|
|
318
353
|
const lines = [
|
|
319
354
|
`#${task.number} ${task.title}`,
|
|
320
355
|
`state: ${task.state} priority: ${task.priority} owner: ${calledOf(task.owner)} workers: ${task.workers.length === 0 ? "nobody" : logins(task.workers)}`,
|
|
321
356
|
`id: ${task.id}${task.parentId === null ? "" : ` part of: ${task.parentId}`}`,
|
|
322
357
|
...(page === undefined ? [] : [pageLine(page)]),
|
|
323
358
|
...(task.agent == null ? [] : [`written through: ${task.agent}`]),
|
|
359
|
+
...(follow == null
|
|
360
|
+
? []
|
|
361
|
+
: [`notifications: ${follow.on ? "on" : "off"}, ${toldOfTask(follow)}`]),
|
|
324
362
|
...scheduleLines(task),
|
|
325
363
|
];
|
|
326
364
|
if (task.links.length > 0) {
|
|
@@ -371,7 +409,7 @@ export function formatComment(comment) {
|
|
|
371
409
|
}
|
|
372
410
|
export function formatRunLine(run) {
|
|
373
411
|
// A run of a listing comes without its reports, counted (`?brief=true`); a run read whole,
|
|
374
|
-
//
|
|
412
|
+
// with them.
|
|
375
413
|
const notes = [plural(reportCountOf(run), "report"), plural(run.artifacts.length, "artifact")];
|
|
376
414
|
if (run.waitingFor !== null) {
|
|
377
415
|
notes.push(`waiting for decision ${run.waitingFor}`);
|
|
@@ -419,18 +457,6 @@ function rulesFacts(page) {
|
|
|
419
457
|
}
|
|
420
458
|
/** A part of the rules that has a text: what it is, who wrote it where someone did, and the text as it stands. */
|
|
421
459
|
const formatRulesPart = (head, page, body) => `${head}${rulesFacts(page)}:\n\n${body.trimEnd()}`;
|
|
422
|
-
/**
|
|
423
|
-
* The workspace's rules as a console of before the parts answers them (ADR-0120): whole, the
|
|
424
|
-
* console's own until an administrator writes the organization's in their place, which is
|
|
425
|
-
* what holds on such a console. No command is named for writing them: this one writes what an
|
|
426
|
-
* organization adds, and refuses to on a console that would keep it as the whole.
|
|
427
|
-
*/
|
|
428
|
-
function formatRulesWhole(rules) {
|
|
429
|
-
const head = rules.source === "reference"
|
|
430
|
-
? "Rules of the workspace: the console's own, until an administrator writes the organization's."
|
|
431
|
-
: `Rules of the workspace${rulesFacts(rules.page) || " (written)"}:`;
|
|
432
|
-
return `${head}\n\n${(rules.body ?? "").trimEnd()}`;
|
|
433
|
-
}
|
|
434
460
|
/**
|
|
435
461
|
* The parts of the rules as they are printed for whoever reads them (ADR-0120): what the
|
|
436
462
|
* project adds where the command works in one and it adds something, the plugins' lines in the
|
|
@@ -453,10 +479,10 @@ function rulesParts(rules, language) {
|
|
|
453
479
|
? undefined
|
|
454
480
|
: formatRulesPlugins(rules.plugins, language),
|
|
455
481
|
pluginCount: count,
|
|
456
|
-
/** What the organization adds, where it adds something
|
|
457
|
-
added:
|
|
458
|
-
/** The console's rules by themselves
|
|
459
|
-
console: workspace.own,
|
|
482
|
+
/** What the organization adds, where it adds something. */
|
|
483
|
+
added: added === null ? undefined : added,
|
|
484
|
+
/** The console's rules by themselves. */
|
|
485
|
+
console: workspace.own ?? "",
|
|
460
486
|
};
|
|
461
487
|
}
|
|
462
488
|
/**
|
|
@@ -493,14 +519,8 @@ const charactersOf = (text) => `${(text ?? "").trimEnd().length} characters`;
|
|
|
493
519
|
export function formatRules(rules, language) {
|
|
494
520
|
const parts = rulesParts(rules, language);
|
|
495
521
|
const mark = rulesMark(rules, language);
|
|
496
|
-
|
|
497
|
-
const
|
|
498
|
-
const last = whole
|
|
499
|
-
? `the workspace's (${charactersOf(parts.workspace.body)})`
|
|
500
|
-
: `the console's (${charactersOf(parts.console ?? null)})`;
|
|
501
|
-
const lastFollows = whole
|
|
502
|
-
? `the workspace's follow (${charactersOf(parts.workspace.body)})`
|
|
503
|
-
: `the console's follow (${charactersOf(parts.console ?? null)})`;
|
|
522
|
+
const last = `the console's (${charactersOf(parts.console)})`;
|
|
523
|
+
const lastFollows = `the console's follow (${charactersOf(parts.console)})`;
|
|
504
524
|
const plugins = `${parts.pluginCount} plugin${parts.pluginCount === 1 ? "" : "s"}`;
|
|
505
525
|
const HOLDS = "the earlier holding where they differ";
|
|
506
526
|
/** The organization's part and the last, after whatever stood before them. */
|
|
@@ -509,10 +529,10 @@ export function formatRules(rules, language) {
|
|
|
509
529
|
: `the organization's${first ? " additions first" : ""} (${charactersOf(parts.added.body)}), then ${last}`;
|
|
510
530
|
let follows;
|
|
511
531
|
if (parts.own !== undefined) {
|
|
512
|
-
follows = `this project's additions first (${charactersOf(parts.own.body)})${parts.plugins === undefined ? "" : ` with its ${plugins}`}, then ${rest(false)}, ${HOLDS}${
|
|
532
|
+
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"}.`;
|
|
513
533
|
}
|
|
514
534
|
else {
|
|
515
|
-
const nobody = parts.added === undefined
|
|
535
|
+
const nobody = parts.added === undefined;
|
|
516
536
|
const lead = parts.named
|
|
517
537
|
? nobody
|
|
518
538
|
? "this project and the organization add nothing; "
|
|
@@ -524,9 +544,7 @@ export function formatRules(rules, language) {
|
|
|
524
544
|
const body = parts.plugins !== undefined
|
|
525
545
|
? `${theirs} first, then ${parts.added === undefined ? last : `the organization's additions (${charactersOf(parts.added.body)}), then ${last}, ${HOLDS}`}`
|
|
526
546
|
: parts.added === undefined
|
|
527
|
-
?
|
|
528
|
-
? lastFollows
|
|
529
|
-
: last
|
|
547
|
+
? lastFollows
|
|
530
548
|
: `${rest(true)}, ${HOLDS}`;
|
|
531
549
|
follows = `${lead}${body}${parts.named ? "." : "; no project is named here, and a project's additions stand before them where it has some."}`;
|
|
532
550
|
}
|
|
@@ -544,9 +562,7 @@ export function formatRules(rules, language) {
|
|
|
544
562
|
? []
|
|
545
563
|
: ["", formatRulesPart("What this organization adds", parts.added.page, parts.added.body)]),
|
|
546
564
|
"",
|
|
547
|
-
parts.console
|
|
548
|
-
? formatRulesWhole(parts.workspace)
|
|
549
|
-
: formatRulesPart("The console's rules, which always hold", null, parts.console),
|
|
565
|
+
formatRulesPart("The console's rules, which always hold", null, parts.console),
|
|
550
566
|
].join("\n");
|
|
551
567
|
}
|
|
552
568
|
/** What a take says, before the task, where it was told the mark the rules have (ADR-0119): they are left out. */
|
|
@@ -971,13 +987,14 @@ function pluginEventSays(event) {
|
|
|
971
987
|
const carried = JSON.stringify(data);
|
|
972
988
|
return carried === "{}" ? "" : carried.length > 300 ? `${carried.slice(0, 300)}...` : carried;
|
|
973
989
|
}
|
|
990
|
+
/** Who did what an event says, as a line names them: the member, with the agent they acted as, or the console. */
|
|
991
|
+
const eventBy = (event) => event.actor === null
|
|
992
|
+
? "the console"
|
|
993
|
+
: `${calledOf(event.actor)}${event.agent === null ? "" : ` as ${event.agent}`}`;
|
|
974
994
|
/** One event of a plugin in a line: its number, when, its kind, who did it and through what, and what it says. */
|
|
975
995
|
export function formatPluginEventLine(event) {
|
|
976
|
-
const who = event.actor === null
|
|
977
|
-
? "the console"
|
|
978
|
-
: `${calledOf(event.actor)}${event.agent === null ? "" : ` as ${event.agent}`}`;
|
|
979
996
|
const says = pluginEventSays(event);
|
|
980
|
-
return `#${event.id} ${moment(event.createdAt)} ${event.kind} ${
|
|
997
|
+
return `#${event.id} ${moment(event.createdAt)} ${event.kind} ${eventBy(event)}${says === "" ? "" : ` ${says}`}`;
|
|
981
998
|
}
|
|
982
999
|
/**
|
|
983
1000
|
* A page of a plugin's events, newest first (ADR-0128), of one kind where one was asked for:
|
|
@@ -992,6 +1009,94 @@ export function formatPluginEvents(key, page, asked) {
|
|
|
992
1009
|
}
|
|
993
1010
|
return `${page.items.map(formatPluginEventLine).join("\n")}${formatMore(page.more, asked.limit, asked.offset)}`;
|
|
994
1011
|
}
|
|
1012
|
+
/**
|
|
1013
|
+
* One notification in a line (ADR-0157): its id, which `--read` takes; whether the member read
|
|
1014
|
+
* it; when; why they are told, the kind and that they turned the task on where that is why; the
|
|
1015
|
+
* project's key where it happened in one; and what happened, who did it and then the feed's own
|
|
1016
|
+
* sentence for the event. What an event carries is what someone wrote, so the line is kept one.
|
|
1017
|
+
* A task is named in the sentence by its number; a decision is not, so its id follows, which
|
|
1018
|
+
* the commands that read and answer it take.
|
|
1019
|
+
*/
|
|
1020
|
+
export function formatNotificationLine(notification) {
|
|
1021
|
+
const { event, project } = notification;
|
|
1022
|
+
const why = `${notification.kind}${notification.followed ? " (followed)" : ""}`;
|
|
1023
|
+
const happened = `${eventBy(event)} ${describeEvent(event)}`.replaceAll(/\s+/g, " ");
|
|
1024
|
+
const decision = event.decisionId === null ? "" : ` (decision ${event.decisionId})`;
|
|
1025
|
+
return `${notification.id} ${notification.readAt === null ? "unread" : "read"} ${moment(notification.createdAt)} ${why} ${project === null ? "" : `${project.key} `}${happened}${decision}`;
|
|
1026
|
+
}
|
|
1027
|
+
/**
|
|
1028
|
+
* A page of one's notifications, the newest first: a line each, then how many are not read
|
|
1029
|
+
* yet, with what marks them read where some are, and how the next page is asked for.
|
|
1030
|
+
*/
|
|
1031
|
+
export function formatNotifications(page, asked) {
|
|
1032
|
+
const more = formatMore(page.more, asked.limit, asked.offset);
|
|
1033
|
+
if (page.items.length === 0) {
|
|
1034
|
+
return `${asked.unread ? "No unread notifications" : "No notifications"}${asked.offset > 0 ? " that far back" : ""}.${more}`;
|
|
1035
|
+
}
|
|
1036
|
+
const unread = page.unread === 0
|
|
1037
|
+
? "None unread."
|
|
1038
|
+
: `${page.unread} unread. Mark read: console notifications --read <id> [<id>...], or --read-all.`;
|
|
1039
|
+
return `${page.items.map(formatNotificationLine).join("\n")}\n${unread}${more}`;
|
|
1040
|
+
}
|
|
1041
|
+
/** What each kind of notification is of (`NOTIFICATION_KINDS`), in a few words said to the member. */
|
|
1042
|
+
const NOTIFICATION_KIND_WORDS = {
|
|
1043
|
+
assigned: "a task was given to you, as its owner or to work on",
|
|
1044
|
+
ready: "a task you work on is ready to begin",
|
|
1045
|
+
moved: "a task you own went from one state to another",
|
|
1046
|
+
changed: "the title, the body or the days of a task of yours changed",
|
|
1047
|
+
commented: "someone wrote on a task of yours",
|
|
1048
|
+
archived: "a task of yours was put away",
|
|
1049
|
+
decision: "a decision waits for you",
|
|
1050
|
+
answered: "a decision you raised was answered",
|
|
1051
|
+
agent: "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",
|
|
1052
|
+
};
|
|
1053
|
+
const onOrOff = (value) => (value ? "on" : "off");
|
|
1054
|
+
/**
|
|
1055
|
+
* What a member is told of (ADR-0157): a line per kind, on or off, with what it is of and, where
|
|
1056
|
+
* they chose otherwise, what it is for a member who chose nothing; then the projects they are
|
|
1057
|
+
* told nothing of, and whether what an agent of their own did as them counts. The kinds stand
|
|
1058
|
+
* in the vocabulary's order, and one a newer console answers after them, by its name alone.
|
|
1059
|
+
*/
|
|
1060
|
+
export function formatNotificationSettings(settings) {
|
|
1061
|
+
const known = NOTIFICATION_KINDS;
|
|
1062
|
+
const kinds = [
|
|
1063
|
+
...NOTIFICATION_KINDS.filter((kind) => Object.hasOwn(settings.kinds, kind)),
|
|
1064
|
+
...Object.keys(settings.kinds).filter((kind) => !known.includes(kind)),
|
|
1065
|
+
];
|
|
1066
|
+
const words = NOTIFICATION_KIND_WORDS;
|
|
1067
|
+
return [
|
|
1068
|
+
...kinds.map((kind) => {
|
|
1069
|
+
const told = settings.kinds[kind] === true;
|
|
1070
|
+
const usual = settings.defaults[kind];
|
|
1071
|
+
const what = words[kind];
|
|
1072
|
+
return `${kind} ${onOrOff(told)}${what === undefined ? "" : ` ${what}`}${usual === undefined || usual === told ? "" : ` (default: ${onOrOff(usual)})`}`;
|
|
1073
|
+
}),
|
|
1074
|
+
`projects off: ${settings.projectsOff.length === 0 ? "none" : settings.projectsOff.map((project) => `${project.key} (${project.name})`).join(", ")}`,
|
|
1075
|
+
`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"})`,
|
|
1076
|
+
].join("\n");
|
|
1077
|
+
}
|
|
1078
|
+
/** What holds of a task's notifications for a member (ADR-0157), in the words that follow on or off. */
|
|
1079
|
+
const toldOfTask = (follow) => follow.on
|
|
1080
|
+
? follow.all
|
|
1081
|
+
? "turned on by you: you are told of everything that happens on it"
|
|
1082
|
+
: "as your settings have it"
|
|
1083
|
+
: follow.usual
|
|
1084
|
+
? "turned off by you: you are told of nothing of it"
|
|
1085
|
+
: "as your settings have it";
|
|
1086
|
+
/**
|
|
1087
|
+
* Whether a task tells a member anything, once they turned its notifications on or off
|
|
1088
|
+
* (ADR-0157), in a line, with what turns them the other way.
|
|
1089
|
+
*/
|
|
1090
|
+
export function formatTaskFollow(task, follow) {
|
|
1091
|
+
const named = `Notifications of #${task.number} ${task.title} are ${follow.on ? "on" : "off"}`;
|
|
1092
|
+
const other = follow.on
|
|
1093
|
+
? `Turn them off: console mute ${task.number}`
|
|
1094
|
+
: `Turn them on: console follow ${task.number}`;
|
|
1095
|
+
if (follow.on ? !follow.all : !follow.usual) {
|
|
1096
|
+
return `${named}, as your settings have it${follow.on ? ": you are told of it by the kinds you have on (console notify)" : ""}. ${other}`;
|
|
1097
|
+
}
|
|
1098
|
+
return `${named}: ${follow.on ? "you are told of everything that happens on it" : "you are told of nothing of it"}. ${other}`;
|
|
1099
|
+
}
|
|
995
1100
|
/** One plugin in full: what it is, how it stands, what one may run, its skills and its settings. */
|
|
996
1101
|
export function formatPlugin(detail, language) {
|
|
997
1102
|
const name = localized(detail.name, language);
|
|
@@ -1017,7 +1122,20 @@ export function formatPlugin(detail, language) {
|
|
|
1017
1122
|
lines.push(`Board project: ${detail.board.key} (${detail.board.name}).`);
|
|
1018
1123
|
}
|
|
1019
1124
|
else if (detail.boardNeeds !== "none") {
|
|
1020
|
-
|
|
1125
|
+
// What `enable --board new` would make, where the plugin proposes one: its key and name,
|
|
1126
|
+
// and the mark it names for it (ADR-0155).
|
|
1127
|
+
const proposed = detail.boardDefaults;
|
|
1128
|
+
const mark = proposed === null
|
|
1129
|
+
? ""
|
|
1130
|
+
: [
|
|
1131
|
+
proposed.glyph == null ? undefined : `the icon ${proposed.glyph}`,
|
|
1132
|
+
proposed.color == null ? undefined : `on ${proposed.color}`,
|
|
1133
|
+
]
|
|
1134
|
+
.filter((word) => word !== undefined)
|
|
1135
|
+
.join(" ");
|
|
1136
|
+
lines.push(proposed === null
|
|
1137
|
+
? "Board project: none yet."
|
|
1138
|
+
: `Board project: none yet. enable --board new makes ${proposed.key} (${localized(proposed.name, language)})${mark === "" ? "" : `, marked with ${mark}`}.`);
|
|
1021
1139
|
}
|
|
1022
1140
|
lines.push("");
|
|
1023
1141
|
if (detail.operations.length === 0) {
|
|
@@ -1033,7 +1151,7 @@ export function formatPlugin(detail, language) {
|
|
|
1033
1151
|
if (detail.skills !== null) {
|
|
1034
1152
|
lines.push("", `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.`);
|
|
1035
1153
|
}
|
|
1036
|
-
// A
|
|
1154
|
+
// A plugin without jobs has nothing printed of them, not an empty block.
|
|
1037
1155
|
if (detail.jobs !== undefined && detail.jobs.length > 0) {
|
|
1038
1156
|
lines.push("", `Jobs (what went wrong in one: console plugin ${detail.key} events --kind plugin.failed):`, ...detail.jobs.map(formatPluginJobLine));
|
|
1039
1157
|
}
|