specatlas 0.1.14 → 0.1.15

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.
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  signApproval
4
- } from "./chunk-N3AY2VXJ.js";
4
+ } from "./chunk-HYN75DTZ.js";
5
5
  import "./chunk-DKFIPJ74.js";
6
6
  export {
7
7
  signApproval
package/dist/bin.js CHANGED
@@ -3,15 +3,16 @@ import {
3
3
  artifactHash,
4
4
  countBySeverity,
5
5
  diag,
6
+ localCompact,
6
7
  localDate,
7
- localIso,
8
8
  localMonth,
9
+ localStamp,
9
10
  parseApprovals,
10
11
  parseChangeMeta,
11
12
  sha256,
12
13
  shortHash,
13
14
  signApproval
14
- } from "./chunk-N3AY2VXJ.js";
15
+ } from "./chunk-HYN75DTZ.js";
15
16
  import {
16
17
  __commonJS,
17
18
  __toESM,
@@ -10840,7 +10841,7 @@ async function approveFromGithub(opts) {
10840
10841
  if (!by) {
10841
10842
  return { approved: false, label, issueNumber: number, diagnostics: [diag("ATLAS-GH-011", "error", "No se pudo determinar qui\xE9n aprueba (--by ni `gh api user`)")] };
10842
10843
  }
10843
- const { signApproval: signApproval2 } = await import("./approvals-XPI466UK-HLB4NIVC.js");
10844
+ const { signApproval: signApproval2 } = await import("./approvals-2PO6223I-54L7NGZ5.js");
10844
10845
  const signed = await signApproval2({
10845
10846
  root: opts.root,
10846
10847
  artifact: path5.posix.join("changes", opts.slug, "spec.md"),
@@ -10990,7 +10991,7 @@ ${exec.stderr}`);
10990
10991
  scenario,
10991
10992
  method,
10992
10993
  result,
10993
- date: localIso(opts.now),
10994
+ date: localStamp(opts.now),
10994
10995
  by: opts.by.trim(),
10995
10996
  line: 0
10996
10997
  };
@@ -11027,7 +11028,7 @@ ${yaml2}
11027
11028
  return returned;
11028
11029
  }
11029
11030
  function generateRunId(now = /* @__PURE__ */ new Date()) {
11030
- const iso = localIso(now).replace(/[-+:.Z]/g, "").slice(0, 15);
11031
+ const iso = localCompact(now);
11031
11032
  return `${iso.slice(0, 8)}-${iso.slice(8, 14)}-${randomBytes(3).toString("hex")}`;
11032
11033
  }
11033
11034
  function runsDir(root) {
@@ -11040,8 +11041,8 @@ async function createRun(root, slug, phase, inputs, now = /* @__PURE__ */ new Da
11040
11041
  slug,
11041
11042
  phase,
11042
11043
  status: "active",
11043
- startedAt: localIso(now),
11044
- updatedAt: localIso(now)
11044
+ startedAt: localStamp(now),
11045
+ updatedAt: localStamp(now)
11045
11046
  };
11046
11047
  if (inputs) state.inputs = inputs;
11047
11048
  const dir = path7.join(runsDir(root), runId);
@@ -11053,7 +11054,7 @@ async function createRun(root, slug, phase, inputs, now = /* @__PURE__ */ new Da
11053
11054
  return state;
11054
11055
  }
11055
11056
  async function appendRunEvent(root, runId, type, data, now = /* @__PURE__ */ new Date()) {
11056
- const event = { eventId: randomBytes(4).toString("hex"), at: localIso(now), type };
11057
+ const event = { eventId: randomBytes(4).toString("hex"), at: localStamp(now), type };
11057
11058
  if (data) event.data = data;
11058
11059
  const file = path7.join(runsDir(root), runId, "events.jsonl");
11059
11060
  const previous = await readTextIfExists(file) ?? "";
@@ -11067,7 +11068,7 @@ async function updateRunStatus(root, runId, status, now = /* @__PURE__ */ new Da
11067
11068
  if (raw === void 0) return;
11068
11069
  const state = JSON.parse(raw);
11069
11070
  state.status = status;
11070
- state.updatedAt = localIso(now);
11071
+ state.updatedAt = localStamp(now);
11071
11072
  await writeText(file, `${JSON.stringify(state, null, 2)}
11072
11073
  `);
11073
11074
  }
@@ -11292,7 +11293,7 @@ async function writeMockupPlan(root, slug, plan, now = /* @__PURE__ */ new Date(
11292
11293
  if (await exists(file)) return file;
11293
11294
  const doc = {
11294
11295
  schema_version: 1,
11295
- generated_at: localIso(now),
11296
+ generated_at: localStamp(now),
11296
11297
  platform: plan.platform,
11297
11298
  screens: plan.screens.map((s) => ({ id: s.id, title: s.title, file: s.file, illustrates: s.illustrates, states: s.states, breakpoints: s.breakpoints }))
11298
11299
  };
@@ -11308,7 +11309,7 @@ async function writeMockupManifest(root, slug, plan, inputsHash, now = /* @__PUR
11308
11309
  level: "hifi",
11309
11310
  platform: plan.platform,
11310
11311
  inputs_hash: inputsHash,
11311
- generated_at: localIso(now),
11312
+ generated_at: localStamp(now),
11312
11313
  screens: plan.screens.map((s) => ({ id: s.id, title: s.title, file: s.file, illustrates: s.illustrates, states: s.states, breakpoints: s.breakpoints })),
11313
11314
  screenshots: []
11314
11315
  };
@@ -11750,7 +11751,7 @@ async function runAnalyze(opts) {
11750
11751
  if (packs) result.packs = packs;
11751
11752
  if (opts.write !== false) {
11752
11753
  const file = path10.join(change.dir, "analyze.md");
11753
- await writeText(file, renderAnalyze(change, result, localIso(opts.now)));
11754
+ await writeText(file, renderAnalyze(change, result, localStamp(opts.now)));
11754
11755
  result.path = file;
11755
11756
  }
11756
11757
  return result;
@@ -11889,7 +11890,7 @@ async function collectMetrics(root, now = /* @__PURE__ */ new Date()) {
11889
11890
  archived: archivedEntries.length
11890
11891
  };
11891
11892
  return {
11892
- generatedAt: localIso(now),
11893
+ generatedAt: localStamp(now),
11893
11894
  project: config.project.name,
11894
11895
  root: resolved,
11895
11896
  changes,
@@ -11944,7 +11945,7 @@ async function generatePresentation(opts) {
11944
11945
  project: config.project.name,
11945
11946
  version: change.delta.sectionsFound.length,
11946
11947
  hash,
11947
- generatedAt: localIso(now),
11948
+ generatedAt: localStamp(now),
11948
11949
  proposalHtml: proposalBody ? renderMarkdown2(proposalBody) : `<p><em>${labels.noProposal}</em></p>`,
11949
11950
  requirements: change.delta ? [...change.delta.added.map((r) => ({ req: r, kind: "added" })), ...change.delta.modified.map((r) => ({ req: r, kind: "modified" }))] : [],
11950
11951
  evidence: new Map((change.verify?.evidence ?? []).map((e) => [e.scenario, e.result])),
@@ -12344,7 +12345,7 @@ function adoptReport(input) {
12344
12345
  lines.push(es ? "# Adopci\xF3n (brownfield)" : "# Adoption (brownfield)");
12345
12346
  lines.push("");
12346
12347
  lines.push(es ? `- Proyecto: ${input.config.project.name}` : `- Project: ${input.config.project.name}`);
12347
- lines.push(es ? `- Generado: ${localIso(input.now)}` : `- Generated: ${localIso(input.now)}`);
12348
+ lines.push(es ? `- Generado: ${localStamp(input.now)}` : `- Generated: ${localStamp(input.now)}`);
12348
12349
  lines.push(es ? `- Archivos de c\xF3digo inventariados: ${input.files} (de ${input.inventoried} archivos totales)` : `- Inventoried source files: ${input.files} (of ${input.inventoried} total files)`);
12349
12350
  if (input.detection) lines.push(es ? `- Stack detectado: ${input.detection.name} (${input.detection.score} puntos)` : `- Detected stack: ${input.detection.name} (${input.detection.score})`);
12350
12351
  lines.push("");
@@ -12396,7 +12397,7 @@ async function initWorkspace(opts) {
12396
12397
  created.push(path14.join(sddDir, "glossary.md"));
12397
12398
  const detected = await detectIfPossible(root, opts.profilesDir);
12398
12399
  if (detected) {
12399
- const yaml2 = detectionToYaml(detected, localIso(opts.now));
12400
+ const yaml2 = detectionToYaml(detected, localStamp(opts.now));
12400
12401
  await writeText(path14.join(sddDir, "profiles", "detected.yaml"), yaml2);
12401
12402
  created.push(path14.join(sddDir, "profiles", "detected.yaml"));
12402
12403
  if (detected.best) {
@@ -5,7 +5,7 @@ import {
5
5
  writeText
6
6
  } from "./chunk-DKFIPJ74.js";
7
7
 
8
- // ../core/dist/chunk-CTT5JQA5.js
8
+ // ../core/dist/chunk-WF6H5ITI.js
9
9
  import path from "path";
10
10
  import { stringify as stringifyYaml } from "yaml";
11
11
  import { createHash } from "crypto";
@@ -20,12 +20,17 @@ function localDate(date = /* @__PURE__ */ new Date()) {
20
20
  function localMonth(date = /* @__PURE__ */ new Date()) {
21
21
  return `${date.getFullYear()}-${pad(date.getMonth() + 1)}`;
22
22
  }
23
- function localIso(date = /* @__PURE__ */ new Date()) {
23
+ function localOffset(date = /* @__PURE__ */ new Date()) {
24
24
  const offset = -date.getTimezoneOffset();
25
25
  const sign = offset >= 0 ? "+" : "-";
26
26
  const absolute = Math.abs(offset);
27
- const time = `${pad(date.getHours())}:${pad(date.getMinutes())}:${pad(date.getSeconds())}.${pad(date.getMilliseconds(), 3)}`;
28
- return `${localDate(date)}T${time}${sign}${pad(Math.floor(absolute / 60))}:${pad(absolute % 60)}`;
27
+ return `${sign}${pad(Math.floor(absolute / 60))}:${pad(absolute % 60)}`;
28
+ }
29
+ function localStamp(date = /* @__PURE__ */ new Date()) {
30
+ return `${localDate(date)} ${pad(date.getHours())}:${pad(date.getMinutes())}:${pad(date.getSeconds())} ${localOffset(date)}`;
31
+ }
32
+ function localCompact(date = /* @__PURE__ */ new Date()) {
33
+ return `${localDate(date).replace(/-/g, "")}${pad(date.getHours())}${pad(date.getMinutes())}${pad(date.getSeconds())}`;
29
34
  }
30
35
  function diag(code, severity, message, opts = {}) {
31
36
  const d = { code, severity, message };
@@ -205,7 +210,7 @@ async function signApproval(opts) {
205
210
  artifact: rel,
206
211
  artifactHash: artifactHash(content),
207
212
  approvedBy: opts.by.trim(),
208
- approvedAt: localIso(now),
213
+ approvedAt: localStamp(now),
209
214
  channel: opts.channel ?? "cli"
210
215
  };
211
216
  if (opts.note) approval.note = opts.note;
@@ -234,7 +239,8 @@ async function signApproval(opts) {
234
239
  export {
235
240
  localDate,
236
241
  localMonth,
237
- localIso,
242
+ localStamp,
243
+ localCompact,
238
244
  diag,
239
245
  countBySeverity,
240
246
  sha256,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "specatlas",
3
- "version": "0.1.14",
3
+ "version": "0.1.15",
4
4
  "description": "SpecAtlas: kernel determinista de Spec-Driven Development (CLI)",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -40,7 +40,7 @@
40
40
  },
41
41
  "devDependencies": {
42
42
  "@specatlas/adapters": "0.1.1",
43
- "@specatlas/core": "0.1.11"
43
+ "@specatlas/core": "0.1.12"
44
44
  },
45
45
  "scripts": {
46
46
  "typecheck": "tsc --noEmit",