botnote 0.2.16 → 0.2.18

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 (136) hide show
  1. package/README.md +24 -504
  2. package/dist/bin.js +16 -9
  3. package/dist/bin.js.map +1 -1
  4. package/dist/config.d.ts +0 -4
  5. package/dist/config.js +0 -31
  6. package/dist/config.js.map +1 -1
  7. package/dist/mcp/server.js +1 -1
  8. package/dist/mcp/server.js.map +1 -1
  9. package/dist/mcp/stdio.d.ts +8 -0
  10. package/dist/mcp/stdio.js +46 -0
  11. package/dist/mcp/stdio.js.map +1 -0
  12. package/package.json +8 -40
  13. package/dist/cli.d.ts +0 -1
  14. package/dist/cli.js +0 -186
  15. package/dist/cli.js.map +0 -1
  16. package/dist/db/client.d.ts +0 -14
  17. package/dist/db/client.js +0 -16
  18. package/dist/db/client.js.map +0 -1
  19. package/dist/db/migrate.d.ts +0 -1
  20. package/dist/db/migrate.js +0 -57
  21. package/dist/db/migrate.js.map +0 -1
  22. package/dist/db/migrations/0001_init.sql +0 -89
  23. package/dist/db/migrations/0002_tasks_due_at.sql +0 -16
  24. package/dist/db/migrations/0003_task_priority_and_sequence.sql +0 -45
  25. package/dist/db/migrations/0004_pinned.sql +0 -8
  26. package/dist/db/migrations/0005_nullable_title_and_parent.sql +0 -5
  27. package/dist/db/migrations/0006_project_color_icon.sql +0 -3
  28. package/dist/db/migrations/0007_tokens.sql +0 -14
  29. package/dist/db/migrations/0008_simplify_kinds_drop_actors.sql +0 -21
  30. package/dist/db/migrations/0009_sessions.sql +0 -14
  31. package/dist/db/migrations/0010_completed_at.sql +0 -17
  32. package/dist/db/migrations/0011_completed_at_backfill_fix.sql +0 -14
  33. package/dist/db/migrations/0012_completed_at_backfill_due.sql +0 -16
  34. package/dist/db/migrations/0013_due_at_noon_utc.sql +0 -13
  35. package/dist/db/migrations/0014_recoverable_api_tokens.sql +0 -3
  36. package/dist/db/migrations/0015_collapse_delayed_archived_statuses.sql +0 -18
  37. package/dist/db/migrations/0016_embedding_settings.sql +0 -23
  38. package/dist/db/migrations/0017_recurrence_rules.sql +0 -55
  39. package/dist/db/migrations/0018_project_archived_at.sql +0 -8
  40. package/dist/db/migrations/0019_project_status.sql +0 -20
  41. package/dist/db/migrations/0020_project_archived_status.sql +0 -20
  42. package/dist/db/migrations/0021_workspace_settings.sql +0 -18
  43. package/dist/db/migrations/0022_recurrence_split.sql +0 -13
  44. package/dist/db/migrations/0023_comment_kind.sql +0 -24
  45. package/dist/db/migrations/0024_memory_access.sql +0 -12
  46. package/dist/db/migrations/0025_soft_delete.sql +0 -12
  47. package/dist/db/migrations/0026_sequence_counter.sql +0 -61
  48. package/dist/db/migrations/0027_self_parent_repair.sql +0 -10
  49. package/dist/db/migrations/0028_workspaces.sql +0 -65
  50. package/dist/db/migrations/0029_drop_global_uniques.sql +0 -38
  51. package/dist/db/migrations/0030_entity_actor_token.sql +0 -12
  52. package/dist/db/migrations/0031_entity_revisions.sql +0 -19
  53. package/dist/db/migrations/0032_touch_respects_explicit_updated_at.sql +0 -18
  54. package/dist/db/migrations/0033_worklog_kind.sql +0 -42
  55. package/dist/db/schema.d.ts +0 -2023
  56. package/dist/db/schema.js +0 -245
  57. package/dist/db/schema.js.map +0 -1
  58. package/dist/rest/attribution.d.ts +0 -22
  59. package/dist/rest/attribution.js +0 -62
  60. package/dist/rest/attribution.js.map +0 -1
  61. package/dist/rest/auth.d.ts +0 -47
  62. package/dist/rest/auth.js +0 -116
  63. package/dist/rest/auth.js.map +0 -1
  64. package/dist/rest/routes.d.ts +0 -3
  65. package/dist/rest/routes.js +0 -844
  66. package/dist/rest/routes.js.map +0 -1
  67. package/dist/rest/server.d.ts +0 -28
  68. package/dist/rest/server.js +0 -276
  69. package/dist/rest/server.js.map +0 -1
  70. package/dist/service/blockers.d.ts +0 -37
  71. package/dist/service/blockers.js +0 -46
  72. package/dist/service/blockers.js.map +0 -1
  73. package/dist/service/dates.d.ts +0 -19
  74. package/dist/service/dates.js +0 -52
  75. package/dist/service/dates.js.map +0 -1
  76. package/dist/service/embedding.d.ts +0 -75
  77. package/dist/service/embedding.js +0 -318
  78. package/dist/service/embedding.js.map +0 -1
  79. package/dist/service/embedding_settings.d.ts +0 -16
  80. package/dist/service/embedding_settings.js +0 -82
  81. package/dist/service/embedding_settings.js.map +0 -1
  82. package/dist/service/entities.d.ts +0 -96
  83. package/dist/service/entities.js +0 -628
  84. package/dist/service/entities.js.map +0 -1
  85. package/dist/service/feedback.d.ts +0 -13
  86. package/dist/service/feedback.js +0 -50
  87. package/dist/service/feedback.js.map +0 -1
  88. package/dist/service/hierarchy.d.ts +0 -31
  89. package/dist/service/hierarchy.js +0 -76
  90. package/dist/service/hierarchy.js.map +0 -1
  91. package/dist/service/index.d.ts +0 -10
  92. package/dist/service/index.js +0 -10
  93. package/dist/service/index.js.map +0 -1
  94. package/dist/service/locks.d.ts +0 -25
  95. package/dist/service/locks.js +0 -34
  96. package/dist/service/locks.js.map +0 -1
  97. package/dist/service/opening_brief.d.ts +0 -24
  98. package/dist/service/opening_brief.js +0 -210
  99. package/dist/service/opening_brief.js.map +0 -1
  100. package/dist/service/projects.d.ts +0 -9
  101. package/dist/service/projects.js +0 -59
  102. package/dist/service/projects.js.map +0 -1
  103. package/dist/service/recurrence.d.ts +0 -93
  104. package/dist/service/recurrence.js +0 -799
  105. package/dist/service/recurrence.js.map +0 -1
  106. package/dist/service/revisions.d.ts +0 -31
  107. package/dist/service/revisions.js +0 -53
  108. package/dist/service/revisions.js.map +0 -1
  109. package/dist/service/scope.d.ts +0 -14
  110. package/dist/service/scope.js +0 -19
  111. package/dist/service/scope.js.map +0 -1
  112. package/dist/service/search.d.ts +0 -34
  113. package/dist/service/search.js +0 -198
  114. package/dist/service/search.js.map +0 -1
  115. package/dist/service/sessions.d.ts +0 -24
  116. package/dist/service/sessions.js +0 -89
  117. package/dist/service/sessions.js.map +0 -1
  118. package/dist/service/tasks.d.ts +0 -48
  119. package/dist/service/tasks.js +0 -354
  120. package/dist/service/tasks.js.map +0 -1
  121. package/dist/service/tokens.d.ts +0 -21
  122. package/dist/service/tokens.js +0 -71
  123. package/dist/service/tokens.js.map +0 -1
  124. package/dist/service/transfer.d.ts +0 -64
  125. package/dist/service/transfer.js +0 -629
  126. package/dist/service/transfer.js.map +0 -1
  127. package/dist/service/types.d.ts +0 -772
  128. package/dist/service/types.js +0 -274
  129. package/dist/service/types.js.map +0 -1
  130. package/dist/service/workspace_settings.d.ts +0 -9
  131. package/dist/service/workspace_settings.js +0 -49
  132. package/dist/service/workspace_settings.js.map +0 -1
  133. package/web/dist/assets/index-C0u0ZrR4.css +0 -1
  134. package/web/dist/assets/index-sCiJNYQ3.js +0 -235
  135. package/web/dist/favicon.svg +0 -13
  136. package/web/dist/index.html +0 -22
@@ -1,93 +0,0 @@
1
- import rrulePkg from "rrule";
2
- import type { Database } from "../db/client.js";
3
- import { type Entity, type RecurrenceRule } from "../db/schema.js";
4
- import type { Scope } from "./scope.js";
5
- import type { RecurrenceInput, SplitRecurrenceInput, StopRecurrenceInput, UpdateRecurrenceInput } from "./types.js";
6
- type BaselineFields = {
7
- title?: string | null;
8
- body?: string;
9
- tags?: string[];
10
- priority?: string;
11
- };
12
- export type ContentFieldKey = "title" | "body" | "tags" | "priority";
13
- interface RecurrenceMarker {
14
- ruleId: string;
15
- seriesId: string;
16
- role: "occurrence";
17
- occurrenceAt: string;
18
- occurrenceIndex: number;
19
- }
20
- export interface RecurrenceDetails {
21
- rule: RecurrenceRule;
22
- currentOccurrence: Entity | null;
23
- }
24
- export declare function recurrenceMarker(e: Entity): Partial<RecurrenceMarker> | null;
25
- export declare function buildRRule(rule: Pick<RecurrenceRule, "rrule" | "dtstart">, dtstart?: Date): rrulePkg.RRule;
26
- /**
27
- * Normalize a computed occurrence date for storage.
28
- * - All-day rules: resolve the calendar day as seen in the rule's timezone,
29
- * then snap to noon UTC (so the intended local calendar day is preserved
30
- * across all UTC-offset clients).
31
- * - Timed rules: use normalizeDueAt (exact-midnight-UTC -> noon-UTC heuristic).
32
- */
33
- export declare function normalizeOccurrenceDueAt(rule: Pick<RecurrenceRule, "allDay" | "timezone">, date: Date): Date;
34
- export declare function findRuleForTask(db: Database["db"], task: Entity, includeDisabled?: boolean): Promise<RecurrenceRule | null>;
35
- export declare function getRecurrenceForTask(scope: Scope, db: Database["db"], taskId: string): Promise<RecurrenceDetails | null>;
36
- export declare function createRecurrenceRule(scope: Scope, db: Database["db"], taskId: string, input: RecurrenceInput): Promise<RecurrenceRule>;
37
- export declare function updateRecurrenceRule(scope: Scope, db: Database["db"], ruleId: string, input: UpdateRecurrenceInput): Promise<RecurrenceRule>;
38
- /**
39
- * Upsert a 'modified' exception row recording the pre-edit (baseline) values
40
- * of content fields for this occurrence. Uses earliest-wins merge: only
41
- * adds a field to baseline if not already present.
42
- */
43
- export declare function upsertModifiedExceptionBaseline(db: Database["db"], rule: RecurrenceRule, occurrence: Entity, preEditValues: BaselineFields, changedFields: ContentFieldKey[]): Promise<void>;
44
- /**
45
- * Remove the given fields from an existing 'modified' exception's baseline.
46
- * If baseline becomes empty after removal, delete the row.
47
- */
48
- export declare function clearModifiedExceptionFields(db: Database["db"], _rule: RecurrenceRule, occurrence: Entity, changedFields: ContentFieldKey[]): Promise<void>;
49
- /**
50
- * Create the occurrences every scheduled-anchor rule owes up to `upTo`.
51
- *
52
- * Each rule is processed in its own transaction under SELECT ... FOR UPDATE
53
- * SKIP LOCKED: a concurrent pass (another daemon instance, or the startup
54
- * pass overlapping the interval timer) skips rules already being advanced
55
- * instead of waiting and then re-generating the same occurrences with a
56
- * double-bumped generated_count.
57
- */
58
- export declare function materializeScheduledRecurrences(db: Database["db"], upTo: Date, limit?: number): Promise<Entity[]>;
59
- export declare function advanceRecurrenceOnCompletion(db: Database["db"], occurrence: Entity, completedAt?: Date): Promise<Entity | null>;
60
- export declare function skipOccurrence(scope: Scope, db: Database["db"], taskId: string, input?: {
61
- reason?: string;
62
- actorKind?: string;
63
- }): Promise<{
64
- skipped: Entity;
65
- next: Entity | null;
66
- rule: RecurrenceRule;
67
- }>;
68
- export declare function stopRecurrence(scope: Scope, db: Database["db"], ruleId: string, _input?: StopRecurrenceInput): Promise<RecurrenceRule>;
69
- /**
70
- * Fork a recurrence series at its current occurrence: freeze the old rule and
71
- * apply a new cadence going forward, keeping the same series so the UI still
72
- * shows one continuous timeline (history + future).
73
- *
74
- * Mechanics:
75
- * - The old rule is bounded with UNTIL at the fork point and disabled. It stays
76
- * as frozen history (its already-materialized occurrences are untouched).
77
- * - A new enabled rule is created sharing the SAME series_id (UI continuity)
78
- * with the new RRULE. The live occurrence is kept as its template/display
79
- * source.
80
- * - The new rule has a distinct id, so its occurrences live in a disjoint
81
- * idempotency-key space (`recurrence:<ruleId>:<dueAt>`): no duplicate or
82
- * orphan occurrence can appear at the fork even if a date coincides.
83
- * - Scheduled forks let the materializer grow the new rule from the first
84
- * occurrence after the fork; the live occurrence stays on the old rule as the
85
- * tail of history. Completion forks re-home the live occurrence onto the new
86
- * rule so completing it advances the new cadence.
87
- *
88
- * The whole operation runs in one transaction: the old rule is disabled before
89
- * the new one is inserted, so the partial-unique "one enabled rule per series"
90
- * index holds at every step.
91
- */
92
- export declare function splitRecurrence(scope: Scope, db: Database["db"], ruleId: string, input: SplitRecurrenceInput): Promise<RecurrenceRule>;
93
- export {};