@north-light/cli 0.3.698 → 0.3.699

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,4 +1,4 @@
1
- var w=Object.defineProperty;var s=(t,e)=>w(t,"name",{value:e,configurable:!0});import{randomBytes as v,randomUUID as b}from"node:crypto";import{join as E}from"node:path";import{cancelCronsOnWake as N}from"../canvas/crons.js";import{withCanvasWrite as c,openDb as I}from"../canvas/db.js";import{getRow as x}from"../canvas/canvas.js";import{messagesDir as h}from"../canvas/paths.js";import{settleDeadControllerWait as k,settleMatchingControllerWait as R}from"../canvas/waits.js";import{generateOperationId as S,operationIdContext as D,validateOperationId as T}from"../events/operation-id.js";import{clipBody as O}from"../../shared/inbox-entry-body.js";function y(){let t;do t=v(16).toString("hex");while(t==="00000000000000000000000000000000");return t}s(y,"newId");function A(t,e){const r=JSON.stringify(t);if(r===void 0)throw new TypeError(`${e} must be JSON-serializable`);return r}s(A,"stringify");async function L(t,e){return e!=="normal"&&e!=="deferred"?e:(await x(t))?.lifecycle==="terminal"?"urgent":e}s(L,"effectiveTier");function C(t,e){return E(h(t),`${e.replace(/[^0-9]/g,"")}-${b().slice(0,6)}.md`)}s(C,"overflowBodyPath");function M(t){if(typeof t!="object"||t===null)return"";const e=t.body;return typeof e=="string"?e.trim():""}s(M,"inlineBody");async function W(t,e){if(e.length===0)return[];const r=e.map(n=>n.messageId??y()),i=Number((await t.prepare("UPDATE message_sequence SET seq = seq + ? WHERE id = 1 RETURNING seq").get(e.length)).seq)-e.length+1,a=s(n=>e.map((o,u)=>n(o,u)),"col");return await t.prepare(`INSERT INTO messages
1
+ var w=Object.defineProperty;var s=(t,e)=>w(t,"name",{value:e,configurable:!0});import{randomBytes as v,randomUUID as b}from"node:crypto";import{join as E}from"node:path";import{cancelCronsOnWake as N}from"../canvas/crons.js";import{withCanvasWrite as c,openDb as I}from"../canvas/db.js";import{getRow as x}from"../canvas/canvas.js";import{messagesDir as h}from"../canvas/paths.js";import{settleDeadControllerWait as k,settleMatchingControllerWait as R}from"../canvas/waits.js";import{generateOperationId as D,operationIdContext as S,validateOperationId as T}from"../events/operation-id.js";import{clipBody as O}from"../../shared/inbox-entry-body.js";function y(){let t;do t=v(16).toString("hex");while(t==="00000000000000000000000000000000");return t}s(y,"newId");function A(t,e){const r=JSON.stringify(t,(d,i)=>typeof i=="string"?i.replace(new RegExp("\\p{Cs}","gu"),"\uFFFD"):i);if(r===void 0)throw new TypeError(`${e} must be JSON-serializable`);return r}s(A,"stringify");async function C(t,e){return e!=="normal"&&e!=="deferred"?e:(await x(t))?.lifecycle==="terminal"?"urgent":e}s(C,"effectiveTier");function L(t,e){return E(h(t),`${e.replace(/[^0-9]/g,"")}-${b().slice(0,6)}.md`)}s(L,"overflowBodyPath");function M(t){if(typeof t!="object"||t===null)return"";const e=t.body;return typeof e=="string"?e.trim():""}s(M,"inlineBody");async function W(t,e){if(e.length===0)return[];const r=e.map(n=>n.messageId??y()),i=Number((await t.prepare("UPDATE message_sequence SET seq = seq + ? WHERE id = 1 RETURNING seq").get(e.length)).seq)-e.length+1,a=s(n=>e.map((o,u)=>n(o,u)),"col");return await t.prepare(`INSERT INTO messages
2
2
  (message_id, seq, operation_id, created_at, sender_node_id, sender_name, kind, label, body_ref, body_json, disposition,
3
3
  event, object_id, level, actor_id, cause_message_id, depth)
4
4
  SELECT v.message_id, v.seq::bigint, v.operation_id, v.created_at, v.sender_node_id, v.sender_name, v.kind, v.label, v.body_ref, v.body_json::jsonb, v.disposition,
@@ -8,6 +8,6 @@ var w=Object.defineProperty;var s=(t,e)=>w(t,"name",{value:e,configurable:!0});i
8
8
  AS v(message_id, seq, operation_id, created_at, sender_node_id, sender_name, kind, label, body_ref, body_json, disposition,
9
9
  event, object_id, level, actor_id, cause_message_id, depth, n) ORDER BY v.n`).run(r,a((n,o)=>String(i+o)),a(n=>n.operationId),a(n=>n.createdAt),a(n=>n.senderNodeId),a(n=>n.senderName),a(n=>n.kind),a(n=>n.label),a(n=>n.bodyRef),a(n=>n.bodyJson===void 0?null:A(n.bodyJson,"message body")),a(n=>n.disposition),a(n=>n.event?.event??null),a(n=>n.event?.objectId??null),a(n=>n.event===void 0?null:String(n.event.level)),a(n=>n.event?.actorId??null),a(n=>n.causeMessageId??null),a(n=>String(n.depth??0))),r}s(W,"insertMessages");async function _(t,e){return(await W(t,[e]))[0]}s(_,"insertMessage");async function f(t,e,r,d,i,a,n){const o=y();return await t.prepare(`INSERT INTO deliveries
10
10
  (delivery_id, message_id, destination_id, urgency, wake, state, idempotency_key, created_at, updated_at)
11
- VALUES (?, ?, ?, ?, ?, 'pending', ?, ?, ?)`).run(o,e,r,d,i,n??null,a,a),o}s(f,"insertNodeDelivery");function g(t,e){const r=new Date().toISOString(),d=t.operationId===void 0?D.current()??S():T(t.operationId);let i=t.bodyRef??null,a=t.bodyJson;if(i===null&&e!==null&&t.senderNodeId!=="human"){const n=M(a),o=O(n);o.clipped&&(i=C(e,r),a={...a,body:o.text,body_full:n})}return{createdAt:r,operationId:d,bodyRef:i,bodyJson:a}}s(g,"finalizeNodeMail");async function j(t,e){const r=g(e,t);return await c(async d=>{const i=await d.prepare("SELECT run_id FROM nodes WHERE node_id = ?").get(t);if(i?.run_id&&(await d.prepare("SELECT deleting_at FROM nodes WHERE node_id = ?").get(i.run_id))?.deleting_at)throw new Error("run is deleting");if(e.idempotencyKey!==void 0){const l=await d.prepare(`SELECT d.delivery_id, d.message_id, d.urgency, m.created_at
12
- FROM deliveries d JOIN messages m ON m.message_id = d.message_id WHERE d.idempotency_key = ?`).get(e.idempotencyKey);if(l!==void 0)return{messageId:l.message_id,deliveryId:l.delivery_id,urgency:l.urgency,createdAt:l.created_at}}const a=Date.now(),n=await L(t,e.urgency),o=await _(d,{messageId:e.messageId,operationId:r.operationId,createdAt:r.createdAt,senderNodeId:e.senderNodeId??null,senderName:e.senderName??null,kind:e.kind,label:e.label,bodyRef:r.bodyRef,bodyJson:r.bodyJson,disposition:e.disposition??null}),u=await f(d,o,t,n,e.wake,a,e.idempotencyKey);return await R(t,e.senderNodeId??null,a,d),await e.withinEnqueue?.(d,o),e.wake===1&&n!=="deferred"&&await p(t),{messageId:o,deliveryId:u,urgency:n,createdAt:r.createdAt}})}s(j,"enqueueNodeMail");function z(t){switch(t){case"interrupt":return{urgency:"critical",wake:1};case"steer":return{urgency:"urgent",wake:1};case"after-turn":return{urgency:"normal",wake:1};case"next-turn":return{urgency:"deferred",wake:0}}}s(z,"listenDeliveryTier");async function m(t,e,r){const d={kind:"update",label:r.label??"notice",bodyJson:{body:r.body},urgency:r.tier,wake:r.wake},i=g(d,e),a=Date.now(),n=await _(t,{operationId:i.operationId,createdAt:i.createdAt,senderNodeId:null,senderName:null,kind:d.kind,label:d.label,bodyRef:i.bodyRef,bodyJson:i.bodyJson,disposition:null}),o=await f(t,n,e,r.tier,r.wake,a);return{messageId:n,deliveryId:o,urgency:r.tier,createdAt:i.createdAt}}s(m,"insertNodeNotice");async function p(t){await c(async e=>{for(const r of await N(t))await m(e,t,{body:`Your cron ${r.name}, next scheduled for ${r.fire_at}, was canceled by this wake. Re-create it if you still need it.`,label:"cron canceled",tier:"normal",wake:1})})}s(p,"consumeDeadlineOnWake");async function G(t,e,r){const d=await m(t,e,r);return r.wake===1&&r.tier!=="deferred"&&await p(e),d}s(G,"queueNodeNotice");async function V(t,e=Date.now()){return Number((await(await I()).prepare("UPDATE deliveries SET canceled_at = ?, updated_at = ? WHERE delivery_id = ? AND canceled_at IS NULL").run(e,e,t)).changes)===1}s(V,"cancelDelivery");async function Q(t,e={}){return await c(async r=>{const d=["d.destination_id = ?","d.canceled_at IS NULL","d.state IN ('pending', 'handed_off')"],i=[t];e.senderNodeId!==void 0&&(d.push("m.sender_node_id IS NOT DISTINCT FROM ?"),i.push(e.senderNodeId)),e.kind!==void 0&&(d.push("m.kind = ?"),i.push(e.kind));const a=await r.prepareUncached(`SELECT d.delivery_id FROM deliveries d JOIN messages m ON m.message_id = d.message_id WHERE ${d.join(" AND ")}`).all(...i);if(a.length===0)return[];const n=Date.now();return await r.prepareUncached(`UPDATE deliveries SET canceled_at = ?, updated_at = ? WHERE delivery_id IN (${a.map(()=>"?").join(",")})`).run(n,n,...a.map(o=>o.delivery_id)),a.map(o=>o.delivery_id)})}s(Q,"cancelPendingNodeMail");async function X(t,e){return await c(async r=>{const d=Date.now(),i=await r.prepare(`SELECT target.status AS controller_status FROM waits w LEFT JOIN nodes target ON target.node_id = w.target_id
13
- WHERE w.node_id = ? AND w.kind = 'controller' AND w.target_id = ? AND w.satisfied_at IS NULL`).get(t,e);if(i===void 0||i.controller_status==="active"||i.controller_status==="idle")return null;const a=await j(t,{kind:"urgent",label:"declared controller is no longer live",bodyJson:{body:`Controller ${e} is no longer live; the declared message wait was cleared.`},urgency:"urgent",wake:1});if(!await k(t,e,d,r))throw new Error(`controller wait changed while notifying ${t}`);return a})}s(X,"enqueueControllerDeathNotice");export{V as cancelDelivery,Q as cancelPendingNodeMail,p as consumeDeadlineOnWake,L as effectiveTier,X as enqueueControllerDeathNotice,j as enqueueNodeMail,g as finalizeNodeMail,_ as insertMessage,W as insertMessages,z as listenDeliveryTier,y as newId,G as queueNodeNotice};
11
+ VALUES (?, ?, ?, ?, ?, 'pending', ?, ?, ?)`).run(o,e,r,d,i,n??null,a,a),o}s(f,"insertNodeDelivery");function g(t,e){const r=new Date().toISOString(),d=t.operationId===void 0?S.current()??D():T(t.operationId);let i=t.bodyRef??null,a=t.bodyJson;if(i===null&&e!==null&&t.senderNodeId!=="human"){const n=M(a),o=O(n);o.clipped&&(i=L(e,r),a={...a,body:o.text,body_full:n})}return{createdAt:r,operationId:d,bodyRef:i,bodyJson:a}}s(g,"finalizeNodeMail");async function j(t,e){const r=g(e,t);return await c(async d=>{const i=await d.prepare("SELECT run_id FROM nodes WHERE node_id = ?").get(t);if(i?.run_id&&(await d.prepare("SELECT deleting_at FROM nodes WHERE node_id = ?").get(i.run_id))?.deleting_at)throw new Error("run is deleting");if(e.idempotencyKey!==void 0){const l=await d.prepare(`SELECT d.delivery_id, d.message_id, d.urgency, m.created_at
12
+ FROM deliveries d JOIN messages m ON m.message_id = d.message_id WHERE d.idempotency_key = ?`).get(e.idempotencyKey);if(l!==void 0)return{messageId:l.message_id,deliveryId:l.delivery_id,urgency:l.urgency,createdAt:l.created_at}}const a=Date.now(),n=await C(t,e.urgency),o=await _(d,{messageId:e.messageId,operationId:r.operationId,createdAt:r.createdAt,senderNodeId:e.senderNodeId??null,senderName:e.senderName??null,kind:e.kind,label:e.label,bodyRef:r.bodyRef,bodyJson:r.bodyJson,disposition:e.disposition??null}),u=await f(d,o,t,n,e.wake,a,e.idempotencyKey);return await R(t,e.senderNodeId??null,a,d),await e.withinEnqueue?.(d,o),e.wake===1&&n!=="deferred"&&await m(t),{messageId:o,deliveryId:u,urgency:n,createdAt:r.createdAt}})}s(j,"enqueueNodeMail");function z(t){switch(t){case"interrupt":return{urgency:"critical",wake:1};case"steer":return{urgency:"urgent",wake:1};case"after-turn":return{urgency:"normal",wake:1};case"next-turn":return{urgency:"deferred",wake:0}}}s(z,"listenDeliveryTier");async function p(t,e,r){const d={kind:"update",label:r.label??"notice",bodyJson:{body:r.body},urgency:r.tier,wake:r.wake},i=g(d,e),a=Date.now(),n=await _(t,{operationId:i.operationId,createdAt:i.createdAt,senderNodeId:null,senderName:null,kind:d.kind,label:d.label,bodyRef:i.bodyRef,bodyJson:i.bodyJson,disposition:null}),o=await f(t,n,e,r.tier,r.wake,a);return{messageId:n,deliveryId:o,urgency:r.tier,createdAt:i.createdAt}}s(p,"insertNodeNotice");async function m(t){await c(async e=>{for(const r of await N(t))await p(e,t,{body:`Your cron ${r.name}, next scheduled for ${r.fire_at}, was canceled by this wake. Re-create it if you still need it.`,label:"cron canceled",tier:"normal",wake:1})})}s(m,"consumeDeadlineOnWake");async function G(t,e,r){const d=await p(t,e,r);return r.wake===1&&r.tier!=="deferred"&&await m(e),d}s(G,"queueNodeNotice");async function V(t,e=Date.now()){return Number((await(await I()).prepare("UPDATE deliveries SET canceled_at = ?, updated_at = ? WHERE delivery_id = ? AND canceled_at IS NULL").run(e,e,t)).changes)===1}s(V,"cancelDelivery");async function Q(t,e={}){return await c(async r=>{const d=["d.destination_id = ?","d.canceled_at IS NULL","d.state IN ('pending', 'handed_off')"],i=[t];e.senderNodeId!==void 0&&(d.push("m.sender_node_id IS NOT DISTINCT FROM ?"),i.push(e.senderNodeId)),e.kind!==void 0&&(d.push("m.kind = ?"),i.push(e.kind));const a=await r.prepareUncached(`SELECT d.delivery_id FROM deliveries d JOIN messages m ON m.message_id = d.message_id WHERE ${d.join(" AND ")}`).all(...i);if(a.length===0)return[];const n=Date.now();return await r.prepareUncached(`UPDATE deliveries SET canceled_at = ?, updated_at = ? WHERE delivery_id IN (${a.map(()=>"?").join(",")})`).run(n,n,...a.map(o=>o.delivery_id)),a.map(o=>o.delivery_id)})}s(Q,"cancelPendingNodeMail");async function X(t,e){return await c(async r=>{const d=Date.now(),i=await r.prepare(`SELECT target.status AS controller_status FROM waits w LEFT JOIN nodes target ON target.node_id = w.target_id
13
+ WHERE w.node_id = ? AND w.kind = 'controller' AND w.target_id = ? AND w.satisfied_at IS NULL`).get(t,e);if(i===void 0||i.controller_status==="active"||i.controller_status==="idle")return null;const a=await j(t,{kind:"urgent",label:"declared controller is no longer live",bodyJson:{body:`Controller ${e} is no longer live; the declared message wait was cleared.`},urgency:"urgent",wake:1});if(!await k(t,e,d,r))throw new Error(`controller wait changed while notifying ${t}`);return a})}s(X,"enqueueControllerDeathNotice");export{V as cancelDelivery,Q as cancelPendingNodeMail,m as consumeDeadlineOnWake,C as effectiveTier,X as enqueueControllerDeathNotice,j as enqueueNodeMail,g as finalizeNodeMail,_ as insertMessage,W as insertMessages,z as listenDeliveryTier,y as newId,G as queueNodeNotice};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@north-light/cli",
3
- "version": "0.3.698",
3
+ "version": "0.3.699",
4
4
  "description": "crtr — agent runtime with memory, plugins, and marketplaces",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -156,8 +156,8 @@
156
156
  },
157
157
  "license": "UNLICENSED",
158
158
  "dependencies": {
159
- "@north-light/identity": "0.3.698",
160
- "@north-light/plugin": "0.3.698",
159
+ "@north-light/identity": "0.3.699",
160
+ "@north-light/plugin": "0.3.699",
161
161
  "@earendil-works/chord": "1.5.2",
162
162
  "@earendil-works/pi-agent-core": "1.5.2",
163
163
  "@earendil-works/pi-ai": "1.5.2",
@@ -222,11 +222,13 @@ export class InputController {
222
222
  const submit = this.hooks.onDormantSubmit;
223
223
  if (submit === undefined)
224
224
  return;
225
- submit(this.expandImagePlaceholders(classification.text));
225
+ const expanded = this.expandImagePlaceholders(classification.text);
226
+ submit(expanded);
226
227
  this.recordCompletionUse(text);
227
228
  this.editor.addToHistory(classification.trimmed);
228
229
  this.editor.setText('');
229
230
  this.clearPastedImages();
231
+ this.hooks.onMessageSent?.(expanded);
230
232
  this.hooks.onPromptSent?.();
231
233
  return;
232
234
  }
@@ -249,6 +251,8 @@ export class InputController {
249
251
  this.editor.addToHistory(classification.trimmed);
250
252
  this.editor.setText('');
251
253
  this.clearPastedImages();
254
+ if (delivery === 'prompt')
255
+ this.hooks.onMessageSent?.(expanded);
252
256
  this.hooks.onPromptSent?.();
253
257
  }
254
258
  handleFollowUp() {
@@ -20,7 +20,7 @@
20
20
  // for crouter-owned message/tool types it understands; other extension
21
21
  // `renderCall`/`renderResult` hooks degrade to the default ToolExecutionComponent
22
22
  // path while builtin tools, diffs, and partial-result streaming keep working.
23
- import { Container, Loader, Spacer, Text } from '@earendil-works/pi-tui';
23
+ import { Container, Loader, Markdown, Spacer, Text } from '@earendil-works/pi-tui';
24
24
  import { AssistantMessageComponent, BashExecutionComponent, BranchSummaryMessageComponent, CompactionSummaryMessageComponent, CustomMessageComponent, parseSkillBlock, SkillInvocationMessageComponent, ToolExecutionComponent, UserMessageComponent, } from '@earendil-works/pi-coding-agent';
25
25
  import { attachMarkdownTheme } from '../config.js';
26
26
  import { ContextMessageComponent } from './context-message.js';
@@ -274,6 +274,11 @@ export class ChatView {
274
274
  /** Standalone ChatViews render activity inline; the attach viewer supplies
275
275
  * `onActivityChange`, so its transcript excludes this container. */
276
276
  statusContainer = new MeasuredContainer();
277
+ /** Messages the person sent from this viewer that the engine has not echoed
278
+ * back yet, drawn gray below history. Outside `historyContainer`, so a
279
+ * welcome snapshot rebuild never drops them. */
280
+ pendingContainer = new MeasuredContainer();
281
+ pendingSends = [];
277
282
  /** Optional banner, above history and status in the viewport's flat source. */
278
283
  bannerContainer;
279
284
  transcript;
@@ -436,11 +441,13 @@ export class ChatView {
436
441
  this.container.addChild(banner);
437
442
  }
438
443
  this.container.addChild(this.historyContainer);
444
+ this.container.addChild(this.pendingContainer);
439
445
  if (!this.onActivityChange)
440
446
  this.container.addChild(this.statusContainer);
441
447
  this.transcript = new CompositeViewportSource([
442
448
  ...(this.bannerContainer ? [this.bannerContainer] : []),
443
449
  this.historyContainer,
450
+ this.pendingContainer,
444
451
  ...(this.onActivityChange ? [] : [this.statusContainer]),
445
452
  ]);
446
453
  }
@@ -597,6 +604,7 @@ export class ChatView {
597
604
  }
598
605
  for (const turn of this.turns)
599
606
  this.refreshTurn(turn);
607
+ this.confirmPendingSendsIn(messages);
600
608
  // A rebuild constructs fresh components, which are born unfolded; re-apply the
601
609
  // setting so a reconnect/welcome does not silently unfold the transcript.
602
610
  this.applyToolDisplay();
@@ -1030,6 +1038,8 @@ export class ChatView {
1030
1038
  break;
1031
1039
  }
1032
1040
  case 'message_start': {
1041
+ if (event.message.role === 'user' && isTrueUserMessage(event.message))
1042
+ this.confirmPendingSend(this.userMessageText(event.message).trim());
1033
1043
  if (event.message.role === 'custom' || event.message.role === 'user') {
1034
1044
  this.addMessageToChat(event.message);
1035
1045
  // A card that joined a folded turn hides at once.
@@ -1858,6 +1868,50 @@ export class ChatView {
1858
1868
  this.historyContainer.markDirty(component);
1859
1869
  this.bashComponent = undefined;
1860
1870
  }
1871
+ /** Show a message the person just sent as pending: gray text, no background,
1872
+ * until the engine echoes it as a user message. */
1873
+ addPendingSend(text) {
1874
+ const trimmed = text.trim();
1875
+ if (!trimmed)
1876
+ return;
1877
+ const parts = [
1878
+ new Spacer(1),
1879
+ new Markdown(trimmed, 1, 1, attachMarkdownTheme(), { color: this.dimStyle }),
1880
+ ];
1881
+ for (const part of parts)
1882
+ this.pendingContainer.addChild(part);
1883
+ this.pendingSends.push({ text: trimmed, parts });
1884
+ this.tui.requestRender();
1885
+ }
1886
+ /** The engine echoed a user message: the matching pending send landed. */
1887
+ confirmPendingSend(text) {
1888
+ // The engine may reshape the text (image blocks, wrapping); with no exact
1889
+ // match the oldest pending send is the one that landed.
1890
+ const exact = this.pendingSends.findIndex((sent) => sent.text === text);
1891
+ const index = exact >= 0 ? exact : 0;
1892
+ if (this.pendingSends.length === 0)
1893
+ return;
1894
+ const [sent] = this.pendingSends.splice(index, 1);
1895
+ for (const part of sent.parts)
1896
+ this.pendingContainer.removeChild(part);
1897
+ }
1898
+ /** A snapshot rebuild: drop pending sends whose text the history now holds. */
1899
+ confirmPendingSendsIn(messages) {
1900
+ if (this.pendingSends.length === 0)
1901
+ return;
1902
+ const seen = new Set();
1903
+ for (const message of messages.slice(-50)) {
1904
+ if (message.role === 'user')
1905
+ seen.add(this.userMessageText(message).trim());
1906
+ }
1907
+ for (const sent of [...this.pendingSends]) {
1908
+ if (!seen.has(sent.text))
1909
+ continue;
1910
+ this.pendingSends.splice(this.pendingSends.indexOf(sent), 1);
1911
+ for (const part of sent.parts)
1912
+ this.pendingContainer.removeChild(part);
1913
+ }
1914
+ }
1861
1915
  /** Swap the single active activity indicator (working/compaction/retry). */
1862
1916
  setActivity(loader) {
1863
1917
  this.activityLoader?.stop();
@@ -92,6 +92,7 @@ export function createInputController(ctx, km, capabilities, hooks) {
92
92
  },
93
93
  onColor: hooks.setChipColor,
94
94
  onPromptSent: hooks.onPromptSent,
95
+ onMessageSent: hooks.onMessageSent,
95
96
  frecency: hooks.frecency,
96
97
  knownRefNames: () => editor.getResolvedRefNames(),
97
98
  // Global display toggles (Ctrl+O tools / Ctrl+T thinking) — pure render
@@ -469,6 +469,7 @@ onConnected) {
469
469
  if (userConfig.whip_mode)
470
470
  whipAnimation.play();
471
471
  },
472
+ onMessageSent: (text) => chatView.addPendingSend(text),
472
473
  frecency,
473
474
  });
474
475
  const whip = () => {
@@ -15,7 +15,7 @@ export function newId() {
15
15
  return id;
16
16
  }
17
17
  function stringify(value, name) {
18
- const json = JSON.stringify(value);
18
+ const json = JSON.stringify(value, (_key, v) => (typeof v === 'string' ? v.replace(/\p{Cs}/gu, '\uFFFD') : v));
19
19
  if (json === undefined)
20
20
  throw new TypeError(`${name} must be JSON-serializable`);
21
21
  return json;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@north-light/api",
3
- "version": "0.3.698",
3
+ "version": "0.3.699",
4
4
  "description": "Typed crtrd /v1 API contract — DTOs, route builders, the error contract, the CrtrClient, and the command-plugin manifest format. Zero runtime dependencies.",
5
5
  "type": "module",
6
6
  "main": "./dist/api/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@north-light/identity",
3
- "version": "0.3.698",
3
+ "version": "0.3.699",
4
4
  "description": "Northlight access-token verification and scope rules",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@north-light/plugin",
3
- "version": "0.3.698",
3
+ "version": "0.3.699",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -27,8 +27,8 @@
27
27
  "postpack": "node ../../scripts/pack-minify.mjs postpack packages/crouter-plugin"
28
28
  },
29
29
  "dependencies": {
30
- "@north-light/api": "0.3.698",
31
- "@north-light/identity": "0.3.698"
30
+ "@north-light/api": "0.3.699",
31
+ "@north-light/identity": "0.3.699"
32
32
  },
33
33
  "license": "UNLICENSED",
34
34
  "publishConfig": {
package/runtime.lock.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@north-light/cli",
3
- "version": "0.3.698",
3
+ "version": "0.3.699",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@north-light/cli",
9
- "version": "0.3.698",
9
+ "version": "0.3.699",
10
10
  "hasInstallScript": true,
11
11
  "license": "UNLICENSED",
12
12
  "workspaces": [
@@ -28,8 +28,8 @@
28
28
  "@milkdown/preset-gfm": "^7.22.3",
29
29
  "@milkdown/prose": "^7.22.3",
30
30
  "@milkdown/utils": "^7.22.3",
31
- "@north-light/identity": "0.3.698",
32
- "@north-light/plugin": "0.3.698",
31
+ "@north-light/identity": "0.3.699",
32
+ "@north-light/plugin": "0.3.699",
33
33
  "cron-parser": "^5.6.0",
34
34
  "esbuild": "0.28.2",
35
35
  "jose": "^6.2.12",
@@ -10667,17 +10667,17 @@
10667
10667
  },
10668
10668
  "packages/crouter-api": {
10669
10669
  "name": "@north-light/api",
10670
- "version": "0.3.698",
10670
+ "version": "0.3.699",
10671
10671
  "license": "UNLICENSED"
10672
10672
  },
10673
10673
  "packages/crouter-env-docker": {
10674
10674
  "name": "@north-light/env-docker",
10675
- "version": "0.3.698",
10675
+ "version": "0.3.699",
10676
10676
  "license": "UNLICENSED"
10677
10677
  },
10678
10678
  "packages/crouter-identity": {
10679
10679
  "name": "@north-light/identity",
10680
- "version": "0.3.698",
10680
+ "version": "0.3.699",
10681
10681
  "license": "UNLICENSED",
10682
10682
  "dependencies": {
10683
10683
  "jose": "^6.2.1"
@@ -10685,21 +10685,21 @@
10685
10685
  },
10686
10686
  "packages/crouter-plugin": {
10687
10687
  "name": "@north-light/plugin",
10688
- "version": "0.3.698",
10688
+ "version": "0.3.699",
10689
10689
  "license": "UNLICENSED",
10690
10690
  "dependencies": {
10691
- "@north-light/api": "0.3.698",
10692
- "@north-light/identity": "0.3.698"
10691
+ "@north-light/api": "0.3.699",
10692
+ "@north-light/identity": "0.3.699"
10693
10693
  }
10694
10694
  },
10695
10695
  "packages/crouter-sdk": {
10696
10696
  "name": "@north-light/sdk",
10697
- "version": "0.3.698",
10697
+ "version": "0.3.699",
10698
10698
  "license": "UNLICENSED",
10699
10699
  "dependencies": {
10700
- "@north-light/api": "0.3.698",
10701
- "@north-light/identity": "0.3.698",
10702
- "@north-light/plugin": "0.3.698",
10700
+ "@north-light/api": "0.3.699",
10701
+ "@north-light/identity": "0.3.699",
10702
+ "@north-light/plugin": "0.3.699",
10703
10703
  "jose": "^6.2.1"
10704
10704
  },
10705
10705
  "bin": {