@co0ontty/wand 4.4.0 → 4.5.0

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.
@@ -1,6 +1,6 @@
1
1
  {
2
- "commit": "dcdccb251729273fd1c919ab495da79dcb88921c",
3
- "builtAt": "2026-07-15T11:46:07.546Z",
4
- "version": "4.4.0",
2
+ "commit": "4c9bbce65ef02fdc9b8b5d2891e8839f0f2a74a2",
3
+ "builtAt": "2026-07-15T13:06:11.510Z",
4
+ "version": "4.5.0",
5
5
  "channel": "stable"
6
6
  }
@@ -959,7 +959,27 @@ export function registerSessionRoutes(app, processes, structured, storage, defau
959
959
  const shortcutKey = body.shortcutKey;
960
960
  try {
961
961
  if (structured.get(sessionId)) {
962
- const snapshot = await structured.sendMessage(sessionId, input);
962
+ const completion = structured.sendMessage(sessionId, input);
963
+ if (body.respondImmediately === true) {
964
+ // sendMessage updates the canonical snapshot synchronously before it
965
+ // starts awaiting the runner. Native clients should not hold this
966
+ // request open for an entire model turn (which can exceed their HTTP
967
+ // timeout, especially while the first-turn title job is also active).
968
+ // The normal structured events continue to carry progress/failure.
969
+ completion.catch((error) => {
970
+ console.error("[wand] Accepted structured input later failed", {
971
+ sessionId,
972
+ error: getInputDebugMeta(error),
973
+ });
974
+ });
975
+ const accepted = structured.get(sessionId);
976
+ if (!accepted) {
977
+ throw new Error("未找到该结构化会话。");
978
+ }
979
+ res.status(202).json(sessionResponseDTO(accepted));
980
+ return;
981
+ }
982
+ const snapshot = await completion;
963
983
  res.json(sessionResponseDTO(snapshot));
964
984
  return;
965
985
  }
package/dist/types.d.ts CHANGED
@@ -291,6 +291,12 @@ export interface CommandRequest {
291
291
  }
292
292
  export interface InputRequest {
293
293
  input?: string;
294
+ /**
295
+ * Structured sessions normally keep the HTTP request open until the whole
296
+ * turn finishes. Native clients can opt into an accepted snapshot instead
297
+ * and continue receiving progress through the existing event stream.
298
+ */
299
+ respondImmediately?: boolean;
294
300
  /** Current UI view: "chat" or "terminal". Chat view uses PTY-derived structured messages. */
295
301
  view?: "chat" | "terminal";
296
302
  autonomyPolicy?: AutonomyPolicy;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@co0ontty/wand",
3
- "version": "4.4.0",
3
+ "version": "4.5.0",
4
4
  "description": "A web console for Claude Code, Codex, OpenCode, and other local CLI tools.",
5
5
  "type": "module",
6
6
  "bin": {