paqad-ai 0.2.0 → 0.2.1
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/dist/cli/index.js +95 -39
- package/dist/cli/index.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +78 -19
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -11450,8 +11450,81 @@ function inferSelectionDomain(detection, overrides, snapshot) {
|
|
|
11450
11450
|
// src/onboarding/rag-onboarding.ts
|
|
11451
11451
|
init_esm_shims();
|
|
11452
11452
|
init_project_intelligence();
|
|
11453
|
-
init_service();
|
|
11454
11453
|
import { input, select as select2 } from "@inquirer/prompts";
|
|
11454
|
+
|
|
11455
|
+
// src/cli/ui/rag-progress.ts
|
|
11456
|
+
init_esm_shims();
|
|
11457
|
+
import chalk from "chalk";
|
|
11458
|
+
var PANEL_WIDTH = 74;
|
|
11459
|
+
function border(left, fill, right) {
|
|
11460
|
+
return `${left}${fill.repeat(PANEL_WIDTH)}${right}`;
|
|
11461
|
+
}
|
|
11462
|
+
function pad(text = "") {
|
|
11463
|
+
return ` ${text}`.padEnd(PANEL_WIDTH, " ");
|
|
11464
|
+
}
|
|
11465
|
+
function surface(text) {
|
|
11466
|
+
return chalk.hex("#FFF7ED")(text);
|
|
11467
|
+
}
|
|
11468
|
+
function accent(text) {
|
|
11469
|
+
return chalk.hex("#C2410C").bold(text);
|
|
11470
|
+
}
|
|
11471
|
+
function muted(text) {
|
|
11472
|
+
return chalk.hex("#9A6B55")(text);
|
|
11473
|
+
}
|
|
11474
|
+
function highlight(text) {
|
|
11475
|
+
return chalk.hex("#7C2D12").bold(text);
|
|
11476
|
+
}
|
|
11477
|
+
function progressText(update) {
|
|
11478
|
+
if (update.percent === void 0) {
|
|
11479
|
+
return update.message;
|
|
11480
|
+
}
|
|
11481
|
+
return `${update.percent.toString().padStart(3, " ")}% ${update.message}`;
|
|
11482
|
+
}
|
|
11483
|
+
function detectStep(update) {
|
|
11484
|
+
const message = update.message.toLowerCase();
|
|
11485
|
+
if (update.phase === "download" || update.phase === "load") {
|
|
11486
|
+
return { id: "prepare", number: 1, title: "Preparing embedding runtime" };
|
|
11487
|
+
}
|
|
11488
|
+
if (message.includes("chunking") || message.includes("chunked")) {
|
|
11489
|
+
return { id: "scan", number: 2, title: "Scanning and chunking the codebase" };
|
|
11490
|
+
}
|
|
11491
|
+
if (message.includes("embedded")) {
|
|
11492
|
+
return { id: "embed", number: 3, title: "Generating embeddings and vector data" };
|
|
11493
|
+
}
|
|
11494
|
+
return { id: "finalize", number: 4, title: "Finalizing RAG indexes and metadata" };
|
|
11495
|
+
}
|
|
11496
|
+
function renderRagIntroPanel() {
|
|
11497
|
+
const lines = [
|
|
11498
|
+
accent(border("\u2554", "\u2550", "\u2557")),
|
|
11499
|
+
accent("\u2551") + surface(pad(" OPTIONAL PROJECT INTELLIGENCE")) + accent("\u2551"),
|
|
11500
|
+
accent(border("\u2560", "\u2550", "\u2563")),
|
|
11501
|
+
accent("\u2551") + surface(pad(" Build a semantic RAG layer over this codebase.")) + accent("\u2551"),
|
|
11502
|
+
accent("\u2551") + muted(pad(" paqad-ai keeps AI suggestions relevant as files, docs, and patterns grow.")) + accent("\u2551"),
|
|
11503
|
+
accent("\u2551") + surface(pad()) + accent("\u2551"),
|
|
11504
|
+
accent("\u2551") + highlight(pad(" Retrieval-Augmented Generation (RAG) for your repo")) + accent("\u2551"),
|
|
11505
|
+
accent("\u2551") + surface(pad()) + accent("\u2551"),
|
|
11506
|
+
accent("\u2551") + muted(pad(" \u2022 Pulls the most relevant code and docs into each task")) + accent("\u2551"),
|
|
11507
|
+
accent("\u2551") + muted(pad(" \u2022 Cuts irrelevant context so prompts stay tighter and cheaper")) + accent("\u2551"),
|
|
11508
|
+
accent("\u2551") + muted(pad(" \u2022 Keeps completions grounded in your actual project structure")) + accent("\u2551"),
|
|
11509
|
+
accent(border("\u255A", "\u2550", "\u255D")),
|
|
11510
|
+
""
|
|
11511
|
+
];
|
|
11512
|
+
return lines.join("\n");
|
|
11513
|
+
}
|
|
11514
|
+
function createRagProgressReporter(write) {
|
|
11515
|
+
let lastStepId;
|
|
11516
|
+
return (update) => {
|
|
11517
|
+
const step = detectStep(update);
|
|
11518
|
+
if (step.id !== lastStepId) {
|
|
11519
|
+
write(chalk.hex("#C2410C").bold(`[${step.number}/4] ${step.title}`));
|
|
11520
|
+
lastStepId = step.id;
|
|
11521
|
+
}
|
|
11522
|
+
write(`${chalk.hex("#EA580C")(" >")} ${progressText(update)}`);
|
|
11523
|
+
};
|
|
11524
|
+
}
|
|
11525
|
+
|
|
11526
|
+
// src/onboarding/rag-onboarding.ts
|
|
11527
|
+
init_service();
|
|
11455
11528
|
function isInteractive2() {
|
|
11456
11529
|
return Boolean(process.stdout.isTTY && process.stdin.isTTY);
|
|
11457
11530
|
}
|
|
@@ -11470,19 +11543,7 @@ async function resolveRagSelection(domain, preset) {
|
|
|
11470
11543
|
if (domain !== "coding" || !isInteractive2()) {
|
|
11471
11544
|
return void 0;
|
|
11472
11545
|
}
|
|
11473
|
-
process.stdout.write(
|
|
11474
|
-
[
|
|
11475
|
-
"paqad-ai can build a RAG (Retrieval-Augmented Generation) index of your",
|
|
11476
|
-
"codebase so AI suggestions stay relevant and context-aware as your",
|
|
11477
|
-
"project grows.",
|
|
11478
|
-
"",
|
|
11479
|
-
"Why it matters:",
|
|
11480
|
-
" \xB7 Sends fewer tokens to the AI by avoiding irrelevant context",
|
|
11481
|
-
" \xB7 Retrieves the most relevant code and docs for each task",
|
|
11482
|
-
" \xB7 Keeps suggestions project-aware as the repository grows",
|
|
11483
|
-
""
|
|
11484
|
-
].join("\n")
|
|
11485
|
-
);
|
|
11546
|
+
process.stdout.write(renderRagIntroPanel());
|
|
11486
11547
|
const enabled = await select2({
|
|
11487
11548
|
message: "Want to enable this?",
|
|
11488
11549
|
choices: [
|
|
@@ -11561,16 +11622,14 @@ async function enableRagDuringOnboarding(projectRoot, ragSelection) {
|
|
|
11561
11622
|
});
|
|
11562
11623
|
service.storeApiKey(ragSelection.provider, key.trim());
|
|
11563
11624
|
}
|
|
11625
|
+
const reportProgress = createRagProgressReporter(printRagProgress);
|
|
11564
11626
|
await service.configureAndBuild(
|
|
11565
11627
|
{
|
|
11566
11628
|
rag_enabled: true,
|
|
11567
11629
|
embedding_provider: ragSelection.provider,
|
|
11568
11630
|
embedding_model: ragSelection.model ?? getDefaultEmbeddingModel(ragSelection.provider)
|
|
11569
11631
|
},
|
|
11570
|
-
|
|
11571
|
-
const prefix = update.percent !== void 0 ? `[${update.percent.toString().padStart(3, " ")}%] ` : "";
|
|
11572
|
-
printRagProgress(`${prefix}${update.message}`);
|
|
11573
|
-
}
|
|
11632
|
+
reportProgress
|
|
11574
11633
|
);
|
|
11575
11634
|
}
|
|
11576
11635
|
|
|
@@ -15365,7 +15424,7 @@ init_esm_shims();
|
|
|
15365
15424
|
init_esm_shims();
|
|
15366
15425
|
|
|
15367
15426
|
// src/index.ts
|
|
15368
|
-
var VERSION = "0.1
|
|
15427
|
+
var VERSION = "0.2.1";
|
|
15369
15428
|
|
|
15370
15429
|
// src/cli/commands/capabilities.ts
|
|
15371
15430
|
init_esm_shims();
|
|
@@ -15431,7 +15490,7 @@ import { Command as Command4 } from "commander";
|
|
|
15431
15490
|
|
|
15432
15491
|
// src/cli/ui/banner.ts
|
|
15433
15492
|
init_esm_shims();
|
|
15434
|
-
import
|
|
15493
|
+
import chalk2 from "chalk";
|
|
15435
15494
|
var ASCII = `
|
|
15436
15495
|
\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2557
|
|
15437
15496
|
\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557 \u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557 \u2588\u2588\u2554\u2550\u2550\u2550\u2588\u2588\u2557 \u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557 \u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557 \u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557 \u2588\u2588\u2551
|
|
@@ -15441,21 +15500,21 @@ var ASCII = `
|
|
|
15441
15500
|
\u255A\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u2550\u2580\u2580\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u255D
|
|
15442
15501
|
`.trimEnd();
|
|
15443
15502
|
var SLOGAN = "AI Framework \xB7 Structured. Auditable. Scalable.\nDocumentation-first AI workflows for every stack.";
|
|
15444
|
-
var
|
|
15503
|
+
var PANEL_WIDTH2 = 68;
|
|
15445
15504
|
function borderLine(left, fill, right) {
|
|
15446
|
-
return `${left}${fill.repeat(
|
|
15505
|
+
return `${left}${fill.repeat(PANEL_WIDTH2)}${right}`;
|
|
15447
15506
|
}
|
|
15448
|
-
function
|
|
15449
|
-
return ` ${text}`.padEnd(
|
|
15507
|
+
function pad2(text = "") {
|
|
15508
|
+
return ` ${text}`.padEnd(PANEL_WIDTH2, " ");
|
|
15450
15509
|
}
|
|
15451
15510
|
function claudeAccent(text) {
|
|
15452
|
-
return
|
|
15511
|
+
return chalk2.hex("#D97757").bold(text);
|
|
15453
15512
|
}
|
|
15454
15513
|
function claudeSurface(text) {
|
|
15455
|
-
return
|
|
15514
|
+
return chalk2.hex("#F5E6DA")(text);
|
|
15456
15515
|
}
|
|
15457
15516
|
function claudeMuted(text) {
|
|
15458
|
-
return
|
|
15517
|
+
return chalk2.hex("#9A6B55")(text);
|
|
15459
15518
|
}
|
|
15460
15519
|
function printBanner() {
|
|
15461
15520
|
console.log(claudeAccent(ASCII));
|
|
@@ -15465,22 +15524,22 @@ function printBanner() {
|
|
|
15465
15524
|
function printNextSteps() {
|
|
15466
15525
|
console.log();
|
|
15467
15526
|
console.log(claudeAccent(borderLine("\u2554", "\u2550", "\u2557")));
|
|
15468
|
-
console.log(claudeAccent("\u2551") + claudeSurface(
|
|
15527
|
+
console.log(claudeAccent("\u2551") + claudeSurface(pad2(" ONBOARDING COMPLETE")) + claudeAccent("\u2551"));
|
|
15469
15528
|
console.log(claudeAccent(borderLine("\u2560", "\u2550", "\u2563")));
|
|
15470
|
-
console.log(claudeAccent("\u2551") + claudeSurface(
|
|
15529
|
+
console.log(claudeAccent("\u2551") + claudeSurface(pad2()) + claudeAccent("\u2551"));
|
|
15471
15530
|
console.log(
|
|
15472
|
-
claudeAccent("\u2551") + claudeSurface(
|
|
15531
|
+
claudeAccent("\u2551") + claudeSurface(pad2(" NEXT STEP: run `create documentation` before feature work.")) + claudeAccent("\u2551")
|
|
15473
15532
|
);
|
|
15474
|
-
console.log(claudeAccent("\u2551") + claudeSurface(
|
|
15533
|
+
console.log(claudeAccent("\u2551") + claudeSurface(pad2()) + claudeAccent("\u2551"));
|
|
15475
15534
|
console.log(
|
|
15476
|
-
claudeAccent("\u2551") +
|
|
15535
|
+
claudeAccent("\u2551") + chalk2.hex("#B45309").bold(pad2(" create documentation")) + claudeAccent("\u2551")
|
|
15477
15536
|
);
|
|
15478
|
-
console.log(claudeAccent("\u2551") + claudeSurface(
|
|
15537
|
+
console.log(claudeAccent("\u2551") + claudeSurface(pad2()) + claudeAccent("\u2551"));
|
|
15479
15538
|
console.log(
|
|
15480
|
-
claudeAccent("\u2551") + claudeMuted(
|
|
15539
|
+
claudeAccent("\u2551") + claudeMuted(pad2(" Generates module docs, stack docs, and architecture context.")) + claudeAccent("\u2551")
|
|
15481
15540
|
);
|
|
15482
15541
|
console.log(
|
|
15483
|
-
claudeAccent("\u2551") + claudeMuted(
|
|
15542
|
+
claudeAccent("\u2551") + claudeMuted(pad2(" A matching `.paqad/next-steps.md` file is written for agent pickup.")) + claudeAccent("\u2551")
|
|
15484
15543
|
);
|
|
15485
15544
|
console.log(claudeAccent(borderLine("\u255A", "\u2550", "\u255D")));
|
|
15486
15545
|
console.log();
|
|
@@ -15872,10 +15931,7 @@ function printProgress(message) {
|
|
|
15872
15931
|
process.stderr.write(`${message}
|
|
15873
15932
|
`);
|
|
15874
15933
|
}
|
|
15875
|
-
|
|
15876
|
-
const prefix = update.percent !== void 0 ? `[${update.percent.toString().padStart(3, " ")}%] ` : "";
|
|
15877
|
-
printProgress(`${prefix}${update.message}`);
|
|
15878
|
-
}
|
|
15934
|
+
var progressPrinter = createRagProgressReporter(printProgress);
|
|
15879
15935
|
async function resolveProvider(explicit, current) {
|
|
15880
15936
|
if (explicit && EMBEDDING_PROVIDERS.includes(explicit)) {
|
|
15881
15937
|
return explicit;
|