@tianshu-ai/tianshu 0.3.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/LICENSE +200 -0
- package/README.md +284 -0
- package/README.zh-CN.md +136 -0
- package/bin/tianshu.mjs +32 -0
- package/package.json +60 -0
- package/packages/plugin-sdk/dist/agent-loop.d.ts +96 -0
- package/packages/plugin-sdk/dist/agent-loop.d.ts.map +1 -0
- package/packages/plugin-sdk/dist/agent-loop.js +11 -0
- package/packages/plugin-sdk/dist/agent-loop.js.map +1 -0
- package/packages/plugin-sdk/dist/capabilities.d.ts +48 -0
- package/packages/plugin-sdk/dist/capabilities.d.ts.map +1 -0
- package/packages/plugin-sdk/dist/capabilities.js +61 -0
- package/packages/plugin-sdk/dist/capabilities.js.map +1 -0
- package/packages/plugin-sdk/dist/catalog.d.ts +60 -0
- package/packages/plugin-sdk/dist/catalog.d.ts.map +1 -0
- package/packages/plugin-sdk/dist/catalog.js +11 -0
- package/packages/plugin-sdk/dist/catalog.js.map +1 -0
- package/packages/plugin-sdk/dist/client.d.ts +171 -0
- package/packages/plugin-sdk/dist/client.d.ts.map +1 -0
- package/packages/plugin-sdk/dist/client.js +96 -0
- package/packages/plugin-sdk/dist/client.js.map +1 -0
- package/packages/plugin-sdk/dist/index.d.ts +9 -0
- package/packages/plugin-sdk/dist/index.d.ts.map +1 -0
- package/packages/plugin-sdk/dist/index.js +19 -0
- package/packages/plugin-sdk/dist/index.js.map +1 -0
- package/packages/plugin-sdk/dist/lsp.d.ts +32 -0
- package/packages/plugin-sdk/dist/lsp.d.ts.map +1 -0
- package/packages/plugin-sdk/dist/lsp.js +19 -0
- package/packages/plugin-sdk/dist/lsp.js.map +1 -0
- package/packages/plugin-sdk/dist/manifest.d.ts +423 -0
- package/packages/plugin-sdk/dist/manifest.d.ts.map +1 -0
- package/packages/plugin-sdk/dist/manifest.js +7 -0
- package/packages/plugin-sdk/dist/manifest.js.map +1 -0
- package/packages/plugin-sdk/dist/mcp-client.d.ts +74 -0
- package/packages/plugin-sdk/dist/mcp-client.d.ts.map +1 -0
- package/packages/plugin-sdk/dist/mcp-client.js +226 -0
- package/packages/plugin-sdk/dist/mcp-client.js.map +1 -0
- package/packages/plugin-sdk/dist/mcp-fetch.d.ts +10 -0
- package/packages/plugin-sdk/dist/mcp-fetch.d.ts.map +1 -0
- package/packages/plugin-sdk/dist/mcp-fetch.js +130 -0
- package/packages/plugin-sdk/dist/mcp-fetch.js.map +1 -0
- package/packages/plugin-sdk/dist/mcp-toolset.d.ts +128 -0
- package/packages/plugin-sdk/dist/mcp-toolset.d.ts.map +1 -0
- package/packages/plugin-sdk/dist/mcp-toolset.js +246 -0
- package/packages/plugin-sdk/dist/mcp-toolset.js.map +1 -0
- package/packages/plugin-sdk/dist/server.d.ts +486 -0
- package/packages/plugin-sdk/dist/server.d.ts.map +1 -0
- package/packages/plugin-sdk/dist/server.js +10 -0
- package/packages/plugin-sdk/dist/server.js.map +1 -0
- package/packages/plugin-sdk/dist/session-inbox.d.ts +56 -0
- package/packages/plugin-sdk/dist/session-inbox.d.ts.map +1 -0
- package/packages/plugin-sdk/dist/session-inbox.js +12 -0
- package/packages/plugin-sdk/dist/session-inbox.js.map +1 -0
- package/packages/plugin-sdk/package.json +36 -0
- package/packages/server/builtinConfig/plugins/README.md +1 -0
- package/packages/server/builtinConfig/plugins/files/manifest.json +100 -0
- package/packages/server/builtinConfig/plugins/files/skills/files-workspace-layout.md +29 -0
- package/packages/server/builtinConfig/plugins/microsandbox/manifest.json +177 -0
- package/packages/server/builtinConfig/plugins/microsandbox/skills/microsandbox-browser-howto.md +155 -0
- package/packages/server/builtinConfig/plugins/microsandbox/skills/microsandbox-build-use.md +201 -0
- package/packages/server/builtinConfig/plugins/microsandbox/skills/microsandbox-config.md +38 -0
- package/packages/server/builtinConfig/plugins/microsandbox/skills/microsandbox-exec-howto.md +144 -0
- package/packages/server/builtinConfig/plugins/microsandbox/skills/microsandbox-libreoffice.md +159 -0
- package/packages/server/builtinConfig/plugins/microsandbox/skills/microsandbox-main-orchestration.md +75 -0
- package/packages/server/builtinConfig/plugins/microsandbox/templates/README.md +26 -0
- package/packages/server/builtinConfig/plugins/microsandbox/templates/browser.yaml +105 -0
- package/packages/server/builtinConfig/plugins/microsandbox/templates/task-runner-with-browser.yaml +80 -0
- package/packages/server/builtinConfig/plugins/microsandbox/templates/task-runner.yaml +80 -0
- package/packages/server/builtinConfig/plugins/web-search/manifest.json +65 -0
- package/packages/server/builtinConfig/plugins/web-search/skills/web-search-howto.md +69 -0
- package/packages/server/builtinConfig/plugins/workboard/agent-seeds/echo-demo/agent.json +7 -0
- package/packages/server/builtinConfig/plugins/workboard/agent-seeds/llm-default/SOUL.md +53 -0
- package/packages/server/builtinConfig/plugins/workboard/agent-seeds/llm-default/agent.json +7 -0
- package/packages/server/builtinConfig/plugins/workboard/manifest.json +180 -0
- package/packages/server/builtinConfig/plugins/workboard/skills/large-input-large-output.md +185 -0
- package/packages/server/builtinConfig/plugins/workboard/skills/workboard-howto.md +166 -0
- package/packages/server/builtinConfig/plugins/workboard/skills/worker-creator.md +267 -0
- package/packages/server/builtinConfig/plugins/workboard/skills/worker-fleet.md +431 -0
- package/packages/server/dist/catalog.d.ts +52 -0
- package/packages/server/dist/catalog.d.ts.map +1 -0
- package/packages/server/dist/catalog.js +189 -0
- package/packages/server/dist/catalog.js.map +1 -0
- package/packages/server/dist/chat/active-harnesses.d.ts +34 -0
- package/packages/server/dist/chat/active-harnesses.d.ts.map +1 -0
- package/packages/server/dist/chat/active-harnesses.js +118 -0
- package/packages/server/dist/chat/active-harnesses.js.map +1 -0
- package/packages/server/dist/chat/agent-loop.d.ts +64 -0
- package/packages/server/dist/chat/agent-loop.d.ts.map +1 -0
- package/packages/server/dist/chat/agent-loop.js +597 -0
- package/packages/server/dist/chat/agent-loop.js.map +1 -0
- package/packages/server/dist/chat/agent-tool-adapter.d.ts +33 -0
- package/packages/server/dist/chat/agent-tool-adapter.d.ts.map +1 -0
- package/packages/server/dist/chat/agent-tool-adapter.js +260 -0
- package/packages/server/dist/chat/agent-tool-adapter.js.map +1 -0
- package/packages/server/dist/chat/compact.d.ts +52 -0
- package/packages/server/dist/chat/compact.d.ts.map +1 -0
- package/packages/server/dist/chat/compact.js +248 -0
- package/packages/server/dist/chat/compact.js.map +1 -0
- package/packages/server/dist/chat/dump-system-prompt.d.ts +17 -0
- package/packages/server/dist/chat/dump-system-prompt.d.ts.map +1 -0
- package/packages/server/dist/chat/dump-system-prompt.js +58 -0
- package/packages/server/dist/chat/dump-system-prompt.js.map +1 -0
- package/packages/server/dist/chat/handler.d.ts +186 -0
- package/packages/server/dist/chat/handler.d.ts.map +1 -0
- package/packages/server/dist/chat/handler.js +1248 -0
- package/packages/server/dist/chat/handler.js.map +1 -0
- package/packages/server/dist/chat/image-fit.d.ts +34 -0
- package/packages/server/dist/chat/image-fit.d.ts.map +1 -0
- package/packages/server/dist/chat/image-fit.js +157 -0
- package/packages/server/dist/chat/image-fit.js.map +1 -0
- package/packages/server/dist/chat/messages.d.ts +118 -0
- package/packages/server/dist/chat/messages.d.ts.map +1 -0
- package/packages/server/dist/chat/messages.js +341 -0
- package/packages/server/dist/chat/messages.js.map +1 -0
- package/packages/server/dist/chat/session-inbox.d.ts +114 -0
- package/packages/server/dist/chat/session-inbox.d.ts.map +1 -0
- package/packages/server/dist/chat/session-inbox.js +418 -0
- package/packages/server/dist/chat/session-inbox.js.map +1 -0
- package/packages/server/dist/chat/sqlite-session-repo.d.ts +26 -0
- package/packages/server/dist/chat/sqlite-session-repo.d.ts.map +1 -0
- package/packages/server/dist/chat/sqlite-session-repo.js +132 -0
- package/packages/server/dist/chat/sqlite-session-repo.js.map +1 -0
- package/packages/server/dist/chat/sqlite-session-storage.d.ts +83 -0
- package/packages/server/dist/chat/sqlite-session-storage.d.ts.map +1 -0
- package/packages/server/dist/chat/sqlite-session-storage.js +418 -0
- package/packages/server/dist/chat/sqlite-session-storage.js.map +1 -0
- package/packages/server/dist/chat/stub-execution-env.d.ts +3 -0
- package/packages/server/dist/chat/stub-execution-env.d.ts.map +1 -0
- package/packages/server/dist/chat/stub-execution-env.js +87 -0
- package/packages/server/dist/chat/stub-execution-env.js.map +1 -0
- package/packages/server/dist/chat/token-estimate.d.ts +11 -0
- package/packages/server/dist/chat/token-estimate.d.ts.map +1 -0
- package/packages/server/dist/chat/token-estimate.js +67 -0
- package/packages/server/dist/chat/token-estimate.js.map +1 -0
- package/packages/server/dist/chat/ws-protocol.d.ts +244 -0
- package/packages/server/dist/chat/ws-protocol.d.ts.map +1 -0
- package/packages/server/dist/chat/ws-protocol.js +193 -0
- package/packages/server/dist/chat/ws-protocol.js.map +1 -0
- package/packages/server/dist/cli.d.ts +9 -0
- package/packages/server/dist/cli.d.ts.map +1 -0
- package/packages/server/dist/cli.js +329 -0
- package/packages/server/dist/cli.js.map +1 -0
- package/packages/server/dist/core/agent-seeds.d.ts +25 -0
- package/packages/server/dist/core/agent-seeds.d.ts.map +1 -0
- package/packages/server/dist/core/agent-seeds.js +69 -0
- package/packages/server/dist/core/agent-seeds.js.map +1 -0
- package/packages/server/dist/core/config.d.ts +172 -0
- package/packages/server/dist/core/config.d.ts.map +1 -0
- package/packages/server/dist/core/config.js +155 -0
- package/packages/server/dist/core/config.js.map +1 -0
- package/packages/server/dist/core/db-pool.d.ts +32 -0
- package/packages/server/dist/core/db-pool.d.ts.map +1 -0
- package/packages/server/dist/core/db-pool.js +108 -0
- package/packages/server/dist/core/db-pool.js.map +1 -0
- package/packages/server/dist/core/dev-mode.d.ts +13 -0
- package/packages/server/dist/core/dev-mode.d.ts.map +1 -0
- package/packages/server/dist/core/dev-mode.js +51 -0
- package/packages/server/dist/core/dev-mode.js.map +1 -0
- package/packages/server/dist/core/global-ops.d.ts +54 -0
- package/packages/server/dist/core/global-ops.d.ts.map +1 -0
- package/packages/server/dist/core/global-ops.js +143 -0
- package/packages/server/dist/core/global-ops.js.map +1 -0
- package/packages/server/dist/core/identity-resolvers.d.ts +102 -0
- package/packages/server/dist/core/identity-resolvers.d.ts.map +1 -0
- package/packages/server/dist/core/identity-resolvers.js +176 -0
- package/packages/server/dist/core/identity-resolvers.js.map +1 -0
- package/packages/server/dist/core/index.d.ts +13 -0
- package/packages/server/dist/core/index.d.ts.map +1 -0
- package/packages/server/dist/core/index.js +18 -0
- package/packages/server/dist/core/index.js.map +1 -0
- package/packages/server/dist/core/llm.d.ts +45 -0
- package/packages/server/dist/core/llm.d.ts.map +1 -0
- package/packages/server/dist/core/llm.js +140 -0
- package/packages/server/dist/core/llm.js.map +1 -0
- package/packages/server/dist/core/mcp-manager.d.ts +47 -0
- package/packages/server/dist/core/mcp-manager.d.ts.map +1 -0
- package/packages/server/dist/core/mcp-manager.js +129 -0
- package/packages/server/dist/core/mcp-manager.js.map +1 -0
- package/packages/server/dist/core/middleware.d.ts +31 -0
- package/packages/server/dist/core/middleware.d.ts.map +1 -0
- package/packages/server/dist/core/middleware.js +102 -0
- package/packages/server/dist/core/middleware.js.map +1 -0
- package/packages/server/dist/core/migrations/001-initial.d.ts +4 -0
- package/packages/server/dist/core/migrations/001-initial.d.ts.map +1 -0
- package/packages/server/dist/core/migrations/001-initial.js +66 -0
- package/packages/server/dist/core/migrations/001-initial.js.map +1 -0
- package/packages/server/dist/core/migrations/002-task-dependencies.d.ts +4 -0
- package/packages/server/dist/core/migrations/002-task-dependencies.d.ts.map +1 -0
- package/packages/server/dist/core/migrations/002-task-dependencies.js +20 -0
- package/packages/server/dist/core/migrations/002-task-dependencies.js.map +1 -0
- package/packages/server/dist/core/migrations/003-session-tree.d.ts +4 -0
- package/packages/server/dist/core/migrations/003-session-tree.d.ts.map +1 -0
- package/packages/server/dist/core/migrations/003-session-tree.js +96 -0
- package/packages/server/dist/core/migrations/003-session-tree.js.map +1 -0
- package/packages/server/dist/core/migrations/003-worker-agents.d.ts +4 -0
- package/packages/server/dist/core/migrations/003-worker-agents.d.ts.map +1 -0
- package/packages/server/dist/core/migrations/003-worker-agents.js +65 -0
- package/packages/server/dist/core/migrations/003-worker-agents.js.map +1 -0
- package/packages/server/dist/core/migrations/004-rebuild-message-chain.d.ts +4 -0
- package/packages/server/dist/core/migrations/004-rebuild-message-chain.d.ts.map +1 -0
- package/packages/server/dist/core/migrations/004-rebuild-message-chain.js +52 -0
- package/packages/server/dist/core/migrations/004-rebuild-message-chain.js.map +1 -0
- package/packages/server/dist/core/migrations/005-task-status-rename.d.ts +4 -0
- package/packages/server/dist/core/migrations/005-task-status-rename.d.ts.map +1 -0
- package/packages/server/dist/core/migrations/005-task-status-rename.js +64 -0
- package/packages/server/dist/core/migrations/005-task-status-rename.js.map +1 -0
- package/packages/server/dist/core/migrations/006-task-labels.d.ts +4 -0
- package/packages/server/dist/core/migrations/006-task-labels.d.ts.map +1 -0
- package/packages/server/dist/core/migrations/006-task-labels.js +43 -0
- package/packages/server/dist/core/migrations/006-task-labels.js.map +1 -0
- package/packages/server/dist/core/migrations/007-session-inbox.d.ts +4 -0
- package/packages/server/dist/core/migrations/007-session-inbox.d.ts.map +1 -0
- package/packages/server/dist/core/migrations/007-session-inbox.js +67 -0
- package/packages/server/dist/core/migrations/007-session-inbox.js.map +1 -0
- package/packages/server/dist/core/migrations/008-task-intervention.d.ts +4 -0
- package/packages/server/dist/core/migrations/008-task-intervention.d.ts.map +1 -0
- package/packages/server/dist/core/migrations/008-task-intervention.js +60 -0
- package/packages/server/dist/core/migrations/008-task-intervention.js.map +1 -0
- package/packages/server/dist/core/migrations/index.d.ts +12 -0
- package/packages/server/dist/core/migrations/index.d.ts.map +1 -0
- package/packages/server/dist/core/migrations/index.js +58 -0
- package/packages/server/dist/core/migrations/index.js.map +1 -0
- package/packages/server/dist/core/paths.d.ts +53 -0
- package/packages/server/dist/core/paths.d.ts.map +1 -0
- package/packages/server/dist/core/paths.js +125 -0
- package/packages/server/dist/core/paths.js.map +1 -0
- package/packages/server/dist/core/plugins/builtin-loader.d.ts +56 -0
- package/packages/server/dist/core/plugins/builtin-loader.d.ts.map +1 -0
- package/packages/server/dist/core/plugins/builtin-loader.js +153 -0
- package/packages/server/dist/core/plugins/builtin-loader.js.map +1 -0
- package/packages/server/dist/core/plugins/discovery.d.ts +28 -0
- package/packages/server/dist/core/plugins/discovery.d.ts.map +1 -0
- package/packages/server/dist/core/plugins/discovery.js +97 -0
- package/packages/server/dist/core/plugins/discovery.js.map +1 -0
- package/packages/server/dist/core/plugins/index.d.ts +6 -0
- package/packages/server/dist/core/plugins/index.d.ts.map +1 -0
- package/packages/server/dist/core/plugins/index.js +6 -0
- package/packages/server/dist/core/plugins/index.js.map +1 -0
- package/packages/server/dist/core/plugins/manifest.d.ts +9 -0
- package/packages/server/dist/core/plugins/manifest.d.ts.map +1 -0
- package/packages/server/dist/core/plugins/manifest.js +584 -0
- package/packages/server/dist/core/plugins/manifest.js.map +1 -0
- package/packages/server/dist/core/plugins/registry.d.ts +269 -0
- package/packages/server/dist/core/plugins/registry.d.ts.map +1 -0
- package/packages/server/dist/core/plugins/registry.js +1003 -0
- package/packages/server/dist/core/plugins/registry.js.map +1 -0
- package/packages/server/dist/core/plugins/secrets.d.ts +46 -0
- package/packages/server/dist/core/plugins/secrets.d.ts.map +1 -0
- package/packages/server/dist/core/plugins/secrets.js +174 -0
- package/packages/server/dist/core/plugins/secrets.js.map +1 -0
- package/packages/server/dist/core/plugins/skills.d.ts +131 -0
- package/packages/server/dist/core/plugins/skills.d.ts.map +1 -0
- package/packages/server/dist/core/plugins/skills.js +389 -0
- package/packages/server/dist/core/plugins/skills.js.map +1 -0
- package/packages/server/dist/core/templates.d.ts +28 -0
- package/packages/server/dist/core/templates.d.ts.map +1 -0
- package/packages/server/dist/core/templates.js +103 -0
- package/packages/server/dist/core/templates.js.map +1 -0
- package/packages/server/dist/core/tenant-context.d.ts +18 -0
- package/packages/server/dist/core/tenant-context.d.ts.map +1 -0
- package/packages/server/dist/core/tenant-context.js +42 -0
- package/packages/server/dist/core/tenant-context.js.map +1 -0
- package/packages/server/dist/core/tenant-id.d.ts +8 -0
- package/packages/server/dist/core/tenant-id.d.ts.map +1 -0
- package/packages/server/dist/core/tenant-id.js +53 -0
- package/packages/server/dist/core/tenant-id.js.map +1 -0
- package/packages/server/dist/core/tenant-skills.d.ts +29 -0
- package/packages/server/dist/core/tenant-skills.d.ts.map +1 -0
- package/packages/server/dist/core/tenant-skills.js +77 -0
- package/packages/server/dist/core/tenant-skills.js.map +1 -0
- package/packages/server/dist/core/worker-agents-fs.d.ts +44 -0
- package/packages/server/dist/core/worker-agents-fs.d.ts.map +1 -0
- package/packages/server/dist/core/worker-agents-fs.js +86 -0
- package/packages/server/dist/core/worker-agents-fs.js.map +1 -0
- package/packages/server/dist/core/worker-agents.d.ts +77 -0
- package/packages/server/dist/core/worker-agents.d.ts.map +1 -0
- package/packages/server/dist/core/worker-agents.js +191 -0
- package/packages/server/dist/core/worker-agents.js.map +1 -0
- package/packages/server/dist/index.d.ts +2 -0
- package/packages/server/dist/index.d.ts.map +1 -0
- package/packages/server/dist/index.js +623 -0
- package/packages/server/dist/index.js.map +1 -0
- package/packages/server/dist/lsp/client.d.ts +53 -0
- package/packages/server/dist/lsp/client.d.ts.map +1 -0
- package/packages/server/dist/lsp/client.js +258 -0
- package/packages/server/dist/lsp/client.js.map +1 -0
- package/packages/server/dist/lsp/format.d.ts +13 -0
- package/packages/server/dist/lsp/format.d.ts.map +1 -0
- package/packages/server/dist/lsp/format.js +55 -0
- package/packages/server/dist/lsp/format.js.map +1 -0
- package/packages/server/dist/lsp/index.d.ts +20 -0
- package/packages/server/dist/lsp/index.d.ts.map +1 -0
- package/packages/server/dist/lsp/index.js +32 -0
- package/packages/server/dist/lsp/index.js.map +1 -0
- package/packages/server/dist/lsp/language-registry.d.ts +29 -0
- package/packages/server/dist/lsp/language-registry.d.ts.map +1 -0
- package/packages/server/dist/lsp/language-registry.js +62 -0
- package/packages/server/dist/lsp/language-registry.js.map +1 -0
- package/packages/server/dist/lsp/manager.d.ts +77 -0
- package/packages/server/dist/lsp/manager.d.ts.map +1 -0
- package/packages/server/dist/lsp/manager.js +300 -0
- package/packages/server/dist/lsp/manager.js.map +1 -0
- package/packages/server/dist/plugins-routes.d.ts +96 -0
- package/packages/server/dist/plugins-routes.d.ts.map +1 -0
- package/packages/server/dist/plugins-routes.js +627 -0
- package/packages/server/dist/plugins-routes.js.map +1 -0
- package/packages/server/dist/setup/checks/config.d.ts +9 -0
- package/packages/server/dist/setup/checks/config.d.ts.map +1 -0
- package/packages/server/dist/setup/checks/config.js +66 -0
- package/packages/server/dist/setup/checks/config.js.map +1 -0
- package/packages/server/dist/setup/checks/db.d.ts +6 -0
- package/packages/server/dist/setup/checks/db.d.ts.map +1 -0
- package/packages/server/dist/setup/checks/db.js +79 -0
- package/packages/server/dist/setup/checks/db.js.map +1 -0
- package/packages/server/dist/setup/checks/known-models.d.ts +18 -0
- package/packages/server/dist/setup/checks/known-models.d.ts.map +1 -0
- package/packages/server/dist/setup/checks/known-models.js +119 -0
- package/packages/server/dist/setup/checks/known-models.js.map +1 -0
- package/packages/server/dist/setup/checks/network.d.ts +11 -0
- package/packages/server/dist/setup/checks/network.d.ts.map +1 -0
- package/packages/server/dist/setup/checks/network.js +176 -0
- package/packages/server/dist/setup/checks/network.js.map +1 -0
- package/packages/server/dist/setup/checks/plugins.d.ts +9 -0
- package/packages/server/dist/setup/checks/plugins.d.ts.map +1 -0
- package/packages/server/dist/setup/checks/plugins.js +194 -0
- package/packages/server/dist/setup/checks/plugins.js.map +1 -0
- package/packages/server/dist/setup/checks/providers.d.ts +12 -0
- package/packages/server/dist/setup/checks/providers.d.ts.map +1 -0
- package/packages/server/dist/setup/checks/providers.js +368 -0
- package/packages/server/dist/setup/checks/providers.js.map +1 -0
- package/packages/server/dist/setup/checks/runtime.d.ts +3 -0
- package/packages/server/dist/setup/checks/runtime.d.ts.map +1 -0
- package/packages/server/dist/setup/checks/runtime.js +44 -0
- package/packages/server/dist/setup/checks/runtime.js.map +1 -0
- package/packages/server/dist/setup/checks/sandbox.d.ts +9 -0
- package/packages/server/dist/setup/checks/sandbox.d.ts.map +1 -0
- package/packages/server/dist/setup/checks/sandbox.js +110 -0
- package/packages/server/dist/setup/checks/sandbox.js.map +1 -0
- package/packages/server/dist/setup/checks/tenants.d.ts +9 -0
- package/packages/server/dist/setup/checks/tenants.d.ts.map +1 -0
- package/packages/server/dist/setup/checks/tenants.js +509 -0
- package/packages/server/dist/setup/checks/tenants.js.map +1 -0
- package/packages/server/dist/setup/cli-agent.d.ts +39 -0
- package/packages/server/dist/setup/cli-agent.d.ts.map +1 -0
- package/packages/server/dist/setup/cli-agent.js +1353 -0
- package/packages/server/dist/setup/cli-agent.js.map +1 -0
- package/packages/server/dist/setup/doctor.d.ts +32 -0
- package/packages/server/dist/setup/doctor.d.ts.map +1 -0
- package/packages/server/dist/setup/doctor.js +80 -0
- package/packages/server/dist/setup/doctor.js.map +1 -0
- package/packages/server/dist/setup/launchd.d.ts +107 -0
- package/packages/server/dist/setup/launchd.d.ts.map +1 -0
- package/packages/server/dist/setup/launchd.js +309 -0
- package/packages/server/dist/setup/launchd.js.map +1 -0
- package/packages/server/dist/setup/load-env.d.ts +21 -0
- package/packages/server/dist/setup/load-env.d.ts.map +1 -0
- package/packages/server/dist/setup/load-env.js +88 -0
- package/packages/server/dist/setup/load-env.js.map +1 -0
- package/packages/server/dist/setup/probe-default-model.d.ts +28 -0
- package/packages/server/dist/setup/probe-default-model.d.ts.map +1 -0
- package/packages/server/dist/setup/probe-default-model.js +133 -0
- package/packages/server/dist/setup/probe-default-model.js.map +1 -0
- package/packages/server/dist/setup/render.d.ts +28 -0
- package/packages/server/dist/setup/render.d.ts.map +1 -0
- package/packages/server/dist/setup/render.js +60 -0
- package/packages/server/dist/setup/render.js.map +1 -0
- package/packages/server/dist/setup/repo-root.d.ts +3 -0
- package/packages/server/dist/setup/repo-root.d.ts.map +1 -0
- package/packages/server/dist/setup/repo-root.js +43 -0
- package/packages/server/dist/setup/repo-root.js.map +1 -0
- package/packages/server/dist/setup/service.d.ts +60 -0
- package/packages/server/dist/setup/service.d.ts.map +1 -0
- package/packages/server/dist/setup/service.js +345 -0
- package/packages/server/dist/setup/service.js.map +1 -0
- package/packages/server/dist/setup/start-server.d.ts +23 -0
- package/packages/server/dist/setup/start-server.d.ts.map +1 -0
- package/packages/server/dist/setup/start-server.js +465 -0
- package/packages/server/dist/setup/start-server.js.map +1 -0
- package/packages/server/dist/setup/wizard.d.ts +59 -0
- package/packages/server/dist/setup/wizard.d.ts.map +1 -0
- package/packages/server/dist/setup/wizard.js +556 -0
- package/packages/server/dist/setup/wizard.js.map +1 -0
- package/packages/server/dist/tools/edit-file.d.ts +13 -0
- package/packages/server/dist/tools/edit-file.d.ts.map +1 -0
- package/packages/server/dist/tools/edit-file.js +90 -0
- package/packages/server/dist/tools/edit-file.js.map +1 -0
- package/packages/server/dist/tools/glob.d.ts +12 -0
- package/packages/server/dist/tools/glob.d.ts.map +1 -0
- package/packages/server/dist/tools/glob.js +82 -0
- package/packages/server/dist/tools/glob.js.map +1 -0
- package/packages/server/dist/tools/index.d.ts +82 -0
- package/packages/server/dist/tools/index.d.ts.map +1 -0
- package/packages/server/dist/tools/index.js +72 -0
- package/packages/server/dist/tools/index.js.map +1 -0
- package/packages/server/dist/tools/list-dir.d.ts +24 -0
- package/packages/server/dist/tools/list-dir.d.ts.map +1 -0
- package/packages/server/dist/tools/list-dir.js +99 -0
- package/packages/server/dist/tools/list-dir.js.map +1 -0
- package/packages/server/dist/tools/path-helper.d.ts +15 -0
- package/packages/server/dist/tools/path-helper.d.ts.map +1 -0
- package/packages/server/dist/tools/path-helper.js +72 -0
- package/packages/server/dist/tools/path-helper.js.map +1 -0
- package/packages/server/dist/tools/read-file.d.ts +17 -0
- package/packages/server/dist/tools/read-file.d.ts.map +1 -0
- package/packages/server/dist/tools/read-file.js +94 -0
- package/packages/server/dist/tools/read-file.js.map +1 -0
- package/packages/server/dist/tools/sandbox.d.ts +57 -0
- package/packages/server/dist/tools/sandbox.d.ts.map +1 -0
- package/packages/server/dist/tools/sandbox.js +291 -0
- package/packages/server/dist/tools/sandbox.js.map +1 -0
- package/packages/server/dist/tools/write-file.d.ts +12 -0
- package/packages/server/dist/tools/write-file.d.ts.map +1 -0
- package/packages/server/dist/tools/write-file.js +67 -0
- package/packages/server/dist/tools/write-file.js.map +1 -0
- package/packages/server/dist/worker-agents-routes.d.ts +11 -0
- package/packages/server/dist/worker-agents-routes.d.ts.map +1 -0
- package/packages/server/dist/worker-agents-routes.js +253 -0
- package/packages/server/dist/worker-agents-routes.js.map +1 -0
- package/packages/server/package.json +41 -0
- package/packages/web/dist/assets/index-DH-gJ09_.js +60 -0
- package/packages/web/dist/assets/index-xU4lYYqY.css +2 -0
- package/packages/web/dist/index.html +14 -0
- package/packages/web/package.json +36 -0
- package/plugins/README.md +64 -0
- package/plugins/files/dist/client.d.ts +5 -0
- package/plugins/files/dist/client.d.ts.map +1 -0
- package/plugins/files/dist/client.js +354 -0
- package/plugins/files/dist/client.js.map +1 -0
- package/plugins/files/dist/server.d.ts +32 -0
- package/plugins/files/dist/server.d.ts.map +1 -0
- package/plugins/files/dist/server.js +514 -0
- package/plugins/files/dist/server.js.map +1 -0
- package/plugins/files/dist/tools/edit-file.d.ts +29 -0
- package/plugins/files/dist/tools/edit-file.d.ts.map +1 -0
- package/plugins/files/dist/tools/edit-file.js +230 -0
- package/plugins/files/dist/tools/edit-file.js.map +1 -0
- package/plugins/files/dist/tools/edit-file.prompt.md +36 -0
- package/plugins/files/dist/tools/glob.d.ts +12 -0
- package/plugins/files/dist/tools/glob.d.ts.map +1 -0
- package/plugins/files/dist/tools/glob.js +84 -0
- package/plugins/files/dist/tools/glob.js.map +1 -0
- package/plugins/files/dist/tools/index.d.ts +13 -0
- package/plugins/files/dist/tools/index.d.ts.map +1 -0
- package/plugins/files/dist/tools/index.js +158 -0
- package/plugins/files/dist/tools/index.js.map +1 -0
- package/plugins/files/dist/tools/list-dir.d.ts +24 -0
- package/plugins/files/dist/tools/list-dir.d.ts.map +1 -0
- package/plugins/files/dist/tools/list-dir.js +104 -0
- package/plugins/files/dist/tools/list-dir.js.map +1 -0
- package/plugins/files/dist/tools/load-prompt.d.ts +5 -0
- package/plugins/files/dist/tools/load-prompt.d.ts.map +1 -0
- package/plugins/files/dist/tools/load-prompt.js +39 -0
- package/plugins/files/dist/tools/load-prompt.js.map +1 -0
- package/plugins/files/dist/tools/path-helper.d.ts +32 -0
- package/plugins/files/dist/tools/path-helper.d.ts.map +1 -0
- package/plugins/files/dist/tools/path-helper.js +113 -0
- package/plugins/files/dist/tools/path-helper.js.map +1 -0
- package/plugins/files/dist/tools/read-file.d.ts +17 -0
- package/plugins/files/dist/tools/read-file.d.ts.map +1 -0
- package/plugins/files/dist/tools/read-file.js +109 -0
- package/plugins/files/dist/tools/read-file.js.map +1 -0
- package/plugins/files/dist/tools/read-tracker.d.ts +28 -0
- package/plugins/files/dist/tools/read-tracker.d.ts.map +1 -0
- package/plugins/files/dist/tools/read-tracker.js +135 -0
- package/plugins/files/dist/tools/read-tracker.js.map +1 -0
- package/plugins/files/dist/tools/replacers.d.ts +27 -0
- package/plugins/files/dist/tools/replacers.d.ts.map +1 -0
- package/plugins/files/dist/tools/replacers.js +221 -0
- package/plugins/files/dist/tools/replacers.js.map +1 -0
- package/plugins/files/dist/tools/tenant-config-delete.d.ts +12 -0
- package/plugins/files/dist/tools/tenant-config-delete.d.ts.map +1 -0
- package/plugins/files/dist/tools/tenant-config-delete.js +70 -0
- package/plugins/files/dist/tools/tenant-config-delete.js.map +1 -0
- package/plugins/files/dist/tools/tenant-config-edit.d.ts +25 -0
- package/plugins/files/dist/tools/tenant-config-edit.d.ts.map +1 -0
- package/plugins/files/dist/tools/tenant-config-edit.js +142 -0
- package/plugins/files/dist/tools/tenant-config-edit.js.map +1 -0
- package/plugins/files/dist/tools/tenant-config-glob.d.ts +12 -0
- package/plugins/files/dist/tools/tenant-config-glob.d.ts.map +1 -0
- package/plugins/files/dist/tools/tenant-config-glob.js +64 -0
- package/plugins/files/dist/tools/tenant-config-glob.js.map +1 -0
- package/plugins/files/dist/tools/tenant-config-helper.d.ts +64 -0
- package/plugins/files/dist/tools/tenant-config-helper.d.ts.map +1 -0
- package/plugins/files/dist/tools/tenant-config-helper.js +162 -0
- package/plugins/files/dist/tools/tenant-config-helper.js.map +1 -0
- package/plugins/files/dist/tools/tenant-config-list.d.ts +20 -0
- package/plugins/files/dist/tools/tenant-config-list.d.ts.map +1 -0
- package/plugins/files/dist/tools/tenant-config-list.js +95 -0
- package/plugins/files/dist/tools/tenant-config-list.js.map +1 -0
- package/plugins/files/dist/tools/tenant-config-read.d.ts +17 -0
- package/plugins/files/dist/tools/tenant-config-read.d.ts.map +1 -0
- package/plugins/files/dist/tools/tenant-config-read.js +87 -0
- package/plugins/files/dist/tools/tenant-config-read.js.map +1 -0
- package/plugins/files/dist/tools/tenant-config-write.d.ts +14 -0
- package/plugins/files/dist/tools/tenant-config-write.d.ts.map +1 -0
- package/plugins/files/dist/tools/tenant-config-write.js +78 -0
- package/plugins/files/dist/tools/tenant-config-write.js.map +1 -0
- package/plugins/files/dist/tools/text-shape.d.ts +20 -0
- package/plugins/files/dist/tools/text-shape.d.ts.map +1 -0
- package/plugins/files/dist/tools/text-shape.js +57 -0
- package/plugins/files/dist/tools/text-shape.js.map +1 -0
- package/plugins/files/dist/tools/write-file.d.ts +12 -0
- package/plugins/files/dist/tools/write-file.d.ts.map +1 -0
- package/plugins/files/dist/tools/write-file.js +89 -0
- package/plugins/files/dist/tools/write-file.js.map +1 -0
- package/plugins/files/dist/tools/write-file.prompt.md +14 -0
- package/plugins/files/manifest.json +100 -0
- package/plugins/files/package.json +39 -0
- package/plugins/files/skills/files-workspace-layout.md +29 -0
- package/plugins/microsandbox/dist/admin/browser-routes.d.ts +41 -0
- package/plugins/microsandbox/dist/admin/browser-routes.d.ts.map +1 -0
- package/plugins/microsandbox/dist/admin/browser-routes.js +208 -0
- package/plugins/microsandbox/dist/admin/browser-routes.js.map +1 -0
- package/plugins/microsandbox/dist/admin/preview-exec.d.ts +38 -0
- package/plugins/microsandbox/dist/admin/preview-exec.d.ts.map +1 -0
- package/plugins/microsandbox/dist/admin/preview-exec.js +185 -0
- package/plugins/microsandbox/dist/admin/preview-exec.js.map +1 -0
- package/plugins/microsandbox/dist/admin/routes.d.ts +35 -0
- package/plugins/microsandbox/dist/admin/routes.d.ts.map +1 -0
- package/plugins/microsandbox/dist/admin/routes.js +728 -0
- package/plugins/microsandbox/dist/admin/routes.js.map +1 -0
- package/plugins/microsandbox/dist/admin/sandboxfile-io.d.ts +11 -0
- package/plugins/microsandbox/dist/admin/sandboxfile-io.d.ts.map +1 -0
- package/plugins/microsandbox/dist/admin/sandboxfile-io.js +72 -0
- package/plugins/microsandbox/dist/admin/sandboxfile-io.js.map +1 -0
- package/plugins/microsandbox/dist/admin/templates.d.ts +16 -0
- package/plugins/microsandbox/dist/admin/templates.d.ts.map +1 -0
- package/plugins/microsandbox/dist/admin/templates.js +66 -0
- package/plugins/microsandbox/dist/admin/templates.js.map +1 -0
- package/plugins/microsandbox/dist/admin.d.ts +5 -0
- package/plugins/microsandbox/dist/admin.d.ts.map +1 -0
- package/plugins/microsandbox/dist/admin.js +256 -0
- package/plugins/microsandbox/dist/admin.js.map +1 -0
- package/plugins/microsandbox/dist/build/builder.d.ts +69 -0
- package/plugins/microsandbox/dist/build/builder.d.ts.map +1 -0
- package/plugins/microsandbox/dist/build/builder.js +257 -0
- package/plugins/microsandbox/dist/build/builder.js.map +1 -0
- package/plugins/microsandbox/dist/build/metadata.d.ts +27 -0
- package/plugins/microsandbox/dist/build/metadata.d.ts.map +1 -0
- package/plugins/microsandbox/dist/build/metadata.js +55 -0
- package/plugins/microsandbox/dist/build/metadata.js.map +1 -0
- package/plugins/microsandbox/dist/build/pointer.d.ts +51 -0
- package/plugins/microsandbox/dist/build/pointer.d.ts.map +1 -0
- package/plugins/microsandbox/dist/build/pointer.js +130 -0
- package/plugins/microsandbox/dist/build/pointer.js.map +1 -0
- package/plugins/microsandbox/dist/build/sandboxfile.d.ts +15 -0
- package/plugins/microsandbox/dist/build/sandboxfile.d.ts.map +1 -0
- package/plugins/microsandbox/dist/build/sandboxfile.js +176 -0
- package/plugins/microsandbox/dist/build/sandboxfile.js.map +1 -0
- package/plugins/microsandbox/dist/client.d.ts +5 -0
- package/plugins/microsandbox/dist/client.d.ts.map +1 -0
- package/plugins/microsandbox/dist/client.js +941 -0
- package/plugins/microsandbox/dist/client.js.map +1 -0
- package/plugins/microsandbox/dist/runner/browser.d.ts +50 -0
- package/plugins/microsandbox/dist/runner/browser.d.ts.map +1 -0
- package/plugins/microsandbox/dist/runner/browser.js +142 -0
- package/plugins/microsandbox/dist/runner/browser.js.map +1 -0
- package/plugins/microsandbox/dist/runner/free-port.d.ts +6 -0
- package/plugins/microsandbox/dist/runner/free-port.d.ts.map +1 -0
- package/plugins/microsandbox/dist/runner/free-port.js +53 -0
- package/plugins/microsandbox/dist/runner/free-port.js.map +1 -0
- package/plugins/microsandbox/dist/runner/index.d.ts +28 -0
- package/plugins/microsandbox/dist/runner/index.d.ts.map +1 -0
- package/plugins/microsandbox/dist/runner/index.js +72 -0
- package/plugins/microsandbox/dist/runner/index.js.map +1 -0
- package/plugins/microsandbox/dist/runner/microsandbox.d.ts +64 -0
- package/plugins/microsandbox/dist/runner/microsandbox.d.ts.map +1 -0
- package/plugins/microsandbox/dist/runner/microsandbox.js +668 -0
- package/plugins/microsandbox/dist/runner/microsandbox.js.map +1 -0
- package/plugins/microsandbox/dist/runner/nullable.d.ts +36 -0
- package/plugins/microsandbox/dist/runner/nullable.d.ts.map +1 -0
- package/plugins/microsandbox/dist/runner/nullable.js +82 -0
- package/plugins/microsandbox/dist/runner/nullable.js.map +1 -0
- package/plugins/microsandbox/dist/runner/pool.d.ts +97 -0
- package/plugins/microsandbox/dist/runner/pool.d.ts.map +1 -0
- package/plugins/microsandbox/dist/runner/pool.js +494 -0
- package/plugins/microsandbox/dist/runner/pool.js.map +1 -0
- package/plugins/microsandbox/dist/runner/types.d.ts +33 -0
- package/plugins/microsandbox/dist/runner/types.d.ts.map +1 -0
- package/plugins/microsandbox/dist/runner/types.js +79 -0
- package/plugins/microsandbox/dist/runner/types.js.map +1 -0
- package/plugins/microsandbox/dist/server.d.ts +7 -0
- package/plugins/microsandbox/dist/server.d.ts.map +1 -0
- package/plugins/microsandbox/dist/server.js +276 -0
- package/plugins/microsandbox/dist/server.js.map +1 -0
- package/plugins/microsandbox/dist/tools/browser.d.ts +25 -0
- package/plugins/microsandbox/dist/tools/browser.d.ts.map +1 -0
- package/plugins/microsandbox/dist/tools/browser.js +78 -0
- package/plugins/microsandbox/dist/tools/browser.js.map +1 -0
- package/plugins/microsandbox/dist/tools/build.d.ts +5 -0
- package/plugins/microsandbox/dist/tools/build.d.ts.map +1 -0
- package/plugins/microsandbox/dist/tools/build.js +243 -0
- package/plugins/microsandbox/dist/tools/build.js.map +1 -0
- package/plugins/microsandbox/dist/tools/index.d.ts +9 -0
- package/plugins/microsandbox/dist/tools/index.d.ts.map +1 -0
- package/plugins/microsandbox/dist/tools/index.js +430 -0
- package/plugins/microsandbox/dist/tools/index.js.map +1 -0
- package/plugins/microsandbox/dist/tools/mcp-client.d.ts +63 -0
- package/plugins/microsandbox/dist/tools/mcp-client.d.ts.map +1 -0
- package/plugins/microsandbox/dist/tools/mcp-client.js +226 -0
- package/plugins/microsandbox/dist/tools/mcp-client.js.map +1 -0
- package/plugins/microsandbox/manifest.json +177 -0
- package/plugins/microsandbox/package.json +38 -0
- package/plugins/microsandbox/skills/microsandbox-browser-howto.md +155 -0
- package/plugins/microsandbox/skills/microsandbox-build-use.md +201 -0
- package/plugins/microsandbox/skills/microsandbox-config.md +38 -0
- package/plugins/microsandbox/skills/microsandbox-exec-howto.md +144 -0
- package/plugins/microsandbox/skills/microsandbox-libreoffice.md +159 -0
- package/plugins/microsandbox/templates/README.md +26 -0
- package/plugins/web-search/dist/server.d.ts +4 -0
- package/plugins/web-search/dist/server.d.ts.map +1 -0
- package/plugins/web-search/dist/server.js +73 -0
- package/plugins/web-search/dist/server.js.map +1 -0
- package/plugins/web-search/dist/tools/health.d.ts +31 -0
- package/plugins/web-search/dist/tools/health.d.ts.map +1 -0
- package/plugins/web-search/dist/tools/health.js +59 -0
- package/plugins/web-search/dist/tools/health.js.map +1 -0
- package/plugins/web-search/dist/tools/index.d.ts +3 -0
- package/plugins/web-search/dist/tools/index.d.ts.map +1 -0
- package/plugins/web-search/dist/tools/index.js +2 -0
- package/plugins/web-search/dist/tools/index.js.map +1 -0
- package/plugins/web-search/dist/tools/providers.d.ts +43 -0
- package/plugins/web-search/dist/tools/providers.d.ts.map +1 -0
- package/plugins/web-search/dist/tools/providers.js +140 -0
- package/plugins/web-search/dist/tools/providers.js.map +1 -0
- package/plugins/web-search/dist/tools/web-search.d.ts +15 -0
- package/plugins/web-search/dist/tools/web-search.d.ts.map +1 -0
- package/plugins/web-search/dist/tools/web-search.js +244 -0
- package/plugins/web-search/dist/tools/web-search.js.map +1 -0
- package/plugins/web-search/manifest.json +65 -0
- package/plugins/web-search/node_modules/@esbuild/darwin-arm64/README.md +3 -0
- package/plugins/web-search/node_modules/@esbuild/darwin-arm64/package.json +20 -0
- package/plugins/web-search/node_modules/@vitest/expect/LICENSE +21 -0
- package/plugins/web-search/node_modules/@vitest/expect/README.md +21 -0
- package/plugins/web-search/node_modules/@vitest/expect/dist/index.d.ts +808 -0
- package/plugins/web-search/node_modules/@vitest/expect/dist/index.js +1799 -0
- package/plugins/web-search/node_modules/@vitest/expect/package.json +46 -0
- package/plugins/web-search/node_modules/@vitest/mocker/LICENSE +21 -0
- package/plugins/web-search/node_modules/@vitest/mocker/README.md +5 -0
- package/plugins/web-search/node_modules/@vitest/mocker/dist/auto-register.d.ts +2 -0
- package/plugins/web-search/node_modules/@vitest/mocker/dist/auto-register.js +9 -0
- package/plugins/web-search/node_modules/@vitest/mocker/dist/browser.d.ts +53 -0
- package/plugins/web-search/node_modules/@vitest/mocker/dist/browser.js +91 -0
- package/plugins/web-search/node_modules/@vitest/mocker/dist/chunk-interceptor-native.js +15 -0
- package/plugins/web-search/node_modules/@vitest/mocker/dist/chunk-mocker.js +1602 -0
- package/plugins/web-search/node_modules/@vitest/mocker/dist/chunk-pathe.M-eThtNZ.js +174 -0
- package/plugins/web-search/node_modules/@vitest/mocker/dist/chunk-registry.js +182 -0
- package/plugins/web-search/node_modules/@vitest/mocker/dist/chunk-utils.js +16 -0
- package/plugins/web-search/node_modules/@vitest/mocker/dist/index.d.ts +21 -0
- package/plugins/web-search/node_modules/@vitest/mocker/dist/index.js +174 -0
- package/plugins/web-search/node_modules/@vitest/mocker/dist/mocker.d-Ce9_ySj5.d.ts +83 -0
- package/plugins/web-search/node_modules/@vitest/mocker/dist/node.d.ts +821 -0
- package/plugins/web-search/node_modules/@vitest/mocker/dist/node.js +1306 -0
- package/plugins/web-search/node_modules/@vitest/mocker/dist/redirect.d.ts +3 -0
- package/plugins/web-search/node_modules/@vitest/mocker/dist/redirect.js +75 -0
- package/plugins/web-search/node_modules/@vitest/mocker/dist/register.d.ts +9 -0
- package/plugins/web-search/node_modules/@vitest/mocker/dist/register.js +41 -0
- package/plugins/web-search/node_modules/@vitest/mocker/dist/registry.d-D765pazg.d.ts +87 -0
- package/plugins/web-search/node_modules/@vitest/mocker/dist/types.d-D_aRZRdy.d.ts +8 -0
- package/plugins/web-search/node_modules/@vitest/mocker/package.json +82 -0
- package/plugins/web-search/node_modules/@vitest/pretty-format/LICENSE +21 -0
- package/plugins/web-search/node_modules/@vitest/pretty-format/dist/index.d.ts +119 -0
- package/plugins/web-search/node_modules/@vitest/pretty-format/dist/index.js +1387 -0
- package/plugins/web-search/node_modules/@vitest/pretty-format/package.json +44 -0
- package/plugins/web-search/node_modules/@vitest/runner/LICENSE +21 -0
- package/plugins/web-search/node_modules/@vitest/runner/README.md +5 -0
- package/plugins/web-search/node_modules/@vitest/runner/dist/chunk-hooks.js +2254 -0
- package/plugins/web-search/node_modules/@vitest/runner/dist/index.d.ts +261 -0
- package/plugins/web-search/node_modules/@vitest/runner/dist/index.js +6 -0
- package/plugins/web-search/node_modules/@vitest/runner/dist/tasks.d-CkscK4of.d.ts +558 -0
- package/plugins/web-search/node_modules/@vitest/runner/dist/types.d.ts +163 -0
- package/plugins/web-search/node_modules/@vitest/runner/dist/types.js +1 -0
- package/plugins/web-search/node_modules/@vitest/runner/dist/utils.d.ts +47 -0
- package/plugins/web-search/node_modules/@vitest/runner/dist/utils.js +6 -0
- package/plugins/web-search/node_modules/@vitest/runner/package.json +49 -0
- package/plugins/web-search/node_modules/@vitest/snapshot/LICENSE +21 -0
- package/plugins/web-search/node_modules/@vitest/snapshot/README.md +84 -0
- package/plugins/web-search/node_modules/@vitest/snapshot/dist/environment.d-DHdQ1Csl.d.ts +22 -0
- package/plugins/web-search/node_modules/@vitest/snapshot/dist/environment.d.ts +16 -0
- package/plugins/web-search/node_modules/@vitest/snapshot/dist/environment.js +40 -0
- package/plugins/web-search/node_modules/@vitest/snapshot/dist/index.d.ts +137 -0
- package/plugins/web-search/node_modules/@vitest/snapshot/dist/index.js +2305 -0
- package/plugins/web-search/node_modules/@vitest/snapshot/dist/manager.d.ts +18 -0
- package/plugins/web-search/node_modules/@vitest/snapshot/dist/manager.js +73 -0
- package/plugins/web-search/node_modules/@vitest/snapshot/dist/rawSnapshot.d-lFsMJFUd.d.ts +61 -0
- package/plugins/web-search/node_modules/@vitest/snapshot/package.json +54 -0
- package/plugins/web-search/node_modules/@vitest/spy/LICENSE +21 -0
- package/plugins/web-search/node_modules/@vitest/spy/README.md +3 -0
- package/plugins/web-search/node_modules/@vitest/spy/dist/index.d.ts +356 -0
- package/plugins/web-search/node_modules/@vitest/spy/dist/index.js +191 -0
- package/plugins/web-search/node_modules/@vitest/spy/package.json +38 -0
- package/plugins/web-search/node_modules/@vitest/utils/LICENSE +21 -0
- package/plugins/web-search/node_modules/@vitest/utils/dist/chunk-_commonjsHelpers.js +158 -0
- package/plugins/web-search/node_modules/@vitest/utils/dist/diff.d.ts +104 -0
- package/plugins/web-search/node_modules/@vitest/utils/dist/diff.js +2185 -0
- package/plugins/web-search/node_modules/@vitest/utils/dist/error.d.ts +9 -0
- package/plugins/web-search/node_modules/@vitest/utils/dist/error.js +162 -0
- package/plugins/web-search/node_modules/@vitest/utils/dist/helpers.d.ts +56 -0
- package/plugins/web-search/node_modules/@vitest/utils/dist/helpers.js +251 -0
- package/plugins/web-search/node_modules/@vitest/utils/dist/index.d.ts +57 -0
- package/plugins/web-search/node_modules/@vitest/utils/dist/index.js +633 -0
- package/plugins/web-search/node_modules/@vitest/utils/dist/source-map.d.ts +139 -0
- package/plugins/web-search/node_modules/@vitest/utils/dist/source-map.js +996 -0
- package/plugins/web-search/node_modules/@vitest/utils/dist/types.d-BCElaP-c.d.ts +53 -0
- package/plugins/web-search/node_modules/@vitest/utils/dist/types.d.ts +53 -0
- package/plugins/web-search/node_modules/@vitest/utils/dist/types.js +1 -0
- package/plugins/web-search/node_modules/@vitest/utils/package.json +77 -0
- package/plugins/web-search/node_modules/chai/LICENSE +21 -0
- package/plugins/web-search/node_modules/chai/README.md +162 -0
- package/plugins/web-search/node_modules/chai/package.json +74 -0
- package/plugins/web-search/node_modules/esbuild/README.md +3 -0
- package/plugins/web-search/node_modules/esbuild/package.json +49 -0
- package/plugins/web-search/node_modules/std-env/README.md +118 -0
- package/plugins/web-search/node_modules/std-env/dist/index.cjs +1 -0
- package/plugins/web-search/node_modules/std-env/dist/index.d.cts +92 -0
- package/plugins/web-search/node_modules/std-env/dist/index.d.mts +92 -0
- package/plugins/web-search/node_modules/std-env/dist/index.d.ts +92 -0
- package/plugins/web-search/node_modules/std-env/dist/index.mjs +1 -0
- package/plugins/web-search/node_modules/std-env/package.json +46 -0
- package/plugins/web-search/node_modules/tinyexec/LICENSE +21 -0
- package/plugins/web-search/node_modules/tinyexec/README.md +256 -0
- package/plugins/web-search/node_modules/tinyexec/dist/main.cjs +575 -0
- package/plugins/web-search/node_modules/tinyexec/dist/main.d.cts +70 -0
- package/plugins/web-search/node_modules/tinyexec/dist/main.d.ts +70 -0
- package/plugins/web-search/node_modules/tinyexec/dist/main.js +578 -0
- package/plugins/web-search/node_modules/tinyexec/package.json +66 -0
- package/plugins/web-search/node_modules/tinyrainbow/README.md +28 -0
- package/plugins/web-search/node_modules/tinyrainbow/dist/browser.d.ts +8 -0
- package/plugins/web-search/node_modules/tinyrainbow/dist/browser.js +20 -0
- package/plugins/web-search/node_modules/tinyrainbow/dist/chunk-BVHSVHOK.js +90 -0
- package/plugins/web-search/node_modules/tinyrainbow/dist/index-8b61d5bc.d.ts +59 -0
- package/plugins/web-search/node_modules/tinyrainbow/dist/node.d.ts +8 -0
- package/plugins/web-search/node_modules/tinyrainbow/dist/node.js +22 -0
- package/plugins/web-search/node_modules/tinyrainbow/package.json +37 -0
- package/plugins/web-search/node_modules/typescript/README.md +50 -0
- package/plugins/web-search/node_modules/typescript/package.json +120 -0
- package/plugins/web-search/node_modules/vite/README.md +20 -0
- package/plugins/web-search/node_modules/vite/dist/client/client.mjs +1106 -0
- package/plugins/web-search/node_modules/vite/dist/client/env.mjs +19 -0
- package/plugins/web-search/node_modules/vite/dist/node/chunks/build.js +4 -0
- package/plugins/web-search/node_modules/vite/dist/node/chunks/build2.js +5538 -0
- package/plugins/web-search/node_modules/vite/dist/node/chunks/chunk.js +48 -0
- package/plugins/web-search/node_modules/vite/dist/node/chunks/config.js +36065 -0
- package/plugins/web-search/node_modules/vite/dist/node/chunks/config2.js +4 -0
- package/plugins/web-search/node_modules/vite/dist/node/chunks/dist.js +6758 -0
- package/plugins/web-search/node_modules/vite/dist/node/chunks/lib.js +377 -0
- package/plugins/web-search/node_modules/vite/dist/node/chunks/logger.js +329 -0
- package/plugins/web-search/node_modules/vite/dist/node/chunks/moduleRunnerTransport.d.ts +96 -0
- package/plugins/web-search/node_modules/vite/dist/node/chunks/optimizer.js +4 -0
- package/plugins/web-search/node_modules/vite/dist/node/chunks/postcss-import.js +479 -0
- package/plugins/web-search/node_modules/vite/dist/node/chunks/preview.js +4 -0
- package/plugins/web-search/node_modules/vite/dist/node/chunks/server.js +4 -0
- package/plugins/web-search/node_modules/vite/dist/node/cli.js +698 -0
- package/plugins/web-search/node_modules/vite/dist/node/index.d.ts +3717 -0
- package/plugins/web-search/node_modules/vite/dist/node/index.js +30 -0
- package/plugins/web-search/node_modules/vite/dist/node/module-runner.d.ts +311 -0
- package/plugins/web-search/node_modules/vite/dist/node/module-runner.js +1160 -0
- package/plugins/web-search/node_modules/vite/package.json +199 -0
- package/plugins/web-search/node_modules/vite/types/package.json +4 -0
- package/plugins/web-search/node_modules/vitest/README.md +7 -0
- package/plugins/web-search/node_modules/vitest/dist/browser.d.ts +34 -0
- package/plugins/web-search/node_modules/vitest/dist/browser.js +8 -0
- package/plugins/web-search/node_modules/vitest/dist/chunks/_commonjsHelpers.BFTU3MAI.js +7 -0
- package/plugins/web-search/node_modules/vitest/dist/chunks/base.DfmxU-tU.js +38 -0
- package/plugins/web-search/node_modules/vitest/dist/chunks/benchmark.CYdenmiT.js +37 -0
- package/plugins/web-search/node_modules/vitest/dist/chunks/benchmark.d.BwvBVTda.d.ts +24 -0
- package/plugins/web-search/node_modules/vitest/dist/chunks/cac.0BJqEUeA.js +1469 -0
- package/plugins/web-search/node_modules/vitest/dist/chunks/cli-api.DWGBtMmz.js +10660 -0
- package/plugins/web-search/node_modules/vitest/dist/chunks/config.d.BKdhh7Zx.d.ts +224 -0
- package/plugins/web-search/node_modules/vitest/dist/chunks/console.CtFJOzRO.js +153 -0
- package/plugins/web-search/node_modules/vitest/dist/chunks/constants.DnKduX2e.js +44 -0
- package/plugins/web-search/node_modules/vitest/dist/chunks/coverage.DVF1vEu8.js +25 -0
- package/plugins/web-search/node_modules/vitest/dist/chunks/coverage.DfSpMS-b.js +4350 -0
- package/plugins/web-search/node_modules/vitest/dist/chunks/coverage.d.S9RMNXIe.d.ts +35 -0
- package/plugins/web-search/node_modules/vitest/dist/chunks/creator.GK6I-cL4.js +640 -0
- package/plugins/web-search/node_modules/vitest/dist/chunks/date.Bq6ZW5rf.js +73 -0
- package/plugins/web-search/node_modules/vitest/dist/chunks/defaults.B7q_naMc.js +115 -0
- package/plugins/web-search/node_modules/vitest/dist/chunks/env.D4Lgay0q.js +8 -0
- package/plugins/web-search/node_modules/vitest/dist/chunks/environment.d.cL3nLXbE.d.ts +119 -0
- package/plugins/web-search/node_modules/vitest/dist/chunks/execute.B7h3T_Hc.js +708 -0
- package/plugins/web-search/node_modules/vitest/dist/chunks/git.BVQ8w_Sw.js +72 -0
- package/plugins/web-search/node_modules/vitest/dist/chunks/global.d.MAmajcmJ.d.ts +136 -0
- package/plugins/web-search/node_modules/vitest/dist/chunks/globals.DEHgCU4V.js +26 -0
- package/plugins/web-search/node_modules/vitest/dist/chunks/index.B521nVV-.js +157 -0
- package/plugins/web-search/node_modules/vitest/dist/chunks/index.BCWujgDG.js +231 -0
- package/plugins/web-search/node_modules/vitest/dist/chunks/index.CdQS2e2Q.js +37 -0
- package/plugins/web-search/node_modules/vitest/dist/chunks/index.CmSc2RE5.js +587 -0
- package/plugins/web-search/node_modules/vitest/dist/chunks/index.CwejwG0H.js +105 -0
- package/plugins/web-search/node_modules/vitest/dist/chunks/index.D3XRDfWc.js +213 -0
- package/plugins/web-search/node_modules/vitest/dist/chunks/index.VByaPkjc.js +2183 -0
- package/plugins/web-search/node_modules/vitest/dist/chunks/index.X0nbfr6-.js +6584 -0
- package/plugins/web-search/node_modules/vitest/dist/chunks/inspector.C914Efll.js +57 -0
- package/plugins/web-search/node_modules/vitest/dist/chunks/mocker.d.BE_2ls6u.d.ts +17 -0
- package/plugins/web-search/node_modules/vitest/dist/chunks/node.fjCdwEIl.js +15 -0
- package/plugins/web-search/node_modules/vitest/dist/chunks/reporters.d.BuRON0I0.d.ts +3168 -0
- package/plugins/web-search/node_modules/vitest/dist/chunks/rpc.-pEldfrD.js +83 -0
- package/plugins/web-search/node_modules/vitest/dist/chunks/runBaseTests.9Ij9_de-.js +129 -0
- package/plugins/web-search/node_modules/vitest/dist/chunks/setup-common.Dd054P77.js +60 -0
- package/plugins/web-search/node_modules/vitest/dist/chunks/suite.d.FvehnV49.d.ts +10 -0
- package/plugins/web-search/node_modules/vitest/dist/chunks/typechecker.DRKU1-1g.js +874 -0
- package/plugins/web-search/node_modules/vitest/dist/chunks/utils.CAioKnHs.js +61 -0
- package/plugins/web-search/node_modules/vitest/dist/chunks/utils.XdZDrNZV.js +65 -0
- package/plugins/web-search/node_modules/vitest/dist/chunks/vi.bdSIJ99Y.js +4015 -0
- package/plugins/web-search/node_modules/vitest/dist/chunks/vite.d.BnOPPc46.d.ts +25 -0
- package/plugins/web-search/node_modules/vitest/dist/chunks/vm.BThCzidc.js +756 -0
- package/plugins/web-search/node_modules/vitest/dist/chunks/worker.d.CUgIPz9V.d.ts +176 -0
- package/plugins/web-search/node_modules/vitest/dist/chunks/worker.d.uzWsCv9X.d.ts +8 -0
- package/plugins/web-search/node_modules/vitest/dist/cli.js +27 -0
- package/plugins/web-search/node_modules/vitest/dist/config.cjs +148 -0
- package/plugins/web-search/node_modules/vitest/dist/config.d.ts +100 -0
- package/plugins/web-search/node_modules/vitest/dist/config.js +21 -0
- package/plugins/web-search/node_modules/vitest/dist/coverage.d.ts +108 -0
- package/plugins/web-search/node_modules/vitest/dist/coverage.js +34 -0
- package/plugins/web-search/node_modules/vitest/dist/environments.d.ts +26 -0
- package/plugins/web-search/node_modules/vitest/dist/environments.js +2 -0
- package/plugins/web-search/node_modules/vitest/dist/execute.d.ts +150 -0
- package/plugins/web-search/node_modules/vitest/dist/execute.js +13 -0
- package/plugins/web-search/node_modules/vitest/dist/index.d.ts +651 -0
- package/plugins/web-search/node_modules/vitest/dist/index.js +18 -0
- package/plugins/web-search/node_modules/vitest/dist/mocker.d.ts +1 -0
- package/plugins/web-search/node_modules/vitest/dist/mocker.js +1 -0
- package/plugins/web-search/node_modules/vitest/dist/node.d.ts +158 -0
- package/plugins/web-search/node_modules/vitest/dist/node.js +105 -0
- package/plugins/web-search/node_modules/vitest/dist/path.js +7 -0
- package/plugins/web-search/node_modules/vitest/dist/reporters.d.ts +25 -0
- package/plugins/web-search/node_modules/vitest/dist/reporters.js +23 -0
- package/plugins/web-search/node_modules/vitest/dist/runners.d.ts +46 -0
- package/plugins/web-search/node_modules/vitest/dist/runners.js +235 -0
- package/plugins/web-search/node_modules/vitest/dist/snapshot.d.ts +9 -0
- package/plugins/web-search/node_modules/vitest/dist/snapshot.js +4 -0
- package/plugins/web-search/node_modules/vitest/dist/spy.js +1 -0
- package/plugins/web-search/node_modules/vitest/dist/suite.d.ts +5 -0
- package/plugins/web-search/node_modules/vitest/dist/suite.js +5 -0
- package/plugins/web-search/node_modules/vitest/dist/worker.js +124 -0
- package/plugins/web-search/node_modules/vitest/dist/workers/forks.js +43 -0
- package/plugins/web-search/node_modules/vitest/dist/workers/runVmTests.js +90 -0
- package/plugins/web-search/node_modules/vitest/dist/workers/threads.js +31 -0
- package/plugins/web-search/node_modules/vitest/dist/workers/vmForks.js +47 -0
- package/plugins/web-search/node_modules/vitest/dist/workers/vmThreads.js +37 -0
- package/plugins/web-search/node_modules/vitest/dist/workers.d.ts +40 -0
- package/plugins/web-search/node_modules/vitest/dist/workers.js +30 -0
- package/plugins/web-search/node_modules/vitest/package.json +207 -0
- package/plugins/web-search/package.json +30 -0
- package/plugins/web-search/skills/web-search-howto.md +69 -0
- package/plugins/workboard/agent-seeds/echo-demo/agent.json +7 -0
- package/plugins/workboard/agent-seeds/llm-default/SOUL.md +53 -0
- package/plugins/workboard/agent-seeds/llm-default/agent.json +7 -0
- package/plugins/workboard/dist/client.d.ts +5 -0
- package/plugins/workboard/dist/client.d.ts.map +1 -0
- package/plugins/workboard/dist/client.js +895 -0
- package/plugins/workboard/dist/client.js.map +1 -0
- package/plugins/workboard/dist/db/agents.d.ts +100 -0
- package/plugins/workboard/dist/db/agents.d.ts.map +1 -0
- package/plugins/workboard/dist/db/agents.js +280 -0
- package/plugins/workboard/dist/db/agents.js.map +1 -0
- package/plugins/workboard/dist/db/schema.d.ts +3 -0
- package/plugins/workboard/dist/db/schema.d.ts.map +1 -0
- package/plugins/workboard/dist/db/schema.js +31 -0
- package/plugins/workboard/dist/db/schema.js.map +1 -0
- package/plugins/workboard/dist/db/session-history.d.ts +28 -0
- package/plugins/workboard/dist/db/session-history.d.ts.map +1 -0
- package/plugins/workboard/dist/db/session-history.js +224 -0
- package/plugins/workboard/dist/db/session-history.js.map +1 -0
- package/plugins/workboard/dist/db/tasks.d.ts +260 -0
- package/plugins/workboard/dist/db/tasks.d.ts.map +1 -0
- package/plugins/workboard/dist/db/tasks.js +451 -0
- package/plugins/workboard/dist/db/tasks.js.map +1 -0
- package/plugins/workboard/dist/db/worker-agents.d.ts +16 -0
- package/plugins/workboard/dist/db/worker-agents.d.ts.map +1 -0
- package/plugins/workboard/dist/db/worker-agents.js +62 -0
- package/plugins/workboard/dist/db/worker-agents.js.map +1 -0
- package/plugins/workboard/dist/effective-skills.d.ts +13 -0
- package/plugins/workboard/dist/effective-skills.d.ts.map +1 -0
- package/plugins/workboard/dist/effective-skills.js +126 -0
- package/plugins/workboard/dist/effective-skills.js.map +1 -0
- package/plugins/workboard/dist/fs-worker-agents.d.ts +35 -0
- package/plugins/workboard/dist/fs-worker-agents.d.ts.map +1 -0
- package/plugins/workboard/dist/fs-worker-agents.js +199 -0
- package/plugins/workboard/dist/fs-worker-agents.js.map +1 -0
- package/plugins/workboard/dist/migrate-worker-agents.d.ts +11 -0
- package/plugins/workboard/dist/migrate-worker-agents.d.ts.map +1 -0
- package/plugins/workboard/dist/migrate-worker-agents.js +89 -0
- package/plugins/workboard/dist/migrate-worker-agents.js.map +1 -0
- package/plugins/workboard/dist/routes/handlers.d.ts +106 -0
- package/plugins/workboard/dist/routes/handlers.d.ts.map +1 -0
- package/plugins/workboard/dist/routes/handlers.js +668 -0
- package/plugins/workboard/dist/routes/handlers.js.map +1 -0
- package/plugins/workboard/dist/server.d.ts +6 -0
- package/plugins/workboard/dist/server.d.ts.map +1 -0
- package/plugins/workboard/dist/server.js +368 -0
- package/plugins/workboard/dist/server.js.map +1 -0
- package/plugins/workboard/dist/tools/index.d.ts +70 -0
- package/plugins/workboard/dist/tools/index.d.ts.map +1 -0
- package/plugins/workboard/dist/tools/index.js +963 -0
- package/plugins/workboard/dist/tools/index.js.map +1 -0
- package/plugins/workboard/dist/types.d.ts +27 -0
- package/plugins/workboard/dist/types.d.ts.map +1 -0
- package/plugins/workboard/dist/types.js +16 -0
- package/plugins/workboard/dist/types.js.map +1 -0
- package/plugins/workboard/dist/worker/pool.d.ts +220 -0
- package/plugins/workboard/dist/worker/pool.d.ts.map +1 -0
- package/plugins/workboard/dist/worker/pool.js +866 -0
- package/plugins/workboard/dist/worker/pool.js.map +1 -0
- package/plugins/workboard/dist/worker/tool-policy.d.ts +27 -0
- package/plugins/workboard/dist/worker/tool-policy.d.ts.map +1 -0
- package/plugins/workboard/dist/worker/tool-policy.js +76 -0
- package/plugins/workboard/dist/worker/tool-policy.js.map +1 -0
- package/plugins/workboard/dist/worker-agents-page.d.ts +4 -0
- package/plugins/workboard/dist/worker-agents-page.d.ts.map +1 -0
- package/plugins/workboard/dist/worker-agents-page.js +193 -0
- package/plugins/workboard/dist/worker-agents-page.js.map +1 -0
- package/plugins/workboard/manifest.json +180 -0
- package/plugins/workboard/package.json +37 -0
- package/plugins/workboard/skills/large-input-large-output.md +185 -0
- package/plugins/workboard/skills/workboard-howto.md +166 -0
- package/plugins/workboard/skills/worker-creator.md +267 -0
- package/plugins/workboard/skills/worker-fleet.md +431 -0
|
@@ -0,0 +1,996 @@
|
|
|
1
|
+
import { isPrimitive, notNullish } from './helpers.js';
|
|
2
|
+
|
|
3
|
+
const comma = ','.charCodeAt(0);
|
|
4
|
+
const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
|
|
5
|
+
const intToChar = new Uint8Array(64); // 64 possible chars.
|
|
6
|
+
const charToInt = new Uint8Array(128); // z is 122 in ASCII
|
|
7
|
+
for (let i = 0; i < chars.length; i++) {
|
|
8
|
+
const c = chars.charCodeAt(i);
|
|
9
|
+
intToChar[i] = c;
|
|
10
|
+
charToInt[c] = i;
|
|
11
|
+
}
|
|
12
|
+
function decodeInteger(reader, relative) {
|
|
13
|
+
let value = 0;
|
|
14
|
+
let shift = 0;
|
|
15
|
+
let integer = 0;
|
|
16
|
+
do {
|
|
17
|
+
const c = reader.next();
|
|
18
|
+
integer = charToInt[c];
|
|
19
|
+
value |= (integer & 31) << shift;
|
|
20
|
+
shift += 5;
|
|
21
|
+
} while (integer & 32);
|
|
22
|
+
const shouldNegate = value & 1;
|
|
23
|
+
value >>>= 1;
|
|
24
|
+
if (shouldNegate) {
|
|
25
|
+
value = -2147483648 | -value;
|
|
26
|
+
}
|
|
27
|
+
return relative + value;
|
|
28
|
+
}
|
|
29
|
+
function hasMoreVlq(reader, max) {
|
|
30
|
+
if (reader.pos >= max)
|
|
31
|
+
return false;
|
|
32
|
+
return reader.peek() !== comma;
|
|
33
|
+
}
|
|
34
|
+
class StringReader {
|
|
35
|
+
constructor(buffer) {
|
|
36
|
+
this.pos = 0;
|
|
37
|
+
this.buffer = buffer;
|
|
38
|
+
}
|
|
39
|
+
next() {
|
|
40
|
+
return this.buffer.charCodeAt(this.pos++);
|
|
41
|
+
}
|
|
42
|
+
peek() {
|
|
43
|
+
return this.buffer.charCodeAt(this.pos);
|
|
44
|
+
}
|
|
45
|
+
indexOf(char) {
|
|
46
|
+
const { buffer, pos } = this;
|
|
47
|
+
const idx = buffer.indexOf(char, pos);
|
|
48
|
+
return idx === -1 ? buffer.length : idx;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function decode(mappings) {
|
|
53
|
+
const { length } = mappings;
|
|
54
|
+
const reader = new StringReader(mappings);
|
|
55
|
+
const decoded = [];
|
|
56
|
+
let genColumn = 0;
|
|
57
|
+
let sourcesIndex = 0;
|
|
58
|
+
let sourceLine = 0;
|
|
59
|
+
let sourceColumn = 0;
|
|
60
|
+
let namesIndex = 0;
|
|
61
|
+
do {
|
|
62
|
+
const semi = reader.indexOf(';');
|
|
63
|
+
const line = [];
|
|
64
|
+
let sorted = true;
|
|
65
|
+
let lastCol = 0;
|
|
66
|
+
genColumn = 0;
|
|
67
|
+
while (reader.pos < semi) {
|
|
68
|
+
let seg;
|
|
69
|
+
genColumn = decodeInteger(reader, genColumn);
|
|
70
|
+
if (genColumn < lastCol)
|
|
71
|
+
sorted = false;
|
|
72
|
+
lastCol = genColumn;
|
|
73
|
+
if (hasMoreVlq(reader, semi)) {
|
|
74
|
+
sourcesIndex = decodeInteger(reader, sourcesIndex);
|
|
75
|
+
sourceLine = decodeInteger(reader, sourceLine);
|
|
76
|
+
sourceColumn = decodeInteger(reader, sourceColumn);
|
|
77
|
+
if (hasMoreVlq(reader, semi)) {
|
|
78
|
+
namesIndex = decodeInteger(reader, namesIndex);
|
|
79
|
+
seg = [genColumn, sourcesIndex, sourceLine, sourceColumn, namesIndex];
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
seg = [genColumn, sourcesIndex, sourceLine, sourceColumn];
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
else {
|
|
86
|
+
seg = [genColumn];
|
|
87
|
+
}
|
|
88
|
+
line.push(seg);
|
|
89
|
+
reader.pos++;
|
|
90
|
+
}
|
|
91
|
+
if (!sorted)
|
|
92
|
+
sort(line);
|
|
93
|
+
decoded.push(line);
|
|
94
|
+
reader.pos = semi + 1;
|
|
95
|
+
} while (reader.pos <= length);
|
|
96
|
+
return decoded;
|
|
97
|
+
}
|
|
98
|
+
function sort(line) {
|
|
99
|
+
line.sort(sortComparator$1);
|
|
100
|
+
}
|
|
101
|
+
function sortComparator$1(a, b) {
|
|
102
|
+
return a[0] - b[0];
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// Matches the scheme of a URL, eg "http://"
|
|
106
|
+
const schemeRegex = /^[\w+.-]+:\/\//;
|
|
107
|
+
/**
|
|
108
|
+
* Matches the parts of a URL:
|
|
109
|
+
* 1. Scheme, including ":", guaranteed.
|
|
110
|
+
* 2. User/password, including "@", optional.
|
|
111
|
+
* 3. Host, guaranteed.
|
|
112
|
+
* 4. Port, including ":", optional.
|
|
113
|
+
* 5. Path, including "/", optional.
|
|
114
|
+
* 6. Query, including "?", optional.
|
|
115
|
+
* 7. Hash, including "#", optional.
|
|
116
|
+
*/
|
|
117
|
+
const urlRegex = /^([\w+.-]+:)\/\/([^@/#?]*@)?([^:/#?]*)(:\d+)?(\/[^#?]*)?(\?[^#]*)?(#.*)?/;
|
|
118
|
+
/**
|
|
119
|
+
* File URLs are weird. They dont' need the regular `//` in the scheme, they may or may not start
|
|
120
|
+
* with a leading `/`, they can have a domain (but only if they don't start with a Windows drive).
|
|
121
|
+
*
|
|
122
|
+
* 1. Host, optional.
|
|
123
|
+
* 2. Path, which may include "/", guaranteed.
|
|
124
|
+
* 3. Query, including "?", optional.
|
|
125
|
+
* 4. Hash, including "#", optional.
|
|
126
|
+
*/
|
|
127
|
+
const fileRegex = /^file:(?:\/\/((?![a-z]:)[^/#?]*)?)?(\/?[^#?]*)(\?[^#]*)?(#.*)?/i;
|
|
128
|
+
var UrlType;
|
|
129
|
+
(function (UrlType) {
|
|
130
|
+
UrlType[UrlType["Empty"] = 1] = "Empty";
|
|
131
|
+
UrlType[UrlType["Hash"] = 2] = "Hash";
|
|
132
|
+
UrlType[UrlType["Query"] = 3] = "Query";
|
|
133
|
+
UrlType[UrlType["RelativePath"] = 4] = "RelativePath";
|
|
134
|
+
UrlType[UrlType["AbsolutePath"] = 5] = "AbsolutePath";
|
|
135
|
+
UrlType[UrlType["SchemeRelative"] = 6] = "SchemeRelative";
|
|
136
|
+
UrlType[UrlType["Absolute"] = 7] = "Absolute";
|
|
137
|
+
})(UrlType || (UrlType = {}));
|
|
138
|
+
function isAbsoluteUrl(input) {
|
|
139
|
+
return schemeRegex.test(input);
|
|
140
|
+
}
|
|
141
|
+
function isSchemeRelativeUrl(input) {
|
|
142
|
+
return input.startsWith('//');
|
|
143
|
+
}
|
|
144
|
+
function isAbsolutePath(input) {
|
|
145
|
+
return input.startsWith('/');
|
|
146
|
+
}
|
|
147
|
+
function isFileUrl(input) {
|
|
148
|
+
return input.startsWith('file:');
|
|
149
|
+
}
|
|
150
|
+
function isRelative(input) {
|
|
151
|
+
return /^[.?#]/.test(input);
|
|
152
|
+
}
|
|
153
|
+
function parseAbsoluteUrl(input) {
|
|
154
|
+
const match = urlRegex.exec(input);
|
|
155
|
+
return makeUrl(match[1], match[2] || '', match[3], match[4] || '', match[5] || '/', match[6] || '', match[7] || '');
|
|
156
|
+
}
|
|
157
|
+
function parseFileUrl(input) {
|
|
158
|
+
const match = fileRegex.exec(input);
|
|
159
|
+
const path = match[2];
|
|
160
|
+
return makeUrl('file:', '', match[1] || '', '', isAbsolutePath(path) ? path : '/' + path, match[3] || '', match[4] || '');
|
|
161
|
+
}
|
|
162
|
+
function makeUrl(scheme, user, host, port, path, query, hash) {
|
|
163
|
+
return {
|
|
164
|
+
scheme,
|
|
165
|
+
user,
|
|
166
|
+
host,
|
|
167
|
+
port,
|
|
168
|
+
path,
|
|
169
|
+
query,
|
|
170
|
+
hash,
|
|
171
|
+
type: UrlType.Absolute,
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
function parseUrl(input) {
|
|
175
|
+
if (isSchemeRelativeUrl(input)) {
|
|
176
|
+
const url = parseAbsoluteUrl('http:' + input);
|
|
177
|
+
url.scheme = '';
|
|
178
|
+
url.type = UrlType.SchemeRelative;
|
|
179
|
+
return url;
|
|
180
|
+
}
|
|
181
|
+
if (isAbsolutePath(input)) {
|
|
182
|
+
const url = parseAbsoluteUrl('http://foo.com' + input);
|
|
183
|
+
url.scheme = '';
|
|
184
|
+
url.host = '';
|
|
185
|
+
url.type = UrlType.AbsolutePath;
|
|
186
|
+
return url;
|
|
187
|
+
}
|
|
188
|
+
if (isFileUrl(input))
|
|
189
|
+
return parseFileUrl(input);
|
|
190
|
+
if (isAbsoluteUrl(input))
|
|
191
|
+
return parseAbsoluteUrl(input);
|
|
192
|
+
const url = parseAbsoluteUrl('http://foo.com/' + input);
|
|
193
|
+
url.scheme = '';
|
|
194
|
+
url.host = '';
|
|
195
|
+
url.type = input
|
|
196
|
+
? input.startsWith('?')
|
|
197
|
+
? UrlType.Query
|
|
198
|
+
: input.startsWith('#')
|
|
199
|
+
? UrlType.Hash
|
|
200
|
+
: UrlType.RelativePath
|
|
201
|
+
: UrlType.Empty;
|
|
202
|
+
return url;
|
|
203
|
+
}
|
|
204
|
+
function stripPathFilename(path) {
|
|
205
|
+
// If a path ends with a parent directory "..", then it's a relative path with excess parent
|
|
206
|
+
// paths. It's not a file, so we can't strip it.
|
|
207
|
+
if (path.endsWith('/..'))
|
|
208
|
+
return path;
|
|
209
|
+
const index = path.lastIndexOf('/');
|
|
210
|
+
return path.slice(0, index + 1);
|
|
211
|
+
}
|
|
212
|
+
function mergePaths(url, base) {
|
|
213
|
+
normalizePath(base, base.type);
|
|
214
|
+
// If the path is just a "/", then it was an empty path to begin with (remember, we're a relative
|
|
215
|
+
// path).
|
|
216
|
+
if (url.path === '/') {
|
|
217
|
+
url.path = base.path;
|
|
218
|
+
}
|
|
219
|
+
else {
|
|
220
|
+
// Resolution happens relative to the base path's directory, not the file.
|
|
221
|
+
url.path = stripPathFilename(base.path) + url.path;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* The path can have empty directories "//", unneeded parents "foo/..", or current directory
|
|
226
|
+
* "foo/.". We need to normalize to a standard representation.
|
|
227
|
+
*/
|
|
228
|
+
function normalizePath(url, type) {
|
|
229
|
+
const rel = type <= UrlType.RelativePath;
|
|
230
|
+
const pieces = url.path.split('/');
|
|
231
|
+
// We need to preserve the first piece always, so that we output a leading slash. The item at
|
|
232
|
+
// pieces[0] is an empty string.
|
|
233
|
+
let pointer = 1;
|
|
234
|
+
// Positive is the number of real directories we've output, used for popping a parent directory.
|
|
235
|
+
// Eg, "foo/bar/.." will have a positive 2, and we can decrement to be left with just "foo".
|
|
236
|
+
let positive = 0;
|
|
237
|
+
// We need to keep a trailing slash if we encounter an empty directory (eg, splitting "foo/" will
|
|
238
|
+
// generate `["foo", ""]` pieces). And, if we pop a parent directory. But once we encounter a
|
|
239
|
+
// real directory, we won't need to append, unless the other conditions happen again.
|
|
240
|
+
let addTrailingSlash = false;
|
|
241
|
+
for (let i = 1; i < pieces.length; i++) {
|
|
242
|
+
const piece = pieces[i];
|
|
243
|
+
// An empty directory, could be a trailing slash, or just a double "//" in the path.
|
|
244
|
+
if (!piece) {
|
|
245
|
+
addTrailingSlash = true;
|
|
246
|
+
continue;
|
|
247
|
+
}
|
|
248
|
+
// If we encounter a real directory, then we don't need to append anymore.
|
|
249
|
+
addTrailingSlash = false;
|
|
250
|
+
// A current directory, which we can always drop.
|
|
251
|
+
if (piece === '.')
|
|
252
|
+
continue;
|
|
253
|
+
// A parent directory, we need to see if there are any real directories we can pop. Else, we
|
|
254
|
+
// have an excess of parents, and we'll need to keep the "..".
|
|
255
|
+
if (piece === '..') {
|
|
256
|
+
if (positive) {
|
|
257
|
+
addTrailingSlash = true;
|
|
258
|
+
positive--;
|
|
259
|
+
pointer--;
|
|
260
|
+
}
|
|
261
|
+
else if (rel) {
|
|
262
|
+
// If we're in a relativePath, then we need to keep the excess parents. Else, in an absolute
|
|
263
|
+
// URL, protocol relative URL, or an absolute path, we don't need to keep excess.
|
|
264
|
+
pieces[pointer++] = piece;
|
|
265
|
+
}
|
|
266
|
+
continue;
|
|
267
|
+
}
|
|
268
|
+
// We've encountered a real directory. Move it to the next insertion pointer, which accounts for
|
|
269
|
+
// any popped or dropped directories.
|
|
270
|
+
pieces[pointer++] = piece;
|
|
271
|
+
positive++;
|
|
272
|
+
}
|
|
273
|
+
let path = '';
|
|
274
|
+
for (let i = 1; i < pointer; i++) {
|
|
275
|
+
path += '/' + pieces[i];
|
|
276
|
+
}
|
|
277
|
+
if (!path || (addTrailingSlash && !path.endsWith('/..'))) {
|
|
278
|
+
path += '/';
|
|
279
|
+
}
|
|
280
|
+
url.path = path;
|
|
281
|
+
}
|
|
282
|
+
/**
|
|
283
|
+
* Attempts to resolve `input` URL/path relative to `base`.
|
|
284
|
+
*/
|
|
285
|
+
function resolve$2(input, base) {
|
|
286
|
+
if (!input && !base)
|
|
287
|
+
return '';
|
|
288
|
+
const url = parseUrl(input);
|
|
289
|
+
let inputType = url.type;
|
|
290
|
+
if (base && inputType !== UrlType.Absolute) {
|
|
291
|
+
const baseUrl = parseUrl(base);
|
|
292
|
+
const baseType = baseUrl.type;
|
|
293
|
+
switch (inputType) {
|
|
294
|
+
case UrlType.Empty:
|
|
295
|
+
url.hash = baseUrl.hash;
|
|
296
|
+
// fall through
|
|
297
|
+
case UrlType.Hash:
|
|
298
|
+
url.query = baseUrl.query;
|
|
299
|
+
// fall through
|
|
300
|
+
case UrlType.Query:
|
|
301
|
+
case UrlType.RelativePath:
|
|
302
|
+
mergePaths(url, baseUrl);
|
|
303
|
+
// fall through
|
|
304
|
+
case UrlType.AbsolutePath:
|
|
305
|
+
// The host, user, and port are joined, you can't copy one without the others.
|
|
306
|
+
url.user = baseUrl.user;
|
|
307
|
+
url.host = baseUrl.host;
|
|
308
|
+
url.port = baseUrl.port;
|
|
309
|
+
// fall through
|
|
310
|
+
case UrlType.SchemeRelative:
|
|
311
|
+
// The input doesn't have a schema at least, so we need to copy at least that over.
|
|
312
|
+
url.scheme = baseUrl.scheme;
|
|
313
|
+
}
|
|
314
|
+
if (baseType > inputType)
|
|
315
|
+
inputType = baseType;
|
|
316
|
+
}
|
|
317
|
+
normalizePath(url, inputType);
|
|
318
|
+
const queryHash = url.query + url.hash;
|
|
319
|
+
switch (inputType) {
|
|
320
|
+
// This is impossible, because of the empty checks at the start of the function.
|
|
321
|
+
// case UrlType.Empty:
|
|
322
|
+
case UrlType.Hash:
|
|
323
|
+
case UrlType.Query:
|
|
324
|
+
return queryHash;
|
|
325
|
+
case UrlType.RelativePath: {
|
|
326
|
+
// The first char is always a "/", and we need it to be relative.
|
|
327
|
+
const path = url.path.slice(1);
|
|
328
|
+
if (!path)
|
|
329
|
+
return queryHash || '.';
|
|
330
|
+
if (isRelative(base || input) && !isRelative(path)) {
|
|
331
|
+
// If base started with a leading ".", or there is no base and input started with a ".",
|
|
332
|
+
// then we need to ensure that the relative path starts with a ".". We don't know if
|
|
333
|
+
// relative starts with a "..", though, so check before prepending.
|
|
334
|
+
return './' + path + queryHash;
|
|
335
|
+
}
|
|
336
|
+
return path + queryHash;
|
|
337
|
+
}
|
|
338
|
+
case UrlType.AbsolutePath:
|
|
339
|
+
return url.path + queryHash;
|
|
340
|
+
default:
|
|
341
|
+
return url.scheme + '//' + url.user + url.host + url.port + url.path + queryHash;
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
function resolve$1(input, base) {
|
|
346
|
+
// The base is always treated as a directory, if it's not empty.
|
|
347
|
+
// https://github.com/mozilla/source-map/blob/8cb3ee57/lib/util.js#L327
|
|
348
|
+
// https://github.com/chromium/chromium/blob/da4adbb3/third_party/blink/renderer/devtools/front_end/sdk/SourceMap.js#L400-L401
|
|
349
|
+
if (base && !base.endsWith('/'))
|
|
350
|
+
base += '/';
|
|
351
|
+
return resolve$2(input, base);
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
/**
|
|
355
|
+
* Removes everything after the last "/", but leaves the slash.
|
|
356
|
+
*/
|
|
357
|
+
function stripFilename(path) {
|
|
358
|
+
if (!path)
|
|
359
|
+
return '';
|
|
360
|
+
const index = path.lastIndexOf('/');
|
|
361
|
+
return path.slice(0, index + 1);
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
const COLUMN = 0;
|
|
365
|
+
const SOURCES_INDEX = 1;
|
|
366
|
+
const SOURCE_LINE = 2;
|
|
367
|
+
const SOURCE_COLUMN = 3;
|
|
368
|
+
const NAMES_INDEX = 4;
|
|
369
|
+
const REV_GENERATED_LINE = 1;
|
|
370
|
+
const REV_GENERATED_COLUMN = 2;
|
|
371
|
+
|
|
372
|
+
function maybeSort(mappings, owned) {
|
|
373
|
+
const unsortedIndex = nextUnsortedSegmentLine(mappings, 0);
|
|
374
|
+
if (unsortedIndex === mappings.length)
|
|
375
|
+
return mappings;
|
|
376
|
+
// If we own the array (meaning we parsed it from JSON), then we're free to directly mutate it. If
|
|
377
|
+
// not, we do not want to modify the consumer's input array.
|
|
378
|
+
if (!owned)
|
|
379
|
+
mappings = mappings.slice();
|
|
380
|
+
for (let i = unsortedIndex; i < mappings.length; i = nextUnsortedSegmentLine(mappings, i + 1)) {
|
|
381
|
+
mappings[i] = sortSegments(mappings[i], owned);
|
|
382
|
+
}
|
|
383
|
+
return mappings;
|
|
384
|
+
}
|
|
385
|
+
function nextUnsortedSegmentLine(mappings, start) {
|
|
386
|
+
for (let i = start; i < mappings.length; i++) {
|
|
387
|
+
if (!isSorted(mappings[i]))
|
|
388
|
+
return i;
|
|
389
|
+
}
|
|
390
|
+
return mappings.length;
|
|
391
|
+
}
|
|
392
|
+
function isSorted(line) {
|
|
393
|
+
for (let j = 1; j < line.length; j++) {
|
|
394
|
+
if (line[j][COLUMN] < line[j - 1][COLUMN]) {
|
|
395
|
+
return false;
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
return true;
|
|
399
|
+
}
|
|
400
|
+
function sortSegments(line, owned) {
|
|
401
|
+
if (!owned)
|
|
402
|
+
line = line.slice();
|
|
403
|
+
return line.sort(sortComparator);
|
|
404
|
+
}
|
|
405
|
+
function sortComparator(a, b) {
|
|
406
|
+
return a[COLUMN] - b[COLUMN];
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
let found = false;
|
|
410
|
+
/**
|
|
411
|
+
* A binary search implementation that returns the index if a match is found.
|
|
412
|
+
* If no match is found, then the left-index (the index associated with the item that comes just
|
|
413
|
+
* before the desired index) is returned. To maintain proper sort order, a splice would happen at
|
|
414
|
+
* the next index:
|
|
415
|
+
*
|
|
416
|
+
* ```js
|
|
417
|
+
* const array = [1, 3];
|
|
418
|
+
* const needle = 2;
|
|
419
|
+
* const index = binarySearch(array, needle, (item, needle) => item - needle);
|
|
420
|
+
*
|
|
421
|
+
* assert.equal(index, 0);
|
|
422
|
+
* array.splice(index + 1, 0, needle);
|
|
423
|
+
* assert.deepEqual(array, [1, 2, 3]);
|
|
424
|
+
* ```
|
|
425
|
+
*/
|
|
426
|
+
function binarySearch(haystack, needle, low, high) {
|
|
427
|
+
while (low <= high) {
|
|
428
|
+
const mid = low + ((high - low) >> 1);
|
|
429
|
+
const cmp = haystack[mid][COLUMN] - needle;
|
|
430
|
+
if (cmp === 0) {
|
|
431
|
+
found = true;
|
|
432
|
+
return mid;
|
|
433
|
+
}
|
|
434
|
+
if (cmp < 0) {
|
|
435
|
+
low = mid + 1;
|
|
436
|
+
}
|
|
437
|
+
else {
|
|
438
|
+
high = mid - 1;
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
found = false;
|
|
442
|
+
return low - 1;
|
|
443
|
+
}
|
|
444
|
+
function upperBound(haystack, needle, index) {
|
|
445
|
+
for (let i = index + 1; i < haystack.length; index = i++) {
|
|
446
|
+
if (haystack[i][COLUMN] !== needle)
|
|
447
|
+
break;
|
|
448
|
+
}
|
|
449
|
+
return index;
|
|
450
|
+
}
|
|
451
|
+
function lowerBound(haystack, needle, index) {
|
|
452
|
+
for (let i = index - 1; i >= 0; index = i--) {
|
|
453
|
+
if (haystack[i][COLUMN] !== needle)
|
|
454
|
+
break;
|
|
455
|
+
}
|
|
456
|
+
return index;
|
|
457
|
+
}
|
|
458
|
+
function memoizedState() {
|
|
459
|
+
return {
|
|
460
|
+
lastKey: -1,
|
|
461
|
+
lastNeedle: -1,
|
|
462
|
+
lastIndex: -1,
|
|
463
|
+
};
|
|
464
|
+
}
|
|
465
|
+
/**
|
|
466
|
+
* This overly complicated beast is just to record the last tested line/column and the resulting
|
|
467
|
+
* index, allowing us to skip a few tests if mappings are monotonically increasing.
|
|
468
|
+
*/
|
|
469
|
+
function memoizedBinarySearch(haystack, needle, state, key) {
|
|
470
|
+
const { lastKey, lastNeedle, lastIndex } = state;
|
|
471
|
+
let low = 0;
|
|
472
|
+
let high = haystack.length - 1;
|
|
473
|
+
if (key === lastKey) {
|
|
474
|
+
if (needle === lastNeedle) {
|
|
475
|
+
found = lastIndex !== -1 && haystack[lastIndex][COLUMN] === needle;
|
|
476
|
+
return lastIndex;
|
|
477
|
+
}
|
|
478
|
+
if (needle >= lastNeedle) {
|
|
479
|
+
// lastIndex may be -1 if the previous needle was not found.
|
|
480
|
+
low = lastIndex === -1 ? 0 : lastIndex;
|
|
481
|
+
}
|
|
482
|
+
else {
|
|
483
|
+
high = lastIndex;
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
state.lastKey = key;
|
|
487
|
+
state.lastNeedle = needle;
|
|
488
|
+
return (state.lastIndex = binarySearch(haystack, needle, low, high));
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
// Rebuilds the original source files, with mappings that are ordered by source line/column instead
|
|
492
|
+
// of generated line/column.
|
|
493
|
+
function buildBySources(decoded, memos) {
|
|
494
|
+
const sources = memos.map(buildNullArray);
|
|
495
|
+
for (let i = 0; i < decoded.length; i++) {
|
|
496
|
+
const line = decoded[i];
|
|
497
|
+
for (let j = 0; j < line.length; j++) {
|
|
498
|
+
const seg = line[j];
|
|
499
|
+
if (seg.length === 1)
|
|
500
|
+
continue;
|
|
501
|
+
const sourceIndex = seg[SOURCES_INDEX];
|
|
502
|
+
const sourceLine = seg[SOURCE_LINE];
|
|
503
|
+
const sourceColumn = seg[SOURCE_COLUMN];
|
|
504
|
+
const originalSource = sources[sourceIndex];
|
|
505
|
+
const originalLine = (originalSource[sourceLine] || (originalSource[sourceLine] = []));
|
|
506
|
+
const memo = memos[sourceIndex];
|
|
507
|
+
// The binary search either found a match, or it found the left-index just before where the
|
|
508
|
+
// segment should go. Either way, we want to insert after that. And there may be multiple
|
|
509
|
+
// generated segments associated with an original location, so there may need to move several
|
|
510
|
+
// indexes before we find where we need to insert.
|
|
511
|
+
let index = upperBound(originalLine, sourceColumn, memoizedBinarySearch(originalLine, sourceColumn, memo, sourceLine));
|
|
512
|
+
memo.lastIndex = ++index;
|
|
513
|
+
insert(originalLine, index, [sourceColumn, i, seg[COLUMN]]);
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
return sources;
|
|
517
|
+
}
|
|
518
|
+
function insert(array, index, value) {
|
|
519
|
+
for (let i = array.length; i > index; i--) {
|
|
520
|
+
array[i] = array[i - 1];
|
|
521
|
+
}
|
|
522
|
+
array[index] = value;
|
|
523
|
+
}
|
|
524
|
+
// Null arrays allow us to use ordered index keys without actually allocating contiguous memory like
|
|
525
|
+
// a real array. We use a null-prototype object to avoid prototype pollution and deoptimizations.
|
|
526
|
+
// Numeric properties on objects are magically sorted in ascending order by the engine regardless of
|
|
527
|
+
// the insertion order. So, by setting any numeric keys, even out of order, we'll get ascending
|
|
528
|
+
// order when iterating with for-in.
|
|
529
|
+
function buildNullArray() {
|
|
530
|
+
return { __proto__: null };
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
const LINE_GTR_ZERO = '`line` must be greater than 0 (lines start at line 1)';
|
|
534
|
+
const COL_GTR_EQ_ZERO = '`column` must be greater than or equal to 0 (columns start at column 0)';
|
|
535
|
+
const LEAST_UPPER_BOUND = -1;
|
|
536
|
+
const GREATEST_LOWER_BOUND = 1;
|
|
537
|
+
class TraceMap {
|
|
538
|
+
constructor(map, mapUrl) {
|
|
539
|
+
const isString = typeof map === 'string';
|
|
540
|
+
if (!isString && map._decodedMemo)
|
|
541
|
+
return map;
|
|
542
|
+
const parsed = (isString ? JSON.parse(map) : map);
|
|
543
|
+
const { version, file, names, sourceRoot, sources, sourcesContent } = parsed;
|
|
544
|
+
this.version = version;
|
|
545
|
+
this.file = file;
|
|
546
|
+
this.names = names || [];
|
|
547
|
+
this.sourceRoot = sourceRoot;
|
|
548
|
+
this.sources = sources;
|
|
549
|
+
this.sourcesContent = sourcesContent;
|
|
550
|
+
this.ignoreList = parsed.ignoreList || parsed.x_google_ignoreList || undefined;
|
|
551
|
+
const from = resolve$1(sourceRoot || '', stripFilename(mapUrl));
|
|
552
|
+
this.resolvedSources = sources.map((s) => resolve$1(s || '', from));
|
|
553
|
+
const { mappings } = parsed;
|
|
554
|
+
if (typeof mappings === 'string') {
|
|
555
|
+
this._encoded = mappings;
|
|
556
|
+
this._decoded = undefined;
|
|
557
|
+
}
|
|
558
|
+
else {
|
|
559
|
+
this._encoded = undefined;
|
|
560
|
+
this._decoded = maybeSort(mappings, isString);
|
|
561
|
+
}
|
|
562
|
+
this._decodedMemo = memoizedState();
|
|
563
|
+
this._bySources = undefined;
|
|
564
|
+
this._bySourceMemos = undefined;
|
|
565
|
+
}
|
|
566
|
+
}
|
|
567
|
+
/**
|
|
568
|
+
* Typescript doesn't allow friend access to private fields, so this just casts the map into a type
|
|
569
|
+
* with public access modifiers.
|
|
570
|
+
*/
|
|
571
|
+
function cast(map) {
|
|
572
|
+
return map;
|
|
573
|
+
}
|
|
574
|
+
/**
|
|
575
|
+
* Returns the decoded (array of lines of segments) form of the SourceMap's mappings field.
|
|
576
|
+
*/
|
|
577
|
+
function decodedMappings(map) {
|
|
578
|
+
var _a;
|
|
579
|
+
return ((_a = cast(map))._decoded || (_a._decoded = decode(cast(map)._encoded)));
|
|
580
|
+
}
|
|
581
|
+
/**
|
|
582
|
+
* A higher-level API to find the source/line/column associated with a generated line/column
|
|
583
|
+
* (think, from a stack trace). Line is 1-based, but column is 0-based, due to legacy behavior in
|
|
584
|
+
* `source-map` library.
|
|
585
|
+
*/
|
|
586
|
+
function originalPositionFor(map, needle) {
|
|
587
|
+
let { line, column, bias } = needle;
|
|
588
|
+
line--;
|
|
589
|
+
if (line < 0)
|
|
590
|
+
throw new Error(LINE_GTR_ZERO);
|
|
591
|
+
if (column < 0)
|
|
592
|
+
throw new Error(COL_GTR_EQ_ZERO);
|
|
593
|
+
const decoded = decodedMappings(map);
|
|
594
|
+
// It's common for parent source maps to have pointers to lines that have no
|
|
595
|
+
// mapping (like a "//# sourceMappingURL=") at the end of the child file.
|
|
596
|
+
if (line >= decoded.length)
|
|
597
|
+
return OMapping(null, null, null, null);
|
|
598
|
+
const segments = decoded[line];
|
|
599
|
+
const index = traceSegmentInternal(segments, cast(map)._decodedMemo, line, column, bias || GREATEST_LOWER_BOUND);
|
|
600
|
+
if (index === -1)
|
|
601
|
+
return OMapping(null, null, null, null);
|
|
602
|
+
const segment = segments[index];
|
|
603
|
+
if (segment.length === 1)
|
|
604
|
+
return OMapping(null, null, null, null);
|
|
605
|
+
const { names, resolvedSources } = map;
|
|
606
|
+
return OMapping(resolvedSources[segment[SOURCES_INDEX]], segment[SOURCE_LINE] + 1, segment[SOURCE_COLUMN], segment.length === 5 ? names[segment[NAMES_INDEX]] : null);
|
|
607
|
+
}
|
|
608
|
+
/**
|
|
609
|
+
* Finds the generated line/column position of the provided source/line/column source position.
|
|
610
|
+
*/
|
|
611
|
+
function generatedPositionFor(map, needle) {
|
|
612
|
+
const { source, line, column, bias } = needle;
|
|
613
|
+
return generatedPosition(map, source, line, column, bias || GREATEST_LOWER_BOUND, false);
|
|
614
|
+
}
|
|
615
|
+
/**
|
|
616
|
+
* Iterates each mapping in generated position order.
|
|
617
|
+
*/
|
|
618
|
+
function eachMapping(map, cb) {
|
|
619
|
+
const decoded = decodedMappings(map);
|
|
620
|
+
const { names, resolvedSources } = map;
|
|
621
|
+
for (let i = 0; i < decoded.length; i++) {
|
|
622
|
+
const line = decoded[i];
|
|
623
|
+
for (let j = 0; j < line.length; j++) {
|
|
624
|
+
const seg = line[j];
|
|
625
|
+
const generatedLine = i + 1;
|
|
626
|
+
const generatedColumn = seg[0];
|
|
627
|
+
let source = null;
|
|
628
|
+
let originalLine = null;
|
|
629
|
+
let originalColumn = null;
|
|
630
|
+
let name = null;
|
|
631
|
+
if (seg.length !== 1) {
|
|
632
|
+
source = resolvedSources[seg[1]];
|
|
633
|
+
originalLine = seg[2] + 1;
|
|
634
|
+
originalColumn = seg[3];
|
|
635
|
+
}
|
|
636
|
+
if (seg.length === 5)
|
|
637
|
+
name = names[seg[4]];
|
|
638
|
+
cb({
|
|
639
|
+
generatedLine,
|
|
640
|
+
generatedColumn,
|
|
641
|
+
source,
|
|
642
|
+
originalLine,
|
|
643
|
+
originalColumn,
|
|
644
|
+
name,
|
|
645
|
+
});
|
|
646
|
+
}
|
|
647
|
+
}
|
|
648
|
+
}
|
|
649
|
+
function OMapping(source, line, column, name) {
|
|
650
|
+
return { source, line, column, name };
|
|
651
|
+
}
|
|
652
|
+
function GMapping(line, column) {
|
|
653
|
+
return { line, column };
|
|
654
|
+
}
|
|
655
|
+
function traceSegmentInternal(segments, memo, line, column, bias) {
|
|
656
|
+
let index = memoizedBinarySearch(segments, column, memo, line);
|
|
657
|
+
if (found) {
|
|
658
|
+
index = (bias === LEAST_UPPER_BOUND ? upperBound : lowerBound)(segments, column, index);
|
|
659
|
+
}
|
|
660
|
+
else if (bias === LEAST_UPPER_BOUND)
|
|
661
|
+
index++;
|
|
662
|
+
if (index === -1 || index === segments.length)
|
|
663
|
+
return -1;
|
|
664
|
+
return index;
|
|
665
|
+
}
|
|
666
|
+
function generatedPosition(map, source, line, column, bias, all) {
|
|
667
|
+
var _a;
|
|
668
|
+
line--;
|
|
669
|
+
if (line < 0)
|
|
670
|
+
throw new Error(LINE_GTR_ZERO);
|
|
671
|
+
if (column < 0)
|
|
672
|
+
throw new Error(COL_GTR_EQ_ZERO);
|
|
673
|
+
const { sources, resolvedSources } = map;
|
|
674
|
+
let sourceIndex = sources.indexOf(source);
|
|
675
|
+
if (sourceIndex === -1)
|
|
676
|
+
sourceIndex = resolvedSources.indexOf(source);
|
|
677
|
+
if (sourceIndex === -1)
|
|
678
|
+
return all ? [] : GMapping(null, null);
|
|
679
|
+
const generated = ((_a = cast(map))._bySources || (_a._bySources = buildBySources(decodedMappings(map), (cast(map)._bySourceMemos = sources.map(memoizedState)))));
|
|
680
|
+
const segments = generated[sourceIndex][line];
|
|
681
|
+
if (segments == null)
|
|
682
|
+
return all ? [] : GMapping(null, null);
|
|
683
|
+
const memo = cast(map)._bySourceMemos[sourceIndex];
|
|
684
|
+
const index = traceSegmentInternal(segments, memo, line, column, bias);
|
|
685
|
+
if (index === -1)
|
|
686
|
+
return GMapping(null, null);
|
|
687
|
+
const segment = segments[index];
|
|
688
|
+
return GMapping(segment[REV_GENERATED_LINE] + 1, segment[REV_GENERATED_COLUMN]);
|
|
689
|
+
}
|
|
690
|
+
|
|
691
|
+
const _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
|
|
692
|
+
function normalizeWindowsPath(input = "") {
|
|
693
|
+
if (!input) {
|
|
694
|
+
return input;
|
|
695
|
+
}
|
|
696
|
+
return input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase());
|
|
697
|
+
}
|
|
698
|
+
const _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;
|
|
699
|
+
function cwd() {
|
|
700
|
+
if (typeof process !== "undefined" && typeof process.cwd === "function") {
|
|
701
|
+
return process.cwd().replace(/\\/g, "/");
|
|
702
|
+
}
|
|
703
|
+
return "/";
|
|
704
|
+
}
|
|
705
|
+
const resolve = function(...arguments_) {
|
|
706
|
+
arguments_ = arguments_.map((argument) => normalizeWindowsPath(argument));
|
|
707
|
+
let resolvedPath = "";
|
|
708
|
+
let resolvedAbsolute = false;
|
|
709
|
+
for (let index = arguments_.length - 1; index >= -1 && !resolvedAbsolute; index--) {
|
|
710
|
+
const path = index >= 0 ? arguments_[index] : cwd();
|
|
711
|
+
if (!path || path.length === 0) {
|
|
712
|
+
continue;
|
|
713
|
+
}
|
|
714
|
+
resolvedPath = `${path}/${resolvedPath}`;
|
|
715
|
+
resolvedAbsolute = isAbsolute(path);
|
|
716
|
+
}
|
|
717
|
+
resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute);
|
|
718
|
+
if (resolvedAbsolute && !isAbsolute(resolvedPath)) {
|
|
719
|
+
return `/${resolvedPath}`;
|
|
720
|
+
}
|
|
721
|
+
return resolvedPath.length > 0 ? resolvedPath : ".";
|
|
722
|
+
};
|
|
723
|
+
function normalizeString(path, allowAboveRoot) {
|
|
724
|
+
let res = "";
|
|
725
|
+
let lastSegmentLength = 0;
|
|
726
|
+
let lastSlash = -1;
|
|
727
|
+
let dots = 0;
|
|
728
|
+
let char = null;
|
|
729
|
+
for (let index = 0; index <= path.length; ++index) {
|
|
730
|
+
if (index < path.length) {
|
|
731
|
+
char = path[index];
|
|
732
|
+
} else if (char === "/") {
|
|
733
|
+
break;
|
|
734
|
+
} else {
|
|
735
|
+
char = "/";
|
|
736
|
+
}
|
|
737
|
+
if (char === "/") {
|
|
738
|
+
if (lastSlash === index - 1 || dots === 1) ; else if (dots === 2) {
|
|
739
|
+
if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
|
|
740
|
+
if (res.length > 2) {
|
|
741
|
+
const lastSlashIndex = res.lastIndexOf("/");
|
|
742
|
+
if (lastSlashIndex === -1) {
|
|
743
|
+
res = "";
|
|
744
|
+
lastSegmentLength = 0;
|
|
745
|
+
} else {
|
|
746
|
+
res = res.slice(0, lastSlashIndex);
|
|
747
|
+
lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
|
|
748
|
+
}
|
|
749
|
+
lastSlash = index;
|
|
750
|
+
dots = 0;
|
|
751
|
+
continue;
|
|
752
|
+
} else if (res.length > 0) {
|
|
753
|
+
res = "";
|
|
754
|
+
lastSegmentLength = 0;
|
|
755
|
+
lastSlash = index;
|
|
756
|
+
dots = 0;
|
|
757
|
+
continue;
|
|
758
|
+
}
|
|
759
|
+
}
|
|
760
|
+
if (allowAboveRoot) {
|
|
761
|
+
res += res.length > 0 ? "/.." : "..";
|
|
762
|
+
lastSegmentLength = 2;
|
|
763
|
+
}
|
|
764
|
+
} else {
|
|
765
|
+
if (res.length > 0) {
|
|
766
|
+
res += `/${path.slice(lastSlash + 1, index)}`;
|
|
767
|
+
} else {
|
|
768
|
+
res = path.slice(lastSlash + 1, index);
|
|
769
|
+
}
|
|
770
|
+
lastSegmentLength = index - lastSlash - 1;
|
|
771
|
+
}
|
|
772
|
+
lastSlash = index;
|
|
773
|
+
dots = 0;
|
|
774
|
+
} else if (char === "." && dots !== -1) {
|
|
775
|
+
++dots;
|
|
776
|
+
} else {
|
|
777
|
+
dots = -1;
|
|
778
|
+
}
|
|
779
|
+
}
|
|
780
|
+
return res;
|
|
781
|
+
}
|
|
782
|
+
const isAbsolute = function(p) {
|
|
783
|
+
return _IS_ABSOLUTE_RE.test(p);
|
|
784
|
+
};
|
|
785
|
+
|
|
786
|
+
const CHROME_IE_STACK_REGEXP = /^\s*at .*(?:\S:\d+|\(native\))/m;
|
|
787
|
+
const SAFARI_NATIVE_CODE_REGEXP = /^(?:eval@)?(?:\[native code\])?$/;
|
|
788
|
+
const stackIgnorePatterns = [
|
|
789
|
+
"node:internal",
|
|
790
|
+
/\/packages\/\w+\/dist\//,
|
|
791
|
+
/\/@vitest\/\w+\/dist\//,
|
|
792
|
+
"/vitest/dist/",
|
|
793
|
+
"/vitest/src/",
|
|
794
|
+
"/vite-node/dist/",
|
|
795
|
+
"/vite-node/src/",
|
|
796
|
+
"/node_modules/chai/",
|
|
797
|
+
"/node_modules/tinypool/",
|
|
798
|
+
"/node_modules/tinyspy/",
|
|
799
|
+
"/deps/chunk-",
|
|
800
|
+
"/deps/@vitest",
|
|
801
|
+
"/deps/loupe",
|
|
802
|
+
"/deps/chai",
|
|
803
|
+
/node:\w+/,
|
|
804
|
+
/__vitest_test__/,
|
|
805
|
+
/__vitest_browser__/,
|
|
806
|
+
/\/deps\/vitest_/
|
|
807
|
+
];
|
|
808
|
+
function extractLocation(urlLike) {
|
|
809
|
+
// Fail-fast but return locations like "(native)"
|
|
810
|
+
if (!urlLike.includes(":")) {
|
|
811
|
+
return [urlLike];
|
|
812
|
+
}
|
|
813
|
+
const regExp = /(.+?)(?::(\d+))?(?::(\d+))?$/;
|
|
814
|
+
const parts = regExp.exec(urlLike.replace(/^\(|\)$/g, ""));
|
|
815
|
+
if (!parts) {
|
|
816
|
+
return [urlLike];
|
|
817
|
+
}
|
|
818
|
+
let url = parts[1];
|
|
819
|
+
if (url.startsWith("async ")) {
|
|
820
|
+
url = url.slice(6);
|
|
821
|
+
}
|
|
822
|
+
if (url.startsWith("http:") || url.startsWith("https:")) {
|
|
823
|
+
const urlObj = new URL(url);
|
|
824
|
+
urlObj.searchParams.delete("import");
|
|
825
|
+
urlObj.searchParams.delete("browserv");
|
|
826
|
+
url = urlObj.pathname + urlObj.hash + urlObj.search;
|
|
827
|
+
}
|
|
828
|
+
if (url.startsWith("/@fs/")) {
|
|
829
|
+
const isWindows = /^\/@fs\/[a-zA-Z]:\//.test(url);
|
|
830
|
+
url = url.slice(isWindows ? 5 : 4);
|
|
831
|
+
}
|
|
832
|
+
return [
|
|
833
|
+
url,
|
|
834
|
+
parts[2] || undefined,
|
|
835
|
+
parts[3] || undefined
|
|
836
|
+
];
|
|
837
|
+
}
|
|
838
|
+
function parseSingleFFOrSafariStack(raw) {
|
|
839
|
+
let line = raw.trim();
|
|
840
|
+
if (SAFARI_NATIVE_CODE_REGEXP.test(line)) {
|
|
841
|
+
return null;
|
|
842
|
+
}
|
|
843
|
+
if (line.includes(" > eval")) {
|
|
844
|
+
line = line.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g, ":$1");
|
|
845
|
+
}
|
|
846
|
+
if (!line.includes("@") && !line.includes(":")) {
|
|
847
|
+
return null;
|
|
848
|
+
}
|
|
849
|
+
// eslint-disable-next-line regexp/no-super-linear-backtracking, regexp/optimal-quantifier-concatenation
|
|
850
|
+
const functionNameRegex = /((.*".+"[^@]*)?[^@]*)(@)/;
|
|
851
|
+
const matches = line.match(functionNameRegex);
|
|
852
|
+
const functionName = matches && matches[1] ? matches[1] : undefined;
|
|
853
|
+
const [url, lineNumber, columnNumber] = extractLocation(line.replace(functionNameRegex, ""));
|
|
854
|
+
if (!url || !lineNumber || !columnNumber) {
|
|
855
|
+
return null;
|
|
856
|
+
}
|
|
857
|
+
return {
|
|
858
|
+
file: url,
|
|
859
|
+
method: functionName || "",
|
|
860
|
+
line: Number.parseInt(lineNumber),
|
|
861
|
+
column: Number.parseInt(columnNumber)
|
|
862
|
+
};
|
|
863
|
+
}
|
|
864
|
+
function parseSingleStack(raw) {
|
|
865
|
+
const line = raw.trim();
|
|
866
|
+
if (!CHROME_IE_STACK_REGEXP.test(line)) {
|
|
867
|
+
return parseSingleFFOrSafariStack(line);
|
|
868
|
+
}
|
|
869
|
+
return parseSingleV8Stack(line);
|
|
870
|
+
}
|
|
871
|
+
// Based on https://github.com/stacktracejs/error-stack-parser
|
|
872
|
+
// Credit to stacktracejs
|
|
873
|
+
function parseSingleV8Stack(raw) {
|
|
874
|
+
let line = raw.trim();
|
|
875
|
+
if (!CHROME_IE_STACK_REGEXP.test(line)) {
|
|
876
|
+
return null;
|
|
877
|
+
}
|
|
878
|
+
if (line.includes("(eval ")) {
|
|
879
|
+
line = line.replace(/eval code/g, "eval").replace(/(\(eval at [^()]*)|(,.*$)/g, "");
|
|
880
|
+
}
|
|
881
|
+
let sanitizedLine = line.replace(/^\s+/, "").replace(/\(eval code/g, "(").replace(/^.*?\s+/, "");
|
|
882
|
+
// capture and preserve the parenthesized location "(/foo/my bar.js:12:87)" in
|
|
883
|
+
// case it has spaces in it, as the string is split on \s+ later on
|
|
884
|
+
const location = sanitizedLine.match(/ (\(.+\)$)/);
|
|
885
|
+
// remove the parenthesized location from the line, if it was matched
|
|
886
|
+
sanitizedLine = location ? sanitizedLine.replace(location[0], "") : sanitizedLine;
|
|
887
|
+
// if a location was matched, pass it to extractLocation() otherwise pass all sanitizedLine
|
|
888
|
+
// because this line doesn't have function name
|
|
889
|
+
const [url, lineNumber, columnNumber] = extractLocation(location ? location[1] : sanitizedLine);
|
|
890
|
+
let method = location && sanitizedLine || "";
|
|
891
|
+
let file = url && ["eval", "<anonymous>"].includes(url) ? undefined : url;
|
|
892
|
+
if (!file || !lineNumber || !columnNumber) {
|
|
893
|
+
return null;
|
|
894
|
+
}
|
|
895
|
+
if (method.startsWith("async ")) {
|
|
896
|
+
method = method.slice(6);
|
|
897
|
+
}
|
|
898
|
+
if (file.startsWith("file://")) {
|
|
899
|
+
file = file.slice(7);
|
|
900
|
+
}
|
|
901
|
+
// normalize Windows path (\ -> /)
|
|
902
|
+
file = file.startsWith("node:") || file.startsWith("internal:") ? file : resolve(file);
|
|
903
|
+
if (method) {
|
|
904
|
+
method = method.replace(/__vite_ssr_import_\d+__\./g, "");
|
|
905
|
+
}
|
|
906
|
+
return {
|
|
907
|
+
method,
|
|
908
|
+
file,
|
|
909
|
+
line: Number.parseInt(lineNumber),
|
|
910
|
+
column: Number.parseInt(columnNumber)
|
|
911
|
+
};
|
|
912
|
+
}
|
|
913
|
+
function createStackString(stacks) {
|
|
914
|
+
return stacks.map((stack) => {
|
|
915
|
+
const line = `${stack.file}:${stack.line}:${stack.column}`;
|
|
916
|
+
if (stack.method) {
|
|
917
|
+
return ` at ${stack.method}(${line})`;
|
|
918
|
+
}
|
|
919
|
+
return ` at ${line}`;
|
|
920
|
+
}).join("\n");
|
|
921
|
+
}
|
|
922
|
+
function parseStacktrace(stack, options = {}) {
|
|
923
|
+
const { ignoreStackEntries = stackIgnorePatterns } = options;
|
|
924
|
+
const stacks = !CHROME_IE_STACK_REGEXP.test(stack) ? parseFFOrSafariStackTrace(stack) : parseV8Stacktrace(stack);
|
|
925
|
+
return stacks.map((stack) => {
|
|
926
|
+
var _options$getSourceMap;
|
|
927
|
+
if (options.getUrlId) {
|
|
928
|
+
stack.file = options.getUrlId(stack.file);
|
|
929
|
+
}
|
|
930
|
+
const map = (_options$getSourceMap = options.getSourceMap) === null || _options$getSourceMap === void 0 ? void 0 : _options$getSourceMap.call(options, stack.file);
|
|
931
|
+
if (!map || typeof map !== "object" || !map.version) {
|
|
932
|
+
return shouldFilter(ignoreStackEntries, stack.file) ? null : stack;
|
|
933
|
+
}
|
|
934
|
+
const traceMap = new TraceMap(map);
|
|
935
|
+
const { line, column, source, name } = originalPositionFor(traceMap, stack);
|
|
936
|
+
let file = stack.file;
|
|
937
|
+
if (source) {
|
|
938
|
+
const fileUrl = stack.file.startsWith("file://") ? stack.file : `file://${stack.file}`;
|
|
939
|
+
const sourceRootUrl = map.sourceRoot ? new URL(map.sourceRoot, fileUrl) : fileUrl;
|
|
940
|
+
file = new URL(source, sourceRootUrl).pathname;
|
|
941
|
+
// if the file path is on windows, we need to remove the leading slash
|
|
942
|
+
if (file.match(/\/\w:\//)) {
|
|
943
|
+
file = file.slice(1);
|
|
944
|
+
}
|
|
945
|
+
}
|
|
946
|
+
if (shouldFilter(ignoreStackEntries, file)) {
|
|
947
|
+
return null;
|
|
948
|
+
}
|
|
949
|
+
if (line != null && column != null) {
|
|
950
|
+
return {
|
|
951
|
+
line,
|
|
952
|
+
column,
|
|
953
|
+
file,
|
|
954
|
+
method: name || stack.method
|
|
955
|
+
};
|
|
956
|
+
}
|
|
957
|
+
return stack;
|
|
958
|
+
}).filter((s) => s != null);
|
|
959
|
+
}
|
|
960
|
+
function shouldFilter(ignoreStackEntries, file) {
|
|
961
|
+
return ignoreStackEntries.some((p) => file.match(p));
|
|
962
|
+
}
|
|
963
|
+
function parseFFOrSafariStackTrace(stack) {
|
|
964
|
+
return stack.split("\n").map((line) => parseSingleFFOrSafariStack(line)).filter(notNullish);
|
|
965
|
+
}
|
|
966
|
+
function parseV8Stacktrace(stack) {
|
|
967
|
+
return stack.split("\n").map((line) => parseSingleV8Stack(line)).filter(notNullish);
|
|
968
|
+
}
|
|
969
|
+
function parseErrorStacktrace(e, options = {}) {
|
|
970
|
+
if (!e || isPrimitive(e)) {
|
|
971
|
+
return [];
|
|
972
|
+
}
|
|
973
|
+
if (e.stacks) {
|
|
974
|
+
return e.stacks;
|
|
975
|
+
}
|
|
976
|
+
const stackStr = e.stack || "";
|
|
977
|
+
// if "stack" property was overwritten at runtime to be something else,
|
|
978
|
+
// ignore the value because we don't know how to process it
|
|
979
|
+
let stackFrames = typeof stackStr === "string" ? parseStacktrace(stackStr, options) : [];
|
|
980
|
+
if (!stackFrames.length) {
|
|
981
|
+
const e_ = e;
|
|
982
|
+
if (e_.fileName != null && e_.lineNumber != null && e_.columnNumber != null) {
|
|
983
|
+
stackFrames = parseStacktrace(`${e_.fileName}:${e_.lineNumber}:${e_.columnNumber}`, options);
|
|
984
|
+
}
|
|
985
|
+
if (e_.sourceURL != null && e_.line != null && e_._column != null) {
|
|
986
|
+
stackFrames = parseStacktrace(`${e_.sourceURL}:${e_.line}:${e_.column}`, options);
|
|
987
|
+
}
|
|
988
|
+
}
|
|
989
|
+
if (options.frameFilter) {
|
|
990
|
+
stackFrames = stackFrames.filter((f) => options.frameFilter(e, f) !== false);
|
|
991
|
+
}
|
|
992
|
+
e.stacks = stackFrames;
|
|
993
|
+
return stackFrames;
|
|
994
|
+
}
|
|
995
|
+
|
|
996
|
+
export { TraceMap, createStackString, eachMapping, generatedPositionFor, originalPositionFor, parseErrorStacktrace, parseSingleFFOrSafariStack, parseSingleStack, parseSingleV8Stack, parseStacktrace };
|