@clawos-dev/clawd 0.2.71-beta.126.06f4cfa → 0.2.71-beta.127.52e9b3f

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/cli.cjs +11 -2
  2. package/package.json +1 -1
package/dist/cli.cjs CHANGED
@@ -28370,15 +28370,18 @@ var RevokeArgsSchema = external_exports.object({
28370
28370
  capabilityId: external_exports.string().min(1)
28371
28371
  }).strict();
28372
28372
  function buildCapabilityHandlers(deps) {
28373
- const { manager } = deps;
28373
+ const { manager, getShareBaseUrl } = deps;
28374
28374
  const issue = async (frame) => {
28375
28375
  const { type: _type, requestId: _requestId, ...rest } = frame;
28376
28376
  const args = IssueArgsSchema.parse(rest);
28377
28377
  const { token, capability } = manager.issue(args);
28378
+ const base = getShareBaseUrl().replace(/\/$/, "");
28379
+ const shareUrl = `${base}/?token=${encodeURIComponent(token)}`;
28378
28380
  return {
28379
28381
  response: {
28380
28382
  type: "capability:issued",
28381
28383
  token,
28384
+ shareUrl,
28382
28385
  capability: stripSecretHash(capability)
28383
28386
  }
28384
28387
  };
@@ -28774,7 +28777,10 @@ function buildMethodHandlers(deps) {
28774
28777
  personaManager: deps.personaManager,
28775
28778
  personaRegistry: deps.personaRegistry
28776
28779
  }),
28777
- ...buildCapabilityHandlers({ manager: deps.capabilityManager }),
28780
+ ...buildCapabilityHandlers({
28781
+ manager: deps.capabilityManager,
28782
+ getShareBaseUrl: deps.getShareBaseUrl
28783
+ }),
28778
28784
  ...buildInboxHandlers({
28779
28785
  manager: deps.inboxManager,
28780
28786
  capabilityRegistry: deps.capabilityRegistry
@@ -29140,6 +29146,9 @@ async function startDaemon(config) {
29140
29146
  },
29141
29147
  // Task 1.9: capability:issue/list/revoke handler 依赖
29142
29148
  capabilityManager,
29149
+ // v2 Phase 5: capability:issue 返回的 shareUrl 用此 base URL 拼接。
29150
+ // tunnel 拉起后切到反代 wss://... 地址;否则本机 ws://host:port。
29151
+ getShareBaseUrl: () => currentTunnelUrl ?? `ws://${config.host}:${config.port}`,
29143
29152
  // Phase 4 Task 4.2: inbox:postMessage 要查 capabilityRegistry 解析 peer Principal
29144
29153
  capabilityRegistry,
29145
29154
  // Phase 3 Task 3.4: inbox:list/markRead handler 依赖
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clawos-dev/clawd",
3
- "version": "0.2.71-beta.126.06f4cfa",
3
+ "version": "0.2.71-beta.127.52e9b3f",
4
4
  "description": "Standalone clawd daemon — Claude Code (and future Codex) session server over WebSocket",
5
5
  "type": "module",
6
6
  "license": "MIT",