plasalid 0.7.2 → 0.7.4

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 (39) hide show
  1. package/README.md +14 -14
  2. package/dist/accounts/taxonomy.d.ts +1 -1
  3. package/dist/accounts/taxonomy.js +1 -1
  4. package/dist/ai/agent.d.ts +5 -5
  5. package/dist/ai/agent.js +6 -6
  6. package/dist/ai/personas.d.ts +1 -1
  7. package/dist/ai/personas.js +14 -14
  8. package/dist/ai/prompt-sections.d.ts +4 -4
  9. package/dist/ai/prompt-sections.js +1 -1
  10. package/dist/ai/system-prompt.d.ts +2 -2
  11. package/dist/ai/system-prompt.js +4 -4
  12. package/dist/ai/tools/clarify.d.ts +2 -0
  13. package/dist/ai/tools/clarify.js +169 -0
  14. package/dist/ai/tools/index.js +7 -7
  15. package/dist/ai/tools/ingest.d.ts +1 -1
  16. package/dist/ai/tools/ingest.js +8 -8
  17. package/dist/ai/tools/read.js +1 -1
  18. package/dist/ai/tools/record.js +5 -5
  19. package/dist/ai/tools/types.d.ts +2 -2
  20. package/dist/cli/commands/clarify.d.ts +5 -0
  21. package/dist/cli/commands/clarify.js +44 -0
  22. package/dist/cli/commands/rules.js +1 -1
  23. package/dist/cli/commands/scan.js +9 -9
  24. package/dist/cli/commands/status.js +1 -1
  25. package/dist/cli/index.js +6 -6
  26. package/dist/cli/ink/ScanDashboard.d.ts +1 -1
  27. package/dist/cli/ink/ScanDashboard.js +2 -2
  28. package/dist/cli/setup.js +1 -1
  29. package/dist/cli/ux.js +1 -1
  30. package/dist/scanner/clarifier-memory.d.ts +8 -0
  31. package/dist/scanner/clarifier-memory.js +24 -0
  32. package/dist/scanner/clarifier.d.ts +39 -0
  33. package/dist/scanner/clarifier.js +196 -0
  34. package/dist/scanner/engine.d.ts +3 -3
  35. package/dist/scanner/engine.js +8 -8
  36. package/dist/scanner/hooks.d.ts +3 -3
  37. package/dist/scanner/worker.d.ts +1 -1
  38. package/dist/scanner/worker.js +1 -1
  39. package/package.json +1 -1
@@ -3,7 +3,7 @@ import { createProgress } from "./progress.js";
3
3
  import { decryptPhase } from "./decrypt.js";
4
4
  import { parsePhase } from "./parse.js";
5
5
  import { chunkPdf } from "./pdf/chunker.js";
6
- import { runResolve } from "./resolver.js";
6
+ import { runClarify } from "./clarifier.js";
7
7
  import { errorMessage } from "./result.js";
8
8
  const chunkPhase = async (_db, state, hooks) => {
9
9
  await hooks.beforeChunk?.(state);
@@ -11,21 +11,21 @@ const chunkPhase = async (_db, state, hooks) => {
11
11
  state.chunks.push(...await chunkPdf(file));
12
12
  await hooks.afterChunk?.(state);
13
13
  };
14
- const resolvePhase = async (db, state, hooks) => {
15
- await hooks.beforeResolve?.(state);
16
- const summary = await runResolve({
14
+ const clarifyPhase = async (db, state, hooks) => {
15
+ await hooks.beforeClarify?.(state);
16
+ const summary = await runClarify({
17
17
  db,
18
18
  scanId: state.scanId,
19
19
  interactive: state.options.interactive ?? true,
20
20
  });
21
- state.resolveSummary = summary;
22
- await hooks.afterResolve?.(state, summary);
21
+ state.clarifySummary = summary;
22
+ await hooks.afterClarify?.(state, summary);
23
23
  };
24
24
  export const DEFAULT_PHASES = [
25
25
  { name: "decrypt", phase: decryptPhase },
26
26
  { name: "chunk", phase: chunkPhase },
27
27
  { name: "parse", phase: parsePhase },
28
- { name: "resolve", phase: resolvePhase },
28
+ { name: "clarify", phase: clarifyPhase },
29
29
  ];
30
30
  /**
31
31
  * Composition root. Builds the progress sink once per scan run, threads it
@@ -45,7 +45,7 @@ export async function runScan(db, opts = {}, hooks = {}) {
45
45
  skipped: [],
46
46
  failed: [],
47
47
  chunks: [],
48
- resolveSummary: null,
48
+ clarifySummary: null,
49
49
  errors: [],
50
50
  };
51
51
  await fire(hooks.onStart, state);
@@ -1,5 +1,5 @@
1
1
  import type { Chunk, ScanState, PhaseName } from "./engine.js";
2
- import type { ResolveSummary } from "./resolver.js";
2
+ import type { ClarifySummary } from "./clarifier.js";
3
3
  export type MaybePromise<T> = T | Promise<T>;
4
4
  /**
5
5
  * Lifecycle hooks the engine fires at phase edges. CLI registers spinner/Ink
@@ -16,8 +16,8 @@ export interface ScanHooks {
16
16
  onWorkerStart?(workerId: string, chunk: Chunk): void;
17
17
  onWorkerEnd?(workerId: string, chunk: Chunk, ok: boolean): void;
18
18
  afterParse?(s: Readonly<ScanState>): MaybePromise<void>;
19
- beforeResolve?(s: Readonly<ScanState>): MaybePromise<void>;
20
- afterResolve?(s: Readonly<ScanState>, summary: ResolveSummary): MaybePromise<void>;
19
+ beforeClarify?(s: Readonly<ScanState>): MaybePromise<void>;
20
+ afterClarify?(s: Readonly<ScanState>, summary: ClarifySummary): MaybePromise<void>;
21
21
  onError?(err: unknown, phase: PhaseName, s: Readonly<ScanState>): MaybePromise<void>;
22
22
  onFinish?(s: Readonly<ScanState>): MaybePromise<void>;
23
23
  }
@@ -14,6 +14,6 @@ export interface ScanWorkerDeps {
14
14
  * scanId + progress sink + scanned_files row injected through the agent
15
15
  * context. Agent's record_transactions / note_question calls write directly to
16
16
  * the DB; per-row ticks fan out via `progress.emit`. Failures land in the DB
17
- * as a `chunk_failed` question so the resolver can pick them up.
17
+ * as a `chunk_failed` question so the clarifier can pick them up.
18
18
  */
19
19
  export declare function runScanWorker(deps: ScanWorkerDeps, hooks: ScanHooks): Promise<void>;
@@ -8,7 +8,7 @@ import { tryExecute } from "./result.js";
8
8
  * scanId + progress sink + scanned_files row injected through the agent
9
9
  * context. Agent's record_transactions / note_question calls write directly to
10
10
  * the DB; per-row ticks fan out via `progress.emit`. Failures land in the DB
11
- * as a `chunk_failed` question so the resolver can pick them up.
11
+ * as a `chunk_failed` question so the clarifier can pick them up.
12
12
  */
13
13
  export async function runScanWorker(deps, hooks) {
14
14
  const workerId = `cw:${randomUUID()}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "plasalid",
3
- "version": "0.7.2",
3
+ "version": "0.7.4",
4
4
  "description": "Plasalid — The Harness Layer for Personal Finance",
5
5
  "keywords": [
6
6
  "finance",