gsd-pi 2.35.0-dev.30eec3f → 2.35.0-dev.640d5c7

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.
Files changed (88) hide show
  1. package/dist/cli.js +2 -7
  2. package/dist/resource-loader.d.ts +1 -1
  3. package/dist/resource-loader.js +1 -13
  4. package/dist/resources/extensions/async-jobs/await-tool.js +2 -0
  5. package/dist/resources/extensions/async-jobs/job-manager.js +6 -0
  6. package/dist/resources/extensions/bg-shell/output-formatter.js +19 -1
  7. package/dist/resources/extensions/bg-shell/process-manager.js +4 -0
  8. package/dist/resources/extensions/bg-shell/types.js +2 -0
  9. package/dist/resources/extensions/context7/index.js +0 -5
  10. package/dist/resources/extensions/get-secrets-from-user.js +30 -2
  11. package/dist/resources/extensions/google-search/index.js +0 -5
  12. package/dist/resources/extensions/gsd/auto-dispatch.js +1 -43
  13. package/dist/resources/extensions/gsd/auto-loop.js +1 -10
  14. package/dist/resources/extensions/gsd/auto-recovery.js +0 -35
  15. package/dist/resources/extensions/gsd/auto-start.js +2 -35
  16. package/dist/resources/extensions/gsd/auto.js +4 -59
  17. package/dist/resources/extensions/gsd/commands-handlers.js +2 -2
  18. package/dist/resources/extensions/gsd/doctor-environment.js +17 -26
  19. package/dist/resources/extensions/gsd/files.js +1 -9
  20. package/dist/resources/extensions/gsd/gitignore.js +7 -54
  21. package/dist/resources/extensions/gsd/guided-flow.js +1 -1
  22. package/dist/resources/extensions/gsd/health-widget.js +46 -97
  23. package/dist/resources/extensions/gsd/index.js +1 -10
  24. package/dist/resources/extensions/gsd/migrate-external.js +2 -55
  25. package/dist/resources/extensions/gsd/paths.js +7 -74
  26. package/dist/resources/extensions/gsd/post-unit-hooks.js +1 -4
  27. package/dist/resources/extensions/gsd/preferences-validation.js +1 -16
  28. package/dist/resources/extensions/gsd/prompts/complete-milestone.md +0 -2
  29. package/dist/resources/extensions/gsd/prompts/validate-milestone.md +0 -2
  30. package/dist/resources/extensions/gsd/session-lock.js +2 -26
  31. package/dist/resources/extensions/gsd/templates/plan.md +0 -8
  32. package/dist/resources/extensions/gsd/worktree-resolver.js +0 -12
  33. package/dist/resources/extensions/remote-questions/remote-command.js +22 -2
  34. package/dist/resources/extensions/shared/mod.js +1 -1
  35. package/dist/resources/extensions/shared/sanitize.js +0 -30
  36. package/dist/resources/extensions/shared/wizard-ui.js +478 -0
  37. package/dist/resources/extensions/subagent/index.js +14 -6
  38. package/package.json +1 -2
  39. package/packages/pi-coding-agent/dist/core/resource-loader.d.ts.map +1 -1
  40. package/packages/pi-coding-agent/dist/core/resource-loader.js +2 -13
  41. package/packages/pi-coding-agent/dist/core/resource-loader.js.map +1 -1
  42. package/packages/pi-coding-agent/src/core/resource-loader.ts +2 -13
  43. package/src/resources/extensions/async-jobs/await-tool.ts +2 -0
  44. package/src/resources/extensions/async-jobs/job-manager.ts +7 -0
  45. package/src/resources/extensions/bg-shell/output-formatter.ts +17 -0
  46. package/src/resources/extensions/bg-shell/process-manager.ts +4 -0
  47. package/src/resources/extensions/bg-shell/types.ts +12 -0
  48. package/src/resources/extensions/context7/index.ts +0 -7
  49. package/src/resources/extensions/get-secrets-from-user.ts +35 -2
  50. package/src/resources/extensions/google-search/index.ts +0 -7
  51. package/src/resources/extensions/gsd/auto-dispatch.ts +1 -49
  52. package/src/resources/extensions/gsd/auto-loop.ts +1 -11
  53. package/src/resources/extensions/gsd/auto-recovery.ts +0 -39
  54. package/src/resources/extensions/gsd/auto-start.ts +2 -42
  55. package/src/resources/extensions/gsd/auto.ts +3 -61
  56. package/src/resources/extensions/gsd/commands-handlers.ts +2 -2
  57. package/src/resources/extensions/gsd/doctor-environment.ts +16 -26
  58. package/src/resources/extensions/gsd/files.ts +1 -10
  59. package/src/resources/extensions/gsd/gitignore.ts +7 -54
  60. package/src/resources/extensions/gsd/guided-flow.ts +1 -1
  61. package/src/resources/extensions/gsd/health-widget.ts +59 -103
  62. package/src/resources/extensions/gsd/index.ts +1 -10
  63. package/src/resources/extensions/gsd/migrate-external.ts +2 -47
  64. package/src/resources/extensions/gsd/paths.ts +7 -73
  65. package/src/resources/extensions/gsd/post-unit-hooks.ts +1 -5
  66. package/src/resources/extensions/gsd/preferences-validation.ts +1 -16
  67. package/src/resources/extensions/gsd/prompts/complete-milestone.md +0 -2
  68. package/src/resources/extensions/gsd/prompts/validate-milestone.md +0 -2
  69. package/src/resources/extensions/gsd/session-lock.ts +2 -29
  70. package/src/resources/extensions/gsd/templates/plan.md +0 -8
  71. package/src/resources/extensions/gsd/tests/preferences.test.ts +2 -12
  72. package/src/resources/extensions/gsd/tests/validate-directory.test.ts +0 -15
  73. package/src/resources/extensions/gsd/tests/validate-milestone.test.ts +0 -2
  74. package/src/resources/extensions/gsd/tests/worktree-sync-milestones.test.ts +0 -32
  75. package/src/resources/extensions/gsd/worktree-resolver.ts +0 -11
  76. package/src/resources/extensions/remote-questions/remote-command.ts +23 -2
  77. package/src/resources/extensions/shared/mod.ts +1 -1
  78. package/src/resources/extensions/shared/sanitize.ts +0 -36
  79. package/src/resources/extensions/shared/wizard-ui.ts +551 -0
  80. package/src/resources/extensions/subagent/index.ts +12 -6
  81. package/dist/resources/extensions/gsd/health-widget-core.js +0 -96
  82. package/dist/resources/extensions/gsd/roadmap-mutations.js +0 -55
  83. package/src/resources/extensions/gsd/health-widget-core.ts +0 -129
  84. package/src/resources/extensions/gsd/roadmap-mutations.ts +0 -66
  85. package/src/resources/extensions/gsd/tests/gitignore-tracked-gsd.test.ts +0 -214
  86. package/src/resources/extensions/gsd/tests/health-widget.test.ts +0 -158
  87. package/src/resources/extensions/gsd/tests/paths.test.ts +0 -113
  88. package/src/resources/extensions/gsd/tests/test-utils.ts +0 -165
@@ -19,7 +19,6 @@ import { join } from 'node:path';
19
19
  import { tmpdir } from 'node:os';
20
20
 
21
21
  import { syncProjectRootToWorktree } from '../auto-worktree-sync.ts';
22
- import { syncGsdStateToWorktree } from '../auto-worktree.ts';
23
22
  import { createTestContext } from './test-helpers.ts';
24
23
 
25
24
  const { assertTrue, report } = createTestContext();
@@ -149,37 +148,6 @@ async function main(): Promise<void> {
149
148
  assertTrue(true, 'no crash on missing directories');
150
149
  }
151
150
 
152
- // ─── 7. milestones/ directory created in worktree when missing ────────
153
- console.log('\n=== 7. milestones/ directory created in worktree when missing ===');
154
- {
155
- const mainBase = createBase('main');
156
- const wtBase = mkdtempSync(join(tmpdir(), 'gsd-wt-sync-wt-'));
157
-
158
- try {
159
- // Worktree has .gsd/ but NO milestones/ subdirectory
160
- mkdirSync(join(wtBase, '.gsd'), { recursive: true });
161
-
162
- // Main repo has M001
163
- const m001Dir = join(mainBase, '.gsd', 'milestones', 'M001');
164
- mkdirSync(m001Dir, { recursive: true });
165
- writeFileSync(join(m001Dir, 'M001-CONTEXT.md'), '# M001 Context');
166
- writeFileSync(join(m001Dir, 'M001-ROADMAP.md'), '# M001 Roadmap');
167
-
168
- assertTrue(!existsSync(join(wtBase, '.gsd', 'milestones')), 'milestones/ missing before sync');
169
-
170
- const result = syncGsdStateToWorktree(mainBase, wtBase);
171
-
172
- assertTrue(existsSync(join(wtBase, '.gsd', 'milestones')), 'milestones/ created in worktree');
173
- assertTrue(existsSync(join(wtBase, '.gsd', 'milestones', 'M001')), 'M001 synced to worktree');
174
- assertTrue(existsSync(join(wtBase, '.gsd', 'milestones', 'M001', 'M001-CONTEXT.md')), 'M001 CONTEXT synced');
175
- assertTrue(existsSync(join(wtBase, '.gsd', 'milestones', 'M001', 'M001-ROADMAP.md')), 'M001 ROADMAP synced');
176
- assertTrue(result.synced.length > 0, 'sync reported files');
177
- } finally {
178
- cleanup(mainBase);
179
- rmSync(wtBase, { recursive: true, force: true });
180
- }
181
- }
182
-
183
151
  report();
184
152
  }
185
153
 
@@ -13,8 +13,6 @@
13
13
  * `process.chdir()` internally — this class MUST NOT double-chdir.
14
14
  */
15
15
 
16
- import { existsSync, unlinkSync } from "node:fs";
17
- import { join } from "node:path";
18
16
  import type { AutoSession } from "./auto/session.js";
19
17
  import { debugLog } from "./debug-logger.js";
20
18
 
@@ -374,15 +372,6 @@ export class WorktreeResolver {
374
372
  });
375
373
  ctx.notify(`Milestone merge failed: ${msg}`, "warning");
376
374
 
377
- // Clean up stale merge state left by failed squash-merge (#1389)
378
- try {
379
- const gitDir = join(originalBase || this.s.basePath, ".git");
380
- for (const f of ["SQUASH_MSG", "MERGE_HEAD", "MERGE_MSG"]) {
381
- const p = join(gitDir, f);
382
- if (existsSync(p)) unlinkSync(p);
383
- }
384
- } catch { /* best-effort */ }
385
-
386
375
  // Error recovery: always restore to project root
387
376
  if (originalBase) {
388
377
  try {
@@ -4,12 +4,12 @@
4
4
 
5
5
  import type { ExtensionAPI, ExtensionCommandContext } from "@gsd/pi-coding-agent";
6
6
  import { AuthStorage } from "@gsd/pi-coding-agent";
7
- import { Editor, type EditorTheme, Key, matchesKey, truncateToWidth } from "@gsd/pi-tui";
7
+ import { CURSOR_MARKER, Editor, type EditorTheme, Key, matchesKey, truncateToWidth } from "@gsd/pi-tui";
8
8
  import { existsSync, readFileSync, writeFileSync, mkdirSync } from "node:fs";
9
9
  import { dirname, join } from "node:path";
10
10
  import { getGlobalGSDPreferencesPath, loadEffectiveGSDPreferences } from "../gsd/preferences.js";
11
11
  import { getRemoteConfigStatus, isValidChannelId, resolveRemoteConfig } from "./config.js";
12
- import { maskEditorLine, sanitizeError } from "../shared/mod.js";
12
+ import { sanitizeError } from "../shared/sanitize.js";
13
13
  import { getLatestPromptSummary } from "./status.js";
14
14
 
15
15
  export async function handleRemote(
@@ -353,6 +353,27 @@ function removeRemoteQuestionsConfig(): void {
353
353
  writeFileSync(prefsPath, next, "utf-8");
354
354
  }
355
355
 
356
+ function maskEditorLine(line: string): string {
357
+ let output = "";
358
+ let i = 0;
359
+ while (i < line.length) {
360
+ if (line.startsWith(CURSOR_MARKER, i)) {
361
+ output += CURSOR_MARKER;
362
+ i += CURSOR_MARKER.length;
363
+ continue;
364
+ }
365
+ const ansiMatch = /^\x1b\[[0-9;]*m/.exec(line.slice(i));
366
+ if (ansiMatch) {
367
+ output += ansiMatch[0];
368
+ i += ansiMatch[0].length;
369
+ continue;
370
+ }
371
+ output += line[i] === " " ? " " : "*";
372
+ i += 1;
373
+ }
374
+ return output;
375
+ }
376
+
356
377
  async function promptMaskedInput(ctx: ExtensionCommandContext, label: string, hint: string): Promise<string | null> {
357
378
  if (!ctx.hasUI) return null;
358
379
  return ctx.ui.custom<string | null>((tui: any, theme: any, _kb: any, done: (r: string | null) => void) => {
@@ -28,6 +28,6 @@ export { showInterviewRound } from "./interview-ui.js";
28
28
  export type { Question, QuestionOption, RoundResult } from "./interview-ui.js";
29
29
  export { showNextAction } from "./next-action-ui.js";
30
30
  export { showConfirm } from "./confirm-ui.js";
31
- export { sanitizeError, maskEditorLine } from "./sanitize.js";
31
+ export { sanitizeError } from "./sanitize.js";
32
32
  export { formatDateShort, truncateWithEllipsis } from "./format-utils.js";
33
33
  export { splitFrontmatter, parseFrontmatterMap } from "./frontmatter.js";
@@ -1,10 +1,7 @@
1
1
  /**
2
2
  * Sanitize error messages by redacting token-like strings before surfacing.
3
- * Also provides maskEditorLine for masking sensitive TUI editor input.
4
3
  */
5
4
 
6
- import { CURSOR_MARKER } from "@gsd/pi-tui";
7
-
8
5
  const TOKEN_PATTERNS = [
9
6
  /xoxb-[A-Za-z0-9\-]+/g, // Slack bot tokens
10
7
  /xoxp-[A-Za-z0-9\-]+/g, // Slack user tokens
@@ -20,36 +17,3 @@ export function sanitizeError(msg: string): string {
20
17
  }
21
18
  return sanitized;
22
19
  }
23
-
24
- /**
25
- * Replace editor visible text with masked characters while preserving
26
- * ANSI cursor/sequencer codes. Keeps border/metadata lines readable.
27
- */
28
- export function maskEditorLine(line: string): string {
29
- if (line.startsWith("─")) {
30
- return line;
31
- }
32
-
33
- let output = "";
34
- let i = 0;
35
- while (i < line.length) {
36
- if (line.startsWith(CURSOR_MARKER, i)) {
37
- output += CURSOR_MARKER;
38
- i += CURSOR_MARKER.length;
39
- continue;
40
- }
41
-
42
- const ansiMatch = /^\x1b\[[0-9;]*m/.exec(line.slice(i));
43
- if (ansiMatch) {
44
- output += ansiMatch[0];
45
- i += ansiMatch[0].length;
46
- continue;
47
- }
48
-
49
- const ch = line[i] as string;
50
- output += ch === " " ? " " : "*";
51
- i += 1;
52
- }
53
-
54
- return output;
55
- }