aiwcli 0.11.1 → 0.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/clear.d.ts +8 -0
- package/dist/commands/clear.js +86 -0
- package/dist/lib/bmad-installer.d.ts +2 -27
- package/dist/lib/bmad-installer.js +3 -43
- package/dist/lib/claude-settings-types.d.ts +2 -1
- package/dist/lib/env-compat.d.ts +0 -8
- package/dist/lib/env-compat.js +0 -12
- package/dist/lib/git/index.d.ts +0 -1
- package/dist/lib/gitignore-manager.d.ts +0 -2
- package/dist/lib/gitignore-manager.js +1 -1
- package/dist/lib/hooks-merger.d.ts +1 -15
- package/dist/lib/hooks-merger.js +1 -1
- package/dist/lib/index.d.ts +3 -7
- package/dist/lib/index.js +3 -11
- package/dist/lib/output.d.ts +2 -1
- package/dist/lib/settings-hierarchy.d.ts +1 -13
- package/dist/lib/settings-hierarchy.js +1 -1
- package/dist/lib/template-installer.d.ts +5 -9
- package/dist/lib/template-installer.js +3 -13
- package/dist/lib/template-linter.d.ts +3 -10
- package/dist/lib/template-linter.js +2 -2
- package/dist/lib/template-resolver.d.ts +6 -0
- package/dist/lib/template-resolver.js +10 -0
- package/dist/lib/template-settings-reconstructor.d.ts +1 -1
- package/dist/lib/template-settings-reconstructor.js +17 -24
- package/dist/lib/terminal.d.ts +3 -14
- package/dist/lib/terminal.js +0 -4
- package/dist/lib/version.d.ts +2 -11
- package/dist/lib/version.js +3 -3
- package/dist/lib/windsurf-hooks-merger.d.ts +1 -15
- package/dist/lib/windsurf-hooks-merger.js +1 -1
- package/dist/templates/_shared/.codex/workflows/handoff.md +1 -1
- package/dist/templates/_shared/.windsurf/workflows/handoff.md +1 -1
- package/dist/templates/_shared/hooks-ts/session_end.ts +75 -4
- package/dist/templates/_shared/hooks-ts/session_start.ts +11 -13
- package/dist/templates/_shared/hooks-ts/user_prompt_submit.ts +6 -8
- package/dist/templates/_shared/lib-ts/CLAUDE.md +56 -7
- package/dist/templates/_shared/lib-ts/base/hook-utils.ts +176 -29
- package/dist/templates/_shared/lib-ts/base/logger.ts +1 -1
- package/dist/templates/_shared/lib-ts/base/state-io.ts +11 -2
- package/dist/templates/_shared/lib-ts/base/subprocess-utils.ts +181 -165
- package/dist/templates/_shared/lib-ts/context/plan-manager.ts +14 -13
- package/dist/templates/_shared/lib-ts/handoff/handoff-reader.ts +3 -2
- package/dist/templates/_shared/lib-ts/package.json +1 -2
- package/dist/templates/_shared/lib-ts/templates/plan-context.ts +27 -34
- package/dist/templates/_shared/lib-ts/types.ts +17 -2
- package/dist/templates/_shared/scripts/resume_handoff.ts +4 -4
- package/dist/templates/_shared/scripts/save_handoff.ts +7 -7
- package/dist/templates/_shared/scripts/status_line.ts +104 -71
- package/dist/templates/_shared/workflows/handoff.md +1 -1
- package/dist/templates/cc-native/.claude/settings.json +182 -175
- package/dist/templates/cc-native/_cc-native/agents/CLAUDE.md +23 -1
- package/dist/templates/cc-native/_cc-native/agents/plan-questions/PLAN-QUESTIONER.md +70 -0
- package/dist/templates/cc-native/_cc-native/hooks/CLAUDE.md +6 -1
- package/dist/templates/cc-native/_cc-native/hooks/cc-native-plan-review.ts +142 -111
- package/dist/templates/cc-native/_cc-native/hooks/enhance_plan_post_subagent.ts +54 -0
- package/dist/templates/cc-native/_cc-native/hooks/enhance_plan_post_write.ts +52 -0
- package/dist/templates/cc-native/_cc-native/hooks/mark_questions_asked.ts +53 -0
- package/dist/templates/cc-native/_cc-native/hooks/plan_questions_early.ts +19 -19
- package/dist/templates/cc-native/_cc-native/lib-ts/aggregate-agents.ts +6 -5
- package/dist/templates/cc-native/_cc-native/lib-ts/artifacts.ts +114 -83
- package/dist/templates/cc-native/_cc-native/lib-ts/cc-native-state.ts +107 -10
- package/dist/templates/cc-native/_cc-native/lib-ts/cli-output-parser.ts +1 -1
- package/dist/templates/cc-native/_cc-native/lib-ts/corroboration.ts +6 -2
- package/dist/templates/cc-native/_cc-native/lib-ts/index.ts +0 -4
- package/dist/templates/cc-native/_cc-native/lib-ts/orchestrator.ts +40 -219
- package/dist/templates/cc-native/_cc-native/lib-ts/plan-enhancement.ts +41 -0
- package/dist/templates/cc-native/_cc-native/lib-ts/plan-questions.ts +102 -0
- package/dist/templates/cc-native/_cc-native/lib-ts/reviewers/agent.ts +26 -227
- package/dist/templates/cc-native/_cc-native/lib-ts/reviewers/base/base-agent.ts +217 -0
- package/dist/templates/cc-native/_cc-native/lib-ts/reviewers/index.ts +4 -2
- package/dist/templates/cc-native/_cc-native/lib-ts/reviewers/providers/claude-agent.ts +65 -0
- package/dist/templates/cc-native/_cc-native/lib-ts/reviewers/providers/codex-agent.ts +185 -0
- package/dist/templates/cc-native/_cc-native/lib-ts/reviewers/providers/gemini-agent.ts +39 -0
- package/dist/templates/cc-native/_cc-native/lib-ts/reviewers/providers/orchestrator-claude-agent.ts +195 -0
- package/dist/templates/cc-native/_cc-native/lib-ts/reviewers/schemas.ts +201 -0
- package/dist/templates/cc-native/_cc-native/lib-ts/reviewers/types.ts +2 -2
- package/dist/templates/cc-native/_cc-native/lib-ts/state.ts +17 -16
- package/dist/templates/cc-native/_cc-native/lib-ts/types.ts +13 -108
- package/dist/templates/cc-native/_cc-native/lib-ts/verdict.ts +3 -3
- package/dist/templates/cc-native/_cc-native/plan-review.config.json +2 -14
- package/oclif.manifest.json +1 -1
- package/package.json +1 -2
- package/dist/templates/cc-native/_cc-native/hooks/add_plan_context.ts +0 -119
- package/dist/templates/cc-native/_cc-native/lib-ts/reviewers/codex.ts +0 -130
- package/dist/templates/cc-native/_cc-native/lib-ts/reviewers/gemini.ts +0 -107
- /package/dist/templates/cc-native/_cc-native/agents/{ARCH-EVOLUTION.md → plan-review/ARCH-EVOLUTION.md} +0 -0
- /package/dist/templates/cc-native/_cc-native/agents/{ARCH-PATTERNS.md → plan-review/ARCH-PATTERNS.md} +0 -0
- /package/dist/templates/cc-native/_cc-native/agents/{ARCH-STRUCTURE.md → plan-review/ARCH-STRUCTURE.md} +0 -0
- /package/dist/templates/cc-native/_cc-native/agents/{ASSUMPTION-TRACER.md → plan-review/ASSUMPTION-TRACER.md} +0 -0
- /package/dist/templates/cc-native/_cc-native/agents/{CLARITY-AUDITOR.md → plan-review/CLARITY-AUDITOR.md} +0 -0
- /package/dist/templates/cc-native/_cc-native/agents/{COMPLETENESS-FEASIBILITY.md → plan-review/COMPLETENESS-FEASIBILITY.md} +0 -0
- /package/dist/templates/cc-native/_cc-native/agents/{COMPLETENESS-GAPS.md → plan-review/COMPLETENESS-GAPS.md} +0 -0
- /package/dist/templates/cc-native/_cc-native/agents/{COMPLETENESS-ORDERING.md → plan-review/COMPLETENESS-ORDERING.md} +0 -0
- /package/dist/templates/cc-native/_cc-native/agents/{CONSTRAINT-VALIDATOR.md → plan-review/CONSTRAINT-VALIDATOR.md} +0 -0
- /package/dist/templates/cc-native/_cc-native/agents/{DESIGN-ADR-VALIDATOR.md → plan-review/DESIGN-ADR-VALIDATOR.md} +0 -0
- /package/dist/templates/cc-native/_cc-native/agents/{DESIGN-SCALE-MATCHER.md → plan-review/DESIGN-SCALE-MATCHER.md} +0 -0
- /package/dist/templates/cc-native/_cc-native/agents/{DEVILS-ADVOCATE.md → plan-review/DEVILS-ADVOCATE.md} +0 -0
- /package/dist/templates/cc-native/_cc-native/agents/{DOCUMENTATION-PHILOSOPHY.md → plan-review/DOCUMENTATION-PHILOSOPHY.md} +0 -0
- /package/dist/templates/cc-native/_cc-native/agents/{HANDOFF-READINESS.md → plan-review/HANDOFF-READINESS.md} +0 -0
- /package/dist/templates/cc-native/_cc-native/agents/{HIDDEN-COMPLEXITY.md → plan-review/HIDDEN-COMPLEXITY.md} +0 -0
- /package/dist/templates/cc-native/_cc-native/agents/{INCREMENTAL-DELIVERY.md → plan-review/INCREMENTAL-DELIVERY.md} +0 -0
- /package/dist/templates/cc-native/_cc-native/agents/{RISK-DEPENDENCY.md → plan-review/RISK-DEPENDENCY.md} +0 -0
- /package/dist/templates/cc-native/_cc-native/agents/{RISK-FMEA.md → plan-review/RISK-FMEA.md} +0 -0
- /package/dist/templates/cc-native/_cc-native/agents/{RISK-PREMORTEM.md → plan-review/RISK-PREMORTEM.md} +0 -0
- /package/dist/templates/cc-native/_cc-native/agents/{RISK-REVERSIBILITY.md → plan-review/RISK-REVERSIBILITY.md} +0 -0
- /package/dist/templates/cc-native/_cc-native/agents/{SCOPE-BOUNDARY.md → plan-review/SCOPE-BOUNDARY.md} +0 -0
- /package/dist/templates/cc-native/_cc-native/agents/{SIMPLICITY-GUARDIAN.md → plan-review/SIMPLICITY-GUARDIAN.md} +0 -0
- /package/dist/templates/cc-native/_cc-native/agents/{SKEPTIC.md → plan-review/SKEPTIC.md} +0 -0
- /package/dist/templates/cc-native/_cc-native/agents/{TESTDRIVEN-BEHAVIOR-AUDITOR.md → plan-review/TESTDRIVEN-BEHAVIOR-AUDITOR.md} +0 -0
- /package/dist/templates/cc-native/_cc-native/agents/{TESTDRIVEN-CHARACTERIZATION.md → plan-review/TESTDRIVEN-CHARACTERIZATION.md} +0 -0
- /package/dist/templates/cc-native/_cc-native/agents/{TESTDRIVEN-FIRST-VALIDATOR.md → plan-review/TESTDRIVEN-FIRST-VALIDATOR.md} +0 -0
- /package/dist/templates/cc-native/_cc-native/agents/{TESTDRIVEN-PYRAMID-ANALYZER.md → plan-review/TESTDRIVEN-PYRAMID-ANALYZER.md} +0 -0
- /package/dist/templates/cc-native/_cc-native/agents/{TRADEOFF-COSTS.md → plan-review/TRADEOFF-COSTS.md} +0 -0
- /package/dist/templates/cc-native/_cc-native/agents/{TRADEOFF-STAKEHOLDERS.md → plan-review/TRADEOFF-STAKEHOLDERS.md} +0 -0
- /package/dist/templates/cc-native/_cc-native/agents/{VERIFY-COVERAGE.md → plan-review/VERIFY-COVERAGE.md} +0 -0
- /package/dist/templates/cc-native/_cc-native/agents/{VERIFY-STRENGTH.md → plan-review/VERIFY-STRENGTH.md} +0 -0
|
@@ -5,14 +5,14 @@
|
|
|
5
5
|
* Renders context window usage and git status with ANSI colors.
|
|
6
6
|
* Optionally persists context_window data to the session's state.json.
|
|
7
7
|
*
|
|
8
|
-
*
|
|
8
|
+
* Context and git sections only.
|
|
9
9
|
*
|
|
10
10
|
* Usage: echo '{"session_id":"...","model":{"display_name":"Opus"},...}' | bun status_line.ts
|
|
11
11
|
*/
|
|
12
|
-
import * as fs from "node:fs";
|
|
13
|
-
import * as path from "node:path";
|
|
14
12
|
import { execFileSync } from "node:child_process";
|
|
13
|
+
import * as fs from "node:fs";
|
|
15
14
|
import { homedir } from "node:os";
|
|
15
|
+
import * as path from "node:path";
|
|
16
16
|
|
|
17
17
|
import { CONTEXT_BASELINE_TOKENS } from "../lib-ts/base/hook-utils.js";
|
|
18
18
|
import { getContextBySessionId, getContext, loadState, saveState } from "../lib-ts/context/context-store.js";
|
|
@@ -31,37 +31,37 @@ const STATUSLINE_CACHE = path.join(CACHE_DIR, ".statusline-cache.json");
|
|
|
31
31
|
// ---------------------------------------------------------------------------
|
|
32
32
|
const NO_COLOR = Boolean(process.env.NO_COLOR);
|
|
33
33
|
|
|
34
|
-
const RESET = NO_COLOR ? "" : "\
|
|
34
|
+
const RESET = NO_COLOR ? "" : "\u001B[0m";
|
|
35
35
|
|
|
36
36
|
// Structural
|
|
37
|
-
const SLATE_300 = NO_COLOR ? "" : "\
|
|
38
|
-
const SLATE_400 = NO_COLOR ? "" : "\
|
|
39
|
-
const SLATE_500 = NO_COLOR ? "" : "\
|
|
40
|
-
const SLATE_600 = NO_COLOR ? "" : "\
|
|
37
|
+
const SLATE_300 = NO_COLOR ? "" : "\u001B[38;2;203;213;225m";
|
|
38
|
+
const SLATE_400 = NO_COLOR ? "" : "\u001B[38;2;148;163;184m";
|
|
39
|
+
const SLATE_500 = NO_COLOR ? "" : "\u001B[38;2;100;116;139m";
|
|
40
|
+
const SLATE_600 = NO_COLOR ? "" : "\u001B[38;2;71;85;105m";
|
|
41
41
|
|
|
42
42
|
// Semantic
|
|
43
|
-
const EMERALD = NO_COLOR ? "" : "\
|
|
44
|
-
const ROSE = NO_COLOR ? "" : "\
|
|
45
|
-
const AMBER = NO_COLOR ? "" : "\
|
|
43
|
+
const EMERALD = NO_COLOR ? "" : "\u001B[38;2;74;222;128m";
|
|
44
|
+
const ROSE = NO_COLOR ? "" : "\u001B[38;2;251;113;133m";
|
|
45
|
+
const AMBER = NO_COLOR ? "" : "\u001B[38;2;251;191;36m";
|
|
46
46
|
|
|
47
47
|
// Context colors
|
|
48
|
-
const CTX_PRIMARY = NO_COLOR ? "" : "\
|
|
49
|
-
const CTX_SECONDARY = NO_COLOR ? "" : "\
|
|
50
|
-
const CTX_ACCENT = NO_COLOR ? "" : "\
|
|
51
|
-
const CTX_BUCKET_EMPTY = NO_COLOR ? "" : "\
|
|
48
|
+
const CTX_PRIMARY = NO_COLOR ? "" : "\u001B[38;2;129;140;248m";
|
|
49
|
+
const CTX_SECONDARY = NO_COLOR ? "" : "\u001B[38;2;165;180;252m";
|
|
50
|
+
const CTX_ACCENT = NO_COLOR ? "" : "\u001B[38;2;139;92;246m";
|
|
51
|
+
const CTX_BUCKET_EMPTY = NO_COLOR ? "" : "\u001B[38;2;75;82;95m";
|
|
52
52
|
|
|
53
53
|
// Git colors
|
|
54
|
-
const GIT_PRIMARY = NO_COLOR ? "" : "\
|
|
55
|
-
const GIT_VALUE = NO_COLOR ? "" : "\
|
|
56
|
-
const GIT_DIR = NO_COLOR ? "" : "\
|
|
57
|
-
const GIT_CLEAN = NO_COLOR ? "" : "\
|
|
58
|
-
const GIT_MODIFIED = NO_COLOR ? "" : "\
|
|
59
|
-
const GIT_ADDED = NO_COLOR ? "" : "\
|
|
60
|
-
const GIT_STASH = NO_COLOR ? "" : "\
|
|
61
|
-
const GIT_AGE_FRESH = NO_COLOR ? "" : "\
|
|
62
|
-
const GIT_AGE_RECENT = NO_COLOR ? "" : "\
|
|
63
|
-
const GIT_AGE_STALE = NO_COLOR ? "" : "\
|
|
64
|
-
const GIT_AGE_OLD = NO_COLOR ? "" : "\
|
|
54
|
+
const GIT_PRIMARY = NO_COLOR ? "" : "\u001B[38;2;56;189;248m";
|
|
55
|
+
const GIT_VALUE = NO_COLOR ? "" : "\u001B[38;2;186;230;253m";
|
|
56
|
+
const GIT_DIR = NO_COLOR ? "" : "\u001B[38;2;147;197;253m";
|
|
57
|
+
const GIT_CLEAN = NO_COLOR ? "" : "\u001B[38;2;125;211;252m";
|
|
58
|
+
const GIT_MODIFIED = NO_COLOR ? "" : "\u001B[38;2;96;165;250m";
|
|
59
|
+
const GIT_ADDED = NO_COLOR ? "" : "\u001B[38;2;59;130;246m";
|
|
60
|
+
const GIT_STASH = NO_COLOR ? "" : "\u001B[38;2;165;180;252m";
|
|
61
|
+
const GIT_AGE_FRESH = NO_COLOR ? "" : "\u001B[38;2;125;211;252m";
|
|
62
|
+
const GIT_AGE_RECENT = NO_COLOR ? "" : "\u001B[38;2;96;165;250m";
|
|
63
|
+
const GIT_AGE_STALE = NO_COLOR ? "" : "\u001B[38;2;59;130;246m";
|
|
64
|
+
const GIT_AGE_OLD = NO_COLOR ? "" : "\u001B[38;2;99;102;241m";
|
|
65
65
|
|
|
66
66
|
// ---------------------------------------------------------------------------
|
|
67
67
|
// Display modes
|
|
@@ -96,7 +96,7 @@ function getBucketColor(pos: number, maxPos: number): string {
|
|
|
96
96
|
if (NO_COLOR) return "";
|
|
97
97
|
const pct = Math.floor((pos * 100) / maxPos);
|
|
98
98
|
|
|
99
|
-
let
|
|
99
|
+
let b: number; let g: number; let r: number;
|
|
100
100
|
|
|
101
101
|
if (pct <= 33) {
|
|
102
102
|
r = 74 + Math.floor(((250 - 74) * pct) / 33);
|
|
@@ -114,7 +114,7 @@ function getBucketColor(pos: number, maxPos: number): string {
|
|
|
114
114
|
b = 60 + Math.floor(((68 - 60) * t) / 34);
|
|
115
115
|
}
|
|
116
116
|
|
|
117
|
-
return `\
|
|
117
|
+
return `\u001B[38;2;${r};${g};${b}m`;
|
|
118
118
|
}
|
|
119
119
|
|
|
120
120
|
// ---------------------------------------------------------------------------
|
|
@@ -131,9 +131,9 @@ function renderContextBar(width: number, pct: number): [string, string] {
|
|
|
131
131
|
if (i <= filled) {
|
|
132
132
|
const color = getBucketColor(i, width);
|
|
133
133
|
lastColor = color;
|
|
134
|
-
parts.push(`${color}\
|
|
134
|
+
parts.push(`${color}\u26C1${RESET}`);
|
|
135
135
|
} else {
|
|
136
|
-
parts.push(`${CTX_BUCKET_EMPTY}\
|
|
136
|
+
parts.push(`${CTX_BUCKET_EMPTY}\u26C1${RESET}`);
|
|
137
137
|
}
|
|
138
138
|
if (width > 8) {
|
|
139
139
|
parts.push(" ");
|
|
@@ -184,40 +184,51 @@ function renderContext(
|
|
|
184
184
|
|
|
185
185
|
const shortModel = shortenModel(modelName);
|
|
186
186
|
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
console.log(
|
|
190
|
-
`${CTX_PRIMARY}\u25c9${RESET} ${CTX_ACCENT}${shortModel}${RESET} ` +
|
|
191
|
-
`${bar} ${pctColor}${contextPct}%${RESET} ` +
|
|
192
|
-
`${CTX_ACCENT}\u23f1${RESET} ${SLATE_300}${timeDisplay}${RESET}`,
|
|
193
|
-
);
|
|
194
|
-
} else if (mode === "micro") {
|
|
187
|
+
switch (mode) {
|
|
188
|
+
case "micro": {
|
|
195
189
|
const [bar] = renderContextBar(6, contextPct);
|
|
196
190
|
console.log(
|
|
197
|
-
`${CTX_PRIMARY}\
|
|
191
|
+
`${CTX_PRIMARY}\u25C9${RESET} ${CTX_ACCENT}${shortModel}${RESET} ` +
|
|
198
192
|
`${SLATE_600}\u2502${RESET} ` +
|
|
199
193
|
`${bar} ${pctColor}${contextPct}%${RESET} ${SLATE_500}(${contextK}k)${RESET} ` +
|
|
200
|
-
`${CTX_ACCENT}\
|
|
194
|
+
`${CTX_ACCENT}\u23F1${RESET} ${SLATE_300}${timeDisplay}${RESET}`,
|
|
201
195
|
);
|
|
202
|
-
|
|
196
|
+
|
|
197
|
+
break;
|
|
198
|
+
}
|
|
199
|
+
case "mini": {
|
|
203
200
|
const [bar] = renderContextBar(8, contextPct);
|
|
204
201
|
console.log(
|
|
205
|
-
`${CTX_PRIMARY}\
|
|
202
|
+
`${CTX_PRIMARY}\u25C9${RESET} ${CTX_ACCENT}${shortModel}${RESET} ` +
|
|
206
203
|
`${SLATE_600}\u2502${RESET} ` +
|
|
207
204
|
`${CTX_SECONDARY}CTX:${RESET} ${bar} ` +
|
|
208
205
|
`${pctColor}${contextPct}%${RESET} ${SLATE_500}(${contextK}k/${maxK}k)${RESET} ` +
|
|
209
|
-
`${CTX_ACCENT}\
|
|
206
|
+
`${CTX_ACCENT}\u23F1${RESET} ${SLATE_300}${timeDisplay}${RESET}`,
|
|
210
207
|
);
|
|
211
|
-
|
|
208
|
+
|
|
209
|
+
break;
|
|
210
|
+
}
|
|
211
|
+
case "nano": {
|
|
212
|
+
const [bar] = renderContextBar(5, contextPct);
|
|
213
|
+
console.log(
|
|
214
|
+
`${CTX_PRIMARY}\u25C9${RESET} ${CTX_ACCENT}${shortModel}${RESET} ` +
|
|
215
|
+
`${bar} ${pctColor}${contextPct}%${RESET} ` +
|
|
216
|
+
`${CTX_ACCENT}\u23F1${RESET} ${SLATE_300}${timeDisplay}${RESET}`,
|
|
217
|
+
);
|
|
218
|
+
|
|
219
|
+
break;
|
|
220
|
+
}
|
|
221
|
+
default: {
|
|
212
222
|
const [bar, lastColor] = renderContextBar(16, contextPct);
|
|
213
223
|
console.log(
|
|
214
|
-
`${CTX_PRIMARY}\
|
|
224
|
+
`${CTX_PRIMARY}\u25C9${RESET} ${CTX_SECONDARY}Model:${RESET} ${CTX_ACCENT}${shortModel}${RESET} ` +
|
|
215
225
|
`${SLATE_600}\u2502${RESET} ` +
|
|
216
226
|
`${CTX_SECONDARY}Context:${RESET} ${bar} ` +
|
|
217
227
|
`${lastColor}${contextPct}%${RESET} ${SLATE_500}(${contextK}k/${maxK}k)${RESET} ` +
|
|
218
228
|
`${SLATE_600}\u2502${RESET} ` +
|
|
219
|
-
`${CTX_ACCENT}\
|
|
229
|
+
`${CTX_ACCENT}\u23F1${RESET} ${SLATE_300}${timeDisplay}${RESET}`,
|
|
220
230
|
);
|
|
231
|
+
}
|
|
221
232
|
}
|
|
222
233
|
|
|
223
234
|
console.log(SEPARATOR);
|
|
@@ -310,7 +321,7 @@ function getGitStatus(cwd: string): GitStatus | null {
|
|
|
310
321
|
const ageSec = nowEpoch - lastEpoch;
|
|
311
322
|
const ageMin = Math.floor(ageSec / 60);
|
|
312
323
|
const ageHrs = Math.floor(ageSec / 3600);
|
|
313
|
-
const ageDays = Math.floor(ageSec /
|
|
324
|
+
const ageDays = Math.floor(ageSec / 86_400);
|
|
314
325
|
|
|
315
326
|
if (ageMin < 1) {
|
|
316
327
|
status.age_display = "now";
|
|
@@ -338,16 +349,9 @@ function renderGit(mode: string, git: GitStatus, dirName: string): void {
|
|
|
338
349
|
const totalChanged = git.modified + git.staged;
|
|
339
350
|
const statusIcon = (totalChanged > 0 || git.untracked > 0) ? "*" : "\u2713";
|
|
340
351
|
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
line += `${GIT_CLEAN}\u2713${RESET}`;
|
|
345
|
-
} else {
|
|
346
|
-
line += `${GIT_MODIFIED}*${totalChanged}${RESET}`;
|
|
347
|
-
}
|
|
348
|
-
console.log(line);
|
|
349
|
-
} else if (mode === "micro") {
|
|
350
|
-
let line = `${GIT_PRIMARY}\u25c8${RESET} ${GIT_DIR}${dirName}${RESET} ${GIT_VALUE}${git.branch}${RESET}`;
|
|
352
|
+
switch (mode) {
|
|
353
|
+
case "micro": {
|
|
354
|
+
let line = `${GIT_PRIMARY}\u25C8${RESET} ${GIT_DIR}${dirName}${RESET} ${GIT_VALUE}${git.branch}${RESET}`;
|
|
351
355
|
if (git.age_display) {
|
|
352
356
|
line += ` ${git.age_color}${git.age_display}${RESET}`;
|
|
353
357
|
}
|
|
@@ -358,9 +362,12 @@ function renderGit(mode: string, git: GitStatus, dirName: string): void {
|
|
|
358
362
|
line += `${GIT_MODIFIED}${statusIcon}${totalChanged}${RESET}`;
|
|
359
363
|
}
|
|
360
364
|
console.log(line);
|
|
361
|
-
|
|
365
|
+
|
|
366
|
+
break;
|
|
367
|
+
}
|
|
368
|
+
case "mini": {
|
|
362
369
|
let line =
|
|
363
|
-
`${GIT_PRIMARY}\
|
|
370
|
+
`${GIT_PRIMARY}\u25C8${RESET} ${GIT_DIR}${dirName}${RESET} ` +
|
|
364
371
|
`${SLATE_600}\u2502${RESET} ${GIT_VALUE}${git.branch}${RESET}`;
|
|
365
372
|
if (git.age_display) {
|
|
366
373
|
line += ` ${SLATE_600}\u2502${RESET} ${git.age_color}${git.age_display}${RESET}`;
|
|
@@ -375,9 +382,23 @@ function renderGit(mode: string, git: GitStatus, dirName: string): void {
|
|
|
375
382
|
}
|
|
376
383
|
}
|
|
377
384
|
console.log(line);
|
|
378
|
-
|
|
385
|
+
|
|
386
|
+
break;
|
|
387
|
+
}
|
|
388
|
+
case "nano": {
|
|
389
|
+
let line = `${GIT_PRIMARY}\u25C8${RESET} ${GIT_DIR}${dirName}${RESET} ${GIT_VALUE}${git.branch}${RESET} `;
|
|
390
|
+
if (statusIcon === "\u2713") {
|
|
391
|
+
line += `${GIT_CLEAN}\u2713${RESET}`;
|
|
392
|
+
} else {
|
|
393
|
+
line += `${GIT_MODIFIED}*${totalChanged}${RESET}`;
|
|
394
|
+
}
|
|
395
|
+
console.log(line);
|
|
396
|
+
|
|
397
|
+
break;
|
|
398
|
+
}
|
|
399
|
+
default: {
|
|
379
400
|
let line =
|
|
380
|
-
`${GIT_PRIMARY}\
|
|
401
|
+
`${GIT_PRIMARY}\u25C8${RESET} ${GIT_PRIMARY}PWD:${RESET} ${GIT_DIR}${dirName}${RESET} ` +
|
|
381
402
|
`${SLATE_600}\u2502${RESET} ` +
|
|
382
403
|
`${GIT_PRIMARY}Branch:${RESET} ${GIT_VALUE}${git.branch}${RESET}`;
|
|
383
404
|
if (git.age_display) {
|
|
@@ -410,6 +431,7 @@ function renderGit(mode: string, git: GitStatus, dirName: string): void {
|
|
|
410
431
|
}
|
|
411
432
|
}
|
|
412
433
|
console.log(line);
|
|
434
|
+
}
|
|
413
435
|
}
|
|
414
436
|
}
|
|
415
437
|
|
|
@@ -493,25 +515,36 @@ function renderContextManager(
|
|
|
493
515
|
planPart = ` ${SLATE_600}\u2502${RESET} ${CTX_SECONDARY}Plan:${RESET} ${SLATE_300}${truncatedPlan}${RESET}`;
|
|
494
516
|
}
|
|
495
517
|
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
518
|
+
switch (mode) {
|
|
519
|
+
case "micro": {
|
|
520
|
+
console.log(`${CTX_ACCENT}\u25C6${RESET} ${SLATE_400}${truncatedId}${RESET}${modeBadge}`);
|
|
521
|
+
|
|
522
|
+
break;
|
|
523
|
+
}
|
|
524
|
+
case "mini": {
|
|
501
525
|
console.log(
|
|
502
|
-
`${CTX_ACCENT}\
|
|
526
|
+
`${CTX_ACCENT}\u25C6${RESET} ${SLATE_400}${truncatedId}${RESET}` +
|
|
503
527
|
`${modeBadge}${planPart}`,
|
|
504
528
|
);
|
|
505
|
-
|
|
529
|
+
|
|
530
|
+
break;
|
|
531
|
+
}
|
|
532
|
+
case "nano": {
|
|
533
|
+
console.log(`${CTX_ACCENT}\u25C6${RESET} ${SLATE_400}${truncatedId}${RESET}${modeBadge}`);
|
|
534
|
+
|
|
535
|
+
break;
|
|
536
|
+
}
|
|
537
|
+
default: {
|
|
506
538
|
console.log(
|
|
507
|
-
`${CTX_ACCENT}\
|
|
539
|
+
`${CTX_ACCENT}\u25C6${RESET} ${CTX_SECONDARY}Context:${RESET} ${SLATE_300}${truncatedId}${RESET}` +
|
|
508
540
|
`${modeBadge}${planPart}`,
|
|
509
541
|
);
|
|
542
|
+
}
|
|
510
543
|
}
|
|
511
544
|
}
|
|
512
545
|
|
|
513
546
|
function renderNoContext(mode: string): void {
|
|
514
|
-
const warn = `${ROSE}\
|
|
547
|
+
const warn = `${ROSE}\u26A0 ${RESET}`;
|
|
515
548
|
if (mode === "normal") {
|
|
516
549
|
console.log(`${warn} ${ROSE}NO CONTEXT${RESET} ${SLATE_500}\u2014 type ^ for context manager${RESET}`);
|
|
517
550
|
} else {
|
|
@@ -620,7 +653,7 @@ function main(): void {
|
|
|
620
653
|
const inputTokens: number = usage.input_tokens ?? 0;
|
|
621
654
|
const cacheCreation: number = usage.cache_creation_input_tokens ?? 0;
|
|
622
655
|
const outputTokens: number = usage.output_tokens ?? 0;
|
|
623
|
-
const contextMax: number = ctxWin.context_window_size ??
|
|
656
|
+
const contextMax: number = ctxWin.context_window_size ?? 200_000;
|
|
624
657
|
|
|
625
658
|
// Calculate context percentage
|
|
626
659
|
const usedPct = ctxWin.used_percentage;
|
|
@@ -150,7 +150,7 @@ If a plan document path was provided in `$ARGUMENTS`:
|
|
|
150
150
|
Instead of writing the file directly, pipe your handoff content to the save script:
|
|
151
151
|
|
|
152
152
|
```bash
|
|
153
|
-
|
|
153
|
+
bun .aiwcli/_shared/scripts/save_handoff.ts "{context_id}" <<'EOF'
|
|
154
154
|
{Your complete handoff markdown content from Step 3}
|
|
155
155
|
EOF
|
|
156
156
|
```
|