@attson/atwebpilot-mcp 0.0.21 → 0.0.22

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.
Files changed (2) hide show
  1. package/dist/index.js +12 -2
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -188,6 +188,7 @@ var ChatSessionEventSchema = z3.discriminatedUnion("type", [
188
188
 
189
189
  // ../shared/src/protocol/messages.ts
190
190
  var StepSchema = z4.object({
191
+ kind: z4.literal("tool"),
191
192
  tool: z4.string(),
192
193
  args: z4.unknown()
193
194
  });
@@ -870,6 +871,15 @@ var LoopbackWSHub = class {
870
871
  }
871
872
  return;
872
873
  }
874
+ if (msg.type === "PING") {
875
+ this.rawSend(socket, {
876
+ type: "PONG",
877
+ nonce: this.opts.idGen.next("nonce"),
878
+ ts: this.opts.clock.now(),
879
+ protocol_version: PROTOCOL_VERSION,
880
+ echo_nonce: msg.nonce
881
+ });
882
+ }
873
883
  const wid = this.workerOf.get(socket);
874
884
  if (wid) {
875
885
  for (const h of this.msgHandlers) h(wid, msg);
@@ -920,7 +930,7 @@ var LoopbackWSHub = class {
920
930
  req_id,
921
931
  session_id: params.session_id,
922
932
  tab_id: params.tab_id,
923
- step: { tool: params.step.tool, args: params.step.args }
933
+ step: { kind: "tool", tool: params.step.tool, args: params.step.args }
924
934
  });
925
935
  if (this.byWorker.get(worker_id) !== socket) {
926
936
  clearTimeout(timer);
@@ -1376,7 +1386,7 @@ async function handleBrowserTool(deps, gen, args) {
1376
1386
  const v = deps.coordinator.validateCall({ session_id, kind: "extension_tool", tool, httpCookied });
1377
1387
  if (!v.ok) throw new Error(`${v.error.code}: ${v.error.message}`);
1378
1388
  deps.coordinator.recordCall(session_id, v.dangerous);
1379
- const result = await deps.hub.exec(session.worker_id, { session_id, tab_id: session.tab_id, step: { tool, args: toolArgs } });
1389
+ const result = await deps.hub.exec(session.worker_id, { session_id, tab_id: session.tab_id, step: { kind: "tool", tool, args: toolArgs } });
1380
1390
  if (!result.ok) throw new Error(result.error ? `${result.error.code}: ${result.error.message}` : "EXEC failed");
1381
1391
  return result.return ?? null;
1382
1392
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@attson/atwebpilot-mcp",
3
- "version": "0.0.21",
3
+ "version": "0.0.22",
4
4
  "license": "Apache-2.0",
5
5
  "description": "MCP server for the atwebpilot browser extension — let Claude Code drive your browser.",
6
6
  "homepage": "https://github.com/attson/atwebpilot#readme",