verbolab 0.1.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +71 -0
- package/dist/bin/verbo.d.ts +3 -0
- package/dist/bin/verbo.d.ts.map +1 -0
- package/dist/bin/verbo.js +1156 -0
- package/dist/bin/verbo.js.map +1 -0
- package/dist/relay/index.d.ts +2 -0
- package/dist/relay/index.d.ts.map +1 -0
- package/dist/relay/index.js +15 -0
- package/dist/relay/index.js.map +1 -0
- package/dist/src/agent/agent-launcher.d.ts +64 -0
- package/dist/src/agent/agent-launcher.d.ts.map +1 -0
- package/dist/src/agent/agent-launcher.js +326 -0
- package/dist/src/agent/agent-launcher.js.map +1 -0
- package/dist/src/agent/agent-monitor.d.ts +16 -0
- package/dist/src/agent/agent-monitor.d.ts.map +1 -0
- package/dist/src/agent/agent-monitor.js +41 -0
- package/dist/src/agent/agent-monitor.js.map +1 -0
- package/dist/src/agent/fun-names.d.ts +9 -0
- package/dist/src/agent/fun-names.d.ts.map +1 -0
- package/dist/src/agent/fun-names.js +118 -0
- package/dist/src/agent/fun-names.js.map +1 -0
- package/dist/src/agent/mcp-shim.d.ts +45 -0
- package/dist/src/agent/mcp-shim.d.ts.map +1 -0
- package/dist/src/agent/mcp-shim.js +192 -0
- package/dist/src/agent/mcp-shim.js.map +1 -0
- package/dist/src/agent/personas.d.ts +47 -0
- package/dist/src/agent/personas.d.ts.map +1 -0
- package/dist/src/agent/personas.js +86 -0
- package/dist/src/agent/personas.js.map +1 -0
- package/dist/src/agent/provider-detection.d.ts +21 -0
- package/dist/src/agent/provider-detection.d.ts.map +1 -0
- package/dist/src/agent/provider-detection.js +47 -0
- package/dist/src/agent/provider-detection.js.map +1 -0
- package/dist/src/agent/providers/claude-provider.d.ts +3 -0
- package/dist/src/agent/providers/claude-provider.d.ts.map +1 -0
- package/dist/src/agent/providers/claude-provider.js +119 -0
- package/dist/src/agent/providers/claude-provider.js.map +1 -0
- package/dist/src/agent/providers/gemini-provider.d.ts +13 -0
- package/dist/src/agent/providers/gemini-provider.d.ts.map +1 -0
- package/dist/src/agent/providers/gemini-provider.js +143 -0
- package/dist/src/agent/providers/gemini-provider.js.map +1 -0
- package/dist/src/agent/providers/openai-provider.d.ts +3 -0
- package/dist/src/agent/providers/openai-provider.d.ts.map +1 -0
- package/dist/src/agent/providers/openai-provider.js +127 -0
- package/dist/src/agent/providers/openai-provider.js.map +1 -0
- package/dist/src/agent/providers/registry.d.ts +19 -0
- package/dist/src/agent/providers/registry.d.ts.map +1 -0
- package/dist/src/agent/providers/registry.js +30 -0
- package/dist/src/agent/providers/registry.js.map +1 -0
- package/dist/src/agent/providers/types.d.ts +118 -0
- package/dist/src/agent/providers/types.d.ts.map +1 -0
- package/dist/src/agent/providers/types.js +2 -0
- package/dist/src/agent/providers/types.js.map +1 -0
- package/dist/src/approval/approval-server.d.ts +17 -0
- package/dist/src/approval/approval-server.d.ts.map +1 -0
- package/dist/src/approval/approval-server.js +90 -0
- package/dist/src/approval/approval-server.js.map +1 -0
- package/dist/src/approval/approval-store.d.ts +29 -0
- package/dist/src/approval/approval-store.d.ts.map +1 -0
- package/dist/src/approval/approval-store.js +94 -0
- package/dist/src/approval/approval-store.js.map +1 -0
- package/dist/src/auth/auth-store.d.ts +18 -0
- package/dist/src/auth/auth-store.d.ts.map +1 -0
- package/dist/src/auth/auth-store.js +34 -0
- package/dist/src/auth/auth-store.js.map +1 -0
- package/dist/src/auth/device-code-client.d.ts +32 -0
- package/dist/src/auth/device-code-client.d.ts.map +1 -0
- package/dist/src/auth/device-code-client.js +41 -0
- package/dist/src/auth/device-code-client.js.map +1 -0
- package/dist/src/auth/plan-enforcer.d.ts +8 -0
- package/dist/src/auth/plan-enforcer.d.ts.map +1 -0
- package/dist/src/auth/plan-enforcer.js +14 -0
- package/dist/src/auth/plan-enforcer.js.map +1 -0
- package/dist/src/commands/audit.d.ts +7 -0
- package/dist/src/commands/audit.d.ts.map +1 -0
- package/dist/src/commands/audit.js +92 -0
- package/dist/src/commands/audit.js.map +1 -0
- package/dist/src/commands/team.d.ts +48 -0
- package/dist/src/commands/team.d.ts.map +1 -0
- package/dist/src/commands/team.js +175 -0
- package/dist/src/commands/team.js.map +1 -0
- package/dist/src/config/verbo-config.d.ts +43 -0
- package/dist/src/config/verbo-config.d.ts.map +1 -0
- package/dist/src/config/verbo-config.js +111 -0
- package/dist/src/config/verbo-config.js.map +1 -0
- package/dist/src/core/agent-session-store.d.ts +69 -0
- package/dist/src/core/agent-session-store.d.ts.map +1 -0
- package/dist/src/core/agent-session-store.js +168 -0
- package/dist/src/core/agent-session-store.js.map +1 -0
- package/dist/src/core/audit-log-store.d.ts +33 -0
- package/dist/src/core/audit-log-store.d.ts.map +1 -0
- package/dist/src/core/audit-log-store.js +104 -0
- package/dist/src/core/audit-log-store.js.map +1 -0
- package/dist/src/core/compliance.d.ts +50 -0
- package/dist/src/core/compliance.d.ts.map +1 -0
- package/dist/src/core/compliance.js +59 -0
- package/dist/src/core/compliance.js.map +1 -0
- package/dist/src/core/conflict-detector.d.ts +19 -0
- package/dist/src/core/conflict-detector.d.ts.map +1 -0
- package/dist/src/core/conflict-detector.js +87 -0
- package/dist/src/core/conflict-detector.js.map +1 -0
- package/dist/src/core/conflict-enforcer.d.ts +37 -0
- package/dist/src/core/conflict-enforcer.d.ts.map +1 -0
- package/dist/src/core/conflict-enforcer.js +139 -0
- package/dist/src/core/conflict-enforcer.js.map +1 -0
- package/dist/src/core/cost-store.d.ts +55 -0
- package/dist/src/core/cost-store.d.ts.map +1 -0
- package/dist/src/core/cost-store.js +140 -0
- package/dist/src/core/cost-store.js.map +1 -0
- package/dist/src/core/hot-files.d.ts +19 -0
- package/dist/src/core/hot-files.d.ts.map +1 -0
- package/dist/src/core/hot-files.js +64 -0
- package/dist/src/core/hot-files.js.map +1 -0
- package/dist/src/core/human-action-store.d.ts +33 -0
- package/dist/src/core/human-action-store.d.ts.map +1 -0
- package/dist/src/core/human-action-store.js +92 -0
- package/dist/src/core/human-action-store.js.map +1 -0
- package/dist/src/core/learning-store.d.ts +32 -0
- package/dist/src/core/learning-store.d.ts.map +1 -0
- package/dist/src/core/learning-store.js +95 -0
- package/dist/src/core/learning-store.js.map +1 -0
- package/dist/src/core/merge-queue.d.ts +28 -0
- package/dist/src/core/merge-queue.d.ts.map +1 -0
- package/dist/src/core/merge-queue.js +92 -0
- package/dist/src/core/merge-queue.js.map +1 -0
- package/dist/src/core/notification-service.d.ts +13 -0
- package/dist/src/core/notification-service.d.ts.map +1 -0
- package/dist/src/core/notification-service.js +126 -0
- package/dist/src/core/notification-service.js.map +1 -0
- package/dist/src/core/notifications.d.ts +10 -0
- package/dist/src/core/notifications.d.ts.map +1 -0
- package/dist/src/core/notifications.js +33 -0
- package/dist/src/core/notifications.js.map +1 -0
- package/dist/src/core/orchestrator-store.d.ts +44 -0
- package/dist/src/core/orchestrator-store.d.ts.map +1 -0
- package/dist/src/core/orchestrator-store.js +69 -0
- package/dist/src/core/orchestrator-store.js.map +1 -0
- package/dist/src/core/parallelizer.d.ts +47 -0
- package/dist/src/core/parallelizer.d.ts.map +1 -0
- package/dist/src/core/parallelizer.js +224 -0
- package/dist/src/core/parallelizer.js.map +1 -0
- package/dist/src/core/pipeline-rollback.d.ts +29 -0
- package/dist/src/core/pipeline-rollback.d.ts.map +1 -0
- package/dist/src/core/pipeline-rollback.js +84 -0
- package/dist/src/core/pipeline-rollback.js.map +1 -0
- package/dist/src/core/pipeline-runner.d.ts +73 -0
- package/dist/src/core/pipeline-runner.d.ts.map +1 -0
- package/dist/src/core/pipeline-runner.js +165 -0
- package/dist/src/core/pipeline-runner.js.map +1 -0
- package/dist/src/core/pr-creator.d.ts +22 -0
- package/dist/src/core/pr-creator.d.ts.map +1 -0
- package/dist/src/core/pr-creator.js +55 -0
- package/dist/src/core/pr-creator.js.map +1 -0
- package/dist/src/core/rbac.d.ts +27 -0
- package/dist/src/core/rbac.d.ts.map +1 -0
- package/dist/src/core/rbac.js +76 -0
- package/dist/src/core/rbac.js.map +1 -0
- package/dist/src/core/startup-cleanup.d.ts +47 -0
- package/dist/src/core/startup-cleanup.d.ts.map +1 -0
- package/dist/src/core/startup-cleanup.js +150 -0
- package/dist/src/core/startup-cleanup.js.map +1 -0
- package/dist/src/core/task-store.d.ts +96 -0
- package/dist/src/core/task-store.d.ts.map +1 -0
- package/dist/src/core/task-store.js +309 -0
- package/dist/src/core/task-store.js.map +1 -0
- package/dist/src/core/verbo-config-editor.d.ts +44 -0
- package/dist/src/core/verbo-config-editor.d.ts.map +1 -0
- package/dist/src/core/verbo-config-editor.js +204 -0
- package/dist/src/core/verbo-config-editor.js.map +1 -0
- package/dist/src/core/verbo-config.d.ts +35 -0
- package/dist/src/core/verbo-config.d.ts.map +1 -0
- package/dist/src/core/verbo-config.js +55 -0
- package/dist/src/core/verbo-config.js.map +1 -0
- package/dist/src/core/verbo-md.d.ts +96 -0
- package/dist/src/core/verbo-md.d.ts.map +1 -0
- package/dist/src/core/verbo-md.js +410 -0
- package/dist/src/core/verbo-md.js.map +1 -0
- package/dist/src/db/database.d.ts +9 -0
- package/dist/src/db/database.d.ts.map +1 -0
- package/dist/src/db/database.js +37 -0
- package/dist/src/db/database.js.map +1 -0
- package/dist/src/db/migrations/001-personas-subtasks.d.ts +10 -0
- package/dist/src/db/migrations/001-personas-subtasks.d.ts.map +1 -0
- package/dist/src/db/migrations/001-personas-subtasks.js +32 -0
- package/dist/src/db/migrations/001-personas-subtasks.js.map +1 -0
- package/dist/src/db/migrations/002-rbac.d.ts +9 -0
- package/dist/src/db/migrations/002-rbac.d.ts.map +1 -0
- package/dist/src/db/migrations/002-rbac.js +31 -0
- package/dist/src/db/migrations/002-rbac.js.map +1 -0
- package/dist/src/db/migrations/003-provider-column.d.ts +8 -0
- package/dist/src/db/migrations/003-provider-column.d.ts.map +1 -0
- package/dist/src/db/migrations/003-provider-column.js +12 -0
- package/dist/src/db/migrations/003-provider-column.js.map +1 -0
- package/dist/src/db/migrations/004-pipeline-cost.d.ts +8 -0
- package/dist/src/db/migrations/004-pipeline-cost.d.ts.map +1 -0
- package/dist/src/db/migrations/004-pipeline-cost.js +23 -0
- package/dist/src/db/migrations/004-pipeline-cost.js.map +1 -0
- package/dist/src/db/migrations/005-audit-log-timestamp.d.ts +10 -0
- package/dist/src/db/migrations/005-audit-log-timestamp.d.ts.map +1 -0
- package/dist/src/db/migrations/005-audit-log-timestamp.js +39 -0
- package/dist/src/db/migrations/005-audit-log-timestamp.js.map +1 -0
- package/dist/src/db/migrations/006-human-action-type.d.ts +9 -0
- package/dist/src/db/migrations/006-human-action-type.d.ts.map +1 -0
- package/dist/src/db/migrations/006-human-action-type.js +16 -0
- package/dist/src/db/migrations/006-human-action-type.js.map +1 -0
- package/dist/src/db/schema.d.ts +6 -0
- package/dist/src/db/schema.d.ts.map +1 -0
- package/dist/src/db/schema.js +255 -0
- package/dist/src/db/schema.js.map +1 -0
- package/dist/src/deps/dependabot-generator.d.ts +22 -0
- package/dist/src/deps/dependabot-generator.d.ts.map +1 -0
- package/dist/src/deps/dependabot-generator.js +83 -0
- package/dist/src/deps/dependabot-generator.js.map +1 -0
- package/dist/src/deps/dependabot-monitor.d.ts +22 -0
- package/dist/src/deps/dependabot-monitor.d.ts.map +1 -0
- package/dist/src/deps/dependabot-monitor.js +28 -0
- package/dist/src/deps/dependabot-monitor.js.map +1 -0
- package/dist/src/deps/package-auditor.d.ts +24 -0
- package/dist/src/deps/package-auditor.d.ts.map +1 -0
- package/dist/src/deps/package-auditor.js +118 -0
- package/dist/src/deps/package-auditor.js.map +1 -0
- package/dist/src/init/ensure-init.d.ts +6 -0
- package/dist/src/init/ensure-init.d.ts.map +1 -0
- package/dist/src/init/ensure-init.js +27 -0
- package/dist/src/init/ensure-init.js.map +1 -0
- package/dist/src/init/project-detector.d.ts +11 -0
- package/dist/src/init/project-detector.d.ts.map +1 -0
- package/dist/src/init/project-detector.js +117 -0
- package/dist/src/init/project-detector.js.map +1 -0
- package/dist/src/init/questionnaire.d.ts +5 -0
- package/dist/src/init/questionnaire.d.ts.map +1 -0
- package/dist/src/init/questionnaire.js +112 -0
- package/dist/src/init/questionnaire.js.map +1 -0
- package/dist/src/init/template.d.ts +17 -0
- package/dist/src/init/template.d.ts.map +1 -0
- package/dist/src/init/template.js +46 -0
- package/dist/src/init/template.js.map +1 -0
- package/dist/src/intelligence/claude-client.d.ts +3 -0
- package/dist/src/intelligence/claude-client.d.ts.map +1 -0
- package/dist/src/intelligence/claude-client.js +12 -0
- package/dist/src/intelligence/claude-client.js.map +1 -0
- package/dist/src/intelligence/conflict-mediator.d.ts +17 -0
- package/dist/src/intelligence/conflict-mediator.d.ts.map +1 -0
- package/dist/src/intelligence/conflict-mediator.js +83 -0
- package/dist/src/intelligence/conflict-mediator.js.map +1 -0
- package/dist/src/intelligence/github-orchestrator.d.ts +30 -0
- package/dist/src/intelligence/github-orchestrator.d.ts.map +1 -0
- package/dist/src/intelligence/github-orchestrator.js +270 -0
- package/dist/src/intelligence/github-orchestrator.js.map +1 -0
- package/dist/src/intelligence/kill-switch.d.ts +10 -0
- package/dist/src/intelligence/kill-switch.d.ts.map +1 -0
- package/dist/src/intelligence/kill-switch.js +12 -0
- package/dist/src/intelligence/kill-switch.js.map +1 -0
- package/dist/src/intelligence/learnings-extractor.d.ts +13 -0
- package/dist/src/intelligence/learnings-extractor.d.ts.map +1 -0
- package/dist/src/intelligence/learnings-extractor.js +74 -0
- package/dist/src/intelligence/learnings-extractor.js.map +1 -0
- package/dist/src/intelligence/project-scanner.d.ts +2 -0
- package/dist/src/intelligence/project-scanner.d.ts.map +1 -0
- package/dist/src/intelligence/project-scanner.js +28 -0
- package/dist/src/intelligence/project-scanner.js.map +1 -0
- package/dist/src/intelligence/task-decomposer.d.ts +14 -0
- package/dist/src/intelligence/task-decomposer.d.ts.map +1 -0
- package/dist/src/intelligence/task-decomposer.js +97 -0
- package/dist/src/intelligence/task-decomposer.js.map +1 -0
- package/dist/src/intelligence/types.d.ts +14 -0
- package/dist/src/intelligence/types.d.ts.map +1 -0
- package/dist/src/intelligence/types.js +2 -0
- package/dist/src/intelligence/types.js.map +1 -0
- package/dist/src/mcp/server.d.ts +63 -0
- package/dist/src/mcp/server.d.ts.map +1 -0
- package/dist/src/mcp/server.js +537 -0
- package/dist/src/mcp/server.js.map +1 -0
- package/dist/src/mcp/stdio-entry.d.ts +2 -0
- package/dist/src/mcp/stdio-entry.d.ts.map +1 -0
- package/dist/src/mcp/stdio-entry.js +124 -0
- package/dist/src/mcp/stdio-entry.js.map +1 -0
- package/dist/src/mcp/subtask-handlers.d.ts +7 -0
- package/dist/src/mcp/subtask-handlers.d.ts.map +1 -0
- package/dist/src/mcp/subtask-handlers.js +50 -0
- package/dist/src/mcp/subtask-handlers.js.map +1 -0
- package/dist/src/security/network-proxy.d.ts +20 -0
- package/dist/src/security/network-proxy.d.ts.map +1 -0
- package/dist/src/security/network-proxy.js +125 -0
- package/dist/src/security/network-proxy.js.map +1 -0
- package/dist/src/security/network-sandbox.d.ts +19 -0
- package/dist/src/security/network-sandbox.d.ts.map +1 -0
- package/dist/src/security/network-sandbox.js +100 -0
- package/dist/src/security/network-sandbox.js.map +1 -0
- package/dist/src/security/sanitize.d.ts +13 -0
- package/dist/src/security/sanitize.d.ts.map +1 -0
- package/dist/src/security/sanitize.js +19 -0
- package/dist/src/security/sanitize.js.map +1 -0
- package/dist/src/security/secrets-patterns.d.ts +29 -0
- package/dist/src/security/secrets-patterns.d.ts.map +1 -0
- package/dist/src/security/secrets-patterns.js +430 -0
- package/dist/src/security/secrets-patterns.js.map +1 -0
- package/dist/src/security/secrets-scanner.d.ts +26 -0
- package/dist/src/security/secrets-scanner.d.ts.map +1 -0
- package/dist/src/security/secrets-scanner.js +62 -0
- package/dist/src/security/secrets-scanner.js.map +1 -0
- package/dist/src/skills/classifier.d.ts +9 -0
- package/dist/src/skills/classifier.d.ts.map +1 -0
- package/dist/src/skills/classifier.js +41 -0
- package/dist/src/skills/classifier.js.map +1 -0
- package/dist/src/skills/registry.d.ts +16 -0
- package/dist/src/skills/registry.d.ts.map +1 -0
- package/dist/src/skills/registry.js +61 -0
- package/dist/src/skills/registry.js.map +1 -0
- package/dist/src/sync/events.d.ts +9 -0
- package/dist/src/sync/events.d.ts.map +1 -0
- package/dist/src/sync/events.js +2 -0
- package/dist/src/sync/events.js.map +1 -0
- package/dist/src/sync/relay-server.d.ts +18 -0
- package/dist/src/sync/relay-server.d.ts.map +1 -0
- package/dist/src/sync/relay-server.js +131 -0
- package/dist/src/sync/relay-server.js.map +1 -0
- package/dist/src/sync/sync-client.d.ts +31 -0
- package/dist/src/sync/sync-client.d.ts.map +1 -0
- package/dist/src/sync/sync-client.js +314 -0
- package/dist/src/sync/sync-client.js.map +1 -0
- package/dist/src/tui/app.d.ts +35 -0
- package/dist/src/tui/app.d.ts.map +1 -0
- package/dist/src/tui/app.js +676 -0
- package/dist/src/tui/app.js.map +1 -0
- package/dist/src/tui/components/activity-feed.d.ts +12 -0
- package/dist/src/tui/components/activity-feed.d.ts.map +1 -0
- package/dist/src/tui/components/activity-feed.js +82 -0
- package/dist/src/tui/components/activity-feed.js.map +1 -0
- package/dist/src/tui/components/agent-list.d.ts +19 -0
- package/dist/src/tui/components/agent-list.d.ts.map +1 -0
- package/dist/src/tui/components/agent-list.js +33 -0
- package/dist/src/tui/components/agent-list.js.map +1 -0
- package/dist/src/tui/components/agent-row.d.ts +12 -0
- package/dist/src/tui/components/agent-row.d.ts.map +1 -0
- package/dist/src/tui/components/agent-row.js +37 -0
- package/dist/src/tui/components/agent-row.js.map +1 -0
- package/dist/src/tui/components/approval-terminal.d.ts +13 -0
- package/dist/src/tui/components/approval-terminal.d.ts.map +1 -0
- package/dist/src/tui/components/approval-terminal.js +34 -0
- package/dist/src/tui/components/approval-terminal.js.map +1 -0
- package/dist/src/tui/components/audit-viewer.d.ts +16 -0
- package/dist/src/tui/components/audit-viewer.d.ts.map +1 -0
- package/dist/src/tui/components/audit-viewer.js +46 -0
- package/dist/src/tui/components/audit-viewer.js.map +1 -0
- package/dist/src/tui/components/auth-gate.d.ts +9 -0
- package/dist/src/tui/components/auth-gate.d.ts.map +1 -0
- package/dist/src/tui/components/auth-gate.js +112 -0
- package/dist/src/tui/components/auth-gate.js.map +1 -0
- package/dist/src/tui/components/command-palette.d.ts +12 -0
- package/dist/src/tui/components/command-palette.d.ts.map +1 -0
- package/dist/src/tui/components/command-palette.js +51 -0
- package/dist/src/tui/components/command-palette.js.map +1 -0
- package/dist/src/tui/components/compliance-badge.d.ts +11 -0
- package/dist/src/tui/components/compliance-badge.d.ts.map +1 -0
- package/dist/src/tui/components/compliance-badge.js +12 -0
- package/dist/src/tui/components/compliance-badge.js.map +1 -0
- package/dist/src/tui/components/decomposition-review.d.ts +10 -0
- package/dist/src/tui/components/decomposition-review.d.ts.map +1 -0
- package/dist/src/tui/components/decomposition-review.js +19 -0
- package/dist/src/tui/components/decomposition-review.js.map +1 -0
- package/dist/src/tui/components/dependency-graph.d.ts +13 -0
- package/dist/src/tui/components/dependency-graph.d.ts.map +1 -0
- package/dist/src/tui/components/dependency-graph.js +143 -0
- package/dist/src/tui/components/dependency-graph.js.map +1 -0
- package/dist/src/tui/components/diff-viewer.d.ts +11 -0
- package/dist/src/tui/components/diff-viewer.d.ts.map +1 -0
- package/dist/src/tui/components/diff-viewer.js +82 -0
- package/dist/src/tui/components/diff-viewer.js.map +1 -0
- package/dist/src/tui/components/edit-task-input.d.ts +10 -0
- package/dist/src/tui/components/edit-task-input.d.ts.map +1 -0
- package/dist/src/tui/components/edit-task-input.js +20 -0
- package/dist/src/tui/components/edit-task-input.js.map +1 -0
- package/dist/src/tui/components/footer.d.ts +12 -0
- package/dist/src/tui/components/footer.d.ts.map +1 -0
- package/dist/src/tui/components/footer.js +41 -0
- package/dist/src/tui/components/footer.js.map +1 -0
- package/dist/src/tui/components/header.d.ts +8 -0
- package/dist/src/tui/components/header.d.ts.map +1 -0
- package/dist/src/tui/components/header.js +20 -0
- package/dist/src/tui/components/header.js.map +1 -0
- package/dist/src/tui/components/human-actions.d.ts +14 -0
- package/dist/src/tui/components/human-actions.d.ts.map +1 -0
- package/dist/src/tui/components/human-actions.js +43 -0
- package/dist/src/tui/components/human-actions.js.map +1 -0
- package/dist/src/tui/components/log-panel.d.ts +10 -0
- package/dist/src/tui/components/log-panel.d.ts.map +1 -0
- package/dist/src/tui/components/log-panel.js +38 -0
- package/dist/src/tui/components/log-panel.js.map +1 -0
- package/dist/src/tui/components/memory-viewer.d.ts +10 -0
- package/dist/src/tui/components/memory-viewer.d.ts.map +1 -0
- package/dist/src/tui/components/memory-viewer.js +44 -0
- package/dist/src/tui/components/memory-viewer.js.map +1 -0
- package/dist/src/tui/components/new-task-input.d.ts +9 -0
- package/dist/src/tui/components/new-task-input.d.ts.map +1 -0
- package/dist/src/tui/components/new-task-input.js +21 -0
- package/dist/src/tui/components/new-task-input.js.map +1 -0
- package/dist/src/tui/components/orchestrator-status.d.ts +9 -0
- package/dist/src/tui/components/orchestrator-status.d.ts.map +1 -0
- package/dist/src/tui/components/orchestrator-status.js +15 -0
- package/dist/src/tui/components/orchestrator-status.js.map +1 -0
- package/dist/src/tui/components/parallelize-banner.d.ts +8 -0
- package/dist/src/tui/components/parallelize-banner.d.ts.map +1 -0
- package/dist/src/tui/components/parallelize-banner.js +9 -0
- package/dist/src/tui/components/parallelize-banner.js.map +1 -0
- package/dist/src/tui/components/progress-bar.d.ts +9 -0
- package/dist/src/tui/components/progress-bar.d.ts.map +1 -0
- package/dist/src/tui/components/progress-bar.js +15 -0
- package/dist/src/tui/components/progress-bar.js.map +1 -0
- package/dist/src/tui/components/review-queue.d.ts +13 -0
- package/dist/src/tui/components/review-queue.d.ts.map +1 -0
- package/dist/src/tui/components/review-queue.js +78 -0
- package/dist/src/tui/components/review-queue.js.map +1 -0
- package/dist/src/tui/components/rich-header.d.ts +11 -0
- package/dist/src/tui/components/rich-header.d.ts.map +1 -0
- package/dist/src/tui/components/rich-header.js +25 -0
- package/dist/src/tui/components/rich-header.js.map +1 -0
- package/dist/src/tui/components/spinner.d.ts +7 -0
- package/dist/src/tui/components/spinner.d.ts.map +1 -0
- package/dist/src/tui/components/spinner.js +8 -0
- package/dist/src/tui/components/spinner.js.map +1 -0
- package/dist/src/tui/components/status-bar.d.ts +23 -0
- package/dist/src/tui/components/status-bar.d.ts.map +1 -0
- package/dist/src/tui/components/status-bar.js +28 -0
- package/dist/src/tui/components/status-bar.js.map +1 -0
- package/dist/src/tui/components/task-queue.d.ts +11 -0
- package/dist/src/tui/components/task-queue.d.ts.map +1 -0
- package/dist/src/tui/components/task-queue.js +30 -0
- package/dist/src/tui/components/task-queue.js.map +1 -0
- package/dist/src/tui/components/team-view.d.ts +13 -0
- package/dist/src/tui/components/team-view.d.ts.map +1 -0
- package/dist/src/tui/components/team-view.js +12 -0
- package/dist/src/tui/components/team-view.js.map +1 -0
- package/dist/src/tui/graph-renderer.d.ts +11 -0
- package/dist/src/tui/graph-renderer.d.ts.map +1 -0
- package/dist/src/tui/graph-renderer.js +296 -0
- package/dist/src/tui/graph-renderer.js.map +1 -0
- package/dist/src/tui/hooks/use-bell.d.ts +21 -0
- package/dist/src/tui/hooks/use-bell.d.ts.map +1 -0
- package/dist/src/tui/hooks/use-bell.js +38 -0
- package/dist/src/tui/hooks/use-bell.js.map +1 -0
- package/dist/src/tui/hooks/use-ci-status.d.ts +16 -0
- package/dist/src/tui/hooks/use-ci-status.d.ts.map +1 -0
- package/dist/src/tui/hooks/use-ci-status.js +97 -0
- package/dist/src/tui/hooks/use-ci-status.js.map +1 -0
- package/dist/src/tui/hooks/use-command-palette.d.ts +37 -0
- package/dist/src/tui/hooks/use-command-palette.d.ts.map +1 -0
- package/dist/src/tui/hooks/use-command-palette.js +108 -0
- package/dist/src/tui/hooks/use-command-palette.js.map +1 -0
- package/dist/src/tui/hooks/use-diff-view.d.ts +16 -0
- package/dist/src/tui/hooks/use-diff-view.d.ts.map +1 -0
- package/dist/src/tui/hooks/use-diff-view.js +75 -0
- package/dist/src/tui/hooks/use-diff-view.js.map +1 -0
- package/dist/src/tui/hooks/use-keyboard.d.ts +3 -0
- package/dist/src/tui/hooks/use-keyboard.d.ts.map +1 -0
- package/dist/src/tui/hooks/use-keyboard.js +70 -0
- package/dist/src/tui/hooks/use-keyboard.js.map +1 -0
- package/dist/src/tui/hooks/use-log-stream.d.ts +25 -0
- package/dist/src/tui/hooks/use-log-stream.d.ts.map +1 -0
- package/dist/src/tui/hooks/use-log-stream.js +83 -0
- package/dist/src/tui/hooks/use-log-stream.js.map +1 -0
- package/dist/src/tui/hooks/use-spinner.d.ts +3 -0
- package/dist/src/tui/hooks/use-spinner.d.ts.map +1 -0
- package/dist/src/tui/hooks/use-spinner.js +13 -0
- package/dist/src/tui/hooks/use-spinner.js.map +1 -0
- package/dist/src/tui/hooks/use-store.d.ts +33 -0
- package/dist/src/tui/hooks/use-store.d.ts.map +1 -0
- package/dist/src/tui/hooks/use-store.js +21 -0
- package/dist/src/tui/hooks/use-store.js.map +1 -0
- package/dist/src/tui/lib/diff-parser.d.ts +24 -0
- package/dist/src/tui/lib/diff-parser.d.ts.map +1 -0
- package/dist/src/tui/lib/diff-parser.js +115 -0
- package/dist/src/tui/lib/diff-parser.js.map +1 -0
- package/dist/src/tui/lib/palette-commands.d.ts +14 -0
- package/dist/src/tui/lib/palette-commands.d.ts.map +1 -0
- package/dist/src/tui/lib/palette-commands.js +101 -0
- package/dist/src/tui/lib/palette-commands.js.map +1 -0
- package/dist/src/tui/tui.d.ts +8 -0
- package/dist/src/tui/tui.d.ts.map +1 -0
- package/dist/src/tui/tui.js +8 -0
- package/dist/src/tui/tui.js.map +1 -0
- package/package.json +66 -0
- package/skills/api-design.md +84 -0
- package/skills/backend-typescript.md +76 -0
- package/skills/data-modeling.md +73 -0
- package/skills/devops-ci.md +82 -0
- package/skills/frontend-design.md +69 -0
- package/skills/observability.md +73 -0
- package/skills/react-nextjs.md +76 -0
- package/skills/refactoring.md +77 -0
- package/skills/security.md +75 -0
- package/skills/testing.md +69 -0
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import { ulid } from 'ulid';
|
|
2
|
+
const VALID_ROLES = new Set(['owner', 'lead', 'developer', 'viewer']);
|
|
3
|
+
/**
|
|
4
|
+
* Parse a `## Team` section from VERBO.md content.
|
|
5
|
+
*
|
|
6
|
+
* Expected format:
|
|
7
|
+
* ```
|
|
8
|
+
* ## Team
|
|
9
|
+
* alice: owner
|
|
10
|
+
* bob: lead
|
|
11
|
+
* carol: developer
|
|
12
|
+
* dave: viewer
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
export function parseTeamSection(verboMdContent) {
|
|
16
|
+
const entries = [];
|
|
17
|
+
let inTeamSection = false;
|
|
18
|
+
for (const line of verboMdContent.split('\n')) {
|
|
19
|
+
const sectionMatch = line.match(/^## (.+)/);
|
|
20
|
+
if (sectionMatch) {
|
|
21
|
+
inTeamSection = sectionMatch[1].trim().toLowerCase() === 'team';
|
|
22
|
+
continue;
|
|
23
|
+
}
|
|
24
|
+
if (!inTeamSection)
|
|
25
|
+
continue;
|
|
26
|
+
const kvMatch = line.match(/^(\S+)\s*:\s*(\S+)/);
|
|
27
|
+
if (!kvMatch)
|
|
28
|
+
continue;
|
|
29
|
+
const humanId = kvMatch[1].trim();
|
|
30
|
+
const role = kvMatch[2].trim().toLowerCase();
|
|
31
|
+
if (VALID_ROLES.has(role)) {
|
|
32
|
+
entries.push({ humanId, role });
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
return entries;
|
|
36
|
+
}
|
|
37
|
+
// ---- Bootstrap team from VERBO.md ----
|
|
38
|
+
/**
|
|
39
|
+
* Seed team_members from the `## Team` section of VERBO.md.
|
|
40
|
+
* Only inserts members that don't already exist — never overwrites.
|
|
41
|
+
*/
|
|
42
|
+
export function bootstrapTeamFromVerboMd(db, verboMdContent) {
|
|
43
|
+
const entries = parseTeamSection(verboMdContent);
|
|
44
|
+
if (entries.length === 0)
|
|
45
|
+
return 0;
|
|
46
|
+
const stmtCheck = db.prepare('SELECT human_id FROM team_members WHERE human_id = ?');
|
|
47
|
+
const stmtInsert = db.prepare('INSERT INTO team_members (human_id, role, created_at, updated_at) VALUES (?, ?, ?, ?)');
|
|
48
|
+
const stmtLogChange = db.prepare('INSERT INTO role_change_log (id, target_human_id, changed_by, old_role, new_role, reason, created_at) VALUES (?, ?, ?, ?, ?, ?, ?)');
|
|
49
|
+
let seeded = 0;
|
|
50
|
+
const now = new Date().toISOString();
|
|
51
|
+
for (const entry of entries) {
|
|
52
|
+
const existing = stmtCheck.get(entry.humanId);
|
|
53
|
+
if (!existing) {
|
|
54
|
+
stmtInsert.run(entry.humanId, entry.role, now, now);
|
|
55
|
+
stmtLogChange.run(ulid(), entry.humanId, 'verbo-bootstrap', null, entry.role, 'Seeded from VERBO.md [team] section', now);
|
|
56
|
+
seeded++;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return seeded;
|
|
60
|
+
}
|
|
61
|
+
export function registerTeamCommand(program, getDeps) {
|
|
62
|
+
const team = program
|
|
63
|
+
.command('team')
|
|
64
|
+
.description('Manage team members and roles');
|
|
65
|
+
// ---- verbo team list ----
|
|
66
|
+
team
|
|
67
|
+
.command('list')
|
|
68
|
+
.description('List all team members and their roles')
|
|
69
|
+
.action(() => {
|
|
70
|
+
const { db } = getDeps();
|
|
71
|
+
const rows = db.prepare('SELECT human_id, role, created_at, updated_at FROM team_members ORDER BY role, human_id').all();
|
|
72
|
+
if (rows.length === 0) {
|
|
73
|
+
console.log('No team members registered. Add members with: verbo team invite <humanId> [--role <role>]');
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
const roleOrder = { owner: 0, lead: 1, developer: 2, viewer: 3 };
|
|
77
|
+
rows.sort((a, b) => (roleOrder[a.role] ?? 4) - (roleOrder[b.role] ?? 4));
|
|
78
|
+
console.log(`Team members (${rows.length}):\n`);
|
|
79
|
+
for (const row of rows) {
|
|
80
|
+
const badge = roleBadge(row.role);
|
|
81
|
+
console.log(` ${badge} ${row.human_id} (since ${row.created_at.slice(0, 10)})`);
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
// ---- verbo team invite <humanId> ----
|
|
85
|
+
team
|
|
86
|
+
.command('invite <humanId>')
|
|
87
|
+
.description('Add a team member')
|
|
88
|
+
.option('-r, --role <role>', 'Role: owner, lead, developer, viewer', 'developer')
|
|
89
|
+
.action((humanId, opts) => {
|
|
90
|
+
const role = opts.role.toLowerCase();
|
|
91
|
+
if (!VALID_ROLES.has(role)) {
|
|
92
|
+
console.error(`Invalid role: ${opts.role}. Must be one of: owner, lead, developer, viewer`);
|
|
93
|
+
process.exit(1);
|
|
94
|
+
}
|
|
95
|
+
const { rbacStore, auditLog } = getDeps();
|
|
96
|
+
rbacStore.setRole(humanId, role, 'cli', 'Invited via CLI');
|
|
97
|
+
console.log(`Invited ${humanId} as ${role}`);
|
|
98
|
+
if (auditLog) {
|
|
99
|
+
auditLog.append({
|
|
100
|
+
eventType: 'team.invite',
|
|
101
|
+
humanId,
|
|
102
|
+
details: { role, invitedBy: 'cli' },
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
// ---- verbo team role <humanId> <newRole> ----
|
|
107
|
+
team
|
|
108
|
+
.command('role <humanId> <newRole>')
|
|
109
|
+
.description('Change a team member\'s role')
|
|
110
|
+
.option('--reason <text>', 'Reason for the role change')
|
|
111
|
+
.action((humanId, newRole, opts) => {
|
|
112
|
+
const role = newRole.toLowerCase();
|
|
113
|
+
if (!VALID_ROLES.has(role)) {
|
|
114
|
+
console.error(`Invalid role: ${newRole}. Must be one of: owner, lead, developer, viewer`);
|
|
115
|
+
process.exit(1);
|
|
116
|
+
}
|
|
117
|
+
const { rbacStore, auditLog } = getDeps();
|
|
118
|
+
const oldRole = rbacStore.getRole(humanId);
|
|
119
|
+
rbacStore.setRole(humanId, role, 'cli', opts.reason);
|
|
120
|
+
console.log(`Changed ${humanId}: ${oldRole} -> ${role}`);
|
|
121
|
+
if (opts.reason) {
|
|
122
|
+
console.log(` Reason: ${opts.reason}`);
|
|
123
|
+
}
|
|
124
|
+
if (auditLog) {
|
|
125
|
+
auditLog.append({
|
|
126
|
+
eventType: 'team.role_change',
|
|
127
|
+
humanId,
|
|
128
|
+
details: { oldRole, newRole: role, reason: opts.reason ?? null },
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
// ---- verbo team log ----
|
|
133
|
+
team
|
|
134
|
+
.command('log')
|
|
135
|
+
.description('Show role change history')
|
|
136
|
+
.option('-n, --limit <count>', 'Number of entries to show', '20')
|
|
137
|
+
.option('--member <humanId>', 'Filter by team member')
|
|
138
|
+
.action((opts) => {
|
|
139
|
+
const { db } = getDeps();
|
|
140
|
+
const limit = parseInt(opts.limit, 10) || 20;
|
|
141
|
+
let sql = 'SELECT * FROM role_change_log';
|
|
142
|
+
const params = [];
|
|
143
|
+
if (opts.member) {
|
|
144
|
+
sql += ' WHERE target_human_id = ?';
|
|
145
|
+
params.push(opts.member);
|
|
146
|
+
}
|
|
147
|
+
sql += ' ORDER BY created_at DESC LIMIT ?';
|
|
148
|
+
params.push(limit);
|
|
149
|
+
const rows = db.prepare(sql).all(...params);
|
|
150
|
+
if (rows.length === 0) {
|
|
151
|
+
console.log('No role changes recorded.');
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
console.log('Role change history:\n');
|
|
155
|
+
for (const row of rows) {
|
|
156
|
+
const oldR = row.old_role ?? '(new)';
|
|
157
|
+
const ts = row.created_at.slice(0, 19).replace('T', ' ');
|
|
158
|
+
console.log(` ${ts} ${row.target_human_id}: ${oldR} -> ${row.new_role} by ${row.changed_by}`);
|
|
159
|
+
if (row.reason) {
|
|
160
|
+
console.log(` Reason: ${row.reason}`);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
// ---- Helpers ----
|
|
166
|
+
function roleBadge(role) {
|
|
167
|
+
switch (role) {
|
|
168
|
+
case 'owner': return '[OWNER] ';
|
|
169
|
+
case 'lead': return '[LEAD] ';
|
|
170
|
+
case 'developer': return '[DEVELOPER]';
|
|
171
|
+
case 'viewer': return '[VIEWER] ';
|
|
172
|
+
default: return `[${role.toUpperCase()}]`;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
//# sourceMappingURL=team.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"team.js","sourceRoot":"","sources":["../../../src/commands/team.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AA4B5B,MAAM,WAAW,GAAG,IAAI,GAAG,CAAO,CAAC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,QAAQ,CAAC,CAAC,CAAC;AAE5E;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,gBAAgB,CAAC,cAAsB;IACrD,MAAM,OAAO,GAAgB,EAAE,CAAC;IAChC,IAAI,aAAa,GAAG,KAAK,CAAC;IAE1B,KAAK,MAAM,IAAI,IAAI,cAAc,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;QAC9C,MAAM,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;QAC5C,IAAI,YAAY,EAAE,CAAC;YACjB,aAAa,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,KAAK,MAAM,CAAC;YAChE,SAAS;QACX,CAAC;QAED,IAAI,CAAC,aAAa;YAAE,SAAS;QAE7B,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAC;QACjD,IAAI,CAAC,OAAO;YAAE,SAAS;QAEvB,MAAM,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;QAClC,MAAM,IAAI,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI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IAC7B,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,OAAO,CAAC,CAAC,OAAO,aAAa,CAAC;QACnC,KAAK,MAAM,CAAC,CAAC,OAAO,aAAa,CAAC;QAClC,KAAK,WAAW,CAAC,CAAC,OAAO,aAAa,CAAC;QACvC,KAAK,QAAQ,CAAC,CAAC,OAAO,aAAa,CAAC;QACpC,OAAO,CAAC,CAAC,OAAO,IAAI,IAAI,CAAC,WAAW,EAAE,GAAG,CAAC;IAC5C,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { ProviderName } from '../agent/providers/types.js';
|
|
2
|
+
export interface ProviderConfig {
|
|
3
|
+
enabled: boolean;
|
|
4
|
+
binary?: string;
|
|
5
|
+
model?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface RoutingRule {
|
|
8
|
+
pattern: string;
|
|
9
|
+
provider: ProviderName;
|
|
10
|
+
priority?: 'p0' | 'p1' | 'p2' | 'p3';
|
|
11
|
+
}
|
|
12
|
+
export interface VerboProviderConfig {
|
|
13
|
+
version: string;
|
|
14
|
+
providers: {
|
|
15
|
+
default: ProviderName;
|
|
16
|
+
fallback?: ProviderName;
|
|
17
|
+
claude?: ProviderConfig;
|
|
18
|
+
openai?: ProviderConfig;
|
|
19
|
+
gemini?: ProviderConfig;
|
|
20
|
+
};
|
|
21
|
+
routing: RoutingRule[];
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Parse a VERBO.md string for a TOML frontmatter block.
|
|
25
|
+
* Returns `null` if no block is found or if the block is malformed.
|
|
26
|
+
*/
|
|
27
|
+
export declare function parseVerboConfig(markdownContent: string): VerboProviderConfig | null;
|
|
28
|
+
/**
|
|
29
|
+
* Determine which provider to use for a given task.
|
|
30
|
+
*
|
|
31
|
+
* Resolution order:
|
|
32
|
+
* 1. First routing rule whose pattern matches the task title AND (if the rule
|
|
33
|
+
* specifies a priority) whose priority matches the task priority AND whose
|
|
34
|
+
* provider is in the available set.
|
|
35
|
+
* 2. `providers.default` if available.
|
|
36
|
+
* 3. `providers.fallback` if available.
|
|
37
|
+
* 4. First provider in the available set (arbitrary order).
|
|
38
|
+
*/
|
|
39
|
+
export declare function resolveProvider(config: VerboProviderConfig, task: {
|
|
40
|
+
title: string;
|
|
41
|
+
priority: string;
|
|
42
|
+
}, available: ReadonlySet<ProviderName>): ProviderName;
|
|
43
|
+
//# sourceMappingURL=verbo-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verbo-config.d.ts","sourceRoot":"","sources":["../../../src/config/verbo-config.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAIhE,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,YAAY,CAAC;IACvB,QAAQ,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;CACtC;AAED,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE;QACT,OAAO,EAAE,YAAY,CAAC;QACtB,QAAQ,CAAC,EAAE,YAAY,CAAC;QACxB,MAAM,CAAC,EAAE,cAAc,CAAC;QACxB,MAAM,CAAC,EAAE,cAAc,CAAC;QACxB,MAAM,CAAC,EAAE,cAAc,CAAC;KACzB,CAAC;IACF,OAAO,EAAE,WAAW,EAAE,CAAC;CACxB;AAUD;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,eAAe,EAAE,MAAM,GAAG,mBAAmB,GAAG,IAAI,CAiEpF;AAID;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAC7B,MAAM,EAAE,mBAAmB,EAC3B,IAAI,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,EACzC,SAAS,EAAE,WAAW,CAAC,YAAY,CAAC,GACnC,YAAY,CAgBd"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { parse as parseTOML } from 'smol-toml';
|
|
2
|
+
// ── Parser ────────────────────────────────────────────────────────────────────
|
|
3
|
+
/** Extract the content of the first ```toml ... ``` block in markdown. */
|
|
4
|
+
function extractTomlBlock(markdown) {
|
|
5
|
+
const match = markdown.match(/```toml\r?\n([\s\S]*?)```/);
|
|
6
|
+
return match ? match[1] : null;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Parse a VERBO.md string for a TOML frontmatter block.
|
|
10
|
+
* Returns `null` if no block is found or if the block is malformed.
|
|
11
|
+
*/
|
|
12
|
+
export function parseVerboConfig(markdownContent) {
|
|
13
|
+
const tomlContent = extractTomlBlock(markdownContent);
|
|
14
|
+
if (!tomlContent)
|
|
15
|
+
return null;
|
|
16
|
+
let raw;
|
|
17
|
+
try {
|
|
18
|
+
raw = parseTOML(tomlContent);
|
|
19
|
+
}
|
|
20
|
+
catch {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
const verboSection = raw['verbo'] ?? {};
|
|
24
|
+
const version = typeof verboSection['version'] === 'string' ? verboSection['version'] : '1';
|
|
25
|
+
const providersSection = raw['providers'] ?? {};
|
|
26
|
+
const defaultProvider = providersSection['default'] ?? 'claude';
|
|
27
|
+
const fallback = providersSection['fallback'];
|
|
28
|
+
function parseProviderConfig(key) {
|
|
29
|
+
const section = providersSection[key];
|
|
30
|
+
if (!section || typeof section !== 'object')
|
|
31
|
+
return undefined;
|
|
32
|
+
const s = section;
|
|
33
|
+
return {
|
|
34
|
+
enabled: typeof s['enabled'] === 'boolean' ? s['enabled'] : true,
|
|
35
|
+
...(typeof s['binary'] === 'string' ? { binary: s['binary'] } : {}),
|
|
36
|
+
...(typeof s['model'] === 'string' ? { model: s['model'] } : {}),
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
const routing = [];
|
|
40
|
+
const rawRouting = raw['routing'];
|
|
41
|
+
if (Array.isArray(rawRouting)) {
|
|
42
|
+
for (const rule of rawRouting) {
|
|
43
|
+
if (!rule || typeof rule !== 'object')
|
|
44
|
+
continue;
|
|
45
|
+
const r = rule;
|
|
46
|
+
if (typeof r['pattern'] !== 'string' || typeof r['provider'] !== 'string')
|
|
47
|
+
continue;
|
|
48
|
+
const routingRule = {
|
|
49
|
+
pattern: r['pattern'],
|
|
50
|
+
provider: r['provider'],
|
|
51
|
+
};
|
|
52
|
+
if (typeof r['priority'] === 'string') {
|
|
53
|
+
routingRule.priority = r['priority'];
|
|
54
|
+
}
|
|
55
|
+
routing.push(routingRule);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return {
|
|
59
|
+
version,
|
|
60
|
+
providers: {
|
|
61
|
+
default: defaultProvider,
|
|
62
|
+
...(fallback !== undefined ? { fallback } : {}),
|
|
63
|
+
...(() => {
|
|
64
|
+
const out = {};
|
|
65
|
+
const c = parseProviderConfig('claude');
|
|
66
|
+
const o = parseProviderConfig('openai');
|
|
67
|
+
const g = parseProviderConfig('gemini');
|
|
68
|
+
if (c)
|
|
69
|
+
out.claude = c;
|
|
70
|
+
if (o)
|
|
71
|
+
out.openai = o;
|
|
72
|
+
if (g)
|
|
73
|
+
out.gemini = g;
|
|
74
|
+
return out;
|
|
75
|
+
})(),
|
|
76
|
+
},
|
|
77
|
+
routing,
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
// ── Routing resolver ──────────────────────────────────────────────────────────
|
|
81
|
+
/**
|
|
82
|
+
* Determine which provider to use for a given task.
|
|
83
|
+
*
|
|
84
|
+
* Resolution order:
|
|
85
|
+
* 1. First routing rule whose pattern matches the task title AND (if the rule
|
|
86
|
+
* specifies a priority) whose priority matches the task priority AND whose
|
|
87
|
+
* provider is in the available set.
|
|
88
|
+
* 2. `providers.default` if available.
|
|
89
|
+
* 3. `providers.fallback` if available.
|
|
90
|
+
* 4. First provider in the available set (arbitrary order).
|
|
91
|
+
*/
|
|
92
|
+
export function resolveProvider(config, task, available) {
|
|
93
|
+
for (const rule of config.routing) {
|
|
94
|
+
if (!available.has(rule.provider))
|
|
95
|
+
continue;
|
|
96
|
+
if (rule.priority !== undefined && rule.priority !== task.priority)
|
|
97
|
+
continue;
|
|
98
|
+
if (!new RegExp(rule.pattern).test(task.title))
|
|
99
|
+
continue;
|
|
100
|
+
return rule.provider;
|
|
101
|
+
}
|
|
102
|
+
if (available.has(config.providers.default))
|
|
103
|
+
return config.providers.default;
|
|
104
|
+
if (config.providers.fallback && available.has(config.providers.fallback)) {
|
|
105
|
+
return config.providers.fallback;
|
|
106
|
+
}
|
|
107
|
+
// Last resort: pick whatever is available
|
|
108
|
+
const [first] = available;
|
|
109
|
+
return first;
|
|
110
|
+
}
|
|
111
|
+
//# sourceMappingURL=verbo-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verbo-config.js","sourceRoot":"","sources":["../../../src/config/verbo-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,WAAW,CAAC;AA6B/C,iFAAiF;AAEjF,0EAA0E;AAC1E,SAAS,gBAAgB,CAAC,QAAgB;IACxC,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,2BAA2B,CAAC,CAAC;IAC1D,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AACjC,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,gBAAgB,CAAC,eAAuB;IACtD,MAAM,WAAW,GAAG,gBAAgB,CAAC,eAAe,CAAC,CAAC;IACtD,IAAI,CAAC,WAAW;QAAE,OAAO,IAAI,CAAC;IAE9B,IAAI,GAA4B,CAAC;IACjC,IAAI,CAAC;QACH,GAAG,GAAG,SAA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|
+
humanId: string;
|
|
6
|
+
pid: number | null;
|
|
7
|
+
worktreePath: string | null;
|
|
8
|
+
worktreeBranch: string | null;
|
|
9
|
+
status: 'starting' | 'active' | 'stalled' | 'completed' | 'errored';
|
|
10
|
+
startedAt: string;
|
|
11
|
+
lastHeartbeat: string | null;
|
|
12
|
+
completionSummary: string | null;
|
|
13
|
+
funName: string | null;
|
|
14
|
+
funTagline: string | null;
|
|
15
|
+
personaName: string | null;
|
|
16
|
+
parentSessionId: string | null;
|
|
17
|
+
provider: string;
|
|
18
|
+
}
|
|
19
|
+
export interface CreateSessionInput {
|
|
20
|
+
taskId: string;
|
|
21
|
+
humanId: string;
|
|
22
|
+
pid?: number;
|
|
23
|
+
worktreePath?: string;
|
|
24
|
+
worktreeBranch?: string;
|
|
25
|
+
provider?: string;
|
|
26
|
+
}
|
|
27
|
+
export interface UpdateSessionInput {
|
|
28
|
+
pid?: number;
|
|
29
|
+
worktreePath?: string;
|
|
30
|
+
worktreeBranch?: string;
|
|
31
|
+
status?: AgentSession['status'];
|
|
32
|
+
funName?: string;
|
|
33
|
+
funTagline?: string;
|
|
34
|
+
personaName?: string;
|
|
35
|
+
parentSessionId?: string;
|
|
36
|
+
}
|
|
37
|
+
export interface AgentSessionStore {
|
|
38
|
+
create(input: CreateSessionInput): AgentSession;
|
|
39
|
+
get(id: string): AgentSession | null;
|
|
40
|
+
update(id: string, input: UpdateSessionInput): AgentSession | null;
|
|
41
|
+
heartbeat(id: string): AgentSession | null;
|
|
42
|
+
complete(id: string, summary: string): AgentSession | null;
|
|
43
|
+
error(id: string): AgentSession | null;
|
|
44
|
+
findStalled(timeoutMinutes: number): AgentSession[];
|
|
45
|
+
listByHuman(humanId: string): AgentSession[];
|
|
46
|
+
listActive(): AgentSession[];
|
|
47
|
+
delete(id: string): void;
|
|
48
|
+
}
|
|
49
|
+
interface AgentSessionRow {
|
|
50
|
+
id: string;
|
|
51
|
+
task_id: string;
|
|
52
|
+
human_id: string;
|
|
53
|
+
pid: number | null;
|
|
54
|
+
worktree_path: string | null;
|
|
55
|
+
worktree_branch: string | null;
|
|
56
|
+
status: string;
|
|
57
|
+
started_at: string;
|
|
58
|
+
last_heartbeat: string | null;
|
|
59
|
+
completion_summary: string | null;
|
|
60
|
+
fun_name: string | null;
|
|
61
|
+
fun_tagline: string | null;
|
|
62
|
+
persona_name: string | null;
|
|
63
|
+
parent_session_id: string | null;
|
|
64
|
+
provider: string | null;
|
|
65
|
+
}
|
|
66
|
+
export declare function rowToSession(row: AgentSessionRow): AgentSession;
|
|
67
|
+
export declare function createAgentSessionStore(db: VerboDatabase): AgentSessionStore;
|
|
68
|
+
export {};
|
|
69
|
+
//# sourceMappingURL=agent-session-store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-session-store.d.ts","sourceRoot":"","sources":["../../../src/core/agent-session-store.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAIvD,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,MAAM,EAAE,UAAU,GAAG,QAAQ,GAAG,SAAS,GAAG,WAAW,GAAG,SAAS,CAAC;IACpE,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B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AC7B,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAID,UAAU,eAAe;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB;AAID,wBAAgB,YAAY,CAAC,GAAG,EAAE,eAAe,GAAG,YAAY,CAkB/D;AAID,wBAAgB,uBAAuB,CAAC,EAAE,EAAE,aAAa,GAAG,iBAAiB,CA+K5E"}
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import { ulid } from 'ulid';
|
|
2
|
+
// ---- Helper: row -> AgentSession ----
|
|
3
|
+
export function rowToSession(row) {
|
|
4
|
+
return {
|
|
5
|
+
id: row.id,
|
|
6
|
+
taskId: row.task_id,
|
|
7
|
+
humanId: row.human_id,
|
|
8
|
+
pid: row.pid ?? null,
|
|
9
|
+
worktreePath: row.worktree_path ?? null,
|
|
10
|
+
worktreeBranch: row.worktree_branch ?? null,
|
|
11
|
+
status: row.status,
|
|
12
|
+
startedAt: row.started_at,
|
|
13
|
+
lastHeartbeat: row.last_heartbeat ?? null,
|
|
14
|
+
completionSummary: row.completion_summary ?? null,
|
|
15
|
+
funName: row.fun_name ?? null,
|
|
16
|
+
funTagline: row.fun_tagline ?? null,
|
|
17
|
+
personaName: row.persona_name ?? null,
|
|
18
|
+
parentSessionId: row.parent_session_id ?? null,
|
|
19
|
+
provider: row.provider ?? 'claude',
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
// ---- Factory ----
|
|
23
|
+
export function createAgentSessionStore(db) {
|
|
24
|
+
const raw = db.raw();
|
|
25
|
+
const stmtInsert = raw.prepare(`
|
|
26
|
+
INSERT INTO agent_sessions (
|
|
27
|
+
id, task_id, human_id, pid, worktree_path, worktree_branch,
|
|
28
|
+
status, started_at, last_heartbeat, completion_summary, provider
|
|
29
|
+
) VALUES (
|
|
30
|
+
@id, @task_id, @human_id, @pid, @worktree_path, @worktree_branch,
|
|
31
|
+
@status, @started_at, @last_heartbeat, @completion_summary, @provider
|
|
32
|
+
)
|
|
33
|
+
`);
|
|
34
|
+
const stmtGetById = raw.prepare('SELECT * FROM agent_sessions WHERE id = ?');
|
|
35
|
+
const stmtDelete = raw.prepare('DELETE FROM agent_sessions WHERE id = ?');
|
|
36
|
+
function create(input) {
|
|
37
|
+
const now = new Date().toISOString();
|
|
38
|
+
const id = ulid();
|
|
39
|
+
const row = {
|
|
40
|
+
id,
|
|
41
|
+
task_id: input.taskId,
|
|
42
|
+
human_id: input.humanId,
|
|
43
|
+
pid: input.pid ?? null,
|
|
44
|
+
worktree_path: input.worktreePath ?? null,
|
|
45
|
+
worktree_branch: input.worktreeBranch ?? null,
|
|
46
|
+
status: 'starting',
|
|
47
|
+
started_at: now,
|
|
48
|
+
last_heartbeat: null,
|
|
49
|
+
completion_summary: null,
|
|
50
|
+
provider: input.provider ?? 'claude',
|
|
51
|
+
};
|
|
52
|
+
stmtInsert.run(row);
|
|
53
|
+
return get(id);
|
|
54
|
+
}
|
|
55
|
+
function get(id) {
|
|
56
|
+
const row = stmtGetById.get(id);
|
|
57
|
+
if (!row)
|
|
58
|
+
return null;
|
|
59
|
+
return rowToSession(row);
|
|
60
|
+
}
|
|
61
|
+
function update(id, input) {
|
|
62
|
+
const existing = get(id);
|
|
63
|
+
if (!existing)
|
|
64
|
+
return null;
|
|
65
|
+
const sets = [];
|
|
66
|
+
const values = [];
|
|
67
|
+
if (input.pid !== undefined) {
|
|
68
|
+
sets.push('pid = ?');
|
|
69
|
+
values.push(input.pid);
|
|
70
|
+
}
|
|
71
|
+
if (input.worktreePath !== undefined) {
|
|
72
|
+
sets.push('worktree_path = ?');
|
|
73
|
+
values.push(input.worktreePath);
|
|
74
|
+
}
|
|
75
|
+
if (input.worktreeBranch !== undefined) {
|
|
76
|
+
sets.push('worktree_branch = ?');
|
|
77
|
+
values.push(input.worktreeBranch);
|
|
78
|
+
}
|
|
79
|
+
if (input.status !== undefined) {
|
|
80
|
+
sets.push('status = ?');
|
|
81
|
+
values.push(input.status);
|
|
82
|
+
}
|
|
83
|
+
if (input.funName !== undefined) {
|
|
84
|
+
sets.push('fun_name = ?');
|
|
85
|
+
values.push(input.funName);
|
|
86
|
+
}
|
|
87
|
+
if (input.funTagline !== undefined) {
|
|
88
|
+
sets.push('fun_tagline = ?');
|
|
89
|
+
values.push(input.funTagline);
|
|
90
|
+
}
|
|
91
|
+
if (input.personaName !== undefined) {
|
|
92
|
+
sets.push('persona_name = ?');
|
|
93
|
+
values.push(input.personaName);
|
|
94
|
+
}
|
|
95
|
+
if (input.parentSessionId !== undefined) {
|
|
96
|
+
sets.push('parent_session_id = ?');
|
|
97
|
+
values.push(input.parentSessionId);
|
|
98
|
+
}
|
|
99
|
+
if (sets.length > 0) {
|
|
100
|
+
values.push(id);
|
|
101
|
+
raw.prepare(`UPDATE agent_sessions SET ${sets.join(', ')} WHERE id = ?`).run(...values);
|
|
102
|
+
}
|
|
103
|
+
return get(id);
|
|
104
|
+
}
|
|
105
|
+
function heartbeat(id) {
|
|
106
|
+
const existing = get(id);
|
|
107
|
+
if (!existing)
|
|
108
|
+
return null;
|
|
109
|
+
const now = new Date().toISOString();
|
|
110
|
+
raw
|
|
111
|
+
.prepare(`UPDATE agent_sessions SET last_heartbeat = ?, status = ? WHERE id = ?`)
|
|
112
|
+
.run(now, 'active', id);
|
|
113
|
+
return get(id);
|
|
114
|
+
}
|
|
115
|
+
function complete(id, summary) {
|
|
116
|
+
const existing = get(id);
|
|
117
|
+
if (!existing)
|
|
118
|
+
return null;
|
|
119
|
+
raw
|
|
120
|
+
.prepare(`UPDATE agent_sessions SET status = 'completed', completion_summary = ? WHERE id = ?`)
|
|
121
|
+
.run(summary, id);
|
|
122
|
+
return get(id);
|
|
123
|
+
}
|
|
124
|
+
function error(id) {
|
|
125
|
+
const existing = get(id);
|
|
126
|
+
if (!existing)
|
|
127
|
+
return null;
|
|
128
|
+
raw
|
|
129
|
+
.prepare(`UPDATE agent_sessions SET status = 'errored' WHERE id = ?`)
|
|
130
|
+
.run(id);
|
|
131
|
+
return get(id);
|
|
132
|
+
}
|
|
133
|
+
function findStalled(timeoutMinutes) {
|
|
134
|
+
const cutoff = new Date(Date.now() - timeoutMinutes * 60 * 1000).toISOString();
|
|
135
|
+
const rows = raw
|
|
136
|
+
.prepare(`SELECT * FROM agent_sessions WHERE status = 'active' AND last_heartbeat < ?`)
|
|
137
|
+
.all(cutoff);
|
|
138
|
+
return rows.map(rowToSession);
|
|
139
|
+
}
|
|
140
|
+
function listByHuman(humanId) {
|
|
141
|
+
const rows = raw
|
|
142
|
+
.prepare(`SELECT * FROM agent_sessions WHERE human_id = ? AND status IN ('starting', 'active', 'stalled') ORDER BY parent_session_id NULLS FIRST, started_at ASC`)
|
|
143
|
+
.all(humanId);
|
|
144
|
+
return rows.map(rowToSession);
|
|
145
|
+
}
|
|
146
|
+
function listActive() {
|
|
147
|
+
const rows = raw
|
|
148
|
+
.prepare(`SELECT * FROM agent_sessions WHERE status IN ('starting', 'active', 'stalled') ORDER BY parent_session_id NULLS FIRST, started_at ASC`)
|
|
149
|
+
.all();
|
|
150
|
+
return rows.map(rowToSession);
|
|
151
|
+
}
|
|
152
|
+
function deleteSession(id) {
|
|
153
|
+
stmtDelete.run(id);
|
|
154
|
+
}
|
|
155
|
+
return {
|
|
156
|
+
create,
|
|
157
|
+
get,
|
|
158
|
+
update,
|
|
159
|
+
heartbeat,
|
|
160
|
+
complete,
|
|
161
|
+
error,
|
|
162
|
+
findStalled,
|
|
163
|
+
listByHuman,
|
|
164
|
+
listActive,
|
|
165
|
+
delete: deleteSession,
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
//# sourceMappingURL=agent-session-store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-session-store.js","sourceRoot":"","sources":["../../../src/core/agent-session-store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AA4E5B,wCAAwC;AAExC,MAAM,UAAU,YAAY,CAAC,GAAoB;IAC/C,OAAO;QACL,EAAE,EAAE,GAAG,CAAC,EAAE;QACV,MAAM,EAAE,GAAG,CAAC,OAAO;QACnB,OAAO,EAAE,GAAG,CAAC,QAAQ;QACrB,GAAG,EAAE,GAAG,CAAC,GAAG,IAAI,IAAI;QACpB,YAAY,EAAE,GAAG,CAAC,aAAa,IAAI,IAAI;QACvC,cAAc,EAAE,GAAG,CAAC,eAAe,IAAI,IAAI;QAC3C,MAAM,EAAE,GAAG,CAAC,MAAgC;QAC5C,SAAS,EAAE,GAAG,CAAC,UAAU;QACzB,aAAa,EAAE,GAAG,CAAC,cAAc,IAAI,IAAI;QACzC,iBAAiB,EAAE,GAAG,CAAC,kBAAkB,IAAI,IAAI;QACjD,OAAO,EAAE,GAAG,CAAC,QAAQ,IAAI,IAAI;QAC7B,UAAU,EAAE,GAAG,CAAC,WAAW,IAAI,IAAI;QACnC,WAAW,EAAE,GAAG,CAAC,YAAY,IAAI,IAAI;QACrC,eAAe,EAAE,GAAG,CAAC,iBAAiB,IAAI,IAAI;QAC9C,QAAQ,EAAE,GAAG,CAAC,QAAQ,IAAI,QA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ACX,WAAW;QACX,UAAU;QACV,MAAM,EAAE,aAAa;KACtB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { VerboDatabase } from '../db/database.js';
|
|
2
|
+
export interface AuditLogEntry {
|
|
3
|
+
id: string;
|
|
4
|
+
timestamp: string;
|
|
5
|
+
eventType: string;
|
|
6
|
+
agentSessionId: string | null;
|
|
7
|
+
taskId: string | null;
|
|
8
|
+
humanId: string | null;
|
|
9
|
+
details: Record<string, unknown>;
|
|
10
|
+
}
|
|
11
|
+
export interface AppendInput {
|
|
12
|
+
eventType: string;
|
|
13
|
+
agentSessionId?: string;
|
|
14
|
+
taskId?: string;
|
|
15
|
+
humanId?: string;
|
|
16
|
+
details?: Record<string, unknown>;
|
|
17
|
+
}
|
|
18
|
+
export interface AuditLogFilter {
|
|
19
|
+
eventType?: string;
|
|
20
|
+
agentSessionId?: string;
|
|
21
|
+
taskId?: string;
|
|
22
|
+
humanId?: string;
|
|
23
|
+
since?: string;
|
|
24
|
+
until?: string;
|
|
25
|
+
}
|
|
26
|
+
export type ExportFormat = 'json' | 'csv';
|
|
27
|
+
export interface AuditLogStore {
|
|
28
|
+
append(input: AppendInput): AuditLogEntry;
|
|
29
|
+
query(filter?: AuditLogFilter): AuditLogEntry[];
|
|
30
|
+
export(filter: AuditLogFilter, format: ExportFormat): string;
|
|
31
|
+
}
|
|
32
|
+
export declare function createAuditLogStore(db: VerboDatabase): AuditLogStore;
|
|
33
|
+
//# sourceMappingURL=audit-log-store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"audit-log-store.d.ts","sourceRoot":"","sources":["../../../src/core/audit-log-store.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAIvD,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM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