@slycode/slycode 0.2.23 → 0.2.24

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 (70) hide show
  1. package/dist/scripts/scaffold.js +40 -1
  2. package/dist/store/actions/approve.md +1 -1
  3. package/dist/store/actions/challenge-implementation.md +149 -0
  4. package/dist/store/actions/challenge.md +119 -0
  5. package/dist/store/actions/checkpoint.md +1 -1
  6. package/dist/store/actions/context.md +2 -2
  7. package/dist/store/actions/implement.md +1 -1
  8. package/dist/store/actions/show-card.md +2 -2
  9. package/dist/store/actions/summarize.md +2 -2
  10. package/dist/store/actions/test-review.md +1 -1
  11. package/dist/web/.next/BUILD_ID +1 -1
  12. package/dist/web/.next/build-manifest.json +2 -2
  13. package/dist/web/.next/server/app/_global-error.html +2 -2
  14. package/dist/web/.next/server/app/_global-error.rsc +1 -1
  15. package/dist/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  16. package/dist/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  17. package/dist/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  18. package/dist/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  19. package/dist/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  20. package/dist/web/.next/server/app/_not-found.html +1 -1
  21. package/dist/web/.next/server/app/_not-found.rsc +1 -1
  22. package/dist/web/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
  23. package/dist/web/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  24. package/dist/web/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
  25. package/dist/web/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  26. package/dist/web/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  27. package/dist/web/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  28. package/dist/web/.next/server/app/page_client-reference-manifest.js +1 -1
  29. package/dist/web/.next/server/chunks/[root-of-the-server]__92f81907._.js +1 -1
  30. package/dist/web/.next/server/chunks/[root-of-the-server]__a259539f._.js +1 -1
  31. package/dist/web/.next/server/chunks/ssr/src_components_Dashboard_tsx_efc4dc27._.js +1 -1
  32. package/dist/web/.next/server/pages/404.html +1 -1
  33. package/dist/web/.next/server/pages/500.html +2 -2
  34. package/dist/web/.next/static/chunks/{3859477038c381ad.js → f566a4b05a9cd6ba.js} +1 -1
  35. package/dist/web/src/app/api/changelog/route.ts +3 -3
  36. package/dist/web/src/app/api/terminal-classes/route.ts +43 -4
  37. package/dist/web/src/components/ChangelogModal.tsx +0 -1
  38. package/dist/web/tsconfig.tsbuildinfo +1 -1
  39. package/lib/cli/sync.d.ts +7 -0
  40. package/lib/cli/sync.d.ts.map +1 -1
  41. package/lib/cli/sync.js +25 -0
  42. package/lib/cli/sync.js.map +1 -1
  43. package/lib/cli/update.d.ts.map +1 -1
  44. package/lib/cli/update.js +9 -0
  45. package/lib/cli/update.js.map +1 -1
  46. package/package.json +1 -1
  47. package/templates/changelog.json +26 -0
  48. package/templates/kanban-seed.json +1 -1
  49. package/templates/store/actions/approve.md +1 -1
  50. package/templates/store/actions/challenge-implementation.md +149 -0
  51. package/templates/store/actions/challenge.md +119 -0
  52. package/templates/store/actions/checkpoint.md +1 -1
  53. package/templates/store/actions/context.md +2 -2
  54. package/templates/store/actions/implement.md +1 -1
  55. package/templates/store/actions/show-card.md +2 -2
  56. package/templates/store/actions/summarize.md +2 -2
  57. package/templates/store/actions/test-review.md +1 -1
  58. package/templates/terminal-classes.json +51 -0
  59. package/templates/updates/actions/approve.md +1 -1
  60. package/templates/updates/actions/challenge-implementation.md +149 -0
  61. package/templates/updates/actions/challenge.md +119 -0
  62. package/templates/updates/actions/checkpoint.md +1 -1
  63. package/templates/updates/actions/context.md +2 -2
  64. package/templates/updates/actions/implement.md +1 -1
  65. package/templates/updates/actions/show-card.md +2 -2
  66. package/templates/updates/actions/summarize.md +2 -2
  67. package/templates/updates/actions/test-review.md +1 -1
  68. /package/dist/web/.next/static/{aN-jqftQVvSm0qVskLybH → O1Ine2WtyXv6EQJcwHyOV}/_buildManifest.js +0 -0
  69. /package/dist/web/.next/static/{aN-jqftQVvSm0qVskLybH → O1Ine2WtyXv6EQJcwHyOV}/_clientMiddlewareManifest.json +0 -0
  70. /package/dist/web/.next/static/{aN-jqftQVvSm0qVskLybH → O1Ine2WtyXv6EQJcwHyOV}/_ssgManifest.js +0 -0
@@ -32,12 +32,12 @@ export async function GET() {
32
32
  const raw = readFileSync(p, 'utf-8');
33
33
  const data = JSON.parse(raw);
34
34
  if (!Array.isArray(data)) {
35
- // Malformed shape fall through to empty
35
+ console.warn(`[changelog] ${p}: root is not an array, skipping`);
36
36
  continue;
37
37
  }
38
38
  return NextResponse.json(data as ChangelogVersion[]);
39
- } catch {
40
- // Malformed JSON fall through to next candidate or empty
39
+ } catch (err) {
40
+ console.warn(`[changelog] ${p}: failed to parse:`, err instanceof Error ? err.message : err);
41
41
  }
42
42
  }
43
43
 
@@ -1,12 +1,29 @@
1
1
  import { NextResponse } from 'next/server';
2
2
  import fs from 'fs/promises';
3
+ import fsSync from 'fs';
3
4
  import path from 'path';
4
- import { getSlycodeRoot } from '@/lib/paths';
5
+ import { getSlycodeRoot, getPackageDir } from '@/lib/paths';
5
6
 
6
7
  function getClassesFile(): string {
7
8
  return path.join(getSlycodeRoot(), 'documentation', 'terminal-classes.json');
8
9
  }
9
10
 
11
+ /**
12
+ * Find the terminal-classes.json template from the package.
13
+ * In prod: node_modules/@slycode/slycode/dist/templates/terminal-classes.json
14
+ * In dev: falls back to documentation/terminal-classes.json at repo root
15
+ */
16
+ function getPackageTemplate(): string | null {
17
+ const pkgDir = getPackageDir();
18
+ // Prod: check templates/ in the package dist
19
+ const templatePath = path.join(pkgDir, 'templates', 'terminal-classes.json');
20
+ if (fsSync.existsSync(templatePath)) return templatePath;
21
+ // Dev fallback: the source file at repo root
22
+ const devPath = path.join(getSlycodeRoot(), 'documentation', 'terminal-classes.json');
23
+ if (fsSync.existsSync(devPath)) return devPath;
24
+ return null;
25
+ }
26
+
10
27
  export interface TerminalClass {
11
28
  id: string;
12
29
  name: string;
@@ -20,12 +37,34 @@ export interface TerminalClassesConfig {
20
37
  }
21
38
 
22
39
  export async function GET() {
40
+ const classesFile = getClassesFile();
41
+
23
42
  try {
24
- const content = await fs.readFile(getClassesFile(), 'utf-8');
43
+ const content = await fs.readFile(classesFile, 'utf-8');
25
44
  const config: TerminalClassesConfig = JSON.parse(content);
26
45
  return NextResponse.json(config);
27
- } catch (_err) {
28
- // Return empty config if file doesn't exist
46
+ } catch {
47
+ // Workspace file missing try to seed from package template
48
+ const templatePath = getPackageTemplate();
49
+ if (templatePath) {
50
+ try {
51
+ const templateContent = await fs.readFile(templatePath, 'utf-8');
52
+ const config: TerminalClassesConfig = JSON.parse(templateContent);
53
+
54
+ // Auto-seed to workspace so future reads don't need the fallback
55
+ try {
56
+ await fs.mkdir(path.dirname(classesFile), { recursive: true });
57
+ await fs.writeFile(classesFile, templateContent);
58
+ } catch {
59
+ // Seed failed (read-only fs, etc.) — still serve the template
60
+ }
61
+
62
+ return NextResponse.json(config);
63
+ } catch {
64
+ // Template unreadable — fall through to empty
65
+ }
66
+ }
67
+
29
68
  return NextResponse.json({
30
69
  version: '1.0',
31
70
  classes: [],
@@ -41,7 +41,6 @@ export function ChangelogModal({ onClose }: ChangelogModalProps) {
41
41
  // Fetch changelog on mount
42
42
  useEffect(() => {
43
43
  let cancelled = false;
44
- setLoading(true);
45
44
  fetch('/api/changelog')
46
45
  .then((r) => {
47
46
  if (!r.ok) throw new Error(`HTTP ${r.status}`);