@anthropologies/claudestory 0.1.9 → 0.1.11

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.
package/dist/index.d.ts CHANGED
@@ -104,25 +104,25 @@ type Issue = z.infer<typeof IssueSchema>;
104
104
 
105
105
  declare const NoteSchema: z.ZodObject<{
106
106
  id: z.ZodString;
107
- title: z.ZodEffects<z.ZodNullable<z.ZodString>, string | null, unknown>;
107
+ title: z.ZodNullable<z.ZodString>;
108
108
  content: z.ZodEffects<z.ZodString, string, string>;
109
- tags: z.ZodEffects<z.ZodArray<z.ZodString, "many">, string[], unknown>;
109
+ tags: z.ZodArray<z.ZodString, "many">;
110
110
  status: z.ZodEnum<["active", "archived"]>;
111
111
  createdDate: z.ZodEffects<z.ZodString, string, string>;
112
112
  updatedDate: z.ZodEffects<z.ZodString, string, string>;
113
113
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
114
114
  id: z.ZodString;
115
- title: z.ZodEffects<z.ZodNullable<z.ZodString>, string | null, unknown>;
115
+ title: z.ZodNullable<z.ZodString>;
116
116
  content: z.ZodEffects<z.ZodString, string, string>;
117
- tags: z.ZodEffects<z.ZodArray<z.ZodString, "many">, string[], unknown>;
117
+ tags: z.ZodArray<z.ZodString, "many">;
118
118
  status: z.ZodEnum<["active", "archived"]>;
119
119
  createdDate: z.ZodEffects<z.ZodString, string, string>;
120
120
  updatedDate: z.ZodEffects<z.ZodString, string, string>;
121
121
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
122
122
  id: z.ZodString;
123
- title: z.ZodEffects<z.ZodNullable<z.ZodString>, string | null, unknown>;
123
+ title: z.ZodNullable<z.ZodString>;
124
124
  content: z.ZodEffects<z.ZodString, string, string>;
125
- tags: z.ZodEffects<z.ZodArray<z.ZodString, "many">, string[], unknown>;
125
+ tags: z.ZodArray<z.ZodString, "many">;
126
126
  status: z.ZodEnum<["active", "archived"]>;
127
127
  createdDate: z.ZodEffects<z.ZodString, string, string>;
128
128
  updatedDate: z.ZodEffects<z.ZodString, string, string>;
@@ -806,6 +806,7 @@ interface InitOptions {
806
806
  force?: boolean;
807
807
  type?: string;
808
808
  language?: string;
809
+ phases?: Phase[];
809
810
  }
810
811
  interface InitResult {
811
812
  readonly root: string;
@@ -1123,29 +1124,30 @@ declare const SnapshotV1Schema: z.ZodObject<{
1123
1124
  }, z.ZodTypeAny, "passthrough">>, "many">;
1124
1125
  notes: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
1125
1126
  id: z.ZodString;
1126
- title: z.ZodEffects<z.ZodNullable<z.ZodString>, string | null, unknown>;
1127
+ title: z.ZodNullable<z.ZodString>;
1127
1128
  content: z.ZodEffects<z.ZodString, string, string>;
1128
- tags: z.ZodEffects<z.ZodArray<z.ZodString, "many">, string[], unknown>;
1129
+ tags: z.ZodArray<z.ZodString, "many">;
1129
1130
  status: z.ZodEnum<["active", "archived"]>;
1130
1131
  createdDate: z.ZodEffects<z.ZodString, string, string>;
1131
1132
  updatedDate: z.ZodEffects<z.ZodString, string, string>;
1132
1133
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
1133
1134
  id: z.ZodString;
1134
- title: z.ZodEffects<z.ZodNullable<z.ZodString>, string | null, unknown>;
1135
+ title: z.ZodNullable<z.ZodString>;
1135
1136
  content: z.ZodEffects<z.ZodString, string, string>;
1136
- tags: z.ZodEffects<z.ZodArray<z.ZodString, "many">, string[], unknown>;
1137
+ tags: z.ZodArray<z.ZodString, "many">;
1137
1138
  status: z.ZodEnum<["active", "archived"]>;
1138
1139
  createdDate: z.ZodEffects<z.ZodString, string, string>;
1139
1140
  updatedDate: z.ZodEffects<z.ZodString, string, string>;
1140
1141
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
1141
1142
  id: z.ZodString;
1142
- title: z.ZodEffects<z.ZodNullable<z.ZodString>, string | null, unknown>;
1143
+ title: z.ZodNullable<z.ZodString>;
1143
1144
  content: z.ZodEffects<z.ZodString, string, string>;
1144
- tags: z.ZodEffects<z.ZodArray<z.ZodString, "many">, string[], unknown>;
1145
+ tags: z.ZodArray<z.ZodString, "many">;
1145
1146
  status: z.ZodEnum<["active", "archived"]>;
1146
1147
  createdDate: z.ZodEffects<z.ZodString, string, string>;
1147
1148
  updatedDate: z.ZodEffects<z.ZodString, string, string>;
1148
1149
  }, z.ZodTypeAny, "passthrough">>, "many">>>;
1150
+ handoverFilenames: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
1149
1151
  warnings: z.ZodOptional<z.ZodArray<z.ZodObject<{
1150
1152
  type: z.ZodString;
1151
1153
  file: z.ZodString;
@@ -1218,9 +1220,9 @@ declare const SnapshotV1Schema: z.ZodObject<{
1218
1220
  project: string;
1219
1221
  notes: z.objectOutputType<{
1220
1222
  id: z.ZodString;
1221
- title: z.ZodEffects<z.ZodNullable<z.ZodString>, string | null, unknown>;
1223
+ title: z.ZodNullable<z.ZodString>;
1222
1224
  content: z.ZodEffects<z.ZodString, string, string>;
1223
- tags: z.ZodEffects<z.ZodArray<z.ZodString, "many">, string[], unknown>;
1225
+ tags: z.ZodArray<z.ZodString, "many">;
1224
1226
  status: z.ZodEnum<["active", "archived"]>;
1225
1227
  createdDate: z.ZodEffects<z.ZodString, string, string>;
1226
1228
  updatedDate: z.ZodEffects<z.ZodString, string, string>;
@@ -1244,6 +1246,7 @@ declare const SnapshotV1Schema: z.ZodObject<{
1244
1246
  } & {
1245
1247
  [k: string]: unknown;
1246
1248
  };
1249
+ handoverFilenames: string[];
1247
1250
  warnings?: {
1248
1251
  message: string;
1249
1252
  type: string;
@@ -1327,9 +1330,9 @@ declare const SnapshotV1Schema: z.ZodObject<{
1327
1330
  };
1328
1331
  notes?: z.objectInputType<{
1329
1332
  id: z.ZodString;
1330
- title: z.ZodEffects<z.ZodNullable<z.ZodString>, string | null, unknown>;
1333
+ title: z.ZodNullable<z.ZodString>;
1331
1334
  content: z.ZodEffects<z.ZodString, string, string>;
1332
- tags: z.ZodEffects<z.ZodArray<z.ZodString, "many">, string[], unknown>;
1335
+ tags: z.ZodArray<z.ZodString, "many">;
1333
1336
  status: z.ZodEnum<["active", "archived"]>;
1334
1337
  createdDate: z.ZodEffects<z.ZodString, string, string>;
1335
1338
  updatedDate: z.ZodEffects<z.ZodString, string, string>;
@@ -1339,6 +1342,7 @@ declare const SnapshotV1Schema: z.ZodObject<{
1339
1342
  type: string;
1340
1343
  file: string;
1341
1344
  }[] | undefined;
1345
+ handoverFilenames?: string[] | undefined;
1342
1346
  }>;
1343
1347
  type SnapshotV1 = z.infer<typeof SnapshotV1Schema>;
1344
1348
  /**
@@ -1438,6 +1442,10 @@ interface SnapshotDiff {
1438
1442
  }>;
1439
1443
  updated: NoteChange[];
1440
1444
  };
1445
+ handovers: {
1446
+ added: string[];
1447
+ removed: string[];
1448
+ };
1441
1449
  }
1442
1450
  interface RecapResult {
1443
1451
  snapshot: {
package/dist/index.js CHANGED
@@ -79,15 +79,9 @@ var IssueSchema = z3.object({
79
79
  import { z as z4 } from "zod";
80
80
  var NoteSchema = z4.object({
81
81
  id: NoteIdSchema,
82
- title: z4.preprocess((v) => v ?? null, z4.string().nullable()),
82
+ title: z4.string().nullable(),
83
83
  content: z4.string().refine((v) => v.trim().length > 0, "Content cannot be empty"),
84
- tags: z4.preprocess(
85
- (v) => {
86
- const raw = Array.isArray(v) ? v : [];
87
- return raw.filter((t) => typeof t === "string").map((t) => t.trim().toLowerCase().replace(/\s+/g, "-").replace(/[^a-z0-9-]/g, "").replace(/-+/g, "-").replace(/^-|-$/g, "")).filter((t) => t.length > 0).filter((t, i, a) => a.indexOf(t) === i);
88
- },
89
- z4.array(z4.string())
90
- ),
84
+ tags: z4.array(z4.string()),
91
85
  status: z4.enum(NOTE_STATUSES),
92
86
  createdDate: DateSchema,
93
87
  updatedDate: DateSchema
@@ -1836,7 +1830,7 @@ async function initProject(root, options) {
1836
1830
  const roadmap = {
1837
1831
  title: options.name,
1838
1832
  date: today,
1839
- phases: [
1833
+ phases: options.phases ?? [
1840
1834
  {
1841
1835
  id: "p0",
1842
1836
  label: "PHASE 0",
@@ -1886,6 +1880,7 @@ var SnapshotV1Schema = z7.object({
1886
1880
  tickets: z7.array(TicketSchema),
1887
1881
  issues: z7.array(IssueSchema),
1888
1882
  notes: z7.array(NoteSchema).optional().default([]),
1883
+ handoverFilenames: z7.array(z7.string()).optional().default([]),
1889
1884
  warnings: z7.array(LoadWarningSchema).optional()
1890
1885
  });
1891
1886
  var MAX_SNAPSHOTS = 20;
@@ -1905,6 +1900,7 @@ async function saveSnapshot(root, loadResult) {
1905
1900
  tickets: [...state.tickets],
1906
1901
  issues: [...state.issues],
1907
1902
  notes: [...state.notes],
1903
+ handoverFilenames: [...state.handoverFilenames],
1908
1904
  ...warnings.length > 0 ? {
1909
1905
  warnings: warnings.map((w) => ({
1910
1906
  type: w.type,
@@ -2057,12 +2053,23 @@ function diffStates(snapshotState, currentState) {
2057
2053
  notesRemoved.push({ id, title: snap.title });
2058
2054
  }
2059
2055
  }
2056
+ const snapHandovers = new Set(snapshotState.handoverFilenames);
2057
+ const curHandovers = new Set(currentState.handoverFilenames);
2058
+ const handoversAdded = [];
2059
+ const handoversRemoved = [];
2060
+ for (const h of curHandovers) {
2061
+ if (!snapHandovers.has(h)) handoversAdded.push(h);
2062
+ }
2063
+ for (const h of snapHandovers) {
2064
+ if (!curHandovers.has(h)) handoversRemoved.push(h);
2065
+ }
2060
2066
  return {
2061
2067
  tickets: { added: ticketsAdded, removed: ticketsRemoved, statusChanged: ticketsStatusChanged, descriptionChanged: ticketsDescriptionChanged },
2062
2068
  issues: { added: issuesAdded, resolved: issuesResolved, statusChanged: issuesStatusChanged, impactChanged: issuesImpactChanged },
2063
2069
  blockers: { added: blockersAdded, cleared: blockersCleared },
2064
2070
  phases: { added: phasesAdded, removed: phasesRemoved, statusChanged: phasesStatusChanged },
2065
- notes: { added: notesAdded, removed: notesRemoved, updated: notesUpdated }
2071
+ notes: { added: notesAdded, removed: notesRemoved, updated: notesUpdated },
2072
+ handovers: { added: handoversAdded, removed: handoversRemoved }
2066
2073
  };
2067
2074
  }
2068
2075
  function buildRecap(currentState, snapshotInfo) {
@@ -2090,7 +2097,7 @@ function buildRecap(currentState, snapshotInfo) {
2090
2097
  notes: snapshot.notes ?? [],
2091
2098
  roadmap: snapshot.roadmap,
2092
2099
  config: snapshot.config,
2093
- handoverFilenames: []
2100
+ handoverFilenames: snapshot.handoverFilenames ?? []
2094
2101
  });
2095
2102
  const changes = diffStates(snapshotState, currentState);
2096
2103
  const recentlyClearedBlockers = changes.blockers.cleared;
@@ -2536,6 +2543,16 @@ function formatRecap(recap, state, format) {
2536
2543
  lines.push(`- ${escapeMarkdownInline(name)} \u2014 **new**`);
2537
2544
  }
2538
2545
  }
2546
+ if (changes.handovers && (changes.handovers.added.length > 0 || changes.handovers.removed.length > 0)) {
2547
+ lines.push("");
2548
+ lines.push("## Handovers");
2549
+ for (const h of changes.handovers.added) {
2550
+ lines.push(`- ${h} \u2014 **new**`);
2551
+ }
2552
+ for (const h of changes.handovers.removed) {
2553
+ lines.push(`- ${h} \u2014 removed`);
2554
+ }
2555
+ }
2539
2556
  if (changes.notes && (changes.notes.added.length > 0 || changes.notes.removed.length > 0 || changes.notes.updated.length > 0)) {
2540
2557
  lines.push("");
2541
2558
  lines.push("## Notes");
@@ -2757,7 +2774,7 @@ function formatFullExport(state, format) {
2757
2774
  return lines.join("\n");
2758
2775
  }
2759
2776
  function hasAnyChanges(diff) {
2760
- return diff.tickets.added.length > 0 || diff.tickets.removed.length > 0 || diff.tickets.statusChanged.length > 0 || diff.tickets.descriptionChanged.length > 0 || diff.issues.added.length > 0 || diff.issues.resolved.length > 0 || diff.issues.statusChanged.length > 0 || diff.issues.impactChanged.length > 0 || diff.blockers.added.length > 0 || diff.blockers.cleared.length > 0 || diff.phases.added.length > 0 || diff.phases.removed.length > 0 || diff.phases.statusChanged.length > 0 || (diff.notes?.added.length ?? 0) > 0 || (diff.notes?.removed.length ?? 0) > 0 || (diff.notes?.updated.length ?? 0) > 0;
2777
+ return diff.tickets.added.length > 0 || diff.tickets.removed.length > 0 || diff.tickets.statusChanged.length > 0 || diff.tickets.descriptionChanged.length > 0 || diff.issues.added.length > 0 || diff.issues.resolved.length > 0 || diff.issues.statusChanged.length > 0 || diff.issues.impactChanged.length > 0 || diff.blockers.added.length > 0 || diff.blockers.cleared.length > 0 || diff.phases.added.length > 0 || diff.phases.removed.length > 0 || diff.phases.statusChanged.length > 0 || (diff.notes?.added.length ?? 0) > 0 || (diff.notes?.removed.length ?? 0) > 0 || (diff.notes?.updated.length ?? 0) > 0 || (diff.handovers?.added.length ?? 0) > 0 || (diff.handovers?.removed.length ?? 0) > 0;
2761
2778
  }
2762
2779
  function truncate(text, maxLen) {
2763
2780
  if (text.length <= maxLen) return text;