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,90 @@
|
|
|
1
|
+
import http from 'http';
|
|
2
|
+
// ---- Factory ----
|
|
3
|
+
export async function createApprovalServer(options) {
|
|
4
|
+
let yoloMode = false;
|
|
5
|
+
const pollInterval = options.pollIntervalMs ?? 500;
|
|
6
|
+
const timeout = options.timeoutMs ?? 300000;
|
|
7
|
+
// Helper: build Claude Code PreToolUse hook response
|
|
8
|
+
function hookResponse(decision, reason) {
|
|
9
|
+
return {
|
|
10
|
+
hookSpecificOutput: {
|
|
11
|
+
hookEventName: 'PreToolUse',
|
|
12
|
+
permissionDecision: decision,
|
|
13
|
+
permissionDecisionReason: reason,
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
const server = http.createServer(async (req, res) => {
|
|
18
|
+
if (req.method === 'POST' && req.url === '/hooks') {
|
|
19
|
+
// Read body
|
|
20
|
+
const chunks = [];
|
|
21
|
+
for await (const chunk of req)
|
|
22
|
+
chunks.push(chunk);
|
|
23
|
+
const body = JSON.parse(Buffer.concat(chunks).toString());
|
|
24
|
+
// YOLO mode: auto-approve everything
|
|
25
|
+
if (yoloMode) {
|
|
26
|
+
res.writeHead(200, { 'Content-Type': 'application/json' });
|
|
27
|
+
res.end(JSON.stringify(hookResponse('allow', 'YOLO mode')));
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
// If sessions store is available, only gate Verbo-managed agents.
|
|
31
|
+
// Unknown agents (e.g. user's own Claude Code) get auto-approved
|
|
32
|
+
// so we don't block them with phantom approval requests.
|
|
33
|
+
if (options.sessions) {
|
|
34
|
+
const sessionId = body.session_id;
|
|
35
|
+
const isVerboAgent = sessionId && options.sessions.get(sessionId) !== null;
|
|
36
|
+
if (!isVerboAgent) {
|
|
37
|
+
res.writeHead(200, { 'Content-Type': 'application/json' });
|
|
38
|
+
res.end(JSON.stringify(hookResponse('allow', 'Not a Verbo-managed agent')));
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
// Create approval request from Claude Code hook payload
|
|
43
|
+
const approval = options.approvals.create({
|
|
44
|
+
agentName: body.agent_type || body.agent_id || body.session_id || 'unknown',
|
|
45
|
+
agentSessionId: body.session_id || undefined,
|
|
46
|
+
toolName: body.tool_name || 'unknown',
|
|
47
|
+
toolInput: body.tool_input || {},
|
|
48
|
+
});
|
|
49
|
+
// Terminal bell: human action requested
|
|
50
|
+
process.stderr.write('\x07');
|
|
51
|
+
// Poll until resolved or timeout
|
|
52
|
+
const startTime = Date.now();
|
|
53
|
+
while (Date.now() - startTime < timeout) {
|
|
54
|
+
// Re-check YOLO in case it was toggled after this request arrived
|
|
55
|
+
if (yoloMode) {
|
|
56
|
+
options.approvals.approve(approval.id);
|
|
57
|
+
res.writeHead(200, { 'Content-Type': 'application/json' });
|
|
58
|
+
res.end(JSON.stringify(hookResponse('allow', 'YOLO mode')));
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
const current = options.approvals.get(approval.id);
|
|
62
|
+
if (current && current.status !== 'pending') {
|
|
63
|
+
res.writeHead(200, { 'Content-Type': 'application/json' });
|
|
64
|
+
res.end(JSON.stringify(hookResponse(current.status === 'approved' ? 'allow' : 'deny', current.status === 'approved' ? 'Approved in Verbo' : 'Denied in Verbo')));
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
await new Promise(resolve => setTimeout(resolve, pollInterval));
|
|
68
|
+
}
|
|
69
|
+
// Timeout: deny by default
|
|
70
|
+
options.approvals.deny(approval.id);
|
|
71
|
+
res.writeHead(200, { 'Content-Type': 'application/json' });
|
|
72
|
+
res.end(JSON.stringify(hookResponse('deny', 'Approval timed out')));
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
// Health check or unknown route
|
|
76
|
+
res.writeHead(200, { 'Content-Type': 'application/json' });
|
|
77
|
+
res.end(JSON.stringify({ status: 'ok', yoloMode }));
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
// Start server
|
|
81
|
+
await new Promise(resolve => server.listen(options.port, '127.0.0.1', resolve));
|
|
82
|
+
const address = server.address();
|
|
83
|
+
return {
|
|
84
|
+
port: () => address.port,
|
|
85
|
+
isYoloMode: () => yoloMode,
|
|
86
|
+
setYoloMode: (enabled) => { yoloMode = enabled; },
|
|
87
|
+
stop: () => new Promise(resolve => server.close(() => resolve())),
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
//# sourceMappingURL=approval-server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"approval-server.js","sourceRoot":"","sources":["../../../src/approval/approval-server.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AAqBxB,oBAAoB;AAEpB,MAAM,CAAC,KAAK,UAAU,oBAAoB,CAAC,OAA8B;IACvE,IAAI,QAAQ,GAAG,KAAK,CAAC;IACrB,MAAM,YAAY,GAAG,OAAO,CAAC,cAAc,IAAI,GAAG,CAAC;IACnD,MAAM,OAAO,GAAG,OAAO,CAAC,SAAS,IAAI,MAAM,CAAC;IAE5C,qDAAqD;IACrD,SAAS,YAAY,CAAC,QAA0B,EAAE,MAAc;QAC9D,OAAO;YACL,kBAAkB,EAAE;gBAClB,aAAa,EAAE,YAAY;gBAC3B,kBAAkB,EAAE,QAAQ;gBAC5B,wBAAwB,EAAE,MAAM;aACjC;SACF,CAAC;IACJ,CAAC;IAED,MAAM,MAAM,GAAG,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE;QAClD,IAAI,GAAG,CAAC,MAAM,KAAK,MAAM,IAAI,GAAG,CAAC,GAAG,KAAK,QAAQ,EAAE,CAAC;YAClD,YAAY;YACZ,MAAM,MAAM,GAAa,EAAE,CAAC;YAC5B,IAAI,KAAK,EAAE,MAAM,KAAK,IAAI,GAAG;gBAAE,MAAM,CAAC,IAAI,CAAC,KAAe,CAAC,CAAC;YAC5D,MAA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
|
+
agentSessionId: string | null;
|
|
5
|
+
agentName: string;
|
|
6
|
+
toolName: string;
|
|
7
|
+
toolInput: Record<string, unknown>;
|
|
8
|
+
status: 'pending' | 'approved' | 'denied';
|
|
9
|
+
createdAt: string;
|
|
10
|
+
resolvedAt: string | null;
|
|
11
|
+
}
|
|
12
|
+
export interface CreateApprovalInput {
|
|
13
|
+
agentSessionId?: string;
|
|
14
|
+
agentName: string;
|
|
15
|
+
toolName: string;
|
|
16
|
+
toolInput: Record<string, unknown>;
|
|
17
|
+
}
|
|
18
|
+
export interface ApprovalStore {
|
|
19
|
+
create(input: CreateApprovalInput): ApprovalRequest;
|
|
20
|
+
get(id: string): ApprovalRequest | null;
|
|
21
|
+
approve(id: string): ApprovalRequest;
|
|
22
|
+
deny(id: string): ApprovalRequest;
|
|
23
|
+
listPending(): ApprovalRequest[];
|
|
24
|
+
listResolved(limit?: number): ApprovalRequest[];
|
|
25
|
+
deleteBySession(agentSessionId: string): void;
|
|
26
|
+
cleanup(): void;
|
|
27
|
+
}
|
|
28
|
+
export declare function createApprovalStore(db: VerboDatabase): ApprovalStore;
|
|
29
|
+
//# sourceMappingURL=approval-store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"approval-store.d.ts","sourceRoot":"","sources":["../../../src/approval/approval-store.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAIvD,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,MAAM,EAAE,SAAS,GAAG,UAAU,GAAG,QAAQ,CAAC;IAC1C,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B;AAED,MAAM,WAAW,mBAAmB;IAClC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC;AAED,MAAM,WAAW,aAAa;IAC5B,MAAM,CAAC,KAAK,EAAE,mBAAmB,GAAG,eAAe,CAAC;IACpD,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,eAAe,GAAG,IAAI,CAAC;IACxC,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,eAAe,CAAC;IACrC,IAAI,CAAC,EAAE,EAAE,MAAM,GAAG,eAAe,CAAC;IAClC,WAAW,IAAI,eAAe,EAAE,CAAC;IACjC,YAAY,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,eAAe,EAAE,CAAC;IAChD,eAAe,CAAC,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9C,OAAO,IAAI,IAAI,CAAC;CACjB;AAgCD,wBAAgB,mBAAmB,CAAC,EAAE,EAAE,aAAa,GAAG,aAAa,CAsGpE"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { ulid } from 'ulid';
|
|
2
|
+
// ---- Helper: row -> ApprovalRequest ----
|
|
3
|
+
function rowToApproval(row) {
|
|
4
|
+
return {
|
|
5
|
+
id: row.id,
|
|
6
|
+
agentSessionId: row.agent_session_id,
|
|
7
|
+
agentName: row.agent_name,
|
|
8
|
+
toolName: row.tool_name,
|
|
9
|
+
toolInput: JSON.parse(row.tool_input ?? '{}'),
|
|
10
|
+
status: row.status,
|
|
11
|
+
createdAt: row.created_at,
|
|
12
|
+
resolvedAt: row.resolved_at,
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
// ---- Factory ----
|
|
16
|
+
export function createApprovalStore(db) {
|
|
17
|
+
const raw = db.raw();
|
|
18
|
+
const stmtInsert = raw.prepare(`
|
|
19
|
+
INSERT INTO approval_requests (
|
|
20
|
+
id, agent_session_id, agent_name, tool_name, tool_input,
|
|
21
|
+
status, created_at, resolved_at
|
|
22
|
+
) VALUES (
|
|
23
|
+
@id, @agent_session_id, @agent_name, @tool_name, @tool_input,
|
|
24
|
+
@status, @created_at, @resolved_at
|
|
25
|
+
)
|
|
26
|
+
`);
|
|
27
|
+
const stmtGetById = raw.prepare('SELECT * FROM approval_requests WHERE id = ?');
|
|
28
|
+
const stmtListPending = raw.prepare("SELECT * FROM approval_requests WHERE status = 'pending' ORDER BY created_at ASC");
|
|
29
|
+
const stmtResolve = raw.prepare(`
|
|
30
|
+
UPDATE approval_requests
|
|
31
|
+
SET status = @status, resolved_at = @resolved_at
|
|
32
|
+
WHERE id = @id
|
|
33
|
+
`);
|
|
34
|
+
const stmtCleanup = raw.prepare("DELETE FROM approval_requests WHERE status != 'pending'");
|
|
35
|
+
const stmtListResolved = raw.prepare("SELECT * FROM approval_requests WHERE status IN ('approved', 'denied') ORDER BY resolved_at DESC LIMIT ?");
|
|
36
|
+
const stmtDeleteBySession = raw.prepare("DELETE FROM approval_requests WHERE agent_session_id = ? AND status = 'pending'");
|
|
37
|
+
function create(input) {
|
|
38
|
+
const now = new Date().toISOString();
|
|
39
|
+
const id = ulid();
|
|
40
|
+
const row = {
|
|
41
|
+
id,
|
|
42
|
+
agent_session_id: input.agentSessionId ?? null,
|
|
43
|
+
agent_name: input.agentName,
|
|
44
|
+
tool_name: input.toolName,
|
|
45
|
+
tool_input: JSON.stringify(input.toolInput),
|
|
46
|
+
status: 'pending',
|
|
47
|
+
created_at: now,
|
|
48
|
+
resolved_at: null,
|
|
49
|
+
};
|
|
50
|
+
stmtInsert.run(row);
|
|
51
|
+
return get(id);
|
|
52
|
+
}
|
|
53
|
+
function get(id) {
|
|
54
|
+
const row = stmtGetById.get(id);
|
|
55
|
+
if (!row)
|
|
56
|
+
return null;
|
|
57
|
+
return rowToApproval(row);
|
|
58
|
+
}
|
|
59
|
+
function approve(id) {
|
|
60
|
+
const now = new Date().toISOString();
|
|
61
|
+
stmtResolve.run({ id, status: 'approved', resolved_at: now });
|
|
62
|
+
return get(id);
|
|
63
|
+
}
|
|
64
|
+
function deny(id) {
|
|
65
|
+
const now = new Date().toISOString();
|
|
66
|
+
stmtResolve.run({ id, status: 'denied', resolved_at: now });
|
|
67
|
+
return get(id);
|
|
68
|
+
}
|
|
69
|
+
function listPending() {
|
|
70
|
+
const rows = stmtListPending.all();
|
|
71
|
+
return rows.map(rowToApproval);
|
|
72
|
+
}
|
|
73
|
+
function listResolved(limit = 50) {
|
|
74
|
+
const rows = stmtListResolved.all(limit);
|
|
75
|
+
return rows.map(rowToApproval);
|
|
76
|
+
}
|
|
77
|
+
function deleteBySession(agentSessionId) {
|
|
78
|
+
stmtDeleteBySession.run(agentSessionId);
|
|
79
|
+
}
|
|
80
|
+
function cleanup() {
|
|
81
|
+
stmtCleanup.run();
|
|
82
|
+
}
|
|
83
|
+
return {
|
|
84
|
+
create,
|
|
85
|
+
get,
|
|
86
|
+
approve,
|
|
87
|
+
deny,
|
|
88
|
+
listPending,
|
|
89
|
+
listResolved,
|
|
90
|
+
deleteBySession,
|
|
91
|
+
cleanup,
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=approval-store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"approval-store.js","sourceRoot":"","sources":["../../../src/approval/approval-store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AA+C5B,2CAA2C;AAE3C,SAAS,aAAa,CAAC,GAAuB;IAC5C,OAAO;QACL,EAAE,EAAE,GAAG,CAAC,EAAE;QACV,cAAc,EAAE,GAAG,CAAC,gBAAgB;QACpC,SAAS,EAAE,GAAG,CAAC,UAAU;QACzB,QAAQ,EAAE,GAAG,CAAC,SAAS;QACvB,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,U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AAO;QACd,WAAW,CAAC,GAAG,EAAE,CAAC;IACpB,CAAC;IAED,OAAO;QACL,MAAM;QACN,GAAG;QACH,OAAO;QACP,IAAI;QACJ,WAAW;QACX,YAAY;QACZ,eAAe;QACf,OAAO;KACR,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface AuthLimits {
|
|
2
|
+
maxAgents: number;
|
|
3
|
+
maxTasks: number;
|
|
4
|
+
maxProjects: number;
|
|
5
|
+
}
|
|
6
|
+
export interface AuthSession {
|
|
7
|
+
token: string;
|
|
8
|
+
userId: string;
|
|
9
|
+
email: string;
|
|
10
|
+
plan: 'free' | 'pro';
|
|
11
|
+
limits: AuthLimits;
|
|
12
|
+
cachedAt: string;
|
|
13
|
+
}
|
|
14
|
+
export declare function readSession(): AuthSession | null;
|
|
15
|
+
export declare function writeSession(session: AuthSession): void;
|
|
16
|
+
export declare function clearSession(): void;
|
|
17
|
+
export declare function isSessionFresh(session: AuthSession): boolean;
|
|
18
|
+
//# sourceMappingURL=auth-store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth-store.d.ts","sourceRoot":"","sources":["../../../src/auth/auth-store.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,UAAU;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,GAAG,KAAK,CAAC;IACrB,MAAM,EAAE,UAAU,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAQD,wBAAgB,WAAW,IAAI,WAAW,GAAG,IAAI,CAQhD;AAED,wBAAgB,YAAY,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI,CAKvD;AAED,wBAAgB,YAAY,IAAI,IAAI,CAGnC;AAED,wBAAgB,cAAc,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAE5D"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import fs from 'fs';
|
|
2
|
+
import os from 'os';
|
|
3
|
+
import path from 'path';
|
|
4
|
+
const CACHE_TTL_MS = 24 * 60 * 60 * 1000;
|
|
5
|
+
function authFilePath() {
|
|
6
|
+
return path.join(os.homedir(), '.verbo', 'auth.json');
|
|
7
|
+
}
|
|
8
|
+
export function readSession() {
|
|
9
|
+
const file = authFilePath();
|
|
10
|
+
if (!fs.existsSync(file))
|
|
11
|
+
return null;
|
|
12
|
+
try {
|
|
13
|
+
return JSON.parse(fs.readFileSync(file, 'utf-8'));
|
|
14
|
+
}
|
|
15
|
+
catch {
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
export function writeSession(session) {
|
|
20
|
+
const file = authFilePath();
|
|
21
|
+
const dir = path.dirname(file);
|
|
22
|
+
if (!fs.existsSync(dir))
|
|
23
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
24
|
+
fs.writeFileSync(file, JSON.stringify(session, null, 2), 'utf-8');
|
|
25
|
+
}
|
|
26
|
+
export function clearSession() {
|
|
27
|
+
const file = authFilePath();
|
|
28
|
+
if (fs.existsSync(file))
|
|
29
|
+
fs.unlinkSync(file);
|
|
30
|
+
}
|
|
31
|
+
export function isSessionFresh(session) {
|
|
32
|
+
return Date.now() - new Date(session.cachedAt).getTime() < CACHE_TTL_MS;
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=auth-store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth-store.js","sourceRoot":"","sources":["../../../src/auth/auth-store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;A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,OAAO,CAAC,QAAQ,CAAC,CAAC,OAAO,EAAE,GAAG,YAAY,CAAC;AAC1E,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { AuthSession } from './auth-store.js';
|
|
2
|
+
export declare const AUTH_API_URL: string;
|
|
3
|
+
export interface JwtPayload {
|
|
4
|
+
sub: string;
|
|
5
|
+
email: string;
|
|
6
|
+
[key: string]: unknown;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Decode the payload segment of a JWT without verifying the signature.
|
|
10
|
+
* Verification is the server's responsibility — the client only needs the claims.
|
|
11
|
+
*/
|
|
12
|
+
export declare function decodeJwtPayload(token: string): JwtPayload;
|
|
13
|
+
export interface CompletedPollResult {
|
|
14
|
+
status: 'completed';
|
|
15
|
+
token: string;
|
|
16
|
+
userId: string;
|
|
17
|
+
email: string;
|
|
18
|
+
plan: 'free' | 'pro';
|
|
19
|
+
limits: {
|
|
20
|
+
max_agents: number;
|
|
21
|
+
max_tasks: number;
|
|
22
|
+
max_projects: number;
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
export interface PendingPollResult {
|
|
26
|
+
status: 'pending' | 'expired';
|
|
27
|
+
}
|
|
28
|
+
export type PollResult = PendingPollResult | CompletedPollResult;
|
|
29
|
+
export declare function requestDeviceCode(): Promise<string>;
|
|
30
|
+
export declare function pollDeviceCode(code: string): Promise<PollResult>;
|
|
31
|
+
export declare function toAuthSession(result: CompletedPollResult): Omit<AuthSession, 'cachedAt'>;
|
|
32
|
+
//# sourceMappingURL=device-code-client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"device-code-client.d.ts","sourceRoot":"","sources":["../../../src/auth/device-code-client.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEnD,eAAO,MAAM,YAAY,QACsC,CAAC;AAMhE,MAAM,WAAW,UAAU;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,UAAU,CAK1D;AAED,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,WAAW,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,GAAG,KAAK,CAAC;IACrB,MAAM,EAAE;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAC;QAAC,YAAY,EAAE,MAAM,CAAA;KAAE,CAAC;CACzE;AAED,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,SAAS,GAAG,SAAS,CAAC;CAC/B;AAED,MAAM,MAAM,UAAU,GAAG,iBAAiB,GAAG,mBAAmB,CAAC;AAEjE,wBAAsB,iBAAiB,IAAI,OAAO,CAAC,MAAM,CAAC,CAKzD;AAED,wBAAsB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAItE;AAED,wBAAgB,aAAa,CAC3B,MAAM,EAAE,mBAAmB,GAC1B,IAAI,CAAC,WAAW,EAAE,UAAU,CAAC,CAa/B"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Buffer } from 'node:buffer';
|
|
2
|
+
export const AUTH_API_URL = process.env.VERBO_AUTH_URL ?? 'https://orchestra.verbolab.co';
|
|
3
|
+
/**
|
|
4
|
+
* Decode the payload segment of a JWT without verifying the signature.
|
|
5
|
+
* Verification is the server's responsibility — the client only needs the claims.
|
|
6
|
+
*/
|
|
7
|
+
export function decodeJwtPayload(token) {
|
|
8
|
+
const parts = token.split('.');
|
|
9
|
+
if (parts.length !== 3)
|
|
10
|
+
throw new Error('Invalid JWT: expected 3 segments');
|
|
11
|
+
const json = Buffer.from(parts[1], 'base64url').toString('utf-8');
|
|
12
|
+
return JSON.parse(json);
|
|
13
|
+
}
|
|
14
|
+
export async function requestDeviceCode() {
|
|
15
|
+
const res = await fetch(`${AUTH_API_URL}/api/device-code`, { method: 'POST' });
|
|
16
|
+
if (!res.ok)
|
|
17
|
+
throw new Error(`Failed to request device code: ${res.status}`);
|
|
18
|
+
const { code } = (await res.json());
|
|
19
|
+
return code;
|
|
20
|
+
}
|
|
21
|
+
export async function pollDeviceCode(code) {
|
|
22
|
+
const res = await fetch(`${AUTH_API_URL}/api/device-code?code=${code}`);
|
|
23
|
+
if (!res.ok)
|
|
24
|
+
throw new Error(`Poll failed: ${res.status}`);
|
|
25
|
+
return (await res.json());
|
|
26
|
+
}
|
|
27
|
+
export function toAuthSession(result) {
|
|
28
|
+
const jwt = decodeJwtPayload(result.token);
|
|
29
|
+
return {
|
|
30
|
+
token: result.token,
|
|
31
|
+
userId: jwt.sub,
|
|
32
|
+
email: jwt.email,
|
|
33
|
+
plan: result.plan,
|
|
34
|
+
limits: {
|
|
35
|
+
maxAgents: result.limits.max_agents,
|
|
36
|
+
maxTasks: result.limits.max_tasks,
|
|
37
|
+
maxProjects: result.limits.max_projects,
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=device-code-client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"device-code-client.js","sourceRoot":"","sources":["../../../src/auth/device-code-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAGrC,MAAM,CAAC,MAAM,YAAY,GACvB,OAAO,CAAC,GAAG,CAAC,cAAc,IAAI,+BAA+B,CAAC;AAYhE;;;GAGG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAAa;IAC5C,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC/B,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC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ACN,SAAS,EAAE,MAAM,CAAC,MAAM,CAAC,UAAU;YACnC,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC,SAAS;YACjC,WAAW,EAAE,MAAM,CAAC,MAAM,CAAC,YAAY;SACxC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { AuthLimits } from './auth-store.js';
|
|
2
|
+
export type { AuthLimits };
|
|
3
|
+
export type LimitKey = 'maxAgents' | 'maxTasks' | 'maxProjects';
|
|
4
|
+
export declare function checkLimit(key: LimitKey, currentCount: number, limits: AuthLimits): {
|
|
5
|
+
allowed: boolean;
|
|
6
|
+
message?: string;
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=plan-enforcer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plan-enforcer.d.ts","sourceRoot":"","sources":["../../../src/auth/plan-enforcer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD,YAAY,EAAE,UAAU,EAAE,CAAC;AAC3B,MAAM,MAAM,QAAQ,GAAG,WAAW,GAAG,UAAU,GAAG,aAAa,CAAC;AAWhE,wBAAgB,UAAU,CACxB,GAAG,EAAE,QAAQ,EACb,YAAY,EAAE,MAAM,EACpB,MAAM,EAAE,UAAU,GACjB;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,CAKxC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
const MESSAGES = {
|
|
2
|
+
maxAgents: (n) => `Free plan allows ${n} agents. Upgrade at verbolab.co/upgrade`,
|
|
3
|
+
maxTasks: (n) => `Free plan allows ${n} tasks. Upgrade at verbolab.co/upgrade`,
|
|
4
|
+
maxProjects: (n) => `Free plan allows ${n} projects. Upgrade at verbolab.co/upgrade`,
|
|
5
|
+
};
|
|
6
|
+
export function checkLimit(key, currentCount, limits) {
|
|
7
|
+
const limit = limits[key];
|
|
8
|
+
if (limit === -1)
|
|
9
|
+
return { allowed: true };
|
|
10
|
+
if (currentCount < limit)
|
|
11
|
+
return { allowed: true };
|
|
12
|
+
return { allowed: false, message: MESSAGES[key](limit) };
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=plan-enforcer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plan-enforcer.js","sourceRoot":"","sources":["../../../src/auth/plan-enforcer.ts"],"names":[],"mappings":"AAKA,MAAM,QAAQ,GAA4C;IACxD,SAAS,EAAE,CAAC,CAAC,EAAE,EAAE,CACf,oBAAoB,CAAC,yCAAyC;IAChE,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CACd,oBAAoB,CAAC,wCAAwC;IAC/D,WAAW,EAAE,CAAC,CAAC,EAAE,EAAE,CACjB,oBAAoB,CAAC,2CAA2C;CACnE,CAAC;AAEF,MAAM,UAAU,UAAU,CACxB,GAAa,EACb,YAAoB,EACpB,MAAkB;IAElB,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;IAC1B,IAAI,KAAK,KAAK,CAAC,CAAC;QAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAC3C,IAAI,YAAY,GAAG,KAAK;QAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IACnD,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC;AAC3D,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
import type { AuditLogStore } from '../core/audit-log-store.js';
|
|
3
|
+
export interface AuditCommandDeps {
|
|
4
|
+
auditLog: AuditLogStore;
|
|
5
|
+
}
|
|
6
|
+
export declare function registerAuditCommand(program: Command, getDeps: () => AuditCommandDeps): void;
|
|
7
|
+
//# sourceMappingURL=audit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"audit.d.ts","sourceRoot":"","sources":["../../../src/commands/audit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,EAAE,aAAa,EAAgC,MAAM,4BAA4B,CAAC;AAI9F,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,aAAa,CAAC;CACzB;AAID,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,GAAG,IAAI,CA6F5F"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
// ---- CLI command registration ----
|
|
2
|
+
export function registerAuditCommand(program, getDeps) {
|
|
3
|
+
const audit = program
|
|
4
|
+
.command('audit')
|
|
5
|
+
.description('View and export the audit log');
|
|
6
|
+
// ---- verbo audit list ----
|
|
7
|
+
audit
|
|
8
|
+
.command('list')
|
|
9
|
+
.description('List audit log entries with optional filters')
|
|
10
|
+
.option('-e, --event-type <type>', 'Filter by event type (e.g. task.created)')
|
|
11
|
+
.option('-h, --human-id <id>', 'Filter by human ID')
|
|
12
|
+
.option('-t, --task-id <id>', 'Filter by task ID')
|
|
13
|
+
.option('-s, --since <timestamp>', 'Show entries since timestamp (ISO or YYYY-MM-DD)')
|
|
14
|
+
.option('-u, --until <timestamp>', 'Show entries until timestamp (ISO or YYYY-MM-DD)')
|
|
15
|
+
.option('-n, --limit <count>', 'Maximum number of entries to show', '50')
|
|
16
|
+
.action((opts) => {
|
|
17
|
+
const { auditLog } = getDeps();
|
|
18
|
+
const limit = parseInt(opts.limit, 10) || 50;
|
|
19
|
+
const filter = {};
|
|
20
|
+
if (opts.eventType)
|
|
21
|
+
filter.eventType = opts.eventType;
|
|
22
|
+
if (opts.humanId)
|
|
23
|
+
filter.humanId = opts.humanId;
|
|
24
|
+
if (opts.taskId)
|
|
25
|
+
filter.taskId = opts.taskId;
|
|
26
|
+
if (opts.since)
|
|
27
|
+
filter.since = normalizeTimestamp(opts.since);
|
|
28
|
+
if (opts.until)
|
|
29
|
+
filter.until = normalizeTimestamp(opts.until);
|
|
30
|
+
const entries = auditLog.query(filter);
|
|
31
|
+
if (entries.length === 0) {
|
|
32
|
+
console.log('No audit entries found.');
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
const limited = entries.slice(0, limit);
|
|
36
|
+
console.log(`Audit log (${limited.length}${entries.length > limit ? ` of ${entries.length}` : ''} entries):\n`);
|
|
37
|
+
for (const entry of limited) {
|
|
38
|
+
const ts = entry.timestamp.slice(0, 19).replace('T', ' ');
|
|
39
|
+
const actor = entry.humanId ?? entry.agentSessionId ?? '-';
|
|
40
|
+
const detailStr = Object.keys(entry.details).length > 0
|
|
41
|
+
? ` ${JSON.stringify(entry.details)}`
|
|
42
|
+
: '';
|
|
43
|
+
console.log(` ${ts} ${padRight(entry.eventType, 24)} ${padRight(actor, 16)}${detailStr}`);
|
|
44
|
+
}
|
|
45
|
+
if (entries.length > limit) {
|
|
46
|
+
console.log(`\n … ${entries.length - limit} more entries (use --limit to show more)`);
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
// ---- verbo audit export ----
|
|
50
|
+
audit
|
|
51
|
+
.command('export')
|
|
52
|
+
.description('Export audit log entries as JSON or CSV')
|
|
53
|
+
.option('-e, --event-type <type>', 'Filter by event type')
|
|
54
|
+
.option('-h, --human-id <id>', 'Filter by human ID')
|
|
55
|
+
.option('-t, --task-id <id>', 'Filter by task ID')
|
|
56
|
+
.option('-s, --since <timestamp>', 'Show entries since timestamp (ISO or YYYY-MM-DD)')
|
|
57
|
+
.option('-u, --until <timestamp>', 'Show entries until timestamp (ISO or YYYY-MM-DD)')
|
|
58
|
+
.option('-f, --format <format>', 'Export format: json or csv', 'json')
|
|
59
|
+
.action((opts) => {
|
|
60
|
+
const { auditLog } = getDeps();
|
|
61
|
+
const format = opts.format.toLowerCase();
|
|
62
|
+
if (format !== 'json' && format !== 'csv') {
|
|
63
|
+
console.error(`Invalid format: ${opts.format}. Must be "json" or "csv".`);
|
|
64
|
+
process.exit(1);
|
|
65
|
+
}
|
|
66
|
+
const filter = {};
|
|
67
|
+
if (opts.eventType)
|
|
68
|
+
filter.eventType = opts.eventType;
|
|
69
|
+
if (opts.humanId)
|
|
70
|
+
filter.humanId = opts.humanId;
|
|
71
|
+
if (opts.taskId)
|
|
72
|
+
filter.taskId = opts.taskId;
|
|
73
|
+
if (opts.since)
|
|
74
|
+
filter.since = normalizeTimestamp(opts.since);
|
|
75
|
+
if (opts.until)
|
|
76
|
+
filter.until = normalizeTimestamp(opts.until);
|
|
77
|
+
const output = auditLog.export(filter, format);
|
|
78
|
+
console.log(output);
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
// ---- Helpers ----
|
|
82
|
+
function normalizeTimestamp(input) {
|
|
83
|
+
// If it looks like a date-only string (YYYY-MM-DD), append midnight UTC
|
|
84
|
+
if (/^\d{4}-\d{2}-\d{2}$/.test(input)) {
|
|
85
|
+
return `${input}T00:00:00.000Z`;
|
|
86
|
+
}
|
|
87
|
+
return input;
|
|
88
|
+
}
|
|
89
|
+
function padRight(str, len) {
|
|
90
|
+
return str.length >= len ? str : str + ' '.repeat(len - str.length);
|
|
91
|
+
}
|
|
92
|
+
//# sourceMappingURL=audit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"audit.js","sourceRoot":"","sources":["../../../src/commands/audit.ts"],"names":[],"mappings":"AASA,qCAAqC;AAErC,MAAM,UAAU,oBAAoB,CAAC,OAAgB,EAAE,OAA+B;IACpF,MAAM,KAAK,GAAG,OAAO;SAClB,OAAO,CAAC,OAAO,CAAC;SAChB,WAAW,CAAC,+BAA+B,CAAC,CAAC;IAEhD,6BAA6B;IAC7B,KAAK;SACF,OAAO,CAAC,MAAM,CAAC;SACf,WAAW,CAAC,8CAA8C,CAAC;SAC3D,MAAM,CAAC,yBAAyB,EAAE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B,CAAC,KAAa;IACvC,wEAAwE;IACxE,IAAI,qBAAqB,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;QACtC,OAAO,GAAG,KAAK,gBAAgB,CAAC;IAClC,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAS,QAAQ,CAAC,GAAW,EAAE,GAAW;IACxC,OAAO,GAAG,CAAC,MAAM,IAAI,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC;AACtE,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
import type { RbacStore, Role } from '../core/rbac.js';
|
|
3
|
+
import type { AuditLogStore } from '../core/audit-log-store.js';
|
|
4
|
+
import type Database from 'better-sqlite3';
|
|
5
|
+
export interface TeamMemberRow {
|
|
6
|
+
human_id: string;
|
|
7
|
+
role: Role;
|
|
8
|
+
created_at: string;
|
|
9
|
+
updated_at: string;
|
|
10
|
+
}
|
|
11
|
+
export interface RoleChangeRow {
|
|
12
|
+
id: string;
|
|
13
|
+
target_human_id: string;
|
|
14
|
+
changed_by: string;
|
|
15
|
+
old_role: string | null;
|
|
16
|
+
new_role: string;
|
|
17
|
+
reason: string | null;
|
|
18
|
+
created_at: string;
|
|
19
|
+
}
|
|
20
|
+
export interface TeamEntry {
|
|
21
|
+
humanId: string;
|
|
22
|
+
role: Role;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Parse a `## Team` section from VERBO.md content.
|
|
26
|
+
*
|
|
27
|
+
* Expected format:
|
|
28
|
+
* ```
|
|
29
|
+
* ## Team
|
|
30
|
+
* alice: owner
|
|
31
|
+
* bob: lead
|
|
32
|
+
* carol: developer
|
|
33
|
+
* dave: viewer
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
export declare function parseTeamSection(verboMdContent: string): TeamEntry[];
|
|
37
|
+
/**
|
|
38
|
+
* Seed team_members from the `## Team` section of VERBO.md.
|
|
39
|
+
* Only inserts members that don't already exist — never overwrites.
|
|
40
|
+
*/
|
|
41
|
+
export declare function bootstrapTeamFromVerboMd(db: Database.Database, verboMdContent: string): number;
|
|
42
|
+
export interface TeamCommandDeps {
|
|
43
|
+
db: Database.Database;
|
|
44
|
+
rbacStore: RbacStore;
|
|
45
|
+
auditLog?: AuditLogStore;
|
|
46
|
+
}
|
|
47
|
+
export declare function registerTeamCommand(program: Command, getDeps: () => TeamCommandDeps): void;
|
|
48
|
+
//# sourceMappingURL=team.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"team.d.ts","sourceRoot":"","sources":["../../../src/commands/team.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAK3C,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,IAAI,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,eAAe,EAAE,MAAM,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;CACpB;AAID,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,IAAI,CAAC;CACZ;AAID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