@productbrain/cli 0.1.0-beta.11282 → 0.1.0-beta.11295

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 (106) hide show
  1. package/README.md +3 -2
  2. package/dist/__tests__/cli-error-once.test.d.ts +2 -0
  3. package/dist/__tests__/cli-error-once.test.d.ts.map +1 -0
  4. package/dist/__tests__/cli-error-once.test.js +51 -0
  5. package/dist/__tests__/cli-error-once.test.js.map +1 -0
  6. package/dist/__tests__/init.test.d.ts +2 -1
  7. package/dist/__tests__/init.test.d.ts.map +1 -1
  8. package/dist/__tests__/init.test.js +110 -8
  9. package/dist/__tests__/init.test.js.map +1 -1
  10. package/dist/__tests__/removed-commands.test.js +31 -2
  11. package/dist/__tests__/removed-commands.test.js.map +1 -1
  12. package/dist/commands/connect-integration.test.js +1 -5
  13. package/dist/commands/connect-integration.test.js.map +1 -1
  14. package/dist/commands/connect-legacy-migration.test.js +0 -1
  15. package/dist/commands/connect-legacy-migration.test.js.map +1 -1
  16. package/dist/commands/connect-screens.d.ts +9 -13
  17. package/dist/commands/connect-screens.d.ts.map +1 -1
  18. package/dist/commands/connect-screens.js +16 -78
  19. package/dist/commands/connect-screens.js.map +1 -1
  20. package/dist/commands/connect-screens.test.d.ts +2 -0
  21. package/dist/commands/connect-screens.test.d.ts.map +1 -0
  22. package/dist/commands/connect-screens.test.js +18 -0
  23. package/dist/commands/connect-screens.test.js.map +1 -0
  24. package/dist/commands/connect.js +5 -5
  25. package/dist/commands/connect.js.map +1 -1
  26. package/dist/commands/connect.test.js +0 -4
  27. package/dist/commands/connect.test.js.map +1 -1
  28. package/dist/commands/init.d.ts +14 -1
  29. package/dist/commands/init.d.ts.map +1 -1
  30. package/dist/commands/init.js +90 -1
  31. package/dist/commands/init.js.map +1 -1
  32. package/dist/formatters/questions.d.ts +2 -0
  33. package/dist/formatters/questions.d.ts.map +1 -1
  34. package/dist/formatters/questions.js +5 -1
  35. package/dist/formatters/questions.js.map +1 -1
  36. package/dist/formatters/questions.test.js +10 -5
  37. package/dist/formatters/questions.test.js.map +1 -1
  38. package/dist/handleCliError.d.ts +17 -0
  39. package/dist/handleCliError.d.ts.map +1 -1
  40. package/dist/handleCliError.js +14 -3
  41. package/dist/handleCliError.js.map +1 -1
  42. package/dist/index.js +7 -29
  43. package/dist/index.js.map +1 -1
  44. package/dist/lib/client.d.ts.map +1 -1
  45. package/dist/lib/client.js +1 -2
  46. package/dist/lib/client.js.map +1 -1
  47. package/package.json +1 -2
  48. package/dist/__tests__/handshake-augment.test.d.ts +0 -2
  49. package/dist/__tests__/handshake-augment.test.d.ts.map +0 -1
  50. package/dist/__tests__/handshake-augment.test.js +0 -407
  51. package/dist/__tests__/handshake-augment.test.js.map +0 -1
  52. package/dist/__tests__/handshake-dormancy.test.d.ts +0 -2
  53. package/dist/__tests__/handshake-dormancy.test.d.ts.map +0 -1
  54. package/dist/__tests__/handshake-dormancy.test.js +0 -24
  55. package/dist/__tests__/handshake-dormancy.test.js.map +0 -1
  56. package/dist/__tests__/handshake-formatter.test.d.ts +0 -2
  57. package/dist/__tests__/handshake-formatter.test.d.ts.map +0 -1
  58. package/dist/__tests__/handshake-formatter.test.js +0 -111
  59. package/dist/__tests__/handshake-formatter.test.js.map +0 -1
  60. package/dist/__tests__/handshake-preview.test.d.ts +0 -2
  61. package/dist/__tests__/handshake-preview.test.d.ts.map +0 -1
  62. package/dist/__tests__/handshake-preview.test.js +0 -500
  63. package/dist/__tests__/handshake-preview.test.js.map +0 -1
  64. package/dist/__tests__/handshake-session-threading.test.d.ts +0 -2
  65. package/dist/__tests__/handshake-session-threading.test.d.ts.map +0 -1
  66. package/dist/__tests__/handshake-session-threading.test.js +0 -185
  67. package/dist/__tests__/handshake-session-threading.test.js.map +0 -1
  68. package/dist/__tests__/handshake.e2e.test.d.ts +0 -2
  69. package/dist/__tests__/handshake.e2e.test.d.ts.map +0 -1
  70. package/dist/__tests__/handshake.e2e.test.js +0 -226
  71. package/dist/__tests__/handshake.e2e.test.js.map +0 -1
  72. package/dist/__tests__/handshake.test.d.ts +0 -2
  73. package/dist/__tests__/handshake.test.d.ts.map +0 -1
  74. package/dist/__tests__/handshake.test.js +0 -1040
  75. package/dist/__tests__/handshake.test.js.map +0 -1
  76. package/dist/__tests__/method-registry.integration.test.d.ts +0 -6
  77. package/dist/__tests__/method-registry.integration.test.d.ts.map +0 -1
  78. package/dist/__tests__/method-registry.integration.test.js +0 -17
  79. package/dist/__tests__/method-registry.integration.test.js.map +0 -1
  80. package/dist/__tests__/method-registry.test.d.ts +0 -12
  81. package/dist/__tests__/method-registry.test.d.ts.map +0 -1
  82. package/dist/__tests__/method-registry.test.js +0 -86
  83. package/dist/__tests__/method-registry.test.js.map +0 -1
  84. package/dist/commands/connect-context.d.ts +0 -55
  85. package/dist/commands/connect-context.d.ts.map +0 -1
  86. package/dist/commands/connect-context.js +0 -78
  87. package/dist/commands/connect-context.js.map +0 -1
  88. package/dist/commands/connect-context.test.d.ts +0 -2
  89. package/dist/commands/connect-context.test.d.ts.map +0 -1
  90. package/dist/commands/connect-context.test.js +0 -148
  91. package/dist/commands/connect-context.test.js.map +0 -1
  92. package/dist/commands/handshake.d.ts +0 -78
  93. package/dist/commands/handshake.d.ts.map +0 -1
  94. package/dist/commands/handshake.js +0 -1359
  95. package/dist/commands/handshake.js.map +0 -1
  96. package/dist/lib/method-registry.d.ts +0 -37
  97. package/dist/lib/method-registry.d.ts.map +0 -1
  98. package/dist/lib/method-registry.js +0 -41
  99. package/dist/lib/method-registry.js.map +0 -1
  100. package/templates/general/code-integrity.md +0 -11
  101. package/templates/general/getting-started.md +0 -12
  102. package/templates/method-registry.json +0 -16
  103. package/templates/node-ts/code-integrity.md +0 -13
  104. package/templates/node-ts/testing.md +0 -12
  105. package/templates/python/code-integrity.md +0 -13
  106. package/templates/python/testing.md +0 -12
@@ -1,78 +0,0 @@
1
- /**
2
- * pb handshake — generate context files for AI developer tools.
3
- * Context export wiring (read-only filesystem bridge; GLO-63, DEC-161) — not a product surface.
4
- */
5
- import { type HandshakeReport } from '../formatters/handshake.js';
6
- import type { WorkspaceHealthResult } from './workspace.js';
7
- import { classifyDriftBucket, type DriftBucket } from './handshakeDriftClassification.js';
8
- import { type StartupResolutionSignals } from '../lib/startup-resolution-signals.js';
9
- import { type SurfaceName } from '../surfaces/registry.js';
10
- /** Wire-safe alias for a single health gap — derived from the CLI mirror in workspace.ts. */
11
- export type HealthGap = WorkspaceHealthResult['gaps'][number];
12
- export declare function runHandshakeInit(options?: {
13
- level?: string;
14
- dryRun?: boolean;
15
- }): Promise<void>;
16
- interface HandshakeOptions {
17
- force?: boolean;
18
- dryRun?: boolean;
19
- /** When true, actually write files. When false (default), show preview plan only. */
20
- apply?: boolean;
21
- level?: string;
22
- /** When true, suppress all progress output. Used when handshake is called as a sub-step. */
23
- quiet?: boolean;
24
- /** Optional caller-provided startup signals, merged with safe local signals. */
25
- startupSignals?: Partial<StartupResolutionSignals>;
26
- /** Queryable telemetry attribution for the path that invoked this handshake. */
27
- invocationPath?: 'session-start' | 'session-close' | 'manual-orient' | 'handshake' | 'unknown';
28
- /** Target surfaces to write adapter files for. Empty = write all. */
29
- surfaces?: string[];
30
- /** WP-421 S3 (#17): true, or non-TTY stdout, bypasses the adopt-or-revert prompt — tampered
31
- * files go to stderr, a `transition` setup_receipt records the refusal, exit non-zero. */
32
- noPrompt?: boolean;
33
- }
34
- /** Dereference a "PR #N" ref to its changed paths via `gh pr diff <N> --name-only` (F4: server
35
- * resolver has no git/gh access). Guarded/time-boxed; `run` is injectable for tests. */
36
- export declare function dereferencePrRefToPaths(cwd: string, prNumber: number, run?: (cwd: string, command: string, timeoutMs: number) => string | undefined): string[];
37
- /** Injectable runners for deriveHandshakeStartupSignals — lets tests drive git/gh side effects
38
- * (changed paths, merge-base delta, PR-diff dereference) without real subprocesses. */
39
- export type HandshakeStartupSignalDeps = {
40
- /** Run a read-only git command; undefined on failure. Default: runGitText. */
41
- runGit: (cwd: string, command: string) => string | undefined;
42
- /** Dereference a PR number to its changed paths (F4). Default: dereferencePrRefToPaths. */
43
- prDiff: (cwd: string, prNumber: number) => string[];
44
- };
45
- export declare function deriveHandshakeStartupSignals(cwd: string, callerSignals?: Partial<StartupResolutionSignals>, deps?: HandshakeStartupSignalDeps): StartupResolutionSignals;
46
- /** Normalize volatile handshake-only timestamps before comparing generated files — keeps visible
47
- * timestamps in artifacts while avoiding meaningless rewrites when content is unchanged. */
48
- export declare function normalizeHandshakeContentForComparison(content: string): string;
49
- export { classifyDriftBucket, type DriftBucket };
50
- export interface LeftoverProjection {
51
- path: string;
52
- reason: string;
53
- }
54
- /**
55
- * findLeftoverProjections — WP-379 S5b
56
- *
57
- * Lists marker-bearing files under .cursor/rules/, .claude/rules/, .claude/skills/, .codex/skills/
58
- * (plus the nested .cursor/skills/<name>/SKILL.md layout) that look stale: orphan (no canonical
59
- * asset), stale case/punctuation variant, or a leftover `.dormant` copy. User-owned (no MARKER)
60
- * files and unselected `allowedTargets` are never reported.
61
- *
62
- * Round 12: stops once `LEFTOVER_FILES_MAX + 1` matches are found across the flat + merged
63
- * nested-Cursor scan combined — bounds read/enumerate I/O, not just the reported list.
64
- * `truncated` says more exist beyond the capped, returned `files`.
65
- *
66
- * @param cursorSkillNames Cursor-specific, SKILL-kind-only canon (falls back to `assetNames`).
67
- * @param exactRelativePaths Round 11: exact write-plan paths (forward-slash), exempted from both
68
- * checks — covers asset-less generated files and a canonical raw name not already normalized.
69
- */
70
- export declare function findLeftoverProjections(cwd: string, assetNames: string[], allowedTargets: Set<SurfaceName>, cursorSkillNames?: string[], exactRelativePaths?: Set<string>): {
71
- files: LeftoverProjection[];
72
- truncated: boolean;
73
- };
74
- export declare function runHandshake(options?: HandshakeOptions): Promise<HandshakeReport | undefined>;
75
- export declare const __test: {
76
- MARKER: string;
77
- };
78
- //# sourceMappingURL=handshake.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"handshake.d.ts","sourceRoot":"","sources":["../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