@shahmarasy/prodo 0.1.5 → 0.1.7

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.
Files changed (69) hide show
  1. package/dist/agents/system-prompts.js +12 -12
  2. package/dist/cli/agent-command-installer.d.ts +1 -1
  3. package/dist/cli/agent-command-installer.js +125 -19
  4. package/dist/cli/doctor.js +2 -2
  5. package/dist/cli/index.js +32 -30
  6. package/dist/cli/init-tui.d.ts +2 -2
  7. package/dist/cli/init-tui.js +43 -36
  8. package/dist/cli/init.d.ts +1 -0
  9. package/dist/cli/init.js +3 -2
  10. package/dist/core/artifacts.js +72 -72
  11. package/dist/core/settings.d.ts +1 -0
  12. package/dist/core/settings.js +10 -2
  13. package/dist/core/templates.js +248 -248
  14. package/dist/i18n/en.json +45 -45
  15. package/dist/i18n/tr.json +45 -45
  16. package/dist/providers/mock-provider.js +5 -5
  17. package/dist/providers/openai-provider.js +12 -12
  18. package/dist/skill-engine/context.d.ts +7 -0
  19. package/dist/skill-engine/context.js +76 -0
  20. package/dist/skill-engine/discovery.d.ts +2 -0
  21. package/dist/skill-engine/discovery.js +52 -0
  22. package/dist/skill-engine/graph.d.ts +4 -0
  23. package/dist/skill-engine/graph.js +114 -0
  24. package/dist/skill-engine/index.d.ts +11 -0
  25. package/dist/skill-engine/index.js +49 -0
  26. package/dist/skill-engine/pipeline.d.ts +9 -0
  27. package/dist/skill-engine/pipeline.js +84 -0
  28. package/dist/skill-engine/registry.d.ts +12 -0
  29. package/dist/skill-engine/registry.js +74 -0
  30. package/dist/skill-engine/types.d.ts +66 -0
  31. package/dist/skill-engine/types.js +2 -0
  32. package/dist/skill-engine/validator.d.ts +4 -0
  33. package/dist/skill-engine/validator.js +90 -0
  34. package/dist/skills/fix.d.ts +2 -0
  35. package/dist/skills/fix.js +41 -0
  36. package/dist/skills/generate-artifact.d.ts +2 -0
  37. package/dist/skills/generate-artifact.js +42 -0
  38. package/dist/skills/normalize.d.ts +2 -0
  39. package/dist/skills/normalize.js +29 -0
  40. package/dist/skills/register-core.d.ts +2 -0
  41. package/dist/skills/register-core.js +21 -0
  42. package/dist/skills/validate.d.ts +2 -0
  43. package/dist/skills/validate.js +37 -0
  44. package/package.json +4 -6
  45. package/src/cli/agent-command-installer.ts +115 -1
  46. package/src/cli/doctor.ts +2 -2
  47. package/src/cli/index.ts +35 -31
  48. package/src/cli/init-tui.ts +220 -208
  49. package/src/cli/init.ts +4 -3
  50. package/src/core/settings.ts +41 -35
  51. package/src/skill-engine/context.ts +90 -0
  52. package/src/skill-engine/discovery.ts +57 -0
  53. package/src/skill-engine/graph.ts +136 -0
  54. package/src/skill-engine/index.ts +55 -0
  55. package/src/skill-engine/pipeline.ts +112 -0
  56. package/src/skill-engine/registry.ts +75 -0
  57. package/src/skill-engine/types.ts +81 -0
  58. package/src/skill-engine/validator.ts +135 -0
  59. package/src/skills/fix.ts +45 -0
  60. package/src/skills/generate-artifact.ts +48 -0
  61. package/src/skills/{normalize-skill.ts → normalize.ts} +15 -12
  62. package/src/skills/register-core.ts +27 -0
  63. package/src/skills/validate.ts +40 -0
  64. package/src/skills/engine.ts +0 -94
  65. package/src/skills/fix-skill.ts +0 -38
  66. package/src/skills/generate-artifact-skill.ts +0 -32
  67. package/src/skills/generate-pipeline-skill.ts +0 -49
  68. package/src/skills/types.ts +0 -36
  69. package/src/skills/validate-skill.ts +0 -29
@@ -311,62 +311,62 @@ function renderWorkflowMarkdownForFeature(markdown, feature, lang) {
311
311
  }
312
312
  async function resolvePrompt(cwd, artifactType, templateContent, requiredHeadings, companionTemplate, outputAuthor, agent) {
313
313
  const base = await promises_1.default.readFile((0, paths_1.promptPath)(cwd, artifactType), "utf8");
314
- const authority = `Template authority (STRICT):
315
- - Treat this template as the single output structure source.
316
- - Keep heading order and names exactly as listed.
317
- - Do not invent new primary sections.
318
-
319
- Required headings (from template):
320
- ${requiredHeadings.map((heading) => `- ${heading}`).join("\n")}
321
-
322
- Resolved template:
323
- \`\`\`md
324
- ${templateContent.trim()}
314
+ const authority = `Template authority (STRICT):
315
+ - Treat this template as the single output structure source.
316
+ - Keep heading order and names exactly as listed.
317
+ - Do not invent new primary sections.
318
+
319
+ Required headings (from template):
320
+ ${requiredHeadings.map((heading) => `- ${heading}`).join("\n")}
321
+
322
+ Resolved template:
323
+ \`\`\`md
324
+ ${templateContent.trim()}
325
325
  \`\`\``;
326
326
  const companionAuthority = companionTemplate
327
- ? `Native companion template (STRICT reference):
328
- - Path: ${companionTemplate.path}
329
- - Preserve this native format and structure when generating companion artifact.
330
- \`\`\`${artifactType === "workflow" ? "mermaid" : "html"}
331
- ${companionTemplate.content.trim()}
327
+ ? `Native companion template (STRICT reference):
328
+ - Path: ${companionTemplate.path}
329
+ - Preserve this native format and structure when generating companion artifact.
330
+ \`\`\`${artifactType === "workflow" ? "mermaid" : "html"}
331
+ ${companionTemplate.content.trim()}
332
332
  \`\`\``
333
333
  : "";
334
334
  const workflowPairing = artifactType === "workflow"
335
- ? `
336
- Workflow paired output contract (STRICT):
337
- - Output markdown explanation first (template headings).
338
- - Then append a mermaid block for the same flow:
339
- \`\`\`mermaid
340
- flowchart TD
341
- ...
342
- \`\`\`
335
+ ? `
336
+ Workflow paired output contract (STRICT):
337
+ - Output markdown explanation first (template headings).
338
+ - Then append a mermaid block for the same flow:
339
+ \`\`\`mermaid
340
+ flowchart TD
341
+ ...
342
+ \`\`\`
343
343
  - Mermaid block is mandatory.`
344
344
  : "";
345
345
  const wireframePairing = artifactType === "wireframe"
346
- ? `
347
- Wireframe paired output contract (STRICT):
348
- - Output markdown explanation first (template headings).
349
- - Generate companion HTML screens based on native wireframe template.
346
+ ? `
347
+ Wireframe paired output contract (STRICT):
348
+ - Output markdown explanation first (template headings).
349
+ - Generate companion HTML screens based on native wireframe template.
350
350
  - HTML must stay low-fidelity and structure-first.`
351
351
  : "";
352
352
  const authorPolicy = outputAuthor && outputAuthor.trim().length > 0
353
- ? `
354
- Author policy (STRICT):
355
- - Use this exact author name wherever author is required: ${outputAuthor.trim()}
353
+ ? `
354
+ Author policy (STRICT):
355
+ - Use this exact author name wherever author is required: ${outputAuthor.trim()}
356
356
  - Do not invent random author names.`
357
357
  : "";
358
- const withTemplate = `${base}
359
-
360
- ${authority}
361
- ${companionAuthority}
362
- ${workflowPairing}
363
- ${wireframePairing}
358
+ const withTemplate = `${base}
359
+
360
+ ${authority}
361
+ ${companionAuthority}
362
+ ${workflowPairing}
363
+ ${wireframePairing}
364
364
  ${authorPolicy}`;
365
365
  if (!agent)
366
366
  return withTemplate;
367
- return `${withTemplate}
368
-
369
- Agent execution profile: ${agent}
367
+ return `${withTemplate}
368
+
369
+ Agent execution profile: ${agent}
370
370
  - Keep output deterministic and actionable.`;
371
371
  }
372
372
  async function loadLatestArtifactPath(cwd, type) {
@@ -574,38 +574,38 @@ async function writeWireframeScreens(targetDir, baseName, normalized, coverage,
574
574
  const screenBase = `${baseName}-${index + 1}-${toSlug(title)}`;
575
575
  const htmlPath = node_path_1.default.join(targetDir, `${screenBase}.html`);
576
576
  const mdPath = node_path_1.default.join(targetDir, `${screenBase}.md`);
577
- const fallbackHtml = `<!doctype html>
578
- <html lang="${lang}">
579
- <head>
580
- <meta charset="utf-8" />
581
- <meta name="viewport" content="width=device-width, initial-scale=1" />
582
- <title>${title}</title>
583
- </head>
584
- <body>
585
- <!-- [${screen.id}] -->
586
- <header>
587
- <h1>${title}</h1>
588
- <nav><button type="button">${(0, i18n_1.t)("back", lang)}</button><button type="button">${(0, i18n_1.t)("next", lang)}</button></nav>
589
- </header>
590
- <main>
591
- <section>
592
- <h2>${(0, i18n_1.t)("content", lang)}</h2>
593
- <ul>
594
- <li>${(0, i18n_1.t)("primary_info_area", lang)}</li>
595
- <li>${(0, i18n_1.t)("status_indicator", lang)}</li>
596
- </ul>
597
- </section>
598
- <section>
599
- <h2>${(0, i18n_1.t)("form", lang)}</h2>
600
- <form>
601
- <label>${(0, i18n_1.t)("field", lang)}
602
- <input type="text" name="field_${index + 1}" />
603
- </label>
604
- <button type="submit">${(0, i18n_1.t)("save", lang)}</button>
605
- </form>
606
- </section>
607
- </main>
608
- </body>
577
+ const fallbackHtml = `<!doctype html>
578
+ <html lang="${lang}">
579
+ <head>
580
+ <meta charset="utf-8" />
581
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
582
+ <title>${title}</title>
583
+ </head>
584
+ <body>
585
+ <!-- [${screen.id}] -->
586
+ <header>
587
+ <h1>${title}</h1>
588
+ <nav><button type="button">${(0, i18n_1.t)("back", lang)}</button><button type="button">${(0, i18n_1.t)("next", lang)}</button></nav>
589
+ </header>
590
+ <main>
591
+ <section>
592
+ <h2>${(0, i18n_1.t)("content", lang)}</h2>
593
+ <ul>
594
+ <li>${(0, i18n_1.t)("primary_info_area", lang)}</li>
595
+ <li>${(0, i18n_1.t)("status_indicator", lang)}</li>
596
+ </ul>
597
+ </section>
598
+ <section>
599
+ <h2>${(0, i18n_1.t)("form", lang)}</h2>
600
+ <form>
601
+ <label>${(0, i18n_1.t)("field", lang)}
602
+ <input type="text" name="field_${index + 1}" />
603
+ </label>
604
+ <button type="submit">${(0, i18n_1.t)("save", lang)}</button>
605
+ </form>
606
+ </section>
607
+ </main>
608
+ </body>
609
609
  </html>`;
610
610
  const htmlTemplate = htmlTemplateContent && htmlTemplateContent.trim().length > 0 ? htmlTemplateContent : fallbackHtml;
611
611
  const html = replaceTemplateTokens(htmlTemplate, {
@@ -2,6 +2,7 @@ export type ProdoSettings = {
2
2
  lang: string;
3
3
  ai?: string;
4
4
  author?: string;
5
+ provider?: string;
5
6
  };
6
7
  export declare function readSettings(cwd: string): Promise<ProdoSettings>;
7
8
  export declare function writeSettings(cwd: string, settings: ProdoSettings): Promise<string>;
@@ -21,7 +21,8 @@ async function readSettings(cwd) {
21
21
  return {
22
22
  lang: typeof parsed.lang === "string" && parsed.lang.trim() ? parsed.lang.trim() : "en",
23
23
  ai: typeof parsed.ai === "string" && parsed.ai.trim() ? parsed.ai.trim() : undefined,
24
- author: typeof parsed.author === "string" && parsed.author.trim() ? parsed.author.trim() : undefined
24
+ author: typeof parsed.author === "string" && parsed.author.trim() ? parsed.author.trim() : undefined,
25
+ provider: typeof parsed.provider === "string" && parsed.provider.trim() ? parsed.provider.trim() : undefined
25
26
  };
26
27
  }
27
28
  catch {
@@ -30,6 +31,13 @@ async function readSettings(cwd) {
30
31
  }
31
32
  async function writeSettings(cwd, settings) {
32
33
  const path = (0, paths_1.settingsPath)(cwd);
33
- await promises_1.default.writeFile(path, `${JSON.stringify(settings, null, 2)}\n`, "utf8");
34
+ const clean = { lang: settings.lang };
35
+ if (settings.ai)
36
+ clean.ai = settings.ai;
37
+ if (settings.author)
38
+ clean.author = settings.author;
39
+ if (settings.provider)
40
+ clean.provider = settings.provider;
41
+ await promises_1.default.writeFile(path, `${JSON.stringify(clean, null, 2)}\n`, "utf8");
34
42
  return path;
35
43
  }