@primusclaw/personal-agent-teams 0.0.0-stage → 0.1.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/LICENSE +37 -0
- package/dist/index.js +8817 -0
- package/dist/main.js +8739 -0
- package/dist/types/activity/decorations.d.ts +40 -0
- package/dist/types/activity/feedback-loop.d.ts +9 -0
- package/dist/types/activity/inbound/actions.d.ts +55 -0
- package/dist/types/activity/inbound/identity.d.ts +36 -0
- package/dist/types/activity/inbound/index.d.ts +9 -0
- package/dist/types/activity/inbound/links.d.ts +30 -0
- package/dist/types/activity/inbound/markup.d.ts +39 -0
- package/dist/types/activity/inbound/mentions.d.ts +37 -0
- package/dist/types/activity/inbound/patterns.d.ts +21 -0
- package/dist/types/activity/inbound/quotes-html.d.ts +17 -0
- package/dist/types/activity/inbound/quotes.d.ts +32 -0
- package/dist/types/activity/inbound/schema.d.ts +44 -0
- package/dist/types/activity/inbound/to-event.d.ts +24 -0
- package/dist/types/activity/outbound.d.ts +25 -0
- package/dist/types/activity/redact-activity.d.ts +16 -0
- package/dist/types/activity/reference.d.ts +9 -0
- package/dist/types/activity/stream-activity.d.ts +16 -0
- package/dist/types/assembly/features-assistant.d.ts +42 -0
- package/dist/types/assembly/features-base.d.ts +49 -0
- package/dist/types/assembly/features-proactive.d.ts +26 -0
- package/dist/types/assembly/features-remote.d.ts +13 -0
- package/dist/types/assembly/features-review.d.ts +31 -0
- package/dist/types/assembly/features-switches.d.ts +26 -0
- package/dist/types/assembly/features-text.d.ts +35 -0
- package/dist/types/assembly/features-turns.d.ts +19 -0
- package/dist/types/assembly/features-w8.d.ts +18 -0
- package/dist/types/assembly/features.d.ts +42 -0
- package/dist/types/assembly/http.d.ts +23 -0
- package/dist/types/assembly/inbound.d.ts +18 -0
- package/dist/types/assembly/outbound.d.ts +40 -0
- package/dist/types/assembly/plugins.d.ts +20 -0
- package/dist/types/assembly/runner.d.ts +28 -0
- package/dist/types/assembly/secrets.d.ts +11 -0
- package/dist/types/assembly/timers.d.ts +14 -0
- package/dist/types/assembly/worker-services.d.ts +23 -0
- package/dist/types/assembly/worker.d.ts +19 -0
- package/dist/types/azure/keyvault-config.d.ts +24 -0
- package/dist/types/azure/keyvault.d.ts +52 -0
- package/dist/types/azure/workload-identity.d.ts +56 -0
- package/dist/types/caps.d.ts +13 -0
- package/dist/types/cards/cjk.d.ts +9 -0
- package/dist/types/cards/json.d.ts +12 -0
- package/dist/types/cards/kit.d.ts +115 -0
- package/dist/types/cards/view-buttons.d.ts +4 -0
- package/dist/types/config/env.d.ts +48 -0
- package/dist/types/config/style.d.ts +32 -0
- package/dist/types/connector/errors.d.ts +34 -0
- package/dist/types/connector/hosts.d.ts +40 -0
- package/dist/types/connector/lanes.d.ts +10 -0
- package/dist/types/connector/limits.d.ts +23 -0
- package/dist/types/connector/outbox.d.ts +97 -0
- package/dist/types/connector/py-parse.d.ts +10 -0
- package/dist/types/connector/request.d.ts +21 -0
- package/dist/types/connector/response.d.ts +9 -0
- package/dist/types/connector/retry.d.ts +57 -0
- package/dist/types/connector/timer.d.ts +18 -0
- package/dist/types/connector/tokens/assertion.d.ts +38 -0
- package/dist/types/connector/tokens/cached.d.ts +33 -0
- package/dist/types/connector/tokens/federated.d.ts +41 -0
- package/dist/types/connector/tokens/http.d.ts +11 -0
- package/dist/types/connector/tokens/imds.d.ts +26 -0
- package/dist/types/feedback/vote.d.ts +10 -0
- package/dist/types/gate/entry-env.d.ts +25 -0
- package/dist/types/gate/no-queue.d.ts +22 -0
- package/dist/types/gate/routes.d.ts +34 -0
- package/dist/types/html/entities.d.ts +2 -0
- package/dist/types/html/html5-entities.d.ts +6 -0
- package/dist/types/html/lexer.d.ts +18 -0
- package/dist/types/inbound/attachments.d.ts +36 -0
- package/dist/types/inbound/download.d.ts +34 -0
- package/dist/types/inbound/fetcher.d.ts +63 -0
- package/dist/types/inbound/names.d.ts +2 -0
- package/dist/types/inbound/types.d.ts +24 -0
- package/dist/types/index.d.ts +15 -0
- package/dist/types/main.d.ts +13 -0
- package/dist/types/messenger/acks.d.ts +23 -0
- package/dist/types/messenger/conversation.d.ts +59 -0
- package/dist/types/messenger/masker.d.ts +20 -0
- package/dist/types/messenger/render.d.ts +27 -0
- package/dist/types/observability/build-info.d.ts +7 -0
- package/dist/types/outbound/log-fields.d.ts +14 -0
- package/dist/types/outbound/outbox.d.ts +70 -0
- package/dist/types/richtext/blocks.d.ts +7 -0
- package/dist/types/richtext/check.d.ts +4 -0
- package/dist/types/richtext/constants.d.ts +15 -0
- package/dist/types/richtext/escape.d.ts +37 -0
- package/dist/types/richtext/index.d.ts +30 -0
- package/dist/types/richtext/inline.d.ts +11 -0
- package/dist/types/richtext/lines.d.ts +18 -0
- package/dist/types/richtext/scan.d.ts +17 -0
- package/dist/types/richtext/status.d.ts +9 -0
- package/dist/types/richtext/url.d.ts +2 -0
- package/dist/types/servicebus/client.d.ts +40 -0
- package/dist/types/servicebus/consumer.d.ts +53 -0
- package/dist/types/servicebus/outbox.d.ts +22 -0
- package/dist/types/stream/busy.d.ts +17 -0
- package/dist/types/stream/informative.d.ts +10 -0
- package/dist/types/stream/live-stream.d.ts +25 -0
- package/dist/types/stream/mutex.d.ts +6 -0
- package/dist/types/stream/teams-stream.d.ts +63 -0
- package/dist/types/surface.d.ts +46 -0
- package/dist/types/views/approval/index.d.ts +33 -0
- package/dist/types/views/assistant/index.d.ts +40 -0
- package/dist/types/views/commands/index.d.ts +26 -0
- package/dist/types/views/feedback/index.d.ts +23 -0
- package/dist/types/views/index.d.ts +3 -0
- package/dist/types/views/observe/index.d.ts +10 -0
- package/dist/types/views/proactive/index.d.ts +31 -0
- package/dist/types/views/registry.d.ts +21 -0
- package/dist/types/views/remote/agents-card.d.ts +10 -0
- package/dist/types/views/remote/elements.d.ts +18 -0
- package/dist/types/views/remote/hidden-card.d.ts +4 -0
- package/dist/types/views/remote/index.d.ts +12 -0
- package/dist/types/views/remote/permission-cards.d.ts +9 -0
- package/dist/types/views/remote/sessions-card.d.ts +8 -0
- package/dist/types/views/remote/small-cards.d.ts +14 -0
- package/dist/types/views/remote/status-card.d.ts +5 -0
- package/dist/types/views/remote/window-card.d.ts +5 -0
- package/dist/types/views/review/index.d.ts +21 -0
- package/dist/types/views/turn/index.d.ts +28 -0
- package/dist/types/views/turn/note.d.ts +10 -0
- package/dist/types/views/turn/stop.d.ts +8 -0
- package/dist/types/worker-api.d.ts +69 -0
- package/package.json +39 -4
- package/README.md +0 -3
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** The agents card (`/agents`) and the conversations an agent offers, as an Adaptive Card. */
|
|
2
|
+
import type { remoteView } from "@primusclaw/personal-agent";
|
|
3
|
+
import type { CardElement } from "../../cards/json.js";
|
|
4
|
+
import { type CardMessage } from "../../cards/kit.js";
|
|
5
|
+
/** The conversations of an agent block (also used where a conversation list is shown alone). */
|
|
6
|
+
export declare function conversationBlocks(items: readonly remoteView.ConversationItem[]): CardElement[];
|
|
7
|
+
/** The choice between asking for approval and not. */
|
|
8
|
+
export declare function approvalBlock(choice: remoteView.ApprovalInput): CardElement;
|
|
9
|
+
/** The agents card. */
|
|
10
|
+
export declare function agentsCard(view: remoteView.AgentsView): CardMessage;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/** The Adaptive Card elements the remote-agent cards are built of: a plain TextBlock, an ActionSet, and their buttons. */
|
|
2
|
+
import { remoteDomain } from "@primusclaw/personal-agent";
|
|
3
|
+
import type { CardElement, JsonObject } from "../../cards/json.js";
|
|
4
|
+
type RemoteButton = remoteDomain.RemoteButton;
|
|
5
|
+
type DecisionButton = remoteDomain.DecisionButton;
|
|
6
|
+
/** A wrapped TextBlock of text that is already what it should say (no punctuation is changed). */
|
|
7
|
+
export declare function block(text: string, extra?: JsonObject): CardElement;
|
|
8
|
+
/** A small subtle line right under the line above it. */
|
|
9
|
+
export declare function underNote(text: string): CardElement;
|
|
10
|
+
/** The Action.Execute of a remote-agent button: its verb names the operation, its data is what the worker reads back. */
|
|
11
|
+
export declare function remoteAction(button: RemoteButton): CardElement;
|
|
12
|
+
/** A row of buttons inside the card's body. */
|
|
13
|
+
export declare function actionSet(buttons: readonly RemoteButton[]): CardElement;
|
|
14
|
+
/** A permission card's button: the option the agent offered, by its own id. */
|
|
15
|
+
export declare function decisionAction(button: DecisionButton): CardElement;
|
|
16
|
+
/** A warning band around one small line (an unattended session). */
|
|
17
|
+
export declare function warningNote(text: string, words: (value: string) => CardElement): CardElement;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** How Teams shows the remote-agent views. */
|
|
2
|
+
import type { Renderers } from "../registry.js";
|
|
3
|
+
export { agentsCard, conversationBlocks } from "./agents-card.js";
|
|
4
|
+
export { decidedCard, permissionCard, remoteAskCard } from "./permission-cards.js";
|
|
5
|
+
export { connectBlocks, sessionsCard } from "./sessions-card.js";
|
|
6
|
+
export { disconnectButtons, disconnectCard, machineChoiceCard, modeCard, takeoverCard } from "./small-cards.js";
|
|
7
|
+
export { hiddenCard } from "./hidden-card.js";
|
|
8
|
+
export { statusCard } from "./status-card.js";
|
|
9
|
+
export { windowCard } from "./window-card.js";
|
|
10
|
+
type RemoteRenderers = Pick<Renderers, "remoteAgents" | "remoteSessions" | "remoteStatus" | "remotePermission" | "remoteAsk" | "remoteDecided" | "remoteDisconnect" | "remoteTakeover" | "remoteMachineChoice" | "remoteMode" | "remoteWindow" | "remoteHidden">;
|
|
11
|
+
/** The remote-agent renderers. */
|
|
12
|
+
export declare const REMOTE_RENDERERS: RemoteRenderers;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** A remote agent's permission request as a card, the push of one that waits on the user, and what either becomes once answered. */
|
|
2
|
+
import { type remoteView } from "@primusclaw/personal-agent";
|
|
3
|
+
import { type CardMessage } from "../../cards/kit.js";
|
|
4
|
+
/** The card for one `permissionRequest`, on the approval card's body. */
|
|
5
|
+
export declare function permissionCard(view: remoteView.PermissionView): CardMessage;
|
|
6
|
+
/** The push for an agent on the user's machine that waits on them. */
|
|
7
|
+
export declare function remoteAskCard(view: remoteView.RemoteAskView): CardMessage;
|
|
8
|
+
/** What a permission card becomes once answered. */
|
|
9
|
+
export declare function decidedCard(view: remoteView.DecidedView): CardMessage;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** The sessions card: every session the user has, per machine and agent, as an Adaptive Card. */
|
|
2
|
+
import type { remoteDomain, remoteView } from "@primusclaw/personal-agent";
|
|
3
|
+
import type { CardElement } from "../../cards/json.js";
|
|
4
|
+
import { type CardMessage } from "../../cards/kit.js";
|
|
5
|
+
/** The connect steps on a card: each command a monospace line of its own. */
|
|
6
|
+
export declare function connectBlocks(steps: remoteDomain.ConnectSteps): CardElement[];
|
|
7
|
+
/** The sessions card. */
|
|
8
|
+
export declare function sessionsCard(view: remoteView.SessionsView): CardMessage;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/** The smaller remote-agent cards: disconnecting a machine, taking over a terminal's conversation, choosing an agent, a mode. */
|
|
2
|
+
import { remoteView } from "@primusclaw/personal-agent";
|
|
3
|
+
import type { CardElement } from "../../cards/json.js";
|
|
4
|
+
import { type CardMessage } from "../../cards/kit.js";
|
|
5
|
+
/** Disconnect (the destructive primary) and Keep it: what the disconnect card's buttons carry. */
|
|
6
|
+
export declare function disconnectButtons(connectorId: string, confirm: string, keep: string): CardElement[];
|
|
7
|
+
/** Asks before a machine is disconnected. */
|
|
8
|
+
export declare function disconnectCard(view: remoteView.DisconnectView): CardMessage;
|
|
9
|
+
/** What a tap on Take over… opens. */
|
|
10
|
+
export declare function takeoverCard(view: remoteView.TakeoverView): CardMessage;
|
|
11
|
+
/** Which agent on a machine a new session goes to. */
|
|
12
|
+
export declare function machineChoiceCard(view: remoteView.MachineChoiceView): CardMessage;
|
|
13
|
+
/** What a tap on Mode opens. */
|
|
14
|
+
export declare function modeCard(view: remoteView.ModeView): CardMessage;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** The status card of a chat attached to a remote session, as an Adaptive Card. */
|
|
2
|
+
import type { remoteView } from "@primusclaw/personal-agent";
|
|
3
|
+
import { type CardMessage } from "../../cards/kit.js";
|
|
4
|
+
/** The status card: the lead (when there is one) above the header, then its lines, then the system operations. */
|
|
5
|
+
export declare function statusCard(view: remoteView.StatusView): CardMessage;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** The session card as the window, as an Adaptive Card. */
|
|
2
|
+
import { type remoteView } from "@primusclaw/personal-agent";
|
|
3
|
+
import { type CardMessage } from "../../cards/kit.js";
|
|
4
|
+
/** The session card. */
|
|
5
|
+
export declare function windowCard(view: remoteView.WindowCardView): CardMessage;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How Teams shows the review delegation's views: the confirmation-setting card, the card a reviewer confirms a held write
|
|
3
|
+
* on, a review item's card with Stop and its end, and the GitHub connect card. Single column, Action.Execute and OpenUrl
|
|
4
|
+
* only. Byte for byte the Python worker's `render.review_mode_card`, `github_confirm_card`, `review_item_card`,
|
|
5
|
+
* `ended_item_card` and `github_connect_card` (snapshots `review_mode`, `review_confirm_merge`, `review_confirm_post`,
|
|
6
|
+
* `review_start`, `review_end`, `github_connect`).
|
|
7
|
+
*/
|
|
8
|
+
import { type EndedItemView, type GithubConfirmView, type GithubConnectView, type ReviewItemView, type ReviewModeView } from "@primusclaw/personal-agent";
|
|
9
|
+
import { type CardMessage } from "../../cards/kit.js";
|
|
10
|
+
import type { Renderers } from "../registry.js";
|
|
11
|
+
/** `text` for a card TextBlock, which reads markdown: its markup characters escaped. */
|
|
12
|
+
export declare function plain(value: string): string;
|
|
13
|
+
export declare function reviewModeCard(model: ReviewModeView): CardMessage;
|
|
14
|
+
export declare function githubConfirmCard(m: GithubConfirmView): CardMessage;
|
|
15
|
+
/** The colour of a review card's band once the review ended, from the line that says how. */
|
|
16
|
+
export declare function endedTone(ended: string): "attention" | "good" | "default" | "accent";
|
|
17
|
+
export declare function reviewItemCard(m: ReviewItemView, ended?: string, summary?: string): CardMessage;
|
|
18
|
+
export declare const ITEM_CARD_ENDED_PLAIN_ZH = "\u5DF2\u7ED3\u675F\uFF0C\u89C1\u4E0A\u65B9\u7ED3\u679C";
|
|
19
|
+
export declare function endedItemCard(m: EndedItemView): CardMessage;
|
|
20
|
+
export declare function githubConnectCard(m: GithubConnectView): CardMessage;
|
|
21
|
+
export declare const REVIEW_RENDERERS: Pick<Renderers, "reviewMode" | "githubConfirm" | "reviewItem" | "endedItem" | "githubConnect">;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The turn's cards in Teams (render.py's delivery_card and changes_card): a file the agent delivered, and what the
|
|
3
|
+
* session changed under a finished answer.
|
|
4
|
+
*/
|
|
5
|
+
import { turn } from "@primusclaw/personal-agent";
|
|
6
|
+
import { message } from "../../cards/kit.js";
|
|
7
|
+
import type { CardElement } from "../../cards/json.js";
|
|
8
|
+
import { noteCard } from "./note.js";
|
|
9
|
+
import { stopCard } from "./stop.js";
|
|
10
|
+
/** Files listed on the changes card, over all repositories; the rest is one "+N more" line. */
|
|
11
|
+
export declare const CHANGES_MAX_FILES = 8;
|
|
12
|
+
/** A phone line holds about 45 characters; a longer path keeps its end ("…/dir/file.py"). */
|
|
13
|
+
export declare const CHANGES_PATH_MAX = 60;
|
|
14
|
+
/** A 1:1 chat's card for a delivered file: its name, size and caption, the image when one came along, and Download. */
|
|
15
|
+
export declare function deliveryCard(model: turn.DeliveryModel): ReturnType<typeof message>;
|
|
16
|
+
/** What the card's button carries; the session is read back from the click and checked against the chat's own. */
|
|
17
|
+
export declare function createPrButton(sessionId: string, title?: string): CardElement;
|
|
18
|
+
/**
|
|
19
|
+
* The card under a finished answer: how many files the session changed and the lines added and removed, up to
|
|
20
|
+
* CHANGES_MAX_FILES of them one line each, "+N more" for the rest, and Create PR and Open diff in Claw.
|
|
21
|
+
*/
|
|
22
|
+
export declare function changesCard(model: turn.ChangesModel): ReturnType<typeof message>;
|
|
23
|
+
export declare const TURN_RENDERERS: {
|
|
24
|
+
delivery: typeof deliveryCard;
|
|
25
|
+
changes: typeof changesCard;
|
|
26
|
+
note: typeof noteCard;
|
|
27
|
+
turnStop: typeof stopCard;
|
|
28
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { NoteModel, ViewButton } from "@primusclaw/personal-agent";
|
|
2
|
+
import type { CardElement } from "../../cards/json.js";
|
|
3
|
+
import { message } from "../../cards/kit.js";
|
|
4
|
+
/** A view's button as a card action. */
|
|
5
|
+
export declare function action(button: ViewButton): CardElement;
|
|
6
|
+
/**
|
|
7
|
+
* What replaces a card the person just clicked: a short note (under a headline in `tone`, when there is one), and the
|
|
8
|
+
* buttons again when the click has to be repeated.
|
|
9
|
+
*/
|
|
10
|
+
export declare function noteCard(model: NoteModel): ReturnType<typeof message>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { turn } from "@primusclaw/personal-agent";
|
|
2
|
+
import { message } from "../../cards/kit.js";
|
|
3
|
+
/**
|
|
4
|
+
* The Stop button of a turn that started from a phone, where Teams' own Stop under a streaming reply is greyed out. A
|
|
5
|
+
* small card of its own, one destructive button; the token names the turn it was sent for, so a press after that turn has
|
|
6
|
+
* ended stops nothing. Single column, Action.Execute only (what Teams mobile sends back).
|
|
7
|
+
*/
|
|
8
|
+
export declare function stopCard(model: turn.StopModel): ReturnType<typeof message>;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The worker process, as an assembly can build it: the public `main` builds it with the neutral plugins, a deployment's
|
|
3
|
+
* own `main` (with its identity platform, model gateway rules, extra routes) builds it with its plugins. Everything else
|
|
4
|
+
* (store, Claw client, Teams outbound, inbound queue, HTTP endpoints) is assembled from the environment the same way for
|
|
5
|
+
* both.
|
|
6
|
+
*/
|
|
7
|
+
import type { Clock, ConversationRef, IntegrationRegistry, Logger, MessageId, Plugins } from "@primusclaw/personal-agent";
|
|
8
|
+
/** The environment the worker reads its settings from (`process.env`, or a copy a test or a gate made). */
|
|
9
|
+
export type WorkerEnv = Readonly<Record<string, string | undefined>>;
|
|
10
|
+
export interface WorkerOptions {
|
|
11
|
+
/** Defaults: the system clock, a line logger on stderr, the global `fetch`. */
|
|
12
|
+
readonly clock?: Clock;
|
|
13
|
+
readonly logger?: Logger;
|
|
14
|
+
readonly fetch?: typeof fetch;
|
|
15
|
+
/**
|
|
16
|
+
* A deployment's own services (its MCP servers, its /whoami lines), registered as the worker is built, on top of
|
|
17
|
+
* whatever the plugins' `integrations` already hold. Registering a server again renames it, but cannot clear the
|
|
18
|
+
* `query` flag the plugins gave it (the registry only adds). The public worker registers none.
|
|
19
|
+
*/
|
|
20
|
+
readonly registerIntegrations?: (registry: IntegrationRegistry) => void;
|
|
21
|
+
}
|
|
22
|
+
/** A built worker: nothing runs until `run`. */
|
|
23
|
+
export interface Worker {
|
|
24
|
+
/**
|
|
25
|
+
* Start every part (HTTP endpoints, the inbound consumer or the gate's test entry, the timers) and resolve when the
|
|
26
|
+
* worker has stopped: after `stop`, or when a part fails (the promise rejects then).
|
|
27
|
+
*/
|
|
28
|
+
run(): Promise<void>;
|
|
29
|
+
/** Stop taking new work, finish what is in hand, close connections. */
|
|
30
|
+
stop(): Promise<void>;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* What a deployment's plugins may use of the worker they are built for (what the Python worker's on-behalf route used of
|
|
34
|
+
* its `Agent`). A person is named by the store's user id: their directory id (Teams: the Entra object id). `post` and the
|
|
35
|
+
* store reads work as soon as the plugins are built; `handleAsTyped` and `spawn` work once the worker is assembled (before
|
|
36
|
+
* then they throw: a plugin calls them from a request, never while it is built).
|
|
37
|
+
*/
|
|
38
|
+
export interface WorkerServices {
|
|
39
|
+
/** The people whose link recorded Claw user `clawUserId`. */
|
|
40
|
+
channelUsersOf(clawUserId: string): readonly string[];
|
|
41
|
+
/** The Claw user a person's link recorded. */
|
|
42
|
+
clawUserOf(userId: string): string | undefined;
|
|
43
|
+
/** Whether a person's link holds a key. */
|
|
44
|
+
hasKey(userId: string): boolean;
|
|
45
|
+
/** Where the bot last talked with a person (their stored conversation reference). */
|
|
46
|
+
conversationOf(userId: string): ConversationRef | undefined;
|
|
47
|
+
/** The people this worker knows by name. */
|
|
48
|
+
knownPeople(): readonly {
|
|
49
|
+
readonly name: string;
|
|
50
|
+
readonly objectId: string;
|
|
51
|
+
}[];
|
|
52
|
+
/** Post `text` into `conversation`; the id the channel gave it, or undefined when it did not say it arrived. */
|
|
53
|
+
post(conversation: ConversationRef, text: string): Promise<MessageId | undefined>;
|
|
54
|
+
/** Handle `text` as the person's own message `messageId` in `conversation`, with provenance "on_behalf". */
|
|
55
|
+
handleAsTyped(conversation: ConversationRef, userId: string, messageId: MessageId, text: string): Promise<void>;
|
|
56
|
+
/** Run `task` in the background; the worker waits for it when it stops, and logs a failure by its kind. */
|
|
57
|
+
spawn(task: () => Promise<void>): void;
|
|
58
|
+
/** One `on_behalf_message` security event (operation "on_behalf"); the fields are shape-checked like every event's. */
|
|
59
|
+
audit(fields: Readonly<Record<string, string | number | null>>): void;
|
|
60
|
+
readonly logger: Logger;
|
|
61
|
+
}
|
|
62
|
+
/** A deployment's plugins, built with the worker's services; what it leaves out is the neutral default. */
|
|
63
|
+
export type PluginFactory = (services: WorkerServices) => Partial<Plugins>;
|
|
64
|
+
/**
|
|
65
|
+
* Build the worker from `env` with `plugins` (or a factory that builds them with the worker's services). Rejects at start,
|
|
66
|
+
* before anything is served, when the settings are not usable (a missing required setting, an unreadable key file): a
|
|
67
|
+
* worker that starts must be able to answer.
|
|
68
|
+
*/
|
|
69
|
+
export type BuildWorker = (env: WorkerEnv, plugins: Plugins | PluginFactory, options?: WorkerOptions) => Promise<Worker>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,41 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@primusclaw/personal-agent-teams",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "The personal agent on Microsoft Teams: activities, Adaptive Cards, streams, Bot Connector, inbound queue, process assembly.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/AMD-AGI/PrimusClaw.git",
|
|
9
|
+
"directory": "personal-agent/packages/teams"
|
|
10
|
+
},
|
|
11
|
+
"homepage": "https://github.com/AMD-AGI/PrimusClaw/tree/main/personal-agent#readme",
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/AMD-AGI/PrimusClaw/issues"
|
|
14
|
+
},
|
|
15
|
+
"type": "module",
|
|
16
|
+
"exports": {
|
|
17
|
+
".": {
|
|
18
|
+
"types": "./dist/types/index.d.ts",
|
|
19
|
+
"default": "./dist/index.js"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"files": [
|
|
23
|
+
"dist"
|
|
24
|
+
],
|
|
25
|
+
"engines": {
|
|
26
|
+
"node": ">=26"
|
|
27
|
+
},
|
|
28
|
+
"publishConfig": {
|
|
29
|
+
"access": "public"
|
|
30
|
+
},
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"@azure/core-auth": "^1.11.0",
|
|
33
|
+
"@azure/service-bus": "^7.10.0",
|
|
34
|
+
"@primusclaw/personal-agent": "0.1.0",
|
|
35
|
+
"@primusclaw/personal-agent-runtime": "0.1.0",
|
|
36
|
+
"zod": "^4.6.7"
|
|
37
|
+
},
|
|
38
|
+
"devDependencies": {
|
|
39
|
+
"ajv": "^8.20.0"
|
|
40
|
+
}
|
|
41
|
+
}
|
package/README.md
DELETED