@playdrop/playdrop-cli 0.16.5 → 0.16.11
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/bin/playdrop +1 -2
- package/config/client-meta.json +4 -4
- package/dist/apiClient.d.ts +2 -2
- package/dist/apiClient.js +16 -20
- package/dist/appUrls.d.ts +2 -2
- package/dist/appUrls.js +31 -33
- package/dist/apps/build.d.ts +2 -2
- package/dist/apps/build.js +83 -83
- package/dist/apps/index.d.ts +7 -7
- package/dist/apps/index.js +8 -8
- package/dist/apps/loadCheck.d.ts +28 -16
- package/dist/apps/loadCheck.js +411 -279
- package/dist/apps/registration.d.ts +3 -3
- package/dist/apps/registration.js +1 -1
- package/dist/apps/staticHtml.d.ts +3 -3
- package/dist/apps/staticHtml.js +90 -91
- package/dist/apps/surfaceProfiles.d.ts +2 -2
- package/dist/apps/surfaceProfiles.js +6 -6
- package/dist/apps/upload.d.ts +5 -5
- package/dist/apps/upload.js +75 -81
- package/dist/apps/validate.d.ts +2 -2
- package/dist/apps/validate.js +18 -22
- package/dist/assetSpecs.d.ts +2 -2
- package/dist/assetSpecs.js +35 -35
- package/dist/assets/model-artifacts.d.ts +1 -1
- package/dist/assets/model-artifacts.js +81 -77
- package/dist/assets/model-worker.d.ts +1 -1
- package/dist/assets/model-worker.js +6 -6
- package/dist/browser.js +9 -9
- package/dist/catalogue-utils.d.ts +1 -1
- package/dist/catalogue-utils.js +26 -26
- package/dist/catalogue.d.ts +21 -16
- package/dist/catalogue.js +509 -413
- package/dist/clientInfo.d.ts +1 -1
- package/dist/clientInfo.js +28 -28
- package/dist/commandContext.d.ts +5 -5
- package/dist/commandContext.js +19 -23
- package/dist/commands/accounts.js +6 -6
- package/dist/commands/ads.js +16 -16
- package/dist/commands/agents.d.ts +2 -2
- package/dist/commands/agents.js +131 -127
- package/dist/commands/boosts.js +41 -31
- package/dist/commands/browse.d.ts +2 -2
- package/dist/commands/browse.js +168 -128
- package/dist/commands/build.js +9 -9
- package/dist/commands/captureListing.d.ts +8 -8
- package/dist/commands/captureListing.js +292 -332
- package/dist/commands/changelog.js +1 -1
- package/dist/commands/chat.js +51 -53
- package/dist/commands/check.d.ts +1 -1
- package/dist/commands/check.js +44 -44
- package/dist/commands/clients.d.ts +3 -3
- package/dist/commands/clients.js +67 -64
- package/dist/commands/comments.js +36 -29
- package/dist/commands/create.js +305 -312
- package/dist/commands/createRemixContent.d.ts +1 -1
- package/dist/commands/createRemixContent.js +65 -60
- package/dist/commands/creations.js +205 -135
- package/dist/commands/credits.js +37 -27
- package/dist/commands/detail.js +40 -34
- package/dist/commands/dev.js +103 -126
- package/dist/commands/devBrowser.js +74 -65
- package/dist/commands/devRuntimeAssets.d.ts +4 -4
- package/dist/commands/devRuntimeAssets.js +38 -40
- package/dist/commands/devServer.d.ts +4 -4
- package/dist/commands/devServer.js +183 -174
- package/dist/commands/devShared.d.ts +3 -3
- package/dist/commands/devShared.js +31 -31
- package/dist/commands/doctor.d.ts +5 -5
- package/dist/commands/doctor.js +63 -57
- package/dist/commands/documentation.js +42 -32
- package/dist/commands/feedback.js +59 -42
- package/dist/commands/format.js +9 -9
- package/dist/commands/generation.d.ts +2 -2
- package/dist/commands/generation.js +344 -326
- package/dist/commands/init.d.ts +4 -4
- package/dist/commands/init.js +64 -61
- package/dist/commands/login.d.ts +2 -2
- package/dist/commands/login.js +42 -62
- package/dist/commands/logout.js +4 -4
- package/dist/commands/marketing.d.ts +8 -8
- package/dist/commands/marketing.js +246 -297
- package/dist/commands/notes.js +19 -19
- package/dist/commands/notifications.js +34 -22
- package/dist/commands/npmProcess.js +3 -3
- package/dist/commands/ownedRuntimeImageValidation.d.ts +1 -1
- package/dist/commands/ownedRuntimeImageValidation.js +19 -17
- package/dist/commands/play.js +12 -21
- package/dist/commands/publicPages.js +8 -4
- package/dist/commands/review.js +123 -110
- package/dist/commands/search.js +107 -88
- package/dist/commands/tags.js +10 -12
- package/dist/commands/taskCaptureSession.d.ts +3 -3
- package/dist/commands/taskCaptureSession.js +3 -3
- package/dist/commands/tweaks.js +25 -23
- package/dist/commands/upgrade.js +40 -31
- package/dist/commands/upload-content.d.ts +5 -5
- package/dist/commands/upload-content.js +130 -122
- package/dist/commands/upload-graph.d.ts +1 -1
- package/dist/commands/upload-graph.js +7 -11
- package/dist/commands/upload.d.ts +7 -7
- package/dist/commands/upload.js +196 -217
- package/dist/commands/validate.js +33 -32
- package/dist/commands/versionsBrowse.js +61 -51
- package/dist/commands/whoami.js +11 -14
- package/dist/commands/worker/archive-staging.d.ts +9 -0
- package/dist/commands/worker/archive-staging.js +257 -0
- package/dist/commands/worker/instrument-evidence.d.ts +1 -1
- package/dist/commands/worker/instrument-evidence.js +41 -43
- package/dist/commands/worker/provider-telemetry.d.ts +2 -1
- package/dist/commands/worker/provider-telemetry.js +181 -64
- package/dist/commands/worker/runtime.d.ts +18 -3
- package/dist/commands/worker/runtime.js +291 -239
- package/dist/commands/worker.d.ts +83 -22
- package/dist/commands/worker.js +1980 -1411
- package/dist/commands/workspaces.d.ts +2 -2
- package/dist/commands/workspaces.js +57 -57
- package/dist/config.js +23 -20
- package/dist/devAuth.d.ts +3 -3
- package/dist/devAuth.js +20 -17
- package/dist/environment.d.ts +1 -1
- package/dist/environment.js +34 -34
- package/dist/errors.d.ts +1 -1
- package/dist/errors.js +7 -7
- package/dist/externalAssetPackValidation.d.ts +1 -1
- package/dist/externalAssetPackValidation.js +9 -9
- package/dist/http.d.ts +1 -1
- package/dist/http.js +9 -9
- package/dist/index.js +657 -664
- package/dist/listingCaptureLease.js +23 -23
- package/dist/listingPreflight.d.ts +2 -2
- package/dist/listingPreflight.js +33 -33
- package/dist/messages.js +6 -14
- package/dist/output.js +9 -9
- package/dist/playwright.d.ts +1 -1
- package/dist/playwright.js +35 -40
- package/dist/proxyFetch.js +30 -27
- package/dist/recorderRelease.js +8 -8
- package/dist/refs.d.ts +5 -5
- package/dist/refs.js +40 -37
- package/dist/sessionCookie.js +15 -21
- package/dist/shellProbe.js +5 -5
- package/dist/taskSelection.d.ts +3 -3
- package/dist/taskSelection.js +67 -62
- package/dist/taskUtils.d.ts +1 -1
- package/dist/taskUtils.js +4 -4
- package/dist/tweakStaleness.d.ts +3 -3
- package/dist/tweakStaleness.js +8 -8
- package/dist/uploadLog.d.ts +3 -3
- package/dist/uploadLog.js +51 -51
- package/dist/versionCompare.js +3 -3
- package/dist/workerAppProject.d.ts +1 -1
- package/dist/workerAppProject.js +10 -17
- package/dist/workspaceAuth.d.ts +1 -1
- package/dist/workspaceAuth.js +28 -22
- package/node_modules/@playdrop/ai-client/dist/index.d.ts +35 -35
- package/node_modules/@playdrop/ai-client/dist/index.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/client.d.ts +34 -33
- package/node_modules/@playdrop/api-client/dist/client.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/core/errors.d.ts +1 -1
- package/node_modules/@playdrop/api-client/dist/core/errors.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/core/request.d.ts +2 -2
- package/node_modules/@playdrop/api-client/dist/core/request.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/admin.d.ts +2 -2
- package/node_modules/@playdrop/api-client/dist/domains/admin.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/admin.js +4 -1
- package/node_modules/@playdrop/api-client/dist/domains/agent-tasks.d.ts +4 -3
- package/node_modules/@playdrop/api-client/dist/domains/agent-tasks.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/agent-tasks.js +12 -0
- package/node_modules/@playdrop/api-client/dist/domains/ai.d.ts +2 -2
- package/node_modules/@playdrop/api-client/dist/domains/ai.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/apps.d.ts +4 -4
- package/node_modules/@playdrop/api-client/dist/domains/apps.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/asset-packs.d.ts +4 -4
- package/node_modules/@playdrop/api-client/dist/domains/asset-packs.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/assets.d.ts +4 -4
- package/node_modules/@playdrop/api-client/dist/domains/assets.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/auth.d.ts +2 -2
- package/node_modules/@playdrop/api-client/dist/domains/auth.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/chat.d.ts +2 -2
- package/node_modules/@playdrop/api-client/dist/domains/chat.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/comments.d.ts +3 -3
- package/node_modules/@playdrop/api-client/dist/domains/comments.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/free-credits.d.ts +2 -2
- package/node_modules/@playdrop/api-client/dist/domains/free-credits.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/me.d.ts +2 -2
- package/node_modules/@playdrop/api-client/dist/domains/me.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/payments.d.ts +2 -2
- package/node_modules/@playdrop/api-client/dist/domains/payments.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/player-meta.d.ts +2 -2
- package/node_modules/@playdrop/api-client/dist/domains/player-meta.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/playtrade.d.ts +3 -3
- package/node_modules/@playdrop/api-client/dist/domains/playtrade.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/playtrade.js +2 -2
- package/node_modules/@playdrop/api-client/dist/domains/search.d.ts +2 -2
- package/node_modules/@playdrop/api-client/dist/domains/search.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/tags.d.ts +2 -2
- package/node_modules/@playdrop/api-client/dist/domains/tags.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/index.d.ts +19 -18
- package/node_modules/@playdrop/api-client/dist/index.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/index.js +7 -2
- package/node_modules/@playdrop/boxel-core/dist/src/entity-cleaner.d.ts +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/entity-cleaner.js +47 -47
- package/node_modules/@playdrop/boxel-core/dist/src/entity-cleaner.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/entity-utils.d.ts +3 -3
- package/node_modules/@playdrop/boxel-core/dist/src/entity-utils.js +32 -47
- package/node_modules/@playdrop/boxel-core/dist/src/entity-utils.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/format-utils.js +16 -18
- package/node_modules/@playdrop/boxel-core/dist/src/format-utils.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/geometry.d.ts +2 -2
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/index.d.ts +4 -4
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/common.d.ts +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/index.d.ts +3 -3
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/textured-builder.d.ts +2 -2
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/textured-builder.js +44 -45
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/textured-builder.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/types.d.ts +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/voxel-builder.d.ts +2 -2
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/voxel-builder.js +40 -44
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/voxel-builder.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/builder.d.ts +2 -2
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/builder.js +30 -34
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/builder.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/index.d.ts +4 -4
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/index.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/scanner.d.ts +3 -3
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/scanner.js +23 -20
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/scanner.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/textures/artifacts.d.ts +3 -3
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/textures/artifacts.js +3 -3
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/textures/face-map.d.ts +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/textures/face-map.js +21 -21
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/textures/face-map.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/templates/index.d.ts +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/templates/index.js +2 -2
- package/node_modules/@playdrop/boxel-core/dist/src/index.d.ts +19 -19
- package/node_modules/@playdrop/boxel-core/dist/src/materials.d.ts +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/materials.js +12 -16
- package/node_modules/@playdrop/boxel-core/dist/src/materials.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/palette_tools.d.ts +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/palette_tools.js +38 -41
- package/node_modules/@playdrop/boxel-core/dist/src/palette_tools.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/serialization.d.ts +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/serialization.js +54 -56
- package/node_modules/@playdrop/boxel-core/dist/src/serialization.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/textures.d.ts +3 -3
- package/node_modules/@playdrop/boxel-core/dist/src/textures.js +39 -45
- package/node_modules/@playdrop/boxel-core/dist/src/textures.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/infer-face.d.ts +2 -2
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/infer-face.js +39 -43
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/infer-face.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/layer-mode.d.ts +3 -3
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/layer-mode.js +35 -35
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/layer-mode.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/merge-overlay.d.ts +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/merge-overlay.js +18 -18
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/merge-overlay.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/slice.d.ts +3 -3
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/slice.js +50 -48
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/slice.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/upscale.d.ts +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/upscale.js +22 -26
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/upscale.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/voxels/slice.d.ts +2 -2
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/voxels/slice.js +8 -8
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/voxels/slice.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/voxels/textured-to-voxel.d.ts +2 -2
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/voxels/textured-to-voxel.js +23 -28
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/voxels/textured-to-voxel.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/types.d.ts +8 -8
- package/node_modules/@playdrop/boxel-core/dist/src/validation.d.ts +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/validation.js +93 -95
- package/node_modules/@playdrop/boxel-core/dist/src/validation.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/voxels/greedy-mesher.d.ts +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/voxels/greedy-mesher.js +2 -2
- package/node_modules/@playdrop/boxel-core/dist/src/voxels/greedy-mesher.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/voxels.d.ts +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/voxels.js +2 -7
- package/node_modules/@playdrop/boxel-core/dist/src/voxels.js.map +1 -1
- package/node_modules/@playdrop/boxel-three/dist/src/animations.d.ts +3 -3
- package/node_modules/@playdrop/boxel-three/dist/src/builders.d.ts +4 -4
- package/node_modules/@playdrop/boxel-three/dist/src/context.d.ts +3 -3
- package/node_modules/@playdrop/boxel-three/dist/src/exporters/glb.d.ts +6 -6
- package/node_modules/@playdrop/boxel-three/dist/src/exporters/glb.js +9 -1
- package/node_modules/@playdrop/boxel-three/dist/src/exporters/image.d.ts +3 -3
- package/node_modules/@playdrop/boxel-three/dist/src/index.d.ts +17 -17
- package/node_modules/@playdrop/boxel-three/dist/src/instantiate.d.ts +9 -9
- package/node_modules/@playdrop/boxel-three/dist/src/nodes.d.ts +3 -3
- package/node_modules/@playdrop/boxel-three/dist/src/nodes.js +1 -1
- package/node_modules/@playdrop/boxel-three/dist/src/overlays.d.ts +2 -2
- package/node_modules/@playdrop/boxel-three/dist/src/primitives.d.ts +1 -1
- package/node_modules/@playdrop/boxel-three/dist/src/scene.d.ts +1 -1
- package/node_modules/@playdrop/boxel-three/dist/src/skinned-mesh.d.ts +2 -2
- package/node_modules/@playdrop/boxel-three/dist/src/texture-atlas.d.ts +1 -1
- package/node_modules/@playdrop/boxel-three/dist/src/textures.d.ts +3 -3
- package/node_modules/@playdrop/boxel-three/dist/src/types.d.ts +4 -4
- package/node_modules/@playdrop/boxel-three/dist/src/voxels/faces.d.ts +2 -2
- package/node_modules/@playdrop/boxel-three/dist/src/voxels/mesher.d.ts +1 -1
- package/node_modules/@playdrop/boxel-three/dist/test/fixtures/render-worker.d.ts +1 -1
- package/node_modules/@playdrop/config/client-meta.json +4 -4
- package/node_modules/@playdrop/config/dist/src/client-meta.d.ts +1 -1
- package/node_modules/@playdrop/config/dist/src/client-meta.d.ts.map +1 -1
- package/node_modules/@playdrop/config/dist/src/client-meta.js +10 -10
- package/node_modules/@playdrop/config/dist/src/constants.js +10 -10
- package/node_modules/@playdrop/config/dist/src/creator-plans.d.ts +1 -1
- package/node_modules/@playdrop/config/dist/src/creator-plans.d.ts.map +1 -1
- package/node_modules/@playdrop/config/dist/src/creator-plans.js +27 -28
- package/node_modules/@playdrop/config/dist/src/deployment.d.ts +4 -4
- package/node_modules/@playdrop/config/dist/src/deployment.d.ts.map +1 -1
- package/node_modules/@playdrop/config/dist/src/deployment.js +42 -41
- package/node_modules/@playdrop/config/dist/src/game-arena.js +12 -12
- package/node_modules/@playdrop/config/dist/src/index.d.ts +9 -9
- package/node_modules/@playdrop/config/dist/src/index.d.ts.map +1 -1
- package/node_modules/@playdrop/config/dist/src/index.js +24 -25
- package/node_modules/@playdrop/config/dist/src/public-deployment.d.ts +4 -4
- package/node_modules/@playdrop/config/dist/src/public-deployment.d.ts.map +1 -1
- package/node_modules/@playdrop/config/dist/src/public-deployment.js +41 -39
- package/node_modules/@playdrop/config/dist/src/runtime-client-meta.js +1 -3
- package/node_modules/@playdrop/config/dist/src/runtime-service-origins.d.ts.map +1 -1
- package/node_modules/@playdrop/config/dist/src/runtime-service-origins.js +23 -25
- package/node_modules/@playdrop/config/dist/src/server/fastify.d.ts +5 -5
- package/node_modules/@playdrop/config/dist/src/server/fastify.d.ts.map +1 -1
- package/node_modules/@playdrop/config/dist/src/server/fastify.js +44 -46
- package/node_modules/@playdrop/config/dist/src/server/logging.d.ts +1 -1
- package/node_modules/@playdrop/config/dist/src/server/logging.d.ts.map +1 -1
- package/node_modules/@playdrop/config/dist/src/server/logging.js +6 -8
- package/node_modules/@playdrop/config/dist/src/types.d.ts +2 -2
- package/node_modules/@playdrop/config/dist/test/creator-plans.test.js +12 -12
- package/node_modules/@playdrop/config/dist/test/deployment.test.js +59 -59
- package/node_modules/@playdrop/config/dist/test/fastify.test.js +4 -4
- package/node_modules/@playdrop/config/dist/test/game-arena.test.js +8 -8
- package/node_modules/@playdrop/config/dist/test/logging.test.js +6 -6
- package/node_modules/@playdrop/config/dist/test/validateClientEnvironment.test.js +57 -57
- package/node_modules/@playdrop/config/dist/tsconfig.tsbuildinfo +1 -1
- package/node_modules/@playdrop/types/dist/agent-task-playtest.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/agent-task-terminal.d.ts +2 -2
- package/node_modules/@playdrop/types/dist/agent-task-terminal.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/api.d.ts +314 -250
- package/node_modules/@playdrop/types/dist/api.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/api.js +40 -59
- package/node_modules/@playdrop/types/dist/app-capability-filters.d.ts +2 -2
- package/node_modules/@playdrop/types/dist/app-playtest-tape.d.ts +6 -6
- package/node_modules/@playdrop/types/dist/app-playtest-tape.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/app-review.d.ts +2 -2
- package/node_modules/@playdrop/types/dist/app-review.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/app-review.js +1 -6
- package/node_modules/@playdrop/types/dist/app.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/asset-pack.d.ts +5 -5
- package/node_modules/@playdrop/types/dist/asset-spec.d.ts +4 -4
- package/node_modules/@playdrop/types/dist/asset.d.ts +11 -11
- package/node_modules/@playdrop/types/dist/attachment-policy.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/chat.d.ts +3 -3
- package/node_modules/@playdrop/types/dist/creator-public-image.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/graph.d.ts +4 -4
- package/node_modules/@playdrop/types/dist/index.d.ts +25 -25
- package/node_modules/@playdrop/types/dist/instrument-evidence.d.ts +2 -2
- package/node_modules/@playdrop/types/dist/instrument-evidence.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/instrument-evidence.js +2 -11
- package/node_modules/@playdrop/types/dist/locale.d.ts +2 -2
- package/node_modules/@playdrop/types/dist/locale.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/locale.js +2 -17
- package/node_modules/@playdrop/types/dist/owned-assets.d.ts +2 -2
- package/node_modules/@playdrop/types/dist/owned-assets.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/player-meta.d.ts +3 -3
- package/node_modules/@playdrop/types/dist/player-meta.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/playtest-notes.d.ts +11 -11
- package/node_modules/@playdrop/types/dist/playtest-notes.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/playtrade.d.ts +8 -5
- package/node_modules/@playdrop/types/dist/playtrade.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/realtime.d.ts +1 -1
- package/node_modules/@playdrop/types/dist/tweaks.d.ts +4 -4
- package/node_modules/@playdrop/types/dist/tweaks.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/tweaks.js +12 -2
- package/node_modules/@playdrop/types/dist/version.d.ts +14 -14
- package/node_modules/@playdrop/types/dist/version.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/version.js +4 -1
- package/node_modules/@playdrop/vox-three/dist/src/index.d.ts +1 -1
- package/node_modules/@playdrop/vox-three/dist/src/vox.d.ts +2 -2
- package/node_modules/@playdrop/vox-three/dist/src/vox.js +20 -18
- package/node_modules/@playdrop/vox-three/dist/src/vox.js.map +1 -1
- package/node_modules/@playdrop/vox-three/dist/test/vox.test.js +11 -14
- package/node_modules/@playdrop/vox-three/dist/test/vox.test.js.map +1 -1
- package/package.json +1 -1
|
@@ -6,10 +6,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.calculateWeeklyUsageRouting = calculateWeeklyUsageRouting;
|
|
7
7
|
exports.buildCodexProviderTelemetry = buildCodexProviderTelemetry;
|
|
8
8
|
exports.buildClaudeProviderTelemetry = buildClaudeProviderTelemetry;
|
|
9
|
+
exports.buildGrokProviderTelemetry = buildGrokProviderTelemetry;
|
|
9
10
|
exports.probeWorkerProviderTelemetry = probeWorkerProviderTelemetry;
|
|
10
11
|
exports.mergeWorkerProviderTelemetry = mergeWorkerProviderTelemetry;
|
|
11
12
|
exports.preserveWorkerProviderTelemetry = preserveWorkerProviderTelemetry;
|
|
12
13
|
const node_child_process_1 = require("node:child_process");
|
|
14
|
+
const promises_1 = require("node:fs/promises");
|
|
15
|
+
const node_os_1 = __importDefault(require("node:os"));
|
|
16
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
13
17
|
const node_process_1 = __importDefault(require("node:process"));
|
|
14
18
|
const node_util_1 = require("node:util");
|
|
15
19
|
const clientInfo_1 = require("../../clientInfo");
|
|
@@ -19,15 +23,13 @@ const WEEKLY_WINDOW_MINUTES = 7 * 24 * 60;
|
|
|
19
23
|
const WEEKLY_WINDOW_MS = 7 * 24 * 60 * 60 * 1000;
|
|
20
24
|
const WEEKLY_USAGE_RESERVE_PERCENT = 10;
|
|
21
25
|
function asObject(value) {
|
|
22
|
-
return typeof value ===
|
|
23
|
-
? value
|
|
24
|
-
: null;
|
|
26
|
+
return typeof value === "object" && value !== null && !Array.isArray(value) ? value : null;
|
|
25
27
|
}
|
|
26
28
|
function optionalString(value) {
|
|
27
|
-
return typeof value ===
|
|
29
|
+
return typeof value === "string" && value.trim() ? value.trim() : null;
|
|
28
30
|
}
|
|
29
31
|
function normalizePercent(value, field) {
|
|
30
|
-
if (typeof value !==
|
|
32
|
+
if (typeof value !== "number" || !Number.isFinite(value) || value < 0 || value > 100) {
|
|
31
33
|
throw new Error(`${field}_invalid`);
|
|
32
34
|
}
|
|
33
35
|
return Math.round(value * 10) / 10;
|
|
@@ -41,11 +43,10 @@ function calculateWeeklyUsageRouting(remainingPercent, resetsAt, checkedAt) {
|
|
|
41
43
|
const resetMs = new Date(resetsAt).getTime();
|
|
42
44
|
const checkedMs = new Date(checkedAt).getTime();
|
|
43
45
|
if (!Number.isFinite(resetMs) || !Number.isFinite(checkedMs)) {
|
|
44
|
-
throw new Error(
|
|
46
|
+
throw new Error("worker_weekly_usage_routing_time_invalid");
|
|
45
47
|
}
|
|
46
48
|
const remainingWindowRatio = Math.max(0, Math.min(1, (resetMs - checkedMs) / WEEKLY_WINDOW_MS));
|
|
47
|
-
const targetRemainingPercent = roundPercent(WEEKLY_USAGE_RESERVE_PERCENT
|
|
48
|
-
+ (100 - WEEKLY_USAGE_RESERVE_PERCENT) * remainingWindowRatio);
|
|
49
|
+
const targetRemainingPercent = roundPercent(WEEKLY_USAGE_RESERVE_PERCENT + (100 - WEEKLY_USAGE_RESERVE_PERCENT) * remainingWindowRatio);
|
|
49
50
|
return {
|
|
50
51
|
targetRemainingPercent,
|
|
51
52
|
surplusPercent: roundPercent(remainingPercent - targetRemainingPercent),
|
|
@@ -56,15 +57,15 @@ function unavailableTelemetry(checkedAt) {
|
|
|
56
57
|
account: null,
|
|
57
58
|
plan: null,
|
|
58
59
|
weeklyUsage: null,
|
|
59
|
-
weeklyUsageStatus:
|
|
60
|
+
weeklyUsageStatus: "UNAVAILABLE",
|
|
60
61
|
telemetryCheckedAt: checkedAt,
|
|
61
62
|
};
|
|
62
63
|
}
|
|
63
64
|
function accountTypeLabel(type) {
|
|
64
|
-
if (type ===
|
|
65
|
-
return
|
|
66
|
-
if (type ===
|
|
67
|
-
return
|
|
65
|
+
if (type === "apiKey")
|
|
66
|
+
return "API key";
|
|
67
|
+
if (type === "amazonBedrock")
|
|
68
|
+
return "Amazon Bedrock";
|
|
68
69
|
return type;
|
|
69
70
|
}
|
|
70
71
|
function readCodexWeeklyWindow(rateLimitsResult) {
|
|
@@ -89,12 +90,12 @@ function buildCodexProviderTelemetry(accountResult, rateLimitsResult, checkedAt)
|
|
|
89
90
|
const accountType = optionalString(account.type);
|
|
90
91
|
const accountLabel = optionalString(account.email) ?? accountTypeLabel(accountType);
|
|
91
92
|
const plan = optionalString(account.planType);
|
|
92
|
-
if (accountType !==
|
|
93
|
+
if (accountType !== "chatgpt") {
|
|
93
94
|
return {
|
|
94
95
|
account: accountLabel,
|
|
95
96
|
plan,
|
|
96
97
|
weeklyUsage: null,
|
|
97
|
-
weeklyUsageStatus:
|
|
98
|
+
weeklyUsageStatus: "NOT_APPLICABLE",
|
|
98
99
|
telemetryCheckedAt: checkedAt,
|
|
99
100
|
};
|
|
100
101
|
}
|
|
@@ -104,15 +105,15 @@ function buildCodexProviderTelemetry(accountResult, rateLimitsResult, checkedAt)
|
|
|
104
105
|
account: accountLabel,
|
|
105
106
|
plan,
|
|
106
107
|
weeklyUsage: null,
|
|
107
|
-
weeklyUsageStatus:
|
|
108
|
+
weeklyUsageStatus: "UNAVAILABLE",
|
|
108
109
|
telemetryCheckedAt: checkedAt,
|
|
109
110
|
};
|
|
110
111
|
}
|
|
111
|
-
const usedPercent = normalizePercent(weeklyWindow.usedPercent,
|
|
112
|
+
const usedPercent = normalizePercent(weeklyWindow.usedPercent, "codex_weekly_usage");
|
|
112
113
|
const remainingPercent = roundPercent(100 - usedPercent);
|
|
113
114
|
const resetsAtSeconds = weeklyWindow.resetsAt;
|
|
114
|
-
if (typeof resetsAtSeconds !==
|
|
115
|
-
throw new Error(
|
|
115
|
+
if (typeof resetsAtSeconds !== "number" || !Number.isFinite(resetsAtSeconds) || resetsAtSeconds <= 0) {
|
|
116
|
+
throw new Error("codex_weekly_reset_invalid");
|
|
116
117
|
}
|
|
117
118
|
const resetsAt = new Date(resetsAtSeconds * 1000).toISOString();
|
|
118
119
|
return {
|
|
@@ -124,14 +125,14 @@ function buildCodexProviderTelemetry(accountResult, rateLimitsResult, checkedAt)
|
|
|
124
125
|
resetsAt,
|
|
125
126
|
...calculateWeeklyUsageRouting(remainingPercent, resetsAt, checkedAt),
|
|
126
127
|
},
|
|
127
|
-
weeklyUsageStatus:
|
|
128
|
+
weeklyUsageStatus: "AVAILABLE",
|
|
128
129
|
telemetryCheckedAt: checkedAt,
|
|
129
130
|
};
|
|
130
131
|
}
|
|
131
132
|
function claudePlanLabel(subscriptionType, rateLimitTier) {
|
|
132
133
|
const tierMatch = rateLimitTier?.match(/^default_claude_(pro|max)(?:_(\d+)x)?$/i);
|
|
133
134
|
if (tierMatch) {
|
|
134
|
-
const name = tierMatch[1]?.toLowerCase() ===
|
|
135
|
+
const name = tierMatch[1]?.toLowerCase() === "max" ? "Max" : "Pro";
|
|
135
136
|
return tierMatch[2] ? `${name} ${tierMatch[2]}x` : name;
|
|
136
137
|
}
|
|
137
138
|
if (!subscriptionType)
|
|
@@ -148,7 +149,7 @@ function buildClaudeProviderTelemetry(authStatus, credentialMetadata, usageResul
|
|
|
148
149
|
account,
|
|
149
150
|
plan,
|
|
150
151
|
weeklyUsage: null,
|
|
151
|
-
weeklyUsageStatus:
|
|
152
|
+
weeklyUsageStatus: "UNAVAILABLE",
|
|
152
153
|
telemetryCheckedAt: checkedAt,
|
|
153
154
|
};
|
|
154
155
|
}
|
|
@@ -158,21 +159,19 @@ function buildClaudeProviderTelemetry(authStatus, credentialMetadata, usageResul
|
|
|
158
159
|
account,
|
|
159
160
|
plan,
|
|
160
161
|
weeklyUsage: null,
|
|
161
|
-
weeklyUsageStatus:
|
|
162
|
+
weeklyUsageStatus: "UNAVAILABLE",
|
|
162
163
|
telemetryCheckedAt: checkedAt,
|
|
163
164
|
};
|
|
164
165
|
}
|
|
165
|
-
const usedPercent = normalizePercent(sevenDay.utilization,
|
|
166
|
+
const usedPercent = normalizePercent(sevenDay.utilization, "claude_weekly_usage");
|
|
166
167
|
const remainingPercent = roundPercent(100 - usedPercent);
|
|
167
168
|
const rawReset = sevenDay.resets_at;
|
|
168
|
-
const resetsAt = rawReset === null
|
|
169
|
-
? null
|
|
170
|
-
: optionalString(rawReset);
|
|
169
|
+
const resetsAt = rawReset === null ? null : optionalString(rawReset);
|
|
171
170
|
if (rawReset !== null && !resetsAt) {
|
|
172
|
-
throw new Error(
|
|
171
|
+
throw new Error("claude_weekly_reset_invalid");
|
|
173
172
|
}
|
|
174
173
|
if (resetsAt && Number.isNaN(new Date(resetsAt).getTime())) {
|
|
175
|
-
throw new Error(
|
|
174
|
+
throw new Error("claude_weekly_reset_invalid");
|
|
176
175
|
}
|
|
177
176
|
return {
|
|
178
177
|
account,
|
|
@@ -183,15 +182,72 @@ function buildClaudeProviderTelemetry(authStatus, credentialMetadata, usageResul
|
|
|
183
182
|
resetsAt: resetsAt ? new Date(resetsAt).toISOString() : null,
|
|
184
183
|
...calculateWeeklyUsageRouting(remainingPercent, resetsAt ? new Date(resetsAt).toISOString() : null, checkedAt),
|
|
185
184
|
},
|
|
186
|
-
weeklyUsageStatus:
|
|
185
|
+
weeklyUsageStatus: "AVAILABLE",
|
|
186
|
+
telemetryCheckedAt: checkedAt,
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
function readGrokTier(authEntry) {
|
|
190
|
+
const token = optionalString(authEntry?.key);
|
|
191
|
+
const payload = token?.split(".")[1];
|
|
192
|
+
if (!payload)
|
|
193
|
+
return null;
|
|
194
|
+
try {
|
|
195
|
+
const claims = asObject(JSON.parse(Buffer.from(payload, "base64url").toString("utf8")));
|
|
196
|
+
return typeof claims?.tier === "number" && Number.isFinite(claims.tier) ? claims.tier : null;
|
|
197
|
+
}
|
|
198
|
+
catch {
|
|
199
|
+
return null;
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
function grokPlanLabel(authEntry, billingConfig) {
|
|
203
|
+
const configured = optionalString(billingConfig?.subscriptionTier) ?? optionalString(billingConfig?.plan);
|
|
204
|
+
if (configured)
|
|
205
|
+
return configured;
|
|
206
|
+
const tier = readGrokTier(authEntry);
|
|
207
|
+
if (tier === 4)
|
|
208
|
+
return "X Premium+";
|
|
209
|
+
return tier === null ? null : `Tier ${tier}`;
|
|
210
|
+
}
|
|
211
|
+
function buildGrokProviderTelemetry(authEntryValue, billingResult, checkedAt) {
|
|
212
|
+
const authEntry = asObject(authEntryValue);
|
|
213
|
+
const billingConfig = asObject(asObject(billingResult)?.config);
|
|
214
|
+
const account = optionalString(authEntry?.email);
|
|
215
|
+
const plan = grokPlanLabel(authEntry, billingConfig);
|
|
216
|
+
if (!authEntry || !optionalString(authEntry.key) || !billingConfig) {
|
|
217
|
+
return {
|
|
218
|
+
account,
|
|
219
|
+
plan,
|
|
220
|
+
weeklyUsage: null,
|
|
221
|
+
weeklyUsageStatus: "UNAVAILABLE",
|
|
222
|
+
telemetryCheckedAt: checkedAt,
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
const currentPeriod = asObject(billingConfig.currentPeriod);
|
|
226
|
+
const usedPercent = normalizePercent(billingConfig.creditUsagePercent, "grok_weekly_usage");
|
|
227
|
+
const rawReset = optionalString(currentPeriod?.end);
|
|
228
|
+
if (!rawReset || Number.isNaN(new Date(rawReset).getTime())) {
|
|
229
|
+
throw new Error("grok_weekly_reset_invalid");
|
|
230
|
+
}
|
|
231
|
+
const resetsAt = new Date(rawReset).toISOString();
|
|
232
|
+
const remainingPercent = roundPercent(100 - usedPercent);
|
|
233
|
+
return {
|
|
234
|
+
account,
|
|
235
|
+
plan,
|
|
236
|
+
weeklyUsage: {
|
|
237
|
+
usedPercent,
|
|
238
|
+
remainingPercent,
|
|
239
|
+
resetsAt,
|
|
240
|
+
...calculateWeeklyUsageRouting(remainingPercent, resetsAt, checkedAt),
|
|
241
|
+
},
|
|
242
|
+
weeklyUsageStatus: "AVAILABLE",
|
|
187
243
|
telemetryCheckedAt: checkedAt,
|
|
188
244
|
};
|
|
189
245
|
}
|
|
190
246
|
function runCodexAccountRequests() {
|
|
191
247
|
return new Promise((resolve, reject) => {
|
|
192
|
-
const child = (0, node_child_process_1.spawn)(
|
|
248
|
+
const child = (0, node_child_process_1.spawn)("codex", ["app-server"], { stdio: ["pipe", "pipe", "pipe"] });
|
|
193
249
|
let settled = false;
|
|
194
|
-
let stdoutBuffer =
|
|
250
|
+
let stdoutBuffer = "";
|
|
195
251
|
let accountReceived = false;
|
|
196
252
|
let rateLimitsReceived = false;
|
|
197
253
|
let accountResult;
|
|
@@ -210,17 +266,17 @@ function runCodexAccountRequests() {
|
|
|
210
266
|
}
|
|
211
267
|
};
|
|
212
268
|
const timeout = setTimeout(() => {
|
|
213
|
-
finish(new Error(
|
|
269
|
+
finish(new Error("codex_telemetry_timeout"));
|
|
214
270
|
}, PROVIDER_TELEMETRY_TIMEOUT_MS);
|
|
215
|
-
child.once(
|
|
216
|
-
child.once(
|
|
271
|
+
child.once("error", () => finish(new Error("codex_app_server_unavailable")));
|
|
272
|
+
child.once("close", () => {
|
|
217
273
|
if (!settled)
|
|
218
|
-
finish(new Error(
|
|
274
|
+
finish(new Error("codex_app_server_closed"));
|
|
219
275
|
});
|
|
220
|
-
child.stdout.on(
|
|
276
|
+
child.stdout.on("data", (chunk) => {
|
|
221
277
|
stdoutBuffer += chunk.toString();
|
|
222
|
-
while (stdoutBuffer.includes(
|
|
223
|
-
const newline = stdoutBuffer.indexOf(
|
|
278
|
+
while (stdoutBuffer.includes("\n")) {
|
|
279
|
+
const newline = stdoutBuffer.indexOf("\n");
|
|
224
280
|
const line = stdoutBuffer.slice(0, newline).trim();
|
|
225
281
|
stdoutBuffer = stdoutBuffer.slice(newline + 1);
|
|
226
282
|
if (!line)
|
|
@@ -229,18 +285,18 @@ function runCodexAccountRequests() {
|
|
|
229
285
|
try {
|
|
230
286
|
const parsed = asObject(JSON.parse(line));
|
|
231
287
|
if (!parsed)
|
|
232
|
-
throw new Error(
|
|
288
|
+
throw new Error("invalid_message");
|
|
233
289
|
message = parsed;
|
|
234
290
|
}
|
|
235
291
|
catch {
|
|
236
|
-
finish(new Error(
|
|
292
|
+
finish(new Error("codex_app_server_response_invalid"));
|
|
237
293
|
return;
|
|
238
294
|
}
|
|
239
295
|
if (message.id !== 1 && message.id !== 2)
|
|
240
296
|
continue;
|
|
241
297
|
if (message.error) {
|
|
242
298
|
if (message.id === 1) {
|
|
243
|
-
finish(new Error(
|
|
299
|
+
finish(new Error("codex_account_request_failed"));
|
|
244
300
|
return;
|
|
245
301
|
}
|
|
246
302
|
rateLimitsReceived = true;
|
|
@@ -261,22 +317,22 @@ function runCodexAccountRequests() {
|
|
|
261
317
|
finish();
|
|
262
318
|
}
|
|
263
319
|
});
|
|
264
|
-
child.once(
|
|
320
|
+
child.once("spawn", () => {
|
|
265
321
|
const messages = [
|
|
266
322
|
{
|
|
267
|
-
method:
|
|
323
|
+
method: "initialize",
|
|
268
324
|
id: 0,
|
|
269
325
|
params: {
|
|
270
326
|
clientInfo: {
|
|
271
|
-
name:
|
|
272
|
-
title:
|
|
327
|
+
name: "playdrop_worker",
|
|
328
|
+
title: "PlayDrop Worker",
|
|
273
329
|
version: (0, clientInfo_1.getCliVersion)(),
|
|
274
330
|
},
|
|
275
331
|
},
|
|
276
332
|
},
|
|
277
|
-
{ method:
|
|
278
|
-
{ method:
|
|
279
|
-
{ method:
|
|
333
|
+
{ method: "initialized", params: {} },
|
|
334
|
+
{ method: "account/read", id: 1, params: { refreshToken: false } },
|
|
335
|
+
{ method: "account/rateLimits/read", id: 2 },
|
|
280
336
|
];
|
|
281
337
|
for (const message of messages) {
|
|
282
338
|
child.stdin.write(`${JSON.stringify(message)}\n`);
|
|
@@ -285,25 +341,28 @@ function runCodexAccountRequests() {
|
|
|
285
341
|
});
|
|
286
342
|
}
|
|
287
343
|
async function readClaudeAuthStatus() {
|
|
288
|
-
const { stdout } = await execFileAsync(
|
|
344
|
+
const { stdout } = await execFileAsync("claude", ["auth", "status", "--json"], {
|
|
289
345
|
timeout: PROVIDER_TELEMETRY_TIMEOUT_MS,
|
|
290
346
|
maxBuffer: 1024 * 1024,
|
|
291
347
|
});
|
|
292
348
|
const parsed = asObject(JSON.parse(stdout));
|
|
293
349
|
if (!parsed)
|
|
294
|
-
throw new Error(
|
|
350
|
+
throw new Error("claude_auth_status_invalid");
|
|
295
351
|
return parsed;
|
|
296
352
|
}
|
|
297
353
|
async function readClaudeCredentialState() {
|
|
298
|
-
if (node_process_1.default.platform !==
|
|
299
|
-
throw new Error(
|
|
354
|
+
if (node_process_1.default.platform !== "darwin") {
|
|
355
|
+
throw new Error("claude_usage_requires_macos_keychain");
|
|
300
356
|
}
|
|
301
|
-
const { stdout } = await execFileAsync(
|
|
357
|
+
const { stdout } = await execFileAsync("security", ["find-generic-password", "-s", "Claude Code-credentials", "-w"], {
|
|
358
|
+
timeout: PROVIDER_TELEMETRY_TIMEOUT_MS,
|
|
359
|
+
maxBuffer: 1024 * 1024,
|
|
360
|
+
});
|
|
302
361
|
const oauth = asObject(asObject(JSON.parse(stdout))?.claudeAiOauth);
|
|
303
362
|
const accessToken = optionalString(oauth?.accessToken);
|
|
304
363
|
const expiresAt = oauth?.expiresAt;
|
|
305
|
-
if (!accessToken || typeof expiresAt !==
|
|
306
|
-
throw new Error(
|
|
364
|
+
if (!accessToken || typeof expiresAt !== "number" || !Number.isFinite(expiresAt)) {
|
|
365
|
+
throw new Error("claude_oauth_credentials_invalid");
|
|
307
366
|
}
|
|
308
367
|
return {
|
|
309
368
|
accessToken,
|
|
@@ -312,7 +371,10 @@ async function readClaudeCredentialState() {
|
|
|
312
371
|
};
|
|
313
372
|
}
|
|
314
373
|
async function refreshClaudeAccessToken() {
|
|
315
|
-
await execFileAsync(
|
|
374
|
+
await execFileAsync("claude", ["--print", "--output-format", "json", "--max-turns", "1", "/model"], {
|
|
375
|
+
timeout: PROVIDER_TELEMETRY_TIMEOUT_MS,
|
|
376
|
+
maxBuffer: 1024 * 1024,
|
|
377
|
+
});
|
|
316
378
|
}
|
|
317
379
|
async function probeCodexProviderTelemetry(checkedAt) {
|
|
318
380
|
const result = await runCodexAccountRequests();
|
|
@@ -332,11 +394,11 @@ async function probeClaudeProviderTelemetry(checkedAt, claudeVersion) {
|
|
|
332
394
|
const timeout = setTimeout(() => controller.abort(), PROVIDER_TELEMETRY_TIMEOUT_MS);
|
|
333
395
|
try {
|
|
334
396
|
try {
|
|
335
|
-
const response = await fetch(
|
|
397
|
+
const response = await fetch("https://api.anthropic.com/api/oauth/usage", {
|
|
336
398
|
headers: {
|
|
337
399
|
authorization: `Bearer ${credentials.accessToken}`,
|
|
338
|
-
|
|
339
|
-
|
|
400
|
+
"anthropic-beta": "oauth-2025-04-20",
|
|
401
|
+
"user-agent": `claude-code/${claudeVersion ?? "unknown"}`,
|
|
340
402
|
},
|
|
341
403
|
signal: controller.signal,
|
|
342
404
|
});
|
|
@@ -353,10 +415,52 @@ async function probeClaudeProviderTelemetry(checkedAt, claudeVersion) {
|
|
|
353
415
|
clearTimeout(timeout);
|
|
354
416
|
}
|
|
355
417
|
}
|
|
418
|
+
async function readGrokAuthEntry() {
|
|
419
|
+
const grokHome = node_process_1.default.env.GROK_HOME?.trim() || node_path_1.default.join(node_os_1.default.homedir(), ".grok");
|
|
420
|
+
const authPath = node_process_1.default.env.GROK_AUTH_PATH?.trim() || node_path_1.default.join(grokHome, "auth.json");
|
|
421
|
+
if (!node_path_1.default.isAbsolute(authPath))
|
|
422
|
+
throw new Error("invalid_grok_auth_path");
|
|
423
|
+
const parsed = asObject(JSON.parse(await (0, promises_1.readFile)(authPath, "utf8")));
|
|
424
|
+
const entry = parsed
|
|
425
|
+
? Object.values(parsed)
|
|
426
|
+
.map(asObject)
|
|
427
|
+
.find((candidate) => {
|
|
428
|
+
const authMode = optionalString(candidate?.auth_mode)?.toLowerCase();
|
|
429
|
+
return (authMode === "oidc" || authMode === "oauth") && Boolean(optionalString(candidate?.key));
|
|
430
|
+
})
|
|
431
|
+
: null;
|
|
432
|
+
if (!entry)
|
|
433
|
+
throw new Error("grok_oauth_credentials_invalid");
|
|
434
|
+
return entry;
|
|
435
|
+
}
|
|
436
|
+
async function probeGrokProviderTelemetry(checkedAt) {
|
|
437
|
+
const authEntry = await readGrokAuthEntry();
|
|
438
|
+
const controller = new AbortController();
|
|
439
|
+
const timeout = setTimeout(() => controller.abort(), PROVIDER_TELEMETRY_TIMEOUT_MS);
|
|
440
|
+
try {
|
|
441
|
+
const response = await fetch("https://cli-chat-proxy.grok.com/v1/billing?format=credits", {
|
|
442
|
+
headers: {
|
|
443
|
+
authorization: `Bearer ${optionalString(authEntry.key)}`,
|
|
444
|
+
"x-grok-client-mode": "headless",
|
|
445
|
+
},
|
|
446
|
+
signal: controller.signal,
|
|
447
|
+
});
|
|
448
|
+
if (!response.ok) {
|
|
449
|
+
throw new Error(`grok_billing_http_${response.status}`);
|
|
450
|
+
}
|
|
451
|
+
return buildGrokProviderTelemetry(authEntry, await response.json(), checkedAt);
|
|
452
|
+
}
|
|
453
|
+
catch {
|
|
454
|
+
return buildGrokProviderTelemetry(authEntry, null, checkedAt);
|
|
455
|
+
}
|
|
456
|
+
finally {
|
|
457
|
+
clearTimeout(timeout);
|
|
458
|
+
}
|
|
459
|
+
}
|
|
356
460
|
async function probeWorkerProviderTelemetry(capabilities) {
|
|
357
461
|
const checkedAt = new Date().toISOString();
|
|
358
462
|
const results = await Promise.all(capabilities.agents.map(async (agent) => {
|
|
359
|
-
if (agent.agent ===
|
|
463
|
+
if (agent.agent === "CODEX") {
|
|
360
464
|
try {
|
|
361
465
|
return [agent.agent, await probeCodexProviderTelemetry(checkedAt)];
|
|
362
466
|
}
|
|
@@ -364,7 +468,7 @@ async function probeWorkerProviderTelemetry(capabilities) {
|
|
|
364
468
|
return [agent.agent, unavailableTelemetry(checkedAt)];
|
|
365
469
|
}
|
|
366
470
|
}
|
|
367
|
-
if (agent.agent ===
|
|
471
|
+
if (agent.agent === "CLAUDE_CODE") {
|
|
368
472
|
try {
|
|
369
473
|
return [agent.agent, await probeClaudeProviderTelemetry(checkedAt, agent.cliVersion ?? null)];
|
|
370
474
|
}
|
|
@@ -378,6 +482,14 @@ async function probeWorkerProviderTelemetry(capabilities) {
|
|
|
378
482
|
];
|
|
379
483
|
}
|
|
380
484
|
}
|
|
485
|
+
if (agent.agent === "GROK_BUILD") {
|
|
486
|
+
try {
|
|
487
|
+
return [agent.agent, await probeGrokProviderTelemetry(checkedAt)];
|
|
488
|
+
}
|
|
489
|
+
catch {
|
|
490
|
+
return [agent.agent, unavailableTelemetry(checkedAt)];
|
|
491
|
+
}
|
|
492
|
+
}
|
|
381
493
|
return null;
|
|
382
494
|
}));
|
|
383
495
|
return Object.fromEntries(results.filter((entry) => entry !== null));
|
|
@@ -403,13 +515,18 @@ function preserveWorkerProviderTelemetry(capabilities, previous) {
|
|
|
403
515
|
const telemetry = Object.fromEntries(previous.agents.flatMap((agent) => {
|
|
404
516
|
if (!agent.weeklyUsageStatus || !agent.telemetryCheckedAt)
|
|
405
517
|
return [];
|
|
406
|
-
return [
|
|
518
|
+
return [
|
|
519
|
+
[
|
|
520
|
+
agent.agent,
|
|
521
|
+
{
|
|
407
522
|
account: agent.account ?? null,
|
|
408
523
|
plan: agent.plan ?? null,
|
|
409
524
|
weeklyUsage: agent.weeklyUsage ?? null,
|
|
410
525
|
weeklyUsageStatus: agent.weeklyUsageStatus,
|
|
411
526
|
telemetryCheckedAt: agent.telemetryCheckedAt,
|
|
412
|
-
}
|
|
527
|
+
},
|
|
528
|
+
],
|
|
529
|
+
];
|
|
413
530
|
}));
|
|
414
531
|
return mergeWorkerProviderTelemetry(capabilities, telemetry);
|
|
415
532
|
}
|
|
@@ -14,6 +14,7 @@ export type LoggedProcessResult = {
|
|
|
14
14
|
tokenUsage: AgentTokenUsage;
|
|
15
15
|
tokensUsed: number | null;
|
|
16
16
|
providerSessionId?: string | null;
|
|
17
|
+
providerResolvedModel?: string | null;
|
|
17
18
|
};
|
|
18
19
|
export type AgentTokenUsage = {
|
|
19
20
|
inputTokens: number | null;
|
|
@@ -25,7 +26,7 @@ export type AgentTokenUsage = {
|
|
|
25
26
|
usageParseError: string | null;
|
|
26
27
|
};
|
|
27
28
|
export type LoggedProcessTranscriptChunk = {
|
|
28
|
-
stream:
|
|
29
|
+
stream: "stdout" | "stderr";
|
|
29
30
|
content: string;
|
|
30
31
|
};
|
|
31
32
|
export declare function resolveDescendantProcessIds(processTable: string, rootPid: number): number[];
|
|
@@ -35,6 +36,12 @@ export declare function extractAgentTokenUsage(output: string): AgentTokenUsage;
|
|
|
35
36
|
export declare function extractCodexRolloutTokenUsage(output: string): AgentTokenUsage;
|
|
36
37
|
export declare function extractCodexThreadId(output: string): string | null;
|
|
37
38
|
export declare function extractClaudeSessionId(output: string): string | null;
|
|
39
|
+
export type GrokRunMetadata = {
|
|
40
|
+
sessionId: string | null;
|
|
41
|
+
resolvedRuntimeModel: string | null;
|
|
42
|
+
tokenUsage: AgentTokenUsage;
|
|
43
|
+
};
|
|
44
|
+
export declare function extractGrokRunMetadata(output: string): GrokRunMetadata;
|
|
38
45
|
export type CodexRolloutTokenUsageReadOptions = {
|
|
39
46
|
sessionsRoot?: string;
|
|
40
47
|
deleteAfterRead?: boolean;
|
|
@@ -69,7 +76,15 @@ export declare function buildCodexExecArgs(input: {
|
|
|
69
76
|
imagePaths?: string[];
|
|
70
77
|
resumeSessionId?: string | null;
|
|
71
78
|
}): string[];
|
|
72
|
-
export
|
|
79
|
+
export declare function buildGrokExecArgs(input: {
|
|
80
|
+
workspaceDir: string;
|
|
81
|
+
promptFile?: string | null;
|
|
82
|
+
promptJson?: string | null;
|
|
83
|
+
model: string;
|
|
84
|
+
reasoningEffort: string;
|
|
85
|
+
resumeSessionId?: string | null;
|
|
86
|
+
}): string[];
|
|
87
|
+
export type CodexSandboxMode = "danger-full-access" | "workspace-write" | "read-only";
|
|
73
88
|
export declare function readCodexSandboxMode(env?: NodeJS.ProcessEnv): CodexSandboxMode;
|
|
74
89
|
export declare function buildClaudeExecArgs(input: {
|
|
75
90
|
model: string;
|
|
@@ -84,7 +99,7 @@ export declare function buildClaudeExecArgs(input: {
|
|
|
84
99
|
resumeSessionId?: string | null;
|
|
85
100
|
}): string[];
|
|
86
101
|
export declare const PLAYWRIGHT_MCP_VERSION = "0.0.78";
|
|
87
|
-
export type WorkerInstrumentSurface =
|
|
102
|
+
export type WorkerInstrumentSurface = "DESKTOP" | "MOBILE_LANDSCAPE" | "MOBILE_PORTRAIT";
|
|
88
103
|
export declare function resolvePlaywrightMcpCliPath(): string;
|
|
89
104
|
export declare function buildPlaywrightMcpCommand(surface?: WorkerInstrumentSurface | null): {
|
|
90
105
|
command: string;
|