sdtk-spec-kit 0.4.3 → 0.4.4

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.
@@ -83,12 +83,17 @@ RE_RELEASE_REF = re.compile(r"\b(?:sdtk-spec-kit@)?(0\.\d+\.\d+)\b")
83
83
  def classify_family(rel: str) -> str:
84
84
  p = rel.replace("\\", "/").lower()
85
85
  name = Path(rel).name.lower()
86
+ is_guide_path = p.startswith("guides/") or "/guides/" in p
86
87
  if p == "readme.md":
87
88
  return "root-readme"
88
89
  if "backlog" in name:
89
90
  return "backlog"
90
- if "governance" in p:
91
- return "governance"
91
+ if "skills" in p:
92
+ return "skill"
93
+ if "templates" in p:
94
+ return "template"
95
+ if "docs/database" in p or "database/" in p:
96
+ return "database"
92
97
  if "docs/specs" in p or "specs/" in p:
93
98
  return "spec"
94
99
  if "docs/architecture" in p or "architecture/" in p:
@@ -103,10 +108,10 @@ def classify_family(rel: str) -> str:
103
108
  return "dev"
104
109
  if "docs/product" in p or "product/" in p:
105
110
  return "product"
106
- if "skills" in p:
107
- return "skill"
108
- if "templates" in p:
109
- return "template"
111
+ if is_guide_path:
112
+ return "guide"
113
+ if "governance" in p:
114
+ return "governance"
110
115
  return "other-markdown"
111
116
 
112
117
 
@@ -668,9 +673,11 @@ def build_summary(
668
673
  # ---------------------------------------------------------------------------
669
674
  _FAMILY_COLORS = {
670
675
  "governance": "#58a6ff",
676
+ "guide": "#14b8a6",
671
677
  "backlog": "#d2a8ff",
672
678
  "spec": "#f0883e",
673
679
  "architecture": "#3fb950",
680
+ "database": "#a371f7",
674
681
  "api": "#f778ba",
675
682
  "qa": "#79c0ff",
676
683
  "design": "#ffa657",
@@ -170,6 +170,17 @@ a{color:var(--accent);text-decoration:none}
170
170
 
171
171
  body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;background:linear-gradient(180deg,#eef3f9 0%,#f7f3ec 100%);color:var(--graph-text);font-size:14px;line-height:1.6;height:100vh;overflow:hidden;--nav-width:0px}
172
172
  body.nav-open{--nav-width:84px}
173
+ body.embedded-atlas{background:#ffffff;--nav-width:0px}
174
+ body.embedded-atlas .nav{display:none !important}
175
+ body.embedded-atlas .panel{inset:0 !important;left:0 !important;right:0 !important;top:0 !important;bottom:0 !important;padding:0 !important}
176
+ body.embedded-atlas .graph-shell{padding:0;border:none;border-radius:0;box-shadow:none;background:#ffffff}
177
+ body.embedded-atlas .graph-main-header{display:none}
178
+ body.embedded-atlas .graph-stage{height:100%}
179
+ body.embedded-atlas .graph-canvas-shell{min-height:0;height:100%;border:none;border-radius:0;padding:0}
180
+ body.embedded-atlas #graph-canvas{border-radius:0}
181
+ body.embedded-atlas .graph-settings-corner{top:14px;right:14px}
182
+ body.embedded-atlas .graph-footer-status{bottom:0}
183
+ body.embedded-atlas .graph-focus-overlay{top:14px;right:14px;bottom:14px}
173
184
  .panel{border-radius:30px;overflow:hidden}
174
185
  a{color:#3156c9;text-decoration:none}
175
186
  .panel{display:none;position:fixed;top:16px;right:16px;bottom:16px;left:calc(var(--nav-width) + 16px);padding:0;min-height:0;overflow:hidden}
@@ -721,8 +732,10 @@ const INDEX = __ATLAS_INDEX_JSON__;
721
732
  const GRAPH = __ATLAS_GRAPH_JSON__;
722
733
  const FAMILY_COLORS = __ATLAS_FAMILY_COLORS_JSON__;
723
734
  const FAMILY_GLYPHS = {
735
+ 'governance': 'G', 'product': 'P', 'spec': 'S', 'architecture': 'A', 'database': 'D',
736
+ 'api': 'I', 'qa': 'Q', 'design': 'L', 'dev': 'V', 'skill': 'K', 'template': 'T',
724
737
  'governance-core': 'G', 'backlog': 'B', 'review-artifact': 'R', 'knowledge-object': 'K',
725
- 'toolkit-skill': 'S', 'toolkit-template': 'T', 'toolkit-guide': 'I', 'docs-site-guide': 'D',
738
+ 'toolkit-skill': 'S', 'toolkit-template': 'T', 'toolkit-guide': 'I', 'docs-site-guide': 'D', 'guide': 'D',
726
739
  'root-readme': 'H', 'other-markdown': 'M',
727
740
  };
728
741
  const GRAPH_EDGE_COLORS = { references_path: 'rgba(95,137,255,0.38)', references_wiki_link: 'rgba(46,181,125,0.44)' };
@@ -893,6 +906,10 @@ const ATLAS_NAV_STORAGE_KEY = 'sdtkAtlasNavOpen';
893
906
  const ATLAS_ASK_POSITION_STORAGE_KEY = 'sdtkAtlasAskDockPositionV3';
894
907
  const GRAPH_TOOLBAR_POSITION_STORAGE_KEY = 'sdtkAtlasGraphToolbarPositionV3';
895
908
  const GRAPH_FOCUS_POSITION_STORAGE_KEY = 'sdtkAtlasGraphFocusPosition';
909
+ const VIEW_PARAMS = new URLSearchParams(window.location.search);
910
+ const EMBEDDED_ATLAS = VIEW_PARAMS.get('embedded') === '1';
911
+ const REQUESTED_PANEL = VIEW_PARAMS.get('panel');
912
+ const INITIAL_PANEL = ['dash', 'docs', 'graph'].includes(REQUESTED_PANEL) ? REQUESTED_PANEL : (EMBEDDED_ATLAS ? 'graph' : 'dash');
896
913
  const atlasAskDragState = { active: false, moved: false, startX: 0, startY: 0, originX: 0, originY: 0 };
897
914
  const graphOverlayDragState = { active: false, kind: '', moved: false, startX: 0, startY: 0, originX: 0, originY: 0 };
898
915
  const ATLAS_ASK_RUNTIME_OPTIONS = [
@@ -907,6 +924,11 @@ const ATLAS_ASK_MODEL_LABELS = {
907
924
  'gpt-5.4-mini': 'GPT-5.4 Mini',
908
925
  'gpt-5.3-codex': 'GPT-5.3 Codex',
909
926
  };
927
+ if (EMBEDDED_ATLAS) {
928
+ document.body.classList.add('embedded-atlas');
929
+ }
930
+ const initialPanelButton = document.querySelector(`.nav-panel-btn[data-panel="${INITIAL_PANEL}"]`);
931
+ showPanel(INITIAL_PANEL, initialPanelButton);
910
932
  function escapeHtml(value) {
911
933
  return String(value).replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
912
934
  }
@@ -3248,13 +3270,20 @@ function ensureGraphLayout(width, height, visibleDocs, visibleEdges) {
3248
3270
  (groupBy[group] = groupBy[group] || []).push(doc);
3249
3271
  });
3250
3272
  const groupNames = Object.keys(groupBy).sort();
3251
- const clusterRadius = Math.min(width, height) * 0.29;
3273
+ const isEmbeddedCompactGraph = EMBEDDED_ATLAS && visibleDocs.length <= 12;
3274
+ const clusterRadius = isEmbeddedCompactGraph
3275
+ ? Math.min(width, height) * 0.1
3276
+ : Math.min(width, height) * 0.29;
3252
3277
  const centers = {};
3253
3278
  groupNames.forEach((group, index) => {
3254
3279
  const angle = (index / Math.max(groupNames.length, 1)) * Math.PI * 2;
3255
3280
  centers[group] = {
3256
- x: width / 2 + clusterRadius * Math.cos(angle),
3257
- y: height / 2 + clusterRadius * Math.sin(angle),
3281
+ x: isEmbeddedCompactGraph
3282
+ ? width / 2 + clusterRadius * Math.cos(angle - Math.PI / 2)
3283
+ : width / 2 + clusterRadius * Math.cos(angle),
3284
+ y: isEmbeddedCompactGraph
3285
+ ? height / 2 + clusterRadius * Math.sin(angle - Math.PI / 2)
3286
+ : height / 2 + clusterRadius * Math.sin(angle),
3258
3287
  };
3259
3288
  });
3260
3289
 
@@ -3269,7 +3298,9 @@ function ensureGraphLayout(width, height, visibleDocs, visibleEdges) {
3269
3298
  positions = {};
3270
3299
  groupNames.forEach(group => {
3271
3300
  const members = groupBy[group].slice().sort((a, b) => (a.title || a.id).localeCompare(b.title || b.id));
3272
- const memberRadius = Math.max(34, Math.min(140, 18 + Math.sqrt(members.length) * 12));
3301
+ const memberRadius = isEmbeddedCompactGraph
3302
+ ? Math.max(120, Math.min(260, 56 + members.length * 22))
3303
+ : Math.max(34, Math.min(140, 18 + Math.sqrt(members.length) * 12));
3273
3304
  members.forEach((doc, index) => {
3274
3305
  const angle = (index / Math.max(members.length, 1)) * Math.PI * 2;
3275
3306
  const seed = hashString(doc.id);
@@ -3339,6 +3370,7 @@ function ensureGraphLayout(width, height, visibleDocs, visibleEdges) {
3339
3370
 
3340
3371
  function drawGraph() {
3341
3372
  const visibleDocs = getVisibleDocs();
3373
+ const isEmbeddedCompactGraphView = EMBEDDED_ATLAS && visibleDocs.length <= 12;
3342
3374
  const visibleIds = new Set(visibleDocs.map(doc => doc.id));
3343
3375
  normalizeGraphFocus(visibleIds);
3344
3376
  const visibleEdges = getVisibleDocEdges(visibleIds);
@@ -3372,7 +3404,9 @@ function drawGraph() {
3372
3404
  const paddingY = 120;
3373
3405
  const fitZoomX = viewport.usableWidth / (bounds.width + paddingX);
3374
3406
  const fitZoomY = viewport.usableHeight / (bounds.height + paddingY);
3375
- graphState.targetZoom = Math.max(0.82, Math.min(1.52, fitZoomX, fitZoomY));
3407
+ graphState.targetZoom = isEmbeddedCompactGraphView
3408
+ ? Math.max(2.6, Math.min(6.5, fitZoomX, fitZoomY))
3409
+ : Math.max(0.82, Math.min(1.52, fitZoomX, fitZoomY));
3376
3410
  const fit = computePanForTargetCenter(
3377
3411
  bounds.centerX,
3378
3412
  bounds.centerY,
@@ -3407,7 +3441,9 @@ function drawGraph() {
3407
3441
  const paddingY = 120;
3408
3442
  const fitZoomX = viewport.usableWidth / (bounds.width + paddingX);
3409
3443
  const fitZoomY = viewport.usableHeight / (bounds.height + paddingY);
3410
- graphState.targetZoom = Math.max(0.84, Math.min(1.48, fitZoomX, fitZoomY));
3444
+ graphState.targetZoom = isEmbeddedCompactGraphView
3445
+ ? Math.max(2.4, Math.min(6.2, fitZoomX, fitZoomY))
3446
+ : Math.max(0.84, Math.min(1.48, fitZoomX, fitZoomY));
3411
3447
  const fit = computePanForTargetCenter(
3412
3448
  bounds.centerX,
3413
3449
  bounds.centerY,
@@ -3421,9 +3457,33 @@ function drawGraph() {
3421
3457
  graphState.targetPanY = fit.panY;
3422
3458
  }
3423
3459
  } else if (!focusId && !graphState.isDragging && !graphState.manualViewport) {
3424
- graphState.targetZoom = 1;
3425
- graphState.targetPanX = 0;
3426
- graphState.targetPanY = 0;
3460
+ if (EMBEDDED_ATLAS) {
3461
+ const bounds = computePositionBounds(visibleDocs);
3462
+ if (bounds) {
3463
+ const paddingX = 120;
3464
+ const paddingY = 120;
3465
+ const fitZoomX = viewport.usableWidth / (bounds.width + paddingX);
3466
+ const fitZoomY = viewport.usableHeight / (bounds.height + paddingY);
3467
+ graphState.targetZoom = isEmbeddedCompactGraphView
3468
+ ? Math.max(2.8, Math.min(7.2, fitZoomX, fitZoomY))
3469
+ : Math.max(0.92, Math.min(1.9, fitZoomX, fitZoomY));
3470
+ const fit = computePanForTargetCenter(
3471
+ bounds.centerX,
3472
+ bounds.centerY,
3473
+ viewport.centerX,
3474
+ viewport.centerY,
3475
+ width,
3476
+ height,
3477
+ graphState.targetZoom,
3478
+ );
3479
+ graphState.targetPanX = fit.panX;
3480
+ graphState.targetPanY = fit.panY;
3481
+ }
3482
+ } else {
3483
+ graphState.targetZoom = 1;
3484
+ graphState.targetPanX = 0;
3485
+ graphState.targetPanY = 0;
3486
+ }
3427
3487
  }
3428
3488
  applyCameraStep();
3429
3489
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sdtk-spec-kit",
3
- "version": "0.4.3",
3
+ "version": "0.4.4",
4
4
  "description": "SDTK-SPEC CLI toolkit for deterministic software documentation workflows via the sdtk-spec command",
5
5
  "bin": {
6
6
  "sdtk-spec": "bin/sdtk.js"
@@ -42,7 +42,7 @@ async function postActivationRequest({
42
42
  licenseKey,
43
43
  machineId,
44
44
  }) {
45
- const pkg = require("../package.json");
45
+ const pkg = require("../../package.json");
46
46
  const body = {
47
47
  license_key: licenseKey,
48
48
  machine_id: machineId,
@@ -57,13 +57,37 @@ async function postActivationRequest({
57
57
  headers: { "Content-Type": "application/json" },
58
58
  body: JSON.stringify(body),
59
59
  });
60
-
61
- const data = await response.json();
60
+ const rawText = await response.text();
61
+ let data = null;
62
+ if (rawText) {
63
+ try {
64
+ data = JSON.parse(rawText);
65
+ } catch (_err) {
66
+ data = null;
67
+ }
68
+ }
62
69
 
63
70
  if (!response.ok) {
71
+ const deniedReason =
72
+ data &&
73
+ data.decision === "denied" &&
74
+ data.manifest &&
75
+ typeof data.manifest.error === "string"
76
+ ? data.manifest.error
77
+ : null;
78
+ return {
79
+ success: false,
80
+ error:
81
+ deniedReason ||
82
+ (data && typeof data.error === "string" ? data.error : null) ||
83
+ `Activation API returned status ${response.status}`,
84
+ };
85
+ }
86
+
87
+ if (!data || typeof data !== "object") {
64
88
  return {
65
89
  success: false,
66
- error: data.error || `Activation API returned status ${response.status}`,
90
+ error: "Activation API returned a non-JSON response",
67
91
  };
68
92
  }
69
93
 
@@ -248,12 +272,12 @@ function rollbackPartialState() {
248
272
  *
249
273
  * @param {object} options
250
274
  * @param {string} options.licenseKey - Activation key from user
251
- * @param {string} [options.activationUrl] - Override API URL (default: https://sdtk-spec.com/api/activate)
275
+ * @param {string} [options.activationUrl] - Override API URL (default: https://sdtk.dev/api/activate)
252
276
  * @returns {Promise<{ success: boolean, decision?: string, message: string, exitCode: number }>}
253
277
  */
254
278
  async function activateWithLicense({
255
279
  licenseKey,
256
- activationUrl = "https://sdtk-spec.com/api/activate",
280
+ activationUrl = process.env.SDTK_ACTIVATION_URL || "https://sdtk.dev/api/activate",
257
281
  } = {}) {
258
282
  const result = {
259
283
  success: false,