@skillcdn/console 0.6.2 → 0.6.4
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 +16 -9
- package/SKILLCDN.md +3 -2
- package/dist/agent-page.d.ts +2 -0
- package/dist/agent-page.d.ts.map +1 -1
- package/dist/agent-page.js +46 -5
- package/dist/agent-page.js.map +1 -1
- package/dist/agent-state.d.ts +9 -0
- package/dist/agent-state.d.ts.map +1 -0
- package/dist/agent-state.js +28 -0
- package/dist/agent-state.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 +948 -252
- package/dist/cli/cli.js.map +1 -1
- package/dist/cli/format.d.ts +44 -7
- package/dist/cli/format.d.ts.map +1 -1
- package/dist/cli/format.js +168 -13
- package/dist/cli/format.js.map +1 -1
- package/dist/cli/help.d.ts +82 -9
- package/dist/cli/help.d.ts.map +1 -1
- package/dist/cli/help.js +855 -331
- package/dist/cli/help.js.map +1 -1
- package/dist/cli/pack.d.ts +13 -12
- package/dist/cli/pack.d.ts.map +1 -1
- package/dist/cli/pack.js +33 -45
- package/dist/cli/pack.js.map +1 -1
- package/dist/cli/plugin-cli.d.ts.map +1 -1
- package/dist/cli/plugin-cli.js +8 -5
- package/dist/cli/plugin-cli.js.map +1 -1
- package/dist/cli/runner-files.d.ts +16 -0
- package/dist/cli/runner-files.d.ts.map +1 -0
- package/dist/cli/runner-files.js +125 -0
- package/dist/cli/runner-files.js.map +1 -0
- package/dist/cli/runner-host.d.ts +7 -0
- package/dist/cli/runner-host.d.ts.map +1 -1
- package/dist/cli/runner-host.js +40 -2
- package/dist/cli/runner-host.js.map +1 -1
- package/dist/cli/skill-path.d.ts +11 -0
- package/dist/cli/skill-path.d.ts.map +1 -0
- package/dist/cli/skill-path.js +44 -0
- package/dist/cli/skill-path.js.map +1 -0
- package/dist/client.d.ts +32 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +15 -1
- package/dist/client.js.map +1 -1
- package/dist/components/agent-page.d.ts +93 -6
- package/dist/components/agent-page.d.ts.map +1 -1
- package/dist/components/agent-page.js +202 -10
- package/dist/components/agent-page.js.map +1 -1
- package/dist/components/agents.d.ts +6 -6
- package/dist/components/agents.d.ts.map +1 -1
- package/dist/components/agents.js +16 -9
- package/dist/components/agents.js.map +1 -1
- package/dist/components/people.d.ts.map +1 -1
- package/dist/components/people.js +7 -2
- package/dist/components/people.js.map +1 -1
- package/dist/components/picker.d.ts +16 -0
- package/dist/components/picker.d.ts.map +1 -1
- package/dist/components/picker.js +69 -4
- package/dist/components/picker.js.map +1 -1
- package/dist/console.css +40 -0
- package/dist/console.js +2 -2
- package/dist/console.js.map +1 -1
- package/dist/feed-words.d.ts.map +1 -1
- package/dist/feed-words.js +12 -1
- package/dist/feed-words.js.map +1 -1
- package/dist/i18n/en.d.ts +64 -6
- package/dist/i18n/en.d.ts.map +1 -1
- package/dist/i18n/en.js +59 -10
- package/dist/i18n/en.js.map +1 -1
- package/dist/i18n/ko.d.ts.map +1 -1
- package/dist/i18n/ko.js +49 -9
- package/dist/i18n/ko.js.map +1 -1
- package/dist/limits.d.ts +26 -0
- package/dist/limits.d.ts.map +1 -1
- package/dist/limits.js +26 -0
- package/dist/limits.js.map +1 -1
- package/dist/onboarding.d.ts +18 -6
- package/dist/onboarding.d.ts.map +1 -1
- package/dist/onboarding.js +42 -7
- package/dist/onboarding.js.map +1 -1
- package/dist/plugin/args.d.ts +24 -2
- package/dist/plugin/args.d.ts.map +1 -1
- package/dist/plugin/args.js +20 -2
- package/dist/plugin/args.js.map +1 -1
- package/dist/plugin/context.d.ts +39 -7
- package/dist/plugin/context.d.ts.map +1 -1
- package/dist/plugin/define.d.ts.map +1 -1
- package/dist/plugin/define.js +12 -3
- package/dist/plugin/define.js.map +1 -1
- package/dist/plugin/rest-schemas.d.ts +2 -0
- package/dist/plugin/rest-schemas.d.ts.map +1 -1
- package/dist/plugin/rest-schemas.js +1 -0
- package/dist/plugin/rest-schemas.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.d.ts +4 -1
- package/dist/rules.d.ts.map +1 -1
- package/dist/rules.js +5 -2
- package/dist/rules.js.map +1 -1
- package/dist/runner/acp.d.ts.map +1 -1
- package/dist/runner/acp.js +9 -3
- package/dist/runner/acp.js.map +1 -1
- package/dist/runner/claude.d.ts.map +1 -1
- package/dist/runner/claude.js +53 -1
- package/dist/runner/claude.js.map +1 -1
- package/dist/runner/codex.d.ts.map +1 -1
- package/dist/runner/codex.js +18 -3
- package/dist/runner/codex.js.map +1 -1
- package/dist/runner/config.d.ts +18 -0
- package/dist/runner/config.d.ts.map +1 -1
- package/dist/runner/config.js +77 -1
- package/dist/runner/config.js.map +1 -1
- package/dist/runner/desk.d.ts +7 -0
- package/dist/runner/desk.d.ts.map +1 -1
- package/dist/runner/desk.js +14 -4
- package/dist/runner/desk.js.map +1 -1
- package/dist/runner/message.d.ts +16 -22
- package/dist/runner/message.d.ts.map +1 -1
- package/dist/runner/message.js +72 -120
- package/dist/runner/message.js.map +1 -1
- package/dist/runner/runner.d.ts +41 -1
- package/dist/runner/runner.d.ts.map +1 -1
- package/dist/runner/runner.js +557 -23
- package/dist/runner/runner.js.map +1 -1
- package/dist/runner/slack-status.d.ts +19 -0
- package/dist/runner/slack-status.d.ts.map +1 -0
- package/dist/runner/slack-status.js +332 -0
- package/dist/runner/slack-status.js.map +1 -0
- package/dist/runner/slack.d.ts.map +1 -1
- package/dist/runner/slack.js +258 -59
- package/dist/runner/slack.js.map +1 -1
- package/dist/runner/types.d.ts +128 -15
- package/dist/runner/types.d.ts.map +1 -1
- package/dist/runner/types.js.map +1 -1
- package/dist/runner/usage.d.ts +6 -1
- package/dist/runner/usage.d.ts.map +1 -1
- package/dist/runner/usage.js +9 -2
- package/dist/runner/usage.js.map +1 -1
- package/dist/runner.d.ts +2 -2
- package/dist/runner.d.ts.map +1 -1
- package/dist/runner.js.map +1 -1
- package/dist/schemas.d.ts +635 -6
- package/dist/schemas.d.ts.map +1 -1
- package/dist/schemas.js +197 -15
- package/dist/schemas.js.map +1 -1
- package/dist/secret-file.d.ts +21 -0
- package/dist/secret-file.d.ts.map +1 -0
- package/dist/secret-file.js +59 -0
- package/dist/secret-file.js.map +1 -0
- package/dist/services.d.ts.map +1 -1
- package/dist/services.js +3 -2
- package/dist/services.js.map +1 -1
- package/dist/setup-guide.d.ts +2 -2
- package/dist/setup-guide.d.ts.map +1 -1
- package/dist/setup-guide.js +6 -5
- package/dist/setup-guide.js.map +1 -1
- package/dist/vocabulary.d.ts +17 -2
- package/dist/vocabulary.d.ts.map +1 -1
- package/dist/vocabulary.js +15 -2
- package/dist/vocabulary.js.map +1 -1
- package/dist/wake-text.d.ts +43 -0
- package/dist/wake-text.d.ts.map +1 -0
- package/dist/wake-text.js +115 -0
- package/dist/wake-text.js.map +1 -0
- package/docs/specs/cli.md +39 -25
- package/docs/specs/plugins.md +10 -9
- package/docs/specs/rest.md +34 -15
- package/docs/specs/runner.md +108 -25
- package/docs/start.md +28 -6
- package/package.json +3 -3
- package/skills/building-a-plugin/SKILL.md +2 -2
- package/skills/deploying-a-console/SKILL.md +3 -3
- package/skills/deploying-a-console/references/access.md +15 -1
- package/skills/deploying-a-console/references/resources.md +2 -2
- package/skills/deploying-a-console/scripts/github-app.mjs +593 -0
- package/skills/keeping-the-pack/SKILL.md +87 -0
- package/skills/planning-the-board/SKILL.md +6 -6
- package/skills/planning-the-board/references/a-task.md +1 -1
- package/skills/planning-the-board/references/setting-up.md +9 -5
- package/skills/running-an-agent/SKILL.md +21 -17
- package/skills/running-an-agent/references/preparing-the-machine.md +4 -3
- package/skills/running-an-agent/references/several-tasks.md +8 -2
- package/skills/running-an-agent/references/slack-app.md +31 -8
- package/skills/running-an-agent/references/the-account-and-the-invitation.md +1 -1
- package/skills/running-an-agent/references/what-was-not-seen-run-yet.md +3 -1
- package/skills/running-an-agent/references/when-the-agent-could-not-go-on.md +4 -4
- package/skills/running-an-agent/references/your-first-task.md +11 -5
- package/skills/trying-a-console/SKILL.md +136 -0
- package/skills/trying-a-console/references/when-it-does-not-go.md +30 -0
- package/skills/working-the-board/SKILL.md +6 -6
- package/skills/working-the-board/references/terms.md +3 -1
- package/skills/working-the-board/references/the-pack.md +14 -7
- package/skills/working-the-board/references/what-they-were-told.md +1 -1
- package/src/agent-page.tsx +111 -4
- package/src/agent-state.ts +33 -0
- package/src/api.ts +43 -0
- package/src/cli/cli.ts +1190 -313
- package/src/cli/format.ts +207 -13
- package/src/cli/help.ts +991 -372
- package/src/cli/pack.ts +55 -62
- package/src/cli/plugin-cli.ts +8 -5
- package/src/cli/runner-files.ts +137 -0
- package/src/cli/runner-host.ts +48 -2
- package/src/cli/skill-path.ts +51 -0
- package/src/client.ts +103 -0
- package/src/components/agent-page.tsx +446 -20
- package/src/components/agents.tsx +27 -28
- package/src/components/people.tsx +7 -3
- package/src/components/picker.tsx +79 -5
- package/src/console.tsx +1 -1
- package/src/feed-words.ts +14 -1
- package/src/i18n/en.ts +64 -11
- package/src/i18n/ko.ts +55 -9
- package/src/limits.ts +26 -0
- package/src/onboarding.ts +60 -21
- package/src/plugin/args.ts +29 -3
- package/src/plugin/context.ts +40 -7
- package/src/plugin/define.ts +18 -3
- package/src/plugin/rest-schemas.ts +3 -0
- package/src/routes.ts +2 -0
- package/src/rules.ts +5 -2
- package/src/runner/acp.ts +9 -3
- package/src/runner/claude.ts +58 -1
- package/src/runner/codex.ts +18 -3
- package/src/runner/config.ts +114 -1
- package/src/runner/desk.ts +15 -4
- package/src/runner/message.ts +88 -126
- package/src/runner/runner.ts +682 -27
- package/src/runner/slack-status.ts +423 -0
- package/src/runner/slack.ts +310 -67
- package/src/runner/types.ts +124 -13
- package/src/runner/usage.ts +16 -3
- package/src/runner.ts +4 -0
- package/src/schemas.ts +245 -13
- package/src/secret-file.ts +76 -0
- package/src/services.ts +3 -2
- package/src/setup-guide.ts +6 -5
- package/src/styles/README.md +1 -1
- package/src/styles/pages/agents.css +40 -0
- package/src/vocabulary.ts +21 -2
- package/src/wake-text.ts +133 -0
- package/dist/cli/command-words.d.ts +0 -20
- package/dist/cli/command-words.d.ts.map +0 -1
- package/dist/cli/command-words.js +0 -51
- package/dist/cli/command-words.js.map +0 -1
- package/src/cli/command-words.ts +0 -56
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, 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";
|
|
1
|
+
import type { RestAgent, RestAgentRunner, RestAgentSecret, RestAgentSecretOffer, RestArtifact, RestCategory, RestComment, RestDecision, RestDocument, RestDocumentSummary, RestDocuments, RestEvent, RestEvents, RestGoal, RestListing, RestMember, RestNotification, RestNotificationSettings, RestNotifications, RestOwnWake, RestPackNote, RestPackNoteLeft, RestPackNotes, 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
|
/**
|
|
@@ -34,9 +34,12 @@ export declare function formatWakeSource(source: NonNullable<RestAgentRunner["so
|
|
|
34
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. */
|
|
35
35
|
export declare function formatOwnWakeLine(wake: RestOwnWake): string;
|
|
36
36
|
/**
|
|
37
|
-
* How an agent account stands (ADR-0085), in a few words: the state,
|
|
38
|
-
* where its runner said, as when a usage limit resets (ADR-0150), and when its runner was
|
|
39
|
-
* heard from.
|
|
37
|
+
* How an agent account stands (ADR-0085), in a few words: the state, since when, until when
|
|
38
|
+
* where its runner said, as when a usage limit resets (ADR-0150), why, and when its runner was
|
|
39
|
+
* last heard from. The moment after `since` is the state's alone, and the reason stands apart
|
|
40
|
+
* from it, after `why:`: with when it was said where that is another moment than the state's,
|
|
41
|
+
* a turn that completed or a new conversation under a state that stayed, and with none where
|
|
42
|
+
* it came with the state or the console keeps no moment for it.
|
|
40
43
|
*/
|
|
41
44
|
export declare function formatAgentState(agent: RestAgent): string;
|
|
42
45
|
/**
|
|
@@ -46,10 +49,44 @@ export declare function formatAgentState(agent: RestAgent): string;
|
|
|
46
49
|
export declare function formatSignalLine(signal: RestSignal, delivered?: number): string;
|
|
47
50
|
/** One secret of an agent account's store (ADR-0087): its name, when it was set and by which side, and the day it ends on where one is known. Never its value. */
|
|
48
51
|
export declare function formatSecretLine(secret: RestAgentSecret): string;
|
|
52
|
+
/**
|
|
53
|
+
* One secret offered to an agent account (ADR-0169): the offer's id, the name proposed, who
|
|
54
|
+
* offers it and through which agent, and how it stands; and, on a line of its own, what the
|
|
55
|
+
* offerer said it is for, as their words. Never its value.
|
|
56
|
+
*/
|
|
57
|
+
export declare function formatSecretOffer(offer: RestAgentSecretOffer): string;
|
|
49
58
|
/** One login let in that nobody has signed in with yet (ADR-0022). */
|
|
50
59
|
export declare function formatListingLine(listing: RestListing): string;
|
|
51
|
-
/** The
|
|
52
|
-
export
|
|
60
|
+
/** The member who keeps the skills, as the command looked them up: what they are called, and whether they are out. */
|
|
61
|
+
export interface KeeperCalled {
|
|
62
|
+
readonly called: string;
|
|
63
|
+
/** Out of the workspace for now: the notes wait for the administrators until they are back. */
|
|
64
|
+
readonly away: boolean;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* The workspace as its Settings page shows it: what it is called, who sees whom, the week, the
|
|
68
|
+
* time zone, where the skills come from and who keeps them, and what tokens may last. `keeper`
|
|
69
|
+
* is the member who keeps the skills, where the command looked them up.
|
|
70
|
+
*/
|
|
71
|
+
export declare function formatWorkspace(workspace: RestWorkspace, keeper?: KeeperCalled | undefined): string;
|
|
72
|
+
/**
|
|
73
|
+
* The notes on the pack as `console skills --notes` lists them (ADR-0178): under a line that
|
|
74
|
+
* says whose they are, how many are open and whom they wait for, each skill or page with its
|
|
75
|
+
* notes, the oldest first, then the jobs no skill fit. `closing` is what the command says after
|
|
76
|
+
* them: to whoever keeps the pack, how one is closed and where a keeper's work is written.
|
|
77
|
+
*/
|
|
78
|
+
export declare function formatPackNotes(notes: RestPackNotes, page: {
|
|
79
|
+
readonly limit: number;
|
|
80
|
+
readonly offset: number;
|
|
81
|
+
readonly all: boolean;
|
|
82
|
+
}, closing: readonly string[]): string;
|
|
83
|
+
/**
|
|
84
|
+
* What leaving a note answers: its id, what it is on and whom it waits for. Where nobody keeps
|
|
85
|
+
* the skills, that is said as something to pass on: a note nobody reads mends nothing.
|
|
86
|
+
*/
|
|
87
|
+
export declare function formatPackNoteLeft(left: RestPackNoteLeft): string;
|
|
88
|
+
/** What closing a note answers: how it ended, and what was said of it. */
|
|
89
|
+
export declare function formatPackNoteClosed(note: RestPackNote): string;
|
|
53
90
|
/** One member of a project: their login, what they are in it, and since when. */
|
|
54
91
|
export declare function formatMemberLine(member: RestMember): string;
|
|
55
92
|
/** The line under a page of a listing that has more after it: how to ask for the next page. */
|
|
@@ -89,7 +126,7 @@ export declare function formatArtifact(artifact: RestArtifact, fileUrl?: (artifa
|
|
|
89
126
|
export declare function rulesMark(rules: RestProjectRules | RestRules, language?: string | null | undefined): string;
|
|
90
127
|
/**
|
|
91
128
|
* The rules that hold, under a first line that says what follows (ADR-0119): the mark, which
|
|
92
|
-
* parts there are and how long each is, and how a
|
|
129
|
+
* parts there are and how long each is, and how a take in this session leaves them out.
|
|
93
130
|
* What differs stands first and what always holds last (ADR-0120): what the project adds with
|
|
94
131
|
* the plugins' lines, then what the organization adds, then the console's rules. An agent that
|
|
95
132
|
* had read the long part once cut every later print at its head, and never saw what stood
|
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":"AAMA,OAAO,KAAK,EACV,SAAS,EACT,eAAe,EACf,eAAe,EACf,oBAAoB,EACpB,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,YAAY,EACZ,gBAAgB,EAChB,aAAa,EACb,UAAU,EACV,cAAc,EACd,UAAU,EAEV,gBAAgB,EAChB,eAAe,EACf,oBAAoB,EACpB,aAAa,EACb,mBAAmB,EACnB,gBAAgB,EAChB,oBAAoB,EACpB,oBAAoB,EACpB,wBAAwB,EACxB,iBAAiB,EACjB,WAAW,EACX,WAAW,EACX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,CAC9B,IAAI,EAAE,IAAI,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,EACxC,MAAM,EAAE,cAAc,GACrB,MAAM,CASR;AAED,oGAAoG;AACpG,wBAAgB,YAAY,CAC1B,MAAM,EAAE,gBAAgB,EACxB,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAClC,MAAM,CAwFR;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,gBAAgB,EACxB,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAClC,MAAM,EAAE,CAkBV;AAED,oEAAoE;AACpE,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,oBAAoB,GAAG,MAAM,CAarE;AAQD,uGAAuG;AACvG,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,gBAAgB,GAAG,MAAM,CAEvE;AAED,wDAAwD;AACxD,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,oBAAoB,GAAG,MAAM,CAStE;AAED,0DAA0D;AAC1D,wBAAgB,kBAAkB,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,5 @@
|
|
|
1
1
|
import { createHash } from "node:crypto";
|
|
2
|
+
import { reasonMoment } from "../agent-state.js";
|
|
2
3
|
import { usageNear, usageSaidTogether, usageStanding, usedHundredths } from "../agent-usage.js";
|
|
3
4
|
import { describeEvent } from "../feed-words.js";
|
|
4
5
|
import { NOTIFICATION_KINDS } from "../notifications.js";
|
|
@@ -143,7 +144,7 @@ export function formatAgent(agent, now) {
|
|
|
143
144
|
...(runner.product === null
|
|
144
145
|
? []
|
|
145
146
|
: [
|
|
146
|
-
`product: ${runner.product.name} ${runner.product.version ?? "of a version it did not say"}
|
|
147
|
+
`product: ${runner.product.name} ${runner.product.version ?? "of a version it did not say"}`,
|
|
147
148
|
]),
|
|
148
149
|
`set to: model ${runner.settings.model ?? OWN_CHOICE}, effort ${runner.settings.effort ?? OWN_CHOICE}`,
|
|
149
150
|
...(runner.running === null
|
|
@@ -213,19 +214,25 @@ export function formatOwnWakeLine(wake) {
|
|
|
213
214
|
return `to come ${wake.key} ${moment(wake.at)}${said}`;
|
|
214
215
|
}
|
|
215
216
|
/**
|
|
216
|
-
* How an agent account stands (ADR-0085), in a few words: the state,
|
|
217
|
-
* where its runner said, as when a usage limit resets (ADR-0150), and when its runner was
|
|
218
|
-
* heard from.
|
|
217
|
+
* How an agent account stands (ADR-0085), in a few words: the state, since when, until when
|
|
218
|
+
* where its runner said, as when a usage limit resets (ADR-0150), why, and when its runner was
|
|
219
|
+
* last heard from. The moment after `since` is the state's alone, and the reason stands apart
|
|
220
|
+
* from it, after `why:`: with when it was said where that is another moment than the state's,
|
|
221
|
+
* a turn that completed or a new conversation under a state that stayed, and with none where
|
|
222
|
+
* it came with the state or the console keeps no moment for it.
|
|
219
223
|
*/
|
|
220
224
|
export function formatAgentState(agent) {
|
|
221
225
|
const state = agent.state ?? null;
|
|
222
226
|
if (state === null) {
|
|
223
227
|
return "no runner has been heard from yet";
|
|
224
228
|
}
|
|
225
|
-
const
|
|
229
|
+
const said = reasonMoment(state);
|
|
226
230
|
const until = state.until === undefined || state.until === null ? "" : `, until ${moment(state.until)}`;
|
|
231
|
+
const why = state.reason === null
|
|
232
|
+
? ""
|
|
233
|
+
: `; why: ${state.reason.replaceAll("_", " ")}${said === undefined ? "" : `, said ${moment(said)}`}`;
|
|
227
234
|
const heard = state.heardAt === null ? "" : `; its runner was last heard from ${moment(state.heardAt)}`;
|
|
228
|
-
return `${state.state}
|
|
235
|
+
return `${state.state} since ${moment(state.since)}${until}${why}${heard}`;
|
|
229
236
|
}
|
|
230
237
|
/**
|
|
231
238
|
* One signal of an agent account's record (ADR-0085): its number, its kind, who sent it or where
|
|
@@ -255,14 +262,70 @@ export function formatSecretLine(secret) {
|
|
|
255
262
|
];
|
|
256
263
|
return `${secret.name} (${facts.join(", ")})`;
|
|
257
264
|
}
|
|
265
|
+
/**
|
|
266
|
+
* One secret offered to an agent account (ADR-0169): the offer's id, the name proposed, who
|
|
267
|
+
* offers it and through which agent, and how it stands; and, on a line of its own, what the
|
|
268
|
+
* offerer said it is for, as their words. Never its value.
|
|
269
|
+
*/
|
|
270
|
+
export function formatSecretOffer(offer) {
|
|
271
|
+
const who = offer.by === null ? "someone who is gone" : calledOf(offer.by);
|
|
272
|
+
const ended = moment(offer.decidedAt ?? offer.endsAt);
|
|
273
|
+
const stands = offer.state === "waiting"
|
|
274
|
+
? `waits until ${moment(offer.endsAt)}`
|
|
275
|
+
: offer.state === "taken"
|
|
276
|
+
? `taken ${ended}${offer.takenAs === null || offer.takenAs === offer.name ? "" : ` as ${offer.takenAs}`}`
|
|
277
|
+
: offer.state === "left"
|
|
278
|
+
? `left ${ended}`
|
|
279
|
+
: `ran out ${ended}`;
|
|
280
|
+
const facts = [
|
|
281
|
+
`from ${who}${offer.agent === null ? "" : ` through ${offer.agent}`}`,
|
|
282
|
+
`offered ${moment(offer.at)}`,
|
|
283
|
+
stands,
|
|
284
|
+
...(offer.expiresOn === null ? [] : [`ends on ${offer.expiresOn}`]),
|
|
285
|
+
];
|
|
286
|
+
const line = `${offer.id} ${offer.name} (${facts.join(", ")})`;
|
|
287
|
+
return offer.note === null ? line : `${line}\n ${who} says of it: ${offer.note}`;
|
|
288
|
+
}
|
|
258
289
|
/** The provider a listing names, as people call it. */
|
|
259
290
|
const HOST_NAMES = { gh: "GitHub", google: "Google" };
|
|
260
291
|
/** One login let in that nobody has signed in with yet (ADR-0022). */
|
|
261
292
|
export function formatListingLine(listing) {
|
|
262
293
|
return `${listing.login} (let in at ${HOST_NAMES[listing.host]}, not signed in yet)`;
|
|
263
294
|
}
|
|
264
|
-
/**
|
|
265
|
-
|
|
295
|
+
/**
|
|
296
|
+
* Who keeps the organization's skills (ADR-0178), as the workspace says it: the keeper as they
|
|
297
|
+
* are called, where the command looked them up, with the hour of their round; that the keeper
|
|
298
|
+
* is out, when the notes wait for the administrators as they do with nobody named; or that
|
|
299
|
+
* nobody keeps them. Nothing for a console that answers none of it.
|
|
300
|
+
*/
|
|
301
|
+
function keeperLine(workspace, keeper) {
|
|
302
|
+
const { keeperId, roundAt } = workspace.skills;
|
|
303
|
+
if (keeperId === undefined) {
|
|
304
|
+
return [];
|
|
305
|
+
}
|
|
306
|
+
if (keeperId === null) {
|
|
307
|
+
return [
|
|
308
|
+
"skills kept by: nobody (the notes on the skills wait for the administrators: console skills --notes; console workspace pack-keeper <login> names a keeper)",
|
|
309
|
+
];
|
|
310
|
+
}
|
|
311
|
+
if (keeper?.away === true) {
|
|
312
|
+
return [
|
|
313
|
+
`skills kept by: ${keeper.called}, who is out (the notes on the skills wait for the administrators until they are back: console skills --notes; console workspace pack-keeper <login> names another)`,
|
|
314
|
+
];
|
|
315
|
+
}
|
|
316
|
+
const round = roundAt == null
|
|
317
|
+
? "no round is kept"
|
|
318
|
+
: `an agent account that keeps them is woken for its round at ${roundAt}, where a note is new`;
|
|
319
|
+
return [
|
|
320
|
+
`skills kept by: ${keeper?.called ?? "a member"} (the notes on the skills wait for them: console skills --notes; ${round})`,
|
|
321
|
+
];
|
|
322
|
+
}
|
|
323
|
+
/**
|
|
324
|
+
* The workspace as its Settings page shows it: what it is called, who sees whom, the week, the
|
|
325
|
+
* time zone, where the skills come from and who keeps them, and what tokens may last. `keeper`
|
|
326
|
+
* is the member who keeps the skills, where the command looked them up.
|
|
327
|
+
*/
|
|
328
|
+
export function formatWorkspace(workspace, keeper) {
|
|
266
329
|
const visibility = workspace.peopleVisibility ?? "everyone";
|
|
267
330
|
const zone = workspace.timeZone ?? null;
|
|
268
331
|
const token = workspace.skills.packToken ?? null;
|
|
@@ -279,14 +342,106 @@ export function formatWorkspace(workspace) {
|
|
|
279
342
|
.map(([name, value]) => `${name}=${value}`),
|
|
280
343
|
].join(", ")}`)),
|
|
281
344
|
`people visibility: ${visibility} (${visibility === "everyone" ? "everyone sees everyone" : "a member sees only the people they share a project with; an administrator sees everyone"})`,
|
|
282
|
-
`
|
|
345
|
+
// What `auto` means is said where the week is left to it, and not beside a day that was chosen.
|
|
346
|
+
`week begins on: ${(workspace.weekStart ?? "auto") === "auto"
|
|
347
|
+
? "auto (the system default, as each device has it)"
|
|
348
|
+
: workspace.weekStart}`,
|
|
283
349
|
`time zone: ${zone ?? "none"} (${zone === null ? "moments are printed as the API gives them, in UTC" : "moments are printed in it, as ISO 8601 with its offset"})`,
|
|
284
350
|
`language: ${workspace.language ?? "none"} (${workspace.language == null ? "whoever has not chosen a language reads English, and the plugins write to them in it" : "whoever has not chosen a language reads it, and the plugins write to them in it"})`,
|
|
285
351
|
`skills: ${workspace.skills.address ?? "no address of the organization's"} at ${workspace.skills.source}`,
|
|
352
|
+
...keeperLine(workspace, keeper),
|
|
286
353
|
`SkillCDN token: ${token === null ? "none" : `set ${moment(token.setAt)}`} (${token === null ? "the organization's pack is read with none" : "the organization's pack is read with it by a project with no address and no token of its own"})`,
|
|
287
354
|
`token days at most: ${workspace.tokenDaysAtMost ?? "a person chooses"}`,
|
|
288
355
|
].join("\n");
|
|
289
356
|
}
|
|
357
|
+
/** A note's text under its line: each line of it set in, so that a list of notes reads as one. */
|
|
358
|
+
const setIn = (text) => text
|
|
359
|
+
.split("\n")
|
|
360
|
+
.map((line) => ` ${line}`)
|
|
361
|
+
.join("\n");
|
|
362
|
+
/** What a note is on, as a list groups it: the skill or the page, or that no skill fit. */
|
|
363
|
+
const NO_SKILL_FIT = "No skill fit";
|
|
364
|
+
/**
|
|
365
|
+
* Who left a note and from where: the member, the agent they left it through, the project. A
|
|
366
|
+
* member the console did not name, since the reader may not see them, is a member and no more.
|
|
367
|
+
*/
|
|
368
|
+
function noteLine(note) {
|
|
369
|
+
const by = note.by === null ? "a member" : calledOf(note.by);
|
|
370
|
+
const through = note.agent === null ? "" : ` through ${note.agent}`;
|
|
371
|
+
const from = note.project === null ? "" : `, from ${note.project}`;
|
|
372
|
+
const standing = note.state === "open" ? "" : ` ${note.state}`;
|
|
373
|
+
return ` ${note.id} ${moment(note.at).slice(0, 10)} ${by}${through}${from}${standing}`;
|
|
374
|
+
}
|
|
375
|
+
/** One note in a list: its line, what it says, and, once closed, what became of it. */
|
|
376
|
+
function formatPackNote(note) {
|
|
377
|
+
return [
|
|
378
|
+
noteLine(note),
|
|
379
|
+
setIn(note.body),
|
|
380
|
+
...(note.outcome === null ? [] : [setIn(`-> ${note.outcome}`)]),
|
|
381
|
+
].join("\n");
|
|
382
|
+
}
|
|
383
|
+
/**
|
|
384
|
+
* Whom the notes wait for, in a few words: the keeper as they are called, a keeper the console
|
|
385
|
+
* did not name to this reader, or the administrators where nobody keeps the skills.
|
|
386
|
+
*/
|
|
387
|
+
const waitsFor = (kept, keeper) => keeper !== null
|
|
388
|
+
? `kept by ${calledOf(keeper)}`
|
|
389
|
+
: kept
|
|
390
|
+
? "kept by a member"
|
|
391
|
+
: "nobody keeps the organization's skills, so they wait for the administrators";
|
|
392
|
+
/**
|
|
393
|
+
* The notes on the pack as `console skills --notes` lists them (ADR-0178): under a line that
|
|
394
|
+
* says whose they are, how many are open and whom they wait for, each skill or page with its
|
|
395
|
+
* notes, the oldest first, then the jobs no skill fit. `closing` is what the command says after
|
|
396
|
+
* them: to whoever keeps the pack, how one is closed and where a keeper's work is written.
|
|
397
|
+
*/
|
|
398
|
+
export function formatPackNotes(notes, page, closing) {
|
|
399
|
+
const whose = notes.everyones ? "everyone's" : "your own";
|
|
400
|
+
const head = `Notes on the skills, ${whose}: ${notes.open} open; ${waitsFor(notes.kept, notes.keeper)}.`;
|
|
401
|
+
if (notes.items.length === 0) {
|
|
402
|
+
return [
|
|
403
|
+
head,
|
|
404
|
+
page.offset > 0
|
|
405
|
+
? "No more on this page."
|
|
406
|
+
: page.all
|
|
407
|
+
? "None was left."
|
|
408
|
+
: "None is open here.",
|
|
409
|
+
...closing,
|
|
410
|
+
].join("\n");
|
|
411
|
+
}
|
|
412
|
+
const groups = new Map();
|
|
413
|
+
for (const note of notes.items) {
|
|
414
|
+
const key = note.path ?? NO_SKILL_FIT;
|
|
415
|
+
groups.set(key, [...(groups.get(key) ?? []), note]);
|
|
416
|
+
}
|
|
417
|
+
// The jobs no skill fit come last: they ask for a skill that is not there, which is a person's to say.
|
|
418
|
+
const ordered = [...groups].sort(([a], [b]) => Number(a === NO_SKILL_FIT) - Number(b === NO_SKILL_FIT));
|
|
419
|
+
return ([
|
|
420
|
+
head,
|
|
421
|
+
...ordered.flatMap(([key, items]) => [
|
|
422
|
+
`${key} (${items.length})`,
|
|
423
|
+
...items.map(formatPackNote),
|
|
424
|
+
]),
|
|
425
|
+
...closing,
|
|
426
|
+
].join("\n") + formatMore(notes.items.length === page.limit, page.limit, page.offset));
|
|
427
|
+
}
|
|
428
|
+
/**
|
|
429
|
+
* What leaving a note answers: its id, what it is on and whom it waits for. Where nobody keeps
|
|
430
|
+
* the skills, that is said as something to pass on: a note nobody reads mends nothing.
|
|
431
|
+
*/
|
|
432
|
+
export function formatPackNoteLeft(left) {
|
|
433
|
+
const on = left.note.path === null ? "that no skill fit" : `on ${left.note.path}`;
|
|
434
|
+
if (left.keeper !== null) {
|
|
435
|
+
return `Noted ${on} (note ${left.note.id}), for ${calledOf(left.keeper)}, who keeps the organization's skills.`;
|
|
436
|
+
}
|
|
437
|
+
return left.kept
|
|
438
|
+
? `Noted ${on} (note ${left.note.id}), for the member who keeps the organization's skills.`
|
|
439
|
+
: `Noted ${on} (note ${left.note.id}). Nobody keeps the organization's skills, so it waits for an administrator, who reads it with console skills --notes: where you report this work, say that a note waits and nobody keeps the skills.`;
|
|
440
|
+
}
|
|
441
|
+
/** What closing a note answers: how it ended, and what was said of it. */
|
|
442
|
+
export function formatPackNoteClosed(note) {
|
|
443
|
+
return `Note ${note.id} is ${note.state}: ${note.outcome ?? ""}`;
|
|
444
|
+
}
|
|
290
445
|
/** One member of a project: their login, what they are in it, and since when. */
|
|
291
446
|
export function formatMemberLine(member) {
|
|
292
447
|
return `${calledOf(member.person)} ${member.role} (since ${moment(member.addedAt).slice(0, 10)})`;
|
|
@@ -509,7 +664,7 @@ export function rulesMark(rules, language) {
|
|
|
509
664
|
const charactersOf = (text) => `${(text ?? "").trimEnd().length} characters`;
|
|
510
665
|
/**
|
|
511
666
|
* The rules that hold, under a first line that says what follows (ADR-0119): the mark, which
|
|
512
|
-
* parts there are and how long each is, and how a
|
|
667
|
+
* parts there are and how long each is, and how a take in this session leaves them out.
|
|
513
668
|
* What differs stands first and what always holds last (ADR-0120): what the project adds with
|
|
514
669
|
* the plugins' lines, then what the organization adds, then the console's rules. An agent that
|
|
515
670
|
* had read the long part once cut every later print at its head, and never saw what stood
|
|
@@ -550,7 +705,7 @@ export function formatRules(rules, language) {
|
|
|
550
705
|
}
|
|
551
706
|
// The mark ends the line bare, so that it is copied as it is.
|
|
552
707
|
const later = parts.named
|
|
553
|
-
? `
|
|
708
|
+
? ` Now that they are read, a take in this session leaves them out: console take <number> --rules ${mark}`
|
|
554
709
|
: "";
|
|
555
710
|
return [
|
|
556
711
|
`Rules ${mark}: ${follows}${later}`,
|
|
@@ -1090,8 +1245,8 @@ const toldOfTask = (follow) => follow.on
|
|
|
1090
1245
|
export function formatTaskFollow(task, follow) {
|
|
1091
1246
|
const named = `Notifications of #${task.number} ${task.title} are ${follow.on ? "on" : "off"}`;
|
|
1092
1247
|
const other = follow.on
|
|
1093
|
-
? `Turn them off: console mute ${task.number}`
|
|
1094
|
-
: `Turn them on: console follow ${task.number}`;
|
|
1248
|
+
? `Turn them off: console task mute ${task.number}`
|
|
1249
|
+
: `Turn them on: console task follow ${task.number}`;
|
|
1095
1250
|
if (follow.on ? !follow.all : !follow.usual) {
|
|
1096
1251
|
return `${named}, as your settings have it${follow.on ? ": you are told of it by the kinds you have on (console notify)" : ""}. ${other}`;
|
|
1097
1252
|
}
|