@anthropologies/claudestory 0.1.8 → 0.1.9

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
@@ -102,6 +102,33 @@ declare const IssueSchema: z.ZodObject<{
102
102
  }, z.ZodTypeAny, "passthrough">>;
103
103
  type Issue = z.infer<typeof IssueSchema>;
104
104
 
105
+ declare const NoteSchema: z.ZodObject<{
106
+ id: z.ZodString;
107
+ title: z.ZodEffects<z.ZodNullable<z.ZodString>, string | null, unknown>;
108
+ content: z.ZodEffects<z.ZodString, string, string>;
109
+ tags: z.ZodEffects<z.ZodArray<z.ZodString, "many">, string[], unknown>;
110
+ status: z.ZodEnum<["active", "archived"]>;
111
+ createdDate: z.ZodEffects<z.ZodString, string, string>;
112
+ updatedDate: z.ZodEffects<z.ZodString, string, string>;
113
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
114
+ id: z.ZodString;
115
+ title: z.ZodEffects<z.ZodNullable<z.ZodString>, string | null, unknown>;
116
+ content: z.ZodEffects<z.ZodString, string, string>;
117
+ tags: z.ZodEffects<z.ZodArray<z.ZodString, "many">, string[], unknown>;
118
+ status: z.ZodEnum<["active", "archived"]>;
119
+ createdDate: z.ZodEffects<z.ZodString, string, string>;
120
+ updatedDate: z.ZodEffects<z.ZodString, string, string>;
121
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
122
+ id: z.ZodString;
123
+ title: z.ZodEffects<z.ZodNullable<z.ZodString>, string | null, unknown>;
124
+ content: z.ZodEffects<z.ZodString, string, string>;
125
+ tags: z.ZodEffects<z.ZodArray<z.ZodString, "many">, string[], unknown>;
126
+ status: z.ZodEnum<["active", "archived"]>;
127
+ createdDate: z.ZodEffects<z.ZodString, string, string>;
128
+ updatedDate: z.ZodEffects<z.ZodString, string, string>;
129
+ }, z.ZodTypeAny, "passthrough">>;
130
+ type Note = z.infer<typeof NoteSchema>;
131
+
105
132
  declare const BlockerSchema: z.ZodObject<{
106
133
  name: z.ZodString;
107
134
  cleared: z.ZodOptional<z.ZodBoolean>;
@@ -378,6 +405,10 @@ declare const ISSUE_STATUSES: readonly ["open", "inprogress", "resolved"];
378
405
  type IssueStatus = (typeof ISSUE_STATUSES)[number];
379
406
  declare const ISSUE_SEVERITIES: readonly ["critical", "high", "medium", "low"];
380
407
  type IssueSeverity = (typeof ISSUE_SEVERITIES)[number];
408
+ declare const NOTE_STATUSES: readonly ["active", "archived"];
409
+ type NoteStatus = (typeof NOTE_STATUSES)[number];
410
+ declare const NOTE_ID_REGEX: RegExp;
411
+ declare const NoteIdSchema: z.ZodString;
381
412
  declare const OUTPUT_FORMATS: readonly ["json", "md"];
382
413
  type OutputFormat = (typeof OUTPUT_FORMATS)[number];
383
414
  declare const ERROR_CODES: readonly ["not_found", "validation_failed", "io_error", "project_corrupt", "invalid_input", "conflict", "version_mismatch"];
@@ -395,6 +426,7 @@ type PhaseStatus = "notstarted" | "inprogress" | "complete";
395
426
  declare class ProjectState {
396
427
  readonly tickets: readonly Ticket[];
397
428
  readonly issues: readonly Issue[];
429
+ readonly notes: readonly Note[];
398
430
  readonly roadmap: Readonly<Roadmap>;
399
431
  readonly config: Readonly<Config>;
400
432
  readonly handoverFilenames: readonly string[];
@@ -407,14 +439,18 @@ declare class ProjectState {
407
439
  private readonly reverseBlocksMap;
408
440
  private readonly ticketsByID;
409
441
  private readonly issuesByID;
442
+ private readonly notesByID;
410
443
  readonly totalTicketCount: number;
411
444
  readonly openTicketCount: number;
412
445
  readonly completeTicketCount: number;
413
446
  readonly openIssueCount: number;
414
447
  readonly issuesBySeverity: ReadonlyMap<IssueSeverity, number>;
448
+ readonly activeNoteCount: number;
449
+ readonly archivedNoteCount: number;
415
450
  constructor(input: {
416
451
  tickets: Ticket[];
417
452
  issues: Issue[];
453
+ notes: Note[];
418
454
  roadmap: Roadmap;
419
455
  config: Config;
420
456
  handoverFilenames: string[];
@@ -435,6 +471,7 @@ declare class ProjectState {
435
471
  get blockedCount(): number;
436
472
  ticketByID(id: string): Ticket | undefined;
437
473
  issueByID(id: string): Issue | undefined;
474
+ noteByID(id: string): Note | undefined;
438
475
  /** IDs of tickets that list `ticketId` in their blockedBy. */
439
476
  ticketsBlocking(ticketId: string): string[];
440
477
  /** IDs of tickets that have `ticketId` as their parentTicket. */
@@ -518,6 +555,13 @@ declare function deleteTicket(id: string, root: string, options?: {
518
555
  force?: boolean;
519
556
  }): Promise<void>;
520
557
  declare function deleteIssue(id: string, root: string): Promise<void>;
558
+ /**
559
+ * Writes a note file WITHOUT acquiring the project lock.
560
+ * Use inside withProjectLock when the lock is already held.
561
+ */
562
+ declare function writeNoteUnlocked(note: Note, root: string): Promise<void>;
563
+ declare function writeNote(note: Note, root: string): Promise<void>;
564
+ declare function deleteNote(id: string, root: string): Promise<void>;
521
565
  interface WithProjectLockOptions {
522
566
  strict?: boolean;
523
567
  }
@@ -618,6 +662,25 @@ interface NextTicketEmpty {
618
662
  readonly kind: "empty_project";
619
663
  }
620
664
  type NextTicketOutcome = NextTicketResult | NextTicketAllComplete | NextTicketAllBlocked | NextTicketEmpty;
665
+ interface NextTicketCandidate {
666
+ readonly ticket: Ticket;
667
+ readonly unblockImpact: UnblockImpact;
668
+ readonly umbrellaProgress: UmbrellaProgress | null;
669
+ }
670
+ interface SkippedBlockedPhase {
671
+ readonly phaseId: string;
672
+ readonly blockedCount: number;
673
+ }
674
+ interface NextTicketsResult {
675
+ readonly kind: "found";
676
+ readonly candidates: readonly NextTicketCandidate[];
677
+ readonly skippedBlockedPhases: readonly SkippedBlockedPhase[];
678
+ }
679
+ interface NextTicketsAllBlocked {
680
+ readonly kind: "all_blocked";
681
+ readonly phases: readonly SkippedBlockedPhase[];
682
+ }
683
+ type NextTicketsOutcome = NextTicketsResult | NextTicketsAllBlocked | NextTicketAllComplete | NextTicketEmpty;
621
684
  interface PhaseWithStatus {
622
685
  readonly phase: Phase;
623
686
  readonly status: PhaseStatus;
@@ -629,6 +692,12 @@ interface PhaseWithStatus {
629
692
  * Returns discriminated outcome for exhaustive handling.
630
693
  */
631
694
  declare function nextTicket(state: ProjectState): NextTicketOutcome;
695
+ /**
696
+ * Up to `count` unblocked leaf tickets across all non-complete phases
697
+ * (roadmap order). Unlike nextTicket, continues past fully-blocked phases
698
+ * and collects multiple candidates within the same phase.
699
+ */
700
+ declare function nextTickets(state: ProjectState, count: number): NextTicketsOutcome;
632
701
  /**
633
702
  * All currently blocked incomplete leaf tickets.
634
703
  */
@@ -656,6 +725,35 @@ declare function phasesWithStatus(state: ProjectState): readonly PhaseWithStatus
656
725
  * Legacy: cleared boolean. New: clearedDate non-null.
657
726
  */
658
727
  declare function isBlockerCleared(blocker: Blocker): boolean;
728
+ /**
729
+ * All descendant leaf tickets of an umbrella (recursive).
730
+ * Public wrapper around the private cycle-safe helper.
731
+ */
732
+ declare function descendantLeaves(ticketId: string, state: ProjectState): Ticket[];
733
+
734
+ /**
735
+ * Context-aware work recommendation engine.
736
+ *
737
+ * Unlike nextTicket (queue-based, phase order), recommend considers the full
738
+ * project state and suggests a ranked list mixing tickets and issues, each
739
+ * with a human-readable rationale.
740
+ */
741
+
742
+ type RecommendCategory = "validation_errors" | "critical_issue" | "inprogress_ticket" | "high_impact_unblock" | "near_complete_umbrella" | "phase_momentum" | "quick_win" | "open_issue";
743
+ type RecommendItemKind = "ticket" | "issue" | "action";
744
+ interface Recommendation {
745
+ readonly id: string;
746
+ readonly kind: RecommendItemKind;
747
+ readonly title: string;
748
+ readonly category: RecommendCategory;
749
+ readonly reason: string;
750
+ readonly score: number;
751
+ }
752
+ interface RecommendResult {
753
+ readonly recommendations: readonly Recommendation[];
754
+ readonly totalCandidates: number;
755
+ }
756
+ declare function recommend(state: ProjectState, count: number): RecommendResult;
659
757
 
660
758
  /**
661
759
  * Next ticket ID: scan existing IDs, find max numeric part, return T-(max+1).
@@ -668,6 +766,11 @@ declare function nextTicketID(tickets: readonly Ticket[]): string;
668
766
  * Zero-padded to 3 digits minimum.
669
767
  */
670
768
  declare function nextIssueID(issues: readonly Issue[]): string;
769
+ /**
770
+ * Next note ID: scan existing IDs, find max numeric part, return N-(max+1).
771
+ * Zero-padded to 3 digits minimum.
772
+ */
773
+ declare function nextNoteID(notes: readonly Note[]): string;
671
774
  /**
672
775
  * Next order value for a phase: max leaf ticket order + 10, or 10 if empty.
673
776
  */
@@ -1018,6 +1121,31 @@ declare const SnapshotV1Schema: z.ZodObject<{
1018
1121
  assignedTo: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1019
1122
  lastModifiedBy: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1020
1123
  }, z.ZodTypeAny, "passthrough">>, "many">;
1124
+ notes: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
1125
+ id: z.ZodString;
1126
+ title: z.ZodEffects<z.ZodNullable<z.ZodString>, string | null, unknown>;
1127
+ content: z.ZodEffects<z.ZodString, string, string>;
1128
+ tags: z.ZodEffects<z.ZodArray<z.ZodString, "many">, string[], unknown>;
1129
+ status: z.ZodEnum<["active", "archived"]>;
1130
+ createdDate: z.ZodEffects<z.ZodString, string, string>;
1131
+ updatedDate: z.ZodEffects<z.ZodString, string, string>;
1132
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
1133
+ id: z.ZodString;
1134
+ title: z.ZodEffects<z.ZodNullable<z.ZodString>, string | null, unknown>;
1135
+ content: z.ZodEffects<z.ZodString, string, string>;
1136
+ tags: z.ZodEffects<z.ZodArray<z.ZodString, "many">, string[], unknown>;
1137
+ status: z.ZodEnum<["active", "archived"]>;
1138
+ createdDate: z.ZodEffects<z.ZodString, string, string>;
1139
+ updatedDate: z.ZodEffects<z.ZodString, string, string>;
1140
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
1141
+ id: z.ZodString;
1142
+ title: z.ZodEffects<z.ZodNullable<z.ZodString>, string | null, unknown>;
1143
+ content: z.ZodEffects<z.ZodString, string, string>;
1144
+ tags: z.ZodEffects<z.ZodArray<z.ZodString, "many">, string[], unknown>;
1145
+ status: z.ZodEnum<["active", "archived"]>;
1146
+ createdDate: z.ZodEffects<z.ZodString, string, string>;
1147
+ updatedDate: z.ZodEffects<z.ZodString, string, string>;
1148
+ }, z.ZodTypeAny, "passthrough">>, "many">>>;
1021
1149
  warnings: z.ZodOptional<z.ZodArray<z.ZodObject<{
1022
1150
  type: z.ZodString;
1023
1151
  file: z.ZodString;
@@ -1088,6 +1216,15 @@ declare const SnapshotV1Schema: z.ZodObject<{
1088
1216
  };
1089
1217
  version: 1;
1090
1218
  project: string;
1219
+ notes: z.objectOutputType<{
1220
+ id: z.ZodString;
1221
+ title: z.ZodEffects<z.ZodNullable<z.ZodString>, string | null, unknown>;
1222
+ content: z.ZodEffects<z.ZodString, string, string>;
1223
+ tags: z.ZodEffects<z.ZodArray<z.ZodString, "many">, string[], unknown>;
1224
+ status: z.ZodEnum<["active", "archived"]>;
1225
+ createdDate: z.ZodEffects<z.ZodString, string, string>;
1226
+ updatedDate: z.ZodEffects<z.ZodString, string, string>;
1227
+ }, z.ZodTypeAny, "passthrough">[];
1091
1228
  createdAt: string;
1092
1229
  config: {
1093
1230
  type: string;
@@ -1188,6 +1325,15 @@ declare const SnapshotV1Schema: z.ZodObject<{
1188
1325
  } & {
1189
1326
  [k: string]: unknown;
1190
1327
  };
1328
+ notes?: z.objectInputType<{
1329
+ id: z.ZodString;
1330
+ title: z.ZodEffects<z.ZodNullable<z.ZodString>, string | null, unknown>;
1331
+ content: z.ZodEffects<z.ZodString, string, string>;
1332
+ tags: z.ZodEffects<z.ZodArray<z.ZodString, "many">, string[], unknown>;
1333
+ status: z.ZodEnum<["active", "archived"]>;
1334
+ createdDate: z.ZodEffects<z.ZodString, string, string>;
1335
+ updatedDate: z.ZodEffects<z.ZodString, string, string>;
1336
+ }, z.ZodTypeAny, "passthrough">[] | undefined;
1191
1337
  warnings?: {
1192
1338
  message: string;
1193
1339
  type: string;
@@ -1232,6 +1378,15 @@ interface PhaseChange {
1232
1378
  from: string;
1233
1379
  to: string;
1234
1380
  }
1381
+ interface ContentChange {
1382
+ id: string;
1383
+ title: string;
1384
+ }
1385
+ interface NoteChange {
1386
+ id: string;
1387
+ title: string | null;
1388
+ changedFields: string[];
1389
+ }
1235
1390
  interface SnapshotDiff {
1236
1391
  tickets: {
1237
1392
  added: Array<{
@@ -1243,6 +1398,7 @@ interface SnapshotDiff {
1243
1398
  title: string;
1244
1399
  }>;
1245
1400
  statusChanged: TicketChange[];
1401
+ descriptionChanged: ContentChange[];
1246
1402
  };
1247
1403
  issues: {
1248
1404
  added: Array<{
@@ -1254,6 +1410,7 @@ interface SnapshotDiff {
1254
1410
  title: string;
1255
1411
  }>;
1256
1412
  statusChanged: IssueChange[];
1413
+ impactChanged: ContentChange[];
1257
1414
  };
1258
1415
  blockers: {
1259
1416
  added: string[];
@@ -1270,6 +1427,17 @@ interface SnapshotDiff {
1270
1427
  }>;
1271
1428
  statusChanged: PhaseChange[];
1272
1429
  };
1430
+ notes: {
1431
+ added: Array<{
1432
+ id: string;
1433
+ title: string | null;
1434
+ }>;
1435
+ removed: Array<{
1436
+ id: string;
1437
+ title: string | null;
1438
+ }>;
1439
+ updated: NoteChange[];
1440
+ };
1273
1441
  }
1274
1442
  interface RecapResult {
1275
1443
  snapshot: {
@@ -1374,5 +1542,6 @@ declare function formatSnapshotResult(result: {
1374
1542
  }, format: OutputFormat): string;
1375
1543
  declare function formatRecap(recap: RecapResult, state: ProjectState, format: OutputFormat): string;
1376
1544
  declare function formatExport(state: ProjectState, mode: "all" | "phase", phaseId: string | null, format: OutputFormat): string;
1545
+ declare function formatRecommendations(result: RecommendResult, format: OutputFormat): string;
1377
1546
 
1378
- export { type Blocker, BlockerSchema, CURRENT_SCHEMA_VERSION, type Config, ConfigSchema, DATE_REGEX, DateSchema, ERROR_CODES, type ErrorCode, type ErrorEnvelope, ExitCode, type ExitCodeValue, type Features, FeaturesSchema, INTEGRITY_WARNING_TYPES, ISSUE_ID_REGEX, ISSUE_SEVERITIES, ISSUE_STATUSES, type InitOptions, type InitResult, type Issue, IssueIdSchema, IssueSchema, type IssueSeverity, type IssueStatus, type LoadOptions, type LoadResult, type LoadWarning, type LoadWarningType, type NextTicketAllBlocked, type NextTicketAllComplete, type NextTicketEmpty, type NextTicketOutcome, type NextTicketResult, OUTPUT_FORMATS, type OutputFormat, type PartialEnvelope, type Phase, PhaseSchema, type PhaseStatus, type PhaseWithStatus, ProjectLoaderError, ProjectState, type RecapResult, type Roadmap, RoadmapSchema, type SnapshotDiff, type SnapshotV1, SnapshotV1Schema, type SuccessEnvelope, TICKET_ID_REGEX, TICKET_STATUSES, TICKET_TYPES, type Ticket, TicketIdSchema, TicketSchema, type TicketStatus, type TicketType, type UmbrellaProgress, type UnblockImpact, type ValidationFinding, type ValidationLevel, type ValidationResult, type WithProjectLockOptions, atomicWrite, blockedTickets, buildRecap, currentPhase, deleteIssue, deleteTicket, diffStates, discoverProjectRoot, errorEnvelope, escapeMarkdownInline, extractHandoverDate, fencedBlock, formatBlockedTickets, formatBlockerList, formatError, formatExport, formatHandoverContent, formatHandoverCreateResult, formatHandoverList, formatInitResult, formatIssue, formatIssueList, formatNextTicketOutcome, formatPhaseList, formatPhaseTickets, formatRecap, formatSnapshotResult, formatStatus, formatTicket, formatTicketList, formatValidation, guardPath, initProject, isBlockerCleared, listHandovers, loadLatestSnapshot, loadProject, mergeValidation, nextIssueID, nextOrder, nextTicket, nextTicketID, partialEnvelope, phasesWithStatus, readHandover, runTransaction, runTransactionUnlocked, saveSnapshot, serializeJSON, sortKeysDeep, successEnvelope, ticketsUnblockedBy, umbrellaProgress, validateProject, withProjectLock, writeConfig, writeIssue, writeIssueUnlocked, writeRoadmap, writeRoadmapUnlocked, writeTicket, writeTicketUnlocked };
1547
+ export { type Blocker, BlockerSchema, CURRENT_SCHEMA_VERSION, type Config, ConfigSchema, DATE_REGEX, DateSchema, ERROR_CODES, type ErrorCode, type ErrorEnvelope, ExitCode, type ExitCodeValue, type Features, FeaturesSchema, INTEGRITY_WARNING_TYPES, ISSUE_ID_REGEX, ISSUE_SEVERITIES, ISSUE_STATUSES, type InitOptions, type InitResult, type Issue, IssueIdSchema, IssueSchema, type IssueSeverity, type IssueStatus, type LoadOptions, type LoadResult, type LoadWarning, type LoadWarningType, NOTE_ID_REGEX, NOTE_STATUSES, type NextTicketAllBlocked, type NextTicketAllComplete, type NextTicketEmpty, type NextTicketOutcome, type NextTicketResult, type Note, NoteIdSchema, NoteSchema, type NoteStatus, OUTPUT_FORMATS, type OutputFormat, type PartialEnvelope, type Phase, PhaseSchema, type PhaseStatus, type PhaseWithStatus, ProjectLoaderError, ProjectState, type RecapResult, type RecommendCategory, type RecommendItemKind, type RecommendResult, type Recommendation, type Roadmap, RoadmapSchema, type SnapshotDiff, type SnapshotV1, SnapshotV1Schema, type SuccessEnvelope, TICKET_ID_REGEX, TICKET_STATUSES, TICKET_TYPES, type Ticket, TicketIdSchema, TicketSchema, type TicketStatus, type TicketType, type UmbrellaProgress, type UnblockImpact, type ValidationFinding, type ValidationLevel, type ValidationResult, type WithProjectLockOptions, atomicWrite, blockedTickets, buildRecap, currentPhase, deleteIssue, deleteNote, deleteTicket, descendantLeaves, diffStates, discoverProjectRoot, errorEnvelope, escapeMarkdownInline, extractHandoverDate, fencedBlock, formatBlockedTickets, formatBlockerList, formatError, formatExport, formatHandoverContent, formatHandoverCreateResult, formatHandoverList, formatInitResult, formatIssue, formatIssueList, formatNextTicketOutcome, formatPhaseList, formatPhaseTickets, formatRecap, formatRecommendations, formatSnapshotResult, formatStatus, formatTicket, formatTicketList, formatValidation, guardPath, initProject, isBlockerCleared, listHandovers, loadLatestSnapshot, loadProject, mergeValidation, nextIssueID, nextNoteID, nextOrder, nextTicket, nextTicketID, nextTickets, partialEnvelope, phasesWithStatus, readHandover, recommend, runTransaction, runTransactionUnlocked, saveSnapshot, serializeJSON, sortKeysDeep, successEnvelope, ticketsUnblockedBy, umbrellaProgress, validateProject, withProjectLock, writeConfig, writeIssue, writeIssueUnlocked, writeNote, writeNoteUnlocked, writeRoadmap, writeRoadmapUnlocked, writeTicket, writeTicketUnlocked };