@kimbho/kimbho-cli 0.1.19 → 0.1.20
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/index.cjs +374 -3
- package/dist/index.cjs.map +3 -3
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -10612,7 +10612,7 @@ var {
|
|
|
10612
10612
|
// package.json
|
|
10613
10613
|
var package_default = {
|
|
10614
10614
|
name: "@kimbho/kimbho-cli",
|
|
10615
|
-
version: "0.1.
|
|
10615
|
+
version: "0.1.20",
|
|
10616
10616
|
description: "Kimbho CLI is a terminal-native coding agent for planning, execution, and verification.",
|
|
10617
10617
|
type: "module",
|
|
10618
10618
|
engines: {
|
|
@@ -18348,6 +18348,135 @@ function inferVisualAdjustment(goal) {
|
|
|
18348
18348
|
function looksLikeVisualAdjustmentGoal(value) {
|
|
18349
18349
|
return inferVisualAdjustment(value) !== null;
|
|
18350
18350
|
}
|
|
18351
|
+
function inferSupplementalPages(goal, kind) {
|
|
18352
|
+
const normalized = goal.toLowerCase();
|
|
18353
|
+
const requestSignals = [
|
|
18354
|
+
"add more pages",
|
|
18355
|
+
"add pages",
|
|
18356
|
+
"more pages",
|
|
18357
|
+
"new pages",
|
|
18358
|
+
"new page",
|
|
18359
|
+
"additional pages",
|
|
18360
|
+
"additional page"
|
|
18361
|
+
];
|
|
18362
|
+
const requested = /* @__PURE__ */ new Set();
|
|
18363
|
+
const specificPageSignals = [
|
|
18364
|
+
["about", "about"],
|
|
18365
|
+
["contact", "contact"],
|
|
18366
|
+
["archive", "archive"],
|
|
18367
|
+
["journal", "journal"],
|
|
18368
|
+
["stories", "stories"],
|
|
18369
|
+
["story", "story"],
|
|
18370
|
+
["menu", "menu"],
|
|
18371
|
+
["reservation", "reservations"],
|
|
18372
|
+
["reservations", "reservations"],
|
|
18373
|
+
["shop", "shop"],
|
|
18374
|
+
["services", "services"]
|
|
18375
|
+
];
|
|
18376
|
+
for (const [signal, slug] of specificPageSignals) {
|
|
18377
|
+
if (normalized.includes(signal)) {
|
|
18378
|
+
requested.add(slug);
|
|
18379
|
+
}
|
|
18380
|
+
}
|
|
18381
|
+
const isPageExpansionRequest = requested.size > 0 || requestSignals.some((signal) => normalized.includes(signal));
|
|
18382
|
+
if (!isPageExpansionRequest) {
|
|
18383
|
+
return null;
|
|
18384
|
+
}
|
|
18385
|
+
if (requested.size === 0) {
|
|
18386
|
+
if (kind === "blog") {
|
|
18387
|
+
requested.add("about");
|
|
18388
|
+
requested.add("archive");
|
|
18389
|
+
requested.add("contact");
|
|
18390
|
+
} else if (kind === "restaurant") {
|
|
18391
|
+
requested.add("menu");
|
|
18392
|
+
requested.add("story");
|
|
18393
|
+
requested.add("reservations");
|
|
18394
|
+
} else if (kind === "storefront") {
|
|
18395
|
+
requested.add("shop");
|
|
18396
|
+
requested.add("story");
|
|
18397
|
+
requested.add("contact");
|
|
18398
|
+
} else {
|
|
18399
|
+
requested.add("about");
|
|
18400
|
+
requested.add("services");
|
|
18401
|
+
requested.add("contact");
|
|
18402
|
+
}
|
|
18403
|
+
}
|
|
18404
|
+
const copyBySlug = {
|
|
18405
|
+
about: {
|
|
18406
|
+
title: "About",
|
|
18407
|
+
eyebrow: "Studio notes",
|
|
18408
|
+
lede: "A calmer overview of the people, perspective, and intent behind the project.",
|
|
18409
|
+
body: "Use this page to explain what the site stands for, who it is for, and why the work matters. Keep it human and specific."
|
|
18410
|
+
},
|
|
18411
|
+
contact: {
|
|
18412
|
+
title: "Contact",
|
|
18413
|
+
eyebrow: "Get in touch",
|
|
18414
|
+
lede: "A simple route for collaborations, questions, bookings, or thoughtful replies.",
|
|
18415
|
+
body: "Replace this copy with the right contact method, social links, newsletter details, or inquiry instructions."
|
|
18416
|
+
},
|
|
18417
|
+
archive: {
|
|
18418
|
+
title: "Archive",
|
|
18419
|
+
eyebrow: "Browse the back catalog",
|
|
18420
|
+
lede: "A clean index for essays, notes, dispatches, and the posts worth resurfacing.",
|
|
18421
|
+
body: "Turn this into a chronological archive, tag explorer, or featured reading list as the site grows."
|
|
18422
|
+
},
|
|
18423
|
+
journal: {
|
|
18424
|
+
title: "Journal",
|
|
18425
|
+
eyebrow: "Field notes",
|
|
18426
|
+
lede: "A lighter-weight stream for updates, drafts, studio notes, and ongoing experiments.",
|
|
18427
|
+
body: "Use this page for smaller entries that do not need the weight of longform essays."
|
|
18428
|
+
},
|
|
18429
|
+
stories: {
|
|
18430
|
+
title: "Stories",
|
|
18431
|
+
eyebrow: "Featured writing",
|
|
18432
|
+
lede: "A front door for standout essays, case studies, or narrative pieces.",
|
|
18433
|
+
body: "Pull your strongest writing forward here so visitors can quickly see the tone and quality of the work."
|
|
18434
|
+
},
|
|
18435
|
+
story: {
|
|
18436
|
+
title: "Our Story",
|
|
18437
|
+
eyebrow: "Behind the project",
|
|
18438
|
+
lede: "A richer page for origin, process, values, and the details that build trust.",
|
|
18439
|
+
body: "Tell the story behind the brand or studio in a way that feels personal instead of corporate."
|
|
18440
|
+
},
|
|
18441
|
+
menu: {
|
|
18442
|
+
title: "Menu",
|
|
18443
|
+
eyebrow: "Current offerings",
|
|
18444
|
+
lede: "A dedicated place for featured dishes, seasonal highlights, and signature favorites.",
|
|
18445
|
+
body: "Replace this with menu sections, tasting notes, pricing context, and dietary guidance."
|
|
18446
|
+
},
|
|
18447
|
+
reservations: {
|
|
18448
|
+
title: "Reservations",
|
|
18449
|
+
eyebrow: "Plan your visit",
|
|
18450
|
+
lede: "A conversion-focused page for table bookings, group dining, and private events.",
|
|
18451
|
+
body: "Use this space for booking links, service windows, cancellation policy, and special-event details."
|
|
18452
|
+
},
|
|
18453
|
+
shop: {
|
|
18454
|
+
title: "Shop",
|
|
18455
|
+
eyebrow: "Browse the collection",
|
|
18456
|
+
lede: "A tighter landing point for products, drops, featured items, or curated collections.",
|
|
18457
|
+
body: "Turn this into a product grid, collection overview, or conversion path into your checkout flow."
|
|
18458
|
+
},
|
|
18459
|
+
services: {
|
|
18460
|
+
title: "Services",
|
|
18461
|
+
eyebrow: "What we do",
|
|
18462
|
+
lede: "A practical overview of offers, engagements, deliverables, and working style.",
|
|
18463
|
+
body: "Use this page to clarify the services, retainers, or project formats you want visitors to understand."
|
|
18464
|
+
}
|
|
18465
|
+
};
|
|
18466
|
+
return Array.from(requested).map((slug) => {
|
|
18467
|
+
const resolved = copyBySlug[slug] ?? copyBySlug.about;
|
|
18468
|
+
return {
|
|
18469
|
+
slug,
|
|
18470
|
+
title: resolved.title,
|
|
18471
|
+
eyebrow: resolved.eyebrow,
|
|
18472
|
+
lede: resolved.lede,
|
|
18473
|
+
body: resolved.body
|
|
18474
|
+
};
|
|
18475
|
+
});
|
|
18476
|
+
}
|
|
18477
|
+
function looksLikePageExpansionGoal(value) {
|
|
18478
|
+
return inferSupplementalPages(value, inferLandingKind(value)) !== null;
|
|
18479
|
+
}
|
|
18351
18480
|
function looksLikeStaticLandingGoal(value) {
|
|
18352
18481
|
const normalized = value.toLowerCase();
|
|
18353
18482
|
const backendSignals = [
|
|
@@ -18409,6 +18538,9 @@ function looksLikeStaticLandingGoal(value) {
|
|
|
18409
18538
|
if (looksLikeVisualAdjustmentGoal(normalized) && !backendSignals.some((signal) => normalized.includes(signal))) {
|
|
18410
18539
|
return true;
|
|
18411
18540
|
}
|
|
18541
|
+
if (looksLikePageExpansionGoal(normalized) && !backendSignals.some((signal) => normalized.includes(signal))) {
|
|
18542
|
+
return true;
|
|
18543
|
+
}
|
|
18412
18544
|
return false;
|
|
18413
18545
|
}
|
|
18414
18546
|
function sanitizeName(value) {
|
|
@@ -18611,6 +18743,195 @@ function renderNextLandingPage(title, content) {
|
|
|
18611
18743
|
function renderPagesRouterLandingPage(title, content) {
|
|
18612
18744
|
return renderNextLandingPage(title, content);
|
|
18613
18745
|
}
|
|
18746
|
+
function renderNextSupplementalPage(siteTitle, page) {
|
|
18747
|
+
return [
|
|
18748
|
+
`const siteTitle = ${JSON.stringify(siteTitle)};`,
|
|
18749
|
+
`const pageTitle = ${JSON.stringify(page.title)};`,
|
|
18750
|
+
"",
|
|
18751
|
+
"export default function SupplementalPage() {",
|
|
18752
|
+
" return (",
|
|
18753
|
+
" <main",
|
|
18754
|
+
" style={{",
|
|
18755
|
+
" minHeight: '100vh',",
|
|
18756
|
+
" background: 'linear-gradient(180deg, #fffaf2 0%, #f4ede2 100%)',",
|
|
18757
|
+
" color: '#1f1812',",
|
|
18758
|
+
` fontFamily: "Georgia, 'Times New Roman', serif"`,
|
|
18759
|
+
" }}",
|
|
18760
|
+
" >",
|
|
18761
|
+
" <section style={{ maxWidth: 920, margin: '0 auto', padding: '72px 20px 96px' }}>",
|
|
18762
|
+
` <p style={{ textTransform: 'uppercase', letterSpacing: '0.18em', fontSize: 12, color: '#9b5c34', margin: 0 }}>{${JSON.stringify(page.eyebrow)}}</p>`,
|
|
18763
|
+
" <h1 style={{ fontSize: 'clamp(2.8rem, 7vw, 4.8rem)', lineHeight: 0.95, margin: '16px 0 18px' }}>{pageTitle}</h1>",
|
|
18764
|
+
` <p style={{ maxWidth: 680, lineHeight: 1.7, fontSize: '1.08rem', color: '#46372d', margin: 0 }}>{${JSON.stringify(page.lede)}}</p>`,
|
|
18765
|
+
" <section",
|
|
18766
|
+
" style={{",
|
|
18767
|
+
" marginTop: 28,",
|
|
18768
|
+
" background: 'rgba(255,255,255,0.82)',",
|
|
18769
|
+
" border: '1px solid rgba(31,24,18,0.12)',",
|
|
18770
|
+
" borderRadius: 28,",
|
|
18771
|
+
" padding: 28,",
|
|
18772
|
+
" boxShadow: '0 18px 40px rgba(31,24,18,0.06)'",
|
|
18773
|
+
" }}",
|
|
18774
|
+
" >",
|
|
18775
|
+
` <p style={{ marginTop: 0, marginBottom: 0, lineHeight: 1.75, color: '#56453a' }}>{${JSON.stringify(page.body)}}</p>`,
|
|
18776
|
+
" </section>",
|
|
18777
|
+
" <div style={{ display: 'flex', gap: 12, flexWrap: 'wrap', marginTop: 28 }}>",
|
|
18778
|
+
" <a href='/' style={{ background: '#c96f3b', color: '#fff', padding: '14px 20px', borderRadius: 999, textDecoration: 'none', fontWeight: 700 }}>Back home</a>",
|
|
18779
|
+
" <span style={{ alignSelf: 'center', color: '#7b6659' }}>{siteTitle}</span>",
|
|
18780
|
+
" </div>",
|
|
18781
|
+
" </section>",
|
|
18782
|
+
" </main>",
|
|
18783
|
+
" );",
|
|
18784
|
+
"}"
|
|
18785
|
+
].join("\n");
|
|
18786
|
+
}
|
|
18787
|
+
function renderStaticSupplementalPage(siteTitle, page) {
|
|
18788
|
+
return [
|
|
18789
|
+
"<!doctype html>",
|
|
18790
|
+
'<html lang="en">',
|
|
18791
|
+
" <head>",
|
|
18792
|
+
' <meta charset="UTF-8" />',
|
|
18793
|
+
' <meta name="viewport" content="width=device-width, initial-scale=1.0" />',
|
|
18794
|
+
` <title>${page.title} | ${siteTitle}</title>`,
|
|
18795
|
+
' <link rel="stylesheet" href="./styles.css" />',
|
|
18796
|
+
" </head>",
|
|
18797
|
+
" <body>",
|
|
18798
|
+
' <main class="shell">',
|
|
18799
|
+
' <section class="hero">',
|
|
18800
|
+
` <p class="eyebrow">${page.eyebrow}</p>`,
|
|
18801
|
+
` <h1>${page.title}</h1>`,
|
|
18802
|
+
` <p class="lede">${page.lede}</p>`,
|
|
18803
|
+
" </section>",
|
|
18804
|
+
' <section class="story">',
|
|
18805
|
+
` <p>${page.body}</p>`,
|
|
18806
|
+
" </section>",
|
|
18807
|
+
' <div class="actions">',
|
|
18808
|
+
' <a href="./index.html" class="button primary">Back home</a>',
|
|
18809
|
+
` <a href="./index.html" class="button secondary">${siteTitle}</a>`,
|
|
18810
|
+
" </div>",
|
|
18811
|
+
" </main>",
|
|
18812
|
+
" </body>",
|
|
18813
|
+
"</html>"
|
|
18814
|
+
].join("\n");
|
|
18815
|
+
}
|
|
18816
|
+
async function inferExistingSiteTitle(cwd, target, fallbackTitle) {
|
|
18817
|
+
const source = await (0, import_promises10.readFile)(import_node_path10.default.join(cwd, target.pagePath), "utf8");
|
|
18818
|
+
const constantMatch = source.match(/const\s+title\s*=\s*["'`](.+?)["'`]/);
|
|
18819
|
+
if (constantMatch?.[1]) {
|
|
18820
|
+
return constantMatch[1];
|
|
18821
|
+
}
|
|
18822
|
+
const headingMatch = source.match(/<h1[^>]*>\s*([^<]+?)\s*<\/h1>/);
|
|
18823
|
+
if (headingMatch?.[1]) {
|
|
18824
|
+
return headingMatch[1];
|
|
18825
|
+
}
|
|
18826
|
+
return fallbackTitle;
|
|
18827
|
+
}
|
|
18828
|
+
function insertNextPageLinks(source, pages) {
|
|
18829
|
+
if (pages.every((page) => source.includes(`href='/${page.slug}'`) || source.includes(`href="/${page.slug}"`))) {
|
|
18830
|
+
return source;
|
|
18831
|
+
}
|
|
18832
|
+
const block = [
|
|
18833
|
+
" <section style={{ marginTop: 26, display: 'grid', gridTemplateColumns: 'repeat(auto-fit, minmax(180px, 1fr))', gap: 14 }}>",
|
|
18834
|
+
...pages.map((page) => ` <a href='/${page.slug}' style={{ display: 'block', textDecoration: 'none', padding: '18px 20px', borderRadius: 22, background: 'rgba(255,255,255,0.82)', border: '1px solid rgba(31,24,18,0.1)', color: '#1f1812', boxShadow: '0 14px 32px rgba(31,24,18,0.05)' }}><strong>${page.title}</strong><br /><span style={{ color: '#6c5a4e' }}>Explore ${page.title.toLowerCase()}.</span></a>`),
|
|
18835
|
+
" </section>"
|
|
18836
|
+
].join("\n");
|
|
18837
|
+
if (source.includes("</main>")) {
|
|
18838
|
+
return source.replace(/(\s*)<\/main>/, `
|
|
18839
|
+
${block}
|
|
18840
|
+
$1</main>`);
|
|
18841
|
+
}
|
|
18842
|
+
return source;
|
|
18843
|
+
}
|
|
18844
|
+
function insertStaticPageLinks(source, pages) {
|
|
18845
|
+
if (pages.every((page) => source.includes(`./${page.slug}.html`) || source.includes(`"${page.slug}.html"`))) {
|
|
18846
|
+
return source;
|
|
18847
|
+
}
|
|
18848
|
+
const block = [
|
|
18849
|
+
' <section class="grid">',
|
|
18850
|
+
...pages.map((page) => ` <article class="card"><h2>${page.title}</h2><p>${page.lede}</p><a class="button secondary" href="./${page.slug}.html">Open ${page.title}</a></article>`),
|
|
18851
|
+
" </section>"
|
|
18852
|
+
].join("\n");
|
|
18853
|
+
if (source.includes("</main>")) {
|
|
18854
|
+
return source.replace(/(\s*)<\/main>/, `
|
|
18855
|
+
${block}
|
|
18856
|
+
$1</main>`);
|
|
18857
|
+
}
|
|
18858
|
+
return source;
|
|
18859
|
+
}
|
|
18860
|
+
async function applyExistingStaticPageExpansion(cwd, goal, target) {
|
|
18861
|
+
const pages = inferSupplementalPages(goal, inferLandingKind(goal));
|
|
18862
|
+
if (!pages) {
|
|
18863
|
+
return null;
|
|
18864
|
+
}
|
|
18865
|
+
const projectName = inferProjectName(goal, cwd);
|
|
18866
|
+
const siteTitle = await inferExistingSiteTitle(cwd, target, inferLandingTitle(goal, projectName));
|
|
18867
|
+
const files = {};
|
|
18868
|
+
const artifacts = [];
|
|
18869
|
+
let createdPages = 0;
|
|
18870
|
+
if (target.kind === "next-app") {
|
|
18871
|
+
for (const page of pages) {
|
|
18872
|
+
const relativePath = `src/app/${page.slug}/page.tsx`;
|
|
18873
|
+
const absolutePath = import_node_path10.default.join(cwd, relativePath);
|
|
18874
|
+
if (!await pathExists(absolutePath)) {
|
|
18875
|
+
files[relativePath] = renderNextSupplementalPage(siteTitle, page);
|
|
18876
|
+
createdPages += 1;
|
|
18877
|
+
}
|
|
18878
|
+
artifacts.push(absolutePath);
|
|
18879
|
+
}
|
|
18880
|
+
const currentSource = await (0, import_promises10.readFile)(import_node_path10.default.join(cwd, target.pagePath), "utf8");
|
|
18881
|
+
const nextSource = insertNextPageLinks(currentSource, pages);
|
|
18882
|
+
if (nextSource !== currentSource) {
|
|
18883
|
+
files[target.pagePath] = nextSource;
|
|
18884
|
+
}
|
|
18885
|
+
} else if (target.kind === "next-pages") {
|
|
18886
|
+
for (const page of pages) {
|
|
18887
|
+
const relativePath = `src/pages/${page.slug}.tsx`;
|
|
18888
|
+
const absolutePath = import_node_path10.default.join(cwd, relativePath);
|
|
18889
|
+
if (!await pathExists(absolutePath)) {
|
|
18890
|
+
files[relativePath] = renderNextSupplementalPage(siteTitle, page);
|
|
18891
|
+
createdPages += 1;
|
|
18892
|
+
}
|
|
18893
|
+
artifacts.push(absolutePath);
|
|
18894
|
+
}
|
|
18895
|
+
const currentSource = await (0, import_promises10.readFile)(import_node_path10.default.join(cwd, target.pagePath), "utf8");
|
|
18896
|
+
const nextSource = insertNextPageLinks(currentSource, pages);
|
|
18897
|
+
if (nextSource !== currentSource) {
|
|
18898
|
+
files[target.pagePath] = nextSource;
|
|
18899
|
+
}
|
|
18900
|
+
} else {
|
|
18901
|
+
for (const page of pages) {
|
|
18902
|
+
const relativePath = `${page.slug}.html`;
|
|
18903
|
+
const absolutePath = import_node_path10.default.join(cwd, relativePath);
|
|
18904
|
+
if (!await pathExists(absolutePath)) {
|
|
18905
|
+
files[relativePath] = renderStaticSupplementalPage(siteTitle, page);
|
|
18906
|
+
createdPages += 1;
|
|
18907
|
+
}
|
|
18908
|
+
artifacts.push(absolutePath);
|
|
18909
|
+
}
|
|
18910
|
+
const currentSource = await (0, import_promises10.readFile)(import_node_path10.default.join(cwd, target.pagePath), "utf8");
|
|
18911
|
+
const nextSource = insertStaticPageLinks(currentSource, pages);
|
|
18912
|
+
if (nextSource !== currentSource) {
|
|
18913
|
+
files[target.pagePath] = nextSource;
|
|
18914
|
+
}
|
|
18915
|
+
}
|
|
18916
|
+
const writtenArtifacts = Object.keys(files).length > 0 ? await writeFiles(cwd, files) : [];
|
|
18917
|
+
if (createdPages === 0 && writtenArtifacts.length === 0) {
|
|
18918
|
+
return {
|
|
18919
|
+
preset: "static-landing",
|
|
18920
|
+
projectName,
|
|
18921
|
+
summary: `Confirmed the requested pages already exist: ${pages.map((page) => page.title).join(", ")}.`,
|
|
18922
|
+
artifacts: artifacts.sort((left, right) => left.localeCompare(right))
|
|
18923
|
+
};
|
|
18924
|
+
}
|
|
18925
|
+
return {
|
|
18926
|
+
preset: "static-landing",
|
|
18927
|
+
projectName,
|
|
18928
|
+
summary: `Added ${createdPages > 0 ? createdPages : pages.length} supplemental page${(createdPages > 0 ? createdPages : pages.length) === 1 ? "" : "s"}: ${pages.map((page) => page.title).join(", ")}.`,
|
|
18929
|
+
artifacts: Array.from(/* @__PURE__ */ new Set([
|
|
18930
|
+
...artifacts,
|
|
18931
|
+
...writtenArtifacts
|
|
18932
|
+
])).sort((left, right) => left.localeCompare(right))
|
|
18933
|
+
};
|
|
18934
|
+
}
|
|
18614
18935
|
async function detectExistingStaticTarget(cwd) {
|
|
18615
18936
|
const nextAppPage = import_node_path10.default.join(cwd, "src/app/page.tsx");
|
|
18616
18937
|
if (await pathExists(nextAppPage)) {
|
|
@@ -18702,6 +19023,10 @@ async function applyExistingStaticVisualAdjustment(cwd, goal, target) {
|
|
|
18702
19023
|
return null;
|
|
18703
19024
|
}
|
|
18704
19025
|
async function adaptExistingStaticLanding(cwd, projectName, goal, target) {
|
|
19026
|
+
const pageExpansionResult = await applyExistingStaticPageExpansion(cwd, goal, target);
|
|
19027
|
+
if (pageExpansionResult) {
|
|
19028
|
+
return pageExpansionResult;
|
|
19029
|
+
}
|
|
18705
19030
|
const adjustedResult = await applyExistingStaticVisualAdjustment(cwd, goal, target);
|
|
18706
19031
|
if (adjustedResult) {
|
|
18707
19032
|
return adjustedResult;
|
|
@@ -19495,7 +19820,7 @@ function isVerificationShellCommand(command) {
|
|
|
19495
19820
|
return VERIFICATION_SHELL_PREFIXES.some((prefix) => normalized === prefix || normalized.startsWith(`${prefix} `));
|
|
19496
19821
|
}
|
|
19497
19822
|
function isLowRiskScaffoldRequest(input) {
|
|
19498
|
-
return input.preset === "static-landing" && typeof input.goal === "string" && looksLikeVisualAdjustmentGoal(input.goal);
|
|
19823
|
+
return input.preset === "static-landing" && typeof input.goal === "string" && (looksLikeVisualAdjustmentGoal(input.goal) || looksLikePageExpansionGoal(input.goal));
|
|
19499
19824
|
}
|
|
19500
19825
|
function isDestructiveShellCommand(command) {
|
|
19501
19826
|
return DESTRUCTIVE_SHELL_PATTERNS.some((pattern) => pattern.test(command));
|
|
@@ -29408,6 +29733,49 @@ function looksLikeVisualAdjustmentGoal2(goal) {
|
|
|
29408
29733
|
}
|
|
29409
29734
|
return editSignals.some((signal) => lower.includes(signal)) && visualSignals.some((signal) => lower.includes(signal)) && (pageContextSignals.some((signal) => lower.includes(signal)) || lower.includes("background"));
|
|
29410
29735
|
}
|
|
29736
|
+
function looksLikePageExpansionGoal2(goal) {
|
|
29737
|
+
const lower = goal.toLowerCase();
|
|
29738
|
+
const backendSignals = [
|
|
29739
|
+
"api",
|
|
29740
|
+
"database",
|
|
29741
|
+
"backend",
|
|
29742
|
+
"server",
|
|
29743
|
+
"migration",
|
|
29744
|
+
"schema",
|
|
29745
|
+
"prisma",
|
|
29746
|
+
"postgres",
|
|
29747
|
+
"sqlite",
|
|
29748
|
+
"auth",
|
|
29749
|
+
"billing",
|
|
29750
|
+
"webhook"
|
|
29751
|
+
];
|
|
29752
|
+
const directSignals = [
|
|
29753
|
+
"add more pages",
|
|
29754
|
+
"add pages",
|
|
29755
|
+
"more pages",
|
|
29756
|
+
"new pages",
|
|
29757
|
+
"new page",
|
|
29758
|
+
"additional pages",
|
|
29759
|
+
"additional page"
|
|
29760
|
+
];
|
|
29761
|
+
const namedPages = [
|
|
29762
|
+
"about",
|
|
29763
|
+
"contact",
|
|
29764
|
+
"archive",
|
|
29765
|
+
"journal",
|
|
29766
|
+
"stories",
|
|
29767
|
+
"story",
|
|
29768
|
+
"menu",
|
|
29769
|
+
"reservation",
|
|
29770
|
+
"reservations",
|
|
29771
|
+
"shop",
|
|
29772
|
+
"services"
|
|
29773
|
+
];
|
|
29774
|
+
if (backendSignals.some((signal) => lower.includes(signal))) {
|
|
29775
|
+
return false;
|
|
29776
|
+
}
|
|
29777
|
+
return directSignals.some((signal) => lower.includes(signal)) || (lower.includes("add") || lower.includes("create") || lower.includes("make")) && lower.includes("page") && namedPages.some((name) => lower.includes(name));
|
|
29778
|
+
}
|
|
29411
29779
|
function looksLikeStaticSiteGoal(goal) {
|
|
29412
29780
|
const lower = goal.toLowerCase();
|
|
29413
29781
|
const backendSignals = [
|
|
@@ -29469,6 +29837,9 @@ function looksLikeStaticSiteGoal(goal) {
|
|
|
29469
29837
|
if (looksLikeVisualAdjustmentGoal2(lower)) {
|
|
29470
29838
|
return true;
|
|
29471
29839
|
}
|
|
29840
|
+
if (looksLikePageExpansionGoal2(lower)) {
|
|
29841
|
+
return true;
|
|
29842
|
+
}
|
|
29472
29843
|
return false;
|
|
29473
29844
|
}
|
|
29474
29845
|
function inferProjectShape(goal) {
|
|
@@ -31386,7 +31757,7 @@ function isStaticSiteTask(task, request) {
|
|
|
31386
31757
|
return task.filesLikelyTouched.some((filePath) => filePath === "src/app/page.tsx" || filePath === "src/app/layout.tsx" || filePath === "src/pages/index.tsx" || filePath === "index.html" || filePath === "styles.css");
|
|
31387
31758
|
}
|
|
31388
31759
|
function shouldDelegateTask(task, request) {
|
|
31389
|
-
if (looksLikeVisualAdjustmentGoal(request.goal) && isStaticSiteTask(task, request)) {
|
|
31760
|
+
if ((looksLikeVisualAdjustmentGoal(request.goal) || looksLikePageExpansionGoal(request.goal)) && isStaticSiteTask(task, request)) {
|
|
31390
31761
|
return false;
|
|
31391
31762
|
}
|
|
31392
31763
|
return (task.swarmDepth ?? 0) === 0 && task.type === "implementation" && ![
|