@tomradex/plugin-sdk 0.2.19 → 0.2.26
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 +54 -0
- package/dist/local-agents.d.ts +30 -5
- package/dist/manifest.d.ts +1 -1
- package/dist/manifest.js +1 -1
- package/package.json +2 -2
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 {
|
package/dist/local-agents.d.ts
CHANGED
|
@@ -46,21 +46,41 @@ export interface LocalAgentPick {
|
|
|
46
46
|
/**
|
|
47
47
|
* SDK 0.2.18. An installer script the app runs for the person: `script` (a
|
|
48
48
|
* POSIX shell installer) as `curl -fsSL <url> | bash`, `powershell` as
|
|
49
|
-
* `irm <url> | iex`.
|
|
49
|
+
* `irm <url> | iex`. SDK 0.2.26 adds `npm`, a package installed with
|
|
50
|
+
* `npm install -g` — through the app's own npm on a machine without Node.
|
|
51
|
+
* Plugin code names only the address or package; these also run as the
|
|
52
|
+
* one-click setup, in the declared order, each on the platforms it fits.
|
|
50
53
|
*/
|
|
51
54
|
export type LocalAgentInstaller = {
|
|
52
55
|
script: string;
|
|
53
56
|
} | {
|
|
54
57
|
powershell: string;
|
|
58
|
+
} | {
|
|
59
|
+
npm: string;
|
|
55
60
|
};
|
|
56
61
|
/** How the agent is installed and signed in, for setup screens. */
|
|
57
62
|
export interface LocalAgentSetup {
|
|
58
|
-
/** Install commands, the recommended one first; an installer
|
|
63
|
+
/** Install commands, the recommended one first; an installer by its address or package (SDK 0.2.18, npm 0.2.26). */
|
|
59
64
|
install: (string | LocalAgentInstaller)[];
|
|
60
65
|
signIn?: string;
|
|
61
66
|
/** Signing in starts the agent itself, which then asks; otherwise the command signs in and returns. */
|
|
62
67
|
signInRuns?: boolean;
|
|
68
|
+
/**
|
|
69
|
+
* SDK 0.2.26. A sign-in command the app runs and watches itself: it opens or
|
|
70
|
+
* prints a browser address and needs no typing; the agent counts as signed in
|
|
71
|
+
* once `probe`/`signedIn` says so. Without it, signing in takes a terminal.
|
|
72
|
+
*/
|
|
73
|
+
signInRun?: {
|
|
74
|
+
args: string[];
|
|
75
|
+
};
|
|
63
76
|
docs?: string;
|
|
77
|
+
/** SDK 0.2.25. The agent's official download page, opened in the system browser beside these commands, for those without the tools they need: one that offers the CLI. */
|
|
78
|
+
download?: string;
|
|
79
|
+
/** SDK 0.2.25. The agent's desktop app, when it has one: whether installing it puts the CLI where Tomrade finds it. Setup screens say so either way. */
|
|
80
|
+
desktop?: {
|
|
81
|
+
title: string;
|
|
82
|
+
shipsCli: boolean;
|
|
83
|
+
};
|
|
64
84
|
suggested?: boolean;
|
|
65
85
|
}
|
|
66
86
|
/** The machine a CLI is looked for on, for `cli.bundled`. */
|
|
@@ -222,9 +242,14 @@ export interface LocalAgentAcp<O> {
|
|
|
222
242
|
efforts?: string[];
|
|
223
243
|
/** The agent's own words for a turn it ended on "refusal". */
|
|
224
244
|
failure?(response: Record<string, any>): string | undefined;
|
|
225
|
-
/**
|
|
226
|
-
|
|
227
|
-
|
|
245
|
+
/**
|
|
246
|
+
* Its CLI can also be handed a ticket in a terminal. SDK 0.2.23: `{ via: "link" }` says it reaches Tomrade
|
|
247
|
+
* there only through its user-level connection (`mcpLink`); absent `via` is `"session"`.
|
|
248
|
+
*/
|
|
249
|
+
terminal?: boolean | {
|
|
250
|
+
via?: "session" | "link";
|
|
251
|
+
};
|
|
252
|
+
/** @deprecated since SDK 0.2.23: `terminal: { via: "link" }`. Still read, for plugins built before it. */
|
|
228
253
|
terminalViaLink?: boolean;
|
|
229
254
|
}
|
|
230
255
|
/**
|
package/dist/manifest.d.ts
CHANGED
|
@@ -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.
|
|
3
|
+
export declare const SDK_CONTRACT = "0.2.26";
|
|
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.
|
|
5
|
+
export const SDK_CONTRACT = "0.2.26";
|
|
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.
|
|
3
|
+
"version": "0.2.26",
|
|
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.
|
|
32
|
+
"@tomradex/domain": "0.2.26",
|
|
33
33
|
"zod": "^4.4.3"
|
|
34
34
|
}
|
|
35
35
|
}
|