feat(commands): multi-select ordered command pipeline with step reordering and single-pass composition (AI-05, AI-07)
This commit is contained in:
parent
f49acf0105
commit
10af20a0ad
157 changed files with 29455 additions and 913 deletions
25
scripts/verification/typing-runtime/Launch.cs
Normal file
25
scripts/verification/typing-runtime/Launch.cs
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Windows.Forms;
|
||||
|
||||
internal static class Launch {
|
||||
[STAThread] private static void Main() {
|
||||
try {
|
||||
var root = Path.GetFullPath(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "../../.."));
|
||||
if (Process.GetProcessesByName("D3RO Voice").Length > 0) {
|
||||
MessageBox.Show("Quit the installed D3RO Voice from its tray menu first, then open this launcher again. This avoids two global input hooks during verification.", "Close installed D3RO Voice first");
|
||||
return;
|
||||
}
|
||||
if (!File.Exists(Path.Combine(root, "apps/desktop/out/main/index.js"))) {
|
||||
throw new InvalidOperationException("Build the desktop product before starting verification.");
|
||||
}
|
||||
var start = new ProcessStartInfo(Path.Combine(root, "node_modules/electron/dist/electron.exe"));
|
||||
start.Arguments = "\"" + Path.Combine(root, "scripts/verification/typing-runtime") + "\" --remote-debugging-address=127.0.0.1 --remote-debugging-port=19229";
|
||||
start.WorkingDirectory = Path.Combine(root, "apps/desktop");
|
||||
start.UseShellExecute = false;
|
||||
start.EnvironmentVariables.Remove("ELECTRON_RUN_AS_NODE");
|
||||
Process.Start(start);
|
||||
} catch (Exception error) { MessageBox.Show(error.Message, "Typing verification launch failed"); }
|
||||
}
|
||||
}
|
||||
15
scripts/verification/typing-runtime/README.md
Normal file
15
scripts/verification/typing-runtime/README.md
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
# Isolated typing verification runtime
|
||||
|
||||
This runs the built desktop product with a separate local-only profile at `test-results/typing-load/profile`. It has no account, typed-text learning, startup registration or protocol registration. The actual product bootstrap, native hook, UIA reader and correction services are used. Input telemetry starts disabled; enable it through the product settings/API when a fixture is ready.
|
||||
|
||||
Build the desktop normally, then build the launcher:
|
||||
|
||||
```powershell
|
||||
pwsh -File scripts/verification/typing-runtime/build.ps1
|
||||
```
|
||||
|
||||
Quit the installed D3RO Voice through its tray menu. Open `test-results/typing-load/runtime/D3ROTypingRuntime.exe` yourself from the interactive desktop or an external terminal. The launcher refuses to run while the installed app is present. Per repository `AGENTS.md`, an agent must not background-launch Electron from a subshell.
|
||||
|
||||
The launcher uses a localhost-only CDP port 19229 for verification. Close the test app when finished and reopen the installed app. Do not copy production account configuration into this profile. Runtime PID/path evidence is stored in `test-results/typing-load/runtime.json`. Reports and compiled executables remain in ignored `test-results`, not in source control.
|
||||
|
||||
Use with `../typing-fixture`. Record the product source hashes, configuration, exact CPU overlap and model load timings with each report. Synthetic scan codes and WinForms text readback do not establish hardware keyboard or Chromium/terminal correctness.
|
||||
10
scripts/verification/typing-runtime/build.ps1
Normal file
10
scripts/verification/typing-runtime/build.ps1
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
$ErrorActionPreference = 'Stop'
|
||||
$repoRoot = [IO.Path]::GetFullPath((Join-Path $PSScriptRoot '../../..'))
|
||||
$output = Join-Path $repoRoot 'test-results/typing-load/runtime'
|
||||
$compiler = Join-Path $env:WINDIR 'Microsoft.NET/Framework64/v4.0.30319/csc.exe'
|
||||
if (-not (Test-Path -LiteralPath $compiler)) { throw 'The installed .NET Framework x64 C# compiler is required.' }
|
||||
New-Item -ItemType Directory -Path $output -Force | Out-Null
|
||||
$target = Join-Path $output 'D3ROTypingRuntime.exe'
|
||||
& $compiler /nologo /target:winexe /platform:x64 /reference:System.Windows.Forms.dll "/out:$target" (Join-Path $PSScriptRoot 'Launch.cs')
|
||||
if ($LASTEXITCODE -ne 0) { throw "Runtime launcher compilation failed: $LASTEXITCODE" }
|
||||
Write-Output $target
|
||||
34
scripts/verification/typing-runtime/main.cjs
Normal file
34
scripts/verification/typing-runtime/main.cjs
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
// Interactive verification entry: real built product with an isolated local-only profile.
|
||||
const { app } = require('electron')
|
||||
const fs = require('node:fs')
|
||||
const path = require('node:path')
|
||||
const { createHash } = require('node:crypto')
|
||||
const root = path.resolve(__dirname, '../../..')
|
||||
const profile = path.join(root, 'test-results/typing-load/profile')
|
||||
fs.mkdirSync(profile, { recursive: true })
|
||||
app.setPath('userData', profile)
|
||||
app.setAppLogsPath(path.join(profile, 'logs'))
|
||||
app.setAppPath(path.join(root, 'apps/desktop'))
|
||||
process.env.NODE_ENV = 'test'
|
||||
// A test launch must never take ownership of the installed OAuth protocol handler.
|
||||
app.setAsDefaultProtocolClient = () => false
|
||||
app.setLoginItemSettings = () => { throw new Error('OS startup registration is disabled in the isolated verification runtime') }
|
||||
const configPath = path.join(profile, 'd3ro-voice-config.json')
|
||||
if (!fs.existsSync(configPath)) fs.writeFileSync(configPath, JSON.stringify({
|
||||
appUsageMode: 'local', onboardingCompleted: true, autoLaunch: false,
|
||||
closeToTray: false, soundEnabled: false, inputTelemetryEnabled: false,
|
||||
inputLearnTypedText: false, suggestionEnabled: false,
|
||||
typoAutoCorrectEnabled: false, typoAutoCorrectUseModel: false,
|
||||
llmModelId: 'gemma4:e4b', ollamaServerUrl: 'http://127.0.0.1:11434',
|
||||
sttModelId: 'tiny', sttProviderConfigs: {local: {modelId: 'tiny'}},
|
||||
localModelsDir: path.join(process.env.APPDATA, 'd3ro-voice/whisper-models')
|
||||
}, null, 2))
|
||||
const productBundle = path.join(root, 'apps/desktop/out/main/index.js')
|
||||
const productPackage = JSON.parse(fs.readFileSync(path.join(root, 'apps/desktop/package.json'), 'utf8'))
|
||||
fs.writeFileSync(path.join(root, 'test-results/typing-load/runtime.json'), JSON.stringify({
|
||||
pid: process.pid, startedAt: new Date().toISOString(), profile,
|
||||
productBundle, productPackageVersion: productPackage.version,
|
||||
productBundleSha256: createHash('sha256').update(fs.readFileSync(productBundle)).digest('hex'),
|
||||
isolation: 'local-only empty profile; protocol and OS startup registration disabled; real product bootstrap'
|
||||
}, null, 2))
|
||||
require(productBundle)
|
||||
1
scripts/verification/typing-runtime/package.json
Normal file
1
scripts/verification/typing-runtime/package.json
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"name":"d3ro-typing-verification","version":"1.0.0","private":true,"main":"main.cjs"}
|
||||
Loading…
Add table
Add a link
Reference in a new issue