beecork 1.3.0 → 1.3.2
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/LICENSE +21 -0
- package/README.md +154 -0
- package/dist/capabilities/index.d.ts +0 -1
- package/dist/capabilities/index.js +0 -1
- package/dist/capabilities/manager.d.ts +0 -1
- package/dist/capabilities/manager.js +0 -1
- package/dist/capabilities/packs.d.ts +0 -1
- package/dist/capabilities/packs.js +7 -8
- package/dist/capabilities/types.d.ts +0 -1
- package/dist/capabilities/types.js +0 -1
- package/dist/channels/command-handler.d.ts +0 -1
- package/dist/channels/command-handler.js +0 -1
- package/dist/channels/discord.d.ts +0 -1
- package/dist/channels/discord.js +30 -47
- package/dist/channels/index.d.ts +0 -1
- package/dist/channels/index.js +0 -1
- package/dist/channels/loader.d.ts +0 -1
- package/dist/channels/loader.js +6 -1
- package/dist/channels/pipeline.d.ts +50 -0
- package/dist/channels/pipeline.js +83 -0
- package/dist/channels/registry.d.ts +0 -1
- package/dist/channels/registry.js +0 -1
- package/dist/channels/telegram.d.ts +0 -1
- package/dist/channels/telegram.js +65 -67
- package/dist/channels/types.d.ts +0 -1
- package/dist/channels/types.js +0 -1
- package/dist/channels/webhook.d.ts +0 -1
- package/dist/channels/webhook.js +0 -1
- package/dist/channels/whatsapp.d.ts +0 -1
- package/dist/channels/whatsapp.js +25 -59
- package/dist/cli/capabilities.d.ts +0 -1
- package/dist/cli/capabilities.js +0 -1
- package/dist/cli/channel.d.ts +0 -1
- package/dist/cli/channel.js +1 -2
- package/dist/cli/commands.d.ts +0 -1
- package/dist/cli/commands.js +9 -3
- package/dist/cli/doctor.d.ts +0 -1
- package/dist/cli/doctor.js +2 -2
- package/dist/cli/handoff.d.ts +0 -1
- package/dist/cli/handoff.js +0 -1
- package/dist/cli/helpers.d.ts +0 -1
- package/dist/cli/helpers.js +0 -1
- package/dist/cli/mcp.d.ts +0 -1
- package/dist/cli/mcp.js +0 -1
- package/dist/cli/media.d.ts +0 -1
- package/dist/cli/media.js +0 -1
- package/dist/cli/setup.d.ts +0 -1
- package/dist/cli/setup.js +11 -11
- package/dist/cli/store.d.ts +0 -1
- package/dist/cli/store.js +0 -1
- package/dist/config.d.ts +0 -1
- package/dist/config.js +0 -1
- package/dist/daemon.d.ts +0 -1
- package/dist/daemon.js +1 -2
- package/dist/dashboard/html.d.ts +0 -1
- package/dist/dashboard/html.js +45 -38
- package/dist/dashboard/server.d.ts +0 -1
- package/dist/dashboard/server.js +60 -25
- package/dist/db/index.d.ts +11 -1
- package/dist/db/index.js +12 -1
- package/dist/db/migrations.d.ts +0 -1
- package/dist/db/migrations.js +5 -1
- package/dist/delegation/manager.d.ts +0 -3
- package/dist/delegation/manager.js +0 -5
- package/dist/index.d.ts +0 -1
- package/dist/index.js +21 -6
- package/dist/knowledge/index.d.ts +0 -1
- package/dist/knowledge/index.js +0 -1
- package/dist/knowledge/manager.d.ts +0 -1
- package/dist/knowledge/manager.js +19 -10
- package/dist/knowledge/types.d.ts +0 -1
- package/dist/knowledge/types.js +0 -1
- package/dist/machines/index.d.ts +1 -3
- package/dist/machines/index.js +1 -3
- package/dist/machines/registry.d.ts +0 -7
- package/dist/machines/registry.js +0 -25
- package/dist/mcp/server.d.ts +0 -1
- package/dist/mcp/server.js +28 -52
- package/dist/media/factory.d.ts +0 -1
- package/dist/media/factory.js +0 -1
- package/dist/media/generators/dall-e.d.ts +0 -1
- package/dist/media/generators/dall-e.js +0 -1
- package/dist/media/generators/elevenlabs-music.d.ts +0 -1
- package/dist/media/generators/elevenlabs-music.js +0 -1
- package/dist/media/generators/elevenlabs-sfx.d.ts +0 -1
- package/dist/media/generators/elevenlabs-sfx.js +0 -1
- package/dist/media/generators/kling.d.ts +0 -1
- package/dist/media/generators/kling.js +14 -20
- package/dist/media/generators/lyria.d.ts +0 -1
- package/dist/media/generators/lyria.js +0 -1
- package/dist/media/generators/nano-banana.d.ts +0 -1
- package/dist/media/generators/nano-banana.js +0 -1
- package/dist/media/generators/poll-util.d.ts +12 -0
- package/dist/media/generators/poll-util.js +22 -0
- package/dist/media/generators/recraft.d.ts +0 -1
- package/dist/media/generators/recraft.js +0 -1
- package/dist/media/generators/runway.d.ts +0 -1
- package/dist/media/generators/runway.js +14 -23
- package/dist/media/generators/stable-diffusion.d.ts +0 -1
- package/dist/media/generators/stable-diffusion.js +0 -1
- package/dist/media/generators/veo.d.ts +0 -1
- package/dist/media/generators/veo.js +0 -1
- package/dist/media/index.d.ts +0 -2
- package/dist/media/index.js +0 -2
- package/dist/media/store.d.ts +0 -1
- package/dist/media/store.js +0 -1
- package/dist/media/types.d.ts +0 -1
- package/dist/media/types.js +0 -1
- package/dist/memory/extractor.d.ts +0 -1
- package/dist/memory/extractor.js +8 -3
- package/dist/notifications/index.d.ts +0 -1
- package/dist/notifications/index.js +0 -1
- package/dist/notifications/ntfy.d.ts +0 -1
- package/dist/notifications/ntfy.js +0 -1
- package/dist/notifications/pushover.d.ts +0 -1
- package/dist/notifications/pushover.js +0 -1
- package/dist/notifications/types.d.ts +0 -1
- package/dist/notifications/types.js +0 -1
- package/dist/notifications/webhook-provider.d.ts +0 -1
- package/dist/notifications/webhook-provider.js +0 -1
- package/dist/observability/analytics.d.ts +0 -1
- package/dist/observability/analytics.js +0 -1
- package/dist/pipe/anthropic-client.d.ts +0 -1
- package/dist/pipe/anthropic-client.js +5 -3
- package/dist/pipe/brain.d.ts +0 -1
- package/dist/pipe/brain.js +0 -1
- package/dist/pipe/memory-store.d.ts +0 -1
- package/dist/pipe/memory-store.js +0 -1
- package/dist/pipe/project-scanner.d.ts +5 -3
- package/dist/pipe/project-scanner.js +21 -90
- package/dist/pipe/types.d.ts +0 -11
- package/dist/pipe/types.js +0 -1
- package/dist/projects/index.d.ts +0 -1
- package/dist/projects/index.js +0 -1
- package/dist/projects/manager.d.ts +0 -1
- package/dist/projects/manager.js +0 -1
- package/dist/projects/router.d.ts +0 -1
- package/dist/projects/router.js +1 -2
- package/dist/projects/types.d.ts +0 -7
- package/dist/projects/types.js +0 -1
- package/dist/service/install.d.ts +0 -1
- package/dist/service/install.js +0 -1
- package/dist/service/templates.d.ts +0 -1
- package/dist/service/templates.js +0 -1
- package/dist/service/windows.d.ts +0 -3
- package/dist/service/windows.js +0 -11
- package/dist/session/circuit-breaker.d.ts +0 -1
- package/dist/session/circuit-breaker.js +0 -1
- package/dist/session/context-monitor.d.ts +0 -1
- package/dist/session/context-monitor.js +0 -1
- package/dist/session/manager.d.ts +0 -1
- package/dist/session/manager.js +3 -4
- package/dist/session/subprocess.d.ts +0 -1
- package/dist/session/subprocess.js +0 -1
- package/dist/session/tool-classifier.d.ts +0 -1
- package/dist/session/tool-classifier.js +0 -1
- package/dist/tasks/scheduler.d.ts +0 -3
- package/dist/tasks/scheduler.js +4 -7
- package/dist/tasks/store.d.ts +0 -3
- package/dist/tasks/store.js +0 -3
- package/dist/timeline/index.d.ts +0 -1
- package/dist/timeline/index.js +0 -1
- package/dist/timeline/logger.d.ts +0 -1
- package/dist/timeline/logger.js +0 -1
- package/dist/timeline/query.d.ts +0 -1
- package/dist/timeline/query.js +2 -2
- package/dist/timeline/types.d.ts +0 -1
- package/dist/timeline/types.js +0 -1
- package/dist/types.d.ts +1 -7
- package/dist/types.js +0 -1
- package/dist/users/index.d.ts +1 -2
- package/dist/users/index.js +1 -2
- package/dist/users/service.d.ts +0 -8
- package/dist/users/service.js +0 -19
- package/dist/util/logger.d.ts +0 -1
- package/dist/util/logger.js +0 -1
- package/dist/util/paths.d.ts +0 -1
- package/dist/util/paths.js +0 -1
- package/dist/util/platform.d.ts +0 -1
- package/dist/util/platform.js +0 -1
- package/dist/util/progress.d.ts +0 -1
- package/dist/util/progress.js +0 -1
- package/dist/util/rate-limiter.d.ts +0 -1
- package/dist/util/rate-limiter.js +0 -1
- package/dist/util/retry.d.ts +0 -1
- package/dist/util/retry.js +1 -2
- package/dist/util/text.d.ts +0 -1
- package/dist/util/text.js +0 -1
- package/dist/version.d.ts +0 -1
- package/dist/version.js +0 -1
- package/dist/voice/index.d.ts +8 -1
- package/dist/voice/index.js +23 -1
- package/dist/voice/stt.d.ts +0 -1
- package/dist/voice/stt.js +0 -1
- package/dist/voice/tts.d.ts +0 -1
- package/dist/voice/tts.js +0 -1
- package/dist/watchers/evaluator.d.ts +0 -1
- package/dist/watchers/evaluator.js +25 -10
- package/dist/watchers/index.d.ts +0 -1
- package/dist/watchers/index.js +0 -1
- package/dist/watchers/scheduler.d.ts +0 -1
- package/dist/watchers/scheduler.js +3 -4
- package/dist/watchers/store.d.ts +0 -1
- package/dist/watchers/store.js +0 -1
- package/dist/watchers/types.d.ts +0 -1
- package/dist/watchers/types.js +0 -1
- package/package.json +26 -3
- package/dist/capabilities/index.d.ts.map +0 -1
- package/dist/capabilities/index.js.map +0 -1
- package/dist/capabilities/manager.d.ts.map +0 -1
- package/dist/capabilities/manager.js.map +0 -1
- package/dist/capabilities/packs.d.ts.map +0 -1
- package/dist/capabilities/packs.js.map +0 -1
- package/dist/capabilities/types.d.ts.map +0 -1
- package/dist/capabilities/types.js.map +0 -1
- package/dist/channels/command-handler.d.ts.map +0 -1
- package/dist/channels/command-handler.js.map +0 -1
- package/dist/channels/discord.d.ts.map +0 -1
- package/dist/channels/discord.js.map +0 -1
- package/dist/channels/index.d.ts.map +0 -1
- package/dist/channels/index.js.map +0 -1
- package/dist/channels/loader.d.ts.map +0 -1
- package/dist/channels/loader.js.map +0 -1
- package/dist/channels/registry.d.ts.map +0 -1
- package/dist/channels/registry.js.map +0 -1
- package/dist/channels/telegram.d.ts.map +0 -1
- package/dist/channels/telegram.js.map +0 -1
- package/dist/channels/types.d.ts.map +0 -1
- package/dist/channels/types.js.map +0 -1
- package/dist/channels/webhook.d.ts.map +0 -1
- package/dist/channels/webhook.js.map +0 -1
- package/dist/channels/whatsapp.d.ts.map +0 -1
- package/dist/channels/whatsapp.js.map +0 -1
- package/dist/cli/capabilities.d.ts.map +0 -1
- package/dist/cli/capabilities.js.map +0 -1
- package/dist/cli/channel.d.ts.map +0 -1
- package/dist/cli/channel.js.map +0 -1
- package/dist/cli/commands.d.ts.map +0 -1
- package/dist/cli/commands.js.map +0 -1
- package/dist/cli/doctor.d.ts.map +0 -1
- package/dist/cli/doctor.js.map +0 -1
- package/dist/cli/handoff.d.ts.map +0 -1
- package/dist/cli/handoff.js.map +0 -1
- package/dist/cli/helpers.d.ts.map +0 -1
- package/dist/cli/helpers.js.map +0 -1
- package/dist/cli/mcp.d.ts.map +0 -1
- package/dist/cli/mcp.js.map +0 -1
- package/dist/cli/media.d.ts.map +0 -1
- package/dist/cli/media.js.map +0 -1
- package/dist/cli/setup.d.ts.map +0 -1
- package/dist/cli/setup.js.map +0 -1
- package/dist/cli/store.d.ts.map +0 -1
- package/dist/cli/store.js.map +0 -1
- package/dist/config.d.ts.map +0 -1
- package/dist/config.js.map +0 -1
- package/dist/daemon.d.ts.map +0 -1
- package/dist/daemon.js.map +0 -1
- package/dist/dashboard/html.d.ts.map +0 -1
- package/dist/dashboard/html.js.map +0 -1
- package/dist/dashboard/server.d.ts.map +0 -1
- package/dist/dashboard/server.js.map +0 -1
- package/dist/db/index.d.ts.map +0 -1
- package/dist/db/index.js.map +0 -1
- package/dist/db/migrations.d.ts.map +0 -1
- package/dist/db/migrations.js.map +0 -1
- package/dist/delegation/manager.d.ts.map +0 -1
- package/dist/delegation/manager.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/knowledge/index.d.ts.map +0 -1
- package/dist/knowledge/index.js.map +0 -1
- package/dist/knowledge/manager.d.ts.map +0 -1
- package/dist/knowledge/manager.js.map +0 -1
- package/dist/knowledge/types.d.ts.map +0 -1
- package/dist/knowledge/types.js.map +0 -1
- package/dist/machines/forwarder.d.ts +0 -7
- package/dist/machines/forwarder.d.ts.map +0 -1
- package/dist/machines/forwarder.js +0 -35
- package/dist/machines/forwarder.js.map +0 -1
- package/dist/machines/index.d.ts.map +0 -1
- package/dist/machines/index.js.map +0 -1
- package/dist/machines/registry.d.ts.map +0 -1
- package/dist/machines/registry.js.map +0 -1
- package/dist/mcp/server.d.ts.map +0 -1
- package/dist/mcp/server.js.map +0 -1
- package/dist/media/factory.d.ts.map +0 -1
- package/dist/media/factory.js.map +0 -1
- package/dist/media/generators/dall-e.d.ts.map +0 -1
- package/dist/media/generators/dall-e.js.map +0 -1
- package/dist/media/generators/elevenlabs-music.d.ts.map +0 -1
- package/dist/media/generators/elevenlabs-music.js.map +0 -1
- package/dist/media/generators/elevenlabs-sfx.d.ts.map +0 -1
- package/dist/media/generators/elevenlabs-sfx.js.map +0 -1
- package/dist/media/generators/kling.d.ts.map +0 -1
- package/dist/media/generators/kling.js.map +0 -1
- package/dist/media/generators/lyria.d.ts.map +0 -1
- package/dist/media/generators/lyria.js.map +0 -1
- package/dist/media/generators/nano-banana.d.ts.map +0 -1
- package/dist/media/generators/nano-banana.js.map +0 -1
- package/dist/media/generators/recraft.d.ts.map +0 -1
- package/dist/media/generators/recraft.js.map +0 -1
- package/dist/media/generators/runway.d.ts.map +0 -1
- package/dist/media/generators/runway.js.map +0 -1
- package/dist/media/generators/stable-diffusion.d.ts.map +0 -1
- package/dist/media/generators/stable-diffusion.js.map +0 -1
- package/dist/media/generators/veo.d.ts.map +0 -1
- package/dist/media/generators/veo.js.map +0 -1
- package/dist/media/index.d.ts.map +0 -1
- package/dist/media/index.js.map +0 -1
- package/dist/media/loader.d.ts +0 -8
- package/dist/media/loader.d.ts.map +0 -1
- package/dist/media/loader.js +0 -46
- package/dist/media/loader.js.map +0 -1
- package/dist/media/store.d.ts.map +0 -1
- package/dist/media/store.js.map +0 -1
- package/dist/media/types.d.ts.map +0 -1
- package/dist/media/types.js.map +0 -1
- package/dist/memory/extractor.d.ts.map +0 -1
- package/dist/memory/extractor.js.map +0 -1
- package/dist/notifications/index.d.ts.map +0 -1
- package/dist/notifications/index.js.map +0 -1
- package/dist/notifications/ntfy.d.ts.map +0 -1
- package/dist/notifications/ntfy.js.map +0 -1
- package/dist/notifications/pushover.d.ts.map +0 -1
- package/dist/notifications/pushover.js.map +0 -1
- package/dist/notifications/types.d.ts.map +0 -1
- package/dist/notifications/types.js.map +0 -1
- package/dist/notifications/webhook-provider.d.ts.map +0 -1
- package/dist/notifications/webhook-provider.js.map +0 -1
- package/dist/observability/analytics.d.ts.map +0 -1
- package/dist/observability/analytics.js.map +0 -1
- package/dist/pipe/anthropic-client.d.ts.map +0 -1
- package/dist/pipe/anthropic-client.js.map +0 -1
- package/dist/pipe/brain.d.ts.map +0 -1
- package/dist/pipe/brain.js.map +0 -1
- package/dist/pipe/memory-store.d.ts.map +0 -1
- package/dist/pipe/memory-store.js.map +0 -1
- package/dist/pipe/project-scanner.d.ts.map +0 -1
- package/dist/pipe/project-scanner.js.map +0 -1
- package/dist/pipe/types.d.ts.map +0 -1
- package/dist/pipe/types.js.map +0 -1
- package/dist/projects/index.d.ts.map +0 -1
- package/dist/projects/index.js.map +0 -1
- package/dist/projects/manager.d.ts.map +0 -1
- package/dist/projects/manager.js.map +0 -1
- package/dist/projects/router.d.ts.map +0 -1
- package/dist/projects/router.js.map +0 -1
- package/dist/projects/types.d.ts.map +0 -1
- package/dist/projects/types.js.map +0 -1
- package/dist/service/install.d.ts.map +0 -1
- package/dist/service/install.js.map +0 -1
- package/dist/service/templates.d.ts.map +0 -1
- package/dist/service/templates.js.map +0 -1
- package/dist/service/windows.d.ts.map +0 -1
- package/dist/service/windows.js.map +0 -1
- package/dist/session/circuit-breaker.d.ts.map +0 -1
- package/dist/session/circuit-breaker.js.map +0 -1
- package/dist/session/context-monitor.d.ts.map +0 -1
- package/dist/session/context-monitor.js.map +0 -1
- package/dist/session/manager.d.ts.map +0 -1
- package/dist/session/manager.js.map +0 -1
- package/dist/session/subprocess.d.ts.map +0 -1
- package/dist/session/subprocess.js.map +0 -1
- package/dist/session/tool-classifier.d.ts.map +0 -1
- package/dist/session/tool-classifier.js.map +0 -1
- package/dist/tasks/scheduler.d.ts.map +0 -1
- package/dist/tasks/scheduler.js.map +0 -1
- package/dist/tasks/store.d.ts.map +0 -1
- package/dist/tasks/store.js.map +0 -1
- package/dist/timeline/index.d.ts.map +0 -1
- package/dist/timeline/index.js.map +0 -1
- package/dist/timeline/logger.d.ts.map +0 -1
- package/dist/timeline/logger.js.map +0 -1
- package/dist/timeline/query.d.ts.map +0 -1
- package/dist/timeline/query.js.map +0 -1
- package/dist/timeline/types.d.ts.map +0 -1
- package/dist/timeline/types.js.map +0 -1
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js.map +0 -1
- package/dist/users/index.d.ts.map +0 -1
- package/dist/users/index.js.map +0 -1
- package/dist/users/service.d.ts.map +0 -1
- package/dist/users/service.js.map +0 -1
- package/dist/util/logger.d.ts.map +0 -1
- package/dist/util/logger.js.map +0 -1
- package/dist/util/paths.d.ts.map +0 -1
- package/dist/util/paths.js.map +0 -1
- package/dist/util/platform.d.ts.map +0 -1
- package/dist/util/platform.js.map +0 -1
- package/dist/util/progress.d.ts.map +0 -1
- package/dist/util/progress.js.map +0 -1
- package/dist/util/rate-limiter.d.ts.map +0 -1
- package/dist/util/rate-limiter.js.map +0 -1
- package/dist/util/retry.d.ts.map +0 -1
- package/dist/util/retry.js.map +0 -1
- package/dist/util/text.d.ts.map +0 -1
- package/dist/util/text.js.map +0 -1
- package/dist/version.d.ts.map +0 -1
- package/dist/version.js.map +0 -1
- package/dist/voice/index.d.ts.map +0 -1
- package/dist/voice/index.js.map +0 -1
- package/dist/voice/stt.d.ts.map +0 -1
- package/dist/voice/stt.js.map +0 -1
- package/dist/voice/tts.d.ts.map +0 -1
- package/dist/voice/tts.js.map +0 -1
- package/dist/watchers/evaluator.d.ts.map +0 -1
- package/dist/watchers/evaluator.js.map +0 -1
- package/dist/watchers/index.d.ts.map +0 -1
- package/dist/watchers/index.js.map +0 -1
- package/dist/watchers/scheduler.d.ts.map +0 -1
- package/dist/watchers/scheduler.js.map +0 -1
- package/dist/watchers/store.d.ts.map +0 -1
- package/dist/watchers/store.js.map +0 -1
- package/dist/watchers/types.d.ts.map +0 -1
- package/dist/watchers/types.js.map +0 -1
package/dist/daemon.js
CHANGED
|
@@ -178,7 +178,7 @@ async function main() {
|
|
|
178
178
|
const anomaly = checkAnomalies();
|
|
179
179
|
if (anomaly)
|
|
180
180
|
broadcastNotify(anomaly);
|
|
181
|
-
}).catch(
|
|
181
|
+
}).catch(err => logger.debug('Anomaly check failed:', err));
|
|
182
182
|
}
|
|
183
183
|
}
|
|
184
184
|
catch (err) {
|
|
@@ -278,4 +278,3 @@ main().catch(err => {
|
|
|
278
278
|
closeDb();
|
|
279
279
|
process.exit(1);
|
|
280
280
|
});
|
|
281
|
-
//# sourceMappingURL=daemon.js.map
|
package/dist/dashboard/html.d.ts
CHANGED
package/dist/dashboard/html.js
CHANGED
|
@@ -5,20 +5,10 @@ export function getDashboardHtml(token) {
|
|
|
5
5
|
<meta charset="UTF-8">
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
7
7
|
<title>Beecork Dashboard</title>
|
|
8
|
-
<script src="https://cdn.tailwindcss.com"></script>
|
|
9
|
-
<script>
|
|
10
|
-
tailwind.config = {
|
|
11
|
-
theme: {
|
|
12
|
-
extend: {
|
|
13
|
-
colors: {
|
|
14
|
-
honey: { 50: '#fefce8', 100: '#fef9c3', 200: '#fef08a', 300: '#fde047', 400: '#facc15', 500: '#eab308', 600: '#ca8a04', 700: '#a16207' },
|
|
15
|
-
bee: { 900: '#111111', 850: '#181818', 800: '#1e1e1e', 750: '#252525', 700: '#2e2e2e', 600: '#3a3a3a', 500: '#555555' }
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
</script>
|
|
21
8
|
<style>
|
|
9
|
+
/* Compiled Tailwind CSS (v4.2.2) — generated via: npx tailwindcss --content src/dashboard/html.ts --minify */
|
|
10
|
+
/*! tailwindcss v4.2.2 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-red-200:oklch(88.5% .062 18.334);--color-red-400:oklch(70.4% .191 22.216);--color-red-900:oklch(39.6% .141 25.723);--color-green-200:oklch(92.5% .084 155.995);--color-green-400:oklch(79.2% .209 151.711);--color-green-900:oklch(39.3% .095 152.535);--color-blue-400:oklch(70.7% .165 254.624);--color-blue-900:oklch(37.9% .146 265.522);--color-purple-400:oklch(71.4% .203 305.504);--color-purple-900:oklch(38.1% .176 304.987);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-300:oklch(87.2% .01 258.338);--color-gray-400:oklch(70.7% .022 261.325);--color-gray-500:oklch(55.1% .027 264.364);--color-gray-600:oklch(44.6% .03 256.802);--color-gray-700:oklch(37.3% .034 259.733);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-lg:32rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height:calc(1.5 / 1);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--font-weight-medium:500;--font-weight-semibold:600;--tracking-wider:.05em;--leading-relaxed:1.625;--radius-lg:.5rem;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--color-honey-400:#facc15;--color-honey-500:#eab308;--color-honey-600:#ca8a04;--color-bee-900:#111;--color-bee-850:#181818;--color-bee-800:#1e1e1e;--color-bee-750:#252525;--color-bee-700:#2e2e2e}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.start{inset-inline-start:var(--spacing)}.end{inset-inline-end:var(--spacing)}.right-4{right:calc(var(--spacing) * 4)}.bottom-4{bottom:calc(var(--spacing) * 4)}.z-50{z-index:50}.container{width:100%}@media (min-width:40rem){.container{max-width:40rem}}@media (min-width:48rem){.container{max-width:48rem}}@media (min-width:64rem){.container{max-width:64rem}}@media (min-width:80rem){.container{max-width:80rem}}@media (min-width:96rem){.container{max-width:96rem}}.mt-0\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:calc(var(--spacing) * 1)}.mt-5{margin-top:calc(var(--spacing) * 5)}.mb-1{margin-bottom:calc(var(--spacing) * 1)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.ml-2{margin-left:calc(var(--spacing) * 2)}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.table{display:table}.h-20{height:calc(var(--spacing) * 20)}.h-24{height:calc(var(--spacing) * 24)}.h-48{height:calc(var(--spacing) * 48)}.h-\[var\(--header-height\)\]{height:var(--header-height)}.h-full{height:100%}.max-h-48{max-height:calc(var(--spacing) * 48)}.max-h-\[calc\(100vh-240px\)\]{max-height:calc(100vh - 240px)}.w-full{width:100%}.max-w-lg{max-width:var(--container-lg)}.min-w-0{min-width:calc(var(--spacing) * 0)}.flex-1{flex:1}.shrink-0{flex-shrink:0}.grow{flex-grow:1}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.cursor-pointer{cursor:pointer}.resize-none{resize:none}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.flex-col{flex-direction:column}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-end{justify-content:flex-end}.gap-1{gap:calc(var(--spacing) * 1)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-lg{border-radius:var(--radius-lg)}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-b-2{border-bottom-style:var(--tw-border-style);border-bottom-width:2px}.border-bee-700{border-color:var(--color-bee-700)}.border-honey-500{border-color:var(--color-honey-500)}.border-transparent{border-color:#0000}.bg-bee-800{background-color:var(--color-bee-800)}.bg-bee-850{background-color:var(--color-bee-850)}.bg-bee-900{background-color:var(--color-bee-900)}.bg-blue-900\/50{background-color:#1c398e80}@supports (color:color-mix(in lab, red, red)){.bg-blue-900\/50{background-color:color-mix(in oklab, var(--color-blue-900) 50%, transparent)}}.bg-green-900\/90{background-color:#0d542be6}@supports (color:color-mix(in lab, red, red)){.bg-green-900\/90{background-color:color-mix(in oklab, var(--color-green-900) 90%, transparent)}}.bg-honey-600{background-color:var(--color-honey-600)}.bg-purple-900\/50{background-color:#59168b80}@supports (color:color-mix(in lab, red, red)){.bg-purple-900\/50{background-color:color-mix(in oklab, var(--color-purple-900) 50%, transparent)}}.bg-red-900\/90{background-color:#82181ae6}@supports (color:color-mix(in lab, red, red)){.bg-red-900\/90{background-color:color-mix(in oklab, var(--color-red-900) 90%, transparent)}}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-6{padding:calc(var(--spacing) * 6)}.px-1\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:calc(var(--spacing) * 1)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-8{padding-block:calc(var(--spacing) * 8)}.py-16{padding-block:calc(var(--spacing) * 16)}.pl-5{padding-left:calc(var(--spacing) * 5)}.text-center{text-align:center}.font-mono{font-family:var(--font-mono)}.font-sans{font-family:var(--font-sans)}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.break-words{overflow-wrap:break-word}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.text-black{color:var(--color-black)}.text-blue-400{color:var(--color-blue-400)}.text-gray-200{color:var(--color-gray-200)}.text-gray-300{color:var(--color-gray-300)}.text-gray-400{color:var(--color-gray-400)}.text-gray-500{color:var(--color-gray-500)}.text-gray-600{color:var(--color-gray-600)}.text-gray-700{color:var(--color-gray-700)}.text-green-200{color:var(--color-green-200)}.text-green-400{color:var(--color-green-400)}.text-honey-400{color:var(--color-honey-400)}.text-purple-400{color:var(--color-purple-400)}.text-red-200{color:var(--color-red-200)}.text-red-400{color:var(--color-red-400)}.text-white{color:var(--color-white)}.uppercase{text-transform:uppercase}.opacity-0{opacity:0}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}@media (hover:hover){.group-hover\:opacity-100:is(:where(.group):hover *){opacity:1}.hover\:bg-bee-750:hover{background-color:var(--color-bee-750)}.hover\:bg-honey-500:hover{background-color:var(--color-honey-500)}.hover\:text-white:hover{color:var(--color-white)}}@media (min-width:40rem){.sm\:block{display:block}.sm\:w-48{width:calc(var(--spacing) * 48)}.sm\:w-auto{width:auto}.sm\:flex-row{flex-direction:row}.sm\:items-center{align-items:center}}}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}
|
|
11
|
+
|
|
22
12
|
:root {
|
|
23
13
|
--sidebar-width: 280px;
|
|
24
14
|
--header-height: 52px;
|
|
@@ -213,12 +203,30 @@ export function getDashboardHtml(token) {
|
|
|
213
203
|
let memorySearchTimer = null;
|
|
214
204
|
let tabsData = [];
|
|
215
205
|
|
|
206
|
+
// Toast notifications
|
|
207
|
+
function showToast(msg, isError) {
|
|
208
|
+
const toast = document.createElement('div');
|
|
209
|
+
toast.className = 'fixed bottom-4 right-4 px-4 py-2 rounded-lg text-sm z-50 ' + (isError ? 'bg-red-900/90 text-red-200' : 'bg-green-900/90 text-green-200');
|
|
210
|
+
toast.textContent = msg;
|
|
211
|
+
document.body.appendChild(toast);
|
|
212
|
+
setTimeout(() => toast.remove(), 4000);
|
|
213
|
+
}
|
|
214
|
+
|
|
216
215
|
// API helpers
|
|
217
216
|
async function api(path, opts) {
|
|
218
217
|
const headers = { 'Authorization': 'Bearer ' + API_TOKEN };
|
|
219
218
|
if (opts && opts.body) headers['Content-Type'] = 'application/json';
|
|
220
|
-
|
|
221
|
-
|
|
219
|
+
try {
|
|
220
|
+
const res = await fetch(path, { headers, ...opts });
|
|
221
|
+
if (!res.ok) {
|
|
222
|
+
const err = await res.json().catch(() => ({ error: res.statusText }));
|
|
223
|
+
throw new Error(err.error || 'Request failed');
|
|
224
|
+
}
|
|
225
|
+
return res.json();
|
|
226
|
+
} catch (err) {
|
|
227
|
+
showToast('API error: ' + err.message, true);
|
|
228
|
+
throw err;
|
|
229
|
+
}
|
|
222
230
|
}
|
|
223
231
|
|
|
224
232
|
function timeAgo(iso) {
|
|
@@ -234,12 +242,12 @@ export function getDashboardHtml(token) {
|
|
|
234
242
|
|
|
235
243
|
function esc(s) {
|
|
236
244
|
if (!s) return '';
|
|
237
|
-
return String(s).replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>').replace(/"/g,'"');
|
|
245
|
+
return String(s).replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>').replace(/"/g,'"').replace(/'/g,''');
|
|
238
246
|
}
|
|
239
247
|
|
|
240
248
|
// --- SSE ---
|
|
241
249
|
function connectSSE() {
|
|
242
|
-
const es = new EventSource('/api/events
|
|
250
|
+
const es = new EventSource('/api/events');
|
|
243
251
|
es.onopen = () => {
|
|
244
252
|
document.getElementById('sse-dot').className = 'sse-indicator sse-connected';
|
|
245
253
|
document.getElementById('sse-label').textContent = 'live';
|
|
@@ -313,7 +321,7 @@ export function getDashboardHtml(token) {
|
|
|
313
321
|
|
|
314
322
|
// --- Tabs ---
|
|
315
323
|
async function loadTabs() {
|
|
316
|
-
tabsData = await api('/api/tabs');
|
|
324
|
+
try { tabsData = await api('/api/tabs'); } catch { return; }
|
|
317
325
|
const list = document.getElementById('tab-list');
|
|
318
326
|
document.getElementById('tab-count').textContent = tabsData.length.toString();
|
|
319
327
|
|
|
@@ -325,13 +333,13 @@ export function getDashboardHtml(token) {
|
|
|
325
333
|
list.innerHTML = tabsData.map(t => {
|
|
326
334
|
const isActive = selectedTab === t.name ? ' active' : '';
|
|
327
335
|
const cost = t.total_cost > 0 ? '$' + t.total_cost.toFixed(4) : '';
|
|
328
|
-
return '<div class="tab-item px-3 py-2.5 cursor-pointer' + isActive + '" data-tab-name="' + esc(t.name) + '" onclick="selectTab(\\'' + esc(t.name).replace(/'/g, "\\\\'") + '\\')">' +
|
|
336
|
+
return '<div class="tab-item px-3 py-2.5 cursor-pointer' + isActive + '" data-tab-name="' + esc(t.name) + '" role="button" tabindex="0" onclick="selectTab(\\'' + esc(t.name).replace(/'/g, "\\\\'") + '\\')" onkeydown="if(event.key===\\'Enter\\')selectTab(\\'' + esc(t.name).replace(/'/g, "\\\\'") + '\\')">' +
|
|
329
337
|
'<div class="flex items-center justify-between">' +
|
|
330
338
|
'<div class="flex items-center gap-2 min-w-0">' +
|
|
331
|
-
'<span class="status-dot tab-status-dot status-' + t.status + '"></span>' +
|
|
339
|
+
'<span class="status-dot tab-status-dot status-' + esc(t.status) + '"></span>' +
|
|
332
340
|
'<span class="text-sm font-medium text-gray-200 truncate">' + esc(t.name) + '</span>' +
|
|
333
341
|
'</div>' +
|
|
334
|
-
'<span class="text-xs tab-status-label text-gray-500 shrink-0">' + t.status + '</span>' +
|
|
342
|
+
'<span class="text-xs tab-status-label text-gray-500 shrink-0">' + esc(t.status) + '</span>' +
|
|
335
343
|
'</div>' +
|
|
336
344
|
'<div class="flex items-center justify-between mt-0.5 pl-5">' +
|
|
337
345
|
'<span class="text-xs text-gray-600">' + t.message_count + ' msgs' + (cost ? ' · ' + cost : '') + '</span>' +
|
|
@@ -357,7 +365,7 @@ export function getDashboardHtml(token) {
|
|
|
357
365
|
document.getElementById('msg-tab-status').textContent = tab.status;
|
|
358
366
|
}
|
|
359
367
|
|
|
360
|
-
|
|
368
|
+
let data; try { data = await api('/api/tabs/' + encodeURIComponent(name) + '/messages?limit=100'); } catch { return; }
|
|
361
369
|
const list = document.getElementById('msg-list');
|
|
362
370
|
document.getElementById('msg-count').textContent = data.total + ' messages';
|
|
363
371
|
|
|
@@ -425,7 +433,7 @@ export function getDashboardHtml(token) {
|
|
|
425
433
|
async function deleteSelectedTab() {
|
|
426
434
|
if (!selectedTab) return;
|
|
427
435
|
if (!confirm('Delete tab "' + selectedTab + '" and all its messages?')) return;
|
|
428
|
-
await api('/api/tabs/' + encodeURIComponent(selectedTab), { method: 'DELETE' });
|
|
436
|
+
try { await api('/api/tabs/' + encodeURIComponent(selectedTab), { method: 'DELETE' }); } catch { return; }
|
|
429
437
|
selectedTab = null;
|
|
430
438
|
document.getElementById('msg-title').textContent = 'Select a tab';
|
|
431
439
|
document.getElementById('msg-tab-status').textContent = '';
|
|
@@ -464,7 +472,7 @@ export function getDashboardHtml(token) {
|
|
|
464
472
|
if (!name) return;
|
|
465
473
|
const workingDir = document.getElementById('modal-tab-dir').value.trim() || undefined;
|
|
466
474
|
const systemPrompt = document.getElementById('modal-tab-prompt').value.trim() || undefined;
|
|
467
|
-
await api('/api/tabs', { method: 'POST', body: JSON.stringify({ name, workingDir, systemPrompt }) });
|
|
475
|
+
try { await api('/api/tabs', { method: 'POST', body: JSON.stringify({ name, workingDir, systemPrompt }) }); } catch { return; }
|
|
468
476
|
closeModal();
|
|
469
477
|
loadTabs();
|
|
470
478
|
}
|
|
@@ -472,7 +480,7 @@ export function getDashboardHtml(token) {
|
|
|
472
480
|
// --- Memories ---
|
|
473
481
|
async function loadMemories(query) {
|
|
474
482
|
const q = query || document.getElementById('memory-search').value || '';
|
|
475
|
-
|
|
483
|
+
let data; try { data = await api('/api/memories?limit=100&q=' + encodeURIComponent(q)); } catch { return; }
|
|
476
484
|
const list = document.getElementById('memory-list');
|
|
477
485
|
document.getElementById('memory-count').textContent = data.total + ' total';
|
|
478
486
|
|
|
@@ -482,7 +490,7 @@ export function getDashboardHtml(token) {
|
|
|
482
490
|
}
|
|
483
491
|
|
|
484
492
|
list.innerHTML = data.memories.map(m => {
|
|
485
|
-
const scope = m.tab_name ? 'tab:' + m.tab_name : 'global';
|
|
493
|
+
const scope = m.tab_name ? 'tab:' + esc(m.tab_name) : 'global';
|
|
486
494
|
return '<div class="px-4 py-3 border-b border-bee-700 group hover:bg-bee-750">' +
|
|
487
495
|
'<div class="flex items-center justify-between mb-1">' +
|
|
488
496
|
'<div class="flex items-center gap-2">' +
|
|
@@ -491,7 +499,7 @@ export function getDashboardHtml(token) {
|
|
|
491
499
|
'</div>' +
|
|
492
500
|
'<div class="flex items-center gap-2">' +
|
|
493
501
|
'<span class="text-xs text-gray-700">' + timeAgo(m.created_at) + '</span>' +
|
|
494
|
-
'<button class="btn-danger px-1.5 py-0.5 text-xs opacity-0 group-hover:opacity-100" onclick="deleteMemory(' + m.id + ')">x</button>' +
|
|
502
|
+
'<button class="btn-danger px-1.5 py-0.5 text-xs opacity-0 group-hover:opacity-100" aria-label="Delete memory" onclick="deleteMemory(' + m.id + ')">x</button>' +
|
|
495
503
|
'</div>' +
|
|
496
504
|
'</div>' +
|
|
497
505
|
'<p class="text-sm text-gray-300 leading-relaxed">' + esc(m.content) + '</p>' +
|
|
@@ -505,7 +513,7 @@ export function getDashboardHtml(token) {
|
|
|
505
513
|
}
|
|
506
514
|
|
|
507
515
|
async function deleteMemory(id) {
|
|
508
|
-
await api('/api/memories/' + id, { method: 'DELETE' });
|
|
516
|
+
try { await api('/api/memories/' + id, { method: 'DELETE' }); } catch { return; }
|
|
509
517
|
loadMemories();
|
|
510
518
|
}
|
|
511
519
|
|
|
@@ -533,14 +541,14 @@ export function getDashboardHtml(token) {
|
|
|
533
541
|
const content = document.getElementById('modal-mem-content').value.trim();
|
|
534
542
|
if (!content) return;
|
|
535
543
|
const tabName = document.getElementById('modal-mem-tab').value.trim() || undefined;
|
|
536
|
-
await api('/api/memories', { method: 'POST', body: JSON.stringify({ content, tabName }) });
|
|
544
|
+
try { await api('/api/memories', { method: 'POST', body: JSON.stringify({ content, tabName }) }); } catch { return; }
|
|
537
545
|
closeModal();
|
|
538
546
|
loadMemories();
|
|
539
547
|
}
|
|
540
548
|
|
|
541
549
|
// --- Tasks (formerly Crons) ---
|
|
542
550
|
async function loadCrons() {
|
|
543
|
-
|
|
551
|
+
let crons; try { crons = await api('/api/tasks'); } catch { return; }
|
|
544
552
|
const list = document.getElementById('cron-list');
|
|
545
553
|
|
|
546
554
|
if (crons.length === 0) {
|
|
@@ -558,7 +566,7 @@ export function getDashboardHtml(token) {
|
|
|
558
566
|
'</div>' +
|
|
559
567
|
'<div class="flex items-center gap-2">' +
|
|
560
568
|
'<span class="text-xs font-mono text-gray-400">' + c.schedule_type + ': ' + esc(c.schedule) + '</span>' +
|
|
561
|
-
'<button class="btn-danger px-1.5 py-0.5 text-xs opacity-0 group-hover:opacity-100" onclick="deleteCron(\\'' + esc(c.id) + '\\')">x</button>' +
|
|
569
|
+
'<button class="btn-danger px-1.5 py-0.5 text-xs opacity-0 group-hover:opacity-100" aria-label="Delete task" onclick="deleteCron(\\'' + esc(c.id) + '\\')">x</button>' +
|
|
562
570
|
'</div>' +
|
|
563
571
|
'</div>' +
|
|
564
572
|
'<div class="flex items-center justify-between mt-1 pl-5">' +
|
|
@@ -571,7 +579,7 @@ export function getDashboardHtml(token) {
|
|
|
571
579
|
|
|
572
580
|
async function deleteCron(id) {
|
|
573
581
|
if (!confirm('Delete this task?')) return;
|
|
574
|
-
await api('/api/tasks/' + encodeURIComponent(id), { method: 'DELETE' });
|
|
582
|
+
try { await api('/api/tasks/' + encodeURIComponent(id), { method: 'DELETE' }); } catch { return; }
|
|
575
583
|
loadCrons();
|
|
576
584
|
}
|
|
577
585
|
|
|
@@ -610,14 +618,14 @@ export function getDashboardHtml(token) {
|
|
|
610
618
|
const tabName = document.getElementById('modal-cron-tab').value.trim() || 'default';
|
|
611
619
|
const message = document.getElementById('modal-cron-msg').value.trim();
|
|
612
620
|
if (!name || !schedule || !message) return;
|
|
613
|
-
await api('/api/tasks', { method: 'POST', body: JSON.stringify({ name, scheduleType, schedule, tabName, message }) });
|
|
621
|
+
try { await api('/api/tasks', { method: 'POST', body: JSON.stringify({ name, scheduleType, schedule, tabName, message }) }); } catch { return; }
|
|
614
622
|
closeModal();
|
|
615
623
|
loadCrons();
|
|
616
624
|
}
|
|
617
625
|
|
|
618
626
|
// --- Watchers ---
|
|
619
627
|
async function loadWatchers() {
|
|
620
|
-
|
|
628
|
+
let watchers; try { watchers = await api('/api/watchers'); } catch { return; }
|
|
621
629
|
const list = document.getElementById('watcher-list');
|
|
622
630
|
|
|
623
631
|
if (watchers.length === 0) {
|
|
@@ -636,7 +644,7 @@ export function getDashboardHtml(token) {
|
|
|
636
644
|
'<div class="flex items-center gap-2">' +
|
|
637
645
|
'<span class="text-xs font-mono text-gray-400">' + esc(w.schedule) + '</span>' +
|
|
638
646
|
'<span class="text-xs text-gray-500">action: ' + esc(w.action) + '</span>' +
|
|
639
|
-
'<button class="btn-danger px-1.5 py-0.5 text-xs opacity-0 group-hover:opacity-100" onclick="deleteWatcher(\\'' + esc(w.id) + '\\')">x</button>' +
|
|
647
|
+
'<button class="btn-danger px-1.5 py-0.5 text-xs opacity-0 group-hover:opacity-100" aria-label="Delete watcher" onclick="deleteWatcher(\\'' + esc(w.id) + '\\')">x</button>' +
|
|
640
648
|
'</div>' +
|
|
641
649
|
'</div>' +
|
|
642
650
|
'<div class="flex items-center justify-between mt-1 pl-5">' +
|
|
@@ -649,13 +657,13 @@ export function getDashboardHtml(token) {
|
|
|
649
657
|
|
|
650
658
|
async function deleteWatcher(id) {
|
|
651
659
|
if (!confirm('Delete this watcher?')) return;
|
|
652
|
-
await api('/api/watchers/' + encodeURIComponent(id), { method: 'DELETE' });
|
|
660
|
+
try { await api('/api/watchers/' + encodeURIComponent(id), { method: 'DELETE' }); } catch { return; }
|
|
653
661
|
loadWatchers();
|
|
654
662
|
}
|
|
655
663
|
|
|
656
664
|
// --- Costs ---
|
|
657
665
|
async function loadCosts() {
|
|
658
|
-
|
|
666
|
+
let costs; try { costs = await api('/api/costs'); } catch { return; }
|
|
659
667
|
const chart = document.getElementById('cost-chart');
|
|
660
668
|
|
|
661
669
|
if (costs.length === 0) {
|
|
@@ -759,4 +767,3 @@ export function getDashboardHtml(token) {
|
|
|
759
767
|
</body>
|
|
760
768
|
</html>`;
|
|
761
769
|
}
|
|
762
|
-
//# sourceMappingURL=html.js.map
|
package/dist/dashboard/server.js
CHANGED
|
@@ -9,6 +9,7 @@ import { getDashboardHtml } from './html.js';
|
|
|
9
9
|
import { VERSION } from '../version.js';
|
|
10
10
|
import { getDaemonPid } from '../cli/helpers.js';
|
|
11
11
|
import { validateTabName } from '../config.js';
|
|
12
|
+
import { createTabRecord } from '../db/index.js';
|
|
12
13
|
let cachedDashDb = null;
|
|
13
14
|
function getDashDb() {
|
|
14
15
|
if (!cachedDashDb) {
|
|
@@ -17,22 +18,32 @@ function getDashDb() {
|
|
|
17
18
|
}
|
|
18
19
|
return cachedDashDb;
|
|
19
20
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
finally {
|
|
26
|
-
db.close();
|
|
21
|
+
let cachedWriteDb = null;
|
|
22
|
+
function getWriteDb() {
|
|
23
|
+
if (!cachedWriteDb) {
|
|
24
|
+
cachedWriteDb = new Database(getDbPath());
|
|
25
|
+
cachedWriteDb.pragma('journal_mode = WAL');
|
|
27
26
|
}
|
|
27
|
+
return cachedWriteDb;
|
|
28
|
+
}
|
|
29
|
+
function withWriteDb(fn) {
|
|
30
|
+
return fn(getWriteDb());
|
|
28
31
|
}
|
|
29
32
|
function json(res, data, status = 200) {
|
|
30
33
|
res.writeHead(status, { 'Content-Type': 'application/json' });
|
|
31
34
|
res.end(JSON.stringify(data));
|
|
32
35
|
}
|
|
33
36
|
function openBrowser(url) {
|
|
34
|
-
const
|
|
35
|
-
|
|
37
|
+
const p = platform();
|
|
38
|
+
if (p === 'darwin') {
|
|
39
|
+
execFile('open', [url]);
|
|
40
|
+
}
|
|
41
|
+
else if (p === 'win32') {
|
|
42
|
+
execFile('cmd', ['/c', 'start', url]);
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
execFile('xdg-open', [url]);
|
|
46
|
+
}
|
|
36
47
|
}
|
|
37
48
|
export function startDashboardServer(port = 0) {
|
|
38
49
|
// Generate auth token at server start
|
|
@@ -54,7 +65,11 @@ export function startDashboardServer(port = 0) {
|
|
|
54
65
|
res.end('Forbidden');
|
|
55
66
|
return;
|
|
56
67
|
}
|
|
57
|
-
res.writeHead(200, {
|
|
68
|
+
res.writeHead(200, {
|
|
69
|
+
'Content-Type': 'text/html',
|
|
70
|
+
'Referrer-Policy': 'no-referrer',
|
|
71
|
+
'Set-Cookie': `beecork_dash=${authToken}; HttpOnly; SameSite=Strict; Path=/`,
|
|
72
|
+
});
|
|
58
73
|
res.end(getDashboardHtml(authToken));
|
|
59
74
|
return;
|
|
60
75
|
}
|
|
@@ -62,7 +77,8 @@ export function startDashboardServer(port = 0) {
|
|
|
62
77
|
if (path.startsWith('/api/')) {
|
|
63
78
|
const authHeader = req.headers.authorization;
|
|
64
79
|
const queryToken = url.searchParams.get('token');
|
|
65
|
-
const
|
|
80
|
+
const cookieToken = req.headers.cookie?.split(';').map(c => c.trim()).find(c => c.startsWith('beecork_dash='))?.split('=')[1];
|
|
81
|
+
const providedToken = authHeader?.replace('Bearer ', '') || queryToken || cookieToken;
|
|
66
82
|
if (providedToken !== authToken) {
|
|
67
83
|
json(res, { error: 'Unauthorized' }, 401);
|
|
68
84
|
return;
|
|
@@ -116,8 +132,9 @@ export function startDashboardServer(port = 0) {
|
|
|
116
132
|
return;
|
|
117
133
|
}
|
|
118
134
|
const tabName = decodeURIComponent(path.split('/')[3]);
|
|
119
|
-
|
|
120
|
-
|
|
135
|
+
const tabErr = validateTabName(tabName);
|
|
136
|
+
if (tabErr) {
|
|
137
|
+
json(res, { error: tabErr }, 400);
|
|
121
138
|
return;
|
|
122
139
|
}
|
|
123
140
|
withWriteDb(db => db.prepare('INSERT INTO pending_messages (tab_name, message, type) VALUES (?, ?, ?)').run(tabName, message, 'user'));
|
|
@@ -147,12 +164,12 @@ export function startDashboardServer(port = 0) {
|
|
|
147
164
|
json(res, { error: 'Missing tab name' }, 400);
|
|
148
165
|
return;
|
|
149
166
|
}
|
|
150
|
-
|
|
151
|
-
|
|
167
|
+
const nameErr = validateTabName(name);
|
|
168
|
+
if (nameErr) {
|
|
169
|
+
json(res, { error: nameErr }, 400);
|
|
152
170
|
return;
|
|
153
171
|
}
|
|
154
|
-
|
|
155
|
-
withWriteDb(db => db.prepare('INSERT OR IGNORE INTO tabs (id, name, session_id, status, working_dir, system_prompt) VALUES (?, ?, ?, ?, ?, ?)').run(id, name, crypto.randomUUID(), 'idle', workingDir || process.env.HOME || '/', systemPrompt || null));
|
|
172
|
+
withWriteDb(db => createTabRecord(db, { name, workingDir, systemPrompt }));
|
|
156
173
|
json(res, { success: true, name });
|
|
157
174
|
return;
|
|
158
175
|
}
|
|
@@ -193,8 +210,9 @@ export function startDashboardServer(port = 0) {
|
|
|
193
210
|
return;
|
|
194
211
|
}
|
|
195
212
|
const effectiveTab = tabName || 'default';
|
|
196
|
-
|
|
197
|
-
|
|
213
|
+
const cronTabErr = validateTabName(effectiveTab);
|
|
214
|
+
if (cronTabErr) {
|
|
215
|
+
json(res, { error: cronTabErr }, 400);
|
|
198
216
|
return;
|
|
199
217
|
}
|
|
200
218
|
const id = crypto.randomUUID();
|
|
@@ -282,8 +300,13 @@ export function startDashboardServer(port = 0) {
|
|
|
282
300
|
}
|
|
283
301
|
if (path === '/api/computer-use' && req.method === 'POST') {
|
|
284
302
|
let body = '';
|
|
285
|
-
for await (const chunk of req)
|
|
303
|
+
for await (const chunk of req) {
|
|
286
304
|
body += chunk;
|
|
305
|
+
if (body.length > 1_000_000) {
|
|
306
|
+
json(res, { error: 'Payload too large' }, 413);
|
|
307
|
+
return;
|
|
308
|
+
}
|
|
309
|
+
}
|
|
287
310
|
let parsedCU;
|
|
288
311
|
try {
|
|
289
312
|
parsedCU = JSON.parse(body);
|
|
@@ -454,7 +477,7 @@ export function startDashboardServer(port = 0) {
|
|
|
454
477
|
json(res, { success: true, package: pkgName, output: stdout.trim() });
|
|
455
478
|
}
|
|
456
479
|
catch (err) {
|
|
457
|
-
json(res, { error: err.message }, 500);
|
|
480
|
+
json(res, { error: err instanceof Error ? err.message : String(err) }, 500);
|
|
458
481
|
}
|
|
459
482
|
return;
|
|
460
483
|
}
|
|
@@ -474,16 +497,29 @@ export function startDashboardServer(port = 0) {
|
|
|
474
497
|
if (path.match(/^\/api\/capabilities\/[^/]+\/enable$/) && req.method === 'POST') {
|
|
475
498
|
const packId = path.split('/')[3];
|
|
476
499
|
let body = '';
|
|
477
|
-
for await (const chunk of req)
|
|
500
|
+
for await (const chunk of req) {
|
|
478
501
|
body += chunk;
|
|
479
|
-
|
|
502
|
+
if (body.length > 1_000_000) {
|
|
503
|
+
json(res, { error: 'Payload too large' }, 413);
|
|
504
|
+
return;
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
let parsedCap;
|
|
508
|
+
try {
|
|
509
|
+
parsedCap = JSON.parse(body);
|
|
510
|
+
}
|
|
511
|
+
catch {
|
|
512
|
+
json(res, { error: 'Invalid JSON' }, 400);
|
|
513
|
+
return;
|
|
514
|
+
}
|
|
515
|
+
const { apiKey } = parsedCap;
|
|
480
516
|
const { enablePack } = await import('../capabilities/index.js');
|
|
481
517
|
try {
|
|
482
518
|
enablePack(packId, apiKey);
|
|
483
519
|
json(res, { success: true, message: 'Restart daemon to activate.' });
|
|
484
520
|
}
|
|
485
521
|
catch (err) {
|
|
486
|
-
json(res, { error: err.message }, 400);
|
|
522
|
+
json(res, { error: err instanceof Error ? err.message : String(err) }, 400);
|
|
487
523
|
}
|
|
488
524
|
return;
|
|
489
525
|
}
|
|
@@ -517,4 +553,3 @@ export function startDashboardServer(port = 0) {
|
|
|
517
553
|
process.exit(0);
|
|
518
554
|
});
|
|
519
555
|
}
|
|
520
|
-
//# sourceMappingURL=server.js.map
|
package/dist/db/index.d.ts
CHANGED
|
@@ -1,4 +1,14 @@
|
|
|
1
1
|
import Database from 'better-sqlite3';
|
|
2
2
|
export declare function getDb(): Database.Database;
|
|
3
|
+
export interface CreateTabOptions {
|
|
4
|
+
name: string;
|
|
5
|
+
workingDir?: string;
|
|
6
|
+
systemPrompt?: string | null;
|
|
7
|
+
}
|
|
8
|
+
/** Shared tab record creation — used by dashboard, MCP, and TabManager */
|
|
9
|
+
export declare function createTabRecord(db: Database.Database, opts: CreateTabOptions): {
|
|
10
|
+
id: string;
|
|
11
|
+
name: string;
|
|
12
|
+
created: boolean;
|
|
13
|
+
};
|
|
3
14
|
export declare function closeDb(): void;
|
|
4
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/db/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import crypto from 'node:crypto';
|
|
1
2
|
import Database from 'better-sqlite3';
|
|
2
3
|
import { getDbPath, ensureBeecorkDirs } from '../util/paths.js';
|
|
3
4
|
import { runMigrations } from './migrations.js';
|
|
@@ -65,6 +66,7 @@ export function getDb() {
|
|
|
65
66
|
// Prune old routing/permission history (keep last 1000 entries)
|
|
66
67
|
db?.exec('DELETE FROM routing_history WHERE created_at < (SELECT created_at FROM routing_history ORDER BY created_at DESC LIMIT 1 OFFSET 999)');
|
|
67
68
|
db?.exec('DELETE FROM permission_history WHERE created_at < (SELECT created_at FROM permission_history ORDER BY created_at DESC LIMIT 1 OFFSET 999)');
|
|
69
|
+
db?.exec("DELETE FROM activity_log WHERE created_at < datetime('now', '-90 days')");
|
|
68
70
|
}
|
|
69
71
|
catch (err) {
|
|
70
72
|
logger.warn('WAL checkpoint/cleanup error:', err);
|
|
@@ -72,6 +74,16 @@ export function getDb() {
|
|
|
72
74
|
}, 30 * 60 * 1000); // every 30 minutes
|
|
73
75
|
return db;
|
|
74
76
|
}
|
|
77
|
+
/** Shared tab record creation — used by dashboard, MCP, and TabManager */
|
|
78
|
+
export function createTabRecord(db, opts) {
|
|
79
|
+
const existing = db.prepare('SELECT name FROM tabs WHERE name = ?').get(opts.name);
|
|
80
|
+
if (existing)
|
|
81
|
+
return { id: '', name: opts.name, created: false };
|
|
82
|
+
const id = crypto.randomUUID();
|
|
83
|
+
const dir = opts.workingDir || process.env.HOME || '/';
|
|
84
|
+
db.prepare('INSERT INTO tabs (id, name, session_id, status, working_dir, system_prompt) VALUES (?, ?, ?, ?, ?, ?)').run(id, opts.name, crypto.randomUUID(), 'idle', dir, opts.systemPrompt || null);
|
|
85
|
+
return { id, name: opts.name, created: true };
|
|
86
|
+
}
|
|
75
87
|
export function closeDb() {
|
|
76
88
|
if (walInterval) {
|
|
77
89
|
clearInterval(walInterval);
|
|
@@ -82,4 +94,3 @@ export function closeDb() {
|
|
|
82
94
|
db = null;
|
|
83
95
|
}
|
|
84
96
|
}
|
|
85
|
-
//# sourceMappingURL=index.js.map
|
package/dist/db/migrations.d.ts
CHANGED
package/dist/db/migrations.js
CHANGED
|
@@ -234,6 +234,11 @@ const MIGRATIONS = [
|
|
|
234
234
|
created_at TEXT DEFAULT (datetime('now'))
|
|
235
235
|
)`,
|
|
236
236
|
},
|
|
237
|
+
{
|
|
238
|
+
version: 21,
|
|
239
|
+
description: 'Add index on activity_log.created_at',
|
|
240
|
+
up: 'CREATE INDEX IF NOT EXISTS idx_activity_log_created ON activity_log(created_at)',
|
|
241
|
+
},
|
|
237
242
|
];
|
|
238
243
|
export function runMigrations(db) {
|
|
239
244
|
// Ensure schema_version table exists
|
|
@@ -286,4 +291,3 @@ export function runMigrations(db) {
|
|
|
286
291
|
db.prepare('UPDATE schema_version SET version = ?').run(migration.version);
|
|
287
292
|
}
|
|
288
293
|
}
|
|
289
|
-
//# sourceMappingURL=migrations.js.map
|
|
@@ -12,10 +12,7 @@ export interface Delegation {
|
|
|
12
12
|
}
|
|
13
13
|
/** Create a new delegation */
|
|
14
14
|
export declare function createDelegation(sourceTab: string, targetTab: string, message: string, returnToTab?: string): Delegation;
|
|
15
|
-
/** Mark a delegation as running */
|
|
16
|
-
export declare function markDelegationRunning(id: string): void;
|
|
17
15
|
/** Complete a delegation with a result */
|
|
18
16
|
export declare function completeDelegation(targetTab: string, result: string): Delegation | null;
|
|
19
17
|
/** Get pending delegations for a tab */
|
|
20
18
|
export declare function getPendingDelegations(tabName?: string): Delegation[];
|
|
21
|
-
//# sourceMappingURL=manager.d.ts.map
|
|
@@ -33,10 +33,6 @@ export function createDelegation(sourceTab, targetTab, message, returnToTab) {
|
|
|
33
33
|
logger.info(`Delegation created: ${sourceTab} → ${targetTab} (depth ${delegation.depth})`);
|
|
34
34
|
return delegation;
|
|
35
35
|
}
|
|
36
|
-
/** Mark a delegation as running */
|
|
37
|
-
export function markDelegationRunning(id) {
|
|
38
|
-
getDb().prepare("UPDATE delegations SET status = 'running' WHERE id = ?").run(id);
|
|
39
|
-
}
|
|
40
36
|
/** Complete a delegation with a result */
|
|
41
37
|
export function completeDelegation(targetTab, result) {
|
|
42
38
|
const db = getDb();
|
|
@@ -85,4 +81,3 @@ function getCurrentDepth(tabName) {
|
|
|
85
81
|
const row = db.prepare("SELECT MAX(depth) as d FROM delegations WHERE source_tab = ? AND status IN ('pending', 'running')").get(tabName);
|
|
86
82
|
return row.d ?? 0;
|
|
87
83
|
}
|
|
88
|
-
//# sourceMappingURL=manager.js.map
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -240,7 +240,7 @@ program
|
|
|
240
240
|
console.log('\nClaude can now control your mouse, keyboard, and screen.');
|
|
241
241
|
console.log('Make sure you have granted permissions:');
|
|
242
242
|
console.log(' macOS: System Settings → Privacy → Screen Recording + Accessibility');
|
|
243
|
-
console.log(' Guide: https://
|
|
243
|
+
console.log(' Guide: https://github.com/beecork/beecork/blob/main/docs/troubleshooting.md');
|
|
244
244
|
}
|
|
245
245
|
console.log('\nRestart daemon to apply: beecork stop && beecork start\n');
|
|
246
246
|
});
|
|
@@ -475,12 +475,22 @@ program
|
|
|
475
475
|
});
|
|
476
476
|
program
|
|
477
477
|
.command('knowledge [scope]')
|
|
478
|
-
.description('List stored knowledge (global, project
|
|
478
|
+
.description('List stored knowledge (global, project <path>, or all)')
|
|
479
479
|
.action(async (scope) => {
|
|
480
|
-
const { getGlobalKnowledge, formatKnowledgeForContext } = await import('./knowledge/index.js');
|
|
481
|
-
|
|
480
|
+
const { getGlobalKnowledge, getProjectKnowledge, getAllKnowledge, formatKnowledgeForContext } = await import('./knowledge/index.js');
|
|
481
|
+
let entries;
|
|
482
|
+
if (scope === 'global') {
|
|
483
|
+
entries = getGlobalKnowledge();
|
|
484
|
+
}
|
|
485
|
+
else if (scope?.startsWith('project')) {
|
|
486
|
+
const projectPath = scope.split(' ').slice(1).join(' ') || process.cwd();
|
|
487
|
+
entries = getProjectKnowledge(projectPath);
|
|
488
|
+
}
|
|
489
|
+
else {
|
|
490
|
+
entries = getAllKnowledge();
|
|
491
|
+
}
|
|
482
492
|
if (entries.length === 0) {
|
|
483
|
-
console.log('No
|
|
493
|
+
console.log('No knowledge stored yet.');
|
|
484
494
|
return;
|
|
485
495
|
}
|
|
486
496
|
console.log(formatKnowledgeForContext(entries));
|
|
@@ -509,5 +519,10 @@ storeCmd
|
|
|
509
519
|
const { storeInfo } = await import('./cli/store.js');
|
|
510
520
|
await storeInfo(pkg);
|
|
511
521
|
});
|
|
522
|
+
program
|
|
523
|
+
.command('help')
|
|
524
|
+
.description('Show help')
|
|
525
|
+
.action(() => {
|
|
526
|
+
program.outputHelp();
|
|
527
|
+
});
|
|
512
528
|
program.parse();
|
|
513
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,3 +1,2 @@
|
|
|
1
1
|
export type { KnowledgeEntry, KnowledgeScope } from './types.js';
|
|
2
2
|
export { getGlobalKnowledge, addGlobalKnowledge, getProjectKnowledge, addProjectKnowledge, getTabKnowledge, getAllKnowledge, formatKnowledgeForContext, addKnowledge, searchKnowledge, } from './manager.js';
|
|
3
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/knowledge/index.js
CHANGED
|
@@ -15,4 +15,3 @@ export declare function addKnowledge(content: string, scope: KnowledgeScope, opt
|
|
|
15
15
|
}): void;
|
|
16
16
|
/** Search knowledge across all layers */
|
|
17
17
|
export declare function searchKnowledge(query: string, projectPath?: string, tabName?: string): KnowledgeEntry[];
|
|
18
|
-
//# sourceMappingURL=manager.d.ts.map
|