tokentracker-cli 0.2.23
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/LICENSE +21 -0
- package/README.md +136 -0
- package/README.old.md +324 -0
- package/README.zh-CN.md +440 -0
- package/bin/tracker.js +28 -0
- package/dashboard/dist/apple-touch-icon.png +0 -0
- package/dashboard/dist/assets/AsciiBox-vyDhXYY5.js +1 -0
- package/dashboard/dist/assets/DashboardPage-CrplxZFL.js +12 -0
- package/dashboard/dist/assets/LandingExtras-DlrtqIDj.js +1 -0
- package/dashboard/dist/assets/LeaderboardPage-Czwkjje0.js +1 -0
- package/dashboard/dist/assets/LeaderboardProfilePage-C4rorru6.js +1 -0
- package/dashboard/dist/assets/MatrixRain-bGmRmuOW.js +1 -0
- package/dashboard/dist/assets/MatrixShell-BfOGBm5o.js +1 -0
- package/dashboard/dist/assets/geist-mono-cyrillic-400-normal-BPBWmzPh.woff +0 -0
- package/dashboard/dist/assets/geist-mono-cyrillic-400-normal-Ce5q_31Z.woff2 +0 -0
- package/dashboard/dist/assets/geist-mono-cyrillic-500-normal-CJBLNVQT.woff2 +0 -0
- package/dashboard/dist/assets/geist-mono-cyrillic-500-normal-mNhfPmgl.woff +0 -0
- package/dashboard/dist/assets/geist-mono-cyrillic-700-normal-DH5Q319x.woff +0 -0
- package/dashboard/dist/assets/geist-mono-cyrillic-700-normal-VCNRadI3.woff2 +0 -0
- package/dashboard/dist/assets/geist-mono-cyrillic-900-normal-BKC3PZkM.woff +0 -0
- package/dashboard/dist/assets/geist-mono-cyrillic-900-normal-DdrQ8KBw.woff2 +0 -0
- package/dashboard/dist/assets/geist-mono-latin-400-normal-CoULgQGM.woff +0 -0
- package/dashboard/dist/assets/geist-mono-latin-400-normal-LC9RFr9I.woff2 +0 -0
- package/dashboard/dist/assets/geist-mono-latin-500-normal-D3o2eNa9.woff2 +0 -0
- package/dashboard/dist/assets/geist-mono-latin-500-normal-DOxI7kZ4.woff +0 -0
- package/dashboard/dist/assets/geist-mono-latin-700-normal-D6izGJRP.woff2 +0 -0
- package/dashboard/dist/assets/geist-mono-latin-700-normal-QGw08Lff.woff +0 -0
- package/dashboard/dist/assets/geist-mono-latin-900-normal-CmoKXrdK.woff +0 -0
- package/dashboard/dist/assets/geist-mono-latin-900-normal-Cu5MFKsu.woff2 +0 -0
- package/dashboard/dist/assets/geist-mono-latin-ext-400-normal-Cgks_Qgx.woff2 +0 -0
- package/dashboard/dist/assets/geist-mono-latin-ext-400-normal-CxNRRMGd.woff +0 -0
- package/dashboard/dist/assets/geist-mono-latin-ext-500-normal-CQcGuCNt.woff2 +0 -0
- package/dashboard/dist/assets/geist-mono-latin-ext-500-normal-diTenJ8L.woff +0 -0
- package/dashboard/dist/assets/geist-mono-latin-ext-700-normal-BX9f1BHp.woff +0 -0
- package/dashboard/dist/assets/geist-mono-latin-ext-700-normal-YOllDaLV.woff2 +0 -0
- package/dashboard/dist/assets/geist-mono-latin-ext-900-normal-Br6WNUGb.woff +0 -0
- package/dashboard/dist/assets/geist-mono-latin-ext-900-normal-CrmBTzU2.woff2 +0 -0
- package/dashboard/dist/assets/index-BeoRn2gJ.js +2 -0
- package/dashboard/dist/assets/main-BYPG1_bI.js +2056 -0
- package/dashboard/dist/assets/main-hwTpulbk.css +1 -0
- package/dashboard/dist/favicon-16.png +0 -0
- package/dashboard/dist/favicon-32.png +0 -0
- package/dashboard/dist/favicon.ico +0 -0
- package/dashboard/dist/feed.xml +18 -0
- package/dashboard/dist/icon-192.png +0 -0
- package/dashboard/dist/icon-512.png +0 -0
- package/dashboard/dist/icon.svg +1 -0
- package/dashboard/dist/index.html +181 -0
- package/dashboard/dist/landing-dashboard.jpg +0 -0
- package/dashboard/dist/llms.txt +25 -0
- package/dashboard/dist/og-image.jpg +0 -0
- package/dashboard/dist/robots.txt +7 -0
- package/dashboard/dist/share-dashboard.jpg +0 -0
- package/dashboard/dist/share.html +118 -0
- package/dashboard/dist/sitemap.xml +13 -0
- package/dashboard/dist/social-preview.png +0 -0
- package/dashboard/dist/wrapped-2025.html +60 -0
- package/dashboard/dist/wrapped-2025.png +0 -0
- package/node_modules/@insforge/sdk/LICENSE +201 -0
- package/node_modules/@insforge/sdk/README.md +259 -0
- package/node_modules/@insforge/sdk/dist/index.d.mts +854 -0
- package/node_modules/@insforge/sdk/dist/index.d.ts +854 -0
- package/node_modules/@insforge/sdk/dist/index.js +1823 -0
- package/node_modules/@insforge/sdk/dist/index.js.map +1 -0
- package/node_modules/@insforge/sdk/dist/index.mjs +1784 -0
- package/node_modules/@insforge/sdk/dist/index.mjs.map +1 -0
- package/node_modules/@insforge/sdk/package.json +68 -0
- package/node_modules/@insforge/shared-schemas/dist/ai-api.schema.d.ts +583 -0
- package/node_modules/@insforge/shared-schemas/dist/ai-api.schema.d.ts.map +1 -0
- package/node_modules/@insforge/shared-schemas/dist/ai-api.schema.js +111 -0
- package/node_modules/@insforge/shared-schemas/dist/ai-api.schema.js.map +1 -0
- package/node_modules/@insforge/shared-schemas/dist/ai.schema.d.ts +188 -0
- package/node_modules/@insforge/shared-schemas/dist/ai.schema.d.ts.map +1 -0
- package/node_modules/@insforge/shared-schemas/dist/ai.schema.js +48 -0
- package/node_modules/@insforge/shared-schemas/dist/ai.schema.js.map +1 -0
- package/node_modules/@insforge/shared-schemas/dist/auth-api.schema.d.ts +1127 -0
- package/node_modules/@insforge/shared-schemas/dist/auth-api.schema.d.ts.map +1 -0
- package/node_modules/@insforge/shared-schemas/dist/auth-api.schema.js +277 -0
- package/node_modules/@insforge/shared-schemas/dist/auth-api.schema.js.map +1 -0
- package/node_modules/@insforge/shared-schemas/dist/auth.schema.d.ts +187 -0
- package/node_modules/@insforge/shared-schemas/dist/auth.schema.d.ts.map +1 -0
- package/node_modules/@insforge/shared-schemas/dist/auth.schema.js +105 -0
- package/node_modules/@insforge/shared-schemas/dist/auth.schema.js.map +1 -0
- package/node_modules/@insforge/shared-schemas/dist/cloud-events.schema.d.ts +144 -0
- package/node_modules/@insforge/shared-schemas/dist/cloud-events.schema.d.ts.map +1 -0
- package/node_modules/@insforge/shared-schemas/dist/cloud-events.schema.js +41 -0
- package/node_modules/@insforge/shared-schemas/dist/cloud-events.schema.js.map +1 -0
- package/node_modules/@insforge/shared-schemas/dist/database-api.schema.d.ts +1627 -0
- package/node_modules/@insforge/shared-schemas/dist/database-api.schema.d.ts.map +1 -0
- package/node_modules/@insforge/shared-schemas/dist/database-api.schema.js +209 -0
- package/node_modules/@insforge/shared-schemas/dist/database-api.schema.js.map +1 -0
- package/node_modules/@insforge/shared-schemas/dist/database.schema.d.ts +263 -0
- package/node_modules/@insforge/shared-schemas/dist/database.schema.d.ts.map +1 -0
- package/node_modules/@insforge/shared-schemas/dist/database.schema.js +89 -0
- package/node_modules/@insforge/shared-schemas/dist/database.schema.js.map +1 -0
- package/node_modules/@insforge/shared-schemas/dist/docs.schema.d.ts +4 -0
- package/node_modules/@insforge/shared-schemas/dist/docs.schema.d.ts.map +1 -0
- package/node_modules/@insforge/shared-schemas/dist/docs.schema.js +22 -0
- package/node_modules/@insforge/shared-schemas/dist/docs.schema.js.map +1 -0
- package/node_modules/@insforge/shared-schemas/dist/email-api.schema.d.ts +34 -0
- package/node_modules/@insforge/shared-schemas/dist/email-api.schema.d.ts.map +1 -0
- package/node_modules/@insforge/shared-schemas/dist/email-api.schema.js +24 -0
- package/node_modules/@insforge/shared-schemas/dist/email-api.schema.js.map +1 -0
- package/node_modules/@insforge/shared-schemas/dist/functions-api.schema.d.ts +39 -0
- package/node_modules/@insforge/shared-schemas/dist/functions-api.schema.d.ts.map +1 -0
- package/node_modules/@insforge/shared-schemas/dist/functions-api.schema.js +18 -0
- package/node_modules/@insforge/shared-schemas/dist/functions-api.schema.js.map +1 -0
- package/node_modules/@insforge/shared-schemas/dist/functions.schema.d.ts +34 -0
- package/node_modules/@insforge/shared-schemas/dist/functions.schema.d.ts.map +1 -0
- package/node_modules/@insforge/shared-schemas/dist/functions.schema.js +14 -0
- package/node_modules/@insforge/shared-schemas/dist/functions.schema.js.map +1 -0
- package/node_modules/@insforge/shared-schemas/dist/index.d.ts +19 -0
- package/node_modules/@insforge/shared-schemas/dist/index.d.ts.map +1 -0
- package/node_modules/@insforge/shared-schemas/dist/index.js +19 -0
- package/node_modules/@insforge/shared-schemas/dist/index.js.map +1 -0
- package/node_modules/@insforge/shared-schemas/dist/logs-api.schema.d.ts +237 -0
- package/node_modules/@insforge/shared-schemas/dist/logs-api.schema.d.ts.map +1 -0
- package/node_modules/@insforge/shared-schemas/dist/logs-api.schema.js +41 -0
- package/node_modules/@insforge/shared-schemas/dist/logs-api.schema.js.map +1 -0
- package/node_modules/@insforge/shared-schemas/dist/logs.schema.d.ts +79 -0
- package/node_modules/@insforge/shared-schemas/dist/logs.schema.d.ts.map +1 -0
- package/node_modules/@insforge/shared-schemas/dist/logs.schema.js +31 -0
- package/node_modules/@insforge/shared-schemas/dist/logs.schema.js.map +1 -0
- package/node_modules/@insforge/shared-schemas/dist/metadata.schema.d.ts +940 -0
- package/node_modules/@insforge/shared-schemas/dist/metadata.schema.d.ts.map +1 -0
- package/node_modules/@insforge/shared-schemas/dist/metadata.schema.js +50 -0
- package/node_modules/@insforge/shared-schemas/dist/metadata.schema.js.map +1 -0
- package/node_modules/@insforge/shared-schemas/dist/realtime-api.schema.d.ts +395 -0
- package/node_modules/@insforge/shared-schemas/dist/realtime-api.schema.d.ts.map +1 -0
- package/node_modules/@insforge/shared-schemas/dist/realtime-api.schema.js +73 -0
- package/node_modules/@insforge/shared-schemas/dist/realtime-api.schema.js.map +1 -0
- package/node_modules/@insforge/shared-schemas/dist/realtime.schema.d.ts +269 -0
- package/node_modules/@insforge/shared-schemas/dist/realtime.schema.d.ts.map +1 -0
- package/node_modules/@insforge/shared-schemas/dist/realtime.schema.js +109 -0
- package/node_modules/@insforge/shared-schemas/dist/realtime.schema.js.map +1 -0
- package/node_modules/@insforge/shared-schemas/dist/storage-api.schema.d.ts +166 -0
- package/node_modules/@insforge/shared-schemas/dist/storage-api.schema.d.ts.map +1 -0
- package/node_modules/@insforge/shared-schemas/dist/storage-api.schema.js +49 -0
- package/node_modules/@insforge/shared-schemas/dist/storage-api.schema.js.map +1 -0
- package/node_modules/@insforge/shared-schemas/dist/storage.schema.d.ts +39 -0
- package/node_modules/@insforge/shared-schemas/dist/storage.schema.d.ts.map +1 -0
- package/node_modules/@insforge/shared-schemas/dist/storage.schema.js +15 -0
- package/node_modules/@insforge/shared-schemas/dist/storage.schema.js.map +1 -0
- package/node_modules/@insforge/shared-schemas/package.json +31 -0
- package/node_modules/@socket.io/component-emitter/LICENSE +24 -0
- package/node_modules/@socket.io/component-emitter/Readme.md +79 -0
- package/node_modules/@socket.io/component-emitter/lib/cjs/index.d.ts +179 -0
- package/node_modules/@socket.io/component-emitter/lib/cjs/index.js +176 -0
- package/node_modules/@socket.io/component-emitter/lib/cjs/package.json +4 -0
- package/node_modules/@socket.io/component-emitter/lib/esm/index.d.ts +179 -0
- package/node_modules/@socket.io/component-emitter/lib/esm/index.js +169 -0
- package/node_modules/@socket.io/component-emitter/lib/esm/package.json +4 -0
- package/node_modules/@socket.io/component-emitter/package.json +28 -0
- package/node_modules/@supabase/node-fetch/LICENSE.md +22 -0
- package/node_modules/@supabase/node-fetch/README.md +633 -0
- package/node_modules/@supabase/node-fetch/browser.js +22 -0
- package/node_modules/@supabase/node-fetch/lib/index.es.js +1778 -0
- package/node_modules/@supabase/node-fetch/lib/index.js +1787 -0
- package/node_modules/@supabase/node-fetch/lib/index.mjs +1776 -0
- package/node_modules/@supabase/node-fetch/package.json +80 -0
- package/node_modules/@supabase/postgrest-js/LICENSE +21 -0
- package/node_modules/@supabase/postgrest-js/README.md +56 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/PostgrestBuilder.d.ts +71 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/PostgrestBuilder.d.ts.map +1 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/PostgrestBuilder.js +222 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/PostgrestBuilder.js.map +1 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/PostgrestClient.d.ts +74 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/PostgrestClient.d.ts.map +1 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/PostgrestClient.js +121 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/PostgrestClient.js.map +1 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/PostgrestError.d.ts +17 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/PostgrestError.d.ts.map +1 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/PostgrestError.js +18 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/PostgrestError.js.map +1 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/PostgrestFilterBuilder.d.ts +108 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/PostgrestFilterBuilder.d.ts.map +1 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/PostgrestFilterBuilder.js +381 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/PostgrestFilterBuilder.js.map +1 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/PostgrestQueryBuilder.d.ts +117 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/PostgrestQueryBuilder.d.ts.map +1 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/PostgrestQueryBuilder.js +251 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/PostgrestQueryBuilder.js.map +1 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/PostgrestTransformBuilder.d.ts +157 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/PostgrestTransformBuilder.d.ts.map +1 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/PostgrestTransformBuilder.js +226 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/PostgrestTransformBuilder.js.map +1 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/constants.d.ts +4 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/constants.d.ts.map +1 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/constants.js +6 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/constants.js.map +1 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/index.d.ts +19 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/index.d.ts.map +1 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/index.js +28 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/index.js.map +1 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/select-query-parser/parser.d.ts +261 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/select-query-parser/parser.d.ts.map +1 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/select-query-parser/parser.js +5 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/select-query-parser/parser.js.map +1 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/select-query-parser/result.d.ts +157 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/select-query-parser/result.d.ts.map +1 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/select-query-parser/result.js +3 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/select-query-parser/result.js.map +1 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/select-query-parser/types.d.ts +31 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/select-query-parser/types.d.ts.map +1 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/select-query-parser/types.js +3 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/select-query-parser/types.js.map +1 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/select-query-parser/utils.d.ts +264 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/select-query-parser/utils.d.ts.map +1 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/select-query-parser/utils.js +3 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/select-query-parser/utils.js.map +1 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/types.d.ts +106 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/types.d.ts.map +1 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/types.js +3 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/types.js.map +1 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/version.d.ts +2 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/version.d.ts.map +1 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/version.js +5 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/version.js.map +1 -0
- package/node_modules/@supabase/postgrest-js/dist/esm/wrapper.mjs +28 -0
- package/node_modules/@supabase/postgrest-js/package.json +75 -0
- package/node_modules/@supabase/postgrest-js/src/PostgrestBuilder.ts +300 -0
- package/node_modules/@supabase/postgrest-js/src/PostgrestClient.ts +192 -0
- package/node_modules/@supabase/postgrest-js/src/PostgrestError.ts +18 -0
- package/node_modules/@supabase/postgrest-js/src/PostgrestFilterBuilder.ts +604 -0
- package/node_modules/@supabase/postgrest-js/src/PostgrestQueryBuilder.ts +437 -0
- package/node_modules/@supabase/postgrest-js/src/PostgrestTransformBuilder.ts +368 -0
- package/node_modules/@supabase/postgrest-js/src/constants.ts +2 -0
- package/node_modules/@supabase/postgrest-js/src/index.ts +35 -0
- package/node_modules/@supabase/postgrest-js/src/select-query-parser/parser.ts +469 -0
- package/node_modules/@supabase/postgrest-js/src/select-query-parser/result.ts +503 -0
- package/node_modules/@supabase/postgrest-js/src/select-query-parser/types.ts +115 -0
- package/node_modules/@supabase/postgrest-js/src/select-query-parser/utils.ts +602 -0
- package/node_modules/@supabase/postgrest-js/src/types.ts +201 -0
- package/node_modules/@supabase/postgrest-js/src/version.ts +1 -0
- package/node_modules/debug/LICENSE +20 -0
- package/node_modules/debug/README.md +481 -0
- package/node_modules/debug/package.json +60 -0
- package/node_modules/debug/src/browser.js +271 -0
- package/node_modules/debug/src/common.js +274 -0
- package/node_modules/debug/src/index.js +10 -0
- package/node_modules/debug/src/node.js +263 -0
- package/node_modules/engine.io-client/LICENSE +22 -0
- package/node_modules/engine.io-client/README.md +331 -0
- package/node_modules/engine.io-client/build/cjs/browser-entrypoint.d.ts +3 -0
- package/node_modules/engine.io-client/build/cjs/browser-entrypoint.js +4 -0
- package/node_modules/engine.io-client/build/cjs/contrib/has-cors.d.ts +1 -0
- package/node_modules/engine.io-client/build/cjs/contrib/has-cors.js +14 -0
- package/node_modules/engine.io-client/build/cjs/contrib/parseqs.d.ts +15 -0
- package/node_modules/engine.io-client/build/cjs/contrib/parseqs.js +38 -0
- package/node_modules/engine.io-client/build/cjs/contrib/parseuri.d.ts +1 -0
- package/node_modules/engine.io-client/build/cjs/contrib/parseuri.js +67 -0
- package/node_modules/engine.io-client/build/cjs/globals.d.ts +4 -0
- package/node_modules/engine.io-client/build/cjs/globals.js +26 -0
- package/node_modules/engine.io-client/build/cjs/globals.node.d.ts +21 -0
- package/node_modules/engine.io-client/build/cjs/globals.node.js +97 -0
- package/node_modules/engine.io-client/build/cjs/index.d.ts +15 -0
- package/node_modules/engine.io-client/build/cjs/index.js +32 -0
- package/node_modules/engine.io-client/build/cjs/package.json +10 -0
- package/node_modules/engine.io-client/build/cjs/socket.d.ts +482 -0
- package/node_modules/engine.io-client/build/cjs/socket.js +765 -0
- package/node_modules/engine.io-client/build/cjs/transport.d.ts +106 -0
- package/node_modules/engine.io-client/build/cjs/transport.js +153 -0
- package/node_modules/engine.io-client/build/cjs/transports/index.d.ts +8 -0
- package/node_modules/engine.io-client/build/cjs/transports/index.js +11 -0
- package/node_modules/engine.io-client/build/cjs/transports/polling-fetch.d.ts +15 -0
- package/node_modules/engine.io-client/build/cjs/transports/polling-fetch.js +60 -0
- package/node_modules/engine.io-client/build/cjs/transports/polling-xhr.d.ts +108 -0
- package/node_modules/engine.io-client/build/cjs/transports/polling-xhr.js +285 -0
- package/node_modules/engine.io-client/build/cjs/transports/polling-xhr.node.d.ts +11 -0
- package/node_modules/engine.io-client/build/cjs/transports/polling-xhr.node.js +44 -0
- package/node_modules/engine.io-client/build/cjs/transports/polling.d.ts +52 -0
- package/node_modules/engine.io-client/build/cjs/transports/polling.js +165 -0
- package/node_modules/engine.io-client/build/cjs/transports/websocket.d.ts +36 -0
- package/node_modules/engine.io-client/build/cjs/transports/websocket.js +136 -0
- package/node_modules/engine.io-client/build/cjs/transports/websocket.node.d.ts +14 -0
- package/node_modules/engine.io-client/build/cjs/transports/websocket.node.js +68 -0
- package/node_modules/engine.io-client/build/cjs/transports/webtransport.d.ts +18 -0
- package/node_modules/engine.io-client/build/cjs/transports/webtransport.js +94 -0
- package/node_modules/engine.io-client/build/cjs/util.d.ts +7 -0
- package/node_modules/engine.io-client/build/cjs/util.js +65 -0
- package/node_modules/engine.io-client/build/esm/browser-entrypoint.d.ts +3 -0
- package/node_modules/engine.io-client/build/esm/browser-entrypoint.js +2 -0
- package/node_modules/engine.io-client/build/esm/contrib/has-cors.d.ts +1 -0
- package/node_modules/engine.io-client/build/esm/contrib/has-cors.js +11 -0
- package/node_modules/engine.io-client/build/esm/contrib/parseqs.d.ts +15 -0
- package/node_modules/engine.io-client/build/esm/contrib/parseqs.js +34 -0
- package/node_modules/engine.io-client/build/esm/contrib/parseuri.d.ts +1 -0
- package/node_modules/engine.io-client/build/esm/contrib/parseuri.js +64 -0
- package/node_modules/engine.io-client/build/esm/globals.d.ts +4 -0
- package/node_modules/engine.io-client/build/esm/globals.js +22 -0
- package/node_modules/engine.io-client/build/esm/globals.node.d.ts +21 -0
- package/node_modules/engine.io-client/build/esm/globals.node.js +91 -0
- package/node_modules/engine.io-client/build/esm/index.d.ts +15 -0
- package/node_modules/engine.io-client/build/esm/index.js +15 -0
- package/node_modules/engine.io-client/build/esm/package.json +10 -0
- package/node_modules/engine.io-client/build/esm/socket.d.ts +482 -0
- package/node_modules/engine.io-client/build/esm/socket.js +727 -0
- package/node_modules/engine.io-client/build/esm/transport.d.ts +106 -0
- package/node_modules/engine.io-client/build/esm/transport.js +142 -0
- package/node_modules/engine.io-client/build/esm/transports/index.d.ts +8 -0
- package/node_modules/engine.io-client/build/esm/transports/index.js +8 -0
- package/node_modules/engine.io-client/build/esm/transports/polling-fetch.d.ts +15 -0
- package/node_modules/engine.io-client/build/esm/transports/polling-fetch.js +56 -0
- package/node_modules/engine.io-client/build/esm/transports/polling-xhr.d.ts +108 -0
- package/node_modules/engine.io-client/build/esm/transports/polling-xhr.js +271 -0
- package/node_modules/engine.io-client/build/esm/transports/polling-xhr.node.d.ts +11 -0
- package/node_modules/engine.io-client/build/esm/transports/polling-xhr.node.js +17 -0
- package/node_modules/engine.io-client/build/esm/transports/polling.d.ts +52 -0
- package/node_modules/engine.io-client/build/esm/transports/polling.js +145 -0
- package/node_modules/engine.io-client/build/esm/transports/websocket.d.ts +36 -0
- package/node_modules/engine.io-client/build/esm/transports/websocket.js +125 -0
- package/node_modules/engine.io-client/build/esm/transports/websocket.node.d.ts +14 -0
- package/node_modules/engine.io-client/build/esm/transports/websocket.node.js +41 -0
- package/node_modules/engine.io-client/build/esm/transports/webtransport.d.ts +18 -0
- package/node_modules/engine.io-client/build/esm/transports/webtransport.js +80 -0
- package/node_modules/engine.io-client/build/esm/util.d.ts +7 -0
- package/node_modules/engine.io-client/build/esm/util.js +59 -0
- package/node_modules/engine.io-client/build/esm-debug/browser-entrypoint.d.ts +3 -0
- package/node_modules/engine.io-client/build/esm-debug/browser-entrypoint.js +2 -0
- package/node_modules/engine.io-client/build/esm-debug/contrib/has-cors.d.ts +1 -0
- package/node_modules/engine.io-client/build/esm-debug/contrib/has-cors.js +11 -0
- package/node_modules/engine.io-client/build/esm-debug/contrib/parseqs.d.ts +15 -0
- package/node_modules/engine.io-client/build/esm-debug/contrib/parseqs.js +34 -0
- package/node_modules/engine.io-client/build/esm-debug/contrib/parseuri.d.ts +1 -0
- package/node_modules/engine.io-client/build/esm-debug/contrib/parseuri.js +64 -0
- package/node_modules/engine.io-client/build/esm-debug/globals.d.ts +4 -0
- package/node_modules/engine.io-client/build/esm-debug/globals.js +22 -0
- package/node_modules/engine.io-client/build/esm-debug/globals.node.d.ts +21 -0
- package/node_modules/engine.io-client/build/esm-debug/globals.node.js +91 -0
- package/node_modules/engine.io-client/build/esm-debug/index.d.ts +15 -0
- package/node_modules/engine.io-client/build/esm-debug/index.js +15 -0
- package/node_modules/engine.io-client/build/esm-debug/package.json +10 -0
- package/node_modules/engine.io-client/build/esm-debug/socket.d.ts +482 -0
- package/node_modules/engine.io-client/build/esm-debug/socket.js +756 -0
- package/node_modules/engine.io-client/build/esm-debug/transport.d.ts +106 -0
- package/node_modules/engine.io-client/build/esm-debug/transport.js +145 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/index.d.ts +8 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/index.js +8 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/polling-fetch.d.ts +15 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/polling-fetch.js +56 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/polling-xhr.d.ts +108 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/polling-xhr.js +276 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/polling-xhr.node.d.ts +11 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/polling-xhr.node.js +17 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/polling.d.ts +52 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/polling.js +158 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/websocket.d.ts +36 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/websocket.js +128 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/websocket.node.d.ts +14 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/websocket.node.js +41 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/webtransport.d.ts +18 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/webtransport.js +87 -0
- package/node_modules/engine.io-client/build/esm-debug/util.d.ts +7 -0
- package/node_modules/engine.io-client/build/esm-debug/util.js +59 -0
- package/node_modules/engine.io-client/dist/engine.io.esm.min.js +7 -0
- package/node_modules/engine.io-client/dist/engine.io.esm.min.js.map +1 -0
- package/node_modules/engine.io-client/dist/engine.io.js +2968 -0
- package/node_modules/engine.io-client/dist/engine.io.js.map +1 -0
- package/node_modules/engine.io-client/dist/engine.io.min.js +7 -0
- package/node_modules/engine.io-client/dist/engine.io.min.js.map +1 -0
- package/node_modules/engine.io-client/package.json +95 -0
- package/node_modules/engine.io-parser/LICENSE +22 -0
- package/node_modules/engine.io-parser/Readme.md +158 -0
- package/node_modules/engine.io-parser/build/cjs/commons.d.ts +14 -0
- package/node_modules/engine.io-parser/build/cjs/commons.js +19 -0
- package/node_modules/engine.io-parser/build/cjs/contrib/base64-arraybuffer.d.ts +2 -0
- package/node_modules/engine.io-parser/build/cjs/contrib/base64-arraybuffer.js +48 -0
- package/node_modules/engine.io-parser/build/cjs/decodePacket.browser.d.ts +2 -0
- package/node_modules/engine.io-parser/build/cjs/decodePacket.browser.js +66 -0
- package/node_modules/engine.io-parser/build/cjs/decodePacket.d.ts +2 -0
- package/node_modules/engine.io-parser/build/cjs/decodePacket.js +59 -0
- package/node_modules/engine.io-parser/build/cjs/encodePacket.browser.d.ts +4 -0
- package/node_modules/engine.io-parser/build/cjs/encodePacket.browser.js +72 -0
- package/node_modules/engine.io-parser/build/cjs/encodePacket.d.ts +3 -0
- package/node_modules/engine.io-parser/build/cjs/encodePacket.js +38 -0
- package/node_modules/engine.io-parser/build/cjs/index.d.ts +9 -0
- package/node_modules/engine.io-parser/build/cjs/index.js +164 -0
- package/node_modules/engine.io-parser/build/cjs/package.json +8 -0
- package/node_modules/engine.io-parser/build/esm/commons.d.ts +14 -0
- package/node_modules/engine.io-parser/build/esm/commons.js +14 -0
- package/node_modules/engine.io-parser/build/esm/contrib/base64-arraybuffer.d.ts +2 -0
- package/node_modules/engine.io-parser/build/esm/contrib/base64-arraybuffer.js +43 -0
- package/node_modules/engine.io-parser/build/esm/decodePacket.browser.d.ts +2 -0
- package/node_modules/engine.io-parser/build/esm/decodePacket.browser.js +62 -0
- package/node_modules/engine.io-parser/build/esm/decodePacket.d.ts +2 -0
- package/node_modules/engine.io-parser/build/esm/decodePacket.js +55 -0
- package/node_modules/engine.io-parser/build/esm/encodePacket.browser.d.ts +4 -0
- package/node_modules/engine.io-parser/build/esm/encodePacket.browser.js +68 -0
- package/node_modules/engine.io-parser/build/esm/encodePacket.d.ts +3 -0
- package/node_modules/engine.io-parser/build/esm/encodePacket.js +33 -0
- package/node_modules/engine.io-parser/build/esm/index.d.ts +9 -0
- package/node_modules/engine.io-parser/build/esm/index.js +156 -0
- package/node_modules/engine.io-parser/build/esm/package.json +8 -0
- package/node_modules/engine.io-parser/package.json +46 -0
- package/node_modules/ms/index.js +162 -0
- package/node_modules/ms/license.md +21 -0
- package/node_modules/ms/package.json +38 -0
- package/node_modules/ms/readme.md +59 -0
- package/node_modules/socket.io-client/LICENSE +21 -0
- package/node_modules/socket.io-client/README.md +29 -0
- package/node_modules/socket.io-client/build/cjs/browser-entrypoint.d.ts +2 -0
- package/node_modules/socket.io-client/build/cjs/browser-entrypoint.js +4 -0
- package/node_modules/socket.io-client/build/cjs/contrib/backo2.d.ts +12 -0
- package/node_modules/socket.io-client/build/cjs/contrib/backo2.js +69 -0
- package/node_modules/socket.io-client/build/cjs/index.d.ts +29 -0
- package/node_modules/socket.io-client/build/cjs/index.js +76 -0
- package/node_modules/socket.io-client/build/cjs/manager.d.ts +295 -0
- package/node_modules/socket.io-client/build/cjs/manager.js +416 -0
- package/node_modules/socket.io-client/build/cjs/on.d.ts +2 -0
- package/node_modules/socket.io-client/build/cjs/on.js +9 -0
- package/node_modules/socket.io-client/build/cjs/socket.d.ts +593 -0
- package/node_modules/socket.io-client/build/cjs/socket.js +910 -0
- package/node_modules/socket.io-client/build/cjs/url.d.ts +33 -0
- package/node_modules/socket.io-client/build/cjs/url.js +69 -0
- package/node_modules/socket.io-client/build/esm/browser-entrypoint.d.ts +2 -0
- package/node_modules/socket.io-client/build/esm/browser-entrypoint.js +2 -0
- package/node_modules/socket.io-client/build/esm/contrib/backo2.d.ts +12 -0
- package/node_modules/socket.io-client/build/esm/contrib/backo2.js +66 -0
- package/node_modules/socket.io-client/build/esm/index.d.ts +29 -0
- package/node_modules/socket.io-client/build/esm/index.js +58 -0
- package/node_modules/socket.io-client/build/esm/manager.d.ts +295 -0
- package/node_modules/socket.io-client/build/esm/manager.js +367 -0
- package/node_modules/socket.io-client/build/esm/on.d.ts +2 -0
- package/node_modules/socket.io-client/build/esm/on.js +6 -0
- package/node_modules/socket.io-client/build/esm/package.json +5 -0
- package/node_modules/socket.io-client/build/esm/socket.d.ts +593 -0
- package/node_modules/socket.io-client/build/esm/socket.js +882 -0
- package/node_modules/socket.io-client/build/esm/url.d.ts +33 -0
- package/node_modules/socket.io-client/build/esm/url.js +59 -0
- package/node_modules/socket.io-client/build/esm-debug/browser-entrypoint.d.ts +2 -0
- package/node_modules/socket.io-client/build/esm-debug/browser-entrypoint.js +2 -0
- package/node_modules/socket.io-client/build/esm-debug/contrib/backo2.d.ts +12 -0
- package/node_modules/socket.io-client/build/esm-debug/contrib/backo2.js +66 -0
- package/node_modules/socket.io-client/build/esm-debug/index.d.ts +29 -0
- package/node_modules/socket.io-client/build/esm-debug/index.js +62 -0
- package/node_modules/socket.io-client/build/esm-debug/manager.d.ts +295 -0
- package/node_modules/socket.io-client/build/esm-debug/manager.js +386 -0
- package/node_modules/socket.io-client/build/esm-debug/on.d.ts +2 -0
- package/node_modules/socket.io-client/build/esm-debug/on.js +6 -0
- package/node_modules/socket.io-client/build/esm-debug/package.json +5 -0
- package/node_modules/socket.io-client/build/esm-debug/socket.d.ts +593 -0
- package/node_modules/socket.io-client/build/esm-debug/socket.js +903 -0
- package/node_modules/socket.io-client/build/esm-debug/url.d.ts +33 -0
- package/node_modules/socket.io-client/build/esm-debug/url.js +63 -0
- package/node_modules/socket.io-client/dist/socket.io.esm.min.js +7 -0
- package/node_modules/socket.io-client/dist/socket.io.esm.min.js.map +1 -0
- package/node_modules/socket.io-client/dist/socket.io.js +4908 -0
- package/node_modules/socket.io-client/dist/socket.io.js.map +1 -0
- package/node_modules/socket.io-client/dist/socket.io.min.js +7 -0
- package/node_modules/socket.io-client/dist/socket.io.min.js.map +1 -0
- package/node_modules/socket.io-client/dist/socket.io.msgpack.min.js +7 -0
- package/node_modules/socket.io-client/dist/socket.io.msgpack.min.js.map +1 -0
- package/node_modules/socket.io-client/package.json +101 -0
- package/node_modules/socket.io-parser/LICENSE +20 -0
- package/node_modules/socket.io-parser/Readme.md +81 -0
- package/node_modules/socket.io-parser/build/cjs/binary.d.ts +20 -0
- package/node_modules/socket.io-parser/build/cjs/binary.js +88 -0
- package/node_modules/socket.io-parser/build/cjs/index.d.ts +90 -0
- package/node_modules/socket.io-parser/build/cjs/index.js +321 -0
- package/node_modules/socket.io-parser/build/cjs/is-binary.d.ts +7 -0
- package/node_modules/socket.io-parser/build/cjs/is-binary.js +55 -0
- package/node_modules/socket.io-parser/build/cjs/package.json +3 -0
- package/node_modules/socket.io-parser/build/esm/binary.d.ts +20 -0
- package/node_modules/socket.io-parser/build/esm/binary.js +83 -0
- package/node_modules/socket.io-parser/build/esm/index.d.ts +90 -0
- package/node_modules/socket.io-parser/build/esm/index.js +311 -0
- package/node_modules/socket.io-parser/build/esm/is-binary.d.ts +7 -0
- package/node_modules/socket.io-parser/build/esm/is-binary.js +50 -0
- package/node_modules/socket.io-parser/build/esm/package.json +3 -0
- package/node_modules/socket.io-parser/build/esm-debug/binary.d.ts +20 -0
- package/node_modules/socket.io-parser/build/esm-debug/binary.js +83 -0
- package/node_modules/socket.io-parser/build/esm-debug/index.d.ts +90 -0
- package/node_modules/socket.io-parser/build/esm-debug/index.js +316 -0
- package/node_modules/socket.io-parser/build/esm-debug/is-binary.d.ts +7 -0
- package/node_modules/socket.io-parser/build/esm-debug/is-binary.js +50 -0
- package/node_modules/socket.io-parser/build/esm-debug/package.json +3 -0
- package/node_modules/socket.io-parser/package.json +58 -0
- package/node_modules/tr46/.npmignore +4 -0
- package/node_modules/tr46/index.js +193 -0
- package/node_modules/tr46/lib/.gitkeep +0 -0
- package/node_modules/tr46/lib/mappingTable.json +1 -0
- package/node_modules/tr46/package.json +31 -0
- package/node_modules/webidl-conversions/LICENSE.md +12 -0
- package/node_modules/webidl-conversions/README.md +53 -0
- package/node_modules/webidl-conversions/lib/index.js +189 -0
- package/node_modules/webidl-conversions/package.json +23 -0
- package/node_modules/whatwg-url/LICENSE.txt +21 -0
- package/node_modules/whatwg-url/README.md +67 -0
- package/node_modules/whatwg-url/lib/URL-impl.js +200 -0
- package/node_modules/whatwg-url/lib/URL.js +196 -0
- package/node_modules/whatwg-url/lib/public-api.js +11 -0
- package/node_modules/whatwg-url/lib/url-state-machine.js +1297 -0
- package/node_modules/whatwg-url/lib/utils.js +20 -0
- package/node_modules/whatwg-url/package.json +32 -0
- package/node_modules/ws/LICENSE +20 -0
- package/node_modules/ws/README.md +548 -0
- package/node_modules/ws/browser.js +8 -0
- package/node_modules/ws/index.js +13 -0
- package/node_modules/ws/lib/buffer-util.js +131 -0
- package/node_modules/ws/lib/constants.js +12 -0
- package/node_modules/ws/lib/event-target.js +292 -0
- package/node_modules/ws/lib/extension.js +203 -0
- package/node_modules/ws/lib/limiter.js +55 -0
- package/node_modules/ws/lib/permessage-deflate.js +514 -0
- package/node_modules/ws/lib/receiver.js +704 -0
- package/node_modules/ws/lib/sender.js +497 -0
- package/node_modules/ws/lib/stream.js +159 -0
- package/node_modules/ws/lib/subprotocol.js +62 -0
- package/node_modules/ws/lib/validation.js +130 -0
- package/node_modules/ws/lib/websocket-server.js +540 -0
- package/node_modules/ws/lib/websocket.js +1338 -0
- package/node_modules/ws/package.json +69 -0
- package/node_modules/ws/wrapper.mjs +8 -0
- package/node_modules/xmlhttprequest-ssl/LICENSE +22 -0
- package/node_modules/xmlhttprequest-ssl/README.md +67 -0
- package/node_modules/xmlhttprequest-ssl/lib/XMLHttpRequest.js +689 -0
- package/node_modules/xmlhttprequest-ssl/package.json +40 -0
- package/node_modules/zod/LICENSE +21 -0
- package/node_modules/zod/README.md +208 -0
- package/node_modules/zod/index.cjs +33 -0
- package/node_modules/zod/index.d.cts +4 -0
- package/node_modules/zod/index.d.ts +4 -0
- package/node_modules/zod/index.js +4 -0
- package/node_modules/zod/package.json +118 -0
- package/node_modules/zod/src/index.ts +4 -0
- package/node_modules/zod/src/v3/ZodError.ts +330 -0
- package/node_modules/zod/src/v3/benchmarks/datetime.ts +58 -0
- package/node_modules/zod/src/v3/benchmarks/discriminatedUnion.ts +80 -0
- package/node_modules/zod/src/v3/benchmarks/index.ts +59 -0
- package/node_modules/zod/src/v3/benchmarks/ipv4.ts +57 -0
- package/node_modules/zod/src/v3/benchmarks/object.ts +69 -0
- package/node_modules/zod/src/v3/benchmarks/primitives.ts +162 -0
- package/node_modules/zod/src/v3/benchmarks/realworld.ts +63 -0
- package/node_modules/zod/src/v3/benchmarks/string.ts +55 -0
- package/node_modules/zod/src/v3/benchmarks/union.ts +80 -0
- package/node_modules/zod/src/v3/errors.ts +13 -0
- package/node_modules/zod/src/v3/external.ts +6 -0
- package/node_modules/zod/src/v3/helpers/enumUtil.ts +17 -0
- package/node_modules/zod/src/v3/helpers/errorUtil.ts +8 -0
- package/node_modules/zod/src/v3/helpers/parseUtil.ts +176 -0
- package/node_modules/zod/src/v3/helpers/partialUtil.ts +34 -0
- package/node_modules/zod/src/v3/helpers/typeAliases.ts +2 -0
- package/node_modules/zod/src/v3/helpers/util.ts +224 -0
- package/node_modules/zod/src/v3/index.ts +4 -0
- package/node_modules/zod/src/v3/locales/en.ts +124 -0
- package/node_modules/zod/src/v3/standard-schema.ts +113 -0
- package/node_modules/zod/src/v3/tests/Mocker.ts +54 -0
- package/node_modules/zod/src/v3/tests/all-errors.test.ts +157 -0
- package/node_modules/zod/src/v3/tests/anyunknown.test.ts +28 -0
- package/node_modules/zod/src/v3/tests/array.test.ts +71 -0
- package/node_modules/zod/src/v3/tests/async-parsing.test.ts +388 -0
- package/node_modules/zod/src/v3/tests/async-refinements.test.ts +46 -0
- package/node_modules/zod/src/v3/tests/base.test.ts +29 -0
- package/node_modules/zod/src/v3/tests/bigint.test.ts +55 -0
- package/node_modules/zod/src/v3/tests/branded.test.ts +53 -0
- package/node_modules/zod/src/v3/tests/catch.test.ts +220 -0
- package/node_modules/zod/src/v3/tests/coerce.test.ts +133 -0
- package/node_modules/zod/src/v3/tests/complex.test.ts +56 -0
- package/node_modules/zod/src/v3/tests/custom.test.ts +31 -0
- package/node_modules/zod/src/v3/tests/date.test.ts +32 -0
- package/node_modules/zod/src/v3/tests/deepmasking.test.ts +186 -0
- package/node_modules/zod/src/v3/tests/default.test.ts +112 -0
- package/node_modules/zod/src/v3/tests/description.test.ts +33 -0
- package/node_modules/zod/src/v3/tests/discriminated-unions.test.ts +315 -0
- package/node_modules/zod/src/v3/tests/enum.test.ts +80 -0
- package/node_modules/zod/src/v3/tests/error.test.ts +551 -0
- package/node_modules/zod/src/v3/tests/firstparty.test.ts +87 -0
- package/node_modules/zod/src/v3/tests/firstpartyschematypes.test.ts +21 -0
- package/node_modules/zod/src/v3/tests/function.test.ts +257 -0
- package/node_modules/zod/src/v3/tests/generics.test.ts +48 -0
- package/node_modules/zod/src/v3/tests/instanceof.test.ts +37 -0
- package/node_modules/zod/src/v3/tests/intersection.test.ts +110 -0
- package/node_modules/zod/src/v3/tests/language-server.source.ts +76 -0
- package/node_modules/zod/src/v3/tests/language-server.test.ts +207 -0
- package/node_modules/zod/src/v3/tests/literal.test.ts +36 -0
- package/node_modules/zod/src/v3/tests/map.test.ts +110 -0
- package/node_modules/zod/src/v3/tests/masking.test.ts +4 -0
- package/node_modules/zod/src/v3/tests/mocker.test.ts +19 -0
- package/node_modules/zod/src/v3/tests/nan.test.ts +21 -0
- package/node_modules/zod/src/v3/tests/nativeEnum.test.ts +87 -0
- package/node_modules/zod/src/v3/tests/nullable.test.ts +42 -0
- package/node_modules/zod/src/v3/tests/number.test.ts +176 -0
- package/node_modules/zod/src/v3/tests/object-augmentation.test.ts +29 -0
- package/node_modules/zod/src/v3/tests/object-in-es5-env.test.ts +29 -0
- package/node_modules/zod/src/v3/tests/object.test.ts +434 -0
- package/node_modules/zod/src/v3/tests/optional.test.ts +42 -0
- package/node_modules/zod/src/v3/tests/parseUtil.test.ts +23 -0
- package/node_modules/zod/src/v3/tests/parser.test.ts +41 -0
- package/node_modules/zod/src/v3/tests/partials.test.ts +243 -0
- package/node_modules/zod/src/v3/tests/pickomit.test.ts +111 -0
- package/node_modules/zod/src/v3/tests/pipeline.test.ts +29 -0
- package/node_modules/zod/src/v3/tests/preprocess.test.ts +186 -0
- package/node_modules/zod/src/v3/tests/primitive.test.ts +440 -0
- package/node_modules/zod/src/v3/tests/promise.test.ts +90 -0
- package/node_modules/zod/src/v3/tests/readonly.test.ts +194 -0
- package/node_modules/zod/src/v3/tests/record.test.ts +171 -0
- package/node_modules/zod/src/v3/tests/recursive.test.ts +197 -0
- package/node_modules/zod/src/v3/tests/refine.test.ts +313 -0
- package/node_modules/zod/src/v3/tests/safeparse.test.ts +27 -0
- package/node_modules/zod/src/v3/tests/set.test.ts +142 -0
- package/node_modules/zod/src/v3/tests/standard-schema.test.ts +83 -0
- package/node_modules/zod/src/v3/tests/string.test.ts +916 -0
- package/node_modules/zod/src/v3/tests/transformer.test.ts +233 -0
- package/node_modules/zod/src/v3/tests/tuple.test.ts +90 -0
- package/node_modules/zod/src/v3/tests/unions.test.ts +57 -0
- package/node_modules/zod/src/v3/tests/validations.test.ts +133 -0
- package/node_modules/zod/src/v3/tests/void.test.ts +15 -0
- package/node_modules/zod/src/v3/types.ts +5136 -0
- package/node_modules/zod/src/v4/classic/checks.ts +30 -0
- package/node_modules/zod/src/v4/classic/coerce.ts +27 -0
- package/node_modules/zod/src/v4/classic/compat.ts +66 -0
- package/node_modules/zod/src/v4/classic/errors.ts +75 -0
- package/node_modules/zod/src/v4/classic/external.ts +50 -0
- package/node_modules/zod/src/v4/classic/index.ts +5 -0
- package/node_modules/zod/src/v4/classic/iso.ts +90 -0
- package/node_modules/zod/src/v4/classic/parse.ts +33 -0
- package/node_modules/zod/src/v4/classic/schemas.ts +2054 -0
- package/node_modules/zod/src/v4/classic/tests/anyunknown.test.ts +26 -0
- package/node_modules/zod/src/v4/classic/tests/array.test.ts +264 -0
- package/node_modules/zod/src/v4/classic/tests/assignability.test.ts +210 -0
- package/node_modules/zod/src/v4/classic/tests/async-parsing.test.ts +381 -0
- package/node_modules/zod/src/v4/classic/tests/async-refinements.test.ts +68 -0
- package/node_modules/zod/src/v4/classic/tests/base.test.ts +7 -0
- package/node_modules/zod/src/v4/classic/tests/bigint.test.ts +54 -0
- package/node_modules/zod/src/v4/classic/tests/brand.test.ts +63 -0
- package/node_modules/zod/src/v4/classic/tests/catch.test.ts +252 -0
- package/node_modules/zod/src/v4/classic/tests/coalesce.test.ts +20 -0
- package/node_modules/zod/src/v4/classic/tests/coerce.test.ts +160 -0
- package/node_modules/zod/src/v4/classic/tests/continuability.test.ts +352 -0
- package/node_modules/zod/src/v4/classic/tests/custom.test.ts +40 -0
- package/node_modules/zod/src/v4/classic/tests/date.test.ts +31 -0
- package/node_modules/zod/src/v4/classic/tests/datetime.test.ts +296 -0
- package/node_modules/zod/src/v4/classic/tests/default.test.ts +313 -0
- package/node_modules/zod/src/v4/classic/tests/description.test.ts +32 -0
- package/node_modules/zod/src/v4/classic/tests/discriminated-unions.test.ts +619 -0
- package/node_modules/zod/src/v4/classic/tests/enum.test.ts +285 -0
- package/node_modules/zod/src/v4/classic/tests/error-utils.test.ts +527 -0
- package/node_modules/zod/src/v4/classic/tests/error.test.ts +711 -0
- package/node_modules/zod/src/v4/classic/tests/file.test.ts +91 -0
- package/node_modules/zod/src/v4/classic/tests/firstparty.test.ts +175 -0
- package/node_modules/zod/src/v4/classic/tests/function.test.ts +268 -0
- package/node_modules/zod/src/v4/classic/tests/generics.test.ts +72 -0
- package/node_modules/zod/src/v4/classic/tests/index.test.ts +829 -0
- package/node_modules/zod/src/v4/classic/tests/instanceof.test.ts +34 -0
- package/node_modules/zod/src/v4/classic/tests/intersection.test.ts +171 -0
- package/node_modules/zod/src/v4/classic/tests/json.test.ts +108 -0
- package/node_modules/zod/src/v4/classic/tests/lazy.test.ts +227 -0
- package/node_modules/zod/src/v4/classic/tests/literal.test.ts +92 -0
- package/node_modules/zod/src/v4/classic/tests/map.test.ts +196 -0
- package/node_modules/zod/src/v4/classic/tests/nan.test.ts +21 -0
- package/node_modules/zod/src/v4/classic/tests/nested-refine.test.ts +168 -0
- package/node_modules/zod/src/v4/classic/tests/nonoptional.test.ts +86 -0
- package/node_modules/zod/src/v4/classic/tests/nullable.test.ts +22 -0
- package/node_modules/zod/src/v4/classic/tests/number.test.ts +247 -0
- package/node_modules/zod/src/v4/classic/tests/object.test.ts +563 -0
- package/node_modules/zod/src/v4/classic/tests/optional.test.ts +123 -0
- package/node_modules/zod/src/v4/classic/tests/partial.test.ts +147 -0
- package/node_modules/zod/src/v4/classic/tests/pickomit.test.ts +127 -0
- package/node_modules/zod/src/v4/classic/tests/pipe.test.ts +81 -0
- package/node_modules/zod/src/v4/classic/tests/prefault.test.ts +37 -0
- package/node_modules/zod/src/v4/classic/tests/preprocess.test.ts +298 -0
- package/node_modules/zod/src/v4/classic/tests/primitive.test.ts +175 -0
- package/node_modules/zod/src/v4/classic/tests/promise.test.ts +81 -0
- package/node_modules/zod/src/v4/classic/tests/prototypes.test.ts +23 -0
- package/node_modules/zod/src/v4/classic/tests/readonly.test.ts +252 -0
- package/node_modules/zod/src/v4/classic/tests/record.test.ts +342 -0
- package/node_modules/zod/src/v4/classic/tests/recursive-types.test.ts +356 -0
- package/node_modules/zod/src/v4/classic/tests/refine.test.ts +532 -0
- package/node_modules/zod/src/v4/classic/tests/registries.test.ts +204 -0
- package/node_modules/zod/src/v4/classic/tests/set.test.ts +179 -0
- package/node_modules/zod/src/v4/classic/tests/standard-schema.test.ts +57 -0
- package/node_modules/zod/src/v4/classic/tests/string-formats.test.ts +109 -0
- package/node_modules/zod/src/v4/classic/tests/string.test.ts +881 -0
- package/node_modules/zod/src/v4/classic/tests/stringbool.test.ts +66 -0
- package/node_modules/zod/src/v4/classic/tests/template-literal.test.ts +758 -0
- package/node_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +2314 -0
- package/node_modules/zod/src/v4/classic/tests/transform.test.ts +250 -0
- package/node_modules/zod/src/v4/classic/tests/tuple.test.ts +163 -0
- package/node_modules/zod/src/v4/classic/tests/union.test.ts +94 -0
- package/node_modules/zod/src/v4/classic/tests/validations.test.ts +283 -0
- package/node_modules/zod/src/v4/classic/tests/void.test.ts +12 -0
- package/node_modules/zod/src/v4/core/api.ts +1594 -0
- package/node_modules/zod/src/v4/core/checks.ts +1283 -0
- package/node_modules/zod/src/v4/core/config.ts +15 -0
- package/node_modules/zod/src/v4/core/core.ts +134 -0
- package/node_modules/zod/src/v4/core/doc.ts +44 -0
- package/node_modules/zod/src/v4/core/errors.ts +424 -0
- package/node_modules/zod/src/v4/core/function.ts +176 -0
- package/node_modules/zod/src/v4/core/index.ts +15 -0
- package/node_modules/zod/src/v4/core/json-schema.ts +143 -0
- package/node_modules/zod/src/v4/core/parse.ts +94 -0
- package/node_modules/zod/src/v4/core/regexes.ts +135 -0
- package/node_modules/zod/src/v4/core/registries.ts +96 -0
- package/node_modules/zod/src/v4/core/schemas.ts +3842 -0
- package/node_modules/zod/src/v4/core/standard-schema.ts +64 -0
- package/node_modules/zod/src/v4/core/tests/index.test.ts +46 -0
- package/node_modules/zod/src/v4/core/tests/locales/be.test.ts +124 -0
- package/node_modules/zod/src/v4/core/tests/locales/en.test.ts +22 -0
- package/node_modules/zod/src/v4/core/tests/locales/ru.test.ts +128 -0
- package/node_modules/zod/src/v4/core/tests/locales/tr.test.ts +69 -0
- package/node_modules/zod/src/v4/core/to-json-schema.ts +977 -0
- package/node_modules/zod/src/v4/core/util.ts +775 -0
- package/node_modules/zod/src/v4/core/versions.ts +5 -0
- package/node_modules/zod/src/v4/core/zsf.ts +323 -0
- package/node_modules/zod/src/v4/index.ts +4 -0
- package/node_modules/zod/src/v4/locales/ar.ts +125 -0
- package/node_modules/zod/src/v4/locales/az.ts +121 -0
- package/node_modules/zod/src/v4/locales/be.ts +184 -0
- package/node_modules/zod/src/v4/locales/ca.ts +127 -0
- package/node_modules/zod/src/v4/locales/cs.ts +142 -0
- package/node_modules/zod/src/v4/locales/de.ts +124 -0
- package/node_modules/zod/src/v4/locales/en.ts +127 -0
- package/node_modules/zod/src/v4/locales/eo.ts +125 -0
- package/node_modules/zod/src/v4/locales/es.ts +125 -0
- package/node_modules/zod/src/v4/locales/fa.ts +134 -0
- package/node_modules/zod/src/v4/locales/fi.ts +131 -0
- package/node_modules/zod/src/v4/locales/fr-CA.ts +126 -0
- package/node_modules/zod/src/v4/locales/fr.ts +124 -0
- package/node_modules/zod/src/v4/locales/he.ts +125 -0
- package/node_modules/zod/src/v4/locales/hu.ts +126 -0
- package/node_modules/zod/src/v4/locales/id.ts +125 -0
- package/node_modules/zod/src/v4/locales/index.ts +39 -0
- package/node_modules/zod/src/v4/locales/it.ts +125 -0
- package/node_modules/zod/src/v4/locales/ja.ts +122 -0
- package/node_modules/zod/src/v4/locales/kh.ts +126 -0
- package/node_modules/zod/src/v4/locales/ko.ts +131 -0
- package/node_modules/zod/src/v4/locales/mk.ts +127 -0
- package/node_modules/zod/src/v4/locales/ms.ts +124 -0
- package/node_modules/zod/src/v4/locales/nl.ts +126 -0
- package/node_modules/zod/src/v4/locales/no.ts +124 -0
- package/node_modules/zod/src/v4/locales/ota.ts +125 -0
- package/node_modules/zod/src/v4/locales/pl.ts +126 -0
- package/node_modules/zod/src/v4/locales/ps.ts +133 -0
- package/node_modules/zod/src/v4/locales/pt.ts +123 -0
- package/node_modules/zod/src/v4/locales/ru.ts +184 -0
- package/node_modules/zod/src/v4/locales/sl.ts +126 -0
- package/node_modules/zod/src/v4/locales/sv.ts +127 -0
- package/node_modules/zod/src/v4/locales/ta.ts +125 -0
- package/node_modules/zod/src/v4/locales/th.ts +126 -0
- package/node_modules/zod/src/v4/locales/tr.ts +121 -0
- package/node_modules/zod/src/v4/locales/ua.ts +126 -0
- package/node_modules/zod/src/v4/locales/ur.ts +126 -0
- package/node_modules/zod/src/v4/locales/vi.ts +125 -0
- package/node_modules/zod/src/v4/locales/zh-CN.ts +123 -0
- package/node_modules/zod/src/v4/locales/zh-TW.ts +125 -0
- package/node_modules/zod/src/v4/mini/checks.ts +32 -0
- package/node_modules/zod/src/v4/mini/coerce.ts +22 -0
- package/node_modules/zod/src/v4/mini/external.ts +40 -0
- package/node_modules/zod/src/v4/mini/index.ts +3 -0
- package/node_modules/zod/src/v4/mini/iso.ts +62 -0
- package/node_modules/zod/src/v4/mini/parse.ts +1 -0
- package/node_modules/zod/src/v4/mini/schemas.ts +1579 -0
- package/node_modules/zod/src/v4/mini/tests/assignability.test.ts +129 -0
- package/node_modules/zod/src/v4/mini/tests/brand.test.ts +51 -0
- package/node_modules/zod/src/v4/mini/tests/checks.test.ts +144 -0
- package/node_modules/zod/src/v4/mini/tests/computed.test.ts +36 -0
- package/node_modules/zod/src/v4/mini/tests/error.test.ts +22 -0
- package/node_modules/zod/src/v4/mini/tests/functions.test.ts +43 -0
- package/node_modules/zod/src/v4/mini/tests/index.test.ts +871 -0
- package/node_modules/zod/src/v4/mini/tests/number.test.ts +95 -0
- package/node_modules/zod/src/v4/mini/tests/object.test.ts +185 -0
- package/node_modules/zod/src/v4/mini/tests/prototypes.test.ts +43 -0
- package/node_modules/zod/src/v4/mini/tests/recursive-types.test.ts +275 -0
- package/node_modules/zod/src/v4/mini/tests/string.test.ts +299 -0
- package/node_modules/zod/src/v4-mini/index.ts +1 -0
- package/node_modules/zod/v3/ZodError.cjs +138 -0
- package/node_modules/zod/v3/ZodError.d.cts +164 -0
- package/node_modules/zod/v3/ZodError.d.ts +164 -0
- package/node_modules/zod/v3/ZodError.js +133 -0
- package/node_modules/zod/v3/errors.cjs +17 -0
- package/node_modules/zod/v3/errors.d.cts +5 -0
- package/node_modules/zod/v3/errors.d.ts +5 -0
- package/node_modules/zod/v3/errors.js +9 -0
- package/node_modules/zod/v3/external.cjs +22 -0
- package/node_modules/zod/v3/external.d.cts +6 -0
- package/node_modules/zod/v3/external.d.ts +6 -0
- package/node_modules/zod/v3/external.js +6 -0
- package/node_modules/zod/v3/helpers/enumUtil.cjs +2 -0
- package/node_modules/zod/v3/helpers/enumUtil.d.cts +8 -0
- package/node_modules/zod/v3/helpers/enumUtil.d.ts +8 -0
- package/node_modules/zod/v3/helpers/enumUtil.js +1 -0
- package/node_modules/zod/v3/helpers/errorUtil.cjs +9 -0
- package/node_modules/zod/v3/helpers/errorUtil.d.cts +9 -0
- package/node_modules/zod/v3/helpers/errorUtil.d.ts +9 -0
- package/node_modules/zod/v3/helpers/errorUtil.js +6 -0
- package/node_modules/zod/v3/helpers/parseUtil.cjs +124 -0
- package/node_modules/zod/v3/helpers/parseUtil.d.cts +78 -0
- package/node_modules/zod/v3/helpers/parseUtil.d.ts +78 -0
- package/node_modules/zod/v3/helpers/parseUtil.js +109 -0
- package/node_modules/zod/v3/helpers/partialUtil.cjs +2 -0
- package/node_modules/zod/v3/helpers/partialUtil.d.cts +8 -0
- package/node_modules/zod/v3/helpers/partialUtil.d.ts +8 -0
- package/node_modules/zod/v3/helpers/partialUtil.js +1 -0
- package/node_modules/zod/v3/helpers/typeAliases.cjs +2 -0
- package/node_modules/zod/v3/helpers/typeAliases.d.cts +2 -0
- package/node_modules/zod/v3/helpers/typeAliases.d.ts +2 -0
- package/node_modules/zod/v3/helpers/typeAliases.js +1 -0
- package/node_modules/zod/v3/helpers/util.cjs +137 -0
- package/node_modules/zod/v3/helpers/util.d.cts +85 -0
- package/node_modules/zod/v3/helpers/util.d.ts +85 -0
- package/node_modules/zod/v3/helpers/util.js +133 -0
- package/node_modules/zod/v3/index.cjs +33 -0
- package/node_modules/zod/v3/index.d.cts +4 -0
- package/node_modules/zod/v3/index.d.ts +4 -0
- package/node_modules/zod/v3/index.js +4 -0
- package/node_modules/zod/v3/locales/en.cjs +111 -0
- package/node_modules/zod/v3/locales/en.d.cts +3 -0
- package/node_modules/zod/v3/locales/en.d.ts +3 -0
- package/node_modules/zod/v3/locales/en.js +109 -0
- package/node_modules/zod/v3/standard-schema.cjs +2 -0
- package/node_modules/zod/v3/standard-schema.d.cts +102 -0
- package/node_modules/zod/v3/standard-schema.d.ts +102 -0
- package/node_modules/zod/v3/standard-schema.js +1 -0
- package/node_modules/zod/v3/types.cjs +3775 -0
- package/node_modules/zod/v3/types.d.cts +1031 -0
- package/node_modules/zod/v3/types.d.ts +1031 -0
- package/node_modules/zod/v3/types.js +3693 -0
- package/node_modules/zod/v4/classic/checks.cjs +32 -0
- package/node_modules/zod/v4/classic/checks.d.cts +1 -0
- package/node_modules/zod/v4/classic/checks.d.ts +1 -0
- package/node_modules/zod/v4/classic/checks.js +1 -0
- package/node_modules/zod/v4/classic/coerce.cjs +47 -0
- package/node_modules/zod/v4/classic/coerce.d.cts +17 -0
- package/node_modules/zod/v4/classic/coerce.d.ts +17 -0
- package/node_modules/zod/v4/classic/coerce.js +17 -0
- package/node_modules/zod/v4/classic/compat.cjs +57 -0
- package/node_modules/zod/v4/classic/compat.d.cts +46 -0
- package/node_modules/zod/v4/classic/compat.d.ts +46 -0
- package/node_modules/zod/v4/classic/compat.js +27 -0
- package/node_modules/zod/v4/classic/errors.cjs +67 -0
- package/node_modules/zod/v4/classic/errors.d.cts +30 -0
- package/node_modules/zod/v4/classic/errors.d.ts +30 -0
- package/node_modules/zod/v4/classic/errors.js +41 -0
- package/node_modules/zod/v4/classic/external.cjs +70 -0
- package/node_modules/zod/v4/classic/external.d.cts +13 -0
- package/node_modules/zod/v4/classic/external.d.ts +13 -0
- package/node_modules/zod/v4/classic/external.js +18 -0
- package/node_modules/zod/v4/classic/index.cjs +33 -0
- package/node_modules/zod/v4/classic/index.d.cts +4 -0
- package/node_modules/zod/v4/classic/index.d.ts +4 -0
- package/node_modules/zod/v4/classic/index.js +4 -0
- package/node_modules/zod/v4/classic/iso.cjs +60 -0
- package/node_modules/zod/v4/classic/iso.d.cts +22 -0
- package/node_modules/zod/v4/classic/iso.d.ts +22 -0
- package/node_modules/zod/v4/classic/iso.js +30 -0
- package/node_modules/zod/v4/classic/parse.cjs +32 -0
- package/node_modules/zod/v4/classic/parse.d.cts +23 -0
- package/node_modules/zod/v4/classic/parse.d.ts +23 -0
- package/node_modules/zod/v4/classic/parse.js +6 -0
- package/node_modules/zod/v4/classic/schemas.cjs +1109 -0
- package/node_modules/zod/v4/classic/schemas.d.cts +630 -0
- package/node_modules/zod/v4/classic/schemas.d.ts +630 -0
- package/node_modules/zod/v4/classic/schemas.js +1006 -0
- package/node_modules/zod/v4/core/api.cjs +1039 -0
- package/node_modules/zod/v4/core/api.d.cts +284 -0
- package/node_modules/zod/v4/core/api.d.ts +284 -0
- package/node_modules/zod/v4/core/api.js +906 -0
- package/node_modules/zod/v4/core/checks.cjs +591 -0
- package/node_modules/zod/v4/core/checks.d.cts +278 -0
- package/node_modules/zod/v4/core/checks.d.ts +278 -0
- package/node_modules/zod/v4/core/checks.js +565 -0
- package/node_modules/zod/v4/core/core.cjs +67 -0
- package/node_modules/zod/v4/core/core.d.cts +49 -0
- package/node_modules/zod/v4/core/core.d.ts +49 -0
- package/node_modules/zod/v4/core/core.js +61 -0
- package/node_modules/zod/v4/core/doc.cjs +39 -0
- package/node_modules/zod/v4/core/doc.d.cts +14 -0
- package/node_modules/zod/v4/core/doc.d.ts +14 -0
- package/node_modules/zod/v4/core/doc.js +35 -0
- package/node_modules/zod/v4/core/errors.cjs +226 -0
- package/node_modules/zod/v4/core/errors.d.cts +208 -0
- package/node_modules/zod/v4/core/errors.d.ts +208 -0
- package/node_modules/zod/v4/core/errors.js +195 -0
- package/node_modules/zod/v4/core/function.cjs +102 -0
- package/node_modules/zod/v4/core/function.d.cts +52 -0
- package/node_modules/zod/v4/core/function.d.ts +52 -0
- package/node_modules/zod/v4/core/function.js +75 -0
- package/node_modules/zod/v4/core/index.cjs +44 -0
- package/node_modules/zod/v4/core/index.d.cts +15 -0
- package/node_modules/zod/v4/core/index.d.ts +15 -0
- package/node_modules/zod/v4/core/index.js +15 -0
- package/node_modules/zod/v4/core/json-schema.cjs +2 -0
- package/node_modules/zod/v4/core/json-schema.d.cts +87 -0
- package/node_modules/zod/v4/core/json-schema.d.ts +87 -0
- package/node_modules/zod/v4/core/json-schema.js +1 -0
- package/node_modules/zod/v4/core/parse.cjs +87 -0
- package/node_modules/zod/v4/core/parse.d.cts +25 -0
- package/node_modules/zod/v4/core/parse.d.ts +25 -0
- package/node_modules/zod/v4/core/parse.js +57 -0
- package/node_modules/zod/v4/core/regexes.cjs +103 -0
- package/node_modules/zod/v4/core/regexes.d.cts +62 -0
- package/node_modules/zod/v4/core/regexes.d.ts +62 -0
- package/node_modules/zod/v4/core/regexes.js +95 -0
- package/node_modules/zod/v4/core/registries.cjs +56 -0
- package/node_modules/zod/v4/core/registries.d.cts +35 -0
- package/node_modules/zod/v4/core/registries.d.ts +35 -0
- package/node_modules/zod/v4/core/registries.js +51 -0
- package/node_modules/zod/v4/core/schemas.cjs +1748 -0
- package/node_modules/zod/v4/core/schemas.d.cts +1041 -0
- package/node_modules/zod/v4/core/schemas.d.ts +1041 -0
- package/node_modules/zod/v4/core/schemas.js +1717 -0
- package/node_modules/zod/v4/core/standard-schema.cjs +2 -0
- package/node_modules/zod/v4/core/standard-schema.d.cts +55 -0
- package/node_modules/zod/v4/core/standard-schema.d.ts +55 -0
- package/node_modules/zod/v4/core/standard-schema.js +1 -0
- package/node_modules/zod/v4/core/to-json-schema.cjs +854 -0
- package/node_modules/zod/v4/core/to-json-schema.d.cts +88 -0
- package/node_modules/zod/v4/core/to-json-schema.d.ts +88 -0
- package/node_modules/zod/v4/core/to-json-schema.js +849 -0
- package/node_modules/zod/v4/core/util.cjs +539 -0
- package/node_modules/zod/v4/core/util.d.cts +183 -0
- package/node_modules/zod/v4/core/util.d.ts +183 -0
- package/node_modules/zod/v4/core/util.js +493 -0
- package/node_modules/zod/v4/core/versions.cjs +8 -0
- package/node_modules/zod/v4/core/versions.d.cts +5 -0
- package/node_modules/zod/v4/core/versions.d.ts +5 -0
- package/node_modules/zod/v4/core/versions.js +5 -0
- package/node_modules/zod/v4/index.cjs +22 -0
- package/node_modules/zod/v4/index.d.cts +3 -0
- package/node_modules/zod/v4/index.d.ts +3 -0
- package/node_modules/zod/v4/index.js +3 -0
- package/node_modules/zod/v4/locales/ar.cjs +142 -0
- package/node_modules/zod/v4/locales/ar.d.cts +4 -0
- package/node_modules/zod/v4/locales/ar.d.ts +4 -0
- package/node_modules/zod/v4/locales/ar.js +116 -0
- package/node_modules/zod/v4/locales/az.cjs +141 -0
- package/node_modules/zod/v4/locales/az.d.cts +4 -0
- package/node_modules/zod/v4/locales/az.d.ts +4 -0
- package/node_modules/zod/v4/locales/az.js +115 -0
- package/node_modules/zod/v4/locales/be.cjs +190 -0
- package/node_modules/zod/v4/locales/be.d.cts +4 -0
- package/node_modules/zod/v4/locales/be.d.ts +4 -0
- package/node_modules/zod/v4/locales/be.js +164 -0
- package/node_modules/zod/v4/locales/ca.cjs +144 -0
- package/node_modules/zod/v4/locales/ca.d.cts +4 -0
- package/node_modules/zod/v4/locales/ca.d.ts +4 -0
- package/node_modules/zod/v4/locales/ca.js +118 -0
- package/node_modules/zod/v4/locales/cs.cjs +161 -0
- package/node_modules/zod/v4/locales/cs.d.cts +4 -0
- package/node_modules/zod/v4/locales/cs.d.ts +4 -0
- package/node_modules/zod/v4/locales/cs.js +135 -0
- package/node_modules/zod/v4/locales/de.cjs +142 -0
- package/node_modules/zod/v4/locales/de.d.cts +4 -0
- package/node_modules/zod/v4/locales/de.d.ts +4 -0
- package/node_modules/zod/v4/locales/de.js +116 -0
- package/node_modules/zod/v4/locales/en.cjs +145 -0
- package/node_modules/zod/v4/locales/en.d.cts +5 -0
- package/node_modules/zod/v4/locales/en.d.ts +5 -0
- package/node_modules/zod/v4/locales/en.js +117 -0
- package/node_modules/zod/v4/locales/eo.cjs +144 -0
- package/node_modules/zod/v4/locales/eo.d.cts +5 -0
- package/node_modules/zod/v4/locales/eo.d.ts +5 -0
- package/node_modules/zod/v4/locales/eo.js +116 -0
- package/node_modules/zod/v4/locales/es.cjs +143 -0
- package/node_modules/zod/v4/locales/es.d.cts +4 -0
- package/node_modules/zod/v4/locales/es.d.ts +4 -0
- package/node_modules/zod/v4/locales/es.js +117 -0
- package/node_modules/zod/v4/locales/fa.cjs +148 -0
- package/node_modules/zod/v4/locales/fa.d.cts +4 -0
- package/node_modules/zod/v4/locales/fa.d.ts +4 -0
- package/node_modules/zod/v4/locales/fa.js +122 -0
- package/node_modules/zod/v4/locales/fi.cjs +148 -0
- package/node_modules/zod/v4/locales/fi.d.cts +4 -0
- package/node_modules/zod/v4/locales/fi.d.ts +4 -0
- package/node_modules/zod/v4/locales/fi.js +122 -0
- package/node_modules/zod/v4/locales/fr-CA.cjs +143 -0
- package/node_modules/zod/v4/locales/fr-CA.d.cts +4 -0
- package/node_modules/zod/v4/locales/fr-CA.d.ts +4 -0
- package/node_modules/zod/v4/locales/fr-CA.js +117 -0
- package/node_modules/zod/v4/locales/fr.cjs +142 -0
- package/node_modules/zod/v4/locales/fr.d.cts +4 -0
- package/node_modules/zod/v4/locales/fr.d.ts +4 -0
- package/node_modules/zod/v4/locales/fr.js +116 -0
- package/node_modules/zod/v4/locales/he.cjs +143 -0
- package/node_modules/zod/v4/locales/he.d.cts +4 -0
- package/node_modules/zod/v4/locales/he.d.ts +4 -0
- package/node_modules/zod/v4/locales/he.js +117 -0
- package/node_modules/zod/v4/locales/hu.cjs +143 -0
- package/node_modules/zod/v4/locales/hu.d.cts +4 -0
- package/node_modules/zod/v4/locales/hu.d.ts +4 -0
- package/node_modules/zod/v4/locales/hu.js +117 -0
- package/node_modules/zod/v4/locales/id.cjs +142 -0
- package/node_modules/zod/v4/locales/id.d.cts +4 -0
- package/node_modules/zod/v4/locales/id.d.ts +4 -0
- package/node_modules/zod/v4/locales/id.js +116 -0
- package/node_modules/zod/v4/locales/index.cjs +84 -0
- package/node_modules/zod/v4/locales/index.d.cts +39 -0
- package/node_modules/zod/v4/locales/index.d.ts +39 -0
- package/node_modules/zod/v4/locales/index.js +39 -0
- package/node_modules/zod/v4/locales/it.cjs +143 -0
- package/node_modules/zod/v4/locales/it.d.cts +4 -0
- package/node_modules/zod/v4/locales/it.d.ts +4 -0
- package/node_modules/zod/v4/locales/it.js +117 -0
- package/node_modules/zod/v4/locales/ja.cjs +141 -0
- package/node_modules/zod/v4/locales/ja.d.cts +4 -0
- package/node_modules/zod/v4/locales/ja.d.ts +4 -0
- package/node_modules/zod/v4/locales/ja.js +115 -0
- package/node_modules/zod/v4/locales/kh.cjs +143 -0
- package/node_modules/zod/v4/locales/kh.d.cts +4 -0
- package/node_modules/zod/v4/locales/kh.d.ts +4 -0
- package/node_modules/zod/v4/locales/kh.js +117 -0
- package/node_modules/zod/v4/locales/ko.cjs +147 -0
- package/node_modules/zod/v4/locales/ko.d.cts +4 -0
- package/node_modules/zod/v4/locales/ko.d.ts +4 -0
- package/node_modules/zod/v4/locales/ko.js +121 -0
- package/node_modules/zod/v4/locales/mk.cjs +144 -0
- package/node_modules/zod/v4/locales/mk.d.cts +4 -0
- package/node_modules/zod/v4/locales/mk.d.ts +4 -0
- package/node_modules/zod/v4/locales/mk.js +118 -0
- package/node_modules/zod/v4/locales/ms.cjs +142 -0
- package/node_modules/zod/v4/locales/ms.d.cts +4 -0
- package/node_modules/zod/v4/locales/ms.d.ts +4 -0
- package/node_modules/zod/v4/locales/ms.js +116 -0
- package/node_modules/zod/v4/locales/nl.cjs +143 -0
- package/node_modules/zod/v4/locales/nl.d.cts +4 -0
- package/node_modules/zod/v4/locales/nl.d.ts +4 -0
- package/node_modules/zod/v4/locales/nl.js +117 -0
- package/node_modules/zod/v4/locales/no.cjs +142 -0
- package/node_modules/zod/v4/locales/no.d.cts +4 -0
- package/node_modules/zod/v4/locales/no.d.ts +4 -0
- package/node_modules/zod/v4/locales/no.js +116 -0
- package/node_modules/zod/v4/locales/ota.cjs +143 -0
- package/node_modules/zod/v4/locales/ota.d.cts +4 -0
- package/node_modules/zod/v4/locales/ota.d.ts +4 -0
- package/node_modules/zod/v4/locales/ota.js +117 -0
- package/node_modules/zod/v4/locales/pl.cjs +143 -0
- package/node_modules/zod/v4/locales/pl.d.cts +4 -0
- package/node_modules/zod/v4/locales/pl.d.ts +4 -0
- package/node_modules/zod/v4/locales/pl.js +117 -0
- package/node_modules/zod/v4/locales/ps.cjs +148 -0
- package/node_modules/zod/v4/locales/ps.d.cts +4 -0
- package/node_modules/zod/v4/locales/ps.d.ts +4 -0
- package/node_modules/zod/v4/locales/ps.js +122 -0
- package/node_modules/zod/v4/locales/pt.cjs +142 -0
- package/node_modules/zod/v4/locales/pt.d.cts +4 -0
- package/node_modules/zod/v4/locales/pt.d.ts +4 -0
- package/node_modules/zod/v4/locales/pt.js +116 -0
- package/node_modules/zod/v4/locales/ru.cjs +190 -0
- package/node_modules/zod/v4/locales/ru.d.cts +4 -0
- package/node_modules/zod/v4/locales/ru.d.ts +4 -0
- package/node_modules/zod/v4/locales/ru.js +164 -0
- package/node_modules/zod/v4/locales/sl.cjs +143 -0
- package/node_modules/zod/v4/locales/sl.d.cts +4 -0
- package/node_modules/zod/v4/locales/sl.d.ts +4 -0
- package/node_modules/zod/v4/locales/sl.js +117 -0
- package/node_modules/zod/v4/locales/sv.cjs +144 -0
- package/node_modules/zod/v4/locales/sv.d.cts +4 -0
- package/node_modules/zod/v4/locales/sv.d.ts +4 -0
- package/node_modules/zod/v4/locales/sv.js +118 -0
- package/node_modules/zod/v4/locales/ta.cjs +143 -0
- package/node_modules/zod/v4/locales/ta.d.cts +4 -0
- package/node_modules/zod/v4/locales/ta.d.ts +4 -0
- package/node_modules/zod/v4/locales/ta.js +117 -0
- package/node_modules/zod/v4/locales/th.cjs +143 -0
- package/node_modules/zod/v4/locales/th.d.cts +4 -0
- package/node_modules/zod/v4/locales/th.d.ts +4 -0
- package/node_modules/zod/v4/locales/th.js +117 -0
- package/node_modules/zod/v4/locales/tr.cjs +143 -0
- package/node_modules/zod/v4/locales/tr.d.cts +5 -0
- package/node_modules/zod/v4/locales/tr.d.ts +5 -0
- package/node_modules/zod/v4/locales/tr.js +115 -0
- package/node_modules/zod/v4/locales/ua.cjs +143 -0
- package/node_modules/zod/v4/locales/ua.d.cts +4 -0
- package/node_modules/zod/v4/locales/ua.d.ts +4 -0
- package/node_modules/zod/v4/locales/ua.js +117 -0
- package/node_modules/zod/v4/locales/ur.cjs +143 -0
- package/node_modules/zod/v4/locales/ur.d.cts +4 -0
- package/node_modules/zod/v4/locales/ur.d.ts +4 -0
- package/node_modules/zod/v4/locales/ur.js +117 -0
- package/node_modules/zod/v4/locales/vi.cjs +142 -0
- package/node_modules/zod/v4/locales/vi.d.cts +4 -0
- package/node_modules/zod/v4/locales/vi.d.ts +4 -0
- package/node_modules/zod/v4/locales/vi.js +116 -0
- package/node_modules/zod/v4/locales/zh-CN.cjs +142 -0
- package/node_modules/zod/v4/locales/zh-CN.d.cts +4 -0
- package/node_modules/zod/v4/locales/zh-CN.d.ts +4 -0
- package/node_modules/zod/v4/locales/zh-CN.js +116 -0
- package/node_modules/zod/v4/locales/zh-TW.cjs +143 -0
- package/node_modules/zod/v4/locales/zh-TW.d.cts +4 -0
- package/node_modules/zod/v4/locales/zh-TW.d.ts +4 -0
- package/node_modules/zod/v4/locales/zh-TW.js +117 -0
- package/node_modules/zod/v4/mini/checks.cjs +34 -0
- package/node_modules/zod/v4/mini/checks.d.cts +1 -0
- package/node_modules/zod/v4/mini/checks.d.ts +1 -0
- package/node_modules/zod/v4/mini/checks.js +1 -0
- package/node_modules/zod/v4/mini/coerce.cjs +47 -0
- package/node_modules/zod/v4/mini/coerce.d.cts +7 -0
- package/node_modules/zod/v4/mini/coerce.d.ts +7 -0
- package/node_modules/zod/v4/mini/coerce.js +17 -0
- package/node_modules/zod/v4/mini/external.cjs +62 -0
- package/node_modules/zod/v4/mini/external.d.cts +11 -0
- package/node_modules/zod/v4/mini/external.d.ts +11 -0
- package/node_modules/zod/v4/mini/external.js +13 -0
- package/node_modules/zod/v4/mini/index.cjs +32 -0
- package/node_modules/zod/v4/mini/index.d.cts +3 -0
- package/node_modules/zod/v4/mini/index.d.ts +3 -0
- package/node_modules/zod/v4/mini/index.js +3 -0
- package/node_modules/zod/v4/mini/iso.cjs +60 -0
- package/node_modules/zod/v4/mini/iso.d.cts +22 -0
- package/node_modules/zod/v4/mini/iso.d.ts +22 -0
- package/node_modules/zod/v4/mini/iso.js +30 -0
- package/node_modules/zod/v4/mini/parse.cjs +8 -0
- package/node_modules/zod/v4/mini/parse.d.cts +1 -0
- package/node_modules/zod/v4/mini/parse.d.ts +1 -0
- package/node_modules/zod/v4/mini/parse.js +1 -0
- package/node_modules/zod/v4/mini/schemas.cjs +839 -0
- package/node_modules/zod/v4/mini/schemas.d.cts +356 -0
- package/node_modules/zod/v4/mini/schemas.d.ts +356 -0
- package/node_modules/zod/v4/mini/schemas.js +732 -0
- package/node_modules/zod/v4-mini/index.cjs +17 -0
- package/node_modules/zod/v4-mini/index.d.cts +1 -0
- package/node_modules/zod/v4-mini/index.d.ts +1 -0
- package/node_modules/zod/v4-mini/index.js +1 -0
- package/package.json +58 -0
- package/src/cli.js +83 -0
- package/src/commands/activate-if-needed.js +41 -0
- package/src/commands/diagnostics.js +38 -0
- package/src/commands/doctor.js +96 -0
- package/src/commands/init.js +975 -0
- package/src/commands/serve.js +200 -0
- package/src/commands/status.js +215 -0
- package/src/commands/sync.js +783 -0
- package/src/commands/uninstall.js +167 -0
- package/src/lib/activation-check.js +341 -0
- package/src/lib/browser-auth.js +177 -0
- package/src/lib/claude-config.js +190 -0
- package/src/lib/cli-ui.js +179 -0
- package/src/lib/codex-config.js +350 -0
- package/src/lib/debug-flags.js +7 -0
- package/src/lib/diagnostics.js +216 -0
- package/src/lib/doctor.js +351 -0
- package/src/lib/fs.js +77 -0
- package/src/lib/gemini-config.js +288 -0
- package/src/lib/init-flow.js +42 -0
- package/src/lib/insforge-client.js +79 -0
- package/src/lib/insforge.js +29 -0
- package/src/lib/local-api.js +511 -0
- package/src/lib/openclaw-hook.js +420 -0
- package/src/lib/openclaw-session-plugin.js +520 -0
- package/src/lib/opencode-config.js +99 -0
- package/src/lib/opencode-usage-audit.js +205 -0
- package/src/lib/progress.js +76 -0
- package/src/lib/project-usage-purge.js +106 -0
- package/src/lib/prompt.js +24 -0
- package/src/lib/rollout.js +2472 -0
- package/src/lib/runtime-config.js +132 -0
- package/src/lib/static-server.js +59 -0
- package/src/lib/subscriptions.js +319 -0
- package/src/lib/tracker-paths.js +15 -0
- package/src/lib/upload-throttle.js +148 -0
- package/src/lib/uploader.js +224 -0
- package/src/lib/vibeusage-api.js +243 -0
- package/src/lib/vibeusage-public-repo.js +105 -0
|
@@ -0,0 +1,783 @@
|
|
|
1
|
+
const os = require("node:os");
|
|
2
|
+
const path = require("node:path");
|
|
3
|
+
const fs = require("node:fs/promises");
|
|
4
|
+
const cp = require("node:child_process");
|
|
5
|
+
|
|
6
|
+
const { ensureDir, readJson, writeJson, openLock } = require("../lib/fs");
|
|
7
|
+
const {
|
|
8
|
+
listRolloutFiles,
|
|
9
|
+
listClaudeProjectFiles,
|
|
10
|
+
listGeminiSessionFiles,
|
|
11
|
+
listOpencodeMessageFiles,
|
|
12
|
+
readOpencodeDbMessages,
|
|
13
|
+
parseRolloutIncremental,
|
|
14
|
+
parseClaudeIncremental,
|
|
15
|
+
parseGeminiIncremental,
|
|
16
|
+
parseOpencodeIncremental,
|
|
17
|
+
parseOpencodeDbIncremental,
|
|
18
|
+
parseOpenclawIncremental,
|
|
19
|
+
} = require("../lib/rollout");
|
|
20
|
+
const { drainQueueToCloud } = require("../lib/uploader");
|
|
21
|
+
const { collectLocalSubscriptions } = require("../lib/subscriptions");
|
|
22
|
+
const { createProgress, renderBar, formatNumber, formatBytes } = require("../lib/progress");
|
|
23
|
+
const { syncHeartbeat } = require("../lib/vibeusage-api");
|
|
24
|
+
const {
|
|
25
|
+
DEFAULTS: UPLOAD_DEFAULTS,
|
|
26
|
+
normalizeState: normalizeUploadState,
|
|
27
|
+
decideAutoUpload,
|
|
28
|
+
recordUploadSuccess,
|
|
29
|
+
recordUploadFailure,
|
|
30
|
+
} = require("../lib/upload-throttle");
|
|
31
|
+
const { purgeProjectUsage } = require("../lib/project-usage-purge");
|
|
32
|
+
const { resolveTrackerPaths } = require("../lib/tracker-paths");
|
|
33
|
+
const { resolveRuntimeConfig } = require("../lib/runtime-config");
|
|
34
|
+
|
|
35
|
+
async function cmdSync(argv) {
|
|
36
|
+
const opts = parseArgs(argv);
|
|
37
|
+
const home = os.homedir();
|
|
38
|
+
const { trackerDir } = await resolveTrackerPaths({ home });
|
|
39
|
+
|
|
40
|
+
await ensureDir(trackerDir);
|
|
41
|
+
if (opts.fromOpenclaw) {
|
|
42
|
+
await writeOpenclawSignal(trackerDir);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const lockPath = path.join(trackerDir, "sync.lock");
|
|
46
|
+
const lock = await openLock(lockPath, { quietIfLocked: opts.auto });
|
|
47
|
+
if (!lock) return;
|
|
48
|
+
|
|
49
|
+
let progress = null;
|
|
50
|
+
try {
|
|
51
|
+
progress = !opts.auto ? createProgress({ stream: process.stdout }) : null;
|
|
52
|
+
const configPath = path.join(trackerDir, "config.json");
|
|
53
|
+
const cursorsPath = path.join(trackerDir, "cursors.json");
|
|
54
|
+
const queuePath = path.join(trackerDir, "queue.jsonl");
|
|
55
|
+
const queueStatePath = path.join(trackerDir, "queue.state.json");
|
|
56
|
+
const projectQueuePath = path.join(trackerDir, "project.queue.jsonl");
|
|
57
|
+
const projectQueueStatePath = path.join(trackerDir, "project.queue.state.json");
|
|
58
|
+
const uploadThrottlePath = path.join(trackerDir, "upload.throttle.json");
|
|
59
|
+
|
|
60
|
+
const config = await readJson(configPath);
|
|
61
|
+
const cursors = (await readJson(cursorsPath)) || { version: 1, files: {}, updatedAt: null };
|
|
62
|
+
const uploadThrottle = normalizeUploadState(await readJson(uploadThrottlePath));
|
|
63
|
+
let uploadThrottleState = uploadThrottle;
|
|
64
|
+
|
|
65
|
+
const codexHome = process.env.CODEX_HOME || path.join(home, ".codex");
|
|
66
|
+
const codeHome = process.env.CODE_HOME || path.join(home, ".code");
|
|
67
|
+
const claudeProjectsDir = path.join(home, ".claude", "projects");
|
|
68
|
+
const geminiHome = process.env.GEMINI_HOME || path.join(home, ".gemini");
|
|
69
|
+
const geminiTmpDir = path.join(geminiHome, "tmp");
|
|
70
|
+
const xdgDataHome = process.env.XDG_DATA_HOME || path.join(home, ".local", "share");
|
|
71
|
+
const opencodeHome = process.env.OPENCODE_HOME || path.join(xdgDataHome, "opencode");
|
|
72
|
+
const opencodeStorageDir = path.join(opencodeHome, "storage");
|
|
73
|
+
|
|
74
|
+
// OpenClaw hook integration: allow a hook to request incremental parsing for a single session jsonl.
|
|
75
|
+
// We still parse all regular sources so model/source attribution stays complete (e.g. Kimi sessions).
|
|
76
|
+
const openclawSignal = opts.fromOpenclaw
|
|
77
|
+
? resolveOpenclawSignal({ home, env: process.env })
|
|
78
|
+
: null;
|
|
79
|
+
|
|
80
|
+
const sources = [
|
|
81
|
+
{ source: "codex", sessionsDir: path.join(codexHome, "sessions") },
|
|
82
|
+
{ source: "every-code", sessionsDir: path.join(codeHome, "sessions") },
|
|
83
|
+
];
|
|
84
|
+
|
|
85
|
+
const rolloutFiles = [];
|
|
86
|
+
const seenSessions = new Set();
|
|
87
|
+
for (const entry of sources) {
|
|
88
|
+
if (seenSessions.has(entry.sessionsDir)) continue;
|
|
89
|
+
seenSessions.add(entry.sessionsDir);
|
|
90
|
+
const files = await listRolloutFiles(entry.sessionsDir);
|
|
91
|
+
for (const filePath of files) {
|
|
92
|
+
rolloutFiles.push({ path: filePath, source: entry.source });
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
const openclawFiles = openclawSignal?.sessionFile
|
|
97
|
+
? [{ path: openclawSignal.sessionFile, source: "openclaw" }]
|
|
98
|
+
: [];
|
|
99
|
+
|
|
100
|
+
if (progress?.enabled) {
|
|
101
|
+
progress.start(
|
|
102
|
+
`Parsing ${renderBar(0)} 0/${formatNumber(rolloutFiles.length)} files | buckets 0`,
|
|
103
|
+
);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
const parseResult = await parseRolloutIncremental({
|
|
107
|
+
rolloutFiles,
|
|
108
|
+
cursors,
|
|
109
|
+
queuePath,
|
|
110
|
+
projectQueuePath,
|
|
111
|
+
onProgress: (p) => {
|
|
112
|
+
if (!progress?.enabled) return;
|
|
113
|
+
const pct = p.total > 0 ? p.index / p.total : 1;
|
|
114
|
+
progress.update(
|
|
115
|
+
`Parsing ${renderBar(pct)} ${formatNumber(p.index)}/${formatNumber(p.total)} files | buckets ${formatNumber(
|
|
116
|
+
p.bucketsQueued,
|
|
117
|
+
)}`,
|
|
118
|
+
);
|
|
119
|
+
},
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
let openclawResult = { filesProcessed: 0, eventsAggregated: 0, bucketsQueued: 0 };
|
|
123
|
+
if (openclawFiles.length > 0) {
|
|
124
|
+
// Only runs when explicitly triggered by OpenClaw hooks.
|
|
125
|
+
openclawResult = await parseOpenclawIncremental({
|
|
126
|
+
sessionFiles: openclawFiles,
|
|
127
|
+
cursors,
|
|
128
|
+
queuePath,
|
|
129
|
+
projectQueuePath,
|
|
130
|
+
source: "openclaw",
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
const openclawFallback = await applyOpenclawTotalsFallback({
|
|
135
|
+
trackerDir,
|
|
136
|
+
signal: openclawSignal,
|
|
137
|
+
cursors,
|
|
138
|
+
queuePath,
|
|
139
|
+
projectQueuePath,
|
|
140
|
+
});
|
|
141
|
+
openclawResult.filesProcessed += openclawFallback.filesProcessed;
|
|
142
|
+
openclawResult.eventsAggregated += openclawFallback.eventsAggregated;
|
|
143
|
+
openclawResult.bucketsQueued += openclawFallback.bucketsQueued;
|
|
144
|
+
|
|
145
|
+
const claudeFiles = await listClaudeProjectFiles(claudeProjectsDir);
|
|
146
|
+
let claudeResult = { filesProcessed: 0, eventsAggregated: 0, bucketsQueued: 0 };
|
|
147
|
+
if (claudeFiles.length > 0) {
|
|
148
|
+
if (progress?.enabled) {
|
|
149
|
+
progress.start(
|
|
150
|
+
`Parsing Claude ${renderBar(0)} 0/${formatNumber(claudeFiles.length)} files | buckets 0`,
|
|
151
|
+
);
|
|
152
|
+
}
|
|
153
|
+
claudeResult = await parseClaudeIncremental({
|
|
154
|
+
projectFiles: claudeFiles,
|
|
155
|
+
cursors,
|
|
156
|
+
queuePath,
|
|
157
|
+
projectQueuePath,
|
|
158
|
+
onProgress: (p) => {
|
|
159
|
+
if (!progress?.enabled) return;
|
|
160
|
+
const pct = p.total > 0 ? p.index / p.total : 1;
|
|
161
|
+
progress.update(
|
|
162
|
+
`Parsing Claude ${renderBar(pct)} ${formatNumber(p.index)}/${formatNumber(p.total)} files | buckets ${formatNumber(
|
|
163
|
+
p.bucketsQueued,
|
|
164
|
+
)}`,
|
|
165
|
+
);
|
|
166
|
+
},
|
|
167
|
+
source: "claude",
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
const geminiFiles = await listGeminiSessionFiles(geminiTmpDir);
|
|
172
|
+
let geminiResult = { filesProcessed: 0, eventsAggregated: 0, bucketsQueued: 0 };
|
|
173
|
+
if (geminiFiles.length > 0) {
|
|
174
|
+
if (progress?.enabled) {
|
|
175
|
+
progress.start(
|
|
176
|
+
`Parsing Gemini ${renderBar(0)} 0/${formatNumber(geminiFiles.length)} files | buckets 0`,
|
|
177
|
+
);
|
|
178
|
+
}
|
|
179
|
+
geminiResult = await parseGeminiIncremental({
|
|
180
|
+
sessionFiles: geminiFiles,
|
|
181
|
+
cursors,
|
|
182
|
+
queuePath,
|
|
183
|
+
projectQueuePath,
|
|
184
|
+
onProgress: (p) => {
|
|
185
|
+
if (!progress?.enabled) return;
|
|
186
|
+
const pct = p.total > 0 ? p.index / p.total : 1;
|
|
187
|
+
progress.update(
|
|
188
|
+
`Parsing Gemini ${renderBar(pct)} ${formatNumber(p.index)}/${formatNumber(p.total)} files | buckets ${formatNumber(
|
|
189
|
+
p.bucketsQueued,
|
|
190
|
+
)}`,
|
|
191
|
+
);
|
|
192
|
+
},
|
|
193
|
+
source: "gemini",
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
const opencodeFiles = await listOpencodeMessageFiles(opencodeStorageDir);
|
|
198
|
+
let opencodeResult = { filesProcessed: 0, eventsAggregated: 0, bucketsQueued: 0 };
|
|
199
|
+
if (opencodeFiles.length > 0) {
|
|
200
|
+
if (progress?.enabled) {
|
|
201
|
+
progress.start(
|
|
202
|
+
`Parsing Opencode ${renderBar(0)} 0/${formatNumber(opencodeFiles.length)} files | buckets 0`,
|
|
203
|
+
);
|
|
204
|
+
}
|
|
205
|
+
opencodeResult = await parseOpencodeIncremental({
|
|
206
|
+
messageFiles: opencodeFiles,
|
|
207
|
+
cursors,
|
|
208
|
+
queuePath,
|
|
209
|
+
projectQueuePath,
|
|
210
|
+
onProgress: (p) => {
|
|
211
|
+
if (!progress?.enabled) return;
|
|
212
|
+
const pct = p.total > 0 ? p.index / p.total : 1;
|
|
213
|
+
progress.update(
|
|
214
|
+
`Parsing Opencode ${renderBar(pct)} ${formatNumber(p.index)}/${formatNumber(
|
|
215
|
+
p.total,
|
|
216
|
+
)} files | buckets ${formatNumber(p.bucketsQueued)}`,
|
|
217
|
+
);
|
|
218
|
+
},
|
|
219
|
+
source: "opencode",
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
// OpenCode v1.2+ stores messages in SQLite (opencode.db) instead of JSON files.
|
|
224
|
+
const opencodeDbPath = path.join(opencodeHome, "opencode.db");
|
|
225
|
+
let opencodeDbResult = { messagesProcessed: 0, eventsAggregated: 0, bucketsQueued: 0 };
|
|
226
|
+
const dbMessages = readOpencodeDbMessages(opencodeDbPath);
|
|
227
|
+
if (dbMessages.length > 0) {
|
|
228
|
+
if (progress?.enabled) {
|
|
229
|
+
progress.start(
|
|
230
|
+
`Parsing Opencode DB ${renderBar(0)} 0/${formatNumber(dbMessages.length)} msgs | buckets 0`,
|
|
231
|
+
);
|
|
232
|
+
}
|
|
233
|
+
opencodeDbResult = await parseOpencodeDbIncremental({
|
|
234
|
+
dbMessages,
|
|
235
|
+
cursors,
|
|
236
|
+
queuePath,
|
|
237
|
+
projectQueuePath,
|
|
238
|
+
onProgress: (p) => {
|
|
239
|
+
if (!progress?.enabled) return;
|
|
240
|
+
const pct = p.total > 0 ? p.index / p.total : 1;
|
|
241
|
+
progress.update(
|
|
242
|
+
`Parsing Opencode DB ${renderBar(pct)} ${formatNumber(p.index)}/${formatNumber(
|
|
243
|
+
p.total,
|
|
244
|
+
)} msgs | buckets ${formatNumber(p.bucketsQueued)}`,
|
|
245
|
+
);
|
|
246
|
+
},
|
|
247
|
+
source: "opencode",
|
|
248
|
+
});
|
|
249
|
+
opencodeResult.filesProcessed += opencodeDbResult.messagesProcessed;
|
|
250
|
+
opencodeResult.eventsAggregated += opencodeDbResult.eventsAggregated;
|
|
251
|
+
opencodeResult.bucketsQueued += opencodeDbResult.bucketsQueued;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
if (cursors?.projectHourly?.projects && projectQueuePath && projectQueueStatePath) {
|
|
255
|
+
for (const [projectKey, meta] of Object.entries(cursors.projectHourly.projects)) {
|
|
256
|
+
if (!meta || typeof meta !== "object") continue;
|
|
257
|
+
if (meta.status !== "blocked" || !meta.purge_pending) continue;
|
|
258
|
+
await purgeProjectUsage({
|
|
259
|
+
projectKey,
|
|
260
|
+
projectQueuePath,
|
|
261
|
+
projectQueueStatePath,
|
|
262
|
+
projectState: cursors.projectHourly,
|
|
263
|
+
});
|
|
264
|
+
meta.purge_pending = false;
|
|
265
|
+
meta.purged_at = new Date().toISOString();
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
cursors.updatedAt = new Date().toISOString();
|
|
270
|
+
await writeJson(cursorsPath, cursors);
|
|
271
|
+
|
|
272
|
+
progress?.stop();
|
|
273
|
+
|
|
274
|
+
const runtime = resolveRuntimeConfig({ config: config || {}, env: process.env });
|
|
275
|
+
const deviceToken = runtime.deviceToken;
|
|
276
|
+
const baseUrl = runtime.baseUrl;
|
|
277
|
+
|
|
278
|
+
let uploadResult = null;
|
|
279
|
+
let uploadAttempted = false;
|
|
280
|
+
if (deviceToken) {
|
|
281
|
+
const beforeState = (await readJson(queueStatePath)) || { offset: 0 };
|
|
282
|
+
const projectBeforeState = (await readJson(projectQueueStatePath)) || { offset: 0 };
|
|
283
|
+
const queueSize = await safeStatSize(queuePath);
|
|
284
|
+
const projectQueueSize = await safeStatSize(projectQueuePath);
|
|
285
|
+
const pendingBytes =
|
|
286
|
+
Math.max(0, queueSize - Number(beforeState.offset || 0)) +
|
|
287
|
+
Math.max(0, projectQueueSize - Number(projectBeforeState.offset || 0));
|
|
288
|
+
let maxBatches = opts.auto ? 3 : opts.drain ? 10_000 : 10;
|
|
289
|
+
let batchSize = UPLOAD_DEFAULTS.batchSize;
|
|
290
|
+
let allowUpload = pendingBytes > 0;
|
|
291
|
+
let autoDecision = null;
|
|
292
|
+
|
|
293
|
+
if (opts.auto) {
|
|
294
|
+
autoDecision = decideAutoUpload({
|
|
295
|
+
nowMs: Date.now(),
|
|
296
|
+
pendingBytes,
|
|
297
|
+
state: uploadThrottle,
|
|
298
|
+
});
|
|
299
|
+
allowUpload = allowUpload && autoDecision.allowed;
|
|
300
|
+
maxBatches = autoDecision.allowed ? autoDecision.maxBatches : 0;
|
|
301
|
+
batchSize = autoDecision.batchSize;
|
|
302
|
+
if (!autoDecision.allowed && pendingBytes > 0 && autoDecision.blockedUntilMs > 0) {
|
|
303
|
+
const reason = deriveAutoSkipReason({ decision: autoDecision, state: uploadThrottle });
|
|
304
|
+
await scheduleAutoRetry({
|
|
305
|
+
trackerDir,
|
|
306
|
+
retryAtMs: autoDecision.blockedUntilMs,
|
|
307
|
+
reason,
|
|
308
|
+
pendingBytes,
|
|
309
|
+
source: "auto-throttled",
|
|
310
|
+
autoRetryNoSpawn: runtime.autoRetryNoSpawn,
|
|
311
|
+
});
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
if (progress?.enabled && pendingBytes > 0 && allowUpload) {
|
|
316
|
+
const totalSize = queueSize + projectQueueSize;
|
|
317
|
+
const totalOffset =
|
|
318
|
+
Number(beforeState.offset || 0) + Number(projectBeforeState.offset || 0);
|
|
319
|
+
const pct = totalSize > 0 ? totalOffset / totalSize : 0;
|
|
320
|
+
progress.start(
|
|
321
|
+
`Uploading ${renderBar(pct)} ${formatBytes(totalOffset)}/${formatBytes(totalSize)} | inserted 0 skipped 0`,
|
|
322
|
+
);
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
if (allowUpload && maxBatches > 0) {
|
|
326
|
+
uploadAttempted = true;
|
|
327
|
+
const deviceSubscriptions = await collectLocalSubscriptions({
|
|
328
|
+
home,
|
|
329
|
+
env: process.env,
|
|
330
|
+
probeKeychain: true,
|
|
331
|
+
probeKeychainDetails: true,
|
|
332
|
+
});
|
|
333
|
+
try {
|
|
334
|
+
uploadResult = await drainQueueToCloud({
|
|
335
|
+
baseUrl,
|
|
336
|
+
deviceToken,
|
|
337
|
+
deviceSubscriptions,
|
|
338
|
+
queuePath,
|
|
339
|
+
queueStatePath,
|
|
340
|
+
projectQueuePath,
|
|
341
|
+
projectQueueStatePath,
|
|
342
|
+
maxBatches,
|
|
343
|
+
batchSize,
|
|
344
|
+
onProgress: (u) => {
|
|
345
|
+
if (!progress?.enabled) return;
|
|
346
|
+
const pct = u.queueSize > 0 ? u.offset / u.queueSize : 1;
|
|
347
|
+
progress.update(
|
|
348
|
+
`Uploading ${renderBar(pct)} ${formatBytes(u.offset)}/${formatBytes(u.queueSize)} | inserted ${formatNumber(
|
|
349
|
+
u.inserted,
|
|
350
|
+
)} skipped ${formatNumber(u.skipped)}`,
|
|
351
|
+
);
|
|
352
|
+
},
|
|
353
|
+
});
|
|
354
|
+
if (uploadResult.attempted > 0) {
|
|
355
|
+
const next = recordUploadSuccess({ nowMs: Date.now(), state: uploadThrottleState });
|
|
356
|
+
uploadThrottleState = next;
|
|
357
|
+
await writeJson(uploadThrottlePath, next);
|
|
358
|
+
}
|
|
359
|
+
} catch (e) {
|
|
360
|
+
const next = recordUploadFailure({
|
|
361
|
+
nowMs: Date.now(),
|
|
362
|
+
state: uploadThrottleState,
|
|
363
|
+
error: e,
|
|
364
|
+
});
|
|
365
|
+
uploadThrottleState = next;
|
|
366
|
+
await writeJson(uploadThrottlePath, next);
|
|
367
|
+
if (opts.auto && pendingBytes > 0) {
|
|
368
|
+
const retryAtMs = Math.max(next.nextAllowedAtMs || 0, next.backoffUntilMs || 0);
|
|
369
|
+
if (retryAtMs > 0) {
|
|
370
|
+
await scheduleAutoRetry({
|
|
371
|
+
trackerDir,
|
|
372
|
+
retryAtMs,
|
|
373
|
+
reason: "backoff",
|
|
374
|
+
pendingBytes,
|
|
375
|
+
source: "auto-error",
|
|
376
|
+
autoRetryNoSpawn: runtime.autoRetryNoSpawn,
|
|
377
|
+
});
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
throw e;
|
|
381
|
+
}
|
|
382
|
+
} else {
|
|
383
|
+
uploadResult = { inserted: 0, skipped: 0 };
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
progress?.stop();
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
const afterState = (await readJson(queueStatePath)) || { offset: 0 };
|
|
390
|
+
const queueSize = await safeStatSize(queuePath);
|
|
391
|
+
const projectAfterState = (await readJson(projectQueueStatePath)) || { offset: 0 };
|
|
392
|
+
const projectQueueSize = await safeStatSize(projectQueuePath);
|
|
393
|
+
const pendingBytes =
|
|
394
|
+
Math.max(0, queueSize - Number(afterState.offset || 0)) +
|
|
395
|
+
Math.max(0, projectQueueSize - Number(projectAfterState.offset || 0));
|
|
396
|
+
|
|
397
|
+
if (pendingBytes <= 0) {
|
|
398
|
+
await clearAutoRetry(trackerDir);
|
|
399
|
+
} else if (opts.auto && uploadAttempted) {
|
|
400
|
+
const retryAtMs = Number(uploadThrottleState?.nextAllowedAtMs || 0);
|
|
401
|
+
if (retryAtMs > Date.now()) {
|
|
402
|
+
await scheduleAutoRetry({
|
|
403
|
+
trackerDir,
|
|
404
|
+
retryAtMs,
|
|
405
|
+
reason: "backlog",
|
|
406
|
+
pendingBytes,
|
|
407
|
+
source: "auto-backlog",
|
|
408
|
+
autoRetryNoSpawn: runtime.autoRetryNoSpawn,
|
|
409
|
+
});
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
await maybeSendHeartbeat({
|
|
414
|
+
baseUrl,
|
|
415
|
+
deviceToken,
|
|
416
|
+
trackerDir,
|
|
417
|
+
uploadResult,
|
|
418
|
+
pendingBytes,
|
|
419
|
+
});
|
|
420
|
+
|
|
421
|
+
if (!opts.auto) {
|
|
422
|
+
const totalParsed =
|
|
423
|
+
parseResult.filesProcessed +
|
|
424
|
+
openclawResult.filesProcessed +
|
|
425
|
+
claudeResult.filesProcessed +
|
|
426
|
+
geminiResult.filesProcessed +
|
|
427
|
+
opencodeResult.filesProcessed;
|
|
428
|
+
const totalBuckets =
|
|
429
|
+
parseResult.bucketsQueued +
|
|
430
|
+
openclawResult.bucketsQueued +
|
|
431
|
+
claudeResult.bucketsQueued +
|
|
432
|
+
geminiResult.bucketsQueued +
|
|
433
|
+
opencodeResult.bucketsQueued;
|
|
434
|
+
process.stdout.write(
|
|
435
|
+
[
|
|
436
|
+
"Sync finished:",
|
|
437
|
+
`- Parsed files: ${totalParsed}`,
|
|
438
|
+
`- New 30-min buckets queued: ${totalBuckets}`,
|
|
439
|
+
deviceToken
|
|
440
|
+
? `- Uploaded: ${uploadResult.inserted} inserted, ${uploadResult.skipped} skipped`
|
|
441
|
+
: "- Uploaded: skipped (no device token)",
|
|
442
|
+
deviceToken && pendingBytes > 0 && !opts.drain
|
|
443
|
+
? `- Remaining: ${formatBytes(pendingBytes)} pending (run sync again, or use --drain)`
|
|
444
|
+
: null,
|
|
445
|
+
"",
|
|
446
|
+
]
|
|
447
|
+
.filter(Boolean)
|
|
448
|
+
.join("\n"),
|
|
449
|
+
);
|
|
450
|
+
}
|
|
451
|
+
} finally {
|
|
452
|
+
progress?.stop();
|
|
453
|
+
await lock.release();
|
|
454
|
+
await fs.unlink(lockPath).catch(() => {});
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
function parseArgs(argv) {
|
|
459
|
+
const out = {
|
|
460
|
+
auto: false,
|
|
461
|
+
fromNotify: false,
|
|
462
|
+
fromRetry: false,
|
|
463
|
+
fromOpenclaw: false,
|
|
464
|
+
drain: false,
|
|
465
|
+
};
|
|
466
|
+
for (let i = 0; i < argv.length; i++) {
|
|
467
|
+
const a = argv[i];
|
|
468
|
+
if (a === "--auto") out.auto = true;
|
|
469
|
+
else if (a === "--from-notify") out.fromNotify = true;
|
|
470
|
+
else if (a === "--from-retry") out.fromRetry = true;
|
|
471
|
+
else if (a === "--from-openclaw") out.fromOpenclaw = true;
|
|
472
|
+
else if (a === "--drain") out.drain = true;
|
|
473
|
+
else throw new Error(`Unknown option: ${a}`);
|
|
474
|
+
}
|
|
475
|
+
return out;
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
module.exports = { cmdSync };
|
|
479
|
+
|
|
480
|
+
function normalizeString(value) {
|
|
481
|
+
if (typeof value !== "string") return null;
|
|
482
|
+
const trimmed = value.trim();
|
|
483
|
+
return trimmed.length > 0 ? trimmed : null;
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
function resolveOpenclawSignal({ home, env } = {}) {
|
|
487
|
+
if (!env) return null;
|
|
488
|
+
|
|
489
|
+
const agentId = normalizeString(env.VIBEUSAGE_OPENCLAW_AGENT_ID);
|
|
490
|
+
const sessionId = normalizeString(env.VIBEUSAGE_OPENCLAW_PREV_SESSION_ID);
|
|
491
|
+
if (!agentId || !sessionId) return null;
|
|
492
|
+
|
|
493
|
+
const openclawHome =
|
|
494
|
+
normalizeString(env.VIBEUSAGE_OPENCLAW_HOME) || path.join(home || os.homedir(), ".openclaw");
|
|
495
|
+
const sessionFile = path.join(openclawHome, "agents", agentId, "sessions", `${sessionId}.jsonl`);
|
|
496
|
+
|
|
497
|
+
const prevTotals = {
|
|
498
|
+
totalTokens: normalizeNonNegativeInt(env.VIBEUSAGE_OPENCLAW_PREV_TOTAL_TOKENS),
|
|
499
|
+
inputTokens: normalizeNonNegativeInt(env.VIBEUSAGE_OPENCLAW_PREV_INPUT_TOKENS),
|
|
500
|
+
outputTokens: normalizeNonNegativeInt(env.VIBEUSAGE_OPENCLAW_PREV_OUTPUT_TOKENS),
|
|
501
|
+
model: normalizeString(env.VIBEUSAGE_OPENCLAW_PREV_MODEL),
|
|
502
|
+
updatedAt: normalizeIsoOrEpoch(env.VIBEUSAGE_OPENCLAW_PREV_UPDATED_AT),
|
|
503
|
+
};
|
|
504
|
+
|
|
505
|
+
return {
|
|
506
|
+
agentId,
|
|
507
|
+
sessionId,
|
|
508
|
+
sessionKey: normalizeString(env.VIBEUSAGE_OPENCLAW_SESSION_KEY),
|
|
509
|
+
openclawHome,
|
|
510
|
+
sessionFile,
|
|
511
|
+
prevTotals,
|
|
512
|
+
};
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
async function applyOpenclawTotalsFallback({
|
|
516
|
+
trackerDir,
|
|
517
|
+
signal,
|
|
518
|
+
cursors,
|
|
519
|
+
queuePath,
|
|
520
|
+
projectQueuePath,
|
|
521
|
+
}) {
|
|
522
|
+
const totalTokens = Number(signal?.prevTotals?.totalTokens || 0);
|
|
523
|
+
if (!trackerDir || !signal || totalTokens <= 0) {
|
|
524
|
+
return { filesProcessed: 0, eventsAggregated: 0, bucketsQueued: 0 };
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
const sessionKey = `${signal.agentId}:${signal.sessionId}`;
|
|
528
|
+
const statePath = path.join(trackerDir, "openclaw.fallback.state.json");
|
|
529
|
+
const fallbackFilePath = path.join(trackerDir, "openclaw.fallback.jsonl");
|
|
530
|
+
const state = (await readJson(statePath)) || { version: 1, sessions: {} };
|
|
531
|
+
const sessions = state.sessions && typeof state.sessions === "object" ? state.sessions : {};
|
|
532
|
+
const prev =
|
|
533
|
+
sessions[sessionKey] && typeof sessions[sessionKey] === "object" ? sessions[sessionKey] : null;
|
|
534
|
+
|
|
535
|
+
const current = {
|
|
536
|
+
totalTokens: normalizeNonNegativeInt(signal?.prevTotals?.totalTokens) || 0,
|
|
537
|
+
inputTokens: normalizeNonNegativeInt(signal?.prevTotals?.inputTokens) || 0,
|
|
538
|
+
outputTokens: normalizeNonNegativeInt(signal?.prevTotals?.outputTokens) || 0,
|
|
539
|
+
model: normalizeString(signal?.prevTotals?.model) || "unknown",
|
|
540
|
+
updatedAt: normalizeIsoOrEpoch(signal?.prevTotals?.updatedAt) || new Date().toISOString(),
|
|
541
|
+
seenAt: new Date().toISOString(),
|
|
542
|
+
};
|
|
543
|
+
|
|
544
|
+
let deltaTotal = current.totalTokens;
|
|
545
|
+
let deltaInput = current.inputTokens;
|
|
546
|
+
let deltaOutput = current.outputTokens;
|
|
547
|
+
if (prev) {
|
|
548
|
+
deltaTotal = Math.max(
|
|
549
|
+
0,
|
|
550
|
+
current.totalTokens - (normalizeNonNegativeInt(prev.totalTokens) || 0),
|
|
551
|
+
);
|
|
552
|
+
deltaInput = Math.max(
|
|
553
|
+
0,
|
|
554
|
+
current.inputTokens - (normalizeNonNegativeInt(prev.inputTokens) || 0),
|
|
555
|
+
);
|
|
556
|
+
deltaOutput = Math.max(
|
|
557
|
+
0,
|
|
558
|
+
current.outputTokens - (normalizeNonNegativeInt(prev.outputTokens) || 0),
|
|
559
|
+
);
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
if (deltaTotal > 0 && deltaInput + deltaOutput === 0) {
|
|
563
|
+
deltaInput = deltaTotal;
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
sessions[sessionKey] = current;
|
|
567
|
+
state.version = 1;
|
|
568
|
+
state.sessions = sessions;
|
|
569
|
+
|
|
570
|
+
if (deltaTotal <= 0) {
|
|
571
|
+
await writeJson(statePath, state);
|
|
572
|
+
return { filesProcessed: 0, eventsAggregated: 0, bucketsQueued: 0 };
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
await ensureDir(path.dirname(fallbackFilePath));
|
|
576
|
+
const syntheticMessage = {
|
|
577
|
+
type: "message",
|
|
578
|
+
timestamp: current.updatedAt,
|
|
579
|
+
message: {
|
|
580
|
+
role: "assistant",
|
|
581
|
+
model: current.model,
|
|
582
|
+
usage: {
|
|
583
|
+
input: deltaInput,
|
|
584
|
+
output: deltaOutput,
|
|
585
|
+
cacheRead: 0,
|
|
586
|
+
cacheWrite: 0,
|
|
587
|
+
totalTokens: deltaTotal,
|
|
588
|
+
},
|
|
589
|
+
},
|
|
590
|
+
};
|
|
591
|
+
await fs.appendFile(fallbackFilePath, `${JSON.stringify(syntheticMessage)}\n`, "utf8");
|
|
592
|
+
await writeJson(statePath, state);
|
|
593
|
+
|
|
594
|
+
return parseOpenclawIncremental({
|
|
595
|
+
sessionFiles: [{ path: fallbackFilePath, source: "openclaw" }],
|
|
596
|
+
cursors,
|
|
597
|
+
queuePath,
|
|
598
|
+
projectQueuePath,
|
|
599
|
+
source: "openclaw",
|
|
600
|
+
});
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
function normalizeNonNegativeInt(value) {
|
|
604
|
+
const n = Number(value);
|
|
605
|
+
if (!Number.isFinite(n) || n < 0) return null;
|
|
606
|
+
return Math.floor(n);
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
function normalizeIsoOrEpoch(value) {
|
|
610
|
+
if (typeof value === "string") {
|
|
611
|
+
const trimmed = value.trim();
|
|
612
|
+
if (trimmed.length > 0 && !Number.isNaN(Date.parse(trimmed))) return trimmed;
|
|
613
|
+
const numeric = Number(trimmed);
|
|
614
|
+
if (Number.isFinite(numeric) && numeric > 0) {
|
|
615
|
+
const ms = numeric < 1e12 ? Math.floor(numeric * 1000) : Math.floor(numeric);
|
|
616
|
+
const iso = new Date(ms).toISOString();
|
|
617
|
+
if (!Number.isNaN(Date.parse(iso))) return iso;
|
|
618
|
+
}
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
const n = Number(value);
|
|
622
|
+
if (!Number.isFinite(n) || n <= 0) return null;
|
|
623
|
+
const ms = n < 1e12 ? Math.floor(n * 1000) : Math.floor(n);
|
|
624
|
+
const dt = new Date(ms);
|
|
625
|
+
if (Number.isNaN(dt.getTime())) return null;
|
|
626
|
+
return dt.toISOString();
|
|
627
|
+
}
|
|
628
|
+
|
|
629
|
+
async function safeStatSize(p) {
|
|
630
|
+
try {
|
|
631
|
+
const st = await fs.stat(p);
|
|
632
|
+
return st && st.isFile() ? st.size : 0;
|
|
633
|
+
} catch (_e) {
|
|
634
|
+
return 0;
|
|
635
|
+
}
|
|
636
|
+
}
|
|
637
|
+
|
|
638
|
+
async function maybeSendHeartbeat({
|
|
639
|
+
baseUrl,
|
|
640
|
+
deviceToken,
|
|
641
|
+
trackerDir,
|
|
642
|
+
uploadResult,
|
|
643
|
+
pendingBytes,
|
|
644
|
+
}) {
|
|
645
|
+
if (!deviceToken || !uploadResult) return;
|
|
646
|
+
if (pendingBytes > 0) return;
|
|
647
|
+
if (Number(uploadResult.inserted || 0) !== 0) return;
|
|
648
|
+
|
|
649
|
+
const heartbeatPath = path.join(trackerDir, "sync.heartbeat.json");
|
|
650
|
+
const heartbeatState = await readJson(heartbeatPath);
|
|
651
|
+
const lastPingAt = Date.parse(heartbeatState?.lastPingAt || "");
|
|
652
|
+
const nowMs = Date.now();
|
|
653
|
+
if (Number.isFinite(lastPingAt) && nowMs - lastPingAt < HEARTBEAT_MIN_INTERVAL_MS) return;
|
|
654
|
+
|
|
655
|
+
try {
|
|
656
|
+
await syncHeartbeat({ baseUrl, deviceToken });
|
|
657
|
+
await writeJson(heartbeatPath, {
|
|
658
|
+
lastPingAt: new Date(nowMs).toISOString(),
|
|
659
|
+
minIntervalMinutes: HEARTBEAT_MIN_INTERVAL_MINUTES,
|
|
660
|
+
});
|
|
661
|
+
} catch (_e) {
|
|
662
|
+
// best-effort heartbeat; ignore failures
|
|
663
|
+
}
|
|
664
|
+
}
|
|
665
|
+
|
|
666
|
+
function deriveAutoSkipReason({ decision, state }) {
|
|
667
|
+
if (!decision || decision.reason !== "throttled") return decision?.reason || "unknown";
|
|
668
|
+
const backoffUntilMs = Number(state?.backoffUntilMs || 0);
|
|
669
|
+
const nextAllowedAtMs = Number(state?.nextAllowedAtMs || 0);
|
|
670
|
+
if (backoffUntilMs > 0 && backoffUntilMs >= nextAllowedAtMs) return "backoff";
|
|
671
|
+
return "throttled";
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
async function scheduleAutoRetry({
|
|
675
|
+
trackerDir,
|
|
676
|
+
retryAtMs,
|
|
677
|
+
reason,
|
|
678
|
+
pendingBytes,
|
|
679
|
+
source,
|
|
680
|
+
autoRetryNoSpawn,
|
|
681
|
+
}) {
|
|
682
|
+
const retryMs = coerceRetryMs(retryAtMs);
|
|
683
|
+
if (!retryMs) return { scheduled: false, retryAtMs: 0 };
|
|
684
|
+
|
|
685
|
+
const retryPath = path.join(trackerDir, AUTO_RETRY_FILENAME);
|
|
686
|
+
const nowMs = Date.now();
|
|
687
|
+
const existing = await readJson(retryPath);
|
|
688
|
+
const existingMs = coerceRetryMs(existing?.retryAtMs);
|
|
689
|
+
if (existingMs && existingMs >= retryMs - 1000) {
|
|
690
|
+
return { scheduled: false, retryAtMs: existingMs };
|
|
691
|
+
}
|
|
692
|
+
|
|
693
|
+
const payload = {
|
|
694
|
+
version: 1,
|
|
695
|
+
retryAtMs: retryMs,
|
|
696
|
+
retryAt: new Date(retryMs).toISOString(),
|
|
697
|
+
reason: typeof reason === "string" && reason.length > 0 ? reason : "throttled",
|
|
698
|
+
pendingBytes: Math.max(0, Number(pendingBytes || 0)),
|
|
699
|
+
scheduledAt: new Date(nowMs).toISOString(),
|
|
700
|
+
source: typeof source === "string" ? source : "auto",
|
|
701
|
+
};
|
|
702
|
+
|
|
703
|
+
await writeJson(retryPath, payload);
|
|
704
|
+
|
|
705
|
+
const delayMs = Math.min(AUTO_RETRY_MAX_DELAY_MS, Math.max(0, retryMs - nowMs));
|
|
706
|
+
if (delayMs <= 0) return { scheduled: false, retryAtMs: retryMs };
|
|
707
|
+
if (autoRetryNoSpawn) {
|
|
708
|
+
return { scheduled: false, retryAtMs: retryMs };
|
|
709
|
+
}
|
|
710
|
+
|
|
711
|
+
spawnAutoRetryProcess({
|
|
712
|
+
retryPath,
|
|
713
|
+
trackerBinPath: path.join(trackerDir, "app", "bin", "tracker.js"),
|
|
714
|
+
fallbackPkg: "vibeusage",
|
|
715
|
+
delayMs,
|
|
716
|
+
});
|
|
717
|
+
return { scheduled: true, retryAtMs: retryMs };
|
|
718
|
+
}
|
|
719
|
+
|
|
720
|
+
async function clearAutoRetry(trackerDir) {
|
|
721
|
+
const retryPath = path.join(trackerDir, AUTO_RETRY_FILENAME);
|
|
722
|
+
await fs.unlink(retryPath).catch(() => {});
|
|
723
|
+
}
|
|
724
|
+
|
|
725
|
+
function spawnAutoRetryProcess({ retryPath, trackerBinPath, fallbackPkg, delayMs }) {
|
|
726
|
+
const script = buildAutoRetryScript({ retryPath, trackerBinPath, fallbackPkg, delayMs });
|
|
727
|
+
try {
|
|
728
|
+
const child = cp.spawn(process.execPath, ["-e", script], {
|
|
729
|
+
detached: true,
|
|
730
|
+
stdio: "ignore",
|
|
731
|
+
env: process.env,
|
|
732
|
+
});
|
|
733
|
+
child.unref();
|
|
734
|
+
} catch (_e) {}
|
|
735
|
+
}
|
|
736
|
+
|
|
737
|
+
function buildAutoRetryScript({ retryPath, trackerBinPath, fallbackPkg, delayMs }) {
|
|
738
|
+
return (
|
|
739
|
+
`'use strict';\n` +
|
|
740
|
+
`const fs = require('node:fs');\n` +
|
|
741
|
+
`const cp = require('node:child_process');\n` +
|
|
742
|
+
`const retryPath = ${JSON.stringify(retryPath)};\n` +
|
|
743
|
+
`const trackerBinPath = ${JSON.stringify(trackerBinPath)};\n` +
|
|
744
|
+
`const fallbackPkg = ${JSON.stringify(fallbackPkg)};\n` +
|
|
745
|
+
`const delayMs = ${Math.max(0, Math.floor(delayMs || 0))};\n` +
|
|
746
|
+
`setTimeout(() => {\n` +
|
|
747
|
+
` let retryAtMs = 0;\n` +
|
|
748
|
+
` try {\n` +
|
|
749
|
+
` const raw = fs.readFileSync(retryPath, 'utf8');\n` +
|
|
750
|
+
` retryAtMs = Number(JSON.parse(raw).retryAtMs || 0);\n` +
|
|
751
|
+
` } catch (_) {}\n` +
|
|
752
|
+
` if (!retryAtMs || Date.now() + 1000 < retryAtMs) process.exit(0);\n` +
|
|
753
|
+
` const argv = ['sync', '--auto', '--from-retry'];\n` +
|
|
754
|
+
` const cmd = fs.existsSync(trackerBinPath)\n` +
|
|
755
|
+
` ? [process.execPath, trackerBinPath, ...argv]\n` +
|
|
756
|
+
` : ['npx', '--yes', fallbackPkg, ...argv];\n` +
|
|
757
|
+
` try {\n` +
|
|
758
|
+
` const child = cp.spawn(cmd[0], cmd.slice(1), { detached: true, stdio: 'ignore', env: process.env });\n` +
|
|
759
|
+
` child.unref();\n` +
|
|
760
|
+
` } catch (_) {}\n` +
|
|
761
|
+
`}, delayMs);\n`
|
|
762
|
+
);
|
|
763
|
+
}
|
|
764
|
+
|
|
765
|
+
function coerceRetryMs(v) {
|
|
766
|
+
const n = Number(v);
|
|
767
|
+
if (!Number.isFinite(n) || n <= 0) return 0;
|
|
768
|
+
return Math.floor(n);
|
|
769
|
+
}
|
|
770
|
+
|
|
771
|
+
async function writeOpenclawSignal(trackerDir) {
|
|
772
|
+
const openclawSignalPath = path.join(trackerDir, "openclaw.signal");
|
|
773
|
+
try {
|
|
774
|
+
await fs.writeFile(openclawSignalPath, new Date().toISOString(), "utf8");
|
|
775
|
+
} catch (_e) {
|
|
776
|
+
// best-effort marker
|
|
777
|
+
}
|
|
778
|
+
}
|
|
779
|
+
|
|
780
|
+
const HEARTBEAT_MIN_INTERVAL_MINUTES = 30;
|
|
781
|
+
const HEARTBEAT_MIN_INTERVAL_MS = HEARTBEAT_MIN_INTERVAL_MINUTES * 60 * 1000;
|
|
782
|
+
const AUTO_RETRY_FILENAME = "auto.retry.json";
|
|
783
|
+
const AUTO_RETRY_MAX_DELAY_MS = 2 * 60 * 60 * 1000;
|