windows-development-sandbox 1.7.0 → 1.9.0
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/config.example.json +10 -0
- package/dist/app/context.d.ts +8 -0
- package/dist/app/context.js +12 -0
- package/dist/app/features/defs.d.ts +322 -0
- package/dist/app/features/defs.js +28 -0
- package/dist/app/features/sandbox/index.d.ts +2 -0
- package/dist/app/features/sandbox/index.js +3 -0
- package/dist/app/features/sandbox/sandbox.def.d.ts +193 -0
- package/dist/app/features/sandbox/sandbox.def.js +245 -0
- package/dist/app/features/sandbox/sandbox.run.d.ts +72 -0
- package/dist/app/features/sandbox/sandbox.run.js +98 -0
- package/dist/app/features/sessions/index.d.ts +2 -0
- package/dist/app/features/sessions/index.js +3 -0
- package/dist/app/features/sessions/sessions.def.d.ts +141 -0
- package/dist/app/features/sessions/sessions.def.js +176 -0
- package/dist/app/features/sessions/sessions.run.d.ts +39 -0
- package/dist/app/features/sessions/sessions.run.js +58 -0
- package/dist/{cli/menu/settings/categories.d.ts → app/features/settings/categories.def.d.ts} +2 -0
- package/dist/{cli/menu/settings/categories.js → app/features/settings/categories.def.js} +24 -5
- package/dist/app/features/settings/index.d.ts +5 -0
- package/dist/app/features/settings/index.js +6 -0
- package/dist/{cli/menu/settings/config-file.d.ts → app/features/settings/settings-file.d.ts} +1 -1
- package/dist/{cli/menu/settings/config-file.js → app/features/settings/settings-file.js} +1 -1
- package/dist/app/features/settings/settings-rows.d.ts +35 -0
- package/dist/app/features/settings/settings-rows.js +94 -0
- package/dist/app/features/settings/settings.def.d.ts +157 -0
- package/dist/app/features/settings/settings.def.js +179 -0
- package/dist/app/features/settings/settings.run.d.ts +67 -0
- package/dist/app/features/settings/settings.run.js +84 -0
- package/dist/app/kernel/define.d.ts +143 -0
- package/dist/app/kernel/define.js +42 -0
- package/dist/app/kernel/errors.d.ts +34 -0
- package/dist/app/kernel/errors.js +45 -0
- package/dist/app/kernel/fields.d.ts +70 -0
- package/dist/app/kernel/fields.js +243 -0
- package/dist/app/kernel/index.d.ts +8 -0
- package/dist/app/kernel/index.js +10 -0
- package/dist/app/kernel/io.d.ts +193 -0
- package/dist/app/kernel/io.js +126 -0
- package/dist/app/kernel/rpc.d.ts +156 -0
- package/dist/app/kernel/rpc.js +47 -0
- package/dist/app/kernel/text.d.ts +6 -0
- package/dist/app/kernel/text.js +57 -0
- package/dist/app/kernel/view.d.ts +146 -0
- package/dist/app/kernel/view.js +28 -0
- package/dist/app/registry.d.ts +10 -0
- package/dist/app/registry.js +50 -0
- package/dist/cli/args.d.ts +5 -0
- package/dist/cli/args.js +6 -0
- package/dist/cli/commands/engine.d.ts +2 -0
- package/dist/cli/commands/engine.js +60 -0
- package/dist/cli/commands/index.d.ts +1 -1
- package/dist/cli/commands/index.js +1 -1
- package/dist/cli/commands/launch/launch.js +47 -7
- package/dist/cli/commands/launch/prepare.js +3 -3
- package/dist/cli/commands/launch/running.js +2 -1
- package/dist/cli/commands/launch/summary.d.ts +2 -0
- package/dist/cli/commands/maintenance/config-share.d.ts +12 -0
- package/dist/cli/commands/maintenance/config-share.js +80 -0
- package/dist/cli/commands/maintenance/config.js +8 -82
- package/dist/cli/commands/maintenance/logs.js +14 -0
- package/dist/cli/commands/registry.js +3 -7
- package/dist/cli/commands/repair/checks/contained.d.ts +2 -0
- package/dist/cli/commands/repair/checks/contained.js +139 -0
- package/dist/cli/commands/repair/checks/hcs.d.ts +7 -0
- package/dist/cli/commands/repair/checks/hcs.js +28 -0
- package/dist/cli/commands/repair/checks/index.js +4 -0
- package/dist/cli/commands/repair/checks/pc.js +32 -1
- package/dist/cli/commands/repair/checks/sandbox.js +16 -1
- package/dist/cli/commands/repair/checks/vpn.js +34 -9
- package/dist/cli/commands/repair/env.js +2 -1
- package/dist/cli/commands/sessions/index.d.ts +0 -4
- package/dist/cli/commands/sessions/index.js +3 -7
- package/dist/cli/commands/shared-use.d.ts +5 -2
- package/dist/cli/commands/shared-use.js +11 -8
- package/dist/cli/commands/storage/contained.d.ts +3 -0
- package/dist/cli/commands/storage/contained.js +179 -0
- package/dist/cli/commands/storage/offer.js +7 -1
- package/dist/cli/commands/storage/storage.js +10 -2
- package/dist/cli/commands/user-config.js +1 -1
- package/dist/cli/commands/vpn.js +19 -3
- package/dist/cli/commands/web.js +2 -0
- package/dist/cli/index.js +2 -1
- package/dist/cli/manifest.d.ts +72 -104
- package/dist/cli/manifest.js +64 -39
- package/dist/cli/menu/add-agent.d.ts +1 -1
- package/dist/cli/menu/add-agent.js +1 -1
- package/dist/cli/menu/apps.d.ts +7 -1
- package/dist/cli/menu/apps.js +36 -0
- package/dist/cli/menu/command-fields.d.ts +1 -1
- package/dist/cli/menu/command-form.js +2 -2
- package/dist/cli/menu/io-menu.d.ts +29 -0
- package/dist/cli/menu/io-menu.js +126 -0
- package/dist/cli/menu/live.d.ts +27 -0
- package/dist/cli/menu/live.js +69 -0
- package/dist/cli/menu/memory.d.ts +19 -0
- package/dist/cli/menu/memory.js +53 -0
- package/dist/cli/menu/menu.d.ts +10 -1
- package/dist/cli/menu/menu.js +27 -9
- package/dist/cli/menu/pages/agents-page.d.ts +3 -1
- package/dist/cli/menu/pages/agents-page.js +12 -5
- package/dist/cli/menu/pages/apps-page.d.ts +3 -1
- package/dist/cli/menu/pages/apps-page.js +19 -2
- package/dist/cli/menu/pages/list-page.d.ts +27 -0
- package/dist/cli/menu/pages/list-page.js +109 -7
- package/dist/cli/menu/pages/maintenance-page.d.ts +0 -5
- package/dist/cli/menu/pages/maintenance-page.js +17 -19
- package/dist/cli/menu/pages/sandbox-page.d.ts +4 -6
- package/dist/cli/menu/pages/sandbox-page.js +26 -118
- package/dist/cli/menu/pages/scopes.d.ts +1 -1
- package/dist/cli/menu/pages/sessions-page.d.ts +5 -11
- package/dist/cli/menu/pages/sessions-page.js +19 -88
- package/dist/cli/menu/pages/settings-page.d.ts +2 -10
- package/dist/cli/menu/pages/settings-page.js +64 -94
- package/dist/cli/menu/render-view.d.ts +28 -0
- package/dist/cli/menu/render-view.js +112 -0
- package/dist/cli/menu/settings/{path-kind.d.ts → ask-path.d.ts} +1 -7
- package/dist/cli/menu/settings/ask-path.js +14 -0
- package/dist/cli/menu/settings/collections/collection-editor.d.ts +1 -1
- package/dist/cli/menu/settings/collections/string-list-editor.d.ts +1 -2
- package/dist/cli/menu/settings/collections/string-list-editor.js +1 -1
- package/dist/cli/menu/settings/draft.d.ts +1 -1
- package/dist/cli/menu/settings/format.d.ts +1 -3
- package/dist/cli/menu/settings/format.js +6 -36
- package/dist/cli/menu/settings/index.d.ts +1 -3
- package/dist/cli/menu/settings/index.js +3 -3
- package/dist/cli/menu/settings/object-editor.d.ts +1 -1
- package/dist/cli/menu/settings/share.d.ts +36 -0
- package/dist/cli/menu/settings/share.js +131 -0
- package/dist/cli/menu/settings/value-editor.d.ts +5 -1
- package/dist/cli/menu/settings/value-editor.js +57 -54
- package/dist/cli/menu/several.js +1 -1
- package/dist/cli/menu/share-settings.d.ts +21 -0
- package/dist/cli/menu/share-settings.js +112 -0
- package/dist/cli/menu/shell.d.ts +21 -5
- package/dist/cli/menu/shell.js +31 -6
- package/dist/cli/menu/views.d.ts +7 -0
- package/dist/cli/menu/views.js +11 -0
- package/dist/cli/menu/vpn-login.js +8 -0
- package/dist/cli/operations/handler.d.ts +6 -0
- package/dist/cli/operations/handler.js +61 -0
- package/dist/cli/operations/index.d.ts +4 -0
- package/dist/cli/operations/index.js +5 -0
- package/dist/cli/operations/input.d.ts +6 -0
- package/dist/cli/operations/input.js +37 -0
- package/dist/cli/operations/io-cli.d.ts +7 -0
- package/dist/cli/operations/io-cli.js +62 -0
- package/dist/cli/operations/spec.d.ts +18 -0
- package/dist/cli/operations/spec.js +108 -0
- package/dist/cli/output/colors.d.ts +2 -2
- package/dist/cli/output/colors.js +2 -11
- package/dist/cli/output/index.d.ts +1 -0
- package/dist/cli/output/index.js +1 -0
- package/dist/cli/output/print.d.ts +3 -1
- package/dist/cli/output/print.js +7 -3
- package/dist/cli/output/progress.d.ts +15 -0
- package/dist/cli/output/progress.js +44 -0
- package/dist/cli/output/render-view.d.ts +4 -0
- package/dist/cli/output/render-view.js +63 -0
- package/dist/cli/services/agent-commands-service.d.ts +2 -0
- package/dist/cli/services/agent-commands-service.js +11 -2
- package/dist/cli/services/logs-service.js +4 -3
- package/dist/cli/tui/app.d.ts +6 -1
- package/dist/cli/tui/app.js +26 -4
- package/dist/cli/tui/list/list-screen.d.ts +14 -0
- package/dist/cli/tui/list/list-screen.js +64 -36
- package/dist/cli/tui/list/list-types.d.ts +2 -0
- package/dist/cli/tui/terminal.d.ts +7 -0
- package/dist/cli/tui/terminal.js +30 -10
- package/dist/core/config/defaults.js +8 -0
- package/dist/core/schema/config.d.ts +13 -0
- package/dist/core/schema/config.js +16 -1
- package/dist/core/schema/harness.d.ts +1 -0
- package/dist/core/schema/harness.js +5 -0
- package/dist/core/schema/sandbox.d.ts +6 -0
- package/dist/core/schema/sandbox.js +20 -3
- package/dist/core/schema/vpn.d.ts +2 -1
- package/dist/core/schema/vpn.js +3 -3
- package/dist/core/types.d.ts +23 -5
- package/dist/core/util/fs.d.ts +2 -0
- package/dist/core/util/fs.js +9 -0
- package/dist/core/util/index.d.ts +1 -1
- package/dist/core/util/index.js +1 -1
- package/dist/guest/agents/agent-files.d.ts +5 -0
- package/dist/guest/agents/agent-files.js +4 -0
- package/dist/guest/agents/local-state.d.ts +2 -0
- package/dist/guest/agents/local-state.js +21 -1
- package/dist/guest/boot/boot.js +2 -1
- package/dist/guest/daemon/daemon.js +4 -0
- package/dist/guest/daemon/sessions.d.ts +5 -0
- package/dist/guest/daemon/sessions.js +17 -3
- package/dist/guest/entries/daemon.js +3 -0
- package/dist/guest/governor/decide.d.ts +61 -0
- package/dist/guest/governor/decide.js +182 -0
- package/dist/guest/governor/governor.d.ts +42 -0
- package/dist/guest/governor/governor.js +214 -0
- package/dist/guest/governor/index.d.ts +2 -0
- package/dist/guest/governor/index.js +2 -0
- package/dist/guest/runtime/csc.d.ts +1 -0
- package/dist/guest/runtime/csc.js +1 -0
- package/dist/guest/sessions/viewer.js +3 -1
- package/dist/guest/toolchains/native/rust-extras.js +4 -2
- package/dist/guest/vpn/vpn.js +69 -21
- package/dist/guest/vpn/wireguard.d.ts +32 -0
- package/dist/guest/vpn/wireguard.js +132 -0
- package/dist/host/agent-commands/commands.d.ts +4 -0
- package/dist/host/agent-commands/commands.js +31 -7
- package/dist/host/audit/log.d.ts +1 -1
- package/dist/host/channel/attach.d.ts +3 -1
- package/dist/host/channel/attach.js +5 -2
- package/dist/host/channel/channel.d.ts +2 -0
- package/dist/host/channel/channel.js +4 -0
- package/dist/host/engines/engine.d.ts +12 -0
- package/dist/host/engines/engine.js +1 -0
- package/dist/host/engines/hcs/check.d.ts +25 -0
- package/dist/host/engines/hcs/check.js +95 -0
- package/dist/host/engines/hcs/documents.d.ts +44 -0
- package/dist/host/engines/hcs/documents.js +155 -0
- package/dist/host/engines/hcs/engine.d.ts +39 -0
- package/dist/host/engines/hcs/engine.js +171 -0
- package/dist/host/engines/hcs/helper.d.ts +43 -0
- package/dist/host/engines/hcs/helper.js +173 -0
- package/dist/host/engines/hcs/images.d.ts +37 -0
- package/dist/host/engines/hcs/images.js +152 -0
- package/dist/host/engines/index.d.ts +7 -0
- package/dist/host/engines/index.js +5 -0
- package/dist/host/engines/registry.d.ts +16 -0
- package/dist/host/engines/registry.js +30 -0
- package/dist/host/engines/types.d.ts +58 -0
- package/dist/host/engines/types.js +1 -0
- package/dist/host/engines/windows-sandbox/engine.d.ts +16 -0
- package/dist/host/engines/windows-sandbox/engine.js +63 -0
- package/dist/host/engines/windows-sandbox/wsb-text.d.ts +2 -0
- package/dist/host/engines/windows-sandbox/wsb-text.js +29 -0
- package/dist/host/launch/generate.d.ts +5 -1
- package/dist/host/launch/generate.js +50 -8
- package/dist/host/launch/index.d.ts +3 -1
- package/dist/host/launch/index.js +3 -1
- package/dist/host/launch/launch-plan.d.ts +13 -0
- package/dist/host/launch/launch-plan.js +26 -0
- package/dist/host/launch/mappings.js +2 -1
- package/dist/host/launch/risk-notes.d.ts +10 -0
- package/dist/host/launch/risk-notes.js +18 -0
- package/dist/host/launch/session-file.d.ts +2 -0
- package/dist/host/launch/session-file.js +7 -1
- package/dist/host/launch/wsb-file.d.ts +28 -4
- package/dist/host/launch/wsb-file.js +61 -42
- package/dist/host/life/crash-report.d.ts +27 -1
- package/dist/host/life/crash-report.js +173 -7
- package/dist/host/life/host-memory.d.ts +40 -0
- package/dist/host/life/host-memory.js +137 -0
- package/dist/host/life/index.d.ts +2 -0
- package/dist/host/life/index.js +2 -0
- package/dist/host/life/stop-events.d.ts +2 -0
- package/dist/host/life/stop-events.js +20 -3
- package/dist/host/life/stop-warning.js +1 -1
- package/dist/host/life/watchdog.d.ts +54 -0
- package/dist/host/life/watchdog.js +108 -0
- package/dist/host/native.d.ts +3 -2
- package/dist/host/native.js +22 -3
- package/dist/host/profile/claude-login.js +3 -2
- package/dist/host/sandbox/contained-deps.d.ts +2 -0
- package/dist/host/sandbox/contained-deps.js +17 -0
- package/dist/host/sandbox/index.d.ts +2 -0
- package/dist/host/sandbox/index.js +2 -0
- package/dist/host/sandbox/platform.d.ts +2 -0
- package/dist/host/sandbox/platform.js +7 -7
- package/dist/host/sandbox/tasklist.d.ts +13 -0
- package/dist/host/sandbox/tasklist.js +47 -0
- package/dist/host/secrets/launch-secrets.js +2 -1
- package/dist/host/sharing/current.js +2 -6
- package/dist/host/storage/contained/check.d.ts +9 -0
- package/dist/host/storage/contained/check.js +37 -0
- package/dist/host/storage/contained/contained-storage.d.ts +66 -0
- package/dist/host/storage/contained/contained-storage.js +168 -0
- package/dist/host/storage/contained/disk-port.d.ts +43 -0
- package/dist/host/storage/contained/disk-port.js +122 -0
- package/dist/host/storage/contained/index.d.ts +9 -0
- package/dist/host/storage/contained/index.js +8 -0
- package/dist/host/storage/contained/layout.d.ts +28 -0
- package/dist/host/storage/contained/layout.js +45 -0
- package/dist/host/storage/contained/resolve.d.ts +4 -0
- package/dist/host/storage/contained/resolve.js +30 -0
- package/dist/host/storage/contained/setting.d.ts +1 -0
- package/dist/host/storage/contained/setting.js +5 -0
- package/dist/host/storage/contained/state.d.ts +89 -0
- package/dist/host/storage/contained/state.js +166 -0
- package/dist/host/storage/contained/transfer.d.ts +24 -0
- package/dist/host/storage/contained/transfer.js +121 -0
- package/dist/host/storage/index.d.ts +2 -0
- package/dist/host/storage/index.js +2 -0
- package/dist/host/storage/providers/contained.d.ts +15 -0
- package/dist/host/storage/providers/contained.js +39 -0
- package/dist/host/storage/providers/folder.d.ts +12 -0
- package/dist/host/storage/providers/folder.js +20 -0
- package/dist/host/storage/providers/index.d.ts +4 -0
- package/dist/host/storage/providers/index.js +3 -0
- package/dist/host/storage/providers/registry.d.ts +9 -0
- package/dist/host/storage/providers/registry.js +14 -0
- package/dist/host/storage/providers/types.d.ts +33 -0
- package/dist/host/storage/providers/types.js +1 -0
- package/dist/host/tools/conpty.js +3 -2
- package/dist/host/tools/windows-terminal.js +8 -7
- package/dist/host/vpn/index.d.ts +1 -1
- package/dist/host/vpn/index.js +1 -1
- package/dist/host/vpn/prepare.d.ts +2 -0
- package/dist/host/vpn/prepare.js +63 -2
- package/dist/host/web/browser.d.ts +2 -0
- package/dist/host/web/browser.js +14 -1
- package/dist/host/web/index.d.ts +3 -2
- package/dist/host/web/index.js +3 -2
- package/dist/host/web/rpc.d.ts +24 -0
- package/dist/host/web/rpc.js +149 -0
- package/dist/host/web/runner.d.ts +2 -0
- package/dist/host/web/runner.js +1 -2
- package/dist/host/web/server.d.ts +7 -0
- package/dist/host/web/server.js +23 -3
- package/dist/runtime/agent.js +69 -8
- package/dist/runtime/daemon.js +1058 -624
- package/dist/runtime/db.js +69 -8
- package/dist/runtime/main.js +624 -182
- package/dist/runtime/netproxy.js +69 -8
- package/dist/runtime/view.js +87 -13
- package/dist/selftest/agent-paths.test.js +11 -1
- package/dist/selftest/app.test.d.ts +2 -0
- package/dist/selftest/app.test.js +324 -0
- package/dist/selftest/channel.test.js +13 -0
- package/dist/selftest/cli.test.js +2 -1
- package/dist/selftest/config.test.js +59 -0
- package/dist/selftest/contained.test.d.ts +2 -0
- package/dist/selftest/contained.test.js +544 -0
- package/dist/selftest/credentials.test.js +1 -1
- package/dist/selftest/engine.test.d.ts +2 -0
- package/dist/selftest/engine.test.js +127 -0
- package/dist/selftest/hcs.test.d.ts +2 -0
- package/dist/selftest/hcs.test.js +482 -0
- package/dist/selftest/heavy-load.test.d.ts +2 -0
- package/dist/selftest/heavy-load.test.js +329 -0
- package/dist/selftest/index.js +12 -0
- package/dist/selftest/layout.test.js +12 -0
- package/dist/selftest/menu-perf.test.d.ts +2 -0
- package/dist/selftest/menu-perf.test.js +248 -0
- package/dist/selftest/menu-screens.js +4 -2
- package/dist/selftest/menu.test.js +36 -8
- package/dist/selftest/support/engine-cases.d.ts +8 -0
- package/dist/selftest/support/engine-cases.js +65 -0
- package/dist/selftest/support/engine-golden.d.ts +3 -0
- package/dist/selftest/support/engine-golden.js +66 -0
- package/dist/selftest/support/fixtures.d.ts +7 -1
- package/dist/selftest/support/hcs-probes.d.ts +17 -0
- package/dist/selftest/support/hcs-probes.js +41 -0
- package/dist/selftest/vpn.test.js +136 -3
- package/dist/selftest/web.test.js +101 -3
- package/dist/shared/channel/run-dir.d.ts +4 -1
- package/dist/shared/channel/run-dir.js +7 -1
- package/dist/shared/channel/schema.d.ts +35 -1
- package/dist/shared/channel/schema.js +27 -0
- package/dist/shared/channel/secrets.d.ts +1 -0
- package/dist/shared/channel/secrets.js +6 -0
- package/dist/shared/memory/index.d.ts +1 -0
- package/dist/shared/memory/index.js +1 -0
- package/dist/shared/memory/policy.d.ts +33 -0
- package/dist/shared/memory/policy.js +55 -0
- package/dist/shared/pty/output-filter.d.ts +14 -1
- package/dist/shared/pty/output-filter.js +22 -4
- package/dist/shared/pty/terminal.d.ts +4 -1
- package/dist/shared/pty/terminal.js +4 -2
- package/dist/shared/system.d.ts +1 -0
- package/dist/shared/system.js +1 -0
- package/dist/shared/vpn/download.d.ts +16 -0
- package/dist/shared/vpn/download.js +16 -0
- package/dist/shared/vpn/wireguard.d.ts +51 -0
- package/dist/shared/vpn/wireguard.js +227 -0
- package/dist/sync/sync-cycle.js +5 -5
- package/dist/sync/watcher.d.ts +13 -0
- package/dist/sync/watcher.js +92 -3
- package/dist/web/index.html +4 -3
- package/dist/web/main-NRRS5O6Z.js +157 -0
- package/dist/web/main-T5DMCHYV.css +1 -0
- package/native/csharp/HcsHost/AssemblyInfo.cs +14 -0
- package/native/csharp/HcsHost/Guard.cs +100 -0
- package/native/csharp/HcsHost/Hcs.cs +256 -0
- package/native/csharp/HcsHost/Json.cs +78 -0
- package/native/csharp/HcsHost/Program.cs +185 -0
- package/native/csharp/HcsHost/VirtualDisk.cs +95 -0
- package/native/csharp/HostTools/AssemblyInfo.cs +14 -0
- package/native/csharp/HostTools/MemoryStatus.cs +107 -0
- package/native/csharp/HostTools/Program.cs +58 -17
- package/native/scripts/check-contained.ps1 +28 -0
- package/native/scripts/contained-common.ps1 +241 -0
- package/native/scripts/dismount-contained.ps1 +66 -0
- package/native/scripts/memory-status.ps1 +34 -0
- package/native/scripts/mount-contained.ps1 +139 -0
- package/native/scripts/run-elevated.ps1 +17 -4
- package/native/scripts/stop-events.ps1 +23 -8
- package/package.json +9 -2
- package/sandbox/csharp/MemGov.cs +398 -0
- package/sandbox/csharp/PtyHost.cs +111 -5
- package/schemas/config.schema.json +60 -6
- package/schemas/sandbox-config.schema.json +3 -3
- package/dist/cli/commands/sessions/control.d.ts +0 -4
- package/dist/cli/commands/sessions/control.js +0 -66
- package/dist/cli/commands/sessions/list.d.ts +0 -2
- package/dist/cli/commands/sessions/list.js +0 -48
- package/dist/cli/commands/sessions/status.d.ts +0 -4
- package/dist/cli/commands/sessions/status.js +0 -114
- package/dist/cli/commands/sessions/window.d.ts +0 -3
- package/dist/cli/commands/sessions/window.js +0 -18
- package/dist/cli/menu/settings/path-kind.js +0 -44
- package/dist/web/main-CXESL347.js +0 -45
- package/dist/web/main-VLR7DVQ4.css +0 -1
- /package/dist/{cli/menu/settings → app/kernel}/schema-node.d.ts +0 -0
- /package/dist/{cli/menu/settings → app/kernel}/schema-node.js +0 -0
package/dist/runtime/daemon.js
CHANGED
|
@@ -18,9 +18,9 @@ var __export = (target, all) => {
|
|
|
18
18
|
};
|
|
19
19
|
var __copyProps = (to, from, except, desc) => {
|
|
20
20
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
21
|
-
for (let
|
|
22
|
-
if (!__hasOwnProp.call(to,
|
|
23
|
-
__defProp(to,
|
|
21
|
+
for (let key2 of __getOwnPropNames(from))
|
|
22
|
+
if (!__hasOwnProp.call(to, key2) && key2 !== except)
|
|
23
|
+
__defProp(to, key2, { get: () => from[key2], enumerable: !(desc = __getOwnPropDesc(from, key2)) || desc.enumerable });
|
|
24
24
|
}
|
|
25
25
|
return to;
|
|
26
26
|
};
|
|
@@ -501,9 +501,9 @@ var require_lodash = __commonJS({
|
|
|
501
501
|
}
|
|
502
502
|
function baseFindKey(collection, predicate, eachFunc) {
|
|
503
503
|
var result;
|
|
504
|
-
eachFunc(collection, function(value,
|
|
505
|
-
if (predicate(value,
|
|
506
|
-
result =
|
|
504
|
+
eachFunc(collection, function(value, key2, collection2) {
|
|
505
|
+
if (predicate(value, key2, collection2)) {
|
|
506
|
+
result = key2;
|
|
507
507
|
return false;
|
|
508
508
|
}
|
|
509
509
|
});
|
|
@@ -537,14 +537,14 @@ var require_lodash = __commonJS({
|
|
|
537
537
|
var length = array2 == null ? 0 : array2.length;
|
|
538
538
|
return length ? baseSum(array2, iteratee) / length : NAN;
|
|
539
539
|
}
|
|
540
|
-
function baseProperty(
|
|
540
|
+
function baseProperty(key2) {
|
|
541
541
|
return function(object2) {
|
|
542
|
-
return object2 == null ? undefined2 : object2[
|
|
542
|
+
return object2 == null ? undefined2 : object2[key2];
|
|
543
543
|
};
|
|
544
544
|
}
|
|
545
545
|
function basePropertyOf(object2) {
|
|
546
|
-
return function(
|
|
547
|
-
return object2 == null ? undefined2 : object2[
|
|
546
|
+
return function(key2) {
|
|
547
|
+
return object2 == null ? undefined2 : object2[key2];
|
|
548
548
|
};
|
|
549
549
|
}
|
|
550
550
|
function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
|
|
@@ -579,8 +579,8 @@ var require_lodash = __commonJS({
|
|
|
579
579
|
return result;
|
|
580
580
|
}
|
|
581
581
|
function baseToPairs(object2, props) {
|
|
582
|
-
return arrayMap(props, function(
|
|
583
|
-
return [
|
|
582
|
+
return arrayMap(props, function(key2) {
|
|
583
|
+
return [key2, object2[key2]];
|
|
584
584
|
});
|
|
585
585
|
}
|
|
586
586
|
function baseTrim(string4) {
|
|
@@ -592,12 +592,12 @@ var require_lodash = __commonJS({
|
|
|
592
592
|
};
|
|
593
593
|
}
|
|
594
594
|
function baseValues(object2, props) {
|
|
595
|
-
return arrayMap(props, function(
|
|
596
|
-
return object2[
|
|
595
|
+
return arrayMap(props, function(key2) {
|
|
596
|
+
return object2[key2];
|
|
597
597
|
});
|
|
598
598
|
}
|
|
599
|
-
function cacheHas(cache,
|
|
600
|
-
return cache.has(
|
|
599
|
+
function cacheHas(cache, key2) {
|
|
600
|
+
return cache.has(key2);
|
|
601
601
|
}
|
|
602
602
|
function charsStartIndex(strSymbols, chrSymbols) {
|
|
603
603
|
var index = -1, length = strSymbols.length;
|
|
@@ -625,8 +625,8 @@ var require_lodash = __commonJS({
|
|
|
625
625
|
function escapeStringChar(chr) {
|
|
626
626
|
return "\\" + stringEscapes[chr];
|
|
627
627
|
}
|
|
628
|
-
function getValue(object2,
|
|
629
|
-
return object2 == null ? undefined2 : object2[
|
|
628
|
+
function getValue(object2, key2) {
|
|
629
|
+
return object2 == null ? undefined2 : object2[key2];
|
|
630
630
|
}
|
|
631
631
|
function hasUnicode(string4) {
|
|
632
632
|
return reHasUnicode.test(string4);
|
|
@@ -643,8 +643,8 @@ var require_lodash = __commonJS({
|
|
|
643
643
|
}
|
|
644
644
|
function mapToArray(map2) {
|
|
645
645
|
var index = -1, result = Array(map2.size);
|
|
646
|
-
map2.forEach(function(value,
|
|
647
|
-
result[++index] = [
|
|
646
|
+
map2.forEach(function(value, key2) {
|
|
647
|
+
result[++index] = [key2, value];
|
|
648
648
|
});
|
|
649
649
|
return result;
|
|
650
650
|
}
|
|
@@ -911,27 +911,27 @@ var require_lodash = __commonJS({
|
|
|
911
911
|
this.__data__ = nativeCreate ? nativeCreate(null) : {};
|
|
912
912
|
this.size = 0;
|
|
913
913
|
}
|
|
914
|
-
function hashDelete(
|
|
915
|
-
var result2 = this.has(
|
|
914
|
+
function hashDelete(key2) {
|
|
915
|
+
var result2 = this.has(key2) && delete this.__data__[key2];
|
|
916
916
|
this.size -= result2 ? 1 : 0;
|
|
917
917
|
return result2;
|
|
918
918
|
}
|
|
919
|
-
function hashGet(
|
|
919
|
+
function hashGet(key2) {
|
|
920
920
|
var data = this.__data__;
|
|
921
921
|
if (nativeCreate) {
|
|
922
|
-
var result2 = data[
|
|
922
|
+
var result2 = data[key2];
|
|
923
923
|
return result2 === HASH_UNDEFINED ? undefined2 : result2;
|
|
924
924
|
}
|
|
925
|
-
return hasOwnProperty.call(data,
|
|
925
|
+
return hasOwnProperty.call(data, key2) ? data[key2] : undefined2;
|
|
926
926
|
}
|
|
927
|
-
function hashHas(
|
|
927
|
+
function hashHas(key2) {
|
|
928
928
|
var data = this.__data__;
|
|
929
|
-
return nativeCreate ? data[
|
|
929
|
+
return nativeCreate ? data[key2] !== undefined2 : hasOwnProperty.call(data, key2);
|
|
930
930
|
}
|
|
931
|
-
function hashSet(
|
|
931
|
+
function hashSet(key2, value) {
|
|
932
932
|
var data = this.__data__;
|
|
933
|
-
this.size += this.has(
|
|
934
|
-
data[
|
|
933
|
+
this.size += this.has(key2) ? 0 : 1;
|
|
934
|
+
data[key2] = nativeCreate && value === undefined2 ? HASH_UNDEFINED : value;
|
|
935
935
|
return this;
|
|
936
936
|
}
|
|
937
937
|
Hash.prototype.clear = hashClear;
|
|
@@ -951,8 +951,8 @@ var require_lodash = __commonJS({
|
|
|
951
951
|
this.__data__ = [];
|
|
952
952
|
this.size = 0;
|
|
953
953
|
}
|
|
954
|
-
function listCacheDelete(
|
|
955
|
-
var data = this.__data__, index = assocIndexOf(data,
|
|
954
|
+
function listCacheDelete(key2) {
|
|
955
|
+
var data = this.__data__, index = assocIndexOf(data, key2);
|
|
956
956
|
if (index < 0) {
|
|
957
957
|
return false;
|
|
958
958
|
}
|
|
@@ -965,18 +965,18 @@ var require_lodash = __commonJS({
|
|
|
965
965
|
--this.size;
|
|
966
966
|
return true;
|
|
967
967
|
}
|
|
968
|
-
function listCacheGet(
|
|
969
|
-
var data = this.__data__, index = assocIndexOf(data,
|
|
968
|
+
function listCacheGet(key2) {
|
|
969
|
+
var data = this.__data__, index = assocIndexOf(data, key2);
|
|
970
970
|
return index < 0 ? undefined2 : data[index][1];
|
|
971
971
|
}
|
|
972
|
-
function listCacheHas(
|
|
973
|
-
return assocIndexOf(this.__data__,
|
|
972
|
+
function listCacheHas(key2) {
|
|
973
|
+
return assocIndexOf(this.__data__, key2) > -1;
|
|
974
974
|
}
|
|
975
|
-
function listCacheSet(
|
|
976
|
-
var data = this.__data__, index = assocIndexOf(data,
|
|
975
|
+
function listCacheSet(key2, value) {
|
|
976
|
+
var data = this.__data__, index = assocIndexOf(data, key2);
|
|
977
977
|
if (index < 0) {
|
|
978
978
|
++this.size;
|
|
979
|
-
data.push([
|
|
979
|
+
data.push([key2, value]);
|
|
980
980
|
} else {
|
|
981
981
|
data[index][1] = value;
|
|
982
982
|
}
|
|
@@ -1003,20 +1003,20 @@ var require_lodash = __commonJS({
|
|
|
1003
1003
|
"string": new Hash()
|
|
1004
1004
|
};
|
|
1005
1005
|
}
|
|
1006
|
-
function mapCacheDelete(
|
|
1007
|
-
var result2 = getMapData(this,
|
|
1006
|
+
function mapCacheDelete(key2) {
|
|
1007
|
+
var result2 = getMapData(this, key2)["delete"](key2);
|
|
1008
1008
|
this.size -= result2 ? 1 : 0;
|
|
1009
1009
|
return result2;
|
|
1010
1010
|
}
|
|
1011
|
-
function mapCacheGet(
|
|
1012
|
-
return getMapData(this,
|
|
1011
|
+
function mapCacheGet(key2) {
|
|
1012
|
+
return getMapData(this, key2).get(key2);
|
|
1013
1013
|
}
|
|
1014
|
-
function mapCacheHas(
|
|
1015
|
-
return getMapData(this,
|
|
1014
|
+
function mapCacheHas(key2) {
|
|
1015
|
+
return getMapData(this, key2).has(key2);
|
|
1016
1016
|
}
|
|
1017
|
-
function mapCacheSet(
|
|
1018
|
-
var data = getMapData(this,
|
|
1019
|
-
data.set(
|
|
1017
|
+
function mapCacheSet(key2, value) {
|
|
1018
|
+
var data = getMapData(this, key2), size2 = data.size;
|
|
1019
|
+
data.set(key2, value);
|
|
1020
1020
|
this.size += data.size == size2 ? 0 : 1;
|
|
1021
1021
|
return this;
|
|
1022
1022
|
}
|
|
@@ -1049,29 +1049,29 @@ var require_lodash = __commonJS({
|
|
|
1049
1049
|
this.__data__ = new ListCache();
|
|
1050
1050
|
this.size = 0;
|
|
1051
1051
|
}
|
|
1052
|
-
function stackDelete(
|
|
1053
|
-
var data = this.__data__, result2 = data["delete"](
|
|
1052
|
+
function stackDelete(key2) {
|
|
1053
|
+
var data = this.__data__, result2 = data["delete"](key2);
|
|
1054
1054
|
this.size = data.size;
|
|
1055
1055
|
return result2;
|
|
1056
1056
|
}
|
|
1057
|
-
function stackGet(
|
|
1058
|
-
return this.__data__.get(
|
|
1057
|
+
function stackGet(key2) {
|
|
1058
|
+
return this.__data__.get(key2);
|
|
1059
1059
|
}
|
|
1060
|
-
function stackHas(
|
|
1061
|
-
return this.__data__.has(
|
|
1060
|
+
function stackHas(key2) {
|
|
1061
|
+
return this.__data__.has(key2);
|
|
1062
1062
|
}
|
|
1063
|
-
function stackSet(
|
|
1063
|
+
function stackSet(key2, value) {
|
|
1064
1064
|
var data = this.__data__;
|
|
1065
1065
|
if (data instanceof ListCache) {
|
|
1066
1066
|
var pairs = data.__data__;
|
|
1067
1067
|
if (!Map2 || pairs.length < LARGE_ARRAY_SIZE - 1) {
|
|
1068
|
-
pairs.push([
|
|
1068
|
+
pairs.push([key2, value]);
|
|
1069
1069
|
this.size = ++data.size;
|
|
1070
1070
|
return this;
|
|
1071
1071
|
}
|
|
1072
1072
|
data = this.__data__ = new MapCache(pairs);
|
|
1073
1073
|
}
|
|
1074
|
-
data.set(
|
|
1074
|
+
data.set(key2, value);
|
|
1075
1075
|
this.size = data.size;
|
|
1076
1076
|
return this;
|
|
1077
1077
|
}
|
|
@@ -1082,13 +1082,13 @@ var require_lodash = __commonJS({
|
|
|
1082
1082
|
Stack.prototype.set = stackSet;
|
|
1083
1083
|
function arrayLikeKeys(value, inherited) {
|
|
1084
1084
|
var isArr = isArray(value), isArg = !isArr && isArguments(value), isBuff = !isArr && !isArg && isBuffer(value), isType = !isArr && !isArg && !isBuff && isTypedArray(value), skipIndexes = isArr || isArg || isBuff || isType, result2 = skipIndexes ? baseTimes(value.length, String2) : [], length = result2.length;
|
|
1085
|
-
for (var
|
|
1086
|
-
if ((inherited || hasOwnProperty.call(value,
|
|
1087
|
-
(
|
|
1088
|
-
isBuff && (
|
|
1089
|
-
isType && (
|
|
1090
|
-
isIndex(
|
|
1091
|
-
result2.push(
|
|
1085
|
+
for (var key2 in value) {
|
|
1086
|
+
if ((inherited || hasOwnProperty.call(value, key2)) && !(skipIndexes && // Safari 9 has enumerable `arguments.length` in strict mode.
|
|
1087
|
+
(key2 == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
|
|
1088
|
+
isBuff && (key2 == "offset" || key2 == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
|
|
1089
|
+
isType && (key2 == "buffer" || key2 == "byteLength" || key2 == "byteOffset") || // Skip index properties.
|
|
1090
|
+
isIndex(key2, length)))) {
|
|
1091
|
+
result2.push(key2);
|
|
1092
1092
|
}
|
|
1093
1093
|
}
|
|
1094
1094
|
return result2;
|
|
@@ -1103,28 +1103,28 @@ var require_lodash = __commonJS({
|
|
|
1103
1103
|
function arrayShuffle(array2) {
|
|
1104
1104
|
return shuffleSelf(copyArray(array2));
|
|
1105
1105
|
}
|
|
1106
|
-
function assignMergeValue(object2,
|
|
1107
|
-
if (value !== undefined2 && !eq(object2[
|
|
1108
|
-
baseAssignValue(object2,
|
|
1106
|
+
function assignMergeValue(object2, key2, value) {
|
|
1107
|
+
if (value !== undefined2 && !eq(object2[key2], value) || value === undefined2 && !(key2 in object2)) {
|
|
1108
|
+
baseAssignValue(object2, key2, value);
|
|
1109
1109
|
}
|
|
1110
1110
|
}
|
|
1111
|
-
function assignValue(object2,
|
|
1112
|
-
var objValue = object2[
|
|
1113
|
-
if (!(hasOwnProperty.call(object2,
|
|
1114
|
-
baseAssignValue(object2,
|
|
1111
|
+
function assignValue(object2, key2, value) {
|
|
1112
|
+
var objValue = object2[key2];
|
|
1113
|
+
if (!(hasOwnProperty.call(object2, key2) && eq(objValue, value)) || value === undefined2 && !(key2 in object2)) {
|
|
1114
|
+
baseAssignValue(object2, key2, value);
|
|
1115
1115
|
}
|
|
1116
1116
|
}
|
|
1117
|
-
function assocIndexOf(array2,
|
|
1117
|
+
function assocIndexOf(array2, key2) {
|
|
1118
1118
|
var length = array2.length;
|
|
1119
1119
|
while (length--) {
|
|
1120
|
-
if (eq(array2[length][0],
|
|
1120
|
+
if (eq(array2[length][0], key2)) {
|
|
1121
1121
|
return length;
|
|
1122
1122
|
}
|
|
1123
1123
|
}
|
|
1124
1124
|
return -1;
|
|
1125
1125
|
}
|
|
1126
1126
|
function baseAggregator(collection, setter, iteratee2, accumulator) {
|
|
1127
|
-
baseEach(collection, function(value,
|
|
1127
|
+
baseEach(collection, function(value, key2, collection2) {
|
|
1128
1128
|
setter(accumulator, value, iteratee2(value), collection2);
|
|
1129
1129
|
});
|
|
1130
1130
|
return accumulator;
|
|
@@ -1135,16 +1135,16 @@ var require_lodash = __commonJS({
|
|
|
1135
1135
|
function baseAssignIn(object2, source) {
|
|
1136
1136
|
return object2 && copyObject(source, keysIn(source), object2);
|
|
1137
1137
|
}
|
|
1138
|
-
function baseAssignValue(object2,
|
|
1139
|
-
if (
|
|
1140
|
-
defineProperty(object2,
|
|
1138
|
+
function baseAssignValue(object2, key2, value) {
|
|
1139
|
+
if (key2 == "__proto__" && defineProperty) {
|
|
1140
|
+
defineProperty(object2, key2, {
|
|
1141
1141
|
"configurable": true,
|
|
1142
1142
|
"enumerable": true,
|
|
1143
1143
|
"value": value,
|
|
1144
1144
|
"writable": true
|
|
1145
1145
|
});
|
|
1146
1146
|
} else {
|
|
1147
|
-
object2[
|
|
1147
|
+
object2[key2] = value;
|
|
1148
1148
|
}
|
|
1149
1149
|
}
|
|
1150
1150
|
function baseAt(object2, paths) {
|
|
@@ -1165,10 +1165,10 @@ var require_lodash = __commonJS({
|
|
|
1165
1165
|
}
|
|
1166
1166
|
return number4;
|
|
1167
1167
|
}
|
|
1168
|
-
function baseClone(value, bitmask, customizer,
|
|
1168
|
+
function baseClone(value, bitmask, customizer, key2, object2, stack) {
|
|
1169
1169
|
var result2, isDeep = bitmask & CLONE_DEEP_FLAG, isFlat = bitmask & CLONE_FLAT_FLAG, isFull = bitmask & CLONE_SYMBOLS_FLAG;
|
|
1170
1170
|
if (customizer) {
|
|
1171
|
-
result2 = object2 ? customizer(value,
|
|
1171
|
+
result2 = object2 ? customizer(value, key2, object2, stack) : customizer(value);
|
|
1172
1172
|
}
|
|
1173
1173
|
if (result2 !== undefined2) {
|
|
1174
1174
|
return result2;
|
|
@@ -1210,18 +1210,18 @@ var require_lodash = __commonJS({
|
|
|
1210
1210
|
result2.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
|
|
1211
1211
|
});
|
|
1212
1212
|
} else if (isMap(value)) {
|
|
1213
|
-
value.forEach(function(subValue,
|
|
1214
|
-
result2.set(
|
|
1213
|
+
value.forEach(function(subValue, key3) {
|
|
1214
|
+
result2.set(key3, baseClone(subValue, bitmask, customizer, key3, value, stack));
|
|
1215
1215
|
});
|
|
1216
1216
|
}
|
|
1217
1217
|
var keysFunc = isFull ? isFlat ? getAllKeysIn : getAllKeys : isFlat ? keysIn : keys;
|
|
1218
1218
|
var props = isArr ? undefined2 : keysFunc(value);
|
|
1219
|
-
arrayEach(props || value, function(subValue,
|
|
1219
|
+
arrayEach(props || value, function(subValue, key3) {
|
|
1220
1220
|
if (props) {
|
|
1221
|
-
|
|
1222
|
-
subValue = value[
|
|
1221
|
+
key3 = subValue;
|
|
1222
|
+
subValue = value[key3];
|
|
1223
1223
|
}
|
|
1224
|
-
assignValue(result2,
|
|
1224
|
+
assignValue(result2, key3, baseClone(subValue, bitmask, customizer, key3, value, stack));
|
|
1225
1225
|
});
|
|
1226
1226
|
return result2;
|
|
1227
1227
|
}
|
|
@@ -1238,8 +1238,8 @@ var require_lodash = __commonJS({
|
|
|
1238
1238
|
}
|
|
1239
1239
|
object2 = Object2(object2);
|
|
1240
1240
|
while (length--) {
|
|
1241
|
-
var
|
|
1242
|
-
if (value === undefined2 && !(
|
|
1241
|
+
var key2 = props[length], predicate = source[key2], value = object2[key2];
|
|
1242
|
+
if (value === undefined2 && !(key2 in object2) || !predicate(value)) {
|
|
1243
1243
|
return false;
|
|
1244
1244
|
}
|
|
1245
1245
|
}
|
|
@@ -1359,15 +1359,15 @@ var require_lodash = __commonJS({
|
|
|
1359
1359
|
return object2 && baseForRight(object2, iteratee2, keys);
|
|
1360
1360
|
}
|
|
1361
1361
|
function baseFunctions(object2, props) {
|
|
1362
|
-
return arrayFilter(props, function(
|
|
1363
|
-
return isFunction(object2[
|
|
1362
|
+
return arrayFilter(props, function(key2) {
|
|
1363
|
+
return isFunction(object2[key2]);
|
|
1364
1364
|
});
|
|
1365
1365
|
}
|
|
1366
|
-
function baseGet(object2,
|
|
1367
|
-
|
|
1368
|
-
var index = 0, length =
|
|
1366
|
+
function baseGet(object2, path69) {
|
|
1367
|
+
path69 = castPath(path69, object2);
|
|
1368
|
+
var index = 0, length = path69.length;
|
|
1369
1369
|
while (object2 != null && index < length) {
|
|
1370
|
-
object2 = object2[toKey(
|
|
1370
|
+
object2 = object2[toKey(path69[index++])];
|
|
1371
1371
|
}
|
|
1372
1372
|
return index && index == length ? object2 : undefined2;
|
|
1373
1373
|
}
|
|
@@ -1384,11 +1384,11 @@ var require_lodash = __commonJS({
|
|
|
1384
1384
|
function baseGt(value, other) {
|
|
1385
1385
|
return value > other;
|
|
1386
1386
|
}
|
|
1387
|
-
function baseHas(object2,
|
|
1388
|
-
return object2 != null && hasOwnProperty.call(object2,
|
|
1387
|
+
function baseHas(object2, key2) {
|
|
1388
|
+
return object2 != null && hasOwnProperty.call(object2, key2);
|
|
1389
1389
|
}
|
|
1390
|
-
function baseHasIn(object2,
|
|
1391
|
-
return object2 != null &&
|
|
1390
|
+
function baseHasIn(object2, key2) {
|
|
1391
|
+
return object2 != null && key2 in Object2(object2);
|
|
1392
1392
|
}
|
|
1393
1393
|
function baseInRange(number4, start, end) {
|
|
1394
1394
|
return number4 >= nativeMin(start, end) && number4 < nativeMax(start, end);
|
|
@@ -1426,15 +1426,15 @@ var require_lodash = __commonJS({
|
|
|
1426
1426
|
return result2;
|
|
1427
1427
|
}
|
|
1428
1428
|
function baseInverter(object2, setter, iteratee2, accumulator) {
|
|
1429
|
-
baseForOwn(object2, function(value,
|
|
1430
|
-
setter(accumulator, iteratee2(value),
|
|
1429
|
+
baseForOwn(object2, function(value, key2, object3) {
|
|
1430
|
+
setter(accumulator, iteratee2(value), key2, object3);
|
|
1431
1431
|
});
|
|
1432
1432
|
return accumulator;
|
|
1433
1433
|
}
|
|
1434
|
-
function baseInvoke(object2,
|
|
1435
|
-
|
|
1436
|
-
object2 = parent(object2,
|
|
1437
|
-
var func = object2 == null ? object2 : object2[toKey(last(
|
|
1434
|
+
function baseInvoke(object2, path69, args) {
|
|
1435
|
+
path69 = castPath(path69, object2);
|
|
1436
|
+
object2 = parent(object2, path69);
|
|
1437
|
+
var func = object2 == null ? object2 : object2[toKey(last(path69))];
|
|
1438
1438
|
return func == null ? undefined2 : apply(func, object2, args);
|
|
1439
1439
|
}
|
|
1440
1440
|
function baseIsArguments(value) {
|
|
@@ -1502,15 +1502,15 @@ var require_lodash = __commonJS({
|
|
|
1502
1502
|
}
|
|
1503
1503
|
while (++index < length) {
|
|
1504
1504
|
data = matchData[index];
|
|
1505
|
-
var
|
|
1505
|
+
var key2 = data[0], objValue = object2[key2], srcValue = data[1];
|
|
1506
1506
|
if (noCustomizer && data[2]) {
|
|
1507
|
-
if (objValue === undefined2 && !(
|
|
1507
|
+
if (objValue === undefined2 && !(key2 in object2)) {
|
|
1508
1508
|
return false;
|
|
1509
1509
|
}
|
|
1510
1510
|
} else {
|
|
1511
1511
|
var stack = new Stack();
|
|
1512
1512
|
if (customizer) {
|
|
1513
|
-
var result2 = customizer(objValue, srcValue,
|
|
1513
|
+
var result2 = customizer(objValue, srcValue, key2, object2, source, stack);
|
|
1514
1514
|
}
|
|
1515
1515
|
if (!(result2 === undefined2 ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack) : result2)) {
|
|
1516
1516
|
return false;
|
|
@@ -1552,9 +1552,9 @@ var require_lodash = __commonJS({
|
|
|
1552
1552
|
return nativeKeys(object2);
|
|
1553
1553
|
}
|
|
1554
1554
|
var result2 = [];
|
|
1555
|
-
for (var
|
|
1556
|
-
if (hasOwnProperty.call(object2,
|
|
1557
|
-
result2.push(
|
|
1555
|
+
for (var key2 in Object2(object2)) {
|
|
1556
|
+
if (hasOwnProperty.call(object2, key2) && key2 != "constructor") {
|
|
1557
|
+
result2.push(key2);
|
|
1558
1558
|
}
|
|
1559
1559
|
}
|
|
1560
1560
|
return result2;
|
|
@@ -1564,9 +1564,9 @@ var require_lodash = __commonJS({
|
|
|
1564
1564
|
return nativeKeysIn(object2);
|
|
1565
1565
|
}
|
|
1566
1566
|
var isProto = isPrototype(object2), result2 = [];
|
|
1567
|
-
for (var
|
|
1568
|
-
if (!(
|
|
1569
|
-
result2.push(
|
|
1567
|
+
for (var key2 in object2) {
|
|
1568
|
+
if (!(key2 == "constructor" && (isProto || !hasOwnProperty.call(object2, key2)))) {
|
|
1569
|
+
result2.push(key2);
|
|
1570
1570
|
}
|
|
1571
1571
|
}
|
|
1572
1572
|
return result2;
|
|
@@ -1576,8 +1576,8 @@ var require_lodash = __commonJS({
|
|
|
1576
1576
|
}
|
|
1577
1577
|
function baseMap(collection, iteratee2) {
|
|
1578
1578
|
var index = -1, result2 = isArrayLike(collection) ? Array2(collection.length) : [];
|
|
1579
|
-
baseEach(collection, function(value,
|
|
1580
|
-
result2[++index] = iteratee2(value,
|
|
1579
|
+
baseEach(collection, function(value, key2, collection2) {
|
|
1580
|
+
result2[++index] = iteratee2(value, key2, collection2);
|
|
1581
1581
|
});
|
|
1582
1582
|
return result2;
|
|
1583
1583
|
}
|
|
@@ -1590,39 +1590,39 @@ var require_lodash = __commonJS({
|
|
|
1590
1590
|
return object2 === source || baseIsMatch(object2, source, matchData);
|
|
1591
1591
|
};
|
|
1592
1592
|
}
|
|
1593
|
-
function baseMatchesProperty(
|
|
1594
|
-
if (isKey(
|
|
1595
|
-
return matchesStrictComparable(toKey(
|
|
1593
|
+
function baseMatchesProperty(path69, srcValue) {
|
|
1594
|
+
if (isKey(path69) && isStrictComparable(srcValue)) {
|
|
1595
|
+
return matchesStrictComparable(toKey(path69), srcValue);
|
|
1596
1596
|
}
|
|
1597
1597
|
return function(object2) {
|
|
1598
|
-
var objValue = get(object2,
|
|
1599
|
-
return objValue === undefined2 && objValue === srcValue ? hasIn(object2,
|
|
1598
|
+
var objValue = get(object2, path69);
|
|
1599
|
+
return objValue === undefined2 && objValue === srcValue ? hasIn(object2, path69) : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
|
|
1600
1600
|
};
|
|
1601
1601
|
}
|
|
1602
1602
|
function baseMerge(object2, source, srcIndex, customizer, stack) {
|
|
1603
1603
|
if (object2 === source) {
|
|
1604
1604
|
return;
|
|
1605
1605
|
}
|
|
1606
|
-
baseFor(source, function(srcValue,
|
|
1606
|
+
baseFor(source, function(srcValue, key2) {
|
|
1607
1607
|
stack || (stack = new Stack());
|
|
1608
1608
|
if (isObject2(srcValue)) {
|
|
1609
|
-
baseMergeDeep(object2, source,
|
|
1609
|
+
baseMergeDeep(object2, source, key2, srcIndex, baseMerge, customizer, stack);
|
|
1610
1610
|
} else {
|
|
1611
|
-
var newValue = customizer ? customizer(safeGet(object2,
|
|
1611
|
+
var newValue = customizer ? customizer(safeGet(object2, key2), srcValue, key2 + "", object2, source, stack) : undefined2;
|
|
1612
1612
|
if (newValue === undefined2) {
|
|
1613
1613
|
newValue = srcValue;
|
|
1614
1614
|
}
|
|
1615
|
-
assignMergeValue(object2,
|
|
1615
|
+
assignMergeValue(object2, key2, newValue);
|
|
1616
1616
|
}
|
|
1617
1617
|
}, keysIn);
|
|
1618
1618
|
}
|
|
1619
|
-
function baseMergeDeep(object2, source,
|
|
1620
|
-
var objValue = safeGet(object2,
|
|
1619
|
+
function baseMergeDeep(object2, source, key2, srcIndex, mergeFunc, customizer, stack) {
|
|
1620
|
+
var objValue = safeGet(object2, key2), srcValue = safeGet(source, key2), stacked = stack.get(srcValue);
|
|
1621
1621
|
if (stacked) {
|
|
1622
|
-
assignMergeValue(object2,
|
|
1622
|
+
assignMergeValue(object2, key2, stacked);
|
|
1623
1623
|
return;
|
|
1624
1624
|
}
|
|
1625
|
-
var newValue = customizer ? customizer(objValue, srcValue,
|
|
1625
|
+
var newValue = customizer ? customizer(objValue, srcValue, key2 + "", object2, source, stack) : undefined2;
|
|
1626
1626
|
var isCommon = newValue === undefined2;
|
|
1627
1627
|
if (isCommon) {
|
|
1628
1628
|
var isArr = isArray(srcValue), isBuff = !isArr && isBuffer(srcValue), isTyped = !isArr && !isBuff && isTypedArray(srcValue);
|
|
@@ -1657,7 +1657,7 @@ var require_lodash = __commonJS({
|
|
|
1657
1657
|
mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
|
|
1658
1658
|
stack["delete"](srcValue);
|
|
1659
1659
|
}
|
|
1660
|
-
assignMergeValue(object2,
|
|
1660
|
+
assignMergeValue(object2, key2, newValue);
|
|
1661
1661
|
}
|
|
1662
1662
|
function baseNth(array2, n) {
|
|
1663
1663
|
var length = array2.length;
|
|
@@ -1682,7 +1682,7 @@ var require_lodash = __commonJS({
|
|
|
1682
1682
|
}
|
|
1683
1683
|
var index = -1;
|
|
1684
1684
|
iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
|
|
1685
|
-
var result2 = baseMap(collection, function(value,
|
|
1685
|
+
var result2 = baseMap(collection, function(value, key2, collection2) {
|
|
1686
1686
|
var criteria = arrayMap(iteratees, function(iteratee2) {
|
|
1687
1687
|
return iteratee2(value);
|
|
1688
1688
|
});
|
|
@@ -1693,23 +1693,23 @@ var require_lodash = __commonJS({
|
|
|
1693
1693
|
});
|
|
1694
1694
|
}
|
|
1695
1695
|
function basePick(object2, paths) {
|
|
1696
|
-
return basePickBy(object2, paths, function(value,
|
|
1697
|
-
return hasIn(object2,
|
|
1696
|
+
return basePickBy(object2, paths, function(value, path69) {
|
|
1697
|
+
return hasIn(object2, path69);
|
|
1698
1698
|
});
|
|
1699
1699
|
}
|
|
1700
1700
|
function basePickBy(object2, paths, predicate) {
|
|
1701
1701
|
var index = -1, length = paths.length, result2 = {};
|
|
1702
1702
|
while (++index < length) {
|
|
1703
|
-
var
|
|
1704
|
-
if (predicate(value,
|
|
1705
|
-
baseSet(result2, castPath(
|
|
1703
|
+
var path69 = paths[index], value = baseGet(object2, path69);
|
|
1704
|
+
if (predicate(value, path69)) {
|
|
1705
|
+
baseSet(result2, castPath(path69, object2), value);
|
|
1706
1706
|
}
|
|
1707
1707
|
}
|
|
1708
1708
|
return result2;
|
|
1709
1709
|
}
|
|
1710
|
-
function basePropertyDeep(
|
|
1710
|
+
function basePropertyDeep(path69) {
|
|
1711
1711
|
return function(object2) {
|
|
1712
|
-
return baseGet(object2,
|
|
1712
|
+
return baseGet(object2, path69);
|
|
1713
1713
|
};
|
|
1714
1714
|
}
|
|
1715
1715
|
function basePullAll(array2, values2, iteratee2, comparator) {
|
|
@@ -1783,26 +1783,26 @@ var require_lodash = __commonJS({
|
|
|
1783
1783
|
var array2 = values(collection);
|
|
1784
1784
|
return shuffleSelf(array2, baseClamp(n, 0, array2.length));
|
|
1785
1785
|
}
|
|
1786
|
-
function baseSet(object2,
|
|
1786
|
+
function baseSet(object2, path69, value, customizer) {
|
|
1787
1787
|
if (!isObject2(object2)) {
|
|
1788
1788
|
return object2;
|
|
1789
1789
|
}
|
|
1790
|
-
|
|
1791
|
-
var index = -1, length =
|
|
1790
|
+
path69 = castPath(path69, object2);
|
|
1791
|
+
var index = -1, length = path69.length, lastIndex = length - 1, nested = object2;
|
|
1792
1792
|
while (nested != null && ++index < length) {
|
|
1793
|
-
var
|
|
1794
|
-
if (
|
|
1793
|
+
var key2 = toKey(path69[index]), newValue = value;
|
|
1794
|
+
if (key2 === "__proto__" || key2 === "constructor" || key2 === "prototype") {
|
|
1795
1795
|
return object2;
|
|
1796
1796
|
}
|
|
1797
1797
|
if (index != lastIndex) {
|
|
1798
|
-
var objValue = nested[
|
|
1799
|
-
newValue = customizer ? customizer(objValue,
|
|
1798
|
+
var objValue = nested[key2];
|
|
1799
|
+
newValue = customizer ? customizer(objValue, key2, nested) : undefined2;
|
|
1800
1800
|
if (newValue === undefined2) {
|
|
1801
|
-
newValue = isObject2(objValue) ? objValue : isIndex(
|
|
1801
|
+
newValue = isObject2(objValue) ? objValue : isIndex(path69[index + 1]) ? [] : {};
|
|
1802
1802
|
}
|
|
1803
1803
|
}
|
|
1804
|
-
assignValue(nested,
|
|
1805
|
-
nested = nested[
|
|
1804
|
+
assignValue(nested, key2, newValue);
|
|
1805
|
+
nested = nested[key2];
|
|
1806
1806
|
}
|
|
1807
1807
|
return object2;
|
|
1808
1808
|
}
|
|
@@ -1964,26 +1964,26 @@ var require_lodash = __commonJS({
|
|
|
1964
1964
|
}
|
|
1965
1965
|
return result2;
|
|
1966
1966
|
}
|
|
1967
|
-
function baseUnset(object2,
|
|
1968
|
-
|
|
1969
|
-
var index = -1, length =
|
|
1967
|
+
function baseUnset(object2, path69) {
|
|
1968
|
+
path69 = castPath(path69, object2);
|
|
1969
|
+
var index = -1, length = path69.length;
|
|
1970
1970
|
if (!length) {
|
|
1971
1971
|
return true;
|
|
1972
1972
|
}
|
|
1973
1973
|
while (++index < length) {
|
|
1974
|
-
var
|
|
1975
|
-
if (
|
|
1974
|
+
var key2 = toKey(path69[index]);
|
|
1975
|
+
if (key2 === "__proto__" && !hasOwnProperty.call(object2, "__proto__")) {
|
|
1976
1976
|
return false;
|
|
1977
1977
|
}
|
|
1978
|
-
if ((
|
|
1978
|
+
if ((key2 === "constructor" || key2 === "prototype") && index < length - 1) {
|
|
1979
1979
|
return false;
|
|
1980
1980
|
}
|
|
1981
1981
|
}
|
|
1982
|
-
var obj = parent(object2,
|
|
1983
|
-
return obj == null || delete obj[toKey(last(
|
|
1982
|
+
var obj = parent(object2, path69);
|
|
1983
|
+
return obj == null || delete obj[toKey(last(path69))];
|
|
1984
1984
|
}
|
|
1985
|
-
function baseUpdate(object2,
|
|
1986
|
-
return baseSet(object2,
|
|
1985
|
+
function baseUpdate(object2, path69, updater, customizer) {
|
|
1986
|
+
return baseSet(object2, path69, updater(baseGet(object2, path69)), customizer);
|
|
1987
1987
|
}
|
|
1988
1988
|
function baseWhile(array2, predicate, isDrop, fromRight) {
|
|
1989
1989
|
var length = array2.length, index = fromRight ? length : -1;
|
|
@@ -2145,15 +2145,15 @@ var require_lodash = __commonJS({
|
|
|
2145
2145
|
object2 || (object2 = {});
|
|
2146
2146
|
var index = -1, length = props.length;
|
|
2147
2147
|
while (++index < length) {
|
|
2148
|
-
var
|
|
2149
|
-
var newValue = customizer ? customizer(object2[
|
|
2148
|
+
var key2 = props[index];
|
|
2149
|
+
var newValue = customizer ? customizer(object2[key2], source[key2], key2, object2, source) : undefined2;
|
|
2150
2150
|
if (newValue === undefined2) {
|
|
2151
|
-
newValue = source[
|
|
2151
|
+
newValue = source[key2];
|
|
2152
2152
|
}
|
|
2153
2153
|
if (isNew) {
|
|
2154
|
-
baseAssignValue(object2,
|
|
2154
|
+
baseAssignValue(object2, key2, newValue);
|
|
2155
2155
|
} else {
|
|
2156
|
-
assignValue(object2,
|
|
2156
|
+
assignValue(object2, key2, newValue);
|
|
2157
2157
|
}
|
|
2158
2158
|
}
|
|
2159
2159
|
return object2;
|
|
@@ -2209,8 +2209,8 @@ var require_lodash = __commonJS({
|
|
|
2209
2209
|
return function(object2, iteratee2, keysFunc) {
|
|
2210
2210
|
var index = -1, iterable = Object2(object2), props = keysFunc(object2), length = props.length;
|
|
2211
2211
|
while (length--) {
|
|
2212
|
-
var
|
|
2213
|
-
if (iteratee2(iterable[
|
|
2212
|
+
var key2 = props[fromRight ? length : ++index];
|
|
2213
|
+
if (iteratee2(iterable[key2], key2, iterable) === false) {
|
|
2214
2214
|
break;
|
|
2215
2215
|
}
|
|
2216
2216
|
}
|
|
@@ -2298,8 +2298,8 @@ var require_lodash = __commonJS({
|
|
|
2298
2298
|
if (!isArrayLike(collection)) {
|
|
2299
2299
|
var iteratee2 = getIteratee(predicate, 3);
|
|
2300
2300
|
collection = keys(collection);
|
|
2301
|
-
predicate = function(
|
|
2302
|
-
return iteratee2(iterable[
|
|
2301
|
+
predicate = function(key2) {
|
|
2302
|
+
return iteratee2(iterable[key2], key2, iterable);
|
|
2303
2303
|
};
|
|
2304
2304
|
}
|
|
2305
2305
|
var index = findIndexFunc(collection, predicate, fromIndex);
|
|
@@ -2590,13 +2590,13 @@ var require_lodash = __commonJS({
|
|
|
2590
2590
|
var setter = data ? baseSetData : setData;
|
|
2591
2591
|
return setWrapToString(setter(result2, newData), func, bitmask);
|
|
2592
2592
|
}
|
|
2593
|
-
function customDefaultsAssignIn(objValue, srcValue,
|
|
2594
|
-
if (objValue === undefined2 || eq(objValue, objectProto[
|
|
2593
|
+
function customDefaultsAssignIn(objValue, srcValue, key2, object2) {
|
|
2594
|
+
if (objValue === undefined2 || eq(objValue, objectProto[key2]) && !hasOwnProperty.call(object2, key2)) {
|
|
2595
2595
|
return srcValue;
|
|
2596
2596
|
}
|
|
2597
2597
|
return objValue;
|
|
2598
2598
|
}
|
|
2599
|
-
function customDefaultsMerge(objValue, srcValue,
|
|
2599
|
+
function customDefaultsMerge(objValue, srcValue, key2, object2, source, stack) {
|
|
2600
2600
|
if (isObject2(objValue) && isObject2(srcValue)) {
|
|
2601
2601
|
stack.set(srcValue, objValue);
|
|
2602
2602
|
baseMerge(objValue, srcValue, undefined2, customDefaultsMerge, stack);
|
|
@@ -2703,8 +2703,8 @@ var require_lodash = __commonJS({
|
|
|
2703
2703
|
}
|
|
2704
2704
|
var index = objLength;
|
|
2705
2705
|
while (index--) {
|
|
2706
|
-
var
|
|
2707
|
-
if (!(isPartial ?
|
|
2706
|
+
var key2 = objProps[index];
|
|
2707
|
+
if (!(isPartial ? key2 in other : hasOwnProperty.call(other, key2))) {
|
|
2708
2708
|
return false;
|
|
2709
2709
|
}
|
|
2710
2710
|
}
|
|
@@ -2718,16 +2718,16 @@ var require_lodash = __commonJS({
|
|
|
2718
2718
|
stack.set(other, object2);
|
|
2719
2719
|
var skipCtor = isPartial;
|
|
2720
2720
|
while (++index < objLength) {
|
|
2721
|
-
|
|
2722
|
-
var objValue = object2[
|
|
2721
|
+
key2 = objProps[index];
|
|
2722
|
+
var objValue = object2[key2], othValue = other[key2];
|
|
2723
2723
|
if (customizer) {
|
|
2724
|
-
var compared = isPartial ? customizer(othValue, objValue,
|
|
2724
|
+
var compared = isPartial ? customizer(othValue, objValue, key2, other, object2, stack) : customizer(objValue, othValue, key2, object2, other, stack);
|
|
2725
2725
|
}
|
|
2726
2726
|
if (!(compared === undefined2 ? objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack) : compared)) {
|
|
2727
2727
|
result2 = false;
|
|
2728
2728
|
break;
|
|
2729
2729
|
}
|
|
2730
|
-
skipCtor || (skipCtor =
|
|
2730
|
+
skipCtor || (skipCtor = key2 == "constructor");
|
|
2731
2731
|
}
|
|
2732
2732
|
if (result2 && !skipCtor) {
|
|
2733
2733
|
var objCtor = object2.constructor, othCtor = other.constructor;
|
|
@@ -2770,20 +2770,20 @@ var require_lodash = __commonJS({
|
|
|
2770
2770
|
result2 = result2 === iteratee ? baseIteratee : result2;
|
|
2771
2771
|
return arguments.length ? result2(arguments[0], arguments[1]) : result2;
|
|
2772
2772
|
}
|
|
2773
|
-
function getMapData(map3,
|
|
2773
|
+
function getMapData(map3, key2) {
|
|
2774
2774
|
var data = map3.__data__;
|
|
2775
|
-
return isKeyable(
|
|
2775
|
+
return isKeyable(key2) ? data[typeof key2 == "string" ? "string" : "hash"] : data.map;
|
|
2776
2776
|
}
|
|
2777
2777
|
function getMatchData(object2) {
|
|
2778
2778
|
var result2 = keys(object2), length = result2.length;
|
|
2779
2779
|
while (length--) {
|
|
2780
|
-
var
|
|
2781
|
-
result2[length] = [
|
|
2780
|
+
var key2 = result2[length], value = object2[key2];
|
|
2781
|
+
result2[length] = [key2, value, isStrictComparable(value)];
|
|
2782
2782
|
}
|
|
2783
2783
|
return result2;
|
|
2784
2784
|
}
|
|
2785
|
-
function getNative(object2,
|
|
2786
|
-
var value = getValue(object2,
|
|
2785
|
+
function getNative(object2, key2) {
|
|
2786
|
+
var value = getValue(object2, key2);
|
|
2787
2787
|
return baseIsNative(value) ? value : undefined2;
|
|
2788
2788
|
}
|
|
2789
2789
|
function getRawTag(value) {
|
|
@@ -2866,21 +2866,21 @@ var require_lodash = __commonJS({
|
|
|
2866
2866
|
var match = source.match(reWrapDetails);
|
|
2867
2867
|
return match ? match[1].split(reSplitDetails) : [];
|
|
2868
2868
|
}
|
|
2869
|
-
function hasPath(object2,
|
|
2870
|
-
|
|
2871
|
-
var index = -1, length =
|
|
2869
|
+
function hasPath(object2, path69, hasFunc) {
|
|
2870
|
+
path69 = castPath(path69, object2);
|
|
2871
|
+
var index = -1, length = path69.length, result2 = false;
|
|
2872
2872
|
while (++index < length) {
|
|
2873
|
-
var
|
|
2874
|
-
if (!(result2 = object2 != null && hasFunc(object2,
|
|
2873
|
+
var key2 = toKey(path69[index]);
|
|
2874
|
+
if (!(result2 = object2 != null && hasFunc(object2, key2))) {
|
|
2875
2875
|
break;
|
|
2876
2876
|
}
|
|
2877
|
-
object2 = object2[
|
|
2877
|
+
object2 = object2[key2];
|
|
2878
2878
|
}
|
|
2879
2879
|
if (result2 || ++index != length) {
|
|
2880
2880
|
return result2;
|
|
2881
2881
|
}
|
|
2882
2882
|
length = object2 == null ? 0 : object2.length;
|
|
2883
|
-
return !!length && isLength(length) && isIndex(
|
|
2883
|
+
return !!length && isLength(length) && isIndex(key2, length) && (isArray(object2) || isArguments(object2));
|
|
2884
2884
|
}
|
|
2885
2885
|
function initCloneArray(array2) {
|
|
2886
2886
|
var length = array2.length, result2 = new array2.constructor(length);
|
|
@@ -2990,20 +2990,20 @@ var require_lodash = __commonJS({
|
|
|
2990
2990
|
function isStrictComparable(value) {
|
|
2991
2991
|
return value === value && !isObject2(value);
|
|
2992
2992
|
}
|
|
2993
|
-
function matchesStrictComparable(
|
|
2993
|
+
function matchesStrictComparable(key2, srcValue) {
|
|
2994
2994
|
return function(object2) {
|
|
2995
2995
|
if (object2 == null) {
|
|
2996
2996
|
return false;
|
|
2997
2997
|
}
|
|
2998
|
-
return object2[
|
|
2998
|
+
return object2[key2] === srcValue && (srcValue !== undefined2 || key2 in Object2(object2));
|
|
2999
2999
|
};
|
|
3000
3000
|
}
|
|
3001
3001
|
function memoizeCapped(func) {
|
|
3002
|
-
var result2 = memoize(func, function(
|
|
3002
|
+
var result2 = memoize(func, function(key2) {
|
|
3003
3003
|
if (cache.size === MAX_MEMOIZE_SIZE) {
|
|
3004
3004
|
cache.clear();
|
|
3005
3005
|
}
|
|
3006
|
-
return
|
|
3006
|
+
return key2;
|
|
3007
3007
|
});
|
|
3008
3008
|
var cache = result2.cache;
|
|
3009
3009
|
return result2;
|
|
@@ -3047,8 +3047,8 @@ var require_lodash = __commonJS({
|
|
|
3047
3047
|
function nativeKeysIn(object2) {
|
|
3048
3048
|
var result2 = [];
|
|
3049
3049
|
if (object2 != null) {
|
|
3050
|
-
for (var
|
|
3051
|
-
result2.push(
|
|
3050
|
+
for (var key2 in Object2(object2)) {
|
|
3051
|
+
result2.push(key2);
|
|
3052
3052
|
}
|
|
3053
3053
|
}
|
|
3054
3054
|
return result2;
|
|
@@ -3072,8 +3072,8 @@ var require_lodash = __commonJS({
|
|
|
3072
3072
|
return apply(func, this, otherArgs);
|
|
3073
3073
|
};
|
|
3074
3074
|
}
|
|
3075
|
-
function parent(object2,
|
|
3076
|
-
return
|
|
3075
|
+
function parent(object2, path69) {
|
|
3076
|
+
return path69.length < 2 ? object2 : baseGet(object2, baseSlice(path69, 0, -1));
|
|
3077
3077
|
}
|
|
3078
3078
|
function reorder(array2, indexes) {
|
|
3079
3079
|
var arrLength = array2.length, length = nativeMin(indexes.length, arrLength), oldArray = copyArray(array2);
|
|
@@ -3083,14 +3083,14 @@ var require_lodash = __commonJS({
|
|
|
3083
3083
|
}
|
|
3084
3084
|
return array2;
|
|
3085
3085
|
}
|
|
3086
|
-
function safeGet(object2,
|
|
3087
|
-
if (
|
|
3086
|
+
function safeGet(object2, key2) {
|
|
3087
|
+
if (key2 === "constructor" && typeof object2[key2] === "function") {
|
|
3088
3088
|
return;
|
|
3089
3089
|
}
|
|
3090
|
-
if (
|
|
3090
|
+
if (key2 == "__proto__") {
|
|
3091
3091
|
return;
|
|
3092
3092
|
}
|
|
3093
|
-
return object2[
|
|
3093
|
+
return object2[key2];
|
|
3094
3094
|
}
|
|
3095
3095
|
var setData = shortOut(baseSetData);
|
|
3096
3096
|
var setTimeout2 = ctxSetTimeout || function(func, wait) {
|
|
@@ -3654,11 +3654,11 @@ var require_lodash = __commonJS({
|
|
|
3654
3654
|
function wrapperValue() {
|
|
3655
3655
|
return baseWrapperValue(this.__wrapped__, this.__actions__);
|
|
3656
3656
|
}
|
|
3657
|
-
var countBy = createAggregator(function(result2, value,
|
|
3658
|
-
if (hasOwnProperty.call(result2,
|
|
3659
|
-
++result2[
|
|
3657
|
+
var countBy = createAggregator(function(result2, value, key2) {
|
|
3658
|
+
if (hasOwnProperty.call(result2, key2)) {
|
|
3659
|
+
++result2[key2];
|
|
3660
3660
|
} else {
|
|
3661
|
-
baseAssignValue(result2,
|
|
3661
|
+
baseAssignValue(result2, key2, 1);
|
|
3662
3662
|
}
|
|
3663
3663
|
});
|
|
3664
3664
|
function every(collection, predicate, guard) {
|
|
@@ -3692,11 +3692,11 @@ var require_lodash = __commonJS({
|
|
|
3692
3692
|
var func = isArray(collection) ? arrayEachRight : baseEachRight;
|
|
3693
3693
|
return func(collection, getIteratee(iteratee2, 3));
|
|
3694
3694
|
}
|
|
3695
|
-
var groupBy = createAggregator(function(result2, value,
|
|
3696
|
-
if (hasOwnProperty.call(result2,
|
|
3697
|
-
result2[
|
|
3695
|
+
var groupBy = createAggregator(function(result2, value, key2) {
|
|
3696
|
+
if (hasOwnProperty.call(result2, key2)) {
|
|
3697
|
+
result2[key2].push(value);
|
|
3698
3698
|
} else {
|
|
3699
|
-
baseAssignValue(result2,
|
|
3699
|
+
baseAssignValue(result2, key2, [value]);
|
|
3700
3700
|
}
|
|
3701
3701
|
});
|
|
3702
3702
|
function includes(collection, value, fromIndex, guard) {
|
|
@@ -3708,15 +3708,15 @@ var require_lodash = __commonJS({
|
|
|
3708
3708
|
}
|
|
3709
3709
|
return isString(collection) ? fromIndex <= length && collection.indexOf(value, fromIndex) > -1 : !!length && baseIndexOf(collection, value, fromIndex) > -1;
|
|
3710
3710
|
}
|
|
3711
|
-
var invokeMap = baseRest(function(collection,
|
|
3712
|
-
var index = -1, isFunc = typeof
|
|
3711
|
+
var invokeMap = baseRest(function(collection, path69, args) {
|
|
3712
|
+
var index = -1, isFunc = typeof path69 == "function", result2 = isArrayLike(collection) ? Array2(collection.length) : [];
|
|
3713
3713
|
baseEach(collection, function(value) {
|
|
3714
|
-
result2[++index] = isFunc ? apply(
|
|
3714
|
+
result2[++index] = isFunc ? apply(path69, value, args) : baseInvoke(value, path69, args);
|
|
3715
3715
|
});
|
|
3716
3716
|
return result2;
|
|
3717
3717
|
});
|
|
3718
|
-
var keyBy = createAggregator(function(result2, value,
|
|
3719
|
-
baseAssignValue(result2,
|
|
3718
|
+
var keyBy = createAggregator(function(result2, value, key2) {
|
|
3719
|
+
baseAssignValue(result2, key2, value);
|
|
3720
3720
|
});
|
|
3721
3721
|
function map2(collection, iteratee2) {
|
|
3722
3722
|
var func = isArray(collection) ? arrayMap : baseMap;
|
|
@@ -3735,8 +3735,8 @@ var require_lodash = __commonJS({
|
|
|
3735
3735
|
}
|
|
3736
3736
|
return baseOrderBy(collection, iteratees, orders);
|
|
3737
3737
|
}
|
|
3738
|
-
var partition = createAggregator(function(result2, value,
|
|
3739
|
-
result2[
|
|
3738
|
+
var partition = createAggregator(function(result2, value, key2) {
|
|
3739
|
+
result2[key2 ? 0 : 1].push(value);
|
|
3740
3740
|
}, function() {
|
|
3741
3741
|
return [[], []];
|
|
3742
3742
|
});
|
|
@@ -3844,13 +3844,13 @@ var require_lodash = __commonJS({
|
|
|
3844
3844
|
}
|
|
3845
3845
|
return createWrap(func, bitmask, thisArg, partials, holders);
|
|
3846
3846
|
});
|
|
3847
|
-
var bindKey = baseRest(function(object2,
|
|
3847
|
+
var bindKey = baseRest(function(object2, key2, partials) {
|
|
3848
3848
|
var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;
|
|
3849
3849
|
if (partials.length) {
|
|
3850
3850
|
var holders = replaceHolders(partials, getHolder(bindKey));
|
|
3851
3851
|
bitmask |= WRAP_PARTIAL_FLAG;
|
|
3852
3852
|
}
|
|
3853
|
-
return createWrap(
|
|
3853
|
+
return createWrap(key2, bitmask, object2, partials, holders);
|
|
3854
3854
|
});
|
|
3855
3855
|
function curry(func, arity, guard) {
|
|
3856
3856
|
arity = guard ? undefined2 : arity;
|
|
@@ -3959,12 +3959,12 @@ var require_lodash = __commonJS({
|
|
|
3959
3959
|
throw new TypeError2(FUNC_ERROR_TEXT);
|
|
3960
3960
|
}
|
|
3961
3961
|
var memoized = function() {
|
|
3962
|
-
var args = arguments,
|
|
3963
|
-
if (cache.has(
|
|
3964
|
-
return cache.get(
|
|
3962
|
+
var args = arguments, key2 = resolver ? resolver.apply(this, args) : args[0], cache = memoized.cache;
|
|
3963
|
+
if (cache.has(key2)) {
|
|
3964
|
+
return cache.get(key2);
|
|
3965
3965
|
}
|
|
3966
3966
|
var result2 = func.apply(this, args);
|
|
3967
|
-
memoized.cache = cache.set(
|
|
3967
|
+
memoized.cache = cache.set(key2, result2) || cache;
|
|
3968
3968
|
return result2;
|
|
3969
3969
|
};
|
|
3970
3970
|
memoized.cache = new (memoize.Cache || MapCache)();
|
|
@@ -4122,8 +4122,8 @@ var require_lodash = __commonJS({
|
|
|
4122
4122
|
if (isPrototype(value)) {
|
|
4123
4123
|
return !baseKeys(value).length;
|
|
4124
4124
|
}
|
|
4125
|
-
for (var
|
|
4126
|
-
if (hasOwnProperty.call(value,
|
|
4125
|
+
for (var key2 in value) {
|
|
4126
|
+
if (hasOwnProperty.call(value, key2)) {
|
|
4127
4127
|
return false;
|
|
4128
4128
|
}
|
|
4129
4129
|
}
|
|
@@ -4292,9 +4292,9 @@ var require_lodash = __commonJS({
|
|
|
4292
4292
|
copyObject(source, keys(source), object2);
|
|
4293
4293
|
return;
|
|
4294
4294
|
}
|
|
4295
|
-
for (var
|
|
4296
|
-
if (hasOwnProperty.call(source,
|
|
4297
|
-
assignValue(object2,
|
|
4295
|
+
for (var key2 in source) {
|
|
4296
|
+
if (hasOwnProperty.call(source, key2)) {
|
|
4297
|
+
assignValue(object2, key2, source[key2]);
|
|
4298
4298
|
}
|
|
4299
4299
|
}
|
|
4300
4300
|
});
|
|
@@ -4326,10 +4326,10 @@ var require_lodash = __commonJS({
|
|
|
4326
4326
|
var propsIndex = -1;
|
|
4327
4327
|
var propsLength = props.length;
|
|
4328
4328
|
while (++propsIndex < propsLength) {
|
|
4329
|
-
var
|
|
4330
|
-
var value = object2[
|
|
4331
|
-
if (value === undefined2 || eq(value, objectProto[
|
|
4332
|
-
object2[
|
|
4329
|
+
var key2 = props[propsIndex];
|
|
4330
|
+
var value = object2[key2];
|
|
4331
|
+
if (value === undefined2 || eq(value, objectProto[key2]) && !hasOwnProperty.call(object2, key2)) {
|
|
4332
|
+
object2[key2] = source[key2];
|
|
4333
4333
|
}
|
|
4334
4334
|
}
|
|
4335
4335
|
}
|
|
@@ -4363,30 +4363,30 @@ var require_lodash = __commonJS({
|
|
|
4363
4363
|
function functionsIn(object2) {
|
|
4364
4364
|
return object2 == null ? [] : baseFunctions(object2, keysIn(object2));
|
|
4365
4365
|
}
|
|
4366
|
-
function get(object2,
|
|
4367
|
-
var result2 = object2 == null ? undefined2 : baseGet(object2,
|
|
4366
|
+
function get(object2, path69, defaultValue) {
|
|
4367
|
+
var result2 = object2 == null ? undefined2 : baseGet(object2, path69);
|
|
4368
4368
|
return result2 === undefined2 ? defaultValue : result2;
|
|
4369
4369
|
}
|
|
4370
|
-
function has(object2,
|
|
4371
|
-
return object2 != null && hasPath(object2,
|
|
4370
|
+
function has(object2, path69) {
|
|
4371
|
+
return object2 != null && hasPath(object2, path69, baseHas);
|
|
4372
4372
|
}
|
|
4373
|
-
function hasIn(object2,
|
|
4374
|
-
return object2 != null && hasPath(object2,
|
|
4373
|
+
function hasIn(object2, path69) {
|
|
4374
|
+
return object2 != null && hasPath(object2, path69, baseHasIn);
|
|
4375
4375
|
}
|
|
4376
|
-
var invert = createInverter(function(result2, value,
|
|
4376
|
+
var invert = createInverter(function(result2, value, key2) {
|
|
4377
4377
|
if (value != null && typeof value.toString != "function") {
|
|
4378
4378
|
value = nativeObjectToString.call(value);
|
|
4379
4379
|
}
|
|
4380
|
-
result2[value] =
|
|
4380
|
+
result2[value] = key2;
|
|
4381
4381
|
}, constant(identity));
|
|
4382
|
-
var invertBy = createInverter(function(result2, value,
|
|
4382
|
+
var invertBy = createInverter(function(result2, value, key2) {
|
|
4383
4383
|
if (value != null && typeof value.toString != "function") {
|
|
4384
4384
|
value = nativeObjectToString.call(value);
|
|
4385
4385
|
}
|
|
4386
4386
|
if (hasOwnProperty.call(result2, value)) {
|
|
4387
|
-
result2[value].push(
|
|
4387
|
+
result2[value].push(key2);
|
|
4388
4388
|
} else {
|
|
4389
|
-
result2[value] = [
|
|
4389
|
+
result2[value] = [key2];
|
|
4390
4390
|
}
|
|
4391
4391
|
}, getIteratee);
|
|
4392
4392
|
var invoke = baseRest(baseInvoke);
|
|
@@ -4399,16 +4399,16 @@ var require_lodash = __commonJS({
|
|
|
4399
4399
|
function mapKeys(object2, iteratee2) {
|
|
4400
4400
|
var result2 = {};
|
|
4401
4401
|
iteratee2 = getIteratee(iteratee2, 3);
|
|
4402
|
-
baseForOwn(object2, function(value,
|
|
4403
|
-
baseAssignValue(result2, iteratee2(value,
|
|
4402
|
+
baseForOwn(object2, function(value, key2, object3) {
|
|
4403
|
+
baseAssignValue(result2, iteratee2(value, key2, object3), value);
|
|
4404
4404
|
});
|
|
4405
4405
|
return result2;
|
|
4406
4406
|
}
|
|
4407
4407
|
function mapValues(object2, iteratee2) {
|
|
4408
4408
|
var result2 = {};
|
|
4409
4409
|
iteratee2 = getIteratee(iteratee2, 3);
|
|
4410
|
-
baseForOwn(object2, function(value,
|
|
4411
|
-
baseAssignValue(result2,
|
|
4410
|
+
baseForOwn(object2, function(value, key2, object3) {
|
|
4411
|
+
baseAssignValue(result2, key2, iteratee2(value, key2, object3));
|
|
4412
4412
|
});
|
|
4413
4413
|
return result2;
|
|
4414
4414
|
}
|
|
@@ -4424,10 +4424,10 @@ var require_lodash = __commonJS({
|
|
|
4424
4424
|
return result2;
|
|
4425
4425
|
}
|
|
4426
4426
|
var isDeep = false;
|
|
4427
|
-
paths = arrayMap(paths, function(
|
|
4428
|
-
|
|
4429
|
-
isDeep || (isDeep =
|
|
4430
|
-
return
|
|
4427
|
+
paths = arrayMap(paths, function(path69) {
|
|
4428
|
+
path69 = castPath(path69, object2);
|
|
4429
|
+
isDeep || (isDeep = path69.length > 1);
|
|
4430
|
+
return path69;
|
|
4431
4431
|
});
|
|
4432
4432
|
copyObject(object2, getAllKeysIn(object2), result2);
|
|
4433
4433
|
if (isDeep) {
|
|
@@ -4453,19 +4453,19 @@ var require_lodash = __commonJS({
|
|
|
4453
4453
|
return [prop];
|
|
4454
4454
|
});
|
|
4455
4455
|
predicate = getIteratee(predicate);
|
|
4456
|
-
return basePickBy(object2, props, function(value,
|
|
4457
|
-
return predicate(value,
|
|
4456
|
+
return basePickBy(object2, props, function(value, path69) {
|
|
4457
|
+
return predicate(value, path69[0]);
|
|
4458
4458
|
});
|
|
4459
4459
|
}
|
|
4460
|
-
function result(object2,
|
|
4461
|
-
|
|
4462
|
-
var index = -1, length =
|
|
4460
|
+
function result(object2, path69, defaultValue) {
|
|
4461
|
+
path69 = castPath(path69, object2);
|
|
4462
|
+
var index = -1, length = path69.length;
|
|
4463
4463
|
if (!length) {
|
|
4464
4464
|
length = 1;
|
|
4465
4465
|
object2 = undefined2;
|
|
4466
4466
|
}
|
|
4467
4467
|
while (++index < length) {
|
|
4468
|
-
var value = object2 == null ? undefined2 : object2[toKey(
|
|
4468
|
+
var value = object2 == null ? undefined2 : object2[toKey(path69[index])];
|
|
4469
4469
|
if (value === undefined2) {
|
|
4470
4470
|
index = length;
|
|
4471
4471
|
value = defaultValue;
|
|
@@ -4474,12 +4474,12 @@ var require_lodash = __commonJS({
|
|
|
4474
4474
|
}
|
|
4475
4475
|
return object2;
|
|
4476
4476
|
}
|
|
4477
|
-
function set2(object2,
|
|
4478
|
-
return object2 == null ? object2 : baseSet(object2,
|
|
4477
|
+
function set2(object2, path69, value) {
|
|
4478
|
+
return object2 == null ? object2 : baseSet(object2, path69, value);
|
|
4479
4479
|
}
|
|
4480
|
-
function setWith(object2,
|
|
4480
|
+
function setWith(object2, path69, value, customizer) {
|
|
4481
4481
|
customizer = typeof customizer == "function" ? customizer : undefined2;
|
|
4482
|
-
return object2 == null ? object2 : baseSet(object2,
|
|
4482
|
+
return object2 == null ? object2 : baseSet(object2, path69, value, customizer);
|
|
4483
4483
|
}
|
|
4484
4484
|
var toPairs = createToPairs(keys);
|
|
4485
4485
|
var toPairsIn = createToPairs(keysIn);
|
|
@@ -4501,15 +4501,15 @@ var require_lodash = __commonJS({
|
|
|
4501
4501
|
});
|
|
4502
4502
|
return accumulator;
|
|
4503
4503
|
}
|
|
4504
|
-
function unset(object2,
|
|
4505
|
-
return object2 == null ? true : baseUnset(object2,
|
|
4504
|
+
function unset(object2, path69) {
|
|
4505
|
+
return object2 == null ? true : baseUnset(object2, path69);
|
|
4506
4506
|
}
|
|
4507
|
-
function update(object2,
|
|
4508
|
-
return object2 == null ? object2 : baseUpdate(object2,
|
|
4507
|
+
function update(object2, path69, updater) {
|
|
4508
|
+
return object2 == null ? object2 : baseUpdate(object2, path69, castFunction(updater));
|
|
4509
4509
|
}
|
|
4510
|
-
function updateWith(object2,
|
|
4510
|
+
function updateWith(object2, path69, updater, customizer) {
|
|
4511
4511
|
customizer = typeof customizer == "function" ? customizer : undefined2;
|
|
4512
|
-
return object2 == null ? object2 : baseUpdate(object2,
|
|
4512
|
+
return object2 == null ? object2 : baseUpdate(object2, path69, castFunction(updater), customizer);
|
|
4513
4513
|
}
|
|
4514
4514
|
function values(object2) {
|
|
4515
4515
|
return object2 == null ? [] : baseValues(object2, keys(object2));
|
|
@@ -4693,8 +4693,8 @@ var require_lodash = __commonJS({
|
|
|
4693
4693
|
string4 = toString(string4);
|
|
4694
4694
|
options = assignWith({}, options, settings, customDefaultsAssignIn);
|
|
4695
4695
|
var imports = assignWith({}, options.imports, settings.imports, customDefaultsAssignIn), importsKeys = keys(imports), importsValues = baseValues(imports, importsKeys);
|
|
4696
|
-
arrayEach(importsKeys, function(
|
|
4697
|
-
if (reForbiddenIdentifierChars.test(
|
|
4696
|
+
arrayEach(importsKeys, function(key2) {
|
|
4697
|
+
if (reForbiddenIdentifierChars.test(key2)) {
|
|
4698
4698
|
throw new Error2(INVALID_TEMPL_IMPORTS_ERROR_TEXT);
|
|
4699
4699
|
}
|
|
4700
4700
|
});
|
|
@@ -4849,9 +4849,9 @@ var require_lodash = __commonJS({
|
|
|
4849
4849
|
}
|
|
4850
4850
|
});
|
|
4851
4851
|
var bindAll = flatRest(function(object2, methodNames) {
|
|
4852
|
-
arrayEach(methodNames, function(
|
|
4853
|
-
|
|
4854
|
-
baseAssignValue(object2,
|
|
4852
|
+
arrayEach(methodNames, function(key2) {
|
|
4853
|
+
key2 = toKey(key2);
|
|
4854
|
+
baseAssignValue(object2, key2, bind(object2[key2], object2));
|
|
4855
4855
|
});
|
|
4856
4856
|
return object2;
|
|
4857
4857
|
});
|
|
@@ -4895,17 +4895,17 @@ var require_lodash = __commonJS({
|
|
|
4895
4895
|
function matches(source) {
|
|
4896
4896
|
return baseMatches(baseClone(source, CLONE_DEEP_FLAG));
|
|
4897
4897
|
}
|
|
4898
|
-
function matchesProperty(
|
|
4899
|
-
return baseMatchesProperty(
|
|
4898
|
+
function matchesProperty(path69, srcValue) {
|
|
4899
|
+
return baseMatchesProperty(path69, baseClone(srcValue, CLONE_DEEP_FLAG));
|
|
4900
4900
|
}
|
|
4901
|
-
var method = baseRest(function(
|
|
4901
|
+
var method = baseRest(function(path69, args) {
|
|
4902
4902
|
return function(object2) {
|
|
4903
|
-
return baseInvoke(object2,
|
|
4903
|
+
return baseInvoke(object2, path69, args);
|
|
4904
4904
|
};
|
|
4905
4905
|
});
|
|
4906
4906
|
var methodOf = baseRest(function(object2, args) {
|
|
4907
|
-
return function(
|
|
4908
|
-
return baseInvoke(object2,
|
|
4907
|
+
return function(path69) {
|
|
4908
|
+
return baseInvoke(object2, path69, args);
|
|
4909
4909
|
};
|
|
4910
4910
|
});
|
|
4911
4911
|
function mixin(object2, source, options) {
|
|
@@ -4952,12 +4952,12 @@ var require_lodash = __commonJS({
|
|
|
4952
4952
|
var over = createOver(arrayMap);
|
|
4953
4953
|
var overEvery = createOver(arrayEvery);
|
|
4954
4954
|
var overSome = createOver(arraySome);
|
|
4955
|
-
function property(
|
|
4956
|
-
return isKey(
|
|
4955
|
+
function property(path69) {
|
|
4956
|
+
return isKey(path69) ? baseProperty(toKey(path69)) : basePropertyDeep(path69);
|
|
4957
4957
|
}
|
|
4958
4958
|
function propertyOf(object2) {
|
|
4959
|
-
return function(
|
|
4960
|
-
return object2 == null ? undefined2 : baseGet(object2,
|
|
4959
|
+
return function(path69) {
|
|
4960
|
+
return object2 == null ? undefined2 : baseGet(object2, path69);
|
|
4961
4961
|
};
|
|
4962
4962
|
}
|
|
4963
4963
|
var range = createRange();
|
|
@@ -5410,12 +5410,12 @@ var require_lodash = __commonJS({
|
|
|
5410
5410
|
LazyWrapper.prototype.findLast = function(predicate) {
|
|
5411
5411
|
return this.reverse().find(predicate);
|
|
5412
5412
|
};
|
|
5413
|
-
LazyWrapper.prototype.invokeMap = baseRest(function(
|
|
5414
|
-
if (typeof
|
|
5413
|
+
LazyWrapper.prototype.invokeMap = baseRest(function(path69, args) {
|
|
5414
|
+
if (typeof path69 == "function") {
|
|
5415
5415
|
return new LazyWrapper(this);
|
|
5416
5416
|
}
|
|
5417
5417
|
return this.map(function(value) {
|
|
5418
|
-
return baseInvoke(value,
|
|
5418
|
+
return baseInvoke(value, path69, args);
|
|
5419
5419
|
});
|
|
5420
5420
|
});
|
|
5421
5421
|
LazyWrapper.prototype.reject = function(predicate) {
|
|
@@ -5488,11 +5488,11 @@ var require_lodash = __commonJS({
|
|
|
5488
5488
|
baseForOwn(LazyWrapper.prototype, function(func, methodName) {
|
|
5489
5489
|
var lodashFunc = lodash[methodName];
|
|
5490
5490
|
if (lodashFunc) {
|
|
5491
|
-
var
|
|
5492
|
-
if (!hasOwnProperty.call(realNames,
|
|
5493
|
-
realNames[
|
|
5491
|
+
var key2 = lodashFunc.name + "";
|
|
5492
|
+
if (!hasOwnProperty.call(realNames, key2)) {
|
|
5493
|
+
realNames[key2] = [];
|
|
5494
5494
|
}
|
|
5495
|
-
realNames[
|
|
5495
|
+
realNames[key2].push({ "name": methodName, "func": lodashFunc });
|
|
5496
5496
|
}
|
|
5497
5497
|
});
|
|
5498
5498
|
realNames[createHybrid(undefined2, WRAP_BIND_KEY_FLAG).name] = [{
|
|
@@ -6272,9 +6272,9 @@ function floatSafeRemainder(val, step) {
|
|
|
6272
6272
|
return ratio - roundedRatio;
|
|
6273
6273
|
}
|
|
6274
6274
|
var EVALUATING = /* @__PURE__ */ Symbol("evaluating");
|
|
6275
|
-
function defineLazy(object2,
|
|
6275
|
+
function defineLazy(object2, key2, getter) {
|
|
6276
6276
|
let value = void 0;
|
|
6277
|
-
Object.defineProperty(object2,
|
|
6277
|
+
Object.defineProperty(object2, key2, {
|
|
6278
6278
|
get() {
|
|
6279
6279
|
if (value === EVALUATING) {
|
|
6280
6280
|
return void 0;
|
|
@@ -6286,7 +6286,7 @@ function defineLazy(object2, key, getter) {
|
|
|
6286
6286
|
return value;
|
|
6287
6287
|
},
|
|
6288
6288
|
set(v) {
|
|
6289
|
-
Object.defineProperty(object2,
|
|
6289
|
+
Object.defineProperty(object2, key2, {
|
|
6290
6290
|
value: v
|
|
6291
6291
|
// configurable: true,
|
|
6292
6292
|
});
|
|
@@ -6312,47 +6312,47 @@ function rawShape(def) {
|
|
|
6312
6312
|
function sourceShape(schema) {
|
|
6313
6313
|
return rawShape(schema._zod.def) ?? schema._zod.def.shape;
|
|
6314
6314
|
}
|
|
6315
|
-
function deferProp(target,
|
|
6316
|
-
Object.defineProperty(target,
|
|
6315
|
+
function deferProp(target, key2, getter) {
|
|
6316
|
+
Object.defineProperty(target, key2, {
|
|
6317
6317
|
get() {
|
|
6318
6318
|
const value = getter();
|
|
6319
|
-
assignProp(this,
|
|
6319
|
+
assignProp(this, key2, value);
|
|
6320
6320
|
return value;
|
|
6321
6321
|
},
|
|
6322
6322
|
enumerable: true,
|
|
6323
6323
|
configurable: true
|
|
6324
6324
|
});
|
|
6325
6325
|
}
|
|
6326
|
-
function putProp(target,
|
|
6327
|
-
if (
|
|
6328
|
-
assignProp(target,
|
|
6326
|
+
function putProp(target, key2, value) {
|
|
6327
|
+
if (key2 in target)
|
|
6328
|
+
assignProp(target, key2, value);
|
|
6329
6329
|
else
|
|
6330
|
-
target[
|
|
6330
|
+
target[key2] = value;
|
|
6331
6331
|
}
|
|
6332
6332
|
function mirrorShape(target, source, keys, wrap) {
|
|
6333
6333
|
const raw = sourceShape(source);
|
|
6334
|
-
for (const
|
|
6335
|
-
const desc = Object.getOwnPropertyDescriptor(raw,
|
|
6334
|
+
for (const key2 of keys) {
|
|
6335
|
+
const desc = Object.getOwnPropertyDescriptor(raw, key2);
|
|
6336
6336
|
if (!desc.enumerable)
|
|
6337
6337
|
continue;
|
|
6338
6338
|
if (desc.get) {
|
|
6339
|
-
deferProp(target,
|
|
6340
|
-
const value = source._zod.def.shape[
|
|
6341
|
-
return wrap ? wrap(value,
|
|
6339
|
+
deferProp(target, key2, () => {
|
|
6340
|
+
const value = source._zod.def.shape[key2];
|
|
6341
|
+
return wrap ? wrap(value, key2) : value;
|
|
6342
6342
|
});
|
|
6343
6343
|
} else
|
|
6344
|
-
putProp(target,
|
|
6344
|
+
putProp(target, key2, wrap ? wrap(desc.value, key2) : desc.value);
|
|
6345
6345
|
}
|
|
6346
6346
|
}
|
|
6347
6347
|
function mirrorProps(target, source) {
|
|
6348
|
-
for (const
|
|
6349
|
-
const desc = Object.getOwnPropertyDescriptor(source,
|
|
6348
|
+
for (const key2 of Reflect.ownKeys(source)) {
|
|
6349
|
+
const desc = Object.getOwnPropertyDescriptor(source, key2);
|
|
6350
6350
|
if (!desc.enumerable)
|
|
6351
6351
|
continue;
|
|
6352
6352
|
if (desc.get)
|
|
6353
|
-
deferProp(target,
|
|
6353
|
+
deferProp(target, key2, () => source[key2]);
|
|
6354
6354
|
else
|
|
6355
|
-
putProp(target,
|
|
6355
|
+
putProp(target, key2, desc.value);
|
|
6356
6356
|
}
|
|
6357
6357
|
}
|
|
6358
6358
|
function mergeDefs(...defs) {
|
|
@@ -6366,14 +6366,14 @@ function mergeDefs(...defs) {
|
|
|
6366
6366
|
function cloneDef(schema) {
|
|
6367
6367
|
return mergeDefs(schema._zod.def);
|
|
6368
6368
|
}
|
|
6369
|
-
function getElementAtPath(obj,
|
|
6370
|
-
if (!
|
|
6369
|
+
function getElementAtPath(obj, path69) {
|
|
6370
|
+
if (!path69)
|
|
6371
6371
|
return obj;
|
|
6372
|
-
return
|
|
6372
|
+
return path69.reduce((acc, key2) => acc?.[key2], obj);
|
|
6373
6373
|
}
|
|
6374
6374
|
function promiseAllObject(promisesObj) {
|
|
6375
6375
|
const keys = Object.keys(promisesObj);
|
|
6376
|
-
const promises = keys.map((
|
|
6376
|
+
const promises = keys.map((key2) => promisesObj[key2]);
|
|
6377
6377
|
return Promise.all(promises).then((results) => {
|
|
6378
6378
|
const resolvedObj = {};
|
|
6379
6379
|
for (let i = 0; i < keys.length; i++) {
|
|
@@ -6445,8 +6445,8 @@ function shallowClone(o) {
|
|
|
6445
6445
|
}
|
|
6446
6446
|
function numKeys(data) {
|
|
6447
6447
|
let keyCount = 0;
|
|
6448
|
-
for (const
|
|
6449
|
-
if (Object.prototype.hasOwnProperty.call(data,
|
|
6448
|
+
for (const key2 in data) {
|
|
6449
|
+
if (Object.prototype.hasOwnProperty.call(data, key2)) {
|
|
6450
6450
|
keyCount++;
|
|
6451
6451
|
}
|
|
6452
6452
|
}
|
|
@@ -6600,12 +6600,12 @@ function pick(schema, mask) {
|
|
|
6600
6600
|
function maskedKeys(schema, mask) {
|
|
6601
6601
|
const raw = sourceShape(schema);
|
|
6602
6602
|
const keys = [];
|
|
6603
|
-
for (const
|
|
6604
|
-
if (!Object.getOwnPropertyDescriptor(raw,
|
|
6605
|
-
throw new Error(`Unrecognized key: "${String(
|
|
6603
|
+
for (const key2 of Reflect.ownKeys(mask)) {
|
|
6604
|
+
if (!Object.getOwnPropertyDescriptor(raw, key2)?.enumerable) {
|
|
6605
|
+
throw new Error(`Unrecognized key: "${String(key2)}"`);
|
|
6606
6606
|
}
|
|
6607
|
-
if (mask[
|
|
6608
|
-
keys.push(
|
|
6607
|
+
if (mask[key2])
|
|
6608
|
+
keys.push(key2);
|
|
6609
6609
|
}
|
|
6610
6610
|
return keys;
|
|
6611
6611
|
}
|
|
@@ -6618,7 +6618,7 @@ function omit(schema, mask) {
|
|
|
6618
6618
|
}
|
|
6619
6619
|
const omitted = new Set(maskedKeys(schema, mask));
|
|
6620
6620
|
const newShape = {};
|
|
6621
|
-
mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)).filter((
|
|
6621
|
+
mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)).filter((key2) => !omitted.has(key2)));
|
|
6622
6622
|
return clone(schema, mergeDefs(currDef, { shape: newShape, checks: [] }));
|
|
6623
6623
|
}
|
|
6624
6624
|
function extend(schema, shape) {
|
|
@@ -6629,8 +6629,8 @@ function extend(schema, shape) {
|
|
|
6629
6629
|
const hasChecks = checks && checks.length > 0;
|
|
6630
6630
|
if (hasChecks) {
|
|
6631
6631
|
const existingShape = sourceShape(schema);
|
|
6632
|
-
for (const
|
|
6633
|
-
if (Object.getOwnPropertyDescriptor(existingShape,
|
|
6632
|
+
for (const key2 of Reflect.ownKeys(shape)) {
|
|
6633
|
+
if (Object.getOwnPropertyDescriptor(existingShape, key2) !== void 0) {
|
|
6634
6634
|
throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.");
|
|
6635
6635
|
}
|
|
6636
6636
|
}
|
|
@@ -6677,15 +6677,15 @@ function partial(Class2, schema, mask, name = "partial") {
|
|
|
6677
6677
|
}
|
|
6678
6678
|
const selected = mask ? new Set(maskedKeys(schema, mask)) : void 0;
|
|
6679
6679
|
const newShape = {};
|
|
6680
|
-
mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)), Class2 && ((value,
|
|
6680
|
+
mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)), Class2 && ((value, key2) => selected && !selected.has(key2) ? value : new Class2({ type: "optional", innerType: value })));
|
|
6681
6681
|
return clone(schema, mergeDefs(schema._zod.def, { shape: newShape, checks: [] }));
|
|
6682
6682
|
}
|
|
6683
6683
|
function required(Class2, schema, mask) {
|
|
6684
6684
|
const selected = mask ? new Set(maskedKeys(schema, mask)) : void 0;
|
|
6685
6685
|
const newShape = {};
|
|
6686
|
-
mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)), (value,
|
|
6686
|
+
mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)), (value, key2) => (
|
|
6687
6687
|
// overwrite with non-optional
|
|
6688
|
-
selected && !selected.has(
|
|
6688
|
+
selected && !selected.has(key2) ? value : new Class2({ type: "nonoptional", innerType: value })
|
|
6689
6689
|
));
|
|
6690
6690
|
return clone(schema, mergeDefs(schema._zod.def, { shape: newShape }));
|
|
6691
6691
|
}
|
|
@@ -6709,11 +6709,11 @@ function explicitlyAborted(x, startIndex = 0) {
|
|
|
6709
6709
|
}
|
|
6710
6710
|
return false;
|
|
6711
6711
|
}
|
|
6712
|
-
function prefixIssues(
|
|
6712
|
+
function prefixIssues(path69, issues) {
|
|
6713
6713
|
return issues.map((iss) => {
|
|
6714
6714
|
var _a3;
|
|
6715
6715
|
(_a3 = iss).path ?? (_a3.path = []);
|
|
6716
|
-
iss.path.unshift(
|
|
6716
|
+
iss.path.unshift(path69);
|
|
6717
6717
|
return iss;
|
|
6718
6718
|
});
|
|
6719
6719
|
}
|
|
@@ -6860,46 +6860,46 @@ var Class = class {
|
|
|
6860
6860
|
}
|
|
6861
6861
|
};
|
|
6862
6862
|
function members(proto, table) {
|
|
6863
|
-
for (const
|
|
6864
|
-
const desc = Object.getOwnPropertyDescriptor(table,
|
|
6863
|
+
for (const key2 in table) {
|
|
6864
|
+
const desc = Object.getOwnPropertyDescriptor(table, key2);
|
|
6865
6865
|
if (desc.get)
|
|
6866
|
-
Object.defineProperty(proto,
|
|
6866
|
+
Object.defineProperty(proto, key2, { ...desc, enumerable: false });
|
|
6867
6867
|
else
|
|
6868
|
-
defineBound(proto,
|
|
6868
|
+
defineBound(proto, key2, desc.value);
|
|
6869
6869
|
}
|
|
6870
6870
|
}
|
|
6871
|
-
function own(inst,
|
|
6872
|
-
Object.defineProperty(inst,
|
|
6871
|
+
function own(inst, key2, value, enumerable = true) {
|
|
6872
|
+
Object.defineProperty(inst, key2, { configurable: true, writable: true, enumerable, value });
|
|
6873
6873
|
return value;
|
|
6874
6874
|
}
|
|
6875
|
-
function hide(inst,
|
|
6876
|
-
return own(inst,
|
|
6875
|
+
function hide(inst, key2, value) {
|
|
6876
|
+
return own(inst, key2, value, false);
|
|
6877
6877
|
}
|
|
6878
6878
|
// @__NO_SIDE_EFFECTS__
|
|
6879
6879
|
function derived(computes, table) {
|
|
6880
|
-
for (const
|
|
6881
|
-
const compute = computes[
|
|
6882
|
-
Object.defineProperty(table,
|
|
6880
|
+
for (const key2 in computes) {
|
|
6881
|
+
const compute = computes[key2];
|
|
6882
|
+
Object.defineProperty(table, key2, {
|
|
6883
6883
|
configurable: true,
|
|
6884
6884
|
enumerable: true,
|
|
6885
6885
|
get() {
|
|
6886
|
-
return own(this,
|
|
6886
|
+
return own(this, key2, compute(this));
|
|
6887
6887
|
},
|
|
6888
6888
|
set(value) {
|
|
6889
|
-
own(this,
|
|
6889
|
+
own(this, key2, value);
|
|
6890
6890
|
}
|
|
6891
6891
|
});
|
|
6892
6892
|
}
|
|
6893
6893
|
return table;
|
|
6894
6894
|
}
|
|
6895
|
-
function defineBound(proto,
|
|
6896
|
-
Object.defineProperty(proto,
|
|
6895
|
+
function defineBound(proto, key2, fn) {
|
|
6896
|
+
Object.defineProperty(proto, key2, {
|
|
6897
6897
|
configurable: true,
|
|
6898
6898
|
get() {
|
|
6899
|
-
return this == null ? fn : own(this,
|
|
6899
|
+
return this == null ? fn : own(this, key2, fn.bind(this));
|
|
6900
6900
|
},
|
|
6901
6901
|
set(value) {
|
|
6902
|
-
own(this,
|
|
6902
|
+
own(this, key2, value);
|
|
6903
6903
|
}
|
|
6904
6904
|
});
|
|
6905
6905
|
}
|
|
@@ -6916,53 +6916,53 @@ var breaker = {
|
|
|
6916
6916
|
return void 0;
|
|
6917
6917
|
}
|
|
6918
6918
|
};
|
|
6919
|
-
function defineLazyInternal(inst,
|
|
6919
|
+
function defineLazyInternal(inst, key2, compute) {
|
|
6920
6920
|
const proto = Object.getPrototypeOf(inst._zod);
|
|
6921
|
-
if (
|
|
6921
|
+
if (key2 in proto && installing !== inst._zod) {
|
|
6922
6922
|
installing = void 0;
|
|
6923
6923
|
return;
|
|
6924
6924
|
}
|
|
6925
6925
|
installing = inst._zod;
|
|
6926
|
-
Object.defineProperty(proto,
|
|
6926
|
+
Object.defineProperty(proto, key2, {
|
|
6927
6927
|
configurable: true,
|
|
6928
6928
|
get() {
|
|
6929
|
-
Object.defineProperty(this,
|
|
6929
|
+
Object.defineProperty(this, key2, breaker);
|
|
6930
6930
|
const outer = broke;
|
|
6931
6931
|
broke = false;
|
|
6932
6932
|
try {
|
|
6933
6933
|
const value = compute(this);
|
|
6934
6934
|
if (broke)
|
|
6935
|
-
delete this[
|
|
6935
|
+
delete this[key2];
|
|
6936
6936
|
else
|
|
6937
|
-
Object.defineProperty(this,
|
|
6937
|
+
Object.defineProperty(this, key2, { configurable: true, writable: true, value });
|
|
6938
6938
|
broke = broke || outer;
|
|
6939
6939
|
return value;
|
|
6940
6940
|
} catch (err) {
|
|
6941
|
-
delete this[
|
|
6941
|
+
delete this[key2];
|
|
6942
6942
|
broke = broke || outer;
|
|
6943
6943
|
throw err;
|
|
6944
6944
|
}
|
|
6945
6945
|
},
|
|
6946
6946
|
set(value) {
|
|
6947
|
-
Object.defineProperty(this,
|
|
6947
|
+
Object.defineProperty(this, key2, { configurable: true, writable: true, value });
|
|
6948
6948
|
}
|
|
6949
6949
|
});
|
|
6950
6950
|
}
|
|
6951
|
-
function installLazyProp(inst,
|
|
6952
|
-
const proto = claim(inst,
|
|
6951
|
+
function installLazyProp(inst, key2, make, enumerable) {
|
|
6952
|
+
const proto = claim(inst, key2);
|
|
6953
6953
|
if (!proto)
|
|
6954
6954
|
return;
|
|
6955
|
-
Object.defineProperty(proto,
|
|
6955
|
+
Object.defineProperty(proto, key2, {
|
|
6956
6956
|
configurable: true,
|
|
6957
6957
|
get() {
|
|
6958
6958
|
const desc = { configurable: true, writable: true, enumerable, value: void 0 };
|
|
6959
|
-
Object.defineProperty(this,
|
|
6959
|
+
Object.defineProperty(this, key2, desc);
|
|
6960
6960
|
desc.value = make(this);
|
|
6961
|
-
Object.defineProperty(this,
|
|
6961
|
+
Object.defineProperty(this, key2, desc);
|
|
6962
6962
|
return desc.value;
|
|
6963
6963
|
},
|
|
6964
6964
|
set(value) {
|
|
6965
|
-
Object.defineProperty(this,
|
|
6965
|
+
Object.defineProperty(this, key2, { configurable: true, writable: true, enumerable, value });
|
|
6966
6966
|
}
|
|
6967
6967
|
});
|
|
6968
6968
|
}
|
|
@@ -7139,15 +7139,15 @@ var $ZodError = $constructor("$ZodError", initializer);
|
|
|
7139
7139
|
var $ZodRealError = $constructor("$ZodError", initializer, void 0, {
|
|
7140
7140
|
Parent: Error
|
|
7141
7141
|
});
|
|
7142
|
-
function node(obj,
|
|
7143
|
-
if (!Object.prototype.hasOwnProperty.call(obj,
|
|
7144
|
-
if (
|
|
7145
|
-
Object.defineProperty(obj,
|
|
7142
|
+
function node(obj, key2, make) {
|
|
7143
|
+
if (!Object.prototype.hasOwnProperty.call(obj, key2)) {
|
|
7144
|
+
if (key2 === "__proto__") {
|
|
7145
|
+
Object.defineProperty(obj, key2, { value: make(), writable: true, enumerable: true, configurable: true });
|
|
7146
7146
|
} else {
|
|
7147
|
-
obj[
|
|
7147
|
+
obj[key2] = make();
|
|
7148
7148
|
}
|
|
7149
7149
|
}
|
|
7150
|
-
return obj[
|
|
7150
|
+
return obj[key2];
|
|
7151
7151
|
}
|
|
7152
7152
|
function flattenError(error62, mapper = (issue2) => issue2.message) {
|
|
7153
7153
|
const fieldErrors = {};
|
|
@@ -7163,16 +7163,16 @@ function flattenError(error62, mapper = (issue2) => issue2.message) {
|
|
|
7163
7163
|
}
|
|
7164
7164
|
function formatError(error62, mapper = (issue2) => issue2.message) {
|
|
7165
7165
|
const fieldErrors = { _errors: [] };
|
|
7166
|
-
const processError = (error63,
|
|
7166
|
+
const processError = (error63, path69 = []) => {
|
|
7167
7167
|
for (const issue2 of error63.issues) {
|
|
7168
7168
|
if (issue2.code === "invalid_union" && issue2.errors.length) {
|
|
7169
|
-
issue2.errors.map((issues) => processError({ issues }, [...
|
|
7169
|
+
issue2.errors.map((issues) => processError({ issues }, [...path69, ...issue2.path]));
|
|
7170
7170
|
} else if (issue2.code === "invalid_key") {
|
|
7171
|
-
processError({ issues: issue2.issues }, [...
|
|
7171
|
+
processError({ issues: issue2.issues }, [...path69, ...issue2.path]);
|
|
7172
7172
|
} else if (issue2.code === "invalid_element") {
|
|
7173
|
-
processError({ issues: issue2.issues }, [...
|
|
7173
|
+
processError({ issues: issue2.issues }, [...path69, ...issue2.path]);
|
|
7174
7174
|
} else {
|
|
7175
|
-
const fullpath = [...
|
|
7175
|
+
const fullpath = [...path69, ...issue2.path];
|
|
7176
7176
|
if (fullpath.length === 0) {
|
|
7177
7177
|
fieldErrors._errors.push(mapper(issue2));
|
|
7178
7178
|
} else {
|
|
@@ -7211,17 +7211,17 @@ function formatError(error62, mapper = (issue2) => issue2.message) {
|
|
|
7211
7211
|
}
|
|
7212
7212
|
function treeifyError(error62, mapper = (issue2) => issue2.message) {
|
|
7213
7213
|
const result = { errors: [] };
|
|
7214
|
-
const processError = (error63,
|
|
7214
|
+
const processError = (error63, path69 = []) => {
|
|
7215
7215
|
var _a3;
|
|
7216
7216
|
for (const issue2 of error63.issues) {
|
|
7217
7217
|
if (issue2.code === "invalid_union" && issue2.errors.length) {
|
|
7218
|
-
issue2.errors.map((issues) => processError({ issues }, [...
|
|
7218
|
+
issue2.errors.map((issues) => processError({ issues }, [...path69, ...issue2.path]));
|
|
7219
7219
|
} else if (issue2.code === "invalid_key") {
|
|
7220
|
-
processError({ issues: issue2.issues }, [...
|
|
7220
|
+
processError({ issues: issue2.issues }, [...path69, ...issue2.path]);
|
|
7221
7221
|
} else if (issue2.code === "invalid_element") {
|
|
7222
|
-
processError({ issues: issue2.issues }, [...
|
|
7222
|
+
processError({ issues: issue2.issues }, [...path69, ...issue2.path]);
|
|
7223
7223
|
} else {
|
|
7224
|
-
const fullpath = [...
|
|
7224
|
+
const fullpath = [...path69, ...issue2.path];
|
|
7225
7225
|
if (fullpath.length === 0) {
|
|
7226
7226
|
result.errors.push(mapper(issue2));
|
|
7227
7227
|
continue;
|
|
@@ -7260,8 +7260,8 @@ function treeifyError(error62, mapper = (issue2) => issue2.message) {
|
|
|
7260
7260
|
}
|
|
7261
7261
|
function toDotPath(_path) {
|
|
7262
7262
|
const segs = [];
|
|
7263
|
-
const
|
|
7264
|
-
for (const seg of
|
|
7263
|
+
const path69 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
|
|
7264
|
+
for (const seg of path69) {
|
|
7265
7265
|
if (typeof seg === "number")
|
|
7266
7266
|
segs.push(`[${seg}]`);
|
|
7267
7267
|
else if (typeof seg === "symbol")
|
|
@@ -8056,16 +8056,16 @@ var $ZodCheckProperties = /* @__PURE__ */ $constructor("$ZodCheckProperties", (i
|
|
|
8056
8056
|
payload.issues.push({ expected: "object", code: "invalid_type", input: payload.value, inst });
|
|
8057
8057
|
return void 0;
|
|
8058
8058
|
}
|
|
8059
|
-
entries2 ?? (entries2 = Reflect.ownKeys(def.shape).map((
|
|
8059
|
+
entries2 ?? (entries2 = Reflect.ownKeys(def.shape).map((key2) => [key2, def.shape[key2]]));
|
|
8060
8060
|
const input2 = payload.value;
|
|
8061
8061
|
let proms;
|
|
8062
|
-
for (const [
|
|
8063
|
-
const result = schema._zod.run({ value: input2[
|
|
8062
|
+
for (const [key2, schema] of entries2) {
|
|
8063
|
+
const result = schema._zod.run({ value: input2[key2], issues: [] }, {});
|
|
8064
8064
|
if (result instanceof Promise) {
|
|
8065
8065
|
proms ?? (proms = []);
|
|
8066
|
-
proms.push(result.then((result2) => handleCheckPropertyResult(result2, payload,
|
|
8066
|
+
proms.push(result.then((result2) => handleCheckPropertyResult(result2, payload, key2)));
|
|
8067
8067
|
} else {
|
|
8068
|
-
handleCheckPropertyResult(result, payload,
|
|
8068
|
+
handleCheckPropertyResult(result, payload, key2);
|
|
8069
8069
|
}
|
|
8070
8070
|
}
|
|
8071
8071
|
if (proms)
|
|
@@ -8940,8 +8940,8 @@ var $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
|
|
|
8940
8940
|
return payload;
|
|
8941
8941
|
};
|
|
8942
8942
|
});
|
|
8943
|
-
function handlePropertyResult(result, final,
|
|
8944
|
-
const isPresent =
|
|
8943
|
+
function handlePropertyResult(result, final, key2, input2, optin, optout) {
|
|
8944
|
+
const isPresent = key2 in input2;
|
|
8945
8945
|
const isOptionalOut = optout === "optional";
|
|
8946
8946
|
if (!isPresent && isOptionalOut && optin === "optional") {
|
|
8947
8947
|
return;
|
|
@@ -8950,7 +8950,7 @@ function handlePropertyResult(result, final, key, input2, optin, optout) {
|
|
|
8950
8950
|
if (optin !== void 0 && isOptionalOut && !isPresent) {
|
|
8951
8951
|
return;
|
|
8952
8952
|
}
|
|
8953
|
-
final.issues.push(...prefixIssues(
|
|
8953
|
+
final.issues.push(...prefixIssues(key2, result.issues));
|
|
8954
8954
|
}
|
|
8955
8955
|
if (!isPresent && optin === void 0) {
|
|
8956
8956
|
if (!result.issues.length) {
|
|
@@ -8958,17 +8958,17 @@ function handlePropertyResult(result, final, key, input2, optin, optout) {
|
|
|
8958
8958
|
code: "invalid_type",
|
|
8959
8959
|
expected: "nonoptional",
|
|
8960
8960
|
input: void 0,
|
|
8961
|
-
path: [
|
|
8961
|
+
path: [key2]
|
|
8962
8962
|
});
|
|
8963
8963
|
}
|
|
8964
8964
|
return;
|
|
8965
8965
|
}
|
|
8966
8966
|
if (result.value === void 0) {
|
|
8967
8967
|
if (isPresent || optin === "defaulted" && !isOptionalOut) {
|
|
8968
|
-
final.value[
|
|
8968
|
+
final.value[key2] = void 0;
|
|
8969
8969
|
}
|
|
8970
8970
|
} else {
|
|
8971
|
-
final.value[
|
|
8971
|
+
final.value[key2] = result.value;
|
|
8972
8972
|
}
|
|
8973
8973
|
}
|
|
8974
8974
|
var NO_SYMBOL_KEYS = [];
|
|
@@ -9001,28 +9001,28 @@ function handleCatchall(proms, input2, payload, ctx, def, inst, abortEarly) {
|
|
|
9001
9001
|
const optin = _catchall.optin;
|
|
9002
9002
|
const optout = _catchall.optout;
|
|
9003
9003
|
let seen = 0;
|
|
9004
|
-
for (const
|
|
9004
|
+
for (const key2 in input2) {
|
|
9005
9005
|
if (abortEarly && payload.issues.length !== seen) {
|
|
9006
9006
|
if (aborted(payload, seen))
|
|
9007
9007
|
break;
|
|
9008
9008
|
seen = payload.issues.length;
|
|
9009
9009
|
}
|
|
9010
|
-
if (keySet.has(
|
|
9010
|
+
if (keySet.has(key2))
|
|
9011
9011
|
continue;
|
|
9012
|
-
if (
|
|
9012
|
+
if (key2 === "__proto__") {
|
|
9013
9013
|
if (t === "never")
|
|
9014
|
-
unrecognized.push(
|
|
9014
|
+
unrecognized.push(key2);
|
|
9015
9015
|
continue;
|
|
9016
9016
|
}
|
|
9017
9017
|
if (t === "never") {
|
|
9018
|
-
unrecognized.push(
|
|
9018
|
+
unrecognized.push(key2);
|
|
9019
9019
|
continue;
|
|
9020
9020
|
}
|
|
9021
|
-
const r = _catchall.run({ value: input2[
|
|
9021
|
+
const r = _catchall.run({ value: input2[key2], issues: [] }, ctx);
|
|
9022
9022
|
if (r instanceof Promise) {
|
|
9023
|
-
proms.push(r.then((r2) => handlePropertyResult(r2, payload,
|
|
9023
|
+
proms.push(r.then((r2) => handlePropertyResult(r2, payload, key2, input2, optin, optout)));
|
|
9024
9024
|
} else {
|
|
9025
|
-
handlePropertyResult(r, payload,
|
|
9025
|
+
handlePropertyResult(r, payload, key2, input2, optin, optout);
|
|
9026
9026
|
}
|
|
9027
9027
|
}
|
|
9028
9028
|
if (unrecognized.length) {
|
|
@@ -9059,16 +9059,16 @@ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
|
|
|
9059
9059
|
defineLazyInternal(inst, "propValues", (zod) => {
|
|
9060
9060
|
const shape = zod.def.shape;
|
|
9061
9061
|
const propValues = {};
|
|
9062
|
-
for (const
|
|
9063
|
-
const field2 = shape[
|
|
9062
|
+
for (const key2 in shape) {
|
|
9063
|
+
const field2 = shape[key2]._zod;
|
|
9064
9064
|
if (field2.values) {
|
|
9065
|
-
if (!Object.prototype.hasOwnProperty.call(propValues,
|
|
9066
|
-
assignProp(propValues,
|
|
9065
|
+
if (!Object.prototype.hasOwnProperty.call(propValues, key2)) {
|
|
9066
|
+
assignProp(propValues, key2, /* @__PURE__ */ new Set());
|
|
9067
9067
|
}
|
|
9068
9068
|
for (const v of field2.values)
|
|
9069
|
-
propValues[
|
|
9069
|
+
propValues[key2].add(v);
|
|
9070
9070
|
if (field2.optin !== void 0)
|
|
9071
|
-
propValues[
|
|
9071
|
+
propValues[key2].add(void 0);
|
|
9072
9072
|
}
|
|
9073
9073
|
}
|
|
9074
9074
|
return propValues;
|
|
@@ -9095,22 +9095,22 @@ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
|
|
|
9095
9095
|
const shape = value.shape;
|
|
9096
9096
|
const abortEarly = ctx?.abortEarly;
|
|
9097
9097
|
let seen = payload.issues.length;
|
|
9098
|
-
for (const
|
|
9098
|
+
for (const key2 of value.allKeys) {
|
|
9099
9099
|
if (abortEarly && payload.issues.length !== seen) {
|
|
9100
9100
|
if (aborted(payload, seen))
|
|
9101
9101
|
break;
|
|
9102
9102
|
seen = payload.issues.length;
|
|
9103
9103
|
}
|
|
9104
|
-
if (
|
|
9104
|
+
if (key2 === "__proto__")
|
|
9105
9105
|
continue;
|
|
9106
|
-
const el = shape[
|
|
9106
|
+
const el = shape[key2];
|
|
9107
9107
|
const optin = el._zod.optin;
|
|
9108
9108
|
const optout = el._zod.optout;
|
|
9109
|
-
const r = el._zod.run({ value: input2[
|
|
9109
|
+
const r = el._zod.run({ value: input2[key2], issues: [] }, ctx);
|
|
9110
9110
|
if (r instanceof Promise) {
|
|
9111
|
-
proms.push(r.then((r2) => handlePropertyResult(r2, payload,
|
|
9111
|
+
proms.push(r.then((r2) => handlePropertyResult(r2, payload, key2, input2, optin, optout)));
|
|
9112
9112
|
} else {
|
|
9113
|
-
handlePropertyResult(r, payload,
|
|
9113
|
+
handlePropertyResult(r, payload, key2, input2, optin, optout);
|
|
9114
9114
|
}
|
|
9115
9115
|
}
|
|
9116
9116
|
if (!catchall) {
|
|
@@ -9144,17 +9144,17 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
|
|
|
9144
9144
|
doc.write(`const input = payload.value;`);
|
|
9145
9145
|
const ids = /* @__PURE__ */ Object.create(null);
|
|
9146
9146
|
let counter = 0;
|
|
9147
|
-
for (const
|
|
9148
|
-
ids[
|
|
9147
|
+
for (const key2 of normalized.allKeys) {
|
|
9148
|
+
ids[key2] = `key_${counter++}`;
|
|
9149
9149
|
}
|
|
9150
9150
|
doc.write(memo2 ? `const newResult = memo.alloc(inst, payload, {}, ctx);` : `const newResult = {};`);
|
|
9151
|
-
for (const
|
|
9152
|
-
if (
|
|
9151
|
+
for (const key2 of normalized.allKeys) {
|
|
9152
|
+
if (key2 === "__proto__")
|
|
9153
9153
|
continue;
|
|
9154
|
-
const id = ids[
|
|
9155
|
-
const k = typeof
|
|
9154
|
+
const id = ids[key2];
|
|
9155
|
+
const k = typeof key2 === "symbol" ? `syms[${syms.indexOf(key2)}]` : esc(key2);
|
|
9156
9156
|
const isPresent = `${k} in input`;
|
|
9157
|
-
const schema = shape[
|
|
9157
|
+
const schema = shape[key2];
|
|
9158
9158
|
const optin = schema?._zod?.optin;
|
|
9159
9159
|
const isOptionalIn = optin !== void 0;
|
|
9160
9160
|
const isOptionalOut = schema?._zod?.optout === "optional";
|
|
@@ -9488,21 +9488,21 @@ function mergeValues(a, b) {
|
|
|
9488
9488
|
}
|
|
9489
9489
|
if (isPlainObject(a) && isPlainObject(b)) {
|
|
9490
9490
|
const bKeys = Object.keys(b);
|
|
9491
|
-
const sharedKeys = Object.keys(a).filter((
|
|
9491
|
+
const sharedKeys = Object.keys(a).filter((key2) => bKeys.indexOf(key2) !== -1);
|
|
9492
9492
|
const newObj = { ...a, ...b };
|
|
9493
9493
|
if (Object.prototype.hasOwnProperty.call(newObj, "__proto__"))
|
|
9494
9494
|
delete newObj.__proto__;
|
|
9495
|
-
for (const
|
|
9496
|
-
if (
|
|
9495
|
+
for (const key2 of sharedKeys) {
|
|
9496
|
+
if (key2 === "__proto__")
|
|
9497
9497
|
continue;
|
|
9498
|
-
const sharedValue = mergeValues(a[
|
|
9498
|
+
const sharedValue = mergeValues(a[key2], b[key2]);
|
|
9499
9499
|
if (!sharedValue.valid) {
|
|
9500
9500
|
return {
|
|
9501
9501
|
valid: false,
|
|
9502
|
-
mergeErrorPath: [
|
|
9502
|
+
mergeErrorPath: [key2, ...sharedValue.mergeErrorPath]
|
|
9503
9503
|
};
|
|
9504
9504
|
}
|
|
9505
|
-
newObj[
|
|
9505
|
+
newObj[key2] = sharedValue.data;
|
|
9506
9506
|
}
|
|
9507
9507
|
return { valid: true, data: newObj };
|
|
9508
9508
|
}
|
|
@@ -9661,9 +9661,9 @@ var $ZodTuple = /* @__PURE__ */ $constructor("$ZodTuple", (inst, def) => {
|
|
|
9661
9661
|
return handleTupleResults(itemResults, payload, items, input2, optoutStart);
|
|
9662
9662
|
};
|
|
9663
9663
|
});
|
|
9664
|
-
function getTupleOptStart(items,
|
|
9664
|
+
function getTupleOptStart(items, key2) {
|
|
9665
9665
|
for (let i = items.length - 1; i >= 0; i--) {
|
|
9666
|
-
const omittable =
|
|
9666
|
+
const omittable = key2 === "optin" ? items[i]._zod.optin !== void 0 : items[i]._zod.optout === "optional";
|
|
9667
9667
|
if (!omittable)
|
|
9668
9668
|
return i + 1;
|
|
9669
9669
|
}
|
|
@@ -9721,12 +9721,12 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
|
9721
9721
|
if (values && !def.partial) {
|
|
9722
9722
|
payload.value = memo2 ? memo2.alloc(inst, payload, {}, ctx) : {};
|
|
9723
9723
|
const recordKeys = /* @__PURE__ */ new Set();
|
|
9724
|
-
for (const
|
|
9725
|
-
if (typeof
|
|
9726
|
-
recordKeys.add(typeof
|
|
9727
|
-
if (
|
|
9724
|
+
for (const key2 of values) {
|
|
9725
|
+
if (typeof key2 === "string" || typeof key2 === "number" || typeof key2 === "symbol") {
|
|
9726
|
+
recordKeys.add(typeof key2 === "number" ? key2.toString() : key2);
|
|
9727
|
+
if (key2 === "__proto__")
|
|
9728
9728
|
continue;
|
|
9729
|
-
const keyResult = def.keyType._zod.run({ value:
|
|
9729
|
+
const keyResult = def.keyType._zod.run({ value: key2, issues: [] }, ctx);
|
|
9730
9730
|
if (keyResult instanceof Promise) {
|
|
9731
9731
|
throw new Error("Async schemas not supported in object keys currently");
|
|
9732
9732
|
}
|
|
@@ -9735,8 +9735,8 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
|
9735
9735
|
code: "invalid_key",
|
|
9736
9736
|
origin: "record",
|
|
9737
9737
|
issues: keyResult.issues.map((iss) => finalizeIssue(iss, ctx, config())),
|
|
9738
|
-
input:
|
|
9739
|
-
path: [
|
|
9738
|
+
input: key2,
|
|
9739
|
+
path: [key2],
|
|
9740
9740
|
inst
|
|
9741
9741
|
});
|
|
9742
9742
|
continue;
|
|
@@ -9744,32 +9744,32 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
|
9744
9744
|
const outKey = keyResult.value;
|
|
9745
9745
|
if (outKey === "__proto__")
|
|
9746
9746
|
continue;
|
|
9747
|
-
const result = def.valueType._zod.run({ value: input2[
|
|
9747
|
+
const result = def.valueType._zod.run({ value: input2[key2], issues: [] }, ctx);
|
|
9748
9748
|
if (result instanceof Promise) {
|
|
9749
9749
|
proms.push(result.then((result2) => {
|
|
9750
9750
|
if (result2.issues.length) {
|
|
9751
|
-
payload.issues.push(...prefixIssues(
|
|
9751
|
+
payload.issues.push(...prefixIssues(key2, result2.issues));
|
|
9752
9752
|
}
|
|
9753
9753
|
payload.value[outKey] = result2.value;
|
|
9754
9754
|
}));
|
|
9755
9755
|
} else {
|
|
9756
9756
|
if (result.issues.length) {
|
|
9757
|
-
payload.issues.push(...prefixIssues(
|
|
9757
|
+
payload.issues.push(...prefixIssues(key2, result.issues));
|
|
9758
9758
|
}
|
|
9759
9759
|
payload.value[outKey] = result.value;
|
|
9760
9760
|
}
|
|
9761
9761
|
}
|
|
9762
9762
|
}
|
|
9763
9763
|
let unrecognized;
|
|
9764
|
-
for (const
|
|
9765
|
-
if (!recordKeys.has(
|
|
9764
|
+
for (const key2 in input2) {
|
|
9765
|
+
if (!recordKeys.has(key2)) {
|
|
9766
9766
|
if (def.mode === "loose") {
|
|
9767
|
-
if (
|
|
9767
|
+
if (key2 === "__proto__")
|
|
9768
9768
|
continue;
|
|
9769
|
-
payload.value[
|
|
9769
|
+
payload.value[key2] = input2[key2];
|
|
9770
9770
|
} else {
|
|
9771
9771
|
unrecognized = unrecognized ?? [];
|
|
9772
|
-
unrecognized.push(
|
|
9772
|
+
unrecognized.push(key2);
|
|
9773
9773
|
}
|
|
9774
9774
|
}
|
|
9775
9775
|
}
|
|
@@ -9785,18 +9785,18 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
|
9785
9785
|
} else {
|
|
9786
9786
|
payload.value = memo2 ? memo2.alloc(inst, payload, {}, ctx) : {};
|
|
9787
9787
|
let unrecognized;
|
|
9788
|
-
for (const
|
|
9789
|
-
if (
|
|
9788
|
+
for (const key2 of Reflect.ownKeys(input2)) {
|
|
9789
|
+
if (key2 === "__proto__")
|
|
9790
9790
|
continue;
|
|
9791
|
-
if (!Object.prototype.propertyIsEnumerable.call(input2,
|
|
9791
|
+
if (!Object.prototype.propertyIsEnumerable.call(input2, key2))
|
|
9792
9792
|
continue;
|
|
9793
|
-
let keyResult = def.keyType._zod.run({ value:
|
|
9793
|
+
let keyResult = def.keyType._zod.run({ value: key2, issues: [] }, ctx);
|
|
9794
9794
|
if (keyResult instanceof Promise) {
|
|
9795
9795
|
throw new Error("Async schemas not supported in object keys currently");
|
|
9796
9796
|
}
|
|
9797
|
-
const checkNumericKey = typeof
|
|
9797
|
+
const checkNumericKey = typeof key2 === "string" && number.test(key2) && keyResult.issues.length;
|
|
9798
9798
|
if (checkNumericKey) {
|
|
9799
|
-
const retryResult = def.keyType._zod.run({ value: Number(
|
|
9799
|
+
const retryResult = def.keyType._zod.run({ value: Number(key2), issues: [] }, ctx);
|
|
9800
9800
|
if (retryResult instanceof Promise) {
|
|
9801
9801
|
throw new Error("Async schemas not supported in object keys currently");
|
|
9802
9802
|
}
|
|
@@ -9806,17 +9806,17 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
|
9806
9806
|
}
|
|
9807
9807
|
if (keyResult.issues.length) {
|
|
9808
9808
|
if (def.mode === "loose") {
|
|
9809
|
-
payload.value[
|
|
9809
|
+
payload.value[key2] = input2[key2];
|
|
9810
9810
|
} else if (values) {
|
|
9811
9811
|
unrecognized = unrecognized ?? [];
|
|
9812
|
-
unrecognized.push(
|
|
9812
|
+
unrecognized.push(key2);
|
|
9813
9813
|
} else {
|
|
9814
9814
|
payload.issues.push({
|
|
9815
9815
|
code: "invalid_key",
|
|
9816
9816
|
origin: "record",
|
|
9817
9817
|
issues: keyResult.issues.map((iss) => finalizeIssue(iss, ctx, config())),
|
|
9818
|
-
input:
|
|
9819
|
-
path: [
|
|
9818
|
+
input: key2,
|
|
9819
|
+
path: [key2],
|
|
9820
9820
|
inst
|
|
9821
9821
|
});
|
|
9822
9822
|
}
|
|
@@ -9825,17 +9825,17 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
|
9825
9825
|
const outKey = keyResult.value;
|
|
9826
9826
|
if (outKey === "__proto__")
|
|
9827
9827
|
continue;
|
|
9828
|
-
const result = def.valueType._zod.run({ value: input2[
|
|
9828
|
+
const result = def.valueType._zod.run({ value: input2[key2], issues: [] }, ctx);
|
|
9829
9829
|
if (result instanceof Promise) {
|
|
9830
9830
|
proms.push(result.then((result2) => {
|
|
9831
9831
|
if (result2.issues.length) {
|
|
9832
|
-
payload.issues.push(...prefixIssues(
|
|
9832
|
+
payload.issues.push(...prefixIssues(key2, result2.issues));
|
|
9833
9833
|
}
|
|
9834
9834
|
payload.value[outKey] = result2.value;
|
|
9835
9835
|
}));
|
|
9836
9836
|
} else {
|
|
9837
9837
|
if (result.issues.length) {
|
|
9838
|
-
payload.issues.push(...prefixIssues(
|
|
9838
|
+
payload.issues.push(...prefixIssues(key2, result.issues));
|
|
9839
9839
|
}
|
|
9840
9840
|
payload.value[outKey] = result.value;
|
|
9841
9841
|
}
|
|
@@ -9875,20 +9875,20 @@ var $ZodMap = /* @__PURE__ */ $constructor("$ZodMap", (inst, def) => {
|
|
|
9875
9875
|
payload.value = memo2 ? memo2.alloc(inst, payload, /* @__PURE__ */ new Map(), ctx) : /* @__PURE__ */ new Map();
|
|
9876
9876
|
const abortEarly = ctx?.abortEarly;
|
|
9877
9877
|
let seen = payload.issues.length;
|
|
9878
|
-
for (const [
|
|
9878
|
+
for (const [key2, value] of input2) {
|
|
9879
9879
|
if (abortEarly && payload.issues.length !== seen) {
|
|
9880
9880
|
if (aborted(payload, seen))
|
|
9881
9881
|
break;
|
|
9882
9882
|
seen = payload.issues.length;
|
|
9883
9883
|
}
|
|
9884
|
-
const keyResult = def.keyType._zod.run({ value:
|
|
9884
|
+
const keyResult = def.keyType._zod.run({ value: key2, issues: [] }, ctx);
|
|
9885
9885
|
const valueResult = def.valueType._zod.run({ value, issues: [] }, ctx);
|
|
9886
9886
|
if (keyResult instanceof Promise || valueResult instanceof Promise) {
|
|
9887
9887
|
proms.push(Promise.all([keyResult, valueResult]).then(([keyResult2, valueResult2]) => {
|
|
9888
|
-
handleMapResult(keyResult2, valueResult2, payload,
|
|
9888
|
+
handleMapResult(keyResult2, valueResult2, payload, key2, input2, inst, ctx);
|
|
9889
9889
|
}));
|
|
9890
9890
|
} else {
|
|
9891
|
-
handleMapResult(keyResult, valueResult, payload,
|
|
9891
|
+
handleMapResult(keyResult, valueResult, payload, key2, input2, inst, ctx);
|
|
9892
9892
|
}
|
|
9893
9893
|
}
|
|
9894
9894
|
if (proms.length)
|
|
@@ -9896,10 +9896,10 @@ var $ZodMap = /* @__PURE__ */ $constructor("$ZodMap", (inst, def) => {
|
|
|
9896
9896
|
return payload;
|
|
9897
9897
|
};
|
|
9898
9898
|
});
|
|
9899
|
-
function handleMapResult(keyResult, valueResult, final,
|
|
9899
|
+
function handleMapResult(keyResult, valueResult, final, key2, input2, inst, ctx) {
|
|
9900
9900
|
if (keyResult.issues.length) {
|
|
9901
|
-
if (propertyKeyTypes.has(typeof
|
|
9902
|
-
final.issues.push(...prefixIssues(
|
|
9901
|
+
if (propertyKeyTypes.has(typeof key2)) {
|
|
9902
|
+
final.issues.push(...prefixIssues(key2, keyResult.issues));
|
|
9903
9903
|
} else {
|
|
9904
9904
|
final.issues.push({
|
|
9905
9905
|
code: "invalid_key",
|
|
@@ -9911,15 +9911,15 @@ function handleMapResult(keyResult, valueResult, final, key, input2, inst, ctx)
|
|
|
9911
9911
|
}
|
|
9912
9912
|
}
|
|
9913
9913
|
if (valueResult.issues.length) {
|
|
9914
|
-
if (propertyKeyTypes.has(typeof
|
|
9915
|
-
final.issues.push(...prefixIssues(
|
|
9914
|
+
if (propertyKeyTypes.has(typeof key2)) {
|
|
9915
|
+
final.issues.push(...prefixIssues(key2, valueResult.issues));
|
|
9916
9916
|
} else {
|
|
9917
9917
|
final.issues.push({
|
|
9918
9918
|
origin: "map",
|
|
9919
9919
|
code: "invalid_element",
|
|
9920
9920
|
input: input2,
|
|
9921
9921
|
inst,
|
|
9922
|
-
key,
|
|
9922
|
+
key: key2,
|
|
9923
9923
|
issues: valueResult.issues.map((iss) => finalizeIssue(iss, ctx, config()))
|
|
9924
9924
|
});
|
|
9925
9925
|
}
|
|
@@ -10593,8 +10593,8 @@ function isRecursive(inst, stack, resolve2) {
|
|
|
10593
10593
|
};
|
|
10594
10594
|
const shape = (sh, spread) => {
|
|
10595
10595
|
let answer = NONE;
|
|
10596
|
-
for (const
|
|
10597
|
-
const desc = Object.getOwnPropertyDescriptor(sh,
|
|
10596
|
+
for (const key2 of Reflect.ownKeys(sh)) {
|
|
10597
|
+
const desc = Object.getOwnPropertyDescriptor(sh, key2);
|
|
10598
10598
|
if (spread && !desc.enumerable)
|
|
10599
10599
|
continue;
|
|
10600
10600
|
const child = desc.get ? ASSUMED : desc.value?._zod ? isRecursive(desc.value, stack, resolve2) : NONE;
|
|
@@ -10690,8 +10690,8 @@ function isRecursive(inst, stack, resolve2) {
|
|
|
10690
10690
|
break;
|
|
10691
10691
|
default: {
|
|
10692
10692
|
kind;
|
|
10693
|
-
for (const
|
|
10694
|
-
const desc = Object.getOwnPropertyDescriptor(def,
|
|
10693
|
+
for (const key2 in def) {
|
|
10694
|
+
const desc = Object.getOwnPropertyDescriptor(def, key2);
|
|
10695
10695
|
if (!desc || desc.get)
|
|
10696
10696
|
continue;
|
|
10697
10697
|
const value = desc.value;
|
|
@@ -18824,11 +18824,11 @@ function generatePropertiesChecks(doc, ctx, def, accessor) {
|
|
|
18824
18824
|
}
|
|
18825
18825
|
doc.write(`if (${accessor} == null) return INVALID;`);
|
|
18826
18826
|
const shape = def.shape;
|
|
18827
|
-
for (const
|
|
18828
|
-
const keyExpr = typeof
|
|
18827
|
+
for (const key2 of Reflect.ownKeys(shape)) {
|
|
18828
|
+
const keyExpr = typeof key2 === "symbol" ? addConstant(ctx, key2) : esc(key2);
|
|
18829
18829
|
const inputVar = newVar(ctx);
|
|
18830
18830
|
doc.write(`const ${inputVar} = ${accessor}[${keyExpr}];`);
|
|
18831
|
-
compileChild(doc, ctx, shape[
|
|
18831
|
+
compileChild(doc, ctx, shape[key2], inputVar, false);
|
|
18832
18832
|
}
|
|
18833
18833
|
}
|
|
18834
18834
|
function generatePropertyCheck(doc, ctx, def, accessor) {
|
|
@@ -19221,9 +19221,9 @@ function generateObjectCheck(doc, ctx, schema, accessor, buildsValue = true) {
|
|
|
19221
19221
|
throw new ZodCompileUnsupportedError('object shape key "__proto__"');
|
|
19222
19222
|
}
|
|
19223
19223
|
const propOutputs = /* @__PURE__ */ new Map();
|
|
19224
|
-
for (const
|
|
19225
|
-
const propSchema = propShape[
|
|
19226
|
-
const kx = keyExpr(
|
|
19224
|
+
for (const key2 of allKeys) {
|
|
19225
|
+
const propSchema = propShape[key2];
|
|
19226
|
+
const kx = keyExpr(key2);
|
|
19227
19227
|
const inputVar = newVar(ctx);
|
|
19228
19228
|
doc.write(`const ${inputVar} = ${accessor}[${kx}];`);
|
|
19229
19229
|
if (propSchema._zod.optin !== void 0) {
|
|
@@ -19244,14 +19244,14 @@ function generateObjectCheck(doc, ctx, schema, accessor, buildsValue = true) {
|
|
|
19244
19244
|
} else {
|
|
19245
19245
|
doc.write(`if (${outputVar2} === INVALID) return INVALID;`);
|
|
19246
19246
|
}
|
|
19247
|
-
propOutputs.set(
|
|
19247
|
+
propOutputs.set(key2, outputVar2);
|
|
19248
19248
|
} else {
|
|
19249
19249
|
if (requiresPresenceCheck(propSchema)) {
|
|
19250
19250
|
doc.write(`if (!(${kx} in ${accessor})) return INVALID;`);
|
|
19251
19251
|
}
|
|
19252
19252
|
const outputAccessor = compileChild(doc, ctx, propSchema, inputVar, buildsValue);
|
|
19253
19253
|
if (outputAccessor !== null)
|
|
19254
|
-
propOutputs.set(
|
|
19254
|
+
propOutputs.set(key2, outputAccessor);
|
|
19255
19255
|
}
|
|
19256
19256
|
}
|
|
19257
19257
|
const catchall = def.catchall;
|
|
@@ -19666,9 +19666,9 @@ function generateTupleCheck(doc, ctx, schema, accessor) {
|
|
|
19666
19666
|
}
|
|
19667
19667
|
return outputVar;
|
|
19668
19668
|
}
|
|
19669
|
-
function getTupleOptStart2(items,
|
|
19669
|
+
function getTupleOptStart2(items, key2) {
|
|
19670
19670
|
for (let i = items.length - 1; i >= 0; i--) {
|
|
19671
|
-
const omittable =
|
|
19671
|
+
const omittable = key2 === "optin" ? items[i]._zod.optin !== void 0 : items[i]._zod.optout === "optional";
|
|
19672
19672
|
if (!omittable)
|
|
19673
19673
|
return i + 1;
|
|
19674
19674
|
}
|
|
@@ -19798,16 +19798,16 @@ function generateRecordCheck(doc, ctx, schema, accessor) {
|
|
|
19798
19798
|
const keyValues = recordDef.partial ? void 0 : def.keyType._zod.values;
|
|
19799
19799
|
if (keyValues) {
|
|
19800
19800
|
const inputKeys = [];
|
|
19801
|
-
for (const
|
|
19802
|
-
if (!(typeof
|
|
19803
|
-
throw new ZodCompileUnsupportedError(`record key value ${String(
|
|
19801
|
+
for (const key2 of keyValues) {
|
|
19802
|
+
if (!(typeof key2 === "string" || typeof key2 === "number" || typeof key2 === "symbol")) {
|
|
19803
|
+
throw new ZodCompileUnsupportedError(`record key value ${String(key2)}`);
|
|
19804
19804
|
}
|
|
19805
|
-
const inputKey = typeof
|
|
19805
|
+
const inputKey = typeof key2 === "number" ? key2.toString() : key2;
|
|
19806
19806
|
if (inputKey === "__proto__") {
|
|
19807
19807
|
throw new ZodCompileUnsupportedError('record key "__proto__"');
|
|
19808
19808
|
}
|
|
19809
19809
|
inputKeys.push(inputKey);
|
|
19810
|
-
const keyConst = addConstant(ctx,
|
|
19810
|
+
const keyConst = addConstant(ctx, key2);
|
|
19811
19811
|
const outKey = generateCheck(doc, ctx, def.keyType, keyConst);
|
|
19812
19812
|
const valueVar = newVar(ctx);
|
|
19813
19813
|
doc.write(`const ${valueVar} = ${accessor}[${literalPropertyKey(ctx, inputKey)}];`);
|
|
@@ -19885,10 +19885,10 @@ function emitOwnKeys(doc, ctx, accessor, kVar, body, onSymbol) {
|
|
|
19885
19885
|
});
|
|
19886
19886
|
doc.write(`}`);
|
|
19887
19887
|
}
|
|
19888
|
-
function literalPropertyKey(ctx,
|
|
19889
|
-
if (typeof
|
|
19890
|
-
return esc(
|
|
19891
|
-
return addConstant(ctx,
|
|
19888
|
+
function literalPropertyKey(ctx, key2) {
|
|
19889
|
+
if (typeof key2 === "string")
|
|
19890
|
+
return esc(key2);
|
|
19891
|
+
return addConstant(ctx, key2);
|
|
19892
19892
|
}
|
|
19893
19893
|
function generateMapCheck(doc, ctx, schema, accessor) {
|
|
19894
19894
|
const def = schema._zod.def;
|
|
@@ -21115,9 +21115,9 @@ function _stringFormat(Class2, format2, fnOrRegex, _params = {}) {
|
|
|
21115
21115
|
// node_modules/zod/v4/core/to-json-schema.js
|
|
21116
21116
|
function assignProps(target, ...sources) {
|
|
21117
21117
|
for (const source of sources) {
|
|
21118
|
-
for (const
|
|
21119
|
-
if (Object.prototype.propertyIsEnumerable.call(source,
|
|
21120
|
-
assignProp(target,
|
|
21118
|
+
for (const key2 of Reflect.ownKeys(source)) {
|
|
21119
|
+
if (Object.prototype.propertyIsEnumerable.call(source, key2)) {
|
|
21120
|
+
assignProp(target, key2, source[key2]);
|
|
21121
21121
|
}
|
|
21122
21122
|
}
|
|
21123
21123
|
}
|
|
@@ -21263,8 +21263,8 @@ function extractDefs(ctx, schema) {
|
|
|
21263
21263
|
if (defId)
|
|
21264
21264
|
seen.defId = defId;
|
|
21265
21265
|
const schema2 = seen.schema;
|
|
21266
|
-
for (const
|
|
21267
|
-
delete schema2[
|
|
21266
|
+
for (const key2 in schema2) {
|
|
21267
|
+
delete schema2[key2];
|
|
21268
21268
|
}
|
|
21269
21269
|
schema2.$ref = ref;
|
|
21270
21270
|
};
|
|
@@ -21345,8 +21345,8 @@ function foldObjects(members2) {
|
|
|
21345
21345
|
for (const member of members2) {
|
|
21346
21346
|
if (typeof member !== "object" || member.type !== "object")
|
|
21347
21347
|
return null;
|
|
21348
|
-
for (const
|
|
21349
|
-
if (!FOLDABLE_KEYS.has(
|
|
21348
|
+
for (const key2 in member) {
|
|
21349
|
+
if (!FOLDABLE_KEYS.has(key2))
|
|
21350
21350
|
return null;
|
|
21351
21351
|
}
|
|
21352
21352
|
objects.push(member);
|
|
@@ -21354,22 +21354,22 @@ function foldObjects(members2) {
|
|
|
21354
21354
|
const properties = {};
|
|
21355
21355
|
const required2 = /* @__PURE__ */ new Set();
|
|
21356
21356
|
for (const object2 of objects) {
|
|
21357
|
-
for (const
|
|
21358
|
-
if (Object.prototype.hasOwnProperty.call(properties,
|
|
21357
|
+
for (const key2 in object2.properties) {
|
|
21358
|
+
if (Object.prototype.hasOwnProperty.call(properties, key2))
|
|
21359
21359
|
continue;
|
|
21360
21360
|
const parts2 = [];
|
|
21361
21361
|
for (const other of objects) {
|
|
21362
|
-
const part = other.properties?.[
|
|
21362
|
+
const part = other.properties?.[key2] ?? undeclaredConstraint(other);
|
|
21363
21363
|
if (part === null || part === void 0)
|
|
21364
21364
|
continue;
|
|
21365
21365
|
if (!parts2.some((seen) => JSON.stringify(seen) === JSON.stringify(part)))
|
|
21366
21366
|
parts2.push(part);
|
|
21367
21367
|
}
|
|
21368
21368
|
const merged = parts2.length === 1 ? parts2[0] : foldObjects(parts2) ?? { allOf: parts2 };
|
|
21369
|
-
assignProp(properties,
|
|
21369
|
+
assignProp(properties, key2, merged);
|
|
21370
21370
|
}
|
|
21371
|
-
for (const
|
|
21372
|
-
required2.add(
|
|
21371
|
+
for (const key2 of object2.required ?? [])
|
|
21372
|
+
required2.add(key2);
|
|
21373
21373
|
}
|
|
21374
21374
|
const folded = { type: "object", properties };
|
|
21375
21375
|
if (required2.size)
|
|
@@ -21394,8 +21394,8 @@ function foldIntersection(json2) {
|
|
|
21394
21394
|
const allOf = json2.allOf;
|
|
21395
21395
|
if (!Array.isArray(allOf) || allOf.length < 2)
|
|
21396
21396
|
return;
|
|
21397
|
-
for (const
|
|
21398
|
-
if (
|
|
21397
|
+
for (const key2 of FOLDABLE_KEYS)
|
|
21398
|
+
if (key2 in json2)
|
|
21399
21399
|
return;
|
|
21400
21400
|
const unions = allOf.filter((m) => UNION_KEYS.some((k) => Array.isArray(m[k])));
|
|
21401
21401
|
let folded = null;
|
|
@@ -21442,20 +21442,20 @@ function finalize(ctx, schema) {
|
|
|
21442
21442
|
assignProps(schema2, _cached);
|
|
21443
21443
|
const isParentRef = zodSchema._zod.parent === ref;
|
|
21444
21444
|
if (isParentRef) {
|
|
21445
|
-
for (const
|
|
21446
|
-
if (
|
|
21445
|
+
for (const key2 in schema2) {
|
|
21446
|
+
if (key2 === "$ref" || key2 === "allOf")
|
|
21447
21447
|
continue;
|
|
21448
|
-
if (!(
|
|
21449
|
-
delete schema2[
|
|
21448
|
+
if (!(key2 in _cached)) {
|
|
21449
|
+
delete schema2[key2];
|
|
21450
21450
|
}
|
|
21451
21451
|
}
|
|
21452
21452
|
}
|
|
21453
21453
|
if (refSchema.$ref && refSeen.def) {
|
|
21454
|
-
for (const
|
|
21455
|
-
if (
|
|
21454
|
+
for (const key2 in schema2) {
|
|
21455
|
+
if (key2 === "$ref" || key2 === "allOf")
|
|
21456
21456
|
continue;
|
|
21457
|
-
if (
|
|
21458
|
-
delete schema2[
|
|
21457
|
+
if (key2 in refSeen.def && JSON.stringify(schema2[key2]) === JSON.stringify(refSeen.def[key2])) {
|
|
21458
|
+
delete schema2[key2];
|
|
21459
21459
|
}
|
|
21460
21460
|
}
|
|
21461
21461
|
}
|
|
@@ -21467,11 +21467,11 @@ function finalize(ctx, schema) {
|
|
|
21467
21467
|
if (parentSeen?.schema.$ref) {
|
|
21468
21468
|
schema2.$ref = parentSeen.schema.$ref;
|
|
21469
21469
|
if (parentSeen.def) {
|
|
21470
|
-
for (const
|
|
21471
|
-
if (
|
|
21470
|
+
for (const key2 in schema2) {
|
|
21471
|
+
if (key2 === "$ref" || key2 === "allOf")
|
|
21472
21472
|
continue;
|
|
21473
|
-
if (
|
|
21474
|
-
delete schema2[
|
|
21473
|
+
if (key2 in parentSeen.def && JSON.stringify(schema2[key2]) === JSON.stringify(parentSeen.def[key2])) {
|
|
21474
|
+
delete schema2[key2];
|
|
21475
21475
|
}
|
|
21476
21476
|
}
|
|
21477
21477
|
}
|
|
@@ -21604,8 +21604,8 @@ function isTransforming(_schema, _ctx) {
|
|
|
21604
21604
|
return isTransforming(def.in, ctx) || isTransforming(def.out, ctx);
|
|
21605
21605
|
}
|
|
21606
21606
|
if (def.type === "object") {
|
|
21607
|
-
for (const
|
|
21608
|
-
if (isTransforming(def.shape[
|
|
21607
|
+
for (const key2 in def.shape) {
|
|
21608
|
+
if (isTransforming(def.shape[key2], ctx))
|
|
21609
21609
|
return true;
|
|
21610
21610
|
}
|
|
21611
21611
|
return false;
|
|
@@ -21643,13 +21643,13 @@ var createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params) =
|
|
|
21643
21643
|
};
|
|
21644
21644
|
|
|
21645
21645
|
// node_modules/zod/v4/core/json-schema-processors.js
|
|
21646
|
-
var narrowMin = (agg,
|
|
21647
|
-
if (agg[
|
|
21648
|
-
agg[
|
|
21646
|
+
var narrowMin = (agg, key2, value) => {
|
|
21647
|
+
if (agg[key2] === void 0 || value > agg[key2])
|
|
21648
|
+
agg[key2] = value;
|
|
21649
21649
|
};
|
|
21650
|
-
var narrowMax = (agg,
|
|
21651
|
-
if (agg[
|
|
21652
|
-
agg[
|
|
21650
|
+
var narrowMax = (agg, key2, value) => {
|
|
21651
|
+
if (agg[key2] === void 0 || value < agg[key2])
|
|
21652
|
+
agg[key2] = value;
|
|
21653
21653
|
};
|
|
21654
21654
|
var narrowBoth = (agg, value) => {
|
|
21655
21655
|
narrowMin(agg, "minimum", value);
|
|
@@ -21987,17 +21987,17 @@ var objectProcessor = (schema, ctx, _json, params) => {
|
|
|
21987
21987
|
}
|
|
21988
21988
|
json2.type = "object";
|
|
21989
21989
|
json2.properties = {};
|
|
21990
|
-
for (const
|
|
21991
|
-
assignProp(json2.properties,
|
|
21990
|
+
for (const key2 in shape) {
|
|
21991
|
+
assignProp(json2.properties, key2, processSchema(shape[key2], ctx, {
|
|
21992
21992
|
...params,
|
|
21993
|
-
path: [...params.path, "properties",
|
|
21993
|
+
path: [...params.path, "properties", key2]
|
|
21994
21994
|
}));
|
|
21995
21995
|
}
|
|
21996
21996
|
const requiredKeys = [];
|
|
21997
|
-
for (const
|
|
21998
|
-
const field2 = def.shape[
|
|
21997
|
+
for (const key2 of Object.keys(shape)) {
|
|
21998
|
+
const field2 = def.shape[key2];
|
|
21999
21999
|
if (ctx.io === "input" ? inputOptin(field2) === void 0 : field2._zod.optout === void 0) {
|
|
22000
|
-
requiredKeys.push(
|
|
22000
|
+
requiredKeys.push(key2);
|
|
22001
22001
|
}
|
|
22002
22002
|
}
|
|
22003
22003
|
if (requiredKeys.length > 0) {
|
|
@@ -22372,9 +22372,9 @@ function toJSONSchema(input2, params) {
|
|
|
22372
22372
|
};
|
|
22373
22373
|
ctx2.external = external;
|
|
22374
22374
|
for (const entry of registry2._idmap.entries()) {
|
|
22375
|
-
const [
|
|
22375
|
+
const [key2, schema] = entry;
|
|
22376
22376
|
extractDefs(ctx2, schema);
|
|
22377
|
-
assignProp(schemas,
|
|
22377
|
+
assignProp(schemas, key2, finalize(ctx2, schema));
|
|
22378
22378
|
}
|
|
22379
22379
|
if (Object.keys(defs).length > 0) {
|
|
22380
22380
|
const defsSegment = ctx2.target === "draft-2020-12" ? "$defs" : "definitions";
|
|
@@ -22689,17 +22689,17 @@ __export(checks_exports2, {
|
|
|
22689
22689
|
|
|
22690
22690
|
// node_modules/zod/v4/classic/errors.js
|
|
22691
22691
|
var _installedErrorProtos = /* @__PURE__ */ new WeakSet([Object.prototype, Error.prototype]);
|
|
22692
|
-
function _lazyMethod(proto,
|
|
22693
|
-
Object.defineProperty(proto,
|
|
22692
|
+
function _lazyMethod(proto, key2, make) {
|
|
22693
|
+
Object.defineProperty(proto, key2, {
|
|
22694
22694
|
configurable: true,
|
|
22695
22695
|
enumerable: false,
|
|
22696
22696
|
get() {
|
|
22697
22697
|
const value = make(this);
|
|
22698
|
-
Object.defineProperty(this,
|
|
22698
|
+
Object.defineProperty(this, key2, { value, configurable: true, writable: true });
|
|
22699
22699
|
return value;
|
|
22700
22700
|
},
|
|
22701
22701
|
set(value) {
|
|
22702
|
-
Object.defineProperty(this,
|
|
22702
|
+
Object.defineProperty(this, key2, { value, configurable: true, writable: true });
|
|
22703
22703
|
}
|
|
22704
22704
|
});
|
|
22705
22705
|
}
|
|
@@ -24363,17 +24363,17 @@ function resolveRef(ref, ctx) {
|
|
|
24363
24363
|
if (!ref.startsWith("#")) {
|
|
24364
24364
|
throw new Error("External $ref is not supported, only local refs (#/...) are allowed");
|
|
24365
24365
|
}
|
|
24366
|
-
const
|
|
24367
|
-
if (
|
|
24366
|
+
const path69 = ref.slice(1).split("/").filter(Boolean);
|
|
24367
|
+
if (path69.length === 0) {
|
|
24368
24368
|
return ctx.rootSchema;
|
|
24369
24369
|
}
|
|
24370
24370
|
const defsKey = ctx.version === "draft-2020-12" ? "$defs" : "definitions";
|
|
24371
|
-
if (
|
|
24372
|
-
const
|
|
24373
|
-
if (!
|
|
24371
|
+
if (path69[0] === defsKey) {
|
|
24372
|
+
const key2 = path69[1] === void 0 ? void 0 : decodeJSONPointerSegment(path69[1]);
|
|
24373
|
+
if (!key2 || !ctx.defs[key2]) {
|
|
24374
24374
|
throw new Error(`Reference not found: ${ref}`);
|
|
24375
24375
|
}
|
|
24376
|
-
return ctx.defs[
|
|
24376
|
+
return ctx.defs[key2];
|
|
24377
24377
|
}
|
|
24378
24378
|
throw new Error(`Reference not found: ${ref}`);
|
|
24379
24379
|
}
|
|
@@ -24408,16 +24408,16 @@ function checkObjectGuards(objectSchema, guards) {
|
|
|
24408
24408
|
});
|
|
24409
24409
|
}
|
|
24410
24410
|
if (guards.keySchema) {
|
|
24411
|
-
for (const
|
|
24412
|
-
const result = guards.keySchema.safeParse(
|
|
24411
|
+
for (const key2 of keys) {
|
|
24412
|
+
const result = guards.keySchema.safeParse(key2);
|
|
24413
24413
|
if (result.success)
|
|
24414
24414
|
continue;
|
|
24415
24415
|
payload.issues.push({
|
|
24416
24416
|
code: "invalid_key",
|
|
24417
24417
|
origin: "record",
|
|
24418
24418
|
issues: result.error.issues,
|
|
24419
|
-
input:
|
|
24420
|
-
path: [
|
|
24419
|
+
input: key2,
|
|
24420
|
+
path: [key2],
|
|
24421
24421
|
continue: true
|
|
24422
24422
|
});
|
|
24423
24423
|
}
|
|
@@ -24442,20 +24442,20 @@ function canonicalKey(value, seen) {
|
|
|
24442
24442
|
if (Array.isArray(value)) {
|
|
24443
24443
|
const parts3 = [];
|
|
24444
24444
|
for (const item of value) {
|
|
24445
|
-
const
|
|
24446
|
-
if (
|
|
24445
|
+
const key2 = canonicalKey(item, seen);
|
|
24446
|
+
if (key2 === null)
|
|
24447
24447
|
return null;
|
|
24448
|
-
parts3.push(
|
|
24448
|
+
parts3.push(key2);
|
|
24449
24449
|
}
|
|
24450
24450
|
return `a${parts3.length}:[${parts3.join(",")}]`;
|
|
24451
24451
|
}
|
|
24452
24452
|
const keys = Object.keys(value).sort();
|
|
24453
24453
|
const parts2 = [];
|
|
24454
24454
|
for (const k of keys) {
|
|
24455
|
-
const
|
|
24456
|
-
if (
|
|
24455
|
+
const key2 = canonicalKey(value[k], seen);
|
|
24456
|
+
if (key2 === null)
|
|
24457
24457
|
return null;
|
|
24458
|
-
parts2.push(`${k.length}:${k}=${
|
|
24458
|
+
parts2.push(`${k.length}:${k}=${key2}`);
|
|
24459
24459
|
}
|
|
24460
24460
|
return `o${parts2.length}:{${parts2.join(",")}}`;
|
|
24461
24461
|
} finally {
|
|
@@ -24495,10 +24495,10 @@ function containsRef(value) {
|
|
|
24495
24495
|
return value.some(containsRef);
|
|
24496
24496
|
if (typeof value.$ref === "string")
|
|
24497
24497
|
return true;
|
|
24498
|
-
return Object.entries(value).some(([
|
|
24499
|
-
if (SCHEMA_KEYWORDS.has(
|
|
24498
|
+
return Object.entries(value).some(([key2, sub]) => {
|
|
24499
|
+
if (SCHEMA_KEYWORDS.has(key2))
|
|
24500
24500
|
return containsRef(sub);
|
|
24501
|
-
if (!SCHEMA_MAP_KEYWORDS.has(
|
|
24501
|
+
if (!SCHEMA_MAP_KEYWORDS.has(key2) || typeof sub !== "object" || sub === null)
|
|
24502
24502
|
return false;
|
|
24503
24503
|
return Object.values(sub).some(containsRef);
|
|
24504
24504
|
});
|
|
@@ -24514,12 +24514,12 @@ function checkArrayGuards(arraySchema, guards) {
|
|
|
24514
24514
|
if (guards.uniqueItems === true) {
|
|
24515
24515
|
const firstSeen = /* @__PURE__ */ new Map();
|
|
24516
24516
|
for (let i = 0; i < items.length; i++) {
|
|
24517
|
-
const
|
|
24518
|
-
if (
|
|
24517
|
+
const key2 = canonicalKey(items[i], /* @__PURE__ */ new Set());
|
|
24518
|
+
if (key2 === null)
|
|
24519
24519
|
continue;
|
|
24520
|
-
const first = firstSeen.get(
|
|
24520
|
+
const first = firstSeen.get(key2);
|
|
24521
24521
|
if (first === void 0) {
|
|
24522
|
-
firstSeen.set(
|
|
24522
|
+
firstSeen.set(key2, i);
|
|
24523
24523
|
continue;
|
|
24524
24524
|
}
|
|
24525
24525
|
payload.issues.push({
|
|
@@ -24758,9 +24758,9 @@ function convertBaseSchema(schema, ctx) {
|
|
|
24758
24758
|
const properties = schema.properties || {};
|
|
24759
24759
|
const requiredSet = new Set(schema.required || []);
|
|
24760
24760
|
const additionalSchema = typeof schema.additionalProperties === "object" ? convertSchema(schema.additionalProperties, ctx) : void 0;
|
|
24761
|
-
for (const [
|
|
24761
|
+
for (const [key2, propSchema] of Object.entries(properties)) {
|
|
24762
24762
|
const propZodSchema = convertSchema(propSchema, ctx);
|
|
24763
|
-
assignProp(shape,
|
|
24763
|
+
assignProp(shape, key2, requiredSet.has(key2) ? propZodSchema : propZodSchema.optional());
|
|
24764
24764
|
}
|
|
24765
24765
|
if (schema.patternProperties) {
|
|
24766
24766
|
const patternProps = schema.patternProperties;
|
|
@@ -24795,12 +24795,12 @@ function convertBaseSchema(schema, ctx) {
|
|
|
24795
24795
|
if (!isPlainObject(payload.value))
|
|
24796
24796
|
return;
|
|
24797
24797
|
const unrecognized = [];
|
|
24798
|
-
for (const
|
|
24799
|
-
if (propertyKeys.includes(
|
|
24798
|
+
for (const key2 of Object.keys(payload.value)) {
|
|
24799
|
+
if (propertyKeys.includes(key2))
|
|
24800
24800
|
continue;
|
|
24801
|
-
if (patterns.some((regex) => regex.test(
|
|
24801
|
+
if (patterns.some((regex) => regex.test(key2)))
|
|
24802
24802
|
continue;
|
|
24803
|
-
unrecognized.push(
|
|
24803
|
+
unrecognized.push(key2);
|
|
24804
24804
|
}
|
|
24805
24805
|
if (unrecognized.length) {
|
|
24806
24806
|
payload.issues.push({
|
|
@@ -24931,38 +24931,38 @@ function convertSchema(schema, ctx) {
|
|
|
24931
24931
|
}
|
|
24932
24932
|
const extraMeta = {};
|
|
24933
24933
|
const coreMetadataKeys = ["$id", "id", "$comment", "$anchor", "$vocabulary", "$dynamicRef", "$dynamicAnchor"];
|
|
24934
|
-
for (const
|
|
24935
|
-
if (
|
|
24936
|
-
extraMeta[
|
|
24934
|
+
for (const key2 of coreMetadataKeys) {
|
|
24935
|
+
if (key2 in schema) {
|
|
24936
|
+
extraMeta[key2] = schema[key2];
|
|
24937
24937
|
}
|
|
24938
24938
|
}
|
|
24939
24939
|
const contentMetadataKeys = ["contentEncoding", "contentMediaType", "contentSchema"];
|
|
24940
|
-
for (const
|
|
24941
|
-
if (
|
|
24942
|
-
extraMeta[
|
|
24940
|
+
for (const key2 of contentMetadataKeys) {
|
|
24941
|
+
if (key2 in schema) {
|
|
24942
|
+
extraMeta[key2] = schema[key2];
|
|
24943
24943
|
}
|
|
24944
24944
|
}
|
|
24945
24945
|
if (schema.type === "object" && schema.$ref === void 0) {
|
|
24946
24946
|
if (schema.propertyNames !== void 0 && !containsRef(schema.propertyNames)) {
|
|
24947
24947
|
extraMeta.propertyNames = schema.propertyNames;
|
|
24948
24948
|
}
|
|
24949
|
-
for (const
|
|
24950
|
-
if (schema[
|
|
24951
|
-
extraMeta[
|
|
24949
|
+
for (const key2 of ["minProperties", "maxProperties"]) {
|
|
24950
|
+
if (schema[key2] !== void 0)
|
|
24951
|
+
extraMeta[key2] = schema[key2];
|
|
24952
24952
|
}
|
|
24953
24953
|
}
|
|
24954
24954
|
if (schema.type === "array" && schema.$ref === void 0) {
|
|
24955
24955
|
if (schema.contains !== void 0 && !containsRef(schema.contains)) {
|
|
24956
24956
|
extraMeta.contains = schema.contains;
|
|
24957
24957
|
}
|
|
24958
|
-
for (const
|
|
24959
|
-
if (schema[
|
|
24960
|
-
extraMeta[
|
|
24958
|
+
for (const key2 of ["uniqueItems", "minContains", "maxContains"]) {
|
|
24959
|
+
if (schema[key2] !== void 0)
|
|
24960
|
+
extraMeta[key2] = schema[key2];
|
|
24961
24961
|
}
|
|
24962
24962
|
}
|
|
24963
|
-
for (const
|
|
24964
|
-
if (!RECOGNIZED_KEYS.has(
|
|
24965
|
-
assignProp(extraMeta,
|
|
24963
|
+
for (const key2 of Object.keys(schema)) {
|
|
24964
|
+
if (!RECOGNIZED_KEYS.has(key2)) {
|
|
24965
|
+
assignProp(extraMeta, key2, schema[key2]);
|
|
24966
24966
|
}
|
|
24967
24967
|
}
|
|
24968
24968
|
if (Object.keys(extraMeta).length > 0) {
|
|
@@ -25257,9 +25257,9 @@ function profileLinkPairs(agent, dirs, profileRoot2, stateRoot) {
|
|
|
25257
25257
|
const seen = /* @__PURE__ */ new Set();
|
|
25258
25258
|
return dirs.flatMap((dir) => {
|
|
25259
25259
|
const link = path.join(profileRoot2, ...parts(dir));
|
|
25260
|
-
const
|
|
25261
|
-
if (seen.has(
|
|
25262
|
-
seen.add(
|
|
25260
|
+
const key2 = link.toLowerCase();
|
|
25261
|
+
if (seen.has(key2)) return [];
|
|
25262
|
+
seen.add(key2);
|
|
25263
25263
|
return [{ link, target: path.join(state, ...parts(dir)) }];
|
|
25264
25264
|
});
|
|
25265
25265
|
}
|
|
@@ -25398,6 +25398,9 @@ var HarnessSchema = external_exports.strictObject({
|
|
|
25398
25398
|
localState: external_exports.record(external_exports.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/), SubfolderSchema).optional().describe(
|
|
25399
25399
|
"Environment variable -> folder below the agent's own state folder (state\\<agent>) for SQLite databases. SQLite cannot run in a mapped folder, so the agent runs from a copy on the sandbox's disk (the variable points to it) that is copied from and back to that folder."
|
|
25400
25400
|
),
|
|
25401
|
+
bootReset: external_exports.array(SubfolderSchema).max(32).optional().describe(
|
|
25402
|
+
"Files and folders below the agent's own state folder (state\\<agent>) that only work on the machine that wrote them (keys sealed with Windows DPAPI, local accounts it created). Every sandbox is a new machine, so they are deleted at each boot and the agent sets them up again."
|
|
25403
|
+
),
|
|
25401
25404
|
resumeArguments: StringsSchema.optional().describe(
|
|
25402
25405
|
"Arguments used when the agent is restarted in place (e.g. after an account switch) so it resumes the conversation."
|
|
25403
25406
|
),
|
|
@@ -25475,6 +25478,9 @@ var MappingSchema = external_exports.strictObject({
|
|
|
25475
25478
|
optional: external_exports.boolean().optional().describe("true = skip it quietly when the host folder does not exist.")
|
|
25476
25479
|
});
|
|
25477
25480
|
var SandboxSchema = external_exports.strictObject({
|
|
25481
|
+
engine: external_exports.enum(["windows-sandbox", "hcs"]).describe(
|
|
25482
|
+
'(alpha) What runs the sandbox. "windows-sandbox" = Windows Sandbox (the default: desktop, Windows Terminal, GPU, clipboard, audio, printers). "hcs" = a headless Hyper-V isolated Server Core container for agents (no desktop, GPU or clipboard); it needs Windows features and an image on this PC (sandbox engine check hcs lists what is missing), and starting it is not enabled yet in this alpha. sandbox engine shows what each engine can do. Yours only: a project file (.sandbox-config.json) cannot set it.'
|
|
25483
|
+
),
|
|
25478
25484
|
memoryMb: external_exports.union([external_exports.literal("auto"), external_exports.number().int().min(2048)]).describe('Sandbox RAM in MB (>= 2048), or "auto": free RAM minus reserveHostMb, capped at maxMemoryMb.'),
|
|
25479
25485
|
maxMemoryMb: external_exports.number().int().positive().describe('Upper limit for memoryMb "auto".'),
|
|
25480
25486
|
maxMemoryPercent: external_exports.number().int().min(10).max(100).describe(`memoryMb "auto" never takes more than this share of this PC's total RAM (percent).`),
|
|
@@ -25484,10 +25490,22 @@ var SandboxSchema = external_exports.strictObject({
|
|
|
25484
25490
|
pageFileMb: external_exports.number().int().min(0).max(262144).describe(
|
|
25485
25491
|
`Size of the sandbox's paging file in MB, created at full size when it starts so it never grows while builds run (8 GB of its disk always stays free). Windows Sandbox starts with about 1 GB: parallel builds then fail with "The paging file is too small", and Windows grows the file under load. 0 = leave Windows' own.`
|
|
25486
25492
|
),
|
|
25487
|
-
reserveHostMb: external_exports.number().int().nonnegative().describe(
|
|
25488
|
-
|
|
25493
|
+
reserveHostMb: external_exports.number().int().nonnegative().describe(
|
|
25494
|
+
'Memory always left for this PC when memoryMb is "auto": the sandbox gets at most (free RAM, and RAM plus paging file still unused) minus this.'
|
|
25495
|
+
),
|
|
25496
|
+
agentMemoryHeadroomMb: external_exports.union([external_exports.literal("auto"), external_exports.literal("none"), external_exports.number().int().min(0)]).describe(
|
|
25497
|
+
'Memory kept out of the agents reach inside the sandbox, in MB: everything the agents start (their builds, tests, tools) together may use at most the sandbox memory minus this; a runaway parallel build then gets out-of-memory errors in its own session instead of freezing or crashing the whole sandbox. "auto" = the larger of 2048 MB and 10 % of the sandbox memory; "none" = no limit. Yours only: a project file cannot change it.'
|
|
25498
|
+
),
|
|
25499
|
+
pressureResponse: external_exports.boolean().describe(
|
|
25500
|
+
"When the sandbox (or this PC) runs low on memory, slow the heaviest build programs down (lower priority) and, if that is not enough, pause the biggest compiler for a few seconds at a time, so heavy parallel builds slow down instead of closing the sandbox. Never touches the agents themselves. Yours only: a project file cannot change it."
|
|
25501
|
+
),
|
|
25502
|
+
vGpu: external_exports.boolean().describe(
|
|
25503
|
+
"Virtual GPU. Off by default: Microsoft notes it widens the sandbox attack surface. The sandbox then uses this PC's graphics card, and with some graphics drivers heavy use can freeze the whole PC: turn it on only when a program in the sandbox needs the GPU (the mesa toolchain gives software OpenGL without it)."
|
|
25504
|
+
),
|
|
25489
25505
|
networking: external_exports.boolean().describe("Internet access. false is the only hard network isolation Windows Sandbox offers."),
|
|
25490
|
-
clipboard: external_exports.boolean().describe(
|
|
25506
|
+
clipboard: external_exports.boolean().describe(
|
|
25507
|
+
"Shared clipboard between this PC and the sandbox. Also lets an agent's copy (in sandbox attach) reach this PC's clipboard."
|
|
25508
|
+
),
|
|
25491
25509
|
audioInput: external_exports.boolean().describe("Microphone access."),
|
|
25492
25510
|
videoInput: external_exports.boolean().describe("Camera access."),
|
|
25493
25511
|
printerRedirection: external_exports.boolean().describe("Printers from this PC."),
|
|
@@ -26609,18 +26627,18 @@ var WebSchema = external_exports.strictObject({
|
|
|
26609
26627
|
});
|
|
26610
26628
|
|
|
26611
26629
|
// src/core/schema/vpn.ts
|
|
26612
|
-
var VPN_PROVIDERS = ["nordvpn", "openvpn-file"];
|
|
26630
|
+
var VPN_PROVIDERS = ["nordvpn", "openvpn-file", "wireguard-file"];
|
|
26613
26631
|
var VpnSchema = external_exports.strictObject({
|
|
26614
26632
|
enabled: external_exports.boolean().describe(
|
|
26615
26633
|
"Send the sandbox's traffic through a VPN. Only the sandbox: your PC's own connection is untouched. Needs a saved login first (sandbox vpn login). The agent in the sandbox can read that login and can turn the tunnel off (it is the administrator there)."
|
|
26616
26634
|
),
|
|
26617
26635
|
provider: external_exports.enum(VPN_PROVIDERS).describe(
|
|
26618
|
-
"nordvpn: a recommended NordVPN server is picked at every launch. openvpn-file: your own .ovpn file (configFile)."
|
|
26636
|
+
"nordvpn: a recommended NordVPN server is picked at every launch. openvpn-file: your own .ovpn file (configFile). wireguard-file: your own WireGuard .conf (configFile), e.g. from your company."
|
|
26619
26637
|
),
|
|
26620
26638
|
protocol: external_exports.enum(["udp", "tcp"]).describe("udp is faster; tcp gets through networks that block udp."),
|
|
26621
26639
|
country: external_exports.string().regex(/^([A-Za-z][A-Za-z .'-]{0,39})?$/, "a country name or code like uk or Germany").describe("nordvpn: the country of the server, e.g. uk, us or Germany. Empty = the best server anywhere."),
|
|
26622
26640
|
configFile: external_exports.string().describe(
|
|
26623
|
-
"openvpn-file: the .ovpn file on this PC (its certificates inside it). Files that run programs (script-security, up, down, plugin ...) are refused. A project's file can never set this."
|
|
26641
|
+
"openvpn-file / wireguard-file: the .ovpn or .conf file on this PC (an .ovpn has its certificates inside it). Files that run programs (script-security, up, down, plugin, PostUp ...) are refused. A WireGuard file holds your private key: it is read when a sandbox starts and handed over in a one-shot file. A project's file can never set this."
|
|
26624
26642
|
),
|
|
26625
26643
|
killSwitch: external_exports.boolean().describe(
|
|
26626
26644
|
"Block all traffic that does not go through the tunnel: when the tunnel cannot start, the sandbox stays offline instead of using your normal connection. A project can only turn this on, never off."
|
|
@@ -26647,6 +26665,10 @@ var ConfigSchema = external_exports.strictObject({
|
|
|
26647
26665
|
markSandboxFiles: external_exports.boolean().describe(
|
|
26648
26666
|
`Programs and scripts (.exe, .ps1, .bat, .cmd, .msi, .lnk ...) that appear or change in your project while a sandbox runs get Windows' "downloaded from the internet" mark, so SmartScreen and PowerShell ask before they run on this PC.`
|
|
26649
26667
|
),
|
|
26668
|
+
contained: external_exports.enum(["off", "vhdx"]).describe(
|
|
26669
|
+
'(beta) Keep the sandbox tools, state and logs inside one disk image file (vhdx) instead of loose folders, so scanning programs on this PC see one file. Not yet tried on a real PC. Turn it on with sandbox storage contained on (it moves your files and asks first); Windows asks for permission to mount the image when a sandbox starts. "off" = loose folders, as always. Yours only: a project file (.sandbox-config.json) cannot set it.'
|
|
26670
|
+
),
|
|
26671
|
+
containedMaxGb: external_exports.number().int().min(8).max(4096).describe("(beta) Largest size, in GB, the disk image of storage.contained may grow to."),
|
|
26650
26672
|
warnDataGb: external_exports.number().min(0).describe(
|
|
26651
26673
|
"Say at launch when the persisted data (tools, databases, logins) is bigger than this many GB; 0 = never. sandbox data shows what takes the space."
|
|
26652
26674
|
)
|
|
@@ -26690,7 +26712,13 @@ var LocalOverridesSchema = external_exports.strictObject({
|
|
|
26690
26712
|
"Scripts (.ps1 / .mjs / .cmd, relative to this file) run inside the sandbox before the agent."
|
|
26691
26713
|
),
|
|
26692
26714
|
// This PC's resources are yours to share: CPU and paging file (this PC's disk) are not a project's to set.
|
|
26693
|
-
sandbox: SandboxSchema.omit({
|
|
26715
|
+
sandbox: SandboxSchema.omit({
|
|
26716
|
+
cpuLimit: true,
|
|
26717
|
+
pageFileMb: true,
|
|
26718
|
+
engine: true,
|
|
26719
|
+
agentMemoryHeadroomMb: true,
|
|
26720
|
+
pressureResponse: true
|
|
26721
|
+
}).partial(),
|
|
26694
26722
|
// A project may block more (the LAN, hosts); it never opens hosts, ports, DNS or a proxy.
|
|
26695
26723
|
network: NetworkSchema.pick({ blockPrivateRanges: true, blockHosts: true }).partial(),
|
|
26696
26724
|
// A project may turn the kill switch on, never off, and never choose a VPN, a server, a file or a login.
|
|
@@ -26799,8 +26827,34 @@ var GuestRequestSchema = external_exports.discriminatedUnion("kind", [
|
|
|
26799
26827
|
cwd: Text().optional(),
|
|
26800
26828
|
createdAt: TimeSchema
|
|
26801
26829
|
}),
|
|
26802
|
-
external_exports.strictObject({ kind: external_exports.literal("ping"), id: IdSchema, createdAt: TimeSchema })
|
|
26830
|
+
external_exports.strictObject({ kind: external_exports.literal("ping"), id: IdSchema, createdAt: TimeSchema }),
|
|
26831
|
+
/**
|
|
26832
|
+
* The PC's own memory or CPU is running low (the host watchdog): the sandbox slows its heaviest builds down for
|
|
26833
|
+
* `seconds` (it never stops them) so Windows does not have to close it. Repeated while the PC stays low.
|
|
26834
|
+
*/
|
|
26835
|
+
external_exports.strictObject({
|
|
26836
|
+
kind: external_exports.literal("pressure"),
|
|
26837
|
+
id: IdSchema,
|
|
26838
|
+
reason: Text(300),
|
|
26839
|
+
seconds: external_exports.number().int().min(10).max(300),
|
|
26840
|
+
createdAt: TimeSchema
|
|
26841
|
+
})
|
|
26803
26842
|
]);
|
|
26843
|
+
var PressureStatusSchema = external_exports.object({
|
|
26844
|
+
level: external_exports.enum(["ok", "throttled", "suspending"]),
|
|
26845
|
+
profile: external_exports.enum(["normal", "gentle"]),
|
|
26846
|
+
/** Share of the sandbox's RAM still free and of its commit limit in use (percent). */
|
|
26847
|
+
ramFreePercent: external_exports.number().int().min(0).max(100),
|
|
26848
|
+
commitPercent: external_exports.number().int().min(0).max(100),
|
|
26849
|
+
/** Programs running at lower priority because of it. */
|
|
26850
|
+
lowered: external_exports.number().int().min(0).max(1024),
|
|
26851
|
+
/** Programs paused right now (name, process id, seconds left). */
|
|
26852
|
+
paused: external_exports.array(external_exports.object({ name: Text(64), pid: external_exports.number().int(), seconds: external_exports.number().int().min(0).max(60) })).max(8),
|
|
26853
|
+
/** The PC itself asked for slowing down (its memory or CPU is low). */
|
|
26854
|
+
pcLow: external_exports.boolean(),
|
|
26855
|
+
lastAction: Text(300),
|
|
26856
|
+
updatedAt: TimeSchema
|
|
26857
|
+
});
|
|
26804
26858
|
var GuestResponseSchema = external_exports.object({
|
|
26805
26859
|
id: IdSchema,
|
|
26806
26860
|
ok: external_exports.boolean(),
|
|
@@ -27009,6 +27063,8 @@ var RunDir = class {
|
|
|
27009
27063
|
root;
|
|
27010
27064
|
sandboxFile;
|
|
27011
27065
|
vpnFile;
|
|
27066
|
+
/** What the memory governor in the sandbox is doing (pressure.json). */
|
|
27067
|
+
pressureFile;
|
|
27012
27068
|
requestsDir;
|
|
27013
27069
|
responsesDir;
|
|
27014
27070
|
sessionsDir;
|
|
@@ -27021,6 +27077,7 @@ var RunDir = class {
|
|
|
27021
27077
|
this.root = path6.join(dataDir2, "run");
|
|
27022
27078
|
this.sandboxFile = path6.join(this.root, "sandbox.json");
|
|
27023
27079
|
this.vpnFile = path6.join(this.root, "vpn.json");
|
|
27080
|
+
this.pressureFile = path6.join(this.root, "pressure.json");
|
|
27024
27081
|
this.requestsDir = path6.join(this.root, "requests");
|
|
27025
27082
|
this.responsesDir = path6.join(this.root, "responses");
|
|
27026
27083
|
this.sessionsDir = path6.join(this.root, "sessions");
|
|
@@ -27049,6 +27106,9 @@ var RunDir = class {
|
|
|
27049
27106
|
readVpnStatus() {
|
|
27050
27107
|
return readValid(VpnStatusSchema, this.vpnFile);
|
|
27051
27108
|
}
|
|
27109
|
+
readPressure() {
|
|
27110
|
+
return readValid(PressureStatusSchema, this.pressureFile);
|
|
27111
|
+
}
|
|
27052
27112
|
readSession(id) {
|
|
27053
27113
|
return readValid(SessionStatusSchema, this.sessionFile(id));
|
|
27054
27114
|
}
|
|
@@ -27161,6 +27221,7 @@ var SYSTEM = {
|
|
|
27161
27221
|
shutdown: () => system32("shutdown.exe"),
|
|
27162
27222
|
dism: () => system32("Dism.exe"),
|
|
27163
27223
|
msiexec: () => system32("msiexec.exe"),
|
|
27224
|
+
sc: () => system32("sc.exe"),
|
|
27164
27225
|
/** The .NET Framework C# compiler that ships with Windows (C# 5). */
|
|
27165
27226
|
csc: () => path9.join(systemRoot(), "Microsoft.NET", "Framework64", "v4.0.30319", "csc.exe")
|
|
27166
27227
|
};
|
|
@@ -27582,7 +27643,9 @@ var SecretsFileSchema = external_exports.strictObject({
|
|
|
27582
27643
|
/** The login of this PC's Claude (claudeProfile.copyCredentials): the text of .credentials.json. */
|
|
27583
27644
|
claudeCredentials: external_exports.string().max(1024 * 1024).optional(),
|
|
27584
27645
|
/** VPN service credentials (vpn.provider's login), only for the launch's own sandbox. */
|
|
27585
|
-
vpn: external_exports.strictObject({ username: external_exports.string().min(1).max(256), password: external_exports.string().min(1).max(1024) }).optional()
|
|
27646
|
+
vpn: external_exports.strictObject({ username: external_exports.string().min(1).max(256), password: external_exports.string().min(1).max(1024) }).optional(),
|
|
27647
|
+
/** The checked WireGuard config of vpn.provider wireguard-file (holds the private key). */
|
|
27648
|
+
wireguardConfig: external_exports.string().min(1).max(32 * 1024).optional()
|
|
27586
27649
|
});
|
|
27587
27650
|
var withEnvironment = (harness, environment) => environment ? { ...harness, environment: { ...harness.environment, ...environment } } : harness;
|
|
27588
27651
|
function mergeRequestSecrets(request, secrets) {
|
|
@@ -27646,7 +27709,7 @@ function withRequestSecrets(req) {
|
|
|
27646
27709
|
}
|
|
27647
27710
|
|
|
27648
27711
|
// src/guest/daemon/daemon.ts
|
|
27649
|
-
import
|
|
27712
|
+
import fs53 from "node:fs";
|
|
27650
27713
|
|
|
27651
27714
|
// src/guest/setup/claude-mem.ts
|
|
27652
27715
|
import fs14 from "node:fs";
|
|
@@ -27958,9 +28021,9 @@ function planPath(input2) {
|
|
|
27958
28021
|
const seen = /* @__PURE__ */ new Set();
|
|
27959
28022
|
const result = [];
|
|
27960
28023
|
for (const entry of input2.entries.flatMap(splitPath)) {
|
|
27961
|
-
const
|
|
27962
|
-
if (seen.has(
|
|
27963
|
-
seen.add(
|
|
28024
|
+
const key2 = pathKey(entry);
|
|
28025
|
+
if (seen.has(key2) || input2.drop?.(entry) || !input2.exists(entry)) continue;
|
|
28026
|
+
seen.add(key2);
|
|
27964
28027
|
result.push(entry);
|
|
27965
28028
|
}
|
|
27966
28029
|
return result;
|
|
@@ -27968,9 +28031,9 @@ function planPath(input2) {
|
|
|
27968
28031
|
function appendMissing(base, extra, skip = () => false) {
|
|
27969
28032
|
const seen = new Set(splitPath(base).map(pathKey));
|
|
27970
28033
|
const added = splitPath(extra).filter((folder) => {
|
|
27971
|
-
const
|
|
27972
|
-
if (seen.has(
|
|
27973
|
-
seen.add(
|
|
28034
|
+
const key2 = pathKey(folder);
|
|
28035
|
+
if (seen.has(key2) || skip(folder)) return false;
|
|
28036
|
+
seen.add(key2);
|
|
27974
28037
|
return true;
|
|
27975
28038
|
});
|
|
27976
28039
|
return [...splitPath(base), ...added].join(";");
|
|
@@ -27980,9 +28043,9 @@ function parseRegPath(output2) {
|
|
|
27980
28043
|
return line ? line.replace(/^\s+Path\s+REG_(EXPAND_)?SZ\s+/i, "").trim() : "";
|
|
27981
28044
|
}
|
|
27982
28045
|
function isPinnedNodeDir(folder, nvmHome2) {
|
|
27983
|
-
const
|
|
28046
|
+
const key2 = pathKey(folder);
|
|
27984
28047
|
const home = pathKey(nvmHome2);
|
|
27985
|
-
return
|
|
28048
|
+
return key2.startsWith(home + "\\") && /^v\d/.test(path21.win32.basename(key2));
|
|
27986
28049
|
}
|
|
27987
28050
|
|
|
27988
28051
|
// src/guest/setup/environment.ts
|
|
@@ -28033,7 +28096,7 @@ function addMachineEnvironment(vars, dirs, additive = false) {
|
|
|
28033
28096
|
var nvmHome = () => path22.join(toolsDir, "nvm");
|
|
28034
28097
|
var MACHINE_ENVIRONMENT_KEY = "HKLM\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment";
|
|
28035
28098
|
var USER_ENVIRONMENT_KEY = "HKCU\\Environment";
|
|
28036
|
-
var registryPath = (
|
|
28099
|
+
var registryPath = (key2) => parseRegPath(execOutput(SYSTEM.reg(), ["query", key2, "/v", "Path"]));
|
|
28037
28100
|
function withRegistryPath(env) {
|
|
28038
28101
|
if (!isWin || dryRun || testMode) return env;
|
|
28039
28102
|
try {
|
|
@@ -28898,20 +28961,20 @@ var VersionCache = class {
|
|
|
28898
28961
|
* the remaining lookups use the remembered versions instead of each waiting for the network; other errors (no such
|
|
28899
28962
|
* version) do not.
|
|
28900
28963
|
*/
|
|
28901
|
-
async resolve(
|
|
28902
|
-
const cached2 = this.remembered()[
|
|
28964
|
+
async resolve(key2, resolve2) {
|
|
28965
|
+
const cached2 = this.remembered()[key2];
|
|
28903
28966
|
if (cached2 && (this.offline || !session.provisioning.refresh && Date.now() - cached2.at < FRESH_MS))
|
|
28904
28967
|
return cached2.value;
|
|
28905
28968
|
try {
|
|
28906
28969
|
const value = await resolve2();
|
|
28907
28970
|
fs25.mkdirSync(toolsDir, { recursive: true });
|
|
28908
|
-
writeJsonAtomic(this.file(), { ...this.remembered(), [
|
|
28971
|
+
writeJsonAtomic(this.file(), { ...this.remembered(), [key2]: { value, at: Date.now() } });
|
|
28909
28972
|
return value;
|
|
28910
28973
|
} catch (e) {
|
|
28911
28974
|
if (isNetworkError(e)) this.offline = true;
|
|
28912
28975
|
if (!cached2) throw e;
|
|
28913
28976
|
warn(
|
|
28914
|
-
"Could not look up the latest " +
|
|
28977
|
+
"Could not look up the latest " + key2 + " online (" + errMsg(e) + "); using " + cached2.value + " from an earlier start."
|
|
28915
28978
|
);
|
|
28916
28979
|
return cached2.value;
|
|
28917
28980
|
}
|
|
@@ -28926,8 +28989,8 @@ var VersionCache = class {
|
|
|
28926
28989
|
}
|
|
28927
28990
|
};
|
|
28928
28991
|
var versionCache = new VersionCache();
|
|
28929
|
-
function resolveCached(
|
|
28930
|
-
return versionCache.resolve(
|
|
28992
|
+
function resolveCached(key2, resolve2) {
|
|
28993
|
+
return versionCache.resolve(key2, resolve2);
|
|
28931
28994
|
}
|
|
28932
28995
|
|
|
28933
28996
|
// src/guest/toolchains/languages/java.ts
|
|
@@ -29436,7 +29499,8 @@ var SOURCES = {
|
|
|
29436
29499
|
openssl: "OpenSsl.cs",
|
|
29437
29500
|
cargoshim: "CargoShim.cs",
|
|
29438
29501
|
linkgate: "LinkGate.cs",
|
|
29439
|
-
pathsync: "PathSync.cs"
|
|
29502
|
+
pathsync: "PathSync.cs",
|
|
29503
|
+
memgov: "MemGov.cs"
|
|
29440
29504
|
};
|
|
29441
29505
|
function sourceOf(name) {
|
|
29442
29506
|
return path40.join(launchDir, "sandbox", "csharp", SOURCES[name]);
|
|
@@ -29531,7 +29595,7 @@ var pointAtOwnCertificates = (root) => {
|
|
|
29531
29595
|
const bundle = path41.join(root, "mingw64", "etc", "ssl", "certs", "ca-bundle.crt");
|
|
29532
29596
|
if (!exists(config2) || !exists(bundle)) return;
|
|
29533
29597
|
const text = fs32.readFileSync(config2, "utf8");
|
|
29534
|
-
const fixed = text.replace(/^(\s*sslCAInfo\s*=\s*).*$/gim, (_m,
|
|
29598
|
+
const fixed = text.replace(/^(\s*sslCAInfo\s*=\s*).*$/gim, (_m, key2) => key2 + posix(bundle));
|
|
29535
29599
|
if (fixed !== text) fs32.writeFileSync(config2, fixed);
|
|
29536
29600
|
};
|
|
29537
29601
|
async function setupGit(env, hostCopy, refresh, access) {
|
|
@@ -29703,7 +29767,7 @@ var CLI_TOOLS = [
|
|
|
29703
29767
|
];
|
|
29704
29768
|
var CLI_NAMES = [...CLI_TOOLS.map((t) => t.name), "openssl"];
|
|
29705
29769
|
function decideCli(settings, ctx) {
|
|
29706
|
-
const
|
|
29770
|
+
const decide2 = (name) => {
|
|
29707
29771
|
const setting = settings[name] ?? false;
|
|
29708
29772
|
if (name === "gh" && setting !== false && ctx.gitAccess !== "full")
|
|
29709
29773
|
return {
|
|
@@ -29715,7 +29779,7 @@ function decideCli(settings, ctx) {
|
|
|
29715
29779
|
if (name === "openssl") return { on: true, reason: "Git for Windows ships it" };
|
|
29716
29780
|
return { on: false, reason: "not listed in toolchains.cli" };
|
|
29717
29781
|
};
|
|
29718
|
-
return Object.fromEntries(CLI_NAMES.map((name) => [name,
|
|
29782
|
+
return Object.fromEntries(CLI_NAMES.map((name) => [name, decide2(name)]));
|
|
29719
29783
|
}
|
|
29720
29784
|
|
|
29721
29785
|
// src/guest/toolchains/runtimes.ts
|
|
@@ -29998,10 +30062,10 @@ async function setupDotnet(env, config2, refresh) {
|
|
|
29998
30062
|
["global.json:" + fs36.readFileSync(globalJson, "utf8").replace(/\s+/g, ""), ["-JSonFile", globalJson]]
|
|
29999
30063
|
] : []
|
|
30000
30064
|
];
|
|
30001
|
-
for (const [
|
|
30065
|
+
for (const [key2, args] of installs.filter(([k]) => !done[k])) {
|
|
30002
30066
|
await downloadFile("https://dot.net/v1/dotnet-install.ps1", script);
|
|
30003
30067
|
log(
|
|
30004
|
-
"Installing the .NET SDK " + (
|
|
30068
|
+
"Installing the .NET SDK " + (key2.startsWith("channel:") ? key2.slice(8) : "pinned in global.json") + " (~250 MB once) ..."
|
|
30005
30069
|
);
|
|
30006
30070
|
await execAsync(SYSTEM.powershell(), [
|
|
30007
30071
|
"-NoLogo",
|
|
@@ -30015,7 +30079,7 @@ async function setupDotnet(env, config2, refresh) {
|
|
|
30015
30079
|
root,
|
|
30016
30080
|
"-NoPath"
|
|
30017
30081
|
]);
|
|
30018
|
-
done[
|
|
30082
|
+
done[key2] = true;
|
|
30019
30083
|
writeJsonAtomic(marker, done);
|
|
30020
30084
|
}
|
|
30021
30085
|
const home = mkdirp(tool("dotnet-home"));
|
|
@@ -30863,7 +30927,7 @@ var phpBuild = async (spec) => {
|
|
|
30863
30927
|
);
|
|
30864
30928
|
const release = Object.values(releases).find((r) => r.version === pick2);
|
|
30865
30929
|
const build = release && Object.entries(release).find(
|
|
30866
|
-
([
|
|
30930
|
+
([key2, value]) => /^nts-vs\d+-x64$/.test(key2) && typeof value === "object" && value.zip
|
|
30867
30931
|
)?.[1];
|
|
30868
30932
|
if (!release || typeof build !== "object" || !build.zip)
|
|
30869
30933
|
throw new Error('No PHP build for Windows matches "' + spec + '"');
|
|
@@ -31210,6 +31274,32 @@ async function setupVscode(env, refresh) {
|
|
|
31210
31274
|
import fs47 from "node:fs";
|
|
31211
31275
|
import os8 from "node:os";
|
|
31212
31276
|
import path61 from "node:path";
|
|
31277
|
+
|
|
31278
|
+
// src/shared/memory/policy.ts
|
|
31279
|
+
var GUEST_THRESHOLDS = {
|
|
31280
|
+
normal: {
|
|
31281
|
+
enterAvailablePercent: 8,
|
|
31282
|
+
enterCommitPercent: 92,
|
|
31283
|
+
exitAvailablePercent: 12,
|
|
31284
|
+
exitCommitPercent: 88,
|
|
31285
|
+
calmSamples: 3
|
|
31286
|
+
},
|
|
31287
|
+
gentle: {
|
|
31288
|
+
enterAvailablePercent: 15,
|
|
31289
|
+
enterCommitPercent: 85,
|
|
31290
|
+
exitAvailablePercent: 20,
|
|
31291
|
+
exitCommitPercent: 80,
|
|
31292
|
+
calmSamples: 3
|
|
31293
|
+
}
|
|
31294
|
+
};
|
|
31295
|
+
function cargoJobs(cpus, memoryGb, sessions2) {
|
|
31296
|
+
const byCpu = Math.max(2, Math.min(4, Math.floor(cpus / 4)));
|
|
31297
|
+
const byMemory = Math.max(1, Math.floor(memoryGb / 4));
|
|
31298
|
+
const jobs = Math.min(byCpu, byMemory);
|
|
31299
|
+
return Math.max(1, Math.min(jobs, Math.floor(8 / Math.max(1, sessions2))));
|
|
31300
|
+
}
|
|
31301
|
+
|
|
31302
|
+
// src/guest/toolchains/native/rust-extras.ts
|
|
31213
31303
|
var cargoTarget = (targetDir) => {
|
|
31214
31304
|
if (targetDir === "shared" || targetDir === "separate") return null;
|
|
31215
31305
|
if (targetDir === "local") return path61.join(localDir, "cargo-target");
|
|
@@ -31244,7 +31334,7 @@ function linkGate(env, rust, host) {
|
|
|
31244
31334
|
function cargoDefaults(host) {
|
|
31245
31335
|
const file3 = tool("rust", "cargo", "config.toml");
|
|
31246
31336
|
if (exists(file3) || !exists(path61.dirname(file3))) return;
|
|
31247
|
-
const jobs =
|
|
31337
|
+
const jobs = cargoJobs(os8.cpus().length, os8.totalmem() / 1024 ** 3, 1);
|
|
31248
31338
|
const gnu = host.endsWith("-gnu");
|
|
31249
31339
|
fs47.writeFileSync(
|
|
31250
31340
|
file3,
|
|
@@ -31524,20 +31614,20 @@ var StepScheduler = class {
|
|
|
31524
31614
|
}
|
|
31525
31615
|
/** Runs `work` once no other step of the same kind (first word of the name) is running. */
|
|
31526
31616
|
async exclusive(name, work) {
|
|
31527
|
-
const
|
|
31528
|
-
const previous = this.locks.get(
|
|
31617
|
+
const key2 = name.split(" ")[0].toLowerCase();
|
|
31618
|
+
const previous = this.locks.get(key2) ?? Promise.resolve();
|
|
31529
31619
|
let release = () => void 0;
|
|
31530
31620
|
const mine = new Promise((r) => {
|
|
31531
31621
|
release = r;
|
|
31532
31622
|
});
|
|
31533
31623
|
const chained = previous.then(() => mine);
|
|
31534
|
-
this.locks.set(
|
|
31624
|
+
this.locks.set(key2, chained);
|
|
31535
31625
|
await previous;
|
|
31536
31626
|
try {
|
|
31537
31627
|
return await work();
|
|
31538
31628
|
} finally {
|
|
31539
31629
|
release();
|
|
31540
|
-
if (this.locks.get(
|
|
31630
|
+
if (this.locks.get(key2) === chained) this.locks.delete(key2);
|
|
31541
31631
|
}
|
|
31542
31632
|
}
|
|
31543
31633
|
};
|
|
@@ -31668,9 +31758,9 @@ var ProjectProvisioner = class {
|
|
|
31668
31758
|
*/
|
|
31669
31759
|
provision(spec, say) {
|
|
31670
31760
|
const id = spec.name.toLowerCase();
|
|
31671
|
-
const
|
|
31761
|
+
const key2 = JSON.stringify(spec);
|
|
31672
31762
|
const known = this.running.get(id);
|
|
31673
|
-
if (known && known.key ===
|
|
31763
|
+
if (known && known.key === key2) {
|
|
31674
31764
|
known.listeners.add(say);
|
|
31675
31765
|
return known.work.finally(() => known.listeners.delete(say));
|
|
31676
31766
|
}
|
|
@@ -31683,7 +31773,7 @@ var ProjectProvisioner = class {
|
|
|
31683
31773
|
}
|
|
31684
31774
|
};
|
|
31685
31775
|
const work = setUp(spec, broadcast);
|
|
31686
|
-
const entry = { key, work, listeners };
|
|
31776
|
+
const entry = { key: key2, work, listeners };
|
|
31687
31777
|
this.running.set(id, entry);
|
|
31688
31778
|
work.then(
|
|
31689
31779
|
(done) => {
|
|
@@ -31729,8 +31819,8 @@ function execCommand(req) {
|
|
|
31729
31819
|
{ cwd: req.cwd, env, windowsHide: true, windowsVerbatimArguments: true }
|
|
31730
31820
|
);
|
|
31731
31821
|
const output2 = { stdout: "", stderr: "" };
|
|
31732
|
-
const collect = (
|
|
31733
|
-
if (output2[
|
|
31822
|
+
const collect = (key2) => (d) => {
|
|
31823
|
+
if (output2[key2].length < MAX_OUTPUT) output2[key2] += d;
|
|
31734
31824
|
};
|
|
31735
31825
|
child.stdout.setEncoding("utf8").on("data", collect("stdout"));
|
|
31736
31826
|
child.stderr.setEncoding("utf8").on("data", collect("stderr"));
|
|
@@ -31754,6 +31844,7 @@ function execCommand(req) {
|
|
|
31754
31844
|
// src/guest/daemon/sessions.ts
|
|
31755
31845
|
import path67 from "node:path";
|
|
31756
31846
|
import crypto4 from "node:crypto";
|
|
31847
|
+
import os11 from "node:os";
|
|
31757
31848
|
import { spawn as spawn7 } from "node:child_process";
|
|
31758
31849
|
|
|
31759
31850
|
// src/shared/pty/protocol.ts
|
|
@@ -31824,6 +31915,9 @@ async function sendControl(endpoint, type) {
|
|
|
31824
31915
|
);
|
|
31825
31916
|
}
|
|
31826
31917
|
|
|
31918
|
+
// src/shared/pty/output-filter.ts
|
|
31919
|
+
var MAX_CLIPBOARD_STRING = 1024 * 1024;
|
|
31920
|
+
|
|
31827
31921
|
// src/guest/sessions/cmdline.ts
|
|
31828
31922
|
import path63 from "node:path";
|
|
31829
31923
|
var quoted = (arg) => '"' + arg.replace(/(\\*)"/g, '$1$1\\"').replace(/(\\+)$/, "$1$1") + '"';
|
|
@@ -32075,7 +32169,14 @@ var harnessFor = (req) => {
|
|
|
32075
32169
|
'Agent "' + req.harness + '" is not configured for this sandbox (it runs ' + session.harnessName + ")."
|
|
32076
32170
|
);
|
|
32077
32171
|
};
|
|
32078
|
-
|
|
32172
|
+
function memoryEnv(env, sessions2) {
|
|
32173
|
+
const out = {};
|
|
32174
|
+
if (session.agentMemoryLimitMb) out.PTYHOST_JOB_MB = String(session.agentMemoryLimitMb);
|
|
32175
|
+
if (!env.CARGO_BUILD_JOBS)
|
|
32176
|
+
out.CARGO_BUILD_JOBS = String(cargoJobs(os11.cpus().length, os11.totalmem() / 1024 ** 3, sessions2));
|
|
32177
|
+
return out;
|
|
32178
|
+
}
|
|
32179
|
+
var launchPtyHost = async (req, remote, env, say, sessions2) => {
|
|
32079
32180
|
const harness = harnessFor(req);
|
|
32080
32181
|
say("Preparing " + req.harness);
|
|
32081
32182
|
await agents.provision(req.harness, harness, env, false);
|
|
@@ -32091,7 +32192,7 @@ var launchPtyHost = async (req, remote, env, say) => {
|
|
|
32091
32192
|
rows: 32,
|
|
32092
32193
|
id: req.id,
|
|
32093
32194
|
cwd: req.cwd,
|
|
32094
|
-
env: { ...withRegistryPath(env), ...harness.environment },
|
|
32195
|
+
env: { ...withRegistryPath(env), ...harness.environment, ...memoryEnv(env, sessions2) },
|
|
32095
32196
|
remote,
|
|
32096
32197
|
command: commandLine(launch.file, [...base, ...req.args]),
|
|
32097
32198
|
restartCommand: commandLine(launch.file, [...base, ...harness.resumeArguments ?? []])
|
|
@@ -32163,7 +32264,7 @@ var SessionManager = class {
|
|
|
32163
32264
|
try {
|
|
32164
32265
|
const place = await placeFor(req, say);
|
|
32165
32266
|
const remote = session.networking && session.attach.enabled;
|
|
32166
|
-
const { child, port, token } = await launchPtyHost(req, remote, place.env, say);
|
|
32267
|
+
const { child, port, token } = await launchPtyHost(req, remote, place.env, say, this.live.size + 1);
|
|
32167
32268
|
const resumed = req.harness === "claude" ? resumedConversation(req.args) : void 0;
|
|
32168
32269
|
const running = {
|
|
32169
32270
|
...status,
|
|
@@ -32272,6 +32373,335 @@ var SessionManager = class {
|
|
|
32272
32373
|
};
|
|
32273
32374
|
var sessions = new SessionManager();
|
|
32274
32375
|
|
|
32376
|
+
// src/guest/governor/decide.ts
|
|
32377
|
+
var COMPILERS = /* @__PURE__ */ new Set([
|
|
32378
|
+
"rustc",
|
|
32379
|
+
"clippy-driver",
|
|
32380
|
+
"rustdoc",
|
|
32381
|
+
"cc1",
|
|
32382
|
+
"cc1plus",
|
|
32383
|
+
"cc1obj",
|
|
32384
|
+
"collect2",
|
|
32385
|
+
"gcc",
|
|
32386
|
+
"g++",
|
|
32387
|
+
"c++",
|
|
32388
|
+
"cc",
|
|
32389
|
+
"clang",
|
|
32390
|
+
"clang++",
|
|
32391
|
+
"clang-cl",
|
|
32392
|
+
"cl",
|
|
32393
|
+
"link",
|
|
32394
|
+
"lld",
|
|
32395
|
+
"lld-link",
|
|
32396
|
+
"ld",
|
|
32397
|
+
"ld.lld",
|
|
32398
|
+
"as",
|
|
32399
|
+
"tsc",
|
|
32400
|
+
"javac"
|
|
32401
|
+
]);
|
|
32402
|
+
var BUILD_TOOLS = /* @__PURE__ */ new Set([
|
|
32403
|
+
"node",
|
|
32404
|
+
"dotnet",
|
|
32405
|
+
"msbuild",
|
|
32406
|
+
"vbcscompiler",
|
|
32407
|
+
"ninja",
|
|
32408
|
+
"make",
|
|
32409
|
+
"mingw32-make",
|
|
32410
|
+
"cmake",
|
|
32411
|
+
"cargo",
|
|
32412
|
+
"go",
|
|
32413
|
+
"java",
|
|
32414
|
+
"gradle",
|
|
32415
|
+
"python"
|
|
32416
|
+
]);
|
|
32417
|
+
var NEVER2 = /* @__PURE__ */ new Set([
|
|
32418
|
+
"claude",
|
|
32419
|
+
"codex",
|
|
32420
|
+
"gemini",
|
|
32421
|
+
"opencode",
|
|
32422
|
+
"aider",
|
|
32423
|
+
"cursor-agent",
|
|
32424
|
+
"cmd",
|
|
32425
|
+
"powershell",
|
|
32426
|
+
"pwsh",
|
|
32427
|
+
"bash",
|
|
32428
|
+
"sh",
|
|
32429
|
+
"zsh",
|
|
32430
|
+
"git",
|
|
32431
|
+
"conhost",
|
|
32432
|
+
"openconsole",
|
|
32433
|
+
"windowsterminal",
|
|
32434
|
+
"wt",
|
|
32435
|
+
"ptyhost",
|
|
32436
|
+
"memgov",
|
|
32437
|
+
"sandboxtools",
|
|
32438
|
+
"sbx-db",
|
|
32439
|
+
"explorer",
|
|
32440
|
+
"csrss",
|
|
32441
|
+
"wininit",
|
|
32442
|
+
"winlogon",
|
|
32443
|
+
"services",
|
|
32444
|
+
"svchost",
|
|
32445
|
+
"lsass",
|
|
32446
|
+
"system",
|
|
32447
|
+
"smss",
|
|
32448
|
+
"dwm"
|
|
32449
|
+
]);
|
|
32450
|
+
var key = (name) => name.toLowerCase().replace(/\.exe$/, "");
|
|
32451
|
+
var isNeverTouched = (name) => NEVER2.has(key(name));
|
|
32452
|
+
var canLower = (name) => !isNeverTouched(name) && (COMPILERS.has(key(name)) || BUILD_TOOLS.has(key(name)));
|
|
32453
|
+
var canPause = (name) => !isNeverTouched(name) && COMPILERS.has(key(name));
|
|
32454
|
+
var INITIAL_STATE = {
|
|
32455
|
+
pressure: false,
|
|
32456
|
+
calm: 0,
|
|
32457
|
+
samples: 0,
|
|
32458
|
+
lowered: {},
|
|
32459
|
+
pausedUntil: 0,
|
|
32460
|
+
nextPauseAt: 0,
|
|
32461
|
+
hostUntil: 0
|
|
32462
|
+
};
|
|
32463
|
+
var PAUSE_MS = 5e3;
|
|
32464
|
+
var PAUSE_COOLDOWN_MS = 1e4;
|
|
32465
|
+
var IDLE_AFTER = 3;
|
|
32466
|
+
var PAUSE_AFTER = 4;
|
|
32467
|
+
var PAUSE_MIN_MB = 300;
|
|
32468
|
+
function decide(prev, sample, nowMs, thresholds, profile) {
|
|
32469
|
+
const ramFree = sample.ramAvailMb / Math.max(1, sample.ramTotalMb) * 100;
|
|
32470
|
+
const commit = (sample.commitLimitMb - sample.commitAvailMb) / Math.max(1, sample.commitLimitMb) * 100;
|
|
32471
|
+
const pcLow = nowMs < prev.hostUntil;
|
|
32472
|
+
const low = ramFree < thresholds.enterAvailablePercent || commit > thresholds.enterCommitPercent || pcLow;
|
|
32473
|
+
const recovered = ramFree > thresholds.exitAvailablePercent && commit < thresholds.exitCommitPercent && !pcLow;
|
|
32474
|
+
let pressure = prev.pressure;
|
|
32475
|
+
let calm = prev.calm;
|
|
32476
|
+
let samples = prev.samples;
|
|
32477
|
+
if (low) {
|
|
32478
|
+
pressure = true;
|
|
32479
|
+
calm = 0;
|
|
32480
|
+
samples = prev.samples + 1;
|
|
32481
|
+
} else if (prev.pressure) {
|
|
32482
|
+
calm = recovered ? prev.calm + 1 : 0;
|
|
32483
|
+
if (calm >= thresholds.calmSamples) {
|
|
32484
|
+
pressure = false;
|
|
32485
|
+
calm = 0;
|
|
32486
|
+
samples = 0;
|
|
32487
|
+
}
|
|
32488
|
+
}
|
|
32489
|
+
const actions = [];
|
|
32490
|
+
const present2 = new Set(sample.procs.map((p) => p.pid));
|
|
32491
|
+
const lowered = {};
|
|
32492
|
+
for (const [pid, to] of Object.entries(prev.lowered)) if (present2.has(Number(pid))) lowered[Number(pid)] = to;
|
|
32493
|
+
if (pressure) {
|
|
32494
|
+
const target = samples > IDLE_AFTER ? "idle" : "below";
|
|
32495
|
+
for (const p of sample.procs) {
|
|
32496
|
+
if (!canLower(p.name) || lowered[p.pid] === target) continue;
|
|
32497
|
+
if (p.prio !== target && !(target === "below" && p.prio === "idle"))
|
|
32498
|
+
actions.push({ kind: "priority", pid: p.pid, name: p.name, to: target });
|
|
32499
|
+
lowered[p.pid] = target;
|
|
32500
|
+
}
|
|
32501
|
+
} else {
|
|
32502
|
+
for (const p of sample.procs) {
|
|
32503
|
+
if (!canLower(p.name)) continue;
|
|
32504
|
+
const base = profile === "gentle" && canPause(p.name) ? "below" : "normal";
|
|
32505
|
+
const was = lowered[p.pid];
|
|
32506
|
+
if (prev.pressure && was !== void 0 && was !== base) {
|
|
32507
|
+
if (p.prio !== base) actions.push({ kind: "priority", pid: p.pid, name: p.name, to: base });
|
|
32508
|
+
if (base === "normal") delete lowered[p.pid];
|
|
32509
|
+
else lowered[p.pid] = base;
|
|
32510
|
+
} else if (!prev.pressure && base === "below" && was === void 0) {
|
|
32511
|
+
if (p.prio === "normal") actions.push({ kind: "priority", pid: p.pid, name: p.name, to: "below" });
|
|
32512
|
+
lowered[p.pid] = "below";
|
|
32513
|
+
}
|
|
32514
|
+
}
|
|
32515
|
+
}
|
|
32516
|
+
let pausedUntil = prev.pausedUntil;
|
|
32517
|
+
let nextPauseAt = prev.nextPauseAt;
|
|
32518
|
+
if (pressure && samples >= PAUSE_AFTER && nowMs >= prev.nextPauseAt && nowMs >= prev.pausedUntil) {
|
|
32519
|
+
const victim = [...sample.procs].filter((p) => canPause(p.name) && p.mb >= PAUSE_MIN_MB).sort((a, b) => b.mb - a.mb)[0];
|
|
32520
|
+
if (victim) {
|
|
32521
|
+
actions.push({ kind: "pause", pid: victim.pid, name: victim.name, ms: PAUSE_MS });
|
|
32522
|
+
pausedUntil = nowMs + PAUSE_MS;
|
|
32523
|
+
nextPauseAt = pausedUntil + PAUSE_COOLDOWN_MS;
|
|
32524
|
+
}
|
|
32525
|
+
}
|
|
32526
|
+
const level = nowMs < pausedUntil ? "suspending" : pressure ? "throttled" : "ok";
|
|
32527
|
+
return {
|
|
32528
|
+
state: { pressure, calm, samples, lowered, pausedUntil, nextPauseAt, hostUntil: prev.hostUntil },
|
|
32529
|
+
actions,
|
|
32530
|
+
level,
|
|
32531
|
+
ramFreePercent: Math.round(ramFree),
|
|
32532
|
+
commitPercent: Math.round(commit)
|
|
32533
|
+
};
|
|
32534
|
+
}
|
|
32535
|
+
|
|
32536
|
+
// src/guest/governor/governor.ts
|
|
32537
|
+
import fs52 from "node:fs";
|
|
32538
|
+
import path68 from "node:path";
|
|
32539
|
+
import { spawn as spawn8 } from "node:child_process";
|
|
32540
|
+
import { createInterface } from "node:readline";
|
|
32541
|
+
var SampleSchema = external_exports.object({
|
|
32542
|
+
ramTotalMb: external_exports.number(),
|
|
32543
|
+
ramAvailMb: external_exports.number(),
|
|
32544
|
+
commitLimitMb: external_exports.number(),
|
|
32545
|
+
commitAvailMb: external_exports.number(),
|
|
32546
|
+
procs: external_exports.array(
|
|
32547
|
+
external_exports.object({
|
|
32548
|
+
pid: external_exports.number().int(),
|
|
32549
|
+
name: external_exports.string().max(128),
|
|
32550
|
+
mb: external_exports.number(),
|
|
32551
|
+
prio: external_exports.enum(["idle", "below", "normal"]).catch("normal")
|
|
32552
|
+
})
|
|
32553
|
+
).max(1024)
|
|
32554
|
+
});
|
|
32555
|
+
var GovernorCore = class {
|
|
32556
|
+
constructor(deps) {
|
|
32557
|
+
this.deps = deps;
|
|
32558
|
+
}
|
|
32559
|
+
deps;
|
|
32560
|
+
state = INITIAL_STATE;
|
|
32561
|
+
lastAction = "";
|
|
32562
|
+
lastWrite = "";
|
|
32563
|
+
lastWriteAt = 0;
|
|
32564
|
+
pausedName = "";
|
|
32565
|
+
pausedPid = 0;
|
|
32566
|
+
hostPressure(seconds, reason) {
|
|
32567
|
+
const until = this.deps.now() + seconds * 1e3;
|
|
32568
|
+
if (until > this.state.hostUntil) {
|
|
32569
|
+
if (this.state.hostUntil <= this.deps.now())
|
|
32570
|
+
this.deps.logLine("governor: this PC is low (" + reason + "); slowing builds down");
|
|
32571
|
+
this.state = { ...this.state, hostUntil: until };
|
|
32572
|
+
}
|
|
32573
|
+
}
|
|
32574
|
+
get current() {
|
|
32575
|
+
return this.state;
|
|
32576
|
+
}
|
|
32577
|
+
onSample(sample) {
|
|
32578
|
+
const nowMs = this.deps.now();
|
|
32579
|
+
const before = this.state.pressure;
|
|
32580
|
+
const d = decide(this.state, sample, nowMs, GUEST_THRESHOLDS[this.deps.profile], this.deps.profile);
|
|
32581
|
+
this.state = d.state;
|
|
32582
|
+
for (const action of d.actions) this.apply(action);
|
|
32583
|
+
if (d.state.pressure !== before)
|
|
32584
|
+
this.deps.logLine(
|
|
32585
|
+
d.state.pressure ? "governor: memory is low (" + d.ramFreePercent + "% RAM free, commit " + d.commitPercent + "% used): slowing builds down" : "governor: memory is fine again: builds back to normal"
|
|
32586
|
+
);
|
|
32587
|
+
const paused = nowMs < d.state.pausedUntil && this.pausedPid ? [{ name: this.pausedName, pid: this.pausedPid, seconds: Math.ceil((d.state.pausedUntil - nowMs) / 1e3) }] : [];
|
|
32588
|
+
const status = {
|
|
32589
|
+
level: d.level,
|
|
32590
|
+
profile: this.deps.profile,
|
|
32591
|
+
ramFreePercent: Math.max(0, Math.min(100, d.ramFreePercent)),
|
|
32592
|
+
commitPercent: Math.max(0, Math.min(100, d.commitPercent)),
|
|
32593
|
+
lowered: Object.keys(d.state.lowered).length,
|
|
32594
|
+
paused,
|
|
32595
|
+
pcLow: nowMs < d.state.hostUntil,
|
|
32596
|
+
lastAction: this.lastAction,
|
|
32597
|
+
updatedAt: now()
|
|
32598
|
+
};
|
|
32599
|
+
const shape = JSON.stringify({ ...status, updatedAt: "", paused: paused.map((p) => p.pid) });
|
|
32600
|
+
if (shape !== this.lastWrite || nowMs - this.lastWriteAt > 6e4) {
|
|
32601
|
+
this.lastWrite = shape;
|
|
32602
|
+
this.lastWriteAt = nowMs;
|
|
32603
|
+
this.deps.saveStatus(status);
|
|
32604
|
+
}
|
|
32605
|
+
}
|
|
32606
|
+
apply(action) {
|
|
32607
|
+
try {
|
|
32608
|
+
if (action.kind === "priority") {
|
|
32609
|
+
this.deps.port.setPriority(action.pid, action.to);
|
|
32610
|
+
this.lastAction = action.name + " (" + action.pid + ") priority " + action.to;
|
|
32611
|
+
} else {
|
|
32612
|
+
this.deps.port.pause(action.pid, action.ms);
|
|
32613
|
+
this.pausedName = action.name;
|
|
32614
|
+
this.pausedPid = action.pid;
|
|
32615
|
+
this.lastAction = "paused " + action.name + " (" + action.pid + ") for " + action.ms / 1e3 + " s";
|
|
32616
|
+
this.deps.logLine("governor: " + this.lastAction);
|
|
32617
|
+
return;
|
|
32618
|
+
}
|
|
32619
|
+
this.deps.logLine("governor: " + this.lastAction);
|
|
32620
|
+
} catch (e) {
|
|
32621
|
+
warn("governor: " + errMsg(e));
|
|
32622
|
+
}
|
|
32623
|
+
}
|
|
32624
|
+
};
|
|
32625
|
+
var MemGovProcess = class {
|
|
32626
|
+
constructor(onSample) {
|
|
32627
|
+
this.onSample = onSample;
|
|
32628
|
+
}
|
|
32629
|
+
onSample;
|
|
32630
|
+
child = null;
|
|
32631
|
+
start() {
|
|
32632
|
+
try {
|
|
32633
|
+
const child = spawn8(ensureCompiled("memgov"), ["serve", "--interval", "2"], {
|
|
32634
|
+
stdio: ["pipe", "pipe", "ignore"],
|
|
32635
|
+
windowsHide: true
|
|
32636
|
+
});
|
|
32637
|
+
this.child = child;
|
|
32638
|
+
createInterface({ input: child.stdout }).on("line", (line) => {
|
|
32639
|
+
try {
|
|
32640
|
+
this.onSample(SampleSchema.parse(JSON.parse(line)));
|
|
32641
|
+
} catch (e) {
|
|
32642
|
+
warn("governor: bad sample: " + errMsg(e));
|
|
32643
|
+
}
|
|
32644
|
+
});
|
|
32645
|
+
child.stdin.on("error", () => void 0);
|
|
32646
|
+
child.once("exit", () => {
|
|
32647
|
+
this.child = null;
|
|
32648
|
+
setTimeout(() => this.start(), 3e4).unref();
|
|
32649
|
+
});
|
|
32650
|
+
} catch (e) {
|
|
32651
|
+
warn("governor: could not start memgov.exe (no memory governor): " + errMsg(e));
|
|
32652
|
+
}
|
|
32653
|
+
}
|
|
32654
|
+
setPriority(pid, to) {
|
|
32655
|
+
this.child?.stdin?.write("priority " + pid + " " + to + "\n");
|
|
32656
|
+
}
|
|
32657
|
+
pause(pid, ms) {
|
|
32658
|
+
this.child?.stdin?.write("suspend " + pid + " " + ms + "\n");
|
|
32659
|
+
}
|
|
32660
|
+
};
|
|
32661
|
+
function appendToMemoryLog(line) {
|
|
32662
|
+
try {
|
|
32663
|
+
const logs = path68.join(dataDir, "logs");
|
|
32664
|
+
const newest = fs52.readdirSync(logs).filter((f) => /^memory-\d{8}-\d{6}\.log$/.test(f)).sort().pop();
|
|
32665
|
+
if (!newest) return;
|
|
32666
|
+
const t = /* @__PURE__ */ new Date();
|
|
32667
|
+
const stamp = [t.getHours(), t.getMinutes(), t.getSeconds()].map((n) => String(n).padStart(2, "0")).join(":");
|
|
32668
|
+
fs52.appendFileSync(path68.join(logs, newest), stamp + " | " + line + "\r\n");
|
|
32669
|
+
} catch {
|
|
32670
|
+
}
|
|
32671
|
+
}
|
|
32672
|
+
var Governor = class {
|
|
32673
|
+
core = null;
|
|
32674
|
+
describe() {
|
|
32675
|
+
const profile = session.loadProfile === "gentle" ? "gentle" : "normal";
|
|
32676
|
+
const t = GUEST_THRESHOLDS[profile];
|
|
32677
|
+
return session.pressureResponse === false ? "off (sandbox.pressureResponse)" : profile + " profile: slows builds down below " + t.enterAvailablePercent + "% free RAM or above " + t.enterCommitPercent + "% commit";
|
|
32678
|
+
}
|
|
32679
|
+
start() {
|
|
32680
|
+
if (session.pressureResponse === false) return;
|
|
32681
|
+
const profile = session.loadProfile === "gentle" ? "gentle" : "normal";
|
|
32682
|
+
const proc = new MemGovProcess((s) => this.core?.onSample(s));
|
|
32683
|
+
this.core = new GovernorCore({
|
|
32684
|
+
port: proc,
|
|
32685
|
+
profile,
|
|
32686
|
+
now: () => Date.now(),
|
|
32687
|
+
logLine: appendToMemoryLog,
|
|
32688
|
+
saveStatus: (status) => {
|
|
32689
|
+
try {
|
|
32690
|
+
writeJsonAtomic(run.pressureFile, status);
|
|
32691
|
+
} catch (e) {
|
|
32692
|
+
warn("governor: could not write its status: " + errMsg(e));
|
|
32693
|
+
}
|
|
32694
|
+
}
|
|
32695
|
+
});
|
|
32696
|
+
proc.start();
|
|
32697
|
+
}
|
|
32698
|
+
/** The host's watchdog: this PC is low for a while. */
|
|
32699
|
+
hostPressure(seconds, reason) {
|
|
32700
|
+
this.core?.hostPressure(seconds, reason);
|
|
32701
|
+
}
|
|
32702
|
+
};
|
|
32703
|
+
var governor = new Governor();
|
|
32704
|
+
|
|
32275
32705
|
// src/guest/daemon/daemon.ts
|
|
32276
32706
|
var POLL_MS = 400;
|
|
32277
32707
|
var MEM_SAVE_MS = 12e4;
|
|
@@ -32290,9 +32720,9 @@ var Daemon = class {
|
|
|
32290
32720
|
tick() {
|
|
32291
32721
|
const { valid, invalid } = run.scanRequests();
|
|
32292
32722
|
for (const file3 of invalid)
|
|
32293
|
-
safely("removing an invalid request", () =>
|
|
32723
|
+
safely("removing an invalid request", () => fs53.rmSync(file3, { recursive: true, force: true }));
|
|
32294
32724
|
for (const req of valid) {
|
|
32295
|
-
safely("claiming a request", () =>
|
|
32725
|
+
safely("claiming a request", () => fs53.rmSync(run.requestFile(req.id), { force: true }));
|
|
32296
32726
|
if (run.readSession(req.id)) continue;
|
|
32297
32727
|
void Promise.resolve(this.handle(withRequestSecrets(req))).catch(
|
|
32298
32728
|
(e) => respond(req.id, { ok: false, message: errMsg(e) })
|
|
@@ -32314,6 +32744,8 @@ var Daemon = class {
|
|
|
32314
32744
|
return execCommand(req);
|
|
32315
32745
|
case "restart":
|
|
32316
32746
|
return sessions.restart(req);
|
|
32747
|
+
case "pressure":
|
|
32748
|
+
return governor.hostPressure(req.seconds, req.reason);
|
|
32317
32749
|
case "ping":
|
|
32318
32750
|
return respond(req.id, { ok: true, message: "pong (" + sessions.count + " session(s) running)" });
|
|
32319
32751
|
}
|
|
@@ -32327,4 +32759,6 @@ adoptBootSecrets();
|
|
|
32327
32759
|
log("Session daemon started (pid " + process.pid + ").");
|
|
32328
32760
|
safely("port forwards", startRelays);
|
|
32329
32761
|
safely("audit", startProcessCollector);
|
|
32762
|
+
safely("memory governor", () => governor.start());
|
|
32763
|
+
log("Memory governor: " + governor.describe());
|
|
32330
32764
|
new Daemon().start();
|