@shumkov/orchestra 0.10.1 → 0.10.3

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.
@@ -369,13 +369,23 @@ mcp.setRequestHandler(ListToolsRequestSchema, async () => {
369
369
  },
370
370
  }, {
371
371
  // 0.13: edit a message already sent via `reply`, in place — the progressive-
372
- // status primitive. Update one bubble instead of sending several.
372
+ // status primitive. Update one bubble instead of sending several. The edit is
373
+ // re-rendered the same way the reply was, so a checklist stays a checklist.
373
374
  name: 'edit_message',
374
- description: 'Edit a message you previously sent via `reply`, in place. Use this for ' +
375
- 'progressive status on a long task: send a short status with `reply`, take the ' +
376
- 'returned message_id, then `edit_message` it as you make progress (ending with ' +
377
- 'the final answer). Keep status in PLAIN LANGUAGE — never tool names like Bash/Edit. ' +
378
- 'One bubble only (no chunking); for long content use `reply` instead.',
375
+ description: 'Edit a message you previously sent via `reply`, in place. In a chat that ' +
376
+ 'renders rich, an edited checklist/table/heading is re-rendered rich rather ' +
377
+ 'than flattened. Canonical use: send a plan as `- [ ] step` items, then edit ' +
378
+ 'that same message_id with the WHOLE list again and `- [x]` on completed ' +
379
+ 'steps — check items off as you go and the user watches one bubble update. ' +
380
+ 'Also fine for a short one-line status. An edit REPLACES the body, so always ' +
381
+ 're-send the full text. An edit is TEXT-ONLY: image markdown degrades to its ' +
382
+ 'caption and cannot add media to a bubble (send media with `reply(files:)`). ' +
383
+ 'Keep status in PLAIN LANGUAGE — never tool names like Bash/Edit. One bubble, ' +
384
+ 'never chunked: ~4,000 chars for plain text, much more (~32,000) when it ' +
385
+ 'renders rich; over the limit the tool tells you which one applied — send ' +
386
+ 'long content as a fresh `reply` instead. An edit does NOT notify the user ' +
387
+ 'and carries no consumed_turn_ids: it is a mid-turn update, never the final ' +
388
+ 'answer.',
379
389
  inputSchema: {
380
390
  type: 'object',
381
391
  properties: {
@@ -941,20 +941,49 @@ class CliProcess extends Process {
941
941
  `DROPPED — it gets re-sent to you or flagged as a lost message. When unsure,`,
942
942
  'include the id.',
943
943
  '',
944
- '### Staying responsive on a long task — show progress, never go silent',
944
+ '### Staying responsive on a long task — HARD CONTRACT',
945
945
  '',
946
946
  'The user sees NOTHING while you work — no inline text, no tool output reaches',
947
- 'them. A turn that runs long with no reply looks BROKEN (they see only silence)',
948
- 'and can hit the turn time-cap before you answer.',
947
+ 'them. A turn that runs long with no visible progress looks BROKEN, and',
948
+ 'working in silence then dropping a finished result is a CONTRACT VIOLATION,',
949
+ 'not a style choice: the user sat staring at a dead chat the whole time.',
949
950
  '',
950
- 'So once you are clearly into multi-step work — you have run a couple of tool',
951
- 'calls without replying, or the request plainly needs research / several steps —',
952
- 'send a SHORT one-line status via `reply` WITH `interim: true` (it returns a',
953
- `\`message_id\`), then use \`mcp__${b}__edit_message\` on that SAME`,
954
- '`message_id` to update the bubble as you progress. `edit_message` is for',
955
- 'INTERIM status ONLY.',
951
+ 'So for any MULTI-STEP task — several steps, research, more than a couple of',
952
+ 'tool calls — this is the sequence, every time:',
956
953
  '',
957
- 'HARD RULE — a status is a MID-TURN update, NOT the end of work. After an',
954
+ '1. Your FIRST visible action MUST be a `reply` with `interim: true` whose',
955
+ ' body is the PLAN as a checklist: one `- [ ] step` line per step, in plain',
956
+ ' task language. It returns a `message_id` — keep it.',
957
+ `2. Posting the plan is NOT a stopping point. Do not end the turn to wait`,
958
+ ' for approval — the checklist is a progress display, not a proposal. Keep',
959
+ ' executing in the SAME turn immediately (ask first only when a step is',
960
+ ' destructive or the request is genuinely ambiguous).',
961
+ `3. After EVERY step you complete — not at the end, after each one — you MUST`,
962
+ ` call \`mcp__${b}__edit_message\` on that SAME \`message_id\` with the WHOLE`,
963
+ ' list again — check items off as you complete them: finished items flip',
964
+ ' to `- [x]`. Five steps means the bubble changes five times; the user',
965
+ ' watches ONE message fill in, live.',
966
+ '4. Always re-send the WHOLE list — an edit REPLACES the body, so a partial',
967
+ ' re-send loses everything you left out.',
968
+ '',
969
+ 'An edit re-renders the bubble exactly as the original `reply` did — a chat',
970
+ 'that renders rich re-renders an edited checklist, table or heading rich, not',
971
+ 'flat. A short one-line status bubble is acceptable only when the work',
972
+ 'genuinely has no enumerable steps.',
973
+ '',
974
+ 'An edit is TEXT-ONLY. Checklists, tables and headings re-render; image',
975
+ 'markdown degrades to its caption, and an edit can never ADD media to a',
976
+ `bubble — send files with \`reply(files:)\`. An edit that is nothing but`,
977
+ 'media has nothing left to say and will come back as an error.',
978
+ '',
979
+ 'Length: an edit is ONE bubble, never chunked. Plain text is capped around',
980
+ '4,000 characters; a rich-rendered structure in a rich-enabled chat gets a',
981
+ 'much larger one (~32,000). You cannot see which applies — if you go over, the',
982
+ 'tool tells you the limit that applied, so shorten the edit or send the long',
983
+ 'content as a fresh `reply`.',
984
+ '',
985
+ 'HARD RULE — a status bubble or progress checklist is a MID-TURN update, NOT',
986
+ 'the end of work, and `edit_message` NEVER delivers the final answer. After an',
958
987
  'interim reply you MUST keep working in the SAME turn and deliver the real',
959
988
  'result. NEVER end your turn on a status / "give me a couple min" / "looking',
960
989
  'into it" reply with no result behind it — that leaves the user staring at a',
@@ -975,20 +1004,30 @@ class CliProcess extends Process {
975
1004
  // that puts `stream` in the bridge's tool list), so the contract below can
976
1005
  // never coach the agent toward a tool that isn't there.
977
1006
  ...(this.streamToolEnabled ? [
978
- '### Showing your answer as you write it',
1007
+ '### Showing your answer as you write it — HARD CONTRACT',
1008
+ '',
1009
+ 'The user is watching a LIVE bubble the whole time you compose, and',
1010
+ `\`mcp__${b}__stream\` is the ONLY thing that fills it in. Writing a long`,
1011
+ 'answer in silence and dropping it at the end is a CONTRACT VIOLATION, not a',
1012
+ 'style choice: the user sat watching an empty bubble for the entire time you',
1013
+ 'were writing.',
1014
+ '',
1015
+ 'So if your answer will run longer than about two paragraphs, this is the',
1016
+ 'cadence: after EVERY section you finish — or after every paragraph, when',
1017
+ 'the answer has no sections — and BEFORE you start writing the next one,',
1018
+ `you MUST call \`mcp__${b}__stream\` with the FULL answer-so-far.`,
1019
+ 'Not once at the end, not "at a natural checkpoint" — after each one,',
1020
+ 'every time. Four sections means four stream calls, and then the reply.',
979
1021
  '',
980
- `While you are COMPOSING anything long, call \`mcp__${b}__stream\` with the`,
981
- 'FULL answer-so-far at natural checkpoints (after a paragraph, a section, a',
982
- 'finished thought). Each call replaces the preview, so always send the whole',
983
- 'answer up to that point — never just the new part. The user watches it fill in',
984
- 'instead of staring at silence.',
1022
+ 'Each call REPLACES the preview, so always send the whole answer up to that',
1023
+ 'point — never just the part you added.',
985
1024
  '',
986
1025
  'HARD RULE — `stream` is a PREVIEW, not a delivery. It never ends a turn and',
987
1026
  `it is not the answer. ALWAYS finish with a normal \`mcp__${b}__reply\``,
988
1027
  'carrying the complete answer; NEVER end a turn on a stream call.',
989
1028
  '',
990
- 'Skip it for short answers (a couple of sentences) — just reply. And never',
991
- 'retry a stream call: it cannot fail in a way that matters.',
1029
+ 'A couple of sentences is short — just reply, no stream. And never retry a',
1030
+ 'stream call: it cannot fail in a way that matters.',
992
1031
  '',
993
1032
  ] : []),
994
1033
  // TEMPORARY mitigation (2026-06-08 Shumabit@UMI wedge): AskUserQuestion opens
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shumkov/orchestra",
3
- "version": "0.10.1",
3
+ "version": "0.10.3",
4
4
  "description": "Transport-agnostic session engine for Claude Code and the native Codex app-server: spawn, steer, supervise, observe turns, and recover.",
5
5
  "type": "commonjs",
6
6
  "main": "index.js",