@ycodium-ai/plugin-im 0.2.3250 → 0.2.3252

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/README.md CHANGED
@@ -260,9 +260,9 @@ is sent to the chat. `chat_type` (1 single, 2 group) comes from the last inbound
260
260
  conversation and is left out when none has arrived since the plugin started, as plain text does.
261
261
  A picture goes as `image` only when it is PNG, JPEG or GIF within 10 MB (`imageMimeTypes`).
262
262
 
263
- Chat commands: `/stop`, `/continue`, `/status`, `/new`, `/sessions`, `/resume`, `/history [count]`, `/model`,
263
+ Chat commands: `/stop`, `/continue`, `/status`, `/version`, `/new`, `/sessions`, `/resume`, `/history [count]`, `/model`,
264
264
  `/plan`, `/repo`, `/group`, `/team`, `/thread`, `/help`, `/panel`. In a chat with no project
265
- `/sessions`, `/resume` and the team commands answer with the project picker. `/sessions` and `/resume` only list and
265
+ `/sessions`, `/resume` and the team commands answer with the project picker. `/version` still answers. `/sessions` and `/resume` only list and
266
266
  switch threads this plugin opened, since the host lets a plugin send only into
267
267
  its own threads. `/continue` calls `threads.turnQueue.resume` for the chat's thread
268
268
  when its queue is paused (a `/stop` or a failure pauses it), which is how WeCom
@@ -270,6 +270,8 @@ resumes a paused queue from the chat; it is not `/resume`, which already switche
270
270
 
271
271
  `/history [count]` previews the current session's recent user and assistant messages in private chats only (default 3, maximum 5), oldest first. It does not start a turn or change the session. Images and files appear as placeholders; long text is split for the platform, with a notice when the preview text is incomplete. Type the command in the chat; panels and native command menus do not list it. With the reply language set to Chinese, `会话历史 [数量]` works too.
272
272
 
273
+ `/version` answers with one line, the plugin name and its version. It takes no arguments; if anything follows it, the reply is a usage reminder. It works in private chats and groups, does not read the session, and does not start a turn. Type it; panels and native command menus do not list it. There is no Chinese alias.
274
+
273
275
  On Lark, Telegram, and the WeCom smart bot, `/panel` sends a command panel, and `/help` stays text and ends with a pointer to it. WeCom App does not implement the panel surface, so `/panel` answers with the text list and `/help` does not mention `/panel`. Lark cards and Telegram inline keyboards show all command buttons. The WeCom smart bot uses a template card from `src/wecomPanel.ts`; its main menu is limited to six buttons. Commands that do not fit are listed in `/help` and can be typed into the chat. Commands that take an argument (a thread, a project, a model) open a second view on the same message with a Back button. These lists let you reach every option by paging: Lark and Telegram show eight items per page, and WeCom shows three, leaving room for Back, Previous, and Next. A tap on the WeCom card updates that same card; when the update cannot be applied, `src/panelController.ts` posts a new card and the old one stops accepting taps. A busy placeholder is not drawn on that card: it stays as it is until the next interactive view. Telegram buttons carry only a short `pn:<version>:<index>` token (`callback_data` is capped at 64 bytes); the action stays in memory and a tap on an older keyboard version counts as expired. Each card keeps its own view stack in memory (`src/panelController.ts`), so after a restart an old card only answers that it has expired. A tap runs the same handler as the typed command and waits in the same per-chat queue as typed messages. Another platform opts in by implementing the optional `panel` surface on its adapter (`src/adapter.ts`).
274
276
 
275
277
  `/team` uses the chat's selected project. It reads the roster from the `team` plugin and
package/dist/index.js CHANGED
@@ -133557,7 +133557,10 @@ var PlanCommandMode = Literals(["toggle", "on", "off", "invalid"]);
133557
133557
  var ParsedChatCommand = Union2([
133558
133558
  SimpleChatCommand,
133559
133559
  Struct({ kind: Literal2("sessions"), arg: optionalKey2(String4) }),
133560
- Struct({ kind: Literals(["resume", "model", "repo"]), arg: String4 }),
133560
+ Struct({
133561
+ kind: Literals(["resume", "model", "repo", "version"]),
133562
+ arg: String4
133563
+ }),
133561
133564
  Struct({ kind: Literal2("history"), count: NullOr(Number5) }),
133562
133565
  Struct({
133563
133566
  kind: Literal2("preset"),
@@ -133603,6 +133606,8 @@ var parseChatCommand = (input) => {
133603
133606
  if (/^\/stop$/i.test(trimmed)) return { kind: "stop" };
133604
133607
  if (/^\/continue$/i.test(trimmed)) return { kind: "continue" };
133605
133608
  if (/^\/status$/i.test(trimmed)) return { kind: "status" };
133609
+ const versionArg = trimmed.match(/^\/version(?:\s+([\s\S]*))?$/iu);
133610
+ if (versionArg !== null) return { kind: "version", arg: (versionArg[1] ?? "").trim() };
133606
133611
  if (/^\/new$/i.test(trimmed)) return { kind: "new" };
133607
133612
  if (/^\/help$/i.test(trimmed)) return { kind: "help" };
133608
133613
  if (/^\/panel$/i.test(trimmed)) return { kind: "panel" };
@@ -133656,6 +133661,7 @@ var helpText = (t, options = {}) => [
133656
133661
  t("help.stop"),
133657
133662
  t("help.continue"),
133658
133663
  t("help.status"),
133664
+ t("help.version"),
133659
133665
  t("help.new"),
133660
133666
  t("help.sessions"),
133661
133667
  t("help.resume"),
@@ -133841,6 +133847,98 @@ ${body}`);
133841
133847
  };
133842
133848
  };
133843
133849
 
133850
+ // package.json
133851
+ var package_default = {
133852
+ name: "@ycodium-ai/plugin-im",
133853
+ version: "0.2.3252",
133854
+ description: "Talk to your agents from Telegram, WeCom, Lark, or WeChat (experimental).",
133855
+ keywords: [
133856
+ "im",
133857
+ "lark",
133858
+ "telegram",
133859
+ "wechat",
133860
+ "wecom",
133861
+ "wecom-app",
133862
+ "ycodium",
133863
+ "ycodium-plugin"
133864
+ ],
133865
+ license: "UNLICENSED",
133866
+ files: [
133867
+ "dist",
133868
+ "assets",
133869
+ "locales"
133870
+ ],
133871
+ type: "module",
133872
+ publishConfig: {
133873
+ access: "public"
133874
+ },
133875
+ scripts: {
133876
+ build: "node build.mjs",
133877
+ prepack: "pnpm run build",
133878
+ typecheck: "tsgo --noEmit && tsgo --noEmit -p tsconfig.ui.json",
133879
+ test: "vp test run"
133880
+ },
133881
+ devDependencies: {
133882
+ "@effect/vitest": "catalog:",
133883
+ "@larksuiteoapi/node-sdk": "^1.73.0",
133884
+ "@types/markdown-it": "^14.2.0",
133885
+ "@types/react": "~19.2.14",
133886
+ "@ycodium-ai/plugin-api": "workspace:*",
133887
+ effect: "catalog:",
133888
+ esbuild: "catalog:",
133889
+ "markdown-it": "^15.0.2",
133890
+ react: "19.2.6",
133891
+ "vite-plus": "catalog:",
133892
+ "ycodium-react-test-harness": "workspace:*"
133893
+ },
133894
+ ycodium: {
133895
+ plugin: "./dist/index.js",
133896
+ displayName: "Chat bridge",
133897
+ description: "Talk to your agents from Telegram, WeCom, Lark, or WeChat (experimental).",
133898
+ icon: "messageCircle",
133899
+ permissions: [
133900
+ {
133901
+ kind: "sessionProjection"
133902
+ },
133903
+ {
133904
+ kind: "threads.user"
133905
+ },
133906
+ {
133907
+ kind: "workspace.read"
133908
+ },
133909
+ {
133910
+ kind: "commands.dispatch",
133911
+ commands: [
133912
+ "thread.create",
133913
+ "thread.meta.update",
133914
+ "thread.external-messages.append",
133915
+ "thread.turn.start",
133916
+ "thread.turn.interrupt",
133917
+ "thread.approval.respond",
133918
+ "thread.user-input.respond",
133919
+ "thread.turn-intent.run",
133920
+ "thread.turn-intent.cancel",
133921
+ "thread.turn-queue.resume"
133922
+ ]
133923
+ },
133924
+ {
133925
+ kind: "ui.seats",
133926
+ seats: [
133927
+ "settings.section"
133928
+ ]
133929
+ }
133930
+ ],
133931
+ ui: {
133932
+ assets: "./assets",
133933
+ entry: "ui.js"
133934
+ }
133935
+ }
133936
+ };
133937
+
133938
+ // src/versionCommand.ts
133939
+ var pluginVersion = package_default.version;
133940
+ var versionReply = (t, arg) => arg === "" ? t("version.current", { version: pluginVersion }) : t("version.usage");
133941
+
133844
133942
  // src/commands.ts
133845
133943
  var NEEDS_PROJECT_COMMANDS = /* @__PURE__ */ new Set(["sessions", "resume", "selectTeam", "selectThread"]);
133846
133944
  var makeCommands = (core, deps) => {
@@ -133922,6 +134020,9 @@ var makeCommands = (core, deps) => {
133922
134020
  bindChat(chatKey, null);
133923
134021
  await deliver(binding, t("command.newSession"));
133924
134022
  return;
134023
+ case "version":
134024
+ await deliver(binding, versionReply(t, command.arg));
134025
+ return;
133925
134026
  case "status": {
133926
134027
  const threadId = chatOf(core.state, chatKey).threadId ?? void 0;
133927
134028
  const routed = targetOf(binding);
@@ -146251,11 +146352,16 @@ var en_default = {
146251
146352
  project: "Project: {{title}}",
146252
146353
  noProject: "No project picked yet. Send /repo to pick one."
146253
146354
  },
146355
+ version: {
146356
+ current: "Ycodium Chat bridge v{{version}}",
146357
+ usage: "Usage: /version (no arguments)."
146358
+ },
146254
146359
  help: {
146255
146360
  title: "Commands:",
146256
146361
  continue: "\xB7 /continue \u2014 resume sending after /stop or a failure paused it; the waiting messages go out",
146257
146362
  stop: "\xB7 /stop \u2014 stop the turn that is running; the session stays",
146258
146363
  status: "\xB7 /status \u2014 what is going on right now",
146364
+ version: "\xB7 /version \u2014 the chat bridge's version (no arguments)",
146259
146365
  new: "\xB7 /new \u2014 forget the current session; the next message starts a new one",
146260
146366
  team: "\xB7 /team \u2014 give this project's team a goal with each message; use /repo to pick the project first",
146261
146367
  thread: "\xB7 /thread \u2014 go back to a normal session",
@@ -147176,11 +147282,16 @@ var zh_CN_default = {
147176
147282
  project: "\u9879\u76EE\uFF1A{{title}}",
147177
147283
  noProject: "\u8FD8\u6CA1\u9009\u9879\u76EE\u3002\u53D1 /repo \u9009\u4E00\u4E2A\u3002"
147178
147284
  },
147285
+ version: {
147286
+ current: "Ycodium \u804A\u5929\u6865 v{{version}}",
147287
+ usage: "\u7528\u6CD5\uFF1A/version\uFF08\u4E0D\u5E26\u53C2\u6570\uFF09\u3002"
147288
+ },
147179
147289
  help: {
147180
147290
  title: "\u80FD\u7528\u7684\u547D\u4EE4\uFF1A",
147181
147291
  continue: "\xB7 /continue \u2014\u2014 /stop \u6216\u51FA\u9519\u6682\u505C\u4E86\u53D1\u9001\u4E4B\u540E\uFF0C\u7528\u5B83\u6062\u590D\uFF0C\u6392\u7740\u7684\u6D88\u606F\u7EE7\u7EED\u53D1\u51FA",
147182
147292
  stop: "\xB7 /stop \u2014\u2014 \u505C\u6389\u6B63\u5728\u8DD1\u7684\u8FD9\u4E00\u8F6E\uFF0C\u4F1A\u8BDD\u7559\u7740",
147183
147293
  status: "\xB7 /status \u2014\u2014 \u73B0\u5728\u5728\u5E72\u4EC0\u4E48",
147294
+ version: "\xB7 /version \u2014\u2014 \u804A\u5929\u6865\u7684\u7248\u672C\uFF08\u4E0D\u5E26\u53C2\u6570\uFF09",
147184
147295
  new: "\xB7 /new \u2014\u2014 \u5FD8\u6389\u5F53\u524D\u4F1A\u8BDD\uFF0C\u4E0B\u4E00\u53E5\u5F00\u65B0\u7684",
147185
147296
  team: "\xB7 /team \u2014\u2014 \u6BCF\u6761\u6D88\u606F\u90FD\u7ED9\u8FD9\u4E2A\u9879\u76EE\u7684\u56E2\u961F\u5F00\u4E00\u4E2A\u76EE\u6807\uFF1B\u5148\u7528 /repo \u9009\u9879\u76EE",
147186
147297
  thread: "\xB7 /thread \u2014\u2014 \u5207\u56DE\u666E\u901A\u4F1A\u8BDD",
@@ -155597,7 +155708,7 @@ var makeWecomAppAdapter = (deps) => {
155597
155708
  // src/index.ts
155598
155709
  var definition = {
155599
155710
  id: "im",
155600
- apiVersion: 28,
155711
+ apiVersion: 29,
155601
155712
  // 第二个参数只给插件自己的测试夹具:换掉文件 IO 与派发重试的等待。宿主只传 ctx。
155602
155713
  activate: async (ctx, testing = {}) => {
155603
155714
  const { dispatchSleep } = testing;
package/locales/en.json CHANGED
@@ -340,11 +340,16 @@
340
340
  "project": "Project: {{title}}",
341
341
  "noProject": "No project picked yet. Send /repo to pick one."
342
342
  },
343
+ "version": {
344
+ "current": "Ycodium Chat bridge v{{version}}",
345
+ "usage": "Usage: /version (no arguments)."
346
+ },
343
347
  "help": {
344
348
  "title": "Commands:",
345
349
  "continue": "· /continue — resume sending after /stop or a failure paused it; the waiting messages go out",
346
350
  "stop": "· /stop — stop the turn that is running; the session stays",
347
351
  "status": "· /status — what is going on right now",
352
+ "version": "· /version — the chat bridge's version (no arguments)",
348
353
  "new": "· /new — forget the current session; the next message starts a new one",
349
354
  "team": "· /team — give this project's team a goal with each message; use /repo to pick the project first",
350
355
  "thread": "· /thread — go back to a normal session",
@@ -340,11 +340,16 @@
340
340
  "project": "项目:{{title}}",
341
341
  "noProject": "还没选项目。发 /repo 选一个。"
342
342
  },
343
+ "version": {
344
+ "current": "Ycodium 聊天桥 v{{version}}",
345
+ "usage": "用法:/version(不带参数)。"
346
+ },
343
347
  "help": {
344
348
  "title": "能用的命令:",
345
349
  "continue": "· /continue —— /stop 或出错暂停了发送之后,用它恢复,排着的消息继续发出",
346
350
  "stop": "· /stop —— 停掉正在跑的这一轮,会话留着",
347
351
  "status": "· /status —— 现在在干什么",
352
+ "version": "· /version —— 聊天桥的版本(不带参数)",
348
353
  "new": "· /new —— 忘掉当前会话,下一句开新的",
349
354
  "team": "· /team —— 每条消息都给这个项目的团队开一个目标;先用 /repo 选项目",
350
355
  "thread": "· /thread —— 切回普通会话",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ycodium-ai/plugin-im",
3
- "version": "0.2.3250",
3
+ "version": "0.2.3252",
4
4
  "description": "Talk to your agents from Telegram, WeCom, Lark, or WeChat (experimental).",
5
5
  "keywords": [
6
6
  "im",
@@ -33,7 +33,7 @@
33
33
  "react": "19.2.6",
34
34
  "vite-plus": "0.2.2",
35
35
  "ycodium-react-test-harness": "0.0.0",
36
- "@ycodium-ai/plugin-api": "0.2.3250"
36
+ "@ycodium-ai/plugin-api": "0.2.3252"
37
37
  },
38
38
  "ycodium": {
39
39
  "plugin": "./dist/index.js",