@rewrlution/papyrus-cli 0.0.1

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 (125) hide show
  1. package/README.md +699 -0
  2. package/dist/cli.d.ts +2 -0
  3. package/dist/cli.js +16 -0
  4. package/dist/cli.js.map +1 -0
  5. package/dist/commands/auth/index.d.ts +2 -0
  6. package/dist/commands/auth/index.js +18 -0
  7. package/dist/commands/auth/index.js.map +1 -0
  8. package/dist/commands/auth/login.d.ts +1 -0
  9. package/dist/commands/auth/login.js +8 -0
  10. package/dist/commands/auth/login.js.map +1 -0
  11. package/dist/commands/auth/logout.d.ts +1 -0
  12. package/dist/commands/auth/logout.js +5 -0
  13. package/dist/commands/auth/logout.js.map +1 -0
  14. package/dist/commands/auth/register.d.ts +1 -0
  15. package/dist/commands/auth/register.js +8 -0
  16. package/dist/commands/auth/register.js.map +1 -0
  17. package/dist/commands/index.d.ts +2 -0
  18. package/dist/commands/index.js +3 -0
  19. package/dist/commands/index.js.map +1 -0
  20. package/dist/commands/journal/add.d.ts +2 -0
  21. package/dist/commands/journal/add.js +5 -0
  22. package/dist/commands/journal/add.js.map +1 -0
  23. package/dist/commands/journal/amend.d.ts +2 -0
  24. package/dist/commands/journal/amend.js +5 -0
  25. package/dist/commands/journal/amend.js.map +1 -0
  26. package/dist/commands/journal/edit.d.ts +6 -0
  27. package/dist/commands/journal/edit.js +60 -0
  28. package/dist/commands/journal/edit.js.map +1 -0
  29. package/dist/commands/journal/index.d.ts +2 -0
  30. package/dist/commands/journal/index.js +32 -0
  31. package/dist/commands/journal/index.js.map +1 -0
  32. package/dist/commands/journal/list.d.ts +1 -0
  33. package/dist/commands/journal/list.js +20 -0
  34. package/dist/commands/journal/list.js.map +1 -0
  35. package/dist/commands/journal/show.d.ts +2 -0
  36. package/dist/commands/journal/show.js +35 -0
  37. package/dist/commands/journal/show.js.map +1 -0
  38. package/dist/commands/journal/sync.d.ts +1 -0
  39. package/dist/commands/journal/sync.js +9 -0
  40. package/dist/commands/journal/sync.js.map +1 -0
  41. package/dist/commands/types.d.ts +9 -0
  42. package/dist/commands/types.js +2 -0
  43. package/dist/commands/types.js.map +1 -0
  44. package/dist/components/Browser.d.ts +29 -0
  45. package/dist/components/Browser.js +124 -0
  46. package/dist/components/Browser.js.map +1 -0
  47. package/dist/components/BrowserFooter.d.ts +6 -0
  48. package/dist/components/BrowserFooter.js +6 -0
  49. package/dist/components/BrowserFooter.js.map +1 -0
  50. package/dist/components/BrowserHeader.d.ts +6 -0
  51. package/dist/components/BrowserHeader.js +6 -0
  52. package/dist/components/BrowserHeader.js.map +1 -0
  53. package/dist/components/ColdStart.d.ts +6 -0
  54. package/dist/components/ColdStart.js +24 -0
  55. package/dist/components/ColdStart.js.map +1 -0
  56. package/dist/components/FormInput.d.ts +10 -0
  57. package/dist/components/FormInput.js +7 -0
  58. package/dist/components/FormInput.js.map +1 -0
  59. package/dist/components/JournalListView.d.ts +10 -0
  60. package/dist/components/JournalListView.js +40 -0
  61. package/dist/components/JournalListView.js.map +1 -0
  62. package/dist/components/JournalViewer.d.ts +32 -0
  63. package/dist/components/JournalViewer.js +146 -0
  64. package/dist/components/JournalViewer.js.map +1 -0
  65. package/dist/components/LoginForm.d.ts +1 -0
  66. package/dist/components/LoginForm.js +68 -0
  67. package/dist/components/LoginForm.js.map +1 -0
  68. package/dist/components/Logo.d.ts +1 -0
  69. package/dist/components/Logo.js +57 -0
  70. package/dist/components/Logo.js.map +1 -0
  71. package/dist/components/RegisterForm.d.ts +1 -0
  72. package/dist/components/RegisterForm.js +72 -0
  73. package/dist/components/RegisterForm.js.map +1 -0
  74. package/dist/components/StatusMessage.d.ts +7 -0
  75. package/dist/components/StatusMessage.js +19 -0
  76. package/dist/components/StatusMessage.js.map +1 -0
  77. package/dist/components/SyncProgress.d.ts +1 -0
  78. package/dist/components/SyncProgress.js +46 -0
  79. package/dist/components/SyncProgress.js.map +1 -0
  80. package/dist/lib/api/api-client.d.ts +23 -0
  81. package/dist/lib/api/api-client.js +111 -0
  82. package/dist/lib/api/api-client.js.map +1 -0
  83. package/dist/lib/api/index.d.ts +3 -0
  84. package/dist/lib/api/index.js +6 -0
  85. package/dist/lib/api/index.js.map +1 -0
  86. package/dist/lib/auth/index.d.ts +1 -0
  87. package/dist/lib/auth/index.js +2 -0
  88. package/dist/lib/auth/index.js.map +1 -0
  89. package/dist/lib/auth/require-auth.d.ts +67 -0
  90. package/dist/lib/auth/require-auth.js +107 -0
  91. package/dist/lib/auth/require-auth.js.map +1 -0
  92. package/dist/lib/storage/base-storage.d.ts +50 -0
  93. package/dist/lib/storage/base-storage.js +91 -0
  94. package/dist/lib/storage/base-storage.js.map +1 -0
  95. package/dist/lib/storage/config-store.d.ts +40 -0
  96. package/dist/lib/storage/config-store.js +63 -0
  97. package/dist/lib/storage/config-store.js.map +1 -0
  98. package/dist/lib/storage/index.d.ts +12 -0
  99. package/dist/lib/storage/index.js +13 -0
  100. package/dist/lib/storage/index.js.map +1 -0
  101. package/dist/lib/storage/journal-storage.d.ts +46 -0
  102. package/dist/lib/storage/journal-storage.js +78 -0
  103. package/dist/lib/storage/journal-storage.js.map +1 -0
  104. package/dist/lib/storage/sync-meta-store.d.ts +37 -0
  105. package/dist/lib/storage/sync-meta-store.js +50 -0
  106. package/dist/lib/storage/sync-meta-store.js.map +1 -0
  107. package/dist/lib/storage/token-store.d.ts +25 -0
  108. package/dist/lib/storage/token-store.js +40 -0
  109. package/dist/lib/storage/token-store.js.map +1 -0
  110. package/dist/lib/sync/sync-engine.d.ts +13 -0
  111. package/dist/lib/sync/sync-engine.js +96 -0
  112. package/dist/lib/sync/sync-engine.js.map +1 -0
  113. package/dist/utils/date.d.ts +58 -0
  114. package/dist/utils/date.js +117 -0
  115. package/dist/utils/date.js.map +1 -0
  116. package/dist/utils/editor.d.ts +2 -0
  117. package/dist/utils/editor.js +81 -0
  118. package/dist/utils/editor.js.map +1 -0
  119. package/dist/utils/template.d.ts +2 -0
  120. package/dist/utils/template.js +17 -0
  121. package/dist/utils/template.js.map +1 -0
  122. package/dist/utils/token.d.ts +20 -0
  123. package/dist/utils/token.js +64 -0
  124. package/dist/utils/token.js.map +1 -0
  125. package/package.json +53 -0
@@ -0,0 +1,18 @@
1
+ import { login } from './login.js';
2
+ import { logout } from './logout.js';
3
+ import { register } from './register.js';
4
+ export function registerAuthCommands(program) {
5
+ program
6
+ .command('login')
7
+ .description('Login to your Papyrus account')
8
+ .action(async () => await login());
9
+ program
10
+ .command('logout')
11
+ .description('Log out from your account')
12
+ .action(() => logout());
13
+ program
14
+ .command('register')
15
+ .description('Create a new Papyrus account')
16
+ .action(async () => await register());
17
+ }
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/auth/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,MAAM,UAAU,oBAAoB,CAAC,OAAgB;IACnD,OAAO;SACJ,OAAO,CAAC,OAAO,CAAC;SAChB,WAAW,CAAC,+BAA+B,CAAC;SAC5C,MAAM,CAAC,KAAK,IAAI,EAAE,CAAC,MAAM,KAAK,EAAE,CAAC,CAAC;IAErC,OAAO;SACJ,OAAO,CAAC,QAAQ,CAAC;SACjB,WAAW,CAAC,2BAA2B,CAAC;SACxC,MAAM,CAAC,GAAG,EAAE,CAAC,MAAM,EAAE,CAAC,CAAC;IAE1B,OAAO;SACJ,OAAO,CAAC,UAAU,CAAC;SACnB,WAAW,CAAC,8BAA8B,CAAC;SAC3C,MAAM,CAAC,KAAK,IAAI,EAAE,CAAC,MAAM,QAAQ,EAAE,CAAC,CAAC;AAC1C,CAAC"}
@@ -0,0 +1 @@
1
+ export declare function login(): Promise<void>;
@@ -0,0 +1,8 @@
1
+ import { render } from 'ink';
2
+ import React from 'react';
3
+ import { LoginForm } from '../../components/LoginForm.js';
4
+ export async function login() {
5
+ const { waitUntilExit } = render(React.createElement(LoginForm));
6
+ await waitUntilExit();
7
+ }
8
+ //# sourceMappingURL=login.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"login.js","sourceRoot":"","sources":["../../../src/commands/auth/login.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAE1D,MAAM,CAAC,KAAK,UAAU,KAAK;IACzB,MAAM,EAAE,aAAa,EAAE,GAAG,MAAM,CAAC,KAAK,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC,CAAC;IAEjE,MAAM,aAAa,EAAE,CAAC;AACxB,CAAC"}
@@ -0,0 +1 @@
1
+ export declare function logout(): void;
@@ -0,0 +1,5 @@
1
+ import { api } from '../../lib/api/index.js';
2
+ export function logout() {
3
+ api.logout();
4
+ }
5
+ //# sourceMappingURL=logout.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logout.js","sourceRoot":"","sources":["../../../src/commands/auth/logout.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,wBAAwB,CAAC;AAE7C,MAAM,UAAU,MAAM;IACpB,GAAG,CAAC,MAAM,EAAE,CAAC;AACf,CAAC"}
@@ -0,0 +1 @@
1
+ export declare function register(): Promise<void>;
@@ -0,0 +1,8 @@
1
+ import { render } from 'ink';
2
+ import React from 'react';
3
+ import { RegisterForm } from '../../components/RegisterForm.js';
4
+ export async function register() {
5
+ const { waitUntilExit } = render(React.createElement(RegisterForm));
6
+ await waitUntilExit();
7
+ }
8
+ //# sourceMappingURL=register.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"register.js","sourceRoot":"","sources":["../../../src/commands/auth/register.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAEhE,MAAM,CAAC,KAAK,UAAU,QAAQ;IAC5B,MAAM,EAAE,aAAa,EAAE,GAAG,MAAM,CAAC,KAAK,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC,CAAC;IACpE,MAAM,aAAa,EAAE,CAAC;AACxB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './auth/index.js';
2
+ export * from './journal/index.js';
@@ -0,0 +1,3 @@
1
+ export * from './auth/index.js';
2
+ export * from './journal/index.js';
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/commands/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC"}
@@ -0,0 +1,2 @@
1
+ import { AddOptions } from '../types.js';
2
+ export declare function addEntry(options: AddOptions): Promise<void>;
@@ -0,0 +1,5 @@
1
+ import { editJournalEntry } from './edit.js';
2
+ export async function addEntry(options) {
3
+ editJournalEntry({ date: options.date, createIfMissing: true });
4
+ }
5
+ //# sourceMappingURL=add.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"add.js","sourceRoot":"","sources":["../../../src/commands/journal/add.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAE7C,MAAM,CAAC,KAAK,UAAU,QAAQ,CAAC,OAAmB;IAChD,gBAAgB,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,eAAe,EAAE,IAAI,EAAE,CAAC,CAAC;AAClE,CAAC"}
@@ -0,0 +1,2 @@
1
+ import { AmendOptions } from '../types.js';
2
+ export declare function amendEntry(options: AmendOptions): Promise<void>;
@@ -0,0 +1,5 @@
1
+ import { editJournalEntry } from './edit.js';
2
+ export async function amendEntry(options) {
3
+ editJournalEntry({ date: options.date, createIfMissing: false });
4
+ }
5
+ //# sourceMappingURL=amend.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"amend.js","sourceRoot":"","sources":["../../../src/commands/journal/amend.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAE7C,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,OAAqB;IACpD,gBAAgB,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,eAAe,EAAE,KAAK,EAAE,CAAC,CAAC;AACnE,CAAC"}
@@ -0,0 +1,6 @@
1
+ interface EditOptions {
2
+ date: string;
3
+ createIfMissing: boolean;
4
+ }
5
+ export declare function editJournalEntry(options: EditOptions): void;
6
+ export {};
@@ -0,0 +1,60 @@
1
+ /* eslint-disable @typescript-eslint/no-explicit-any */
2
+ import { journalStore } from '../../lib/storage/index.js';
3
+ import { formatDate, parseDate } from '../../utils/date.js';
4
+ import { openInEditor } from '../../utils/editor.js';
5
+ import { JOURNAL_TEMPATE, stripTemplateComments, } from '../../utils/template.js';
6
+ export function editJournalEntry(options) {
7
+ const { date: inputDate, createIfMissing } = options;
8
+ try {
9
+ // 1. Parse and validate date
10
+ const date = parseDate(inputDate);
11
+ const displayDate = formatDate(date);
12
+ // 2. Load existing or create new entry
13
+ let entry = journalStore.load(date);
14
+ let isNew = false;
15
+ if (!entry) {
16
+ if (!createIfMissing) {
17
+ // amend: fail if entry doesn't exist
18
+ console.error(`\n❌ Error: No journal entry found for ${date}.\n` +
19
+ `💡 Use 'papyrus add -d ${date}' to create a new entry.\n`);
20
+ process.exit(1);
21
+ }
22
+ // add: create new entry
23
+ isNew = true;
24
+ entry = '';
25
+ console.log(`\n✨ Creating new entry for ${displayDate}...\n`);
26
+ }
27
+ else {
28
+ console.log(`\n📖 Loading existing entry for ${displayDate}...\n`);
29
+ }
30
+ // 3. Append hint comments for user guidance
31
+ const contentWithHints = `${entry}\n${JOURNAL_TEMPATE}`;
32
+ // 4. Open editor
33
+ const editedContent = openInEditor(contentWithHints, `papyrus-${date}.md`);
34
+ const finalContent = stripTemplateComments(editedContent);
35
+ if (!finalContent.trim()) {
36
+ console.log('⚠️ No content written. Entry not saved.\n');
37
+ return;
38
+ }
39
+ journalStore.create(date, finalContent);
40
+ // 5. Show success message with stats
41
+ const words = countWords(finalContent);
42
+ const chars = finalContent.length;
43
+ console.log(`\n✅ Journal entry ${isNew ? 'created' : 'updated'} for ${date}`);
44
+ console.log(`📊 Words: ${words} | Characters: ${chars}\n`);
45
+ }
46
+ catch (error) {
47
+ console.error(`\n❌ Error: ${error.message}\n`);
48
+ process.exit(1);
49
+ }
50
+ }
51
+ /**
52
+ * Count words in text
53
+ */
54
+ function countWords(text) {
55
+ return text
56
+ .trim()
57
+ .split(/\s+/)
58
+ .filter((word) => word.length > 0).length;
59
+ }
60
+ //# sourceMappingURL=edit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"edit.js","sourceRoot":"","sources":["../../../src/commands/journal/edit.ts"],"names":[],"mappings":"AAAA,uDAAuD;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EACL,eAAe,EACf,qBAAqB,GACtB,MAAM,yBAAyB,CAAC;AAOjC,MAAM,UAAU,gBAAgB,CAAC,OAAoB;IACnD,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,eAAe,EAAE,GAAG,OAAO,CAAC;IAErD,IAAI,CAAC;QACH,6BAA6B;QAC7B,MAAM,IAAI,GAAG,SAAS,CAAC,SAAS,CAAC,CAAC;QAClC,MAAM,WAAW,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC;QAErC,uCAAuC;QACvC,IAAI,KAAK,GAAG,YAAY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aAAa,KAAK,kBAAkB,KAAK,IAAI,CAAC,CAAC;IAC7D,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QACpB,OAAO,CAAC,KAAK,CAAC,cAAc,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC;QAC/C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC;AAED;;GAEG;AACH,SAAS,UAAU,CAAC,IAAY;IAC9B,OAAO,IAAI;SACR,IAAI,EAAE;SACN,KAAK,CAAC,KAAK,CAAC;SACZ,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC;AAC9C,CAAC"}
@@ -0,0 +1,2 @@
1
+ import { Command } from 'commander';
2
+ export declare function registerJournalCommands(program: Command): void;
@@ -0,0 +1,32 @@
1
+ import { addEntry } from './add.js';
2
+ import { amendEntry } from './amend.js';
3
+ import { listEntries } from './list.js';
4
+ import { showEntry } from './show.js';
5
+ import { syncEntries } from './sync.js';
6
+ export function registerJournalCommands(program) {
7
+ program
8
+ .command('add')
9
+ .description('Create a new journal entry')
10
+ .option('-d, --date <date>', 'Date for the entry (default: today)', 'today')
11
+ .action(async (options) => await addEntry(options));
12
+ program
13
+ .command('amend')
14
+ .description('Modify an existing journal entry')
15
+ .option('-d, --date <date>', 'Date of the entry to amend (default: today)', 'today')
16
+ .action(async (options) => await amendEntry(options));
17
+ program
18
+ .command('show')
19
+ .description('Display a journal entry')
20
+ .option('-d, --date <date>', 'Date of the entry to show (default: today)', 'today')
21
+ .action(async (options) => await showEntry(options));
22
+ program
23
+ .command('list')
24
+ .alias('ls')
25
+ .description('List all local journal entries')
26
+ .action(async () => await listEntries());
27
+ program
28
+ .command('sync')
29
+ .description('Sync journals with server (requires authentication)')
30
+ .action(async () => await syncEntries());
31
+ }
32
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot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ACf,WAAW,CAAC,qDAAqD,CAAC;SAClE,MAAM,CAAC,KAAK,IAAI,EAAE,CAAC,MAAM,WAAW,EAAE,CAAC,CAAC;AAC7C,CAAC"}
@@ -0,0 +1 @@
1
+ export declare function listEntries(): Promise<void>;
@@ -0,0 +1,20 @@
1
+ /* eslint-disable @typescript-eslint/no-explicit-any */
2
+ import { render } from 'ink';
3
+ import React from 'react';
4
+ import { Browser } from '../../components/Browser.js';
5
+ import { journalStore } from '../../lib/storage/index.js';
6
+ export async function listEntries() {
7
+ try {
8
+ // Load all journal entries
9
+ const journals = journalStore.list();
10
+ // Render the interactive browser
11
+ const { waitUntilExit } = render(React.createElement(Browser, { journals }));
12
+ await waitUntilExit();
13
+ }
14
+ catch (error) {
15
+ console.error(`\n❌ Error: Failed to list journal entries`);
16
+ console.error(`${error.message}\n`);
17
+ process.exit(1);
18
+ }
19
+ }
20
+ //# sourceMappingURL=list.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list.js","sourceRoot":"","sources":["../../../src/commands/journal/list.ts"],"names":[],"mappings":"AAAA,uDAAuD;AACvD,OAAO,EAAE,MAAM,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,MAAM,CAAC,KAAK,UAAU,WAAW;IAC/B,IAAI,CAAC;QACH,2BAA2B;QAC3B,MAAM,QAAQ,GAAG,YAAY,CAAC,IAAI,EAAE,CAAC;QAErC,iCAAiC;QACjC,MAAM,EAAE,aAAa,EAAE,GAAG,MAAM,CAC9B,KAAK,CAAC,aAAa,CAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,CAAC,CAC3C,CAAC;QAEF,MAAM,aAAa,EAAE,CAAC;IACxB,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QACpB,OAAO,CAAC,KAAK,CAAC,2CAA2C,CAAC,CAAC;QAC3D,OAAO,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC;QACpC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC"}
@@ -0,0 +1,2 @@
1
+ import { ShowOptions } from '../types.js';
2
+ export declare function showEntry(options: ShowOptions): Promise<void>;
@@ -0,0 +1,35 @@
1
+ /* eslint-disable @typescript-eslint/no-explicit-any */
2
+ import { render } from 'ink';
3
+ import React from 'react';
4
+ import { JournalViewer } from '../../components/JournalViewer.js';
5
+ import { journalStore } from '../../lib/storage/index.js';
6
+ import { formatDate, parseDate } from '../../utils/date.js';
7
+ export async function showEntry(options) {
8
+ const dateInput = options.date;
9
+ try {
10
+ // 1. Parse and validate date
11
+ const date = parseDate(dateInput);
12
+ const displayDate = formatDate(date);
13
+ // 2. Check if entry exists
14
+ if (!journalStore.exists(date)) {
15
+ console.error(`\n❌ Error: No journal entry found for ${displayDate}`);
16
+ console.error(`💡 Run 'papyrus add -d ${date}' to create one.\n`);
17
+ process.exit(1);
18
+ }
19
+ // 3. Load the entry
20
+ const content = journalStore.load(date);
21
+ if (!content) {
22
+ console.error(`\n❌ Error: Failed to load journal entry for ${date}\n`);
23
+ process.exit(1);
24
+ }
25
+ // 4. Display the entry
26
+ const { waitUntilExit } = render(React.createElement(JournalViewer, { date, content }));
27
+ await waitUntilExit();
28
+ }
29
+ catch (error) {
30
+ console.error(`\n❌ Error: ${error.message}`);
31
+ console.error('💡 Use formats like: today, yesterday, tomorrow, or YYYYMMDD (e.g., 20260104)\n');
32
+ process.exit(1);
33
+ }
34
+ }
35
+ //# sourceMappingURL=show.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"show.js","sourceRoot":"","sources":["../../../src/commands/journal/show.ts"],"names":[],"mappings":"AAAA,uDAAuD;AACvD,OAAO,EAAE,MAAM,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,KAAK,MAAM,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AAC,KAAK,CACX,iFAAiF,CAClF,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC"}
@@ -0,0 +1 @@
1
+ export declare function syncEntries(): Promise<void>;
@@ -0,0 +1,9 @@
1
+ import { render } from 'ink';
2
+ import React from 'react';
3
+ import { SyncProgress } from '../../components/SyncProgress.js';
4
+ import { ensureAuthenticated } from '../../lib/auth/require-auth.js';
5
+ export async function syncEntries() {
6
+ ensureAuthenticated();
7
+ render(React.createElement(SyncProgress));
8
+ }
9
+ //# sourceMappingURL=sync.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sync.js","sourceRoot":"","sources":["../../../src/commands/journal/sync.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAErE,MAAM,CAAC,KAAK,UAAU,WAAW;IAC/B,mBAAmB,EAAE,CAAC;IACtB,MAAM,CAAC,KAAK,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC,CAAC;AAC5C,CAAC"}
@@ -0,0 +1,9 @@
1
+ export interface DateOption {
2
+ date: string;
3
+ }
4
+ export interface AddOptions extends DateOption {
5
+ }
6
+ export interface AmendOptions extends DateOption {
7
+ }
8
+ export interface ShowOptions extends DateOption {
9
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/commands/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,29 @@
1
+ import React from 'react';
2
+ import { type JournalFileInfo } from '../lib/storage/journal-storage.js';
3
+ interface BrowserProps {
4
+ journals: JournalFileInfo[];
5
+ }
6
+ /**
7
+ * Interactive browser for navigating and reading journal entries.
8
+ *
9
+ * Features:
10
+ * - List view with keyboard navigation (↑/↓ or j/k)
11
+ * - Reader view with full journal content
12
+ * - Circular navigation (wrap around at top/bottom)
13
+ * - Today marker for current date's entry
14
+ * - Virtual scrolling for large journal collections
15
+ * - Press Enter to read, q to return to list or quit
16
+ *
17
+ * Architecture:
18
+ * 1. BrowserHeader - Shows total journal count
19
+ * 2. JournalListView - Virtual scrolling list of journals
20
+ * 3. BrowserFooter - Keyboard shortcuts reference
21
+ * 4. JournalViewer - Full journal reader (opens when selecting entry)
22
+ *
23
+ * State Management:
24
+ * - viewMode: 'list' | 'reader' - Current view
25
+ * - selectedIndex: number - Currently selected journal in list
26
+ * - selectedJournal: JournalFileInfo | null - Journal being read
27
+ */
28
+ export declare const Browser: React.FC<BrowserProps>;
29
+ export {};
@@ -0,0 +1,124 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Box, Text, useInput, useApp } from 'ink';
3
+ import { useState } from 'react';
4
+ import { journalStore } from '../lib/storage/index.js';
5
+ import { getTodayDate } from '../utils/date.js';
6
+ import { BrowserFooter } from './BrowserFooter.js';
7
+ import { BrowserHeader } from './BrowserHeader.js';
8
+ import { JournalListView } from './JournalListView.js';
9
+ import { JournalViewer } from './JournalViewer.js';
10
+ /**
11
+ * Interactive browser for navigating and reading journal entries.
12
+ *
13
+ * Features:
14
+ * - List view with keyboard navigation (↑/↓ or j/k)
15
+ * - Reader view with full journal content
16
+ * - Circular navigation (wrap around at top/bottom)
17
+ * - Today marker for current date's entry
18
+ * - Virtual scrolling for large journal collections
19
+ * - Press Enter to read, q to return to list or quit
20
+ *
21
+ * Architecture:
22
+ * 1. BrowserHeader - Shows total journal count
23
+ * 2. JournalListView - Virtual scrolling list of journals
24
+ * 3. BrowserFooter - Keyboard shortcuts reference
25
+ * 4. JournalViewer - Full journal reader (opens when selecting entry)
26
+ *
27
+ * State Management:
28
+ * - viewMode: 'list' | 'reader' - Current view
29
+ * - selectedIndex: number - Currently selected journal in list
30
+ * - selectedJournal: JournalFileInfo | null - Journal being read
31
+ */
32
+ export const Browser = ({ journals }) => {
33
+ // State management
34
+ const [selectedIndex, setSelectedIndex] = useState(0);
35
+ const [viewMode, setViewMode] = useState('list');
36
+ const [selectedJournal, setSelectedJournal] = useState(null);
37
+ const [journalContent, setJournalContent] = useState('');
38
+ const { exit } = useApp();
39
+ const today = getTodayDate();
40
+ // Keyboard input handlers
41
+ useInput((input, key) => {
42
+ // Handle list view navigation
43
+ if (viewMode === 'list') {
44
+ // Navigate up (↑ or k)
45
+ if (key.upArrow || input === 'k') {
46
+ handleNavigateUp();
47
+ return;
48
+ }
49
+ // Navigate down (↓ or j)
50
+ if (key.downArrow || input === 'j') {
51
+ handleNavigateDown();
52
+ return;
53
+ }
54
+ // Open journal (Enter or Space)
55
+ if (key.return || input === ' ') {
56
+ handleOpenJournal();
57
+ return;
58
+ }
59
+ // Quit from list view (q or Escape)
60
+ if (input === 'q' || key.escape) {
61
+ exit();
62
+ return;
63
+ }
64
+ }
65
+ // Note: Reader view keyboard handling is done by JournalViewer component
66
+ // It will call handleBackToList() when user presses 'q'
67
+ });
68
+ // Navigation handlers
69
+ const handleNavigateUp = () => {
70
+ setSelectedIndex((current) => {
71
+ const next = current - 1;
72
+ // Circular navigation: if at top, wrap to bottom
73
+ if (next < 0) {
74
+ return journals.length - 1;
75
+ }
76
+ return next;
77
+ });
78
+ };
79
+ const handleNavigateDown = () => {
80
+ setSelectedIndex((current) => {
81
+ const next = current + 1;
82
+ // Circular navigation: if at bottom, wrap to top
83
+ if (next >= journals.length) {
84
+ return 0;
85
+ }
86
+ return next;
87
+ });
88
+ };
89
+ const handleOpenJournal = () => {
90
+ const journal = journals[selectedIndex];
91
+ if (journal) {
92
+ try {
93
+ // Load journal content
94
+ const content = journalStore.load(journal.date);
95
+ if (content) {
96
+ setSelectedJournal(journal);
97
+ setJournalContent(content);
98
+ setViewMode('reader');
99
+ }
100
+ }
101
+ catch (error) {
102
+ // If loading fails, stay in list view
103
+ // The error will be visible in the console
104
+ console.error(`Failed to load journal: ${error}`);
105
+ }
106
+ }
107
+ };
108
+ const handleBackToList = () => {
109
+ setViewMode('list');
110
+ setSelectedJournal(null);
111
+ setJournalContent('');
112
+ };
113
+ // Empty state
114
+ if (journals.length === 0) {
115
+ return (_jsxs(Box, { flexDirection: "column", borderStyle: "round", padding: 1, children: [_jsx(Text, { color: "yellow", children: "No journal entries yet." }), _jsx(Text, { dimColor: true, children: " Run 'papyrus add' to create your first entry." }), _jsx(Box, { marginTop: 1, children: _jsx(Text, { dimColor: true, children: "Press 'q' to quit" }) })] }));
116
+ }
117
+ // Reader view
118
+ if (viewMode === 'reader' && selectedJournal) {
119
+ return (_jsx(JournalViewer, { date: selectedJournal.date, content: journalContent, onExit: handleBackToList }));
120
+ }
121
+ // List view (default)
122
+ return (_jsxs(Box, { flexDirection: "column", children: [_jsx(BrowserHeader, { totalJournals: journals.length }), _jsx(JournalListView, { journals: journals, selectedIndex: selectedIndex, todayDate: today, windowSize: 10 }), _jsx(BrowserFooter, { shortcuts: "\u2191\u2193/jk Navigate \u2022 Enter Read \u2022 q Quit" })] }));
123
+ };
124
+ //# sourceMappingURL=Browser.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Browser.js","sourceRoot":"","sources":["../../src/components/Browser.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,KAAK,CAAC;AAClD,OAAc,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAExC,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEvD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEhD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,sBA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
3
+ shortcuts: string;
4
+ }
5
+ export declare const BrowserFooter: React.FC<BrowserFooterProps>;
6
+ export {};
@@ -0,0 +1,6 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Box, Text } from 'ink';
3
+ export const BrowserFooter = ({ shortcuts }) => {
4
+ return (_jsx(Box, { marginTop: 1, borderStyle: "round", borderColor: "gray", paddingX: 1, children: _jsx(Text, { dimColor: true, children: shortcuts }) }));
5
+ };
6
+ //# sourceMappingURL=BrowserFooter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BrowserFooter.js","sourceRoot":"","sources":["../../src/components/BrowserFooter.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAOhC,MAAM,CAAC,MAAM,aAAa,GAAiC,CAAC,EAAE,SAAS,EAAE,EAAE,EAAE;IAC3E,OAAO,CACL,KAAC,GAAG,IAAC,SAAS,EAAE,CAAC,EAAE,WAAW,EAAC,OAAO,EAAC,WAAW,EAAC,MAAM,EAAC,QAAQ,EAAE,CAAC,YACnE,KAAC,IAAI,IAAC,QAAQ,kBAAE,SAAS,GAAQ,GAC7B,CACP,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ interface BrowserHeaderProps {
3
+ totalJournals: number;
4
+ }
5
+ export declare const BrowserHeader: React.FC<BrowserHeaderProps>;
6
+ export {};
@@ -0,0 +1,6 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Box, Text } from 'ink';
3
+ export const BrowserHeader = ({ totalJournals, }) => {
4
+ return (_jsxs(Box, { borderStyle: "round", borderColor: "blue", paddingX: 1, children: [_jsx(Text, { bold: true, color: "blue", children: "Browse Your Journals" }), _jsx(Box, { marginLeft: 2, children: _jsxs(Text, { dimColor: true, children: ["Total: ", totalJournals, " entries"] }) })] }));
5
+ };
6
+ //# sourceMappingURL=BrowserHeader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BrowserHeader.js","sourceRoot":"","sources":["../../src/components/BrowserHeader.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAOhC,MAAM,CAAC,MAAM,aAAa,GAAiC,CAAC,EAC1D,aAAa,GACd,EAAE,EAAE;IACH,OAAO,CACL,MAAC,GAAG,IAAC,WAAW,EAAC,OAAO,EAAC,WAAW,EAAC,MAAM,EAAC,QAAQ,EAAE,CAAC,aACrD,KAAC,IAAI,IAAC,IAAI,QAAC,KAAK,EAAC,MAAM,qCAEhB,EACP,KAAC,GAAG,IAAC,UAAU,EAAE,CAAC,YAChB,MAAC,IAAI,IAAC,QAAQ,8BAAS,aAAa,gBAAgB,GAChD,IACF,CACP,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ interface ColdStartAwareSpinnerProps {
3
+ message: string;
4
+ }
5
+ export declare const ColdStartAwareSpinner: React.FC<ColdStartAwareSpinnerProps>;
6
+ export {};
@@ -0,0 +1,24 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Text } from 'ink';
3
+ import Spinner from 'ink-spinner';
4
+ import { useState, useEffect } from 'react';
5
+ export const ColdStartAwareSpinner = ({ message, }) => {
6
+ const [elapsed, setElapsed] = useState(0);
7
+ const [currentMessage, setCurrentMessage] = useState(message);
8
+ useEffect(() => {
9
+ const interval = setInterval(() => {
10
+ setElapsed((prev) => prev + 1);
11
+ }, 1000);
12
+ return () => clearInterval(interval);
13
+ }, []);
14
+ useEffect(() => {
15
+ if (elapsed >= 5 && elapsed < 15) {
16
+ setCurrentMessage('Waking up the server (this may take a moment)...');
17
+ }
18
+ else if (elapsed > 15) {
19
+ setCurrentMessage('Server is starting up (free tier cold start may take up to 1 min)...');
20
+ }
21
+ }, [elapsed]);
22
+ return (_jsxs(Text, { children: [_jsx(Text, { color: "green", children: _jsx(Spinner, { type: "dots" }) }), ' ', currentMessage, elapsed >= 5 && _jsxs(Text, { color: "gray", children: ["(", elapsed, "s)"] })] }));
23
+ };
24
+ //# sourceMappingURL=ColdStart.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ColdStart.js","sourceRoot":"","sources":["../../src/components/ColdStart.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC3B,OAAO,OAAO,MAAM,aAAa,CAAC;AAClC,OAAc,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAMnD,MAAM,CAAC,MAAM,qBAAqB,GAAyC,CAAC,EAC1E,OAAO,GACR,EAAE,EAAE;IACH,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC1C,MAAM,CAAC,cAAc,EAAE,iBAAiB,CAAC,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC;IAE9D,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,QAAQ,GAAG,WAAW,CAAC,GAAG,EAAE;YAChC,UAAU,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC;QACjC,CAAC,EAAE,IAAI,CAAC,CAAC;QAET,OAAO,GAAG,EAAE,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;IACvC,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,OAAO,IAAI,CAAC,IAAI,OAAO,GAAG,EAAE,EAAE,CAAC;YACjC,iBAAiB,CAAC,kDAAkD,CAAC,CAAC;QACxE,CAAC;aAAM,IAAI,OAAO,GAAG,EAAE,EAAE,CAAC;YACxB,iBAAiB,CACf,sEAAsE,CACvE,CAAC;QACJ,CAAC;IACH,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;IAEd,OAAO,CACL,MAAC,IAAI,eACH,KAAC,IAAI,IAAC,KAAK,EAAC,OAAO,YACjB,KAAC,OAAO,IAAC,IAAI,EAAC,MAAM,GAAG,GAClB,EAAC,GAAG,EACV,cAAc,EACd,OAAO,IAAI,CAAC,IAAI,MAAC,IAAI,IAAC,KAAK,EAAC,MAAM,kBAAG,OAAO,UAAU,IAClD,CACR,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,10 @@
1
+ interface FormInputProps {
2
+ label: string;
3
+ value: string;
4
+ onChange: (value: string) => void;
5
+ placeholder?: string;
6
+ mask?: string;
7
+ focus?: boolean;
8
+ }
9
+ export declare function FormInput({ label, value, onChange, placeholder, mask, focus, }: FormInputProps): import("react/jsx-runtime").JSX.Element;
10
+ export {};
@@ -0,0 +1,7 @@
1
+ import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
2
+ import { Box, Text } from 'ink';
3
+ import TextInput from 'ink-text-input';
4
+ export function FormInput({ label, value, onChange, placeholder, mask, focus = true, }) {
5
+ return (_jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [_jsxs(Text, { color: "cyan", bold: true, children: [label, ":"] }), _jsxs(Box, { marginLeft: 2, children: [_jsx(Text, { color: "gray", children: '> ' }), _jsx(TextInput, { value: value, onChange: onChange, placeholder: placeholder, mask: mask, focus: focus })] })] }));
6
+ }
7
+ //# sourceMappingURL=FormInput.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FormInput.js","sourceRoot":"","sources":["../../src/components/FormInput.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,SAAS,MAAM,gBAAgB,CAAC;AAYvC,MAAM,UAAU,SAAS,CAAC,EACxB,KAAK,EACL,KAAK,EACL,QAAQ,EACR,WAAW,EACX,IAAI,EACJ,KAAK,GAAG,IAAI,GACG;IACf,OAAO,CACL,MAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,EAAC,YAAY,EAAE,CAAC,aACzC,MAAC,IAAI,IAAC,KAAK,EAAC,MAAM,EAAC,IAAI,mBACpB,KAAK,SACD,EACP,MAAC,GAAG,IAAC,UAAU,EAAE,CAAC,aAChB,KAAC,IAAI,IAAC,KAAK,EAAC,MAAM,YAAE,IAAI,GAAQ,EAChC,KAAC,SAAS,IACR,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,QAAQ,EAClB,WAAW,EAAE,WAAW,EACxB,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,KAAK,GACZ,IACE,IACF,CACP,CAAC;AACJ,CAAC"}
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import { type JournalFileInfo } from '../lib/storage/journal-storage.js';
3
+ interface JournalListViewProps {
4
+ journals: JournalFileInfo[];
5
+ selectedIndex: number;
6
+ todayDate: string;
7
+ windowSize?: number;
8
+ }
9
+ export declare const JournalListView: React.FC<JournalListViewProps>;
10
+ export {};