@karmaniverous/jeeves-meta 0.17.0 → 0.18.0-0

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 (93) hide show
  1. package/README.md +1 -2
  2. package/dist/cli/jeeves-meta/index.js +1235 -1198
  3. package/dist/prompts/architect.md +31 -59
  4. package/dist/prompts/critic.md +18 -33
  5. package/package.json +14 -22
  6. package/dist/archive/index.d.ts +0 -10
  7. package/dist/archive/listArchive.d.ts +0 -12
  8. package/dist/archive/prune.d.ts +0 -14
  9. package/dist/archive/readArchive.d.ts +0 -30
  10. package/dist/archive/readLatest.d.ts +0 -13
  11. package/dist/archive/snapshot.d.ts +0 -17
  12. package/dist/bootstrap.d.ts +0 -26
  13. package/dist/cache.d.ts +0 -22
  14. package/dist/cli/jeeves-meta/architect.md +0 -173
  15. package/dist/cli/jeeves-meta/critic.md +0 -104
  16. package/dist/cli.d.ts +0 -10
  17. package/dist/configHotReload.d.ts +0 -30
  18. package/dist/configLoader.d.ts +0 -36
  19. package/dist/constants.d.ts +0 -13
  20. package/dist/customCliCommands.d.ts +0 -13
  21. package/dist/descriptor.d.ts +0 -19
  22. package/dist/discovery/buildMinimalNode.d.ts +0 -22
  23. package/dist/discovery/computeSummary.d.ts +0 -17
  24. package/dist/discovery/discoverMetas.d.ts +0 -19
  25. package/dist/discovery/getAncestorMeta.d.ts +0 -16
  26. package/dist/discovery/index.d.ts +0 -12
  27. package/dist/discovery/listMetas.d.ts +0 -63
  28. package/dist/discovery/ownershipTree.d.ts +0 -25
  29. package/dist/discovery/scope.d.ts +0 -47
  30. package/dist/discovery/types.d.ts +0 -25
  31. package/dist/ema.d.ts +0 -14
  32. package/dist/errors.d.ts +0 -15
  33. package/dist/escapeGlob.d.ts +0 -23
  34. package/dist/executor/GatewayExecutor.d.ts +0 -79
  35. package/dist/executor/SpawnAbortedError.d.ts +0 -9
  36. package/dist/executor/SpawnTimeoutError.d.ts +0 -13
  37. package/dist/executor/index.d.ts +0 -8
  38. package/dist/index.d.ts +0 -35
  39. package/dist/index.js +0 -5797
  40. package/dist/interfaces/MetaContext.d.ts +0 -38
  41. package/dist/interfaces/MetaExecutor.d.ts +0 -44
  42. package/dist/interfaces/WatcherClient.d.ts +0 -75
  43. package/dist/interfaces/index.d.ts +0 -8
  44. package/dist/lock.d.ts +0 -70
  45. package/dist/logger/index.d.ts +0 -27
  46. package/dist/mtimeFilter.d.ts +0 -26
  47. package/dist/normalizePath.d.ts +0 -6
  48. package/dist/orchestrator/buildTask.d.ts +0 -38
  49. package/dist/orchestrator/contextPackage.d.ts +0 -30
  50. package/dist/orchestrator/index.d.ts +0 -10
  51. package/dist/orchestrator/orchestratePhase.d.ts +0 -44
  52. package/dist/orchestrator/parseOutput.d.ts +0 -42
  53. package/dist/orchestrator/runPhase.d.ts +0 -40
  54. package/dist/phaseState/derivePhaseState.d.ts +0 -39
  55. package/dist/phaseState/index.d.ts +0 -9
  56. package/dist/phaseState/invalidate.d.ts +0 -39
  57. package/dist/phaseState/phaseScheduler.d.ts +0 -76
  58. package/dist/phaseState/phaseTransitions.d.ts +0 -83
  59. package/dist/progress/index.d.ts +0 -73
  60. package/dist/prompts/index.d.ts +0 -12
  61. package/dist/queue/index.d.ts +0 -90
  62. package/dist/readMetaJson.d.ts +0 -17
  63. package/dist/routes/__testUtils.d.ts +0 -37
  64. package/dist/routes/config.d.ts +0 -11
  65. package/dist/routes/configApply.d.ts +0 -13
  66. package/dist/routes/index.d.ts +0 -50
  67. package/dist/routes/metas.d.ts +0 -9
  68. package/dist/routes/metasUpdate.d.ts +0 -11
  69. package/dist/routes/preview.d.ts +0 -8
  70. package/dist/routes/queue.d.ts +0 -13
  71. package/dist/routes/seed.d.ts +0 -8
  72. package/dist/routes/status.d.ts +0 -13
  73. package/dist/routes/synthesize.d.ts +0 -12
  74. package/dist/routes/unlock.d.ts +0 -8
  75. package/dist/rules/healthCheck.d.ts +0 -36
  76. package/dist/rules/index.d.ts +0 -37
  77. package/dist/rules/verify.d.ts +0 -22
  78. package/dist/scheduler/index.d.ts +0 -71
  79. package/dist/scheduling/index.d.ts +0 -7
  80. package/dist/scheduling/staleness.d.ts +0 -68
  81. package/dist/scheduling/weightedFormula.d.ts +0 -38
  82. package/dist/schema/config.d.ts +0 -67
  83. package/dist/schema/error.d.ts +0 -6
  84. package/dist/schema/index.d.ts +0 -8
  85. package/dist/schema/meta.d.ts +0 -72
  86. package/dist/seed/autoSeed.d.ts +0 -30
  87. package/dist/seed/createMeta.d.ts +0 -38
  88. package/dist/seed/index.d.ts +0 -7
  89. package/dist/server.d.ts +0 -24
  90. package/dist/shutdown/index.d.ts +0 -33
  91. package/dist/structureHash.d.ts +0 -15
  92. package/dist/watcher-client/HttpWatcherClient.d.ts +0 -38
  93. package/dist/watcher-client/index.d.ts +0 -6
@@ -1,14 +1,10 @@
1
1
  # Architect Prompt
2
2
 
3
- You are the Architect in a knowledge synthesis pipeline. Your job is to craft a
4
- task brief for a Builder agent that will synthesize knowledge from source data.
3
+ You are the Architect in a knowledge synthesis pipeline. Your job is to craft a task brief for a Builder agent that will synthesize knowledge from source data.
5
4
 
6
5
  ## Context
7
6
 
8
- You are analyzing a directory where a .meta/ directory defines a synthesis target.
9
- The Builder will receive your task brief and execute it with full tool access: it
10
- can read files from the filesystem and search the semantic index (watcher_search)
11
- for cross-domain context.
7
+ You are analyzing a directory where a .meta/ directory defines a synthesis target. The Builder will receive your task brief and execute it with full tool access: it can read files from the filesystem and search the semantic index (watcher_search) for cross-domain context.
12
8
 
13
9
  ## Inputs You Will Receive
14
10
 
@@ -18,33 +14,27 @@ for cross-domain context.
18
14
  4. Previous synthesis output (_content) — what the Builder produced last time.
19
15
  5. Previous feedback (_feedback) — the Critic's evaluation. Address every concern.
20
16
  6. Child meta outputs — subdirectory synthesis outputs (consume these, not raw files).
21
- 7. Cross-ref meta outputs — synthesis outputs from explicitly referenced metas
22
- (_crossRefs). These are metas from other parts of the hierarchy that the
23
- human declared relevant. Treat them like child metas: consume the synthesis,
24
- don't re-analyze their raw sources.
17
+ 7. Cross-ref meta outputs — synthesis outputs from explicitly referenced metas (_crossRefs). These are metas from other parts of the hierarchy that the human declared relevant. Treat them like child metas: consume the synthesis, don't re-analyze their raw sources.
25
18
  8. Archive snapshots — timestamped previous syntheses from .meta/archive/.
26
19
 
27
20
  ## Your Output: A Task Brief
28
21
 
29
- Respond with ONLY the task brief as plain Markdown. No JSON wrapping, no code
30
- fences around the entire output, no preamble. Just the numbered sections below.
22
+ Respond with ONLY the task brief as plain Markdown. No JSON wrapping, no code fences around the entire output, no preamble. Just the numbered sections below.
31
23
 
32
24
  The task brief must include these sections:
33
25
 
34
26
  ### 1. Data Shape
35
27
 
36
- Describe the source data briefly. File types, schemas, structures, domain.
37
- On subsequent cycles (when previous output exists), focus on what changed.
28
+ Describe the source data briefly. File types, schemas, structures, domain. On subsequent cycles (when previous output exists), focus on what changed.
38
29
 
39
30
  ### 2. Mandatory Reads
40
31
 
41
- List specific files the Builder must read before making claims. Include entity
42
- files, key source files, config/schema files, and test files where relevant.
32
+ List specific files the Builder must read before making claims. Include entity files, key source files, config/schema files, and test files where relevant.
43
33
 
44
34
  ### 3. Analytical Framework
45
35
 
46
- Define dimensions of analysis appropriate to this data shape and steering prompt.
47
- Always include:
36
+ Define dimensions of analysis appropriate to this data shape and steering prompt. Always include:
37
+
48
38
  - Entity/issue status with verification (classify against source, not just metadata)
49
39
  - Cross-entity relationship analysis (connections, dependencies, supersession)
50
40
  - Health/quality assessment with evidence
@@ -53,8 +43,8 @@ Always include:
53
43
 
54
44
  ### 4. Cross-Reference Integration
55
45
 
56
- If cross-ref meta outputs are provided, describe how the Builder should
57
- integrate them:
46
+ If cross-ref meta outputs are provided, describe how the Builder should integrate them:
47
+
58
48
  - What themes or entities from each referenced meta are relevant here?
59
49
  - How should cross-ref context supplement (not duplicate) local data analysis?
60
50
  - What cross-domain connections should the Builder look for?
@@ -63,88 +53,73 @@ If no cross-refs are present, omit this section entirely.
63
53
 
64
54
  ### 5. Search Strategies (Not Specific Queries)
65
55
 
66
- Define PATTERNS for how the Builder should use watcher_search. Do NOT hardcode
67
- specific search terms — the Builder will instantiate these patterns against
68
- whatever it actually finds in the data.
56
+ Define PATTERNS for how the Builder should use watcher_search. Do NOT hardcode specific search terms — the Builder will instantiate these patterns against whatever it actually finds in the data.
69
57
 
70
58
  Examples of good search strategies:
71
- - "For each human sender with 3+ messages, search for their name + any
72
- company/project mentioned in the subject line."
73
- - "For each open issue, search for the issue title keywords to find related
74
- Slack discussions or meeting notes."
75
- - "For each financial notification, search for the institution name to find
76
- related planning discussions."
59
+
60
+ - "For each human sender with 3+ messages, search for their name + any company/project mentioned in the subject line."
61
+ - "For each open issue, search for the issue title keywords to find related Slack discussions or meeting notes."
62
+ - "For each financial notification, search for the institution name to find related planning discussions."
77
63
 
78
64
  Examples of BAD search strategies:
65
+
79
66
  - "Search for 'Pat Brady MoneyMatch'" (too specific, stale next cycle)
80
67
  - "Search for 'jeeves-runner CI pipeline broken'" (hardcoded to current state)
81
68
 
82
- The goal: teach the Builder HOW to search, not WHAT to search for. The brief
83
- should stay valid even when the underlying data changes between architect cycles.
69
+ The goal: teach the Builder HOW to search, not WHAT to search for. The brief should stay valid even when the underlying data changes between architect cycles.
84
70
 
85
71
  ### 6. Verification Requirements
86
72
 
87
73
  Define what "verify before asserting" means for this data shape:
74
+
88
75
  - For code repos: verify issue status against source files, cite exact lines
89
76
  - For email: verify thread status against message metadata (dates, labels)
90
- - For meetings: verify action items against follow-up evidence
91
- Always require: exact entity titles/names (not paraphrases), evidence citations,
92
- partial implementation notes, config default verification from schema files.
77
+ - For meetings: verify action items against follow-up evidence Always require: exact entity titles/names (not paraphrases), evidence citations, partial implementation notes, config default verification from schema files.
93
78
 
94
79
  {{#if (gt scope.fileCount 500)}}
95
80
  ## LARGE SCOPE — SAMPLING MODE
96
81
 
97
- This entity has {{scope.fileCount}} files. Do NOT attempt to read or
98
- explore the full scope. Instead:
82
+ This entity has {{scope.fileCount}} files. Do NOT attempt to read or explore the full scope. Instead:
99
83
 
100
- 1. Read _state and _content from previous cycles to understand existing
101
- data shape knowledge
102
- 2. Sample at most 5–10 representative files to verify the data shape
103
- hasn't fundamentally changed
84
+ 1. Read _state and _content from previous cycles to understand existing data shape knowledge
85
+ 2. Sample at most 5–10 representative files to verify the data shape hasn't fundamentally changed
104
86
  3. Focus your brief updates on what the _feedback says needs improving
105
- 4. Preserve the existing progressive processing strategy unless the
106
- data shape has materially changed
87
+ 4. Preserve the existing progressive processing strategy unless the data shape has materially changed
107
88
 
108
89
  Your job on re-runs is refinement, not rediscovery.
109
90
  {{/if}}
110
91
 
111
92
  ### 7. Progressive Processing (_state)
112
93
 
113
- When the scope is large (hundreds of files or more), instruct the Builder to
114
- use progressive processing via `_state`. The Builder can set an opaque `_state`
115
- value in its output JSON. This state is persisted and passed back as context
116
- on the next cycle.
94
+ When the scope is large (hundreds of files or more), instruct the Builder to use progressive processing via `_state`. The Builder can set an opaque `_state` value in its output JSON. This state is persisted and passed back as context on the next cycle.
117
95
 
118
96
  Design a chunking strategy appropriate to the data shape:
97
+
119
98
  - For email archives: process by date range (e.g. most recent month first)
120
99
  - For Slack channels: process by message date range
121
100
  - For large codebases: process by directory subtree
122
101
  - For meetings: process N meetings per cycle
123
102
 
124
103
  The Builder should:
104
+
125
105
  1. Read `_state` to determine what was already processed
126
106
  2. Process the next chunk
127
107
  3. Update `_state` with a cursor/bookmark for the next cycle
128
108
  4. Merge new findings with previous `_content` (carried in context)
129
109
 
130
110
  If the scope is small enough to process in one pass, omit chunking instructions.
111
+
131
112
  ### 8. Output Structure
132
113
 
133
- Define non-underscore fields for structured data and the _content narrative
134
- structure. _content must not exceed \{{config.maxLines}} lines.
135
- IMPORTANT: The Builder returns its output as data. It does NOT write files.
136
- Do not instruct the Builder to write to any file path. The orchestrator
137
- handles all file I/O.
114
+ Define non-underscore fields for structured data and the _content narrative structure. _content must not exceed \{{config.maxLines}} lines. IMPORTANT: The Builder returns its output as data. It does NOT write files. Do not instruct the Builder to write to any file path. The orchestrator handles all file I/O.
138
115
 
139
116
  ### 9. Previous Feedback Integration
140
117
 
141
- If _feedback is provided, turn every critique into an explicit directive.
142
- Quote the specific issue and state what to do differently.
118
+ If _feedback is provided, turn every critique into an explicit directive. Quote the specific issue and state what to do differently.
143
119
 
144
120
  ## Template Variables
145
121
 
146
- Your task brief will be compiled as a Handlebars template before the Builder
147
- receives it. You can use these variables to write adaptive instructions:
122
+ Your task brief will be compiled as a Handlebars template before the Builder receives it. You can use these variables to write adaptive instructions:
148
123
 
149
124
  - `\{{config.maxLines}}` — Maximum _content lines
150
125
  - `\{{config.architectEvery}}` — Cycles between architect refreshes
@@ -166,8 +141,5 @@ Example: "Process files in chunks of 50. Limit output to \{{config.maxLines}} li
166
141
  - Search strategies must be patterns, not hardcoded queries.
167
142
  - Keep the brief focused. The Builder is an intelligent agent.
168
143
  - _content must be Markdown suitable for human reading and semantic embedding.
169
- - When diagrams would aid understanding (architecture, relationships, workflows),
170
- instruct the Builder to use PlantUML syntax in fenced code blocks
171
- (` ```plantuml `). PlantUML is rendered natively by the serving infrastructure.
172
- NEVER use ASCII art.
144
+ - When diagrams would aid understanding (architecture, relationships, workflows), instruct the Builder to use PlantUML syntax in fenced code blocks (` ```plantuml `). PlantUML is rendered natively by the serving infrastructure. NEVER use ASCII art.
173
145
  - Do NOT instruct the Builder to write to any file. It returns data; the engine writes.
@@ -1,14 +1,10 @@
1
1
  # Critic Prompt
2
2
 
3
- You are the Critic in a knowledge synthesis pipeline. Your job is to evaluate
4
- a synthesis produced by the Builder and provide actionable feedback that will
5
- improve future cycles.
3
+ You are the Critic in a knowledge synthesis pipeline. Your job is to evaluate a synthesis produced by the Builder and provide actionable feedback that will improve future cycles.
6
4
 
7
5
  ## Context
8
6
 
9
- A Builder agent has just produced a synthesis (_content + structured fields) for
10
- a .meta/ directory. You have full tool access: you can read the same source files
11
- the Builder read, search the semantic index (watcher_search), and verify claims.
7
+ A Builder agent has just produced a synthesis (_content + structured fields) for a .meta/ directory. You have full tool access: you can read the same source files the Builder read, search the semantic index (watcher_search), and verify claims.
12
8
 
13
9
  ## Inputs You Will Receive
14
10
 
@@ -24,60 +20,50 @@ Evaluate the synthesis on these dimensions:
24
20
 
25
21
  ### 1. Steering Alignment
26
22
 
27
- Does the output address what the steering prompt asked for? What is missing
28
- or underweight?
23
+ Does the output address what the steering prompt asked for? What is missing or underweight?
29
24
 
30
25
  ### 2. Factual Accuracy
31
26
 
32
27
  Spot-check specific claims by reading source files yourself:
33
- - For code repos: verify line number citations, issue classifications,
34
- config default values, test file counts.
35
- - For email: verify thread status claims, sender names, financial amounts,
36
- date assertions.
37
- - For any domain: verify that "missing" claims are genuinely missing by
38
- reading the relevant files.
39
28
 
40
- IMPORTANT: Your own claims must also be verified. Do not introduce errors
41
- into the feedback loop. If you are unsure about a fact, say so explicitly
42
- rather than asserting incorrectly.
29
+ - For code repos: verify line number citations, issue classifications, config default values, test file counts.
30
+ - For email: verify thread status claims, sender names, financial amounts, date assertions.
31
+ - For any domain: verify that "missing" claims are genuinely missing by reading the relevant files.
32
+
33
+ IMPORTANT: Your own claims must also be verified. Do not introduce errors into the feedback loop. If you are unsure about a fact, say so explicitly rather than asserting incorrectly.
43
34
 
44
35
  ### 3. Analytical Depth
45
36
 
46
- Is the analysis shallow or insightful? Does it surface non-obvious connections?
47
- Does the cross-domain search add genuine value or just restate local content?
37
+ Is the analysis shallow or insightful? Does it surface non-obvious connections? Does the cross-domain search add genuine value or just restate local content?
48
38
 
49
39
  ### 4. Cross-Reference Utilization
50
40
 
51
41
  If cross-ref metas were provided as context:
42
+
52
43
  - Were they meaningfully integrated, or just mentioned superficially?
53
44
  - Did the synthesis surface genuine cross-domain connections?
54
- - Were claims drawn from cross-ref context verified against the referenced
55
- meta's actual content?
56
- - Did the synthesis avoid re-analyzing raw sources that belong to the
57
- referenced meta's scope?
45
+ - Were claims drawn from cross-ref context verified against the referenced meta's actual content?
46
+ - Did the synthesis avoid re-analyzing raw sources that belong to the referenced meta's scope?
58
47
 
59
48
  If no cross-refs were provided, skip this section.
60
49
 
61
50
  ### 5. Output Quality
62
51
 
63
- Is _content well-structured and concise? Within maxLines? Would a human
64
- reading this learn something they did not already know?
52
+ Is _content well-structured and concise? Within maxLines? Would a human reading this learn something they did not already know?
65
53
 
66
54
  ### 6. What Is Missing
67
55
 
68
- What important aspects are not covered? What questions does the synthesis
69
- leave unanswered?
56
+ What important aspects are not covered? What questions does the synthesis leave unanswered?
70
57
 
71
58
  ### 7. Previous Feedback Resolution
72
59
 
73
- If you provided feedback last cycle, check whether each issue was addressed.
74
- Note: resolved / partially resolved / still present for each.
60
+ If you provided feedback last cycle, check whether each issue was addressed. Note: resolved / partially resolved / still present for each.
75
61
 
76
62
  ## Your Output
77
63
 
78
64
  Produce a structured critique stored as _feedback. Use exactly this structure:
79
65
 
80
- ~~~~
66
+ ```
81
67
  ## Overall Assessment
82
68
  [1-2 sentences]
83
69
 
@@ -92,13 +78,12 @@ Produce a structured critique stored as _feedback. Use exactly this structure:
92
78
 
93
79
  ## Recommendations for Next Cycle
94
80
  - [actionable improvements for both architect and builder]
95
- ~~~~
81
+ ```
96
82
 
97
83
  ## Constraints
98
84
 
99
85
  - Be specific. Cite file paths and evidence when you find discrepancies.
100
86
  - Your feedback will be read by both the Architect and Builder. Make it useful.
101
87
  - Do NOT introduce factual errors. If you cannot verify a claim, say so.
102
- - Focus on issues that would change the reader's understanding or actions.
103
- Skip cosmetic concerns.
88
+ - Focus on issues that would change the reader's understanding or actions. Skip cosmetic concerns.
104
89
  - Return your critique as structured text. Do NOT write to any file.
package/package.json CHANGED
@@ -7,41 +7,35 @@
7
7
  "url": "https://github.com/karmaniverous/jeeves-meta/issues"
8
8
  },
9
9
  "dependencies": {
10
- "@karmaniverous/jeeves": "^0.5.12",
10
+ "@karmaniverous/jeeves": "0.6.0-7",
11
11
  "@karmaniverous/jeeves-meta-core": "^0.2.2",
12
- "commander": "^14",
12
+ "commander": "^15",
13
13
  "croner": "^10",
14
- "fastify": "^5.8",
14
+ "fastify": "^5.12",
15
15
  "handlebars": "^4.7.9",
16
16
  "package-directory": "^8.2.0",
17
17
  "pino": "^10",
18
- "zod": "^4.4"
18
+ "zod": "^4.6"
19
19
  },
20
20
  "description": "Fastify HTTP service for the Jeeves Meta synthesis engine",
21
21
  "devDependencies": {
22
- "@dotenvx/dotenvx": "^1.69.1",
23
- "@rollup/plugin-commonjs": "^29.0.2",
22
+ "@dotenvx/dotenvx": "^2.30.0",
23
+ "@rollup/plugin-commonjs": "^29.0.3",
24
24
  "@rollup/plugin-json": "^6.1.0",
25
25
  "@rollup/plugin-node-resolve": "^16.0.3",
26
26
  "@rollup/plugin-typescript": "^12.3.0",
27
- "@types/node": "^25.9.1",
28
- "@vitest/coverage-v8": "^4.1.7",
27
+ "@types/node": "^26.6.3",
28
+ "@vitest/coverage-v8": "^5.0.2",
29
29
  "cross-env": "^10.1.0",
30
- "release-it": "^20.0.1",
31
- "rollup": "^4.60.4",
30
+ "release-it": "^21.1.0",
31
+ "rollup": "^4.63.5",
32
32
  "rollup-plugin-copy": "^3.5.0",
33
33
  "tslib": "^2.8.1",
34
- "vitest": "^4.1.7"
34
+ "vitest": "^5.0.2"
35
35
  },
36
36
  "engines": {
37
37
  "node": ">=22"
38
38
  },
39
- "exports": {
40
- ".": {
41
- "types": "./dist/index.d.ts",
42
- "default": "./dist/index.js"
43
- }
44
- },
45
39
  "files": [
46
40
  "dist"
47
41
  ],
@@ -56,7 +50,6 @@
56
50
  "typescript"
57
51
  ],
58
52
  "license": "BSD-3-Clause",
59
- "module": "dist/index.js",
60
53
  "name": "@karmaniverous/jeeves-meta",
61
54
  "publishConfig": {
62
55
  "access": "public"
@@ -98,17 +91,16 @@
98
91
  "url": "git+https://github.com/karmaniverous/jeeves-meta.git"
99
92
  },
100
93
  "scripts": {
101
- "build": "rimraf dist && cross-env NO_COLOR=1 rollup --config rollup.config.ts --configPlugin \"@rollup/plugin-typescript={outputToFilesystem:true}\"",
94
+ "build": "rimraf dist && cross-env NO_COLOR=1 rollup --config rollup.config.ts --configPlugin \"@rollup/plugin-typescript={outputToFilesystem:true,paths:{}}\"",
102
95
  "changelog": "git-cliff -o CHANGELOG.md",
103
96
  "knip": "knip",
104
97
  "lint": "eslint .",
105
98
  "lint:fix": "eslint --fix .",
106
99
  "release": "dotenvx run -f .env.local -- release-it",
107
- "release:pre": "dotenvx run -f .env.local -- release-it --no-git.requireBranch --github.prerelease --preRelease",
100
+ "release:pre": "dotenvx run -f .env.local -- release-it --no-git.requireBranch --github.preRelease --preRelease",
108
101
  "test": "vitest run",
109
102
  "typecheck": "tsc"
110
103
  },
111
104
  "type": "module",
112
- "types": "dist/index.d.ts",
113
- "version": "0.17.0"
105
+ "version": "0.18.0-0"
114
106
  }
@@ -1,10 +0,0 @@
1
- /**
2
- * Archive module — snapshot creation, pruning, and reading.
3
- *
4
- * @module archive
5
- */
6
- export { listArchiveFiles } from './listArchive.js';
7
- export { pruneArchive } from './prune.js';
8
- export { readArchiveFromDisk, readArchiveFromWatcher } from './readArchive.js';
9
- export { readLatestArchive } from './readLatest.js';
10
- export { createSnapshot } from './snapshot.js';
@@ -1,12 +0,0 @@
1
- /**
2
- * List archive snapshot files in chronological order.
3
- *
4
- * @module archive/listArchive
5
- */
6
- /**
7
- * List archive .json files sorted chronologically (oldest first).
8
- *
9
- * @param metaPath - Absolute path to the .meta directory.
10
- * @returns Array of absolute paths to archive files, or empty if none.
11
- */
12
- export declare function listArchiveFiles(metaPath: string): string[];
@@ -1,14 +0,0 @@
1
- /**
2
- * Prune old archive snapshots beyond maxArchive.
3
- *
4
- * @module archive/prune
5
- */
6
- /**
7
- * Prune archive directory to keep at most maxArchive snapshots.
8
- * Removes the oldest files.
9
- *
10
- * @param metaPath - Absolute path to the .meta directory.
11
- * @param maxArchive - Maximum snapshots to retain.
12
- * @returns Number of files pruned.
13
- */
14
- export declare function pruneArchive(metaPath: string, maxArchive: number): Promise<number>;
@@ -1,30 +0,0 @@
1
- /**
2
- * Archive reading helpers — watcher scan with filesystem fallback.
3
- *
4
- * Used by the GET /metas/:path route to retrieve archive history.
5
- * Prefers watcher scan for performance; falls back to disk reads
6
- * when the watcher is unavailable.
7
- *
8
- * @module archive/readArchive
9
- */
10
- import type { WatcherClient } from '../interfaces/index.js';
11
- /**
12
- * Read archive history via watcher scan.
13
- *
14
- * @param watcher - WatcherClient with scan support.
15
- * @param metaPath - Absolute path to the .meta/ directory.
16
- * @param metaArchiveProperty - Additional filter properties for archive points.
17
- * @param limit - Max entries to return (newest first). Undefined = all.
18
- * @param projectMeta - Field projection function.
19
- * @returns Array of projected archive entries, newest first.
20
- */
21
- export declare function readArchiveFromWatcher(watcher: WatcherClient, metaPath: string, metaArchiveProperty: Record<string, unknown>, limit: number | undefined, projectMeta: (m: Record<string, unknown>) => Record<string, unknown>): Promise<Array<Record<string, unknown>>>;
22
- /**
23
- * Read archive history from disk (fallback).
24
- *
25
- * @param metaPath - Absolute path to the .meta/ directory.
26
- * @param limit - Max entries to return (newest first). Undefined = all.
27
- * @param projectMeta - Field projection function.
28
- * @returns Array of projected archive entries, newest first.
29
- */
30
- export declare function readArchiveFromDisk(metaPath: string, limit: number | undefined, projectMeta: (m: Record<string, unknown>) => Record<string, unknown>): Promise<Array<Record<string, unknown>>>;
@@ -1,13 +0,0 @@
1
- /**
2
- * Read the latest archive snapshot for steer change detection.
3
- *
4
- * @module archive/readLatest
5
- */
6
- import type { MetaJson } from '../schema/index.js';
7
- /**
8
- * Read the most recent archive snapshot.
9
- *
10
- * @param metaPath - Absolute path to the .meta directory.
11
- * @returns The latest archived meta, or null if no archives exist.
12
- */
13
- export declare function readLatestArchive(metaPath: string): Promise<MetaJson | null>;
@@ -1,17 +0,0 @@
1
- /**
2
- * Create archive snapshots of meta.json.
3
- *
4
- * Copies current meta.json to archive/\{ISO-timestamp\}.json with
5
- * _archived: true and _archivedAt added.
6
- *
7
- * @module archive/snapshot
8
- */
9
- import type { MetaJson } from '../schema/index.js';
10
- /**
11
- * Create an archive snapshot of the current meta.json.
12
- *
13
- * @param metaPath - Absolute path to the .meta directory.
14
- * @param meta - Current meta.json content.
15
- * @returns The archive file path.
16
- */
17
- export declare function createSnapshot(metaPath: string, meta: MetaJson): Promise<string>;
@@ -1,26 +0,0 @@
1
- /**
2
- * Service bootstrap — wire up all components and start listening.
3
- *
4
- * @module bootstrap
5
- */
6
- import { type ServiceConfig } from './schema/config.js';
7
- /**
8
- * Compute per-cycle token total from a completed meta.
9
- *
10
- * Exported for testing.
11
- *
12
- * Uses `_synthesisCount` as a discriminator: after increment by `runCritic`,
13
- * a value of 1 means architect ran this cycle (was 0 pre-increment),
14
- * so all three phase token fields are summed. A value \> 1 means architect
15
- * was skipped (cached brief reused), so only builder + critic are summed.
16
- */
17
- export declare function computeCycleTokens(meta: Record<string, unknown>): number;
18
- /**
19
- * Bootstrap the service: create logger, build server, start listening,
20
- * wire scheduler, queue processing, rule registration, config hot-reload,
21
- * startup lock cleanup, and shutdown.
22
- *
23
- * @param config - Validated service configuration.
24
- * @param configPath - Optional path to config file for hot-reload.
25
- */
26
- export declare function startService(config: ServiceConfig, configPath?: string): Promise<void>;
package/dist/cache.d.ts DELETED
@@ -1,22 +0,0 @@
1
- /**
2
- * In-memory cache for listMetas results with TTL and concurrent refresh guard.
3
- *
4
- * @module cache
5
- */
6
- import { type MetaListResult } from './discovery/index.js';
7
- import type { WatcherClient } from './interfaces/index.js';
8
- import type { ServiceConfig } from './schema/config.js';
9
- /**
10
- * Caches listMetas results to avoid expensive repeated filesystem walks.
11
- * Supports concurrent refresh coalescing and manual invalidation.
12
- */
13
- export declare class MetaCache {
14
- private result;
15
- private updatedAt;
16
- private refreshPromise;
17
- /** Get cached result or refresh if stale. */
18
- get(config: ServiceConfig, watcher: WatcherClient): Promise<MetaListResult>;
19
- /** Force-expire the cache so next get() triggers a refresh. */
20
- invalidate(): void;
21
- private refresh;
22
- }