agent-recall-core 3.4.18 → 3.4.21

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 (125) hide show
  1. package/README.md +404 -981
  2. package/dist/index.d.ts +45 -1
  3. package/dist/index.d.ts.map +1 -1
  4. package/dist/index.js +33 -1
  5. package/dist/index.js.map +1 -1
  6. package/dist/naming.d.ts +109 -0
  7. package/dist/naming.d.ts.map +1 -0
  8. package/dist/naming.js +198 -0
  9. package/dist/naming.js.map +1 -0
  10. package/dist/palace/awareness.d.ts +6 -0
  11. package/dist/palace/awareness.d.ts.map +1 -1
  12. package/dist/palace/awareness.js +19 -0
  13. package/dist/palace/awareness.js.map +1 -1
  14. package/dist/palace/fsrs.d.ts +64 -0
  15. package/dist/palace/fsrs.d.ts.map +1 -0
  16. package/dist/palace/fsrs.js +86 -0
  17. package/dist/palace/fsrs.js.map +1 -0
  18. package/dist/palace/hopfield.d.ts +108 -0
  19. package/dist/palace/hopfield.d.ts.map +1 -0
  20. package/dist/palace/hopfield.js +237 -0
  21. package/dist/palace/hopfield.js.map +1 -0
  22. package/dist/palace/obsidian.d.ts.map +1 -1
  23. package/dist/palace/obsidian.js +25 -1
  24. package/dist/palace/obsidian.js.map +1 -1
  25. package/dist/palace/pipeline.d.ts +61 -0
  26. package/dist/palace/pipeline.d.ts.map +1 -0
  27. package/dist/palace/pipeline.js +289 -0
  28. package/dist/palace/pipeline.js.map +1 -0
  29. package/dist/palace/skills.d.ts +71 -0
  30. package/dist/palace/skills.d.ts.map +1 -0
  31. package/dist/palace/skills.js +225 -0
  32. package/dist/palace/skills.js.map +1 -0
  33. package/dist/storage/behavior-policies.d.ts +54 -0
  34. package/dist/storage/behavior-policies.d.ts.map +1 -0
  35. package/dist/storage/behavior-policies.js +98 -0
  36. package/dist/storage/behavior-policies.js.map +1 -0
  37. package/dist/storage/corrections.d.ts +54 -0
  38. package/dist/storage/corrections.d.ts.map +1 -1
  39. package/dist/storage/corrections.js +93 -4
  40. package/dist/storage/corrections.js.map +1 -1
  41. package/dist/storage/cwd-allowlist.d.ts +33 -0
  42. package/dist/storage/cwd-allowlist.d.ts.map +1 -0
  43. package/dist/storage/cwd-allowlist.js +106 -0
  44. package/dist/storage/cwd-allowlist.js.map +1 -0
  45. package/dist/storage/dream-health.d.ts +19 -0
  46. package/dist/storage/dream-health.d.ts.map +1 -0
  47. package/dist/storage/dream-health.js +79 -0
  48. package/dist/storage/dream-health.js.map +1 -0
  49. package/dist/storage/paths.d.ts +12 -0
  50. package/dist/storage/paths.d.ts.map +1 -1
  51. package/dist/storage/paths.js +37 -15
  52. package/dist/storage/paths.js.map +1 -1
  53. package/dist/storage/project.d.ts +6 -0
  54. package/dist/storage/project.d.ts.map +1 -1
  55. package/dist/storage/project.js +26 -1
  56. package/dist/storage/project.js.map +1 -1
  57. package/dist/storage/session.d.ts.map +1 -1
  58. package/dist/storage/session.js +16 -1
  59. package/dist/storage/session.js.map +1 -1
  60. package/dist/tools-logic/bootstrap.d.ts.map +1 -1
  61. package/dist/tools-logic/bootstrap.js +69 -6
  62. package/dist/tools-logic/bootstrap.js.map +1 -1
  63. package/dist/tools-logic/check-action.d.ts +55 -0
  64. package/dist/tools-logic/check-action.d.ts.map +1 -0
  65. package/dist/tools-logic/check-action.js +152 -0
  66. package/dist/tools-logic/check-action.js.map +1 -0
  67. package/dist/tools-logic/dashboard-export.d.ts +75 -0
  68. package/dist/tools-logic/dashboard-export.d.ts.map +1 -0
  69. package/dist/tools-logic/dashboard-export.js +271 -0
  70. package/dist/tools-logic/dashboard-export.js.map +1 -0
  71. package/dist/tools-logic/pipeline-close.d.ts +22 -0
  72. package/dist/tools-logic/pipeline-close.d.ts.map +1 -0
  73. package/dist/tools-logic/pipeline-close.js +66 -0
  74. package/dist/tools-logic/pipeline-close.js.map +1 -0
  75. package/dist/tools-logic/pipeline-current.d.ts +11 -0
  76. package/dist/tools-logic/pipeline-current.d.ts.map +1 -0
  77. package/dist/tools-logic/pipeline-current.js +8 -0
  78. package/dist/tools-logic/pipeline-current.js.map +1 -0
  79. package/dist/tools-logic/pipeline-list.d.ts +11 -0
  80. package/dist/tools-logic/pipeline-list.d.ts.map +1 -0
  81. package/dist/tools-logic/pipeline-list.js +8 -0
  82. package/dist/tools-logic/pipeline-list.js.map +1 -0
  83. package/dist/tools-logic/pipeline-open.d.ts +23 -0
  84. package/dist/tools-logic/pipeline-open.d.ts.map +1 -0
  85. package/dist/tools-logic/pipeline-open.js +109 -0
  86. package/dist/tools-logic/pipeline-open.js.map +1 -0
  87. package/dist/tools-logic/pipeline-show.d.ts +34 -0
  88. package/dist/tools-logic/pipeline-show.d.ts.map +1 -0
  89. package/dist/tools-logic/pipeline-show.js +134 -0
  90. package/dist/tools-logic/pipeline-show.js.map +1 -0
  91. package/dist/tools-logic/register-rule.d.ts +15 -0
  92. package/dist/tools-logic/register-rule.d.ts.map +1 -0
  93. package/dist/tools-logic/register-rule.js +13 -0
  94. package/dist/tools-logic/register-rule.js.map +1 -0
  95. package/dist/tools-logic/session-end-reflect.d.ts +57 -0
  96. package/dist/tools-logic/session-end-reflect.d.ts.map +1 -0
  97. package/dist/tools-logic/session-end-reflect.js +117 -0
  98. package/dist/tools-logic/session-end-reflect.js.map +1 -0
  99. package/dist/tools-logic/session-end.d.ts +29 -0
  100. package/dist/tools-logic/session-end.d.ts.map +1 -1
  101. package/dist/tools-logic/session-end.js +34 -0
  102. package/dist/tools-logic/session-end.js.map +1 -1
  103. package/dist/tools-logic/session-start-lite.d.ts +26 -0
  104. package/dist/tools-logic/session-start-lite.d.ts.map +1 -0
  105. package/dist/tools-logic/session-start-lite.js +46 -0
  106. package/dist/tools-logic/session-start-lite.js.map +1 -0
  107. package/dist/tools-logic/session-start.d.ts +26 -0
  108. package/dist/tools-logic/session-start.d.ts.map +1 -1
  109. package/dist/tools-logic/session-start.js +53 -7
  110. package/dist/tools-logic/session-start.js.map +1 -1
  111. package/dist/tools-logic/skill-list.d.ts +19 -0
  112. package/dist/tools-logic/skill-list.d.ts.map +1 -0
  113. package/dist/tools-logic/skill-list.js +20 -0
  114. package/dist/tools-logic/skill-list.js.map +1 -0
  115. package/dist/tools-logic/skill-recall.d.ts +26 -0
  116. package/dist/tools-logic/skill-recall.d.ts.map +1 -0
  117. package/dist/tools-logic/skill-recall.js +32 -0
  118. package/dist/tools-logic/skill-recall.js.map +1 -0
  119. package/dist/tools-logic/skill-write.d.ts +23 -0
  120. package/dist/tools-logic/skill-write.d.ts.map +1 -0
  121. package/dist/tools-logic/skill-write.js +46 -0
  122. package/dist/tools-logic/skill-write.js.map +1 -0
  123. package/dist/types.d.ts +1 -1
  124. package/dist/types.js +1 -1
  125. package/package.json +1 -1
@@ -0,0 +1,8 @@
1
+ import { resolveProject } from "../storage/project.js";
2
+ import { findActiveMilestone } from "../palace/pipeline.js";
3
+ export async function pipelineCurrent(input) {
4
+ const slug = await resolveProject(input.project);
5
+ const milestone = findActiveMilestone(slug);
6
+ return { success: true, project: slug, milestone };
7
+ }
8
+ //# sourceMappingURL=pipeline-current.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pipeline-current.js","sourceRoot":"","sources":["../../src/tools-logic/pipeline-current.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAkB,MAAM,uBAAuB,CAAC;AAY5E,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,KAA2B;IAC/D,MAAM,IAAI,GAAG,MAAM,cAAc,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IACjD,MAAM,SAAS,GAAG,mBAAmB,CAAC,IAAI,CAAC,CAAC;IAC5C,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;AACrD,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { type MilestoneSummary } from "../palace/pipeline.js";
2
+ export interface PipelineListInput {
3
+ project?: string;
4
+ }
5
+ export interface PipelineListResult {
6
+ success: boolean;
7
+ project: string;
8
+ milestones: MilestoneSummary[];
9
+ }
10
+ export declare function pipelineList(input: PipelineListInput): Promise<PipelineListResult>;
11
+ //# sourceMappingURL=pipeline-list.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pipeline-list.d.ts","sourceRoot":"","sources":["../../src/tools-logic/pipeline-list.ts"],"names":[],"mappings":"AACA,OAAO,EAA6B,KAAK,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzF,MAAM,WAAW,iBAAiB;IAChC,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,gBAAgB,EAAE,CAAC;CAChC;AAED,wBAAsB,YAAY,CAAC,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAIxF"}
@@ -0,0 +1,8 @@
1
+ import { resolveProject } from "../storage/project.js";
2
+ import { listMilestones, summarize } from "../palace/pipeline.js";
3
+ export async function pipelineList(input) {
4
+ const slug = await resolveProject(input.project);
5
+ const milestones = listMilestones(slug).map(summarize);
6
+ return { success: true, project: slug, milestones };
7
+ }
8
+ //# sourceMappingURL=pipeline-list.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pipeline-list.js","sourceRoot":"","sources":["../../src/tools-logic/pipeline-list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,SAAS,EAAyB,MAAM,uBAAuB,CAAC;AAYzF,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,KAAwB;IACzD,MAAM,IAAI,GAAG,MAAM,cAAc,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IACjD,MAAM,UAAU,GAAG,cAAc,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IACvD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC;AACtD,CAAC"}
@@ -0,0 +1,23 @@
1
+ export interface PipelineOpenInput {
2
+ project?: string;
3
+ phase_name: string;
4
+ goal: string;
5
+ close_previous_with_synthesis?: string;
6
+ /** Mark this phase as auto-drafted (background process). Default false. */
7
+ auto?: boolean;
8
+ }
9
+ export interface PipelineOpenResult {
10
+ success: boolean;
11
+ project: string;
12
+ order: number;
13
+ phase: string;
14
+ file_path: string;
15
+ closed_previous?: {
16
+ order: number;
17
+ phase: string;
18
+ file_path: string;
19
+ };
20
+ error?: string;
21
+ }
22
+ export declare function pipelineOpen(input: PipelineOpenInput): Promise<PipelineOpenResult>;
23
+ //# sourceMappingURL=pipeline-open.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pipeline-open.d.ts","sourceRoot":"","sources":["../../src/tools-logic/pipeline-open.ts"],"names":[],"mappings":"AA0BA,MAAM,WAAW,iBAAiB;IAChC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,6BAA6B,CAAC,EAAE,MAAM,CAAC;IACvC,2EAA2E;IAC3E,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC;IACtE,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AA0BD,wBAAsB,YAAY,CAAC,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAyExF"}
@@ -0,0 +1,109 @@
1
+ import * as fs from "node:fs";
2
+ import { resolveProject } from "../storage/project.js";
3
+ import { withLock } from "../storage/filelock.js";
4
+ import { syncToSupabase } from "../supabase/sync.js";
5
+ import { findActiveMilestone, nextOrder, writeMilestone, PLACEHOLDER, } from "../palace/pipeline.js";
6
+ /**
7
+ * Fire-and-forget Supabase sync. Reads the just-written file back inside the
8
+ * caller's lock window; the actual upload is deferred via setImmediate inside
9
+ * syncToSupabase, so this never blocks.
10
+ */
11
+ function syncPipelineFile(filePath, project) {
12
+ try {
13
+ const content = fs.readFileSync(filePath, "utf-8");
14
+ syncToSupabase(filePath, content, project, "palace", "pipeline");
15
+ }
16
+ catch {
17
+ // Best-effort — Supabase sync failures must never break a write.
18
+ }
19
+ }
20
+ function autoCloseActive(project, active, synthesis) {
21
+ const closedAt = new Date().toISOString();
22
+ const updatedMeta = { ...active.meta, status: "closed", closed: closedAt };
23
+ const sections = {
24
+ goal: active.sections.goal,
25
+ what_was_hard: active.sections.what_was_hard && active.sections.what_was_hard !== PLACEHOLDER
26
+ ? active.sections.what_was_hard
27
+ : "(not captured at close)",
28
+ how_solved: active.sections.how_solved && active.sections.how_solved !== PLACEHOLDER
29
+ ? active.sections.how_solved
30
+ : "(not captured at close)",
31
+ synthesis,
32
+ };
33
+ const filePath = writeMilestone(project, updatedMeta, sections, active.file_path);
34
+ syncPipelineFile(filePath, project);
35
+ return { order: active.meta.order, phase: active.meta.phase, file_path: filePath };
36
+ }
37
+ export async function pipelineOpen(input) {
38
+ const slug = await resolveProject(input.project);
39
+ const phaseName = (input.phase_name ?? "").trim();
40
+ const goal = (input.goal ?? "").trim();
41
+ if (!phaseName) {
42
+ return {
43
+ success: false,
44
+ project: slug,
45
+ order: 0,
46
+ phase: "",
47
+ file_path: "",
48
+ error: "phase_name is required (non-empty after trim).",
49
+ };
50
+ }
51
+ if (!goal) {
52
+ return {
53
+ success: false,
54
+ project: slug,
55
+ order: 0,
56
+ phase: phaseName,
57
+ file_path: "",
58
+ error: "goal is required (non-empty after trim).",
59
+ };
60
+ }
61
+ return withLock(`pipeline-${slug}`, () => {
62
+ const active = findActiveMilestone(slug);
63
+ let closedPrev;
64
+ if (active) {
65
+ if (input.close_previous_with_synthesis && input.close_previous_with_synthesis.trim()) {
66
+ closedPrev = autoCloseActive(slug, active, input.close_previous_with_synthesis.trim());
67
+ }
68
+ else {
69
+ return {
70
+ success: false,
71
+ project: slug,
72
+ order: active.meta.order,
73
+ phase: active.meta.phase,
74
+ file_path: active.file_path,
75
+ error: `Phase ${active.meta.order} (${active.meta.phase}) is still active. Close it with pipeline_close, or pass close_previous_with_synthesis to auto-close.`,
76
+ };
77
+ }
78
+ }
79
+ const order = nextOrder(slug);
80
+ const openedAt = new Date().toISOString();
81
+ const meta = {
82
+ phase: phaseName,
83
+ order,
84
+ status: "active",
85
+ opened: openedAt,
86
+ closed: null,
87
+ auto: input.auto === true,
88
+ };
89
+ const sections = {
90
+ goal,
91
+ what_was_hard: PLACEHOLDER,
92
+ how_solved: PLACEHOLDER,
93
+ synthesis: PLACEHOLDER,
94
+ };
95
+ const filePath = writeMilestone(slug, meta, sections);
96
+ syncPipelineFile(filePath, slug);
97
+ const result = {
98
+ success: true,
99
+ project: slug,
100
+ order,
101
+ phase: phaseName,
102
+ file_path: filePath,
103
+ };
104
+ if (closedPrev)
105
+ result.closed_previous = closedPrev;
106
+ return result;
107
+ });
108
+ }
109
+ //# sourceMappingURL=pipeline-open.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pipeline-open.js","sourceRoot":"","sources":["../../src/tools-logic/pipeline-open.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM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C"}
@@ -0,0 +1,34 @@
1
+ /**
2
+ * pipeline_show — render a project's narrative spine on demand.
3
+ *
4
+ * Reads existing pipeline/*.md milestones + journal entries + corrections.
5
+ * No writes, no LLM. Lazy reconstruction view of "where is this project."
6
+ */
7
+ import { type MilestoneSummary } from "../palace/pipeline.js";
8
+ export interface PipelineShowInput {
9
+ project?: string;
10
+ /** Render full sections (what_was_hard, how_solved) for the last N phases. Default 3. */
11
+ detail_last_n?: number;
12
+ }
13
+ export interface SubstrateStats {
14
+ sessions: {
15
+ count: number;
16
+ first_iso: string | null;
17
+ last_iso: string | null;
18
+ days_span: number;
19
+ };
20
+ corrections: {
21
+ count: number;
22
+ };
23
+ }
24
+ export interface PipelineShowResult {
25
+ success: boolean;
26
+ project: string;
27
+ substrate: SubstrateStats;
28
+ spine: MilestoneSummary[];
29
+ active: MilestoneSummary | null;
30
+ /** Pretty-printed combined view, suitable for direct display. */
31
+ view: string;
32
+ }
33
+ export declare function pipelineShow(input: PipelineShowInput): Promise<PipelineShowResult>;
34
+ //# sourceMappingURL=pipeline-show.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pipeline-show.d.ts","sourceRoot":"","sources":["../../src/tools-logic/pipeline-show.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,EAGL,KAAK,gBAAgB,EAEtB,MAAM,uBAAuB,CAAC;AAE/B,MAAM,WAAW,iBAAiB;IAChC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,yFAAyF;IACzF,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE;QACR,KAAK,EAAE,MAAM,CAAC;QACd,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;QACzB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;QACxB,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;IACF,WAAW,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;CAChC;AAED,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,cAAc,CAAC;IAC1B,KAAK,EAAE,gBAAgB,EAAE,CAAC;IAC1B,MAAM,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAChC,iEAAiE;IACjE,IAAI,EAAE,MAAM,CAAC;CACd;AA4HD,wBAAsB,YAAY,CAAC,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAexF"}
@@ -0,0 +1,134 @@
1
+ /**
2
+ * pipeline_show — render a project's narrative spine on demand.
3
+ *
4
+ * Reads existing pipeline/*.md milestones + journal entries + corrections.
5
+ * No writes, no LLM. Lazy reconstruction view of "where is this project."
6
+ */
7
+ import { resolveProject } from "../storage/project.js";
8
+ import { listJournalFiles } from "../helpers/journal-files.js";
9
+ import { readCorrections } from "../storage/corrections.js";
10
+ import { listMilestones, summarize, } from "../palace/pipeline.js";
11
+ function daysBetween(aISO, bISO) {
12
+ const a = new Date(aISO).getTime();
13
+ const b = new Date(bISO).getTime();
14
+ if (Number.isNaN(a) || Number.isNaN(b))
15
+ return 0;
16
+ return Math.max(0, Math.round(Math.abs(b - a) / (1000 * 60 * 60 * 24)));
17
+ }
18
+ function formatDuration(opened, closed, status) {
19
+ if (status === "active") {
20
+ const d = daysBetween(opened, new Date().toISOString());
21
+ return d > 0 ? `${d}d open` : "open today";
22
+ }
23
+ if (!closed)
24
+ return "";
25
+ const d = daysBetween(opened, closed);
26
+ return d > 0 ? `${d}d` : "same-day";
27
+ }
28
+ function gatherSubstrate(slug) {
29
+ const journals = listJournalFiles(slug);
30
+ const dates = journals.map((j) => j.date).filter(Boolean).sort();
31
+ const first = dates[0] ?? null;
32
+ const last = dates[dates.length - 1] ?? null;
33
+ const corrections = readCorrections(slug);
34
+ return {
35
+ sessions: {
36
+ count: journals.length,
37
+ first_iso: first,
38
+ last_iso: last,
39
+ days_span: first && last ? daysBetween(first, last) : 0,
40
+ },
41
+ corrections: { count: corrections.length },
42
+ };
43
+ }
44
+ function renderPhase(m, detailed) {
45
+ const lines = [];
46
+ const statusLabel = m.meta.status === "active" ? "ACTIVE" : m.meta.status === "abandoned" ? "abandoned" : "closed";
47
+ const autoFlag = m.meta.auto ? " ⚠auto" : "";
48
+ const dur = formatDuration(m.meta.opened, m.meta.closed ?? null, m.meta.status);
49
+ const opened = m.meta.opened?.slice(0, 10) ?? "?";
50
+ const datePart = dur ? `${opened}, ${dur}` : opened;
51
+ lines.push(` ${String(m.meta.order).padStart(2, "0")} ${m.meta.phase} (${statusLabel} ${datePart}${autoFlag})`);
52
+ const realGoal = m.sections.goal && m.sections.goal !== "(in progress)" ? m.sections.goal : null;
53
+ if (realGoal)
54
+ lines.push(` Goal: ${realGoal}`);
55
+ if (detailed) {
56
+ const hard = m.sections.what_was_hard && m.sections.what_was_hard !== "(in progress)" ? m.sections.what_was_hard : null;
57
+ const how = m.sections.how_solved && m.sections.how_solved !== "(in progress)" ? m.sections.how_solved : null;
58
+ if (hard)
59
+ lines.push(` Hard: ${hard}`);
60
+ if (how)
61
+ lines.push(` Solved by: ${how}`);
62
+ }
63
+ if (m.meta.status !== "active" && m.sections.synthesis && m.sections.synthesis !== "(in progress)") {
64
+ lines.push(` → ${m.sections.synthesis}`);
65
+ }
66
+ if (m.meta.status === "active") {
67
+ lines.push(` (in progress — no synthesis yet)`);
68
+ }
69
+ lines.push("");
70
+ return lines;
71
+ }
72
+ function renderView(slug, substrate, milestones, active, detailLastN) {
73
+ const lines = [];
74
+ lines.push(`=== ${slug} ===`);
75
+ const { sessions, corrections } = substrate;
76
+ if (sessions.count > 0) {
77
+ if (sessions.count === 1 || sessions.days_span === 0) {
78
+ lines.push(`Sessions: ${sessions.count} (${sessions.first_iso})`);
79
+ }
80
+ else {
81
+ lines.push(`Sessions: ${sessions.count} over ${sessions.days_span} day${sessions.days_span === 1 ? "" : "s"} (${sessions.first_iso} → ${sessions.last_iso})`);
82
+ }
83
+ }
84
+ if (corrections.count > 0) {
85
+ lines.push(`Corrections logged: ${corrections.count}`);
86
+ }
87
+ const closed = milestones.filter((m) => m.meta.status === "closed").length;
88
+ const abandoned = milestones.filter((m) => m.meta.status === "abandoned").length;
89
+ const activeCount = milestones.filter((m) => m.meta.status === "active").length;
90
+ if (milestones.length > 0) {
91
+ const parts = [`${closed} closed`];
92
+ if (abandoned > 0)
93
+ parts.push(`${abandoned} abandoned`);
94
+ parts.push(`${activeCount} active`);
95
+ lines.push(`Phases: ${milestones.length} (${parts.join(", ")})`);
96
+ }
97
+ else {
98
+ lines.push(`Phases: 0`);
99
+ }
100
+ lines.push("");
101
+ if (milestones.length === 0) {
102
+ lines.push("[No phases yet. Open one with pipeline_open or wait for v1.5 auto-detection.]");
103
+ return lines.join("\n").trimEnd();
104
+ }
105
+ // Render. Detail (hard/solved) only for the last N phases — keeps output bounded.
106
+ const detailStart = Math.max(0, milestones.length - detailLastN);
107
+ milestones.forEach((m, i) => {
108
+ lines.push(...renderPhase(m, i >= detailStart));
109
+ });
110
+ if (active) {
111
+ lines.push(`▶ Currently active: Phase ${active.meta.order} — ${active.meta.phase}`);
112
+ if (active.sections.goal && active.sections.goal !== "(in progress)") {
113
+ lines.push(` Goal: ${active.sections.goal}`);
114
+ }
115
+ }
116
+ return lines.join("\n").trimEnd();
117
+ }
118
+ export async function pipelineShow(input) {
119
+ const slug = await resolveProject(input.project);
120
+ const substrate = gatherSubstrate(slug);
121
+ const milestones = listMilestones(slug);
122
+ const active = milestones.find((m) => m.meta.status === "active") ?? null;
123
+ const detailLastN = typeof input.detail_last_n === "number" && input.detail_last_n >= 0 ? input.detail_last_n : 3;
124
+ const view = renderView(slug, substrate, milestones, active, detailLastN);
125
+ return {
126
+ success: true,
127
+ project: slug,
128
+ substrate,
129
+ spine: milestones.map(summarize),
130
+ active: active ? summarize(active) : null,
131
+ view,
132
+ };
133
+ }
134
+ //# sourceMappingURL=pipeline-show.js.map
@@ -0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MAAM,SAAS,GAAG,eAAe,CAAC,IAAI,CAAC,CAAC;IACxC,MAAM,UAAU,GAAG,cAAc,CAAC,IAAI,CAAC,CAAC;IACxC,MAAM,MAAM,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,KAAK,QAAQ,CAAC,IAAI,IAAI,CAAC;IAC1E,MAAM,WAAW,GAAG,OAAO,KAAK,CAAC,aAAa,KAAK,QAAQ,IAAI,KAAK,CAAC,aAAa,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;IAClH,MAAM,IAAI,GAAG,UAAU,CAAC,IAAI,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC;IAC1E,OAAO;QACL,OAAO,EAAE,IAAI;QACb,OAAO,EAAE,IAAI;QACb,SAAS;QACT,KAAK,EAAE,UAAU,CAAC,GAAG,CAAC,SAAS,CAAC;QAChC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI;QACzC,IAAI;KACL,CAAC;AACJ,CAAC"}
@@ -0,0 +1,15 @@
1
+ export interface RegisterRuleToolInput {
2
+ project?: string;
3
+ name: string;
4
+ when: string;
5
+ do: string;
6
+ }
7
+ export interface RegisterRuleToolResult {
8
+ success: boolean;
9
+ project: string;
10
+ rule_id?: string;
11
+ total_rules?: number;
12
+ error?: string;
13
+ }
14
+ export declare function registerRule(input: RegisterRuleToolInput): Promise<RegisterRuleToolResult>;
15
+ //# sourceMappingURL=register-rule.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"register-rule.d.ts","sourceRoot":"","sources":["../../src/tools-logic/register-rule.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,qBAAqB;IACpC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,wBAAsB,YAAY,CAAC,KAAK,EAAE,qBAAqB,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAShG"}
@@ -0,0 +1,13 @@
1
+ import { resolveProject } from "../storage/project.js";
2
+ import { registerBehaviorRule } from "../storage/behavior-policies.js";
3
+ export async function registerRule(input) {
4
+ const slug = await resolveProject(input.project);
5
+ const r = registerBehaviorRule({
6
+ project: slug,
7
+ name: input.name,
8
+ when: input.when,
9
+ do: input.do,
10
+ });
11
+ return { ...r, project: slug };
12
+ }
13
+ //# sourceMappingURL=register-rule.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"register-rule.js","sourceRoot":"","sources":["../../src/tools-logic/register-rule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAiBvE,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,KAA4B;IAC7D,MAAM,IAAI,GAAG,MAAM,cAAc,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IACjD,MAAM,CAAC,GAAG,oBAAoB,CAAC;QAC7B,OAAO,EAAE,IAAI;QACb,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,EAAE,EAAE,KAAK,CAAC,EAAE;KACb,CAAC,CAAC;IACH,OAAO,EAAE,GAAG,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AACjC,CAAC"}
@@ -0,0 +1,57 @@
1
+ /**
2
+ * Reflect — Park-2023-style aggregation step.
3
+ *
4
+ * The V2 finding: AgentRecall only promotes insights from CORRECTIONS.
5
+ * Successful patterns never become semantic knowledge. Generative Agents
6
+ * (Park et al. 2023) showed that periodic LLM-driven distillation of raw
7
+ * memories into "high-level questions + derived insights" is the move
8
+ * that makes memory compound.
9
+ *
10
+ * Design choice: this tool does NOT call an LLM directly. Core is meant
11
+ * to stay deterministic + dependency-free of any model API. Instead, we
12
+ * package the necessary inputs + prompt template into a structured
13
+ * payload that the calling MCP tool returns to the LLM in the loop, and
14
+ * the LLM does the synthesis on its own turn. The result can then be
15
+ * fed back via `skill_write` or `awareness_update`.
16
+ *
17
+ * Why: this matches AgentRecall's "agent-as-author" stance — the agent
18
+ * already in the conversation writes its own reflection, we just give it
19
+ * the inputs.
20
+ */
21
+ export interface ReflectInput {
22
+ project?: string;
23
+ /** Look back this many days of journal entries. Default 7. */
24
+ lookback_days?: number;
25
+ }
26
+ export interface ReflectInputBundle {
27
+ /** Journal entries (file path + first 800 chars) within lookback window. */
28
+ recent_journals: Array<{
29
+ date: string;
30
+ file: string;
31
+ excerpt: string;
32
+ }>;
33
+ /** Active corrections relevant to the lookback window. */
34
+ active_corrections: Array<{
35
+ id: string;
36
+ rule: string;
37
+ severity: string;
38
+ precision: number | null;
39
+ }>;
40
+ /** Last 3 closed pipeline phases with their synthesis. */
41
+ recent_phases: Array<{
42
+ order: number;
43
+ phase: string;
44
+ synthesis: string;
45
+ }>;
46
+ }
47
+ export interface ReflectResult {
48
+ success: boolean;
49
+ project: string;
50
+ bundle: ReflectInputBundle;
51
+ /** Ready-to-paste prompt the calling LLM can use to write reflection back. */
52
+ prompt: string;
53
+ /** Suggested follow-up tool calls. */
54
+ next_actions: string[];
55
+ }
56
+ export declare function sessionEndReflect(input: ReflectInput): Promise<ReflectResult>;
57
+ //# sourceMappingURL=session-end-reflect.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session-end-reflect.d.ts","sourceRoot":"","sources":["../../src/tools-logic/session-end-reflect.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AASH,MAAM,WAAW,YAAY;IAC3B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,8DAA8D;IAC9D,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,kBAAkB;IACjC,4EAA4E;IAC5E,eAAe,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACxE,0DAA0D;IAC1D,kBAAkB,EAAE,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,CAAC,CAAC;IACpG,0DAA0D;IAC1D,aAAa,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAC3E;AAED,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,kBAAkB,CAAC;IAC3B,8EAA8E;IAC9E,MAAM,EAAE,MAAM,CAAC;IACf,sCAAsC;IACtC,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB;AAID,wBAAsB,iBAAiB,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAAC,aAAa,CAAC,CA0DnF"}
@@ -0,0 +1,117 @@
1
+ /**
2
+ * Reflect — Park-2023-style aggregation step.
3
+ *
4
+ * The V2 finding: AgentRecall only promotes insights from CORRECTIONS.
5
+ * Successful patterns never become semantic knowledge. Generative Agents
6
+ * (Park et al. 2023) showed that periodic LLM-driven distillation of raw
7
+ * memories into "high-level questions + derived insights" is the move
8
+ * that makes memory compound.
9
+ *
10
+ * Design choice: this tool does NOT call an LLM directly. Core is meant
11
+ * to stay deterministic + dependency-free of any model API. Instead, we
12
+ * package the necessary inputs + prompt template into a structured
13
+ * payload that the calling MCP tool returns to the LLM in the loop, and
14
+ * the LLM does the synthesis on its own turn. The result can then be
15
+ * fed back via `skill_write` or `awareness_update`.
16
+ *
17
+ * Why: this matches AgentRecall's "agent-as-author" stance — the agent
18
+ * already in the conversation writes its own reflection, we just give it
19
+ * the inputs.
20
+ */
21
+ import { resolveProject } from "../storage/project.js";
22
+ import { readCorrections } from "../storage/corrections.js";
23
+ import { listJournalFiles } from "../helpers/journal-files.js";
24
+ import { listMilestones } from "../palace/pipeline.js";
25
+ import * as fs from "node:fs";
26
+ import * as path from "node:path";
27
+ const EXCERPT_CHARS = 800;
28
+ export async function sessionEndReflect(input) {
29
+ const slug = await resolveProject(input.project);
30
+ const lookback = input.lookback_days && input.lookback_days > 0 ? input.lookback_days : 7;
31
+ const cutoff = new Date(Date.now() - lookback * 86400000);
32
+ // Collect recent journal excerpts
33
+ const journals = listJournalFiles(slug);
34
+ const recentJournals = [];
35
+ for (const j of journals) {
36
+ const d = new Date(j.date);
37
+ if (Number.isNaN(d.getTime()) || d < cutoff)
38
+ continue;
39
+ let excerpt = "";
40
+ try {
41
+ const content = fs.readFileSync(path.join(j.dir, j.file), "utf-8");
42
+ excerpt = content.slice(0, EXCERPT_CHARS);
43
+ }
44
+ catch {
45
+ // skip unreadable
46
+ }
47
+ recentJournals.push({ date: j.date, file: j.file, excerpt });
48
+ if (recentJournals.length >= 7)
49
+ break;
50
+ }
51
+ // Active corrections + precision
52
+ const corrections = readCorrections(slug)
53
+ .filter((r) => r.active !== false)
54
+ .slice(0, 20)
55
+ .map((r) => ({
56
+ id: r.id,
57
+ rule: r.rule,
58
+ severity: r.severity,
59
+ precision: r.precision ?? null,
60
+ }));
61
+ // Last 3 closed phases
62
+ const allPhases = listMilestones(slug);
63
+ const recentPhases = allPhases
64
+ .filter((p) => p.meta.status === "closed")
65
+ .slice(-3)
66
+ .map((p) => ({
67
+ order: p.meta.order,
68
+ phase: p.meta.phase,
69
+ synthesis: p.sections.synthesis,
70
+ }));
71
+ const bundle = {
72
+ recent_journals: recentJournals,
73
+ active_corrections: corrections,
74
+ recent_phases: recentPhases,
75
+ };
76
+ const prompt = buildPrompt(slug, bundle, lookback);
77
+ const nextActions = [
78
+ "After reading the bundle, call skill_write for any IF-THEN production rule worth saving (procedural memory).",
79
+ "Call session_end again with insights[] containing distilled cross-session patterns.",
80
+ "If a correction's precision < 0.3 across ≥3 retrievals, suggest archiving it (set active:false).",
81
+ ];
82
+ return { success: true, project: slug, bundle, prompt, next_actions: nextActions };
83
+ }
84
+ function buildPrompt(slug, bundle, lookback) {
85
+ const lines = [];
86
+ lines.push(`# Reflect on ${slug} — last ${lookback} days`);
87
+ lines.push("");
88
+ lines.push("You are the agent reviewing your own recent work. Look at the inputs below and produce:");
89
+ lines.push("");
90
+ lines.push("1. **Three high-level questions** this period raised (Park 2023 style).");
91
+ lines.push("2. **Procedural skills** that crystallized — anything repeated ≥2x is a candidate (call skill_write).");
92
+ lines.push("3. **Cross-session patterns** that aren't yet in awareness — distilled insights worth promoting.");
93
+ lines.push("4. **Noise to archive** — corrections with low precision that should be retired.");
94
+ lines.push("");
95
+ lines.push("Be terse. One bullet per finding. Cite journal dates / phase orders / correction ids as evidence.");
96
+ lines.push("");
97
+ lines.push("---");
98
+ lines.push("");
99
+ lines.push(`## Journals (${bundle.recent_journals.length})`);
100
+ for (const j of bundle.recent_journals) {
101
+ lines.push(`### ${j.date} — ${j.file}`);
102
+ lines.push(j.excerpt);
103
+ lines.push("");
104
+ }
105
+ lines.push(`## Active corrections (${bundle.active_corrections.length})`);
106
+ for (const c of bundle.active_corrections) {
107
+ const p = c.precision !== null ? ` p=${c.precision}` : "";
108
+ lines.push(`- [${c.id}] (${c.severity}${p}) ${c.rule}`);
109
+ }
110
+ lines.push("");
111
+ lines.push(`## Recent closed phases (${bundle.recent_phases.length})`);
112
+ for (const ph of bundle.recent_phases) {
113
+ lines.push(`- Phase ${ph.order} — ${ph.phase}: ${ph.synthesis}`);
114
+ }
115
+ return lines.join("\n");
116
+ }
117
+ //# sourceMappingURL=session-end-reflect.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session-end-reflect.js","sourceRoot":"","sources":["../../src/tools-logic/session-end-reflect.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AA2BlC,MAAM,aAAa,GAAG,GAAG,CAAC;AAE1B,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,KAAmB;IACzD,MAAM,IAAI,GAAG,MAAM,cAAc,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IACjD,MAAM,QAAQ,GAAG,KAAK,CAAC,aAAa,IAAI,KAAK,CAAC,aAAa,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;IAC1F,MAAM,MAAM,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,QAAQ,GAAG,QAAQ,CAAC,CAAC;IAE1D,kCAAkC;IAClC,MAAM,QAAQ,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC;IACxC,MAAM,cAAc,GAA0C,EAAE,CAAC;IACjE,KAAK,MAAM,CAAC,IAAI,QAAQ,EAAE,CAAC;QACzB,MAAM,CAAC,GAAG,IAAI,IAAI,CA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