@primusclaw/personal-agent-teams 0.12.0 → 0.14.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 +32 -1
- package/dist/main.js +32 -1
- package/dist/types/views/assistant/index.d.ts +7 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -2141,7 +2141,8 @@ import {
|
|
|
2141
2141
|
markdownPlain,
|
|
2142
2142
|
own as own6,
|
|
2143
2143
|
cardLang,
|
|
2144
|
-
workCardText
|
|
2144
|
+
workCardText,
|
|
2145
|
+
seatDispatchText
|
|
2145
2146
|
} from "@primusclaw/personal-agent";
|
|
2146
2147
|
function workButton(op, cardId, title) {
|
|
2147
2148
|
return execute(title, `primusclaw.work_${op}`, { primusclaw: "work", op, card: cardId });
|
|
@@ -2176,6 +2177,18 @@ function workCard(model) {
|
|
|
2176
2177
|
}
|
|
2177
2178
|
return message(body, actions);
|
|
2178
2179
|
}
|
|
2180
|
+
function workDelivered(model) {
|
|
2181
|
+
const { item: item3 } = model;
|
|
2182
|
+
const lang = cardLang(model.lang, model.text, item3.title);
|
|
2183
|
+
const t = assistantCardText.in(lang);
|
|
2184
|
+
const version = item3.delivered?.version ?? item3.resultVersion;
|
|
2185
|
+
const watching = item3.delivered?.watching ?? [];
|
|
2186
|
+
const sub = watching.length ? t.deliveredWatching({ version, pulls: watching.join(lang === "zh" ? "\u3001" : ", ") }) : t.delivered({ version });
|
|
2187
|
+
const body = [header(markdownPlain(itemLabel(item3)), { tone: "good", subtitle: sub, emoji: "good" })];
|
|
2188
|
+
if (model.text) body.push(text(workCardText(model.text)));
|
|
2189
|
+
body.push(note(t.replyToChange));
|
|
2190
|
+
return message(body);
|
|
2191
|
+
}
|
|
2179
2192
|
function workDone(model) {
|
|
2180
2193
|
const accepted = model.verb === "Accepted";
|
|
2181
2194
|
const t = assistantCardText.in("en");
|
|
@@ -2286,6 +2299,7 @@ function actionCard(model) {
|
|
|
2286
2299
|
function confirmWrite(model) {
|
|
2287
2300
|
const t = assistantCardText.in(model.lang === "zh" ? "zh" : "en");
|
|
2288
2301
|
const button = (title, op) => execute(title, `primusclaw.assistant_confirm_${op}`, { primusclaw: "assistant_confirm", op, card: model.cardId });
|
|
2302
|
+
if (model.options?.length) return confirmChoice(model);
|
|
2289
2303
|
return message(
|
|
2290
2304
|
[header(t.confirmTitle, { tone: "warning", emoji: "needs_you" }), text(model.text)],
|
|
2291
2305
|
buttons([
|
|
@@ -2294,6 +2308,22 @@ function confirmWrite(model) {
|
|
|
2294
2308
|
])
|
|
2295
2309
|
);
|
|
2296
2310
|
}
|
|
2311
|
+
function confirmChoice(model) {
|
|
2312
|
+
const t = seatDispatchText.in(model.lang === "zh" ? "zh" : "en");
|
|
2313
|
+
const press = (title, op, pick) => execute(title, `primusclaw.assistant_confirm_${op}`, {
|
|
2314
|
+
primusclaw: "assistant_confirm",
|
|
2315
|
+
op,
|
|
2316
|
+
card: model.cardId,
|
|
2317
|
+
...pick === void 0 ? {} : { pick: String(pick) }
|
|
2318
|
+
});
|
|
2319
|
+
const body = [header(t.choiceTitle, { tone: "warning", emoji: "needs_you" })];
|
|
2320
|
+
if (model.text) body.push(text(model.text));
|
|
2321
|
+
(model.options ?? []).forEach((option, i) => {
|
|
2322
|
+
body.push({ type: "ActionSet", actions: [press(option.label, "allow", i)], spacing: "Small" });
|
|
2323
|
+
if (option.detail) body.push(note(markdownPlain(option.detail), { spacing: "None" }));
|
|
2324
|
+
});
|
|
2325
|
+
return message(body, buttons([press(t.cancel, "deny")], ""));
|
|
2326
|
+
}
|
|
2297
2327
|
function choiceCard(model) {
|
|
2298
2328
|
const lang = cardLang(model.lang, model.text, ...model.options);
|
|
2299
2329
|
const t = assistantCardText.in(lang);
|
|
@@ -2331,6 +2361,7 @@ var assistantRenderers = {
|
|
|
2331
2361
|
board,
|
|
2332
2362
|
confirmWrite,
|
|
2333
2363
|
workCard,
|
|
2364
|
+
workDelivered,
|
|
2334
2365
|
workDone,
|
|
2335
2366
|
workNote
|
|
2336
2367
|
};
|
package/dist/main.js
CHANGED
|
@@ -5200,7 +5200,8 @@ import {
|
|
|
5200
5200
|
markdownPlain,
|
|
5201
5201
|
own as own11,
|
|
5202
5202
|
cardLang,
|
|
5203
|
-
workCardText
|
|
5203
|
+
workCardText,
|
|
5204
|
+
seatDispatchText
|
|
5204
5205
|
} from "@primusclaw/personal-agent";
|
|
5205
5206
|
function workButton(op, cardId, title) {
|
|
5206
5207
|
return execute(title, `primusclaw.work_${op}`, { primusclaw: "work", op, card: cardId });
|
|
@@ -5235,6 +5236,18 @@ function workCard(model) {
|
|
|
5235
5236
|
}
|
|
5236
5237
|
return message(body, actions);
|
|
5237
5238
|
}
|
|
5239
|
+
function workDelivered(model) {
|
|
5240
|
+
const { item: item3 } = model;
|
|
5241
|
+
const lang = cardLang(model.lang, model.text, item3.title);
|
|
5242
|
+
const t = assistantCardText.in(lang);
|
|
5243
|
+
const version = item3.delivered?.version ?? item3.resultVersion;
|
|
5244
|
+
const watching = item3.delivered?.watching ?? [];
|
|
5245
|
+
const sub = watching.length ? t.deliveredWatching({ version, pulls: watching.join(lang === "zh" ? "\u3001" : ", ") }) : t.delivered({ version });
|
|
5246
|
+
const body = [header(markdownPlain(itemLabel(item3)), { tone: "good", subtitle: sub, emoji: "good" })];
|
|
5247
|
+
if (model.text) body.push(text2(workCardText(model.text)));
|
|
5248
|
+
body.push(note(t.replyToChange));
|
|
5249
|
+
return message(body);
|
|
5250
|
+
}
|
|
5238
5251
|
function workDone(model) {
|
|
5239
5252
|
const accepted = model.verb === "Accepted";
|
|
5240
5253
|
const t = assistantCardText.in("en");
|
|
@@ -5345,6 +5358,7 @@ function actionCard(model) {
|
|
|
5345
5358
|
function confirmWrite(model) {
|
|
5346
5359
|
const t = assistantCardText.in(model.lang === "zh" ? "zh" : "en");
|
|
5347
5360
|
const button = (title, op) => execute(title, `primusclaw.assistant_confirm_${op}`, { primusclaw: "assistant_confirm", op, card: model.cardId });
|
|
5361
|
+
if (model.options?.length) return confirmChoice(model);
|
|
5348
5362
|
return message(
|
|
5349
5363
|
[header(t.confirmTitle, { tone: "warning", emoji: "needs_you" }), text2(model.text)],
|
|
5350
5364
|
buttons([
|
|
@@ -5353,6 +5367,22 @@ function confirmWrite(model) {
|
|
|
5353
5367
|
])
|
|
5354
5368
|
);
|
|
5355
5369
|
}
|
|
5370
|
+
function confirmChoice(model) {
|
|
5371
|
+
const t = seatDispatchText.in(model.lang === "zh" ? "zh" : "en");
|
|
5372
|
+
const press = (title, op, pick) => execute(title, `primusclaw.assistant_confirm_${op}`, {
|
|
5373
|
+
primusclaw: "assistant_confirm",
|
|
5374
|
+
op,
|
|
5375
|
+
card: model.cardId,
|
|
5376
|
+
...pick === void 0 ? {} : { pick: String(pick) }
|
|
5377
|
+
});
|
|
5378
|
+
const body = [header(t.choiceTitle, { tone: "warning", emoji: "needs_you" })];
|
|
5379
|
+
if (model.text) body.push(text2(model.text));
|
|
5380
|
+
(model.options ?? []).forEach((option, i) => {
|
|
5381
|
+
body.push({ type: "ActionSet", actions: [press(option.label, "allow", i)], spacing: "Small" });
|
|
5382
|
+
if (option.detail) body.push(note(markdownPlain(option.detail), { spacing: "None" }));
|
|
5383
|
+
});
|
|
5384
|
+
return message(body, buttons([press(t.cancel, "deny")], ""));
|
|
5385
|
+
}
|
|
5356
5386
|
function choiceCard(model) {
|
|
5357
5387
|
const lang = cardLang(model.lang, model.text, ...model.options);
|
|
5358
5388
|
const t = assistantCardText.in(lang);
|
|
@@ -5390,6 +5420,7 @@ var assistantRenderers = {
|
|
|
5390
5420
|
board,
|
|
5391
5421
|
confirmWrite,
|
|
5392
5422
|
workCard,
|
|
5423
|
+
workDelivered,
|
|
5393
5424
|
workDone,
|
|
5394
5425
|
workNote
|
|
5395
5426
|
};
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* (`assistantCardText`, the work item helpers); this draws it on the card kit. The buttons carry only the id of the card the
|
|
5
5
|
* worker recorded: what a press means is read from the record, never from the click.
|
|
6
6
|
*/
|
|
7
|
-
import { type ActionCardModel, type BoardModel, type BoardRetry, type ChoiceCardModel, type ChoiceChosenModel, type ConfirmWriteModel, type Lang, type ReviewAskedOfOther, type WorkCardModel, type WorkDoneModel, type WorkNoteModel } from "@primusclaw/personal-agent";
|
|
7
|
+
import { type ActionCardModel, type BoardModel, type BoardRetry, type ChoiceCardModel, type ChoiceChosenModel, type ConfirmWriteModel, type Lang, type ReviewAskedOfOther, type WorkCardModel, type WorkDeliveredModel, type WorkDoneModel, type WorkNoteModel } from "@primusclaw/personal-agent";
|
|
8
8
|
import type { CardElement } from "../../cards/json.js";
|
|
9
9
|
import type { Tone } from "../../cards/kit.js";
|
|
10
10
|
import type { TeamsMessage } from "../registry.js";
|
|
@@ -18,6 +18,11 @@ export declare function workButtons(cardId: string, version: number, canAccept:
|
|
|
18
18
|
*/
|
|
19
19
|
export declare function noteCard(value: string, actions?: CardElement[], title?: string, tone?: Tone): TeamsMessage;
|
|
20
20
|
declare function workCard(model: WorkCardModel): TeamsMessage;
|
|
21
|
+
/**
|
|
22
|
+
* A result Claw delivered without an Accept, where the card that asked for one was: the version, the pull request the item still
|
|
23
|
+
* watches, what the assistant said, and that a reply changes it. No buttons.
|
|
24
|
+
*/
|
|
25
|
+
declare function workDelivered(model: WorkDeliveredModel): TeamsMessage;
|
|
21
26
|
declare function workDone(model: WorkDoneModel): TeamsMessage;
|
|
22
27
|
declare function workNote(model: WorkNoteModel): TeamsMessage;
|
|
23
28
|
/** The board's own buttons: Accept all (the primary button) and a Retry for each task that failed or was stopped. */
|
|
@@ -44,6 +49,7 @@ export declare const assistantRenderers: {
|
|
|
44
49
|
board: typeof board;
|
|
45
50
|
confirmWrite: typeof confirmWrite;
|
|
46
51
|
workCard: typeof workCard;
|
|
52
|
+
workDelivered: typeof workDelivered;
|
|
47
53
|
workDone: typeof workDone;
|
|
48
54
|
workNote: typeof workNote;
|
|
49
55
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@primusclaw/personal-agent-teams",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.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.14.0",
|
|
39
|
+
"@primusclaw/personal-agent-runtime": "0.14.0",
|
|
40
40
|
"zod": "^4.6.7"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|