@sun-asterisk/sungen 3.2.1-beta.1 → 3.2.2-beta.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.
Files changed (50) hide show
  1. package/dist/cli/commands/delivery.d.ts.map +1 -1
  2. package/dist/cli/commands/delivery.js +31 -0
  3. package/dist/cli/commands/delivery.js.map +1 -1
  4. package/dist/exporters/feature-parser.d.ts +25 -0
  5. package/dist/exporters/feature-parser.d.ts.map +1 -1
  6. package/dist/exporters/feature-parser.js +59 -0
  7. package/dist/exporters/feature-parser.js.map +1 -1
  8. package/dist/exporters/types.d.ts +38 -0
  9. package/dist/exporters/types.d.ts.map +1 -1
  10. package/dist/exporters/xlsx-exporter.d.ts +31 -2
  11. package/dist/exporters/xlsx-exporter.d.ts.map +1 -1
  12. package/dist/exporters/xlsx-exporter.js +144 -1
  13. package/dist/exporters/xlsx-exporter.js.map +1 -1
  14. package/dist/harness/parse.d.ts.map +1 -1
  15. package/dist/harness/parse.js +4 -1
  16. package/dist/harness/parse.js.map +1 -1
  17. package/dist/orchestrator/ai-rules-updater.d.ts.map +1 -1
  18. package/dist/orchestrator/ai-rules-updater.js +1 -0
  19. package/dist/orchestrator/ai-rules-updater.js.map +1 -1
  20. package/dist/orchestrator/templates/ai-instructions/claude-agent-generator.md +44 -0
  21. package/dist/orchestrator/templates/ai-instructions/claude-cmd-create-test.md +18 -1
  22. package/dist/orchestrator/templates/ai-instructions/claude-skill-delivery.md +27 -0
  23. package/dist/orchestrator/templates/ai-instructions/claude-skill-gherkin-syntax.md +2 -0
  24. package/dist/orchestrator/templates/ai-instructions/claude-skill-tc-generation.md +2 -0
  25. package/dist/orchestrator/templates/ai-instructions/copilot-cmd-create-test.md +2 -1
  26. package/dist/orchestrator/templates/ai-instructions/github-skill-sungen-delivery.md +27 -0
  27. package/dist/orchestrator/templates/ai-instructions/github-skill-sungen-gherkin-syntax.md +2 -0
  28. package/dist/orchestrator/templates/ai-instructions/github-skill-sungen-tc-generation.md +2 -0
  29. package/dist/orchestrator/templates/specs-api.d.ts +7 -0
  30. package/dist/orchestrator/templates/specs-api.d.ts.map +1 -1
  31. package/dist/orchestrator/templates/specs-api.js +13 -2
  32. package/dist/orchestrator/templates/specs-api.js.map +1 -1
  33. package/dist/orchestrator/templates/specs-api.ts +13 -2
  34. package/package.json +3 -3
  35. package/src/cli/commands/delivery.ts +32 -2
  36. package/src/exporters/feature-parser.ts +57 -0
  37. package/src/exporters/types.ts +38 -0
  38. package/src/exporters/xlsx-exporter.ts +176 -2
  39. package/src/harness/parse.ts +4 -1
  40. package/src/orchestrator/ai-rules-updater.ts +1 -0
  41. package/src/orchestrator/templates/ai-instructions/claude-agent-generator.md +44 -0
  42. package/src/orchestrator/templates/ai-instructions/claude-cmd-create-test.md +18 -1
  43. package/src/orchestrator/templates/ai-instructions/claude-skill-delivery.md +27 -0
  44. package/src/orchestrator/templates/ai-instructions/claude-skill-gherkin-syntax.md +2 -0
  45. package/src/orchestrator/templates/ai-instructions/claude-skill-tc-generation.md +2 -0
  46. package/src/orchestrator/templates/ai-instructions/copilot-cmd-create-test.md +2 -1
  47. package/src/orchestrator/templates/ai-instructions/github-skill-sungen-delivery.md +27 -0
  48. package/src/orchestrator/templates/ai-instructions/github-skill-sungen-gherkin-syntax.md +2 -0
  49. package/src/orchestrator/templates/ai-instructions/github-skill-sungen-tc-generation.md +2 -0
  50. package/src/orchestrator/templates/specs-api.ts +13 -2
@@ -49,6 +49,17 @@ function substitute(text: string, params: Record<string, any>): string {
49
49
  return text.replace(/:([A-Za-z_][A-Za-z0-9_]*)/g, (_m, p) => encodeURIComponent(String(params[p] ?? '')));
50
50
  }
51
51
 
52
+ /**
53
+ * Join a datasource base URL with a catalog path. Concatenate rather than rely on Playwright's
54
+ * baseURL resolution: an absolute path (`/user/1`) resolves against the base ORIGIN and would drop
55
+ * a base path component (`/api/v3`). Most APIs are mounted under such a prefix, so the full URL must
56
+ * be built explicitly.
57
+ */
58
+ export function joinApiUrl(base: string, urlPath: string): string {
59
+ const b = base.replace(/\/$/, '');
60
+ return urlPath.startsWith('/') ? b + urlPath : `${b}/${urlPath}`;
61
+ }
62
+
52
63
  class ApiClient {
53
64
  private configs: Record<string, ApiDataSource> | null = null;
54
65
 
@@ -103,13 +114,13 @@ class ApiClient {
103
114
  // `storageState` (the @auth role's saved session) so the request shares the browser's
104
115
  // authenticated cookies. Disposed per call so no request context lingers and hangs the process.
105
116
  const ctx: APIRequestContext = await request.newContext({
106
- baseURL: base,
107
117
  extraHTTPHeaders: headers,
108
118
  timeout: conf.timeout_ms ?? 15000,
109
119
  ...(opts.storageState ? { storageState: opts.storageState } : {}),
110
120
  });
111
121
  try {
112
- const res = await ctx.fetch(urlPath, { method: req.method, ...bodyOpt });
122
+ // Full URL (not a baseURL-relative path) so a base path component like /api/v3 is preserved.
123
+ const res = await ctx.fetch(joinApiUrl(base, urlPath), { method: req.method, ...bodyOpt });
113
124
  const text = await res.text();
114
125
  let parsed: any = text;
115
126
  try { parsed = text ? JSON.parse(text) : null; } catch { /* non-JSON → keep text */ }