@jingyi0605/codingns 0.8.0 → 0.8.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/codingns.mjs +180 -0
- package/dist/public/assets/{AdaptiveButlerPage-BsgVNRAa.js → AdaptiveButlerPage-CJw8Ae62.js} +3 -3
- package/dist/public/assets/App-BOHBGFOd.js +30 -0
- package/dist/public/assets/{BootstrapPage--MDOigQi.js → BootstrapPage-BxHQT4nA.js} +1 -1
- package/dist/public/assets/{ConversationPage-BBss5ED8.js → ConversationPage-DWFsF6BB.js} +6 -6
- package/dist/public/assets/{DesktopDetachPreviewPage-CB8DoqwU.js → DesktopDetachPreviewPage-DOgEjYEf.js} +1 -1
- package/dist/public/assets/DesktopModal-D_A8sgQU.js +1 -0
- package/dist/public/assets/DesktopWindowPage-DK7L7osV.js +2 -0
- package/dist/public/assets/FileContextPanel-BdCoubcJ.js +1 -0
- package/dist/public/assets/GitSidebar-BeZ0hj7A.js +6 -0
- package/dist/public/assets/MobileCreateSessionSheet-DfLMVu8q.js +1 -0
- package/dist/public/assets/MobileSheet-5kZ-w-gU.js +1 -0
- package/dist/public/assets/{MobileTopHeaderFrame-DGVOzXyg.js → MobileTopHeaderFrame-lcp2GscV.js} +1 -1
- package/dist/public/assets/MobileWorkspaceSwitcherHeader-C6JMiOq_.js +1 -0
- package/dist/public/assets/PluginAccessOverview-DGcKAMQl.js +1 -0
- package/dist/public/assets/PluginContainerPage-BlY-xJDh.js +1 -0
- package/dist/public/assets/PluginDetailPage-CAJ7LFpD.js +1 -0
- package/dist/public/assets/PluginsListPage-BxZG1NyT.js +1 -0
- package/dist/public/assets/{RelayConnectEntryPage-0MPPjxtQ.js → RelayConnectEntryPage-CfNO_TIl.js} +1 -1
- package/dist/public/assets/ServerSettingsModal-by36Z_5k.js +1 -0
- package/dist/public/assets/SessionIndexPage-DkBp9Mqz.js +1 -0
- package/dist/public/assets/SettingsPage-C-ASmJAG.js +2 -0
- package/dist/public/assets/TerminalManagerPanel-NVZRxxmH.js +1 -0
- package/dist/public/assets/{TerminalPage-B6Rdhylx.js → TerminalPage-C4LNoPBp.js} +3 -3
- package/dist/public/assets/TerminalRuntimeFallbackModal-Bzum5nZ0.js +1 -0
- package/dist/public/assets/ToolFilesPage-47zbdgTW.js +1 -0
- package/dist/public/assets/ToolGitPage-Fuk_b_jg.js +1 -0
- package/dist/public/assets/ToolProcessesPage-sWSMWD-9.js +1 -0
- package/dist/public/assets/ToolsHomePage-R1mZlbZi.js +1 -0
- package/dist/public/assets/WorkbenchLandingPage-CqmiFH2u.js +1 -0
- package/dist/public/assets/WorkbenchLayout-OFi6CWgH.js +244 -0
- package/dist/public/assets/WorkbenchModal-C7qoQElW.js +1 -0
- package/dist/public/assets/WorkbenchShellRoute-BAQe_E0O.js +1 -0
- package/dist/public/assets/WorkspaceDebugDetailPage-DhKa6e9y.js +1 -0
- package/dist/public/assets/WorkspaceDetailPage-BPsrFffw.js +1 -0
- package/dist/public/assets/WorkspaceHomePage-KAtqZOAb.js +1 -0
- package/dist/public/assets/{client-runtime-manager-DGdKvYzx.js → client-runtime-manager-wmCJZKYd.js} +1 -1
- package/dist/public/assets/file-tree-icon-Mg1DiBRX.js +590 -0
- package/dist/public/assets/{index-CcaQt50x.css → index-C4t-vvqk.css} +1 -1
- package/dist/public/assets/index-CL97fwWB.js +42 -0
- package/dist/public/assets/{login-direct-candidate-resolver-DEP_xCmR.js → login-direct-candidate-resolver-BOAgTuUf.js} +1 -1
- package/dist/public/assets/plugin-permission-copy-Cq99cnzV.js +1 -0
- package/dist/public/assets/plugins-api-BQTV5DOp.js +1 -0
- package/dist/public/assets/{preferences-service-CV6Ih0BG.js → preferences-service-DJxbEEeg.js} +1 -1
- package/dist/public/assets/realtime-client-CLafKzzJ.js +1 -0
- package/dist/public/assets/{relay-entry-C751A-Sm.js → relay-entry-D-LfvdiX.js} +1 -1
- package/dist/public/assets/{terminal-runtime-meta-CRAVR-8G.js → terminal-runtime-meta-BJmy8dyK.js} +1 -1
- package/dist/public/assets/useRegisteredDebugTemplates-DQAWVdCo.js +1 -0
- package/dist/public/assets/workbench-navigation-MEzCSmsK.js +1 -0
- package/dist/public/index.html +2 -2
- package/dist/server/config/env.d.ts +1 -0
- package/dist/server/config/env.js +4 -0
- package/dist/server/config/env.js.map +1 -1
- package/dist/server/helpers/wechat-claw-runtime/modules/runtime-state-store.js +1 -1
- package/dist/server/helpers/wechat-claw-runtime/modules/runtime-state-store.js.map +1 -1
- package/dist/server/main.js +2 -0
- package/dist/server/main.js.map +1 -1
- package/dist/server/modules/assistant-capability/assistant-capability-controller.d.ts +1 -0
- package/dist/server/modules/assistant-capability/assistant-capability-controller.js +1 -0
- package/dist/server/modules/assistant-capability/assistant-capability-controller.js.map +1 -1
- package/dist/server/modules/assistant-capability/assistant-capability-service.d.ts +1 -0
- package/dist/server/modules/assistant-capability/assistant-capability-service.js +1 -0
- package/dist/server/modules/assistant-capability/assistant-capability-service.js.map +1 -1
- package/dist/server/modules/browser-runtime/browser-runtime-controller.d.ts +2 -1
- package/dist/server/modules/browser-runtime/browser-runtime-controller.js +1 -0
- package/dist/server/modules/browser-runtime/browser-runtime-controller.js.map +1 -1
- package/dist/server/modules/browser-runtime/browser-runtime-service.d.ts +4 -1
- package/dist/server/modules/browser-runtime/browser-runtime-service.js +40 -0
- package/dist/server/modules/browser-runtime/browser-runtime-service.js.map +1 -1
- package/dist/server/modules/browser-runtime/browser-task-payload.d.ts +2 -0
- package/dist/server/modules/browser-runtime/browser-task-payload.js.map +1 -1
- package/dist/server/modules/file/file-access-guard.d.ts +2 -0
- package/dist/server/modules/file/file-access-guard.js +24 -2
- package/dist/server/modules/file/file-access-guard.js.map +1 -1
- package/dist/server/modules/file/file-controller.d.ts +153 -1
- package/dist/server/modules/file/file-controller.js +215 -1
- package/dist/server/modules/file/file-controller.js.map +1 -1
- package/dist/server/modules/file/file-preview-link-service.d.ts +2 -0
- package/dist/server/modules/file/file-preview-link-service.js +5 -1
- package/dist/server/modules/file/file-preview-link-service.js.map +1 -1
- package/dist/server/modules/file/runtime/codingns-workspace-bridge.js +911 -0
- package/dist/server/modules/file/workspace-file-bridge-service.d.ts +126 -0
- package/dist/server/modules/file/workspace-file-bridge-service.js +471 -0
- package/dist/server/modules/file/workspace-file-bridge-service.js.map +1 -0
- package/dist/server/modules/file/workspace-file-bridge-watch-service.d.ts +42 -0
- package/dist/server/modules/file/workspace-file-bridge-watch-service.js +304 -0
- package/dist/server/modules/file/workspace-file-bridge-watch-service.js.map +1 -0
- package/dist/server/modules/git/git-command-helper-process.js +0 -18
- package/dist/server/modules/git/git-command-helper-process.js.map +1 -1
- package/dist/server/modules/git/git-command-runner.js +0 -18
- package/dist/server/modules/git/git-command-runner.js.map +1 -1
- package/dist/server/modules/model-switch/cc-switch-adapter.js +1 -1
- package/dist/server/modules/model-switch/cc-switch-adapter.js.map +1 -1
- package/dist/server/modules/plugins/plugin-controller.d.ts +131 -0
- package/dist/server/modules/plugins/plugin-controller.js +277 -0
- package/dist/server/modules/plugins/plugin-controller.js.map +1 -0
- package/dist/server/modules/plugins/plugin-file-gateway-service.d.ts +38 -0
- package/dist/server/modules/plugins/plugin-file-gateway-service.js +178 -0
- package/dist/server/modules/plugins/plugin-file-gateway-service.js.map +1 -0
- package/dist/server/modules/plugins/plugin-manifest.d.ts +8 -0
- package/dist/server/modules/plugins/plugin-manifest.js +420 -0
- package/dist/server/modules/plugins/plugin-manifest.js.map +1 -0
- package/dist/server/modules/plugins/plugin-permission-service.d.ts +49 -0
- package/dist/server/modules/plugins/plugin-permission-service.js +267 -0
- package/dist/server/modules/plugins/plugin-permission-service.js.map +1 -0
- package/dist/server/modules/plugins/plugin-process-runner.d.ts +21 -0
- package/dist/server/modules/plugins/plugin-process-runner.js +127 -0
- package/dist/server/modules/plugins/plugin-process-runner.js.map +1 -0
- package/dist/server/modules/plugins/plugin-registry-service.d.ts +41 -0
- package/dist/server/modules/plugins/plugin-registry-service.js +238 -0
- package/dist/server/modules/plugins/plugin-registry-service.js.map +1 -0
- package/dist/server/modules/plugins/plugin-runtime-service.d.ts +55 -0
- package/dist/server/modules/plugins/plugin-runtime-service.js +252 -0
- package/dist/server/modules/plugins/plugin-runtime-service.js.map +1 -0
- package/dist/server/modules/plugins/plugin-runtime-session-service.d.ts +21 -0
- package/dist/server/modules/plugins/plugin-runtime-session-service.js +83 -0
- package/dist/server/modules/plugins/plugin-runtime-session-service.js.map +1 -0
- package/dist/server/modules/plugins/plugin-scheduler-service.d.ts +31 -0
- package/dist/server/modules/plugins/plugin-scheduler-service.js +232 -0
- package/dist/server/modules/plugins/plugin-scheduler-service.js.map +1 -0
- package/dist/server/modules/plugins/plugin-static-service.d.ts +11 -0
- package/dist/server/modules/plugins/plugin-static-service.js +145 -0
- package/dist/server/modules/plugins/plugin-static-service.js.map +1 -0
- package/dist/server/modules/presentation/presentation-controller.d.ts +3 -0
- package/dist/server/modules/presentation/presentation-controller.js +11 -0
- package/dist/server/modules/presentation/presentation-controller.js.map +1 -1
- package/dist/server/modules/presentation/presentation-export-task-service.d.ts +6 -0
- package/dist/server/modules/presentation/presentation-export-task-service.js +52 -8
- package/dist/server/modules/presentation/presentation-export-task-service.js.map +1 -1
- package/dist/server/modules/presentation/presentation-pptx-export-service.js +200 -14
- package/dist/server/modules/presentation/presentation-pptx-export-service.js.map +1 -1
- package/dist/server/modules/presentation/presentation-renderer.d.ts +50 -0
- package/dist/server/modules/presentation/presentation-renderer.js +450 -37
- package/dist/server/modules/presentation/presentation-renderer.js.map +1 -1
- package/dist/server/modules/sessions/session-live-runtime-service.js +46 -3
- package/dist/server/modules/sessions/session-live-runtime-service.js.map +1 -1
- package/dist/server/modules/sessions/workspace-session-runtime-context-service.d.ts +1 -0
- package/dist/server/modules/sessions/workspace-session-runtime-context-service.js +11 -2
- package/dist/server/modules/sessions/workspace-session-runtime-context-service.js.map +1 -1
- package/dist/server/modules/skills/builtin-skills/codingns-workspace-session/SKILL.md +2 -2
- package/dist/server/modules/tasks/task-types.d.ts +2 -0
- package/dist/server/modules/tasks/task-types.js +2 -0
- package/dist/server/modules/tasks/task-types.js.map +1 -1
- package/dist/server/modules/terminal/runtime/terminal-log-writer-process.js +1 -1
- package/dist/server/modules/terminal/runtime/terminal-log-writer-process.js.map +1 -1
- package/dist/server/routes/files.js +40 -0
- package/dist/server/routes/files.js.map +1 -1
- package/dist/server/routes/plugins-public.d.ts +3 -0
- package/dist/server/routes/plugins-public.js +5 -0
- package/dist/server/routes/plugins-public.js.map +1 -0
- package/dist/server/routes/plugins.d.ts +3 -0
- package/dist/server/routes/plugins.js +19 -0
- package/dist/server/routes/plugins.js.map +1 -0
- package/dist/server/routes/presentation.js +1 -0
- package/dist/server/routes/presentation.js.map +1 -1
- package/dist/server/server/create-server.d.ts +20 -0
- package/dist/server/server/create-server.js +47 -1
- package/dist/server/server/create-server.js.map +1 -1
- package/dist/server/shared/http/error-handler.js +63 -25
- package/dist/server/shared/http/error-handler.js.map +1 -1
- package/dist/server/shared/runtime/better-sqlite3.d.ts +5 -0
- package/dist/server/shared/runtime/better-sqlite3.js +6 -0
- package/dist/server/shared/runtime/better-sqlite3.js.map +1 -0
- package/dist/server/shared/utils/install-console-timestamp-prefix.d.ts +1 -0
- package/dist/server/shared/utils/install-console-timestamp-prefix.js +28 -0
- package/dist/server/shared/utils/install-console-timestamp-prefix.js.map +1 -0
- package/dist/server/storage/repositories/plugin-audit-event-repository.d.ts +8 -0
- package/dist/server/storage/repositories/plugin-audit-event-repository.js +49 -0
- package/dist/server/storage/repositories/plugin-audit-event-repository.js.map +1 -0
- package/dist/server/storage/repositories/plugin-definition-repository.d.ts +10 -0
- package/dist/server/storage/repositories/plugin-definition-repository.js +84 -0
- package/dist/server/storage/repositories/plugin-definition-repository.js.map +1 -0
- package/dist/server/storage/repositories/plugin-enablement-repository.d.ts +9 -0
- package/dist/server/storage/repositories/plugin-enablement-repository.js +74 -0
- package/dist/server/storage/repositories/plugin-enablement-repository.js.map +1 -0
- package/dist/server/storage/repositories/plugin-permission-grant-repository.d.ts +12 -0
- package/dist/server/storage/repositories/plugin-permission-grant-repository.js +142 -0
- package/dist/server/storage/repositories/plugin-permission-grant-repository.js.map +1 -0
- package/dist/server/storage/repositories/plugin-run-repository.d.ts +10 -0
- package/dist/server/storage/repositories/plugin-run-repository.js +111 -0
- package/dist/server/storage/repositories/plugin-run-repository.js.map +1 -0
- package/dist/server/storage/repositories/plugin-runtime-session-repository.d.ts +10 -0
- package/dist/server/storage/repositories/plugin-runtime-session-repository.js +86 -0
- package/dist/server/storage/repositories/plugin-runtime-session-repository.js.map +1 -0
- package/dist/server/storage/sqlite/client.d.ts +2 -2
- package/dist/server/storage/sqlite/client.js +250 -1
- package/dist/server/storage/sqlite/client.js.map +1 -1
- package/dist/server/storage/sqlite/schema.sql +140 -0
- package/dist/server/types/domain.d.ts +122 -0
- package/node_modules/@codingns/session-sync-core/dist/claude-message-utils.d.ts +42 -0
- package/node_modules/@codingns/session-sync-core/dist/claude-message-utils.js +346 -0
- package/node_modules/@codingns/session-sync-core/dist/claude-message-utils.js.map +1 -0
- package/node_modules/@codingns/session-sync-core/dist/codex-resume-history.d.ts +1 -0
- package/node_modules/@codingns/session-sync-core/dist/codex-resume-history.js +80 -0
- package/node_modules/@codingns/session-sync-core/dist/codex-resume-history.js.map +1 -0
- package/node_modules/@codingns/session-sync-core/dist/index.d.ts +18 -0
- package/node_modules/@codingns/session-sync-core/dist/index.js +19 -0
- package/node_modules/@codingns/session-sync-core/dist/index.js.map +1 -0
- package/node_modules/@codingns/session-sync-core/dist/kimi-message-normalizer.d.ts +18 -0
- package/node_modules/@codingns/session-sync-core/dist/kimi-message-normalizer.js +659 -0
- package/node_modules/@codingns/session-sync-core/dist/kimi-message-normalizer.js.map +1 -0
- package/node_modules/@codingns/session-sync-core/dist/kimi-shared.d.ts +11 -0
- package/node_modules/@codingns/session-sync-core/dist/kimi-shared.js +72 -0
- package/node_modules/@codingns/session-sync-core/dist/kimi-shared.js.map +1 -0
- package/node_modules/@codingns/session-sync-core/dist/patch-builder.d.ts +67 -0
- package/node_modules/@codingns/session-sync-core/dist/patch-builder.js +752 -0
- package/node_modules/@codingns/session-sync-core/dist/patch-builder.js.map +1 -0
- package/node_modules/@codingns/session-sync-core/dist/providers/claude-code.d.ts +48 -0
- package/node_modules/@codingns/session-sync-core/dist/providers/claude-code.js +1184 -0
- package/node_modules/@codingns/session-sync-core/dist/providers/claude-code.js.map +1 -0
- package/node_modules/@codingns/session-sync-core/dist/providers/claude-session-store.d.ts +11 -0
- package/node_modules/@codingns/session-sync-core/dist/providers/claude-session-store.js +105 -0
- package/node_modules/@codingns/session-sync-core/dist/providers/claude-session-store.js.map +1 -0
- package/node_modules/@codingns/session-sync-core/dist/providers/codex.d.ts +84 -0
- package/node_modules/@codingns/session-sync-core/dist/providers/codex.js +2436 -0
- package/node_modules/@codingns/session-sync-core/dist/providers/codex.js.map +1 -0
- package/node_modules/@codingns/session-sync-core/dist/providers/gemini.d.ts +47 -0
- package/node_modules/@codingns/session-sync-core/dist/providers/gemini.js +1480 -0
- package/node_modules/@codingns/session-sync-core/dist/providers/gemini.js.map +1 -0
- package/node_modules/@codingns/session-sync-core/dist/providers/kimi.d.ts +33 -0
- package/node_modules/@codingns/session-sync-core/dist/providers/kimi.js +684 -0
- package/node_modules/@codingns/session-sync-core/dist/providers/kimi.js.map +1 -0
- package/node_modules/@codingns/session-sync-core/dist/providers/legna-code.d.ts +9 -0
- package/node_modules/@codingns/session-sync-core/dist/providers/legna-code.js +17 -0
- package/node_modules/@codingns/session-sync-core/dist/providers/legna-code.js.map +1 -0
- package/node_modules/@codingns/session-sync-core/dist/providers/opencode-permissions.d.ts +1 -0
- package/node_modules/@codingns/session-sync-core/dist/providers/opencode-permissions.js +8 -0
- package/node_modules/@codingns/session-sync-core/dist/providers/opencode-permissions.js.map +1 -0
- package/node_modules/@codingns/session-sync-core/dist/providers/opencode-shared.d.ts +48 -0
- package/node_modules/@codingns/session-sync-core/dist/providers/opencode-shared.js +373 -0
- package/node_modules/@codingns/session-sync-core/dist/providers/opencode-shared.js.map +1 -0
- package/node_modules/@codingns/session-sync-core/dist/providers/opencode.d.ts +61 -0
- package/node_modules/@codingns/session-sync-core/dist/providers/opencode.js +1191 -0
- package/node_modules/@codingns/session-sync-core/dist/providers/opencode.js.map +1 -0
- package/node_modules/@codingns/session-sync-core/dist/providers/utils.d.ts +27 -0
- package/node_modules/@codingns/session-sync-core/dist/providers/utils.js +415 -0
- package/node_modules/@codingns/session-sync-core/dist/providers/utils.js.map +1 -0
- package/node_modules/@codingns/session-sync-core/dist/registry.d.ts +7 -0
- package/node_modules/@codingns/session-sync-core/dist/registry.js +22 -0
- package/node_modules/@codingns/session-sync-core/dist/registry.js.map +1 -0
- package/node_modules/@codingns/session-sync-core/dist/runtime/active-run-registry.d.ts +24 -0
- package/node_modules/@codingns/session-sync-core/dist/runtime/active-run-registry.js +329 -0
- package/node_modules/@codingns/session-sync-core/dist/runtime/active-run-registry.js.map +1 -0
- package/node_modules/@codingns/session-sync-core/dist/runtime/claude-runtime.d.ts +30 -0
- package/node_modules/@codingns/session-sync-core/dist/runtime/claude-runtime.js +939 -0
- package/node_modules/@codingns/session-sync-core/dist/runtime/claude-runtime.js.map +1 -0
- package/node_modules/@codingns/session-sync-core/dist/runtime/codex-permissions.d.ts +1 -0
- package/node_modules/@codingns/session-sync-core/dist/runtime/codex-permissions.js +16 -0
- package/node_modules/@codingns/session-sync-core/dist/runtime/codex-permissions.js.map +1 -0
- package/node_modules/@codingns/session-sync-core/dist/runtime/codex-runtime.d.ts +70 -0
- package/node_modules/@codingns/session-sync-core/dist/runtime/codex-runtime.js +2571 -0
- package/node_modules/@codingns/session-sync-core/dist/runtime/codex-runtime.js.map +1 -0
- package/node_modules/@codingns/session-sync-core/dist/runtime/gemini-runtime.d.ts +21 -0
- package/node_modules/@codingns/session-sync-core/dist/runtime/gemini-runtime.js +561 -0
- package/node_modules/@codingns/session-sync-core/dist/runtime/gemini-runtime.js.map +1 -0
- package/node_modules/@codingns/session-sync-core/dist/runtime/kimi-runtime.d.ts +38 -0
- package/node_modules/@codingns/session-sync-core/dist/runtime/kimi-runtime.js +911 -0
- package/node_modules/@codingns/session-sync-core/dist/runtime/kimi-runtime.js.map +1 -0
- package/node_modules/@codingns/session-sync-core/dist/runtime/legna-runtime.d.ts +15 -0
- package/node_modules/@codingns/session-sync-core/dist/runtime/legna-runtime.js +16 -0
- package/node_modules/@codingns/session-sync-core/dist/runtime/legna-runtime.js.map +1 -0
- package/node_modules/@codingns/session-sync-core/dist/runtime/opencode-runtime.d.ts +38 -0
- package/node_modules/@codingns/session-sync-core/dist/runtime/opencode-runtime.js +970 -0
- package/node_modules/@codingns/session-sync-core/dist/runtime/opencode-runtime.js.map +1 -0
- package/node_modules/@codingns/session-sync-core/dist/runtime/provider-runtime-service.d.ts +21 -0
- package/node_modules/@codingns/session-sync-core/dist/runtime/provider-runtime-service.js +168 -0
- package/node_modules/@codingns/session-sync-core/dist/runtime/provider-runtime-service.js.map +1 -0
- package/node_modules/@codingns/session-sync-core/dist/runtime/types.d.ts +152 -0
- package/node_modules/@codingns/session-sync-core/dist/runtime/types.js +2 -0
- package/node_modules/@codingns/session-sync-core/dist/runtime/types.js.map +1 -0
- package/node_modules/@codingns/session-sync-core/dist/services.d.ts +28 -0
- package/node_modules/@codingns/session-sync-core/dist/services.js +148 -0
- package/node_modules/@codingns/session-sync-core/dist/services.js.map +1 -0
- package/node_modules/@codingns/session-sync-core/dist/sqlite/node-sqlite.d.ts +6 -0
- package/node_modules/@codingns/session-sync-core/dist/sqlite/node-sqlite.js +9 -0
- package/node_modules/@codingns/session-sync-core/dist/sqlite/node-sqlite.js.map +1 -0
- package/node_modules/@codingns/session-sync-core/dist/types.d.ts +198 -0
- package/node_modules/@codingns/session-sync-core/dist/types.js +2 -0
- package/node_modules/@codingns/session-sync-core/dist/types.js.map +1 -0
- package/node_modules/@codingns/session-sync-core/package.json +33 -0
- package/package.json +15 -6
- package/scripts/postinstall.mjs +248 -11
- package/vendor/better-sqlite3-win32-x64-node22/LICENSE +21 -0
- package/vendor/better-sqlite3-win32-x64-node22/README.md +12 -0
- package/vendor/better-sqlite3-win32-x64-node22/README.upstream.md +99 -0
- package/vendor/better-sqlite3-win32-x64-node22/binding.gyp +38 -0
- package/vendor/better-sqlite3-win32-x64-node22/build/Release/better_sqlite3.node +0 -0
- package/vendor/better-sqlite3-win32-x64-node22/deps/common.gypi +68 -0
- package/vendor/better-sqlite3-win32-x64-node22/deps/copy.js +31 -0
- package/vendor/better-sqlite3-win32-x64-node22/deps/defines.gypi +41 -0
- package/vendor/better-sqlite3-win32-x64-node22/deps/download.sh +122 -0
- package/vendor/better-sqlite3-win32-x64-node22/deps/patches/1208.patch +15 -0
- package/vendor/better-sqlite3-win32-x64-node22/deps/sqlite3/sqlite3.c +265994 -0
- package/vendor/better-sqlite3-win32-x64-node22/deps/sqlite3/sqlite3.h +13968 -0
- package/vendor/better-sqlite3-win32-x64-node22/deps/sqlite3/sqlite3ext.h +730 -0
- package/vendor/better-sqlite3-win32-x64-node22/deps/sqlite3.gyp +80 -0
- package/vendor/better-sqlite3-win32-x64-node22/deps/test_extension.c +21 -0
- package/vendor/better-sqlite3-win32-x64-node22/lib/database.js +90 -0
- package/vendor/better-sqlite3-win32-x64-node22/lib/index.js +3 -0
- package/vendor/better-sqlite3-win32-x64-node22/lib/methods/aggregate.js +43 -0
- package/vendor/better-sqlite3-win32-x64-node22/lib/methods/backup.js +67 -0
- package/vendor/better-sqlite3-win32-x64-node22/lib/methods/function.js +31 -0
- package/vendor/better-sqlite3-win32-x64-node22/lib/methods/inspect.js +7 -0
- package/vendor/better-sqlite3-win32-x64-node22/lib/methods/pragma.js +12 -0
- package/vendor/better-sqlite3-win32-x64-node22/lib/methods/serialize.js +16 -0
- package/vendor/better-sqlite3-win32-x64-node22/lib/methods/table.js +189 -0
- package/vendor/better-sqlite3-win32-x64-node22/lib/methods/transaction.js +78 -0
- package/vendor/better-sqlite3-win32-x64-node22/lib/methods/wrappers.js +54 -0
- package/vendor/better-sqlite3-win32-x64-node22/lib/sqlite-error.js +20 -0
- package/vendor/better-sqlite3-win32-x64-node22/lib/util.js +12 -0
- package/vendor/better-sqlite3-win32-x64-node22/package.json +38 -0
- package/vendor/better-sqlite3-win32-x64-node22/scripts/verify-runtime.cjs +42 -0
- package/vendor/better-sqlite3-win32-x64-node22/src/addon.cpp +47 -0
- package/vendor/better-sqlite3-win32-x64-node22/src/better_sqlite3.cpp +74 -0
- package/vendor/better-sqlite3-win32-x64-node22/src/objects/backup.cpp +120 -0
- package/vendor/better-sqlite3-win32-x64-node22/src/objects/backup.hpp +36 -0
- package/vendor/better-sqlite3-win32-x64-node22/src/objects/database.cpp +417 -0
- package/vendor/better-sqlite3-win32-x64-node22/src/objects/database.hpp +103 -0
- package/vendor/better-sqlite3-win32-x64-node22/src/objects/statement-iterator.cpp +113 -0
- package/vendor/better-sqlite3-win32-x64-node22/src/objects/statement-iterator.hpp +50 -0
- package/vendor/better-sqlite3-win32-x64-node22/src/objects/statement.cpp +383 -0
- package/vendor/better-sqlite3-win32-x64-node22/src/objects/statement.hpp +58 -0
- package/vendor/better-sqlite3-win32-x64-node22/src/util/bind-map.cpp +73 -0
- package/vendor/better-sqlite3-win32-x64-node22/src/util/binder.cpp +193 -0
- package/vendor/better-sqlite3-win32-x64-node22/src/util/constants.cpp +172 -0
- package/vendor/better-sqlite3-win32-x64-node22/src/util/custom-aggregate.cpp +121 -0
- package/vendor/better-sqlite3-win32-x64-node22/src/util/custom-function.cpp +59 -0
- package/vendor/better-sqlite3-win32-x64-node22/src/util/custom-table.cpp +409 -0
- package/vendor/better-sqlite3-win32-x64-node22/src/util/data-converter.cpp +17 -0
- package/vendor/better-sqlite3-win32-x64-node22/src/util/data.cpp +194 -0
- package/vendor/better-sqlite3-win32-x64-node22/src/util/helpers.cpp +109 -0
- package/vendor/better-sqlite3-win32-x64-node22/src/util/macros.cpp +83 -0
- package/vendor/better-sqlite3-win32-x64-node22/src/util/query-macros.cpp +71 -0
- package/vendor/better-sqlite3-win32-x64-node22/src/util/row-builder.cpp +49 -0
- package/vendor/node-pty-fork/LICENSE +69 -0
- package/vendor/node-pty-fork/README.md +92 -0
- package/vendor/node-pty-fork/binding.gyp +117 -0
- package/vendor/node-pty-fork/deps/.editorconfig +2 -0
- package/vendor/node-pty-fork/deps/winpty/.drone.yml +17 -0
- package/vendor/node-pty-fork/deps/winpty/.gitattributes +19 -0
- package/vendor/node-pty-fork/deps/winpty/LICENSE +21 -0
- package/vendor/node-pty-fork/deps/winpty/Makefile +166 -0
- package/vendor/node-pty-fork/deps/winpty/README.md +151 -0
- package/vendor/node-pty-fork/deps/winpty/RELEASES.md +280 -0
- package/vendor/node-pty-fork/deps/winpty/VERSION.txt +1 -0
- package/vendor/node-pty-fork/deps/winpty/configure +167 -0
- package/vendor/node-pty-fork/deps/winpty/misc/BufferResizeTests.cc +90 -0
- package/vendor/node-pty-fork/deps/winpty/misc/ChangeScreenBuffer.cc +53 -0
- package/vendor/node-pty-fork/deps/winpty/misc/ClearConsole.cc +72 -0
- package/vendor/node-pty-fork/deps/winpty/misc/ConinMode.cc +117 -0
- package/vendor/node-pty-fork/deps/winpty/misc/ConinMode.ps1 +116 -0
- package/vendor/node-pty-fork/deps/winpty/misc/ConoutMode.cc +113 -0
- package/vendor/node-pty-fork/deps/winpty/misc/DebugClient.py +42 -0
- package/vendor/node-pty-fork/deps/winpty/misc/DebugServer.py +63 -0
- package/vendor/node-pty-fork/deps/winpty/misc/DumpLines.py +5 -0
- package/vendor/node-pty-fork/deps/winpty/misc/EnableExtendedFlags.txt +46 -0
- package/vendor/node-pty-fork/deps/winpty/misc/Font-Report-June2016/CP437-Consolas.txt +528 -0
- package/vendor/node-pty-fork/deps/winpty/misc/Font-Report-June2016/CP437-Lucida.txt +633 -0
- package/vendor/node-pty-fork/deps/winpty/misc/Font-Report-June2016/CP932.txt +630 -0
- package/vendor/node-pty-fork/deps/winpty/misc/Font-Report-June2016/CP936.txt +630 -0
- package/vendor/node-pty-fork/deps/winpty/misc/Font-Report-June2016/CP949.txt +630 -0
- package/vendor/node-pty-fork/deps/winpty/misc/Font-Report-June2016/CP950.txt +630 -0
- package/vendor/node-pty-fork/deps/winpty/misc/Font-Report-June2016/MinimumWindowWidths.txt +16 -0
- package/vendor/node-pty-fork/deps/winpty/misc/Font-Report-June2016/Results.txt +4 -0
- package/vendor/node-pty-fork/deps/winpty/misc/Font-Report-June2016/Windows10SetFontBugginess.txt +144 -0
- package/vendor/node-pty-fork/deps/winpty/misc/FontSurvey.cc +100 -0
- package/vendor/node-pty-fork/deps/winpty/misc/FormatChar.h +21 -0
- package/vendor/node-pty-fork/deps/winpty/misc/FreezePerfTest.cc +62 -0
- package/vendor/node-pty-fork/deps/winpty/misc/GetCh.cc +20 -0
- package/vendor/node-pty-fork/deps/winpty/misc/GetConsolePos.cc +41 -0
- package/vendor/node-pty-fork/deps/winpty/misc/GetFont.cc +261 -0
- package/vendor/node-pty-fork/deps/winpty/misc/IdentifyConsoleWindow.ps1 +51 -0
- package/vendor/node-pty-fork/deps/winpty/misc/IsNewConsole.cc +87 -0
- package/vendor/node-pty-fork/deps/winpty/misc/MouseInputNotes.txt +90 -0
- package/vendor/node-pty-fork/deps/winpty/misc/MoveConsoleWindow.cc +34 -0
- package/vendor/node-pty-fork/deps/winpty/misc/Notes.txt +219 -0
- package/vendor/node-pty-fork/deps/winpty/misc/OSVersion.cc +27 -0
- package/vendor/node-pty-fork/deps/winpty/misc/ScreenBufferFreezeInactive.cc +101 -0
- package/vendor/node-pty-fork/deps/winpty/misc/ScreenBufferTest.cc +671 -0
- package/vendor/node-pty-fork/deps/winpty/misc/ScreenBufferTest2.cc +151 -0
- package/vendor/node-pty-fork/deps/winpty/misc/SelectAllTest.cc +45 -0
- package/vendor/node-pty-fork/deps/winpty/misc/SetBufferSize.cc +32 -0
- package/vendor/node-pty-fork/deps/winpty/misc/SetCursorPos.cc +10 -0
- package/vendor/node-pty-fork/deps/winpty/misc/SetFont.cc +145 -0
- package/vendor/node-pty-fork/deps/winpty/misc/SetWindowRect.cc +36 -0
- package/vendor/node-pty-fork/deps/winpty/misc/ShowArgv.cc +12 -0
- package/vendor/node-pty-fork/deps/winpty/misc/ShowConsoleInput.cc +40 -0
- package/vendor/node-pty-fork/deps/winpty/misc/Spew.py +5 -0
- package/vendor/node-pty-fork/deps/winpty/misc/TestUtil.cc +172 -0
- package/vendor/node-pty-fork/deps/winpty/misc/UnicodeDoubleWidthTest.cc +102 -0
- package/vendor/node-pty-fork/deps/winpty/misc/UnicodeWideTest1.cc +246 -0
- package/vendor/node-pty-fork/deps/winpty/misc/UnicodeWideTest2.cc +130 -0
- package/vendor/node-pty-fork/deps/winpty/misc/UnixEcho.cc +89 -0
- package/vendor/node-pty-fork/deps/winpty/misc/Utf16Echo.cc +46 -0
- package/vendor/node-pty-fork/deps/winpty/misc/VeryLargeRead.cc +122 -0
- package/vendor/node-pty-fork/deps/winpty/misc/VkEscapeTest.cc +56 -0
- package/vendor/node-pty-fork/deps/winpty/misc/Win10ResizeWhileFrozen.cc +52 -0
- package/vendor/node-pty-fork/deps/winpty/misc/Win10WrapTest1.cc +57 -0
- package/vendor/node-pty-fork/deps/winpty/misc/Win10WrapTest2.cc +30 -0
- package/vendor/node-pty-fork/deps/winpty/misc/Win32Echo1.cc +26 -0
- package/vendor/node-pty-fork/deps/winpty/misc/Win32Echo2.cc +19 -0
- package/vendor/node-pty-fork/deps/winpty/misc/Win32Test1.cc +46 -0
- package/vendor/node-pty-fork/deps/winpty/misc/Win32Test2.cc +70 -0
- package/vendor/node-pty-fork/deps/winpty/misc/Win32Test3.cc +78 -0
- package/vendor/node-pty-fork/deps/winpty/misc/Win32Write1.cc +44 -0
- package/vendor/node-pty-fork/deps/winpty/misc/WindowsBugCrashReader.cc +27 -0
- package/vendor/node-pty-fork/deps/winpty/misc/WriteConsole.cc +106 -0
- package/vendor/node-pty-fork/deps/winpty/misc/build32.sh +9 -0
- package/vendor/node-pty-fork/deps/winpty/misc/build64.sh +9 -0
- package/vendor/node-pty-fork/deps/winpty/misc/color-test.sh +212 -0
- package/vendor/node-pty-fork/deps/winpty/misc/font-notes.txt +300 -0
- package/vendor/node-pty-fork/deps/winpty/misc/winbug-15048.cc +201 -0
- package/vendor/node-pty-fork/deps/winpty/ship/build-pty4j-libpty.bat +36 -0
- package/vendor/node-pty-fork/deps/winpty/ship/common_ship.py +53 -0
- package/vendor/node-pty-fork/deps/winpty/ship/make_msvc_package.py +165 -0
- package/vendor/node-pty-fork/deps/winpty/ship/ship.py +108 -0
- package/vendor/node-pty-fork/deps/winpty/src/agent/Agent.cc +605 -0
- package/vendor/node-pty-fork/deps/winpty/src/agent/Agent.h +103 -0
- package/vendor/node-pty-fork/deps/winpty/src/agent/AgentCreateDesktop.cc +84 -0
- package/vendor/node-pty-fork/deps/winpty/src/agent/AgentCreateDesktop.h +28 -0
- package/vendor/node-pty-fork/deps/winpty/src/agent/ConsoleFont.cc +632 -0
- package/vendor/node-pty-fork/deps/winpty/src/agent/ConsoleFont.h +28 -0
- package/vendor/node-pty-fork/deps/winpty/src/agent/ConsoleInput.cc +852 -0
- package/vendor/node-pty-fork/deps/winpty/src/agent/ConsoleInput.h +109 -0
- package/vendor/node-pty-fork/deps/winpty/src/agent/ConsoleInputReencoding.cc +121 -0
- package/vendor/node-pty-fork/deps/winpty/src/agent/ConsoleInputReencoding.h +36 -0
- package/vendor/node-pty-fork/deps/winpty/src/agent/ConsoleLine.cc +152 -0
- package/vendor/node-pty-fork/deps/winpty/src/agent/ConsoleLine.h +41 -0
- package/vendor/node-pty-fork/deps/winpty/src/agent/Coord.h +87 -0
- package/vendor/node-pty-fork/deps/winpty/src/agent/DebugShowInput.cc +239 -0
- package/vendor/node-pty-fork/deps/winpty/src/agent/DebugShowInput.h +32 -0
- package/vendor/node-pty-fork/deps/winpty/src/agent/DefaultInputMap.cc +422 -0
- package/vendor/node-pty-fork/deps/winpty/src/agent/DefaultInputMap.h +28 -0
- package/vendor/node-pty-fork/deps/winpty/src/agent/DsrSender.h +30 -0
- package/vendor/node-pty-fork/deps/winpty/src/agent/EventLoop.cc +99 -0
- package/vendor/node-pty-fork/deps/winpty/src/agent/EventLoop.h +47 -0
- package/vendor/node-pty-fork/deps/winpty/src/agent/InputMap.cc +246 -0
- package/vendor/node-pty-fork/deps/winpty/src/agent/InputMap.h +114 -0
- package/vendor/node-pty-fork/deps/winpty/src/agent/LargeConsoleRead.cc +71 -0
- package/vendor/node-pty-fork/deps/winpty/src/agent/LargeConsoleRead.h +68 -0
- package/vendor/node-pty-fork/deps/winpty/src/agent/NamedPipe.cc +378 -0
- package/vendor/node-pty-fork/deps/winpty/src/agent/NamedPipe.h +125 -0
- package/vendor/node-pty-fork/deps/winpty/src/agent/Scraper.cc +699 -0
- package/vendor/node-pty-fork/deps/winpty/src/agent/Scraper.h +103 -0
- package/vendor/node-pty-fork/deps/winpty/src/agent/SimplePool.h +75 -0
- package/vendor/node-pty-fork/deps/winpty/src/agent/SmallRect.h +143 -0
- package/vendor/node-pty-fork/deps/winpty/src/agent/Terminal.cc +535 -0
- package/vendor/node-pty-fork/deps/winpty/src/agent/Terminal.h +69 -0
- package/vendor/node-pty-fork/deps/winpty/src/agent/UnicodeEncoding.h +157 -0
- package/vendor/node-pty-fork/deps/winpty/src/agent/UnicodeEncodingTest.cc +189 -0
- package/vendor/node-pty-fork/deps/winpty/src/agent/Win32Console.cc +107 -0
- package/vendor/node-pty-fork/deps/winpty/src/agent/Win32Console.h +67 -0
- package/vendor/node-pty-fork/deps/winpty/src/agent/Win32ConsoleBuffer.cc +193 -0
- package/vendor/node-pty-fork/deps/winpty/src/agent/Win32ConsoleBuffer.h +99 -0
- package/vendor/node-pty-fork/deps/winpty/src/agent/main.cc +114 -0
- package/vendor/node-pty-fork/deps/winpty/src/agent/subdir.mk +61 -0
- package/vendor/node-pty-fork/deps/winpty/src/configurations.gypi +60 -0
- package/vendor/node-pty-fork/deps/winpty/src/debugserver/DebugServer.cc +117 -0
- package/vendor/node-pty-fork/deps/winpty/src/debugserver/subdir.mk +41 -0
- package/vendor/node-pty-fork/deps/winpty/src/include/winpty.h +242 -0
- package/vendor/node-pty-fork/deps/winpty/src/include/winpty_constants.h +131 -0
- package/vendor/node-pty-fork/deps/winpty/src/libwinpty/AgentLocation.cc +75 -0
- package/vendor/node-pty-fork/deps/winpty/src/libwinpty/AgentLocation.h +28 -0
- package/vendor/node-pty-fork/deps/winpty/src/libwinpty/LibWinptyException.h +54 -0
- package/vendor/node-pty-fork/deps/winpty/src/libwinpty/WinptyInternal.h +72 -0
- package/vendor/node-pty-fork/deps/winpty/src/libwinpty/subdir.mk +46 -0
- package/vendor/node-pty-fork/deps/winpty/src/libwinpty/winpty.cc +970 -0
- package/vendor/node-pty-fork/deps/winpty/src/shared/AgentMsg.h +38 -0
- package/vendor/node-pty-fork/deps/winpty/src/shared/BackgroundDesktop.cc +122 -0
- package/vendor/node-pty-fork/deps/winpty/src/shared/BackgroundDesktop.h +73 -0
- package/vendor/node-pty-fork/deps/winpty/src/shared/Buffer.cc +103 -0
- package/vendor/node-pty-fork/deps/winpty/src/shared/Buffer.h +102 -0
- package/vendor/node-pty-fork/deps/winpty/src/shared/DebugClient.cc +187 -0
- package/vendor/node-pty-fork/deps/winpty/src/shared/DebugClient.h +38 -0
- package/vendor/node-pty-fork/deps/winpty/src/shared/GenRandom.cc +138 -0
- package/vendor/node-pty-fork/deps/winpty/src/shared/GenRandom.h +55 -0
- package/vendor/node-pty-fork/deps/winpty/src/shared/GetCommitHash.bat +13 -0
- package/vendor/node-pty-fork/deps/winpty/src/shared/Mutex.h +54 -0
- package/vendor/node-pty-fork/deps/winpty/src/shared/OsModule.h +63 -0
- package/vendor/node-pty-fork/deps/winpty/src/shared/OwnedHandle.cc +36 -0
- package/vendor/node-pty-fork/deps/winpty/src/shared/OwnedHandle.h +45 -0
- package/vendor/node-pty-fork/deps/winpty/src/shared/PrecompiledHeader.h +43 -0
- package/vendor/node-pty-fork/deps/winpty/src/shared/StringBuilder.h +227 -0
- package/vendor/node-pty-fork/deps/winpty/src/shared/StringBuilderTest.cc +114 -0
- package/vendor/node-pty-fork/deps/winpty/src/shared/StringUtil.cc +55 -0
- package/vendor/node-pty-fork/deps/winpty/src/shared/StringUtil.h +80 -0
- package/vendor/node-pty-fork/deps/winpty/src/shared/TimeMeasurement.h +63 -0
- package/vendor/node-pty-fork/deps/winpty/src/shared/UnixCtrlChars.h +45 -0
- package/vendor/node-pty-fork/deps/winpty/src/shared/UpdateGenVersion.bat +20 -0
- package/vendor/node-pty-fork/deps/winpty/src/shared/WindowsSecurity.cc +460 -0
- package/vendor/node-pty-fork/deps/winpty/src/shared/WindowsSecurity.h +104 -0
- package/vendor/node-pty-fork/deps/winpty/src/shared/WindowsVersion.cc +252 -0
- package/vendor/node-pty-fork/deps/winpty/src/shared/WindowsVersion.h +29 -0
- package/vendor/node-pty-fork/deps/winpty/src/shared/WinptyAssert.cc +55 -0
- package/vendor/node-pty-fork/deps/winpty/src/shared/WinptyAssert.h +64 -0
- package/vendor/node-pty-fork/deps/winpty/src/shared/WinptyException.cc +57 -0
- package/vendor/node-pty-fork/deps/winpty/src/shared/WinptyException.h +43 -0
- package/vendor/node-pty-fork/deps/winpty/src/shared/WinptyVersion.cc +42 -0
- package/vendor/node-pty-fork/deps/winpty/src/shared/WinptyVersion.h +27 -0
- package/vendor/node-pty-fork/deps/winpty/src/shared/winpty_snprintf.h +99 -0
- package/vendor/node-pty-fork/deps/winpty/src/subdir.mk +5 -0
- package/vendor/node-pty-fork/deps/winpty/src/tests/subdir.mk +28 -0
- package/vendor/node-pty-fork/deps/winpty/src/tests/trivial_test.cc +158 -0
- package/vendor/node-pty-fork/deps/winpty/src/unix-adapter/InputHandler.cc +114 -0
- package/vendor/node-pty-fork/deps/winpty/src/unix-adapter/InputHandler.h +56 -0
- package/vendor/node-pty-fork/deps/winpty/src/unix-adapter/OutputHandler.cc +80 -0
- package/vendor/node-pty-fork/deps/winpty/src/unix-adapter/OutputHandler.h +53 -0
- package/vendor/node-pty-fork/deps/winpty/src/unix-adapter/Util.cc +86 -0
- package/vendor/node-pty-fork/deps/winpty/src/unix-adapter/Util.h +31 -0
- package/vendor/node-pty-fork/deps/winpty/src/unix-adapter/WakeupFd.cc +70 -0
- package/vendor/node-pty-fork/deps/winpty/src/unix-adapter/WakeupFd.h +42 -0
- package/vendor/node-pty-fork/deps/winpty/src/unix-adapter/main.cc +729 -0
- package/vendor/node-pty-fork/deps/winpty/src/unix-adapter/subdir.mk +41 -0
- package/vendor/node-pty-fork/deps/winpty/src/winpty.gyp +206 -0
- package/vendor/node-pty-fork/deps/winpty/vcbuild.bat +83 -0
- package/vendor/node-pty-fork/lib/conpty_console_list_agent.js +20 -0
- package/vendor/node-pty-fork/lib/conpty_console_list_agent.js.map +1 -0
- package/vendor/node-pty-fork/lib/eventEmitter2.js +47 -0
- package/vendor/node-pty-fork/lib/eventEmitter2.js.map +1 -0
- package/vendor/node-pty-fork/lib/eventEmitter2.test.js +30 -0
- package/vendor/node-pty-fork/lib/eventEmitter2.test.js.map +1 -0
- package/vendor/node-pty-fork/lib/index.js +51 -0
- package/vendor/node-pty-fork/lib/index.js.map +1 -0
- package/vendor/node-pty-fork/lib/interfaces.js +7 -0
- package/vendor/node-pty-fork/lib/interfaces.js.map +1 -0
- package/vendor/node-pty-fork/lib/shared/conout.js +11 -0
- package/vendor/node-pty-fork/lib/shared/conout.js.map +1 -0
- package/vendor/node-pty-fork/lib/terminal.js +190 -0
- package/vendor/node-pty-fork/lib/terminal.js.map +1 -0
- package/vendor/node-pty-fork/lib/terminal.test.js +139 -0
- package/vendor/node-pty-fork/lib/terminal.test.js.map +1 -0
- package/vendor/node-pty-fork/lib/testUtils.test.js +28 -0
- package/vendor/node-pty-fork/lib/testUtils.test.js.map +1 -0
- package/vendor/node-pty-fork/lib/types.js +7 -0
- package/vendor/node-pty-fork/lib/types.js.map +1 -0
- package/vendor/node-pty-fork/lib/unixTerminal.js +304 -0
- package/vendor/node-pty-fork/lib/unixTerminal.js.map +1 -0
- package/vendor/node-pty-fork/lib/unixTerminal.test.js +330 -0
- package/vendor/node-pty-fork/lib/unixTerminal.test.js.map +1 -0
- package/vendor/node-pty-fork/lib/utils.js +17 -0
- package/vendor/node-pty-fork/lib/utils.js.map +1 -0
- package/vendor/node-pty-fork/lib/windowsConoutConnection.js +122 -0
- package/vendor/node-pty-fork/lib/windowsConoutConnection.js.map +1 -0
- package/vendor/node-pty-fork/lib/windowsPtyAgent.js +324 -0
- package/vendor/node-pty-fork/lib/windowsPtyAgent.js.map +1 -0
- package/vendor/node-pty-fork/lib/windowsPtyAgent.test.js +90 -0
- package/vendor/node-pty-fork/lib/windowsPtyAgent.test.js.map +1 -0
- package/vendor/node-pty-fork/lib/windowsTerminal.js +201 -0
- package/vendor/node-pty-fork/lib/windowsTerminal.js.map +1 -0
- package/vendor/node-pty-fork/lib/windowsTerminal.test.js +203 -0
- package/vendor/node-pty-fork/lib/windowsTerminal.test.js.map +1 -0
- package/vendor/node-pty-fork/lib/worker/conoutSocketWorker.js +22 -0
- package/vendor/node-pty-fork/lib/worker/conoutSocketWorker.js.map +1 -0
- package/vendor/node-pty-fork/package.json +35 -0
- package/vendor/node-pty-fork/scripts/apply-patches.mjs +341 -0
- package/vendor/node-pty-fork/scripts/fetch-upstream.mjs +41 -0
- package/vendor/node-pty-fork/scripts/install-smoke.cjs +59 -0
- package/vendor/node-pty-fork/scripts/runtime-install-context.cjs +24 -0
- package/vendor/node-pty-fork/scripts/smoke-load.cjs +10 -0
- package/vendor/node-pty-fork/scripts/sync-upstream.mjs +29 -0
- package/vendor/node-pty-fork/scripts/verify-runtime.cjs +62 -0
- package/vendor/node-pty-fork/scripts/verify-runtime.test.cjs +52 -0
- package/vendor/node-pty-fork/scripts/verify-tarball.cjs +80 -0
- package/vendor/node-pty-fork/src/conpty_console_list_agent.ts +19 -0
- package/vendor/node-pty-fork/src/eventEmitter2.test.ts +30 -0
- package/vendor/node-pty-fork/src/eventEmitter2.ts +48 -0
- package/vendor/node-pty-fork/src/index.ts +51 -0
- package/vendor/node-pty-fork/src/interfaces.ts +129 -0
- package/vendor/node-pty-fork/src/native.d.ts +56 -0
- package/vendor/node-pty-fork/src/shared/conout.ts +15 -0
- package/vendor/node-pty-fork/src/terminal.test.ts +119 -0
- package/vendor/node-pty-fork/src/terminal.ts +211 -0
- package/vendor/node-pty-fork/src/testUtils.test.ts +23 -0
- package/vendor/node-pty-fork/src/tsconfig.json +22 -0
- package/vendor/node-pty-fork/src/types.ts +15 -0
- package/vendor/node-pty-fork/src/unix/pty.cc +826 -0
- package/vendor/node-pty-fork/src/unix/spawn-helper.cc +23 -0
- package/vendor/node-pty-fork/src/unixTerminal.test.ts +335 -0
- package/vendor/node-pty-fork/src/unixTerminal.ts +320 -0
- package/vendor/node-pty-fork/src/utils.ts +9 -0
- package/vendor/node-pty-fork/src/win/conpty.cc +500 -0
- package/vendor/node-pty-fork/src/win/conpty_console_list.cc +43 -0
- package/vendor/node-pty-fork/src/win/path_util.cc +73 -0
- package/vendor/node-pty-fork/src/win/path_util.h +22 -0
- package/vendor/node-pty-fork/src/win/winpty.cc +322 -0
- package/vendor/node-pty-fork/src/windowsConoutConnection.ts +79 -0
- package/vendor/node-pty-fork/src/windowsPtyAgent.test.ts +94 -0
- package/vendor/node-pty-fork/src/windowsPtyAgent.ts +323 -0
- package/vendor/node-pty-fork/src/windowsTerminal.test.ts +214 -0
- package/vendor/node-pty-fork/src/windowsTerminal.ts +208 -0
- package/vendor/node-pty-fork/src/worker/conoutSocketWorker.ts +22 -0
- package/vendor/node-pty-fork/typings/node-pty.d.ts +203 -0
- package/vendor-src/better-sqlite3-win32-x64-node22/README.md +12 -0
- package/dist/public/assets/App-tPcbyRdS.js +0 -30
- package/dist/public/assets/DesktopWindowPage-GtIx5m8K.js +0 -2
- package/dist/public/assets/FileContextPanel-BcM7AIT4.js +0 -1
- package/dist/public/assets/GitSidebar-CMtkaxuI.js +0 -6
- package/dist/public/assets/MobileCreateSessionSheet-CrFY41_8.js +0 -1
- package/dist/public/assets/MobileWorkspaceSwitcherHeader-DLkACTnQ.js +0 -1
- package/dist/public/assets/ServerSettingsModal-vgOhwus4.js +0 -1
- package/dist/public/assets/SessionIndexPage-KK626Ra9.js +0 -1
- package/dist/public/assets/SettingsPage-B3edBJIo.js +0 -2
- package/dist/public/assets/TerminalManagerPanel-BxlhZp8c.js +0 -1
- package/dist/public/assets/TerminalRuntimeFallbackModal-BVLfrpSa.js +0 -1
- package/dist/public/assets/ToolFilesPage-N_gwwUjD.js +0 -1
- package/dist/public/assets/ToolGitPage-DOcuuWM1.js +0 -1
- package/dist/public/assets/ToolProcessesPage-D-FfJ7Re.js +0 -1
- package/dist/public/assets/ToolsHomePage-CHfPxd20.js +0 -1
- package/dist/public/assets/WorkbenchLandingPage-CTTnfovY.js +0 -1
- package/dist/public/assets/WorkbenchLayout-CbpJg0g1.js +0 -244
- package/dist/public/assets/WorkbenchModal-Bt_1fYmM.js +0 -1
- package/dist/public/assets/WorkbenchShellRoute-DyaMnPfS.js +0 -1
- package/dist/public/assets/WorkspaceDebugDetailPage-s7yuDIxR.js +0 -1
- package/dist/public/assets/WorkspaceDetailPage-Cf-gVpqK.js +0 -1
- package/dist/public/assets/WorkspaceHomePage-COf6I8sT.js +0 -1
- package/dist/public/assets/file-tree-icon-BeHqeru9.js +0 -590
- package/dist/public/assets/index-CuzMc7q2.js +0 -42
- package/dist/public/assets/model-switch-api-c6kcbBGm.js +0 -1
- package/dist/public/assets/realtime-client-CRCx5xBt.js +0 -1
- package/dist/public/assets/useRegisteredDebugTemplates-D6YtNS0r.js +0 -1
|
@@ -0,0 +1,322 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2013-2015, Christopher Jeffrey, Peter Sunde (MIT License)
|
|
3
|
+
* Copyright (c) 2016, Daniel Imms (MIT License).
|
|
4
|
+
* Copyright (c) 2018, Microsoft Corporation (MIT License).
|
|
5
|
+
*
|
|
6
|
+
* pty.cc:
|
|
7
|
+
* This file is responsible for starting processes
|
|
8
|
+
* with pseudo-terminal file descriptors.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
#include <iostream>
|
|
12
|
+
#include <nan.h>
|
|
13
|
+
#include <Shlwapi.h> // PathCombine, PathIsRelative
|
|
14
|
+
#include <sstream>
|
|
15
|
+
#include <stdlib.h>
|
|
16
|
+
#include <string.h>
|
|
17
|
+
#include <string>
|
|
18
|
+
#include <vector>
|
|
19
|
+
#include <winpty.h>
|
|
20
|
+
|
|
21
|
+
#include "path_util.h"
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Misc
|
|
25
|
+
*/
|
|
26
|
+
extern "C" void init(v8::Local<v8::Object>);
|
|
27
|
+
|
|
28
|
+
#define WINPTY_DBG_VARIABLE TEXT("WINPTYDBG")
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* winpty
|
|
32
|
+
*/
|
|
33
|
+
static std::vector<winpty_t *> ptyHandles;
|
|
34
|
+
static volatile LONG ptyCounter;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Helpers
|
|
38
|
+
*/
|
|
39
|
+
|
|
40
|
+
static winpty_t *get_pipe_handle(int handle) {
|
|
41
|
+
for (size_t i = 0; i < ptyHandles.size(); ++i) {
|
|
42
|
+
winpty_t *ptyHandle = ptyHandles[i];
|
|
43
|
+
int current = (int)winpty_agent_process(ptyHandle);
|
|
44
|
+
if (current == handle) {
|
|
45
|
+
return ptyHandle;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return nullptr;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
static bool remove_pipe_handle(int handle) {
|
|
52
|
+
for (size_t i = 0; i < ptyHandles.size(); ++i) {
|
|
53
|
+
winpty_t *ptyHandle = ptyHandles[i];
|
|
54
|
+
if ((int)winpty_agent_process(ptyHandle) == handle) {
|
|
55
|
+
winpty_free(ptyHandle);
|
|
56
|
+
ptyHandles.erase(ptyHandles.begin() + i);
|
|
57
|
+
ptyHandle = nullptr;
|
|
58
|
+
return true;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return false;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
void throw_winpty_error(const char *generalMsg, winpty_error_ptr_t error_ptr) {
|
|
65
|
+
std::stringstream why;
|
|
66
|
+
std::wstring msg(winpty_error_msg(error_ptr));
|
|
67
|
+
std::string msg_(msg.begin(), msg.end());
|
|
68
|
+
why << generalMsg << ": " << msg_;
|
|
69
|
+
Nan::ThrowError(why.str().c_str());
|
|
70
|
+
winpty_error_free(error_ptr);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
static NAN_METHOD(PtyGetExitCode) {
|
|
74
|
+
Nan::HandleScope scope;
|
|
75
|
+
|
|
76
|
+
if (info.Length() != 1 ||
|
|
77
|
+
!info[0]->IsNumber()) {
|
|
78
|
+
Nan::ThrowError("Usage: pty.getExitCode(pidHandle)");
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
DWORD exitCode = 0;
|
|
83
|
+
GetExitCodeProcess((HANDLE)info[0]->IntegerValue(Nan::GetCurrentContext()).FromJust(), &exitCode);
|
|
84
|
+
|
|
85
|
+
info.GetReturnValue().Set(Nan::New<v8::Number>(exitCode));
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
static NAN_METHOD(PtyGetProcessList) {
|
|
89
|
+
Nan::HandleScope scope;
|
|
90
|
+
|
|
91
|
+
if (info.Length() != 1 ||
|
|
92
|
+
!info[0]->IsNumber()) {
|
|
93
|
+
Nan::ThrowError("Usage: pty.getProcessList(pid)");
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
int pid = info[0]->Int32Value(Nan::GetCurrentContext()).FromJust();
|
|
98
|
+
|
|
99
|
+
winpty_t *pc = get_pipe_handle(pid);
|
|
100
|
+
if (pc == nullptr) {
|
|
101
|
+
info.GetReturnValue().Set(Nan::New<v8::Array>(0));
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
int processList[64];
|
|
105
|
+
const int processCount = 64;
|
|
106
|
+
int actualCount = winpty_get_console_process_list(pc, processList, processCount, nullptr);
|
|
107
|
+
|
|
108
|
+
v8::Local<v8::Array> result = Nan::New<v8::Array>(actualCount);
|
|
109
|
+
for (uint32_t i = 0; i < actualCount; i++) {
|
|
110
|
+
Nan::Set(result, i, Nan::New<v8::Number>(processList[i]));
|
|
111
|
+
}
|
|
112
|
+
info.GetReturnValue().Set(result);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
static NAN_METHOD(PtyStartProcess) {
|
|
116
|
+
Nan::HandleScope scope;
|
|
117
|
+
|
|
118
|
+
std::stringstream why;
|
|
119
|
+
const wchar_t *filename = nullptr;
|
|
120
|
+
const wchar_t *cmdline = nullptr;
|
|
121
|
+
const wchar_t *cwd = nullptr;
|
|
122
|
+
std::wstring env;
|
|
123
|
+
int cols = 0;
|
|
124
|
+
int rows = 0;
|
|
125
|
+
bool debug = false;
|
|
126
|
+
winpty_error_ptr_t error_ptr = nullptr;
|
|
127
|
+
winpty_config_t* winpty_config = nullptr;
|
|
128
|
+
winpty_t *pc = nullptr;
|
|
129
|
+
winpty_spawn_config_t* config = nullptr;
|
|
130
|
+
HANDLE handle = nullptr;
|
|
131
|
+
BOOL spawnSuccess = FALSE;
|
|
132
|
+
v8::Local<v8::Object> marshal = Nan::New<v8::Object>();
|
|
133
|
+
|
|
134
|
+
if (info.Length() != 7 ||
|
|
135
|
+
!info[0]->IsString() ||
|
|
136
|
+
!info[1]->IsString() ||
|
|
137
|
+
!info[2]->IsArray() ||
|
|
138
|
+
!info[3]->IsString() ||
|
|
139
|
+
!info[4]->IsNumber() ||
|
|
140
|
+
!info[5]->IsNumber() ||
|
|
141
|
+
!info[6]->IsBoolean()) {
|
|
142
|
+
Nan::ThrowError("Usage: pty.startProcess(file, cmdline, env, cwd, cols, rows, debug)");
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
filename = path_util::to_wstring(Nan::Utf8String(info[0]));
|
|
147
|
+
cmdline = path_util::to_wstring(Nan::Utf8String(info[1]));
|
|
148
|
+
cwd = path_util::to_wstring(Nan::Utf8String(info[3]));
|
|
149
|
+
|
|
150
|
+
// create environment block
|
|
151
|
+
const v8::Local<v8::Array> envValues = v8::Local<v8::Array>::Cast(info[2]);
|
|
152
|
+
if (!envValues.IsEmpty()) {
|
|
153
|
+
|
|
154
|
+
std::wstringstream envBlock;
|
|
155
|
+
|
|
156
|
+
for(uint32_t i = 0; i < envValues->Length(); i++) {
|
|
157
|
+
std::wstring envValue(path_util::to_wstring(Nan::Utf8String(Nan::Get(envValues, i).ToLocalChecked())));
|
|
158
|
+
envBlock << envValue << L'\0';
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
env = envBlock.str();
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
// use environment 'Path' variable to determine location of
|
|
165
|
+
// the relative path that we have recieved (e.g cmd.exe)
|
|
166
|
+
std::wstring shellpath;
|
|
167
|
+
if (::PathIsRelativeW(filename)) {
|
|
168
|
+
shellpath = path_util::get_shell_path(filename);
|
|
169
|
+
} else {
|
|
170
|
+
shellpath = filename;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
std::string shellpath_(shellpath.begin(), shellpath.end());
|
|
174
|
+
|
|
175
|
+
if (shellpath.empty() || !path_util::file_exists(shellpath)) {
|
|
176
|
+
why << "File not found: " << shellpath_;
|
|
177
|
+
Nan::ThrowError(why.str().c_str());
|
|
178
|
+
goto cleanup;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
cols = info[4]->Int32Value(Nan::GetCurrentContext()).FromJust();
|
|
182
|
+
rows = info[5]->Int32Value(Nan::GetCurrentContext()).FromJust();
|
|
183
|
+
debug = Nan::To<bool>(info[6]).FromJust();
|
|
184
|
+
|
|
185
|
+
// Enable/disable debugging
|
|
186
|
+
SetEnvironmentVariable(WINPTY_DBG_VARIABLE, debug ? "1" : NULL); // NULL = deletes variable
|
|
187
|
+
|
|
188
|
+
// Create winpty config
|
|
189
|
+
winpty_config = winpty_config_new(0, &error_ptr);
|
|
190
|
+
if (winpty_config == nullptr) {
|
|
191
|
+
throw_winpty_error("Error creating WinPTY config", error_ptr);
|
|
192
|
+
goto cleanup;
|
|
193
|
+
}
|
|
194
|
+
winpty_error_free(error_ptr);
|
|
195
|
+
|
|
196
|
+
// Set pty size on config
|
|
197
|
+
winpty_config_set_initial_size(winpty_config, cols, rows);
|
|
198
|
+
|
|
199
|
+
// Start the pty agent
|
|
200
|
+
pc = winpty_open(winpty_config, &error_ptr);
|
|
201
|
+
winpty_config_free(winpty_config);
|
|
202
|
+
if (pc == nullptr) {
|
|
203
|
+
throw_winpty_error("Error launching WinPTY agent", error_ptr);
|
|
204
|
+
goto cleanup;
|
|
205
|
+
}
|
|
206
|
+
winpty_error_free(error_ptr);
|
|
207
|
+
|
|
208
|
+
// Save pty struct for later use
|
|
209
|
+
ptyHandles.insert(ptyHandles.end(), pc);
|
|
210
|
+
|
|
211
|
+
// Create winpty spawn config
|
|
212
|
+
config = winpty_spawn_config_new(WINPTY_SPAWN_FLAG_AUTO_SHUTDOWN, shellpath.c_str(), cmdline, cwd, env.c_str(), &error_ptr);
|
|
213
|
+
if (config == nullptr) {
|
|
214
|
+
throw_winpty_error("Error creating WinPTY spawn config", error_ptr);
|
|
215
|
+
goto cleanup;
|
|
216
|
+
}
|
|
217
|
+
winpty_error_free(error_ptr);
|
|
218
|
+
|
|
219
|
+
// Spawn the new process
|
|
220
|
+
spawnSuccess = winpty_spawn(pc, config, &handle, nullptr, nullptr, &error_ptr);
|
|
221
|
+
winpty_spawn_config_free(config);
|
|
222
|
+
if (!spawnSuccess) {
|
|
223
|
+
throw_winpty_error("Unable to start terminal process", error_ptr);
|
|
224
|
+
goto cleanup;
|
|
225
|
+
}
|
|
226
|
+
winpty_error_free(error_ptr);
|
|
227
|
+
|
|
228
|
+
// Set return values
|
|
229
|
+
Nan::Set(marshal, Nan::New<v8::String>("innerPid").ToLocalChecked(), Nan::New<v8::Number>((int)GetProcessId(handle)));
|
|
230
|
+
Nan::Set(marshal, Nan::New<v8::String>("innerPidHandle").ToLocalChecked(), Nan::New<v8::Number>((int)handle));
|
|
231
|
+
Nan::Set(marshal, Nan::New<v8::String>("pid").ToLocalChecked(), Nan::New<v8::Number>((int)winpty_agent_process(pc)));
|
|
232
|
+
Nan::Set(marshal, Nan::New<v8::String>("pty").ToLocalChecked(), Nan::New<v8::Number>(InterlockedIncrement(&ptyCounter)));
|
|
233
|
+
Nan::Set(marshal, Nan::New<v8::String>("fd").ToLocalChecked(), Nan::New<v8::Number>(-1));
|
|
234
|
+
{
|
|
235
|
+
LPCWSTR coninPipeName = winpty_conin_name(pc);
|
|
236
|
+
std::wstring coninPipeNameWStr(coninPipeName);
|
|
237
|
+
std::string coninPipeNameStr(coninPipeNameWStr.begin(), coninPipeNameWStr.end());
|
|
238
|
+
Nan::Set(marshal, Nan::New<v8::String>("conin").ToLocalChecked(), Nan::New<v8::String>(coninPipeNameStr).ToLocalChecked());
|
|
239
|
+
LPCWSTR conoutPipeName = winpty_conout_name(pc);
|
|
240
|
+
std::wstring conoutPipeNameWStr(conoutPipeName);
|
|
241
|
+
std::string conoutPipeNameStr(conoutPipeNameWStr.begin(), conoutPipeNameWStr.end());
|
|
242
|
+
Nan::Set(marshal, Nan::New<v8::String>("conout").ToLocalChecked(), Nan::New<v8::String>(conoutPipeNameStr).ToLocalChecked());
|
|
243
|
+
}
|
|
244
|
+
info.GetReturnValue().Set(marshal);
|
|
245
|
+
|
|
246
|
+
goto cleanup;
|
|
247
|
+
|
|
248
|
+
cleanup:
|
|
249
|
+
delete filename;
|
|
250
|
+
delete cmdline;
|
|
251
|
+
delete cwd;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
static NAN_METHOD(PtyResize) {
|
|
255
|
+
Nan::HandleScope scope;
|
|
256
|
+
|
|
257
|
+
if (info.Length() != 3 ||
|
|
258
|
+
!info[0]->IsNumber() ||
|
|
259
|
+
!info[1]->IsNumber() ||
|
|
260
|
+
!info[2]->IsNumber()) {
|
|
261
|
+
Nan::ThrowError("Usage: pty.resize(pid, cols, rows)");
|
|
262
|
+
return;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
int handle = info[0]->Int32Value(Nan::GetCurrentContext()).FromJust();
|
|
266
|
+
int cols = info[1]->Int32Value(Nan::GetCurrentContext()).FromJust();
|
|
267
|
+
int rows = info[2]->Int32Value(Nan::GetCurrentContext()).FromJust();
|
|
268
|
+
|
|
269
|
+
winpty_t *pc = get_pipe_handle(handle);
|
|
270
|
+
|
|
271
|
+
if (pc == nullptr) {
|
|
272
|
+
Nan::ThrowError("The pty doesn't appear to exist");
|
|
273
|
+
return;
|
|
274
|
+
}
|
|
275
|
+
BOOL success = winpty_set_size(pc, cols, rows, nullptr);
|
|
276
|
+
if (!success) {
|
|
277
|
+
Nan::ThrowError("The pty could not be resized");
|
|
278
|
+
return;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
return info.GetReturnValue().SetUndefined();
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
static NAN_METHOD(PtyKill) {
|
|
285
|
+
Nan::HandleScope scope;
|
|
286
|
+
|
|
287
|
+
if (info.Length() != 2 ||
|
|
288
|
+
!info[0]->IsNumber() ||
|
|
289
|
+
!info[1]->IsNumber()) {
|
|
290
|
+
Nan::ThrowError("Usage: pty.kill(pid, innerPidHandle)");
|
|
291
|
+
return;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
int handle = info[0]->Int32Value(Nan::GetCurrentContext()).FromJust();
|
|
295
|
+
HANDLE innerPidHandle = (HANDLE)info[1]->Int32Value(Nan::GetCurrentContext()).FromJust();
|
|
296
|
+
|
|
297
|
+
winpty_t *pc = get_pipe_handle(handle);
|
|
298
|
+
if (pc == nullptr) {
|
|
299
|
+
Nan::ThrowError("Pty seems to have been killed already");
|
|
300
|
+
return;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
assert(remove_pipe_handle(handle));
|
|
304
|
+
CloseHandle(innerPidHandle);
|
|
305
|
+
|
|
306
|
+
return info.GetReturnValue().SetUndefined();
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
/**
|
|
310
|
+
* Init
|
|
311
|
+
*/
|
|
312
|
+
|
|
313
|
+
extern "C" void init(v8::Local<v8::Object> target) {
|
|
314
|
+
Nan::HandleScope scope;
|
|
315
|
+
Nan::SetMethod(target, "startProcess", PtyStartProcess);
|
|
316
|
+
Nan::SetMethod(target, "resize", PtyResize);
|
|
317
|
+
Nan::SetMethod(target, "kill", PtyKill);
|
|
318
|
+
Nan::SetMethod(target, "getExitCode", PtyGetExitCode);
|
|
319
|
+
Nan::SetMethod(target, "getProcessList", PtyGetProcessList);
|
|
320
|
+
};
|
|
321
|
+
|
|
322
|
+
NODE_MODULE(pty, init);
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2020, Microsoft Corporation (MIT License).
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { Worker } from 'worker_threads';
|
|
6
|
+
import { Socket } from 'net';
|
|
7
|
+
import { IDisposable } from './types';
|
|
8
|
+
import { IWorkerData, ConoutWorkerMessage, getWorkerPipeName } from './shared/conout';
|
|
9
|
+
import { join } from 'path';
|
|
10
|
+
import { IEvent, EventEmitter2 } from './eventEmitter2';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* The amount of time to wait for additional data after the conpty shell process has exited before
|
|
14
|
+
* shutting down the worker and sockets. The timer will be reset if a new data event comes in after
|
|
15
|
+
* the timer has started.
|
|
16
|
+
*/
|
|
17
|
+
const FLUSH_DATA_INTERVAL = 1000;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Connects to and manages the lifecycle of the conout socket. This socket must be drained on
|
|
21
|
+
* another thread in order to avoid deadlocks where Conpty waits for the out socket to drain
|
|
22
|
+
* when `ClosePseudoConsole` is called. This happens when data is being written to the terminal when
|
|
23
|
+
* the pty is closed.
|
|
24
|
+
*
|
|
25
|
+
* See also:
|
|
26
|
+
* - https://github.com/microsoft/node-pty/issues/375
|
|
27
|
+
* - https://github.com/microsoft/vscode/issues/76548
|
|
28
|
+
* - https://github.com/microsoft/terminal/issues/1810
|
|
29
|
+
* - https://docs.microsoft.com/en-us/windows/console/closepseudoconsole
|
|
30
|
+
*/
|
|
31
|
+
export class ConoutConnection implements IDisposable {
|
|
32
|
+
private _worker: Worker;
|
|
33
|
+
private _drainTimeout: NodeJS.Timeout | undefined;
|
|
34
|
+
private _isDisposed: boolean = false;
|
|
35
|
+
|
|
36
|
+
private _onReady = new EventEmitter2<void>();
|
|
37
|
+
public get onReady(): IEvent<void> { return this._onReady.event; }
|
|
38
|
+
|
|
39
|
+
constructor(
|
|
40
|
+
private _conoutPipeName: string
|
|
41
|
+
) {
|
|
42
|
+
const workerData: IWorkerData = { conoutPipeName: _conoutPipeName };
|
|
43
|
+
const scriptPath = __dirname.replace('node_modules.asar', 'node_modules.asar.unpacked');
|
|
44
|
+
this._worker = new Worker(join(scriptPath, 'worker/conoutSocketWorker.js'), { workerData });
|
|
45
|
+
this._worker.on('message', (message: ConoutWorkerMessage) => {
|
|
46
|
+
switch (message) {
|
|
47
|
+
case ConoutWorkerMessage.READY:
|
|
48
|
+
this._onReady.fire();
|
|
49
|
+
return;
|
|
50
|
+
default:
|
|
51
|
+
console.warn('Unexpected ConoutWorkerMessage', message);
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
dispose(): void {
|
|
57
|
+
if (this._isDisposed) {
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
this._isDisposed = true;
|
|
61
|
+
// Drain all data from the socket before closing
|
|
62
|
+
this._drainDataAndClose();
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
connectSocket(socket: Socket): void {
|
|
66
|
+
socket.connect(getWorkerPipeName(this._conoutPipeName));
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
private _drainDataAndClose(): void {
|
|
70
|
+
if (this._drainTimeout) {
|
|
71
|
+
clearTimeout(this._drainTimeout);
|
|
72
|
+
}
|
|
73
|
+
this._drainTimeout = setTimeout(() => this._destroySocket(), FLUSH_DATA_INTERVAL);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
private async _destroySocket(): Promise<void> {
|
|
77
|
+
await this._worker.terminate();
|
|
78
|
+
}
|
|
79
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2017, Daniel Imms (MIT License).
|
|
3
|
+
* Copyright (c) 2018, Microsoft Corporation (MIT License).
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import * as assert from 'assert';
|
|
7
|
+
import { argsToCommandLine } from './windowsPtyAgent';
|
|
8
|
+
|
|
9
|
+
function check(file: string, args: string | string[], expected: string): void {
|
|
10
|
+
assert.equal(argsToCommandLine(file, args), expected);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
if (process.platform === 'win32') {
|
|
14
|
+
describe('argsToCommandLine', () => {
|
|
15
|
+
describe('Plain strings', () => {
|
|
16
|
+
it('doesn\'t quote plain string', () => {
|
|
17
|
+
check('asdf', [], 'asdf');
|
|
18
|
+
});
|
|
19
|
+
it('doesn\'t escape backslashes', () => {
|
|
20
|
+
check('\\asdf\\qwer\\', [], '\\asdf\\qwer\\');
|
|
21
|
+
});
|
|
22
|
+
it('doesn\'t escape multiple backslashes', () => {
|
|
23
|
+
check('asdf\\\\qwer', [], 'asdf\\\\qwer');
|
|
24
|
+
});
|
|
25
|
+
it('adds backslashes before quotes', () => {
|
|
26
|
+
check('"asdf"qwer"', [], '\\"asdf\\"qwer\\"');
|
|
27
|
+
});
|
|
28
|
+
it('escapes backslashes before quotes', () => {
|
|
29
|
+
check('asdf\\"qwer', [], 'asdf\\\\\\"qwer');
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
describe('Quoted strings', () => {
|
|
34
|
+
it('quotes string with spaces', () => {
|
|
35
|
+
check('asdf qwer', [], '"asdf qwer"');
|
|
36
|
+
});
|
|
37
|
+
it('quotes empty string', () => {
|
|
38
|
+
check('', [], '""');
|
|
39
|
+
});
|
|
40
|
+
it('quotes string with tabs', () => {
|
|
41
|
+
check('asdf\tqwer', [], '"asdf\tqwer"');
|
|
42
|
+
});
|
|
43
|
+
it('escapes only the last backslash', () => {
|
|
44
|
+
check('\\asdf \\qwer\\', [], '"\\asdf \\qwer\\\\"');
|
|
45
|
+
});
|
|
46
|
+
it('doesn\'t escape multiple backslashes', () => {
|
|
47
|
+
check('asdf \\\\qwer', [], '"asdf \\\\qwer"');
|
|
48
|
+
});
|
|
49
|
+
it('escapes backslashes before quotes', () => {
|
|
50
|
+
check('asdf \\"qwer', [], '"asdf \\\\\\"qwer"');
|
|
51
|
+
});
|
|
52
|
+
it('escapes multiple backslashes at the end', () => {
|
|
53
|
+
check('asdf qwer\\\\', [], '"asdf qwer\\\\\\\\"');
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
describe('Multiple arguments', () => {
|
|
58
|
+
it('joins arguments with spaces', () => {
|
|
59
|
+
check('asdf', ['qwer zxcv', '', '"'], 'asdf "qwer zxcv" "" \\"');
|
|
60
|
+
});
|
|
61
|
+
it('array argument all in quotes', () => {
|
|
62
|
+
check('asdf', ['"surounded by quotes"'], 'asdf \\"surounded by quotes\\"');
|
|
63
|
+
});
|
|
64
|
+
it('array argument quotes in the middle', () => {
|
|
65
|
+
check('asdf', ['quotes "in the" middle'], 'asdf "quotes \\"in the\\" middle"');
|
|
66
|
+
});
|
|
67
|
+
it('array argument quotes near start', () => {
|
|
68
|
+
check('asdf', ['"quotes" near start'], 'asdf "\\"quotes\\" near start"');
|
|
69
|
+
});
|
|
70
|
+
it('array argument quotes near end', () => {
|
|
71
|
+
check('asdf', ['quotes "near end"'], 'asdf "quotes \\"near end\\""');
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
describe('Args as CommandLine', () => {
|
|
76
|
+
it('should handle empty string', () => {
|
|
77
|
+
check('file', '', 'file');
|
|
78
|
+
});
|
|
79
|
+
it('should not change args', () => {
|
|
80
|
+
check('file', 'foo bar baz', 'file foo bar baz');
|
|
81
|
+
check('file', 'foo \\ba"r \baz', 'file foo \\ba"r \baz');
|
|
82
|
+
});
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
describe('Real-world cases', () => {
|
|
86
|
+
it('quotes within quotes', () => {
|
|
87
|
+
check('cmd.exe', ['/c', 'powershell -noexit -command \'Set-location \"C:\\user\"\''], 'cmd.exe /c "powershell -noexit -command \'Set-location \\\"C:\\user\\"\'"');
|
|
88
|
+
});
|
|
89
|
+
it('space within quotes', () => {
|
|
90
|
+
check('cmd.exe', ['/k', '"C:\\Users\\alros\\Desktop\\test script.bat"'], 'cmd.exe /k \\"C:\\Users\\alros\\Desktop\\test script.bat\\"');
|
|
91
|
+
});
|
|
92
|
+
});
|
|
93
|
+
});
|
|
94
|
+
}
|