@primusclaw/personal-agent-teams 0.8.1 → 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.
- package/dist/index.js +68 -1
- package/dist/main.js +68 -1
- package/dist/types/views/skills/index.d.ts +19 -0
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -3581,6 +3581,72 @@ var REVIEW_RENDERERS = {
|
|
|
3581
3581
|
githubConnect: githubConnectCard
|
|
3582
3582
|
};
|
|
3583
3583
|
|
|
3584
|
+
// packages/teams/src/views/skills/index.ts
|
|
3585
|
+
import {
|
|
3586
|
+
SKILL_EDIT_CONTENT,
|
|
3587
|
+
SKILL_EDIT_DESCRIPTION,
|
|
3588
|
+
SKILL_VERB,
|
|
3589
|
+
skillText
|
|
3590
|
+
} from "@primusclaw/personal-agent";
|
|
3591
|
+
function skillButton(title, op, cardId) {
|
|
3592
|
+
return execute(title, `primusclaw.${SKILL_VERB}_${op}`, { primusclaw: SKILL_VERB, op, card: cardId });
|
|
3593
|
+
}
|
|
3594
|
+
function heading2(model) {
|
|
3595
|
+
const t = skillText.in(model.lang);
|
|
3596
|
+
const { skill } = model;
|
|
3597
|
+
const version = skill.version ?? 1;
|
|
3598
|
+
switch (skill.kind) {
|
|
3599
|
+
case "saved":
|
|
3600
|
+
return skill.created ? { title: t.savedTitle({ name: skill.name, version }), tone: "good", emoji: "good" } : { title: t.updatedTitle({ name: skill.name, version }), tone: "good", emoji: "good" };
|
|
3601
|
+
case "deleted":
|
|
3602
|
+
return { title: t.deletedTitle({ name: skill.name }), tone: "default", emoji: "dropped" };
|
|
3603
|
+
case "disabled":
|
|
3604
|
+
return { title: t.disabledTitle({ name: skill.name }), tone: "default", emoji: "notice" };
|
|
3605
|
+
case "enabled":
|
|
3606
|
+
return { title: t.enabledTitle({ name: skill.name }), tone: "good", emoji: "good" };
|
|
3607
|
+
case "draft":
|
|
3608
|
+
return { title: t.draftTitle({ name: skill.name }), tone: "warning", emoji: "needs_you" };
|
|
3609
|
+
}
|
|
3610
|
+
}
|
|
3611
|
+
function skillCard(model) {
|
|
3612
|
+
const t = skillText.in(model.lang);
|
|
3613
|
+
const { skill } = model;
|
|
3614
|
+
const head = heading2(model);
|
|
3615
|
+
const body = [header(head.title, { tone: head.tone, emoji: head.emoji })];
|
|
3616
|
+
body.push(
|
|
3617
|
+
...facts([
|
|
3618
|
+
[t.whenToUse, skill.description],
|
|
3619
|
+
[t.files, skill.files.join(", ")]
|
|
3620
|
+
])
|
|
3621
|
+
);
|
|
3622
|
+
if (skill.kind === "saved" || skill.kind === "draft") {
|
|
3623
|
+
body.push(note(skill.kind === "draft" ? t.draftNote : skill.manual ? t.manual : t.autoNote));
|
|
3624
|
+
}
|
|
3625
|
+
if (skill.preview) body.push(...fold("skill-preview", [text(skill.preview, { subtle: true })], "SKILL.md"));
|
|
3626
|
+
if (model.note) body.push(text(model.note, { weight: "Bolder" }));
|
|
3627
|
+
if (model.ended || !model.cardId) return message(body);
|
|
3628
|
+
if (skill.kind === "draft") {
|
|
3629
|
+
const confirm = (title, op) => execute(title, `primusclaw.assistant_confirm_${op}`, { primusclaw: "assistant_confirm", op, card: model.cardId });
|
|
3630
|
+
return message(body, buttons([confirm(model.allowLabel || t.save, "allow"), confirm(t.discard, "deny")]));
|
|
3631
|
+
}
|
|
3632
|
+
const actions = [skillButton(t.undo, "undo", model.cardId)];
|
|
3633
|
+
if (skill.kind === "saved") actions.push(skillButton(t.edit, "edit", model.cardId));
|
|
3634
|
+
return message(body, buttons(actions, ""));
|
|
3635
|
+
}
|
|
3636
|
+
function skillEdit(model) {
|
|
3637
|
+
const t = skillText.in(model.lang);
|
|
3638
|
+
const body = [
|
|
3639
|
+
header(t.editTitle({ name: model.name }), { tone: "accent", emoji: "changes" }),
|
|
3640
|
+
text(t.editDescription, { weight: "Bolder" }),
|
|
3641
|
+
{ type: "Input.Text", id: SKILL_EDIT_DESCRIPTION, value: model.description, maxLength: 300, isMultiline: true },
|
|
3642
|
+
text(t.editContent, { weight: "Bolder" }),
|
|
3643
|
+
{ type: "Input.Text", id: SKILL_EDIT_CONTENT, value: model.content, isMultiline: true }
|
|
3644
|
+
];
|
|
3645
|
+
if (model.note) body.push(text(model.note, { weight: "Bolder" }));
|
|
3646
|
+
return message(body, buttons([skillButton(t.editSave, "save_edit", model.cardId)]));
|
|
3647
|
+
}
|
|
3648
|
+
var skillRenderers = { skillCard, skillEdit };
|
|
3649
|
+
|
|
3584
3650
|
// packages/teams/src/views/turn/index.ts
|
|
3585
3651
|
import { pyRstrip as pyRstrip2, turn as turn2 } from "@primusclaw/personal-agent";
|
|
3586
3652
|
|
|
@@ -3668,7 +3734,8 @@ var RENDERERS = {
|
|
|
3668
3734
|
...TURN_RENDERERS,
|
|
3669
3735
|
...REVIEW_RENDERERS,
|
|
3670
3736
|
...FEEDBACK_RENDERERS,
|
|
3671
|
-
...OBSERVE_RENDERERS
|
|
3737
|
+
...OBSERVE_RENDERERS,
|
|
3738
|
+
...skillRenderers
|
|
3672
3739
|
};
|
|
3673
3740
|
|
|
3674
3741
|
// packages/teams/src/assembly/worker.ts
|
package/dist/main.js
CHANGED
|
@@ -6092,6 +6092,72 @@ var REVIEW_RENDERERS = {
|
|
|
6092
6092
|
githubConnect: githubConnectCard
|
|
6093
6093
|
};
|
|
6094
6094
|
|
|
6095
|
+
// packages/teams/src/views/skills/index.ts
|
|
6096
|
+
import {
|
|
6097
|
+
SKILL_EDIT_CONTENT,
|
|
6098
|
+
SKILL_EDIT_DESCRIPTION,
|
|
6099
|
+
SKILL_VERB,
|
|
6100
|
+
skillText
|
|
6101
|
+
} from "@primusclaw/personal-agent";
|
|
6102
|
+
function skillButton(title, op, cardId) {
|
|
6103
|
+
return execute(title, `primusclaw.${SKILL_VERB}_${op}`, { primusclaw: SKILL_VERB, op, card: cardId });
|
|
6104
|
+
}
|
|
6105
|
+
function heading2(model) {
|
|
6106
|
+
const t = skillText.in(model.lang);
|
|
6107
|
+
const { skill } = model;
|
|
6108
|
+
const version = skill.version ?? 1;
|
|
6109
|
+
switch (skill.kind) {
|
|
6110
|
+
case "saved":
|
|
6111
|
+
return skill.created ? { title: t.savedTitle({ name: skill.name, version }), tone: "good", emoji: "good" } : { title: t.updatedTitle({ name: skill.name, version }), tone: "good", emoji: "good" };
|
|
6112
|
+
case "deleted":
|
|
6113
|
+
return { title: t.deletedTitle({ name: skill.name }), tone: "default", emoji: "dropped" };
|
|
6114
|
+
case "disabled":
|
|
6115
|
+
return { title: t.disabledTitle({ name: skill.name }), tone: "default", emoji: "notice" };
|
|
6116
|
+
case "enabled":
|
|
6117
|
+
return { title: t.enabledTitle({ name: skill.name }), tone: "good", emoji: "good" };
|
|
6118
|
+
case "draft":
|
|
6119
|
+
return { title: t.draftTitle({ name: skill.name }), tone: "warning", emoji: "needs_you" };
|
|
6120
|
+
}
|
|
6121
|
+
}
|
|
6122
|
+
function skillCard(model) {
|
|
6123
|
+
const t = skillText.in(model.lang);
|
|
6124
|
+
const { skill } = model;
|
|
6125
|
+
const head = heading2(model);
|
|
6126
|
+
const body = [header(head.title, { tone: head.tone, emoji: head.emoji })];
|
|
6127
|
+
body.push(
|
|
6128
|
+
...facts([
|
|
6129
|
+
[t.whenToUse, skill.description],
|
|
6130
|
+
[t.files, skill.files.join(", ")]
|
|
6131
|
+
])
|
|
6132
|
+
);
|
|
6133
|
+
if (skill.kind === "saved" || skill.kind === "draft") {
|
|
6134
|
+
body.push(note(skill.kind === "draft" ? t.draftNote : skill.manual ? t.manual : t.autoNote));
|
|
6135
|
+
}
|
|
6136
|
+
if (skill.preview) body.push(...fold("skill-preview", [text2(skill.preview, { subtle: true })], "SKILL.md"));
|
|
6137
|
+
if (model.note) body.push(text2(model.note, { weight: "Bolder" }));
|
|
6138
|
+
if (model.ended || !model.cardId) return message(body);
|
|
6139
|
+
if (skill.kind === "draft") {
|
|
6140
|
+
const confirm = (title, op) => execute(title, `primusclaw.assistant_confirm_${op}`, { primusclaw: "assistant_confirm", op, card: model.cardId });
|
|
6141
|
+
return message(body, buttons([confirm(model.allowLabel || t.save, "allow"), confirm(t.discard, "deny")]));
|
|
6142
|
+
}
|
|
6143
|
+
const actions = [skillButton(t.undo, "undo", model.cardId)];
|
|
6144
|
+
if (skill.kind === "saved") actions.push(skillButton(t.edit, "edit", model.cardId));
|
|
6145
|
+
return message(body, buttons(actions, ""));
|
|
6146
|
+
}
|
|
6147
|
+
function skillEdit(model) {
|
|
6148
|
+
const t = skillText.in(model.lang);
|
|
6149
|
+
const body = [
|
|
6150
|
+
header(t.editTitle({ name: model.name }), { tone: "accent", emoji: "changes" }),
|
|
6151
|
+
text2(t.editDescription, { weight: "Bolder" }),
|
|
6152
|
+
{ type: "Input.Text", id: SKILL_EDIT_DESCRIPTION, value: model.description, maxLength: 300, isMultiline: true },
|
|
6153
|
+
text2(t.editContent, { weight: "Bolder" }),
|
|
6154
|
+
{ type: "Input.Text", id: SKILL_EDIT_CONTENT, value: model.content, isMultiline: true }
|
|
6155
|
+
];
|
|
6156
|
+
if (model.note) body.push(text2(model.note, { weight: "Bolder" }));
|
|
6157
|
+
return message(body, buttons([skillButton(t.editSave, "save_edit", model.cardId)]));
|
|
6158
|
+
}
|
|
6159
|
+
var skillRenderers = { skillCard, skillEdit };
|
|
6160
|
+
|
|
6095
6161
|
// packages/teams/src/views/turn/index.ts
|
|
6096
6162
|
import { pyRstrip as pyRstrip5, turn as turn2 } from "@primusclaw/personal-agent";
|
|
6097
6163
|
|
|
@@ -6179,7 +6245,8 @@ var RENDERERS = {
|
|
|
6179
6245
|
...TURN_RENDERERS,
|
|
6180
6246
|
...REVIEW_RENDERERS,
|
|
6181
6247
|
...FEEDBACK_RENDERERS,
|
|
6182
|
-
...OBSERVE_RENDERERS
|
|
6248
|
+
...OBSERVE_RENDERERS,
|
|
6249
|
+
...skillRenderers
|
|
6183
6250
|
};
|
|
6184
6251
|
|
|
6185
6252
|
// packages/teams/src/assembly/inbound.ts
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The cards of the person's personal skills: what was saved, changed, turned off or deleted (Undo; Edit for a saved one), a draft to
|
|
3
|
+
* save (Save and Discard, the held write's own buttons), and the form that edits one. What they say is core's (`skillText`); the
|
|
4
|
+
* buttons carry only the id of the card the worker recorded, never what the press means.
|
|
5
|
+
*/
|
|
6
|
+
import { type SkillCardModel, type SkillEditModel } from "@primusclaw/personal-agent";
|
|
7
|
+
import type { TeamsMessage } from "../registry.js";
|
|
8
|
+
/**
|
|
9
|
+
* A skill's card: what it is for and its files, the start of SKILL.md folded away, then its buttons. A draft's are Save and Discard
|
|
10
|
+
* (the held write's own verb, answered as any held write is); anything done already has Undo, and a saved one Edit too.
|
|
11
|
+
*/
|
|
12
|
+
declare function skillCard(model: SkillCardModel): TeamsMessage;
|
|
13
|
+
/** The form that edits a skill: its description and its whole SKILL.md, and Save changes. */
|
|
14
|
+
declare function skillEdit(model: SkillEditModel): TeamsMessage;
|
|
15
|
+
export declare const skillRenderers: {
|
|
16
|
+
skillCard: typeof skillCard;
|
|
17
|
+
skillEdit: typeof skillEdit;
|
|
18
|
+
};
|
|
19
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@primusclaw/personal-agent-teams",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "The personal agent on Microsoft Teams: activities, Adaptive Cards, streams, Bot Connector, inbound queue, and the worker's Teams surface.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@azure/core-auth": "^1.11.0",
|
|
37
37
|
"@azure/service-bus": "^7.10.0",
|
|
38
|
-
"@primusclaw/personal-agent": "0.
|
|
39
|
-
"@primusclaw/personal-agent-runtime": "0.
|
|
38
|
+
"@primusclaw/personal-agent": "0.9.0",
|
|
39
|
+
"@primusclaw/personal-agent-runtime": "0.9.0",
|
|
40
40
|
"zod": "^4.6.7"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|