@dxos/edge-client 0.9.0 → 0.9.1-staging.ee54ba693a
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/lib/neutral/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/neutral/chunk-J5LGTIGS.mjs.map +7 -0
- package/dist/lib/neutral/cors-proxy.mjs +1 -0
- package/dist/lib/neutral/edge-ws-muxer.mjs +1 -0
- package/dist/lib/neutral/index.mjs +111 -35
- package/dist/lib/neutral/index.mjs.map +3 -3
- package/dist/lib/neutral/meta.json +1 -1
- package/dist/lib/neutral/service/index.mjs +134 -0
- package/dist/lib/neutral/service/index.mjs.map +7 -0
- package/dist/lib/neutral/testing/index.mjs +2 -1
- package/dist/lib/neutral/testing/index.mjs.map +3 -3
- package/dist/types/src/auth.d.ts.map +1 -1
- package/dist/types/src/browser-rendering.d.ts +28 -0
- package/dist/types/src/browser-rendering.d.ts.map +1 -0
- package/dist/types/src/edge-ai-http-client.d.ts +39 -0
- package/dist/types/src/edge-ai-http-client.d.ts.map +1 -1
- package/dist/types/src/edge-ai-http-client.test.d.ts +2 -0
- package/dist/types/src/edge-ai-http-client.test.d.ts.map +1 -0
- package/dist/types/src/edge-client.d.ts +3 -2
- package/dist/types/src/edge-client.d.ts.map +1 -1
- package/dist/types/src/edge-http-client.d.ts +19 -4
- package/dist/types/src/edge-http-client.d.ts.map +1 -1
- package/dist/types/src/edge-identity.d.ts +5 -1
- package/dist/types/src/edge-identity.d.ts.map +1 -1
- package/dist/types/src/hub-http-client.d.ts +8 -1
- package/dist/types/src/hub-http-client.d.ts.map +1 -1
- package/dist/types/src/service/Image.d.ts +25 -0
- package/dist/types/src/service/Image.d.ts.map +1 -0
- package/dist/types/src/service/edge-service.d.ts +36 -0
- package/dist/types/src/service/edge-service.d.ts.map +1 -0
- package/dist/types/src/service/edge-service.test.d.ts +2 -0
- package/dist/types/src/service/edge-service.test.d.ts.map +1 -0
- package/dist/types/src/service/image-service.e2e.test.d.ts +2 -0
- package/dist/types/src/service/image-service.e2e.test.d.ts.map +1 -0
- package/dist/types/src/service/index.d.ts +3 -0
- package/dist/types/src/service/index.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +22 -17
- package/src/auth.ts +6 -6
- package/src/base-http-client.ts +1 -1
- package/src/browser-rendering.ts +39 -0
- package/src/edge-ai-http-client.test.ts +37 -0
- package/src/edge-ai-http-client.ts +87 -2
- package/src/edge-client.test.ts +1 -1
- package/src/edge-client.ts +9 -7
- package/src/edge-http-client.ts +25 -10
- package/src/edge-identity.ts +5 -1
- package/src/edge-ws-connection.ts +1 -1
- package/src/edge-ws-muxer.test.ts +1 -1
- package/src/hub-http-client.ts +20 -0
- package/src/service/Image.ts +61 -0
- package/src/service/edge-service.test.ts +151 -0
- package/src/service/edge-service.ts +139 -0
- package/src/service/image-service.e2e.test.ts +53 -0
- package/src/service/index.ts +7 -0
- package/src/testing/test-utils.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"src/cors-proxy.ts":{"bytes":5060,"imports":[],"format":"esm"},"src/protocol.ts":{"bytes":9826,"imports":[{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/protocols/buf","kind":"import-statement","external":true},{"path":"@dxos/protocols/buf/dxos/edge/messenger_pb","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"src/defs.ts":{"bytes":1470,"imports":[{"path":"@dxos/protocols/buf","kind":"import-statement","external":true},{"path":"@dxos/protocols/buf/dxos/edge/messenger_pb","kind":"import-statement","external":true},{"path":"src/protocol.ts","kind":"import-statement","original":"./protocol"}],"format":"esm"},"src/edge-ws-muxer.ts":{"bytes":29236,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/protocols/buf","kind":"import-statement","external":true},{"path":"@dxos/protocols/buf/dxos/edge/messenger_pb","kind":"import-statement","external":true},{"path":"src/defs.ts","kind":"import-statement","original":"./defs"}],"format":"esm"},"src/auth.ts":{"bytes":11980,"imports":[{"path":"@dxos/credentials","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keyring","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true}],"format":"esm"},"src/edge-identity.ts":{"bytes":3761,"imports":[{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto","kind":"import-statement","external":true}],"format":"esm"},"src/edge-ws-connection.ts":{"bytes":36161,"imports":[{"path":"isomorphic-ws","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/protocols","kind":"import-statement","external":true},{"path":"@dxos/protocols/buf","kind":"import-statement","external":true},{"path":"@dxos/protocols/buf/dxos/edge/messenger_pb","kind":"import-statement","external":true},{"path":"src/defs.ts","kind":"import-statement","original":"./defs"},{"path":"src/edge-ws-muxer.ts","kind":"import-statement","original":"./edge-ws-muxer"},{"path":"src/protocol.ts","kind":"import-statement","original":"./protocol"}],"format":"esm"},"src/errors.ts":{"bytes":1106,"imports":[],"format":"esm"},"src/utils.ts":{"bytes":1317,"imports":[],"format":"esm"},"src/edge-client.ts":{"bytes":39693,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/client/services","kind":"import-statement","external":true},{"path":"src/defs.ts","kind":"import-statement","original":"./defs"},{"path":"src/edge-identity.ts","kind":"import-statement","original":"./edge-identity"},{"path":"src/edge-ws-connection.ts","kind":"import-statement","original":"./edge-ws-connection"},{"path":"src/errors.ts","kind":"import-statement","original":"./errors"},{"path":"src/utils.ts","kind":"import-statement","original":"./utils"}],"format":"esm"},"src/http-client.ts":{"bytes":7215,"imports":[{"path":"effect/Context","kind":"import-statement","external":true},{"path":"effect/Duration","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Layer","kind":"import-statement","external":true},{"path":"effect/Schedule","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"src/base-http-client.ts":{"bytes":27427,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/protocols","kind":"import-statement","external":true},{"path":"src/edge-identity.ts","kind":"import-statement","original":"./edge-identity"},{"path":"src/http-client.ts","kind":"import-statement","original":"./http-client"},{"path":"src/utils.ts","kind":"import-statement","original":"./utils"}],"format":"esm"},"src/edge-ai-http-client.ts":{"bytes":16882,"imports":[{"path":"@effect/platform/Headers","kind":"import-statement","external":true},{"path":"@effect/platform/HttpClient","kind":"import-statement","external":true},{"path":"@effect/platform/HttpClientError","kind":"import-statement","external":true},{"path":"@effect/platform/HttpClientResponse","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/FiberRef","kind":"import-statement","external":true},{"path":"effect/Layer","kind":"import-statement","external":true},{"path":"effect/Stream","kind":"import-statement","external":true},{"path":"@dxos/errors","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/protocols","kind":"import-statement","external":true}],"format":"esm"},"src/edge-http-client.ts":{"bytes":47558,"imports":[{"path":"@effect/platform/FetchHttpClient","kind":"import-statement","external":true},{"path":"@effect/platform/HttpClient","kind":"import-statement","external":true},{"path":"@effect/platform/HttpClientRequest","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Function","kind":"import-statement","external":true},{"path":"@dxos/effect","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/protocols","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"src/base-http-client.ts","kind":"import-statement","original":"./base-http-client"},{"path":"src/cors-proxy.ts","kind":"import-statement","original":"./cors-proxy"},{"path":"src/http-client.ts","kind":"import-statement","original":"./http-client"}],"format":"esm"},"src/hub-http-client.ts":{"bytes":11880,"imports":[{"path":"src/base-http-client.ts","kind":"import-statement","original":"./base-http-client"}],"format":"esm"},"src/index.ts":{"bytes":1718,"imports":[{"path":"@dxos/protocols/buf/dxos/edge/messenger_pb","kind":"import-statement","external":true},{"path":"src/auth.ts","kind":"import-statement","original":"./auth"},{"path":"src/cors-proxy.ts","kind":"import-statement","original":"./cors-proxy"},{"path":"src/defs.ts","kind":"import-statement","original":"./defs"},{"path":"src/edge-client.ts","kind":"import-statement","original":"./edge-client"},{"path":"src/errors.ts","kind":"import-statement","original":"./errors"},{"path":"src/protocol.ts","kind":"import-statement","original":"./protocol"},{"path":"src/base-http-client.ts","kind":"import-statement","original":"./base-http-client"},{"path":"src/edge-ai-http-client.ts","kind":"import-statement","original":"./edge-ai-http-client"},{"path":"src/edge-http-client.ts","kind":"import-statement","original":"./edge-http-client"},{"path":"src/hub-http-client.ts","kind":"import-statement","original":"./hub-http-client"},{"path":"src/edge-identity.ts","kind":"import-statement","original":"./edge-identity"},{"path":"src/edge-ws-muxer.ts","kind":"import-statement","original":"./edge-ws-muxer"},{"path":"src/http-client.ts","kind":"import-statement","original":"./http-client"}],"format":"esm"},"src/testing/test-server.ts":{"bytes":4454,"imports":[{"path":"@dxos/node-std/http","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"src/testing/test-utils.ts":{"bytes":13633,"imports":[{"path":"isomorphic-ws","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/protocols","kind":"import-statement","external":true},{"path":"@dxos/protocols/buf","kind":"import-statement","external":true},{"path":"@dxos/protocols/buf/dxos/edge/messenger_pb","kind":"import-statement","external":true},{"path":"src/defs.ts","kind":"import-statement","original":"../defs"},{"path":"src/edge-ws-muxer.ts","kind":"import-statement","original":"../edge-ws-muxer"},{"path":"src/protocol.ts","kind":"import-statement","original":"../protocol"}],"format":"esm"},"src/testing/index.ts":{"bytes":477,"imports":[{"path":"src/testing/test-server.ts","kind":"import-statement","original":"./test-server"},{"path":"src/testing/test-utils.ts","kind":"import-statement","original":"./test-utils"}],"format":"esm"}},"outputs":{"dist/lib/neutral/cors-proxy.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/neutral/cors-proxy.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-WQKMEZJR.mjs","kind":"import-statement"}],"exports":["proxyFetchLegacy"],"entryPoint":"src/cors-proxy.ts","inputs":{},"bytes":130},"dist/lib/neutral/edge-ws-muxer.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/neutral/edge-ws-muxer.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-L5ZHLJ4B.mjs","kind":"import-statement"}],"exports":["CLOUDFLARE_MESSAGE_MAX_BYTES","CLOUDFLARE_RPC_MAX_BYTES","WebSocketMuxer"],"entryPoint":"src/edge-ws-muxer.ts","inputs":{},"bytes":249},"dist/lib/neutral/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":97880},"dist/lib/neutral/index.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-WQKMEZJR.mjs","kind":"import-statement"},{"path":"dist/lib/neutral/chunk-L5ZHLJ4B.mjs","kind":"import-statement"},{"path":"@dxos/protocols/buf/dxos/edge/messenger_pb","kind":"import-statement","external":true},{"path":"@dxos/credentials","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keyring","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/client/services","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto","kind":"import-statement","external":true},{"path":"isomorphic-ws","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/protocols","kind":"import-statement","external":true},{"path":"@dxos/protocols/buf","kind":"import-statement","external":true},{"path":"@dxos/protocols/buf/dxos/edge/messenger_pb","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/protocols","kind":"import-statement","external":true},{"path":"effect/Context","kind":"import-statement","external":true},{"path":"effect/Duration","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Layer","kind":"import-statement","external":true},{"path":"effect/Schedule","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@effect/platform/Headers","kind":"import-statement","external":true},{"path":"@effect/platform/HttpClient","kind":"import-statement","external":true},{"path":"@effect/platform/HttpClientError","kind":"import-statement","external":true},{"path":"@effect/platform/HttpClientResponse","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/FiberRef","kind":"import-statement","external":true},{"path":"effect/Layer","kind":"import-statement","external":true},{"path":"effect/Stream","kind":"import-statement","external":true},{"path":"@dxos/errors","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/protocols","kind":"import-statement","external":true},{"path":"@effect/platform/FetchHttpClient","kind":"import-statement","external":true},{"path":"@effect/platform/HttpClient","kind":"import-statement","external":true},{"path":"@effect/platform/HttpClientRequest","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Function","kind":"import-statement","external":true},{"path":"@dxos/effect","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/protocols","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"exports":["BaseHttpClient","ByokError","CLOUDFLARE_MESSAGE_MAX_BYTES","CLOUDFLARE_RPC_MAX_BYTES","EdgeAiHttpClient","EdgeClient","EdgeConnectionClosedError","EdgeHttpClient","EdgeIdentityChangedError","HttpConfig","HubHttpClient","Protocol","WebSocketMuxer","createChainEdgeIdentity","createDeviceEdgeIdentity","createEphemeralEdgeIdentity","createStubEdgeIdentity","createTestHaloEdgeIdentity","encodeAuthHeader","getTypename","handleAuthChallenge","protocol","proxyFetchLegacy","requestInitTagKey","toUint8Array","withLogging","withRetry","withRetryConfig"],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":60},"src/auth.ts":{"bytesInOutput":2919},"src/edge-client.ts":{"bytesInOutput":10071},"src/edge-identity.ts":{"bytesInOutput":1120},"src/edge-ws-connection.ts":{"bytesInOutput":9708},"src/errors.ts":{"bytesInOutput":232},"src/utils.ts":{"bytesInOutput":244},"src/base-http-client.ts":{"bytesInOutput":6930},"src/http-client.ts":{"bytesInOutput":1536},"src/edge-ai-http-client.ts":{"bytesInOutput":3218},"src/edge-http-client.ts":{"bytesInOutput":10298},"src/hub-http-client.ts":{"bytesInOutput":2147}},"bytes":49671},"dist/lib/neutral/chunk-WQKMEZJR.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2574},"dist/lib/neutral/chunk-WQKMEZJR.mjs":{"imports":[],"exports":["proxyFetchLegacy"],"inputs":{"src/cors-proxy.ts":{"bytesInOutput":868}},"bytes":965},"dist/lib/neutral/testing/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":8926},"dist/lib/neutral/testing/index.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-L5ZHLJ4B.mjs","kind":"import-statement"},{"path":"@dxos/node-std/http","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"isomorphic-ws","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/protocols","kind":"import-statement","external":true},{"path":"@dxos/protocols/buf","kind":"import-statement","external":true},{"path":"@dxos/protocols/buf/dxos/edge/messenger_pb","kind":"import-statement","external":true}],"exports":["DEFAULT_PORT","createTestEdgeWsServer","createTestServer","responseHandler"],"entryPoint":"src/testing/index.ts","inputs":{"src/testing/test-server.ts":{"bytesInOutput":1115},"src/testing/index.ts":{"bytesInOutput":0},"src/testing/test-utils.ts":{"bytesInOutput":3534}},"bytes":4923},"dist/lib/neutral/chunk-L5ZHLJ4B.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":18947},"dist/lib/neutral/chunk-L5ZHLJ4B.mjs":{"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/protocols/buf","kind":"import-statement","external":true},{"path":"@dxos/protocols/buf/dxos/edge/messenger_pb","kind":"import-statement","external":true},{"path":"@dxos/protocols/buf","kind":"import-statement","external":true},{"path":"@dxos/protocols/buf/dxos/edge/messenger_pb","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/protocols/buf","kind":"import-statement","external":true},{"path":"@dxos/protocols/buf/dxos/edge/messenger_pb","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"exports":["CLOUDFLARE_MESSAGE_MAX_BYTES","CLOUDFLARE_RPC_MAX_BYTES","Protocol","WebSocketMuxer","getTypename","protocol","toUint8Array"],"inputs":{"src/edge-ws-muxer.ts":{"bytesInOutput":7443},"src/defs.ts":{"bytesInOutput":298},"src/protocol.ts":{"bytesInOutput":2520}},"bytes":10551}}}
|
|
1
|
+
{"inputs":{"src/cors-proxy.ts":{"bytes":5060,"imports":[],"format":"esm"},"src/protocol.ts":{"bytes":9826,"imports":[{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/protocols/buf","kind":"import-statement","external":true},{"path":"@dxos/protocols/buf/dxos/edge/messenger_pb","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"src/defs.ts":{"bytes":1470,"imports":[{"path":"@dxos/protocols/buf","kind":"import-statement","external":true},{"path":"@dxos/protocols/buf/dxos/edge/messenger_pb","kind":"import-statement","external":true},{"path":"src/protocol.ts","kind":"import-statement","original":"./protocol"}],"format":"esm"},"src/edge-ws-muxer.ts":{"bytes":29236,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/protocols/buf","kind":"import-statement","external":true},{"path":"@dxos/protocols/buf/dxos/edge/messenger_pb","kind":"import-statement","external":true},{"path":"src/defs.ts","kind":"import-statement","original":"./defs"}],"format":"esm"},"src/auth.ts":{"bytes":12429,"imports":[{"path":"@dxos/credentials","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keyring","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true}],"format":"esm"},"src/edge-identity.ts":{"bytes":3969,"imports":[{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto","kind":"import-statement","external":true}],"format":"esm"},"src/edge-ws-connection.ts":{"bytes":36161,"imports":[{"path":"isomorphic-ws","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/protocols","kind":"import-statement","external":true},{"path":"@dxos/protocols/buf","kind":"import-statement","external":true},{"path":"@dxos/protocols/buf/dxos/edge/messenger_pb","kind":"import-statement","external":true},{"path":"src/defs.ts","kind":"import-statement","original":"./defs"},{"path":"src/edge-ws-muxer.ts","kind":"import-statement","original":"./edge-ws-muxer"},{"path":"src/protocol.ts","kind":"import-statement","original":"./protocol"}],"format":"esm"},"src/errors.ts":{"bytes":1106,"imports":[],"format":"esm"},"src/utils.ts":{"bytes":1317,"imports":[],"format":"esm"},"src/edge-client.ts":{"bytes":39965,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/client/services","kind":"import-statement","external":true},{"path":"src/defs.ts","kind":"import-statement","original":"./defs"},{"path":"src/edge-identity.ts","kind":"import-statement","original":"./edge-identity"},{"path":"src/edge-ws-connection.ts","kind":"import-statement","original":"./edge-ws-connection"},{"path":"src/errors.ts","kind":"import-statement","original":"./errors"},{"path":"src/utils.ts","kind":"import-statement","original":"./utils"}],"format":"esm"},"src/http-client.ts":{"bytes":7215,"imports":[{"path":"effect/Context","kind":"import-statement","external":true},{"path":"effect/Duration","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Layer","kind":"import-statement","external":true},{"path":"effect/Schedule","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"src/base-http-client.ts":{"bytes":27427,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/protocols","kind":"import-statement","external":true},{"path":"src/edge-identity.ts","kind":"import-statement","original":"./edge-identity"},{"path":"src/http-client.ts","kind":"import-statement","original":"./http-client"},{"path":"src/utils.ts","kind":"import-statement","original":"./utils"}],"format":"esm"},"src/edge-ai-http-client.ts":{"bytes":25932,"imports":[{"path":"@effect/platform/Headers","kind":"import-statement","external":true},{"path":"@effect/platform/HttpClient","kind":"import-statement","external":true},{"path":"@effect/platform/HttpClientError","kind":"import-statement","external":true},{"path":"@effect/platform/HttpClientResponse","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/FiberRef","kind":"import-statement","external":true},{"path":"effect/Layer","kind":"import-statement","external":true},{"path":"effect/Stream","kind":"import-statement","external":true},{"path":"@dxos/errors","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/protocols","kind":"import-statement","external":true}],"format":"esm"},"src/edge-http-client.ts":{"bytes":48938,"imports":[{"path":"@effect/platform/FetchHttpClient","kind":"import-statement","external":true},{"path":"@effect/platform/HttpClient","kind":"import-statement","external":true},{"path":"@effect/platform/HttpClientRequest","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Function","kind":"import-statement","external":true},{"path":"@dxos/effect","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/protocols","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"src/base-http-client.ts","kind":"import-statement","original":"./base-http-client"},{"path":"src/cors-proxy.ts","kind":"import-statement","original":"./cors-proxy"},{"path":"src/http-client.ts","kind":"import-statement","original":"./http-client"}],"format":"esm"},"src/hub-http-client.ts":{"bytes":13661,"imports":[{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"src/base-http-client.ts","kind":"import-statement","original":"./base-http-client"}],"format":"esm"},"src/index.ts":{"bytes":1718,"imports":[{"path":"@dxos/protocols/buf/dxos/edge/messenger_pb","kind":"import-statement","external":true},{"path":"src/auth.ts","kind":"import-statement","original":"./auth"},{"path":"src/cors-proxy.ts","kind":"import-statement","original":"./cors-proxy"},{"path":"src/defs.ts","kind":"import-statement","original":"./defs"},{"path":"src/edge-client.ts","kind":"import-statement","original":"./edge-client"},{"path":"src/errors.ts","kind":"import-statement","original":"./errors"},{"path":"src/protocol.ts","kind":"import-statement","original":"./protocol"},{"path":"src/base-http-client.ts","kind":"import-statement","original":"./base-http-client"},{"path":"src/edge-ai-http-client.ts","kind":"import-statement","original":"./edge-ai-http-client"},{"path":"src/edge-http-client.ts","kind":"import-statement","original":"./edge-http-client"},{"path":"src/hub-http-client.ts","kind":"import-statement","original":"./hub-http-client"},{"path":"src/edge-identity.ts","kind":"import-statement","original":"./edge-identity"},{"path":"src/edge-ws-muxer.ts","kind":"import-statement","original":"./edge-ws-muxer"},{"path":"src/http-client.ts","kind":"import-statement","original":"./http-client"}],"format":"esm"},"src/service/edge-service.ts":{"bytes":17547,"imports":[{"path":"effect/Data","kind":"import-statement","external":true},{"path":"effect/Duration","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Schema","kind":"import-statement","external":true}],"format":"esm"},"src/service/Image.ts":{"bytes":5369,"imports":[{"path":"effect/Schema","kind":"import-statement","external":true}],"format":"esm"},"src/service/index.ts":{"bytes":522,"imports":[{"path":"src/service/edge-service.ts","kind":"import-statement","original":"./edge-service"},{"path":"src/service/Image.ts","kind":"import-statement","original":"./Image"}],"format":"esm"},"src/testing/test-server.ts":{"bytes":4454,"imports":[{"path":"@dxos/node-std/http","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"src/testing/test-utils.ts":{"bytes":13633,"imports":[{"path":"isomorphic-ws","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/protocols","kind":"import-statement","external":true},{"path":"@dxos/protocols/buf","kind":"import-statement","external":true},{"path":"@dxos/protocols/buf/dxos/edge/messenger_pb","kind":"import-statement","external":true},{"path":"src/defs.ts","kind":"import-statement","original":"../defs"},{"path":"src/edge-ws-muxer.ts","kind":"import-statement","original":"../edge-ws-muxer"},{"path":"src/protocol.ts","kind":"import-statement","original":"../protocol"}],"format":"esm"},"src/testing/index.ts":{"bytes":477,"imports":[{"path":"src/testing/test-server.ts","kind":"import-statement","original":"./test-server"},{"path":"src/testing/test-utils.ts","kind":"import-statement","original":"./test-utils"}],"format":"esm"}},"outputs":{"dist/lib/neutral/cors-proxy.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/neutral/cors-proxy.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-WQKMEZJR.mjs","kind":"import-statement"},{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"}],"exports":["proxyFetchLegacy"],"entryPoint":"src/cors-proxy.ts","inputs":{},"bytes":161},"dist/lib/neutral/edge-ws-muxer.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/neutral/edge-ws-muxer.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-L5ZHLJ4B.mjs","kind":"import-statement"},{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"}],"exports":["CLOUDFLARE_MESSAGE_MAX_BYTES","CLOUDFLARE_RPC_MAX_BYTES","WebSocketMuxer"],"entryPoint":"src/edge-ws-muxer.ts","inputs":{},"bytes":280},"dist/lib/neutral/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":104152},"dist/lib/neutral/index.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-WQKMEZJR.mjs","kind":"import-statement"},{"path":"dist/lib/neutral/chunk-L5ZHLJ4B.mjs","kind":"import-statement"},{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"@dxos/protocols/buf/dxos/edge/messenger_pb","kind":"import-statement","external":true},{"path":"@dxos/credentials","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keyring","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/client/services","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto","kind":"import-statement","external":true},{"path":"isomorphic-ws","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/protocols","kind":"import-statement","external":true},{"path":"@dxos/protocols/buf","kind":"import-statement","external":true},{"path":"@dxos/protocols/buf/dxos/edge/messenger_pb","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/protocols","kind":"import-statement","external":true},{"path":"effect/Context","kind":"import-statement","external":true},{"path":"effect/Duration","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Layer","kind":"import-statement","external":true},{"path":"effect/Schedule","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@effect/platform/Headers","kind":"import-statement","external":true},{"path":"@effect/platform/HttpClient","kind":"import-statement","external":true},{"path":"@effect/platform/HttpClientError","kind":"import-statement","external":true},{"path":"@effect/platform/HttpClientResponse","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/FiberRef","kind":"import-statement","external":true},{"path":"effect/Layer","kind":"import-statement","external":true},{"path":"effect/Stream","kind":"import-statement","external":true},{"path":"@dxos/errors","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/protocols","kind":"import-statement","external":true},{"path":"@effect/platform/FetchHttpClient","kind":"import-statement","external":true},{"path":"@effect/platform/HttpClient","kind":"import-statement","external":true},{"path":"@effect/platform/HttpClientRequest","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Function","kind":"import-statement","external":true},{"path":"@dxos/effect","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/protocols","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"exports":["BaseHttpClient","ByokError","CLOUDFLARE_MESSAGE_MAX_BYTES","CLOUDFLARE_RPC_MAX_BYTES","EdgeAiHttpClient","EdgeClient","EdgeConnectionClosedError","EdgeHttpClient","EdgeIdentityChangedError","HttpConfig","HubHttpClient","Protocol","UsageQuotaExceededError","WebSocketMuxer","createChainEdgeIdentity","createDeviceEdgeIdentity","createEphemeralEdgeIdentity","createStubEdgeIdentity","createTestHaloEdgeIdentity","encodeAuthHeader","getTypename","handleAuthChallenge","patchAnthropicMessagesRequestBody","protocol","proxyFetchLegacy","requestInitTagKey","toUint8Array","withLogging","withRetry","withRetryConfig"],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":60},"src/auth.ts":{"bytesInOutput":3070},"src/edge-client.ts":{"bytesInOutput":10071},"src/edge-identity.ts":{"bytesInOutput":1120},"src/edge-ws-connection.ts":{"bytesInOutput":9708},"src/errors.ts":{"bytesInOutput":232},"src/utils.ts":{"bytesInOutput":244},"src/base-http-client.ts":{"bytesInOutput":6930},"src/http-client.ts":{"bytesInOutput":1536},"src/edge-ai-http-client.ts":{"bytesInOutput":5001},"src/edge-http-client.ts":{"bytesInOutput":10608},"src/hub-http-client.ts":{"bytesInOutput":2632}},"bytes":52495},"dist/lib/neutral/chunk-WQKMEZJR.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2574},"dist/lib/neutral/chunk-WQKMEZJR.mjs":{"imports":[],"exports":["proxyFetchLegacy"],"inputs":{"src/cors-proxy.ts":{"bytesInOutput":868}},"bytes":965},"dist/lib/neutral/service/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":11386},"dist/lib/neutral/service/index.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"effect/Data","kind":"import-statement","external":true},{"path":"effect/Duration","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"effect/Schema","kind":"import-statement","external":true}],"exports":["EdgeServiceClient","EdgeServiceError","Image"],"entryPoint":"src/service/index.ts","inputs":{"src/service/edge-service.ts":{"bytesInOutput":3307},"src/service/index.ts":{"bytesInOutput":0},"src/service/Image.ts":{"bytesInOutput":782}},"bytes":4311},"dist/lib/neutral/testing/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":8927},"dist/lib/neutral/testing/index.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-L5ZHLJ4B.mjs","kind":"import-statement"},{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"@dxos/node-std/http","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"isomorphic-ws","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/protocols","kind":"import-statement","external":true},{"path":"@dxos/protocols/buf","kind":"import-statement","external":true},{"path":"@dxos/protocols/buf/dxos/edge/messenger_pb","kind":"import-statement","external":true}],"exports":["DEFAULT_PORT","createTestEdgeWsServer","createTestServer","responseHandler"],"entryPoint":"src/testing/index.ts","inputs":{"src/testing/test-server.ts":{"bytesInOutput":1115},"src/testing/index.ts":{"bytesInOutput":0},"src/testing/test-utils.ts":{"bytesInOutput":3534}},"bytes":4955},"dist/lib/neutral/chunk-L5ZHLJ4B.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":18947},"dist/lib/neutral/chunk-L5ZHLJ4B.mjs":{"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/protocols/buf","kind":"import-statement","external":true},{"path":"@dxos/protocols/buf/dxos/edge/messenger_pb","kind":"import-statement","external":true},{"path":"@dxos/protocols/buf","kind":"import-statement","external":true},{"path":"@dxos/protocols/buf/dxos/edge/messenger_pb","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/protocols/buf","kind":"import-statement","external":true},{"path":"@dxos/protocols/buf/dxos/edge/messenger_pb","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"exports":["CLOUDFLARE_MESSAGE_MAX_BYTES","CLOUDFLARE_RPC_MAX_BYTES","Protocol","WebSocketMuxer","getTypename","protocol","toUint8Array"],"inputs":{"src/edge-ws-muxer.ts":{"bytesInOutput":7443},"src/defs.ts":{"bytesInOutput":298},"src/protocol.ts":{"bytesInOutput":2520}},"bytes":10551},"dist/lib/neutral/chunk-J5LGTIGS.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/neutral/chunk-J5LGTIGS.mjs":{"imports":[],"exports":["__export"],"inputs":{},"bytes":235}}}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__export
|
|
3
|
+
} from "../chunk-J5LGTIGS.mjs";
|
|
4
|
+
|
|
5
|
+
// src/service/edge-service.ts
|
|
6
|
+
import * as Data from "effect/Data";
|
|
7
|
+
import * as Duration from "effect/Duration";
|
|
8
|
+
import * as Effect from "effect/Effect";
|
|
9
|
+
import * as Schema from "effect/Schema";
|
|
10
|
+
var EDGE_CLIENT_TAG_HEADER = "X-DXOS-Client-Tag";
|
|
11
|
+
var DEFAULT_TIMEOUT = Duration.seconds(15);
|
|
12
|
+
var ERROR_BODY_LIMIT = 512;
|
|
13
|
+
var EdgeServiceError = class extends Data.TaggedError("EdgeServiceError") {
|
|
14
|
+
};
|
|
15
|
+
var EdgeServiceClient = class {
|
|
16
|
+
#baseUrl;
|
|
17
|
+
#clientTag;
|
|
18
|
+
#timeout;
|
|
19
|
+
#fetch;
|
|
20
|
+
#authHeaders;
|
|
21
|
+
constructor(options) {
|
|
22
|
+
this.#baseUrl = options.baseUrl;
|
|
23
|
+
this.#clientTag = options.clientTag;
|
|
24
|
+
this.#timeout = Duration.decode(options.timeout ?? DEFAULT_TIMEOUT);
|
|
25
|
+
const fetchImpl = options.fetch ?? globalThis.fetch;
|
|
26
|
+
this.#fetch = fetchImpl.bind(globalThis);
|
|
27
|
+
this.#authHeaders = options.authHeaders;
|
|
28
|
+
}
|
|
29
|
+
get baseUrl() {
|
|
30
|
+
return this.#baseUrl;
|
|
31
|
+
}
|
|
32
|
+
/** POST a `FormData` (multipart) body and decode the JSON response. */
|
|
33
|
+
postForm(path, form, schema) {
|
|
34
|
+
return this.#request(path, schema, {
|
|
35
|
+
method: "POST",
|
|
36
|
+
body: form
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
/** POST a JSON body and decode the JSON response. */
|
|
40
|
+
postJson(path, body, schema) {
|
|
41
|
+
return Effect.try({
|
|
42
|
+
try: () => JSON.stringify(body),
|
|
43
|
+
catch: (cause) => new EdgeServiceError({
|
|
44
|
+
message: "Failed to serialize JSON request body",
|
|
45
|
+
cause
|
|
46
|
+
})
|
|
47
|
+
}).pipe(Effect.flatMap((json) => this.#request(path, schema, {
|
|
48
|
+
method: "POST",
|
|
49
|
+
body: json,
|
|
50
|
+
headers: {
|
|
51
|
+
"Content-Type": "application/json"
|
|
52
|
+
}
|
|
53
|
+
})));
|
|
54
|
+
}
|
|
55
|
+
#request(path, schema, init) {
|
|
56
|
+
return Effect.gen(this, function* () {
|
|
57
|
+
const url = new URL(path, this.#baseUrl);
|
|
58
|
+
const headers = new Headers(init.headers ?? void 0);
|
|
59
|
+
if (this.#clientTag) {
|
|
60
|
+
headers.set(EDGE_CLIENT_TAG_HEADER, this.#clientTag);
|
|
61
|
+
}
|
|
62
|
+
if (this.#authHeaders) {
|
|
63
|
+
const auth = yield* this.#authHeaders();
|
|
64
|
+
for (const [key, value] of Object.entries(auth)) {
|
|
65
|
+
headers.set(key, value);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
const response = yield* Effect.tryPromise({
|
|
69
|
+
try: (signal) => this.#fetch(url, {
|
|
70
|
+
...init,
|
|
71
|
+
headers,
|
|
72
|
+
signal
|
|
73
|
+
}),
|
|
74
|
+
catch: (cause) => new EdgeServiceError({
|
|
75
|
+
message: `Request to ${url.pathname} failed`,
|
|
76
|
+
cause
|
|
77
|
+
})
|
|
78
|
+
});
|
|
79
|
+
if (!response.ok) {
|
|
80
|
+
const detail = yield* Effect.promise(() => response.text().catch(() => "")).pipe(Effect.map((text) => text.slice(0, ERROR_BODY_LIMIT)));
|
|
81
|
+
return yield* new EdgeServiceError({
|
|
82
|
+
message: `Service responded ${response.status}${detail ? `: ${detail}` : ""}`,
|
|
83
|
+
status: response.status
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
const json = yield* Effect.tryPromise({
|
|
87
|
+
try: () => response.json(),
|
|
88
|
+
catch: (cause) => new EdgeServiceError({
|
|
89
|
+
message: "Failed to parse JSON response",
|
|
90
|
+
status: response.status,
|
|
91
|
+
cause
|
|
92
|
+
})
|
|
93
|
+
});
|
|
94
|
+
return yield* Schema.decodeUnknown(schema)(json).pipe(Effect.mapError((cause) => new EdgeServiceError({
|
|
95
|
+
message: "Response did not match expected schema",
|
|
96
|
+
status: response.status,
|
|
97
|
+
cause
|
|
98
|
+
})));
|
|
99
|
+
}).pipe(Effect.timeoutFail({
|
|
100
|
+
duration: this.#timeout,
|
|
101
|
+
onTimeout: () => new EdgeServiceError({
|
|
102
|
+
message: `Request to ${path} timed out`
|
|
103
|
+
})
|
|
104
|
+
}));
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
// src/service/Image.ts
|
|
109
|
+
var Image_exports = {};
|
|
110
|
+
__export(Image_exports, {
|
|
111
|
+
DEFAULT_IMAGE_SERVICE_URL: () => DEFAULT_IMAGE_SERVICE_URL,
|
|
112
|
+
Result: () => Result,
|
|
113
|
+
thumbnail: () => thumbnail,
|
|
114
|
+
upload: () => upload
|
|
115
|
+
});
|
|
116
|
+
import * as Schema2 from "effect/Schema";
|
|
117
|
+
var DEFAULT_IMAGE_SERVICE_URL = "https://image-service-main.dxos.workers.dev";
|
|
118
|
+
var Result = Schema2.Struct({
|
|
119
|
+
id: Schema2.optional(Schema2.String),
|
|
120
|
+
url: Schema2.String
|
|
121
|
+
});
|
|
122
|
+
var upload = (client, blob, opts) => uploadToPath(client, blob, "/upload", opts);
|
|
123
|
+
var thumbnail = (client, blob, opts) => uploadToPath(client, blob, "/thumbnail", opts);
|
|
124
|
+
var uploadToPath = (client, blob, path, opts) => {
|
|
125
|
+
const form = new FormData();
|
|
126
|
+
form.append(opts?.field ?? "file", blob, opts?.filename ?? "image");
|
|
127
|
+
return client.postForm(path, form, Result);
|
|
128
|
+
};
|
|
129
|
+
export {
|
|
130
|
+
EdgeServiceClient,
|
|
131
|
+
EdgeServiceError,
|
|
132
|
+
Image_exports as Image
|
|
133
|
+
};
|
|
134
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/service/edge-service.ts", "../../../../src/service/Image.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2026 DXOS.org\n//\n\n// Lightweight client for EDGE-hosted HTTP services — intentionally free of the\n// heavy transitive dependencies (`@dxos/context`, `@dxos/protocols`) that\n// `BaseHttpClient` pulls in, so it bundles cleanly into browser / workerd. The\n// only runtime dependencies are `effect` and `@dxos/log`.\n\nimport * as Data from 'effect/Data';\nimport * as Duration from 'effect/Duration';\nimport * as Effect from 'effect/Effect';\nimport * as Schema from 'effect/Schema';\n\n// Matches EDGE_CLIENT_TAG_HEADER from @dxos/protocols. Duplicated here (as in\n// `cors-proxy`) to avoid importing the heavy protocols bundle.\nconst EDGE_CLIENT_TAG_HEADER = 'X-DXOS-Client-Tag';\n\nconst DEFAULT_TIMEOUT = Duration.seconds(15);\n\n/** Number of body characters retained for the error message on a non-2xx response. */\nconst ERROR_BODY_LIMIT = 512;\n\nexport type EdgeServiceClientOptions = {\n /** Base URL the service is hosted at; request paths resolve against it. */\n baseUrl: string;\n /** Tag included in the {@link EDGE_CLIENT_TAG_HEADER} header for metering. */\n clientTag?: string;\n /** Per-request timeout. */\n timeout?: Duration.DurationInput;\n /** Injectable for deterministic tests; defaults to `globalThis.fetch`. */\n fetch?: typeof globalThis.fetch;\n /** Auth seam invoked per request; unused by the image service today. */\n authHeaders?: () => Effect.Effect<Record<string, string>>;\n};\n\n/** Single failure type for every transport, status, and decode error. */\nexport class EdgeServiceError extends Data.TaggedError('EdgeServiceError')<{\n message: string;\n status?: number;\n cause?: unknown;\n}> {}\n\nexport class EdgeServiceClient {\n readonly #baseUrl: string;\n readonly #clientTag: string | undefined;\n readonly #timeout: Duration.Duration;\n readonly #fetch: typeof globalThis.fetch;\n readonly #authHeaders: (() => Effect.Effect<Record<string, string>>) | undefined;\n\n constructor(options: EdgeServiceClientOptions) {\n this.#baseUrl = options.baseUrl;\n this.#clientTag = options.clientTag;\n this.#timeout = Duration.decode(options.timeout ?? DEFAULT_TIMEOUT);\n // Bind so `fetch` keeps its expected `this` when injected as a method reference.\n const fetchImpl = options.fetch ?? globalThis.fetch;\n this.#fetch = fetchImpl.bind(globalThis);\n this.#authHeaders = options.authHeaders;\n }\n\n get baseUrl(): string {\n return this.#baseUrl;\n }\n\n /** POST a `FormData` (multipart) body and decode the JSON response. */\n postForm<A>(path: string, form: FormData, schema: Schema.Schema<A>): Effect.Effect<A, EdgeServiceError> {\n // The runtime sets `Content-Type: multipart/form-data` with the boundary;\n // setting it manually here would omit the boundary and break parsing.\n return this.#request(path, schema, { method: 'POST', body: form });\n }\n\n /** POST a JSON body and decode the JSON response. */\n postJson<A>(path: string, body: unknown, schema: Schema.Schema<A>): Effect.Effect<A, EdgeServiceError> {\n // Serialize inside the Effect so a circular/non-serializable body surfaces as\n // EdgeServiceError rather than throwing synchronously from the call site.\n return Effect.try({\n try: () => JSON.stringify(body),\n catch: (cause) => new EdgeServiceError({ message: 'Failed to serialize JSON request body', cause }),\n }).pipe(\n Effect.flatMap((json) =>\n this.#request(path, schema, {\n method: 'POST',\n body: json,\n headers: { 'Content-Type': 'application/json' },\n }),\n ),\n );\n }\n\n #request<A>(path: string, schema: Schema.Schema<A>, init: RequestInit): Effect.Effect<A, EdgeServiceError> {\n return Effect.gen(this, function* () {\n const url = new URL(path, this.#baseUrl);\n const headers = new Headers(init.headers ?? undefined);\n if (this.#clientTag) {\n headers.set(EDGE_CLIENT_TAG_HEADER, this.#clientTag);\n }\n if (this.#authHeaders) {\n const auth = yield* this.#authHeaders();\n for (const [key, value] of Object.entries(auth)) {\n headers.set(key, value);\n }\n }\n\n const response = yield* Effect.tryPromise({\n try: (signal) => this.#fetch(url, { ...init, headers, signal }),\n catch: (cause) => new EdgeServiceError({ message: `Request to ${url.pathname} failed`, cause }),\n });\n\n if (!response.ok) {\n // Body text aids debugging but may be large; truncate and never throw on read.\n const detail = yield* Effect.promise(() => response.text().catch(() => '')).pipe(\n Effect.map((text) => text.slice(0, ERROR_BODY_LIMIT)),\n );\n return yield* new EdgeServiceError({\n message: `Service responded ${response.status}${detail ? `: ${detail}` : ''}`,\n status: response.status,\n });\n }\n\n const json = yield* Effect.tryPromise({\n try: () => response.json(),\n catch: (cause) =>\n new EdgeServiceError({ message: 'Failed to parse JSON response', status: response.status, cause }),\n });\n\n return yield* Schema.decodeUnknown(schema)(json).pipe(\n Effect.mapError(\n (cause) =>\n new EdgeServiceError({ message: 'Response did not match expected schema', status: response.status, cause }),\n ),\n );\n }).pipe(\n Effect.timeoutFail({\n duration: this.#timeout,\n onTimeout: () => new EdgeServiceError({ message: `Request to ${path} timed out` }),\n }),\n );\n }\n}\n", "//\n// Copyright 2026 DXOS.org\n//\n\n// @import-as-namespace\n\n// Image service helpers built on the generic {@link EdgeServiceClient}. The\n// worker exposes two contract-identical routes (`/upload` and `/thumbnail`,\n// both returning `{ id, url }`); we mirror them so callers stay on whichever\n// route they already use.\n\nimport * as Effect from 'effect/Effect';\nimport * as Schema from 'effect/Schema';\n\nimport { type EdgeServiceClient, type EdgeServiceError } from './edge-service';\n\n/**\n * Default Composer image-service base URL — the Cloudflare Worker used in\n * production. Override per-environment via the client's `baseUrl`.\n */\n// TODO(burdon): Get from config.\nexport const DEFAULT_IMAGE_SERVICE_URL = 'https://image-service-main.dxos.workers.dev';\n\n/** Hosted image returned by the service: a CDN `url` and its storage `id`. */\nexport const Result = Schema.Struct({\n id: Schema.optional(Schema.String),\n url: Schema.String,\n});\nexport type Result = typeof Result.Type;\n\nexport type UploadOptions = {\n /** Multipart field name. */\n field?: string;\n /** Upload filename. */\n filename?: string;\n};\n\n/** Store an image and return its hosted CDN URL (POST `/upload`). */\nexport const upload = (\n client: EdgeServiceClient,\n blob: Blob,\n opts?: UploadOptions,\n): Effect.Effect<Result, EdgeServiceError> => uploadToPath(client, blob, '/upload', opts);\n\n/** Store an image and create a thumbnail, returning its hosted CDN URL (POST `/thumbnail`). */\nexport const thumbnail = (\n client: EdgeServiceClient,\n blob: Blob,\n opts?: UploadOptions,\n): Effect.Effect<Result, EdgeServiceError> => uploadToPath(client, blob, '/thumbnail', opts);\n\nconst uploadToPath = (\n client: EdgeServiceClient,\n blob: Blob,\n path: string,\n opts?: UploadOptions,\n): Effect.Effect<Result, EdgeServiceError> => {\n const form = new FormData();\n form.append(opts?.field ?? 'file', blob, opts?.filename ?? 'image');\n return client.postForm(path, form, Result);\n};\n"],
|
|
5
|
+
"mappings": ";;;;;AASA,YAAYA,UAAU;AACtB,YAAYC,cAAc;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AAAA;MAAiB,CAAA;IAClF,CAAA,CAAA;EAEJ;AACF;;;AC1IA;;;;;;;AAYA,YAAY4C,aAAY;AASjB,IAAMC,4BAA4B;AAGlC,IAAMC,SAAgBC,eAAO;EAClCC,IAAWC,iBAAgBC,cAAM;EACjCC,KAAYD;AACd,CAAA;AAWO,IAAME,SAAS,CACpBC,QACAC,MACAC,SAC4CC,aAAaH,QAAQC,MAAM,WAAWC,IAAAA;AAG7E,IAAME,YAAY,CACvBJ,QACAC,MACAC,SAC4CC,aAAaH,QAAQC,MAAM,cAAcC,IAAAA;AAEvF,IAAMC,eAAe,CACnBH,QACAC,MACAI,MACAH,SAAAA;AAEA,QAAMI,OAAO,IAAIC,SAAAA;AACjBD,OAAKE,OAAON,MAAMO,SAAS,QAAQR,MAAMC,MAAMQ,YAAY,OAAA;AAC3D,SAAOV,OAAOW,SAASN,MAAMC,MAAMb,MAAAA;AACrC;",
|
|
6
|
+
"names": ["Data", "Duration", "Effect", "Schema", "EDGE_CLIENT_TAG_HEADER", "DEFAULT_TIMEOUT", "seconds", "ERROR_BODY_LIMIT", "EdgeServiceError", "TaggedError", "EdgeServiceClient", "options", "baseUrl", "clientTag", "decode", "timeout", "fetchImpl", "fetch", "globalThis", "bind", "authHeaders", "postForm", "path", "form", "schema", "method", "body", "postJson", "try", "JSON", "stringify", "catch", "cause", "message", "pipe", "flatMap", "json", "headers", "init", "gen", "url", "URL", "Headers", "undefined", "set", "auth", "key", "value", "Object", "entries", "response", "tryPromise", "signal", "pathname", "ok", "detail", "promise", "text", "map", "slice", "status", "decodeUnknown", "mapError", "timeoutFail", "duration", "onTimeout", "Schema", "DEFAULT_IMAGE_SERVICE_URL", "Result", "Struct", "id", "optional", "String", "url", "upload", "client", "blob", "opts", "uploadToPath", "thumbnail", "path", "form", "FormData", "append", "field", "filename", "postForm"]
|
|
7
|
+
}
|
|
@@ -3,6 +3,7 @@ import {
|
|
|
3
3
|
protocol,
|
|
4
4
|
toUint8Array
|
|
5
5
|
} from "../chunk-L5ZHLJ4B.mjs";
|
|
6
|
+
import "../chunk-J5LGTIGS.mjs";
|
|
6
7
|
|
|
7
8
|
// src/testing/test-server.ts
|
|
8
9
|
import http from "@dxos/node-std/http";
|
|
@@ -134,7 +135,7 @@ var createResponseSender = (connection) => {
|
|
|
134
135
|
const recipient = request.source;
|
|
135
136
|
void connection().send(buf.create(MessageSchema, {
|
|
136
137
|
source: {
|
|
137
|
-
|
|
138
|
+
identityDid: recipient.identityDid,
|
|
138
139
|
peerKey: recipient.peerKey
|
|
139
140
|
},
|
|
140
141
|
serviceId: request.serviceId,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/testing/test-server.ts", "../../../../src/testing/test-utils.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport http from 'node:http';\n\nimport { log } from '@dxos/log';\n\nexport type TestServer = {\n url: string;\n close: () => void;\n};\n\nexport type ResponseHandler = (req: http.IncomingMessage, res: http.ServerResponse) => void;\n\nexport const createTestServer = (responseHandler: ResponseHandler) => {\n const server = http.createServer(responseHandler);\n\n return new Promise<TestServer>((resolve) => {\n server.listen(0, () => {\n const address = server.address();\n const port = typeof address === 'object' && address ? address.port : 0;\n resolve({\n url: `http://localhost:${port}`,\n close: () => server.close(),\n });\n });\n });\n};\n\nexport const responseHandler = (cb: (attempt: number) => false | object): ResponseHandler => {\n let attempt = 0;\n return (req, res) => {\n const data = cb(++attempt) ?? {};\n if (data === false) {\n log('simulating failure', { attempt });\n res.statusCode = 500;\n res.statusMessage = 'Simulating failure';\n res.end('');\n } else {\n res.writeHead(200, { 'Content-Type': 'application/json' });\n res.end(JSON.stringify({ success: true, data }));\n }\n };\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport WebSocket from 'isomorphic-ws';\n\nimport { Trigger } from '@dxos/async';\nimport { log } from '@dxos/log';\nimport { EdgeWebsocketProtocol } from '@dxos/protocols';\nimport { buf } from '@dxos/protocols/buf';\nimport { type Message, MessageSchema, TextMessageSchema } from '@dxos/protocols/buf/dxos/edge/messenger_pb';\n\nimport { protocol } from '../defs';\nimport { WebSocketMuxer } from '../edge-ws-muxer';\nimport { toUint8Array } from '../protocol';\n\nexport const DEFAULT_PORT = 8080;\n\ntype TestEdgeWsServerProps = {\n admitConnection?: Trigger;\n payloadDecoder?: (payload: Uint8Array) => any;\n messageHandler?: (payload: any) => Promise<Uint8Array | undefined>;\n};\n\nexport const createTestEdgeWsServer = async (port = DEFAULT_PORT, params?: TestEdgeWsServerProps) => {\n const wsServer = new WebSocket.Server({\n port,\n verifyClient: createConnectionDelayHandler(params),\n handleProtocols: () => EdgeWebsocketProtocol.V1,\n });\n\n let connection: { ws: WebSocket; muxer: WebSocketMuxer } | undefined;\n\n const messageSink: any[] = [];\n const messageSourceLog: any[] = [];\n const closeTrigger = new Trigger();\n const sendResponseMessage = createResponseSender(() => connection!.muxer);\n\n wsServer.on('connection', (ws: WebSocket) => {\n const muxer = new WebSocketMuxer(ws);\n connection = { ws, muxer };\n ws.on('error', (err: Error) => log.catch(err));\n ws.on('message', async (data: any) => {\n if (String(data) === '__ping__') {\n ws.send('__pong__');\n return;\n }\n const message = muxer.receiveData(await toUint8Array(data));\n if (!message) {\n return;\n }\n const { request, requestPayload } = await decodePayload(message, params);\n messageSourceLog.push(request.source);\n if (params?.messageHandler) {\n const responsePayload = await params.messageHandler(requestPayload);\n if (responsePayload && connection) {\n sendResponseMessage(request, responsePayload);\n }\n }\n log('message', { payload: requestPayload });\n messageSink.push(requestPayload);\n });\n\n ws.on('close', () => {\n connection = undefined;\n closeTrigger.wake();\n });\n });\n\n return {\n server: wsServer,\n messageSink,\n messageSourceLog,\n endpoint: `ws://127.0.0.1:${port}`,\n cleanup: () => wsServer.close(),\n currentConnection: () => connection,\n sendResponseMessage,\n sendMessage: (msg: Message) => {\n return connection!.muxer.send(msg);\n },\n closeConnection: () => {\n closeTrigger.reset();\n connection!.ws.close(1011);\n return closeTrigger.wait();\n },\n };\n};\n\nconst createConnectionDelayHandler = (params: TestEdgeWsServerProps | undefined) => {\n return (_: any, callback: (admit: boolean) => void) => {\n if (params?.admitConnection) {\n log('delaying edge connection admission');\n void params.admitConnection.wait().then(() => {\n callback(true);\n log('edge connection admitted');\n });\n } else {\n callback(true);\n }\n };\n};\n\nconst createResponseSender = (connection: () => WebSocketMuxer) => {\n return (request: Message, responsePayload: Uint8Array) => {\n const recipient = request.source!;\n void connection().send(\n buf.create(MessageSchema, {\n source: {\n
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": ["http", "log", "createTestServer", "resolve", "server", "listen", "responseHandler", "address", "port", "url", "close", "req", "res", "data", "attempt", "statusCode", "statusMessage", "end", "writeHead", "stringify", "WebSocket", "Trigger", "log", "EdgeWebsocketProtocol", "buf", "MessageSchema", "TextMessageSchema", "__dxlog_file", "DEFAULT_PORT", "wsServer", "WebSocket", "port", "verifyClient", "createConnectionDelayHandler", "handleProtocols", "connection", "closeTrigger", "sendResponseMessage", "ws", "WebSocketMuxer", "muxer", "on", "data", "messageSourceLog", "params", "messageHandler", "responsePayload", "request", "log", "messageSink", "push", "wake", "endpoint", "cleanup", "currentConnection", "sendMessage", "msg", "closeConnection", "close", "admitConnection", "callback", "create", "source", "
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport http from 'node:http';\n\nimport { log } from '@dxos/log';\n\nexport type TestServer = {\n url: string;\n close: () => void;\n};\n\nexport type ResponseHandler = (req: http.IncomingMessage, res: http.ServerResponse) => void;\n\nexport const createTestServer = (responseHandler: ResponseHandler) => {\n const server = http.createServer(responseHandler);\n\n return new Promise<TestServer>((resolve) => {\n server.listen(0, () => {\n const address = server.address();\n const port = typeof address === 'object' && address ? address.port : 0;\n resolve({\n url: `http://localhost:${port}`,\n close: () => server.close(),\n });\n });\n });\n};\n\nexport const responseHandler = (cb: (attempt: number) => false | object): ResponseHandler => {\n let attempt = 0;\n return (req, res) => {\n const data = cb(++attempt) ?? {};\n if (data === false) {\n log('simulating failure', { attempt });\n res.statusCode = 500;\n res.statusMessage = 'Simulating failure';\n res.end('');\n } else {\n res.writeHead(200, { 'Content-Type': 'application/json' });\n res.end(JSON.stringify({ success: true, data }));\n }\n };\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport WebSocket from 'isomorphic-ws';\n\nimport { Trigger } from '@dxos/async';\nimport { log } from '@dxos/log';\nimport { EdgeWebsocketProtocol } from '@dxos/protocols';\nimport { buf } from '@dxos/protocols/buf';\nimport { type Message, MessageSchema, TextMessageSchema } from '@dxos/protocols/buf/dxos/edge/messenger_pb';\n\nimport { protocol } from '../defs';\nimport { WebSocketMuxer } from '../edge-ws-muxer';\nimport { toUint8Array } from '../protocol';\n\nexport const DEFAULT_PORT = 8080;\n\ntype TestEdgeWsServerProps = {\n admitConnection?: Trigger;\n payloadDecoder?: (payload: Uint8Array) => any;\n messageHandler?: (payload: any) => Promise<Uint8Array | undefined>;\n};\n\nexport const createTestEdgeWsServer = async (port = DEFAULT_PORT, params?: TestEdgeWsServerProps) => {\n const wsServer = new WebSocket.Server({\n port,\n verifyClient: createConnectionDelayHandler(params),\n handleProtocols: () => EdgeWebsocketProtocol.V1,\n });\n\n let connection: { ws: WebSocket; muxer: WebSocketMuxer } | undefined;\n\n const messageSink: any[] = [];\n const messageSourceLog: any[] = [];\n const closeTrigger = new Trigger();\n const sendResponseMessage = createResponseSender(() => connection!.muxer);\n\n wsServer.on('connection', (ws: WebSocket) => {\n const muxer = new WebSocketMuxer(ws);\n connection = { ws, muxer };\n ws.on('error', (err: Error) => log.catch(err));\n ws.on('message', async (data: any) => {\n if (String(data) === '__ping__') {\n ws.send('__pong__');\n return;\n }\n const message = muxer.receiveData(await toUint8Array(data));\n if (!message) {\n return;\n }\n const { request, requestPayload } = await decodePayload(message, params);\n messageSourceLog.push(request.source);\n if (params?.messageHandler) {\n const responsePayload = await params.messageHandler(requestPayload);\n if (responsePayload && connection) {\n sendResponseMessage(request, responsePayload);\n }\n }\n log('message', { payload: requestPayload });\n messageSink.push(requestPayload);\n });\n\n ws.on('close', () => {\n connection = undefined;\n closeTrigger.wake();\n });\n });\n\n return {\n server: wsServer,\n messageSink,\n messageSourceLog,\n endpoint: `ws://127.0.0.1:${port}`,\n cleanup: () => wsServer.close(),\n currentConnection: () => connection,\n sendResponseMessage,\n sendMessage: (msg: Message) => {\n return connection!.muxer.send(msg);\n },\n closeConnection: () => {\n closeTrigger.reset();\n connection!.ws.close(1011);\n return closeTrigger.wait();\n },\n };\n};\n\nconst createConnectionDelayHandler = (params: TestEdgeWsServerProps | undefined) => {\n return (_: any, callback: (admit: boolean) => void) => {\n if (params?.admitConnection) {\n log('delaying edge connection admission');\n void params.admitConnection.wait().then(() => {\n callback(true);\n log('edge connection admitted');\n });\n } else {\n callback(true);\n }\n };\n};\n\nconst createResponseSender = (connection: () => WebSocketMuxer) => {\n return (request: Message, responsePayload: Uint8Array) => {\n const recipient = request.source!;\n void connection().send(\n buf.create(MessageSchema, {\n source: {\n identityDid: recipient.identityDid,\n peerKey: recipient.peerKey,\n },\n serviceId: request.serviceId!,\n payload: { value: responsePayload },\n }),\n );\n };\n};\n\nconst decodePayload = async (request: Message, params: TestEdgeWsServerProps | undefined) => {\n const requestPayload = params?.payloadDecoder\n ? params.payloadDecoder(request.payload!.value!)\n : protocol.getPayload(request, TextMessageSchema);\n return { request, requestPayload };\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;AAIA,OAAOA,UAAU;AAEjB,SAASC,WAAW;AASpB,IAAA,eAAaC;AAGX,IAAO,mBAAyBC,CAAAA,qBAAAA;QAC9BC,SAAOC,KAAO,aAAGC,gBAAA;aACf,QAAMC,CAAAA,YAAUH;WAChB,OAAMI,GAAO,MAAA;AACbL,YAAAA,UAAQ,OAAA,QAAA;YACNM,OAAM,OAAA,YAAmBD,YAAM,UAAA,QAAA,OAAA;cAC/BE;QACF,KAAA,oBAAA,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C,YAAQ,QAAA;oBACNC,EAAAA,KAAaC,IAAAA,OAAUD,eAAW;cAClCE;QACF,aAAA,UAAA;QACAC,SAAWnB,UAAQmB;MACnBC;iBAAkBrB,QAAAA;MAAgB,SAAA;QACpC,OAAA;MAEJ;IACF,CAAA,CAAA;EAEA;;IAIE,gBAAO,OAAA,SAAA,WAAA;QAAEC,iBAAAA,QAAAA,iBAAAA,OAAAA,eAAAA,QAAAA,QAAAA,KAAAA,IAAAA,SAAAA,WAAAA,SAAAA,iBAAAA;SAASqB;IAAe;IACnC;;;",
|
|
6
|
+
"names": ["http", "log", "createTestServer", "resolve", "server", "listen", "responseHandler", "address", "port", "url", "close", "req", "res", "data", "attempt", "statusCode", "statusMessage", "end", "writeHead", "stringify", "WebSocket", "Trigger", "log", "EdgeWebsocketProtocol", "buf", "MessageSchema", "TextMessageSchema", "__dxlog_file", "DEFAULT_PORT", "wsServer", "WebSocket", "port", "verifyClient", "createConnectionDelayHandler", "handleProtocols", "connection", "closeTrigger", "sendResponseMessage", "ws", "WebSocketMuxer", "muxer", "on", "data", "messageSourceLog", "params", "messageHandler", "responsePayload", "request", "log", "messageSink", "push", "wake", "endpoint", "cleanup", "currentConnection", "sendMessage", "msg", "closeConnection", "close", "admitConnection", "callback", "create", "source", "identityDid", "recipient", "peerKey", "serviceId", "payload", "requestPayload"]
|
|
7
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../src/auth.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,cAAc,CAAC;AAG3C,OAAO,
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../src/auth.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,cAAc,CAAC;AAG3C,OAAO,EAAe,SAAS,EAAE,MAAM,YAAY,CAAC;AACpD,OAAO,EAAE,KAAK,KAAK,EAAE,KAAK,UAAU,EAAE,MAAM,6CAA6C,CAAC;AAE1F,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEpD;;GAEG;AACH,eAAO,MAAM,wBAAwB,WAAkB,MAAM,OAAO,SAAS,KAAG,OAAO,CAAC,YAAY,CAyBnG,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,uBAAuB,WAC1B,MAAM,eACD,SAAS,WACb,SAAS,SACX,KAAK,GAAG,SAAS,eACX,UAAU,EAAE,KACxB,OAAO,CAAC,YAAY,CAkCtB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,2BAA2B,QAAa,OAAO,CAAC,YAAY,CAIxE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,0BAA0B,WAC7B,MAAM,eACD,SAAS,aACX,SAAS,KACnB,OAAO,CAAC,YAAY,CAqBtB,CAAC;AAEF,eAAO,MAAM,sBAAsB,QAAO,YAUzC,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as Context from 'effect/Context';
|
|
2
|
+
import * as Schema from 'effect/Schema';
|
|
3
|
+
import { type EdgeHttpClient } from './edge-http-client';
|
|
4
|
+
/** Request body for EDGE `/ai/browser-rendering/markdown` (ai-service Browser Run markdown quick action). */
|
|
5
|
+
export declare const MarkdownRequest: Schema.Struct<{
|
|
6
|
+
url: Schema.optional<typeof Schema.String>;
|
|
7
|
+
html: Schema.optional<typeof Schema.String>;
|
|
8
|
+
gotoOptions: Schema.optional<Schema.Struct<{
|
|
9
|
+
waitUntil: Schema.optional<Schema.Literal<["load", "domcontentloaded", "networkidle0", "networkidle2"]>>;
|
|
10
|
+
timeout: Schema.optional<typeof Schema.Number>;
|
|
11
|
+
}>>;
|
|
12
|
+
rejectRequestPattern: Schema.optional<Schema.Array$<typeof Schema.String>>;
|
|
13
|
+
userAgent: Schema.optional<typeof Schema.String>;
|
|
14
|
+
waitForSelector: Schema.optional<typeof Schema.String>;
|
|
15
|
+
}>;
|
|
16
|
+
export type MarkdownRequest = Schema.Schema.Type<typeof MarkdownRequest>;
|
|
17
|
+
/** JSON body returned by Cloudflare Browser Run markdown quick action. */
|
|
18
|
+
export declare const MarkdownResponse: Schema.Struct<{
|
|
19
|
+
success: typeof Schema.Boolean;
|
|
20
|
+
result: typeof Schema.String;
|
|
21
|
+
}>;
|
|
22
|
+
export type MarkdownResponse = Schema.Schema.Type<typeof MarkdownResponse>;
|
|
23
|
+
declare const EdgeHttpClientService_base: Context.TagClass<EdgeHttpClientService, "@dxos/edge-client/EdgeHttpClientService", EdgeHttpClient>;
|
|
24
|
+
/** Authenticated EDGE HTTP client for operation handlers (e.g. browser markdown fetch). */
|
|
25
|
+
export declare class EdgeHttpClientService extends EdgeHttpClientService_base {
|
|
26
|
+
}
|
|
27
|
+
export {};
|
|
28
|
+
//# sourceMappingURL=browser-rendering.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser-rendering.d.ts","sourceRoot":"","sources":["../../../src/browser-rendering.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEzD,6GAA6G;AAC7G,eAAO,MAAM,eAAe;;;;;;;;;;EAY1B,CAAC;AAEH,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,eAAe,CAAC,CAAC;AAEzE,0EAA0E;AAC1E,eAAO,MAAM,gBAAgB;;;EAG3B,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,gBAAgB,CAAC,CAAC;;AAE3E,2FAA2F;AAC3F,qBAAa,qBAAsB,SAAQ,0BAGxC;CAAG"}
|
|
@@ -42,10 +42,49 @@ export declare class ByokError extends ByokError_base {
|
|
|
42
42
|
provider: string;
|
|
43
43
|
} & BaseErrorOptions);
|
|
44
44
|
}
|
|
45
|
+
declare const UsageQuotaExceededError_base: {
|
|
46
|
+
new (options?: BaseErrorOptions): {
|
|
47
|
+
cause?: unknown;
|
|
48
|
+
stack?: string;
|
|
49
|
+
name: "UsageQuotaExceededError";
|
|
50
|
+
context: Record<string, unknown>;
|
|
51
|
+
readonly message: string;
|
|
52
|
+
readonly _tag: "UsageQuotaExceededError";
|
|
53
|
+
};
|
|
54
|
+
isError(error: unknown): error is Error;
|
|
55
|
+
name: "UsageQuotaExceededError";
|
|
56
|
+
is(error: unknown): error is BaseError;
|
|
57
|
+
wrap(options?: Omit<BaseErrorOptions, 'cause'> & {
|
|
58
|
+
ifTypeDiffers?: boolean;
|
|
59
|
+
}): (error: unknown) => {
|
|
60
|
+
cause?: unknown;
|
|
61
|
+
stack?: string;
|
|
62
|
+
name: "UsageQuotaExceededError";
|
|
63
|
+
context: Record<string, unknown>;
|
|
64
|
+
readonly message: string;
|
|
65
|
+
readonly _tag: "UsageQuotaExceededError";
|
|
66
|
+
};
|
|
67
|
+
extend<Name extends string = string>(name: Name, message?: string): any;
|
|
68
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
69
|
+
prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
|
|
70
|
+
stackTraceLimit: number;
|
|
71
|
+
};
|
|
72
|
+
/**
|
|
73
|
+
* Thrown by {@link EdgeAiHttpClient} when EDGE rejects an AI request with 429 because the
|
|
74
|
+
* authenticated profile exceeded a metering limit. Wrapped as the `cause` of an
|
|
75
|
+
* {@link HttpClientError.ResponseError} so it survives `@effect/ai`'s error mapping.
|
|
76
|
+
*/
|
|
77
|
+
export declare class UsageQuotaExceededError extends UsageQuotaExceededError_base {
|
|
78
|
+
}
|
|
45
79
|
/**
|
|
46
80
|
* Copy pasted from https://github.com/Effect-TS/effect/blob/main/packages/platform/src/internal/fetchHttpClient.ts
|
|
47
81
|
*/
|
|
48
82
|
export declare const requestInitTagKey = "@effect/platform/FetchHttpClient/FetchOptions";
|
|
83
|
+
/**
|
|
84
|
+
* Enables Anthropic fine-grained tool input streaming for client-defined tools.
|
|
85
|
+
* Provider tools (bash, web_search, etc.) are left unchanged.
|
|
86
|
+
*/
|
|
87
|
+
export declare const patchAnthropicMessagesRequestBody: (body: BodyInit | undefined) => BodyInit | undefined;
|
|
49
88
|
/**
|
|
50
89
|
* An `@effect/platform` {@link HttpClient.HttpClient} that routes requests through the
|
|
51
90
|
* authenticated EDGE AI endpoint via {@link EdgeHttpClient.anthropicAiRequest}, instead of
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"edge-ai-http-client.d.ts","sourceRoot":"","sources":["../../../src/edge-ai-http-client.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,UAAU,MAAM,6BAA6B,CAAC;AAK1D,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAGtC,OAAO,EAAE,SAAS,EAAE,KAAK,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAIhE,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEzD,MAAM,MAAM,iBAAiB,GAAG,MAAM,cAAc,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAErD;;;;;GAKG;AACH,qBAAa,SAAU,SAAQ,cAA2D;IACxF,YAAY,OAAO,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,GAAG,gBAAgB,EAE3E;CACF;
|
|
1
|
+
{"version":3,"file":"edge-ai-http-client.d.ts","sourceRoot":"","sources":["../../../src/edge-ai-http-client.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,UAAU,MAAM,6BAA6B,CAAC;AAK1D,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAGtC,OAAO,EAAE,SAAS,EAAE,KAAK,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAIhE,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEzD,MAAM,MAAM,iBAAiB,GAAG,MAAM,cAAc,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAErD;;;;;GAKG;AACH,qBAAa,SAAU,SAAQ,cAA2D;IACxF,YAAY,OAAO,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,GAAG,gBAAgB,EAE3E;CACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAED;;;;GAIG;AACH,qBAAa,uBAAwB,SAAQ,4BAAmE;CAAG;AAEnH;;GAEG;AACH,eAAO,MAAM,iBAAiB,kDAAkD,CAAC;AASjF;;;GAGG;AACH,eAAO,MAAM,iCAAiC,SAAU,QAAQ,GAAG,SAAS,KAAG,QAAQ,GAAG,SAmCzF,CAAC;AAQF;;;;;;;;;;GAUG;AACH,qBAAa,gBAAgB;IAC3B,MAAM,CAAC,IAAI,cAAe,iBAAiB,2BAkGtC;IAEL,MAAM,CAAC,KAAK,cAAe,iBAAiB,sDAC6B;CAC1E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"edge-ai-http-client.test.d.ts","sourceRoot":"","sources":["../../../src/edge-ai-http-client.test.ts"],"names":[],"mappings":""}
|
|
@@ -18,7 +18,8 @@ export type MessengerConfig = {
|
|
|
18
18
|
export interface EdgeConnection extends Required<Lifecycle> {
|
|
19
19
|
statusChanged: Event<EdgeStatus>;
|
|
20
20
|
get info(): any;
|
|
21
|
-
|
|
21
|
+
/** Identity DID (`did:halo:…`) of the connected identity. */
|
|
22
|
+
get identityDid(): string;
|
|
22
23
|
get peerKey(): string;
|
|
23
24
|
get isOpen(): boolean;
|
|
24
25
|
get status(): EdgeStatus;
|
|
@@ -52,7 +53,7 @@ export declare class EdgeClient extends Resource implements EdgeConnection {
|
|
|
52
53
|
device: string;
|
|
53
54
|
};
|
|
54
55
|
get status(): EdgeStatus;
|
|
55
|
-
get
|
|
56
|
+
get identityDid(): string;
|
|
56
57
|
get peerKey(): string;
|
|
57
58
|
setIdentity(identity: EdgeIdentity): void;
|
|
58
59
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"edge-client.d.ts","sourceRoot":"","sources":["../../../src/edge-client.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,KAAK,EAMN,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,OAAO,EAA+C,MAAM,eAAe,CAAC;AACrF,OAAO,EAAE,KAAK,SAAS,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzD,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,4CAA4C,CAAC;AAC1E,OAAO,EAAE,UAAU,EAAE,MAAM,4CAA4C,CAAC;AAGxE,OAAO,EAAE,KAAK,YAAY,EAAuB,MAAM,iBAAiB,CAAC;AAGzE,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,YAAY,CAAC;AAQ3C,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;AACzD,MAAM,MAAM,iBAAiB,GAAG,MAAM,IAAI,CAAC;AAE3C,MAAM,MAAM,eAAe,GAAG;IAC5B,cAAc,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,kGAAkG;IAClG,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,WAAW,cAAe,SAAQ,QAAQ,CAAC,SAAS,CAAC;IACzD,aAAa,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;IACjC,IAAI,IAAI,IAAI,GAAG,CAAC;IAChB,IAAI,WAAW,IAAI,MAAM,CAAC;IAC1B,IAAI,OAAO,IAAI,MAAM,CAAC;IACtB,IAAI,MAAM,IAAI,OAAO,CAAC;IACtB,IAAI,MAAM,IAAI,UAAU,CAAC;I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
|
import { type Context } from '@dxos/context';
|
|
2
|
-
import { type
|
|
3
|
-
import { type CompleteOAuthRegistrationRequest, type CompleteOAuthRegistrationResponse, type CreateAgentRequestBody, type CreateAgentResponseBody, type CreateSpaceRequest, type CreateSpaceResponseBody, type EdgeStatus, type ExecuteWorkflowResponseBody, type ExportBundleRequest, type ExportBundleResponse, type FeedProtocol, type GetAgentStatusResponseBody, type GetNotarizationResponseBody, type
|
|
2
|
+
import { type SpaceId } from '@dxos/keys';
|
|
3
|
+
import { type CompleteOAuthRegistrationRequest, type CompleteOAuthRegistrationResponse, type CreateAgentRequestBody, type CreateAgentResponseBody, type CreateSpaceRequest, type CreateSpaceResponseBody, type EdgeStatus, type ExecuteWorkflowResponseBody, type ExportBundleRequest, type ExportBundleResponse, type FeedProtocol, type GetAgentStatusResponseBody, type GetNotarizationResponseBody, type GetPluginsResponseBody, type ImportBundleRequest, type InitiateOAuthFlowRequest, type InitiateOAuthFlowResponse, type JoinSpaceRequest, type JoinSpaceResponseBody, type ObjectId, type PostNotarizationRequestBody, type RecoverIdentityRequest, type RecoverIdentityResponseBody, type UploadFunctionRequest, type UploadFunctionResponseBody } from '@dxos/protocols';
|
|
4
4
|
import { type QueryRequest as QueryRequestProto, type QueryResponse as QueryResponseProto } from '@dxos/protocols/proto/dxos/echo/query';
|
|
5
5
|
import { BaseHttpClient, type BaseHttpClientOptions, type EdgeHttpCallArgs } from './base-http-client';
|
|
6
6
|
export type { EdgeHttpCallArgs, RetryConfig } from './base-http-client';
|
|
@@ -12,6 +12,14 @@ export type EdgeQueryQueueResponse = {
|
|
|
12
12
|
nextCursor?: string;
|
|
13
13
|
prevCursor?: string;
|
|
14
14
|
};
|
|
15
|
+
export type UploadPluginBundleRequest = {
|
|
16
|
+
slug: string;
|
|
17
|
+
version: string;
|
|
18
|
+
files: {
|
|
19
|
+
path: string;
|
|
20
|
+
content: string;
|
|
21
|
+
}[];
|
|
22
|
+
};
|
|
15
23
|
export type TriggersDispatcherStatus = {
|
|
16
24
|
isActive: boolean;
|
|
17
25
|
nextCronTaskRunTimestamp?: number;
|
|
@@ -35,7 +43,7 @@ export declare class EdgeHttpClient extends BaseHttpClient {
|
|
|
35
43
|
getStatus(ctx: Context, args?: EdgeHttpCallArgs): Promise<EdgeStatus>;
|
|
36
44
|
createAgent(ctx: Context, body: CreateAgentRequestBody, args?: EdgeHttpCallArgs): Promise<CreateAgentResponseBody>;
|
|
37
45
|
getAgentStatus(ctx: Context, request: {
|
|
38
|
-
|
|
46
|
+
ownerIdentityDid: string;
|
|
39
47
|
}, args?: EdgeHttpCallArgs): Promise<GetAgentStatusResponseBody>;
|
|
40
48
|
getCredentialsForNotarization(ctx: Context, spaceId: SpaceId, args?: EdgeHttpCallArgs): Promise<GetNotarizationResponseBody>;
|
|
41
49
|
notarizeCredentials(ctx: Context, spaceId: SpaceId, body: PostNotarizationRequestBody, args?: EdgeHttpCallArgs): Promise<void>;
|
|
@@ -64,7 +72,14 @@ export declare class EdgeHttpClient extends BaseHttpClient {
|
|
|
64
72
|
forceRunCronTrigger(ctx: Context, spaceId: SpaceId, triggerId: ObjectId): Promise<unknown>;
|
|
65
73
|
execQuery(ctx: Context, spaceId: SpaceId, body: QueryRequestProto, args?: EdgeHttpCallArgs): Promise<QueryResponseProto>;
|
|
66
74
|
getRegistryPlugins(ctx: Context, args?: EdgeHttpCallArgs): Promise<GetPluginsResponseBody>;
|
|
67
|
-
|
|
75
|
+
/**
|
|
76
|
+
* Uploads a built plugin bundle to the registry's R2-backed hosting. Authenticated
|
|
77
|
+
* with the caller's hub identity (verifiable presentation) — `setIdentity` must
|
|
78
|
+
* have been called. Returns the canonical `moduleUrl` (the hosted `manifest.json`).
|
|
79
|
+
*/
|
|
80
|
+
uploadPluginBundle(ctx: Context, request: UploadPluginBundleRequest, args?: EdgeHttpCallArgs): Promise<{
|
|
81
|
+
moduleUrl: string;
|
|
82
|
+
}>;
|
|
68
83
|
importBundle(ctx: Context, spaceId: SpaceId, body: ImportBundleRequest, args?: EdgeHttpCallArgs): Promise<void>;
|
|
69
84
|
exportBundle(ctx: Context, spaceId: SpaceId, body: ExportBundleRequest, args?: EdgeHttpCallArgs): Promise<ExportBundleResponse>;
|
|
70
85
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"edge-http-client.d.ts","sourceRoot":"","sources":["../../../src/edge-http-client.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,eAAe,CAAC;AAG7C,OAAO,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"edge-http-client.d.ts","sourceRoot":"","sources":["../../../src/edge-http-client.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,eAAe,CAAC;AAG7C,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,YAAY,CAAC;AAE1C,OAAO,EACL,KAAK,gCAAgC,EACrC,KAAK,iCAAiC,EACtC,KAAK,sBAAsB,EAC3B,KAAK,uBAAuB,EAC5B,KAAK,kBAAkB,EACvB,KAAK,uBAAuB,EAE5B,KAAK,UAAU,EACf,KAAK,2BAA2B,EAChC,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,YAAY,EACjB,KAAK,0BAA0B,EAC/B,KAAK,2BAA2B,EAChC,KAAK,sBAAsB,EAC3B,KAAK,mBAAmB,EACxB,KAAK,wBAAwB,EAC7B,KAAK,yBAAyB,EAC9B,KAAK,gBAAgB,EACrB,KAAK,qBAAqB,EAC1B,KAAK,QAAQ,EACb,KAAK,2BAA2B,EAChC,KAAK,sBAAsB,EAC3B,KAAK,2BAA2B,EAChC,KAAK,qBAAqB,EAC1B,KAAK,0BAA0B,EAChC,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,KAAK,YAAY,IAAI,iBAAiB,EACtC,KAAK,aAAa,IAAI,kBAAkB,EACzC,MAAM,uCAAuC,CAAC;AAG/C,OAAO,EAAE,cAAc,EAAE,KAAK,qBAAqB,EAAE,K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