@ycodium-ai/plugin-im 0.2.3034 → 0.2.3054

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 (3) hide show
  1. package/README.md +1 -1
  2. package/dist/index.js +14 -16
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -158,7 +158,7 @@ The agent's questions and the messages queued behind a running turn use the
158
158
  optional `choiceCards` surface (`ImChoiceCard`, `src/adapter.ts`): Lark patches a
159
159
  card, Telegram edits a message and its inline keyboard. A request is posted on
160
160
  `thread.user-input-pending` (read with `listPendingUserInputs`), one card per
161
- question, and answered with one `thread.user-input.respond` once every question
161
+ question, and answered through `ctx.threads.userInput.respond` once every question
162
162
  has an answer; a free-form answer is the next ordinary message in the chat, and
163
163
  `thread.request-resolved` freezes the cards of a question answered elsewhere or
164
164
  closed unanswered. WeCom has no buttons: it writes the options as numbers and the
package/dist/index.js CHANGED
@@ -129015,13 +129015,11 @@ var makeQuestionFlow = (host) => {
129015
129015
  return true;
129016
129016
  }
129017
129017
  try {
129018
- await host.dispatch({
129019
- type: "thread.user-input.respond",
129020
- commandId: host.newId(),
129018
+ await host.respondToUserInput({
129019
+ requestId: host.newId(),
129021
129020
  threadId: after.threadId,
129022
- requestId,
129023
- answers: Object.fromEntries(after.items.map((entry) => [entry.id, entry.answer])),
129024
- createdAt: host.now()
129021
+ userInputRequestId: requestId,
129022
+ answers: Object.fromEntries(after.items.map((entry) => [entry.id, entry.answer]))
129025
129023
  });
129026
129024
  } catch (error) {
129027
129025
  host.warn("chat could not hand the answer to the agent", error);
@@ -129406,6 +129404,7 @@ var makeInteractions = (core, deps) => {
129406
129404
  });
129407
129405
  return false;
129408
129406
  },
129407
+ respondToUserInput: (input) => host.threads.userInput.respond(input),
129409
129408
  dispatch: (command) => host.commands.dispatch(command),
129410
129409
  say: async (chatKey, text3) => {
129411
129410
  const binding = bindingForChatKey(chatKey);
@@ -139085,9 +139084,8 @@ var makeModelPlan = (core, deps) => {
139085
139084
  const threadId = chatOf(core.state, chatKey).threadId;
139086
139085
  if (threadId !== null && await threadStillUsable(binding, threadId)) {
139087
139086
  try {
139088
- await host.commands.dispatch({
139089
- type: "thread.meta.update",
139090
- commandId: crypto.randomUUID(),
139087
+ await host.threads.update({
139088
+ requestId: crypto.randomUUID(),
139091
139089
  threadId,
139092
139090
  modelSelection: selection
139093
139091
  });
@@ -141698,21 +141696,21 @@ var makeTurns = (core, deps) => {
141698
141696
  }
141699
141697
  }
141700
141698
  try {
141701
- await host.commands.dispatch({
141702
- type: "thread.turn.start",
141703
- commandId: crypto.randomUUID(),
141699
+ await host.threads.turns.start({
141700
+ requestId: crypto.randomUUID(),
141704
141701
  threadId,
141705
141702
  message: {
141706
141703
  messageId: userMessageId,
141707
141704
  role: "user",
141708
141705
  text: notes.length === 0 ? text3 : [text3, ...notes].join("\n"),
141709
- attachments
141706
+ attachments: attachments.map(
141707
+ (attachment) => attachment.type === "image" ? { ...attachment, type: "image" } : { ...attachment, type: "file" }
141708
+ )
141710
141709
  },
141711
141710
  titleSeed: titleFrom(text3 || attachments[0]?.name || "Chat"),
141712
141711
  runtimeMode: binding.runtimeMode,
141713
141712
  interactionMode: interactionModeOf(chatKey),
141714
- ...intentAction !== void 0 ? { intentAction } : {},
141715
- createdAt: (/* @__PURE__ */ new Date()).toISOString()
141713
+ ...intentAction !== void 0 ? { intentAction } : {}
141716
141714
  });
141717
141715
  } catch (error) {
141718
141716
  if (carried !== void 0) pendingByChat.set(chatKey, carried);
@@ -144000,7 +143998,7 @@ var makeWecomAppAdapter = (deps) => {
144000
143998
  // src/index.ts
144001
143999
  var imPlugin = definePlugin({
144002
144000
  id: "im",
144003
- apiVersion: 9,
144001
+ apiVersion: 11,
144004
144002
  activate: async (ctx) => {
144005
144003
  const { t, setLanguage } = makeLiveTranslate(
144006
144004
  parseReplyLanguage(ctx.config[REPLY_LANGUAGE_FIELD])
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ycodium-ai/plugin-im",
3
- "version": "0.2.3034",
3
+ "version": "0.2.3054",
4
4
  "description": "Talk to your agents from Telegram, WeCom, Lark, or WeChat (experimental).",
5
5
  "keywords": [
6
6
  "im",
@@ -32,7 +32,7 @@
32
32
  "markdown-it": "^15.0.2",
33
33
  "react": "19.2.6",
34
34
  "vite-plus": "0.2.2",
35
- "@ycodium-ai/plugin-api": "0.2.3034"
35
+ "@ycodium-ai/plugin-api": "0.2.3054"
36
36
  },
37
37
  "ycodium": {
38
38
  "plugin": "./dist/index.js",