@drisp/cli 0.3.39 → 0.4.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.
@@ -470,6 +470,9 @@ var ConsoleAdapter = class {
470
470
  idempotencyKey: msg.idempotencyKey,
471
471
  text: msg.text
472
472
  };
473
+ writeGatewayTrace(
474
+ `consoleAdapter send message.out runner=${this.opts.runnerId} workspace=${frame.address.workspaceId ?? ""} conversation=${frame.address.conversationId ?? ""} thread=${frame.address.threadId ?? ""} user=${frame.address.userId ?? ""} textLength=${msg.text.length} idempotencyKey=${msg.idempotencyKey}`
475
+ );
473
476
  client.sendFrame(frame);
474
477
  return {
475
478
  providerMessageId: messageId,
@@ -2097,7 +2100,7 @@ var cachedVersion = null;
2097
2100
  function readVersion() {
2098
2101
  if (cachedVersion !== null) return cachedVersion;
2099
2102
  try {
2100
- const injected = "0.3.39";
2103
+ const injected = "0.4.0";
2101
2104
  if (typeof injected === "string" && injected.length > 0) {
2102
2105
  cachedVersion = injected;
2103
2106
  return cachedVersion;
@@ -2669,6 +2672,9 @@ var Dispatcher = class {
2669
2672
  }
2670
2673
  async handleTurnComplete(payload) {
2671
2674
  const current = this.registry.getCurrent();
2675
+ writeGatewayTrace(
2676
+ `dispatcher turn.complete received runtimeId=${payload.runtimeId} dispatchId=${payload.dispatchId} channel=${payload.location.channelId} account=${payload.location.accountId} thread=${payload.location.thread?.id ?? ""} textLength=${payload.text.length}`
2677
+ );
2672
2678
  if (!current || current.runtimeId !== payload.runtimeId) {
2673
2679
  throw new Error("runtime mismatch on session.turn.complete");
2674
2680
  }
@@ -2677,15 +2683,24 @@ var Dispatcher = class {
2677
2683
  entry = this.registry.completeDispatch(payload.dispatchId);
2678
2684
  } catch (err) {
2679
2685
  if (err instanceof UnknownDispatchError) {
2686
+ writeGatewayTrace(
2687
+ `dispatcher turn.complete unknown dispatchId=${payload.dispatchId}`
2688
+ );
2680
2689
  return { delivered: false };
2681
2690
  }
2682
2691
  throw err;
2683
2692
  }
2693
+ writeGatewayTrace(
2694
+ `dispatcher sendOutbound channel=${entry.location.channelId} dispatchId=${payload.dispatchId} parkedAccount=${entry.location.accountId} parkedThread=${entry.location.thread?.id ?? ""}`
2695
+ );
2684
2696
  const result = await this.sendOutbound(entry.location.channelId, {
2685
2697
  location: payload.location,
2686
2698
  text: payload.text,
2687
2699
  idempotencyKey: payload.idempotencyKey
2688
2700
  });
2701
+ writeGatewayTrace(
2702
+ `dispatcher sendOutbound delivered dispatchId=${payload.dispatchId} providerMessageId=${result.providerMessageId}`
2703
+ );
2689
2704
  return {
2690
2705
  delivered: true,
2691
2706
  providerMessageId: result.providerMessageId
package/dist/cli.js CHANGED
@@ -12062,6 +12062,9 @@ var SessionBridge = class {
12062
12062
  }
12063
12063
  async completeTurn(input) {
12064
12064
  const client = await this.requireConnectedClient();
12065
+ writeGatewayTrace(
12066
+ `sessionBridge completeTurn request runtimeId=${this.opts.runtimeId} dispatchId=${input.dispatchId} channel=${input.location.channelId} account=${input.location.accountId} thread=${input.location.thread?.id ?? ""} textLength=${input.text.length}`
12067
+ );
12065
12068
  const req = {
12066
12069
  runtimeId: this.opts.runtimeId,
12067
12070
  dispatchId: input.dispatchId,
@@ -12069,7 +12072,11 @@ var SessionBridge = class {
12069
12072
  text: input.text,
12070
12073
  idempotencyKey: input.idempotencyKey
12071
12074
  };
12072
- return client.request("session.turn.complete", req);
12075
+ const res = await client.request("session.turn.complete", req);
12076
+ writeGatewayTrace(
12077
+ `sessionBridge completeTurn response runtimeId=${this.opts.runtimeId} dispatchId=${input.dispatchId} delivered=${res.delivered} providerMessageId=${res.providerMessageId ?? ""}`
12078
+ );
12079
+ return res;
12073
12080
  }
12074
12081
  async relayPermission(req) {
12075
12082
  writeGatewayTrace(
@@ -23928,6 +23935,9 @@ function AppContent({
23928
23935
  location: payload.inbound.location,
23929
23936
  feedEventCountAtDispatch: feedEvents.length
23930
23937
  };
23938
+ writeGatewayTrace(
23939
+ `AppShell dispatch received dispatchId=${payload.dispatchId} channel=${payload.inbound.location.channelId} account=${payload.inbound.location.accountId} thread=${payload.inbound.location.thread?.id ?? ""} feedCount=${feedEvents.length}`
23940
+ );
23931
23941
  addMessage("user", text);
23932
23942
  const sessionToResume = currentSessionId ?? initialSessionRef.current;
23933
23943
  const continuation = sessionToResume ? { mode: "resume", handle: sessionToResume } : { mode: "fresh" };
@@ -23978,6 +23988,9 @@ function AppContent({
23978
23988
  if (!text || text.length === 0) return;
23979
23989
  pendingDispatchRef.current = null;
23980
23990
  const idempotencyKey = `dispatch:${pending.dispatchId}`;
23991
+ writeGatewayTrace(
23992
+ `AppShell completing dispatchId=${pending.dispatchId} channel=${pending.location.channelId} account=${pending.location.accountId} thread=${pending.location.thread?.id ?? ""} replySeq=${reply.seq} replyLength=${text.length}`
23993
+ );
23981
23994
  void sessionBridge.completeTurn({
23982
23995
  dispatchId: pending.dispatchId,
23983
23996
  location: pending.location,
@@ -27399,7 +27412,7 @@ var cachedVersion = null;
27399
27412
  function readPackageVersion() {
27400
27413
  if (cachedVersion !== null) return cachedVersion;
27401
27414
  try {
27402
- const injected = "0.3.39";
27415
+ const injected = "0.4.0";
27403
27416
  if (typeof injected === "string" && injected.length > 0) {
27404
27417
  cachedVersion = injected;
27405
27418
  return cachedVersion;
package/package.json CHANGED
@@ -17,7 +17,7 @@
17
17
  "hooks",
18
18
  "dashboard"
19
19
  ],
20
- "version": "0.3.39",
20
+ "version": "0.4.0",
21
21
  "license": "MIT",
22
22
  "bin": {
23
23
  "drisp": "dist/cli.js",