@wrongstack/tools 0.320.1 → 1.0.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.
Files changed (192) hide show
  1. package/dist/_danger-detect.d.ts +8 -0
  2. package/dist/_syntax-check.d.ts +1 -2
  3. package/dist/audit.d.ts +4 -5
  4. package/dist/audit.js +6 -6
  5. package/dist/auto-proceed-loop-guard.d.ts +1 -1
  6. package/dist/auto-proceed-loop-guard.js +9 -160
  7. package/dist/bash-kill-guard.d.ts +2 -3
  8. package/dist/bash.d.ts +2 -3
  9. package/dist/bash.js +4 -4
  10. package/dist/batch-tool-use.d.ts +2 -3
  11. package/dist/batch-tool-use.js +1 -1
  12. package/dist/browser/index.d.ts +1 -1
  13. package/dist/browser/index.js +1 -1
  14. package/dist/browser/tools.d.ts +56 -45
  15. package/dist/builtin.js +50 -50
  16. package/dist/{chunk-T77XOX7E.js → chunk-24T5XIJU.js} +1 -1
  17. package/dist/{chunk-DTQ75VBC.js → chunk-2CTZW6JQ.js} +2 -2
  18. package/dist/{chunk-KWXIKGE3.js → chunk-3D5DJWOE.js} +3 -3
  19. package/dist/{chunk-XSSFBS5I.js → chunk-4ERMPDHV.js} +11 -6
  20. package/dist/{chunk-QSNVDHOZ.js → chunk-4WPBS45A.js} +4 -5
  21. package/dist/{chunk-4CQWNZ62.js → chunk-5ITQPCLC.js} +2 -2
  22. package/dist/{chunk-B4HTSV6Z.js → chunk-5KS24LTS.js} +11 -11
  23. package/dist/{chunk-QPNYDH5B.js → chunk-62OAECEQ.js} +29 -7
  24. package/dist/{chunk-DFQDJT22.js → chunk-6GOZTS6F.js} +3 -3
  25. package/dist/{chunk-5UFVCIUB.js → chunk-6H4ERJP7.js} +140 -24
  26. package/dist/{chunk-34VLZ35Z.js → chunk-7HL23T3T.js} +63 -10
  27. package/dist/{chunk-HFXSNKCV.js → chunk-7JJFC6CT.js} +1 -1
  28. package/dist/{chunk-23EX5WDO.js → chunk-7LQCT3LT.js} +3 -3
  29. package/dist/{chunk-NDIT3SBZ.js → chunk-7N5U2RAU.js} +2 -2
  30. package/dist/{chunk-QBV725YG.js → chunk-7ODZTPCU.js} +2 -2
  31. package/dist/{chunk-6AAOT4PW.js → chunk-AQ5YBURX.js} +16 -4
  32. package/dist/{chunk-ZMW6WJFT.js → chunk-ASEXQRA7.js} +3 -3
  33. package/dist/{chunk-FRN7TIAA.js → chunk-B3MGJBFI.js} +1 -1
  34. package/dist/{chunk-JLYA4X7K.js → chunk-CGXTR34H.js} +21 -6
  35. package/dist/{chunk-IU4DV2PA.js → chunk-CHEK3ASV.js} +6 -3
  36. package/dist/{chunk-GOIZNNOA.js → chunk-DJYLI7EW.js} +1 -1
  37. package/dist/{chunk-Z6IHMJMC.js → chunk-DK4J2WMH.js} +11 -11
  38. package/dist/{chunk-OYP27E3I.js → chunk-DRRY6SCM.js} +47 -20
  39. package/dist/{chunk-JVRLTEO7.js → chunk-E7JE3UEX.js} +2 -2
  40. package/dist/{chunk-BK732J7I.js → chunk-FBUP524S.js} +4 -4
  41. package/dist/{chunk-NYRLWDT5.js → chunk-FVM3O4JQ.js} +1 -1
  42. package/dist/chunk-FYDBUVQD.js +244 -0
  43. package/dist/{chunk-PV6HIZQD.js → chunk-GDDXX27P.js} +50 -50
  44. package/dist/{chunk-3GIKYHLA.js → chunk-GKSG5CPH.js} +6 -6
  45. package/dist/{chunk-ESLPBT5A.js → chunk-HDYUBRMF.js} +4 -3
  46. package/dist/{chunk-4BABEJC2.js → chunk-IAYMTTR2.js} +236 -79
  47. package/dist/{chunk-ELRRTWNP.js → chunk-IXIS7RSG.js} +2 -2
  48. package/dist/{chunk-HR67OWEP.js → chunk-IYH4OHBP.js} +5 -5
  49. package/dist/{chunk-W232EFEM.js → chunk-JDOO4P6Z.js} +7 -4
  50. package/dist/{chunk-2OXHS3KZ.js → chunk-KLJZ4WV4.js} +4 -3
  51. package/dist/{chunk-3M7LLN7W.js → chunk-LQSOU63Z.js} +12 -11
  52. package/dist/{chunk-OTPTQBYE.js → chunk-MGPR7VG3.js} +279 -265
  53. package/dist/{chunk-C2DQKVLO.js → chunk-MJSJWXBF.js} +1 -1
  54. package/dist/{chunk-NSPNFOJ7.js → chunk-MK2JK35J.js} +25 -10
  55. package/dist/{chunk-JSNSMG5R.js → chunk-MSOAX3GC.js} +1 -1
  56. package/dist/{chunk-J43O3BOX.js → chunk-N3K2SFEI.js} +532 -492
  57. package/dist/{chunk-J74TMK4M.js → chunk-NJX2RXKJ.js} +50 -7
  58. package/dist/chunk-NL2S2CXD.js +171 -0
  59. package/dist/{chunk-WAQASTXB.js → chunk-O6BY43ZB.js} +29 -8
  60. package/dist/{chunk-QGF2C7TF.js → chunk-PVCB7RUZ.js} +2 -2
  61. package/dist/{chunk-YTKSNTT4.js → chunk-QA6IASYX.js} +8 -8
  62. package/dist/{chunk-VPALDFYM.js → chunk-RV7BVTDG.js} +1 -1
  63. package/dist/chunk-S57CDR2H.js +288 -0
  64. package/dist/{chunk-W2CECGTG.js → chunk-SMARDKAC.js} +1 -1
  65. package/dist/{chunk-QWKSKFKZ.js → chunk-SOR7OCYP.js} +1 -1
  66. package/dist/{chunk-I7FBZOEP.js → chunk-T3SMFF5Q.js} +11 -5
  67. package/dist/{chunk-4BHUSMNL.js → chunk-UI3ZJIG3.js} +1 -1
  68. package/dist/{chunk-WXJY3BKV.js → chunk-VBF2YXUW.js} +2 -2
  69. package/dist/{chunk-FQNXYA6W.js → chunk-VU3QBYL4.js} +36 -5
  70. package/dist/{chunk-VD2LV5WO.js → chunk-VZGPASGD.js} +37 -12
  71. package/dist/{chunk-UZFY3CKD.js → chunk-WEEVSWQB.js} +17 -6
  72. package/dist/chunk-XXRMF2BC.js +186 -0
  73. package/dist/{chunk-LRDIRJJL.js → chunk-YEISRT4S.js} +5 -11
  74. package/dist/{chunk-Q5JPPCZC.js → chunk-YJTXRH5Y.js} +3 -2
  75. package/dist/{chunk-Z5Q3TXRY.js → chunk-ZTCJCYLN.js} +3 -3
  76. package/dist/circuit-breaker.d.ts +1 -0
  77. package/dist/circuit-breaker.js +1 -1
  78. package/dist/clarify.d.ts +1 -0
  79. package/dist/codebase-index/codebase-ast-replace-tool.d.ts +2 -3
  80. package/dist/codebase-index/codebase-impact-analysis-tool.d.ts +5 -4
  81. package/dist/codebase-index/codebase-incoming-calls-tool.d.ts +4 -3
  82. package/dist/codebase-index/codebase-index-tool.d.ts +2 -3
  83. package/dist/codebase-index/codebase-invariant-check-tool.d.ts +2 -3
  84. package/dist/codebase-index/codebase-outgoing-calls-tool.d.ts +4 -3
  85. package/dist/codebase-index/codebase-repo-map-tool.d.ts +2 -3
  86. package/dist/codebase-index/codebase-search-tool.d.ts +2 -3
  87. package/dist/codebase-index/codebase-skeleton-tool.d.ts +2 -3
  88. package/dist/codebase-index/codebase-stats-tool.d.ts +9 -3
  89. package/dist/codebase-index/codebase-targeted-test-tool.d.ts +4 -3
  90. package/dist/codebase-index/index.d.ts +11 -11
  91. package/dist/codebase-index/index.js +8 -8
  92. package/dist/codebase-index/project-server-framing.d.ts +29 -0
  93. package/dist/codebase-index/project-server-lifecycle.d.ts +20 -0
  94. package/dist/codebase-index/project-server-operations.d.ts +37 -0
  95. package/dist/codebase-index/project-server-types.d.ts +30 -0
  96. package/dist/codebase-index/project-server-watcher.d.ts +25 -0
  97. package/dist/codebase-index/project-server.js +448 -391
  98. package/dist/codebase-index/worker.js +2 -2
  99. package/dist/codebase-index/writer-init.d.ts +13 -0
  100. package/dist/codebase-index/writer-maintenance.d.ts +14 -0
  101. package/dist/codebase-index/writer.d.ts +0 -15
  102. package/dist/design.d.ts +2 -2
  103. package/dist/design.js +1 -1
  104. package/dist/diff.d.ts +4 -4
  105. package/dist/diff.js +1 -1
  106. package/dist/document.d.ts +3 -4
  107. package/dist/document.js +1 -1
  108. package/dist/e2e.d.ts +1 -1
  109. package/dist/e2e.js +1 -1
  110. package/dist/edit.d.ts +3 -3
  111. package/dist/edit.js +6 -6
  112. package/dist/exec.d.ts +2 -3
  113. package/dist/exec.js +4 -4
  114. package/dist/fetch.d.ts +4 -3
  115. package/dist/fetch.js +1 -1
  116. package/dist/format.d.ts +17 -45
  117. package/dist/format.js +12 -8
  118. package/dist/git.d.ts +3 -3
  119. package/dist/git.js +1 -1
  120. package/dist/glob.d.ts +2 -3
  121. package/dist/glob.js +2 -2
  122. package/dist/grep.d.ts +7 -5
  123. package/dist/grep.js +3 -3
  124. package/dist/index.d.ts +54 -45
  125. package/dist/index.js +118 -59
  126. package/dist/install.d.ts +7 -55
  127. package/dist/install.js +6 -6
  128. package/dist/json.d.ts +3 -4
  129. package/dist/json.js +2 -2
  130. package/dist/kanban-tool-types.d.ts +1 -2
  131. package/dist/kanban.d.ts +3 -19
  132. package/dist/kanban.js +1 -1
  133. package/dist/languages/execute-tool.d.ts +2 -3
  134. package/dist/languages/index.d.ts +2 -2
  135. package/dist/languages/index.js +4 -4
  136. package/dist/languages/tool.d.ts +3 -4
  137. package/dist/{legacy-bridge-FOV5ODDI.js → legacy-bridge-YXANP5QB.js} +6 -6
  138. package/dist/lint.d.ts +5 -4
  139. package/dist/lint.js +6 -6
  140. package/dist/logs.d.ts +3 -4
  141. package/dist/logs.js +2 -2
  142. package/dist/memory.d.ts +7 -8
  143. package/dist/memory.js +1 -1
  144. package/dist/mode.d.ts +3 -4
  145. package/dist/mode.js +1 -1
  146. package/dist/next-steps-tool.d.ts +2 -3
  147. package/dist/next-steps.d.ts +4 -0
  148. package/dist/next-steps.js +9 -175
  149. package/dist/outdated.d.ts +5 -29
  150. package/dist/outdated.js +3 -3
  151. package/dist/pack.js +51 -51
  152. package/dist/patch.d.ts +2 -3
  153. package/dist/patch.js +5 -5
  154. package/dist/plan.d.ts +4 -4
  155. package/dist/plan.js +3 -3
  156. package/dist/process-registry.js +2 -2
  157. package/dist/ps-slash.js +4 -4
  158. package/dist/pwsh.d.ts +1 -0
  159. package/dist/read.d.ts +5 -5
  160. package/dist/read.js +5 -5
  161. package/dist/replace.d.ts +2 -3
  162. package/dist/replace.js +6 -6
  163. package/dist/scaffold.d.ts +7 -3
  164. package/dist/scaffold.js +3 -1
  165. package/dist/search.d.ts +17 -3
  166. package/dist/search.js +5 -1
  167. package/dist/set-working-dir.d.ts +2 -3
  168. package/dist/skill.d.ts +4 -5
  169. package/dist/skill.js +1 -1
  170. package/dist/task.d.ts +6 -6
  171. package/dist/task.js +3 -3
  172. package/dist/test.d.ts +5 -4
  173. package/dist/test.js +6 -6
  174. package/dist/todo.d.ts +8 -8
  175. package/dist/todo.js +2 -2
  176. package/dist/tool-diff.js +11 -230
  177. package/dist/tool-help.d.ts +2 -3
  178. package/dist/tool-help.js +1 -1
  179. package/dist/tool-search.d.ts +2 -3
  180. package/dist/tool-search.js +1 -1
  181. package/dist/tool-summary.js +5 -281
  182. package/dist/tool-tier.js +52 -52
  183. package/dist/tool-use.d.ts +2 -3
  184. package/dist/tool-use.js +1 -1
  185. package/dist/tree.d.ts +5 -3
  186. package/dist/tree.js +5 -1
  187. package/dist/typecheck.d.ts +3 -3
  188. package/dist/typecheck.js +6 -6
  189. package/dist/write.d.ts +2 -3
  190. package/dist/write.js +6 -6
  191. package/package.json +5 -5
  192. package/dist/spawn-background.d.ts +0 -80
@@ -0,0 +1,29 @@
1
+ import { type ProjectServerClientMessage, type ProjectServerMessage } from './project-server-protocol.js';
2
+ import type { ClientState } from './project-server-types.js';
3
+ /**
4
+ * Cap on outbound bytes queued for one client before it is dropped. This
5
+ * server pushes index-activity updates to every client, and `socket.write()`
6
+ * buffers without limit when its `false` return is ignored — so one client
7
+ * that stops reading would otherwise grow the owner's heap indefinitely. The
8
+ * index lives in SQLite; a dropped client re-queries on reconnect.
9
+ */
10
+ export declare const MAX_CLIENT_WRITE_BUFFER_BYTES: number;
11
+ export declare function sendServerMessage(state: ClientState, message: ProjectServerMessage): void;
12
+ /**
13
+ * Frame reader for one client connection. Each frame is sniffed per first
14
+ * byte: `0x57` ('W') → length-prefixed MessagePack, anything else →
15
+ * newline-delimited JSON text. Bytes stay raw until a complete frame is
16
+ * assembled, so a multibyte UTF-8 sequence split across chunks is only ever
17
+ * decoded as part of a finished line (raw `0x0a` only occurs as the JSON
18
+ * delimiter — inside JSON strings `\n` is escaped — so a complete line is
19
+ * always complete UTF-8).
20
+ *
21
+ * The buffer is consumed with a scan offset rather than re-slicing after
22
+ * every frame: each parsed frame advances `scan` within the same Buffer,
23
+ * and the leftover tail is compacted once at the end of the call. A burst
24
+ * of small frames therefore costs one allocation per chunk, not one
25
+ * per frame (the previous slice-per-frame loop reallocated on every frame
26
+ * while pinning the whole parent buffer).
27
+ */
28
+ export declare function consumeClientChunk(state: ClientState, chunk: Buffer, onMessage: (state: ClientState, message: ProjectServerClientMessage) => void): void;
29
+ //# sourceMappingURL=project-server-framing.d.ts.map
@@ -0,0 +1,20 @@
1
+ import type { ProjectIndexServerMetadata } from './project-server-protocol.js';
2
+ export declare function removeMetadataIfOwned(metadataPath: string, pid: number): void;
3
+ export declare function writeProjectServerMetadata(metadataPath: string, metadata: ProjectIndexServerMetadata): Promise<void>;
4
+ /**
5
+ * One SIGINT/SIGTERM pair per PROCESS, not per module instance.
6
+ *
7
+ * The in-process test harness imports this module once per test case with a
8
+ * `?case=<n>` query URL, so every case evaluates this module body fresh; a
9
+ * bare top-level `process.once(signal, ...)` pair accumulates one handler
10
+ * per case until Node raises MaxListenersExceededWarning in every coverage
11
+ * run. The guard lives on globalThis under a Symbol.for key: the first
12
+ * evaluation registers the pair, every evaluation re-targets it at its own
13
+ * `stop`, and a fired signal removes the pair (once semantics).
14
+ */
15
+ export interface CodebaseIndexSignalGuard {
16
+ arm(stop: (signal: string) => Promise<void>): void;
17
+ }
18
+ export declare const SIGNAL_GUARD: unique symbol;
19
+ export declare function armCodebaseIndexSignalGuard(stop: (signal: string) => Promise<void>): void;
20
+ //# sourceMappingURL=project-server-lifecycle.d.ts.map
@@ -0,0 +1,37 @@
1
+ import type { ProjectIndexServerActivity, ProjectServerClientMessage, ProjectServerMessage } from './project-server-protocol.js';
2
+ import { type ServerQueryCaches } from './project-server-query-cache.js';
3
+ import type { ActiveFullIndex, ClientState } from './project-server-types.js';
4
+ import type { IndexOpArgs, OpShapes } from './worker-protocol.js';
5
+ export interface OperationContext {
6
+ projectRoot: string;
7
+ indexDir: string;
8
+ queryCaches: ServerQueryCaches;
9
+ getActivity: () => ProjectIndexServerActivity;
10
+ withIndexWrite: <T>(job: (onProgress: (currentFile: number, totalFiles: number) => void) => Promise<T>, options: {
11
+ preserveCaches: boolean;
12
+ }) => Promise<T>;
13
+ send: (state: ClientState, message: ProjectServerMessage) => void;
14
+ getActiveFullIndex: () => ActiveFullIndex | null;
15
+ setActiveFullIndex: (active: ActiveFullIndex | null) => void;
16
+ }
17
+ /**
18
+ * Cache policy at write-run completion.
19
+ *
20
+ * A run with an explicit targeted file list (edit/watcher reindex) makes a
21
+ * per-file surgical change, so — on success — every previous-generation entry
22
+ * stays valid as a stale answer for the NEXT refresh. On failure the run's
23
+ * transaction rolls back, which equally leaves the cached entries describing
24
+ * the on-disk truth. (Precision: the rollback is per-file — a multi-file
25
+ * targeted run commits the files that parsed and rolls back only the failed
26
+ * one — but each file's slice is atomic, and queries never straddle slices,
27
+ * so cached answers stay correct.) Anything else (full scan, force rebuild,
28
+ * langs/ignore-filtered scan) can reshape the whole index, so its caches are
29
+ * dropped on completion and on failure alike.
30
+ */
31
+ export declare function preservesQueryCaches(args: IndexOpArgs): boolean;
32
+ export declare function isShareableFullIndex(args: IndexOpArgs): boolean;
33
+ export declare function runFullIndex(ctx: OperationContext, state: ClientState, id: number, args: IndexOpArgs): Promise<OpShapes['index']['result']>;
34
+ export declare function dispatchOperation(ctx: OperationContext, state: ClientState, message: Extract<ProjectServerClientMessage, {
35
+ type: 'request';
36
+ }>): Promise<unknown>;
37
+ //# sourceMappingURL=project-server-operations.d.ts.map
@@ -0,0 +1,30 @@
1
+ import type * as net from 'node:net';
2
+ import type { OpShapes } from './worker-protocol.js';
3
+ export interface ClientState {
4
+ socket: net.Socket;
5
+ /**
6
+ * Raw inbound bytes. Frames may be newline-delimited JSON or length-
7
+ * prefixed binary (magic 0x57); the mode is sniffed per frame. Kept as
8
+ * bytes because a JSON text line may split a multibyte UTF-8 sequence at a
9
+ * chunk boundary — the StringDecoder handles that at parse time.
10
+ */
11
+ buffer: Buffer;
12
+ cancelled: Set<number>;
13
+ cancel: Map<number, () => void>;
14
+ watchExternal: boolean;
15
+ debounceMs: number;
16
+ coalesceWindowMs: number;
17
+ lastSeenAt: number;
18
+ /** True once this client has sent at least one binary frame. */
19
+ binary: boolean;
20
+ }
21
+ export interface FullIndexSubscriber {
22
+ state: ClientState;
23
+ id: number;
24
+ }
25
+ export interface ActiveFullIndex {
26
+ promise: Promise<OpShapes['index']['result']>;
27
+ controller: AbortController;
28
+ subscribers: Set<FullIndexSubscriber>;
29
+ }
30
+ //# sourceMappingURL=project-server-types.d.ts.map
@@ -0,0 +1,25 @@
1
+ import type { ClientState } from './project-server-types.js';
2
+ export declare const DEFAULT_EXTERNAL_DEBOUNCE_MS = 400;
3
+ export declare const DEFAULT_EXTERNAL_COALESCE_WINDOW_MS = 50;
4
+ export declare function isIgnoredRelativePath(relativePath: string): boolean;
5
+ export interface ProjectServerWatcherOptions {
6
+ projectRoot: string;
7
+ onFilesChanged: (files: string[]) => void;
8
+ }
9
+ export declare class ProjectServerWatcherManager {
10
+ private readonly options;
11
+ private externalWatcher;
12
+ private externalDebounceMs;
13
+ private externalCoalesceWindowMs;
14
+ private readonly externalDebounceTimers;
15
+ private readonly externalReadyFiles;
16
+ private externalReadyFlush;
17
+ constructor(options: ProjectServerWatcherOptions);
18
+ get isWatching(): boolean;
19
+ get pendingFileCount(): number;
20
+ private enqueueExternalFile;
21
+ private ensureExternalWatcher;
22
+ stop(): void;
23
+ reconcile(clients: Iterable<ClientState>): void;
24
+ }
25
+ //# sourceMappingURL=project-server-watcher.d.ts.map