@bf-meishijian/aip 0.0.43 → 0.0.44
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 +3 -3
- package/dist/coding-run-manager.d.ts +1 -0
- package/dist/coding-run-manager.d.ts.map +1 -1
- package/dist/coding-run-manager.js +60 -4
- package/dist/coding-run-manager.js.map +1 -1
- package/dist/daemon.d.ts.map +1 -1
- package/dist/daemon.js +48 -5
- package/dist/daemon.js.map +1 -1
- package/dist/diagnostics.d.ts.map +1 -1
- package/dist/general-run-client.d.ts.map +1 -1
- package/dist/host-status.d.ts.map +1 -1
- package/dist/host-update.d.ts.map +1 -1
- package/dist/host-update.js +21 -82
- package/dist/host-update.js.map +1 -1
- package/dist/host-updater.d.ts +4 -0
- package/dist/host-updater.d.ts.map +1 -0
- package/dist/host-updater.js +246 -0
- package/dist/host-updater.js.map +1 -0
- package/dist/installer.d.ts.map +1 -1
- package/dist/installer.js +10 -2
- package/dist/installer.js.map +1 -1
- package/dist/pi-model-service.d.ts.map +1 -1
- package/dist/platform-client.d.ts +22 -0
- package/dist/platform-client.d.ts.map +1 -1
- package/dist/platform-client.js +9 -0
- package/dist/platform-client.js.map +1 -1
- package/dist/runtime-download.d.ts +11 -0
- package/dist/runtime-download.d.ts.map +1 -0
- package/dist/runtime-download.js +136 -0
- package/dist/runtime-download.js.map +1 -0
- package/dist/runtime-update-control.d.ts +14 -0
- package/dist/runtime-update-control.d.ts.map +1 -0
- package/dist/runtime-update-control.js +111 -0
- package/dist/runtime-update-control.js.map +1 -0
- package/dist/runtime-update-state.d.ts +24 -0
- package/dist/runtime-update-state.d.ts.map +1 -0
- package/dist/runtime-update-state.js +38 -0
- package/dist/runtime-update-state.js.map +1 -0
- package/dist/update-service.d.ts +19 -0
- package/dist/update-service.d.ts.map +1 -0
- package/dist/update-service.js +119 -0
- package/dist/update-service.js.map +1 -0
- package/dist/workflow-guidance.js +1 -1
- package/dist/workspace-diff.d.ts.map +1 -1
- package/dist/workspace-diff.js +7 -1
- package/dist/workspace-diff.js.map +1 -1
- package/package.json +4 -4
- package/dist/apps/local-coding-host/src/bash-discovery.d.ts +0 -8
- package/dist/apps/local-coding-host/src/bash-discovery.d.ts.map +0 -1
- package/dist/apps/local-coding-host/src/bash-discovery.js +0 -66
- package/dist/apps/local-coding-host/src/bash-discovery.js.map +0 -1
- package/dist/apps/local-coding-host/src/cli.d.ts +0 -4
- package/dist/apps/local-coding-host/src/cli.d.ts.map +0 -1
- package/dist/apps/local-coding-host/src/cli.js +0 -388
- package/dist/apps/local-coding-host/src/cli.js.map +0 -1
- package/dist/apps/local-coding-host/src/coding-run-manager.d.ts +0 -174
- package/dist/apps/local-coding-host/src/coding-run-manager.d.ts.map +0 -1
- package/dist/apps/local-coding-host/src/coding-run-manager.js +0 -1587
- package/dist/apps/local-coding-host/src/coding-run-manager.js.map +0 -1
- package/dist/apps/local-coding-host/src/coding-subagent-child.d.ts +0 -22
- package/dist/apps/local-coding-host/src/coding-subagent-child.d.ts.map +0 -1
- package/dist/apps/local-coding-host/src/coding-subagent-child.js +0 -96
- package/dist/apps/local-coding-host/src/coding-subagent-child.js.map +0 -1
- package/dist/apps/local-coding-host/src/coding-subagents.d.ts +0 -65
- package/dist/apps/local-coding-host/src/coding-subagents.d.ts.map +0 -1
- package/dist/apps/local-coding-host/src/coding-subagents.js +0 -521
- package/dist/apps/local-coding-host/src/coding-subagents.js.map +0 -1
- package/dist/apps/local-coding-host/src/command-executor.d.ts +0 -9
- package/dist/apps/local-coding-host/src/command-executor.d.ts.map +0 -1
- package/dist/apps/local-coding-host/src/command-executor.js +0 -222
- package/dist/apps/local-coding-host/src/command-executor.js.map +0 -1
- package/dist/apps/local-coding-host/src/command-wakeup.d.ts +0 -19
- package/dist/apps/local-coding-host/src/command-wakeup.d.ts.map +0 -1
- package/dist/apps/local-coding-host/src/command-wakeup.js +0 -109
- package/dist/apps/local-coding-host/src/command-wakeup.js.map +0 -1
- package/dist/apps/local-coding-host/src/daemon.d.ts +0 -8
- package/dist/apps/local-coding-host/src/daemon.d.ts.map +0 -1
- package/dist/apps/local-coding-host/src/daemon.js +0 -314
- package/dist/apps/local-coding-host/src/daemon.js.map +0 -1
- package/dist/apps/local-coding-host/src/delivery-files.d.ts +0 -39
- package/dist/apps/local-coding-host/src/delivery-files.d.ts.map +0 -1
- package/dist/apps/local-coding-host/src/delivery-files.js +0 -237
- package/dist/apps/local-coding-host/src/delivery-files.js.map +0 -1
- package/dist/apps/local-coding-host/src/delivery-tools.d.ts +0 -30
- package/dist/apps/local-coding-host/src/delivery-tools.d.ts.map +0 -1
- package/dist/apps/local-coding-host/src/delivery-tools.js +0 -196
- package/dist/apps/local-coding-host/src/delivery-tools.js.map +0 -1
- package/dist/apps/local-coding-host/src/diagnostic-log.d.ts +0 -20
- package/dist/apps/local-coding-host/src/diagnostic-log.d.ts.map +0 -1
- package/dist/apps/local-coding-host/src/diagnostic-log.js +0 -61
- package/dist/apps/local-coding-host/src/diagnostic-log.js.map +0 -1
- package/dist/apps/local-coding-host/src/diagnostics.d.ts +0 -38
- package/dist/apps/local-coding-host/src/diagnostics.d.ts.map +0 -1
- package/dist/apps/local-coding-host/src/diagnostics.js +0 -217
- package/dist/apps/local-coding-host/src/diagnostics.js.map +0 -1
- package/dist/apps/local-coding-host/src/execution-process-observer.d.ts +0 -19
- package/dist/apps/local-coding-host/src/execution-process-observer.d.ts.map +0 -1
- package/dist/apps/local-coding-host/src/execution-process-observer.js +0 -35
- package/dist/apps/local-coding-host/src/execution-process-observer.js.map +0 -1
- package/dist/apps/local-coding-host/src/execution-process-tree.d.ts +0 -32
- package/dist/apps/local-coding-host/src/execution-process-tree.d.ts.map +0 -1
- package/dist/apps/local-coding-host/src/execution-process-tree.js +0 -288
- package/dist/apps/local-coding-host/src/execution-process-tree.js.map +0 -1
- package/dist/apps/local-coding-host/src/execution-process.d.ts +0 -59
- package/dist/apps/local-coding-host/src/execution-process.d.ts.map +0 -1
- package/dist/apps/local-coding-host/src/execution-process.js +0 -112
- package/dist/apps/local-coding-host/src/execution-process.js.map +0 -1
- package/dist/apps/local-coding-host/src/execution-receipts.d.ts +0 -12
- package/dist/apps/local-coding-host/src/execution-receipts.d.ts.map +0 -1
- package/dist/apps/local-coding-host/src/execution-receipts.js +0 -89
- package/dist/apps/local-coding-host/src/execution-receipts.js.map +0 -1
- package/dist/apps/local-coding-host/src/execution-supervisor.d.ts +0 -25
- package/dist/apps/local-coding-host/src/execution-supervisor.d.ts.map +0 -1
- package/dist/apps/local-coding-host/src/execution-supervisor.js +0 -482
- package/dist/apps/local-coding-host/src/execution-supervisor.js.map +0 -1
- package/dist/apps/local-coding-host/src/execution-worker.d.ts +0 -42
- package/dist/apps/local-coding-host/src/execution-worker.d.ts.map +0 -1
- package/dist/apps/local-coding-host/src/execution-worker.js +0 -165
- package/dist/apps/local-coding-host/src/execution-worker.js.map +0 -1
- package/dist/apps/local-coding-host/src/general-run-client.d.ts +0 -111
- package/dist/apps/local-coding-host/src/general-run-client.d.ts.map +0 -1
- package/dist/apps/local-coding-host/src/general-run-client.js +0 -41
- package/dist/apps/local-coding-host/src/general-run-client.js.map +0 -1
- package/dist/apps/local-coding-host/src/general-run-manager.d.ts +0 -33
- package/dist/apps/local-coding-host/src/general-run-manager.d.ts.map +0 -1
- package/dist/apps/local-coding-host/src/general-run-manager.js +0 -363
- package/dist/apps/local-coding-host/src/general-run-manager.js.map +0 -1
- package/dist/apps/local-coding-host/src/general-run-supervisor.d.ts +0 -12
- package/dist/apps/local-coding-host/src/general-run-supervisor.d.ts.map +0 -1
- package/dist/apps/local-coding-host/src/general-run-supervisor.js +0 -160
- package/dist/apps/local-coding-host/src/general-run-supervisor.js.map +0 -1
- package/dist/apps/local-coding-host/src/general-run-tools.d.ts +0 -25
- package/dist/apps/local-coding-host/src/general-run-tools.d.ts.map +0 -1
- package/dist/apps/local-coding-host/src/general-run-tools.js +0 -123
- package/dist/apps/local-coding-host/src/general-run-tools.js.map +0 -1
- package/dist/apps/local-coding-host/src/git-credential-environment.d.ts +0 -3
- package/dist/apps/local-coding-host/src/git-credential-environment.d.ts.map +0 -1
- package/dist/apps/local-coding-host/src/git-credential-environment.js +0 -46
- package/dist/apps/local-coding-host/src/git-credential-environment.js.map +0 -1
- package/dist/apps/local-coding-host/src/git-credential-helper.d.ts +0 -2
- package/dist/apps/local-coding-host/src/git-credential-helper.d.ts.map +0 -1
- package/dist/apps/local-coding-host/src/git-credential-helper.js +0 -38
- package/dist/apps/local-coding-host/src/git-credential-helper.js.map +0 -1
- package/dist/apps/local-coding-host/src/git-http-migration.d.ts +0 -24
- package/dist/apps/local-coding-host/src/git-http-migration.d.ts.map +0 -1
- package/dist/apps/local-coding-host/src/git-http-migration.js +0 -197
- package/dist/apps/local-coding-host/src/git-http-migration.js.map +0 -1
- package/dist/apps/local-coding-host/src/git-process.d.ts +0 -25
- package/dist/apps/local-coding-host/src/git-process.d.ts.map +0 -1
- package/dist/apps/local-coding-host/src/git-process.js +0 -85
- package/dist/apps/local-coding-host/src/git-process.js.map +0 -1
- package/dist/apps/local-coding-host/src/git-transport.d.ts +0 -6
- package/dist/apps/local-coding-host/src/git-transport.d.ts.map +0 -1
- package/dist/apps/local-coding-host/src/git-transport.js +0 -57
- package/dist/apps/local-coding-host/src/git-transport.js.map +0 -1
- package/dist/apps/local-coding-host/src/gitlab-cli.d.ts +0 -2
- package/dist/apps/local-coding-host/src/gitlab-cli.d.ts.map +0 -1
- package/dist/apps/local-coding-host/src/gitlab-cli.js +0 -39
- package/dist/apps/local-coding-host/src/gitlab-cli.js.map +0 -1
- package/dist/apps/local-coding-host/src/gitlab-credentials.d.ts +0 -18
- package/dist/apps/local-coding-host/src/gitlab-credentials.d.ts.map +0 -1
- package/dist/apps/local-coding-host/src/gitlab-credentials.js +0 -137
- package/dist/apps/local-coding-host/src/gitlab-credentials.js.map +0 -1
- package/dist/apps/local-coding-host/src/handoff-cli.d.ts +0 -2
- package/dist/apps/local-coding-host/src/handoff-cli.d.ts.map +0 -1
- package/dist/apps/local-coding-host/src/handoff-cli.js +0 -86
- package/dist/apps/local-coding-host/src/handoff-cli.js.map +0 -1
- package/dist/apps/local-coding-host/src/harness.d.ts +0 -2
- package/dist/apps/local-coding-host/src/harness.d.ts.map +0 -1
- package/dist/apps/local-coding-host/src/harness.js +0 -2
- package/dist/apps/local-coding-host/src/harness.js.map +0 -1
- package/dist/apps/local-coding-host/src/host-log.d.ts +0 -13
- package/dist/apps/local-coding-host/src/host-log.d.ts.map +0 -1
- package/dist/apps/local-coding-host/src/host-log.js +0 -43
- package/dist/apps/local-coding-host/src/host-log.js.map +0 -1
- package/dist/apps/local-coding-host/src/host-shell.d.ts +0 -2
- package/dist/apps/local-coding-host/src/host-shell.d.ts.map +0 -1
- package/dist/apps/local-coding-host/src/host-shell.js +0 -2
- package/dist/apps/local-coding-host/src/host-shell.js.map +0 -1
- package/dist/apps/local-coding-host/src/host-status.d.ts +0 -57
- package/dist/apps/local-coding-host/src/host-status.d.ts.map +0 -1
- package/dist/apps/local-coding-host/src/host-status.js +0 -144
- package/dist/apps/local-coding-host/src/host-status.js.map +0 -1
- package/dist/apps/local-coding-host/src/host-tools.d.ts +0 -15
- package/dist/apps/local-coding-host/src/host-tools.d.ts.map +0 -1
- package/dist/apps/local-coding-host/src/host-tools.js +0 -178
- package/dist/apps/local-coding-host/src/host-tools.js.map +0 -1
- package/dist/apps/local-coding-host/src/host-update.d.ts +0 -3
- package/dist/apps/local-coding-host/src/host-update.d.ts.map +0 -1
- package/dist/apps/local-coding-host/src/host-update.js +0 -95
- package/dist/apps/local-coding-host/src/host-update.js.map +0 -1
- package/dist/apps/local-coding-host/src/installer.d.ts +0 -28
- package/dist/apps/local-coding-host/src/installer.d.ts.map +0 -1
- package/dist/apps/local-coding-host/src/installer.js +0 -346
- package/dist/apps/local-coding-host/src/installer.js.map +0 -1
- package/dist/apps/local-coding-host/src/linux-service.d.ts +0 -14
- package/dist/apps/local-coding-host/src/linux-service.d.ts.map +0 -1
- package/dist/apps/local-coding-host/src/linux-service.js +0 -63
- package/dist/apps/local-coding-host/src/linux-service.js.map +0 -1
- package/dist/apps/local-coding-host/src/live-employee.d.ts +0 -17
- package/dist/apps/local-coding-host/src/live-employee.d.ts.map +0 -1
- package/dist/apps/local-coding-host/src/live-employee.js +0 -74
- package/dist/apps/local-coding-host/src/live-employee.js.map +0 -1
- package/dist/apps/local-coding-host/src/local-employee-runtime.d.ts +0 -30
- package/dist/apps/local-coding-host/src/local-employee-runtime.d.ts.map +0 -1
- package/dist/apps/local-coding-host/src/local-employee-runtime.js +0 -521
- package/dist/apps/local-coding-host/src/local-employee-runtime.js.map +0 -1
- package/dist/apps/local-coding-host/src/local-handoff-workspace.d.ts +0 -27
- package/dist/apps/local-coding-host/src/local-handoff-workspace.d.ts.map +0 -1
- package/dist/apps/local-coding-host/src/local-handoff-workspace.js +0 -71
- package/dist/apps/local-coding-host/src/local-handoff-workspace.js.map +0 -1
- package/dist/apps/local-coding-host/src/local-mcp.d.ts +0 -246
- package/dist/apps/local-coding-host/src/local-mcp.d.ts.map +0 -1
- package/dist/apps/local-coding-host/src/local-mcp.js +0 -173
- package/dist/apps/local-coding-host/src/local-mcp.js.map +0 -1
- package/dist/apps/local-coding-host/src/local-model-usage.d.ts +0 -6
- package/dist/apps/local-coding-host/src/local-model-usage.d.ts.map +0 -1
- package/dist/apps/local-coding-host/src/local-model-usage.js +0 -40
- package/dist/apps/local-coding-host/src/local-model-usage.js.map +0 -1
- package/dist/apps/local-coding-host/src/login-url.d.ts +0 -3
- package/dist/apps/local-coding-host/src/login-url.d.ts.map +0 -1
- package/dist/apps/local-coding-host/src/login-url.js +0 -30
- package/dist/apps/local-coding-host/src/login-url.js.map +0 -1
- package/dist/apps/local-coding-host/src/managed-process.d.ts +0 -21
- package/dist/apps/local-coding-host/src/managed-process.d.ts.map +0 -1
- package/dist/apps/local-coding-host/src/managed-process.js +0 -119
- package/dist/apps/local-coding-host/src/managed-process.js.map +0 -1
- package/dist/apps/local-coding-host/src/merge-requests.d.ts +0 -54
- package/dist/apps/local-coding-host/src/merge-requests.d.ts.map +0 -1
- package/dist/apps/local-coding-host/src/merge-requests.js +0 -230
- package/dist/apps/local-coding-host/src/merge-requests.js.map +0 -1
- package/dist/apps/local-coding-host/src/model-stores.d.ts +0 -20
- package/dist/apps/local-coding-host/src/model-stores.d.ts.map +0 -1
- package/dist/apps/local-coding-host/src/model-stores.js +0 -77
- package/dist/apps/local-coding-host/src/model-stores.js.map +0 -1
- package/dist/apps/local-coding-host/src/open-browser.d.ts +0 -2
- package/dist/apps/local-coding-host/src/open-browser.d.ts.map +0 -1
- package/dist/apps/local-coding-host/src/open-browser.js +0 -20
- package/dist/apps/local-coding-host/src/open-browser.js.map +0 -1
- package/dist/apps/local-coding-host/src/operation-context.d.ts +0 -31
- package/dist/apps/local-coding-host/src/operation-context.d.ts.map +0 -1
- package/dist/apps/local-coding-host/src/operation-context.js +0 -166
- package/dist/apps/local-coding-host/src/operation-context.js.map +0 -1
- package/dist/apps/local-coding-host/src/outcome-cli.d.ts +0 -3
- package/dist/apps/local-coding-host/src/outcome-cli.d.ts.map +0 -1
- package/dist/apps/local-coding-host/src/outcome-cli.js +0 -91
- package/dist/apps/local-coding-host/src/outcome-cli.js.map +0 -1
- package/dist/apps/local-coding-host/src/paths.d.ts +0 -30
- package/dist/apps/local-coding-host/src/paths.d.ts.map +0 -1
- package/dist/apps/local-coding-host/src/paths.js +0 -52
- package/dist/apps/local-coding-host/src/paths.js.map +0 -1
- package/dist/apps/local-coding-host/src/pi-message-queue.d.ts +0 -20
- package/dist/apps/local-coding-host/src/pi-message-queue.d.ts.map +0 -1
- package/dist/apps/local-coding-host/src/pi-message-queue.js +0 -78
- package/dist/apps/local-coding-host/src/pi-message-queue.js.map +0 -1
- package/dist/apps/local-coding-host/src/pi-model-service.d.ts +0 -91
- package/dist/apps/local-coding-host/src/pi-model-service.d.ts.map +0 -1
- package/dist/apps/local-coding-host/src/pi-model-service.js +0 -372
- package/dist/apps/local-coding-host/src/pi-model-service.js.map +0 -1
- package/dist/apps/local-coding-host/src/platform-client.d.ts +0 -398
- package/dist/apps/local-coding-host/src/platform-client.d.ts.map +0 -1
- package/dist/apps/local-coding-host/src/platform-client.js +0 -255
- package/dist/apps/local-coding-host/src/platform-client.js.map +0 -1
- package/dist/apps/local-coding-host/src/platform-gitlab-credential.d.ts +0 -8
- package/dist/apps/local-coding-host/src/platform-gitlab-credential.d.ts.map +0 -1
- package/dist/apps/local-coding-host/src/platform-gitlab-credential.js +0 -31
- package/dist/apps/local-coding-host/src/platform-gitlab-credential.js.map +0 -1
- package/dist/apps/local-coding-host/src/platform.d.ts +0 -2
- package/dist/apps/local-coding-host/src/platform.d.ts.map +0 -1
- package/dist/apps/local-coding-host/src/platform.js +0 -15
- package/dist/apps/local-coding-host/src/platform.js.map +0 -1
- package/dist/apps/local-coding-host/src/profile.d.ts +0 -9
- package/dist/apps/local-coding-host/src/profile.d.ts.map +0 -1
- package/dist/apps/local-coding-host/src/profile.js +0 -43
- package/dist/apps/local-coding-host/src/profile.js.map +0 -1
- package/dist/apps/local-coding-host/src/project-facts.d.ts +0 -20
- package/dist/apps/local-coding-host/src/project-facts.d.ts.map +0 -1
- package/dist/apps/local-coding-host/src/project-facts.js +0 -94
- package/dist/apps/local-coding-host/src/project-facts.js.map +0 -1
- package/dist/apps/local-coding-host/src/provider-auth-error.d.ts +0 -3
- package/dist/apps/local-coding-host/src/provider-auth-error.d.ts.map +0 -1
- package/dist/apps/local-coding-host/src/provider-auth-error.js +0 -12
- package/dist/apps/local-coding-host/src/provider-auth-error.js.map +0 -1
- package/dist/apps/local-coding-host/src/qa-contract.d.ts +0 -2
- package/dist/apps/local-coding-host/src/qa-contract.d.ts.map +0 -1
- package/dist/apps/local-coding-host/src/qa-contract.js +0 -3
- package/dist/apps/local-coding-host/src/qa-contract.js.map +0 -1
- package/dist/apps/local-coding-host/src/qa-project-checkout.d.ts +0 -16
- package/dist/apps/local-coding-host/src/qa-project-checkout.d.ts.map +0 -1
- package/dist/apps/local-coding-host/src/qa-project-checkout.js +0 -92
- package/dist/apps/local-coding-host/src/qa-project-checkout.js.map +0 -1
- package/dist/apps/local-coding-host/src/qa-session-manager.d.ts +0 -83
- package/dist/apps/local-coding-host/src/qa-session-manager.d.ts.map +0 -1
- package/dist/apps/local-coding-host/src/qa-session-manager.js +0 -782
- package/dist/apps/local-coding-host/src/qa-session-manager.js.map +0 -1
- package/dist/apps/local-coding-host/src/run-resources.d.ts +0 -17
- package/dist/apps/local-coding-host/src/run-resources.d.ts.map +0 -1
- package/dist/apps/local-coding-host/src/run-resources.js +0 -115
- package/dist/apps/local-coding-host/src/run-resources.js.map +0 -1
- package/dist/apps/local-coding-host/src/runtime-cleanup.d.ts +0 -5
- package/dist/apps/local-coding-host/src/runtime-cleanup.d.ts.map +0 -1
- package/dist/apps/local-coding-host/src/runtime-cleanup.js +0 -187
- package/dist/apps/local-coding-host/src/runtime-cleanup.js.map +0 -1
- package/dist/apps/local-coding-host/src/runtime-environment.d.ts +0 -2
- package/dist/apps/local-coding-host/src/runtime-environment.d.ts.map +0 -1
- package/dist/apps/local-coding-host/src/runtime-environment.js +0 -7
- package/dist/apps/local-coding-host/src/runtime-environment.js.map +0 -1
- package/dist/apps/local-coding-host/src/runtime-search-tools.d.ts +0 -3
- package/dist/apps/local-coding-host/src/runtime-search-tools.d.ts.map +0 -1
- package/dist/apps/local-coding-host/src/runtime-search-tools.js +0 -30
- package/dist/apps/local-coding-host/src/runtime-search-tools.js.map +0 -1
- package/dist/apps/local-coding-host/src/secure-json.d.ts +0 -12
- package/dist/apps/local-coding-host/src/secure-json.d.ts.map +0 -1
- package/dist/apps/local-coding-host/src/secure-json.js +0 -129
- package/dist/apps/local-coding-host/src/secure-json.js.map +0 -1
- package/dist/apps/local-coding-host/src/self-check.d.ts +0 -3
- package/dist/apps/local-coding-host/src/self-check.d.ts.map +0 -1
- package/dist/apps/local-coding-host/src/self-check.js +0 -9
- package/dist/apps/local-coding-host/src/self-check.js.map +0 -1
- package/dist/apps/local-coding-host/src/skill-bundle-cache.d.ts +0 -11
- package/dist/apps/local-coding-host/src/skill-bundle-cache.d.ts.map +0 -1
- package/dist/apps/local-coding-host/src/skill-bundle-cache.js +0 -76
- package/dist/apps/local-coding-host/src/skill-bundle-cache.js.map +0 -1
- package/dist/apps/local-coding-host/src/skill-storage.d.ts +0 -18
- package/dist/apps/local-coding-host/src/skill-storage.d.ts.map +0 -1
- package/dist/apps/local-coding-host/src/skill-storage.js +0 -287
- package/dist/apps/local-coding-host/src/skill-storage.js.map +0 -1
- package/dist/apps/local-coding-host/src/stage-delivery.d.ts +0 -2
- package/dist/apps/local-coding-host/src/stage-delivery.d.ts.map +0 -1
- package/dist/apps/local-coding-host/src/stage-delivery.js +0 -3
- package/dist/apps/local-coding-host/src/stage-delivery.js.map +0 -1
- package/dist/apps/local-coding-host/src/state.d.ts +0 -55
- package/dist/apps/local-coding-host/src/state.d.ts.map +0 -1
- package/dist/apps/local-coding-host/src/state.js +0 -151
- package/dist/apps/local-coding-host/src/state.js.map +0 -1
- package/dist/apps/local-coding-host/src/storage-maintenance.d.ts +0 -13
- package/dist/apps/local-coding-host/src/storage-maintenance.d.ts.map +0 -1
- package/dist/apps/local-coding-host/src/storage-maintenance.js +0 -62
- package/dist/apps/local-coding-host/src/storage-maintenance.js.map +0 -1
- package/dist/apps/local-coding-host/src/test-cli.d.ts +0 -2
- package/dist/apps/local-coding-host/src/test-cli.d.ts.map +0 -1
- package/dist/apps/local-coding-host/src/test-cli.js +0 -48
- package/dist/apps/local-coding-host/src/test-cli.js.map +0 -1
- package/dist/apps/local-coding-host/src/test-executor.d.ts +0 -41
- package/dist/apps/local-coding-host/src/test-executor.d.ts.map +0 -1
- package/dist/apps/local-coding-host/src/test-executor.js +0 -483
- package/dist/apps/local-coding-host/src/test-executor.js.map +0 -1
- package/dist/apps/local-coding-host/src/test-reports.d.ts +0 -25
- package/dist/apps/local-coding-host/src/test-reports.d.ts.map +0 -1
- package/dist/apps/local-coding-host/src/test-reports.js +0 -129
- package/dist/apps/local-coding-host/src/test-reports.js.map +0 -1
- package/dist/apps/local-coding-host/src/test-run-manager.d.ts +0 -34
- package/dist/apps/local-coding-host/src/test-run-manager.d.ts.map +0 -1
- package/dist/apps/local-coding-host/src/test-run-manager.js +0 -180
- package/dist/apps/local-coding-host/src/test-run-manager.js.map +0 -1
- package/dist/apps/local-coding-host/src/tool-dispatch.d.ts +0 -14
- package/dist/apps/local-coding-host/src/tool-dispatch.d.ts.map +0 -1
- package/dist/apps/local-coding-host/src/tool-dispatch.js +0 -59
- package/dist/apps/local-coding-host/src/tool-dispatch.js.map +0 -1
- package/dist/apps/local-coding-host/src/tool-probe.d.ts +0 -31
- package/dist/apps/local-coding-host/src/tool-probe.d.ts.map +0 -1
- package/dist/apps/local-coding-host/src/tool-probe.js +0 -95
- package/dist/apps/local-coding-host/src/tool-probe.js.map +0 -1
- package/dist/apps/local-coding-host/src/windows-runtime.d.ts +0 -9
- package/dist/apps/local-coding-host/src/windows-runtime.d.ts.map +0 -1
- package/dist/apps/local-coding-host/src/windows-runtime.js +0 -64
- package/dist/apps/local-coding-host/src/windows-runtime.js.map +0 -1
- package/dist/apps/local-coding-host/src/windows-service.d.ts +0 -22
- package/dist/apps/local-coding-host/src/windows-service.d.ts.map +0 -1
- package/dist/apps/local-coding-host/src/windows-service.js +0 -126
- package/dist/apps/local-coding-host/src/windows-service.js.map +0 -1
- package/dist/apps/local-coding-host/src/workflow-guidance.d.ts +0 -2
- package/dist/apps/local-coding-host/src/workflow-guidance.d.ts.map +0 -1
- package/dist/apps/local-coding-host/src/workflow-guidance.js +0 -3
- package/dist/apps/local-coding-host/src/workflow-guidance.js.map +0 -1
- package/dist/apps/local-coding-host/src/workspace-diff.d.ts +0 -6
- package/dist/apps/local-coding-host/src/workspace-diff.d.ts.map +0 -1
- package/dist/apps/local-coding-host/src/workspace-diff.js +0 -280
- package/dist/apps/local-coding-host/src/workspace-diff.js.map +0 -1
- package/dist/apps/local-coding-host/src/workspace-gc.d.ts +0 -25
- package/dist/apps/local-coding-host/src/workspace-gc.d.ts.map +0 -1
- package/dist/apps/local-coding-host/src/workspace-gc.js +0 -417
- package/dist/apps/local-coding-host/src/workspace-gc.js.map +0 -1
- package/dist/apps/local-coding-host/tests/bash-discovery.test.d.ts +0 -2
- package/dist/apps/local-coding-host/tests/bash-discovery.test.d.ts.map +0 -1
- package/dist/apps/local-coding-host/tests/bash-discovery.test.js +0 -36
- package/dist/apps/local-coding-host/tests/bash-discovery.test.js.map +0 -1
- package/dist/apps/local-coding-host/tests/cli-startup.test.d.ts +0 -2
- package/dist/apps/local-coding-host/tests/cli-startup.test.d.ts.map +0 -1
- package/dist/apps/local-coding-host/tests/cli-startup.test.js +0 -176
- package/dist/apps/local-coding-host/tests/cli-startup.test.js.map +0 -1
- package/dist/apps/local-coding-host/tests/coding-run-manager.test.d.ts +0 -2
- package/dist/apps/local-coding-host/tests/coding-run-manager.test.d.ts.map +0 -1
- package/dist/apps/local-coding-host/tests/coding-run-manager.test.js +0 -3211
- package/dist/apps/local-coding-host/tests/coding-run-manager.test.js.map +0 -1
- package/dist/apps/local-coding-host/tests/coding-subagent-child.test.d.ts +0 -2
- package/dist/apps/local-coding-host/tests/coding-subagent-child.test.d.ts.map +0 -1
- package/dist/apps/local-coding-host/tests/coding-subagent-child.test.js +0 -223
- package/dist/apps/local-coding-host/tests/coding-subagent-child.test.js.map +0 -1
- package/dist/apps/local-coding-host/tests/coding-subagents.integration.test.d.ts +0 -2
- package/dist/apps/local-coding-host/tests/coding-subagents.integration.test.d.ts.map +0 -1
- package/dist/apps/local-coding-host/tests/coding-subagents.integration.test.js +0 -390
- package/dist/apps/local-coding-host/tests/coding-subagents.integration.test.js.map +0 -1
- package/dist/apps/local-coding-host/tests/command-wakeup.test.d.ts +0 -2
- package/dist/apps/local-coding-host/tests/command-wakeup.test.d.ts.map +0 -1
- package/dist/apps/local-coding-host/tests/command-wakeup.test.js +0 -148
- package/dist/apps/local-coding-host/tests/command-wakeup.test.js.map +0 -1
- package/dist/apps/local-coding-host/tests/daemon-wakeup.test.d.ts +0 -2
- package/dist/apps/local-coding-host/tests/daemon-wakeup.test.d.ts.map +0 -1
- package/dist/apps/local-coding-host/tests/daemon-wakeup.test.js +0 -636
- package/dist/apps/local-coding-host/tests/daemon-wakeup.test.js.map +0 -1
- package/dist/apps/local-coding-host/tests/database-tool-transport.test.d.ts +0 -2
- package/dist/apps/local-coding-host/tests/database-tool-transport.test.d.ts.map +0 -1
- package/dist/apps/local-coding-host/tests/database-tool-transport.test.js +0 -37
- package/dist/apps/local-coding-host/tests/database-tool-transport.test.js.map +0 -1
- package/dist/apps/local-coding-host/tests/delivery-files.test.d.ts +0 -2
- package/dist/apps/local-coding-host/tests/delivery-files.test.d.ts.map +0 -1
- package/dist/apps/local-coding-host/tests/delivery-files.test.js +0 -655
- package/dist/apps/local-coding-host/tests/delivery-files.test.js.map +0 -1
- package/dist/apps/local-coding-host/tests/device-gitlab-sync.test.d.ts +0 -2
- package/dist/apps/local-coding-host/tests/device-gitlab-sync.test.d.ts.map +0 -1
- package/dist/apps/local-coding-host/tests/device-gitlab-sync.test.js +0 -116
- package/dist/apps/local-coding-host/tests/device-gitlab-sync.test.js.map +0 -1
- package/dist/apps/local-coding-host/tests/diagnostic-logging.test.d.ts +0 -2
- package/dist/apps/local-coding-host/tests/diagnostic-logging.test.d.ts.map +0 -1
- package/dist/apps/local-coding-host/tests/diagnostic-logging.test.js +0 -143
- package/dist/apps/local-coding-host/tests/diagnostic-logging.test.js.map +0 -1
- package/dist/apps/local-coding-host/tests/execution-process.test.d.ts +0 -2
- package/dist/apps/local-coding-host/tests/execution-process.test.d.ts.map +0 -1
- package/dist/apps/local-coding-host/tests/execution-process.test.js +0 -127
- package/dist/apps/local-coding-host/tests/execution-process.test.js.map +0 -1
- package/dist/apps/local-coding-host/tests/execution-receipts.test.d.ts +0 -2
- package/dist/apps/local-coding-host/tests/execution-receipts.test.d.ts.map +0 -1
- package/dist/apps/local-coding-host/tests/execution-receipts.test.js +0 -72
- package/dist/apps/local-coding-host/tests/execution-receipts.test.js.map +0 -1
- package/dist/apps/local-coding-host/tests/execution-supervisor.test.d.ts +0 -2
- package/dist/apps/local-coding-host/tests/execution-supervisor.test.d.ts.map +0 -1
- package/dist/apps/local-coding-host/tests/execution-supervisor.test.js +0 -488
- package/dist/apps/local-coding-host/tests/execution-supervisor.test.js.map +0 -1
- package/dist/apps/local-coding-host/tests/general-employee-fixture.d.ts +0 -3
- package/dist/apps/local-coding-host/tests/general-employee-fixture.d.ts.map +0 -1
- package/dist/apps/local-coding-host/tests/general-employee-fixture.js +0 -43
- package/dist/apps/local-coding-host/tests/general-employee-fixture.js.map +0 -1
- package/dist/apps/local-coding-host/tests/general-run-manager.test.d.ts +0 -2
- package/dist/apps/local-coding-host/tests/general-run-manager.test.d.ts.map +0 -1
- package/dist/apps/local-coding-host/tests/general-run-manager.test.js +0 -506
- package/dist/apps/local-coding-host/tests/general-run-manager.test.js.map +0 -1
- package/dist/apps/local-coding-host/tests/general-run-supervisor.test.d.ts +0 -2
- package/dist/apps/local-coding-host/tests/general-run-supervisor.test.d.ts.map +0 -1
- package/dist/apps/local-coding-host/tests/general-run-supervisor.test.js +0 -252
- package/dist/apps/local-coding-host/tests/general-run-supervisor.test.js.map +0 -1
- package/dist/apps/local-coding-host/tests/general-run-tools.test.d.ts +0 -2
- package/dist/apps/local-coding-host/tests/general-run-tools.test.d.ts.map +0 -1
- package/dist/apps/local-coding-host/tests/general-run-tools.test.js +0 -202
- package/dist/apps/local-coding-host/tests/general-run-tools.test.js.map +0 -1
- package/dist/apps/local-coding-host/tests/general-run.integration.test.d.ts +0 -2
- package/dist/apps/local-coding-host/tests/general-run.integration.test.d.ts.map +0 -1
- package/dist/apps/local-coding-host/tests/general-run.integration.test.js +0 -150
- package/dist/apps/local-coding-host/tests/general-run.integration.test.js.map +0 -1
- package/dist/apps/local-coding-host/tests/git-http-migration.test.d.ts +0 -2
- package/dist/apps/local-coding-host/tests/git-http-migration.test.d.ts.map +0 -1
- package/dist/apps/local-coding-host/tests/git-http-migration.test.js +0 -140
- package/dist/apps/local-coding-host/tests/git-http-migration.test.js.map +0 -1
- package/dist/apps/local-coding-host/tests/git-process.test.d.ts +0 -2
- package/dist/apps/local-coding-host/tests/git-process.test.d.ts.map +0 -1
- package/dist/apps/local-coding-host/tests/git-process.test.js +0 -106
- package/dist/apps/local-coding-host/tests/git-process.test.js.map +0 -1
- package/dist/apps/local-coding-host/tests/git-transport.test.d.ts +0 -2
- package/dist/apps/local-coding-host/tests/git-transport.test.d.ts.map +0 -1
- package/dist/apps/local-coding-host/tests/git-transport.test.js +0 -56
- package/dist/apps/local-coding-host/tests/git-transport.test.js.map +0 -1
- package/dist/apps/local-coding-host/tests/gitlab-credentials.test.d.ts +0 -2
- package/dist/apps/local-coding-host/tests/gitlab-credentials.test.d.ts.map +0 -1
- package/dist/apps/local-coding-host/tests/gitlab-credentials.test.js +0 -130
- package/dist/apps/local-coding-host/tests/gitlab-credentials.test.js.map +0 -1
- package/dist/apps/local-coding-host/tests/gitlab-platform-credentials.test.d.ts +0 -2
- package/dist/apps/local-coding-host/tests/gitlab-platform-credentials.test.d.ts.map +0 -1
- package/dist/apps/local-coding-host/tests/gitlab-platform-credentials.test.js +0 -273
- package/dist/apps/local-coding-host/tests/gitlab-platform-credentials.test.js.map +0 -1
- package/dist/apps/local-coding-host/tests/host-log.test.d.ts +0 -2
- package/dist/apps/local-coding-host/tests/host-log.test.d.ts.map +0 -1
- package/dist/apps/local-coding-host/tests/host-log.test.js +0 -51
- package/dist/apps/local-coding-host/tests/host-log.test.js.map +0 -1
- package/dist/apps/local-coding-host/tests/host-status-workspace.test.d.ts +0 -2
- package/dist/apps/local-coding-host/tests/host-status-workspace.test.d.ts.map +0 -1
- package/dist/apps/local-coding-host/tests/host-status-workspace.test.js +0 -256
- package/dist/apps/local-coding-host/tests/host-status-workspace.test.js.map +0 -1
- package/dist/apps/local-coding-host/tests/host-tool-stages.test.d.ts +0 -2
- package/dist/apps/local-coding-host/tests/host-tool-stages.test.d.ts.map +0 -1
- package/dist/apps/local-coding-host/tests/host-tool-stages.test.js +0 -82
- package/dist/apps/local-coding-host/tests/host-tool-stages.test.js.map +0 -1
- package/dist/apps/local-coding-host/tests/host-tools-logging.test.d.ts +0 -2
- package/dist/apps/local-coding-host/tests/host-tools-logging.test.d.ts.map +0 -1
- package/dist/apps/local-coding-host/tests/host-tools-logging.test.js +0 -110
- package/dist/apps/local-coding-host/tests/host-tools-logging.test.js.map +0 -1
- package/dist/apps/local-coding-host/tests/host-tools.test.d.ts +0 -2
- package/dist/apps/local-coding-host/tests/host-tools.test.d.ts.map +0 -1
- package/dist/apps/local-coding-host/tests/host-tools.test.js +0 -96
- package/dist/apps/local-coding-host/tests/host-tools.test.js.map +0 -1
- package/dist/apps/local-coding-host/tests/host-update.test.d.ts +0 -2
- package/dist/apps/local-coding-host/tests/host-update.test.d.ts.map +0 -1
- package/dist/apps/local-coding-host/tests/host-update.test.js +0 -102
- package/dist/apps/local-coding-host/tests/host-update.test.js.map +0 -1
- package/dist/apps/local-coding-host/tests/install-scripts.test.d.ts +0 -2
- package/dist/apps/local-coding-host/tests/install-scripts.test.d.ts.map +0 -1
- package/dist/apps/local-coding-host/tests/install-scripts.test.js +0 -80
- package/dist/apps/local-coding-host/tests/install-scripts.test.js.map +0 -1
- package/dist/apps/local-coding-host/tests/linux-service.test.d.ts +0 -2
- package/dist/apps/local-coding-host/tests/linux-service.test.d.ts.map +0 -1
- package/dist/apps/local-coding-host/tests/linux-service.test.js +0 -32
- package/dist/apps/local-coding-host/tests/linux-service.test.js.map +0 -1
- package/dist/apps/local-coding-host/tests/live-employee.test.d.ts +0 -2
- package/dist/apps/local-coding-host/tests/live-employee.test.d.ts.map +0 -1
- package/dist/apps/local-coding-host/tests/live-employee.test.js +0 -739
- package/dist/apps/local-coding-host/tests/live-employee.test.js.map +0 -1
- package/dist/apps/local-coding-host/tests/local-handoff-workspace-errors.test.d.ts +0 -2
- package/dist/apps/local-coding-host/tests/local-handoff-workspace-errors.test.d.ts.map +0 -1
- package/dist/apps/local-coding-host/tests/local-handoff-workspace-errors.test.js +0 -33
- package/dist/apps/local-coding-host/tests/local-handoff-workspace-errors.test.js.map +0 -1
- package/dist/apps/local-coding-host/tests/local-handoff-workspace.test.d.ts +0 -2
- package/dist/apps/local-coding-host/tests/local-handoff-workspace.test.d.ts.map +0 -1
- package/dist/apps/local-coding-host/tests/local-handoff-workspace.test.js +0 -67
- package/dist/apps/local-coding-host/tests/local-handoff-workspace.test.js.map +0 -1
- package/dist/apps/local-coding-host/tests/local-host.test.d.ts +0 -2
- package/dist/apps/local-coding-host/tests/local-host.test.d.ts.map +0 -1
- package/dist/apps/local-coding-host/tests/local-host.test.js +0 -1009
- package/dist/apps/local-coding-host/tests/local-host.test.js.map +0 -1
- package/dist/apps/local-coding-host/tests/local-intake-recovery.test.d.ts +0 -2
- package/dist/apps/local-coding-host/tests/local-intake-recovery.test.d.ts.map +0 -1
- package/dist/apps/local-coding-host/tests/local-intake-recovery.test.js +0 -71
- package/dist/apps/local-coding-host/tests/local-intake-recovery.test.js.map +0 -1
- package/dist/apps/local-coding-host/tests/local-mcp.test.d.ts +0 -2
- package/dist/apps/local-coding-host/tests/local-mcp.test.d.ts.map +0 -1
- package/dist/apps/local-coding-host/tests/local-mcp.test.js +0 -193
- package/dist/apps/local-coding-host/tests/local-mcp.test.js.map +0 -1
- package/dist/apps/local-coding-host/tests/local-model-usage.test.d.ts +0 -2
- package/dist/apps/local-coding-host/tests/local-model-usage.test.d.ts.map +0 -1
- package/dist/apps/local-coding-host/tests/local-model-usage.test.js +0 -55
- package/dist/apps/local-coding-host/tests/local-model-usage.test.js.map +0 -1
- package/dist/apps/local-coding-host/tests/local-outcome-workspace.test.d.ts +0 -2
- package/dist/apps/local-coding-host/tests/local-outcome-workspace.test.d.ts.map +0 -1
- package/dist/apps/local-coding-host/tests/local-outcome-workspace.test.js +0 -87
- package/dist/apps/local-coding-host/tests/local-outcome-workspace.test.js.map +0 -1
- package/dist/apps/local-coding-host/tests/login-url.test.d.ts +0 -2
- package/dist/apps/local-coding-host/tests/login-url.test.d.ts.map +0 -1
- package/dist/apps/local-coding-host/tests/login-url.test.js +0 -82
- package/dist/apps/local-coding-host/tests/login-url.test.js.map +0 -1
- package/dist/apps/local-coding-host/tests/material-fixture.d.ts +0 -13
- package/dist/apps/local-coding-host/tests/material-fixture.d.ts.map +0 -1
- package/dist/apps/local-coding-host/tests/material-fixture.js +0 -32
- package/dist/apps/local-coding-host/tests/material-fixture.js.map +0 -1
- package/dist/apps/local-coding-host/tests/merge-requests.test.d.ts +0 -2
- package/dist/apps/local-coding-host/tests/merge-requests.test.d.ts.map +0 -1
- package/dist/apps/local-coding-host/tests/merge-requests.test.js +0 -318
- package/dist/apps/local-coding-host/tests/merge-requests.test.js.map +0 -1
- package/dist/apps/local-coding-host/tests/model-stores.test.d.ts +0 -2
- package/dist/apps/local-coding-host/tests/model-stores.test.d.ts.map +0 -1
- package/dist/apps/local-coding-host/tests/model-stores.test.js +0 -152
- package/dist/apps/local-coding-host/tests/model-stores.test.js.map +0 -1
- package/dist/apps/local-coding-host/tests/operation-context.test.d.ts +0 -2
- package/dist/apps/local-coding-host/tests/operation-context.test.d.ts.map +0 -1
- package/dist/apps/local-coding-host/tests/operation-context.test.js +0 -171
- package/dist/apps/local-coding-host/tests/operation-context.test.js.map +0 -1
- package/dist/apps/local-coding-host/tests/outcome-cli.test.d.ts +0 -2
- package/dist/apps/local-coding-host/tests/outcome-cli.test.d.ts.map +0 -1
- package/dist/apps/local-coding-host/tests/outcome-cli.test.js +0 -208
- package/dist/apps/local-coding-host/tests/outcome-cli.test.js.map +0 -1
- package/dist/apps/local-coding-host/tests/pi-message-queue.test.d.ts +0 -2
- package/dist/apps/local-coding-host/tests/pi-message-queue.test.d.ts.map +0 -1
- package/dist/apps/local-coding-host/tests/pi-message-queue.test.js +0 -91
- package/dist/apps/local-coding-host/tests/pi-message-queue.test.js.map +0 -1
- package/dist/apps/local-coding-host/tests/pi-model-switch.test.d.ts +0 -2
- package/dist/apps/local-coding-host/tests/pi-model-switch.test.d.ts.map +0 -1
- package/dist/apps/local-coding-host/tests/pi-model-switch.test.js +0 -244
- package/dist/apps/local-coding-host/tests/pi-model-switch.test.js.map +0 -1
- package/dist/apps/local-coding-host/tests/pi-native-capabilities.test.d.ts +0 -2
- package/dist/apps/local-coding-host/tests/pi-native-capabilities.test.d.ts.map +0 -1
- package/dist/apps/local-coding-host/tests/pi-native-capabilities.test.js +0 -75
- package/dist/apps/local-coding-host/tests/pi-native-capabilities.test.js.map +0 -1
- package/dist/apps/local-coding-host/tests/pi-overflow-recovery.test.d.ts +0 -2
- package/dist/apps/local-coding-host/tests/pi-overflow-recovery.test.d.ts.map +0 -1
- package/dist/apps/local-coding-host/tests/pi-overflow-recovery.test.js +0 -183
- package/dist/apps/local-coding-host/tests/pi-overflow-recovery.test.js.map +0 -1
- package/dist/apps/local-coding-host/tests/pi-session-restore.test.d.ts +0 -2
- package/dist/apps/local-coding-host/tests/pi-session-restore.test.d.ts.map +0 -1
- package/dist/apps/local-coding-host/tests/pi-session-restore.test.js +0 -84
- package/dist/apps/local-coding-host/tests/pi-session-restore.test.js.map +0 -1
- package/dist/apps/local-coding-host/tests/platform-client-status.test.d.ts +0 -2
- package/dist/apps/local-coding-host/tests/platform-client-status.test.d.ts.map +0 -1
- package/dist/apps/local-coding-host/tests/platform-client-status.test.js +0 -29
- package/dist/apps/local-coding-host/tests/platform-client-status.test.js.map +0 -1
- package/dist/apps/local-coding-host/tests/platform-models.test.d.ts +0 -2
- package/dist/apps/local-coding-host/tests/platform-models.test.d.ts.map +0 -1
- package/dist/apps/local-coding-host/tests/platform-models.test.js +0 -395
- package/dist/apps/local-coding-host/tests/platform-models.test.js.map +0 -1
- package/dist/apps/local-coding-host/tests/powershell-resolution.test.d.ts +0 -2
- package/dist/apps/local-coding-host/tests/powershell-resolution.test.d.ts.map +0 -1
- package/dist/apps/local-coding-host/tests/powershell-resolution.test.js +0 -138
- package/dist/apps/local-coding-host/tests/powershell-resolution.test.js.map +0 -1
- package/dist/apps/local-coding-host/tests/profile-installer.test.d.ts +0 -2
- package/dist/apps/local-coding-host/tests/profile-installer.test.d.ts.map +0 -1
- package/dist/apps/local-coding-host/tests/profile-installer.test.js +0 -88
- package/dist/apps/local-coding-host/tests/profile-installer.test.js.map +0 -1
- package/dist/apps/local-coding-host/tests/profile.test.d.ts +0 -2
- package/dist/apps/local-coding-host/tests/profile.test.d.ts.map +0 -1
- package/dist/apps/local-coding-host/tests/profile.test.js +0 -88
- package/dist/apps/local-coding-host/tests/profile.test.js.map +0 -1
- package/dist/apps/local-coding-host/tests/provider-auth-status.test.d.ts +0 -2
- package/dist/apps/local-coding-host/tests/provider-auth-status.test.d.ts.map +0 -1
- package/dist/apps/local-coding-host/tests/provider-auth-status.test.js +0 -82
- package/dist/apps/local-coding-host/tests/provider-auth-status.test.js.map +0 -1
- package/dist/apps/local-coding-host/tests/qa-project-checkout.test.d.ts +0 -2
- package/dist/apps/local-coding-host/tests/qa-project-checkout.test.d.ts.map +0 -1
- package/dist/apps/local-coding-host/tests/qa-project-checkout.test.js +0 -101
- package/dist/apps/local-coding-host/tests/qa-project-checkout.test.js.map +0 -1
- package/dist/apps/local-coding-host/tests/qa-session-manager.test.d.ts +0 -2
- package/dist/apps/local-coding-host/tests/qa-session-manager.test.d.ts.map +0 -1
- package/dist/apps/local-coding-host/tests/qa-session-manager.test.js +0 -1493
- package/dist/apps/local-coding-host/tests/qa-session-manager.test.js.map +0 -1
- package/dist/apps/local-coding-host/tests/qa-verification-contract.test.d.ts +0 -2
- package/dist/apps/local-coding-host/tests/qa-verification-contract.test.d.ts.map +0 -1
- package/dist/apps/local-coding-host/tests/qa-verification-contract.test.js +0 -208
- package/dist/apps/local-coding-host/tests/qa-verification-contract.test.js.map +0 -1
- package/dist/apps/local-coding-host/tests/recovery-workspace.test.d.ts +0 -2
- package/dist/apps/local-coding-host/tests/recovery-workspace.test.d.ts.map +0 -1
- package/dist/apps/local-coding-host/tests/recovery-workspace.test.js +0 -69
- package/dist/apps/local-coding-host/tests/recovery-workspace.test.js.map +0 -1
- package/dist/apps/local-coding-host/tests/review-query.test.d.ts +0 -2
- package/dist/apps/local-coding-host/tests/review-query.test.d.ts.map +0 -1
- package/dist/apps/local-coding-host/tests/review-query.test.js +0 -66
- package/dist/apps/local-coding-host/tests/review-query.test.js.map +0 -1
- package/dist/apps/local-coding-host/tests/run-resources.test.d.ts +0 -2
- package/dist/apps/local-coding-host/tests/run-resources.test.d.ts.map +0 -1
- package/dist/apps/local-coding-host/tests/run-resources.test.js +0 -207
- package/dist/apps/local-coding-host/tests/run-resources.test.js.map +0 -1
- package/dist/apps/local-coding-host/tests/runtime-cleanup.test.d.ts +0 -2
- package/dist/apps/local-coding-host/tests/runtime-cleanup.test.d.ts.map +0 -1
- package/dist/apps/local-coding-host/tests/runtime-cleanup.test.js +0 -161
- package/dist/apps/local-coding-host/tests/runtime-cleanup.test.js.map +0 -1
- package/dist/apps/local-coding-host/tests/runtime-package-install.test.d.ts +0 -2
- package/dist/apps/local-coding-host/tests/runtime-package-install.test.d.ts.map +0 -1
- package/dist/apps/local-coding-host/tests/runtime-package-install.test.js +0 -63
- package/dist/apps/local-coding-host/tests/runtime-package-install.test.js.map +0 -1
- package/dist/apps/local-coding-host/tests/runtime-version.test.d.ts +0 -2
- package/dist/apps/local-coding-host/tests/runtime-version.test.d.ts.map +0 -1
- package/dist/apps/local-coding-host/tests/runtime-version.test.js +0 -15
- package/dist/apps/local-coding-host/tests/runtime-version.test.js.map +0 -1
- package/dist/apps/local-coding-host/tests/secure-json.test.d.ts +0 -2
- package/dist/apps/local-coding-host/tests/secure-json.test.d.ts.map +0 -1
- package/dist/apps/local-coding-host/tests/secure-json.test.js +0 -64
- package/dist/apps/local-coding-host/tests/secure-json.test.js.map +0 -1
- package/dist/apps/local-coding-host/tests/skill-storage-gc.test.d.ts +0 -2
- package/dist/apps/local-coding-host/tests/skill-storage-gc.test.d.ts.map +0 -1
- package/dist/apps/local-coding-host/tests/skill-storage-gc.test.js +0 -312
- package/dist/apps/local-coding-host/tests/skill-storage-gc.test.js.map +0 -1
- package/dist/apps/local-coding-host/tests/storage-maintenance.test.d.ts +0 -2
- package/dist/apps/local-coding-host/tests/storage-maintenance.test.d.ts.map +0 -1
- package/dist/apps/local-coding-host/tests/storage-maintenance.test.js +0 -135
- package/dist/apps/local-coding-host/tests/storage-maintenance.test.js.map +0 -1
- package/dist/apps/local-coding-host/tests/test-executor.test.d.ts +0 -2
- package/dist/apps/local-coding-host/tests/test-executor.test.d.ts.map +0 -1
- package/dist/apps/local-coding-host/tests/test-executor.test.js +0 -365
- package/dist/apps/local-coding-host/tests/test-executor.test.js.map +0 -1
- package/dist/apps/local-coding-host/tests/test-reports.test.d.ts +0 -2
- package/dist/apps/local-coding-host/tests/test-reports.test.d.ts.map +0 -1
- package/dist/apps/local-coding-host/tests/test-reports.test.js +0 -68
- package/dist/apps/local-coding-host/tests/test-reports.test.js.map +0 -1
- package/dist/apps/local-coding-host/tests/test-run-manager.test.d.ts +0 -2
- package/dist/apps/local-coding-host/tests/test-run-manager.test.d.ts.map +0 -1
- package/dist/apps/local-coding-host/tests/test-run-manager.test.js +0 -287
- package/dist/apps/local-coding-host/tests/test-run-manager.test.js.map +0 -1
- package/dist/apps/local-coding-host/tests/tool-dispatch.integration.test.d.ts +0 -2
- package/dist/apps/local-coding-host/tests/tool-dispatch.integration.test.d.ts.map +0 -1
- package/dist/apps/local-coding-host/tests/tool-dispatch.integration.test.js +0 -224
- package/dist/apps/local-coding-host/tests/tool-dispatch.integration.test.js.map +0 -1
- package/dist/apps/local-coding-host/tests/tool-dispatch.test.d.ts +0 -2
- package/dist/apps/local-coding-host/tests/tool-dispatch.test.d.ts.map +0 -1
- package/dist/apps/local-coding-host/tests/tool-dispatch.test.js +0 -47
- package/dist/apps/local-coding-host/tests/tool-dispatch.test.js.map +0 -1
- package/dist/apps/local-coding-host/tests/tool-probe.test.d.ts +0 -2
- package/dist/apps/local-coding-host/tests/tool-probe.test.d.ts.map +0 -1
- package/dist/apps/local-coding-host/tests/tool-probe.test.js +0 -55
- package/dist/apps/local-coding-host/tests/tool-probe.test.js.map +0 -1
- package/dist/apps/local-coding-host/tests/windows-background-check.test.d.ts +0 -2
- package/dist/apps/local-coding-host/tests/windows-background-check.test.d.ts.map +0 -1
- package/dist/apps/local-coding-host/tests/windows-background-check.test.js +0 -60
- package/dist/apps/local-coding-host/tests/windows-background-check.test.js.map +0 -1
- package/dist/apps/local-coding-host/tests/windows-install-script.test.d.ts +0 -2
- package/dist/apps/local-coding-host/tests/windows-install-script.test.d.ts.map +0 -1
- package/dist/apps/local-coding-host/tests/windows-install-script.test.js +0 -170
- package/dist/apps/local-coding-host/tests/windows-install-script.test.js.map +0 -1
- package/dist/apps/local-coding-host/tests/windows-installer.test.d.ts +0 -2
- package/dist/apps/local-coding-host/tests/windows-installer.test.d.ts.map +0 -1
- package/dist/apps/local-coding-host/tests/windows-installer.test.js +0 -244
- package/dist/apps/local-coding-host/tests/windows-installer.test.js.map +0 -1
- package/dist/apps/local-coding-host/tests/windows-task-configuration.test.d.ts +0 -2
- package/dist/apps/local-coding-host/tests/windows-task-configuration.test.d.ts.map +0 -1
- package/dist/apps/local-coding-host/tests/windows-task-configuration.test.js +0 -34
- package/dist/apps/local-coding-host/tests/windows-task-configuration.test.js.map +0 -1
- package/dist/apps/local-coding-host/tests/workflow-rule-projection.test.d.ts +0 -2
- package/dist/apps/local-coding-host/tests/workflow-rule-projection.test.d.ts.map +0 -1
- package/dist/apps/local-coding-host/tests/workflow-rule-projection.test.js +0 -370
- package/dist/apps/local-coding-host/tests/workflow-rule-projection.test.js.map +0 -1
- package/dist/apps/local-coding-host/tests/workspace-diff.test.d.ts +0 -2
- package/dist/apps/local-coding-host/tests/workspace-diff.test.d.ts.map +0 -1
- package/dist/apps/local-coding-host/tests/workspace-diff.test.js +0 -166
- package/dist/apps/local-coding-host/tests/workspace-diff.test.js.map +0 -1
- package/dist/apps/local-coding-host/tests/workspace-gc.test.d.ts +0 -2
- package/dist/apps/local-coding-host/tests/workspace-gc.test.d.ts.map +0 -1
- package/dist/apps/local-coding-host/tests/workspace-gc.test.js +0 -391
- package/dist/apps/local-coding-host/tests/workspace-gc.test.js.map +0 -1
- package/dist/services/platform-api/src/coding-run/coding-tool-definitions.d.ts +0 -83
- package/dist/services/platform-api/src/coding-run/coding-tool-definitions.d.ts.map +0 -1
- package/dist/services/platform-api/src/coding-run/coding-tool-definitions.js +0 -282
- package/dist/services/platform-api/src/coding-run/coding-tool-definitions.js.map +0 -1
- package/dist/services/platform-api/src/coding-run/delivery-requirements.d.ts +0 -15
- package/dist/services/platform-api/src/coding-run/delivery-requirements.d.ts.map +0 -1
- package/dist/services/platform-api/src/coding-run/delivery-requirements.js +0 -60
- package/dist/services/platform-api/src/coding-run/delivery-requirements.js.map +0 -1
- package/dist/services/platform-api/src/coding-run/development-test-report.d.ts +0 -10
- package/dist/services/platform-api/src/coding-run/development-test-report.d.ts.map +0 -1
- package/dist/services/platform-api/src/coding-run/development-test-report.js +0 -32
- package/dist/services/platform-api/src/coding-run/development-test-report.js.map +0 -1
- package/dist/services/platform-api/src/coding-run/host-tool-dispatch.d.ts +0 -21
- package/dist/services/platform-api/src/coding-run/host-tool-dispatch.d.ts.map +0 -1
- package/dist/services/platform-api/src/coding-run/host-tool-dispatch.js +0 -86
- package/dist/services/platform-api/src/coding-run/host-tool-dispatch.js.map +0 -1
- package/dist/services/platform-api/src/coding-run/workspace-materials.d.ts +0 -37
- package/dist/services/platform-api/src/coding-run/workspace-materials.d.ts.map +0 -1
- package/dist/services/platform-api/src/coding-run/workspace-materials.js +0 -99
- package/dist/services/platform-api/src/coding-run/workspace-materials.js.map +0 -1
- package/dist/services/platform-api/src/common/app-exception.d.ts +0 -17
- package/dist/services/platform-api/src/common/app-exception.d.ts.map +0 -1
- package/dist/services/platform-api/src/common/app-exception.js +0 -46
- package/dist/services/platform-api/src/common/app-exception.js.map +0 -1
- package/dist/services/platform-api/src/config/environment.d.ts +0 -30
- package/dist/services/platform-api/src/config/environment.d.ts.map +0 -1
- package/dist/services/platform-api/src/config/environment.js +0 -123
- package/dist/services/platform-api/src/config/environment.js.map +0 -1
- package/dist/services/platform-api/src/database/database.service.d.ts +0 -38
- package/dist/services/platform-api/src/database/database.service.d.ts.map +0 -1
- package/dist/services/platform-api/src/database/database.service.js +0 -520
- package/dist/services/platform-api/src/database/database.service.js.map +0 -1
- package/dist/services/platform-api/src/database/migration-ledger.d.ts +0 -5
- package/dist/services/platform-api/src/database/migration-ledger.d.ts.map +0 -1
- package/dist/services/platform-api/src/database/migration-ledger.js +0 -33
- package/dist/services/platform-api/src/database/migration-ledger.js.map +0 -1
- package/dist/services/platform-api/src/digital-employee/local-skill-bundles.d.ts +0 -13
- package/dist/services/platform-api/src/digital-employee/local-skill-bundles.d.ts.map +0 -1
- package/dist/services/platform-api/src/digital-employee/local-skill-bundles.js +0 -25
- package/dist/services/platform-api/src/digital-employee/local-skill-bundles.js.map +0 -1
- package/dist/services/platform-api/src/mcp-connection/mcp-tool-name.d.ts +0 -6
- package/dist/services/platform-api/src/mcp-connection/mcp-tool-name.d.ts.map +0 -1
- package/dist/services/platform-api/src/mcp-connection/mcp-tool-name.js +0 -20
- package/dist/services/platform-api/src/mcp-connection/mcp-tool-name.js.map +0 -1
- package/dist/services/platform-api/src/qa/qa-tool-definitions.d.ts +0 -100
- package/dist/services/platform-api/src/qa/qa-tool-definitions.d.ts.map +0 -1
- package/dist/services/platform-api/src/qa/qa-tool-definitions.js +0 -498
- package/dist/services/platform-api/src/qa/qa-tool-definitions.js.map +0 -1
- package/dist/tsconfig.tsbuildinfo +0 -1
|
@@ -1,1009 +0,0 @@
|
|
|
1
|
-
import { execFileSync } from "node:child_process";
|
|
2
|
-
import { createHash } from "node:crypto";
|
|
3
|
-
import { chmod, mkdir, mkdtemp, rm, writeFile } from "node:fs/promises";
|
|
4
|
-
import { createServer } from "node:http";
|
|
5
|
-
import { tmpdir } from "node:os";
|
|
6
|
-
import { dirname, join } from "node:path";
|
|
7
|
-
import { ModelRuntime } from "@earendil-works/pi-coding-agent";
|
|
8
|
-
import { afterEach, describe, expect, it, vi } from "vitest";
|
|
9
|
-
import { executeCommand, runDaemon, runtimePath } from "../src/daemon.js";
|
|
10
|
-
import { runDiagnostics } from "../src/diagnostics.js";
|
|
11
|
-
import { launchAgentDefinition, windowsTaskDefinition } from "../src/installer.js";
|
|
12
|
-
import { FileCredentialStore, FileModelsStore } from "../src/model-stores.js";
|
|
13
|
-
import { paths } from "../src/paths.js";
|
|
14
|
-
import { isDefaultModelValid, ProductionPiModelService, TestPiModelService, } from "../src/pi-model-service.js";
|
|
15
|
-
import { runtimeArchitecture } from "../src/platform.js";
|
|
16
|
-
import { PlatformClient, PlatformClientError } from "../src/platform-client.js";
|
|
17
|
-
import { isSecureFile, readJson, writeSecureJson } from "../src/secure-json.js";
|
|
18
|
-
import { hostIdentity, readDeviceAuth, readHostState, registrationCatalogRevision, writeDeviceAuth, writeHostState, } from "../src/state.js";
|
|
19
|
-
// 工具执行由 host-tools 测试和发布包隔离验证覆盖,此处验证状态与心跳协议。
|
|
20
|
-
vi.mock("../src/host-tools.js", () => ({
|
|
21
|
-
installSearchTools: vi.fn().mockResolvedValue(undefined),
|
|
22
|
-
checkHostTools: vi.fn().mockResolvedValue(["SHELL", "CONTENT_SEARCH", "FILE_SEARCH"].map((id) => ({
|
|
23
|
-
id,
|
|
24
|
-
status: "PASS",
|
|
25
|
-
code: `${id}_OK`,
|
|
26
|
-
nextAction: "无需处理",
|
|
27
|
-
}))),
|
|
28
|
-
}));
|
|
29
|
-
vi.mock("../src/runtime-search-tools.js", () => ({
|
|
30
|
-
installSearchTools: vi.fn().mockResolvedValue(undefined),
|
|
31
|
-
}));
|
|
32
|
-
let home;
|
|
33
|
-
afterEach(async () => {
|
|
34
|
-
if (home)
|
|
35
|
-
await rm(home, { recursive: true, force: true });
|
|
36
|
-
home = undefined;
|
|
37
|
-
delete process.env.AIP_HOME;
|
|
38
|
-
delete process.env.AIP_TEST_PI;
|
|
39
|
-
delete process.env.AIP_TEST_PI_CATALOG_ERROR;
|
|
40
|
-
delete process.env.AIP_PROFILE;
|
|
41
|
-
delete process.env.AIP_LAUNCH_AGENT_DIR;
|
|
42
|
-
vi.unstubAllEnvs();
|
|
43
|
-
});
|
|
44
|
-
async function isolatedHome() {
|
|
45
|
-
home = await mkdtemp(join(tmpdir(), "aip-host-test-"));
|
|
46
|
-
process.env.AIP_HOME = home;
|
|
47
|
-
return home;
|
|
48
|
-
}
|
|
49
|
-
describe("Local Coding Host 本机状态", () => {
|
|
50
|
-
it.runIf(process.platform !== "win32")("daemon 优先使用自包含 Runtime 的命令", () => {
|
|
51
|
-
const node = join("/opt", "aip", "runtime", "bin", "node");
|
|
52
|
-
expect(runtimePath("/usr/bin:/bin", node)).toBe("/opt/aip/runtime/bin:/usr/bin:/bin");
|
|
53
|
-
expect(runtimePath("/opt/aip/runtime/bin:/usr/bin", node)).toBe("/opt/aip/runtime/bin:/usr/bin");
|
|
54
|
-
});
|
|
55
|
-
it.runIf(process.platform === "darwin")("LaunchAgent 保留安装时 PATH 且 Runtime 优先,可执行已有 CLI", async () => {
|
|
56
|
-
const root = await isolatedHome();
|
|
57
|
-
const bin = join(root, "tools & cli");
|
|
58
|
-
await mkdir(bin);
|
|
59
|
-
await writeFile(join(bin, "existing-cli"), "#!/bin/sh\nprintf available", { mode: 0o755 });
|
|
60
|
-
const previous = process.env.PATH;
|
|
61
|
-
try {
|
|
62
|
-
process.env.PATH = `${bin}:/usr/bin:/bin`;
|
|
63
|
-
const definition = launchAgentDefinition(paths().runtimeCurrent);
|
|
64
|
-
expect(definition.xml).toContain("tools & cli:/usr/bin:/bin</string>");
|
|
65
|
-
const encoded = definition.xml.match(/<key>PATH<\/key><string>(.*?)<\/string>/)[1];
|
|
66
|
-
const inherited = encoded.replaceAll("&", "&");
|
|
67
|
-
const path = runtimePath(inherited, "/opt/aip/runtime/bin/node");
|
|
68
|
-
expect(path.startsWith("/opt/aip/runtime/bin:")).toBe(true);
|
|
69
|
-
expect(execFileSync("/bin/sh", ["-c", "existing-cli"], {
|
|
70
|
-
env: { PATH: path },
|
|
71
|
-
encoding: "utf8",
|
|
72
|
-
})).toBe("available");
|
|
73
|
-
expect(definition.xml).not.toContain("ACCESS_TOKEN");
|
|
74
|
-
}
|
|
75
|
-
finally {
|
|
76
|
-
process.env.PATH = previous;
|
|
77
|
-
}
|
|
78
|
-
});
|
|
79
|
-
it("同一 Host 重新登记时保留模型目录 revision,避免平台静默丢弃刷新", () => {
|
|
80
|
-
expect(registrationCatalogRevision(null, "h1")).toBe(0);
|
|
81
|
-
expect(registrationCatalogRevision({ hostId: "h1", catalogRevision: 3405 }, "h1")).toBe(3405);
|
|
82
|
-
expect(registrationCatalogRevision({ hostId: "h1", catalogRevision: 3405 }, "h2")).toBe(0);
|
|
83
|
-
});
|
|
84
|
-
it("原子写入 0600 JSON 并保持设备与 Host 文件分离", async () => {
|
|
85
|
-
await isolatedHome();
|
|
86
|
-
await writeDeviceAuth({
|
|
87
|
-
platformUrl: "http://127.0.0.1:3000",
|
|
88
|
-
deviceToken: "local-test-value",
|
|
89
|
-
expiresAt: new Date(Date.now() + 1000).toISOString(),
|
|
90
|
-
user: { id: "u1", username: "tester" },
|
|
91
|
-
});
|
|
92
|
-
await writeHostState({ ...hostIdentity(), hostId: "h1", generation: 1, catalogRevision: 0 });
|
|
93
|
-
expect(await readDeviceAuth()).toMatchObject({ user: { id: "u1" } });
|
|
94
|
-
expect(await readHostState()).toMatchObject({ hostId: "h1", generation: 1 });
|
|
95
|
-
expect(await isSecureFile(paths().deviceAuth)).toBe(true);
|
|
96
|
-
expect(paths().providerAuth).not.toBe(paths().deviceAuth);
|
|
97
|
-
expect(hostIdentity().arch).toBe(runtimeArchitecture());
|
|
98
|
-
});
|
|
99
|
-
it("测试 Provider 只在独立 auth.json 中产生模型目录", async () => {
|
|
100
|
-
await isolatedHome();
|
|
101
|
-
const pi = new TestPiModelService();
|
|
102
|
-
expect(await pi.readAvailableModels()).toEqual([]);
|
|
103
|
-
await pi.login("openai-codex");
|
|
104
|
-
expect(await pi.readProviderStates()).toContainEqual({
|
|
105
|
-
providerId: "openai-codex",
|
|
106
|
-
status: "READY",
|
|
107
|
-
accountHint: "test…1234",
|
|
108
|
-
});
|
|
109
|
-
expect(await pi.readAvailableModels()).toEqual([
|
|
110
|
-
expect.objectContaining({ providerId: "openai-codex", modelId: "gpt-5.6-codex" }),
|
|
111
|
-
expect.objectContaining({
|
|
112
|
-
providerId: "openai-codex",
|
|
113
|
-
modelId: "gpt-5.6-chat",
|
|
114
|
-
allowedThinkingLevels: ["off"],
|
|
115
|
-
}),
|
|
116
|
-
]);
|
|
117
|
-
await pi.login("anthropic");
|
|
118
|
-
expect(await pi.readProviderStates()).toContainEqual({
|
|
119
|
-
providerId: "anthropic",
|
|
120
|
-
status: "READY",
|
|
121
|
-
accountHint: null,
|
|
122
|
-
});
|
|
123
|
-
await pi.logout("openai-codex");
|
|
124
|
-
await pi.logout("anthropic");
|
|
125
|
-
expect(await readJson(paths().providerAuth)).toEqual({});
|
|
126
|
-
});
|
|
127
|
-
it("生产 Pi 门面只投影已认证 Provider 的非敏感模型元数据", async () => {
|
|
128
|
-
await isolatedHome();
|
|
129
|
-
let loggedOut = "";
|
|
130
|
-
let runtimeOptions;
|
|
131
|
-
const runtime = {
|
|
132
|
-
login: async () => undefined,
|
|
133
|
-
logout: async (providerId) => {
|
|
134
|
-
loggedOut = providerId;
|
|
135
|
-
},
|
|
136
|
-
getAvailable: async () => [
|
|
137
|
-
{
|
|
138
|
-
provider: "openai-codex",
|
|
139
|
-
id: "gpt-local",
|
|
140
|
-
input: ["text", "image"],
|
|
141
|
-
name: "GPT Local",
|
|
142
|
-
reasoning: false,
|
|
143
|
-
},
|
|
144
|
-
{ provider: "google", id: "hidden", name: "Hidden", reasoning: false },
|
|
145
|
-
],
|
|
146
|
-
};
|
|
147
|
-
const runtimeMock = vi.spyOn(ModelRuntime, "create").mockImplementation(async (options) => {
|
|
148
|
-
runtimeOptions = options;
|
|
149
|
-
return {
|
|
150
|
-
...runtime,
|
|
151
|
-
getAuth: async () => ({ auth: { apiKey: "test-only" } }),
|
|
152
|
-
refresh: async () => ({ errors: new Map() }),
|
|
153
|
-
};
|
|
154
|
-
});
|
|
155
|
-
try {
|
|
156
|
-
await writeSecureJson(paths().providerAuth, {
|
|
157
|
-
"openai-codex": {
|
|
158
|
-
type: "oauth",
|
|
159
|
-
access: "hidden",
|
|
160
|
-
refresh: "hidden",
|
|
161
|
-
expires: Date.now() + 60_000,
|
|
162
|
-
accountId: "acct-1234567890",
|
|
163
|
-
},
|
|
164
|
-
anthropic: {
|
|
165
|
-
type: "oauth",
|
|
166
|
-
access: "hidden",
|
|
167
|
-
refresh: "hidden",
|
|
168
|
-
expires: Date.now() + 60_000,
|
|
169
|
-
},
|
|
170
|
-
});
|
|
171
|
-
const pi = new ProductionPiModelService();
|
|
172
|
-
await expect(pi.login("openai-codex", "remote")).resolves.toEqual({
|
|
173
|
-
code: "PROVIDER_LOGIN_SUCCEEDED",
|
|
174
|
-
});
|
|
175
|
-
await expect(pi.readProviderStates()).resolves.toEqual([
|
|
176
|
-
{ providerId: "openai-codex", status: "READY", accountHint: "acct…7890" },
|
|
177
|
-
{ providerId: "anthropic", status: "READY", accountHint: null },
|
|
178
|
-
]);
|
|
179
|
-
await expect(pi.readAvailableModels()).resolves.toEqual([
|
|
180
|
-
{
|
|
181
|
-
providerId: "openai-codex",
|
|
182
|
-
modelId: "gpt-local",
|
|
183
|
-
displayName: "GPT Local",
|
|
184
|
-
supportsImages: true,
|
|
185
|
-
reasoning: false,
|
|
186
|
-
allowedThinkingLevels: ["off"],
|
|
187
|
-
thinkingLevelAdaptations: {
|
|
188
|
-
off: "off",
|
|
189
|
-
minimal: "off",
|
|
190
|
-
low: "off",
|
|
191
|
-
medium: "off",
|
|
192
|
-
high: "off",
|
|
193
|
-
xhigh: "off",
|
|
194
|
-
max: "off",
|
|
195
|
-
},
|
|
196
|
-
},
|
|
197
|
-
]);
|
|
198
|
-
expect(runtimeOptions).toMatchObject({
|
|
199
|
-
credentials: expect.any(FileCredentialStore),
|
|
200
|
-
modelsStore: expect.any(FileModelsStore),
|
|
201
|
-
});
|
|
202
|
-
await pi.logout("openai-codex");
|
|
203
|
-
expect(loggedOut).toBe("openai-codex");
|
|
204
|
-
await writeSecureJson(paths().providerAuth, {
|
|
205
|
-
"openai-codex": { type: "oauth", expires: Date.now() - 1 },
|
|
206
|
-
});
|
|
207
|
-
await expect(pi.readProviderStates()).resolves.toContainEqual({
|
|
208
|
-
providerId: "openai-codex",
|
|
209
|
-
status: "READY",
|
|
210
|
-
accountHint: null,
|
|
211
|
-
});
|
|
212
|
-
await expect(pi.readAvailableModels()).resolves.toEqual([
|
|
213
|
-
expect.objectContaining({ providerId: "openai-codex", modelId: "gpt-local" }),
|
|
214
|
-
]);
|
|
215
|
-
await writeFile(paths().providerAuth, "not-json", { mode: 0o600 });
|
|
216
|
-
await expect(pi.readProviderStates()).resolves.toEqual([
|
|
217
|
-
{ providerId: "openai-codex", status: "ERROR", accountHint: null },
|
|
218
|
-
{ providerId: "anthropic", status: "ERROR", accountHint: null },
|
|
219
|
-
]);
|
|
220
|
-
await expect(pi.login("google", "local")).rejects.toThrow("PROVIDER_NOT_SUPPORTED");
|
|
221
|
-
}
|
|
222
|
-
finally {
|
|
223
|
-
runtimeMock.mockRestore();
|
|
224
|
-
}
|
|
225
|
-
});
|
|
226
|
-
it("远程 OpenAI 登录只自动选择 Pi 的 browser 分支并拒绝敏感或未知交互", async () => {
|
|
227
|
-
await isolatedHome();
|
|
228
|
-
let promptKind = "openai";
|
|
229
|
-
const runtime = {
|
|
230
|
-
login: async (_providerId, _method, interaction) => {
|
|
231
|
-
if (promptKind === "openai") {
|
|
232
|
-
await expect(interaction.prompt({
|
|
233
|
-
type: "select",
|
|
234
|
-
message: "Select OpenAI Codex login method:",
|
|
235
|
-
options: [
|
|
236
|
-
{ id: "browser", label: "Browser login (default)" },
|
|
237
|
-
{ id: "device_code", label: "Device code login (headless)" },
|
|
238
|
-
],
|
|
239
|
-
})).resolves.toBe("browser");
|
|
240
|
-
const manualAbort = new AbortController();
|
|
241
|
-
const callbackWait = interaction.prompt({
|
|
242
|
-
type: "manual_code",
|
|
243
|
-
message: "Complete login in your browser, or paste the authorization code / redirect URL here:",
|
|
244
|
-
placeholder: "http://localhost:1455/auth/callback",
|
|
245
|
-
signal: manualAbort.signal,
|
|
246
|
-
});
|
|
247
|
-
manualAbort.abort();
|
|
248
|
-
await expect(callbackWait).resolves.toBe("");
|
|
249
|
-
return;
|
|
250
|
-
}
|
|
251
|
-
if (promptKind === "secret") {
|
|
252
|
-
await interaction.prompt({ type: "secret", message: "Paste token" });
|
|
253
|
-
return;
|
|
254
|
-
}
|
|
255
|
-
if (promptKind === "manual") {
|
|
256
|
-
await interaction.prompt({
|
|
257
|
-
type: "manual_code",
|
|
258
|
-
message: "Paste a code",
|
|
259
|
-
placeholder: "https://unknown.example/callback",
|
|
260
|
-
signal: new AbortController().signal,
|
|
261
|
-
});
|
|
262
|
-
return;
|
|
263
|
-
}
|
|
264
|
-
await interaction.prompt({
|
|
265
|
-
type: "select",
|
|
266
|
-
message: "Choose an account",
|
|
267
|
-
options: [
|
|
268
|
-
{ id: "personal", label: "Personal" },
|
|
269
|
-
{ id: "team", label: "Team" },
|
|
270
|
-
],
|
|
271
|
-
signal: new AbortController().signal,
|
|
272
|
-
});
|
|
273
|
-
},
|
|
274
|
-
};
|
|
275
|
-
const runtimeMock = vi
|
|
276
|
-
.spyOn(ModelRuntime, "create")
|
|
277
|
-
.mockResolvedValue({ ...runtime, refresh: async () => ({ errors: new Map() }) });
|
|
278
|
-
try {
|
|
279
|
-
const pi = new ProductionPiModelService();
|
|
280
|
-
await expect(pi.login("openai-codex", "remote")).resolves.toEqual({
|
|
281
|
-
code: "PROVIDER_LOGIN_SUCCEEDED",
|
|
282
|
-
});
|
|
283
|
-
promptKind = "secret";
|
|
284
|
-
await expect(pi.login("openai-codex", "remote")).rejects.toThrow("UNSUPPORTED_PROVIDER_INTERACTION");
|
|
285
|
-
promptKind = "manual";
|
|
286
|
-
await expect(pi.login("openai-codex", "remote")).rejects.toThrow("LOCAL_INTERACTION_REQUIRED");
|
|
287
|
-
promptKind = "unknown";
|
|
288
|
-
await expect(pi.login("openai-codex", "remote")).rejects.toThrow("LOCAL_INTERACTION_REQUIRED");
|
|
289
|
-
}
|
|
290
|
-
finally {
|
|
291
|
-
runtimeMock.mockRestore();
|
|
292
|
-
}
|
|
293
|
-
});
|
|
294
|
-
it("生产模型目录保留可续期 OAuth 模型且不读取全局 models.json", async () => {
|
|
295
|
-
const root = await isolatedHome();
|
|
296
|
-
const ambientHome = join(root, "ambient-home");
|
|
297
|
-
const originalHome = process.env.HOME;
|
|
298
|
-
process.env.HOME = ambientHome;
|
|
299
|
-
await mkdir(join(ambientHome, ".pi", "agent"), { recursive: true });
|
|
300
|
-
await writeFile(join(ambientHome, ".pi", "agent", "models.json"), JSON.stringify({ providers: { "ambient-provider": { api: "openai" } } }));
|
|
301
|
-
await writeSecureJson(paths().providerAuth, {
|
|
302
|
-
"openai-codex": { type: "oauth", expires: Date.now() - 1 },
|
|
303
|
-
anthropic: { type: "oauth", expires: Date.now() + 60_000 },
|
|
304
|
-
});
|
|
305
|
-
const runtimeMock = vi.spyOn(ModelRuntime, "create").mockResolvedValue({
|
|
306
|
-
refresh: async () => ({ errors: new Map() }),
|
|
307
|
-
getAvailable: async () => [
|
|
308
|
-
{
|
|
309
|
-
provider: "openai-codex",
|
|
310
|
-
id: "expired",
|
|
311
|
-
name: "Expired",
|
|
312
|
-
reasoning: false,
|
|
313
|
-
input: ["text"],
|
|
314
|
-
},
|
|
315
|
-
{ provider: "anthropic", id: "ready", name: "Ready", reasoning: false, input: ["text"] },
|
|
316
|
-
{ provider: "ambient-provider", id: "leaked", name: "Leaked", reasoning: false },
|
|
317
|
-
],
|
|
318
|
-
});
|
|
319
|
-
try {
|
|
320
|
-
await expect(new ProductionPiModelService().readAvailableModels()).resolves.toEqual([
|
|
321
|
-
expect.objectContaining({ providerId: "openai-codex", modelId: "expired" }),
|
|
322
|
-
expect.objectContaining({ providerId: "anthropic", modelId: "ready" }),
|
|
323
|
-
]);
|
|
324
|
-
}
|
|
325
|
-
finally {
|
|
326
|
-
runtimeMock.mockRestore();
|
|
327
|
-
if (originalHome === undefined)
|
|
328
|
-
delete process.env.HOME;
|
|
329
|
-
else
|
|
330
|
-
process.env.HOME = originalHome;
|
|
331
|
-
}
|
|
332
|
-
});
|
|
333
|
-
it.runIf(process.platform === "darwin")("诊断只返回稳定检查和动作,不返回本机路径", async () => {
|
|
334
|
-
await isolatedHome();
|
|
335
|
-
await writeValidRuntime();
|
|
336
|
-
await writeDeviceAuth({
|
|
337
|
-
platformUrl: "http://127.0.0.1:3000",
|
|
338
|
-
deviceToken: "hidden",
|
|
339
|
-
expiresAt: new Date(Date.now() + 60_000).toISOString(),
|
|
340
|
-
user: { id: "u1", username: "tester" },
|
|
341
|
-
});
|
|
342
|
-
await writeSecureJson(paths().daemonState, {
|
|
343
|
-
pid: process.pid,
|
|
344
|
-
profile: "default",
|
|
345
|
-
root: paths().root,
|
|
346
|
-
});
|
|
347
|
-
process.env.AIP_LAUNCH_AGENT_DIR = join(paths().root, "LaunchAgents");
|
|
348
|
-
const definition = launchAgentDefinition(paths().runtimeCurrent);
|
|
349
|
-
await mkdir(definition.launchDir, { recursive: true });
|
|
350
|
-
await writeFile(definition.plist, definition.xml);
|
|
351
|
-
const launchctlCalls = [];
|
|
352
|
-
const checks = await runDiagnostics({
|
|
353
|
-
platformReachable: true,
|
|
354
|
-
deviceCredentialValid: true,
|
|
355
|
-
generationValid: true,
|
|
356
|
-
defaultModelValid: true,
|
|
357
|
-
providerReady: true,
|
|
358
|
-
}, {
|
|
359
|
-
captureCommand: async (command, args) => {
|
|
360
|
-
launchctlCalls.push([command, ...args]);
|
|
361
|
-
return {
|
|
362
|
-
code: 0,
|
|
363
|
-
output: `${join(paths().runtimeCurrent, "bin", "node")} ${join(paths().runtimeCurrent, "app", "dist", "daemon.js")} ${paths().root}`,
|
|
364
|
-
};
|
|
365
|
-
},
|
|
366
|
-
});
|
|
367
|
-
expect(checks).toHaveLength(11);
|
|
368
|
-
expect(checks.every((check) => check.status === "PASS")).toBe(true);
|
|
369
|
-
expect(JSON.stringify(checks)).not.toContain(home);
|
|
370
|
-
expect(launchctlCalls).toEqual([
|
|
371
|
-
["launchctl", "print", `${definition.domain}/${definition.label}`],
|
|
372
|
-
]);
|
|
373
|
-
await chmod(paths().deviceAuth, 0o644);
|
|
374
|
-
expect((await runDiagnostics({
|
|
375
|
-
platformReachable: false,
|
|
376
|
-
deviceCredentialValid: false,
|
|
377
|
-
generationValid: false,
|
|
378
|
-
defaultModelValid: false,
|
|
379
|
-
providerReady: false,
|
|
380
|
-
})).find((check) => check.id === "DEVICE_CREDENTIAL")?.code).toBe("DEVICE_CREDENTIAL_PERMISSION_INVALID");
|
|
381
|
-
});
|
|
382
|
-
it.runIf(process.platform === "darwin").each(["default", "local"])("后台诊断忽略终端与安装时 PATH 差异但校验 %s 服务身份", async (profile) => {
|
|
383
|
-
await isolatedHome();
|
|
384
|
-
process.env.AIP_PROFILE = profile;
|
|
385
|
-
process.env.AIP_LAUNCH_AGENT_DIR = join(paths().root, "LaunchAgents");
|
|
386
|
-
const previousPath = process.env.PATH;
|
|
387
|
-
try {
|
|
388
|
-
process.env.PATH = "/opt/tools & cli:/usr/bin";
|
|
389
|
-
const definition = launchAgentDefinition(paths().runtimeCurrent);
|
|
390
|
-
await mkdir(definition.launchDir, { recursive: true });
|
|
391
|
-
await writeFile(definition.plist, definition.xml);
|
|
392
|
-
await writeSecureJson(paths().daemonState, {
|
|
393
|
-
pid: process.pid,
|
|
394
|
-
profile,
|
|
395
|
-
root: paths().root,
|
|
396
|
-
});
|
|
397
|
-
process.env.PATH = runtimePath("/another/terminal/bin:/usr/bin", join(paths().runtimeCurrent, "bin/node"));
|
|
398
|
-
const loaded = `${join(paths().runtimeCurrent, "bin/node")} ${join(paths().runtimeCurrent, "app/dist/daemon.js")} ${paths().root}`;
|
|
399
|
-
const check = async (output = loaded) => (await runDiagnostics({
|
|
400
|
-
platformReachable: true,
|
|
401
|
-
deviceCredentialValid: true,
|
|
402
|
-
generationValid: true,
|
|
403
|
-
defaultModelValid: true,
|
|
404
|
-
providerReady: true,
|
|
405
|
-
}, { captureCommand: async () => ({ code: 0, output }) })).find((entry) => entry.id === "BACKGROUND_SERVICE");
|
|
406
|
-
expect((await check())?.status).toBe("PASS");
|
|
407
|
-
expect((await check("different runtime"))?.status).toBe("FAIL");
|
|
408
|
-
for (const invalid of [
|
|
409
|
-
definition.xml.replace("<key>AIP_PROFILE</key><string>" + profile, "<key>AIP_PROFILE</key><string>other"),
|
|
410
|
-
definition.xml.replace("<key>AIP_HOME</key><string>", "<key>AIP_HOME</key><string>/wrong"),
|
|
411
|
-
definition.xml.replace("app/dist/daemon.js", "app/dist/other.js"),
|
|
412
|
-
definition.xml.replace(/<key>PATH<\/key><string>[^<]*<\/string>/u, ""),
|
|
413
|
-
]) {
|
|
414
|
-
await writeFile(definition.plist, invalid);
|
|
415
|
-
expect((await check())?.status).toBe("FAIL");
|
|
416
|
-
}
|
|
417
|
-
await writeFile(definition.plist, definition.xml);
|
|
418
|
-
await writeSecureJson(paths().daemonState, {
|
|
419
|
-
pid: 2147483647,
|
|
420
|
-
profile,
|
|
421
|
-
root: paths().root,
|
|
422
|
-
});
|
|
423
|
-
expect((await check())?.status).toBe("FAIL");
|
|
424
|
-
}
|
|
425
|
-
finally {
|
|
426
|
-
if (previousPath === undefined)
|
|
427
|
-
delete process.env.PATH;
|
|
428
|
-
else
|
|
429
|
-
process.env.PATH = previousPath;
|
|
430
|
-
}
|
|
431
|
-
});
|
|
432
|
-
it.runIf(process.platform === "darwin")("LaunchAgent 未加载时后台服务诊断失败", async () => {
|
|
433
|
-
await isolatedHome();
|
|
434
|
-
await writeSecureJson(paths().daemonState, {
|
|
435
|
-
pid: process.pid,
|
|
436
|
-
profile: "default",
|
|
437
|
-
root: paths().root,
|
|
438
|
-
});
|
|
439
|
-
process.env.AIP_LAUNCH_AGENT_DIR = join(paths().root, "LaunchAgents");
|
|
440
|
-
const definition = launchAgentDefinition(paths().runtimeCurrent);
|
|
441
|
-
await mkdir(definition.launchDir, { recursive: true });
|
|
442
|
-
await writeFile(definition.plist, definition.xml);
|
|
443
|
-
const checks = await runDiagnostics({
|
|
444
|
-
platformReachable: true,
|
|
445
|
-
deviceCredentialValid: true,
|
|
446
|
-
generationValid: true,
|
|
447
|
-
defaultModelValid: true,
|
|
448
|
-
providerReady: true,
|
|
449
|
-
}, { captureCommand: async () => ({ code: 1, output: "" }) });
|
|
450
|
-
expect(checks.find((check) => check.id === "BACKGROUND_SERVICE")).toEqual({
|
|
451
|
-
id: "BACKGROUND_SERVICE",
|
|
452
|
-
status: "FAIL",
|
|
453
|
-
code: "BACKGROUND_SERVICE_STOPPED",
|
|
454
|
-
nextAction: "执行 aip host restart",
|
|
455
|
-
});
|
|
456
|
-
});
|
|
457
|
-
it("默认工作根目录被文件占用时返回稳定故障,不尝试其他目录", async () => {
|
|
458
|
-
await isolatedHome();
|
|
459
|
-
await mkdir(paths().root, { recursive: true });
|
|
460
|
-
await writeFile(paths().workspaceRoot, "occupied");
|
|
461
|
-
const checks = await runDiagnostics({
|
|
462
|
-
platformReachable: true,
|
|
463
|
-
deviceCredentialValid: true,
|
|
464
|
-
generationValid: true,
|
|
465
|
-
defaultModelValid: true,
|
|
466
|
-
providerReady: true,
|
|
467
|
-
});
|
|
468
|
-
expect(checks.find((check) => check.id === "WORKSPACE_ROOT")).toEqual({
|
|
469
|
-
id: "WORKSPACE_ROOT",
|
|
470
|
-
status: "FAIL",
|
|
471
|
-
code: "WORKSPACE_ROOT_UNAVAILABLE",
|
|
472
|
-
nextAction: "修复 ~/.aip/profiles/default/workspaces 目录权限",
|
|
473
|
-
});
|
|
474
|
-
});
|
|
475
|
-
it("Runtime 文件摘要损坏且设备凭证过期时诊断失败", async () => {
|
|
476
|
-
await isolatedHome();
|
|
477
|
-
await writeValidRuntime();
|
|
478
|
-
await writeFile(join(paths().runtimeCurrent, "payload.txt"), "tampered");
|
|
479
|
-
await writeDeviceAuth({
|
|
480
|
-
platformUrl: "http://127.0.0.1:3000",
|
|
481
|
-
deviceToken: "hidden",
|
|
482
|
-
expiresAt: new Date(Date.now() - 1).toISOString(),
|
|
483
|
-
user: { id: "u1", username: "tester" },
|
|
484
|
-
});
|
|
485
|
-
const checks = await runDiagnostics({
|
|
486
|
-
platformReachable: true,
|
|
487
|
-
deviceCredentialValid: true,
|
|
488
|
-
generationValid: false,
|
|
489
|
-
defaultModelValid: false,
|
|
490
|
-
providerReady: false,
|
|
491
|
-
});
|
|
492
|
-
expect(checks.find((check) => check.id === "RUNTIME_INTEGRITY")?.status).toBe("FAIL");
|
|
493
|
-
expect(checks.find((check) => check.id === "DEVICE_CREDENTIAL")?.code).toBe("DEVICE_CREDENTIAL_EXPIRED");
|
|
494
|
-
});
|
|
495
|
-
it("已校验安装包的页面诊断检查启动文件,损坏时仍报告失败", async () => {
|
|
496
|
-
await isolatedHome();
|
|
497
|
-
const root = paths().runtimeCurrent;
|
|
498
|
-
const criticalPaths = [
|
|
499
|
-
process.platform === "win32" ? "bin/node.exe" : "bin/node",
|
|
500
|
-
"app/dist/cli.js",
|
|
501
|
-
"app/dist/daemon.js",
|
|
502
|
-
"app/dist/diagnostics.js",
|
|
503
|
-
"app/dist/installer.js",
|
|
504
|
-
"app/dist/self-check.js",
|
|
505
|
-
];
|
|
506
|
-
const files = [];
|
|
507
|
-
for (const path of criticalPaths) {
|
|
508
|
-
const target = join(root, path);
|
|
509
|
-
await mkdir(dirname(target), { recursive: true });
|
|
510
|
-
await writeFile(target, path);
|
|
511
|
-
files.push({ path, sha256: createHash("sha256").update(path).digest("hex") });
|
|
512
|
-
}
|
|
513
|
-
await writeFile(join(root, ".archive-sha256"), "a".repeat(64));
|
|
514
|
-
await writeFile(join(root, "runtime-manifest.json"), JSON.stringify({
|
|
515
|
-
version: "0.0.6",
|
|
516
|
-
platform: process.platform,
|
|
517
|
-
arch: runtimeArchitecture(),
|
|
518
|
-
files,
|
|
519
|
-
}));
|
|
520
|
-
const options = {
|
|
521
|
-
platformReachable: true,
|
|
522
|
-
deviceCredentialValid: true,
|
|
523
|
-
generationValid: true,
|
|
524
|
-
defaultModelValid: true,
|
|
525
|
-
providerReady: true,
|
|
526
|
-
runtimeVerification: "installed-package",
|
|
527
|
-
};
|
|
528
|
-
expect((await runDiagnostics(options)).find((check) => check.id === "RUNTIME_INTEGRITY")?.status).toBe("PASS");
|
|
529
|
-
await writeFile(join(root, "app/dist/daemon.js"), "tampered");
|
|
530
|
-
expect((await runDiagnostics(options)).find((check) => check.id === "RUNTIME_INTEGRITY")?.status).toBe("FAIL");
|
|
531
|
-
});
|
|
532
|
-
it("按平台保存的模型与思考级别验证默认配置", () => {
|
|
533
|
-
const models = [
|
|
534
|
-
{
|
|
535
|
-
providerId: "openai-codex",
|
|
536
|
-
modelId: "gpt-test",
|
|
537
|
-
displayName: "GPT Test",
|
|
538
|
-
reasoning: true,
|
|
539
|
-
allowedThinkingLevels: ["low", "high"],
|
|
540
|
-
},
|
|
541
|
-
];
|
|
542
|
-
expect(isDefaultModelValid({ providerId: "openai-codex", modelId: "gpt-test", thinkingLevel: "high" }, models.map((model) => ({
|
|
543
|
-
...model,
|
|
544
|
-
allowedThinkingLevels: [...model.allowedThinkingLevels],
|
|
545
|
-
})))).toBe(true);
|
|
546
|
-
expect(isDefaultModelValid({ providerId: "openai-codex", modelId: "gpt-test", thinkingLevel: "medium" }, models.map((model) => ({
|
|
547
|
-
...model,
|
|
548
|
-
allowedThinkingLevels: [...model.allowedThinkingLevels],
|
|
549
|
-
})))).toBe(false);
|
|
550
|
-
});
|
|
551
|
-
});
|
|
552
|
-
async function writeValidRuntime() {
|
|
553
|
-
await mkdir(paths().runtimeCurrent, { recursive: true });
|
|
554
|
-
const payload = Buffer.from("runtime-ok");
|
|
555
|
-
await writeFile(join(paths().runtimeCurrent, "payload.txt"), payload);
|
|
556
|
-
await writeFile(join(paths().runtimeCurrent, "runtime-manifest.json"), `${JSON.stringify({
|
|
557
|
-
version: "0.0.2",
|
|
558
|
-
platform: process.platform,
|
|
559
|
-
arch: runtimeArchitecture(),
|
|
560
|
-
files: [{ path: "payload.txt", sha256: createHash("sha256").update(payload).digest("hex") }],
|
|
561
|
-
})}\n`);
|
|
562
|
-
}
|
|
563
|
-
describe("PlatformClient", () => {
|
|
564
|
-
it("使用独立 Device scheme 并保留稳定业务错误码", async () => {
|
|
565
|
-
const received = [];
|
|
566
|
-
const server = createServer((request, response) => {
|
|
567
|
-
received.push(`${request.method} ${request.url}`);
|
|
568
|
-
if (request.url !== "/failed") {
|
|
569
|
-
response.setHeader("content-type", "application/json");
|
|
570
|
-
response.end(JSON.stringify({ authorization: request.headers.authorization }));
|
|
571
|
-
}
|
|
572
|
-
else {
|
|
573
|
-
response.statusCode = 409;
|
|
574
|
-
response.setHeader("content-type", "application/json");
|
|
575
|
-
response.end(JSON.stringify({ code: "HOST_FENCED", message: "fenced" }));
|
|
576
|
-
}
|
|
577
|
-
});
|
|
578
|
-
await new Promise((resolve) => server.listen(0, "127.0.0.1", resolve));
|
|
579
|
-
const address = server.address();
|
|
580
|
-
if (!address || typeof address === "string")
|
|
581
|
-
throw new Error("server address missing");
|
|
582
|
-
const client = new PlatformClient(`http://127.0.0.1:${address.port}`, "device-value");
|
|
583
|
-
try {
|
|
584
|
-
await expect(client.request("/ok")).resolves.toEqual({
|
|
585
|
-
authorization: "Device device-value",
|
|
586
|
-
});
|
|
587
|
-
await expect(client.request("/failed")).rejects.toMatchObject({
|
|
588
|
-
status: 409,
|
|
589
|
-
code: "HOST_FENCED",
|
|
590
|
-
});
|
|
591
|
-
await client.register({
|
|
592
|
-
fingerprint: "fingerprint",
|
|
593
|
-
hostName: "Mac",
|
|
594
|
-
os: "darwin",
|
|
595
|
-
arch: "arm64",
|
|
596
|
-
cliVersion: "0.1.0",
|
|
597
|
-
runtimeVersion: "0.1.0",
|
|
598
|
-
});
|
|
599
|
-
await client.heartbeat({
|
|
600
|
-
hostId: "h1",
|
|
601
|
-
generation: 1,
|
|
602
|
-
bootId: "00000000-0000-4000-8000-000000000001",
|
|
603
|
-
});
|
|
604
|
-
await client.verify({ hostId: "h1", generation: 1 });
|
|
605
|
-
await client.reportStatus({
|
|
606
|
-
hostId: "h1",
|
|
607
|
-
generation: 1,
|
|
608
|
-
workspaceRootStatus: "PASS",
|
|
609
|
-
catalogRevision: 1,
|
|
610
|
-
providers: [],
|
|
611
|
-
models: [],
|
|
612
|
-
});
|
|
613
|
-
await client.completeCommand("c1", {
|
|
614
|
-
hostId: "h1",
|
|
615
|
-
generation: 1,
|
|
616
|
-
status: "SUCCEEDED",
|
|
617
|
-
resultCode: "COMMAND_SUCCEEDED",
|
|
618
|
-
result: {},
|
|
619
|
-
});
|
|
620
|
-
expect(received).toEqual(expect.arrayContaining([
|
|
621
|
-
"POST /api/v1/local-coding-host/registration",
|
|
622
|
-
"POST /api/v1/local-coding-host/heartbeat",
|
|
623
|
-
"POST /api/v1/local-coding-host/verification",
|
|
624
|
-
"PUT /api/v1/local-coding-host/status",
|
|
625
|
-
"PUT /api/v1/local-coding-host/commands/c1/result",
|
|
626
|
-
]));
|
|
627
|
-
}
|
|
628
|
-
finally {
|
|
629
|
-
await new Promise((resolve) => server.close(() => resolve()));
|
|
630
|
-
}
|
|
631
|
-
});
|
|
632
|
-
});
|
|
633
|
-
describe("Windows 构建适配", () => {
|
|
634
|
-
it("后台任务只引用自包含 Runtime 的绝对路径", () => {
|
|
635
|
-
expect(windowsTaskDefinition("C:\\Users\\tester\\.aip\\runtime\\current", "C:\\Users\\tester\\.aip")).toMatchObject({
|
|
636
|
-
executable: expect.stringMatching(/powershell\.exe$/i),
|
|
637
|
-
arguments: expect.arrayContaining([
|
|
638
|
-
"-WindowStyle",
|
|
639
|
-
"Hidden",
|
|
640
|
-
"C:\\Users\\tester\\.aip\\profiles\\default\\bin\\host-daemon.ps1",
|
|
641
|
-
]),
|
|
642
|
-
environment: { AIP_HOME: "C:\\Users\\tester\\.aip", AIP_PROFILE: "default" },
|
|
643
|
-
});
|
|
644
|
-
});
|
|
645
|
-
});
|
|
646
|
-
describe("Host 心跳与状态降级", () => {
|
|
647
|
-
it("每次 daemon 进程启动都用新的 boot generation 心跳", async () => {
|
|
648
|
-
await isolatedHome();
|
|
649
|
-
const requests = [];
|
|
650
|
-
const server = await hostServer(requests);
|
|
651
|
-
try {
|
|
652
|
-
await prepareDaemonState(server);
|
|
653
|
-
process.env.AIP_TEST_PI = "1";
|
|
654
|
-
const unrelatedPi = join(paths().base, "unrelated-pi");
|
|
655
|
-
const credential = (access) => ({
|
|
656
|
-
"openai-codex": {
|
|
657
|
-
type: "oauth",
|
|
658
|
-
access,
|
|
659
|
-
refresh: "unused",
|
|
660
|
-
expires: Date.now() + 3600_000,
|
|
661
|
-
},
|
|
662
|
-
});
|
|
663
|
-
await writeSecureJson(join(unrelatedPi, "auth.json"), credential("unrelated-account"));
|
|
664
|
-
await writeSecureJson(paths().providerAuth, credential("host-account"));
|
|
665
|
-
vi.stubEnv("PI_CODING_AGENT_DIR", unrelatedPi);
|
|
666
|
-
await runDaemon({ once: true });
|
|
667
|
-
expect(process.env.PI_CODING_AGENT_DIR).toBe(paths().piAgent);
|
|
668
|
-
const childRuntime = await ModelRuntime.create({ refreshOnCreate: false });
|
|
669
|
-
expect((await childRuntime.getAuth("openai-codex"))?.auth.apiKey).toBe("host-account");
|
|
670
|
-
await runDaemon({ once: true });
|
|
671
|
-
const heartbeats = requests.filter((request) => request.path === "/api/v1/local-coding-host/heartbeat");
|
|
672
|
-
expect(heartbeats).toHaveLength(2);
|
|
673
|
-
expect(heartbeats[0]?.body.bootId).toMatch(/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/u);
|
|
674
|
-
expect(heartbeats[1]?.body.bootId).not.toBe(heartbeats[0]?.body.bootId);
|
|
675
|
-
await expect(readJson(paths().daemonState)).resolves.toMatchObject({
|
|
676
|
-
bootId: heartbeats[1]?.body.bootId,
|
|
677
|
-
});
|
|
678
|
-
}
|
|
679
|
-
finally {
|
|
680
|
-
await new Promise((resolve) => server.close(() => resolve()));
|
|
681
|
-
}
|
|
682
|
-
});
|
|
683
|
-
it("工作目录异常仍先心跳并上报未就绪事实", async () => {
|
|
684
|
-
await isolatedHome();
|
|
685
|
-
const requests = [];
|
|
686
|
-
const server = await hostServer(requests);
|
|
687
|
-
try {
|
|
688
|
-
await prepareDaemonState(server);
|
|
689
|
-
await mkdir(paths().root, { recursive: true });
|
|
690
|
-
await writeFile(paths().workspaceRoot, "occupied");
|
|
691
|
-
process.env.AIP_TEST_PI = "1";
|
|
692
|
-
await runDaemon({ once: true });
|
|
693
|
-
expect(requests.map((request) => request.path)).toEqual([
|
|
694
|
-
"/api/v1/local-coding-host/heartbeat",
|
|
695
|
-
"/api/v1/local-coding-host/verification",
|
|
696
|
-
"/api/v1/local-coding-host/status",
|
|
697
|
-
"/api/v1/local-coding-host/general-runs:claim",
|
|
698
|
-
]);
|
|
699
|
-
expect(requests[2]?.body.workspaceRootStatus).toBe("FAIL");
|
|
700
|
-
}
|
|
701
|
-
finally {
|
|
702
|
-
await new Promise((resolve) => server.close(() => resolve()));
|
|
703
|
-
}
|
|
704
|
-
});
|
|
705
|
-
it("状态上报失败不阻断已经发送的心跳", async () => {
|
|
706
|
-
await isolatedHome();
|
|
707
|
-
const requests = [];
|
|
708
|
-
const server = await hostServer(requests, true);
|
|
709
|
-
try {
|
|
710
|
-
await prepareDaemonState(server);
|
|
711
|
-
process.env.AIP_TEST_PI = "1";
|
|
712
|
-
await expect(runDaemon({ once: true })).rejects.toMatchObject({ code: "STATUS_REJECTED" });
|
|
713
|
-
expect(requests.map((request) => request.path)).toEqual([
|
|
714
|
-
"/api/v1/local-coding-host/heartbeat",
|
|
715
|
-
"/api/v1/local-coding-host/verification",
|
|
716
|
-
"/api/v1/local-coding-host/status",
|
|
717
|
-
]);
|
|
718
|
-
}
|
|
719
|
-
finally {
|
|
720
|
-
await new Promise((resolve) => server.close(() => resolve()));
|
|
721
|
-
}
|
|
722
|
-
});
|
|
723
|
-
it("Pi 模型目录异常时仍发送心跳,不用空列表覆盖已有目录", async () => {
|
|
724
|
-
await isolatedHome();
|
|
725
|
-
const requests = [];
|
|
726
|
-
const server = await hostServer(requests);
|
|
727
|
-
try {
|
|
728
|
-
await prepareDaemonState(server);
|
|
729
|
-
process.env.AIP_TEST_PI = "1";
|
|
730
|
-
await new TestPiModelService().login("openai-codex");
|
|
731
|
-
process.env.AIP_TEST_PI_CATALOG_ERROR = "1";
|
|
732
|
-
await expect(runDaemon({ once: true })).rejects.toThrow("TEST_CATALOG_ERROR");
|
|
733
|
-
expect(requests.map((request) => request.path)).toEqual([
|
|
734
|
-
"/api/v1/local-coding-host/heartbeat",
|
|
735
|
-
]);
|
|
736
|
-
}
|
|
737
|
-
finally {
|
|
738
|
-
await new Promise((resolve) => server.close(() => resolve()));
|
|
739
|
-
}
|
|
740
|
-
});
|
|
741
|
-
});
|
|
742
|
-
async function hostServer(requests, rejectStatus = false) {
|
|
743
|
-
const server = createServer(async (request, response) => {
|
|
744
|
-
let raw = "";
|
|
745
|
-
for await (const chunk of request)
|
|
746
|
-
raw += chunk.toString();
|
|
747
|
-
requests.push({ path: request.url ?? "", body: raw ? JSON.parse(raw) : {} });
|
|
748
|
-
response.setHeader("content-type", "application/json");
|
|
749
|
-
if (request.url === "/api/v1/local-coding-host/heartbeat") {
|
|
750
|
-
response.end(JSON.stringify({ command: null, nextHeartbeatSeconds: 20 }));
|
|
751
|
-
return;
|
|
752
|
-
}
|
|
753
|
-
if (request.url === "/api/v1/local-coding-host/verification") {
|
|
754
|
-
response.end(JSON.stringify({
|
|
755
|
-
generationValid: true,
|
|
756
|
-
shell: { name: "bash" },
|
|
757
|
-
toolConfigurationRevision: "test-revision",
|
|
758
|
-
}));
|
|
759
|
-
return;
|
|
760
|
-
}
|
|
761
|
-
if (rejectStatus) {
|
|
762
|
-
response.statusCode = 503;
|
|
763
|
-
response.end(JSON.stringify({ code: "STATUS_REJECTED", message: "status failed" }));
|
|
764
|
-
return;
|
|
765
|
-
}
|
|
766
|
-
response.end(JSON.stringify({ accepted: true }));
|
|
767
|
-
});
|
|
768
|
-
await new Promise((resolve) => server.listen(0, "127.0.0.1", resolve));
|
|
769
|
-
return server;
|
|
770
|
-
}
|
|
771
|
-
async function prepareDaemonState(server) {
|
|
772
|
-
const address = server.address();
|
|
773
|
-
if (!address || typeof address === "string")
|
|
774
|
-
throw new Error("server address missing");
|
|
775
|
-
await writeDeviceAuth({
|
|
776
|
-
platformUrl: `http://127.0.0.1:${address.port}`,
|
|
777
|
-
deviceToken: "local-test-value",
|
|
778
|
-
expiresAt: new Date(Date.now() + 60_000).toISOString(),
|
|
779
|
-
user: { id: "u1", username: "tester" },
|
|
780
|
-
});
|
|
781
|
-
await writeHostState({ ...hostIdentity(), hostId: "h1", generation: 1, catalogRevision: 0 });
|
|
782
|
-
}
|
|
783
|
-
describe("图片命令失败反馈", () => {
|
|
784
|
-
it.each([
|
|
785
|
-
[
|
|
786
|
-
new PlatformClientError(422, "IMAGE_ATTACHMENT_READ_FAILED", "图片读取失败"),
|
|
787
|
-
"IMAGE_ATTACHMENT_READ_FAILED",
|
|
788
|
-
"图片读取失败",
|
|
789
|
-
],
|
|
790
|
-
[new Error("MODEL_IMAGES_UNSUPPORTED"), "MODEL_IMAGES_UNSUPPORTED", "当前模型不支持图片"],
|
|
791
|
-
])("保留图片错误码并提供可识别提示 %s", async (error, code, summary) => {
|
|
792
|
-
const client = {
|
|
793
|
-
reportCodingTerminal: vi.fn().mockResolvedValue({}),
|
|
794
|
-
completeCommand: vi.fn().mockResolvedValue({}),
|
|
795
|
-
};
|
|
796
|
-
const coding = { execute: vi.fn().mockRejectedValue(error) };
|
|
797
|
-
const stderr = vi.spyOn(process.stderr, "write").mockReturnValue(true);
|
|
798
|
-
try {
|
|
799
|
-
await executeCommand(client, {}, coding, { hostId: "host", generation: 3 }, {
|
|
800
|
-
id: "command",
|
|
801
|
-
kind: "CODING_RUN_STEER",
|
|
802
|
-
run: { runId: "run", turnId: "turn", action: "STEER" },
|
|
803
|
-
});
|
|
804
|
-
expect(client.reportCodingTerminal).toHaveBeenCalledWith("run", expect.objectContaining({ failureCode: code, summary: expect.stringContaining(summary) }));
|
|
805
|
-
if (code === "IMAGE_ATTACHMENT_READ_FAILED")
|
|
806
|
-
expect(client.completeCommand.mock.invocationCallOrder[0]).toBeLessThan(client.reportCodingTerminal.mock.invocationCallOrder[0]);
|
|
807
|
-
expect(client.completeCommand).toHaveBeenCalledWith("command", expect.objectContaining({ status: "FAILED", resultCode: code }));
|
|
808
|
-
}
|
|
809
|
-
finally {
|
|
810
|
-
stderr.mockRestore();
|
|
811
|
-
}
|
|
812
|
-
});
|
|
813
|
-
});
|
|
814
|
-
it("图片失败命令持久化失败时不发布可恢复的终态", async () => {
|
|
815
|
-
const client = {
|
|
816
|
-
reportCodingTerminal: vi.fn(),
|
|
817
|
-
completeCommand: vi.fn().mockRejectedValue(new Error("PERSIST_FAILED")),
|
|
818
|
-
};
|
|
819
|
-
const coding = {
|
|
820
|
-
execute: vi
|
|
821
|
-
.fn()
|
|
822
|
-
.mockRejectedValue(new PlatformClientError(503, "IMAGE_ATTACHMENT_READ_FAILED", "图片读取失败")),
|
|
823
|
-
};
|
|
824
|
-
const stderr = vi.spyOn(process.stderr, "write").mockReturnValue(true);
|
|
825
|
-
try {
|
|
826
|
-
await expect(executeCommand(client, {}, coding, { hostId: "host", generation: 3 }, {
|
|
827
|
-
id: "command",
|
|
828
|
-
kind: "CODING_RUN_STEER",
|
|
829
|
-
run: { runId: "run", turnId: "turn", action: "STEER" },
|
|
830
|
-
})).rejects.toThrow("PERSIST_FAILED");
|
|
831
|
-
expect(client.reportCodingTerminal).not.toHaveBeenCalled();
|
|
832
|
-
}
|
|
833
|
-
finally {
|
|
834
|
-
stderr.mockRestore();
|
|
835
|
-
}
|
|
836
|
-
});
|
|
837
|
-
describe("QA 指令只回执接收,不宣称执行完成", () => {
|
|
838
|
-
it.each([
|
|
839
|
-
"TEST_RUN",
|
|
840
|
-
"TEST_RETRANSMIT",
|
|
841
|
-
"TEST_SESSION_START",
|
|
842
|
-
"TEST_SESSION_MESSAGE",
|
|
843
|
-
"TEST_SESSION_STOP",
|
|
844
|
-
])("%s 回执符合平台契约", async (kind) => {
|
|
845
|
-
const client = { completeCommand: vi.fn().mockResolvedValue({}) };
|
|
846
|
-
const manager = {
|
|
847
|
-
execute: vi.fn().mockResolvedValue({ executionId: "execution", accepted: true }),
|
|
848
|
-
};
|
|
849
|
-
await executeCommand(client, {}, {}, { hostId: "host", generation: 1, catalogRevision: 7 }, { id: "command", kind, test: { sessionId: "session" } }, manager, manager);
|
|
850
|
-
expect(manager.execute).toHaveBeenCalledExactlyOnceWith(client, { hostId: "host", generation: 1 }, expect.anything());
|
|
851
|
-
expect(client.completeCommand).toHaveBeenCalledExactlyOnceWith("command", {
|
|
852
|
-
hostId: "host",
|
|
853
|
-
generation: 1,
|
|
854
|
-
status: "SUCCEEDED",
|
|
855
|
-
resultCode: kind.startsWith("TEST_SESSION_")
|
|
856
|
-
? "QA_SESSION_COMMAND_ACCEPTED"
|
|
857
|
-
: "TEST_COMMAND_ACCEPTED",
|
|
858
|
-
result: { phase: "ACCEPTED" },
|
|
859
|
-
});
|
|
860
|
-
});
|
|
861
|
-
});
|
|
862
|
-
describe("显式刷新模型", () => {
|
|
863
|
-
it.each([false, true])("先上报后完成,失败时不覆盖目录(失败=%s)", async (fail) => {
|
|
864
|
-
await isolatedHome();
|
|
865
|
-
await writeHostState({ ...hostIdentity(), hostId: "host", generation: 1, catalogRevision: 1 });
|
|
866
|
-
const client = {
|
|
867
|
-
verify: vi.fn().mockResolvedValue({
|
|
868
|
-
generationValid: true,
|
|
869
|
-
shell: { name: "powershell" },
|
|
870
|
-
toolConfigurationRevision: 1,
|
|
871
|
-
}),
|
|
872
|
-
reportStatus: vi.fn().mockResolvedValue({}),
|
|
873
|
-
completeCommand: vi.fn().mockResolvedValue({}),
|
|
874
|
-
};
|
|
875
|
-
const pi = {
|
|
876
|
-
readProviderStates: vi.fn().mockResolvedValue([]),
|
|
877
|
-
readAvailableModels: fail
|
|
878
|
-
? vi.fn().mockRejectedValue(new Error("CATALOG_FAILED"))
|
|
879
|
-
: vi.fn().mockResolvedValue([]),
|
|
880
|
-
};
|
|
881
|
-
const stderr = vi.spyOn(process.stderr, "write").mockReturnValue(true);
|
|
882
|
-
try {
|
|
883
|
-
await executeCommand(client, pi, {}, { hostId: "host", generation: 1, catalogRevision: 1 }, { id: "refresh", kind: "REFRESH_MODELS" });
|
|
884
|
-
expect(client.completeCommand).toHaveBeenCalledWith("refresh", expect.objectContaining({ status: fail ? "FAILED" : "SUCCEEDED" }));
|
|
885
|
-
expect(client.reportStatus).toHaveBeenCalledTimes(fail ? 0 : 1);
|
|
886
|
-
if (!fail)
|
|
887
|
-
expect(client.reportStatus.mock.invocationCallOrder[0]).toBeLessThan(client.completeCommand.mock.invocationCallOrder[0]);
|
|
888
|
-
}
|
|
889
|
-
finally {
|
|
890
|
-
stderr.mockRestore();
|
|
891
|
-
}
|
|
892
|
-
});
|
|
893
|
-
});
|
|
894
|
-
it("Host先读取命令输入引用,再将完整输入交给执行器", async () => {
|
|
895
|
-
const run = {
|
|
896
|
-
runId: "run",
|
|
897
|
-
turnId: "turn",
|
|
898
|
-
action: "START",
|
|
899
|
-
runInput: { materialPreparation: { inputPaths: ["prd.md"] } },
|
|
900
|
-
};
|
|
901
|
-
const client = {
|
|
902
|
-
commandInput: vi.fn().mockResolvedValue({ run }),
|
|
903
|
-
completeCommand: vi.fn().mockResolvedValue({}),
|
|
904
|
-
};
|
|
905
|
-
const coding = { execute: vi.fn().mockResolvedValue({}) };
|
|
906
|
-
await executeCommand(client, {}, coding, { hostId: "host", generation: 3 }, {
|
|
907
|
-
id: "command",
|
|
908
|
-
inputRef: "command",
|
|
909
|
-
kind: "CODING_RUN_START",
|
|
910
|
-
run: { runId: "run", turnId: "turn", action: "START" },
|
|
911
|
-
});
|
|
912
|
-
expect(client.commandInput).toHaveBeenCalledExactlyOnceWith("command", {
|
|
913
|
-
hostId: "host",
|
|
914
|
-
generation: 3,
|
|
915
|
-
});
|
|
916
|
-
expect(coding.execute).toHaveBeenCalledWith(client, expect.anything(), expect.objectContaining({ run }));
|
|
917
|
-
expect(client.completeCommand).toHaveBeenCalledWith("command", expect.objectContaining({ status: "SUCCEEDED" }));
|
|
918
|
-
});
|
|
919
|
-
it("输入引用读取失败时不启动执行,并记录失败", async () => {
|
|
920
|
-
const client = {
|
|
921
|
-
commandInput: vi.fn().mockRejectedValue(new Error("HOST_COMMAND_INPUT_STALE")),
|
|
922
|
-
completeCommand: vi.fn().mockResolvedValue({}),
|
|
923
|
-
reportCodingTerminal: vi.fn().mockResolvedValue({}),
|
|
924
|
-
};
|
|
925
|
-
const coding = { execute: vi.fn() };
|
|
926
|
-
const stderr = vi.spyOn(process.stderr, "write").mockReturnValue(true);
|
|
927
|
-
try {
|
|
928
|
-
await executeCommand(client, {}, coding, { hostId: "host", generation: 3 }, {
|
|
929
|
-
id: "command",
|
|
930
|
-
inputRef: "command",
|
|
931
|
-
kind: "CODING_RUN_START",
|
|
932
|
-
run: { runId: "run", turnId: "turn", action: "START" },
|
|
933
|
-
});
|
|
934
|
-
expect(coding.execute).not.toHaveBeenCalled();
|
|
935
|
-
expect(client.completeCommand).toHaveBeenCalledWith("command", expect.objectContaining({ status: "FAILED", resultCode: "HOST_COMMAND_INPUT_STALE" }));
|
|
936
|
-
}
|
|
937
|
-
finally {
|
|
938
|
-
stderr.mockRestore();
|
|
939
|
-
}
|
|
940
|
-
});
|
|
941
|
-
it.each(["CODING_WORKTREE_REMOTE_AHEAD_DIRTY", "CODING_WORKTREE_DIVERGED"])("接回冲突 %s 向平台回传可处理且不泄密的原因", async (code) => {
|
|
942
|
-
const client = {
|
|
943
|
-
completeCommand: vi.fn().mockResolvedValue({}),
|
|
944
|
-
reportCodingTerminal: vi.fn().mockResolvedValue({}),
|
|
945
|
-
};
|
|
946
|
-
const coding = {
|
|
947
|
-
execute: vi.fn().mockRejectedValue(new Error(`${code}:secret-token-not-for-platform`)),
|
|
948
|
-
};
|
|
949
|
-
const stderr = vi.spyOn(process.stderr, "write").mockReturnValue(true);
|
|
950
|
-
try {
|
|
951
|
-
await executeCommand(client, {}, coding, { hostId: "host", generation: 3 }, {
|
|
952
|
-
id: "command",
|
|
953
|
-
kind: "CODING_RUN_START",
|
|
954
|
-
run: { runId: "run", turnId: "turn", action: "START" },
|
|
955
|
-
});
|
|
956
|
-
expect(client.completeCommand).toHaveBeenCalledWith("command", expect.objectContaining({
|
|
957
|
-
status: "FAILED",
|
|
958
|
-
resultCode: code,
|
|
959
|
-
result: { message: expect.stringContaining("原 Host 工作区") },
|
|
960
|
-
}));
|
|
961
|
-
expect(client.reportCodingTerminal).toHaveBeenCalledWith("run", expect.objectContaining({
|
|
962
|
-
failureCode: code,
|
|
963
|
-
summary: expect.stringContaining("原 Host 工作区"),
|
|
964
|
-
}));
|
|
965
|
-
expect(JSON.stringify(client.completeCommand.mock.calls)).not.toContain("secret-token");
|
|
966
|
-
expect(JSON.stringify(client.reportCodingTerminal.mock.calls)).not.toContain("secret-token");
|
|
967
|
-
}
|
|
968
|
-
finally {
|
|
969
|
-
stderr.mockRestore();
|
|
970
|
-
}
|
|
971
|
-
});
|
|
972
|
-
it("首次准备在clone前失败时回报实际未初始化事实", async () => {
|
|
973
|
-
const home = await mkdtemp(join(tmpdir(), "aip-initialization-failure-"));
|
|
974
|
-
const prior = process.env.AIP_HOME;
|
|
975
|
-
process.env.AIP_HOME = home;
|
|
976
|
-
const client = {
|
|
977
|
-
completeCommand: vi.fn().mockResolvedValue({}),
|
|
978
|
-
reportCodingTerminal: vi.fn().mockResolvedValue({}),
|
|
979
|
-
};
|
|
980
|
-
const stderr = vi.spyOn(process.stderr, "write").mockReturnValue(true);
|
|
981
|
-
try {
|
|
982
|
-
await executeCommand(client, {}, { execute: vi.fn().mockRejectedValue(new Error("CODING_REPOSITORY_ACCESS_FAILED")) }, { hostId: "host", generation: 1 }, {
|
|
983
|
-
id: "cmd",
|
|
984
|
-
kind: "CODING_RUN_START",
|
|
985
|
-
run: {
|
|
986
|
-
runId: "new-run",
|
|
987
|
-
turnId: "turn",
|
|
988
|
-
action: "START",
|
|
989
|
-
runInput: {
|
|
990
|
-
workItem: { key: "INIT" },
|
|
991
|
-
projects: [{ id: "project", name: "fixture", devBranch: "aip/INIT" }],
|
|
992
|
-
},
|
|
993
|
-
},
|
|
994
|
-
});
|
|
995
|
-
expect(client.completeCommand).toHaveBeenCalledWith("cmd", expect.objectContaining({
|
|
996
|
-
status: "FAILED",
|
|
997
|
-
result: { workspaceInitialization: [{ projectId: "project", status: "NOT_INITIALIZED" }] },
|
|
998
|
-
}));
|
|
999
|
-
}
|
|
1000
|
-
finally {
|
|
1001
|
-
stderr.mockRestore();
|
|
1002
|
-
if (prior === undefined)
|
|
1003
|
-
delete process.env.AIP_HOME;
|
|
1004
|
-
else
|
|
1005
|
-
process.env.AIP_HOME = prior;
|
|
1006
|
-
await rm(home, { recursive: true, force: true });
|
|
1007
|
-
}
|
|
1008
|
-
});
|
|
1009
|
-
//# sourceMappingURL=local-host.test.js.map
|