MCPcopy
hub / github.com/github/awesome-copilot / getSectionGuide

Function getSectionGuide

extensions/site-studio/extension.mjs:769–786  ·  view source on GitHub ↗
(sectionId)

Source from the content-addressed store, hash-verified

767}
768
769function getSectionGuide(sectionId) {
770 const section = findSectionOrThrow(sectionId);
771 const templates = getFieldSuggestionsForSection(section.id);
772 const missingFields = templates
773 .map((item) => item.field)
774 .filter((field) => {
775 const value = section.content?.[field];
776 return !safeString(value).trim() || isSamplePlaceholder(value);
777 });
778 return {
779 sectionId: section.id,
780 sectionName: section.name,
781 suggestedFields: templates,
782 fieldSchemas: stateCache.sectionSchemas?.[section.id] || {},
783 missingFields,
784 nextSuggestedQuestion: templates.find((item) => missingFields.includes(item.field))?.prompt ?? null,
785 };
786}
787
788function detectSectionIdFromPrompt(prompt) {
789 const normalized = prompt.toLowerCase();

Callers 1

extension.mjsFile · 0.85

Calls 4

findSectionOrThrowFunction · 0.85
safeStringFunction · 0.85
isSamplePlaceholderFunction · 0.85

Tested by

no test coverage detected