@primusclaw/personal-agent 0.8.1 → 0.10.0

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.
Files changed (46) hide show
  1. package/dist/index.js +655 -143
  2. package/dist/types/assistant/chat.d.ts +8 -1
  3. package/dist/types/assistant/confirm-outcome.d.ts +2 -0
  4. package/dist/types/assistant/events.d.ts +28 -1
  5. package/dist/types/assistant/receipt.d.ts +1 -1
  6. package/dist/types/assistant/say.d.ts +10 -3
  7. package/dist/types/branding.d.ts +4 -3
  8. package/dist/types/capabilities/natural.d.ts +3 -2
  9. package/dist/types/capabilities/phrases.d.ts +6 -4
  10. package/dist/types/commands/names.d.ts +1 -1
  11. package/dist/types/config/settings.d.ts +10 -5
  12. package/dist/types/direct-chat/direct-chat.d.ts +17 -19
  13. package/dist/types/feedback/flow.d.ts +2 -0
  14. package/dist/types/feedback/issue-text.d.ts +3 -3
  15. package/dist/types/group-context/command.d.ts +1 -1
  16. package/dist/types/index.d.ts +3 -0
  17. package/dist/types/legacy-names.d.ts +21 -0
  18. package/dist/types/locales/help-lead.d.ts +2 -0
  19. package/dist/types/locales/index.d.ts +1 -0
  20. package/dist/types/locales/remote.d.ts +1 -1
  21. package/dist/types/locales/review-github.d.ts +14 -9
  22. package/dist/types/locales/review-request.d.ts +11 -5
  23. package/dist/types/locales/review-start.d.ts +6 -6
  24. package/dist/types/locales/skills.d.ts +105 -0
  25. package/dist/types/observability/metrics-catalog.d.ts +1 -1
  26. package/dist/types/observability/security-events.d.ts +1 -1
  27. package/dist/types/observe/observer.d.ts +2 -0
  28. package/dist/types/ports/claw/index.d.ts +4 -0
  29. package/dist/types/ports/claw/skills.d.ts +52 -0
  30. package/dist/types/ports/surface.d.ts +1 -1
  31. package/dist/types/proactive/deps.d.ts +1 -1
  32. package/dist/types/protocol/claw-api/assistant-events.d.ts +47 -2
  33. package/dist/types/remote/follow/speaker.d.ts +2 -0
  34. package/dist/types/remote/lines.d.ts +1 -1
  35. package/dist/types/review/connect/connections.d.ts +1 -1
  36. package/dist/types/review/consent.d.ts +5 -4
  37. package/dist/types/review/intent-check.d.ts +3 -2
  38. package/dist/types/review/service/deps.d.ts +2 -0
  39. package/dist/types/review/views.d.ts +4 -0
  40. package/dist/types/skills/card.d.ts +4 -0
  41. package/dist/types/skills/clicks.d.ts +24 -0
  42. package/dist/types/skills/command.d.ts +22 -0
  43. package/dist/types/skills/index.d.ts +5 -0
  44. package/dist/types/skills/views.d.ts +43 -0
  45. package/dist/types/typed-answer/prompt.d.ts +2 -2
  46. package/package.json +1 -1
@@ -0,0 +1,105 @@
1
+ export declare const skillText: import("./catalog.js").Catalog<{
2
+ savedTitle: (p: {
3
+ name: string;
4
+ version: number;
5
+ }) => string;
6
+ updatedTitle: (p: {
7
+ name: string;
8
+ version: number;
9
+ }) => string;
10
+ deletedTitle: (p: {
11
+ name: string;
12
+ }) => string;
13
+ disabledTitle: (p: {
14
+ name: string;
15
+ }) => string;
16
+ enabledTitle: (p: {
17
+ name: string;
18
+ }) => string;
19
+ draftTitle: (p: {
20
+ name: string;
21
+ }) => string;
22
+ whenToUse: string;
23
+ files: string;
24
+ manual: string;
25
+ autoNote: string;
26
+ draftNote: string;
27
+ undo: string;
28
+ edit: string;
29
+ save: string;
30
+ discard: string;
31
+ editTitle: (p: {
32
+ name: string;
33
+ }) => string;
34
+ editDescription: string;
35
+ editContent: string;
36
+ editSave: string;
37
+ editTooLong: (p: {
38
+ name: string;
39
+ }) => string;
40
+ undoneDeleted: (p: {
41
+ name: string;
42
+ }) => string;
43
+ undoneVersion: (p: {
44
+ name: string;
45
+ version: number;
46
+ }) => string;
47
+ undoneRestored: (p: {
48
+ name: string;
49
+ }) => string;
50
+ undoneEnabled: (p: {
51
+ name: string;
52
+ }) => string;
53
+ undoneDisabled: (p: {
54
+ name: string;
55
+ }) => string;
56
+ undoExpired: string;
57
+ undoChanged: (p: {
58
+ name: string;
59
+ }) => string;
60
+ undoDone: string;
61
+ undoFull: string;
62
+ gone: string;
63
+ failed: string;
64
+ refused: (p: {
65
+ why: string;
66
+ }) => string;
67
+ unavailable: string;
68
+ noSkills: string;
69
+ listTitle: (p: {
70
+ n: number;
71
+ }) => string;
72
+ listLine: (p: {
73
+ name: string;
74
+ version: number;
75
+ description: string;
76
+ state: string;
77
+ }) => string;
78
+ stateOff: string;
79
+ stateManual: string;
80
+ listHint: string;
81
+ showHead: (p: {
82
+ name: string;
83
+ version: number;
84
+ state: string;
85
+ }) => string;
86
+ showFiles: (p: {
87
+ files: string;
88
+ }) => string;
89
+ notFound: (p: {
90
+ name: string;
91
+ }) => string;
92
+ already: (p: {
93
+ name: string;
94
+ on: string;
95
+ }) => string;
96
+ on: string;
97
+ off: string;
98
+ usage: string;
99
+ couldNotRead: string;
100
+ draftSaved: (p: {
101
+ name: string;
102
+ version: number;
103
+ }) => string;
104
+ draftDiscarded: string;
105
+ }>;
@@ -2,7 +2,7 @@
2
2
  * The closed lists every metric label value comes from, so the number of series is fixed and no label names a person,
3
3
  * a conversation or anything a person chose.
4
4
  */
5
- /** The category fields of a security event that become labels of `clawy_security_events_total`, in this order. */
5
+ /** The category fields of a security event that become labels of `personal_agent_security_events_total`, in this order. */
6
6
  export declare const SECURITY_EVENT_LABELS: readonly ["scope", "outcome", "reason"];
7
7
  /** Why a message or task was refused by a per-person limit. */
8
8
  export declare const LIMIT_REASONS: readonly ["user_limit", "concurrency_limit"];
@@ -16,7 +16,7 @@ export type SecurityEventRecord = Readonly<{
16
16
  event: SecurityEventName;
17
17
  dropped?: readonly string[];
18
18
  } & Record<string, unknown>>;
19
- /** What the log of security events is called (the Python worker's logger name, which SIEM rules select on). */
19
+ /** What the log of security events is called (the Python worker's logger name, which SIEM rules select on: kept as it was). */
20
20
  export declare const SECURITY_LOGGER = "clawy.security";
21
21
  /**
22
22
  * The record of one security event. `event` must be one of SECURITY_EVENTS (anything else is a bug: InvariantError). A
@@ -17,6 +17,8 @@ export interface ObserverDeps {
17
17
  /** CLAW_PLUGIN_ID, named on the request an accepted suggestion becomes. */
18
18
  readonly pluginId: number | undefined;
19
19
  readonly log: Logger;
20
+ /** The bot's name in this deployment (`Settings.botName`). */
21
+ readonly botName: string;
20
22
  }
21
23
  export declare class Observer implements Observing {
22
24
  private readonly deps;
@@ -1,11 +1,13 @@
1
1
  import type { ClawAssistantPort } from "./assistant.js";
2
2
  import type { ClawRemoteAgentsPort } from "./remote-agents.js";
3
3
  import type { ClawSessionsPort } from "./sessions.js";
4
+ import type { ClawSkillsPort } from "./skills.js";
4
5
  import type { ClawMergeConfirmationsPort, ClawNotificationsPort, ClawSettingsPort, ClawTriggersPort } from "./settings.js";
5
6
  import type { ClawWorkItemsPort } from "./work-items.js";
6
7
  export type * from "./assistant.js";
7
8
  export type * from "./remote-agents.js";
8
9
  export type * from "./sessions.js";
10
+ export type * from "./skills.js";
9
11
  export type * from "./settings.js";
10
12
  export type * from "./work-items.js";
11
13
  /**
@@ -25,4 +27,6 @@ export interface ClawPort {
25
27
  readonly triggers: ClawTriggersPort;
26
28
  readonly mergeConfirmations: ClawMergeConfirmationsPort;
27
29
  readonly remoteAgents: ClawRemoteAgentsPort;
30
+ /** The person's personal skills: `/skills`, and the buttons of a skill's card. */
31
+ readonly skills: ClawSkillsPort;
28
32
  }
@@ -0,0 +1,52 @@
1
+ import type { ClawCredential } from "../../claw/credential.js";
2
+ /** One of the person's personal skills as `/skills` lists it: the current version of each name, turned off ones included. */
3
+ export interface ClawSkillEntry {
4
+ readonly name: string;
5
+ readonly version: number;
6
+ readonly description: string;
7
+ readonly enabled: boolean;
8
+ /** `manual`: used only when the person names it. */
9
+ readonly invocation: "auto" | "manual";
10
+ /** Imported from someone else. */
11
+ readonly imported: boolean;
12
+ /** When a turn last read it (ISO), or "" never. */
13
+ readonly lastUsedAt: string;
14
+ readonly files: number;
15
+ }
16
+ /** One skill whole: SKILL.md and its files. */
17
+ export interface ClawSkill extends ClawSkillEntry {
18
+ readonly content: string;
19
+ readonly fileList: readonly {
20
+ readonly path: string;
21
+ readonly sizeBytes: number;
22
+ }[];
23
+ }
24
+ /** A change Claw made that the person can take back (`change_id`), and until when (ISO, "" not said). */
25
+ export interface ClawSkillChange {
26
+ readonly version: number | null;
27
+ readonly changed: boolean;
28
+ readonly changeId: string;
29
+ readonly undoExpiresAt: string;
30
+ }
31
+ /** What an undo did: `deleted`, `restored_version`, `restored`, `enabled` or `disabled`. */
32
+ export interface ClawSkillUndone {
33
+ readonly undone: string;
34
+ readonly name: string;
35
+ readonly version: number | null;
36
+ }
37
+ /**
38
+ * The person's personal skills (`/v1/users/me/skills`, `/v1/users/me/skill-changes`), always as that person. ClawError(404): no such
39
+ * skill, change or route (a Claw without them); ClawError(409/410): the change cannot be undone (`reason`, in the error's text).
40
+ */
41
+ export interface ClawSkillsPort {
42
+ list(key: ClawCredential): Promise<ClawSkillEntry[]>;
43
+ show(key: ClawCredential, name: string): Promise<ClawSkill>;
44
+ setEnabled(key: ClawCredential, name: string, enabled: boolean): Promise<ClawSkillChange>;
45
+ remove(key: ClawCredential, name: string): Promise<ClawSkillChange>;
46
+ /** Saves new text (and description) for one of the person's skills as its next version. */
47
+ update(key: ClawCredential, name: string, skill: {
48
+ readonly content: string;
49
+ readonly description: string;
50
+ }): Promise<ClawSkillChange>;
51
+ undo(key: ClawCredential, changeId: string): Promise<ClawSkillUndone>;
52
+ }
@@ -202,7 +202,7 @@ export interface Citation {
202
202
  }
203
203
  /**
204
204
  * A reply to tap: the button's `title` and the text it sends as the person's message, `value` (they differ: "Back to
205
- * Clawy" sends "back to Clawy"; Teams: an imBack action).
205
+ * <bot>" sends "back to <bot>"; Teams: an imBack action).
206
206
  */
207
207
  export interface SuggestedReply {
208
208
  readonly title: string;
@@ -67,7 +67,7 @@ export interface ProactiveDeps {
67
67
  readonly logger: Logger;
68
68
  /** A run's event as a card may show it (`publicRunEvent` bound to the public-error service): internal errors withheld. */
69
69
  readonly publicEvent: (event: JsonObject) => JsonObject;
70
- /** The bot's display name (branding; "Clawy" by default). */
70
+ /** The bot's display name in this deployment (`Settings.botName`). */
71
71
  readonly botName: string;
72
72
  /**
73
73
  * The inbound event being handled, if any (Python CLIENT_LOCALE): held messages released while a message of the person's is
@@ -62,12 +62,55 @@ export interface AssistantConfirmWrite {
62
62
  confirmation_id: string;
63
63
  /** The short id the person may type back. */
64
64
  ref: string;
65
- /** `devenv_send`: an instruction for an agent on the person's own machine (`assistant/devenv-tools.ts`). */
66
- kind: "trigger_create" | "trigger_cancel" | "github_comment" | "devenv_send" | "devenv_hide";
65
+ /**
66
+ * `devenv_send`: an instruction for an agent on the person's own machine (`assistant/devenv-tools.ts`). `skill_save`: a personal skill
67
+ * the assistant drafted on its own, saved only when the person lets it through (`assistant/skill-writes.ts`); its message carries
68
+ * `skill_card` with what would be saved.
69
+ */
70
+ kind: "trigger_create" | "trigger_cancel" | "github_comment" | "devenv_send" | "devenv_hide" | "skill_save";
67
71
  /** What the button that lets it through says, in the language of the text. */
68
72
  allow_label: string;
69
73
  expires_at: string;
70
74
  }
75
+ /**
76
+ * A personal skill as a message shows it (`assistant/skill-writes.ts`): what was just saved, changed, turned off or deleted at the
77
+ * person's request, or what the assistant drafted for them to confirm. The message's text says the same in words, for a channel that
78
+ * draws no card. Everything here is the person's own skill, so it goes only to their own conversation, never a group's.
79
+ *
80
+ * - `saved` (a skill created, or a new version of one), `deleted`, `disabled`, `enabled`: done already. `change_id` is what an Undo
81
+ * button takes back, `POST /v1/users/me/skill-changes/{change_id}/undo` made as the person, until `undo_expires_at`: a created skill
82
+ * is deleted again, an update goes back to the version before, a delete is restored, a turn off or on is turned back. An Edit
83
+ * button changes the skill as it is now (`GET` then `PUT /v1/users/me/skills/{name}`).
84
+ * - `draft`: nothing is saved yet. The message also carries `confirm_write` (kind `skill_save`); its two buttons are Save (`allow`)
85
+ * and Discard (`deny`) on that confirmation.
86
+ */
87
+ export interface AssistantSkillCard {
88
+ kind: "saved" | "deleted" | "disabled" | "enabled" | "draft";
89
+ name: string;
90
+ /** The version now (for `draft`, the version a save would make; null when not known). */
91
+ version: number | null;
92
+ /** `saved`: true for a new skill (or one brought back), false for a new version of one the person had. */
93
+ created?: boolean;
94
+ /** When to use it, in the person's words: what decides whether it is used without being named. */
95
+ description: string;
96
+ /** `manual`: used only when the person names it. */
97
+ invocation: "auto" | "manual";
98
+ files: Array<{
99
+ path: string;
100
+ size_bytes: number;
101
+ }>;
102
+ /** The first lines of SKILL.md (at most 30 lines and 1500 characters), for the card to show; empty for `deleted`. */
103
+ preview: string;
104
+ change_id?: string;
105
+ undo_expires_at?: string;
106
+ /** `draft`: the confirmation its Save and Discard answer, the same as `confirm_write.confirmation_id`. */
107
+ confirmation_id?: string;
108
+ /**
109
+ * `draft` shown where the user has no assistant (a session event of the chat a worker saved from): no confirmation, the draft itself,
110
+ * saved with `POST /v1/users/me/skill-drafts/{draft_id}/confirm` and dropped with `DELETE` on the same path.
111
+ */
112
+ draft_id?: string;
113
+ }
71
114
  /**
72
115
  * A file a work item's worker delivered (`deliver_file`, `deliver_text`), or one the router wrote (`deliver_text`), for a channel to
73
116
  * offer as a download. The download is Claw's own link, `GET /v1/sessions/{session_id}/deliveries/{id}`, which answers only the
@@ -179,6 +222,8 @@ export interface AssistantSayPayload extends AssistantEventBase {
179
222
  */
180
223
  choices?: AssistantSayChoice;
181
224
  confirm_write?: AssistantConfirmWrite;
225
+ /** A personal skill the message is about (`AssistantSkillCard`); present only with `CLAW_USER_SKILLS_ENABLED`. */
226
+ skill_card?: AssistantSkillCard;
182
227
  /** Files the user gets with the message (a worker's deliveries, `deliveries.ts`): one download each. */
183
228
  files?: AssistantFile[];
184
229
  /** Present on a development environment session's own message: which session, and which of its three kinds of news. */
@@ -34,6 +34,8 @@ export interface SpeakerDeps {
34
34
  lang(): Lang;
35
35
  /** The chat is the agent's window itself (`direct-chat`): what the agent says is signed with its head. */
36
36
  direct(): boolean;
37
+ /** The bot's name in this deployment, for the way back to it under what the agent said. */
38
+ readonly botName: string;
37
39
  /** The paragraph that says the session ended and why (the reason a connector gave). */
38
40
  describeEnd?: (reason: string) => Promise<string>;
39
41
  /** The chat's session card, when it is the window: the text so far (`final` false) or the burst (`final` true); false when
@@ -55,7 +55,7 @@ export declare function switchedLine(label: string, host: string, lang: Lang): s
55
55
  export declare function recoveredLine(label: string, host: string, lang: Lang, interrupted: boolean, continuing: boolean): string;
56
56
  export declare function backLine(lang: Lang): string;
57
57
  /** Which messages of an attached chat stay with the assistant: said on the status card, where the person looks. */
58
- export declare function clawyLine(lang: Lang, bot: string): string;
58
+ export declare function botLine(lang: Lang, bot: string): string;
59
59
  /** How to connect a machine with the one command line Claw gave (`claw-connector pair`): run it there, it does the rest. */
60
60
  export declare function pairText(command: string, minutes: number, lang: Lang, lead?: string): string;
61
61
  /** The disconnect card's title. */
@@ -1,4 +1,4 @@
1
- /** What /whoami says the person is connected to: SaFE, GitHub (what Clawy reads it with), the deployment's own lines, memory. */
1
+ /** What /whoami says the person is connected to: SaFE, GitHub (what the bot reads it with), the deployment's own lines, memory. */
2
2
  import type { GithubConnection } from "../../claw/model.js";
3
3
  import type { GithubState } from "../../ports/github.js";
4
4
  /** A part that could not be read just now. */
@@ -1,4 +1,4 @@
1
- /** What a person agrees to with `/github bind`, and how `/github status` says what Clawy reads their GitHub with. */
1
+ /** What a person agrees to with `/github bind`, and how `/github status` says what the bot reads their GitHub with. */
2
2
  import type { GithubConnection } from "../claw/model.js";
3
3
  import type { DeviceCode } from "../ports/github.js";
4
4
  export declare const MAX_DEVICE_WAIT_SECONDS: number;
@@ -6,8 +6,9 @@ export declare const MAX_DEVICE_WAIT_SECONDS: number;
6
6
  export declare function codeMinutes(code: DeviceCode): number;
7
7
  /**
8
8
  * What `/github bind` asks the person to agree to, Chinese then English. `reads`: Claw reads GitHub with the binding too
9
- * (or could not say whether it does: then the wider use is what they are told), so the consent says that.
9
+ * (or could not say whether it does: then the wider use is what they are told), so the consent says that. `bot`: the bot's
10
+ * name in this deployment.
10
11
  */
11
- export declare function consentText(code: DeviceCode, reads: boolean): string;
12
- /** The line of `/github status` that says whether Clawy reads the person's GitHub with this binding, as Claw says it. */
12
+ export declare function consentText(code: DeviceCode, reads: boolean, bot: string): string;
13
+ /** The line of `/github status` that says whether the bot ("I") reads the person's GitHub with this binding, as Claw says it. */
13
14
  export declare function readsLine(connection: GithubConnection | null, known: boolean): string;
@@ -31,6 +31,7 @@ export declare function pullsWritten(item: string, keys: ReadonlySet<PullKey>):
31
31
  /**
32
32
  * The model's reading of a request, held to the message. `text` is what the asker wrote (with the addresses behind its
33
33
  * links), never a message it quotes: a quote may name the pull requests (`found` is read from it too), never the reviewer
34
- * or the model. `direct`: a 1:1 chat, where naming nobody means the asker.
34
+ * or the model. `direct`: a 1:1 chat, where naming nobody means the asker. `bot`: the bot's name in this deployment, for the
35
+ * example a question shows.
35
36
  */
36
- export declare function checkIntent(raw: Readonly<Record<string, unknown>>, text: string, mentions: readonly Mention[], found: readonly PullRef[], direct?: boolean): IntentVerdict;
37
+ export declare function checkIntent(raw: Readonly<Record<string, unknown>>, text: string, mentions: readonly Mention[], found: readonly PullRef[], direct: boolean, bot: string): IntentVerdict;
@@ -95,6 +95,8 @@ export interface ReviewDeps {
95
95
  readonly installUrl: string;
96
96
  /** What a review runs on when its request names no model ('' Claw's default). */
97
97
  readonly defaultModel: string;
98
+ /** The bot's name in this deployment (`Settings.botName`), in every text that names it. */
99
+ readonly botName: string;
98
100
  }
99
101
  /** The language of a text a person wrote, as the review service answers in it. */
100
102
  export type ReviewLang = Lang;
@@ -15,6 +15,8 @@ export interface ReviewModeView {
15
15
  /** How to answer by typing, for a person whose clicks may not arrive ('' none). */
16
16
  readonly hint: string;
17
17
  readonly installUrl: string;
18
+ /** The bot's name in this deployment. */
19
+ readonly bot: string;
18
20
  }
19
21
  export interface GithubConfirmView {
20
22
  readonly confirmationId: string;
@@ -32,6 +34,8 @@ export interface GithubConfirmView {
32
34
  readonly model: string;
33
35
  readonly hint: boolean;
34
36
  readonly installUrl: string;
37
+ /** The bot's name in this deployment. */
38
+ readonly bot: string;
35
39
  /** Where the merge lands ('' not read). */
36
40
  readonly base: string;
37
41
  readonly login: string;
@@ -0,0 +1,4 @@
1
+ import type { SkillCardEvent } from "../assistant/events.js";
2
+ import type { ClawSkill, ClawSkillEntry } from "../ports/claw/skills.js";
3
+ /** A skill Claw answered, as a card shows it (`kind`, and the change its Undo takes back, "" none). */
4
+ export declare function skillCardOfSkill(skill: ClawSkillEntry & Partial<Pick<ClawSkill, "content" | "fileList">>, kind: SkillCardEvent["kind"], changeId: string): SkillCardEvent;
@@ -0,0 +1,24 @@
1
+ import { ClawError } from "../claw/errors.js";
2
+ import type { ClawSkillsPort } from "../ports/claw/skills.js";
3
+ import type { ClickHandler, ClickRoute } from "../ports/routing.js";
4
+ import type { Logger } from "../ports/logger.js";
5
+ import type { StorePort } from "../ports/store/index.js";
6
+ export interface SkillClickDeps {
7
+ readonly store: Pick<StorePort, "assistantButtons">;
8
+ readonly skills: ClawSkillsPort;
9
+ readonly logger: Logger;
10
+ }
11
+ /** Why Claw refused (the `reason` of its answer), or "". */
12
+ export declare function refusalReason(error: ClawError): string;
13
+ /** Claw's own words for a refusal (its `error`), or the status. */
14
+ export declare function refusalWords(error: ClawError): string;
15
+ export declare class SkillCardClicks implements ClickHandler {
16
+ private readonly deps;
17
+ readonly verbs: readonly ["assistant_skill"];
18
+ constructor(deps: SkillClickDeps);
19
+ withCredential(click: ClickRoute, credential: string): Promise<void>;
20
+ private undo;
21
+ private undoRefused;
22
+ private edit;
23
+ private saveEdit;
24
+ }
@@ -0,0 +1,22 @@
1
+ import type { ClawSkillsPort } from "../ports/claw/skills.js";
2
+ import type { Logger } from "../ports/logger.js";
3
+ import type { CommandHandler, CommandRoute } from "../ports/routing.js";
4
+ import type { StorePort } from "../ports/store/index.js";
5
+ export interface SkillsCommandDeps {
6
+ readonly store: Pick<StorePort, "assistantButtons">;
7
+ readonly skills: ClawSkillsPort;
8
+ readonly logger: Logger;
9
+ }
10
+ /** The longest SKILL.md `/skills show` says whole (code points); a longer one is cut, with a note. */
11
+ export declare const SHOW_MAX = 3500;
12
+ export declare class SkillsCommand implements CommandHandler {
13
+ private readonly deps;
14
+ readonly name = "skills";
15
+ constructor(deps: SkillsCommandDeps);
16
+ run(route: CommandRoute, args: string): Promise<boolean>;
17
+ private dispatch;
18
+ private state;
19
+ private list;
20
+ private show;
21
+ private act;
22
+ }
@@ -0,0 +1,5 @@
1
+ /** The person's personal skills in the chat: `/skills`, and the buttons of a skill's card. */
2
+ export { SkillCardClicks, type SkillClickDeps } from "./clicks.js";
3
+ export { SkillsCommand, type SkillsCommandDeps } from "./command.js";
4
+ export { SKILL_EDIT_CONTENT, SKILL_EDIT_DESCRIPTION, SKILL_EDIT_MAX, SKILL_UNDO_KIND, SKILL_VERB } from "./views.js";
5
+ export type { SkillCardModel, SkillEditModel } from "./views.js";
@@ -0,0 +1,43 @@
1
+ /**
2
+ * The cards of the person's personal skills. What they say is `skillText`'s; a surface draws them. Their buttons carry only the id of
3
+ * the card this worker recorded (`assistant_confirm_cards`): what a press means is read from the record, never from the click.
4
+ */
5
+ import type { SkillCardEvent } from "../assistant/events.js";
6
+ /** The kind a skill card's record has: its Undo takes back the change it names (`confirmationId`, the change's id); `label` is the skill's name. */
7
+ export declare const SKILL_UNDO_KIND = "skill_undo";
8
+ /** The verb of the Undo, Edit and Save changes buttons (a draft's Save and Discard are the held write's own, `assistant_confirm`). */
9
+ export declare const SKILL_VERB = "assistant_skill";
10
+ /** The ids of the edit card's inputs. */
11
+ export declare const SKILL_EDIT_DESCRIPTION = "skill_description";
12
+ export declare const SKILL_EDIT_CONTENT = "skill_content";
13
+ /** The longest SKILL.md edited on a card (code points): a longer one is changed by telling the assistant. */
14
+ export declare const SKILL_EDIT_MAX = 6000;
15
+ /** A skill as its card shows it: what was saved, changed, turned off or deleted (with Undo and Edit), or a draft (Save, Discard). */
16
+ export interface SkillCardModel {
17
+ readonly skill: SkillCardEvent;
18
+ /** The card's record ("" none: no buttons). A draft's is its held write; any other's is its change, for Undo and Edit. */
19
+ readonly cardId: string;
20
+ /** A draft's Save, in Claw's word ("" for the catalog's). */
21
+ readonly allowLabel: string;
22
+ /** One line under it ("" none): what came of a press, or why to press again. */
23
+ readonly note: string;
24
+ /** Its buttons are gone: answered already. */
25
+ readonly ended: boolean;
26
+ readonly lang: "zh" | "en";
27
+ }
28
+ /** A skill's text and description to change, with Save changes. */
29
+ export interface SkillEditModel {
30
+ readonly cardId: string;
31
+ readonly name: string;
32
+ readonly description: string;
33
+ readonly content: string;
34
+ /** One line above Save changes ("" none): why the last Save did not go through. */
35
+ readonly note: string;
36
+ readonly lang: "zh" | "en";
37
+ }
38
+ declare module "../ports/surface.js" {
39
+ interface ViewMap {
40
+ skillCard: SkillCardModel;
41
+ skillEdit: SkillEditModel;
42
+ }
43
+ }
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * What the model is asked when it reads whether a message is the person's answer to what waits for them. The rules
3
3
  * (`read.ts`) then say what it answers; with no reading, only a message that is nothing but an answer counts. `channel`: the
4
- * chat app's full name (`SurfaceCaps.name`).
4
+ * chat app's full name (`SurfaceCaps.name`); `bot`: the bot's name in this deployment.
5
5
  */
6
- export declare const answerPrompt: (channel: string) => string;
6
+ export declare const answerPrompt: (channel: string, bot: string) => string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@primusclaw/personal-agent",
3
- "version": "0.8.1",
3
+ "version": "0.10.0",
4
4
  "description": "The personal agent's channel-neutral core: domain logic, ports and plugin interfaces.",
5
5
  "license": "MIT",
6
6
  "repository": {