@ycodium-ai/plugin-im 0.2.2554 → 0.2.2566

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
@@ -56,9 +56,9 @@ switch threads this plugin opened, since the host lets a plugin send only into
56
56
  its own threads.
57
57
 
58
58
  The **Reply language** setting (Chinese by default, or English) picks the
59
- language of everything the bot says itself, and of the settings card. The copy
60
- lives in `locales/en.json` and `locales/zh-CN.json`; Chinese shortcut commands
61
- only work in Chinese.
59
+ language of everything the bot says itself. The settings card follows the
60
+ interface language instead. The copy lives in `locales/en.json` and
61
+ `locales/zh-CN.json`; Chinese shortcut commands only work in Chinese.
62
62
 
63
63
  ## Requirements
64
64
 
package/dist/index.js CHANGED
@@ -132147,8 +132147,13 @@ var startLarkInbound = (input) => {
132147
132147
  // src/larkAdapter.ts
132148
132148
  var TOKEN_CACHE_MAX_AGE_MS = 30 * 6e4;
132149
132149
  var COLUMNS = [
132150
- { key: "larkAppId", kind: "text", label: "Lark app ID", placeholder: "cli_\u2026" },
132151
- { key: "larkAppSecret", kind: "password", label: "Lark app secret" }
132150
+ {
132151
+ key: "larkAppId",
132152
+ kind: "text",
132153
+ labelKey: "column.larkAppId.label",
132154
+ placeholderKey: "column.larkAppId.placeholder"
132155
+ },
132156
+ { key: "larkAppSecret", kind: "password", labelKey: "column.larkAppSecret.label" }
132152
132157
  ];
132153
132158
  var credentials = (binding) => ({
132154
132159
  appId: binding.values["larkAppId"] ?? "",
@@ -132328,7 +132333,8 @@ var en_default = {
132328
132333
  label: "Platform"
132329
132334
  },
132330
132335
  larkAppId: {
132331
- label: "Lark app ID"
132336
+ label: "Lark app ID",
132337
+ placeholder: "cli_\u2026"
132332
132338
  },
132333
132339
  larkAppSecret: {
132334
132340
  label: "Lark app secret"
@@ -132534,7 +132540,8 @@ var zh_CN_default = {
132534
132540
  label: "\u5E73\u53F0"
132535
132541
  },
132536
132542
  larkAppId: {
132537
- label: "\u98DE\u4E66\u5E94\u7528 ID"
132543
+ label: "\u98DE\u4E66\u5E94\u7528 ID",
132544
+ placeholder: "cli_\u2026"
132538
132545
  },
132539
132546
  larkAppSecret: {
132540
132547
  label: "\u98DE\u4E66\u5E94\u7528\u5BC6\u94A5"
@@ -132983,7 +132990,7 @@ var makeTelegramApi = (input) => {
132983
132990
 
132984
132991
  // src/telegramAdapter.ts
132985
132992
  var COLUMNS2 = [
132986
- { key: "telegramToken", kind: "password", label: "Telegram bot token" }
132993
+ { key: "telegramToken", kind: "password", labelKey: "column.telegramToken.label" }
132987
132994
  ];
132988
132995
  var BACKOFF_START_MS = 1e3;
132989
132996
  var BACKOFF_MAX_MS = 6e4;
@@ -133499,8 +133506,8 @@ var runWecomClient = (input) => {
133499
133506
  var BACKOFF_START_MS2 = 1e3;
133500
133507
  var BACKOFF_MAX_MS2 = 6e4;
133501
133508
  var COLUMNS3 = [
133502
- { key: "wecomBotId", kind: "text", label: "WeCom bot ID" },
133503
- { key: "wecomBotSecret", kind: "password", label: "WeCom bot secret" }
133509
+ { key: "wecomBotId", kind: "text", labelKey: "column.wecomBotId.label" },
133510
+ { key: "wecomBotSecret", kind: "password", labelKey: "column.wecomBotSecret.label" }
133504
133511
  ];
133505
133512
  var defaultSleep2 = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
133506
133513
  var credentials2 = (binding) => ({
@@ -133695,99 +133702,99 @@ var imPlugin = definePlugin({
133695
133702
  const platformColumn = {
133696
133703
  key: "platform",
133697
133704
  kind: "select",
133698
- label: t("column.platform.label"),
133705
+ labelKey: "column.platform.label",
133699
133706
  options: adapters.map((adapter) => ({
133700
133707
  value: adapter.platform,
133701
- // 平台名在目录里有本地叫法(飞书、企业微信);没有就用适配器自己的名字。
133702
- label: t.optional(`platform.${adapter.platform}`) ?? adapter.label,
133708
+ // 平台名在目录里有本地叫法(飞书、企业微信)。
133709
+ labelKey: `platform.${adapter.platform}`,
133703
133710
  icon: adapter.icon
133704
133711
  }))
133705
133712
  };
133706
133713
  const credentialColumns = adapters.flatMap(
133707
133714
  (adapter) => adapter.columns.map((column) => ({
133708
133715
  ...column,
133709
- // 凭据列的字也走目录;适配器自己写的英文只是目录里没有这个键时的回落。
133710
- label: t.optional(`column.${column.key}.label`) ?? column.label,
133711
133716
  showWhen: { key: platformColumn.key, equals: [adapter.platform] }
133712
133717
  }))
133713
133718
  );
133714
133719
  ctx.settingsCard({
133715
- title: t("settings.title"),
133716
- description: t("settings.description"),
133720
+ titleKey: "settings.title",
133721
+ descriptionKey: "settings.description",
133717
133722
  fields: [
133718
133723
  {
133719
133724
  key: REPLY_LANGUAGE_FIELD,
133720
133725
  kind: "select",
133721
- label: t("settings.language.label"),
133722
- description: t("settings.language.description"),
133726
+ labelKey: "settings.language.label",
133727
+ descriptionKey: "settings.language.description",
133723
133728
  options: [
133724
- { value: "zh-CN", label: t("settings.language.zhCN") },
133725
- { value: "en", label: t("settings.language.en") }
133729
+ { value: "zh-CN", labelKey: "settings.language.zhCN" },
133730
+ { value: "en", labelKey: "settings.language.en" }
133726
133731
  ]
133727
133732
  },
133728
133733
  {
133729
133734
  key: GROUPS_FIELD,
133730
133735
  kind: "table",
133731
- label: t("settings.groups"),
133736
+ labelKey: "settings.groups",
133732
133737
  columns: [
133733
133738
  {
133734
133739
  key: "displayName",
133735
133740
  kind: "text",
133736
- label: t("column.displayName.label"),
133737
- placeholder: t("column.displayName.placeholder")
133741
+ labelKey: "column.displayName.label",
133742
+ placeholderKey: "column.displayName.placeholder"
133738
133743
  },
133739
133744
  platformColumn,
133740
133745
  ...credentialColumns,
133741
133746
  {
133742
133747
  key: "chatId",
133743
133748
  kind: "text",
133744
- label: t("column.chatId.label"),
133745
- description: t("column.chatId.description")
133749
+ labelKey: "column.chatId.label",
133750
+ descriptionKey: "column.chatId.description"
133746
133751
  },
133747
133752
  {
133748
133753
  key: "allowedSenders",
133749
133754
  kind: "text",
133750
- label: t("column.allowedSenders.label"),
133751
- description: t("column.allowedSenders.description")
133755
+ labelKey: "column.allowedSenders.label",
133756
+ descriptionKey: "column.allowedSenders.description"
133752
133757
  },
133753
133758
  {
133754
133759
  // 选项由宿主填,连三态一起——插件只声明「这个格子装的是代理」,宿主因此
133755
133760
  // 也就认得出这一行引用了哪个代理,删代理时拦得住(路线图 #64)。
133756
133761
  key: "proxy",
133757
133762
  kind: "proxy",
133758
- label: t("column.proxy.label"),
133759
- description: t("column.proxy.description")
133763
+ labelKey: "column.proxy.label",
133764
+ descriptionKey: "column.proxy.description"
133760
133765
  },
133761
133766
  {
133762
133767
  key: "projectId",
133763
133768
  kind: "select",
133764
- label: t("column.projectId.label"),
133765
- description: t("column.projectId.description"),
133769
+ labelKey: "column.projectId.label",
133770
+ descriptionKey: "column.projectId.description",
133766
133771
  options: [
133767
- { value: "", label: t("settings.reportOnly") },
133772
+ { value: "", labelKey: "settings.reportOnly" },
133773
+ // 项目名是数据,只能写成字面量;已归档的那段后缀宿主翻不了(选项没有带参数的
133774
+ // 键),所以仍按回话语言取。
133768
133775
  ...imProjectOptions(projects, boundProjectIds, t("settings.archivedSuffix"))
133769
133776
  ]
133770
133777
  },
133771
133778
  {
133772
133779
  key: "runtimeMode",
133773
133780
  kind: "select",
133774
- label: t("column.runtimeMode.label"),
133775
- description: t("column.runtimeMode.description"),
133781
+ labelKey: "column.runtimeMode.label",
133782
+ descriptionKey: "column.runtimeMode.description",
133776
133783
  options: [
133777
- { value: "approval-required", label: t("settings.runtimeMode.approvalRequired") },
133778
- { value: "auto-accept-edits", label: t("settings.runtimeMode.autoAcceptEdits") },
133779
- { value: "auto", label: t("settings.runtimeMode.auto") },
133780
- { value: "full-access", label: t("settings.runtimeMode.fullAccess") }
133784
+ { value: "approval-required", labelKey: "settings.runtimeMode.approvalRequired" },
133785
+ { value: "auto-accept-edits", labelKey: "settings.runtimeMode.autoAcceptEdits" },
133786
+ { value: "auto", labelKey: "settings.runtimeMode.auto" },
133787
+ { value: "full-access", labelKey: "settings.runtimeMode.fullAccess" }
133781
133788
  ]
133782
133789
  },
133783
133790
  {
133784
133791
  key: "mode",
133785
133792
  kind: "select",
133786
- label: t("column.mode.label"),
133787
- description: t("column.mode.description"),
133793
+ labelKey: "column.mode.label",
133794
+ descriptionKey: "column.mode.description",
133788
133795
  options: [
133789
- { value: "turn", label: t("settings.notifyMode.turn") },
133790
- { value: "message", label: t("settings.notifyMode.message") }
133796
+ { value: "turn", labelKey: "settings.notifyMode.turn" },
133797
+ { value: "message", labelKey: "settings.notifyMode.message" }
133791
133798
  ]
133792
133799
  }
133793
133800
  ]
package/locales/en.json CHANGED
@@ -36,7 +36,8 @@
36
36
  "label": "Platform"
37
37
  },
38
38
  "larkAppId": {
39
- "label": "Lark app ID"
39
+ "label": "Lark app ID",
40
+ "placeholder": "cli_…"
40
41
  },
41
42
  "larkAppSecret": {
42
43
  "label": "Lark app secret"
@@ -36,7 +36,8 @@
36
36
  "label": "平台"
37
37
  },
38
38
  "larkAppId": {
39
- "label": "飞书应用 ID"
39
+ "label": "飞书应用 ID",
40
+ "placeholder": "cli_…"
40
41
  },
41
42
  "larkAppSecret": {
42
43
  "label": "飞书应用密钥"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ycodium-ai/plugin-im",
3
- "version": "0.2.2554",
3
+ "version": "0.2.2566",
4
4
  "description": "Talk to your agents from Telegram, WeCom or Lark.",
5
5
  "keywords": [
6
6
  "im",
@@ -27,7 +27,7 @@
27
27
  "esbuild": "0.28.1",
28
28
  "markdown-it": "^15.0.2",
29
29
  "vite-plus": "0.2.2",
30
- "@ycodium-ai/plugin-api": "0.2.2554"
30
+ "@ycodium-ai/plugin-api": "0.2.2566"
31
31
  },
32
32
  "ycodium": {
33
33
  "plugin": "./dist/index.js",