aiwcli 0.15.4 → 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
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import * as fs from "node:fs";
|
|
8
|
-
import
|
|
8
|
+
import path from "node:path";
|
|
9
9
|
|
|
10
10
|
import { atomicWrite } from "./atomic-write.js";
|
|
11
11
|
import { getContextDir } from "./constants.js";
|
|
@@ -118,11 +118,11 @@ export function readStateJson(
|
|
|
118
118
|
if (!fs.existsSync(sp)) return null;
|
|
119
119
|
|
|
120
120
|
try {
|
|
121
|
-
const raw = fs.readFileSync(sp, "
|
|
122
|
-
const data = JSON.parse(raw) as Record<string,
|
|
121
|
+
const raw = fs.readFileSync(sp, "utf8");
|
|
122
|
+
const data = JSON.parse(raw) as Record<string, unknown>;
|
|
123
123
|
migrateConsumedFlags(data); // Migrate before dictToState
|
|
124
124
|
return dictToState(data);
|
|
125
|
-
} catch (error:
|
|
125
|
+
} catch (error: unknown) {
|
|
126
126
|
logWarn("state_io", `Failed to read state.json for '${contextId}': ${error}`);
|
|
127
127
|
return null;
|
|
128
128
|
}
|
|
@@ -142,7 +142,8 @@ export function writeStateJson(
|
|
|
142
142
|
fs.mkdirSync(dir, { recursive: true });
|
|
143
143
|
|
|
144
144
|
const content = JSON.stringify(toDict(state), null, 2);
|
|
145
|
-
|
|
145
|
+
// fsync: false — state.json is reconstructable from context folder contents
|
|
146
|
+
return atomicWrite(sp, content, 2, [500, 1000], false);
|
|
146
147
|
}
|
|
147
148
|
|
|
148
149
|
/**
|
|
@@ -159,7 +160,7 @@ export function dictToState(data: Record<string, unknown>): ContextState {
|
|
|
159
160
|
typeof data.mode === "string" ? data.mode : "idle";
|
|
160
161
|
const mode: Mode = (MODE_MIGRATION[rawMode] ?? rawMode) as Mode;
|
|
161
162
|
|
|
162
|
-
const state:
|
|
163
|
+
const state: Record<string, unknown> = {
|
|
163
164
|
id: data.id,
|
|
164
165
|
status: data.status ?? "active",
|
|
165
166
|
summary: data.summary ?? "",
|
|
@@ -199,5 +200,8 @@ export function dictToState(data: Record<string, unknown>): ContextState {
|
|
|
199
200
|
}
|
|
200
201
|
}
|
|
201
202
|
|
|
202
|
-
return state as ContextState;
|
|
203
|
+
return state as unknown as ContextState;
|
|
203
204
|
}
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
|
|
@@ -0,0 +1,185 @@
|
|
|
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
|
+
"anybody", "anyone", "anything", "anyway", "anyways", "apparently", "appear", "are",
|
|
25
|
+
"aren", "arent", "args", "around", "as", "ask", "assert",
|
|
26
|
+
"async", "at", "b", // SINGLE LETTERS
|
|
27
|
+
"based",
|
|
28
|
+
|
|
29
|
+
"basic", "basically", "bat", "be", "because", "become", "been",
|
|
30
|
+
"before", "begin", "behind", "being", "below",
|
|
31
|
+
"below", "beside", "besides", "between", "beyond", "block", "both",
|
|
32
|
+
|
|
33
|
+
"but", "by", "c", "can", "cant", "case", "cases",
|
|
34
|
+
"cause", "cc", "certainly", "chunk", "clarification",
|
|
35
|
+
|
|
36
|
+
"class", "clearly", "come", "complete",
|
|
37
|
+
|
|
38
|
+
"completely", "consequently", "consider", "const",
|
|
39
|
+
|
|
40
|
+
"contain", "contains", "continue", "conversely", "correct", "correctly",
|
|
41
|
+
"could", "couldn", "couldnt", "critical", "current", "currently",
|
|
42
|
+
"d", "def",
|
|
43
|
+
|
|
44
|
+
"definitely", "dict", "did", "didn", "didnt", "different", "directory", "do",
|
|
45
|
+
"does", "doesn", "doesn", "doesnt",
|
|
46
|
+
"doing", "don", "done", "dont", "down",
|
|
47
|
+
"during", "e", "each", "eh", "eight", "either", "elif", "else", "empty",
|
|
48
|
+
|
|
49
|
+
"end", "enough", "entirely", "eprint", "er", "essentially", // SHORT NOISE
|
|
50
|
+
"etc",
|
|
51
|
+
"eventually", "every", "everybody", "everyone", "everything", "exactly",
|
|
52
|
+
"example", "examples", "except", "exe", "existing",
|
|
53
|
+
|
|
54
|
+
"expect", "expected", "f", "false", "feature",
|
|
55
|
+
|
|
56
|
+
"features", "feel", "few", "finally", "find", "first", "five",
|
|
57
|
+
"folder", "follow", "following", "footer", "for", "format", "four",
|
|
58
|
+
"from", "full", "furthermore", "g", "general",
|
|
59
|
+
"get", "getting", "give", // COMMON NON-ACTION VERBS
|
|
60
|
+
"go",
|
|
61
|
+
|
|
62
|
+
"going", "gonna", "gotta", "group",
|
|
63
|
+
"h", "had", "hadn", "hadnt", "has", "hasn", "hasnt",
|
|
64
|
+
"have", "haven", "havent", "having", "he", "header", "hello",
|
|
65
|
+
|
|
66
|
+
"help", "hence", "her", "her", "here", // ADVERBS OF PLACE/TIME
|
|
67
|
+
"heres", "hers", "herself", "hes",
|
|
68
|
+
"hey", "hi", "high", // GENERIC ADJECTIVES
|
|
69
|
+
"him", "himself", "his", "hm", "hmm",
|
|
70
|
+
"how", // LINKING/TRANSITION WORDS
|
|
71
|
+
"however",
|
|
72
|
+
|
|
73
|
+
"huh", "i", // PRONOUNS - Personal
|
|
74
|
+
"id", "if", "ill", "im", // CONTRACTED FORMS
|
|
75
|
+
"immediately",
|
|
76
|
+
"import", "important", "in", "include", "index", "information", // GENERIC TECHNICAL NOUNS
|
|
77
|
+
"inside",
|
|
78
|
+
"instead", "into", "is", "isn", "isnt",
|
|
79
|
+
"issue", "it", "item", "items", "its", "itself",
|
|
80
|
+
"ive", "j", "js", "json", // FILLER/HEDGE WORDS
|
|
81
|
+
"just",
|
|
82
|
+
|
|
83
|
+
"k", "keep", "kind", "kinda", "know", "l", "lambda", "last", "later",
|
|
84
|
+
"least", "len", "less", "let", "lets", "level", "like", "likewise",
|
|
85
|
+
"line", "lines", "list", "literally", "ll",
|
|
86
|
+
"look", "looking", "low", "m", "main", "make",
|
|
87
|
+
|
|
88
|
+
"making", "manual", "many", "may", "maybe", "md", "me",
|
|
89
|
+
"mean", "meanwhile", "method", "might", "mine", "mode", "more",
|
|
90
|
+
"moreover", "most", "much", "multiple", "must", // PRONOUNS - Possessive
|
|
91
|
+
"my",
|
|
92
|
+
|
|
93
|
+
"myself", "n", "nah", "near", "nearly", "need", "needed", "neither",
|
|
94
|
+
"never", "nevertheless", "new", "next", "nine", "no", // NEGATION
|
|
95
|
+
"nobody", "none",
|
|
96
|
+
"none", "nonetheless", "no one", "nope", "nor", "not",
|
|
97
|
+
"nothing", "now", "o", "obviously", "of", "off",
|
|
98
|
+
"often", "oh",
|
|
99
|
+
|
|
100
|
+
"ok", "okay", "on", "one", "ones", "only",
|
|
101
|
+
"onto", "option", "optional", "options", "or",
|
|
102
|
+
"other", "otherwise", "our", "ours", "ourselves",
|
|
103
|
+
|
|
104
|
+
"out", "outside", "over", "overall", "p", "part", "parts", "pass", "per",
|
|
105
|
+
|
|
106
|
+
"perhaps", "phase", "pl",
|
|
107
|
+
"please", "point",
|
|
108
|
+
"points", "possibly", "pretty", "previously", "primary", "probably", "process",
|
|
109
|
+
"proper", "provide", "provided", "purpose", "put", // FILE EXTENSIONS
|
|
110
|
+
"py",
|
|
111
|
+
"q", "question", "questions", // QUERY LANGUAGE
|
|
112
|
+
"quite",
|
|
113
|
+
"r", "rather", // FRAGMENT WORDS
|
|
114
|
+
"re",
|
|
115
|
+
|
|
116
|
+
"real", "really", "recently", "region",
|
|
117
|
+
|
|
118
|
+
"remain", "require", "required",
|
|
119
|
+
|
|
120
|
+
"result", "return", "right", "s", "same", "say", "secondary", // DOCUMENT/CODE STRUCTURE
|
|
121
|
+
"section",
|
|
122
|
+
"see", "seem", // PROGRAMMING KEYWORDS
|
|
123
|
+
"self",
|
|
124
|
+
"set", "seven", "several", "shall",
|
|
125
|
+
"she", "shes", "should", "shouldn",
|
|
126
|
+
"shouldnt", "show", "similarly", "simple", "simply",
|
|
127
|
+
|
|
128
|
+
"since", "single", "six", "so", "some", // QUANTIFIERS
|
|
129
|
+
"somebody", "someone", // PRONOUNS - Indefinite
|
|
130
|
+
"something",
|
|
131
|
+
"sometimes", "somewhat", "soon", "sorta", "source", "specific", "stable", "start",
|
|
132
|
+
"state", "status", "stay", "step", // STRUCTURAL WORDS
|
|
133
|
+
"steps", "still",
|
|
134
|
+
|
|
135
|
+
"str", "stuff", "such", "sys", "t", "take",
|
|
136
|
+
"tell", "ten", "that", "thats", "the", "their",
|
|
137
|
+
"theirs", "them", "themselves", "then", "there", "therefore",
|
|
138
|
+
|
|
139
|
+
"theres", "these", "they", "theyre", "theyve", // OVERLY GENERIC TERMS
|
|
140
|
+
"thing",
|
|
141
|
+
"things", "think", "this", // PRONOUNS - Demonstrative
|
|
142
|
+
"those", "though", "three", "through",
|
|
143
|
+
"thus", "time", "times", // PREPOSITIONS
|
|
144
|
+
"to",
|
|
145
|
+
|
|
146
|
+
"today", "toml", "tomorrow", "too", // SHORT FILLER
|
|
147
|
+
"totally", "toward",
|
|
148
|
+
"towards", "true", "try", "trying", "ts", // NUMBER WORDS
|
|
149
|
+
"two",
|
|
150
|
+
|
|
151
|
+
"type", "types", "u", "uh", "um", // SPEECH-TO-TEXT FILLERS (STT artifacts from voice input)
|
|
152
|
+
"under", "unknown", "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
|
+
}
|
|
185
|
+
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { execFile } from 'node:child_process'
|
|
2
|
+
import type { ChildProcess } from 'node:child_process'
|
|
3
|
+
|
|
4
|
+
import { resolveExecutable } from './executable-policy.js'
|
|
5
|
+
|
|
6
|
+
const childProcesses = new Set<ChildProcess>()
|
|
7
|
+
|
|
8
|
+
function cleanupChildren(): void {
|
|
9
|
+
for (const child of childProcesses) {
|
|
10
|
+
try {
|
|
11
|
+
child.kill('SIGKILL')
|
|
12
|
+
} catch {
|
|
13
|
+
// Child may have already exited.
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
childProcesses.clear()
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
process.on('exit', () => {
|
|
21
|
+
cleanupChildren()
|
|
22
|
+
})
|
|
23
|
+
|
|
24
|
+
process.on('SIGINT', () => {
|
|
25
|
+
cleanupChildren()
|
|
26
|
+
process.exit(130)
|
|
27
|
+
})
|
|
28
|
+
|
|
29
|
+
process.on('SIGTERM', () => {
|
|
30
|
+
cleanupChildren()
|
|
31
|
+
process.exit(143)
|
|
32
|
+
})
|
|
33
|
+
|
|
34
|
+
export function isInternalCall(): boolean {
|
|
35
|
+
return process.env.AIWCLI_INTERNAL_CALL === 'true'
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export function getInternalSubprocessEnv(): Record<string, string | undefined> {
|
|
39
|
+
const env: Record<string, string | undefined> = {
|
|
40
|
+
...process.env,
|
|
41
|
+
AIWCLI_INTERNAL_CALL: 'true',
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
delete env.CLAUDECODE
|
|
45
|
+
delete env.CLAUDE_CODE_ENTRYPOINT
|
|
46
|
+
return env
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export function findExecutable(name: string): string | null {
|
|
50
|
+
return resolveExecutable(name, { windowsProfile: 'cmdOrExeFirst' })
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export interface ExecSyncError {
|
|
54
|
+
killed: boolean
|
|
55
|
+
signal: string | null
|
|
56
|
+
stdout: Buffer | string
|
|
57
|
+
stderr: Buffer | string
|
|
58
|
+
status: number | null
|
|
59
|
+
message: string
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export function isExecSyncError(error: unknown): error is ExecSyncError {
|
|
63
|
+
return typeof error === 'object' && error !== null && 'killed' in error && 'signal' in error
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export function normalizePathForCli(pathValue: string): string {
|
|
67
|
+
if (process.platform !== 'win32') return pathValue
|
|
68
|
+
return pathValue.replaceAll('\\', '/')
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export function shellQuoteWin(arg: string): string {
|
|
72
|
+
if (process.platform !== 'win32') return arg
|
|
73
|
+
return '"' + arg.replaceAll('"', '""') + '"'
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export interface ExecResult {
|
|
77
|
+
stdout: string
|
|
78
|
+
stderr: string
|
|
79
|
+
exitCode: number
|
|
80
|
+
killed: boolean
|
|
81
|
+
signal: string | null
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export interface ExecAsyncOptions {
|
|
85
|
+
input?: string | undefined
|
|
86
|
+
timeout?: number | undefined
|
|
87
|
+
env?: Record<string, string | undefined> | undefined
|
|
88
|
+
maxBuffer?: number | undefined
|
|
89
|
+
shell?: boolean | undefined
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export function execFileAsync(
|
|
93
|
+
file: string,
|
|
94
|
+
args: string[],
|
|
95
|
+
options?: ExecAsyncOptions,
|
|
96
|
+
): Promise<ExecResult> {
|
|
97
|
+
return new Promise((resolve) => {
|
|
98
|
+
const child = execFile(
|
|
99
|
+
file,
|
|
100
|
+
args,
|
|
101
|
+
{
|
|
102
|
+
encoding: 'utf8',
|
|
103
|
+
timeout: options?.timeout ?? 0,
|
|
104
|
+
env: options?.env as NodeJS.ProcessEnv,
|
|
105
|
+
maxBuffer: options?.maxBuffer ?? 10 * 1024 * 1024,
|
|
106
|
+
shell: options?.shell,
|
|
107
|
+
},
|
|
108
|
+
(error, stdout, stderr) => {
|
|
109
|
+
if (error) {
|
|
110
|
+
const errObj = error as unknown as Record<string, unknown>
|
|
111
|
+
resolve({
|
|
112
|
+
stdout: String(stdout ?? ''),
|
|
113
|
+
stderr: String(stderr ?? ''),
|
|
114
|
+
exitCode:
|
|
115
|
+
typeof errObj.code === 'number'
|
|
116
|
+
? errObj.code
|
|
117
|
+
: typeof errObj.status === 'number'
|
|
118
|
+
? errObj.status
|
|
119
|
+
: 1,
|
|
120
|
+
killed: Boolean(errObj.killed),
|
|
121
|
+
signal: typeof errObj.signal === 'string' ? errObj.signal : null,
|
|
122
|
+
})
|
|
123
|
+
} else {
|
|
124
|
+
resolve({
|
|
125
|
+
stdout: String(stdout ?? ''),
|
|
126
|
+
stderr: String(stderr ?? ''),
|
|
127
|
+
exitCode: 0,
|
|
128
|
+
killed: false,
|
|
129
|
+
signal: null,
|
|
130
|
+
})
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
)
|
|
134
|
+
|
|
135
|
+
childProcesses.add(child)
|
|
136
|
+
child.on('exit', () => {
|
|
137
|
+
childProcesses.delete(child)
|
|
138
|
+
})
|
|
139
|
+
|
|
140
|
+
if (options?.input !== null && options?.input !== undefined && child.stdin) {
|
|
141
|
+
child.stdin.write(options.input)
|
|
142
|
+
child.stdin.end()
|
|
143
|
+
}
|
|
144
|
+
})
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { execFileSync } from 'node:child_process'
|
|
2
|
+
import { existsSync } from 'node:fs'
|
|
3
|
+
|
|
4
|
+
import { isCommandAvailable, lookupExecutables } from './executable-policy.js'
|
|
5
|
+
import { isWindowsPlatform } from './platform-adapter.js'
|
|
6
|
+
|
|
7
|
+
export function selectMsysBashFromLookupPaths(paths: string[]): null | string {
|
|
8
|
+
for (const candidate of paths) {
|
|
9
|
+
const trimmed = candidate.trim()
|
|
10
|
+
if (trimmed && /git|msys|mingw/iu.test(trimmed)) return trimmed
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
return null
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function deriveMsysBashFromGitPath(gitPath: string): null | string {
|
|
17
|
+
const trimmed = gitPath.trim()
|
|
18
|
+
if (!trimmed) return null
|
|
19
|
+
|
|
20
|
+
const gitMatch = trimmed.match(/^(.+[/\\]Git)[/\\]cmd[/\\]git\.exe$/iu)
|
|
21
|
+
if (!gitMatch?.[1]) return null
|
|
22
|
+
return `${gitMatch[1]}\\usr\\bin\\bash.exe`
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export function findMsysBash(): null | string {
|
|
26
|
+
const directBash = selectMsysBashFromLookupPaths(lookupExecutables('bash', { platform: 'win32' }))
|
|
27
|
+
if (directBash) return directBash
|
|
28
|
+
|
|
29
|
+
const gitCandidates = lookupExecutables('git', { platform: 'win32' })
|
|
30
|
+
for (const candidate of gitCandidates) {
|
|
31
|
+
const derived = deriveMsysBashFromGitPath(candidate)
|
|
32
|
+
if (derived && existsSync(derived)) return derived
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const knownPaths = [
|
|
36
|
+
String.raw`C:\Program Files\Git\usr\bin\bash.exe`,
|
|
37
|
+
String.raw`C:\Program Files (x86)\Git\usr\bin\bash.exe`,
|
|
38
|
+
]
|
|
39
|
+
|
|
40
|
+
for (const knownPath of knownPaths) {
|
|
41
|
+
if (existsSync(knownPath)) return knownPath
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
return null
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export function isTmuxReachableViaBash(bashPath: string): boolean {
|
|
48
|
+
try {
|
|
49
|
+
execFileSync(bashPath, ['-lc', 'tmux -V'], {
|
|
50
|
+
timeout: 3000,
|
|
51
|
+
stdio: 'ignore',
|
|
52
|
+
env: { ...process.env, MSYS_NO_PATHCONV: '1' },
|
|
53
|
+
windowsHide: true,
|
|
54
|
+
})
|
|
55
|
+
return true
|
|
56
|
+
} catch {
|
|
57
|
+
return false
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export function isNativeTmuxAvailable(platform: NodeJS.Platform = process.platform): boolean {
|
|
62
|
+
return isCommandAvailable('tmux', platform)
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/** Find psmux (native Windows terminal multiplexer) on PATH. */
|
|
66
|
+
export function findPsmux(): null | string {
|
|
67
|
+
if (!isWindowsPlatform()) return null
|
|
68
|
+
const candidates = lookupExecutables('psmux', { platform: 'win32' })
|
|
69
|
+
return candidates[0]?.trim() || null
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export interface WindowsTmuxPreflight {
|
|
73
|
+
available: boolean
|
|
74
|
+
bashPath?: string
|
|
75
|
+
reason?: string
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export function preflightWindowsTmux(): WindowsTmuxPreflight {
|
|
79
|
+
if (!isWindowsPlatform()) {
|
|
80
|
+
return { available: false, reason: 'not running on Windows' }
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
const bashPath = findMsysBash()
|
|
84
|
+
if (!bashPath) {
|
|
85
|
+
return { available: false, reason: 'Git Bash not found' }
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
if (!isTmuxReachableViaBash(bashPath)) {
|
|
89
|
+
return { available: false, bashPath, reason: 'tmux not available in Git Bash' }
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
return { available: true, bashPath }
|
|
93
|
+
}
|
|
@@ -10,7 +10,7 @@ import { STOP_WORDS } from "./stop-words.js";
|
|
|
10
10
|
/**
|
|
11
11
|
* Print to stderr. For terminal-only UX messages, not diagnostics.
|
|
12
12
|
*/
|
|
13
|
-
export function eprint(...args:
|
|
13
|
+
export function eprint(...args: unknown[]): void {
|
|
14
14
|
process.stderr.write(args.map(String).join(" ") + "\n");
|
|
15
15
|
}
|
|
16
16
|
|
|
@@ -127,7 +127,7 @@ export function generateSlug(
|
|
|
127
127
|
);
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
|
-
} catch (error:
|
|
130
|
+
} catch (error: unknown) {
|
|
131
131
|
logWarn("utils", `AI slug generation failed, using fallback: ${error}`);
|
|
132
132
|
}
|
|
133
133
|
|
|
@@ -171,7 +171,7 @@ export function generateContextId(
|
|
|
171
171
|
try {
|
|
172
172
|
const slug = generateSlug(summary);
|
|
173
173
|
baseId = `${timestamp}-${slug}`;
|
|
174
|
-
} catch (error:
|
|
174
|
+
} catch (error: unknown) {
|
|
175
175
|
logError(
|
|
176
176
|
"utils",
|
|
177
177
|
`Context ID generation failed entirely, using timestamp: ${error}`,
|
|
@@ -190,3 +190,4 @@ export function generateContextId(
|
|
|
190
190
|
|
|
191
191
|
return `${baseId}-${counter}`;
|
|
192
192
|
}
|
|
193
|
+
|
|
@@ -32,13 +32,14 @@ export function getStatusIcon(status: string): string {
|
|
|
32
32
|
|
|
33
33
|
// §13.3 — Task rendering
|
|
34
34
|
export function renderTaskItem(
|
|
35
|
-
task: Record<string,
|
|
35
|
+
task: Record<string, unknown> | Task,
|
|
36
36
|
showDescription = true,
|
|
37
37
|
maxDescriptionLength = 100,
|
|
38
38
|
): string {
|
|
39
|
-
const
|
|
40
|
-
const
|
|
41
|
-
const
|
|
39
|
+
const taskData = task as Partial<Task> & Record<string, unknown>;
|
|
40
|
+
const status = typeof taskData.status === "string" ? taskData.status : "pending";
|
|
41
|
+
const subject = typeof taskData.subject === "string" ? taskData.subject : "";
|
|
42
|
+
const description = typeof taskData.description === "string" ? taskData.description : "";
|
|
42
43
|
|
|
43
44
|
const icon = getStatusIcon(status);
|
|
44
45
|
const statusText = `[${status.toUpperCase()}]`;
|
|
@@ -57,7 +58,7 @@ export function renderTaskItem(
|
|
|
57
58
|
}
|
|
58
59
|
|
|
59
60
|
export function renderTaskList(
|
|
60
|
-
tasks: Array<Record<string,
|
|
61
|
+
tasks: Array<Record<string, unknown> | Task>,
|
|
61
62
|
header = "Active Tasks",
|
|
62
63
|
showDescription = true,
|
|
63
64
|
): string {
|
|
@@ -102,3 +103,4 @@ export const REASON_MAP: Record<string, string> = {
|
|
|
102
103
|
export function formatReason(reason: string): string {
|
|
103
104
|
return REASON_MAP[reason] ?? reason;
|
|
104
105
|
}
|
|
106
|
+
|
|
@@ -29,7 +29,7 @@ What exactly to build or change
|
|
|
29
29
|
- \`exact/path/to/reference.ext\` — Why relevant (e.g., "pattern to follow at lines 12-30")
|
|
30
30
|
|
|
31
31
|
## Steps
|
|
32
|
-
Numbered steps with specific details. For each step, consider whether
|
|
32
|
+
Numbered steps with specific details. For each step, consider whether unknown of the skills available in your system-reminder messages would help the implementation agent — if so, reference the skill inline at the point of use.
|
|
33
33
|
|
|
34
34
|
1. [Specific action with function names, patterns, or code snippets]
|
|
35
35
|
2. [Enough detail for someone who never saw this conversation]
|
|
@@ -56,3 +56,4 @@ The implementation agent should document these so the next session inherits what
|
|
|
56
56
|
- [ ] Are relevant skills referenced where they add value?
|
|
57
57
|
- [ ] Are key decisions captured so they survive this session?`;
|
|
58
58
|
}
|
|
59
|
+
|