yepanywhere 0.1.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.
- package/bundled/@yep-anywhere/shared/dist/app-types.d.ts +229 -0
- package/bundled/@yep-anywhere/shared/dist/app-types.d.ts.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/app-types.js +46 -0
- package/bundled/@yep-anywhere/shared/dist/app-types.js.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/content/DocumentContentSchema.d.ts +16 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/content/DocumentContentSchema.d.ts.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/content/DocumentContentSchema.js +17 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/content/DocumentContentSchema.js.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/content/ImageContentSchema.d.ts +15 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/content/ImageContentSchema.d.ts.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/content/ImageContentSchema.js +10 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/content/ImageContentSchema.js.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/content/TextContentSchema.d.ts +6 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/content/TextContentSchema.d.ts.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/content/TextContentSchema.js +6 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/content/TextContentSchema.js.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/content/ThinkingContentSchema.d.ts +7 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/content/ThinkingContentSchema.d.ts.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/content/ThinkingContentSchema.js +7 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/content/ThinkingContentSchema.js.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/content/ToolResultContentSchema.d.ts +24 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/content/ToolResultContentSchema.d.ts.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/content/ToolResultContentSchema.js +13 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/content/ToolResultContentSchema.js.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/content/ToolUseContentSchema.d.ts +8 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/content/ToolUseContentSchema.d.ts.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/content/ToolUseContentSchema.js +8 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/content/ToolUseContentSchema.js.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/AssistantEntrySchema.d.ts +78 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/AssistantEntrySchema.d.ts.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/AssistantEntrySchema.js +13 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/AssistantEntrySchema.js.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/BaseEntrySchema.d.ts +18 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/BaseEntrySchema.d.ts.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/BaseEntrySchema.js +19 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/BaseEntrySchema.js.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/FileHistorySnapshotEntrySchema.d.ts +13 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/FileHistorySnapshotEntrySchema.d.ts.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/FileHistorySnapshotEntrySchema.js +14 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/FileHistorySnapshotEntrySchema.js.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/QueueOperationEntrySchema.d.ts +68 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/QueueOperationEntrySchema.d.ts.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/QueueOperationEntrySchema.js +37 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/QueueOperationEntrySchema.js.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/SummaryEntrySchema.d.ts +8 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/SummaryEntrySchema.d.ts.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/SummaryEntrySchema.js +7 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/SummaryEntrySchema.js.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/SystemEntrySchema.d.ts +52 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/SystemEntrySchema.d.ts.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/SystemEntrySchema.js +29 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/SystemEntrySchema.js.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/UserEntrySchema.d.ts +72 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/UserEntrySchema.d.ts.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/UserEntrySchema.js +10 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/UserEntrySchema.js.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/normalizeQueueOperationContent.d.ts +14 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/normalizeQueueOperationContent.d.ts.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/normalizeQueueOperationContent.js +39 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/normalizeQueueOperationContent.js.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/guards.d.ts +15 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/guards.d.ts.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/guards.js +26 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/guards.js.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/index.d.ts +566 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/index.d.ts.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/index.js +39 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/index.js.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/message/AssistantMessageSchema.d.ts +93 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/message/AssistantMessageSchema.d.ts.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/message/AssistantMessageSchema.js +40 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/message/AssistantMessageSchema.js.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/message/UserMessageSchema.d.ts +105 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/message/UserMessageSchema.d.ts.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/message/UserMessageSchema.js +20 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/message/UserMessageSchema.js.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/tool/CommonToolSchema.d.ts +53 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/tool/CommonToolSchema.d.ts.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/tool/CommonToolSchema.js +54 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/tool/CommonToolSchema.js.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/tool/StructuredPatchSchema.d.ts +9 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/tool/StructuredPatchSchema.d.ts.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/tool/StructuredPatchSchema.js +9 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/tool/StructuredPatchSchema.js.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/tool/TodoSchema.d.ts +32 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/tool/TodoSchema.d.ts.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/tool/TodoSchema.js +12 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/tool/TodoSchema.js.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/tool/ToolResultSchemas.d.ts +288 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/tool/ToolResultSchemas.d.ts.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/tool/ToolResultSchemas.js +293 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/tool/ToolResultSchemas.js.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/tool/index.d.ts +83 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/tool/index.d.ts.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/tool/index.js +10 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/tool/index.js.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/types.d.ts +42 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/types.d.ts.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/types.js +11 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/types.js.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/codex-schema/content.d.ts +99 -0
- package/bundled/@yep-anywhere/shared/dist/codex-schema/content.d.ts.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/codex-schema/content.js +64 -0
- package/bundled/@yep-anywhere/shared/dist/codex-schema/content.js.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/codex-schema/index.d.ts +17 -0
- package/bundled/@yep-anywhere/shared/dist/codex-schema/index.d.ts.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/codex-schema/index.js +17 -0
- package/bundled/@yep-anywhere/shared/dist/codex-schema/index.js.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/codex-schema/session.d.ts +600 -0
- package/bundled/@yep-anywhere/shared/dist/codex-schema/session.d.ts.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/codex-schema/session.js +282 -0
- package/bundled/@yep-anywhere/shared/dist/codex-schema/session.js.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/codex-schema/types.d.ts +7 -0
- package/bundled/@yep-anywhere/shared/dist/codex-schema/types.d.ts.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/codex-schema/types.js +6 -0
- package/bundled/@yep-anywhere/shared/dist/codex-schema/types.js.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/dag.d.ts +35 -0
- package/bundled/@yep-anywhere/shared/dist/dag.d.ts.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/dag.js +75 -0
- package/bundled/@yep-anywhere/shared/dist/dag.js.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/filePathDetection.d.ts +72 -0
- package/bundled/@yep-anywhere/shared/dist/filePathDetection.d.ts.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/filePathDetection.js +376 -0
- package/bundled/@yep-anywhere/shared/dist/filePathDetection.js.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/gemini-schema/content.d.ts +95 -0
- package/bundled/@yep-anywhere/shared/dist/gemini-schema/content.d.ts.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/gemini-schema/content.js +57 -0
- package/bundled/@yep-anywhere/shared/dist/gemini-schema/content.js.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/gemini-schema/events.d.ts +174 -0
- package/bundled/@yep-anywhere/shared/dist/gemini-schema/events.d.ts.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/gemini-schema/events.js +117 -0
- package/bundled/@yep-anywhere/shared/dist/gemini-schema/events.js.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/gemini-schema/index.d.ts +18 -0
- package/bundled/@yep-anywhere/shared/dist/gemini-schema/index.d.ts.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/gemini-schema/index.js +18 -0
- package/bundled/@yep-anywhere/shared/dist/gemini-schema/index.js.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/gemini-schema/session.d.ts +267 -0
- package/bundled/@yep-anywhere/shared/dist/gemini-schema/session.d.ts.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/gemini-schema/session.js +147 -0
- package/bundled/@yep-anywhere/shared/dist/gemini-schema/session.js.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/gemini-schema/types.d.ts +7 -0
- package/bundled/@yep-anywhere/shared/dist/gemini-schema/types.d.ts.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/gemini-schema/types.js +6 -0
- package/bundled/@yep-anywhere/shared/dist/gemini-schema/types.js.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/ideMetadata.d.ts +30 -0
- package/bundled/@yep-anywhere/shared/dist/ideMetadata.d.ts.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/ideMetadata.js +58 -0
- package/bundled/@yep-anywhere/shared/dist/ideMetadata.js.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/index.d.ts +24 -0
- package/bundled/@yep-anywhere/shared/dist/index.d.ts.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/index.js +17 -0
- package/bundled/@yep-anywhere/shared/dist/index.js.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/opencode-schema/events.d.ts +457 -0
- package/bundled/@yep-anywhere/shared/dist/opencode-schema/events.d.ts.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/opencode-schema/events.js +217 -0
- package/bundled/@yep-anywhere/shared/dist/opencode-schema/events.js.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/opencode-schema/index.d.ts +23 -0
- package/bundled/@yep-anywhere/shared/dist/opencode-schema/index.d.ts.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/opencode-schema/index.js +23 -0
- package/bundled/@yep-anywhere/shared/dist/opencode-schema/index.js.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/opencode-schema/session.d.ts +149 -0
- package/bundled/@yep-anywhere/shared/dist/opencode-schema/session.d.ts.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/opencode-schema/session.js +158 -0
- package/bundled/@yep-anywhere/shared/dist/opencode-schema/session.js.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/opencode-schema/types.d.ts +7 -0
- package/bundled/@yep-anywhere/shared/dist/opencode-schema/types.d.ts.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/opencode-schema/types.js +6 -0
- package/bundled/@yep-anywhere/shared/dist/opencode-schema/types.js.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/projectId.d.ts +48 -0
- package/bundled/@yep-anywhere/shared/dist/projectId.d.ts.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/projectId.js +74 -0
- package/bundled/@yep-anywhere/shared/dist/projectId.js.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/session/SessionView.d.ts +171 -0
- package/bundled/@yep-anywhere/shared/dist/session/SessionView.d.ts.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/session/SessionView.js +189 -0
- package/bundled/@yep-anywhere/shared/dist/session/SessionView.js.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/session/UnifiedSession.d.ts +31 -0
- package/bundled/@yep-anywhere/shared/dist/session/UnifiedSession.d.ts.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/session/UnifiedSession.js +2 -0
- package/bundled/@yep-anywhere/shared/dist/session/UnifiedSession.js.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/session/index.d.ts +3 -0
- package/bundled/@yep-anywhere/shared/dist/session/index.d.ts.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/session/index.js +2 -0
- package/bundled/@yep-anywhere/shared/dist/session/index.js.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/types.d.ts +172 -0
- package/bundled/@yep-anywhere/shared/dist/types.d.ts.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/types.js +33 -0
- package/bundled/@yep-anywhere/shared/dist/types.js.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/upload.d.ts +58 -0
- package/bundled/@yep-anywhere/shared/dist/upload.d.ts.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/upload.js +6 -0
- package/bundled/@yep-anywhere/shared/dist/upload.js.map +1 -0
- package/bundled/@yep-anywhere/shared/package.json +7 -0
- package/client-dist/assets/index-C7DeAWG4.css +1 -0
- package/client-dist/assets/index-yX0HPwrz.js +147 -0
- package/client-dist/badge-96.png +0 -0
- package/client-dist/badge.svg +20 -0
- package/client-dist/debug-streaming.html +746 -0
- package/client-dist/favicon.ico +0 -0
- package/client-dist/icon-192.png +0 -0
- package/client-dist/icon-512.png +0 -0
- package/client-dist/icon.svg +27 -0
- package/client-dist/index.html +35 -0
- package/client-dist/manifest.json +23 -0
- package/client-dist/sw.js +482 -0
- package/dist/app.d.ts +67 -0
- package/dist/app.d.ts.map +1 -0
- package/dist/app.js +236 -0
- package/dist/app.js.map +1 -0
- package/dist/augments/augment-generator.d.ts +30 -0
- package/dist/augments/augment-generator.d.ts.map +1 -0
- package/dist/augments/augment-generator.js +171 -0
- package/dist/augments/augment-generator.js.map +1 -0
- package/dist/augments/block-detector.d.ts +81 -0
- package/dist/augments/block-detector.d.ts.map +1 -0
- package/dist/augments/block-detector.js +615 -0
- package/dist/augments/block-detector.js.map +1 -0
- package/dist/augments/edit-augments.d.ts +138 -0
- package/dist/augments/edit-augments.d.ts.map +1 -0
- package/dist/augments/edit-augments.js +665 -0
- package/dist/augments/edit-augments.js.map +1 -0
- package/dist/augments/index.d.ts +14 -0
- package/dist/augments/index.d.ts.map +1 -0
- package/dist/augments/index.js +20 -0
- package/dist/augments/index.js.map +1 -0
- package/dist/augments/markdown-augments.d.ts +33 -0
- package/dist/augments/markdown-augments.d.ts.map +1 -0
- package/dist/augments/markdown-augments.js +128 -0
- package/dist/augments/markdown-augments.js.map +1 -0
- package/dist/augments/read-augments.d.ts +40 -0
- package/dist/augments/read-augments.d.ts.map +1 -0
- package/dist/augments/read-augments.js +64 -0
- package/dist/augments/read-augments.js.map +1 -0
- package/dist/augments/stream-coordinator.d.ts +32 -0
- package/dist/augments/stream-coordinator.d.ts.map +1 -0
- package/dist/augments/stream-coordinator.js +115 -0
- package/dist/augments/stream-coordinator.js.map +1 -0
- package/dist/augments/write-augments.d.ts +32 -0
- package/dist/augments/write-augments.d.ts.map +1 -0
- package/dist/augments/write-augments.js +27 -0
- package/dist/augments/write-augments.js.map +1 -0
- package/dist/auth/AuthService.d.ts +98 -0
- package/dist/auth/AuthService.d.ts.map +1 -0
- package/dist/auth/AuthService.js +217 -0
- package/dist/auth/AuthService.js.map +1 -0
- package/dist/auth/index.d.ts +3 -0
- package/dist/auth/index.d.ts.map +1 -0
- package/dist/auth/index.js +3 -0
- package/dist/auth/index.js.map +1 -0
- package/dist/auth/routes.d.ts +13 -0
- package/dist/auth/routes.d.ts.map +1 -0
- package/dist/auth/routes.js +149 -0
- package/dist/auth/routes.js.map +1 -0
- package/dist/cli.d.ts +19 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +152 -0
- package/dist/cli.js.map +1 -0
- package/dist/config.d.ts +76 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +124 -0
- package/dist/config.js.map +1 -0
- package/dist/dev-mock.d.ts +18 -0
- package/dist/dev-mock.d.ts.map +1 -0
- package/dist/dev-mock.js +260 -0
- package/dist/dev-mock.js.map +1 -0
- package/dist/frontend/index.d.ts +10 -0
- package/dist/frontend/index.d.ts.map +1 -0
- package/dist/frontend/index.js +10 -0
- package/dist/frontend/index.js.map +1 -0
- package/dist/frontend/proxy.d.ts +70 -0
- package/dist/frontend/proxy.d.ts.map +1 -0
- package/dist/frontend/proxy.js +329 -0
- package/dist/frontend/proxy.js.map +1 -0
- package/dist/frontend/static.d.ts +16 -0
- package/dist/frontend/static.d.ts.map +1 -0
- package/dist/frontend/static.js +106 -0
- package/dist/frontend/static.js.map +1 -0
- package/dist/highlighting/index.d.ts +43 -0
- package/dist/highlighting/index.d.ts.map +1 -0
- package/dist/highlighting/index.js +224 -0
- package/dist/highlighting/index.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +259 -0
- package/dist/index.js.map +1 -0
- package/dist/indexes/SessionIndexService.d.ts +106 -0
- package/dist/indexes/SessionIndexService.d.ts.map +1 -0
- package/dist/indexes/SessionIndexService.js +356 -0
- package/dist/indexes/SessionIndexService.js.map +1 -0
- package/dist/indexes/index.d.ts +3 -0
- package/dist/indexes/index.d.ts.map +1 -0
- package/dist/indexes/index.js +2 -0
- package/dist/indexes/index.js.map +1 -0
- package/dist/indexes/types.d.ts +55 -0
- package/dist/indexes/types.d.ts.map +1 -0
- package/dist/indexes/types.js +8 -0
- package/dist/indexes/types.js.map +1 -0
- package/dist/logging/index.d.ts +2 -0
- package/dist/logging/index.d.ts.map +1 -0
- package/dist/logging/index.js +2 -0
- package/dist/logging/index.js.map +1 -0
- package/dist/logging/logger.d.ts +81 -0
- package/dist/logging/logger.d.ts.map +1 -0
- package/dist/logging/logger.js +257 -0
- package/dist/logging/logger.js.map +1 -0
- package/dist/maintenance/debug-routes.d.ts +39 -0
- package/dist/maintenance/debug-routes.d.ts.map +1 -0
- package/dist/maintenance/debug-routes.js +561 -0
- package/dist/maintenance/debug-routes.js.map +1 -0
- package/dist/maintenance/index.d.ts +3 -0
- package/dist/maintenance/index.d.ts.map +1 -0
- package/dist/maintenance/index.js +3 -0
- package/dist/maintenance/index.js.map +1 -0
- package/dist/maintenance/server.d.ts +53 -0
- package/dist/maintenance/server.d.ts.map +1 -0
- package/dist/maintenance/server.js +419 -0
- package/dist/maintenance/server.js.map +1 -0
- package/dist/metadata/SessionMetadataService.d.ts +96 -0
- package/dist/metadata/SessionMetadataService.d.ts.map +1 -0
- package/dist/metadata/SessionMetadataService.js +209 -0
- package/dist/metadata/SessionMetadataService.js.map +1 -0
- package/dist/metadata/index.d.ts +2 -0
- package/dist/metadata/index.d.ts.map +1 -0
- package/dist/metadata/index.js +2 -0
- package/dist/metadata/index.js.map +1 -0
- package/dist/middleware/auth.d.ts +18 -0
- package/dist/middleware/auth.d.ts.map +1 -0
- package/dist/middleware/auth.js +53 -0
- package/dist/middleware/auth.js.map +1 -0
- package/dist/middleware/security.d.ts +4 -0
- package/dist/middleware/security.d.ts.map +1 -0
- package/dist/middleware/security.js +28 -0
- package/dist/middleware/security.js.map +1 -0
- package/dist/notifications/NotificationService.d.ts +76 -0
- package/dist/notifications/NotificationService.d.ts.map +1 -0
- package/dist/notifications/NotificationService.js +155 -0
- package/dist/notifications/NotificationService.js.map +1 -0
- package/dist/notifications/index.d.ts +2 -0
- package/dist/notifications/index.d.ts.map +1 -0
- package/dist/notifications/index.js +2 -0
- package/dist/notifications/index.js.map +1 -0
- package/dist/projects/codex-scanner.d.ts +52 -0
- package/dist/projects/codex-scanner.d.ts.map +1 -0
- package/dist/projects/codex-scanner.js +167 -0
- package/dist/projects/codex-scanner.js.map +1 -0
- package/dist/projects/gemini-project-map.d.ts +54 -0
- package/dist/projects/gemini-project-map.d.ts.map +1 -0
- package/dist/projects/gemini-project-map.js +116 -0
- package/dist/projects/gemini-project-map.js.map +1 -0
- package/dist/projects/gemini-scanner.d.ts +58 -0
- package/dist/projects/gemini-scanner.d.ts.map +1 -0
- package/dist/projects/gemini-scanner.js +210 -0
- package/dist/projects/gemini-scanner.js.map +1 -0
- package/dist/projects/index.d.ts +16 -0
- package/dist/projects/index.d.ts.map +1 -0
- package/dist/projects/index.js +17 -0
- package/dist/projects/index.js.map +1 -0
- package/dist/projects/paths.d.ts +127 -0
- package/dist/projects/paths.d.ts.map +1 -0
- package/dist/projects/paths.js +185 -0
- package/dist/projects/paths.js.map +1 -0
- package/dist/projects/scanner.d.ts +45 -0
- package/dist/projects/scanner.d.ts.map +1 -0
- package/dist/projects/scanner.js +287 -0
- package/dist/projects/scanner.js.map +1 -0
- package/dist/push/PushNotifier.d.ts +48 -0
- package/dist/push/PushNotifier.d.ts.map +1 -0
- package/dist/push/PushNotifier.js +145 -0
- package/dist/push/PushNotifier.js.map +1 -0
- package/dist/push/PushService.d.ts +95 -0
- package/dist/push/PushService.d.ts.map +1 -0
- package/dist/push/PushService.js +245 -0
- package/dist/push/PushService.js.map +1 -0
- package/dist/push/index.d.ts +9 -0
- package/dist/push/index.d.ts.map +1 -0
- package/dist/push/index.js +8 -0
- package/dist/push/index.js.map +1 -0
- package/dist/push/routes.d.ts +10 -0
- package/dist/push/routes.d.ts.map +1 -0
- package/dist/push/routes.js +111 -0
- package/dist/push/routes.js.map +1 -0
- package/dist/push/types.d.ts +80 -0
- package/dist/push/types.d.ts.map +1 -0
- package/dist/push/types.js +5 -0
- package/dist/push/types.js.map +1 -0
- package/dist/push/vapid.d.ts +42 -0
- package/dist/push/vapid.d.ts.map +1 -0
- package/dist/push/vapid.js +132 -0
- package/dist/push/vapid.js.map +1 -0
- package/dist/recents/RecentsService.d.ts +77 -0
- package/dist/recents/RecentsService.d.ts.map +1 -0
- package/dist/recents/RecentsService.js +155 -0
- package/dist/recents/RecentsService.js.map +1 -0
- package/dist/recents/index.d.ts +2 -0
- package/dist/recents/index.d.ts.map +1 -0
- package/dist/recents/index.js +2 -0
- package/dist/recents/index.js.map +1 -0
- package/dist/routes/activity.d.ts +7 -0
- package/dist/routes/activity.d.ts.map +1 -0
- package/dist/routes/activity.js +80 -0
- package/dist/routes/activity.js.map +1 -0
- package/dist/routes/beads.d.ts +42 -0
- package/dist/routes/beads.d.ts.map +1 -0
- package/dist/routes/beads.js +101 -0
- package/dist/routes/beads.js.map +1 -0
- package/dist/routes/debug-streaming.d.ts +7 -0
- package/dist/routes/debug-streaming.d.ts.map +1 -0
- package/dist/routes/debug-streaming.js +88 -0
- package/dist/routes/debug-streaming.js.map +1 -0
- package/dist/routes/dev.d.ts +11 -0
- package/dist/routes/dev.d.ts.map +1 -0
- package/dist/routes/dev.js +55 -0
- package/dist/routes/dev.js.map +1 -0
- package/dist/routes/files.d.ts +7 -0
- package/dist/routes/files.d.ts.map +1 -0
- package/dist/routes/files.js +429 -0
- package/dist/routes/files.js.map +1 -0
- package/dist/routes/global-sessions.d.ts +76 -0
- package/dist/routes/global-sessions.d.ts.map +1 -0
- package/dist/routes/global-sessions.js +207 -0
- package/dist/routes/global-sessions.js.map +1 -0
- package/dist/routes/health.d.ts +3 -0
- package/dist/routes/health.d.ts.map +1 -0
- package/dist/routes/health.js +6 -0
- package/dist/routes/health.js.map +1 -0
- package/dist/routes/inbox.d.ts +45 -0
- package/dist/routes/inbox.d.ts.map +1 -0
- package/dist/routes/inbox.js +174 -0
- package/dist/routes/inbox.js.map +1 -0
- package/dist/routes/processes.d.ts +16 -0
- package/dist/routes/processes.d.ts.map +1 -0
- package/dist/routes/processes.js +82 -0
- package/dist/routes/processes.js.map +1 -0
- package/dist/routes/projects.d.ts +30 -0
- package/dist/routes/projects.d.ts.map +1 -0
- package/dist/routes/projects.js +316 -0
- package/dist/routes/projects.js.map +1 -0
- package/dist/routes/providers.d.ts +9 -0
- package/dist/routes/providers.d.ts.map +1 -0
- package/dist/routes/providers.js +63 -0
- package/dist/routes/providers.js.map +1 -0
- package/dist/routes/recents.d.ts +14 -0
- package/dist/routes/recents.d.ts.map +1 -0
- package/dist/routes/recents.js +82 -0
- package/dist/routes/recents.js.map +1 -0
- package/dist/routes/sessions.d.ts +26 -0
- package/dist/routes/sessions.d.ts.map +1 -0
- package/dist/routes/sessions.js +962 -0
- package/dist/routes/sessions.js.map +1 -0
- package/dist/routes/stream.d.ts +7 -0
- package/dist/routes/stream.d.ts.map +1 -0
- package/dist/routes/stream.js +561 -0
- package/dist/routes/stream.js.map +1 -0
- package/dist/routes/upload.d.ts +14 -0
- package/dist/routes/upload.d.ts.map +1 -0
- package/dist/routes/upload.js +278 -0
- package/dist/routes/upload.js.map +1 -0
- package/dist/sdk/cli-detection.d.ts +47 -0
- package/dist/sdk/cli-detection.d.ts.map +1 -0
- package/dist/sdk/cli-detection.js +122 -0
- package/dist/sdk/cli-detection.js.map +1 -0
- package/dist/sdk/messageLogger.d.ts +15 -0
- package/dist/sdk/messageLogger.d.ts.map +1 -0
- package/dist/sdk/messageLogger.js +68 -0
- package/dist/sdk/messageLogger.js.map +1 -0
- package/dist/sdk/messageQueue.d.ts +49 -0
- package/dist/sdk/messageQueue.d.ts.map +1 -0
- package/dist/sdk/messageQueue.js +186 -0
- package/dist/sdk/messageQueue.js.map +1 -0
- package/dist/sdk/mock.d.ts +16 -0
- package/dist/sdk/mock.d.ts.map +1 -0
- package/dist/sdk/mock.js +81 -0
- package/dist/sdk/mock.js.map +1 -0
- package/dist/sdk/providers/__mocks__/base.d.ts +78 -0
- package/dist/sdk/providers/__mocks__/base.d.ts.map +1 -0
- package/dist/sdk/providers/__mocks__/base.js +185 -0
- package/dist/sdk/providers/__mocks__/base.js.map +1 -0
- package/dist/sdk/providers/__mocks__/claude.d.ts +33 -0
- package/dist/sdk/providers/__mocks__/claude.d.ts.map +1 -0
- package/dist/sdk/providers/__mocks__/claude.js +146 -0
- package/dist/sdk/providers/__mocks__/claude.js.map +1 -0
- package/dist/sdk/providers/__mocks__/codex.d.ts +45 -0
- package/dist/sdk/providers/__mocks__/codex.d.ts.map +1 -0
- package/dist/sdk/providers/__mocks__/codex.js +160 -0
- package/dist/sdk/providers/__mocks__/codex.js.map +1 -0
- package/dist/sdk/providers/__mocks__/factory.d.ts +40 -0
- package/dist/sdk/providers/__mocks__/factory.d.ts.map +1 -0
- package/dist/sdk/providers/__mocks__/factory.js +183 -0
- package/dist/sdk/providers/__mocks__/factory.js.map +1 -0
- package/dist/sdk/providers/__mocks__/gemini.d.ts +43 -0
- package/dist/sdk/providers/__mocks__/gemini.d.ts.map +1 -0
- package/dist/sdk/providers/__mocks__/gemini.js +198 -0
- package/dist/sdk/providers/__mocks__/gemini.js.map +1 -0
- package/dist/sdk/providers/__mocks__/index.d.ts +23 -0
- package/dist/sdk/providers/__mocks__/index.d.ts.map +1 -0
- package/dist/sdk/providers/__mocks__/index.js +25 -0
- package/dist/sdk/providers/__mocks__/index.js.map +1 -0
- package/dist/sdk/providers/__mocks__/opencode.d.ts +33 -0
- package/dist/sdk/providers/__mocks__/opencode.d.ts.map +1 -0
- package/dist/sdk/providers/__mocks__/opencode.js +136 -0
- package/dist/sdk/providers/__mocks__/opencode.js.map +1 -0
- package/dist/sdk/providers/__mocks__/types.d.ts +50 -0
- package/dist/sdk/providers/__mocks__/types.d.ts.map +1 -0
- package/dist/sdk/providers/__mocks__/types.js +8 -0
- package/dist/sdk/providers/__mocks__/types.js.map +1 -0
- package/dist/sdk/providers/claude.d.ts +63 -0
- package/dist/sdk/providers/claude.d.ts.map +1 -0
- package/dist/sdk/providers/claude.js +252 -0
- package/dist/sdk/providers/claude.js.map +1 -0
- package/dist/sdk/providers/codex-oss.d.ts +108 -0
- package/dist/sdk/providers/codex-oss.d.ts.map +1 -0
- package/dist/sdk/providers/codex-oss.js +744 -0
- package/dist/sdk/providers/codex-oss.js.map +1 -0
- package/dist/sdk/providers/codex.d.ts +82 -0
- package/dist/sdk/providers/codex.d.ts.map +1 -0
- package/dist/sdk/providers/codex.js +597 -0
- package/dist/sdk/providers/codex.js.map +1 -0
- package/dist/sdk/providers/gemini.d.ts +78 -0
- package/dist/sdk/providers/gemini.d.ts.map +1 -0
- package/dist/sdk/providers/gemini.js +536 -0
- package/dist/sdk/providers/gemini.js.map +1 -0
- package/dist/sdk/providers/index.d.ts +22 -0
- package/dist/sdk/providers/index.d.ts.map +1 -0
- package/dist/sdk/providers/index.js +53 -0
- package/dist/sdk/providers/index.js.map +1 -0
- package/dist/sdk/providers/opencode.d.ts +95 -0
- package/dist/sdk/providers/opencode.d.ts.map +1 -0
- package/dist/sdk/providers/opencode.js +586 -0
- package/dist/sdk/providers/opencode.js.map +1 -0
- package/dist/sdk/providers/types.d.ts +99 -0
- package/dist/sdk/providers/types.d.ts.map +1 -0
- package/dist/sdk/providers/types.js +2 -0
- package/dist/sdk/providers/types.js.map +1 -0
- package/dist/sdk/real.d.ts +20 -0
- package/dist/sdk/real.d.ts.map +1 -0
- package/dist/sdk/real.js +22 -0
- package/dist/sdk/real.js.map +1 -0
- package/dist/sdk/types.d.ts +113 -0
- package/dist/sdk/types.d.ts.map +1 -0
- package/dist/sdk/types.js +3 -0
- package/dist/sdk/types.js.map +1 -0
- package/dist/sessions/Session.d.ts +80 -0
- package/dist/sessions/Session.d.ts.map +1 -0
- package/dist/sessions/Session.js +119 -0
- package/dist/sessions/Session.js.map +1 -0
- package/dist/sessions/codex-reader.d.ts +166 -0
- package/dist/sessions/codex-reader.d.ts.map +1 -0
- package/dist/sessions/codex-reader.js +664 -0
- package/dist/sessions/codex-reader.js.map +1 -0
- package/dist/sessions/dag.d.ts +62 -0
- package/dist/sessions/dag.d.ts.map +1 -0
- package/dist/sessions/dag.js +175 -0
- package/dist/sessions/dag.js.map +1 -0
- package/dist/sessions/fork.d.ts +34 -0
- package/dist/sessions/fork.d.ts.map +1 -0
- package/dist/sessions/fork.js +58 -0
- package/dist/sessions/fork.js.map +1 -0
- package/dist/sessions/gemini-reader.d.ts +103 -0
- package/dist/sessions/gemini-reader.d.ts.map +1 -0
- package/dist/sessions/gemini-reader.js +332 -0
- package/dist/sessions/gemini-reader.js.map +1 -0
- package/dist/sessions/normalization.d.ts +7 -0
- package/dist/sessions/normalization.d.ts.map +1 -0
- package/dist/sessions/normalization.js +429 -0
- package/dist/sessions/normalization.js.map +1 -0
- package/dist/sessions/opencode-reader.d.ts +99 -0
- package/dist/sessions/opencode-reader.d.ts.map +1 -0
- package/dist/sessions/opencode-reader.js +370 -0
- package/dist/sessions/opencode-reader.js.map +1 -0
- package/dist/sessions/reader.d.ts +118 -0
- package/dist/sessions/reader.d.ts.map +1 -0
- package/dist/sessions/reader.js +444 -0
- package/dist/sessions/reader.js.map +1 -0
- package/dist/sessions/types.d.ts +77 -0
- package/dist/sessions/types.d.ts.map +1 -0
- package/dist/sessions/types.js +8 -0
- package/dist/sessions/types.js.map +1 -0
- package/dist/supervisor/ExternalSessionTracker.d.ts +94 -0
- package/dist/supervisor/ExternalSessionTracker.d.ts.map +1 -0
- package/dist/supervisor/ExternalSessionTracker.js +507 -0
- package/dist/supervisor/ExternalSessionTracker.js.map +1 -0
- package/dist/supervisor/Process.d.ts +230 -0
- package/dist/supervisor/Process.d.ts.map +1 -0
- package/dist/supervisor/Process.js +878 -0
- package/dist/supervisor/Process.js.map +1 -0
- package/dist/supervisor/Supervisor.d.ts +191 -0
- package/dist/supervisor/Supervisor.d.ts.map +1 -0
- package/dist/supervisor/Supervisor.js +933 -0
- package/dist/supervisor/Supervisor.js.map +1 -0
- package/dist/supervisor/WorkerQueue.d.ts +113 -0
- package/dist/supervisor/WorkerQueue.d.ts.map +1 -0
- package/dist/supervisor/WorkerQueue.js +148 -0
- package/dist/supervisor/WorkerQueue.js.map +1 -0
- package/dist/supervisor/types.d.ts +176 -0
- package/dist/supervisor/types.d.ts.map +1 -0
- package/dist/supervisor/types.js +7 -0
- package/dist/supervisor/types.js.map +1 -0
- package/dist/testing/mockProjectData.d.ts +5 -0
- package/dist/testing/mockProjectData.d.ts.map +1 -0
- package/dist/testing/mockProjectData.js +27 -0
- package/dist/testing/mockProjectData.js.map +1 -0
- package/dist/uploads/index.d.ts +3 -0
- package/dist/uploads/index.d.ts.map +1 -0
- package/dist/uploads/index.js +2 -0
- package/dist/uploads/index.js.map +1 -0
- package/dist/uploads/manager.d.ts +84 -0
- package/dist/uploads/manager.d.ts.map +1 -0
- package/dist/uploads/manager.js +215 -0
- package/dist/uploads/manager.js.map +1 -0
- package/dist/utils/fileLock.d.ts +57 -0
- package/dist/utils/fileLock.d.ts.map +1 -0
- package/dist/utils/fileLock.js +91 -0
- package/dist/utils/fileLock.js.map +1 -0
- package/dist/watcher/BatchProcessor.d.ts +58 -0
- package/dist/watcher/BatchProcessor.d.ts.map +1 -0
- package/dist/watcher/BatchProcessor.js +105 -0
- package/dist/watcher/BatchProcessor.js.map +1 -0
- package/dist/watcher/EventBus.d.ts +157 -0
- package/dist/watcher/EventBus.d.ts.map +1 -0
- package/dist/watcher/EventBus.js +36 -0
- package/dist/watcher/EventBus.js.map +1 -0
- package/dist/watcher/FileWatcher.d.ts +42 -0
- package/dist/watcher/FileWatcher.d.ts.map +1 -0
- package/dist/watcher/FileWatcher.js +165 -0
- package/dist/watcher/FileWatcher.js.map +1 -0
- package/dist/watcher/SourceWatcher.d.ts +36 -0
- package/dist/watcher/SourceWatcher.d.ts.map +1 -0
- package/dist/watcher/SourceWatcher.js +97 -0
- package/dist/watcher/SourceWatcher.js.map +1 -0
- package/dist/watcher/index.d.ts +9 -0
- package/dist/watcher/index.d.ts.map +1 -0
- package/dist/watcher/index.js +5 -0
- package/dist/watcher/index.js.map +1 -0
- package/package.json +54 -0
- package/scripts/postinstall.js +48 -0
package/dist/cli.js
ADDED
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* CLI entry point for yepanywhere
|
|
4
|
+
*
|
|
5
|
+
* Usage:
|
|
6
|
+
* yepanywhere # Start server with defaults
|
|
7
|
+
* yepanywhere --help # Show help
|
|
8
|
+
* yepanywhere --version # Show version
|
|
9
|
+
*
|
|
10
|
+
* Environment variables:
|
|
11
|
+
* PORT # Server port (default: 3400)
|
|
12
|
+
* YEP_ANYWHERE_DATA_DIR # Data directory override
|
|
13
|
+
* YEP_ANYWHERE_PROFILE # Profile name (creates ~/.yep-anywhere-{profile}/)
|
|
14
|
+
* AUTH_ENABLED # Enable cookie auth (default: false)
|
|
15
|
+
* LOG_LEVEL # Log level: fatal, error, warn, info, debug, trace
|
|
16
|
+
* ... (see CLAUDE.md for full list)
|
|
17
|
+
*/
|
|
18
|
+
import { execSync } from "node:child_process";
|
|
19
|
+
import * as fs from "node:fs";
|
|
20
|
+
import * as path from "node:path";
|
|
21
|
+
import { fileURLToPath } from "node:url";
|
|
22
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
23
|
+
const __dirname = path.dirname(__filename);
|
|
24
|
+
const MINIMUM_NODE_VERSION = 20;
|
|
25
|
+
/**
|
|
26
|
+
* Check if Node.js version meets minimum requirements.
|
|
27
|
+
* Exits with error if version is too low.
|
|
28
|
+
*/
|
|
29
|
+
function checkNodeVersion() {
|
|
30
|
+
const currentVersion = process.versions.node;
|
|
31
|
+
const majorVersion = Number.parseInt(currentVersion.split(".")[0] ?? "0", 10);
|
|
32
|
+
if (majorVersion < MINIMUM_NODE_VERSION) {
|
|
33
|
+
console.error(`Error: Node.js ${MINIMUM_NODE_VERSION}+ is required.`);
|
|
34
|
+
console.error(`Current version: ${currentVersion}`);
|
|
35
|
+
console.error("");
|
|
36
|
+
console.error("Please upgrade Node.js: https://nodejs.org/");
|
|
37
|
+
process.exit(1);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Check if Claude CLI is installed and warn if not found.
|
|
42
|
+
* Does not exit - Claude is optional but recommended.
|
|
43
|
+
*/
|
|
44
|
+
function checkClaudeCli() {
|
|
45
|
+
try {
|
|
46
|
+
execSync("which claude", {
|
|
47
|
+
encoding: "utf-8",
|
|
48
|
+
stdio: ["pipe", "pipe", "pipe"],
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
catch {
|
|
52
|
+
console.warn("Warning: Claude CLI not found.");
|
|
53
|
+
console.warn("Claude Code is the primary supported agent. Install it to use Claude sessions:");
|
|
54
|
+
console.warn(" curl -fsSL https://claude.ai/install.sh | bash");
|
|
55
|
+
console.warn("");
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
function showHelp() {
|
|
59
|
+
console.log(`
|
|
60
|
+
yepanywhere - A mobile-first supervisor for Claude Code agents
|
|
61
|
+
|
|
62
|
+
USAGE:
|
|
63
|
+
yepanywhere [OPTIONS]
|
|
64
|
+
|
|
65
|
+
OPTIONS:
|
|
66
|
+
--help, -h Show this help message
|
|
67
|
+
--version, -v Show version number
|
|
68
|
+
|
|
69
|
+
ENVIRONMENT VARIABLES:
|
|
70
|
+
PORT Server port (default: 3400)
|
|
71
|
+
YEP_ANYWHERE_DATA_DIR Data directory override
|
|
72
|
+
YEP_ANYWHERE_PROFILE Profile name (creates ~/.yep-anywhere-{profile}/)
|
|
73
|
+
AUTH_ENABLED Enable cookie auth (default: false)
|
|
74
|
+
LOG_LEVEL Log level: fatal, error, warn, info, debug, trace
|
|
75
|
+
MAINTENANCE_PORT Maintenance server port (default: PORT + 1, 0 to disable)
|
|
76
|
+
|
|
77
|
+
EXAMPLES:
|
|
78
|
+
# Start with defaults (port 3400)
|
|
79
|
+
yepanywhere
|
|
80
|
+
|
|
81
|
+
# Start on custom port
|
|
82
|
+
PORT=8000 yepanywhere
|
|
83
|
+
|
|
84
|
+
# Use development profile (separate data directory)
|
|
85
|
+
YEP_ANYWHERE_PROFILE=dev yepanywhere
|
|
86
|
+
|
|
87
|
+
# Enable authentication
|
|
88
|
+
AUTH_ENABLED=true yepanywhere
|
|
89
|
+
|
|
90
|
+
DOCUMENTATION:
|
|
91
|
+
For full documentation, see: https://github.com/your-org/yepanywhere
|
|
92
|
+
|
|
93
|
+
DATA DIRECTORY:
|
|
94
|
+
Default: ~/.yep-anywhere/
|
|
95
|
+
Contains: logs/, indexes/, uploads/, session metadata, push subscriptions
|
|
96
|
+
|
|
97
|
+
REQUIREMENTS:
|
|
98
|
+
- Node.js >= 20
|
|
99
|
+
- Claude CLI installed (curl -fsSL https://claude.ai/install.sh | bash)
|
|
100
|
+
`);
|
|
101
|
+
}
|
|
102
|
+
function getVersion() {
|
|
103
|
+
try {
|
|
104
|
+
// Read package.json from the package root
|
|
105
|
+
const packageJsonPath = path.resolve(__dirname, "../package.json");
|
|
106
|
+
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, "utf-8"));
|
|
107
|
+
return packageJson.version || "unknown";
|
|
108
|
+
}
|
|
109
|
+
catch (error) {
|
|
110
|
+
return "unknown";
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
function showVersion() {
|
|
114
|
+
console.log(`yepanywhere v${getVersion()}`);
|
|
115
|
+
}
|
|
116
|
+
// Parse command line arguments
|
|
117
|
+
const args = process.argv.slice(2);
|
|
118
|
+
if (args.includes("--help") || args.includes("-h")) {
|
|
119
|
+
showHelp();
|
|
120
|
+
process.exit(0);
|
|
121
|
+
}
|
|
122
|
+
if (args.includes("--version") || args.includes("-v")) {
|
|
123
|
+
showVersion();
|
|
124
|
+
process.exit(0);
|
|
125
|
+
}
|
|
126
|
+
// If there are unknown arguments, show error and help
|
|
127
|
+
if (args.length > 0) {
|
|
128
|
+
console.error(`Error: Unknown arguments: ${args.join(" ")}`);
|
|
129
|
+
console.error("");
|
|
130
|
+
console.error("Run 'yepanywhere --help' for usage information.");
|
|
131
|
+
process.exit(1);
|
|
132
|
+
}
|
|
133
|
+
// Run prerequisite checks before starting
|
|
134
|
+
checkNodeVersion();
|
|
135
|
+
checkClaudeCli();
|
|
136
|
+
// Set NODE_ENV to production if not already set (CLI users expect production mode)
|
|
137
|
+
if (!process.env.NODE_ENV) {
|
|
138
|
+
process.env.NODE_ENV = "production";
|
|
139
|
+
}
|
|
140
|
+
// Start the server by importing the main module
|
|
141
|
+
// This ensures all initialization happens in index.ts as designed
|
|
142
|
+
async function start() {
|
|
143
|
+
try {
|
|
144
|
+
await import("./index.js");
|
|
145
|
+
}
|
|
146
|
+
catch (error) {
|
|
147
|
+
console.error("Failed to start server:", error);
|
|
148
|
+
process.exit(1);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
start();
|
|
152
|
+
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAEA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;AAE3C,MAAM,oBAAoB,GAAG,EAAE,CAAC;AAEhC;;;GAGG;AACH,SAAS,gBAAgB;IACvB,MAAM,cAAc,GAAG,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC;IAC7C,MAAM,YAAY,GAAG,MAAM,CAAC,QAAQ,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,EAAE,EAAE,CAAC,CAAC;IAE9E,IAAI,YAAY,GAAG,oBAAoB,EAAE,CAAC;QACxC,OAAO,CAAC,KAAK,CAAC,kBAAkB,oBAAoB,gBAAgB,CAAC,C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AE,KAAK,CAAC,CAAC;QAChD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC;AAED,KAAK,EAAE,CAAC"}
|
package/dist/config.d.ts
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import type { Level as LogLevel } from "pino";
|
|
2
|
+
import type { PermissionMode } from "./sdk/types.js";
|
|
3
|
+
/**
|
|
4
|
+
* Get the data directory for yep-anywhere state files.
|
|
5
|
+
* Supports profiles for running multiple instances (like Chrome profiles).
|
|
6
|
+
*
|
|
7
|
+
* Priority:
|
|
8
|
+
* 1. YEP_ANYWHERE_DATA_DIR - Full path override
|
|
9
|
+
* 2. YEP_ANYWHERE_PROFILE - Appends suffix: ~/.yep-anywhere-{profile}
|
|
10
|
+
* 3. Default: ~/.yep-anywhere
|
|
11
|
+
*/
|
|
12
|
+
export declare function getDataDir(): string;
|
|
13
|
+
/**
|
|
14
|
+
* Server configuration loaded from environment variables.
|
|
15
|
+
*/
|
|
16
|
+
export interface Config {
|
|
17
|
+
/** Data directory for yep-anywhere state files (indexes, metadata, uploads, etc.) */
|
|
18
|
+
dataDir: string;
|
|
19
|
+
/** Directory where Claude projects are stored */
|
|
20
|
+
claudeProjectsDir: string;
|
|
21
|
+
/** Claude sessions directory (~/.claude/projects) */
|
|
22
|
+
claudeSessionsDir: string;
|
|
23
|
+
/** Gemini sessions directory (~/.gemini/tmp) */
|
|
24
|
+
geminiSessionsDir: string;
|
|
25
|
+
/** Codex sessions directory (~/.codex/sessions) */
|
|
26
|
+
codexSessionsDir: string;
|
|
27
|
+
/** Idle timeout in milliseconds before process cleanup */
|
|
28
|
+
idleTimeoutMs: number;
|
|
29
|
+
/** Default permission mode for new sessions */
|
|
30
|
+
defaultPermissionMode: PermissionMode;
|
|
31
|
+
/** Server port */
|
|
32
|
+
port: number;
|
|
33
|
+
/** Maintenance server port (default: main port + 1). Set to 0 to disable. */
|
|
34
|
+
maintenancePort: number;
|
|
35
|
+
/** Use mock SDK instead of real Claude SDK */
|
|
36
|
+
useMockSdk: boolean;
|
|
37
|
+
/** Maximum concurrent workers. 0 = unlimited (default for backward compat) */
|
|
38
|
+
maxWorkers: number;
|
|
39
|
+
/** Idle threshold in milliseconds for preemption. Workers idle longer than this can be preempted. */
|
|
40
|
+
idlePreemptThresholdMs: number;
|
|
41
|
+
/** Whether to serve frontend (proxy in dev, static in prod) */
|
|
42
|
+
serveFrontend: boolean;
|
|
43
|
+
/** Vite dev server port for frontend proxy */
|
|
44
|
+
vitePort: number;
|
|
45
|
+
/** Path to built client dist directory */
|
|
46
|
+
clientDistPath: string;
|
|
47
|
+
/** Path to stable (emergency) client dist directory */
|
|
48
|
+
stableDistPath: string;
|
|
49
|
+
/** Maximum upload file size in bytes. 0 = unlimited (default: 100MB) */
|
|
50
|
+
maxUploadSizeBytes: number;
|
|
51
|
+
/** Maximum queue size for pending requests. 0 = unlimited (default: 100) */
|
|
52
|
+
maxQueueSize: number;
|
|
53
|
+
/** Directory for log files. Default: ~/.yep-anywhere/logs */
|
|
54
|
+
logDir: string;
|
|
55
|
+
/** Log filename. Default: server.log */
|
|
56
|
+
logFile: string;
|
|
57
|
+
/** Minimum log level for console. Default: info */
|
|
58
|
+
logLevel: LogLevel;
|
|
59
|
+
/** Minimum log level for file. Default: same as logLevel or LOG_FILE_LEVEL */
|
|
60
|
+
logFileLevel: LogLevel;
|
|
61
|
+
/** Whether to log to file. Default: true */
|
|
62
|
+
logToFile: boolean;
|
|
63
|
+
/** Whether to log to console. Default: true */
|
|
64
|
+
logToConsole: boolean;
|
|
65
|
+
/** Whether cookie-based auth is enabled. Default: false (enable in settings) */
|
|
66
|
+
authEnabled: boolean;
|
|
67
|
+
/** Cookie signing secret. Auto-generated if not provided. */
|
|
68
|
+
authCookieSecret?: string;
|
|
69
|
+
/** Session TTL in milliseconds. Default: 30 days */
|
|
70
|
+
authSessionTtlMs: number;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Load configuration from environment variables with defaults.
|
|
74
|
+
*/
|
|
75
|
+
export declare function loadConfig(): Config;
|
|
76
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,KAAK,IAAI,QAAQ,EAAE,MAAM,MAAM,CAAC;AAC9C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAErD;;;;;;;;GAQG;AACH,wBAAgB,UAAU,IAAI,MAAM,CASnC;AAED;;GAEG;AACH,MAAM,WAAW,MAAM;IACrB,qFAAqF;IACrF,OAAO,EAAE,MAAM,CAAC;IAChB,iDAAiD;IACjD,iBAAiB,EAAE,MAAM,CAAC;IAC1B,qDAAqD;IACrD,iBAAiB,EAAE,MAAM,CAAC;IAC1B,gDAAgD;IAChD,iBAAiB,EAAE,MAAM,CAAC;IAC1B,mDAAmD;IACnD,gBAAgB,EAAE,MAAM,CAAC;IACzB,0DAA0D;IAC1D,aAAa,EAAE,MAAM,CAAC;IACtB,+CAA+C;IAC/C,qBAAqB,EAAE,cAAc,CAAC;IACtC,kBAAkB;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,6EAA6E;IAC7E,eAAe,EAAE,MAAM,CAAC;IACxB,8CAA8C;IAC9C,UAAU,EAAE,OAAO,CAAC;IACpB,8EAA8E;IAC9E,UAAU,EAAE,MAAM,CAAC;IACnB,qGAAqG;IACrG,sBAAsB,EAAE,MAAM,CAAC;IAC/B,+DAA+D;IAC/D,aAAa,EAAE,OAAO,CAAC;IACvB,8CAA8C;IAC9C,QAAQ,EAAE,MAAM,CAAC;IACjB,0CAA0C;IAC1C,cAAc,EAAE,MAAM,CAAC;IACvB,uDAAuD;IACvD,cAAc,EAAE,MAAM,CAAC;IACvB,wEAAwE;IACxE,kBAAkB,EAAE,MAAM,CAAC;IAC3B,4EAA4E;IAC5E,YAAY,EAAE,MAAM,CAAC;IACrB,6DAA6D;IAC7D,MAAM,EAAE,MAAM,CAAC;IACf,wCAAwC;IACxC,OAAO,EAAE,MAAM,CAAC;IAChB,mDAAmD;IACnD,QAAQ,EAAE,QAAQ,CAAC;IACnB,8EAA8E;IAC9E,YAAY,EAAE,QAAQ,CAAC;IACvB,4CAA4C;IAC5C,SAAS,EAAE,OAAO,CAAC;IACnB,+CAA+C;IAC/C,YAAY,EAAE,OAAO,CAAC;IACtB,gFAAgF;IAChF,WAAW,EAAE,OAAO,CAAC;IACrB,6DAA6D;IAC7D,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,oDAAoD;IACpD,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED;;GAEG;AACH,wBAAgB,UAAU,IAAI,MAAM,CA+EnC"}
|
package/dist/config.js
ADDED
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import * as fs from "node:fs";
|
|
2
|
+
import * as os from "node:os";
|
|
3
|
+
import * as path from "node:path";
|
|
4
|
+
/**
|
|
5
|
+
* Get the data directory for yep-anywhere state files.
|
|
6
|
+
* Supports profiles for running multiple instances (like Chrome profiles).
|
|
7
|
+
*
|
|
8
|
+
* Priority:
|
|
9
|
+
* 1. YEP_ANYWHERE_DATA_DIR - Full path override
|
|
10
|
+
* 2. YEP_ANYWHERE_PROFILE - Appends suffix: ~/.yep-anywhere-{profile}
|
|
11
|
+
* 3. Default: ~/.yep-anywhere
|
|
12
|
+
*/
|
|
13
|
+
export function getDataDir() {
|
|
14
|
+
if (process.env.YEP_ANYWHERE_DATA_DIR) {
|
|
15
|
+
return process.env.YEP_ANYWHERE_DATA_DIR;
|
|
16
|
+
}
|
|
17
|
+
const profile = process.env.YEP_ANYWHERE_PROFILE;
|
|
18
|
+
if (profile) {
|
|
19
|
+
return path.join(os.homedir(), `.yep-anywhere-${profile}`);
|
|
20
|
+
}
|
|
21
|
+
return path.join(os.homedir(), ".yep-anywhere");
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Load configuration from environment variables with defaults.
|
|
25
|
+
*/
|
|
26
|
+
export function loadConfig() {
|
|
27
|
+
// Determine if we're in production mode
|
|
28
|
+
const isProduction = process.env.NODE_ENV === "production";
|
|
29
|
+
// SERVE_FRONTEND defaults to true (unified server mode)
|
|
30
|
+
// Set SERVE_FRONTEND=false to disable frontend serving (API-only mode)
|
|
31
|
+
const serveFrontend = process.env.SERVE_FRONTEND !== "false";
|
|
32
|
+
// Get data directory (supports profiles for multiple instances)
|
|
33
|
+
const dataDir = getDataDir();
|
|
34
|
+
const claudeSessionsDir = path.join(os.homedir(), ".claude", "projects");
|
|
35
|
+
const geminiSessionsDir = path.join(os.homedir(), ".gemini", "tmp");
|
|
36
|
+
const codexSessionsDir = path.join(os.homedir(), ".codex", "sessions");
|
|
37
|
+
return {
|
|
38
|
+
dataDir,
|
|
39
|
+
claudeProjectsDir: process.env.CLAUDE_PROJECTS_DIR ?? claudeSessionsDir,
|
|
40
|
+
claudeSessionsDir,
|
|
41
|
+
geminiSessionsDir,
|
|
42
|
+
codexSessionsDir,
|
|
43
|
+
idleTimeoutMs: parseIntOrDefault(process.env.IDLE_TIMEOUT, 5 * 60) * 1000,
|
|
44
|
+
defaultPermissionMode: parsePermissionMode(process.env.PERMISSION_MODE),
|
|
45
|
+
port: parseIntOrDefault(process.env.PORT, 3400),
|
|
46
|
+
// Maintenance port defaults to main port + 1, set to 0 to disable
|
|
47
|
+
maintenancePort: parseIntOrDefault(process.env.MAINTENANCE_PORT, parseIntOrDefault(process.env.PORT, 3400) + 1),
|
|
48
|
+
useMockSdk: process.env.USE_MOCK_SDK === "true",
|
|
49
|
+
maxWorkers: parseIntOrDefault(process.env.MAX_WORKERS, 0),
|
|
50
|
+
idlePreemptThresholdMs: parseIntOrDefault(process.env.IDLE_PREEMPT_THRESHOLD, 10) * 1000,
|
|
51
|
+
serveFrontend,
|
|
52
|
+
// Vite port defaults to main port + 2, keeping all ports sequential
|
|
53
|
+
vitePort: parseIntOrDefault(process.env.VITE_PORT, parseIntOrDefault(process.env.PORT, 3400) + 2),
|
|
54
|
+
// Client dist path: Check bundled location first (npm package), then monorepo (dev)
|
|
55
|
+
clientDistPath: process.env.CLIENT_DIST_PATH ??
|
|
56
|
+
(() => {
|
|
57
|
+
// When published to npm, client assets are bundled into ./client-dist
|
|
58
|
+
const bundledPath = path.resolve(import.meta.dirname, "../client-dist");
|
|
59
|
+
if (fs.existsSync(bundledPath)) {
|
|
60
|
+
return bundledPath;
|
|
61
|
+
}
|
|
62
|
+
// In development (monorepo), use ../client/dist
|
|
63
|
+
return path.resolve(import.meta.dirname, "../../client/dist");
|
|
64
|
+
})(),
|
|
65
|
+
// Stable (emergency) UI build with /_stable/ base path
|
|
66
|
+
stableDistPath: process.env.STABLE_DIST_PATH ??
|
|
67
|
+
path.resolve(import.meta.dirname, "../../client/dist-stable"),
|
|
68
|
+
// Default 100MB max upload size
|
|
69
|
+
maxUploadSizeBytes: parseIntOrDefault(process.env.MAX_UPLOAD_SIZE_MB, 100) * 1024 * 1024,
|
|
70
|
+
// Default 100 max queue size
|
|
71
|
+
maxQueueSize: parseIntOrDefault(process.env.MAX_QUEUE_SIZE, 100),
|
|
72
|
+
// Logging configuration (uses dataDir as base)
|
|
73
|
+
logDir: process.env.LOG_DIR ?? path.join(dataDir, "logs"),
|
|
74
|
+
logFile: process.env.LOG_FILE ?? "server.log",
|
|
75
|
+
logLevel: parseLogLevel(process.env.LOG_LEVEL),
|
|
76
|
+
logFileLevel: parseLogLevel(process.env.LOG_FILE_LEVEL ?? process.env.LOG_LEVEL),
|
|
77
|
+
logToFile: process.env.LOG_TO_FILE !== "false",
|
|
78
|
+
logToConsole: process.env.LOG_TO_CONSOLE !== "false",
|
|
79
|
+
// Auth configuration (disabled by default, enable with AUTH_ENABLED=true or in settings)
|
|
80
|
+
authEnabled: process.env.AUTH_ENABLED === "true",
|
|
81
|
+
authCookieSecret: process.env.AUTH_COOKIE_SECRET,
|
|
82
|
+
authSessionTtlMs: parseIntOrDefault(process.env.AUTH_SESSION_TTL_DAYS, 30) *
|
|
83
|
+
24 *
|
|
84
|
+
60 *
|
|
85
|
+
60 *
|
|
86
|
+
1000,
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Parse an integer from string or return default value.
|
|
91
|
+
*/
|
|
92
|
+
function parseIntOrDefault(value, defaultValue) {
|
|
93
|
+
if (!value)
|
|
94
|
+
return defaultValue;
|
|
95
|
+
const parsed = Number.parseInt(value, 10);
|
|
96
|
+
return Number.isNaN(parsed) ? defaultValue : parsed;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Parse permission mode from string or return default.
|
|
100
|
+
*/
|
|
101
|
+
function parsePermissionMode(value) {
|
|
102
|
+
if (value === "bypassPermissions" || value === "acceptEdits") {
|
|
103
|
+
return value;
|
|
104
|
+
}
|
|
105
|
+
return "default";
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Parse log level from string or return default.
|
|
109
|
+
*/
|
|
110
|
+
function parseLogLevel(value) {
|
|
111
|
+
const validLevels = [
|
|
112
|
+
"fatal",
|
|
113
|
+
"error",
|
|
114
|
+
"warn",
|
|
115
|
+
"info",
|
|
116
|
+
"debug",
|
|
117
|
+
"trace",
|
|
118
|
+
];
|
|
119
|
+
if (value && validLevels.includes(value)) {
|
|
120
|
+
return value;
|
|
121
|
+
}
|
|
122
|
+
return "info";
|
|
123
|
+
}
|
|
124
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAIlC;;;;;;;;GAQG;AACH,MAAM,UAAU,UAAU;IACxB,IAAI,OAAO,CAAC,GAAG,CAA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,KAAK,EAAE,EAAE,CAAC,CAAC;IAC1C,OAAO,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC;AACtD,CAAC;AAED;;GAEG;AACH,SAAS,mBAAmB,CAAC,KAAyB;IACpD,IAAI,KAAK,KAAK,mBAAmB,IAAI,KAAK,KAAK,aAAa,EAAE,CAAC;QAC7D,OAAO,KAAK,CAAC;IACf,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED;;GAEG;AACH,SAAS,aAAa,CAAC,KAAyB;IAC9C,MAAM,WAAW,GAAe;QAC9B,OAAO;QACP,OAAO;QACP,MAAM;QACN,MAAM;QACN,OAAO;QACP,OAAO;KACR,CAAC;IACF,IAAI,KAAK,IAAI,WAAW,CAAC,QAAQ,CAAC,KAAiB,CAAC,EAAE,CAAC;QACrD,OAAO,KAAiB,CAAC;IAC3B,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Development server with mock providers.
|
|
3
|
+
*
|
|
4
|
+
* Runs the full application with mock SDK/providers for testing.
|
|
5
|
+
* Supports multiple providers (Claude, Codex, Gemini) via mock implementations.
|
|
6
|
+
*
|
|
7
|
+
* Environment variables:
|
|
8
|
+
* - MOCK_PROVIDER: Default provider to use (claude, codex, gemini). Default: claude
|
|
9
|
+
* - MOCK_DELAY_MS: Delay between mock messages in ms. Default: 200
|
|
10
|
+
*/
|
|
11
|
+
import { MockClaudeSDK } from "./sdk/mock.js";
|
|
12
|
+
import { type MockAgentProvider } from "./sdk/providers/__mocks__/index.js";
|
|
13
|
+
import type { ProviderName } from "./sdk/providers/types.js";
|
|
14
|
+
declare const DEFAULT_PROVIDER: ProviderName;
|
|
15
|
+
declare const mockProviders: Record<ProviderName, MockAgentProvider>;
|
|
16
|
+
declare const mockSdk: MockClaudeSDK;
|
|
17
|
+
export { mockProviders, mockSdk, DEFAULT_PROVIDER };
|
|
18
|
+
//# sourceMappingURL=dev-mock.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dev-mock.d.ts","sourceRoot":"","sources":["../src/dev-mock.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAiBH,OAAO,EAEL,aAAa,EACd,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,KAAK,iBAAiB,EAOvB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAO7D,QAAA,MAAM,gBAAgB,cACmC,CAAC;AA0F1D,QAAA,MAAM,aAAa,EAAE,MAAM,CAAC,YAAY,EAAE,iBAAiB,CAU1D,CAAC;AAKF,QAAA,MAAM,OAAO,eAEZ,CAAC;AA4JF,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
|
package/dist/dev-mock.js
ADDED
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Development server with mock providers.
|
|
3
|
+
*
|
|
4
|
+
* Runs the full application with mock SDK/providers for testing.
|
|
5
|
+
* Supports multiple providers (Claude, Codex, Gemini) via mock implementations.
|
|
6
|
+
*
|
|
7
|
+
* Environment variables:
|
|
8
|
+
* - MOCK_PROVIDER: Default provider to use (claude, codex, gemini). Default: claude
|
|
9
|
+
* - MOCK_DELAY_MS: Delay between mock messages in ms. Default: 200
|
|
10
|
+
*/
|
|
11
|
+
import * as fs from "node:fs";
|
|
12
|
+
import * as os from "node:os";
|
|
13
|
+
import * as path from "node:path";
|
|
14
|
+
import { serve } from "@hono/node-server";
|
|
15
|
+
import { RESPONSE_ALREADY_SENT } from "@hono/node-server/utils/response";
|
|
16
|
+
import { createNodeWebSocket } from "@hono/node-ws";
|
|
17
|
+
import { createApp } from "./app.js";
|
|
18
|
+
import { loadConfig } from "./config.js";
|
|
19
|
+
import { attachUnifiedUpgradeHandler, createFrontendProxy, createStaticRoutes, } from "./frontend/index.js";
|
|
20
|
+
import { ProjectScanner } from "./projects/scanner.js";
|
|
21
|
+
import { createUploadRoutes } from "./routes/upload.js";
|
|
22
|
+
import { MockClaudeSDK, } from "./sdk/mock.js";
|
|
23
|
+
import { MockClaudeProvider, MockCodexOSSProvider, MockCodexProvider, MockGeminiProvider, MockOpenCodeProvider, } from "./sdk/providers/__mocks__/index.js";
|
|
24
|
+
import { setupMockProjects } from "./testing/mockProjectData.js";
|
|
25
|
+
import { EventBus, FileWatcher } from "./watcher/index.js";
|
|
26
|
+
const config = loadConfig();
|
|
27
|
+
// Configuration from environment
|
|
28
|
+
const DEFAULT_PROVIDER = process.env.MOCK_PROVIDER || "claude";
|
|
29
|
+
const DELAY_MS = Number.parseInt(process.env.MOCK_DELAY_MS || "200", 10);
|
|
30
|
+
// Ensure mock data exists
|
|
31
|
+
setupMockProjects();
|
|
32
|
+
/**
|
|
33
|
+
* Create mock scenarios for each provider.
|
|
34
|
+
* These simulate realistic responses with appropriate delays.
|
|
35
|
+
*/
|
|
36
|
+
function createMockScenarios(provider) {
|
|
37
|
+
const prefix = provider.charAt(0).toUpperCase() + provider.slice(1);
|
|
38
|
+
return [
|
|
39
|
+
{
|
|
40
|
+
messages: [
|
|
41
|
+
{ type: "system", subtype: "init", session_id: `${provider}-001` },
|
|
42
|
+
{
|
|
43
|
+
type: "assistant",
|
|
44
|
+
message: {
|
|
45
|
+
content: `Hello! I'm ${prefix}. How can I help you today?`,
|
|
46
|
+
role: "assistant",
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
{ type: "result", session_id: `${provider}-001` },
|
|
50
|
+
],
|
|
51
|
+
delayMs: DELAY_MS,
|
|
52
|
+
sessionId: `${provider}-001`,
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
messages: [
|
|
56
|
+
{ type: "system", subtype: "init", session_id: `${provider}-002` },
|
|
57
|
+
{
|
|
58
|
+
type: "assistant",
|
|
59
|
+
message: {
|
|
60
|
+
content: `I understand. Let me help you with that. (${prefix})`,
|
|
61
|
+
role: "assistant",
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
{ type: "result", session_id: `${provider}-002` },
|
|
65
|
+
],
|
|
66
|
+
delayMs: DELAY_MS,
|
|
67
|
+
sessionId: `${provider}-002`,
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
messages: [
|
|
71
|
+
{ type: "system", subtype: "init", session_id: `${provider}-003` },
|
|
72
|
+
{
|
|
73
|
+
type: "assistant",
|
|
74
|
+
message: {
|
|
75
|
+
content: `Got it. Here's what I can do. (${prefix})`,
|
|
76
|
+
role: "assistant",
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
{ type: "result", session_id: `${provider}-003` },
|
|
80
|
+
],
|
|
81
|
+
delayMs: DELAY_MS,
|
|
82
|
+
sessionId: `${provider}-003`,
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
messages: [
|
|
86
|
+
{ type: "system", subtype: "init", session_id: `${provider}-004` },
|
|
87
|
+
{
|
|
88
|
+
type: "assistant",
|
|
89
|
+
message: {
|
|
90
|
+
content: `Processing your request. (${prefix})`,
|
|
91
|
+
role: "assistant",
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
{ type: "result", session_id: `${provider}-004` },
|
|
95
|
+
],
|
|
96
|
+
delayMs: DELAY_MS,
|
|
97
|
+
sessionId: `${provider}-004`,
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
messages: [
|
|
101
|
+
{ type: "system", subtype: "init", session_id: `${provider}-005` },
|
|
102
|
+
{
|
|
103
|
+
type: "assistant",
|
|
104
|
+
message: { content: `Here you go! (${prefix})`, role: "assistant" },
|
|
105
|
+
},
|
|
106
|
+
{ type: "result", session_id: `${provider}-005` },
|
|
107
|
+
],
|
|
108
|
+
delayMs: DELAY_MS,
|
|
109
|
+
sessionId: `${provider}-005`,
|
|
110
|
+
},
|
|
111
|
+
];
|
|
112
|
+
}
|
|
113
|
+
// Create mock providers for all provider types
|
|
114
|
+
const mockProviders = {
|
|
115
|
+
claude: new MockClaudeProvider({ scenarios: createMockScenarios("claude") }),
|
|
116
|
+
codex: new MockCodexProvider({ scenarios: createMockScenarios("codex") }),
|
|
117
|
+
"codex-oss": new MockCodexOSSProvider({
|
|
118
|
+
scenarios: createMockScenarios("codex-oss"),
|
|
119
|
+
}),
|
|
120
|
+
gemini: new MockGeminiProvider({ scenarios: createMockScenarios("gemini") }),
|
|
121
|
+
opencode: new MockOpenCodeProvider({
|
|
122
|
+
scenarios: createMockScenarios("opencode"),
|
|
123
|
+
}),
|
|
124
|
+
};
|
|
125
|
+
// Create legacy mock SDK for backward compatibility
|
|
126
|
+
// Uses the same scenarios as the Claude mock provider
|
|
127
|
+
// Note: MockScenario from __mocks__ has an extra `sessionId` field, cast to legacy type
|
|
128
|
+
const mockSdk = new MockClaudeSDK(createMockScenarios("test-session"));
|
|
129
|
+
// Create EventBus and FileWatchers for all provider directories
|
|
130
|
+
const eventBus = new EventBus();
|
|
131
|
+
const fileWatchers = [];
|
|
132
|
+
// Helper to create watcher if directory exists
|
|
133
|
+
function createWatcherIfExists(watchDir, provider) {
|
|
134
|
+
if (fs.existsSync(watchDir)) {
|
|
135
|
+
const watcher = new FileWatcher({
|
|
136
|
+
watchDir,
|
|
137
|
+
provider,
|
|
138
|
+
eventBus,
|
|
139
|
+
debounceMs: 200,
|
|
140
|
+
});
|
|
141
|
+
watcher.start();
|
|
142
|
+
fileWatchers.push(watcher);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
// Create watchers for session directories only (not full provider dirs)
|
|
146
|
+
// This reduces inotify pressure and memory usage
|
|
147
|
+
createWatcherIfExists(path.join(os.homedir(), ".claude", "projects"), "claude");
|
|
148
|
+
createWatcherIfExists(path.join(os.homedir(), ".gemini", "tmp"), "gemini");
|
|
149
|
+
createWatcherIfExists(path.join(os.homedir(), ".codex", "sessions"), "codex");
|
|
150
|
+
// Create frontend proxy or static routes depending on configuration
|
|
151
|
+
// If VITE_PORT=0 and CLIENT_DIST_PATH exists, serve static files
|
|
152
|
+
// Otherwise, proxy to Vite dev server
|
|
153
|
+
let frontendProxy;
|
|
154
|
+
let useStaticFiles = false;
|
|
155
|
+
if (config.serveFrontend) {
|
|
156
|
+
const distExists = fs.existsSync(config.clientDistPath);
|
|
157
|
+
if (config.vitePort === 0 && distExists) {
|
|
158
|
+
// E2E mode: serve pre-built static files
|
|
159
|
+
useStaticFiles = true;
|
|
160
|
+
console.log(`[Frontend] Serving static files from ${config.clientDistPath}`);
|
|
161
|
+
}
|
|
162
|
+
else if (config.vitePort > 0) {
|
|
163
|
+
// Dev mode: proxy to Vite
|
|
164
|
+
frontendProxy = createFrontendProxy({ vitePort: config.vitePort });
|
|
165
|
+
console.log(`[Frontend] Proxying to Vite at http://localhost:${config.vitePort}`);
|
|
166
|
+
}
|
|
167
|
+
else {
|
|
168
|
+
console.warn(`[Frontend] No frontend available (VITE_PORT=0 and no dist at ${config.clientDistPath})`);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
// Create the main app first (without WebSocket support or frontend proxy)
|
|
172
|
+
// We'll add those after setting up WebSocket support to ensure correct route order
|
|
173
|
+
const { app } = createApp({
|
|
174
|
+
sdk: mockSdk,
|
|
175
|
+
idleTimeoutMs: 60000, // 1 minute for testing
|
|
176
|
+
eventBus,
|
|
177
|
+
// Note: upgradeWebSocket and frontendProxy not passed - will be added below
|
|
178
|
+
});
|
|
179
|
+
// Set up WebSocket support with the main app
|
|
180
|
+
// @hono/node-ws requires the app instance to be the same one used by the server
|
|
181
|
+
// We get wss for the unified upgrade handler (instead of using injectWebSocket)
|
|
182
|
+
const { wss, upgradeWebSocket } = createNodeWebSocket({ app });
|
|
183
|
+
// Add the upload routes with WebSocket support
|
|
184
|
+
// These must be added BEFORE the frontend proxy catch-all
|
|
185
|
+
const scanner = new ProjectScanner();
|
|
186
|
+
const uploadRoutes = createUploadRoutes({ scanner, upgradeWebSocket });
|
|
187
|
+
app.route("/api", uploadRoutes);
|
|
188
|
+
// Add mock auth status endpoint (auth disabled for testing)
|
|
189
|
+
app.get("/api/auth/status", (c) => {
|
|
190
|
+
return c.json({
|
|
191
|
+
enabled: false,
|
|
192
|
+
authenticated: true,
|
|
193
|
+
setupRequired: false,
|
|
194
|
+
});
|
|
195
|
+
});
|
|
196
|
+
// Add mock providers status endpoint
|
|
197
|
+
// Returns all mock providers as available and authenticated
|
|
198
|
+
app.get("/api/providers", async (c) => {
|
|
199
|
+
const providers = await Promise.all(Object.entries(mockProviders).map(async ([name, provider]) => ({
|
|
200
|
+
name,
|
|
201
|
+
displayName: provider.displayName,
|
|
202
|
+
installed: await provider.isInstalled(),
|
|
203
|
+
authenticated: await provider.isAuthenticated(),
|
|
204
|
+
enabled: await provider.isAuthenticated(),
|
|
205
|
+
})));
|
|
206
|
+
return c.json(providers);
|
|
207
|
+
});
|
|
208
|
+
// Add mock provider status endpoint
|
|
209
|
+
app.get("/api/providers/:name/status", async (c) => {
|
|
210
|
+
const name = c.req.param("name");
|
|
211
|
+
const provider = mockProviders[name];
|
|
212
|
+
if (!provider) {
|
|
213
|
+
return c.json({ error: `Unknown provider: ${name}` }, 404);
|
|
214
|
+
}
|
|
215
|
+
const status = await provider.getAuthStatus();
|
|
216
|
+
return c.json({
|
|
217
|
+
name,
|
|
218
|
+
displayName: provider.displayName,
|
|
219
|
+
...status,
|
|
220
|
+
});
|
|
221
|
+
});
|
|
222
|
+
// Add frontend serving as the final catch-all (AFTER all API routes including uploads)
|
|
223
|
+
if (useStaticFiles) {
|
|
224
|
+
// E2E mode: serve static files
|
|
225
|
+
const staticRoutes = createStaticRoutes({
|
|
226
|
+
distPath: config.clientDistPath,
|
|
227
|
+
});
|
|
228
|
+
app.route("/", staticRoutes);
|
|
229
|
+
}
|
|
230
|
+
else if (frontendProxy) {
|
|
231
|
+
// Dev mode: proxy to Vite
|
|
232
|
+
const proxy = frontendProxy;
|
|
233
|
+
app.all("*", (c) => {
|
|
234
|
+
const { incoming, outgoing } = c.env;
|
|
235
|
+
proxy.web(incoming, outgoing);
|
|
236
|
+
return RESPONSE_ALREADY_SENT;
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
const port = config.port;
|
|
240
|
+
const server = serve({ fetch: app.fetch, port }, () => {
|
|
241
|
+
// Get actual port (important when binding to port 0)
|
|
242
|
+
const addr = server.address();
|
|
243
|
+
const actualPort = typeof addr === "object" && addr ? addr.port : port;
|
|
244
|
+
console.log(`Mock server running at http://localhost:${actualPort}`);
|
|
245
|
+
console.log(`Default provider: ${DEFAULT_PROVIDER}`);
|
|
246
|
+
console.log(`Message delay: ${DELAY_MS}ms`);
|
|
247
|
+
console.log("Available mock providers: claude, codex, gemini, local");
|
|
248
|
+
});
|
|
249
|
+
// Attach unified WebSocket upgrade handler
|
|
250
|
+
// This replaces both attachFrontendProxyUpgrade and injectWebSocket to avoid
|
|
251
|
+
// conflicts where both would try to handle the same upgrade request
|
|
252
|
+
attachUnifiedUpgradeHandler(server, {
|
|
253
|
+
frontendProxy,
|
|
254
|
+
isApiPath: (urlPath) => urlPath.startsWith("/api"),
|
|
255
|
+
app,
|
|
256
|
+
wss,
|
|
257
|
+
});
|
|
258
|
+
// Export for testing
|
|
259
|
+
export { mockProviders, mockSdk, DEFAULT_PROVIDER };
|
|
260
|
+
//# sourceMappingURL=dev-mock.js.map
|