@jingyi0605/codingns 0.7.4 → 0.8.1
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/README.md +6 -0
- package/bin/codingns.mjs +747 -28
- package/bin/office-mcp-server.mjs +620 -0
- package/dist/public/assets/{AdaptiveButlerPage-CgBX49t-.js → AdaptiveButlerPage-b7s6F_sd.js} +1 -1
- package/dist/public/assets/{App-tXOqoHNl.js → App-B0q8uDA-.js} +3 -3
- package/dist/public/assets/{BootstrapPage-DoRMz87R.js → BootstrapPage-jFfl7KNK.js} +1 -1
- package/dist/public/assets/{ConversationPage-DXR6Hp4O.js → ConversationPage-sj_rn4q0.js} +6 -6
- package/dist/public/assets/{DesktopDetachPreviewPage-Cyk-ZYCk.js → DesktopDetachPreviewPage-C5c88SOX.js} +1 -1
- package/dist/public/assets/{DesktopWindowPage-DNVNK3hs.js → DesktopWindowPage-BdKUZrKG.js} +1 -1
- package/dist/public/assets/FileContextPanel-lM5mBcfn.js +1 -0
- package/dist/public/assets/{GitSidebar-Cr3Z9OUI.js → GitSidebar-CmXAhyjo.js} +2 -2
- package/dist/public/assets/{MobileCreateSessionSheet-DMW0V6GJ.js → MobileCreateSessionSheet-CceV0-AH.js} +1 -1
- package/dist/public/assets/{MobileTopHeaderFrame-CkdnZ_MU.js → MobileTopHeaderFrame-_I0t7cC_.js} +1 -1
- package/dist/public/assets/{MobileWorkspaceSwitcherHeader-KIbqBYJN.js → MobileWorkspaceSwitcherHeader-DhaM9fgx.js} +1 -1
- package/dist/public/assets/{RelayConnectEntryPage-DIRBH3hw.js → RelayConnectEntryPage-CMtDWyGS.js} +1 -1
- package/dist/public/assets/{ServerSettingsModal-C-9RxdWP.js → ServerSettingsModal-Rkgn3jft.js} +1 -1
- package/dist/public/assets/{SessionIndexPage-bRlIydRA.js → SessionIndexPage-BOumP3ij.js} +1 -1
- package/dist/public/assets/{SettingsPage-CMEt4ua9.js → SettingsPage-vx_c-00-.js} +2 -2
- package/dist/public/assets/{TerminalManagerPanel-2bi9wVhT.js → TerminalManagerPanel-D9JHCS6d.js} +1 -1
- package/dist/public/assets/{TerminalPage-DayZz2Tf.js → TerminalPage-CBIKHI33.js} +1 -1
- package/dist/public/assets/{TerminalRuntimeFallbackModal-DgwYcp-Y.js → TerminalRuntimeFallbackModal-W5NjqFEz.js} +1 -1
- package/dist/public/assets/{ToolFilesPage-YvnP_FXW.js → ToolFilesPage-DWtpaN_7.js} +1 -1
- package/dist/public/assets/{ToolGitPage-GMcQKtV9.js → ToolGitPage-MpGXsw4_.js} +1 -1
- package/dist/public/assets/{ToolProcessesPage-DFIQ7BCd.js → ToolProcessesPage-B1jHQKhZ.js} +1 -1
- package/dist/public/assets/{ToolsHomePage-CSilFzXR.js → ToolsHomePage-CJrn8ZFl.js} +1 -1
- package/dist/public/assets/{WorkbenchLandingPage-1VtToSz9.js → WorkbenchLandingPage-CJQ1V5U-.js} +1 -1
- package/dist/public/assets/WorkbenchLayout-D48i71PU.js +244 -0
- package/dist/public/assets/{WorkbenchModal-BWXYSXmC.js → WorkbenchModal-BYNuMIoV.js} +1 -1
- package/dist/public/assets/WorkbenchShellRoute-B4XB8SwG.css +1 -0
- package/dist/public/assets/WorkbenchShellRoute-CGKjy4J-.js +1 -0
- package/dist/public/assets/{WorkspaceDebugDetailPage-Ux8_Q7la.js → WorkspaceDebugDetailPage-DCAYgays.js} +1 -1
- package/dist/public/assets/{WorkspaceDetailPage-B402p99m.js → WorkspaceDetailPage-D5v-nUIi.js} +1 -1
- package/dist/public/assets/{WorkspaceHomePage-D2pob6HI.js → WorkspaceHomePage-I5G1p5SR.js} +1 -1
- package/dist/public/assets/{client-runtime-manager-C5D76ewj.js → client-runtime-manager-CdJP7nUp.js} +1 -1
- package/dist/public/assets/file-tree-icon-BFwaPxKs.js +590 -0
- package/dist/public/assets/index-CjewzOUG.js +42 -0
- package/dist/public/assets/index-VVxfF0s5.css +1 -0
- package/dist/public/assets/{login-direct-candidate-resolver-wXSaB0i7.js → login-direct-candidate-resolver-C-mo698r.js} +1 -1
- package/dist/public/assets/{model-switch-api-CPtou49j.js → model-switch-api-Br0ivfe5.js} +1 -1
- package/dist/public/assets/{preferences-service-CdaK7zA8.js → preferences-service-CnaTvZq2.js} +1 -1
- package/dist/public/assets/{realtime-client-BjQazYsK.js → realtime-client-BlQRqVmm.js} +1 -1
- package/dist/public/assets/{relay-entry-BwE5nw0l.js → relay-entry-D7OgZZN-.js} +1 -1
- package/dist/public/assets/{terminal-runtime-meta-C-Lbyx2i.js → terminal-runtime-meta-BCtAYB0E.js} +1 -1
- package/dist/public/assets/{useRegisteredDebugTemplates-BM7-c-gx.js → useRegisteredDebugTemplates-CXmxu69X.js} +1 -1
- package/dist/public/index.html +2 -2
- package/dist/server/config/env.d.ts +3 -0
- package/dist/server/config/env.js +67 -1
- package/dist/server/config/env.js.map +1 -1
- package/dist/server/config/opencode-base-url-resolver.d.ts +3 -2
- package/dist/server/config/opencode-base-url-resolver.js +64 -24
- package/dist/server/config/opencode-base-url-resolver.js.map +1 -1
- package/dist/server/main.js +2 -0
- package/dist/server/main.js.map +1 -1
- package/dist/server/middlewares/auth-guard.js +4 -0
- package/dist/server/middlewares/auth-guard.js.map +1 -1
- package/dist/server/modules/assistant-capability/assistant-capability-controller.d.ts +169 -1
- package/dist/server/modules/assistant-capability/assistant-capability-controller.js +206 -4
- package/dist/server/modules/assistant-capability/assistant-capability-controller.js.map +1 -1
- package/dist/server/modules/assistant-capability/assistant-capability-service.d.ts +297 -2
- package/dist/server/modules/assistant-capability/assistant-capability-service.js +873 -3
- package/dist/server/modules/assistant-capability/assistant-capability-service.js.map +1 -1
- package/dist/server/modules/auth/auth-service.d.ts +21 -1
- package/dist/server/modules/auth/auth-service.js +64 -0
- package/dist/server/modules/auth/auth-service.js.map +1 -1
- package/dist/server/modules/browser-runtime/browser-profile-service.d.ts +26 -0
- package/dist/server/modules/browser-runtime/browser-profile-service.js +85 -0
- package/dist/server/modules/browser-runtime/browser-profile-service.js.map +1 -0
- package/dist/server/modules/browser-runtime/browser-runtime-controller.d.ts +70 -0
- package/dist/server/modules/browser-runtime/browser-runtime-controller.js +84 -0
- package/dist/server/modules/browser-runtime/browser-runtime-controller.js.map +1 -0
- package/dist/server/modules/browser-runtime/browser-runtime-service.d.ts +59 -0
- package/dist/server/modules/browser-runtime/browser-runtime-service.js +255 -0
- package/dist/server/modules/browser-runtime/browser-runtime-service.js.map +1 -0
- package/dist/server/modules/browser-runtime/browser-task-execution-support.d.ts +65 -0
- package/dist/server/modules/browser-runtime/browser-task-execution-support.js +432 -0
- package/dist/server/modules/browser-runtime/browser-task-execution-support.js.map +1 -0
- package/dist/server/modules/browser-runtime/browser-task-executor-registry.d.ts +7 -0
- package/dist/server/modules/browser-runtime/browser-task-executor-registry.js +21 -0
- package/dist/server/modules/browser-runtime/browser-task-executor-registry.js.map +1 -0
- package/dist/server/modules/browser-runtime/browser-task-executor.d.ts +55 -0
- package/dist/server/modules/browser-runtime/browser-task-executor.js +2 -0
- package/dist/server/modules/browser-runtime/browser-task-executor.js.map +1 -0
- package/dist/server/modules/browser-runtime/browser-task-payload.d.ts +33 -0
- package/dist/server/modules/browser-runtime/browser-task-payload.js +55 -0
- package/dist/server/modules/browser-runtime/browser-task-payload.js.map +1 -0
- package/dist/server/modules/browser-runtime/opencli-bridge-browser-executor.d.ts +19 -0
- package/dist/server/modules/browser-runtime/opencli-bridge-browser-executor.js +219 -0
- package/dist/server/modules/browser-runtime/opencli-bridge-browser-executor.js.map +1 -0
- package/dist/server/modules/browser-runtime/opencli-browser-bridge-service.d.ts +15 -0
- package/dist/server/modules/browser-runtime/opencli-browser-bridge-service.js +33 -0
- package/dist/server/modules/browser-runtime/opencli-browser-bridge-service.js.map +1 -0
- package/dist/server/modules/browser-runtime/playwright-browser-executor.d.ts +16 -0
- package/dist/server/modules/browser-runtime/playwright-browser-executor.js +272 -0
- package/dist/server/modules/browser-runtime/playwright-browser-executor.js.map +1 -0
- package/dist/server/modules/butler/butler-auth-service.js +4 -0
- package/dist/server/modules/butler/butler-auth-service.js.map +1 -1
- package/dist/server/modules/butler/butler-inbox-instruction-adapter.js +1 -0
- package/dist/server/modules/butler/butler-inbox-instruction-adapter.js.map +1 -1
- package/dist/server/modules/butler/butler-session-summary-service.d.ts +1 -0
- package/dist/server/modules/butler/butler-session-summary-service.js +5 -3
- package/dist/server/modules/butler/butler-session-summary-service.js.map +1 -1
- package/dist/server/modules/butler/butler-workspace-context.js +23 -0
- package/dist/server/modules/butler/butler-workspace-context.js.map +1 -1
- package/dist/server/modules/debug-target/debug-target-service.d.ts +2 -0
- package/dist/server/modules/debug-target/debug-target-service.js +14 -0
- package/dist/server/modules/debug-target/debug-target-service.js.map +1 -1
- package/dist/server/modules/document-runtime/document-docx-fallback-renderer.py +139 -0
- package/dist/server/modules/document-runtime/document-export-executor.d.ts +50 -0
- package/dist/server/modules/document-runtime/document-export-executor.js +827 -0
- package/dist/server/modules/document-runtime/document-export-executor.js.map +1 -0
- package/dist/server/modules/document-runtime/document-runtime-controller.d.ts +127 -0
- package/dist/server/modules/document-runtime/document-runtime-controller.js +131 -0
- package/dist/server/modules/document-runtime/document-runtime-controller.js.map +1 -0
- package/dist/server/modules/document-runtime/document-runtime-service.d.ts +125 -0
- package/dist/server/modules/document-runtime/document-runtime-service.js +706 -0
- package/dist/server/modules/document-runtime/document-runtime-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/office/office-controller.d.ts +77 -0
- package/dist/server/modules/office/office-controller.js +174 -0
- package/dist/server/modules/office/office-controller.js.map +1 -0
- package/dist/server/modules/office/office-preview-link-service.d.ts +27 -0
- package/dist/server/modules/office/office-preview-link-service.js +121 -0
- package/dist/server/modules/office/office-preview-link-service.js.map +1 -0
- package/dist/server/modules/office/office-service.d.ts +67 -0
- package/dist/server/modules/office/office-service.js +359 -0
- package/dist/server/modules/office/office-service.js.map +1 -0
- package/dist/server/modules/opencli/opencli-bridge-skill-service.js +38 -14
- package/dist/server/modules/opencli/opencli-bridge-skill-service.js.map +1 -1
- package/dist/server/modules/opencli/opencli-install-discovery.d.ts +4 -0
- package/dist/server/modules/opencli/opencli-install-discovery.js +94 -0
- package/dist/server/modules/opencli/opencli-install-discovery.js.map +1 -1
- package/dist/server/modules/opencli/opencli-runtime-builder.js +29 -0
- package/dist/server/modules/opencli/opencli-runtime-builder.js.map +1 -1
- package/dist/server/modules/opencli/opencli-runtime-guard.d.ts +2 -0
- package/dist/server/modules/opencli/opencli-runtime-guard.js +5 -0
- package/dist/server/modules/opencli/opencli-runtime-guard.js.map +1 -0
- package/dist/server/modules/ops-runtime/ops-runtime-controller.d.ts +70 -0
- package/dist/server/modules/ops-runtime/ops-runtime-controller.js +83 -0
- package/dist/server/modules/ops-runtime/ops-runtime-controller.js.map +1 -0
- package/dist/server/modules/ops-runtime/ops-runtime-service.d.ts +80 -0
- package/dist/server/modules/ops-runtime/ops-runtime-service.js +327 -0
- package/dist/server/modules/ops-runtime/ops-runtime-service.js.map +1 -0
- package/dist/server/modules/ops-runtime/ssh-ops-executor.d.ts +41 -0
- package/dist/server/modules/ops-runtime/ssh-ops-executor.js +478 -0
- package/dist/server/modules/ops-runtime/ssh-ops-executor.js.map +1 -0
- package/dist/server/modules/presentation/presentation-controller.d.ts +22 -0
- package/dist/server/modules/presentation/presentation-controller.js +59 -0
- package/dist/server/modules/presentation/presentation-controller.js.map +1 -0
- package/dist/server/modules/presentation/presentation-export-task-service.d.ts +24 -0
- package/dist/server/modules/presentation/presentation-export-task-service.js +137 -0
- package/dist/server/modules/presentation/presentation-export-task-service.js.map +1 -0
- package/dist/server/modules/presentation/presentation-export-types.d.ts +12 -0
- package/dist/server/modules/presentation/presentation-export-types.js +2 -0
- package/dist/server/modules/presentation/presentation-export-types.js.map +1 -0
- package/dist/server/modules/presentation/presentation-pdf-export-service.d.ts +20 -0
- package/dist/server/modules/presentation/presentation-pdf-export-service.js +29 -0
- package/dist/server/modules/presentation/presentation-pdf-export-service.js.map +1 -0
- package/dist/server/modules/presentation/presentation-pptx-export-service.d.ts +20 -0
- package/dist/server/modules/presentation/presentation-pptx-export-service.js +64 -0
- package/dist/server/modules/presentation/presentation-pptx-export-service.js.map +1 -0
- package/dist/server/modules/presentation/presentation-renderer.d.ts +21 -0
- package/dist/server/modules/presentation/presentation-renderer.js +208 -0
- package/dist/server/modules/presentation/presentation-renderer.js.map +1 -0
- package/dist/server/modules/relay-tunnel/relay-tunnel-gateway-service.js +3 -3
- package/dist/server/modules/relay-tunnel/relay-tunnel-gateway-service.js.map +1 -1
- package/dist/server/modules/relay-tunnel/relay-tunnel-service.js +6 -1
- package/dist/server/modules/relay-tunnel/relay-tunnel-service.js.map +1 -1
- package/dist/server/modules/sessions/codex-app-server-helper-process.js +2 -1
- package/dist/server/modules/sessions/codex-app-server-helper-process.js.map +1 -1
- package/dist/server/modules/sessions/session-controller.d.ts +1 -0
- package/dist/server/modules/sessions/session-controller.js +59 -4
- package/dist/server/modules/sessions/session-controller.js.map +1 -1
- package/dist/server/modules/sessions/session-history-service.js +17 -5
- package/dist/server/modules/sessions/session-history-service.js.map +1 -1
- package/dist/server/modules/sessions/session-live-runtime-service.d.ts +5 -1
- package/dist/server/modules/sessions/session-live-runtime-service.js +129 -8
- package/dist/server/modules/sessions/session-live-runtime-service.js.map +1 -1
- package/dist/server/modules/sessions/session-provider-config-service.d.ts +25 -1
- package/dist/server/modules/sessions/session-provider-config-service.js +54 -5
- package/dist/server/modules/sessions/session-provider-config-service.js.map +1 -1
- package/dist/server/modules/sessions/workspace-office-mcp-config.d.ts +14 -0
- package/dist/server/modules/sessions/workspace-office-mcp-config.js +54 -0
- package/dist/server/modules/sessions/workspace-office-mcp-config.js.map +1 -0
- package/dist/server/modules/sessions/workspace-session-auth-service.d.ts +27 -0
- package/dist/server/modules/sessions/workspace-session-auth-service.js +109 -0
- package/dist/server/modules/sessions/workspace-session-auth-service.js.map +1 -0
- package/dist/server/modules/sessions/workspace-session-runtime-context-service.d.ts +51 -0
- package/dist/server/modules/sessions/workspace-session-runtime-context-service.js +341 -0
- package/dist/server/modules/sessions/workspace-session-runtime-context-service.js.map +1 -0
- package/dist/server/modules/skills/assistant-runtime-skill-catalog.js +5 -0
- package/dist/server/modules/skills/assistant-runtime-skill-catalog.js.map +1 -1
- package/dist/server/modules/skills/builtin-skills/codingns-workspace-session/SKILL.md +67 -0
- package/dist/server/modules/skills/builtin-skills/codingns-workspace-session/agents/openai.yaml +4 -0
- package/dist/server/modules/skills/builtin-skills/codingns-workspace-session/references/cli-workflow.md +133 -0
- package/dist/server/modules/skills/skill-controller.d.ts +7 -0
- package/dist/server/modules/skills/skill-controller.js +7 -0
- package/dist/server/modules/skills/skill-controller.js.map +1 -1
- package/dist/server/modules/skills/skill-manager-service.d.ts +61 -0
- package/dist/server/modules/skills/skill-manager-service.js +218 -0
- package/dist/server/modules/skills/skill-manager-service.js.map +1 -1
- package/dist/server/modules/skills/skill-name-policy.js +2 -1
- package/dist/server/modules/skills/skill-name-policy.js.map +1 -1
- package/dist/server/modules/tasks/task-helper-client.d.ts +1 -0
- package/dist/server/modules/tasks/task-helper-client.js +45 -9
- package/dist/server/modules/tasks/task-helper-client.js.map +1 -1
- package/dist/server/modules/tasks/task-types.d.ts +5 -0
- package/dist/server/modules/tasks/task-types.js +6 -1
- package/dist/server/modules/tasks/task-types.js.map +1 -1
- package/dist/server/modules/terminal/runtime/conpty-session-agent-process.js +2 -1
- package/dist/server/modules/terminal/runtime/conpty-session-agent-process.js.map +1 -1
- package/dist/server/modules/terminal/runtime/node-pty-loader.d.ts +5 -0
- package/dist/server/modules/terminal/runtime/node-pty-loader.js +68 -0
- package/dist/server/modules/terminal/runtime/node-pty-loader.js.map +1 -0
- package/dist/server/modules/terminal/runtime/pty-broker-agent-process.js +2 -1
- package/dist/server/modules/terminal/runtime/pty-broker-agent-process.js.map +1 -1
- package/dist/server/modules/terminal/runtime/pty-host-attachment-manager.js +6 -9
- package/dist/server/modules/terminal/runtime/pty-host-attachment-manager.js.map +1 -1
- package/dist/server/modules/terminal/runtime/pty-runtime-manager.js +6 -9
- package/dist/server/modules/terminal/runtime/pty-runtime-manager.js.map +1 -1
- package/dist/server/routes/assistant.d.ts +2 -1
- package/dist/server/routes/assistant.js +20 -1
- package/dist/server/routes/assistant.js.map +1 -1
- package/dist/server/routes/browser-runtime.d.ts +3 -0
- package/dist/server/routes/browser-runtime.js +14 -0
- package/dist/server/routes/browser-runtime.js.map +1 -0
- package/dist/server/routes/document-runtime.d.ts +3 -0
- package/dist/server/routes/document-runtime.js +18 -0
- package/dist/server/routes/document-runtime.js.map +1 -0
- package/dist/server/routes/office.d.ts +3 -0
- package/dist/server/routes/office.js +16 -0
- package/dist/server/routes/office.js.map +1 -0
- package/dist/server/routes/ops-runtime.d.ts +3 -0
- package/dist/server/routes/ops-runtime.js +13 -0
- package/dist/server/routes/ops-runtime.js.map +1 -0
- package/dist/server/routes/presentation.d.ts +3 -0
- package/dist/server/routes/presentation.js +5 -0
- package/dist/server/routes/presentation.js.map +1 -0
- package/dist/server/routes/skills.js +1 -0
- package/dist/server/routes/skills.js.map +1 -1
- package/dist/server/server/create-server.d.ts +36 -0
- package/dist/server/server/create-server.js +215 -4
- package/dist/server/server/create-server.js.map +1 -1
- package/dist/server/server/release-manifest-sync.d.ts +1 -0
- package/dist/server/server/release-manifest-sync.js +2 -2
- package/dist/server/server/release-manifest-sync.js.map +1 -1
- package/dist/server/server/start-host.js +1 -1
- package/dist/server/server/start-host.js.map +1 -1
- package/dist/server/shared/http/error-handler.js +53 -19
- package/dist/server/shared/http/error-handler.js.map +1 -1
- 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/auth-token-repository.js +22 -6
- package/dist/server/storage/repositories/auth-token-repository.js.map +1 -1
- package/dist/server/storage/repositories/browser-profile-repository.d.ts +18 -0
- package/dist/server/storage/repositories/browser-profile-repository.js +134 -0
- package/dist/server/storage/repositories/browser-profile-repository.js.map +1 -0
- package/dist/server/storage/repositories/document-comment-repository.d.ts +10 -0
- package/dist/server/storage/repositories/document-comment-repository.js +118 -0
- package/dist/server/storage/repositories/document-comment-repository.js.map +1 -0
- package/dist/server/storage/repositories/document-repository.d.ts +16 -0
- package/dist/server/storage/repositories/document-repository.js +109 -0
- package/dist/server/storage/repositories/document-repository.js.map +1 -0
- package/dist/server/storage/repositories/document-revision-repository.d.ts +10 -0
- package/dist/server/storage/repositories/document-revision-repository.js +79 -0
- package/dist/server/storage/repositories/document-revision-repository.js.map +1 -0
- package/dist/server/storage/repositories/document-template-repository.d.ts +13 -0
- package/dist/server/storage/repositories/document-template-repository.js +244 -0
- package/dist/server/storage/repositories/document-template-repository.js.map +1 -0
- package/dist/server/storage/repositories/office-approval-repository.d.ts +11 -0
- package/dist/server/storage/repositories/office-approval-repository.js +109 -0
- package/dist/server/storage/repositories/office-approval-repository.js.map +1 -0
- package/dist/server/storage/repositories/office-artifact-repository.d.ts +10 -0
- package/dist/server/storage/repositories/office-artifact-repository.js +89 -0
- package/dist/server/storage/repositories/office-artifact-repository.js.map +1 -0
- package/dist/server/storage/repositories/office-audit-event-repository.d.ts +8 -0
- package/dist/server/storage/repositories/office-audit-event-repository.js +54 -0
- package/dist/server/storage/repositories/office-audit-event-repository.js.map +1 -0
- package/dist/server/storage/repositories/office-connector-repository.d.ts +10 -0
- package/dist/server/storage/repositories/office-connector-repository.js +97 -0
- package/dist/server/storage/repositories/office-connector-repository.js.map +1 -0
- package/dist/server/storage/repositories/office-receipt-repository.d.ts +8 -0
- package/dist/server/storage/repositories/office-receipt-repository.js +48 -0
- package/dist/server/storage/repositories/office-receipt-repository.js.map +1 -0
- package/dist/server/storage/repositories/office-rollback-record-repository.d.ts +8 -0
- package/dist/server/storage/repositories/office-rollback-record-repository.js +60 -0
- package/dist/server/storage/repositories/office-rollback-record-repository.js.map +1 -0
- package/dist/server/storage/repositories/office-task-repository.d.ts +19 -0
- package/dist/server/storage/repositories/office-task-repository.js +199 -0
- package/dist/server/storage/repositories/office-task-repository.js.map +1 -0
- package/dist/server/storage/repositories/office-task-step-repository.d.ts +10 -0
- package/dist/server/storage/repositories/office-task-step-repository.js +110 -0
- package/dist/server/storage/repositories/office-task-step-repository.js.map +1 -0
- package/dist/server/storage/repositories/ops-target-repository.d.ts +16 -0
- package/dist/server/storage/repositories/ops-target-repository.js +119 -0
- package/dist/server/storage/repositories/ops-target-repository.js.map +1 -0
- package/dist/server/storage/repositories/session-binding-repository.d.ts +4 -0
- package/dist/server/storage/repositories/session-binding-repository.js +70 -69
- package/dist/server/storage/repositories/session-binding-repository.js.map +1 -1
- package/dist/server/storage/repositories/session-changed-file-repository.d.ts +6 -0
- package/dist/server/storage/repositories/session-changed-file-repository.js +44 -43
- package/dist/server/storage/repositories/session-changed-file-repository.js.map +1 -1
- package/dist/server/storage/repositories/session-fork-repository.d.ts +2 -0
- package/dist/server/storage/repositories/session-fork-repository.js +42 -41
- package/dist/server/storage/repositories/session-fork-repository.js.map +1 -1
- package/dist/server/storage/repositories/session-index-repository.d.ts +5 -0
- package/dist/server/storage/repositories/session-index-repository.js +153 -152
- package/dist/server/storage/repositories/session-index-repository.js.map +1 -1
- package/dist/server/storage/repositories/session-message-attachment-repository.d.ts +7 -0
- package/dist/server/storage/repositories/session-message-attachment-repository.js +91 -90
- package/dist/server/storage/repositories/session-message-attachment-repository.js.map +1 -1
- package/dist/server/storage/repositories/session-message-origin-repository.d.ts +2 -0
- package/dist/server/storage/repositories/session-message-origin-repository.js +25 -24
- package/dist/server/storage/repositories/session-message-origin-repository.js.map +1 -1
- package/dist/server/storage/repositories/session-state-repository.d.ts +2 -0
- package/dist/server/storage/repositories/session-state-repository.js +35 -34
- package/dist/server/storage/repositories/session-state-repository.js.map +1 -1
- package/dist/server/storage/repositories/session-status-snapshot-repository.d.ts +2 -0
- package/dist/server/storage/repositories/session-status-snapshot-repository.js +25 -24
- package/dist/server/storage/repositories/session-status-snapshot-repository.js.map +1 -1
- package/dist/server/storage/sqlite/client.js +123 -1
- package/dist/server/storage/sqlite/client.js.map +1 -1
- package/dist/server/storage/sqlite/schema.sql +300 -1
- package/dist/server/types/domain.d.ts +205 -1
- package/node_modules/@codingns/session-sync-core/dist/runtime/opencode-runtime.d.ts +3 -2
- package/node_modules/@codingns/session-sync-core/dist/runtime/opencode-runtime.js +26 -19
- package/node_modules/@codingns/session-sync-core/dist/runtime/opencode-runtime.js.map +1 -1
- package/package.json +17 -8
- package/scripts/postinstall.mjs +159 -7
- package/vendor/node-pty-fork/LICENSE +69 -0
- package/vendor/node-pty-fork/README.md +91 -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/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 +54 -0
- package/vendor/node-pty-fork/scripts/verify-runtime.test.cjs +22 -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/dist/public/assets/FileContextPanel-xGTYDclT.js +0 -1
- package/dist/public/assets/WorkbenchLayout-DScHaza9.js +0 -244
- package/dist/public/assets/WorkbenchShellRoute-DN6LdrqC.js +0 -1
- package/dist/public/assets/WorkbenchShellRoute-DhQo_0vu.css +0 -1
- package/dist/public/assets/file-tree-icon-lfU9Ag77.js +0 -3
- package/dist/public/assets/index-CFYXCsyx.css +0 -1
- package/dist/public/assets/index-NGxWr8Ix.js +0 -42
- package/dist/server/modules/channels/wechat-claw-client.d.ts +0 -51
- package/dist/server/modules/channels/wechat-claw-client.js +0 -245
- package/dist/server/modules/channels/wechat-claw-client.js.map +0 -1
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type { FastifyReply, FastifyRequest } from "fastify";
|
|
2
|
+
import type { BrowserEngine, BrowserProfileMode, BrowserProfileOwnershipScope, OfficeRiskLevel } from "../../types/domain.js";
|
|
3
|
+
import { BrowserRuntimeService } from "./browser-runtime-service.js";
|
|
4
|
+
import type { BrowserExecutionBackend, BrowserSessionRequirement } from "./browser-task-payload.js";
|
|
5
|
+
interface BrowserProfileListQuery {
|
|
6
|
+
workspaceId?: string;
|
|
7
|
+
}
|
|
8
|
+
interface CreateBrowserProfileBody {
|
|
9
|
+
workspaceId?: string | null;
|
|
10
|
+
engine?: BrowserEngine;
|
|
11
|
+
mode?: BrowserProfileMode;
|
|
12
|
+
displayName?: string | null;
|
|
13
|
+
ownershipScope?: BrowserProfileOwnershipScope;
|
|
14
|
+
cdpEndpoint?: string | null;
|
|
15
|
+
}
|
|
16
|
+
interface UpdateBrowserProfileBody {
|
|
17
|
+
ownershipScope?: BrowserProfileOwnershipScope;
|
|
18
|
+
}
|
|
19
|
+
interface CreateBrowserTaskBody {
|
|
20
|
+
workspaceId?: string | null;
|
|
21
|
+
title?: string;
|
|
22
|
+
profileId?: string;
|
|
23
|
+
riskLevel?: OfficeRiskLevel;
|
|
24
|
+
executionBackend?: BrowserExecutionBackend;
|
|
25
|
+
sessionRequirement?: BrowserSessionRequirement;
|
|
26
|
+
input?: unknown;
|
|
27
|
+
}
|
|
28
|
+
interface BrowserTaskParams {
|
|
29
|
+
taskId: string;
|
|
30
|
+
}
|
|
31
|
+
interface BrowserProfileParams {
|
|
32
|
+
profileId: string;
|
|
33
|
+
}
|
|
34
|
+
export declare class BrowserRuntimeController {
|
|
35
|
+
private readonly browserRuntimeService;
|
|
36
|
+
constructor(browserRuntimeService: BrowserRuntimeService);
|
|
37
|
+
readonly listProfiles: (request: FastifyRequest<{
|
|
38
|
+
Querystring: BrowserProfileListQuery;
|
|
39
|
+
}>, reply: FastifyReply) => Promise<void>;
|
|
40
|
+
readonly createProfile: (request: FastifyRequest<{
|
|
41
|
+
Body: CreateBrowserProfileBody;
|
|
42
|
+
}>, reply: FastifyReply) => Promise<void>;
|
|
43
|
+
readonly createTask: (request: FastifyRequest<{
|
|
44
|
+
Body: CreateBrowserTaskBody;
|
|
45
|
+
}>, reply: FastifyReply) => Promise<void>;
|
|
46
|
+
readonly getProfile: (request: FastifyRequest<{
|
|
47
|
+
Params: BrowserProfileParams;
|
|
48
|
+
}>, reply: FastifyReply) => Promise<void>;
|
|
49
|
+
readonly updateProfile: (request: FastifyRequest<{
|
|
50
|
+
Params: BrowserProfileParams;
|
|
51
|
+
Body: UpdateBrowserProfileBody;
|
|
52
|
+
}>, reply: FastifyReply) => Promise<void>;
|
|
53
|
+
readonly deleteProfile: (request: FastifyRequest<{
|
|
54
|
+
Params: BrowserProfileParams;
|
|
55
|
+
}>, reply: FastifyReply) => Promise<void>;
|
|
56
|
+
readonly attachCdp: (request: FastifyRequest<{
|
|
57
|
+
Body: CreateBrowserProfileBody;
|
|
58
|
+
}>, reply: FastifyReply) => Promise<void>;
|
|
59
|
+
readonly executeTask: (request: FastifyRequest<{
|
|
60
|
+
Params: BrowserTaskParams;
|
|
61
|
+
}>, reply: FastifyReply) => Promise<void>;
|
|
62
|
+
readonly getExecution: (request: FastifyRequest<{
|
|
63
|
+
Params: BrowserTaskParams;
|
|
64
|
+
}>, reply: FastifyReply) => Promise<void>;
|
|
65
|
+
readonly getBridgeStatus: (_request: FastifyRequest, reply: FastifyReply) => Promise<void>;
|
|
66
|
+
readonly cancelExecution: (request: FastifyRequest<{
|
|
67
|
+
Params: BrowserTaskParams;
|
|
68
|
+
}>, reply: FastifyReply) => Promise<void>;
|
|
69
|
+
}
|
|
70
|
+
export {};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { requireUserId } from "../preferences/common.js";
|
|
2
|
+
export class BrowserRuntimeController {
|
|
3
|
+
browserRuntimeService;
|
|
4
|
+
constructor(browserRuntimeService) {
|
|
5
|
+
this.browserRuntimeService = browserRuntimeService;
|
|
6
|
+
}
|
|
7
|
+
listProfiles = async (request, reply) => {
|
|
8
|
+
reply.send({
|
|
9
|
+
items: this.browserRuntimeService.listProfiles(requireUserId(request), normalizeOptionalText(request.query.workspaceId))
|
|
10
|
+
});
|
|
11
|
+
};
|
|
12
|
+
createProfile = async (request, reply) => {
|
|
13
|
+
reply.send(this.browserRuntimeService.createProfile({
|
|
14
|
+
userId: requireUserId(request),
|
|
15
|
+
workspaceId: normalizeOptionalText(request.body.workspaceId),
|
|
16
|
+
engine: request.body.engine ?? "chrome",
|
|
17
|
+
mode: request.body.mode,
|
|
18
|
+
displayName: request.body.displayName,
|
|
19
|
+
ownershipScope: request.body.ownershipScope,
|
|
20
|
+
cdpEndpoint: request.body.cdpEndpoint
|
|
21
|
+
}));
|
|
22
|
+
};
|
|
23
|
+
createTask = async (request, reply) => {
|
|
24
|
+
reply.send(this.browserRuntimeService.createBrowserTask({
|
|
25
|
+
userId: requireUserId(request),
|
|
26
|
+
workspaceId: normalizeOptionalText(request.body.workspaceId),
|
|
27
|
+
title: request.body.title?.trim() || "浏览器任务",
|
|
28
|
+
profileId: request.body.profileId?.trim() || "",
|
|
29
|
+
riskLevel: request.body.riskLevel,
|
|
30
|
+
executionBackend: request.body.executionBackend,
|
|
31
|
+
sessionRequirement: request.body.sessionRequirement,
|
|
32
|
+
input: request.body.input
|
|
33
|
+
}));
|
|
34
|
+
};
|
|
35
|
+
getProfile = async (request, reply) => {
|
|
36
|
+
reply.send(this.browserRuntimeService.getProfile(request.params.profileId, requireUserId(request)));
|
|
37
|
+
};
|
|
38
|
+
updateProfile = async (request, reply) => {
|
|
39
|
+
reply.send(this.browserRuntimeService.updateProfile({
|
|
40
|
+
userId: requireUserId(request),
|
|
41
|
+
profileId: request.params.profileId,
|
|
42
|
+
ownershipScope: request.body.ownershipScope
|
|
43
|
+
}));
|
|
44
|
+
};
|
|
45
|
+
deleteProfile = async (request, reply) => {
|
|
46
|
+
reply.send(this.browserRuntimeService.deleteProfile(request.params.profileId, requireUserId(request)));
|
|
47
|
+
};
|
|
48
|
+
attachCdp = async (request, reply) => {
|
|
49
|
+
reply.send(this.browserRuntimeService.attachCdpProfile({
|
|
50
|
+
userId: requireUserId(request),
|
|
51
|
+
workspaceId: normalizeOptionalText(request.body.workspaceId),
|
|
52
|
+
engine: request.body.engine ?? "chrome",
|
|
53
|
+
mode: "cdp_attached",
|
|
54
|
+
displayName: request.body.displayName,
|
|
55
|
+
ownershipScope: request.body.ownershipScope,
|
|
56
|
+
cdpEndpoint: request.body.cdpEndpoint
|
|
57
|
+
}));
|
|
58
|
+
};
|
|
59
|
+
executeTask = async (request, reply) => {
|
|
60
|
+
reply.send(await this.browserRuntimeService.executeBrowserTask(request.params.taskId, requireUserId(request)));
|
|
61
|
+
};
|
|
62
|
+
getExecution = async (request, reply) => {
|
|
63
|
+
reply.send({
|
|
64
|
+
task: this.browserRuntimeService.getExecutionSnapshot(request.params.taskId, requireUserId(request))
|
|
65
|
+
});
|
|
66
|
+
};
|
|
67
|
+
getBridgeStatus = async (_request, reply) => {
|
|
68
|
+
reply.send(await this.browserRuntimeService.getBridgeStatus());
|
|
69
|
+
};
|
|
70
|
+
cancelExecution = async (request, reply) => {
|
|
71
|
+
reply.send(this.browserRuntimeService.cancelExecution(request.params.taskId, requireUserId(request)));
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
function normalizeOptionalText(value) {
|
|
75
|
+
if (value === undefined) {
|
|
76
|
+
return undefined;
|
|
77
|
+
}
|
|
78
|
+
if (value === null) {
|
|
79
|
+
return null;
|
|
80
|
+
}
|
|
81
|
+
const trimmed = value.trim();
|
|
82
|
+
return trimmed.length > 0 ? trimmed : null;
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=browser-runtime-controller.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser-runtime-controller.js","sourceRoot":"","sources":["../../../../src/modules/browser-runtime/browser-runtime-controller.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAuCzD,MAAM,OAAO,wBAAwB;IACN;IAA7B,YAA6B,qBAA4C;QAA5C,0BAAqB,GAArB,qBAAqB,CAAuB;IAAG,CAAC;IAEpE,YAAY,GAAG,KAAK,EAC3B,OAAiE,EACjE,KAAmB,EACJ,EAAE;QACjB,KAAK,CAAC,IAAI,CAAC;YACT,KAAK,EAAE,IAAI,CAAC,qBAAqB,CAAC,YAAY,CAC5C,aAAa,CAAC,OAAO,CAAC,EACtB,qBAAqB,CAAC,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,CACjD;SACF,CAAC,CAAC;IACL,CAAC,CAAC;IAEO,aAAa,GAAG,KAAK,EAC5B,OAA2D,EAC3D,KAAmB,EACJ,EAAE;QACjB,KAAK,CAAC,IAAI,CACR,IAAI,CAAC,qBAAqB,CAAC,aAAa,CAAC;YACvC,MAAM,EAAE,aAAa,CAAC,OAAO,CAAC;YAC9B,WAAW,EAAE,qBAA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,OAAO,CAAC,CACvB,CACF,CAAC;IACJ,CAAC,CAAC;IAEO,YAAY,GAAG,KAAK,EAC3B,OAAsD,EACtD,KAAmB,EACJ,EAAE;QACjB,KAAK,CAAC,IAAI,CAAC;YACT,IAAI,EAAE,IAAI,CAAC,qBAAqB,CAAC,oBAAoB,CACnD,OAAO,CAAC,MAAM,CAAC,MAAM,EACrB,aAAa,CAAC,OAAO,CAAC,CACvB;SACF,CAAC,CAAC;IACL,CAAC,CAAC;IAEO,eAAe,GAAG,KAAK,EAC9B,QAAwB,EACxB,KAAmB,EACJ,EAAE;QACjB,KAAK,CAAC,IAAI,CAAC,MAAM,IAAI,CAAC,qBAAqB,CAAC,eAAe,EAAE,CAAC,CAAC;IACjE,CAAC,CAAC;IAEO,eAAe,GAAG,KAAK,EAC9B,OAAsD,EACtD,KAAmB,EACJ,EAAE;QACjB,KAAK,CAAC,IAAI,CACR,IAAI,CAAC,qBAAqB,CAAC,eAAe,CACxC,OAAO,CAAC,MAAM,CAAC,MAAM,EACrB,aAAa,CAAC,OAAO,CAAC,CACvB,CACF,CAAC;IACJ,CAAC,CAAC;CACH;AAED,SAAS,qBAAqB,CAAC,KAAgC;IAC7D,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;QACnB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IAC7B,OAAO,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC;AAC7C,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { BrowserProfile } from "../../types/domain.js";
|
|
2
|
+
import type { OfficeTaskRepository } from "../../storage/repositories/office-task-repository.js";
|
|
3
|
+
import type { CreateOfficeTaskInput, OfficeService } from "../office/office-service.js";
|
|
4
|
+
import type { TaskManager } from "../tasks/task-manager.js";
|
|
5
|
+
import { type TaskSnapshot } from "../tasks/task-types.js";
|
|
6
|
+
import { BrowserProfileService } from "./browser-profile-service.js";
|
|
7
|
+
import type { BrowserTaskExecutor } from "./browser-task-executor.js";
|
|
8
|
+
import { type BrowserExecutionBackend, type BrowserSessionRequirement } from "./browser-task-payload.js";
|
|
9
|
+
import type { BrowserBridgeStatusDto, OpenCliBrowserBridgeService } from "./opencli-browser-bridge-service.js";
|
|
10
|
+
export interface CreateBrowserTaskInput {
|
|
11
|
+
userId: string;
|
|
12
|
+
workspaceId?: string | null;
|
|
13
|
+
title: string;
|
|
14
|
+
profileId?: string | null;
|
|
15
|
+
executionBackend?: BrowserExecutionBackend;
|
|
16
|
+
sessionRequirement?: BrowserSessionRequirement;
|
|
17
|
+
input?: unknown;
|
|
18
|
+
riskLevel?: CreateOfficeTaskInput["riskLevel"];
|
|
19
|
+
}
|
|
20
|
+
export declare class BrowserRuntimeService {
|
|
21
|
+
private readonly browserProfileService;
|
|
22
|
+
private readonly officeService;
|
|
23
|
+
private readonly officeTaskRepository;
|
|
24
|
+
private readonly openCliBrowserBridgeService;
|
|
25
|
+
private readonly taskManager;
|
|
26
|
+
private readonly executorRegistry;
|
|
27
|
+
constructor(browserProfileService: BrowserProfileService, officeService: OfficeService, officeTaskRepository: OfficeTaskRepository, browserExecutors: BrowserTaskExecutor[], openCliBrowserBridgeService: OpenCliBrowserBridgeService, taskManager: TaskManager);
|
|
28
|
+
listProfiles(userId: string, workspaceId?: string | null): BrowserProfile[];
|
|
29
|
+
getProfile(profileId: string, userId: string): BrowserProfile;
|
|
30
|
+
createProfile(input: Parameters<BrowserProfileService["createProfile"]>[0]): BrowserProfile;
|
|
31
|
+
updateProfile(input: Parameters<BrowserProfileService["updateProfile"]>[0]): BrowserProfile;
|
|
32
|
+
deleteProfile(profileId: string, userId: string): {
|
|
33
|
+
profileId: string;
|
|
34
|
+
deleted: true;
|
|
35
|
+
};
|
|
36
|
+
attachCdpProfile(input: Parameters<BrowserProfileService["createProfile"]>[0]): BrowserProfile;
|
|
37
|
+
createBrowserTask(input: CreateBrowserTaskInput): {
|
|
38
|
+
task: import("../../types/domain.js").OfficeTask;
|
|
39
|
+
requiresApproval: boolean;
|
|
40
|
+
};
|
|
41
|
+
private resolveSessionRequirement;
|
|
42
|
+
private assertSessionRequirementCompatible;
|
|
43
|
+
private requirePlaywrightProfile;
|
|
44
|
+
getBridgeStatus(): Promise<BrowserBridgeStatusDto>;
|
|
45
|
+
executeBrowserTask(taskId: string, userId: string): Promise<{
|
|
46
|
+
taskId: string;
|
|
47
|
+
executionTaskId: string;
|
|
48
|
+
deduped: boolean;
|
|
49
|
+
}>;
|
|
50
|
+
getExecutionSnapshot(taskId: string, userId: string): TaskSnapshot | null;
|
|
51
|
+
cancelExecution(taskId: string, userId: string): {
|
|
52
|
+
taskId: string;
|
|
53
|
+
cancelled: boolean;
|
|
54
|
+
};
|
|
55
|
+
private registerBackgroundTask;
|
|
56
|
+
private requireExecutableTask;
|
|
57
|
+
private requirePlaywrightExecutionProfile;
|
|
58
|
+
private requireOwnedBrowserTask;
|
|
59
|
+
}
|
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
import { AppError } from "../../shared/errors/app-error.js";
|
|
2
|
+
import { HOST_TASK_TYPES } from "../tasks/task-types.js";
|
|
3
|
+
import { BrowserTaskExecutorRegistry } from "./browser-task-executor-registry.js";
|
|
4
|
+
import { normalizeBrowserExecutionBackend, normalizeBrowserTaskActions, normalizeBrowserTaskPayloadShape, normalizeOptionalText, parseBrowserTaskPayload } from "./browser-task-payload.js";
|
|
5
|
+
export class BrowserRuntimeService {
|
|
6
|
+
browserProfileService;
|
|
7
|
+
officeService;
|
|
8
|
+
officeTaskRepository;
|
|
9
|
+
openCliBrowserBridgeService;
|
|
10
|
+
taskManager;
|
|
11
|
+
executorRegistry;
|
|
12
|
+
constructor(browserProfileService, officeService, officeTaskRepository, browserExecutors, openCliBrowserBridgeService, taskManager) {
|
|
13
|
+
this.browserProfileService = browserProfileService;
|
|
14
|
+
this.officeService = officeService;
|
|
15
|
+
this.officeTaskRepository = officeTaskRepository;
|
|
16
|
+
this.openCliBrowserBridgeService = openCliBrowserBridgeService;
|
|
17
|
+
this.taskManager = taskManager;
|
|
18
|
+
this.executorRegistry = new BrowserTaskExecutorRegistry(browserExecutors);
|
|
19
|
+
this.registerBackgroundTask();
|
|
20
|
+
}
|
|
21
|
+
listProfiles(userId, workspaceId) {
|
|
22
|
+
return this.browserProfileService.listProfiles(userId, workspaceId);
|
|
23
|
+
}
|
|
24
|
+
getProfile(profileId, userId) {
|
|
25
|
+
return this.browserProfileService.getProfile(profileId, userId);
|
|
26
|
+
}
|
|
27
|
+
createProfile(input) {
|
|
28
|
+
return this.browserProfileService.createProfile(input);
|
|
29
|
+
}
|
|
30
|
+
updateProfile(input) {
|
|
31
|
+
return this.browserProfileService.updateProfile(input);
|
|
32
|
+
}
|
|
33
|
+
deleteProfile(profileId, userId) {
|
|
34
|
+
const tasks = this.officeTaskRepository.list({
|
|
35
|
+
userId,
|
|
36
|
+
taskType: "browser"
|
|
37
|
+
}).filter((task) => task.targetRefId === profileId);
|
|
38
|
+
const blockingTask = tasks.find((task) => task.status === "running"
|
|
39
|
+
|| task.status === "paused"
|
|
40
|
+
|| task.status === "waiting_external");
|
|
41
|
+
if (blockingTask) {
|
|
42
|
+
throw new AppError({
|
|
43
|
+
statusCode: 409,
|
|
44
|
+
errorCode: "BROWSER_PROFILE_TASK_IN_USE",
|
|
45
|
+
detail: "当前浏览器 Profile 仍有关联任务正在执行或等待外部完成,暂时不能删除"
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
for (const task of tasks) {
|
|
49
|
+
if (task.status === "draft" || task.status === "pending_approval" || task.status === "ready") {
|
|
50
|
+
this.officeService.cancelTask(task.id, userId);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
this.browserProfileService.deleteProfile(profileId, userId);
|
|
54
|
+
return {
|
|
55
|
+
profileId,
|
|
56
|
+
deleted: true
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
attachCdpProfile(input) {
|
|
60
|
+
return this.browserProfileService.createProfile({
|
|
61
|
+
...input,
|
|
62
|
+
mode: "cdp_attached"
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
createBrowserTask(input) {
|
|
66
|
+
const payload = normalizeBrowserTaskPayloadShape(input.input);
|
|
67
|
+
const sessionRequirement = this.resolveSessionRequirement(input, payload);
|
|
68
|
+
const executionBackend = normalizeBrowserExecutionBackend(input.executionBackend ?? payload.executionBackend);
|
|
69
|
+
this.assertSessionRequirementCompatible(sessionRequirement, executionBackend);
|
|
70
|
+
const taskInput = {
|
|
71
|
+
...payload,
|
|
72
|
+
sessionRequirement,
|
|
73
|
+
executionBackend,
|
|
74
|
+
startUrl: normalizeOptionalText(payload.startUrl),
|
|
75
|
+
actions: normalizeBrowserTaskActions(input.input)
|
|
76
|
+
};
|
|
77
|
+
if (executionBackend === "opencli_bridge") {
|
|
78
|
+
return this.officeService.createTask({
|
|
79
|
+
userId: input.userId,
|
|
80
|
+
workspaceId: input.workspaceId ?? null,
|
|
81
|
+
taskType: "browser",
|
|
82
|
+
title: input.title,
|
|
83
|
+
connectorId: "browser.opencli_bridge",
|
|
84
|
+
targetRefKind: "browser_bridge",
|
|
85
|
+
targetRefId: null,
|
|
86
|
+
input: taskInput,
|
|
87
|
+
riskLevel: input.riskLevel ?? "low"
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
const profile = this.requirePlaywrightProfile(input.userId, input.profileId ?? null);
|
|
91
|
+
return this.officeService.createTask({
|
|
92
|
+
userId: input.userId,
|
|
93
|
+
workspaceId: input.workspaceId ?? profile.workspaceId,
|
|
94
|
+
taskType: "browser",
|
|
95
|
+
title: input.title,
|
|
96
|
+
connectorId: "browser.playwright",
|
|
97
|
+
targetRefKind: "browser_profile",
|
|
98
|
+
targetRefId: profile.id,
|
|
99
|
+
input: {
|
|
100
|
+
profileId: profile.id,
|
|
101
|
+
engine: profile.engine,
|
|
102
|
+
mode: profile.mode,
|
|
103
|
+
...taskInput
|
|
104
|
+
},
|
|
105
|
+
riskLevel: input.riskLevel ?? "low"
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
resolveSessionRequirement(input, payload) {
|
|
109
|
+
if (input.sessionRequirement === "reuse_current_logged_in_browser") {
|
|
110
|
+
return "reuse_current_logged_in_browser";
|
|
111
|
+
}
|
|
112
|
+
if (payload.sessionRequirement === "reuse_current_logged_in_browser") {
|
|
113
|
+
return "reuse_current_logged_in_browser";
|
|
114
|
+
}
|
|
115
|
+
const combinedText = [
|
|
116
|
+
input.title,
|
|
117
|
+
normalizeOptionalText(payload.startUrl) ?? "",
|
|
118
|
+
...normalizeBrowserTaskActions(input.input).flatMap((action) => [
|
|
119
|
+
normalizeOptionalText(action.url) ?? "",
|
|
120
|
+
normalizeOptionalText(action.selector) ?? "",
|
|
121
|
+
normalizeOptionalText(action.value) ?? "",
|
|
122
|
+
normalizeOptionalText(action.key) ?? ""
|
|
123
|
+
])
|
|
124
|
+
]
|
|
125
|
+
.join("\n")
|
|
126
|
+
.toLowerCase();
|
|
127
|
+
if (/(淘宝|京东|订单|购物车|待收货|待付款|个人账户|登录态|已登录|验证码|后台|管理后台|商家后台|edge|chrome)/i.test(combinedText)) {
|
|
128
|
+
return "reuse_current_logged_in_browser";
|
|
129
|
+
}
|
|
130
|
+
return "none";
|
|
131
|
+
}
|
|
132
|
+
assertSessionRequirementCompatible(sessionRequirement, executionBackend) {
|
|
133
|
+
if (sessionRequirement !== "reuse_current_logged_in_browser") {
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
if (executionBackend === "opencli_bridge") {
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
throw new AppError({
|
|
140
|
+
statusCode: 409,
|
|
141
|
+
errorCode: "BROWSER_SESSION_REQUIREMENT_CONFLICT",
|
|
142
|
+
detail: "当前任务要求复用已登录浏览器会话,必须使用 opencli_bridge,不能降级到 playwright"
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
requirePlaywrightProfile(userId, requestedProfileId) {
|
|
146
|
+
const profileId = requestedProfileId?.trim() ?? "";
|
|
147
|
+
if (profileId.length === 0) {
|
|
148
|
+
throw new AppError({
|
|
149
|
+
statusCode: 400,
|
|
150
|
+
errorCode: "BROWSER_PROFILE_REQUIRED",
|
|
151
|
+
detail: "playwright 浏览器任务必须提供 profileId"
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
const profile = this.browserProfileService.getProfile(profileId, userId);
|
|
155
|
+
if (profile.status !== "active") {
|
|
156
|
+
throw new AppError({
|
|
157
|
+
statusCode: 409,
|
|
158
|
+
errorCode: "BROWSER_PROFILE_NOT_ACTIVE",
|
|
159
|
+
detail: "当前浏览器 Profile 不可用"
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
return profile;
|
|
163
|
+
}
|
|
164
|
+
async getBridgeStatus() {
|
|
165
|
+
return await this.openCliBrowserBridgeService.getStatus();
|
|
166
|
+
}
|
|
167
|
+
async executeBrowserTask(taskId, userId) {
|
|
168
|
+
const task = this.requireExecutableTask(taskId, userId);
|
|
169
|
+
const handle = this.taskManager.enqueue(HOST_TASK_TYPES.officeBrowserTaskExecute, {
|
|
170
|
+
key: task.id,
|
|
171
|
+
source: "office.browser_task.execute",
|
|
172
|
+
input: {
|
|
173
|
+
taskId: task.id,
|
|
174
|
+
userId
|
|
175
|
+
}
|
|
176
|
+
});
|
|
177
|
+
void handle.promise.catch(() => undefined);
|
|
178
|
+
return {
|
|
179
|
+
taskId: task.id,
|
|
180
|
+
executionTaskId: handle.taskId,
|
|
181
|
+
deduped: handle.deduped
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
getExecutionSnapshot(taskId, userId) {
|
|
185
|
+
this.requireOwnedBrowserTask(taskId, userId);
|
|
186
|
+
return this.taskManager.peek(HOST_TASK_TYPES.officeBrowserTaskExecute, taskId.trim());
|
|
187
|
+
}
|
|
188
|
+
cancelExecution(taskId, userId) {
|
|
189
|
+
const task = this.requireOwnedBrowserTask(taskId, userId);
|
|
190
|
+
this.taskManager.cancel(HOST_TASK_TYPES.officeBrowserTaskExecute, task.id, "office_browser_task_cancelled");
|
|
191
|
+
return {
|
|
192
|
+
taskId: task.id,
|
|
193
|
+
cancelled: true
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
registerBackgroundTask() {
|
|
197
|
+
if (this.taskManager.has(HOST_TASK_TYPES.officeBrowserTaskExecute)) {
|
|
198
|
+
return;
|
|
199
|
+
}
|
|
200
|
+
this.taskManager.register({
|
|
201
|
+
taskType: HOST_TASK_TYPES.officeBrowserTaskExecute,
|
|
202
|
+
executionLane: "host_background",
|
|
203
|
+
timeoutMs: 180_000,
|
|
204
|
+
concurrency: 1,
|
|
205
|
+
run: async (input, context) => {
|
|
206
|
+
const task = this.requireExecutableTask(input.taskId, input.userId);
|
|
207
|
+
const payload = parseBrowserTaskPayload(task.inputJson);
|
|
208
|
+
const executionBackend = normalizeBrowserExecutionBackend(payload.executionBackend);
|
|
209
|
+
const executor = this.executorRegistry.get(executionBackend);
|
|
210
|
+
const profile = executionBackend === "playwright"
|
|
211
|
+
? this.requirePlaywrightExecutionProfile(task, input.userId)
|
|
212
|
+
: undefined;
|
|
213
|
+
return await executor.execute({
|
|
214
|
+
task,
|
|
215
|
+
profile,
|
|
216
|
+
runContext: context
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
requireExecutableTask(taskId, userId) {
|
|
222
|
+
const task = this.requireOwnedBrowserTask(taskId, userId);
|
|
223
|
+
if (task.status !== "ready" && task.status !== "failed") {
|
|
224
|
+
throw new AppError({
|
|
225
|
+
statusCode: 409,
|
|
226
|
+
errorCode: "BROWSER_TASK_EXECUTION_NOT_ALLOWED",
|
|
227
|
+
detail: "当前任务状态不允许执行"
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
return task;
|
|
231
|
+
}
|
|
232
|
+
requirePlaywrightExecutionProfile(task, userId) {
|
|
233
|
+
const profile = this.browserProfileService.getProfile(task.targetRefId ?? "", userId);
|
|
234
|
+
if (profile.status !== "active") {
|
|
235
|
+
throw new AppError({
|
|
236
|
+
statusCode: 409,
|
|
237
|
+
errorCode: "BROWSER_PROFILE_NOT_ACTIVE",
|
|
238
|
+
detail: "当前浏览器 Profile 不可用"
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
return profile;
|
|
242
|
+
}
|
|
243
|
+
requireOwnedBrowserTask(taskId, userId) {
|
|
244
|
+
const task = this.officeTaskRepository.findById(taskId.trim());
|
|
245
|
+
if (!task || task.userId !== userId || task.taskType !== "browser") {
|
|
246
|
+
throw new AppError({
|
|
247
|
+
statusCode: 404,
|
|
248
|
+
errorCode: "BROWSER_TASK_NOT_FOUND",
|
|
249
|
+
detail: "未找到对应浏览器任务"
|
|
250
|
+
});
|
|
251
|
+
}
|
|
252
|
+
return task;
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
//# sourceMappingURL=browser-runtime-service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser-runtime-service.js","sourceRoot":"","sources":["../../../../src/modules/browser-runtime/browser-runtime-service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AAK5D,OAAO,EAAE,eAAe,EAAqB,MAAM,wBAAwB,CAAC;AAG5E,OAAO,EAAE,2BAA2B,EAAE,MAAM,qCAAqC,CAAC;AAClF,OAAO,EACL,gCAAgC,EAChC,2BAA2B,EAC3B,gCAAgC,EAChC,qBAAqB,EACrB,uBAAuB,EAGxB,MAAM,2BAA2B,CAAC;AAcnC,MAAM,OAAO,qBAAqB;IAIb;IACA;IACA;IAEA;IACA;IARF,gBAAgB,CAA8B;IAE/D,YACmB,qBAA4C,EAC5C,aAA4B,EAC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C,IAAI,IAAI,IAAI,CAAC,MAAM,KAAK,MAAM,IAAI,IAAI,CAAC,QAAQ,KAAK,SAAS,EAAE,CAAC;YACnE,MAAM,IAAI,QAAQ,CAAC;gBACjB,UAAU,EAAE,GAAG;gBACf,SAAS,EAAE,wBAAwB;gBACnC,MAAM,EAAE,YAAY;aACrB,CAAC,CAAC;QACL,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;CACF"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type { OfficeArtifactRepository } from "../../storage/repositories/office-artifact-repository.js";
|
|
2
|
+
import type { OfficeAuditEventRepository } from "../../storage/repositories/office-audit-event-repository.js";
|
|
3
|
+
import type { OfficeReceiptRepository } from "../../storage/repositories/office-receipt-repository.js";
|
|
4
|
+
import type { OfficeTaskRepository } from "../../storage/repositories/office-task-repository.js";
|
|
5
|
+
import type { OfficeTaskStepRepository } from "../../storage/repositories/office-task-step-repository.js";
|
|
6
|
+
import type { BrowserProfile, OfficeArtifact, OfficeReceipt, OfficeTask, OfficeTaskStep } from "../../types/domain.js";
|
|
7
|
+
import { type TaskRunContext } from "../tasks/task-types.js";
|
|
8
|
+
import type { BrowserStepResult, BrowserTaskArtifactInput, BrowserTaskExecutionReceiptPayload, BrowserTaskStepLifecyclePort } from "./browser-task-executor.js";
|
|
9
|
+
import type { BrowserExecutionBackend, BrowserTaskAction, BrowserTaskPayload } from "./browser-task-payload.js";
|
|
10
|
+
export interface BrowserTaskExecutionPersistenceDeps {
|
|
11
|
+
databasePath: string;
|
|
12
|
+
officeTaskRepository: OfficeTaskRepository;
|
|
13
|
+
officeTaskStepRepository: OfficeTaskStepRepository;
|
|
14
|
+
officeArtifactRepository: OfficeArtifactRepository;
|
|
15
|
+
officeReceiptRepository: OfficeReceiptRepository;
|
|
16
|
+
officeAuditEventRepository: OfficeAuditEventRepository;
|
|
17
|
+
}
|
|
18
|
+
export declare class BrowserTaskExecutionPersistence implements BrowserTaskStepLifecyclePort {
|
|
19
|
+
private readonly backend;
|
|
20
|
+
private readonly deps;
|
|
21
|
+
private readonly artifactRoot;
|
|
22
|
+
constructor(backend: BrowserExecutionBackend, deps: BrowserTaskExecutionPersistenceDeps);
|
|
23
|
+
markTaskRunning(task: OfficeTask): OfficeTask;
|
|
24
|
+
markTaskSucceeded(task: OfficeTask, payload: BrowserTaskExecutionReceiptPayload): {
|
|
25
|
+
task: OfficeTask;
|
|
26
|
+
receipt: OfficeReceipt;
|
|
27
|
+
};
|
|
28
|
+
markTaskFailed(task: OfficeTask, reason: string): OfficeTask;
|
|
29
|
+
createStep(task: OfficeTask, stepSeq: number, action: BrowserTaskAction): OfficeTaskStep;
|
|
30
|
+
startStep(step: OfficeTaskStep): OfficeTaskStep;
|
|
31
|
+
finishStep(step: OfficeTaskStep, outputJson: string): OfficeTaskStep;
|
|
32
|
+
failStep(step: OfficeTaskStep, errorMessage: string): OfficeTaskStep;
|
|
33
|
+
createTextArtifact(task: OfficeTask, step: OfficeTaskStep, input: BrowserTaskArtifactInput & {
|
|
34
|
+
content: string;
|
|
35
|
+
}): OfficeArtifact;
|
|
36
|
+
createBinaryArtifact(task: OfficeTask, step: OfficeTaskStep, input: BrowserTaskArtifactInput & {
|
|
37
|
+
content: Buffer;
|
|
38
|
+
}): OfficeArtifact;
|
|
39
|
+
createFileArtifact(task: OfficeTask, step: OfficeTaskStep, input: BrowserTaskArtifactInput & {
|
|
40
|
+
sourceFilePath: string;
|
|
41
|
+
metadata?: Record<string, unknown>;
|
|
42
|
+
}): OfficeArtifact;
|
|
43
|
+
private recordArtifactAudit;
|
|
44
|
+
private ensureArtifactDir;
|
|
45
|
+
}
|
|
46
|
+
export declare function runBrowserTaskActions(input: {
|
|
47
|
+
task: OfficeTask;
|
|
48
|
+
payload: BrowserTaskPayload;
|
|
49
|
+
backend: BrowserExecutionBackend;
|
|
50
|
+
runContext?: TaskRunContext;
|
|
51
|
+
lifecycle: BrowserTaskStepLifecyclePort;
|
|
52
|
+
executeAction: (action: BrowserTaskAction, step: OfficeTaskStep, runContext?: TaskRunContext) => Promise<BrowserStepResult>;
|
|
53
|
+
getFinalUrl: () => string | null | Promise<string | null>;
|
|
54
|
+
}): Promise<{
|
|
55
|
+
task: OfficeTask;
|
|
56
|
+
receipt: OfficeReceipt;
|
|
57
|
+
stepResults: BrowserStepResult[];
|
|
58
|
+
}>;
|
|
59
|
+
export declare function ensureBrowserExecutablePath(databasePath: string, configPath: string, engine: BrowserProfile["engine"]): string;
|
|
60
|
+
export declare function requireString(value: string | undefined, field: string): string;
|
|
61
|
+
export declare function normalizeStringArray(values: string[] | undefined, singleValue: string | undefined, field: string): string[];
|
|
62
|
+
export declare function normalizeFilePaths(filePaths: string[] | undefined, singleFilePath: string | undefined): string[];
|
|
63
|
+
export declare function normalizeFileName(fileName: string | undefined, fallback: string): string;
|
|
64
|
+
export declare function buildStepTitle(action: BrowserTaskAction): string;
|
|
65
|
+
export declare function ensureNotCancelled(runContext?: TaskRunContext): void;
|