@a-company/paradigm 1.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 +142 -0
- package/dist/accept-orchestration-CWZNCGZX.js +188 -0
- package/dist/agents-suggest-35LIQKDH.js +83 -0
- package/dist/aggregate-W7Q6VIM2.js +88 -0
- package/dist/auto-IU7VN55K.js +470 -0
- package/dist/beacon-B47XSTL7.js +251 -0
- package/dist/chunk-2M6OSOIG.js +1302 -0
- package/dist/chunk-4NCFWYGG.js +110 -0
- package/dist/chunk-5C4SGQKH.js +705 -0
- package/dist/chunk-5GOA7WYD.js +1095 -0
- package/dist/chunk-5JGJACDU.js +37 -0
- package/dist/chunk-6QC3YGB6.js +114 -0
- package/dist/chunk-753RICFF.js +325 -0
- package/dist/chunk-AD2LSCHB.js +1595 -0
- package/dist/chunk-CHSHON3O.js +669 -0
- package/dist/chunk-ELLR7WP6.js +3175 -0
- package/dist/chunk-ILOWBJRC.js +12 -0
- package/dist/chunk-IRKUEJVW.js +405 -0
- package/dist/chunk-MC7XC7XQ.js +533 -0
- package/dist/chunk-MO4EEYFW.js +38 -0
- package/dist/chunk-MQWH7PFI.js +13366 -0
- package/dist/chunk-N6PJAPDE.js +364 -0
- package/dist/chunk-PBHIFAL4.js +259 -0
- package/dist/chunk-PMXRGPRQ.js +305 -0
- package/dist/chunk-PW2EXJQT.js +689 -0
- package/dist/chunk-TAP5N3HH.js +245 -0
- package/dist/chunk-THFVK5AE.js +148 -0
- package/dist/chunk-UM54F7G5.js +1533 -0
- package/dist/chunk-UUZ2DMG5.js +185 -0
- package/dist/chunk-WS5KM7OL.js +780 -0
- package/dist/chunk-YDNKXH4Z.js +2316 -0
- package/dist/chunk-YO6DVTL7.js +99 -0
- package/dist/claude-SUYNN72C.js +362 -0
- package/dist/claude-cli-OF43XAO3.js +276 -0
- package/dist/claude-code-PW6SKD2M.js +126 -0
- package/dist/claude-code-teams-JLZ5IXB6.js +199 -0
- package/dist/constellation-K3CIQCHI.js +225 -0
- package/dist/cost-AEK6R7HK.js +174 -0
- package/dist/cost-KYXIQ62X.js +93 -0
- package/dist/cursor-cli-IHJMPRCW.js +269 -0
- package/dist/cursorrules-KI5QWHIX.js +84 -0
- package/dist/diff-AJJ5H6HV.js +125 -0
- package/dist/dist-7MPIRMTZ-IOQOREMZ.js +10866 -0
- package/dist/dist-NHJQVVUW.js +68 -0
- package/dist/dist-ZEMSQV74.js +20 -0
- package/dist/doctor-6Y6L6HEB.js +11 -0
- package/dist/echo-VYZW3OTT.js +248 -0
- package/dist/export-R4FJ5NOH.js +38 -0
- package/dist/history-EVO3L6SC.js +277 -0
- package/dist/hooks-MBWE4ILT.js +12 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +568 -0
- package/dist/lint-HXKTWRNO.js +316 -0
- package/dist/manual-Y3QOXWYA.js +204 -0
- package/dist/mcp.js +14745 -0
- package/dist/orchestrate-4ZH5GUQH.js +323 -0
- package/dist/probe-OYCP4JYG.js +151 -0
- package/dist/promote-Z52ZJTJU.js +181 -0
- package/dist/providers-4PGPZEWP.js +104 -0
- package/dist/remember-6VZ74B7E.js +77 -0
- package/dist/ripple-SBQOSTZD.js +215 -0
- package/dist/sentinel-LCFD56OJ.js +43 -0
- package/dist/server-F5ITNK6T.js +9846 -0
- package/dist/server-T6WIFYRQ.js +16076 -0
- package/dist/setup-DF4F3ICN.js +25 -0
- package/dist/setup-JHBPZAG7.js +296 -0
- package/dist/shift-HKIAP4ZN.js +226 -0
- package/dist/snapshot-GTVPRYZG.js +62 -0
- package/dist/spawn-BJRQA2NR.js +196 -0
- package/dist/summary-H6J6N6PJ.js +140 -0
- package/dist/switch-6EANJ7O6.js +232 -0
- package/dist/sync-BEOCW7TZ.js +11 -0
- package/dist/team-NWP2KJAB.js +32 -0
- package/dist/test-MA5TWJQV.js +934 -0
- package/dist/thread-JCJVRUQR.js +258 -0
- package/dist/triage-ETVXXFMV.js +1880 -0
- package/dist/tutorial-L5Q3ZDHK.js +666 -0
- package/dist/university-R2WDQLSI.js +40 -0
- package/dist/upgrade-5B3YGGC6.js +550 -0
- package/dist/validate-F3YHBCRZ.js +39 -0
- package/dist/validate-QEEY6KFS.js +64 -0
- package/dist/watch-4LT4O6K7.js +123 -0
- package/dist/watch-6IIWPWDN.js +111 -0
- package/dist/wisdom-LRM4FFCH.js +319 -0
- package/package.json +68 -0
- package/templates/paradigm/config.yaml +175 -0
- package/templates/paradigm/docs/commands.md +727 -0
- package/templates/paradigm/docs/decisions/000-template.md +47 -0
- package/templates/paradigm/docs/decisions/README.md +26 -0
- package/templates/paradigm/docs/error-patterns.md +215 -0
- package/templates/paradigm/docs/patterns.md +358 -0
- package/templates/paradigm/docs/queries.md +200 -0
- package/templates/paradigm/docs/troubleshooting.md +477 -0
- package/templates/paradigm/echoes.yaml +25 -0
- package/templates/paradigm/prompts/add-feature.md +152 -0
- package/templates/paradigm/prompts/add-gate.md +117 -0
- package/templates/paradigm/prompts/debug-auth.md +174 -0
- package/templates/paradigm/prompts/implement-ftux.md +722 -0
- package/templates/paradigm/prompts/implement-sandbox.md +651 -0
- package/templates/paradigm/prompts/read-docs.md +84 -0
- package/templates/paradigm/prompts/refactor.md +106 -0
- package/templates/paradigm/prompts/run-e2e-tests.md +340 -0
- package/templates/paradigm/prompts/trace-flow.md +202 -0
- package/templates/paradigm/prompts/validate-portals.md +279 -0
- package/templates/paradigm/specs/context-tracking.md +200 -0
- package/templates/paradigm/specs/context.md +461 -0
- package/templates/paradigm/specs/disciplines.md +413 -0
- package/templates/paradigm/specs/history.md +339 -0
- package/templates/paradigm/specs/logger.md +303 -0
- package/templates/paradigm/specs/navigator.md +236 -0
- package/templates/paradigm/specs/purpose.md +265 -0
- package/templates/paradigm/specs/scan.md +177 -0
- package/templates/paradigm/specs/symbols.md +451 -0
- package/templates/paradigm/specs/wisdom.md +294 -0
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
aggregateFromDirectory,
|
|
4
|
+
buildSymbolIndex,
|
|
5
|
+
getAllSymbols,
|
|
6
|
+
getSymbolCounts
|
|
7
|
+
} from "./chunk-5C4SGQKH.js";
|
|
8
|
+
import "./chunk-PW2EXJQT.js";
|
|
9
|
+
import "./chunk-IRKUEJVW.js";
|
|
10
|
+
import {
|
|
11
|
+
log
|
|
12
|
+
} from "./chunk-4NCFWYGG.js";
|
|
13
|
+
import "./chunk-MO4EEYFW.js";
|
|
14
|
+
|
|
15
|
+
// src/commands/beacon.ts
|
|
16
|
+
import * as fs from "fs";
|
|
17
|
+
import * as path from "path";
|
|
18
|
+
import chalk from "chalk";
|
|
19
|
+
import ora from "ora";
|
|
20
|
+
function findLandmarks(rootDir) {
|
|
21
|
+
const landmarks = [];
|
|
22
|
+
const importantFiles = [
|
|
23
|
+
{ pattern: "portal.yaml", desc: "Authorization topology" },
|
|
24
|
+
{ pattern: "src/lib/api.ts", desc: "API utilities" },
|
|
25
|
+
{ pattern: "src/lib/api.js", desc: "API utilities" },
|
|
26
|
+
{ pattern: "src/utils/api.ts", desc: "API utilities" },
|
|
27
|
+
{ pattern: "src/hooks/useAuth.ts", desc: "Auth hook" },
|
|
28
|
+
{ pattern: "src/hooks/useAuth.tsx", desc: "Auth hook" },
|
|
29
|
+
{ pattern: "src/context/AuthContext.tsx", desc: "Auth context" },
|
|
30
|
+
{ pattern: "src/store/index.ts", desc: "State store" },
|
|
31
|
+
{ pattern: "src/types/index.ts", desc: "Type definitions" },
|
|
32
|
+
{ pattern: "src/types.ts", desc: "Type definitions" },
|
|
33
|
+
{ pattern: ".paradigm/config.yaml", desc: "Paradigm config" },
|
|
34
|
+
{ pattern: "tsconfig.json", desc: "TypeScript config" },
|
|
35
|
+
{ pattern: "package.json", desc: "Package manifest" }
|
|
36
|
+
];
|
|
37
|
+
for (const { pattern, desc } of importantFiles) {
|
|
38
|
+
const fullPath = path.join(rootDir, pattern);
|
|
39
|
+
if (fs.existsSync(fullPath)) {
|
|
40
|
+
landmarks.push({ path: pattern, description: desc });
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return landmarks.slice(0, 8);
|
|
44
|
+
}
|
|
45
|
+
function findPathways(rootDir) {
|
|
46
|
+
const promptsDir = path.join(rootDir, ".paradigm", "prompts");
|
|
47
|
+
const pathways = [];
|
|
48
|
+
if (fs.existsSync(promptsDir)) {
|
|
49
|
+
const files = fs.readdirSync(promptsDir).filter((f) => f.endsWith(".md"));
|
|
50
|
+
for (const file of files) {
|
|
51
|
+
const name = file.replace(".md", "").replace(/-/g, " ");
|
|
52
|
+
pathways.push({
|
|
53
|
+
name: name.charAt(0).toUpperCase() + name.slice(1),
|
|
54
|
+
path: `.paradigm/prompts/${file}`
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return pathways.slice(0, 6);
|
|
59
|
+
}
|
|
60
|
+
function generateBeacon(projectName, symbols, landmarks, pathways, _rootDir) {
|
|
61
|
+
const lines = [];
|
|
62
|
+
lines.push(`# Beacon - ${projectName}`);
|
|
63
|
+
lines.push("");
|
|
64
|
+
lines.push("> Quick-start orientation for AI agents. Generated by Paradigm.");
|
|
65
|
+
lines.push("");
|
|
66
|
+
lines.push("## Constellation (Symbol Map)");
|
|
67
|
+
lines.push("");
|
|
68
|
+
lines.push("```");
|
|
69
|
+
const components = symbols.filter((s) => s.type === "component");
|
|
70
|
+
const gates = symbols.filter((s) => s.type === "gate");
|
|
71
|
+
for (const component of components.slice(0, 15)) {
|
|
72
|
+
const componentGates = component.references.filter((r) => r.startsWith("^"));
|
|
73
|
+
let line = `${component.symbol.padEnd(20)} \u2192 ${path.dirname(component.filePath).padEnd(25)}`;
|
|
74
|
+
if (componentGates.length > 0) {
|
|
75
|
+
line += ` \u2192 ${componentGates.join(", ")}`;
|
|
76
|
+
}
|
|
77
|
+
lines.push(line);
|
|
78
|
+
}
|
|
79
|
+
if (components.length > 15) {
|
|
80
|
+
lines.push(`... and ${components.length - 15} more components`);
|
|
81
|
+
}
|
|
82
|
+
lines.push("```");
|
|
83
|
+
lines.push("");
|
|
84
|
+
if (gates.length > 0) {
|
|
85
|
+
lines.push("## Gates (Authorization)");
|
|
86
|
+
lines.push("");
|
|
87
|
+
for (const gate of gates.slice(0, 6)) {
|
|
88
|
+
const desc = gate.description ? ` - ${gate.description}` : "";
|
|
89
|
+
lines.push(`- \`${gate.symbol}\`${desc}`);
|
|
90
|
+
}
|
|
91
|
+
if (gates.length > 6) {
|
|
92
|
+
lines.push(`- ... and ${gates.length - 6} more gates`);
|
|
93
|
+
}
|
|
94
|
+
lines.push("");
|
|
95
|
+
}
|
|
96
|
+
if (landmarks.length > 0) {
|
|
97
|
+
lines.push("## Landmarks (Key Files)");
|
|
98
|
+
lines.push("");
|
|
99
|
+
for (const landmark of landmarks) {
|
|
100
|
+
lines.push(`- \`${landmark.path}\` - ${landmark.description}`);
|
|
101
|
+
}
|
|
102
|
+
lines.push("");
|
|
103
|
+
}
|
|
104
|
+
if (pathways.length > 0) {
|
|
105
|
+
lines.push("## Pathways (Common Tasks)");
|
|
106
|
+
lines.push("");
|
|
107
|
+
for (const pathway of pathways) {
|
|
108
|
+
lines.push(`- "${pathway.name}" \u2192 \`${pathway.path}\``);
|
|
109
|
+
}
|
|
110
|
+
lines.push("");
|
|
111
|
+
}
|
|
112
|
+
lines.push("## Symbol Quick Reference");
|
|
113
|
+
lines.push("");
|
|
114
|
+
lines.push("| Symbol | Type | Meaning |");
|
|
115
|
+
lines.push("|--------|------|---------|");
|
|
116
|
+
lines.push("| `#` | Component | Any documented code unit |");
|
|
117
|
+
lines.push("| `$` | Flow | Multi-step process |");
|
|
118
|
+
lines.push("| `^` | Gate | Authorization checkpoint |");
|
|
119
|
+
lines.push("| `!` | Signal | Event for side effects |");
|
|
120
|
+
lines.push("| `~` | Aspect | Rule with code anchor |");
|
|
121
|
+
lines.push("");
|
|
122
|
+
lines.push("## For More Context");
|
|
123
|
+
lines.push("");
|
|
124
|
+
lines.push("- Full symbol graph: `.paradigm/constellation.json`");
|
|
125
|
+
lines.push("- Detailed context: `.paradigm/specs/` for detailed specifications");
|
|
126
|
+
lines.push("- Session history: `.paradigm/thread.md` (if available)");
|
|
127
|
+
lines.push("- Error mapping: `.paradigm/echoes.yaml` (if available)");
|
|
128
|
+
lines.push("");
|
|
129
|
+
lines.push("---");
|
|
130
|
+
lines.push(`*Generated: ${(/* @__PURE__ */ new Date()).toISOString().split("T")[0]}*`);
|
|
131
|
+
lines.push(`*Run \`paradigm beacon --refresh\` to update*`);
|
|
132
|
+
return lines.join("\n");
|
|
133
|
+
}
|
|
134
|
+
async function beaconCommand(targetPath, options = {}) {
|
|
135
|
+
const cwd = process.cwd();
|
|
136
|
+
const absolutePath = targetPath ? path.resolve(cwd, targetPath) : cwd;
|
|
137
|
+
const projectName = path.basename(absolutePath);
|
|
138
|
+
const showUI = !options.json && !options.quiet;
|
|
139
|
+
if (showUI) {
|
|
140
|
+
console.log(chalk.blue("\n\u{1F526} Generating Beacon...\n"));
|
|
141
|
+
}
|
|
142
|
+
const spinner = options.json ? null : ora("Scanning project...").start();
|
|
143
|
+
const tracker = log.command("beacon").start("Generating beacon", { project: projectName });
|
|
144
|
+
try {
|
|
145
|
+
const paradigmDir = path.join(absolutePath, ".paradigm");
|
|
146
|
+
const beaconPath = options.output || path.join(paradigmDir, "beacon.md");
|
|
147
|
+
if (!options.json && fs.existsSync(beaconPath) && !options.refresh) {
|
|
148
|
+
spinner?.info("Beacon already exists");
|
|
149
|
+
if (showUI) {
|
|
150
|
+
console.log(chalk.gray(` Use --refresh to regenerate
|
|
151
|
+
`));
|
|
152
|
+
console.log(chalk.gray(` Path: ${beaconPath}
|
|
153
|
+
`));
|
|
154
|
+
const content = fs.readFileSync(beaconPath, "utf8");
|
|
155
|
+
const lines = content.split("\n").slice(0, 15);
|
|
156
|
+
console.log(chalk.white("Current Beacon (preview):"));
|
|
157
|
+
console.log(chalk.gray("\u2500".repeat(40)));
|
|
158
|
+
for (const line of lines) {
|
|
159
|
+
console.log(chalk.gray(` ${line}`));
|
|
160
|
+
}
|
|
161
|
+
console.log(chalk.gray(" ..."));
|
|
162
|
+
console.log("");
|
|
163
|
+
}
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
const result = await aggregateFromDirectory(absolutePath);
|
|
167
|
+
const index = buildSymbolIndex(result);
|
|
168
|
+
const symbols = getAllSymbols(index);
|
|
169
|
+
spinner && (spinner.text = "Finding landmarks...");
|
|
170
|
+
const landmarks = findLandmarks(absolutePath);
|
|
171
|
+
spinner && (spinner.text = "Finding pathways...");
|
|
172
|
+
const pathways = findPathways(absolutePath);
|
|
173
|
+
if (options.json) {
|
|
174
|
+
const jsonComponents = symbols.filter((s) => s.type === "component");
|
|
175
|
+
const jsonGates = symbols.filter((s) => s.type === "gate");
|
|
176
|
+
const counts = getSymbolCounts(index);
|
|
177
|
+
const jsonOutput = {
|
|
178
|
+
project: projectName,
|
|
179
|
+
generated: (/* @__PURE__ */ new Date()).toISOString(),
|
|
180
|
+
symbols: {
|
|
181
|
+
features: jsonComponents.filter((c) => c.tags?.includes("feature")).map((f) => ({
|
|
182
|
+
symbol: f.symbol,
|
|
183
|
+
path: path.dirname(f.filePath),
|
|
184
|
+
portals: f.references.filter((r) => r.startsWith("^")).length > 0 ? f.references.filter((r) => r.startsWith("^")) : void 0
|
|
185
|
+
})),
|
|
186
|
+
components: jsonComponents.map((c) => ({
|
|
187
|
+
symbol: c.symbol,
|
|
188
|
+
path: path.dirname(c.filePath)
|
|
189
|
+
})),
|
|
190
|
+
portals: jsonGates.map((g) => ({
|
|
191
|
+
symbol: g.symbol,
|
|
192
|
+
description: g.description
|
|
193
|
+
}))
|
|
194
|
+
},
|
|
195
|
+
landmarks,
|
|
196
|
+
pathways,
|
|
197
|
+
stats: {
|
|
198
|
+
features: jsonComponents.filter((c) => c.tags?.includes("feature")).length,
|
|
199
|
+
components: counts.component,
|
|
200
|
+
portals: counts.gate,
|
|
201
|
+
total: Object.values(counts).reduce((a, b) => a + b, 0)
|
|
202
|
+
}
|
|
203
|
+
};
|
|
204
|
+
console.log(JSON.stringify(jsonOutput, null, 2));
|
|
205
|
+
return jsonOutput;
|
|
206
|
+
}
|
|
207
|
+
spinner && (spinner.text = "Generating beacon...");
|
|
208
|
+
const beaconContent = generateBeacon(
|
|
209
|
+
projectName,
|
|
210
|
+
symbols,
|
|
211
|
+
landmarks,
|
|
212
|
+
pathways,
|
|
213
|
+
absolutePath
|
|
214
|
+
);
|
|
215
|
+
if (!fs.existsSync(paradigmDir)) {
|
|
216
|
+
fs.mkdirSync(paradigmDir, { recursive: true });
|
|
217
|
+
}
|
|
218
|
+
fs.writeFileSync(beaconPath, beaconContent, "utf8");
|
|
219
|
+
log.component("beacon-file").success("Beacon file written", { path: beaconPath });
|
|
220
|
+
spinner?.succeed("Beacon generated");
|
|
221
|
+
tracker.success("Beacon generated", { path: beaconPath, symbols: symbols.length });
|
|
222
|
+
if (!options.quiet) {
|
|
223
|
+
const counts = getSymbolCounts(index);
|
|
224
|
+
console.log(chalk.white("\nBeacon Contents"));
|
|
225
|
+
console.log(chalk.gray("\u2500".repeat(40)));
|
|
226
|
+
console.log(` Components: ${chalk.green(counts.component.toString())}`);
|
|
227
|
+
console.log(` Flows: ${chalk.yellow(counts.flow.toString())}`);
|
|
228
|
+
console.log(` Gates: ${chalk.red(counts.gate.toString())}`);
|
|
229
|
+
console.log(` Signals: ${chalk.cyan(counts.signal.toString())}`);
|
|
230
|
+
console.log(` Aspects: ${chalk.magenta(counts.aspect.toString())}`);
|
|
231
|
+
console.log(` Landmarks: ${chalk.cyan(landmarks.length.toString())}`);
|
|
232
|
+
console.log(` Pathways: ${chalk.yellow(pathways.length.toString())}`);
|
|
233
|
+
console.log(chalk.gray(`
|
|
234
|
+
Output: ${beaconPath}
|
|
235
|
+
`));
|
|
236
|
+
console.log(chalk.white("Tip"));
|
|
237
|
+
console.log(chalk.gray("\u2500".repeat(40)));
|
|
238
|
+
console.log(chalk.gray(" AI agents should read beacon.md first for quick orientation."));
|
|
239
|
+
console.log(chalk.gray(" Then constellation.json for detailed relationships.\n"));
|
|
240
|
+
}
|
|
241
|
+
} catch (error) {
|
|
242
|
+
spinner?.fail("Failed to generate beacon");
|
|
243
|
+
tracker.error("Beacon generation failed", { error: error.message });
|
|
244
|
+
console.log(chalk.red(`Error: ${error.message}
|
|
245
|
+
`));
|
|
246
|
+
process.exit(1);
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
export {
|
|
250
|
+
beaconCommand
|
|
251
|
+
};
|