@agentproto/runtime 5.11.0 → 5.11.1

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.
package/dist/index.d.ts CHANGED
@@ -936,15 +936,14 @@ interface EnableResult {
936
936
  * A single link to open on a phone (PHONE-PLAN.md P1.2) — the token rides
937
937
  * in a URL *fragment* (`#token=`), never a `?` query string, since
938
938
  * fragments never reach a server (no Referer, no access/proxy log, no CDN
939
- * cache key). Two shapes, chosen by whether this daemon has the
940
- * `@agentik/session-chat` app installed with a UI:
941
- * - installed: `<publicUrl>/apps/@agentik/session-chat/ui#token=<t>` —
942
- * the phone lands directly in Control Center.
943
- * - not installed: `https://cli.agentproto.sh/panel#daemon=<publicUrl>&token=<t>`
944
- * — the hosted panel, which speaks the same fragment shape (see
945
- * agentproto/cli-site's `readFragmentConnection`).
946
- * Only emitted when exposing the gateway (same condition as `bearerToken`)
947
- * — a passthrough tunnel has no daemon UI to link to.
939
+ * cache key): `<publicUrl>/apps/@agentik/session-chat/ui#token=<t>`, so
940
+ * the phone lands directly in Control Center. Only emitted when exposing
941
+ * the gateway (same condition as `bearerToken`) — a passthrough tunnel has
942
+ * no daemon UI to link to — AND when this daemon has the
943
+ * `@agentik/session-chat` app installed with a UI: it is the only daemon
944
+ * page that reads the `#token=` fragment, and there is no hosted panel to
945
+ * fall back to (the hosted cli-site panel is retired; phones pair
946
+ * through rendezvous, `agentproto pair offer`).
948
947
  */
949
948
  phoneUrl?: string;
950
949
  provider: "quick";
package/dist/index.mjs CHANGED
@@ -27959,7 +27959,8 @@ function createMcpObservationStore(opts = {}) {
27959
27959
  const obs = touch(sessionId);
27960
27960
  const at = obs.lastSeenAt;
27961
27961
  const result = message.result && typeof message.result === "object" ? message.result : void 0;
27962
- const error = message.error ? `${String(message.error.code ?? "error")}: ${String(message.error.message ?? "")}` : void 0;
27962
+ const isExpectedDiscoverMiss = method === "server/discover" && message.error?.code === -32601;
27963
+ const error = message.error && !isExpectedDiscoverMiss ? `${String(message.error.code ?? "error")}: ${String(message.error.message ?? "")}` : void 0;
27963
27964
  const answeredVersion = typeof result?.["protocolVersion"] === "string" ? result["protocolVersion"] : void 0;
27964
27965
  const protocolVersion = method === "initialize" ? answeredVersion : clientProtocolVersion;
27965
27966
  const base = {
@@ -28149,7 +28150,7 @@ function buildSessionCapabilities(desc, pendingPermissions, mcpObservation) {
28149
28150
  function daemonMountFields(obs, turnsCompleted) {
28150
28151
  const status = daemonMountStatus(obs, turnsCompleted);
28151
28152
  const tl = obs?.toolsList;
28152
- const failing = tl && !tl.ok ? tl : [obs?.initialize, obs?.discover].find((c) => c && !c.ok);
28153
+ const failing = tl ? tl.ok ? void 0 : tl : [obs?.initialize, obs?.discover].find((c) => c && !c.ok);
28153
28154
  const error = failing?.error ?? (obs?.httpError ? `HTTP ${obs.httpError.status}` : void 0);
28154
28155
  const protocolVersion = tl?.protocolVersion ?? obs?.initialize?.protocolVersion ?? obs?.discover?.protocolVersion;
28155
28156
  return {
@@ -50568,16 +50569,7 @@ function projectSessionForHttp(session, fields) {
50568
50569
  var DEFAULT_ALLOWED_ORIGINS = [
50569
50570
  "http://localhost:*",
50570
50571
  "http://127.0.0.1:*",
50571
- "https://localhost:*",
50572
- // The canonical hosted agentproto panel (github.com/agentproto/cli-site,
50573
- // deployed at cli.agentproto.sh). It drives the user's OWN local daemon
50574
- // from the browser: read-only GETs (session list, SSE stream) are ungated
50575
- // and already work, but the /sessions/:id/pty WebSocket upgrade IS gated —
50576
- // so a PTY terminal in the panel 401s unless this first-party origin is
50577
- // trusted like localhost. A malicious page can't forge this Origin (the
50578
- // browser sets it), so the trust is scoped to agentproto's own panel,
50579
- // matching how guilde.work is trusted. Drop it via `strictOrigins`.
50580
- "https://cli.agentproto.sh"
50572
+ "https://localhost:*"
50581
50573
  ];
50582
50574
  var DEFAULT_FRAME_ANCESTORS = ["vscode-webview:", "vscode-file:"];
50583
50575
  var EVENTS_KEEPALIVE_MS = 25e3;
@@ -64356,7 +64348,9 @@ var RemoteController = class {
64356
64348
  result.bearerToken = bearerToken;
64357
64349
  result.mcpEndpoint = mcpEndpoint;
64358
64350
  result.mcpConfigSnippet = buildMcpConfigSnippet2(mcpEndpoint, bearerToken);
64359
- result.phoneUrl = this.opts.isSessionChatInstalled?.() ? `${started.publicUrl}/apps/${SESSION_CHAT_APP_ID}/ui#token=${bearerToken}` : `https://cli.agentproto.sh/panel#daemon=${encodeURIComponent(started.publicUrl)}&token=${bearerToken}`;
64351
+ if (this.opts.isSessionChatInstalled?.()) {
64352
+ result.phoneUrl = `${started.publicUrl}/apps/${SESSION_CHAT_APP_ID}/ui#token=${bearerToken}`;
64353
+ }
64360
64354
  } else {
64361
64355
  const warning = `\u26A0 ${started.publicUrl} forwards to ${target.host}:${target.port} with NO authentication from the daemon \u2014 anyone with the URL can reach it. Ensure the upstream service enforces its own auth, and run remote_disable when done.`;
64362
64356
  result.warning = warning;
@@ -64450,7 +64444,7 @@ function registerRemoteTools(server, opts) {
64450
64444
  const { controller } = opts;
64451
64445
  server.tool(
64452
64446
  "remote_enable",
64453
- "Publish a local port to the internet via Cloudflare. By default exposes this gateway and gates it with a bearer token (returned ONCE in the response \u2014 store it; only its hash is persisted). Pass `targetPort` to tunnel a different local service (Supabase, dev server, \u2026); in that mode the daemon does not gate the proxied traffic \u2014 the upstream service handles its own auth. Returns the public URL plus a paste-ready `.mcp.json` snippet and a `phoneUrl` \u2014 a single link to open on a phone, with the token in a URL fragment (gateway mode only). Re-running while a tunnel is already up errors; call `remote_disable` first to rotate.",
64447
+ "Publish a local port to the internet via Cloudflare. By default exposes this gateway and gates it with a bearer token (returned ONCE in the response \u2014 store it; only its hash is persisted). Pass `targetPort` to tunnel a different local service (Supabase, dev server, \u2026); in that mode the daemon does not gate the proxied traffic \u2014 the upstream service handles its own auth. Returns the public URL plus a paste-ready `.mcp.json` snippet and a `phoneUrl` \u2014 a single link to open on a phone, with the token in a URL fragment (gateway mode, and only when the @agentik/session-chat app is installed). Re-running while a tunnel is already up errors; call `remote_disable` first to rotate.",
64454
64448
  {
64455
64449
  provider: z.enum(["quick"]).optional().describe(
64456
64450
  "Tunnel backend. `quick` = Cloudflare Quick Tunnel (no API key, ephemeral *.trycloudflare.com URL). Defaults to `quick`. Named-CF / Tailscale providers TBD."