@hazem3500/komo 0.0.0-stage → 0.8.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 (124) hide show
  1. package/LICENSE +21 -0
  2. package/NODE.md +60 -0
  3. package/NOTICE.md +45 -0
  4. package/README.md +399 -2
  5. package/cli/agent.mjs +615 -0
  6. package/cli/config.mjs +34 -0
  7. package/cli/index.mjs +405 -0
  8. package/cli/project.mjs +136 -0
  9. package/cli/workflow.mjs +42 -0
  10. package/dist/MorphingMenu.d.ts +30 -0
  11. package/dist/PointerIcon.d.ts +2 -0
  12. package/dist/SmileIcon.d.ts +2 -0
  13. package/dist/THIRD_PARTY_NOTICES.txt +387 -0
  14. package/dist/accent-picker-HSUCA4KE.js +1 -0
  15. package/dist/accent-picker.d.ts +4 -0
  16. package/dist/accent.d.ts +2 -0
  17. package/dist/account-usage.d.ts +2 -0
  18. package/dist/action-menu.d.ts +10 -0
  19. package/dist/agent-prompt.d.ts +6 -0
  20. package/dist/agent-prompt.js +1 -0
  21. package/dist/anchors.d.ts +48 -0
  22. package/dist/api.d.ts +39 -0
  23. package/dist/approved-sites.d.ts +9 -0
  24. package/dist/card-motion.d.ts +8 -0
  25. package/dist/chunk-7YUXYVQA.js +1 -0
  26. package/dist/chunk-E5X4IQJ2.js +1 -0
  27. package/dist/chunk-I7AUKTXE.js +1 -0
  28. package/dist/chunk-RPKLGTEU.js +1 -0
  29. package/dist/chunk-Y2GRLW4Q.js +1 -0
  30. package/dist/chunk-Z2ABBESO.js +1 -0
  31. package/dist/chunk-ZUNTYWJF.js +1 -0
  32. package/dist/config.d.ts +11 -0
  33. package/dist/connect-project.d.ts +14 -0
  34. package/dist/connection-issue.d.ts +7 -0
  35. package/dist/design-export-BRBI7S3V.js +1 -0
  36. package/dist/design-export.d.ts +8 -0
  37. package/dist/design-mode-styles.d.ts +1 -0
  38. package/dist/design-mode.d.ts +19 -0
  39. package/dist/design-mode.js +1 -0
  40. package/dist/design-panel-BPVXFERR.js +1 -0
  41. package/dist/design-panel-styles.d.ts +1 -0
  42. package/dist/design-panel.d.ts +33 -0
  43. package/dist/design-tokens.d.ts +76 -0
  44. package/dist/dom.d.ts +10 -0
  45. package/dist/drawer-expand-motion.d.ts +46 -0
  46. package/dist/drawer-presence.d.ts +4 -0
  47. package/dist/edge-sidebar.d.ts +39 -0
  48. package/dist/emoji-history.d.ts +8 -0
  49. package/dist/emoji.d.ts +1 -0
  50. package/dist/floating-drag.d.ts +9 -0
  51. package/dist/icon-markup.d.ts +4 -0
  52. package/dist/index.d.ts +8 -0
  53. package/dist/index.js +1 -0
  54. package/dist/inline-text-editor-F7B6FQQ3.js +1 -0
  55. package/dist/inline-text-editor.d.ts +70 -0
  56. package/dist/lazy-accent-picker.d.ts +4 -0
  57. package/dist/lazy-toolbar.d.ts +19 -0
  58. package/dist/message-links.d.ts +2 -0
  59. package/dist/morphing-menu-styles.d.ts +1 -0
  60. package/dist/node.mjs +2454 -0
  61. package/dist/onboarding-YA63RUKK.js +1 -0
  62. package/dist/onboarding.d.ts +6 -0
  63. package/dist/optimistic.d.ts +26 -0
  64. package/dist/page.d.ts +2 -0
  65. package/dist/picker-WQN53YJ5.js +1 -0
  66. package/dist/pin-direction.d.ts +12 -0
  67. package/dist/pin-stacks.d.ts +3 -0
  68. package/dist/polling.d.ts +10 -0
  69. package/dist/postgres/001_initial.sql +128 -0
  70. package/dist/postgres/002_thread_tags.sql +1 -0
  71. package/dist/postgres/003_project_webhooks.sql +4 -0
  72. package/dist/project-management.d.ts +2 -0
  73. package/dist/react-inspector.d.ts +43 -0
  74. package/dist/react-props-panel-XSMDR2CY.js +1 -0
  75. package/dist/react-props-panel.d.ts +39 -0
  76. package/dist/react.d.ts +38 -0
  77. package/dist/react.js +1 -0
  78. package/dist/reaction-picker.d.ts +1 -0
  79. package/dist/review-layout.d.ts +23 -0
  80. package/dist/setup-browser.d.ts +1 -0
  81. package/dist/setup.d.ts +4 -0
  82. package/dist/setup.js +1 -0
  83. package/dist/shortcuts.d.ts +15 -0
  84. package/dist/static-svg.d.ts +3 -0
  85. package/dist/styles.d.ts +1 -0
  86. package/dist/tag-editor-VDPZ6CO3.js +1 -0
  87. package/dist/tag-editor.d.ts +12 -0
  88. package/dist/toolbar-runtime-MYOLQPTJ.js +1 -0
  89. package/dist/toolbar-runtime.d.ts +5 -0
  90. package/dist/types.d.ts +150 -0
  91. package/package.json +114 -4
  92. package/server/digest.ts +8 -0
  93. package/server/import-project.ts +164 -0
  94. package/server/index.ts +1565 -0
  95. package/server/migrations/0001_comments.sql +54 -0
  96. package/server/migrations/0002_identity.sql +2 -0
  97. package/server/migrations/0003_accent_color.sql +1 -0
  98. package/server/migrations/0004_workspaces.sql +46 -0
  99. package/server/migrations/0005_domains.sql +6 -0
  100. package/server/migrations/0006_member_budget.sql +16 -0
  101. package/server/migrations/0007_revisions.sql +17 -0
  102. package/server/migrations/0008_starter_comments.sql +1 -0
  103. package/server/migrations/0009_retention.sql +19 -0
  104. package/server/migrations/0010_reviewer_history.sql +1 -0
  105. package/server/migrations/0011_project_management.sql +52 -0
  106. package/server/migrations/0012_setup_sites.sql +3 -0
  107. package/server/migrations/0013_project_sites.sql +8 -0
  108. package/server/migrations/0014_project_site_removals.sql +3 -0
  109. package/server/migrations/0015_query_efficiency.sql +6 -0
  110. package/server/migrations/0016_thread_tags.sql +1 -0
  111. package/server/migrations/0017_project_webhooks.sql +4 -0
  112. package/server/node-webhooks.ts +126 -0
  113. package/server/project-management.ts +387 -0
  114. package/server/project-sites.ts +117 -0
  115. package/server/secrets.d.ts +18 -0
  116. package/server/setup-client.txt +2904 -0
  117. package/server/setup-page.ts +14 -0
  118. package/server/tsconfig.json +12 -0
  119. package/server/validation.ts +220 -0
  120. package/server/webhooks.ts +206 -0
  121. package/server/workspaces.ts +168 -0
  122. package/src/emoji.ts +7 -0
  123. package/src/page.ts +4 -0
  124. package/src/types.ts +153 -0
package/src/types.ts ADDED
@@ -0,0 +1,153 @@
1
+ export interface Identity {
2
+ id: string;
3
+ name: string;
4
+ verified: boolean;
5
+ avatarUrl?: string;
6
+ accentColor?: string;
7
+ }
8
+
9
+ export interface Anchor {
10
+ /** A manually moved indicator keeps its own position instead of joining a stack. */
11
+ unstacked?: boolean;
12
+ selector: string;
13
+ text: string;
14
+ x: number;
15
+ y: number;
16
+ width: number;
17
+ height: number;
18
+ pageX: number;
19
+ pageY: number;
20
+ viewportWidth: number;
21
+ source?: string;
22
+ /** Optional public target details; old anchors remain valid without them. */
23
+ context?: {
24
+ tag?: string;
25
+ role?: string;
26
+ label?: string;
27
+ nearby?: string;
28
+ classes?: string;
29
+ selectedText?: string;
30
+ styles?: string;
31
+ scope?: string;
32
+ };
33
+ }
34
+
35
+ export interface Comment {
36
+ id: string;
37
+ body: string;
38
+ author: Identity;
39
+ createdAt: number;
40
+ editedAt: number | null;
41
+ reactions: Record<string, string[]>;
42
+ }
43
+
44
+ export interface Thread {
45
+ id: string;
46
+ page: string;
47
+ anchor: Anchor;
48
+ resolved: boolean;
49
+ resolvedBy: Identity | null;
50
+ createdAt: number;
51
+ updatedAt: number;
52
+ /** Reviewer-defined labels used to group related feedback. */
53
+ tags?: string[];
54
+ comments: Comment[];
55
+ }
56
+
57
+ export interface OnboardingOptions {
58
+ /** Temporary first-run setup inside the consuming site. Generated by the CLI. */
59
+ inProject?: boolean;
60
+ /** Suggested deployed sites shown for owner approval during first-run setup. */
61
+ sites?: string[];
62
+ invite?: string;
63
+ code?: string;
64
+ workspace?: string;
65
+ claimKey?: string;
66
+ site?: string;
67
+ }
68
+
69
+ /**
70
+ * Keyboard shortcuts as a key with optional Ctrl, Alt, Shift, or Meta
71
+ * modifiers, e.g. "M" or "Shift+J". Set false to disable one. Escape and Tab
72
+ * are reserved.
73
+ */
74
+ export interface KomoShortcuts {
75
+ /** Toggle comment mode. Defaults to "C". */
76
+ comment?: string | false;
77
+ /** Return to browsing. Defaults to "V". */
78
+ browse?: string | false;
79
+ /** Toggle Design mode. Defaults to "D". Has no effect when features.designMode is false. */
80
+ design?: string | false;
81
+ /** Restore a dismissed toolbar. Defaults to "Shift+K". */
82
+ restore?: string | false;
83
+ }
84
+
85
+ /** Optional review features. Each defaults to true; false removes it from the UI. */
86
+ export interface KomoFeatures {
87
+ /** Design mode inspector, style previews, and design proposals. */
88
+ designMode?: boolean;
89
+ /** Thread group tags: add them while writing a comment or on an open thread; shown in the sidebar. */
90
+ tags?: boolean;
91
+ }
92
+
93
+ export interface CommentsOptions {
94
+ /** Used by the hosted setup screen to reuse the sidebar account UI. */
95
+ onboarding?: OnboardingOptions;
96
+ /** Shared API URL. Never put a private credential here. */
97
+ endpoint: string;
98
+ /** Repository identifier, normally owner/repository. */
99
+ repo: string;
100
+ branch: string;
101
+ /** Public project key registered in the API configuration. */
102
+ project: string;
103
+ enabled?: boolean;
104
+ /** Hide the toolbar until controller.open() or the restore shortcut is used. Defaults to true. */
105
+ showToolbar?: boolean;
106
+ /** Override or disable the review keyboard shortcuts. */
107
+ shortcuts?: KomoShortcuts;
108
+ /** Turn optional features off, e.g. { designMode: false, tags: false }. */
109
+ features?: KomoFeatures;
110
+ /**
111
+ * Sidebar presentation when the review opens. "edge" (default) is a floating,
112
+ * draggable sidebar that parks off and peeks from the viewport edge while
113
+ * closed. "background" frames the site and shows the sidebar in the scaled
114
+ * review sheet. Users can switch Floating and Frame from the Account panel;
115
+ * that choice is remembered per project. Compact viewports always use a bottom
116
+ * Drawer, retaining the desktop preference when the viewport grows.
117
+ */
118
+ sidebar?: "background" | "edge";
119
+ /** Hide the drawer away from the pointer. Defaults to true. */
120
+ autoHideDrawer?: boolean;
121
+ /** Center the default drawer position within this element. */
122
+ drawerContainer?: HTMLElement;
123
+ /** Mounted content root for Frame. Defaults to a sole body content element; otherwise Floating only. */
124
+ pageRoot?: HTMLElement;
125
+ /** Resolve an anchor to a repository-relative source path. */
126
+ source?: (element: Element) => string | undefined;
127
+ /** Defaults to GitHub's source viewer. */
128
+ sourceUrl?: (source: string, branch: string) => string;
129
+ /** Defaults to location.pathname; query strings are not stored. */
130
+ page?: () => string;
131
+ pollInterval?: number;
132
+ /** Full emoji JSON URL; fetched only when choosing another emoji. */
133
+ emojiDataSource?: string;
134
+ /** Opt-in trusted parent domain. Every sibling host can receive the session. */
135
+ sessionDomain?: string;
136
+ /** Canonical API identity for trusted gateways to the same service. Defaults to endpoint. */
137
+ sessionEndpoint?: string;
138
+ }
139
+
140
+ export interface CommentsController {
141
+ /** Open a new comment anchored to an element. */
142
+ comment(element: Element): void;
143
+ destroy(): void;
144
+ open(): void;
145
+ close(): void;
146
+ refresh(): Promise<void>;
147
+ }
148
+
149
+ export interface AccountUsage {
150
+ hosted: boolean;
151
+ projects: { used: number; limit: number | null } | null;
152
+ comments: { used: number; limit: number | null };
153
+ }