@yattalo/task-system 0.3.6 → 0.5.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.
- package/README.md +48 -0
- package/dashboard-app/assets/spa-entry-CnIKatv4.js +24 -0
- package/dashboard-app/assets/styles-CAIFwsCh.css +1 -0
- package/dashboard-app/index.html +14 -0
- package/dist/commands/agent.d.ts +2 -0
- package/dist/commands/agent.d.ts.map +1 -0
- package/dist/commands/agent.js +97 -0
- package/dist/commands/agent.js.map +1 -0
- package/dist/commands/context.d.ts +2 -0
- package/dist/commands/context.d.ts.map +1 -0
- package/dist/commands/context.js +151 -0
- package/dist/commands/context.js.map +1 -0
- package/dist/commands/dashboard.d.ts +2 -0
- package/dist/commands/dashboard.d.ts.map +1 -1
- package/dist/commands/dashboard.js +133 -6
- package/dist/commands/dashboard.js.map +1 -1
- package/dist/commands/day.d.ts +9 -0
- package/dist/commands/day.d.ts.map +1 -0
- package/dist/commands/day.js +98 -0
- package/dist/commands/day.js.map +1 -0
- package/dist/commands/drift.d.ts +2 -0
- package/dist/commands/drift.d.ts.map +1 -0
- package/dist/commands/drift.js +190 -0
- package/dist/commands/drift.js.map +1 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +35 -1
- package/dist/commands/init.js.map +1 -1
- package/dist/generators/mgrep-setup.d.ts +6 -0
- package/dist/generators/mgrep-setup.d.ts.map +1 -0
- package/dist/generators/mgrep-setup.js +191 -0
- package/dist/generators/mgrep-setup.js.map +1 -0
- package/dist/generators/mgrep-skill.d.ts +6 -0
- package/dist/generators/mgrep-skill.d.ts.map +1 -0
- package/dist/generators/mgrep-skill.js +173 -0
- package/dist/generators/mgrep-skill.js.map +1 -0
- package/dist/generators/uca-functions.d.ts +8 -0
- package/dist/generators/uca-functions.d.ts.map +1 -0
- package/dist/generators/uca-functions.js +57 -0
- package/dist/generators/uca-functions.js.map +1 -0
- package/dist/generators/uca-reexports.d.ts +8 -0
- package/dist/generators/uca-reexports.d.ts.map +1 -0
- package/dist/generators/uca-reexports.js +112 -0
- package/dist/generators/uca-reexports.js.map +1 -0
- package/dist/generators/uca-schema.d.ts +8 -0
- package/dist/generators/uca-schema.d.ts.map +1 -0
- package/dist/generators/uca-schema.js +650 -0
- package/dist/generators/uca-schema.js.map +1 -0
- package/dist/index.js +19 -1
- package/dist/index.js.map +1 -1
- package/dist/presets/research.d.ts.map +1 -1
- package/dist/presets/research.js +10 -0
- package/dist/presets/research.js.map +1 -1
- package/dist/presets/software.d.ts.map +1 -1
- package/dist/presets/software.js +10 -0
- package/dist/presets/software.js.map +1 -1
- package/dist/utils/convex-run.d.ts +10 -0
- package/dist/utils/convex-run.d.ts.map +1 -0
- package/dist/utils/convex-run.js +34 -0
- package/dist/utils/convex-run.js.map +1 -0
- package/dist/utils/detect.d.ts.map +1 -1
- package/dist/utils/detect.js +15 -0
- package/dist/utils/detect.js.map +1 -1
- package/dist/utils/merge.d.ts.map +1 -1
- package/dist/utils/merge.js +2 -0
- package/dist/utils/merge.js.map +1 -1
- package/package.json +6 -4
- package/templates/uca/agents.ts +59 -0
- package/templates/uca/contextEntries.ts +125 -0
- package/templates/uca/cronManager.ts +255 -0
- package/templates/uca/cronUtils.ts +99 -0
- package/templates/uca/driftEvents.ts +106 -0
- package/templates/uca/heartbeats.ts +167 -0
- package/templates/uca/hooks.ts +430 -0
- package/templates/uca/memory.ts +326 -0
- package/templates/uca/sessionBridge.ts +238 -0
- package/templates/uca/skills.ts +284 -0
- package/templates/uca/ucaTasks.ts +500 -0
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
// ============================================================
|
|
2
|
+
// Generator: Layer 6b — Semantic Search Setup (mgrep config)
|
|
3
|
+
// Generates .mgreprc.yaml, .mgrepignore, and Claude hook
|
|
4
|
+
// ============================================================
|
|
5
|
+
import { writeFileSync, readFileSync, existsSync, mkdirSync, chmodSync } from "node:fs";
|
|
6
|
+
import { join } from "node:path";
|
|
7
|
+
export function generateMgrepSetup(ctx) {
|
|
8
|
+
const { config, targetDir, dryRun } = ctx;
|
|
9
|
+
const searchConfig = config.semanticSearch ?? {};
|
|
10
|
+
const results = [];
|
|
11
|
+
// 1. Generate .mgreprc.yaml
|
|
12
|
+
const rcContent = generateMgrepRc(searchConfig);
|
|
13
|
+
const rcPath = join(targetDir, ".mgreprc.yaml");
|
|
14
|
+
if (!dryRun) {
|
|
15
|
+
if (!existsSync(rcPath)) {
|
|
16
|
+
writeFileSync(rcPath, rcContent, "utf-8");
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
results.push({ file: ".mgreprc.yaml", lines: rcContent.split("\n").length });
|
|
20
|
+
// 2. Generate .mgrepignore
|
|
21
|
+
const ignoreContent = generateMgrepIgnore(searchConfig);
|
|
22
|
+
const ignorePath = join(targetDir, ".mgrepignore");
|
|
23
|
+
if (!dryRun) {
|
|
24
|
+
if (!existsSync(ignorePath)) {
|
|
25
|
+
writeFileSync(ignorePath, ignoreContent, "utf-8");
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
results.push({ file: ".mgrepignore", lines: ignoreContent.split("\n").length });
|
|
29
|
+
// 3. Generate mgrep watch hook for Claude Code sessions
|
|
30
|
+
if (searchConfig.autoWatch !== false) {
|
|
31
|
+
const hookContent = generateMgrepWatchHook();
|
|
32
|
+
const hooksDir = join(targetDir, ".claude", "hooks");
|
|
33
|
+
const hookPath = join(hooksDir, "mgrep-auto-watch.sh");
|
|
34
|
+
if (!dryRun) {
|
|
35
|
+
if (!existsSync(hooksDir)) {
|
|
36
|
+
mkdirSync(hooksDir, { recursive: true });
|
|
37
|
+
}
|
|
38
|
+
writeFileSync(hookPath, hookContent, "utf-8");
|
|
39
|
+
chmodSync(hookPath, 0o755);
|
|
40
|
+
}
|
|
41
|
+
results.push({ file: ".claude/hooks/mgrep-auto-watch.sh", lines: hookContent.split("\n").length });
|
|
42
|
+
// 4. Merge mgrep hook into .claude/settings.json
|
|
43
|
+
const settingsSnippet = generateMgrepSettingsSnippet();
|
|
44
|
+
const settingsPath = join(targetDir, ".claude", "settings.json");
|
|
45
|
+
if (!dryRun) {
|
|
46
|
+
mergeSettingsJson(settingsPath, settingsSnippet);
|
|
47
|
+
}
|
|
48
|
+
results.push({ file: ".claude/settings.json (mgrep hook)", lines: settingsSnippet.split("\n").length });
|
|
49
|
+
}
|
|
50
|
+
return results;
|
|
51
|
+
}
|
|
52
|
+
function generateMgrepRc(searchConfig) {
|
|
53
|
+
const L = [];
|
|
54
|
+
L.push(`# ============================================================`);
|
|
55
|
+
L.push(`# mgrep Configuration — Semantic Search`);
|
|
56
|
+
L.push(`# Generated by @yattalo/task-system`);
|
|
57
|
+
L.push(`# See: https://www.mgrep.dev/`);
|
|
58
|
+
L.push(`# ============================================================`);
|
|
59
|
+
L.push(``);
|
|
60
|
+
L.push(`# Maximum file size in bytes (default: 1MB)`);
|
|
61
|
+
L.push(`maxFileSize: ${searchConfig.maxFileSize ?? 1048576}`);
|
|
62
|
+
L.push(``);
|
|
63
|
+
L.push(`# Maximum files to sync per operation (default: 1000)`);
|
|
64
|
+
L.push(`maxFileCount: ${searchConfig.maxFileCount ?? 1000}`);
|
|
65
|
+
L.push(``);
|
|
66
|
+
return L.join("\n");
|
|
67
|
+
}
|
|
68
|
+
function generateMgrepIgnore(searchConfig) {
|
|
69
|
+
const L = [];
|
|
70
|
+
L.push(`# ============================================================`);
|
|
71
|
+
L.push(`# mgrep Ignore Patterns — Semantic Search`);
|
|
72
|
+
L.push(`# Generated by @yattalo/task-system`);
|
|
73
|
+
L.push(`# Syntax: same as .gitignore`);
|
|
74
|
+
L.push(`# ============================================================`);
|
|
75
|
+
L.push(``);
|
|
76
|
+
L.push(`# Build outputs`);
|
|
77
|
+
L.push(`dist/`);
|
|
78
|
+
L.push(`.next/`);
|
|
79
|
+
L.push(`.output/`);
|
|
80
|
+
L.push(`build/`);
|
|
81
|
+
L.push(``);
|
|
82
|
+
L.push(`# Dependencies`);
|
|
83
|
+
L.push(`node_modules/`);
|
|
84
|
+
L.push(``);
|
|
85
|
+
L.push(`# Generated files`);
|
|
86
|
+
L.push(`*.min.js`);
|
|
87
|
+
L.push(`*.min.css`);
|
|
88
|
+
L.push(`*.map`);
|
|
89
|
+
L.push(`*.tsbuildinfo`);
|
|
90
|
+
L.push(``);
|
|
91
|
+
L.push(`# Lock files`);
|
|
92
|
+
L.push(`package-lock.json`);
|
|
93
|
+
L.push(`pnpm-lock.yaml`);
|
|
94
|
+
L.push(`yarn.lock`);
|
|
95
|
+
L.push(`bun.lockb`);
|
|
96
|
+
L.push(``);
|
|
97
|
+
L.push(`# Convex generated`);
|
|
98
|
+
L.push(`convex/_generated/`);
|
|
99
|
+
L.push(``);
|
|
100
|
+
L.push(`# Task system artifacts`);
|
|
101
|
+
L.push(`.turbo/`);
|
|
102
|
+
L.push(``);
|
|
103
|
+
// Custom ignore patterns from config
|
|
104
|
+
const extraPatterns = searchConfig.ignorePatterns ?? [];
|
|
105
|
+
if (extraPatterns.length > 0) {
|
|
106
|
+
L.push(`# Project-specific patterns`);
|
|
107
|
+
for (const pattern of extraPatterns) {
|
|
108
|
+
L.push(pattern);
|
|
109
|
+
}
|
|
110
|
+
L.push(``);
|
|
111
|
+
}
|
|
112
|
+
return L.join("\n");
|
|
113
|
+
}
|
|
114
|
+
function generateMgrepWatchHook() {
|
|
115
|
+
const L = [];
|
|
116
|
+
L.push(`#!/bin/bash`);
|
|
117
|
+
L.push(`# ============================================================`);
|
|
118
|
+
L.push(`# mgrep Auto-Watch — starts background indexing for Claude sessions`);
|
|
119
|
+
L.push(`# Generated by @yattalo/task-system`);
|
|
120
|
+
L.push(`# ============================================================`);
|
|
121
|
+
L.push(``);
|
|
122
|
+
L.push(`# Check if mgrep is installed`);
|
|
123
|
+
L.push(`if ! command -v mgrep &>/dev/null; then`);
|
|
124
|
+
L.push(` exit 0`);
|
|
125
|
+
L.push(`fi`);
|
|
126
|
+
L.push(``);
|
|
127
|
+
L.push(`# Check if mgrep watch is already running`);
|
|
128
|
+
L.push(`if pgrep -f "mgrep watch" &>/dev/null; then`);
|
|
129
|
+
L.push(` exit 0`);
|
|
130
|
+
L.push(`fi`);
|
|
131
|
+
L.push(``);
|
|
132
|
+
L.push(`# Start mgrep watch in background`);
|
|
133
|
+
L.push(`nohup mgrep watch &>/dev/null &`);
|
|
134
|
+
L.push(``);
|
|
135
|
+
L.push(`exit 0`);
|
|
136
|
+
return L.join("\n");
|
|
137
|
+
}
|
|
138
|
+
function generateMgrepSettingsSnippet() {
|
|
139
|
+
const settings = {
|
|
140
|
+
hooks: {
|
|
141
|
+
SessionStart: [
|
|
142
|
+
{
|
|
143
|
+
hooks: [
|
|
144
|
+
{
|
|
145
|
+
type: "command",
|
|
146
|
+
command: "$CLAUDE_PROJECT_DIR/.claude/hooks/mgrep-auto-watch.sh",
|
|
147
|
+
statusMessage: "Starting semantic search indexing",
|
|
148
|
+
},
|
|
149
|
+
],
|
|
150
|
+
},
|
|
151
|
+
],
|
|
152
|
+
},
|
|
153
|
+
};
|
|
154
|
+
return JSON.stringify(settings, null, 2);
|
|
155
|
+
}
|
|
156
|
+
/** Merge new hooks into existing settings.json instead of overwriting */
|
|
157
|
+
function mergeSettingsJson(settingsPath, newContent) {
|
|
158
|
+
const newSettings = JSON.parse(newContent);
|
|
159
|
+
if (existsSync(settingsPath)) {
|
|
160
|
+
try {
|
|
161
|
+
const existing = JSON.parse(readFileSync(settingsPath, "utf-8"));
|
|
162
|
+
const existingHooks = (existing.hooks ?? {});
|
|
163
|
+
const newHooks = (newSettings.hooks ?? {});
|
|
164
|
+
// Merge each hook event, appending new entries
|
|
165
|
+
for (const [event, entries] of Object.entries(newHooks)) {
|
|
166
|
+
if (existingHooks[event]) {
|
|
167
|
+
// Check if mgrep hook already exists for this event
|
|
168
|
+
const existingStr = JSON.stringify(existingHooks[event]);
|
|
169
|
+
if (!existingStr.includes("mgrep")) {
|
|
170
|
+
existingHooks[event].push(...entries);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
else {
|
|
174
|
+
existingHooks[event] = entries;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
const merged = {
|
|
178
|
+
...existing,
|
|
179
|
+
hooks: existingHooks,
|
|
180
|
+
};
|
|
181
|
+
writeFileSync(settingsPath, JSON.stringify(merged, null, 2), "utf-8");
|
|
182
|
+
}
|
|
183
|
+
catch {
|
|
184
|
+
writeFileSync(settingsPath, newContent, "utf-8");
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
else {
|
|
188
|
+
writeFileSync(settingsPath, newContent, "utf-8");
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
//# sourceMappingURL=mgrep-setup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mgrep-setup.js","sourceRoot":"","sources":["../../src/generators/mgrep-setup.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,6DAA6D;AAC7D,yDAAyD;AACzD,+DAA+D;AAE/D,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACxF,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAGjC,MAAM,UAAU,kBAAkB,CAAC,GAAqB;IACtD,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,GAAG,CAAC;IAC1C,MAAM,YAAY,GAAyB,MAAM,CAAC,cAAc,IAAI,EAAE,CAAC;IACvE,MAAM,OAAO,GAAsC,EAAE,CAAC;IAEtD,4BAA4B;IAC5B,MAAM,SAAS,GAAG,eAAe,CAAC,YAAY,CAAC,CAAC;IAChD,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,EAAE,eAAe,CAAC,CAAC;IAChD,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC;YACxB,aAAa,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,CA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AAY,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC;IACnD,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mgrep-skill.d.ts","sourceRoot":"","sources":["../../src/generators/mgrep-skill.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAElE,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,gBAAgB,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAsLzF"}
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
// ============================================================
|
|
2
|
+
// Generator: Layer 6a — Semantic Search Skill (mgrep SKILL.md)
|
|
3
|
+
// Generates .claude/skills/semantic-search/SKILL.md
|
|
4
|
+
// ============================================================
|
|
5
|
+
import { writeFileSync } from "node:fs";
|
|
6
|
+
import { join } from "node:path";
|
|
7
|
+
export function generateMgrepSkill(ctx) {
|
|
8
|
+
const { config, targetDir, dryRun } = ctx;
|
|
9
|
+
const searchConfig = config.semanticSearch ?? {};
|
|
10
|
+
const maxResults = searchConfig.defaultMaxResults ?? 10;
|
|
11
|
+
const lines = [];
|
|
12
|
+
lines.push(`---`);
|
|
13
|
+
lines.push(`name: semantic-search`);
|
|
14
|
+
lines.push(`description: Semantic code search with mgrep. Natural language queries, feature discovery, cross-file understanding. Use mgrep "query" for intent-based search, -a for AI answers, --web for documentation lookup.`);
|
|
15
|
+
lines.push(`---`);
|
|
16
|
+
lines.push(``);
|
|
17
|
+
lines.push(`# Semantic Search — Claude Code Skill`);
|
|
18
|
+
lines.push(``);
|
|
19
|
+
lines.push(`> Generated by @yattalo/task-system for **${config.projectName}**`);
|
|
20
|
+
lines.push(`> Powered by [mgrep](https://www.mgrep.dev/) — semantic grep for code, docs, images, PDFs`);
|
|
21
|
+
lines.push(`> DO NOT EDIT MANUALLY — re-run \`npx @yattalo/task-system init\` to regenerate`);
|
|
22
|
+
lines.push(``);
|
|
23
|
+
// --- Overview ---
|
|
24
|
+
lines.push(`## Overview`);
|
|
25
|
+
lines.push(``);
|
|
26
|
+
lines.push(`This project uses **mgrep** for semantic code search. Unlike grep/ripgrep which match`);
|
|
27
|
+
lines.push(`exact patterns, mgrep understands natural language queries and finds code by meaning.`);
|
|
28
|
+
lines.push(``);
|
|
29
|
+
lines.push(`**When to use mgrep vs grep:**`);
|
|
30
|
+
lines.push(`- **mgrep**: Intent-based search, feature discovery, onboarding, cross-file understanding`);
|
|
31
|
+
lines.push(`- **grep/rg**: Exact matches, symbol tracing, refactoring, regex patterns`);
|
|
32
|
+
lines.push(``);
|
|
33
|
+
lines.push(`Best results come from combining both: mgrep to discover, grep to refine.`);
|
|
34
|
+
lines.push(``);
|
|
35
|
+
// --- Quick Reference ---
|
|
36
|
+
lines.push(`## Quick Reference`);
|
|
37
|
+
lines.push(``);
|
|
38
|
+
lines.push(`\`\`\`bash`);
|
|
39
|
+
lines.push(`# Basic semantic search`);
|
|
40
|
+
lines.push(`mgrep "where is authentication configured?"`);
|
|
41
|
+
lines.push(``);
|
|
42
|
+
lines.push(`# Search with more results`);
|
|
43
|
+
lines.push(`mgrep "error handling patterns" -m 20`);
|
|
44
|
+
lines.push(``);
|
|
45
|
+
lines.push(`# Show surrounding context`);
|
|
46
|
+
lines.push(`mgrep "database connection setup" -c`);
|
|
47
|
+
lines.push(``);
|
|
48
|
+
lines.push(`# Get AI-generated answer from results`);
|
|
49
|
+
lines.push(`mgrep "how does the payment flow work?" -a`);
|
|
50
|
+
lines.push(``);
|
|
51
|
+
if (searchConfig.webSearch) {
|
|
52
|
+
lines.push(`# Web search (enabled by default for this project)`);
|
|
53
|
+
lines.push(`mgrep "latest React 19 patterns" --web`);
|
|
54
|
+
lines.push(``);
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
lines.push(`# Include web search results`);
|
|
58
|
+
lines.push(`mgrep "how to implement SSR with this framework" --web`);
|
|
59
|
+
lines.push(``);
|
|
60
|
+
}
|
|
61
|
+
if (searchConfig.agenticSearch) {
|
|
62
|
+
lines.push(`# Agentic multi-query refinement (enabled by default)`);
|
|
63
|
+
lines.push(`mgrep "trace the complete request lifecycle" --agentic`);
|
|
64
|
+
lines.push(``);
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
lines.push(`# Complex queries with multi-query refinement`);
|
|
68
|
+
lines.push(`mgrep "trace the complete request lifecycle" --agentic`);
|
|
69
|
+
lines.push(``);
|
|
70
|
+
}
|
|
71
|
+
lines.push(`# Search specific directory`);
|
|
72
|
+
lines.push(`mgrep "API endpoint definitions" src/`);
|
|
73
|
+
lines.push(``);
|
|
74
|
+
lines.push(`# Sync files before searching (ensures index is current)`);
|
|
75
|
+
lines.push(`mgrep "recent changes to auth" -s`);
|
|
76
|
+
lines.push(`\`\`\``);
|
|
77
|
+
lines.push(``);
|
|
78
|
+
// --- UCA Integration ---
|
|
79
|
+
lines.push(`## UCA Integration`);
|
|
80
|
+
lines.push(``);
|
|
81
|
+
lines.push(`Semantic search is a core pillar of the Unified Context Accelerator (UCA).`);
|
|
82
|
+
lines.push(`It bridges the gap between **Context** (what agents know) and **Knowledge** (curated information).`);
|
|
83
|
+
lines.push(``);
|
|
84
|
+
lines.push(`### Search Patterns for UCA Workflows`);
|
|
85
|
+
lines.push(``);
|
|
86
|
+
lines.push(`\`\`\`bash`);
|
|
87
|
+
lines.push(`# Find related context for a task`);
|
|
88
|
+
lines.push(`mgrep "authentication middleware implementation" -m ${maxResults}`);
|
|
89
|
+
lines.push(``);
|
|
90
|
+
lines.push(`# Discover knowledge before creating context entries`);
|
|
91
|
+
lines.push(`mgrep "patterns we use for error handling" -a`);
|
|
92
|
+
lines.push(``);
|
|
93
|
+
lines.push(`# Cross-reference existing implementations`);
|
|
94
|
+
lines.push(`mgrep "similar to the user registration flow" -c`);
|
|
95
|
+
lines.push(``);
|
|
96
|
+
lines.push(`# Validate assumptions against codebase`);
|
|
97
|
+
lines.push(`mgrep "is rate limiting implemented anywhere?" -a`);
|
|
98
|
+
lines.push(`\`\`\``);
|
|
99
|
+
lines.push(``);
|
|
100
|
+
// --- Agent-Specific Patterns ---
|
|
101
|
+
const agentKeys = Object.keys(config.agents);
|
|
102
|
+
if (agentKeys.length > 0) {
|
|
103
|
+
lines.push(`### Agent Search Patterns`);
|
|
104
|
+
lines.push(``);
|
|
105
|
+
lines.push(`Each agent should use mgrep for codebase understanding before starting tasks:`);
|
|
106
|
+
lines.push(``);
|
|
107
|
+
lines.push(`\`\`\`bash`);
|
|
108
|
+
lines.push(`# Before starting any task — understand the area`);
|
|
109
|
+
lines.push(`mgrep "how does [feature area] work?" -a`);
|
|
110
|
+
lines.push(``);
|
|
111
|
+
lines.push(`# During code review — find related patterns`);
|
|
112
|
+
lines.push(`mgrep "other places that use this pattern" -m 15`);
|
|
113
|
+
lines.push(``);
|
|
114
|
+
lines.push(`# When blocked — search for similar solutions`);
|
|
115
|
+
lines.push(`mgrep "workaround for [issue description]" --web`);
|
|
116
|
+
lines.push(`\`\`\``);
|
|
117
|
+
lines.push(``);
|
|
118
|
+
}
|
|
119
|
+
// --- Indexing ---
|
|
120
|
+
lines.push(`## Indexing`);
|
|
121
|
+
lines.push(``);
|
|
122
|
+
lines.push(`The project index is managed by mgrep and synced to a Mixedbread cloud store.`);
|
|
123
|
+
lines.push(``);
|
|
124
|
+
lines.push(`\`\`\`bash`);
|
|
125
|
+
lines.push(`# Start background indexing (watches for file changes)`);
|
|
126
|
+
lines.push(`mgrep watch`);
|
|
127
|
+
lines.push(``);
|
|
128
|
+
lines.push(`# Manual sync before search`);
|
|
129
|
+
lines.push(`mgrep "query" -s`);
|
|
130
|
+
lines.push(`\`\`\``);
|
|
131
|
+
lines.push(``);
|
|
132
|
+
if ((searchConfig.ignorePatterns ?? []).length > 0) {
|
|
133
|
+
lines.push(`### Custom Ignore Patterns`);
|
|
134
|
+
lines.push(``);
|
|
135
|
+
lines.push(`This project excludes:`);
|
|
136
|
+
for (const pattern of searchConfig.ignorePatterns) {
|
|
137
|
+
lines.push(`- \`${pattern}\``);
|
|
138
|
+
}
|
|
139
|
+
lines.push(``);
|
|
140
|
+
}
|
|
141
|
+
// --- Configuration ---
|
|
142
|
+
lines.push(`## Configuration`);
|
|
143
|
+
lines.push(``);
|
|
144
|
+
lines.push(`| Setting | Value |`);
|
|
145
|
+
lines.push(`|---------|-------|`);
|
|
146
|
+
lines.push(`| Max file size | ${((searchConfig.maxFileSize ?? 1048576) / 1024 / 1024).toFixed(1)}MB |`);
|
|
147
|
+
lines.push(`| Max file count | ${searchConfig.maxFileCount ?? 1000} |`);
|
|
148
|
+
lines.push(`| Default results | ${maxResults} |`);
|
|
149
|
+
lines.push(`| Web search | ${searchConfig.webSearch ? "enabled" : "disabled"} |`);
|
|
150
|
+
lines.push(`| Agentic search | ${searchConfig.agenticSearch ? "enabled" : "disabled"} |`);
|
|
151
|
+
lines.push(`| Auto-watch | ${searchConfig.autoWatch !== false ? "enabled" : "disabled"} |`);
|
|
152
|
+
lines.push(``);
|
|
153
|
+
// --- Best Practices ---
|
|
154
|
+
lines.push(`## Best Practices`);
|
|
155
|
+
lines.push(``);
|
|
156
|
+
lines.push(`1. **Ask in natural language** — "where is the auth middleware?" beats "auth middleware file"`);
|
|
157
|
+
lines.push(`2. **Use \`-a\` for understanding** — generates synthesized answers from multiple results`);
|
|
158
|
+
lines.push(`3. **Use \`-c\` for context** — shows surrounding code for faster comprehension`);
|
|
159
|
+
lines.push(`4. **Combine with grep** — use mgrep to discover, grep to trace exact references`);
|
|
160
|
+
lines.push(`5. **Keep index fresh** — run \`mgrep watch\` or use \`-s\` flag during active development`);
|
|
161
|
+
lines.push(`6. **Use \`--agentic\` for complex queries** — multi-query refinement for architectural questions`);
|
|
162
|
+
lines.push(``);
|
|
163
|
+
const content = lines.join("\n");
|
|
164
|
+
if (!dryRun) {
|
|
165
|
+
const skillPath = join(targetDir, ".claude", "skills", "semantic-search", "SKILL.md");
|
|
166
|
+
writeFileSync(skillPath, content, "utf-8");
|
|
167
|
+
}
|
|
168
|
+
return {
|
|
169
|
+
file: ".claude/skills/semantic-search/SKILL.md",
|
|
170
|
+
lines: lines.length,
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
//# sourceMappingURL=mgrep-skill.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mgrep-skill.js","sourceRoot":"","sources":["../../src/generators/mgrep-skill.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D;AAC/D,oDAAoD;AACpD,+DAA+D;AAE/D,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAGjC,MAAM,UAAU,kBAAkB,CAAC,GAAqB;IACtD,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,GAAG,CAAC;IAC1C,MAAM,YAAY,GAAG,MAAM,CAAC,cAAc,IAAI,EAAE,CAAC;IACjD,MAAM,UAAU,GAAG,YAAY,CAAC,iBAAiB,IAAI,EAAE,CAAC;IAExD,MAAM,KAAK,GAAa,EAAE,CAAC;IAE3B,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAClB,KAAK,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAC;IACpC,KAAK,CAAC,IAAI,CAAC,oNAAoN,CAAC,CAAC;IACjO,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAClB,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACf,KAAK,CAAC,IAAI,CAAC,uCAAuC,CAAC,CAAC;IACpD,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACf,KAAK,CAAC,IAAI,CAAC,6CAA6C,MAAM,CAAC,WAAW,IAAI,CAAC,CAAC;IAChF,KAAK,CAAC,IAAI,CAAC,2FAA2F,CAAC,CAAC;IACxG,KAAK,CAAC,IAAI,CAAC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
file: string;
|
|
4
|
+
lines: number;
|
|
5
|
+
}
|
|
6
|
+
export declare function generateUcaFunctions(ctx: GeneratorContext): GeneratorResult[];
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=uca-functions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uca-functions.d.ts","sourceRoot":"","sources":["../../src/generators/uca-functions.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAKlE,UAAU,eAAe;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAuBD,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,gBAAgB,GAAG,eAAe,EAAE,CAkC7E"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
// ============================================================
|
|
2
|
+
// Generator: UCA Backend Functions
|
|
3
|
+
// Copies UCA function templates to convex/taskSystem/
|
|
4
|
+
// ============================================================
|
|
5
|
+
import { existsSync, readFileSync, writeFileSync } from "node:fs";
|
|
6
|
+
import { join, dirname } from "node:path";
|
|
7
|
+
import { fileURLToPath } from "node:url";
|
|
8
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
9
|
+
const __dirname = dirname(__filename);
|
|
10
|
+
const UCA_TEMPLATE_FILES = [
|
|
11
|
+
"ucaTasks",
|
|
12
|
+
"contextEntries",
|
|
13
|
+
"driftEvents",
|
|
14
|
+
"agents",
|
|
15
|
+
"memory",
|
|
16
|
+
"skills",
|
|
17
|
+
"hooks",
|
|
18
|
+
"heartbeats",
|
|
19
|
+
"sessionBridge",
|
|
20
|
+
"cronManager",
|
|
21
|
+
"cronUtils",
|
|
22
|
+
];
|
|
23
|
+
function resolveTemplateDir() {
|
|
24
|
+
// In compiled form: dist/generators/uca-functions.js
|
|
25
|
+
// Templates live at: packages/cli/templates/uca/
|
|
26
|
+
// So from dist/generators/ we go ../../templates/uca/
|
|
27
|
+
return join(__dirname, "..", "..", "templates", "uca");
|
|
28
|
+
}
|
|
29
|
+
export function generateUcaFunctions(ctx) {
|
|
30
|
+
const { targetDir, dryRun } = ctx;
|
|
31
|
+
const templateDir = resolveTemplateDir();
|
|
32
|
+
const outDir = join(targetDir, "convex", "taskSystem");
|
|
33
|
+
const results = [];
|
|
34
|
+
for (const name of UCA_TEMPLATE_FILES) {
|
|
35
|
+
const templatePath = join(templateDir, `${name}.ts`);
|
|
36
|
+
const outPath = join(outDir, `${name}.ts`);
|
|
37
|
+
if (!existsSync(templatePath)) {
|
|
38
|
+
console.warn(` Warning: UCA template not found: ${templatePath}`);
|
|
39
|
+
continue;
|
|
40
|
+
}
|
|
41
|
+
// Skip if file already exists (don't overwrite user customizations)
|
|
42
|
+
if (existsSync(outPath)) {
|
|
43
|
+
continue;
|
|
44
|
+
}
|
|
45
|
+
const content = readFileSync(templatePath, "utf-8");
|
|
46
|
+
const lineCount = content.split("\n").length;
|
|
47
|
+
if (!dryRun) {
|
|
48
|
+
writeFileSync(outPath, content, "utf-8");
|
|
49
|
+
}
|
|
50
|
+
results.push({
|
|
51
|
+
file: `convex/taskSystem/${name}.ts`,
|
|
52
|
+
lines: lineCount,
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
return results;
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=uca-functions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uca-functions.js","sourceRoot":"","sources":["../../src/generators/uca-functions.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,mCAAmC;AACnC,sDAAsD;AACtD,+DAA+D;AAE/D,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAClE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAGzC,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC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CAAC,CAAC,MAAM,CAAC;QAE7C,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,aAAa,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;QAC3C,CAAC;QAED,OAAO,CAAC,IAAI,CAAC;YACX,IAAI,EAAE,qBAAqB,IAAI,KAAK;YACpC,KAAK,EAAE,SAAS;SACjB,CAAC,CAAC;IACL,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { GeneratorContext } from "@yattalo/task-system-core";
|
|
2
|
+
interface GeneratorResult {
|
|
3
|
+
file: string;
|
|
4
|
+
lines: number;
|
|
5
|
+
}
|
|
6
|
+
export declare function generateUcaReexports(ctx: GeneratorContext): GeneratorResult[];
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=uca-reexports.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uca-reexports.d.ts","sourceRoot":"","sources":["../../src/generators/uca-reexports.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAElE,UAAU,eAAe;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAuFD,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,gBAAgB,GAAG,eAAe,EAAE,CA2B7E"}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
// ============================================================
|
|
2
|
+
// Generator: UCA Re-export Wrappers
|
|
3
|
+
// Creates top-level convex/ files that re-export from taskSystem/
|
|
4
|
+
// This makes the API surface match the pre-built SPA dashboard
|
|
5
|
+
// (e.g., api.tasks.list instead of api.taskSystem.tasks.list)
|
|
6
|
+
// ============================================================
|
|
7
|
+
import { existsSync, writeFileSync } from "node:fs";
|
|
8
|
+
import { join } from "node:path";
|
|
9
|
+
// Map of top-level file -> exports from taskSystem module
|
|
10
|
+
const REEXPORT_MAP = {
|
|
11
|
+
tasks: {
|
|
12
|
+
source: "./taskSystem/ucaTasks",
|
|
13
|
+
exports: [
|
|
14
|
+
"list", "stats", "getByTaskId", "create", "upsert",
|
|
15
|
+
"updateStatus", "markDoneWithCommit", "captureCommitFromGitHook",
|
|
16
|
+
"addCommit", "addBlocker", "resolveBlocker", "updateNotes",
|
|
17
|
+
],
|
|
18
|
+
},
|
|
19
|
+
contextEntries: {
|
|
20
|
+
source: "./taskSystem/contextEntries",
|
|
21
|
+
exports: ["list", "stats", "create", "promote", "addValidation", "updateSummary"],
|
|
22
|
+
},
|
|
23
|
+
driftEvents: {
|
|
24
|
+
source: "./taskSystem/driftEvents",
|
|
25
|
+
exports: ["list", "stats", "create", "resolve", "dismiss", "acknowledge"],
|
|
26
|
+
},
|
|
27
|
+
agents: {
|
|
28
|
+
source: "./taskSystem/agents",
|
|
29
|
+
exports: ["list", "stats", "register", "updateStatus"],
|
|
30
|
+
},
|
|
31
|
+
memory: {
|
|
32
|
+
source: "./taskSystem/memory",
|
|
33
|
+
exports: [
|
|
34
|
+
"listMemory", "memoryStats", "addMemory", "searchMemory",
|
|
35
|
+
"consolidateHotMemory", "syncMemoryToContext",
|
|
36
|
+
],
|
|
37
|
+
},
|
|
38
|
+
skills: {
|
|
39
|
+
source: "./taskSystem/skills",
|
|
40
|
+
exports: [
|
|
41
|
+
"listSkills", "upsertSkill", "removeSkill", "listAgentSkills",
|
|
42
|
+
"assignSkillToAgent", "toggleAgentSkill", "buildPromptForTask",
|
|
43
|
+
],
|
|
44
|
+
},
|
|
45
|
+
hooks: {
|
|
46
|
+
source: "./taskSystem/hooks",
|
|
47
|
+
exports: [
|
|
48
|
+
"listEvents", "listWebhooks", "registerWebhook",
|
|
49
|
+
"setWebhookEnabled", "emitEvent", "ingestWebhook",
|
|
50
|
+
],
|
|
51
|
+
},
|
|
52
|
+
heartbeats: {
|
|
53
|
+
source: "./taskSystem/heartbeats",
|
|
54
|
+
exports: [
|
|
55
|
+
"beat", "getAgentHeartbeat", "listHeartbeats",
|
|
56
|
+
"statusSummary", "internalSweepStaleHeartbeats",
|
|
57
|
+
],
|
|
58
|
+
},
|
|
59
|
+
sessionBridge: {
|
|
60
|
+
source: "./taskSystem/sessionBridge",
|
|
61
|
+
exports: [
|
|
62
|
+
"sendMessage", "inbox", "markDelivered",
|
|
63
|
+
"acknowledgeMessage", "handoffTask", "internalExpireMessages",
|
|
64
|
+
],
|
|
65
|
+
},
|
|
66
|
+
cronManager: {
|
|
67
|
+
source: "./taskSystem/cronManager",
|
|
68
|
+
exports: [
|
|
69
|
+
"listSchedules", "createSchedule", "updateSchedule",
|
|
70
|
+
"deleteSchedule", "enqueue", "completeQueueItem",
|
|
71
|
+
"internalDispatchDueSchedules",
|
|
72
|
+
],
|
|
73
|
+
},
|
|
74
|
+
};
|
|
75
|
+
function generateReexportContent(name, config) {
|
|
76
|
+
const lines = [
|
|
77
|
+
`// ============================================================`,
|
|
78
|
+
`// Re-export: ${name} — generated by @yattalo/task-system`,
|
|
79
|
+
`// Maps api.${name}.* to convex/taskSystem/${name}.*`,
|
|
80
|
+
`// DO NOT EDIT — re-run 'npx @yattalo/task-system init' to update`,
|
|
81
|
+
`// ============================================================`,
|
|
82
|
+
``,
|
|
83
|
+
`export {`,
|
|
84
|
+
...config.exports.map((e, i, arr) => ` ${e}${i < arr.length - 1 ? "," : ""}`),
|
|
85
|
+
`} from "${config.source}";`,
|
|
86
|
+
``,
|
|
87
|
+
];
|
|
88
|
+
return lines.join("\n");
|
|
89
|
+
}
|
|
90
|
+
export function generateUcaReexports(ctx) {
|
|
91
|
+
const { targetDir, dryRun } = ctx;
|
|
92
|
+
const convexDir = join(targetDir, "convex");
|
|
93
|
+
const results = [];
|
|
94
|
+
for (const [name, config] of Object.entries(REEXPORT_MAP)) {
|
|
95
|
+
const outPath = join(convexDir, `${name}.ts`);
|
|
96
|
+
// Skip if file already exists (don't overwrite user code)
|
|
97
|
+
if (existsSync(outPath)) {
|
|
98
|
+
continue;
|
|
99
|
+
}
|
|
100
|
+
const content = generateReexportContent(name, config);
|
|
101
|
+
const lineCount = content.split("\n").length;
|
|
102
|
+
if (!dryRun) {
|
|
103
|
+
writeFileSync(outPath, content, "utf-8");
|
|
104
|
+
}
|
|
105
|
+
results.push({
|
|
106
|
+
file: `convex/${name}.ts`,
|
|
107
|
+
lines: lineCount,
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
return results;
|
|
111
|
+
}
|
|
112
|
+
//# sourceMappingURL=uca-reexports.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uca-reexports.js","sourceRoot":"","sources":["../../src/generators/uca-reexports.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,oCAAoC;AACpC,kEAAkE;AAClE,+DAA+D;AAC/D,8DAA8D;AAC9D,+DAA+D;AAE/D,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACpD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAQjC,0DAA0D;AAC1D,MAAM,YAAY,GAA0D;IAC1E,KAAK,EAAE;QACL,MAAM,EAAE,uBAAuB;QAC/B,OAAO,EAAE;YACP,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,QAAQ;YAClD,cAAc,EAAE,oBAAoB,EAAE,0BAA0B;YAChE,WAAW,EAAE,YAAY,EAAE,gBAAgB,EAAE,aAAa;SAC3D;KACF;IACD,cAAc,EAAE;QACd,MAAM,EAAE,6BAA6B;QACrC,OAAO,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,eAAe,EAAE,eAAe,CAAC;KAClF;IACD,WAAW,EAAE;QACX,MAAM,EAAE,0BAA0B;QAClC,OAAO,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,aAAa,CAAC;KAC1E;IACD,MAAM,EAAE;QACN,MAAM,EAAE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 -0,0 +1,8 @@
|
|
|
1
|
+
import type { GeneratorContext } from "@yattalo/task-system-core";
|
|
2
|
+
interface GeneratorResult {
|
|
3
|
+
file: string;
|
|
4
|
+
lines: number;
|
|
5
|
+
}
|
|
6
|
+
export declare function generateUcaSchema(ctx: GeneratorContext): GeneratorResult;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=uca-schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uca-schema.d.ts","sourceRoot":"","sources":["../../src/generators/uca-schema.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAGlE,UAAU,eAAe;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAED,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,gBAAgB,GAAG,eAAe,CAqoBxE"}
|