@ycodium-ai/plugin-im 0.2.2974 → 0.2.2976

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.
Files changed (2) hide show
  1. package/dist/index.js +13 -10
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -127123,13 +127123,15 @@ var makeApprovals = (core, anchors) => {
127123
127123
  if (binding === void 0) return;
127124
127124
  const adapter = adapterFor(binding.platform);
127125
127125
  if (adapter === void 0) return;
127126
- const pending = await host.projections.listPendingApprovals(threadId);
127126
+ const pending = await host.approvals.pending.list({ threadId });
127127
127127
  const fresh = pending.filter(
127128
127128
  (candidate) => core.state.approvals[candidate.requestId] === void 0
127129
127129
  );
127130
127130
  const offers = (adapter.answerByText === void 0 ? fresh : fresh.slice(0, 1)).map(
127131
127131
  (approval) => {
127132
- const offered = approval.options.filter((option) => option.decision !== "acceptAlways");
127132
+ const offered = (approval.options ?? []).filter(
127133
+ (option) => option.decision !== "acceptAlways"
127134
+ );
127133
127135
  const options = offered.length > 0 ? offered : [
127134
127136
  { decision: "accept", label: t("approval.allow") },
127135
127137
  { decision: "decline", label: t("approval.deny") }
@@ -140204,17 +140206,16 @@ var makeSessions = (core) => {
140204
140206
  };
140205
140207
  };
140206
140208
  const webShellsForProject = async (projectId) => {
140207
- const listThreads = host.projections.listThreads;
140208
- if (listThreads === void 0 || projectId === "") return [];
140209
+ if (projectId === "") return [];
140209
140210
  const shells = [];
140210
- let cursor = void 0;
140211
+ let cursor = null;
140211
140212
  for (let page = 0; page < 5; page += 1) {
140212
- const result = await listThreads({
140213
+ const result = await host.threads.list({
140213
140214
  limit: WEB_LIST_PAGE,
140214
- includeArchived: false,
140215
- ...cursor === void 0 || cursor === null ? {} : { cursor }
140215
+ archived: "exclude",
140216
+ cursor
140216
140217
  });
140217
- for (const shell of result.threads) {
140218
+ for (const shell of result.items) {
140218
140219
  if (shell.projectId !== projectId) continue;
140219
140220
  if (shell.archivedAt != null) continue;
140220
140221
  shells.push({
@@ -143364,7 +143365,7 @@ var makeWecomAppAdapter = (deps) => {
143364
143365
  // src/index.ts
143365
143366
  var imPlugin = definePlugin({
143366
143367
  id: "im",
143367
- apiVersion: 3,
143368
+ apiVersion: 5,
143368
143369
  activate: async (ctx) => {
143369
143370
  const { t, setLanguage } = makeLiveTranslate(
143370
143371
  parseReplyLanguage(ctx.config[REPLY_LANGUAGE_FIELD])
@@ -143428,6 +143429,8 @@ var imPlugin = definePlugin({
143428
143429
  host: {
143429
143430
  log: ctx.log,
143430
143431
  projections: ctx.projections,
143432
+ threads: ctx.threads,
143433
+ approvals: ctx.approvals,
143431
143434
  commands: ctx.commands,
143432
143435
  plugins: ctx.plugins,
143433
143436
  attachments: ctx.attachments,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ycodium-ai/plugin-im",
3
- "version": "0.2.2974",
3
+ "version": "0.2.2976",
4
4
  "description": "Talk to your agents from Telegram, WeCom, Lark, or WeChat (experimental).",
5
5
  "keywords": [
6
6
  "im",
@@ -29,7 +29,7 @@
29
29
  "esbuild": "0.28.1",
30
30
  "markdown-it": "^15.0.2",
31
31
  "vite-plus": "0.2.2",
32
- "@ycodium-ai/plugin-api": "0.2.2974"
32
+ "@ycodium-ai/plugin-api": "0.2.2976"
33
33
  },
34
34
  "ycodium": {
35
35
  "plugin": "./dist/index.js",