@ycodium-ai/plugin-im 0.2.2596 → 0.2.2634

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
@@ -57,17 +57,38 @@ snapshot wins), `turnCards.ts` (per-thread queue and lifecycle),
57
57
  `plainTurnText.ts` (view model to plain text), `telegramTurn.ts` (message
58
58
  rollover).
59
59
 
60
+ The agent's questions and the messages queued behind a running turn use the
61
+ optional `choiceCards` surface (`ImChoiceCard`, `src/adapter.ts`): Lark patches a
62
+ card, Telegram edits a message and its inline keyboard. A request is posted on
63
+ `thread.user-input-pending` (read with `listPendingUserInputs`), one card per
64
+ question, and answered with one `thread.user-input.respond` once every question
65
+ has an answer; a free-form answer is the next ordinary message in the group, and
66
+ `thread.request-resolved` freezes the cards of a question answered elsewhere or
67
+ closed unanswered. WeCom has no buttons: it writes the options as numbers and the
68
+ reply is parsed in `src/questionCards.ts`. A message that lands behind a running
69
+ turn gets a queued card (Steer, Withdraw, Resume sending) drawn from
70
+ `getThreadExecution` and refreshed when the turn intents or the queue change
71
+ (`src/queueCards.ts`, `src/queueFlow.ts`); the buttons dispatch
72
+ `thread.turn-intent.run` (steer, with the active turn id), `thread.turn-intent.cancel`
73
+ and `thread.turn-queue.resume`, and the card is the user's own action, so no
74
+ `intentAction` is sent. WeCom only gets a one-line notice, since steering
75
+ and withdrawing need buttons (resuming is the `/continue` command). Editing a queued message is not offered:
76
+ the host does not let a plugin dispatch `thread.turn-intent.edit`.
77
+
60
78
  A group keeps its place across restarts. Which thread a group is talking in, the
61
79
  team it is pointed at, the model and plan mode set from the group, the threads
62
- this plugin has opened, and the approval buttons still waiting in the group are
80
+ this plugin has opened, and the approval, question and queued-message buttons still
81
+ waiting in the group are
63
82
  written as plugin facts (`ctx.events.append`) and folded back by a pure function
64
83
  (`ctx.derivedState`, see `src/chatState.ts`). A saved thread that was deleted,
65
84
  archived or moved to another project is dropped on the next message.
66
85
 
67
- Chat commands: `/stop`, `/status`, `/new`, `/sessions`, `/resume`, `/model`,
86
+ Chat commands: `/stop`, `/continue`, `/status`, `/new`, `/sessions`, `/resume`, `/model`,
68
87
  `/plan`, `/team`, `/thread`, `/help`, `/panel`. `/sessions` and `/resume` only list and
69
88
  switch threads this plugin opened, since the host lets a plugin send only into
70
- its own threads.
89
+ its own threads. `/continue` dispatches `thread.turn-queue.resume` for the group's thread
90
+ when its queue is paused (a `/stop` or a failure pauses it), which is how WeCom, with
91
+ no buttons, resumes; it is not `/resume`, which already switches threads.
71
92
 
72
93
  On Lark and Telegram, `/panel` sends a command panel (`/help` stays text and ends with a pointer to it; on WeCom, which has no panel, it does not): every command above
73
94
  is a button (a card on Lark, an inline keyboard on Telegram), and the ones that take an argument (a thread, a team, a model) open
@@ -87,9 +108,10 @@ interface language instead. The copy lives in `locales/en.json` and
87
108
  ## Requirements
88
109
 
89
110
  A Ycodium server. The plugin asks to dispatch `thread.create`,
90
- `thread.meta.update`, `thread.turn.start`, `thread.turn.interrupt`, and
91
- `thread.approval.respond`. Those commands only land on threads this plugin
92
- started.
111
+ `thread.meta.update`, `thread.turn.start`, `thread.turn.interrupt`,
112
+ `thread.approval.respond`, `thread.user-input.respond`, `thread.turn-intent.run`,
113
+ `thread.turn-intent.cancel` and `thread.turn-queue.resume`. Those commands only land
114
+ on threads this plugin started.
93
115
 
94
116
  ## Install
95
117