aiwcli 0.15.5 → 0.15.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -3
- package/dist/capabilities/branch/adapters.d.ts +2 -0
- package/dist/capabilities/branch/adapters.js +21 -0
- package/dist/capabilities/branch/contracts.d.ts +57 -0
- package/dist/capabilities/branch/contracts.js +1 -0
- package/dist/capabilities/branch/control-plane.d.ts +2 -0
- package/dist/capabilities/branch/control-plane.js +343 -0
- package/dist/capabilities/branch/runtime-core.d.ts +5 -0
- package/dist/capabilities/branch/runtime-core.js +36 -0
- package/dist/capabilities/installation/control-plane/clean-command.d.ts +41 -0
- package/dist/capabilities/installation/control-plane/clean-command.js +196 -0
- package/dist/capabilities/installation/control-plane/clear-command.d.ts +160 -0
- package/dist/capabilities/installation/control-plane/clear-command.js +1220 -0
- package/dist/capabilities/installation/control-plane/init-command.d.ts +81 -0
- package/dist/capabilities/installation/control-plane/init-command.js +449 -0
- package/dist/capabilities/launch/contracts.d.ts +51 -0
- package/dist/capabilities/launch/contracts.js +1 -0
- package/dist/capabilities/launch/control-plane/execute-launch.d.ts +2 -0
- package/dist/capabilities/launch/control-plane/execute-launch.js +222 -0
- package/dist/capabilities/launch/runtime-core/launch-options.d.ts +14 -0
- package/dist/capabilities/launch/runtime-core/launch-options.js +69 -0
- package/dist/cli/base-command.d.ts +18 -0
- package/dist/cli/base-command.js +55 -0
- package/dist/commands/branch.d.ts +0 -20
- package/dist/commands/branch.js +24 -416
- package/dist/commands/clean.d.ts +1 -41
- package/dist/commands/clean.js +1 -196
- package/dist/commands/clear.d.ts +1 -161
- package/dist/commands/clear.js +1 -1121
- package/dist/commands/init/index.d.ts +1 -98
- package/dist/commands/init/index.js +4 -478
- package/dist/commands/launch.d.ts +36 -11
- package/dist/commands/launch.js +135 -159
- package/dist/lib/base-command.d.ts +1 -114
- package/dist/lib/base-command.js +1 -153
- package/dist/lib/claude-settings-types.d.ts +31 -19
- package/dist/lib/context/context-formatter.d.ts +74 -0
- package/dist/lib/context/context-formatter.js +493 -0
- package/dist/lib/context/context-selector.d.ts +42 -0
- package/dist/lib/context/context-selector.js +451 -0
- package/dist/lib/context/context-store.d.ts +100 -0
- package/dist/lib/context/context-store.js +618 -0
- package/dist/lib/context/plan-manager.d.ts +54 -0
- package/dist/lib/context/plan-manager.js +282 -0
- package/dist/lib/context/task-tracker.d.ts +44 -0
- package/dist/lib/context/task-tracker.js +146 -0
- package/dist/lib/core-ide-base.d.ts +4 -0
- package/dist/lib/core-ide-base.js +77 -0
- package/dist/lib/core-installer.d.ts +5 -0
- package/dist/lib/core-installer.js +54 -0
- package/dist/lib/git-exclude-manager.d.ts +2 -2
- package/dist/lib/git-exclude-manager.js +3 -3
- package/dist/lib/hooks/hook-utils.d.ts +143 -0
- package/dist/lib/hooks/hook-utils.js +609 -0
- package/dist/lib/hooks/session-end-logic.d.ts +5 -0
- package/dist/lib/hooks/session-end-logic.js +63 -0
- package/dist/lib/hooks-merger.js +25 -19
- package/dist/lib/ide-path-resolver.d.ts +19 -7
- package/dist/lib/ide-path-resolver.js +25 -9
- package/dist/lib/install-state.d.ts +34 -0
- package/dist/lib/install-state.js +161 -0
- package/dist/lib/launch-options.d.ts +1 -0
- package/dist/lib/launch-options.js +1 -0
- package/dist/lib/lsp-patch.d.ts +12 -0
- package/dist/lib/lsp-patch.js +156 -0
- package/dist/lib/multiplexer.d.ts +57 -0
- package/dist/lib/multiplexer.js +19 -0
- package/dist/lib/multiplexers/psmux.d.ts +75 -0
- package/dist/lib/multiplexers/psmux.js +384 -0
- package/dist/lib/multiplexers/tmux.d.ts +44 -0
- package/dist/lib/multiplexers/tmux.js +262 -0
- package/dist/lib/mux-utils.d.ts +5 -0
- package/dist/lib/mux-utils.js +42 -0
- package/dist/lib/paths.d.ts +2 -2
- package/dist/lib/paths.js +2 -2
- package/dist/lib/platform-commands.d.ts +27 -0
- package/dist/lib/platform-commands.js +49 -0
- package/dist/lib/runtime/aiw-cli.d.ts +37 -0
- package/dist/lib/runtime/aiw-cli.js +74 -0
- package/dist/lib/runtime/atomic-write.d.ts +19 -0
- package/dist/lib/runtime/atomic-write.js +121 -0
- package/dist/lib/runtime/cli-args.d.ts +55 -0
- package/dist/lib/runtime/cli-args.js +185 -0
- package/dist/lib/runtime/constants.d.ts +56 -0
- package/dist/lib/runtime/constants.js +230 -0
- package/dist/lib/runtime/executable-policy.d.ts +16 -0
- package/dist/lib/runtime/executable-policy.js +57 -0
- package/dist/lib/runtime/git-state.d.ts +9 -0
- package/dist/lib/runtime/git-state.js +59 -0
- package/dist/lib/runtime/inference.d.ts +37 -0
- package/dist/lib/runtime/inference.js +262 -0
- package/dist/lib/runtime/lint-dispatch.d.ts +40 -0
- package/dist/lib/runtime/lint-dispatch.js +285 -0
- package/dist/lib/runtime/logger.d.ts +66 -0
- package/dist/lib/runtime/logger.js +201 -0
- package/dist/lib/runtime/models.d.ts +14 -0
- package/dist/lib/runtime/models.js +14 -0
- package/dist/lib/runtime/platform-adapter.d.ts +7 -0
- package/dist/lib/runtime/platform-adapter.js +21 -0
- package/dist/lib/runtime/preflight.d.ts +24 -0
- package/dist/lib/runtime/preflight.js +65 -0
- package/dist/lib/runtime/sentinel-ipc.d.ts +14 -0
- package/dist/lib/runtime/sentinel-ipc.js +67 -0
- package/dist/lib/runtime/state-io.d.ts +30 -0
- package/dist/lib/runtime/state-io.js +174 -0
- package/dist/lib/runtime/stop-words.d.ts +20 -0
- package/dist/lib/runtime/stop-words.js +150 -0
- package/dist/lib/runtime/subprocess-utils.d.ts +29 -0
- package/dist/lib/runtime/subprocess-utils.js +96 -0
- package/dist/lib/runtime/tmux-preflight.d.ts +13 -0
- package/dist/lib/runtime/tmux-preflight.js +78 -0
- package/dist/lib/runtime/utils.d.ts +54 -0
- package/dist/lib/runtime/utils.js +162 -0
- package/dist/lib/sentinel-wrapper.d.ts +9 -0
- package/dist/lib/sentinel-wrapper.js +20 -0
- package/dist/lib/shell-quoting.d.ts +5 -0
- package/dist/lib/shell-quoting.js +17 -0
- package/dist/lib/spawn-errors.d.ts +6 -0
- package/dist/lib/spawn-errors.js +15 -0
- package/dist/lib/spawn.js +5 -11
- package/dist/lib/template-installer.d.ts +4 -5
- package/dist/lib/template-installer.js +36 -34
- package/dist/lib/template-resolver.d.ts +6 -7
- package/dist/lib/template-resolver.js +26 -21
- package/dist/lib/template-settings-reconstructor.d.ts +7 -2
- package/dist/lib/template-settings-reconstructor.js +76 -45
- package/dist/lib/terminal-strategy.d.ts +11 -0
- package/dist/lib/terminal-strategy.js +49 -0
- package/dist/lib/terminal.d.ts +28 -0
- package/dist/lib/terminal.js +162 -112
- package/dist/lib/tmux-pane-placement.d.ts +17 -0
- package/dist/lib/tmux-pane-placement.js +58 -0
- package/dist/lib/tmux-primitives.d.ts +5 -0
- package/dist/lib/tmux-primitives.js +15 -0
- package/dist/lib/tmux-session.d.ts +32 -0
- package/dist/lib/tmux-session.js +86 -0
- package/dist/lib/tty-detection.js +1 -1
- package/dist/lib/types.d.ts +168 -0
- package/dist/lib/types.js +6 -0
- package/dist/lib/version.d.ts +1 -1
- package/dist/lib/version.js +1 -1
- package/dist/platform/launch.d.ts +10 -0
- package/dist/platform/launch.js +10 -0
- package/dist/templates/CLAUDE.md +31 -40
- package/dist/templates/cc-native/.claude/settings.json +27 -27
- package/dist/templates/cc-native/CC-NATIVE-README.md +1 -1
- package/dist/templates/cc-native/TEMPLATE-SCHEMA.md +10 -9
- package/dist/templates/cc-native/_cc-native/CLAUDE.md +18 -18
- package/dist/templates/cc-native/_cc-native/artifacts/CLAUDE.md +3 -3
- package/dist/templates/cc-native/_cc-native/artifacts/lib/format.ts +14 -14
- package/dist/templates/cc-native/_cc-native/artifacts/lib/tracker.ts +1 -1
- package/dist/templates/cc-native/_cc-native/artifacts/lib/write.ts +3 -3
- package/dist/templates/cc-native/_cc-native/cc-native.config.json +3 -3
- package/dist/templates/cc-native/_cc-native/hooks/CLAUDE.md +16 -15
- package/dist/templates/cc-native/_cc-native/hooks/cc-native-plan-review.ts +3 -3
- package/dist/templates/cc-native/_cc-native/hooks/enhance_plan_post_subagent.ts +2 -2
- package/dist/templates/cc-native/_cc-native/hooks/enhance_plan_post_write.ts +2 -2
- package/dist/templates/cc-native/_cc-native/hooks/mark_questions_asked.ts +3 -3
- package/dist/templates/cc-native/_cc-native/hooks/plan_questions_early.ts +2 -2
- package/dist/templates/cc-native/_cc-native/hooks/validate_task_prompt.ts +3 -3
- package/dist/templates/cc-native/_cc-native/lib-ts/CLAUDE.md +8 -8
- package/dist/templates/cc-native/_cc-native/lib-ts/aggregate-agents.ts +1 -1
- package/dist/templates/cc-native/_cc-native/lib-ts/cc-native-state.ts +4 -4
- package/dist/templates/cc-native/_cc-native/lib-ts/cli-output-parser.ts +1 -1
- package/dist/templates/cc-native/_cc-native/lib-ts/config.ts +1 -1
- package/dist/templates/cc-native/_cc-native/lib-ts/debug.ts +1 -1
- package/dist/templates/cc-native/_cc-native/lib-ts/json-parser.ts +1 -1
- package/dist/templates/cc-native/_cc-native/lib-ts/plan-discovery.ts +2 -2
- package/dist/templates/cc-native/_cc-native/lib-ts/rlm/logger.ts +1 -1
- package/dist/templates/cc-native/_cc-native/lib-ts/rlm/retrieval-pipeline.ts +2 -2
- package/dist/templates/cc-native/_cc-native/lib-ts/rlm/types.ts +1 -1
- package/dist/templates/cc-native/_cc-native/lib-ts/settings.ts +8 -8
- package/dist/templates/cc-native/_cc-native/lib-ts/state.ts +3 -3
- package/dist/templates/cc-native/_cc-native/lib-ts/tsconfig.json +2 -2
- package/dist/templates/cc-native/_cc-native/lib-ts/types.ts +3 -3
- package/dist/templates/cc-native/_cc-native/plan-review/CLAUDE.md +3 -1
- package/dist/templates/cc-native/_cc-native/plan-review/lib/__tests__/agent-selection.test.ts +345 -0
- package/dist/templates/cc-native/_cc-native/plan-review/lib/__tests__/preflight.test.ts +344 -0
- package/dist/templates/cc-native/_cc-native/plan-review/lib/agent-selection.ts +37 -15
- package/dist/templates/cc-native/_cc-native/plan-review/lib/corroboration.ts +16 -69
- package/dist/templates/cc-native/_cc-native/plan-review/lib/orchestrator.ts +1 -1
- package/dist/templates/cc-native/_cc-native/plan-review/lib/output-builder.ts +1 -1
- package/dist/templates/cc-native/_cc-native/plan-review/lib/plan-questions.ts +2 -2
- package/dist/templates/cc-native/_cc-native/plan-review/lib/preflight.ts +56 -26
- package/dist/templates/cc-native/_cc-native/plan-review/lib/review-pipeline.ts +7 -7
- package/dist/templates/cc-native/_cc-native/plan-review/lib/reviewers/agent.ts +4 -4
- package/dist/templates/cc-native/_cc-native/plan-review/lib/reviewers/base/base-agent.ts +3 -3
- package/dist/templates/cc-native/_cc-native/plan-review/lib/reviewers/index.ts +1 -1
- package/dist/templates/cc-native/_cc-native/plan-review/lib/reviewers/providers/claude-agent.ts +2 -2
- package/dist/templates/cc-native/_cc-native/plan-review/lib/reviewers/providers/codex-agent.ts +4 -4
- package/dist/templates/cc-native/_cc-native/plan-review/lib/reviewers/providers/gemini-agent.ts +1 -1
- package/dist/templates/cc-native/_cc-native/plan-review/lib/reviewers/providers/orchestrator-claude-agent.ts +5 -6
- package/dist/templates/core/.codex/workflows/codex.md +17 -0
- package/dist/templates/core/.codex/workflows/handoff.md +5 -0
- package/dist/templates/core/.codex/workflows/meta-plan.md +7 -0
- package/dist/templates/core/.cognition/AGENTS.md +5 -0
- package/dist/templates/core/.cognition/config.json +12 -0
- package/dist/templates/{_shared → core}/.windsurf/workflows/handoff.md +1 -1
- package/dist/templates/{_shared → core}/.windsurf/workflows/meta-plan.md +1 -1
- package/dist/templates/core/hooks-ts/_utils/git-state.ts +2 -0
- package/dist/templates/{_shared → core}/hooks-ts/archive_plan.ts +14 -23
- package/dist/templates/core/hooks-ts/codex_explorer.ts +160 -0
- package/dist/templates/{_shared → core}/hooks-ts/context_monitor.ts +23 -55
- package/dist/templates/{_shared → core}/hooks-ts/file-suggestion.ts +4 -3
- package/dist/templates/{_shared → core}/hooks-ts/lint_after_edit.ts +7 -9
- package/dist/templates/{_shared → core}/hooks-ts/pre_compact.ts +5 -5
- package/dist/templates/{_shared → core}/hooks-ts/session_end.ts +38 -78
- package/dist/templates/{_shared → core}/hooks-ts/session_start.ts +5 -5
- package/dist/templates/core/hooks-ts/task_create_capture.ts +32 -0
- package/dist/templates/{_shared → core}/hooks-ts/task_update_capture.ts +9 -24
- package/dist/templates/core/hooks-ts/user_prompt_submit.ts +46 -0
- package/dist/templates/{_shared → core}/lib-ts/CLAUDE.md +27 -16
- package/dist/templates/{_shared → core}/lib-ts/agent-exec/backends/headless.ts +3 -2
- package/dist/templates/{_shared → core}/lib-ts/agent-exec/backends/tmux.ts +44 -15
- package/dist/templates/{_shared → core}/lib-ts/agent-exec/base-agent.ts +6 -4
- package/dist/templates/{_shared → core}/lib-ts/agent-exec/execution-backend.ts +1 -1
- package/dist/templates/{_shared → core}/lib-ts/agent-exec/index.ts +2 -2
- package/dist/templates/{_shared → core}/lib-ts/agent-exec/structured-output.ts +4 -5
- package/dist/templates/{_shared → core}/lib-ts/context/CLAUDE.md +9 -6
- package/dist/templates/{_shared → core}/lib-ts/context/context-formatter.ts +16 -21
- package/dist/templates/{_shared → core}/lib-ts/context/context-selector.ts +8 -6
- package/dist/templates/{_shared → core}/lib-ts/context/context-store.ts +32 -20
- package/dist/templates/{_shared → core}/lib-ts/context/plan-manager.ts +19 -15
- package/dist/templates/{_shared → core}/lib-ts/context/task-tracker.ts +3 -3
- package/dist/templates/core/lib-ts/hooks/context-monitor-logic.ts +32 -0
- package/dist/templates/{_shared/lib-ts/base → core/lib-ts/hooks}/hook-utils.ts +168 -41
- package/dist/templates/core/lib-ts/hooks/prompt-binding-logic.ts +80 -0
- package/dist/templates/core/lib-ts/hooks/session-end-logic.ts +93 -0
- package/dist/templates/core/lib-ts/package.json +19 -0
- package/dist/templates/core/lib-ts/runtime/agent-launcher.ts +295 -0
- package/dist/templates/core/lib-ts/runtime/aiw-cli.ts +106 -0
- package/dist/templates/{_shared/lib-ts/base → core/lib-ts/runtime}/atomic-write.ts +12 -7
- package/dist/templates/{_shared/lib-ts/base → core/lib-ts/runtime}/cli-args.ts +8 -6
- package/dist/templates/{_shared/lib-ts/base → core/lib-ts/runtime}/constants.ts +326 -324
- package/dist/templates/core/lib-ts/runtime/executable-policy.ts +89 -0
- package/dist/templates/{_shared/lib-ts/base → core/lib-ts/runtime}/git-state.ts +6 -4
- package/dist/templates/{_shared/lib-ts/base → core/lib-ts/runtime}/inference.ts +59 -10
- package/dist/templates/{_shared/lib-ts/base → core/lib-ts/runtime}/lint-dispatch.ts +25 -23
- package/dist/templates/{_shared/lib-ts/base → core/lib-ts/runtime}/logger.ts +32 -29
- package/dist/templates/{_shared/lib-ts/base → core/lib-ts/runtime}/models.ts +2 -2
- package/dist/templates/core/lib-ts/runtime/platform-adapter.ts +33 -0
- package/dist/templates/{_shared/lib-ts/base → core/lib-ts/runtime}/preflight.ts +4 -3
- package/dist/templates/core/lib-ts/runtime/sentinel-ipc.ts +91 -0
- package/dist/templates/{_shared/lib-ts/base → core/lib-ts/runtime}/state-io.ts +11 -7
- package/dist/templates/core/lib-ts/runtime/stop-words.ts +185 -0
- package/dist/templates/core/lib-ts/runtime/subprocess-utils.ts +147 -0
- package/dist/templates/core/lib-ts/runtime/tmux-preflight.ts +93 -0
- package/dist/templates/{_shared/lib-ts/base → core/lib-ts/runtime}/utils.ts +4 -3
- package/dist/templates/{_shared → core}/lib-ts/templates/formatters.ts +7 -5
- package/dist/templates/{_shared → core}/lib-ts/templates/plan-context.ts +2 -1
- package/dist/templates/{_shared → core}/lib-ts/tsconfig.json +3 -1
- package/dist/templates/{_shared → core}/lib-ts/types.ts +78 -77
- package/dist/templates/core/scripts/resolve-run.ts +61 -0
- package/dist/templates/{_shared → core}/scripts/resolve_context.ts +3 -3
- package/dist/templates/{_shared → core}/scripts/status_line.ts +25 -20
- package/dist/templates/core/skills/codex/CLAUDE.md +78 -0
- package/dist/templates/{_shared → core}/skills/codex/SKILL.md +21 -18
- package/dist/templates/{_shared → core}/skills/codex/lib/codex-watcher.ts +76 -103
- package/dist/templates/{_shared → core}/skills/codex/scripts/launch-codex.ts +119 -133
- package/dist/templates/{_shared → core}/skills/codex/scripts/watch-codex.ts +6 -4
- package/dist/templates/core/skills/devin/CLAUDE.md +65 -0
- package/dist/templates/core/skills/devin/SKILL.md +73 -0
- package/dist/templates/core/skills/devin/lib/devin-watcher.ts +280 -0
- package/dist/templates/core/skills/devin/scripts/launch-devin.ts +257 -0
- package/dist/templates/{_shared → core}/skills/handoff-system/CLAUDE.md +436 -433
- package/dist/templates/{_shared → core}/skills/handoff-system/lib/document-generator.ts +9 -7
- package/dist/templates/{_shared → core}/skills/handoff-system/lib/handoff-reader.ts +6 -4
- package/dist/templates/{_shared → core}/skills/handoff-system/scripts/resume_handoff.ts +10 -8
- package/dist/templates/{_shared → core}/skills/handoff-system/scripts/save_handoff.ts +12 -10
- package/dist/templates/{_shared → core}/skills/handoff-system/workflows/handoff-resume.md +2 -2
- package/dist/templates/{_shared → core}/skills/handoff-system/workflows/handoff.md +6 -5
- package/dist/templates/{_shared → core}/skills/meta-plan/CLAUDE.md +2 -1
- package/dist/templates/{_shared → core}/skills/meta-plan/workflows/meta-plan.md +8 -7
- package/oclif.manifest.json +89 -13
- package/package.json +13 -12
- package/dist/templates/_shared/.claude/settings.json +0 -120
- package/dist/templates/_shared/.claude/skills/codex/SKILL.md +0 -35
- package/dist/templates/_shared/.claude/skills/handoff/SKILL.md +0 -13
- package/dist/templates/_shared/.claude/skills/handoff-resume/SKILL.md +0 -13
- package/dist/templates/_shared/.claude/skills/meta-plan/SKILL.md +0 -43
- package/dist/templates/_shared/.codex/workflows/codex.md +0 -11
- package/dist/templates/_shared/.codex/workflows/handoff.md +0 -226
- package/dist/templates/_shared/.codex/workflows/meta-plan.md +0 -347
- package/dist/templates/_shared/hooks-ts/_utils/git-state.ts +0 -2
- package/dist/templates/_shared/hooks-ts/task_create_capture.ts +0 -48
- package/dist/templates/_shared/hooks-ts/user_prompt_submit.ts +0 -93
- package/dist/templates/_shared/lib-ts/base/launchers/tmux-launcher.ts +0 -173
- package/dist/templates/_shared/lib-ts/base/launchers/window-launcher.ts +0 -93
- package/dist/templates/_shared/lib-ts/base/launchers/wt-launcher.ts +0 -64
- package/dist/templates/_shared/lib-ts/base/pane-launcher.ts +0 -55
- package/dist/templates/_shared/lib-ts/base/sentinel-ipc.ts +0 -87
- package/dist/templates/_shared/lib-ts/base/stop-words.ts +0 -184
- package/dist/templates/_shared/lib-ts/base/subprocess-utils.ts +0 -249
- package/dist/templates/_shared/lib-ts/base/tmux-driver.ts +0 -341
- package/dist/templates/_shared/lib-ts/base/tmux-pane-placement.ts +0 -78
- package/dist/templates/_shared/lib-ts/package.json +0 -20
- package/dist/templates/_shared/scripts/resolve-run.ts +0 -62
- package/dist/templates/_shared/skills/codex/CLAUDE.md +0 -70
- /package/dist/templates/{_shared → core}/lib-ts/agent-exec/backends/index.ts +0 -0
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import { execFileAsync, findExecutable } from "../subprocess-utils.js";
|
|
2
|
-
import { quoteForSh } from "./tmux-launcher.js";
|
|
3
|
-
import type { PaneLaunchOptions, PaneLaunchResult, PaneLauncher } from "../pane-launcher.js";
|
|
4
|
-
|
|
5
|
-
function quoteForPowerShell(input: string): string {
|
|
6
|
-
return `'${input.replaceAll("'", "''")}'`;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
function findPowerShell(): string | null {
|
|
10
|
-
return findExecutable("pwsh") ?? findExecutable("powershell");
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export class WindowLauncher implements PaneLauncher {
|
|
14
|
-
readonly backend = "window" as const;
|
|
15
|
-
|
|
16
|
-
async available(): Promise<boolean> {
|
|
17
|
-
if (process.platform !== "win32") return false;
|
|
18
|
-
return Boolean(findPowerShell() ?? findExecutable("mintty"));
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
async launch(options: PaneLaunchOptions): Promise<PaneLaunchResult> {
|
|
22
|
-
if (process.platform !== "win32") {
|
|
23
|
-
return {
|
|
24
|
-
launched: false,
|
|
25
|
-
backend: this.backend,
|
|
26
|
-
reason: "window launcher only available on Windows",
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
const powershellPath = findPowerShell();
|
|
31
|
-
if (powershellPath) {
|
|
32
|
-
const cwd = options.cwd?.trim() || process.cwd();
|
|
33
|
-
const startProcess = [
|
|
34
|
-
`$cmd = ${quoteForPowerShell(options.command)}`,
|
|
35
|
-
`$wd = ${quoteForPowerShell(cwd)}`,
|
|
36
|
-
`Start-Process -FilePath ${quoteForPowerShell(powershellPath)} -WorkingDirectory $wd -ArgumentList @('-NoProfile','-Command',$cmd) | Out-Null`,
|
|
37
|
-
].join("; ");
|
|
38
|
-
|
|
39
|
-
const psLaunch = await execFileAsync(
|
|
40
|
-
powershellPath,
|
|
41
|
-
["-NoProfile", "-Command", startProcess],
|
|
42
|
-
{ timeout: 5000, shell: false },
|
|
43
|
-
);
|
|
44
|
-
|
|
45
|
-
if (psLaunch.exitCode === 0) {
|
|
46
|
-
return {
|
|
47
|
-
launched: true,
|
|
48
|
-
backend: this.backend,
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
return {
|
|
53
|
-
launched: false,
|
|
54
|
-
backend: this.backend,
|
|
55
|
-
reason: "Start-Process launch failed",
|
|
56
|
-
stderr: psLaunch.stderr.trim() || undefined,
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
const minttyPath = findExecutable("mintty");
|
|
61
|
-
if (!minttyPath) {
|
|
62
|
-
return {
|
|
63
|
-
launched: false,
|
|
64
|
-
backend: this.backend,
|
|
65
|
-
reason: "PowerShell and mintty are both unavailable",
|
|
66
|
-
};
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
const shellBody = options.cwd?.trim()
|
|
70
|
-
? `cd ${quoteForSh(options.cwd.trim())} && ${options.command}`
|
|
71
|
-
: options.command;
|
|
72
|
-
|
|
73
|
-
const minttyLaunch = await execFileAsync(
|
|
74
|
-
minttyPath,
|
|
75
|
-
["-e", "bash", "-lc", shellBody],
|
|
76
|
-
{ timeout: 5000, shell: false },
|
|
77
|
-
);
|
|
78
|
-
|
|
79
|
-
if (minttyLaunch.exitCode !== 0) {
|
|
80
|
-
return {
|
|
81
|
-
launched: false,
|
|
82
|
-
backend: this.backend,
|
|
83
|
-
reason: "mintty launch failed",
|
|
84
|
-
stderr: minttyLaunch.stderr.trim() || undefined,
|
|
85
|
-
};
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
return {
|
|
89
|
-
launched: true,
|
|
90
|
-
backend: this.backend,
|
|
91
|
-
};
|
|
92
|
-
}
|
|
93
|
-
}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { execFileAsync, findExecutable } from "../subprocess-utils.js";
|
|
2
|
-
import type { PaneLaunchOptions, PaneLaunchResult, PaneLauncher } from "../pane-launcher.js";
|
|
3
|
-
|
|
4
|
-
function findPowerShell(): string {
|
|
5
|
-
return findExecutable("pwsh") ?? findExecutable("powershell") ?? "powershell";
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export class WtLauncher implements PaneLauncher {
|
|
9
|
-
readonly backend = "wt" as const;
|
|
10
|
-
|
|
11
|
-
async available(): Promise<boolean> {
|
|
12
|
-
if (process.platform !== "win32") return false;
|
|
13
|
-
return Boolean(findExecutable("wt") ?? findExecutable("wt.exe"));
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
async launch(options: PaneLaunchOptions): Promise<PaneLaunchResult> {
|
|
17
|
-
if (process.platform !== "win32") {
|
|
18
|
-
return {
|
|
19
|
-
launched: false,
|
|
20
|
-
backend: this.backend,
|
|
21
|
-
reason: "wt launcher only available on Windows",
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
const wtPath = findExecutable("wt") ?? findExecutable("wt.exe");
|
|
26
|
-
if (!wtPath) {
|
|
27
|
-
return {
|
|
28
|
-
launched: false,
|
|
29
|
-
backend: this.backend,
|
|
30
|
-
reason: "wt.exe not found on PATH",
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
const args = ["split-pane"];
|
|
35
|
-
const splitDirection = options.splitDirection ?? "auto";
|
|
36
|
-
if (splitDirection === "h") args.push("-H");
|
|
37
|
-
if (splitDirection === "v") args.push("-V");
|
|
38
|
-
|
|
39
|
-
if (options.cwd?.trim()) args.push("-d", options.cwd.trim());
|
|
40
|
-
if (options.title?.trim()) args.push("--title", options.title.trim());
|
|
41
|
-
|
|
42
|
-
const powershellPath = findPowerShell();
|
|
43
|
-
args.push("--", powershellPath, "-NoProfile", "-Command", options.command);
|
|
44
|
-
|
|
45
|
-
const result = await execFileAsync(wtPath, args, {
|
|
46
|
-
timeout: 5000,
|
|
47
|
-
shell: false,
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
if (result.exitCode !== 0) {
|
|
51
|
-
return {
|
|
52
|
-
launched: false,
|
|
53
|
-
backend: this.backend,
|
|
54
|
-
reason: "wt split-pane failed",
|
|
55
|
-
stderr: result.stderr.trim() || undefined,
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
return {
|
|
60
|
-
launched: true,
|
|
61
|
-
backend: this.backend,
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { TmuxLauncher } from "./launchers/tmux-launcher.js";
|
|
2
|
-
import { WindowLauncher } from "./launchers/window-launcher.js";
|
|
3
|
-
import { WtLauncher } from "./launchers/wt-launcher.js";
|
|
4
|
-
|
|
5
|
-
export type PaneBackend = "tmux" | "wt" | "window" | "exec";
|
|
6
|
-
export type PaneSplitDirection = "h" | "v" | "auto";
|
|
7
|
-
|
|
8
|
-
export interface PaneLaunchOptions {
|
|
9
|
-
command: string;
|
|
10
|
-
splitDirection?: PaneSplitDirection;
|
|
11
|
-
splitTarget?: string;
|
|
12
|
-
cwd?: string;
|
|
13
|
-
title?: string;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export interface PaneLaunchResult {
|
|
17
|
-
launched: boolean;
|
|
18
|
-
backend: PaneBackend;
|
|
19
|
-
paneId?: string;
|
|
20
|
-
reason?: string;
|
|
21
|
-
stderr?: string;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export interface PaneLauncher {
|
|
25
|
-
readonly backend: PaneBackend;
|
|
26
|
-
available(): Promise<boolean>;
|
|
27
|
-
launch(options: PaneLaunchOptions): Promise<PaneLaunchResult>;
|
|
28
|
-
kill?(paneId: string): Promise<void>;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export interface PaneLauncherFactoryOptions {
|
|
32
|
-
/** Include tmux launcher only when running inside a tmux session. Default: true. */
|
|
33
|
-
requireTmuxSession?: boolean;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Resolve the first available pane launcher for the current environment.
|
|
38
|
-
* Detection order: tmux -> Windows Terminal -> window fallback.
|
|
39
|
-
*/
|
|
40
|
-
export async function createPaneLauncher(
|
|
41
|
-
options?: PaneLauncherFactoryOptions,
|
|
42
|
-
): Promise<PaneLauncher | null> {
|
|
43
|
-
const requireTmuxSession = options?.requireTmuxSession ?? true;
|
|
44
|
-
|
|
45
|
-
const tmux = new TmuxLauncher({ requireSessionEnv: requireTmuxSession });
|
|
46
|
-
if (await tmux.available()) return tmux;
|
|
47
|
-
|
|
48
|
-
const wt = new WtLauncher();
|
|
49
|
-
if (await wt.available()) return wt;
|
|
50
|
-
|
|
51
|
-
const window = new WindowLauncher();
|
|
52
|
-
if (await window.available()) return window;
|
|
53
|
-
|
|
54
|
-
return null;
|
|
55
|
-
}
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import * as fs from "node:fs";
|
|
2
|
-
import * as os from "node:os";
|
|
3
|
-
import * as path from "node:path";
|
|
4
|
-
|
|
5
|
-
export interface SentinelIpcPaths {
|
|
6
|
-
tmpDir: string;
|
|
7
|
-
inputPath: string;
|
|
8
|
-
stdoutPath: string;
|
|
9
|
-
stderrPath: string;
|
|
10
|
-
sentinelPath: string;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
function sanitizePrefix(prefix: string): string {
|
|
14
|
-
return prefix.replaceAll(/[^a-zA-Z0-9_-]/g, "-");
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export function createSentinelIpcPaths(prefix: string): SentinelIpcPaths {
|
|
18
|
-
const safePrefix = sanitizePrefix(prefix);
|
|
19
|
-
const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), `${safePrefix}-`));
|
|
20
|
-
|
|
21
|
-
return {
|
|
22
|
-
tmpDir,
|
|
23
|
-
inputPath: path.join(tmpDir, "input.txt"),
|
|
24
|
-
stdoutPath: path.join(tmpDir, "stdout.txt"),
|
|
25
|
-
stderrPath: path.join(tmpDir, "stderr.txt"),
|
|
26
|
-
sentinelPath: path.join(tmpDir, "sentinel.txt"),
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export function buildShellCaptureScript(
|
|
31
|
-
command: string,
|
|
32
|
-
paths: Pick<SentinelIpcPaths, "inputPath" | "stdoutPath" | "stderrPath" | "sentinelPath">,
|
|
33
|
-
quote: (input: string) => string,
|
|
34
|
-
): string {
|
|
35
|
-
return [
|
|
36
|
-
command,
|
|
37
|
-
`< ${quote(paths.inputPath)}`,
|
|
38
|
-
`> ${quote(paths.stdoutPath)}`,
|
|
39
|
-
`2> ${quote(paths.stderrPath)}`,
|
|
40
|
-
`; echo $? > ${quote(paths.sentinelPath)}`,
|
|
41
|
-
].join(" ");
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export async function waitForSentinelFile(
|
|
45
|
-
sentinelPath: string,
|
|
46
|
-
timeoutMs: number,
|
|
47
|
-
pollIntervalMs = 250,
|
|
48
|
-
): Promise<boolean> {
|
|
49
|
-
const deadline = Date.now() + timeoutMs;
|
|
50
|
-
while (Date.now() < deadline) {
|
|
51
|
-
if (fs.existsSync(sentinelPath)) return true;
|
|
52
|
-
await new Promise((resolve) => setTimeout(resolve, pollIntervalMs));
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
return fs.existsSync(sentinelPath);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
export function readSentinelExitCode(sentinelPath: string, fallback = 1): number {
|
|
59
|
-
if (!fs.existsSync(sentinelPath)) return fallback;
|
|
60
|
-
|
|
61
|
-
const raw = fs.readFileSync(sentinelPath, "utf-8").trim();
|
|
62
|
-
const parsed = Number.parseInt(raw, 10);
|
|
63
|
-
return Number.isFinite(parsed) ? parsed : fallback;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
export function readTextIfExists(filePath: string): string {
|
|
67
|
-
if (!filePath || !fs.existsSync(filePath)) return "";
|
|
68
|
-
return fs.readFileSync(filePath, "utf-8");
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
export function cleanupSentinelIpc(paths: Pick<SentinelIpcPaths, "tmpDir">): void {
|
|
72
|
-
try {
|
|
73
|
-
fs.rmSync(paths.tmpDir, { recursive: true, force: true });
|
|
74
|
-
} catch {
|
|
75
|
-
// Best-effort cleanup.
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
export function cleanupSentinelPath(sentinelPath: string | undefined): void {
|
|
80
|
-
if (!sentinelPath) return;
|
|
81
|
-
|
|
82
|
-
try {
|
|
83
|
-
fs.rmSync(path.dirname(sentinelPath), { recursive: true, force: true });
|
|
84
|
-
} catch {
|
|
85
|
-
// Best-effort cleanup.
|
|
86
|
-
}
|
|
87
|
-
}
|
|
@@ -1,184 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Stop words for context ID generation.
|
|
3
|
-
*
|
|
4
|
-
* Generated from analysis of 1,424 prompts, context summaries, and plan files.
|
|
5
|
-
* Words that appear frequently but don't help identify the specific task.
|
|
6
|
-
*
|
|
7
|
-
* ACTION VERBS ARE INTENTIONALLY EXCLUDED:
|
|
8
|
-
* add, fix, update, create, implement, refactor, migrate, debug, remove, change,
|
|
9
|
-
* move, rename, delete, build, test, deploy, verify, analyze, modify, write, run,
|
|
10
|
-
* check, replace, save, sync, load, extract, install, clean, merge, etc.
|
|
11
|
-
*
|
|
12
|
-
* See SPEC.md §14.1
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
export const STOP_WORDS: ReadonlySet<string> = new Set([
|
|
16
|
-
// ARTICLES
|
|
17
|
-
"a", "about", "above",
|
|
18
|
-
|
|
19
|
-
"absolutely", "accordingly", "across", "active", "actually", "after", "afterwards", "against", "ago", "ah",
|
|
20
|
-
"aiw", "all", "allow", "almost", "along", "already", "alright", "also",
|
|
21
|
-
"alternatively", "although", "always", // AUXILIARY/MODAL VERBS
|
|
22
|
-
"am", "among", "an", // CONJUNCTIONS
|
|
23
|
-
"and", "another",
|
|
24
|
-
"any", "anybody", "anyone", "anything", "anyway", "anyways", "apparently", "appear",
|
|
25
|
-
"are", "aren", "arent", "args", "around", "as", "ask",
|
|
26
|
-
"assert", "async", "at", // SINGLE LETTERS
|
|
27
|
-
"b",
|
|
28
|
-
|
|
29
|
-
"based", "basic", "basically", "bat", "be", "because", "become",
|
|
30
|
-
"been", "before", "begin", "behind", "being",
|
|
31
|
-
"below", "below", "beside", "besides", "between", "beyond", "block",
|
|
32
|
-
|
|
33
|
-
"both", "but", "by", "c", "can", "cant", "case",
|
|
34
|
-
"cases", "cause", "cc", "certainly", "chunk",
|
|
35
|
-
|
|
36
|
-
"clarification", "class", "clearly", "come",
|
|
37
|
-
|
|
38
|
-
"complete", "completely", "consequently", "consider",
|
|
39
|
-
|
|
40
|
-
"const", "contain", "contains", "continue", "conversely", "correct",
|
|
41
|
-
"correctly", "could", "couldn", "couldnt", "critical", "current",
|
|
42
|
-
"currently", "d",
|
|
43
|
-
|
|
44
|
-
"def", "definitely", "dict", "did", "didn", "didnt", "different", "directory",
|
|
45
|
-
"do", "does", "doesn", "doesn",
|
|
46
|
-
"doesnt", "doing", "don", "done", "dont",
|
|
47
|
-
"down", "during", "e", "each", "eh", "eight", "either", "elif", "else",
|
|
48
|
-
|
|
49
|
-
"empty", "end", "enough", "entirely", "eprint", "er",
|
|
50
|
-
"essentially", // SHORT NOISE
|
|
51
|
-
"etc", "eventually", "every", "everybody", "everyone", "everything",
|
|
52
|
-
"exactly", "example", "examples", "except", "exe",
|
|
53
|
-
|
|
54
|
-
"existing", "expect", "expected", "f", "false",
|
|
55
|
-
|
|
56
|
-
"feature", "features", "feel", "few", "finally", "find", "first",
|
|
57
|
-
"five", "folder", "follow", "following", "footer", "for", "format",
|
|
58
|
-
"four", "from", "full", "furthermore", "g",
|
|
59
|
-
"general", "get", "getting", "give",
|
|
60
|
-
|
|
61
|
-
// COMMON NON-ACTION VERBS
|
|
62
|
-
"go", "going", "gonna", "gotta",
|
|
63
|
-
"group", "h", "had", "hadn", "hadnt", "has", "hasn",
|
|
64
|
-
"hasnt", "have", "haven", "havent", "having", "he", "header",
|
|
65
|
-
|
|
66
|
-
"hello", "help", "hence", "her", "her", // ADVERBS OF PLACE/TIME
|
|
67
|
-
"here", "heres", "hers", "herself",
|
|
68
|
-
"hes", "hey", "hi", // GENERIC ADJECTIVES
|
|
69
|
-
"high", "him", "himself", "his", "hm",
|
|
70
|
-
"hmm", "how",
|
|
71
|
-
|
|
72
|
-
// LINKING/TRANSITION WORDS
|
|
73
|
-
"however", "huh", // PRONOUNS - Personal
|
|
74
|
-
"i", "id", "if", "ill", // CONTRACTED FORMS
|
|
75
|
-
"im",
|
|
76
|
-
"immediately", "import", "important", "in", "include", "index", // GENERIC TECHNICAL NOUNS
|
|
77
|
-
"information",
|
|
78
|
-
"inside", "instead", "into", "is", "isn",
|
|
79
|
-
"isnt", "issue", "it", "item", "items", "its",
|
|
80
|
-
"itself", "ive", "j", "js", "json",
|
|
81
|
-
|
|
82
|
-
// FILLER/HEDGE WORDS
|
|
83
|
-
"just", "k", "keep", "kind", "kinda", "know", "l", "lambda", "last",
|
|
84
|
-
"later", "least", "len", "less", "let", "lets", "level", "like",
|
|
85
|
-
"likewise", "line", "lines", "list", "literally",
|
|
86
|
-
"ll", "look", "looking", "low", "m", "main",
|
|
87
|
-
|
|
88
|
-
"make", "making", "manual", "many", "may", "maybe", "md",
|
|
89
|
-
"me", "mean", "meanwhile", "method", "might", "mine", "mode",
|
|
90
|
-
"more", "moreover", "most", "much", "multiple", "must",
|
|
91
|
-
|
|
92
|
-
// PRONOUNS - Possessive
|
|
93
|
-
"my", "myself", "n", "nah", "near", "nearly", "need", "needed",
|
|
94
|
-
"neither", "never", "nevertheless", "new", "next", "nine", // NEGATION
|
|
95
|
-
"no", "nobody",
|
|
96
|
-
"none", "none", "nonetheless", "no one", "nope", "nor",
|
|
97
|
-
"not", "nothing", "now", "o", "obviously", "of",
|
|
98
|
-
"off", "often",
|
|
99
|
-
|
|
100
|
-
"oh", "ok", "okay", "on", "one", "ones",
|
|
101
|
-
"only", "onto", "option", "optional", "options",
|
|
102
|
-
"or", "other", "otherwise", "our", "ours",
|
|
103
|
-
|
|
104
|
-
"ourselves", "out", "outside", "over", "overall", "p", "part", "parts", "pass",
|
|
105
|
-
|
|
106
|
-
"per", "perhaps", "phase",
|
|
107
|
-
"pl", "please",
|
|
108
|
-
"point", "points", "possibly", "pretty", "previously", "primary", "probably",
|
|
109
|
-
"process", "proper", "provide", "provided", "purpose",
|
|
110
|
-
"put", // FILE EXTENSIONS
|
|
111
|
-
"py", "q", "question", // QUERY LANGUAGE
|
|
112
|
-
"questions",
|
|
113
|
-
"quite", "r", "rather",
|
|
114
|
-
|
|
115
|
-
// FRAGMENT WORDS
|
|
116
|
-
"re", "real", "really", "recently",
|
|
117
|
-
|
|
118
|
-
"region", "remain", "require",
|
|
119
|
-
|
|
120
|
-
"required", "result", "return", "right", "s", "same", "say",
|
|
121
|
-
"secondary", // DOCUMENT/CODE STRUCTURE
|
|
122
|
-
"section", "see", "seem",
|
|
123
|
-
// PROGRAMMING KEYWORDS
|
|
124
|
-
"self", "set", "seven", "several",
|
|
125
|
-
"shall", "she", "shes", "should",
|
|
126
|
-
"shouldn", "shouldnt", "show", "similarly", "simple",
|
|
127
|
-
|
|
128
|
-
"simply", "since", "single", "six", "so", // QUANTIFIERS
|
|
129
|
-
"some", "somebody", // PRONOUNS - Indefinite
|
|
130
|
-
"someone",
|
|
131
|
-
"something", "sometimes", "somewhat", "soon", "sorta", "source", "specific", "stable",
|
|
132
|
-
"start", "state", "status", "stay", // STRUCTURAL WORDS
|
|
133
|
-
"step", "steps",
|
|
134
|
-
|
|
135
|
-
"still", "str", "stuff", "such", "sys", "t",
|
|
136
|
-
"take", "tell", "ten", "that", "thats", "the",
|
|
137
|
-
"their", "theirs", "them", "themselves", "then", "there",
|
|
138
|
-
|
|
139
|
-
"therefore", "theres", "these", "they", "theyre", "theyve",
|
|
140
|
-
// OVERLY GENERIC TERMS
|
|
141
|
-
"thing", "things", "think", // PRONOUNS - Demonstrative
|
|
142
|
-
"this", "those", "though", "three",
|
|
143
|
-
"through", "thus", "time", "times",
|
|
144
|
-
|
|
145
|
-
// PREPOSITIONS
|
|
146
|
-
"to", "today", "toml", "tomorrow", // SHORT FILLER
|
|
147
|
-
"too", "totally",
|
|
148
|
-
"toward", "towards", "true", "try", "trying", "ts",
|
|
149
|
-
|
|
150
|
-
// NUMBER WORDS
|
|
151
|
-
"two", "type", "types", "u", "uh", // SPEECH-TO-TEXT FILLERS (STT artifacts from voice input)
|
|
152
|
-
"um", "under", "unless",
|
|
153
|
-
|
|
154
|
-
"until", "up", "upon", "us", "used", "uses", // COMMON CODING TERMS
|
|
155
|
-
"using",
|
|
156
|
-
"v", "value", "ve", "version", "very", "via", "w",
|
|
157
|
-
"wanna", // COMMON REQUEST PHRASES
|
|
158
|
-
"want", "was", "wasn", "wasnt", "way", "ways",
|
|
159
|
-
"we", "well", "were", "weren", "werent", "weve", // QUESTION WORDS
|
|
160
|
-
"what",
|
|
161
|
-
"whats", "when", "whenever", "where", "whereas",
|
|
162
|
-
|
|
163
|
-
"wherever", "whether", "which", "while",
|
|
164
|
-
|
|
165
|
-
// PRONOUNS - Relative
|
|
166
|
-
"who", "whom", "whos", "whose", "why", "will", "with", "within", "without",
|
|
167
|
-
|
|
168
|
-
"won", "wont", "work", "working", "works", "would", "wouldn", "wouldnt", "x", "y", "yaml", "yeah", "yep", "yes",
|
|
169
|
-
"yesterday", "yet", "yield", "you", "youll", "your", "youre", "yours",
|
|
170
|
-
|
|
171
|
-
"yourself", "youve", "yup", "z",
|
|
172
|
-
]);
|
|
173
|
-
|
|
174
|
-
/**
|
|
175
|
-
* Filter stop words from text.
|
|
176
|
-
* Splits on whitespace, removes words in STOP_WORDS set and single-char words.
|
|
177
|
-
* See SPEC.md §6.4
|
|
178
|
-
*/
|
|
179
|
-
export function filterStopWords(text: string): string {
|
|
180
|
-
return text
|
|
181
|
-
.split(/\s+/)
|
|
182
|
-
.filter((word) => word.length > 1 && !STOP_WORDS.has(word.toLowerCase()))
|
|
183
|
-
.join(" ");
|
|
184
|
-
}
|