@primusclaw/personal-agent 0.8.0 → 0.9.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 (33) hide show
  1. package/dist/index.js +490 -19
  2. package/dist/types/assistant/chat.d.ts +1 -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/say.d.ts +9 -2
  6. package/dist/types/commands/names.d.ts +1 -1
  7. package/dist/types/config/settings.d.ts +25 -25
  8. package/dist/types/direct-chat/direct-chat.d.ts +1 -1
  9. package/dist/types/group-context/buffer.d.ts +1 -1
  10. package/dist/types/guardrails/operations.d.ts +20 -4
  11. package/dist/types/index.d.ts +2 -0
  12. package/dist/types/limits/user-limits.d.ts +3 -3
  13. package/dist/types/locales/index.d.ts +1 -0
  14. package/dist/types/locales/skills.d.ts +105 -0
  15. package/dist/types/locales/transparency.d.ts +1 -1
  16. package/dist/types/observe/observer.d.ts +1 -1
  17. package/dist/types/ports/claw/index.d.ts +4 -0
  18. package/dist/types/ports/claw/skills.d.ts +52 -0
  19. package/dist/types/ports/secret-source.d.ts +3 -2
  20. package/dist/types/ports/store/policy.d.ts +3 -3
  21. package/dist/types/protocol/claw-api/assistant-events.d.ts +47 -2
  22. package/dist/types/remote/context.d.ts +1 -1
  23. package/dist/types/remote/follow/control.d.ts +1 -1
  24. package/dist/types/remote/state.d.ts +1 -1
  25. package/dist/types/routing/credentials.d.ts +1 -1
  26. package/dist/types/routing/deps.d.ts +1 -1
  27. package/dist/types/skills/card.d.ts +4 -0
  28. package/dist/types/skills/clicks.d.ts +24 -0
  29. package/dist/types/skills/command.d.ts +22 -0
  30. package/dist/types/skills/index.d.ts +5 -0
  31. package/dist/types/skills/views.d.ts +43 -0
  32. package/dist/types/subscriptions/subscriptions.d.ts +1 -1
  33. package/package.json +1 -1
@@ -28,7 +28,7 @@ export interface RouterConfig {
28
28
  readonly reviewModel: string;
29
29
  /** A turn refused for want of a gateway key runs again on this model ("" never). */
30
30
  readonly fallbackModel: string;
31
- /** Ordinary chats run on exchanged tokens (TEAMS_EXCHANGE_FOR_CHAT) instead of the linked key. */
31
+ /** Ordinary chats run on exchanged tokens (PA_EXCHANGE_FOR_CHAT) instead of the linked key. */
32
32
  readonly exchangeForChat: boolean;
33
33
  /** The parts of help that need Claw switches this worker cannot read. */
34
34
  readonly briefEnabled: boolean;
@@ -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
+ }
@@ -16,7 +16,7 @@ export interface SubscriptionsOptions {
16
16
  readonly baseUrl: string;
17
17
  /** ASSISTANT_ENABLED: subscriptions also get the assistant's event types. */
18
18
  readonly assistant?: boolean;
19
- /** TEAMS_ASSISTANT_UNDERSTANDING_USERS: whose subscription also asks for `assistant.action`. */
19
+ /** PA_ASSISTANT_UNDERSTANDING_USERS: whose subscription also asks for `assistant.action`. */
20
20
  readonly understood?: (aadId: string) => boolean;
21
21
  /** ASSISTANT_USERS: whose subscription gets the assistant's types (an empty list: everybody's). */
22
22
  readonly assistantFor?: (aadId: string) => boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@primusclaw/personal-agent",
3
- "version": "0.8.0",
3
+ "version": "0.9.0",
4
4
  "description": "The personal agent's channel-neutral core: domain logic, ports and plugin interfaces.",
5
5
  "license": "MIT",
6
6
  "repository": {