@tomradex/plugin-sdk 0.2.19 → 0.2.24

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/im.d.ts CHANGED
@@ -65,6 +65,20 @@ export type ImInbound = {
65
65
  });
66
66
  /** How an adapter writes formatted text. `markdown` passes the common layer's Markdown through unchanged. */
67
67
  export type ImMarkdownDialect = "plain" | "markdown" | "slack" | "telegram-html" | "discord" | "lark" | "dingtalk" | "wecom";
68
+ /** SDK 0.2.20. */
69
+ export interface ImLink {
70
+ label: Localized;
71
+ url: string;
72
+ }
73
+ /** SDK 0.2.20. Something on a connection the person has to fix, such as a permission the bot lacks. */
74
+ export interface ImNotice {
75
+ /** Said once per key, until `clearNotice` withdraws it. */
76
+ key: string;
77
+ text: Localized;
78
+ /** The conversation it happened in hears one line; when it cannot, the paired people's direct chats do. */
79
+ address?: ImAddress;
80
+ link?: ImLink;
81
+ }
68
82
  export interface ImButton {
69
83
  label: string;
70
84
  token: string;
@@ -185,6 +199,19 @@ export interface ImAdapterSession {
185
199
  id: string;
186
200
  name?: string;
187
201
  };
202
+ /**
203
+ * SDK 0.2.20. Links the person may need once the connection is up, such as
204
+ * the one that adds the bot to a server; shown on the connection and in the
205
+ * pairing reply. Older hosts ignore them.
206
+ */
207
+ links?: ImLink[];
208
+ /**
209
+ * SDK 0.2.24. A conversation's name as the platform shows it (`#tomrade-work`, a group's title), for Settings to
210
+ * show instead of its id; null when it has none or the bot may not see it. Older hosts never ask.
211
+ */
212
+ describe?(address: ImAddress): Promise<{
213
+ name?: string;
214
+ } | null>;
188
215
  /**
189
216
  * SDK 0.2.19. Topics the bot opens itself, when `topics`: one per ticket
190
217
  * being worked in a group conversation. Messages people write in one arrive
@@ -232,6 +259,11 @@ export interface ImAdapterSetup {
232
259
  text: string;
233
260
  };
234
261
  docsUrl?: string;
262
+ /**
263
+ * SDK 0.2.22. How to start using the connected bot in a group or server, in order; Markdown. Settings shows them
264
+ * under the connection, then what each kind of channel does. Without them it shows generic steps.
265
+ */
266
+ groupSteps?: Localized[];
235
267
  }
236
268
  /** What the platform can do. Fields marked 0.2.5 are optional; leaving them out declares the 0.2.2 behaviour. */
237
269
  export interface ImCapabilities {
@@ -330,6 +362,28 @@ export interface ImAdapter {
330
362
  status(state: ImConnectionState, detail?: string): void;
331
363
  /** Reads only handles explicitly included in a delivery for this connection. */
332
364
  readOutboundFile(id: string): Promise<Uint8Array>;
365
+ /** SDK 0.2.20, absent on older hosts. Shows a notice on the connection and tells it where it happened. */
366
+ notice?(notice: ImNotice): void;
367
+ /** SDK 0.2.20, absent on older hosts. The notice's cause is gone; the same key may be said again. */
368
+ clearNotice?(key: string): void;
369
+ /** SDK 0.2.21, absent on older hosts. The projects a person paired on this connection may give a conversation, the one they used last first; none for anyone else. */
370
+ projects?(actorId: string): {
371
+ id: string;
372
+ name: string;
373
+ }[];
374
+ /**
375
+ * SDK 0.2.21, absent on older hosts. For an adapter's own setup: a paired person makes a group conversation a
376
+ * work channel (a thread per ticket), a status channel (news only) or a chat channel of the project, as the card
377
+ * in a group with no route does, and the conversation is told. One already allowed is left as it is. False when
378
+ * they may not.
379
+ */
380
+ allow?(request: {
381
+ actorId: string;
382
+ address: ImAddress;
383
+ kind: "work" | "status" | "chat";
384
+ projectId: string; /** SDK 0.2.24. The conversation's name, when the adapter knows it. */
385
+ name?: string;
386
+ }): boolean;
333
387
  }): Promise<ImAdapterSession>;
334
388
  }
335
389
  export interface ImApi {
@@ -222,9 +222,14 @@ export interface LocalAgentAcp<O> {
222
222
  efforts?: string[];
223
223
  /** The agent's own words for a turn it ended on "refusal". */
224
224
  failure?(response: Record<string, any>): string | undefined;
225
- /** Its CLI can also be handed a ticket in a terminal. */
226
- terminal?: boolean;
227
- /** In a terminal it reaches Tomrade only through its user-level connection (`mcpLink`). */
225
+ /**
226
+ * Its CLI can also be handed a ticket in a terminal. SDK 0.2.23: `{ via: "link" }` says it reaches Tomrade
227
+ * there only through its user-level connection (`mcpLink`); absent `via` is `"session"`.
228
+ */
229
+ terminal?: boolean | {
230
+ via?: "session" | "link";
231
+ };
232
+ /** @deprecated since SDK 0.2.23: `terminal: { via: "link" }`. Still read, for plugins built before it. */
228
233
  terminalViaLink?: boolean;
229
234
  }
230
235
  /**
@@ -1,6 +1,6 @@
1
1
  import { z } from "zod";
2
2
  /** The contract this SDK describes. A plugin's `engines.sdk` range is checked against the host's. */
3
- export declare const SDK_CONTRACT = "0.2.19";
3
+ export declare const SDK_CONTRACT = "0.2.24";
4
4
  export declare const PLUGIN_ID: RegExp;
5
5
  export declare const NAMESPACE: RegExp;
6
6
  /** The app's own names, and the official publisher's. */
package/dist/manifest.js CHANGED
@@ -2,7 +2,7 @@ import { z } from "zod";
2
2
  import { LANGUAGE_PACK_LIMITS, LanguageEntrySchema } from "./language.js";
3
3
  import { isRange, isVersion } from "./semver.js";
4
4
  /** The contract this SDK describes. A plugin's `engines.sdk` range is checked against the host's. */
5
- export const SDK_CONTRACT = "0.2.19";
5
+ export const SDK_CONTRACT = "0.2.24";
6
6
  export const PLUGIN_ID = /^[a-z0-9][a-z0-9-]{0,38}\/[a-z0-9][a-z0-9-]{0,63}$/;
7
7
  export const NAMESPACE = /^[a-z][a-z0-9_]{1,31}$/;
8
8
  /** The app's own names, and the official publisher's. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tomradex/plugin-sdk",
3
- "version": "0.2.19",
3
+ "version": "0.2.24",
4
4
  "type": "module",
5
5
  "author": "Haoyuan Tang",
6
6
  "engines": {
@@ -29,7 +29,7 @@
29
29
  "dist"
30
30
  ],
31
31
  "dependencies": {
32
- "@tomradex/domain": "0.2.19",
32
+ "@tomradex/domain": "0.2.24",
33
33
  "zod": "^4.4.3"
34
34
  }
35
35
  }