pi-crew 0.1.45 → 0.1.49
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/CHANGELOG.md +97 -0
- package/README.md +5 -5
- package/agents/analyst.md +11 -11
- package/agents/critic.md +11 -11
- package/agents/executor.md +11 -11
- package/agents/explorer.md +11 -11
- package/agents/planner.md +11 -11
- package/agents/reviewer.md +11 -11
- package/agents/security-reviewer.md +11 -11
- package/agents/test-engineer.md +11 -11
- package/agents/verifier.md +11 -11
- package/agents/writer.md +11 -11
- package/docs/next-upgrade-roadmap.md +808 -0
- package/docs/research/AGENT-EXECUTION-ARCHITECTURE.md +261 -0
- package/docs/research/AGENT-LIFECYCLE-COMPARISON.md +111 -0
- package/docs/research/AUDIT_OH_MY_PI.md +261 -0
- package/docs/research/AUDIT_PI_CREW.md +457 -0
- package/docs/research/CAVEMAN-DEEP-RESEARCH.md +281 -0
- package/docs/research/COMPARISON_OH_MY_PI_VS_PI_CREW.md +264 -0
- package/docs/research/DEEP-RESEARCH-PI-POWERBAR.md +343 -0
- package/docs/research/DEEP_RESEARCH_SUBAGENT_ARCHITECTURE.md +480 -0
- package/docs/research/GAP_CLOSURE_IMPLEMENTATION_PLAN.md +354 -0
- package/docs/research/IMPLEMENTATION_PLAN.md +385 -0
- package/docs/research/LIVE-SESSION-PRODUCTION-READY-PLAN.md +502 -0
- package/docs/research/OH-MY-PI-DEEP-RESEARCH-v14.7.6.md +266 -0
- package/docs/research/REMAINING-GAPS-PLAN.md +363 -0
- package/docs/research/SESSION-SUMMARY-2026-05-08.md +146 -0
- package/docs/research/UI-RESPONSIVENESS-AUDIT.md +173 -0
- package/docs/research-awesome-agent-skills-distillation.md +100 -0
- package/docs/research-oh-my-pi-distillation.md +369 -0
- package/docs/source-runtime-refactor-map.md +24 -0
- package/docs/usage.md +3 -3
- package/install.mjs +52 -8
- package/package.json +99 -98
- package/schema.json +10 -1
- package/skills/async-worker-recovery/SKILL.md +42 -0
- package/skills/context-artifact-hygiene/SKILL.md +52 -0
- package/skills/delegation-patterns/SKILL.md +54 -0
- package/skills/mailbox-interactive/SKILL.md +40 -0
- package/skills/model-routing-context/SKILL.md +39 -0
- package/skills/multi-perspective-review/SKILL.md +58 -0
- package/skills/observability-reliability/SKILL.md +41 -0
- package/skills/orchestration/SKILL.md +157 -0
- package/skills/ownership-session-security/SKILL.md +41 -0
- package/skills/pi-extension-lifecycle/SKILL.md +39 -0
- package/skills/requirements-to-task-packet/SKILL.md +63 -0
- package/skills/resource-discovery-config/SKILL.md +41 -0
- package/skills/runtime-state-reader/SKILL.md +44 -0
- package/skills/secure-agent-orchestration-review/SKILL.md +45 -0
- package/skills/state-mutation-locking/SKILL.md +42 -0
- package/skills/systematic-debugging/SKILL.md +67 -0
- package/skills/ui-render-performance/SKILL.md +39 -0
- package/skills/verification-before-done/SKILL.md +57 -0
- package/skills/worktree-isolation/SKILL.md +39 -0
- package/src/agents/agent-config.ts +6 -0
- package/src/agents/agent-search.ts +98 -0
- package/src/agents/agent-serializer.ts +38 -34
- package/src/agents/discover-agents.ts +29 -15
- package/src/config/config.ts +72 -24
- package/src/config/defaults.ts +25 -0
- package/src/extension/autonomous-policy.ts +26 -33
- package/src/extension/help.ts +1 -0
- package/src/extension/management.ts +5 -0
- package/src/extension/project-init.ts +62 -2
- package/src/extension/register.ts +69 -22
- package/src/extension/registration/commands.ts +64 -25
- package/src/extension/registration/compaction-guard.ts +1 -1
- package/src/extension/registration/subagent-helpers.ts +8 -0
- package/src/extension/registration/subagent-tools.ts +149 -148
- package/src/extension/registration/team-tool.ts +14 -10
- package/src/extension/run-index.ts +35 -21
- package/src/extension/run-maintenance.ts +30 -5
- package/src/extension/team-tool/api.ts +47 -9
- package/src/extension/team-tool/cancel.ts +109 -5
- package/src/extension/team-tool/context.ts +8 -0
- package/src/extension/team-tool/intent-policy.ts +42 -0
- package/src/extension/team-tool/lifecycle-actions.ts +120 -79
- package/src/extension/team-tool/parallel-dispatch.ts +156 -0
- package/src/extension/team-tool/respond.ts +46 -18
- package/src/extension/team-tool/run.ts +55 -12
- package/src/extension/team-tool/status.ts +13 -2
- package/src/extension/team-tool-types.ts +3 -0
- package/src/extension/team-tool.ts +45 -14
- package/src/hooks/registry.ts +61 -0
- package/src/hooks/types.ts +41 -0
- package/src/observability/event-to-metric.ts +8 -1
- package/src/runtime/agent-control.ts +169 -63
- package/src/runtime/async-runner.ts +3 -1
- package/src/runtime/background-runner.ts +78 -53
- package/src/runtime/cancellation-token.ts +89 -0
- package/src/runtime/cancellation.ts +61 -0
- package/src/runtime/capability-inventory.ts +116 -0
- package/src/runtime/child-pi.ts +458 -444
- package/src/runtime/code-summary.ts +247 -0
- package/src/runtime/crash-recovery.ts +182 -0
- package/src/runtime/crew-agent-records.ts +70 -10
- package/src/runtime/crew-agent-runtime.ts +1 -0
- package/src/runtime/custom-tools/irc-tool.ts +201 -0
- package/src/runtime/custom-tools/submit-result-tool.ts +90 -0
- package/src/runtime/deadletter.ts +1 -0
- package/src/runtime/delivery-coordinator.ts +48 -25
- package/src/runtime/effectiveness.ts +81 -0
- package/src/runtime/event-stream-bridge.ts +90 -0
- package/src/runtime/live-agent-control.ts +2 -1
- package/src/runtime/live-agent-manager.ts +179 -85
- package/src/runtime/live-control-realtime.ts +1 -1
- package/src/runtime/live-extension-bridge.ts +150 -0
- package/src/runtime/live-irc.ts +92 -0
- package/src/runtime/live-session-health.ts +100 -0
- package/src/runtime/live-session-runtime.ts +599 -305
- package/src/runtime/manifest-cache.ts +17 -2
- package/src/runtime/mcp-proxy.ts +113 -0
- package/src/runtime/model-fallback.ts +6 -4
- package/src/runtime/notebook-helpers.ts +90 -0
- package/src/runtime/orphan-sentinel.ts +7 -0
- package/src/runtime/output-validator.ts +187 -0
- package/src/runtime/parallel-utils.ts +57 -0
- package/src/runtime/parent-guard.ts +80 -0
- package/src/runtime/pi-args.ts +18 -3
- package/src/runtime/process-status.ts +5 -1
- package/src/runtime/prose-compressor.ts +164 -0
- package/src/runtime/result-extractor.ts +121 -0
- package/src/runtime/retry-executor.ts +81 -64
- package/src/runtime/runtime-resolver.ts +23 -10
- package/src/runtime/semaphore.ts +131 -0
- package/src/runtime/sensitive-paths.ts +92 -0
- package/src/runtime/skill-instructions.ts +222 -0
- package/src/runtime/stale-reconciler.ts +4 -14
- package/src/runtime/stream-preview.ts +177 -0
- package/src/runtime/subagent-manager.ts +6 -2
- package/src/runtime/subprocess-tool-registry.ts +67 -0
- package/src/runtime/task-output-context.ts +177 -127
- package/src/runtime/task-runner/capabilities.ts +78 -0
- package/src/runtime/task-runner/live-executor.ts +107 -101
- package/src/runtime/task-runner/prompt-builder.ts +72 -8
- package/src/runtime/task-runner/prompt-pipeline.ts +64 -0
- package/src/runtime/task-runner/run-projection.ts +104 -0
- package/src/runtime/task-runner.ts +115 -5
- package/src/runtime/team-runner.ts +134 -19
- package/src/runtime/workspace-tree.ts +298 -0
- package/src/runtime/yield-handler.ts +189 -0
- package/src/schema/config-schema.ts +7 -0
- package/src/schema/team-tool-schema.ts +14 -4
- package/src/skills/discover-skills.ts +67 -0
- package/src/state/active-run-registry.ts +167 -0
- package/src/state/artifact-store.ts +4 -1
- package/src/state/atomic-write.ts +50 -1
- package/src/state/blob-store.ts +117 -0
- package/src/state/contracts.ts +2 -1
- package/src/state/event-log-rotation.ts +158 -0
- package/src/state/event-log.ts +52 -2
- package/src/state/mailbox.ts +129 -9
- package/src/state/state-store.ts +32 -5
- package/src/state/types.ts +64 -2
- package/src/teams/team-config.ts +1 -0
- package/src/ui/agent-management-overlay.ts +144 -0
- package/src/ui/crew-widget.ts +15 -5
- package/src/ui/dashboard-panes/cancellation-pane.ts +43 -0
- package/src/ui/dashboard-panes/capability-pane.ts +60 -0
- package/src/ui/dashboard-panes/mailbox-pane.ts +35 -11
- package/src/ui/dashboard-panes/progress-pane.ts +2 -0
- package/src/ui/live-run-sidebar.ts +4 -0
- package/src/ui/powerbar-publisher.ts +77 -15
- package/src/ui/render-coalescer.ts +51 -0
- package/src/ui/run-dashboard.ts +4 -0
- package/src/ui/run-event-bus.ts +209 -0
- package/src/ui/run-snapshot-cache.ts +78 -18
- package/src/ui/snapshot-types.ts +10 -0
- package/src/ui/transcript-entries.ts +258 -0
- package/src/utils/ids.ts +5 -0
- package/src/utils/incremental-reader.ts +104 -0
- package/src/utils/paths.ts +4 -2
- package/src/utils/scan-cache.ts +137 -0
- package/src/utils/sse-parser.ts +134 -0
- package/src/utils/task-name-generator.ts +337 -0
- package/src/utils/visual.ts +33 -2
- package/src/workflows/workflow-config.ts +1 -0
- package/src/worktree/cleanup.ts +2 -1
|
@@ -0,0 +1,337 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Human-readable task name generator.
|
|
3
|
+
* Format: AdjectiveNoun (e.g., "SwiftFalcon", "CalmPanda")
|
|
4
|
+
*
|
|
5
|
+
* Curated lists of ~120 adjectives and ~120 animals/nouns.
|
|
6
|
+
* 120 × 120 = 14,400 combinations.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
const ADJECTIVES = [
|
|
10
|
+
"active",
|
|
11
|
+
"agile",
|
|
12
|
+
"alert",
|
|
13
|
+
"ancient",
|
|
14
|
+
"bold",
|
|
15
|
+
"brave",
|
|
16
|
+
"bright",
|
|
17
|
+
"brilliant",
|
|
18
|
+
"calm",
|
|
19
|
+
"capable",
|
|
20
|
+
"careful",
|
|
21
|
+
"charming",
|
|
22
|
+
"cheerful",
|
|
23
|
+
"clever",
|
|
24
|
+
"cloudy",
|
|
25
|
+
"cold",
|
|
26
|
+
"cool",
|
|
27
|
+
"curious",
|
|
28
|
+
"cute",
|
|
29
|
+
"daring",
|
|
30
|
+
"dark",
|
|
31
|
+
"deep",
|
|
32
|
+
"direct",
|
|
33
|
+
"eager",
|
|
34
|
+
"early",
|
|
35
|
+
"electric",
|
|
36
|
+
"elegant",
|
|
37
|
+
"energetic",
|
|
38
|
+
"enormous",
|
|
39
|
+
"epic",
|
|
40
|
+
"exact",
|
|
41
|
+
"exotic",
|
|
42
|
+
"fair",
|
|
43
|
+
"fancy",
|
|
44
|
+
"fast",
|
|
45
|
+
"fierce",
|
|
46
|
+
"firm",
|
|
47
|
+
"flat",
|
|
48
|
+
"flexible",
|
|
49
|
+
"fresh",
|
|
50
|
+
"friendly",
|
|
51
|
+
"full",
|
|
52
|
+
"fun",
|
|
53
|
+
"funny",
|
|
54
|
+
"gentle",
|
|
55
|
+
"global",
|
|
56
|
+
"golden",
|
|
57
|
+
"good",
|
|
58
|
+
"grand",
|
|
59
|
+
"grateful",
|
|
60
|
+
"great",
|
|
61
|
+
"green",
|
|
62
|
+
"happy",
|
|
63
|
+
"hard",
|
|
64
|
+
"heavy",
|
|
65
|
+
"hidden",
|
|
66
|
+
"honest",
|
|
67
|
+
"hot",
|
|
68
|
+
"huge",
|
|
69
|
+
"icy",
|
|
70
|
+
"ideal",
|
|
71
|
+
"keen",
|
|
72
|
+
"kind",
|
|
73
|
+
"large",
|
|
74
|
+
"lazy",
|
|
75
|
+
"light",
|
|
76
|
+
"lively",
|
|
77
|
+
"local",
|
|
78
|
+
"loud",
|
|
79
|
+
"lucky",
|
|
80
|
+
"magic",
|
|
81
|
+
"mighty",
|
|
82
|
+
"mild",
|
|
83
|
+
"modern",
|
|
84
|
+
"neat",
|
|
85
|
+
"new",
|
|
86
|
+
"nice",
|
|
87
|
+
"noble",
|
|
88
|
+
"odd",
|
|
89
|
+
"old",
|
|
90
|
+
"open",
|
|
91
|
+
"patient",
|
|
92
|
+
"perfect",
|
|
93
|
+
"plain",
|
|
94
|
+
"polite",
|
|
95
|
+
"popular",
|
|
96
|
+
"powerful",
|
|
97
|
+
"precise",
|
|
98
|
+
"pretty",
|
|
99
|
+
"proud",
|
|
100
|
+
"pure",
|
|
101
|
+
"quick",
|
|
102
|
+
"quiet",
|
|
103
|
+
"rapid",
|
|
104
|
+
"rare",
|
|
105
|
+
"real",
|
|
106
|
+
"rich",
|
|
107
|
+
"robust",
|
|
108
|
+
"round",
|
|
109
|
+
"royal",
|
|
110
|
+
"safe",
|
|
111
|
+
"sharp",
|
|
112
|
+
"short",
|
|
113
|
+
"shy",
|
|
114
|
+
"silent",
|
|
115
|
+
"simple",
|
|
116
|
+
"slim",
|
|
117
|
+
"smart",
|
|
118
|
+
"smooth",
|
|
119
|
+
"soft",
|
|
120
|
+
"solar",
|
|
121
|
+
"solid",
|
|
122
|
+
"steady",
|
|
123
|
+
"strange",
|
|
124
|
+
"strong",
|
|
125
|
+
"sunny",
|
|
126
|
+
"swift",
|
|
127
|
+
"tall",
|
|
128
|
+
"tame",
|
|
129
|
+
"tiny",
|
|
130
|
+
"tough",
|
|
131
|
+
"true",
|
|
132
|
+
"unique",
|
|
133
|
+
"vast",
|
|
134
|
+
"warm",
|
|
135
|
+
"wild",
|
|
136
|
+
"wise",
|
|
137
|
+
"zany",
|
|
138
|
+
"zen",
|
|
139
|
+
] as const;
|
|
140
|
+
|
|
141
|
+
const NOUNS = [
|
|
142
|
+
"albatross",
|
|
143
|
+
"ant",
|
|
144
|
+
"antelope",
|
|
145
|
+
"ape",
|
|
146
|
+
"archer",
|
|
147
|
+
"badger",
|
|
148
|
+
"bass",
|
|
149
|
+
"bat",
|
|
150
|
+
"bear",
|
|
151
|
+
"beaver",
|
|
152
|
+
"bee",
|
|
153
|
+
"beetle",
|
|
154
|
+
"bird",
|
|
155
|
+
"bison",
|
|
156
|
+
"boar",
|
|
157
|
+
"bobcat",
|
|
158
|
+
"bull",
|
|
159
|
+
"buzzard",
|
|
160
|
+
"camel",
|
|
161
|
+
"canary",
|
|
162
|
+
"carp",
|
|
163
|
+
"cat",
|
|
164
|
+
"cedar",
|
|
165
|
+
"cheetah",
|
|
166
|
+
"chicken",
|
|
167
|
+
"cobra",
|
|
168
|
+
"cod",
|
|
169
|
+
"condor",
|
|
170
|
+
"coral",
|
|
171
|
+
"cougar",
|
|
172
|
+
"crab",
|
|
173
|
+
"crane",
|
|
174
|
+
"cricket",
|
|
175
|
+
"crow",
|
|
176
|
+
"deer",
|
|
177
|
+
"dolphin",
|
|
178
|
+
"dove",
|
|
179
|
+
"dragon",
|
|
180
|
+
"duck",
|
|
181
|
+
"eagle",
|
|
182
|
+
"eel",
|
|
183
|
+
"elk",
|
|
184
|
+
"falcon",
|
|
185
|
+
"ferret",
|
|
186
|
+
"finch",
|
|
187
|
+
"flamingo",
|
|
188
|
+
"fox",
|
|
189
|
+
"frog",
|
|
190
|
+
"gazelle",
|
|
191
|
+
"gecko",
|
|
192
|
+
"ghost",
|
|
193
|
+
"gibbon",
|
|
194
|
+
"goat",
|
|
195
|
+
"goldfish",
|
|
196
|
+
"goose",
|
|
197
|
+
"gorilla",
|
|
198
|
+
"halibut",
|
|
199
|
+
"hamster",
|
|
200
|
+
"hare",
|
|
201
|
+
"hawk",
|
|
202
|
+
"heron",
|
|
203
|
+
"horse",
|
|
204
|
+
"hummingbird",
|
|
205
|
+
"hyena",
|
|
206
|
+
"ibis",
|
|
207
|
+
"iguana",
|
|
208
|
+
"impala",
|
|
209
|
+
"jackal",
|
|
210
|
+
"jaguar",
|
|
211
|
+
"jay",
|
|
212
|
+
"jellyfish",
|
|
213
|
+
"kangaroo",
|
|
214
|
+
"kite",
|
|
215
|
+
"kiwi",
|
|
216
|
+
"koala",
|
|
217
|
+
"krill",
|
|
218
|
+
"lark",
|
|
219
|
+
"lemur",
|
|
220
|
+
"leopard",
|
|
221
|
+
"lion",
|
|
222
|
+
"lizard",
|
|
223
|
+
"llama",
|
|
224
|
+
"lobster",
|
|
225
|
+
"lynx",
|
|
226
|
+
"macaw",
|
|
227
|
+
"magnet",
|
|
228
|
+
"mammoth",
|
|
229
|
+
"marmot",
|
|
230
|
+
"mink",
|
|
231
|
+
"mole",
|
|
232
|
+
"monkey",
|
|
233
|
+
"moose",
|
|
234
|
+
"moth",
|
|
235
|
+
"mouse",
|
|
236
|
+
"newt",
|
|
237
|
+
"ocelot",
|
|
238
|
+
"octopus",
|
|
239
|
+
"orca",
|
|
240
|
+
"ostrich",
|
|
241
|
+
"otter",
|
|
242
|
+
"owl",
|
|
243
|
+
"ox",
|
|
244
|
+
"panda",
|
|
245
|
+
"panther",
|
|
246
|
+
"parrot",
|
|
247
|
+
"peacock",
|
|
248
|
+
"pelican",
|
|
249
|
+
"penguin",
|
|
250
|
+
"pike",
|
|
251
|
+
"pony",
|
|
252
|
+
"python",
|
|
253
|
+
"quail",
|
|
254
|
+
"rabbit",
|
|
255
|
+
"raccoon",
|
|
256
|
+
"ram",
|
|
257
|
+
"raven",
|
|
258
|
+
"robin",
|
|
259
|
+
"rook",
|
|
260
|
+
"sable",
|
|
261
|
+
"salmon",
|
|
262
|
+
"scorpion",
|
|
263
|
+
"seal",
|
|
264
|
+
"shark",
|
|
265
|
+
"sheep",
|
|
266
|
+
"snail",
|
|
267
|
+
"sparrow",
|
|
268
|
+
"spider",
|
|
269
|
+
"squid",
|
|
270
|
+
"squirrel",
|
|
271
|
+
"stork",
|
|
272
|
+
"swan",
|
|
273
|
+
"tiger",
|
|
274
|
+
"toad",
|
|
275
|
+
"tortoise",
|
|
276
|
+
"toucan",
|
|
277
|
+
"trout",
|
|
278
|
+
"tuna",
|
|
279
|
+
"turkey",
|
|
280
|
+
"turtle",
|
|
281
|
+
"viper",
|
|
282
|
+
"vulture",
|
|
283
|
+
"walrus",
|
|
284
|
+
"wasp",
|
|
285
|
+
"whale",
|
|
286
|
+
"wolf",
|
|
287
|
+
"wombat",
|
|
288
|
+
"woodpecker",
|
|
289
|
+
"wren",
|
|
290
|
+
"yak",
|
|
291
|
+
"zebra",
|
|
292
|
+
] as const;
|
|
293
|
+
|
|
294
|
+
function capitalize(s: string): string {
|
|
295
|
+
return s.charAt(0).toUpperCase() + s.slice(1);
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
let usedNames = new Set<string>();
|
|
299
|
+
|
|
300
|
+
/**
|
|
301
|
+
* Generate a unique two-word identifier (e.g., "SwiftFalcon").
|
|
302
|
+
* Resets and starts over if all combinations exhausted.
|
|
303
|
+
*/
|
|
304
|
+
export function generateTaskName(): string {
|
|
305
|
+
// Try random combinations first (50 attempts)
|
|
306
|
+
for (let attempt = 0; attempt < 50; attempt++) {
|
|
307
|
+
const adj = ADJECTIVES[Math.floor(Math.random() * ADJECTIVES.length)]!;
|
|
308
|
+
const noun = NOUNS[Math.floor(Math.random() * NOUNS.length)]!;
|
|
309
|
+
const name = `${capitalize(adj)}${capitalize(noun)}`;
|
|
310
|
+
if (!usedNames.has(name)) {
|
|
311
|
+
usedNames.add(name);
|
|
312
|
+
return name;
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
// Exhaustive search if random fails
|
|
317
|
+
for (const adj of ADJECTIVES) {
|
|
318
|
+
for (const noun of NOUNS) {
|
|
319
|
+
const name = `${capitalize(adj)}${capitalize(noun)}`;
|
|
320
|
+
if (!usedNames.has(name)) {
|
|
321
|
+
usedNames.add(name);
|
|
322
|
+
return name;
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
// All combinations exhausted — reset and start over
|
|
328
|
+
usedNames.clear();
|
|
329
|
+
return generateTaskName();
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
/**
|
|
333
|
+
* Reset name generator state (for testing).
|
|
334
|
+
*/
|
|
335
|
+
export function resetTaskNames(): void {
|
|
336
|
+
usedNames = new Set<string>();
|
|
337
|
+
}
|
package/src/utils/visual.ts
CHANGED
|
@@ -3,12 +3,43 @@ export const ANSI_PATTERN = /\u001b\[[0-?]*[ -/]*[@-~]/g;
|
|
|
3
3
|
const WIDTH_CACHE_LIMIT = 256;
|
|
4
4
|
const widthCache = new Map<string, number>();
|
|
5
5
|
|
|
6
|
+
/** Code-point ranges that render as width 2 in most terminals (CJK + emoji). */
|
|
7
|
+
const WIDE_RANGES: Array<[number, number]> = [
|
|
8
|
+
// CJK Unified Ideographs
|
|
9
|
+
[0x4E00, 0x9FFF],
|
|
10
|
+
// CJK Extension A
|
|
11
|
+
[0x3400, 0x4DBF],
|
|
12
|
+
// CJK Compatibility Ideographs
|
|
13
|
+
[0xF900, 0xFAFF],
|
|
14
|
+
// Hangul Syllables
|
|
15
|
+
[0xAC00, 0xD7AF],
|
|
16
|
+
// CJK Symbols and Punctuation, Hiragana, Katakana
|
|
17
|
+
[0x3000, 0x33FF],
|
|
18
|
+
// Fullwidth forms
|
|
19
|
+
[0xFF01, 0xFF60],
|
|
20
|
+
// Emoji blocks
|
|
21
|
+
[0x2600, 0x27BF], // Miscellaneous Symbols + Dingbats (includes ✅)
|
|
22
|
+
[0x1F300, 0x1F9FF], // Misc Symbols, Emoticons, Transport, Map, Supplement
|
|
23
|
+
[0x1FA00, 0x1FAFF], // Symbols Extended-A
|
|
24
|
+
[0x1F000, 0x1F02F], // Mahjong, Dominos
|
|
25
|
+
[0x2702, 0x27B0], // Dingbats
|
|
26
|
+
[0xFE00, 0xFE0F], // Variation Selectors (emoji presentation)
|
|
27
|
+
[0x200D, 0x200D], // Zero Width Joiner (creates compound emoji)
|
|
28
|
+
];
|
|
29
|
+
|
|
30
|
+
function isWideCodePoint(code: number): boolean {
|
|
31
|
+
for (const [lo, hi] of WIDE_RANGES) {
|
|
32
|
+
if (code >= lo && code <= hi) return true;
|
|
33
|
+
}
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
|
|
6
37
|
export function visibleWidth(value: string): number {
|
|
7
38
|
// Skip caching for very long strings to avoid memory pressure.
|
|
8
39
|
if (value.length > 4096) {
|
|
9
40
|
let length = 0;
|
|
10
41
|
for (const char of value.replace(ANSI_PATTERN, "")) {
|
|
11
|
-
if (char !== "\n") length += 1;
|
|
42
|
+
if (char !== "\n") length += isWideCodePoint(char.codePointAt(0) ?? 0) ? 2 : 1;
|
|
12
43
|
}
|
|
13
44
|
return length;
|
|
14
45
|
}
|
|
@@ -16,7 +47,7 @@ export function visibleWidth(value: string): number {
|
|
|
16
47
|
if (cached !== undefined) return cached;
|
|
17
48
|
let length = 0;
|
|
18
49
|
for (const char of value.replace(ANSI_PATTERN, "")) {
|
|
19
|
-
if (char !== "\n") length += 1;
|
|
50
|
+
if (char !== "\n") length += isWideCodePoint(char.codePointAt(0) ?? 0) ? 2 : 1;
|
|
20
51
|
}
|
|
21
52
|
if (widthCache.size >= WIDTH_CACHE_LIMIT) {
|
|
22
53
|
const firstKey = widthCache.keys().next().value;
|
|
@@ -9,6 +9,7 @@ export interface WorkflowStep {
|
|
|
9
9
|
output?: string | false;
|
|
10
10
|
reads?: string[] | false;
|
|
11
11
|
model?: string;
|
|
12
|
+
/** Additional skills for this step; false disables role-default injected skills for this step. */
|
|
12
13
|
skills?: string[] | false;
|
|
13
14
|
progress?: boolean;
|
|
14
15
|
worktree?: boolean;
|
package/src/worktree/cleanup.ts
CHANGED
|
@@ -33,12 +33,13 @@ function captureDiff(worktreePath: string): string {
|
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
export function cleanupRunWorktrees(manifest: TeamRunManifest, options: { force?: boolean } = {}): WorktreeCleanupResult {
|
|
36
|
+
export function cleanupRunWorktrees(manifest: TeamRunManifest, options: { force?: boolean; signal?: AbortSignal } = {}): WorktreeCleanupResult {
|
|
37
37
|
const worktreeRoot = path.join(projectCrewRoot(manifest.cwd), DEFAULT_PATHS.state.worktreesSubdir, manifest.runId);
|
|
38
38
|
const result: WorktreeCleanupResult = { removed: [], preserved: [], artifactPaths: [] };
|
|
39
39
|
if (!fs.existsSync(worktreeRoot)) return result;
|
|
40
40
|
|
|
41
41
|
for (const entry of fs.readdirSync(worktreeRoot)) {
|
|
42
|
+
if (options.signal?.aborted) break;
|
|
42
43
|
const worktreePath = path.join(worktreeRoot, entry);
|
|
43
44
|
if (!fs.statSync(worktreePath).isDirectory()) continue;
|
|
44
45
|
const dirty = isDirty(worktreePath);
|