ushman-ledger 0.3.0 → 1.2.0

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 (80) hide show
  1. package/AGENTS.md +11 -7
  2. package/CHANGELOG.md +8 -12
  3. package/README.md +28 -57
  4. package/dist/archive-journal.d.ts +29 -18
  5. package/dist/archive-journal.d.ts.map +1 -1
  6. package/dist/archive-journal.js +17 -17
  7. package/dist/blobs.js +3 -3
  8. package/dist/builders.d.ts +79 -358
  9. package/dist/builders.d.ts.map +1 -1
  10. package/dist/builders.js +15 -60
  11. package/dist/cli.d.ts.map +1 -1
  12. package/dist/cli.js +227 -52
  13. package/dist/doctor.d.ts.map +1 -1
  14. package/dist/doctor.js +104 -4
  15. package/dist/handle.d.ts +4 -2
  16. package/dist/handle.d.ts.map +1 -1
  17. package/dist/handle.js +20 -15
  18. package/dist/helpers.d.ts +7 -0
  19. package/dist/helpers.d.ts.map +1 -0
  20. package/dist/helpers.js +38 -0
  21. package/dist/index.d.ts +4 -5
  22. package/dist/index.d.ts.map +1 -1
  23. package/dist/index.js +3 -4
  24. package/dist/lab-min.d.ts +7 -7
  25. package/dist/lab-min.d.ts.map +1 -1
  26. package/dist/lab-min.js +7 -9
  27. package/dist/list.d.ts +104 -303
  28. package/dist/list.d.ts.map +1 -1
  29. package/dist/note.d.ts +20 -0
  30. package/dist/note.d.ts.map +1 -1
  31. package/dist/note.js +5 -0
  32. package/dist/patch-resolver.d.ts +27 -0
  33. package/dist/patch-resolver.d.ts.map +1 -0
  34. package/dist/patch-resolver.js +184 -0
  35. package/dist/read-index.d.ts +45 -57
  36. package/dist/read-index.d.ts.map +1 -1
  37. package/dist/read-index.js +16 -34
  38. package/dist/record.d.ts.map +1 -1
  39. package/dist/record.js +19 -130
  40. package/dist/recovery.d.ts +19 -8
  41. package/dist/recovery.d.ts.map +1 -1
  42. package/dist/recovery.js +13 -13
  43. package/dist/render/migration-log.d.ts +3 -0
  44. package/dist/render/migration-log.d.ts.map +1 -0
  45. package/dist/render/migration-log.js +72 -0
  46. package/dist/render/retro.d.ts.map +1 -1
  47. package/dist/render/retro.js +41 -25
  48. package/dist/render/workspace-narrative.d.ts +6 -0
  49. package/dist/render/workspace-narrative.d.ts.map +1 -0
  50. package/dist/render/workspace-narrative.js +69 -0
  51. package/dist/schema/entry-core.d.ts +110 -0
  52. package/dist/schema/entry-core.d.ts.map +1 -0
  53. package/dist/schema/entry-core.js +143 -0
  54. package/dist/schema/entry-migrations.d.ts +3 -0
  55. package/dist/schema/entry-migrations.d.ts.map +1 -0
  56. package/dist/schema/entry-migrations.js +48 -0
  57. package/dist/schema/entry-read.d.ts +694 -0
  58. package/dist/schema/entry-read.d.ts.map +1 -0
  59. package/dist/schema/entry-read.js +92 -0
  60. package/dist/schema/entry-write.d.ts +865 -0
  61. package/dist/schema/entry-write.d.ts.map +1 -0
  62. package/dist/schema/entry-write.js +105 -0
  63. package/dist/schema/entry.d.ts +6 -3295
  64. package/dist/schema/entry.d.ts.map +1 -1
  65. package/dist/schema/entry.js +10 -619
  66. package/dist/schema/manifest.d.ts +28 -41
  67. package/dist/schema/manifest.d.ts.map +1 -1
  68. package/dist/schema/manifest.js +20 -24
  69. package/dist/schema/note.d.ts +3 -9
  70. package/dist/schema/note.d.ts.map +1 -1
  71. package/dist/schema/note.js +13 -2
  72. package/dist/storage/filesystem.d.ts +2 -1
  73. package/dist/storage/filesystem.d.ts.map +1 -1
  74. package/dist/storage/filesystem.js +6 -4
  75. package/dist/storage/lock-reclaimer.d.ts +2 -0
  76. package/dist/storage/lock-reclaimer.d.ts.map +1 -0
  77. package/dist/storage/lock-reclaimer.js +45 -0
  78. package/dist/version.d.ts +1 -1
  79. package/dist/version.js +1 -1
  80. package/package.json +3 -4
package/dist/handle.js CHANGED
@@ -1,3 +1,4 @@
1
+ import path from 'node:path';
1
2
  import { archiveLedger } from "./archive.js";
2
3
  import { computeCoverage } from "./coverage.js";
3
4
  import { runLedgerDoctor } from "./doctor.js";
@@ -6,28 +7,22 @@ import { iterateEntriesFromManifest, listEntries } from "./list.js";
6
7
  import { appendNote } from "./note.js";
7
8
  import { appendRecord, readEntryById } from "./record.js";
8
9
  import { loadLedgerState, prepareLedgerState } from "./recovery.js";
9
- import { renderAnalyticsSummary } from "./render/analytics-summary.js";
10
10
  import { renderDependencyGraph } from "./render/dependency-graph.js";
11
11
  import { renderJsonl } from "./render/jsonl.js";
12
+ import { renderMigrationLogMarkdown } from "./render/migration-log.js";
12
13
  import { renderRetroMarkdown } from "./render/retro.js";
13
14
  import { renderTimelineHtml } from "./render/timeline-html.js";
15
+ import { renderWorkspaceNarrativeMarkdown } from "./render/workspace-narrative.js";
14
16
  import { resolveLedgerPaths, writeAtomicTextFile } from "./storage/filesystem.js";
15
- const renderEntries = async ({ filter, target, useCache, workspaceRoot, }) => {
17
+ const renderEntries = async ({ filter, target, workspaceRoot, }) => {
16
18
  const { manifest, readIndex } = await loadLedgerState(workspaceRoot);
17
19
  switch (target) {
18
- case 'analytics-summary':
19
- return renderAnalyticsSummary({
20
- cachePath: resolveLedgerPaths(workspaceRoot).analyticsSummaryFile,
21
- entries: iterateEntriesFromManifest(workspaceRoot, manifest, readIndex, filter),
22
- filter,
23
- manifest,
24
- readIndex,
25
- useCache,
26
- });
27
20
  case 'dependency-graph':
28
21
  return renderDependencyGraph(iterateEntriesFromManifest(workspaceRoot, manifest, readIndex, filter));
29
22
  case 'jsonl':
30
23
  return renderJsonl(iterateEntriesFromManifest(workspaceRoot, manifest, readIndex, filter));
24
+ case 'migration-log-md':
25
+ return renderMigrationLogMarkdown(iterateEntriesFromManifest(workspaceRoot, manifest, readIndex, filter));
31
26
  case 'timeline-html':
32
27
  return renderTimelineHtml(iterateEntriesFromManifest(workspaceRoot, manifest, readIndex, filter));
33
28
  case 'retro':
@@ -35,17 +30,24 @@ const renderEntries = async ({ filter, target, useCache, workspaceRoot, }) => {
35
30
  entries: iterateEntriesFromManifest(workspaceRoot, manifest, readIndex, filter),
36
31
  manifest,
37
32
  });
33
+ case 'workspace-narrative-md':
34
+ return renderWorkspaceNarrativeMarkdown({
35
+ entries: iterateEntriesFromManifest(workspaceRoot, manifest, readIndex, filter),
36
+ workspaceName: path.basename(workspaceRoot),
37
+ });
38
38
  }
39
39
  };
40
40
  const resolveRenderOutputPath = (workspaceRoot, target) => {
41
41
  const paths = resolveLedgerPaths(workspaceRoot);
42
42
  switch (target) {
43
- case 'analytics-summary':
44
- return paths.analyticsSummaryFile;
45
43
  case 'retro':
46
44
  return paths.renderFile;
45
+ case 'migration-log-md':
46
+ return paths.renderMigrationLogFile;
47
47
  case 'timeline-html':
48
48
  return paths.renderTimelineFile;
49
+ case 'workspace-narrative-md':
50
+ return paths.renderWorkspaceNarrativeFile;
49
51
  default:
50
52
  return null;
51
53
  }
@@ -68,9 +70,12 @@ export const openLedger = async (workspaceRoot) => {
68
70
  },
69
71
  render: async (options) => {
70
72
  const content = await renderEntries({
71
- filter: { phase: options.phase },
73
+ filter: {
74
+ limit: options.limit,
75
+ phase: options.phase,
76
+ since: options.since,
77
+ },
72
78
  target: options.to,
73
- useCache: options.to === 'analytics-summary' ? options.fresh !== true : false,
74
79
  workspaceRoot,
75
80
  });
76
81
  const outputPath = options.out ?? resolveRenderOutputPath(workspaceRoot, options.to);
@@ -0,0 +1,7 @@
1
+ export declare const createWorkspaceFixture: () => Promise<{
2
+ cleanup: () => Promise<void>;
3
+ workspaceRoot: string;
4
+ }>;
5
+ export declare const ageFile: (filePath: string, ageMs?: number) => Promise<void>;
6
+ export declare const waitForFile: (filePath: string, timeoutMs?: number) => Promise<void>;
7
+ //# sourceMappingURL=helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,sBAAsB;;;EAuBlC,CAAC;AAEF,eAAO,MAAM,OAAO,GAAU,UAAU,MAAM,EAAE,cAAc,kBAG7D,CAAC;AAEF,eAAO,MAAM,WAAW,GAAU,UAAU,MAAM,EAAE,kBAAiB,kBAcpE,CAAC"}
@@ -0,0 +1,38 @@
1
+ import { mkdir, mkdtemp, rm, stat, utimes, writeFile } from 'node:fs/promises';
2
+ import os from 'node:os';
3
+ import path from 'node:path';
4
+ export const createWorkspaceFixture = async () => {
5
+ const workspaceRoot = await mkdtemp(path.join(os.tmpdir(), 'ushman-ledger-'));
6
+ await mkdir(path.join(workspaceRoot, '.lab'), { recursive: true });
7
+ await mkdir(path.join(workspaceRoot, 'src'), { recursive: true });
8
+ await writeFile(path.join(workspaceRoot, '.lab', 'lab.json'), `${JSON.stringify({
9
+ schemaVersion: 'ushman-lab/v4.0',
10
+ workspaceId: '3d71d4fb-dca0-4d63-9ad6-69d59a2395f4',
11
+ }, null, 2)}\n`, 'utf8');
12
+ return {
13
+ cleanup: async () => {
14
+ await rm(workspaceRoot, { force: true, recursive: true });
15
+ },
16
+ workspaceRoot,
17
+ };
18
+ };
19
+ export const ageFile = async (filePath, ageMs = 61_000) => {
20
+ const staleTime = new Date(Date.now() - ageMs);
21
+ await utimes(filePath, staleTime, staleTime);
22
+ };
23
+ export const waitForFile = async (filePath, timeoutMs = 1_000) => {
24
+ const deadline = Date.now() + timeoutMs;
25
+ while (Date.now() <= deadline) {
26
+ try {
27
+ await stat(filePath);
28
+ return;
29
+ }
30
+ catch (error) {
31
+ if (error.code !== 'ENOENT') {
32
+ throw error;
33
+ }
34
+ }
35
+ await new Promise((resolve) => setTimeout(resolve, 10));
36
+ }
37
+ throw new Error(`Timed out waiting for file: ${filePath}`);
38
+ };
package/dist/index.d.ts CHANGED
@@ -1,11 +1,10 @@
1
- export { buildAgentPatchRecord, buildCorrectionRecord, buildDescopeBriefRecord, buildMergeReturnRecord, buildMergeReturnRejectedRecord, buildOperatorDecisionRecord, buildOperatorPatchRecord, buildRevertRecord, buildReworkTestRetiredRecord, buildRollbackRecord, buildStageTransitionRecord, buildStripDecisionRevertedRecord, buildValidatorResultRecord, } from './builders.ts';
1
+ export { buildChangeLogRecord, buildCorrectionRecord, buildOperatorDecisionRecord, buildStripDecisionRevertedRecord, buildValidatorResultRecord, } from './builders.ts';
2
2
  export { runLedgerCli } from './cli.ts';
3
3
  export { type CoverageReport, computeCoverage } from './coverage.ts';
4
- export { type LedgerHandle, openLedger } from './handle.ts';
4
+ export { type LedgerHandle, type RenderTarget, openLedger } from './handle.ts';
5
5
  export type { LedgerFilter } from './list.ts';
6
- export { derivePatchPayloadFromDiffText, parseStructuredPatch } from './patch-metadata.ts';
7
- export { type AnalyticsSummary, AnalyticsSummarySchema } from './render/analytics-summary.ts';
8
- export { type AgentPatchDiff, AgentPatchDiffSchema, AgentPatchEntrySchema, AgentPatchRecordSchema, CorrectionEntrySchema, type CorrectionPayload, CorrectionPayloadSchema, CorrectionRecordSchema, DescopeBriefEntrySchema, type DescopeBriefPayload, DescopeBriefPayloadSchema, DescopeBriefRecordSchema, EmitterSchema, type LedgerEntry, LedgerEntrySchema, type LedgerKind, LedgerLinksSchema, type LedgerPhase, LedgerPhaseSchema, type LedgerRecord, LedgerRecordSchema, MergeReturnEntrySchema, type MergeReturnPayload, MergeReturnPayloadSchema, MergeReturnRecordSchema, MergeReturnRejectedEntrySchema, MergeReturnRejectedPayloadSchema, MergeReturnRejectedRecordSchema, NoteEntrySchema, type OperatorDecisionAction, OperatorDecisionActionSchema, OperatorDecisionEntrySchema, OperatorDecisionPayloadSchema, OperatorDecisionRecordSchema, OperatorPatchEntrySchema, OperatorPatchRecordSchema, type PatchHunk, PatchHunkSchema, type PatchPayload, PatchPayloadSchema, PatchPayloadWriteSchema, parseLedgerEntry, parseLedgerRecord, RevertEntrySchema, RevertPayloadSchema, RevertRecordSchema, ReworkTestRetiredEntrySchema, type ReworkTestRetiredPayload, ReworkTestRetiredPayloadSchema, ReworkTestRetiredRecordSchema, RollbackEntrySchema, type RollbackPayload, RollbackPayloadSchema, RollbackRecordSchema, RuntimeEventEntrySchema, StageTransitionEntrySchema, type StageTransitionPayload, StageTransitionPayloadSchema, StageTransitionRecordSchema, StripDecisionRevertedEntrySchema, type StripDecisionRevertedPayload, StripDecisionRevertedPayloadSchema, StripDecisionRevertedRecordSchema, ToolInvocationEntrySchema, ToolInvocationRecordSchema, ValidatorResultEntrySchema, ValidatorResultPayloadSchema, ValidatorResultRecordSchema, } from './schema/entry.ts';
6
+ export { appendCleanupWaveNote, appendDecompositionWaveNote, appendNote, appendOpenIssueNote, appendSemanticCleanupSummaryNote, appendVerifiedFlowNote, type NoteBody, } from './note.ts';
7
+ export { type AgentPatchDiff, AgentPatchDiffSchema, AgentPatchEntrySchema, AgentPatchRecordSchema, type ChangeLogEntry, ChangeLogEntrySchema, type ChangeLogFileChange, ChangeLogFileChangeSchema, type ChangeLogParityStatus, ChangeLogParityStatusSchema, type ChangeLogRecord, ChangeLogRecordSchema, type ChangeLogSmokeResult, ChangeLogSmokeResultSchema, type ChangeLogSubkind, ChangeLogSubkindSchema, CorrectionEntrySchema, CorrectionRecordSchema, EmitterSchema, type LedgerEntry, LedgerEntrySchema, type LedgerKind, LedgerLinksSchema, type LedgerLinks, type LedgerPhase, LedgerPhaseSchema, type LedgerRecord, LedgerRecordSchema, type NoteEntry, NoteEntrySchema, type OperatorDecisionAction, OperatorDecisionActionSchema, OperatorDecisionEntrySchema, type OperatorDecisionPayload, OperatorDecisionPayloadSchema, OperatorDecisionRecordSchema, OperatorPatchEntrySchema, OperatorPatchRecordSchema, parseLedgerEntry, parseLedgerRecord, RuntimeEventEntrySchema, StripDecisionRevertedEntrySchema, type StripDecisionRevertedPayload, StripDecisionRevertedPayloadSchema, StripDecisionRevertedRecordSchema, ToolInvocationEntrySchema, ToolInvocationRecordSchema, ValidatorResultEntrySchema, ValidatorResultRecordSchema, } from './schema/entry.ts';
9
8
  export { type NoteSubkind, NoteSubkindSchema } from './schema/note.ts';
10
9
  export { resolveLedgerPaths } from './storage/filesystem.ts';
11
10
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {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ACH,KAAK,cAAc,EACnB,oBAAoB,EACpB,qBAAqB,EACrB,sBAAsB,EACtB,KAAK,cAAc,EACnB,oBAAoB,EACpB,KAAK,mBAAmB,EACxB,yBAAyB,EACzB,KAAK,qBAAqB,EAC1B,2BAA2B,EAC3B,KAAK,eAAe,EACpB,qBAAqB,EACrB,KAAK,oBAAoB,EACzB,0BAA0B,EAC1B,KAAK,gBAAgB,EACrB,sBAAsB,EACtB,qBAAqB,EACrB,sBAAsB,EACtB,aAAa,EACb,KAAK,WAAW,EAChB,iBAAiB,EACjB,KAAK,UAAU,EACf,iBAAiB,EACjB,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,iBAAiB,EACjB,KAAK,YAAY,EACjB,kBAAkB,EAClB,KAAK,SAAS,EACd,eAAe,EACf,KAAK,sBAAsB,EAC3B,4BAA4B,EAC5B,2BAA2B,EAC3B,KAAK,uBAAuB,EAC5B,6BAA6B,EAC7B,4BAA4B,EAC5B,wBAAwB,EACxB,yBAAyB,EACzB,gBAAgB,EAChB,iBAAiB,EACjB,uBAAuB,EACvB,gCAAgC,EAChC,KAAK,4BAA4B,EACjC,kCAAkC,EAClC,iCAAiC,EACjC,yBAAyB,EACzB,0BAA0B,EAC1B,0BAA0B,EAC1B,2BAA2B,GAC9B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,KAAK,WAAW,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACvE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC"}
package/dist/index.js CHANGED
@@ -1,9 +1,8 @@
1
- export { buildAgentPatchRecord, buildCorrectionRecord, buildDescopeBriefRecord, buildMergeReturnRecord, buildMergeReturnRejectedRecord, buildOperatorDecisionRecord, buildOperatorPatchRecord, buildRevertRecord, buildReworkTestRetiredRecord, buildRollbackRecord, buildStageTransitionRecord, buildStripDecisionRevertedRecord, buildValidatorResultRecord, } from "./builders.js";
1
+ export { buildChangeLogRecord, buildCorrectionRecord, buildOperatorDecisionRecord, buildStripDecisionRevertedRecord, buildValidatorResultRecord, } from "./builders.js";
2
2
  export { runLedgerCli } from "./cli.js";
3
3
  export { computeCoverage } from "./coverage.js";
4
4
  export { openLedger } from "./handle.js";
5
- export { derivePatchPayloadFromDiffText, parseStructuredPatch } from "./patch-metadata.js";
6
- export { AnalyticsSummarySchema } from "./render/analytics-summary.js";
7
- export { AgentPatchDiffSchema, AgentPatchEntrySchema, AgentPatchRecordSchema, CorrectionEntrySchema, CorrectionPayloadSchema, CorrectionRecordSchema, DescopeBriefEntrySchema, DescopeBriefPayloadSchema, DescopeBriefRecordSchema, EmitterSchema, LedgerEntrySchema, LedgerLinksSchema, LedgerPhaseSchema, LedgerRecordSchema, MergeReturnEntrySchema, MergeReturnPayloadSchema, MergeReturnRecordSchema, MergeReturnRejectedEntrySchema, MergeReturnRejectedPayloadSchema, MergeReturnRejectedRecordSchema, NoteEntrySchema, OperatorDecisionActionSchema, OperatorDecisionEntrySchema, OperatorDecisionPayloadSchema, OperatorDecisionRecordSchema, OperatorPatchEntrySchema, OperatorPatchRecordSchema, PatchHunkSchema, PatchPayloadSchema, PatchPayloadWriteSchema, parseLedgerEntry, parseLedgerRecord, RevertEntrySchema, RevertPayloadSchema, RevertRecordSchema, ReworkTestRetiredEntrySchema, ReworkTestRetiredPayloadSchema, ReworkTestRetiredRecordSchema, RollbackEntrySchema, RollbackPayloadSchema, RollbackRecordSchema, RuntimeEventEntrySchema, StageTransitionEntrySchema, StageTransitionPayloadSchema, StageTransitionRecordSchema, StripDecisionRevertedEntrySchema, StripDecisionRevertedPayloadSchema, StripDecisionRevertedRecordSchema, ToolInvocationEntrySchema, ToolInvocationRecordSchema, ValidatorResultEntrySchema, ValidatorResultPayloadSchema, ValidatorResultRecordSchema, } from "./schema/entry.js";
5
+ export { appendCleanupWaveNote, appendDecompositionWaveNote, appendNote, appendOpenIssueNote, appendSemanticCleanupSummaryNote, appendVerifiedFlowNote, } from "./note.js";
6
+ export { AgentPatchDiffSchema, AgentPatchEntrySchema, AgentPatchRecordSchema, ChangeLogEntrySchema, ChangeLogFileChangeSchema, ChangeLogParityStatusSchema, ChangeLogRecordSchema, ChangeLogSmokeResultSchema, ChangeLogSubkindSchema, CorrectionEntrySchema, CorrectionRecordSchema, EmitterSchema, LedgerEntrySchema, LedgerLinksSchema, LedgerPhaseSchema, LedgerRecordSchema, NoteEntrySchema, OperatorDecisionActionSchema, OperatorDecisionEntrySchema, OperatorDecisionPayloadSchema, OperatorDecisionRecordSchema, OperatorPatchEntrySchema, OperatorPatchRecordSchema, parseLedgerEntry, parseLedgerRecord, RuntimeEventEntrySchema, StripDecisionRevertedEntrySchema, StripDecisionRevertedPayloadSchema, StripDecisionRevertedRecordSchema, ToolInvocationEntrySchema, ToolInvocationRecordSchema, ValidatorResultEntrySchema, ValidatorResultRecordSchema, } from "./schema/entry.js";
8
7
  export { NoteSubkindSchema } from "./schema/note.js";
9
8
  export { resolveLedgerPaths } from "./storage/filesystem.js";
package/dist/lab-min.d.ts CHANGED
@@ -1,9 +1,9 @@
1
- import { z } from 'zod';
2
- export declare const LabManifestMin: z.ZodObject<{
3
- createdAt: z.ZodOptional<z.ZodString>;
4
- schemaVersion: z.ZodLiteral<"ushman-lab/v4.0">;
5
- workspaceId: z.ZodString;
6
- }, z.core.$loose>;
7
- export type LabManifestMin = z.infer<typeof LabManifestMin>;
1
+ import * as v from 'valibot';
2
+ export declare const LabManifestMin: v.LooseObjectSchema<{
3
+ readonly createdAt: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
4
+ readonly schemaVersion: v.LiteralSchema<"ushman-lab/v4.0", undefined>;
5
+ readonly workspaceId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
6
+ }, undefined>;
7
+ export type LabManifestMin = v.InferOutput<typeof LabManifestMin>;
8
8
  export declare const readLabManifestMin: (workspaceRoot: string) => Promise<LabManifestMin>;
9
9
  //# sourceMappingURL=lab-min.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"lab-min.d.ts","sourceRoot":"","sources":["../src/lab-min.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,cAAc;;;;iBAMT,CAAC;AAEnB,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAE5D,eAAO,MAAM,kBAAkB,GAAU,eAAe,MAAM,KAAG,OAAO,CAAC,cAAc,CAWtF,CAAC"}
1
+ {"version":3,"file":"lab-min.d.ts","sourceRoot":"","sources":["../src/lab-min.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAC;AAE7B,eAAO,MAAM,cAAc;;;;aAIzB,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,cAAc,CAAC,CAAC;AAElE,eAAO,MAAM,kBAAkB,GAAU,eAAe,MAAM,KAAG,OAAO,CAAC,cAAc,CAWtF,CAAC"}
package/dist/lab-min.js CHANGED
@@ -1,18 +1,16 @@
1
1
  import { readFile } from 'node:fs/promises';
2
2
  import path from 'node:path';
3
- import { z } from 'zod';
4
- export const LabManifestMin = z
5
- .object({
6
- createdAt: z.string().optional(),
7
- schemaVersion: z.literal('ushman-lab/v4.0'),
8
- workspaceId: z.string().uuid(),
9
- })
10
- .passthrough();
3
+ import * as v from 'valibot';
4
+ export const LabManifestMin = v.looseObject({
5
+ createdAt: v.optional(v.string()),
6
+ schemaVersion: v.literal('ushman-lab/v4.0'),
7
+ workspaceId: v.pipe(v.string(), v.uuid()),
8
+ });
11
9
  export const readLabManifestMin = async (workspaceRoot) => {
12
10
  const filePath = path.join(workspaceRoot, '.lab', 'lab.json');
13
11
  try {
14
12
  const text = await readFile(filePath, 'utf8');
15
- return LabManifestMin.parse(JSON.parse(text));
13
+ return v.parse(LabManifestMin, JSON.parse(text));
16
14
  }
17
15
  catch (error) {
18
16
  if (error.code === 'ENOENT') {