@adaptic/maestro 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/commands/init-agent.md +99 -0
- package/.claude/commands/init-maestro.md +565 -0
- package/.claude/settings.json +114 -0
- package/.env.example +152 -0
- package/README.md +491 -0
- package/agents/board-prep/agent.md +80 -0
- package/agents/browser-operator/agent.md +52 -0
- package/agents/calendar-ops/agent.md +50 -0
- package/agents/capital-raising/agent.md +69 -0
- package/agents/ceo-briefing/agent.md +72 -0
- package/agents/communications/agent.md +69 -0
- package/agents/competitive-intelligence/agent.md +49 -0
- package/agents/corporate-development/agent.md +66 -0
- package/agents/decision-log/agent.md +65 -0
- package/agents/desktop-operator/agent.md +59 -0
- package/agents/engineering-coordination/agent.md +51 -0
- package/agents/founder-voice/agent.md +72 -0
- package/agents/fund-ops/agent.md +52 -0
- package/agents/gmail-operator/agent.md +62 -0
- package/agents/hiring-org-design/agent.md +119 -0
- package/agents/inbound-dispatcher/agent.md +66 -0
- package/agents/legal-structuring/agent.md +65 -0
- package/agents/market-research/agent.md +48 -0
- package/agents/partnerships/agent.md +59 -0
- package/agents/platform-architecture/agent.md +57 -0
- package/agents/pmo-execution/agent.md +60 -0
- package/agents/product-strategy/agent.md +50 -0
- package/agents/regulatory-dfsa/agent.md +96 -0
- package/agents/risk-register/agent.md +62 -0
- package/agents/rollup-target-sourcing/agent.md +59 -0
- package/agents/session-spawner/agent.md +64 -0
- package/agents/slack-operator/agent.md +60 -0
- package/agents/sophie-chief-of-staff/agent.md +134 -0
- package/agents/strategic-planning/agent.md +54 -0
- package/agents/whatsapp-operator/agent.md +60 -0
- package/agents/workflow-automation/agent.md +61 -0
- package/bin/maestro.mjs +388 -0
- package/desktop-control/README.md +56 -0
- package/desktop-control/app-profiles/gmail.yaml +120 -0
- package/desktop-control/app-profiles/slack.yaml +315 -0
- package/desktop-control/app-profiles/whatsapp.yaml +107 -0
- package/docs/architecture/agent-topology.md +2222 -0
- package/docs/architecture/continuous-monitoring.md +221 -0
- package/docs/architecture/mcp-capability-map.md +560 -0
- package/docs/architecture/system-architecture.md +1273 -0
- package/docs/business-synthesis/ADAPTIC-GROUP-FINAL-OWNERSHIP-STRUCTURE.pdf +13667 -10
- package/docs/business-synthesis/adaptic-overview.md +296 -0
- package/docs/business-synthesis/executive-operating-model.md +261 -0
- package/docs/governance/action-approval-model.md +331 -0
- package/docs/governance/communications-policy.md +410 -0
- package/docs/governance/desktop-control-safety.md +499 -0
- package/docs/guides/agent-persona-setup.md +600 -0
- package/docs/operating-charter.md +87 -0
- package/docs/prompts/board-pack-cover-template.md +37 -0
- package/docs/prompts/decision-recommendation-template.md +88 -0
- package/docs/prompts/followup-message-template.md +141 -0
- package/docs/prompts/investor-letter-template.md +52 -0
- package/docs/prompts/morning-brief-template.md +82 -0
- package/docs/prompts/presentation-template.md +58 -0
- package/docs/prompts/weekly-strategic-memo-template.md +104 -0
- package/docs/runbooks/mac-mini-bootstrap.md +404 -0
- package/docs/runbooks/perpetual-operations.md +505 -0
- package/docs/runbooks/recovery-and-failover.md +588 -0
- package/docs/superpowers/plans/2026-04-02-phase0-operational-foundation.md +2550 -0
- package/docs/superpowers/plans/2026-04-03-phase1-executive-core.md +1085 -0
- package/docs/superpowers/plans/2026-04-03-phase2-people-product-commercial.md +739 -0
- package/docs/superpowers/plans/2026-04-05-information-barrier-implementation.md +926 -0
- package/docs/superpowers/plans/2026-04-06-session-context-dedup.md +1994 -0
- package/docs/superpowers/specs/2026-04-02-phase0-operational-foundation-design.md +842 -0
- package/docs/superpowers/specs/2026-04-03-phase1-executive-core-design.md +516 -0
- package/docs/superpowers/specs/2026-04-03-phase2-people-product-commercial-design.md +452 -0
- package/docs/superpowers/specs/2026-04-03-phase3-4-final-towers-design.md +129 -0
- package/docs/superpowers/specs/2026-04-05-information-barrier-design.md +678 -0
- package/docs/superpowers/specs/2026-04-05-reactive-daemon-design.md +237 -0
- package/docs/superpowers/specs/2026-04-06-session-context-dedup-design.md +369 -0
- package/docs/workflows/executive-cadence.md +218 -0
- package/ingest/README.md +87 -0
- package/mcp/README.md +51 -0
- package/package.json +48 -0
- package/plugins/maestro-skills/plugin.json +55 -0
- package/plugins/maestro-skills/skills/board-deck.md +68 -0
- package/plugins/maestro-skills/skills/decision-brief.md +89 -0
- package/plugins/maestro-skills/skills/draft-comms.md +84 -0
- package/plugins/maestro-skills/skills/evening-wrap.md +53 -0
- package/plugins/maestro-skills/skills/hiring-triage.md +74 -0
- package/plugins/maestro-skills/skills/inbox-triage.md +61 -0
- package/plugins/maestro-skills/skills/morning-brief.md +54 -0
- package/plugins/maestro-skills/skills/pipeline-review.md +76 -0
- package/plugins/maestro-skills/skills/regulatory-status.md +81 -0
- package/plugins/maestro-skills/skills/schedule-meeting.md +91 -0
- package/plugins/maestro-skills/skills/slack-followup.md +64 -0
- package/plugins/maestro-skills/skills/weekly-memo.md +70 -0
- package/policies/action-classification.yaml +110 -0
- package/policies/information-barriers.yaml +119 -0
- package/policies/prompt-injection-defence.yaml +138 -0
- package/public/assets/adaptic-icon-dark.png +0 -0
- package/public/assets/adaptic-icon-dark.svg +4 -0
- package/public/assets/adaptic-icon-light.svg +4 -0
- package/public/assets/adaptic-logo-dark.svg +17 -0
- package/public/assets/adaptic-logo-light.svg +17 -0
- package/scaffold/CLAUDE.md +21 -0
- package/scaffold/config/agent.ts +69 -0
- package/scaffold/config/agent.ts.example +218 -0
- package/schedules/README.md +49 -0
- package/schedules/triggers/backlog-executor.md +102 -0
- package/schedules/triggers/daily-evening-wrap.md +142 -0
- package/schedules/triggers/daily-midday-sweep.md +58 -0
- package/schedules/triggers/daily-morning-brief.md +55 -0
- package/schedules/triggers/inbox-processor.md +115 -0
- package/schedules/triggers/meeting-action-capture.md +60 -0
- package/schedules/triggers/meeting-prep.md +69 -0
- package/schedules/triggers/quarterly-self-assessment.md +54 -0
- package/schedules/triggers/weekly-engineering-health.md +37 -0
- package/schedules/triggers/weekly-execution.md +67 -0
- package/schedules/triggers/weekly-hiring.md +53 -0
- package/schedules/triggers/weekly-priorities.md +38 -0
- package/schedules/triggers/weekly-strategic-memo.md +124 -0
- package/scripts/__pycache__/disclosure_assessment.cpython-313.pyc +0 -0
- package/scripts/__pycache__/disclosure_boundaries.cpython-313.pyc +0 -0
- package/scripts/__pycache__/email_quote_thread.cpython-313.pyc +0 -0
- package/scripts/__pycache__/email_thread_dedup.cpython-313.pyc +0 -0
- package/scripts/__pycache__/mehran-inbox-poller.cpython-313.pyc +0 -0
- package/scripts/__pycache__/outbound_dedup.cpython-313.pyc +0 -0
- package/scripts/__pycache__/pre-draft-context.cpython-313.pyc +0 -0
- package/scripts/__pycache__/pre_draft_lookup.cpython-313.pyc +0 -0
- package/scripts/__pycache__/send-email-as-mehran.cpython-313.pyc +0 -0
- package/scripts/__pycache__/send-email-threaded.cpython-313.pyc +0 -0
- package/scripts/__pycache__/send-email-with-attachment.cpython-313.pyc +0 -0
- package/scripts/__pycache__/validate_outbound.cpython-313.pyc +0 -0
- package/scripts/airtable-crm-populate.md +99 -0
- package/scripts/archive-email.sh +41 -0
- package/scripts/comms-monitor.sh +285 -0
- package/scripts/configure-whatsapp-sandbox.sh +201 -0
- package/scripts/continuous-monitor.sh +86 -0
- package/scripts/daemon/classifier.mjs +355 -0
- package/scripts/daemon/context-compiler.mjs +490 -0
- package/scripts/daemon/dispatcher.mjs +385 -0
- package/scripts/daemon/health.mjs +72 -0
- package/scripts/daemon/prompt-builder.mjs +426 -0
- package/scripts/daemon/responder.mjs +547 -0
- package/scripts/daemon/session-lock.mjs +520 -0
- package/scripts/daemon/sophie-daemon.mjs +521 -0
- package/scripts/daemon/test-context-compiler.mjs +238 -0
- package/scripts/daemon/test-integration.mjs +130 -0
- package/scripts/daemon/test-session-lock.mjs +215 -0
- package/scripts/disclosure_assessment.py +873 -0
- package/scripts/disclosure_boundaries.py +562 -0
- package/scripts/email-signature-mehran.html +52 -0
- package/scripts/email-signature.html +44 -0
- package/scripts/email_quote_thread.py +167 -0
- package/scripts/email_thread_dedup.py +361 -0
- package/scripts/emergency-stop.sh +41 -0
- package/scripts/healthcheck.sh +110 -0
- package/scripts/hooks/block-mcp-slack-send.sh +7 -0
- package/scripts/hooks/post-action-log.sh +17 -0
- package/scripts/hooks/pre-send-audit.sh +57 -0
- package/scripts/hooks/session-end-log.sh +27 -0
- package/scripts/huddle/audio-bridge.mjs +664 -0
- package/scripts/huddle/boot-slack-cdp.sh +102 -0
- package/scripts/huddle/huddle-controller.mjs +942 -0
- package/scripts/huddle/huddle-server.mjs +1059 -0
- package/scripts/huddle/launch-slack.sh +232 -0
- package/scripts/huddle/node_modules/.package-lock.json +50 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/CHANGELOG.md +1677 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/LICENSE +8 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/README.md +674 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/_vendor/partial-json-parser/parser.d.mts +3 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/_vendor/partial-json-parser/parser.d.mts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/_vendor/partial-json-parser/parser.d.ts +3 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/_vendor/partial-json-parser/parser.d.ts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/_vendor/partial-json-parser/parser.js +226 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/_vendor/partial-json-parser/parser.js.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/_vendor/partial-json-parser/parser.mjs +223 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/_vendor/partial-json-parser/parser.mjs.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/api-promise.d.mts +2 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/api-promise.d.mts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/api-promise.d.ts +2 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/api-promise.d.ts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/api-promise.js +6 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/api-promise.js.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/api-promise.mjs +2 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/api-promise.mjs.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/bin/cli +53 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/bin/migration-config.json +7 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/client.d.mts +225 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/client.d.mts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/client.d.ts +225 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/client.d.ts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/client.js +536 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/client.js.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/client.mjs +531 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/client.mjs.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/core/api-promise.d.mts +49 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/core/api-promise.d.mts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/core/api-promise.d.ts +49 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/core/api-promise.d.ts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/core/api-promise.js +76 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/core/api-promise.js.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/core/api-promise.mjs +72 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/core/api-promise.mjs.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/core/error.d.mts +47 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/core/error.d.mts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/core/error.d.ts +47 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/core/error.d.ts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/core/error.js +114 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/core/error.js.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/core/error.mjs +98 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/core/error.mjs.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/core/pagination.d.mts +63 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/core/pagination.d.mts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/core/pagination.d.ts +63 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/core/pagination.d.ts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/core/pagination.js +123 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/core/pagination.js.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/core/pagination.mjs +117 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/core/pagination.mjs.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/core/resource.d.mts +6 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/core/resource.d.mts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/core/resource.d.ts +6 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/core/resource.d.ts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/core/resource.js +11 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/core/resource.js.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/core/resource.mjs +7 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/core/resource.mjs.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/core/streaming.d.mts +31 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/core/streaming.d.mts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/core/streaming.d.ts +31 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/core/streaming.d.ts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/core/streaming.js +282 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/core/streaming.js.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/core/streaming.mjs +277 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/core/streaming.mjs.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/core/uploads.d.mts +3 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/core/uploads.d.mts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/core/uploads.d.ts +3 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/core/uploads.d.ts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/core/uploads.js +6 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/core/uploads.js.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/core/uploads.mjs +2 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/core/uploads.mjs.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/error.d.mts +2 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/error.d.mts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/error.d.ts +2 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/error.d.ts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/error.js +6 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/error.js.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/error.mjs +2 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/error.mjs.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/index.d.mts +7 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/index.d.mts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/index.d.ts +7 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/index.d.ts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/index.js +35 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/index.js.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/index.mjs +8 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/index.mjs.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/builtin-types.d.mts +73 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/builtin-types.d.mts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/builtin-types.d.ts +73 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/builtin-types.d.ts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/builtin-types.js +4 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/builtin-types.js.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/builtin-types.mjs +3 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/builtin-types.mjs.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/constants.d.mts +5 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/constants.d.mts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/constants.d.ts +5 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/constants.d.ts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/constants.js +15 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/constants.js.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/constants.mjs +12 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/constants.mjs.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/decoders/jsonl.d.mts +10 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/decoders/jsonl.d.mts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/decoders/jsonl.d.ts +10 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/decoders/jsonl.d.ts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/decoders/jsonl.js +39 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/decoders/jsonl.js.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/decoders/jsonl.mjs +35 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/decoders/jsonl.mjs.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/decoders/line.d.mts +17 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/decoders/line.d.mts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/decoders/line.d.ts +17 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/decoders/line.d.ts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/decoders/line.js +113 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/decoders/line.js.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/decoders/line.mjs +108 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/decoders/line.mjs.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/detect-platform.d.mts +15 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/detect-platform.d.mts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/detect-platform.d.ts +15 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/detect-platform.d.ts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/detect-platform.js +162 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/detect-platform.js.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/detect-platform.mjs +157 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/detect-platform.mjs.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/errors.d.mts +3 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/errors.d.mts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/errors.d.ts +3 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/errors.d.ts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/errors.js +41 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/errors.js.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/errors.mjs +36 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/errors.mjs.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/headers.d.mts +22 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/headers.d.mts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/headers.d.ts +22 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/headers.d.ts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/headers.js +79 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/headers.js.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/headers.mjs +74 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/headers.mjs.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/parse.d.mts +17 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/parse.d.mts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/parse.d.ts +17 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/parse.d.ts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/parse.js +55 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/parse.js.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/parse.mjs +51 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/parse.mjs.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/request-options.d.mts +34 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/request-options.d.mts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/request-options.d.ts +34 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/request-options.d.ts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/request-options.js +14 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/request-options.js.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/request-options.mjs +10 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/request-options.mjs.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/shim-types.d.mts +28 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/shim-types.d.ts +28 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/shims.d.mts +20 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/shims.d.mts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/shims.d.ts +20 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/shims.d.ts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/shims.js +92 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/shims.js.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/shims.mjs +85 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/shims.mjs.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/stream-utils.d.mts +8 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/stream-utils.d.mts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/stream-utils.d.ts +8 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/stream-utils.d.ts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/stream-utils.js +38 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/stream-utils.js.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/stream-utils.mjs +35 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/stream-utils.mjs.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/to-file.d.mts +45 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/to-file.d.mts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/to-file.d.ts +45 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/to-file.d.ts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/to-file.js +96 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/to-file.js.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/to-file.mjs +93 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/to-file.mjs.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/tslib.js +81 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/tslib.mjs +17 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/types.d.mts +67 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/types.d.mts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/types.d.ts +67 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/types.d.ts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/types.js +4 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/types.js.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/types.mjs +3 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/types.mjs.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/uploads.d.mts +42 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/uploads.d.mts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/uploads.d.ts +42 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/uploads.d.ts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/uploads.js +146 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/uploads.js.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/uploads.mjs +136 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/uploads.mjs.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/base64.d.mts +3 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/base64.d.mts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/base64.d.ts +3 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/base64.d.ts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/base64.js +38 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/base64.js.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/base64.mjs +33 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/base64.mjs.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/bytes.d.mts +4 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/bytes.d.mts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/bytes.d.ts +4 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/bytes.d.ts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/bytes.js +31 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/bytes.js.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/bytes.mjs +26 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/bytes.mjs.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/env.d.mts +9 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/env.d.mts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/env.d.ts +9 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/env.d.ts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/env.js +22 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/env.js.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/env.mjs +18 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/env.mjs.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/log.d.mts +37 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/log.d.mts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/log.d.ts +37 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/log.d.ts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/log.js +86 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/log.js.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/log.mjs +80 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/log.mjs.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/path.d.mts +15 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/path.d.mts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/path.d.ts +15 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/path.d.ts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/path.js +58 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/path.js.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/path.mjs +53 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/path.mjs.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/sleep.d.mts +2 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/sleep.d.mts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/sleep.d.ts +2 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/sleep.d.ts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/sleep.js +7 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/sleep.js.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/sleep.mjs +3 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/sleep.mjs.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/uuid.d.mts +5 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/uuid.d.mts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/uuid.d.ts +5 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/uuid.d.ts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/uuid.js +19 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/uuid.js.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/uuid.mjs +15 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/uuid.mjs.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/values.d.mts +16 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/values.d.mts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/values.d.ts +16 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/values.d.ts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/values.js +109 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/values.js.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/values.mjs +92 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/values.mjs.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils.d.mts +7 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils.d.mts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils.d.ts +7 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils.d.ts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils.js +11 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils.js.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils.mjs +8 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils.mjs.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/lib/BetaMessageStream.d.mts +114 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/lib/BetaMessageStream.d.mts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/lib/BetaMessageStream.d.ts +114 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/lib/BetaMessageStream.d.ts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/lib/BetaMessageStream.js +553 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/lib/BetaMessageStream.js.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/lib/BetaMessageStream.mjs +549 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/lib/BetaMessageStream.mjs.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/lib/MessageStream.d.mts +114 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/lib/MessageStream.d.mts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/lib/MessageStream.d.ts +114 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/lib/MessageStream.d.ts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/lib/MessageStream.js +553 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/lib/MessageStream.js.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/lib/MessageStream.mjs +549 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/lib/MessageStream.mjs.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/package.json +185 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/pagination.d.mts +2 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/pagination.d.mts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/pagination.d.ts +2 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/pagination.d.ts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/pagination.js +6 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/pagination.js.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/pagination.mjs +2 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/pagination.mjs.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resource.d.mts +2 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resource.d.mts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resource.d.ts +2 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resource.d.ts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resource.js +6 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resource.js.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resource.mjs +2 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resource.mjs.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/beta.d.mts +61 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/beta.d.mts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/beta.d.ts +61 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/beta.d.ts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/beta.js +25 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/beta.js.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/beta.mjs +20 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/beta.mjs.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/files.d.mts +151 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/files.d.mts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/files.d.ts +151 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/files.d.ts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/files.js +122 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/files.js.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/files.mjs +118 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/files.mjs.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/index.d.mts +5 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/index.d.mts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/index.d.ts +5 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/index.d.ts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/index.js +13 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/index.js.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/index.mjs +6 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/index.mjs.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/messages/batches.d.mts +343 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/messages/batches.d.mts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/messages/batches.d.ts +343 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/messages/batches.d.ts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/messages/batches.js +204 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/messages/batches.js.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/messages/batches.mjs +200 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/messages/batches.mjs.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/messages/index.d.mts +3 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/messages/index.d.mts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/messages/index.d.ts +3 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/messages/index.d.ts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/messages/index.js +9 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/messages/index.js.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/messages/index.mjs +4 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/messages/index.mjs.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/messages/messages.d.mts +1561 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/messages/messages.d.mts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/messages/messages.d.ts +1561 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/messages/messages.d.ts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/messages/messages.js +86 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/messages/messages.js.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/messages/messages.mjs +81 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/messages/messages.mjs.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/messages.d.mts +2 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/messages.d.mts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/messages.d.ts +2 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/messages.d.ts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/messages.js +6 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/messages.js.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/messages.mjs +3 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/messages.mjs.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/models.d.mts +74 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/models.d.mts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/models.d.ts +74 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/models.d.ts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/models.js +60 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/models.js.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/models.mjs +56 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/models.mjs.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta.d.mts +2 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta.d.mts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta.d.ts +2 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta.d.ts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta.js +6 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta.js.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta.mjs +3 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta.mjs.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/completions.d.mts +183 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/completions.d.mts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/completions.d.ts +183 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/completions.d.ts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/completions.js +23 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/completions.js.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/completions.mjs +19 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/completions.mjs.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/index.d.mts +6 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/index.d.mts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/index.d.ts +6 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/index.d.ts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/index.js +15 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/index.js.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/index.mjs +7 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/index.mjs.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/messages/batches.d.mts +304 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/messages/batches.d.mts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/messages/batches.d.ts +304 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/messages/batches.d.ts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/messages/batches.js +153 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/messages/batches.js.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/messages/batches.mjs +149 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/messages/batches.mjs.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/messages/index.d.mts +3 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/messages/index.d.mts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/messages/index.d.ts +3 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/messages/index.d.ts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/messages/index.js +9 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/messages/index.js.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/messages/index.mjs +4 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/messages/index.mjs.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/messages/messages.d.mts +1264 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/messages/messages.d.mts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/messages/messages.d.ts +1264 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/messages/messages.d.ts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/messages/messages.js +72 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/messages/messages.js.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/messages/messages.mjs +67 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/messages/messages.mjs.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/messages.d.mts +2 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/messages.d.mts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/messages.d.ts +2 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/messages.d.ts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/messages.js +6 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/messages.js.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/messages.mjs +3 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/messages.mjs.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/models.d.mts +59 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/models.d.mts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/models.d.ts +59 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/models.d.ts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/models.js +45 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/models.js.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/models.mjs +41 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/models.mjs.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/shared.d.mts +42 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/shared.d.mts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/shared.d.ts +42 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/shared.d.ts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/shared.js +4 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/shared.js.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/shared.mjs +3 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/shared.mjs.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/top-level.d.mts +2 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/top-level.d.mts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/top-level.d.ts +2 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/top-level.d.ts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/top-level.js +4 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/top-level.js.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/top-level.mjs +3 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/top-level.mjs.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources.d.mts +2 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources.d.mts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources.d.ts +2 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources.d.ts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources.js +5 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources.js.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources.mjs +2 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources.mjs.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/_vendor/partial-json-parser/README.md +3 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/_vendor/partial-json-parser/parser.ts +264 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/api-promise.ts +2 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/client.ts +1070 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/core/README.md +3 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/core/api-promise.ts +101 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/core/error.ts +133 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/core/pagination.ts +201 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/core/resource.ts +11 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/core/streaming.ts +331 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/core/uploads.ts +2 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/error.ts +2 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/index.ts +23 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/internal/README.md +3 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/internal/builtin-types.ts +93 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/internal/constants.ts +12 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/internal/decoders/jsonl.ts +48 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/internal/decoders/line.ts +135 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/internal/detect-platform.ts +196 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/internal/errors.ts +33 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/internal/headers.ts +99 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/internal/parse.ts +84 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/internal/request-options.ts +39 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/internal/shim-types.d.ts +28 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/internal/shims.ts +107 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/internal/stream-utils.ts +32 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/internal/to-file.ts +159 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/internal/types.ts +92 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/internal/uploads.ts +193 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/internal/utils/base64.ts +40 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/internal/utils/bytes.ts +32 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/internal/utils/env.ts +18 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/internal/utils/log.ts +127 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/internal/utils/path.ts +65 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/internal/utils/sleep.ts +3 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/internal/utils/uuid.ts +17 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/internal/utils/values.ts +102 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/internal/utils.ts +8 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/lib/.keep +4 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/lib/BetaMessageStream.ts +683 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/lib/MessageStream.ts +684 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/pagination.ts +2 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/resource.ts +2 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/resources/beta/beta.ts +380 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/resources/beta/files.ts +258 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/resources/beta/index.ts +148 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/resources/beta/messages/batches.ts +502 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/resources/beta/messages/index.ts +135 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/resources/beta/messages/messages.ts +2249 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/resources/beta/messages.ts +3 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/resources/beta/models.ts +118 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/resources/beta.ts +3 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/resources/completions.ts +231 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/resources/index.ts +121 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/resources/messages/batches.ts +396 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/resources/messages/index.ts +110 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/resources/messages/messages.ts +1783 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/resources/messages.ts +3 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/resources/models.ts +103 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/resources/shared.ts +72 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/resources/top-level.ts +3 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/resources.ts +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/streaming.ts +2 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/tsconfig.json +11 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/uploads.ts +2 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/version.ts +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/streaming.d.mts +2 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/streaming.d.mts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/streaming.d.ts +2 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/streaming.d.ts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/streaming.js +6 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/streaming.js.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/streaming.mjs +2 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/streaming.mjs.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/uploads.d.mts +2 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/uploads.d.mts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/uploads.d.ts +2 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/uploads.d.ts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/uploads.js +6 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/uploads.js.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/uploads.mjs +2 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/uploads.mjs.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/version.d.mts +2 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/version.d.mts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/version.d.ts +2 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/version.d.ts.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/version.js +5 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/version.js.map +1 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/version.mjs +2 -0
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/version.mjs.map +1 -0
- package/scripts/huddle/node_modules/dotenv/CHANGELOG.md +520 -0
- package/scripts/huddle/node_modules/dotenv/LICENSE +23 -0
- package/scripts/huddle/node_modules/dotenv/README-es.md +411 -0
- package/scripts/huddle/node_modules/dotenv/README.md +645 -0
- package/scripts/huddle/node_modules/dotenv/SECURITY.md +1 -0
- package/scripts/huddle/node_modules/dotenv/config.d.ts +1 -0
- package/scripts/huddle/node_modules/dotenv/config.js +9 -0
- package/scripts/huddle/node_modules/dotenv/lib/cli-options.js +17 -0
- package/scripts/huddle/node_modules/dotenv/lib/env-options.js +28 -0
- package/scripts/huddle/node_modules/dotenv/lib/main.d.ts +162 -0
- package/scripts/huddle/node_modules/dotenv/lib/main.js +386 -0
- package/scripts/huddle/node_modules/dotenv/package.json +62 -0
- package/scripts/huddle/node_modules/ws/LICENSE +20 -0
- package/scripts/huddle/node_modules/ws/README.md +548 -0
- package/scripts/huddle/node_modules/ws/browser.js +8 -0
- package/scripts/huddle/node_modules/ws/index.js +22 -0
- package/scripts/huddle/node_modules/ws/lib/buffer-util.js +131 -0
- package/scripts/huddle/node_modules/ws/lib/constants.js +19 -0
- package/scripts/huddle/node_modules/ws/lib/event-target.js +292 -0
- package/scripts/huddle/node_modules/ws/lib/extension.js +203 -0
- package/scripts/huddle/node_modules/ws/lib/limiter.js +55 -0
- package/scripts/huddle/node_modules/ws/lib/permessage-deflate.js +528 -0
- package/scripts/huddle/node_modules/ws/lib/receiver.js +706 -0
- package/scripts/huddle/node_modules/ws/lib/sender.js +602 -0
- package/scripts/huddle/node_modules/ws/lib/stream.js +161 -0
- package/scripts/huddle/node_modules/ws/lib/subprotocol.js +62 -0
- package/scripts/huddle/node_modules/ws/lib/validation.js +152 -0
- package/scripts/huddle/node_modules/ws/lib/websocket-server.js +554 -0
- package/scripts/huddle/node_modules/ws/lib/websocket.js +1393 -0
- package/scripts/huddle/node_modules/ws/package.json +70 -0
- package/scripts/huddle/node_modules/ws/wrapper.mjs +21 -0
- package/scripts/huddle/package-lock.json +62 -0
- package/scripts/huddle/package.json +22 -0
- package/scripts/huddle/setup-audio.sh +239 -0
- package/scripts/huddle/start-call.mjs +318 -0
- package/scripts/huddle/test-pipeline.mjs +263 -0
- package/scripts/llm_email_dedup.py +434 -0
- package/scripts/local-triggers/install-all.sh +43 -0
- package/scripts/local-triggers/plists/ai.adaptic.slack-events-server.plist +45 -0
- package/scripts/local-triggers/plists/ai.adaptic.sophie-backlog-executor.plist +21 -0
- package/scripts/local-triggers/plists/ai.adaptic.sophie-daemon.plist +32 -0
- package/scripts/local-triggers/plists/ai.adaptic.sophie-inbox-processor.plist +21 -0
- package/scripts/local-triggers/plists/ai.adaptic.sophie-meeting-action-capture.plist +21 -0
- package/scripts/local-triggers/plists/ai.adaptic.sophie-meeting-prep.plist +21 -0
- package/scripts/local-triggers/plists/ai.adaptic.sophie-midday-sweep.plist +26 -0
- package/scripts/local-triggers/plists/ai.adaptic.sophie-quarterly-self-assessment.plist +62 -0
- package/scripts/local-triggers/plists/ai.adaptic.sophie-weekly-engineering-health.plist +28 -0
- package/scripts/local-triggers/plists/ai.adaptic.sophie-weekly-execution.plist +28 -0
- package/scripts/local-triggers/plists/ai.adaptic.sophie-weekly-hiring.plist +28 -0
- package/scripts/local-triggers/plists/ai.adaptic.sophie-weekly-priorities.plist +28 -0
- package/scripts/local-triggers/plists/ai.adaptic.sophie-weekly-strategic-memo.plist +28 -0
- package/scripts/local-triggers/run-trigger.sh +44 -0
- package/scripts/media-generation/README.md +103 -0
- package/scripts/media-generation/gemini-image-client.mjs +173 -0
- package/scripts/media-generation/generate-assets.mjs +289 -0
- package/scripts/media-generation/veo-video-client.mjs +219 -0
- package/scripts/mehran-inbox-poller.py +437 -0
- package/scripts/outbound-dedup-cleanup.sh +43 -0
- package/scripts/outbound-dedup.sh +476 -0
- package/scripts/outbound_dedup.py +115 -0
- package/scripts/parse-voice-transcript.mjs +486 -0
- package/scripts/pdf-generation/README.md +61 -0
- package/scripts/pdf-generation/build-document.mjs +230 -0
- package/scripts/pdf-generation/templates/board-pack.latex +136 -0
- package/scripts/pdf-generation/templates/corporate-letter.latex +126 -0
- package/scripts/pdf-generation/templates/memo.latex +114 -0
- package/scripts/poll-slack-events.sh +33 -0
- package/scripts/poller/calendar-poller.mjs +12 -0
- package/scripts/poller/gmail-poller.mjs +156 -0
- package/scripts/poller/imap-client.mjs +286 -0
- package/scripts/poller/index.mjs +73 -0
- package/scripts/poller/intra-session-check.mjs +267 -0
- package/scripts/poller/mehran-gmail-poller.mjs +98 -0
- package/scripts/poller/slack-poller.mjs +716 -0
- package/scripts/poller/trigger.mjs +47 -0
- package/scripts/poller/utils.mjs +253 -0
- package/scripts/poller-launchd/ai.adaptic.sophie-poller.plist +40 -0
- package/scripts/poller-launchd/ai.adaptic.sophie-whatsapp-handler.plist +39 -0
- package/scripts/poller-launchd/install.sh +38 -0
- package/scripts/post-interaction-indexer.py +1598 -0
- package/scripts/pre-draft-context.py +994 -0
- package/scripts/pre_draft_lookup.py +258 -0
- package/scripts/rag-indexer.py +629 -0
- package/scripts/resume-operations.sh +40 -0
- package/scripts/search-mehran-inbox.py +181 -0
- package/scripts/self-optimization/compute-metrics.py +377 -0
- package/scripts/send-difc-rfp.sh +98 -0
- package/scripts/send-email-as-mehran.py +369 -0
- package/scripts/send-email-threaded.py +336 -0
- package/scripts/send-email-with-attachment.py +360 -0
- package/scripts/send-email.sh +93 -0
- package/scripts/send-sms.sh +151 -0
- package/scripts/send-whatsapp.sh +261 -0
- package/scripts/session-start.sh +106 -0
- package/scripts/setup/configure-macos.sh +508 -0
- package/scripts/setup/init-agent.sh +450 -0
- package/scripts/slack-events-ctl.sh +177 -0
- package/scripts/slack-events-server.mjs +989 -0
- package/scripts/slack-react.mjs +89 -0
- package/scripts/slack-responded.sh +185 -0
- package/scripts/slack-send.sh +190 -0
- package/scripts/slack-typing.mjs +196 -0
- package/scripts/slack-upload-v2.py +95 -0
- package/scripts/sms-handler.mjs +436 -0
- package/scripts/sophie-inbox-poller.py +406 -0
- package/scripts/spawn-session.sh +85 -0
- package/scripts/system-verify.sh +171 -0
- package/scripts/test-email-thread-dedup.py +239 -0
- package/scripts/test-information-barriers.py +484 -0
- package/scripts/test-llm-email-dedup.py +251 -0
- package/scripts/test-pre-draft-integration.py +203 -0
- package/scripts/test-rag-phase2.sh +442 -0
- package/scripts/test-rag-search.sh +251 -0
- package/scripts/test-voice-parser.mjs +316 -0
- package/scripts/user-context-search.py +660 -0
- package/scripts/validate-outbound.py +1493 -0
- package/scripts/whatsapp-handler.mjs +525 -0
- package/teams/desktop-operations.yaml +34 -0
- package/teams/executive-office.yaml +27 -0
- package/teams/legal-and-regulatory.yaml +24 -0
- package/teams/platform-and-engineering.yaml +23 -0
- package/teams/strategy-and-growth.yaml +29 -0
- package/workflows/continuous/inbound-monitor.yaml +168 -0
- package/workflows/daily/applicant-triage.yaml +197 -0
- package/workflows/daily/comms-triage.yaml +80 -0
- package/workflows/daily/evening-wrap.yaml +65 -0
- package/workflows/daily/morning-brief.yaml +147 -0
- package/workflows/daily/slack-followup-sweep.yaml +87 -0
- package/workflows/event-driven/README.md +50 -0
- package/workflows/monthly/board-readiness.yaml +76 -0
- package/workflows/quarterly/strategic-scenario-analysis.yaml +85 -0
- package/workflows/session-protocol.md +171 -0
- package/workflows/weekly/hiring-review.yaml +169 -0
- package/workflows/weekly/rollup-pipeline-review.yaml +76 -0
- package/workflows/weekly/strategic-memo.yaml +79 -0
|
@@ -0,0 +1,1059 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Sophie Huddle — Main Server
|
|
4
|
+
*
|
|
5
|
+
* Orchestrates Slack huddle voice participation by coordinating:
|
|
6
|
+
* - HuddleController (CDP-based Slack UI automation)
|
|
7
|
+
* - AudioBridge (BlackHole capture → Deepgram STT → ElevenLabs TTS → BlackHole playback)
|
|
8
|
+
* - Claude API (conversation intelligence, reused from voice-ai)
|
|
9
|
+
*
|
|
10
|
+
* Lifecycle:
|
|
11
|
+
* 1. Connects to Slack desktop app via CDP
|
|
12
|
+
* 2. Listens for huddle invitations (Events API + DOM polling)
|
|
13
|
+
* 3. On invitation or initiate command → joins huddle
|
|
14
|
+
* 4. Captures audio → transcribes → Claude generates response → TTS → speaks
|
|
15
|
+
* 5. On huddle end → saves transcript, routes action items
|
|
16
|
+
*
|
|
17
|
+
* Usage:
|
|
18
|
+
* node huddle-server.mjs # Start and listen for huddles
|
|
19
|
+
* node huddle-server.mjs --join #general # Join huddle in #general
|
|
20
|
+
* node huddle-server.mjs --call mehran # Initiate huddle with Mehran
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
import dotenv from "dotenv";
|
|
24
|
+
import { fileURLToPath as _fu } from "node:url";
|
|
25
|
+
import { dirname as _dn, join as _jn } from "node:path";
|
|
26
|
+
|
|
27
|
+
// Load .env from sophie-ai root (where all API keys live), then huddle-specific .env
|
|
28
|
+
const _d = _dn(_fu(import.meta.url));
|
|
29
|
+
dotenv.config({ path: _jn(_d, "../..", ".env") });
|
|
30
|
+
dotenv.config({ path: _jn(_d, ".env"), override: true });
|
|
31
|
+
import { EventEmitter } from "node:events";
|
|
32
|
+
import { readFileSync, appendFileSync, mkdirSync, existsSync } from "node:fs";
|
|
33
|
+
import { join, dirname } from "node:path";
|
|
34
|
+
import { fileURLToPath } from "node:url";
|
|
35
|
+
import { createServer } from "node:http";
|
|
36
|
+
import { execFile as execFileCb } from "node:child_process";
|
|
37
|
+
import { promisify } from "node:util";
|
|
38
|
+
import Anthropic from "@anthropic-ai/sdk";
|
|
39
|
+
|
|
40
|
+
const execFileAsync = promisify(execFileCb);
|
|
41
|
+
import { HuddleController } from "./huddle-controller.mjs";
|
|
42
|
+
import { AudioBridge } from "./audio-bridge.mjs";
|
|
43
|
+
|
|
44
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
45
|
+
const SOPHIE_ROOT = join(__dirname, "../..");
|
|
46
|
+
const VOICE_AI_ROOT = join(process.env.HOME || "/Users/sophie", "voice-ai");
|
|
47
|
+
|
|
48
|
+
// ---------------------------------------------------------------------------
|
|
49
|
+
// Configuration
|
|
50
|
+
// ---------------------------------------------------------------------------
|
|
51
|
+
|
|
52
|
+
const MAX_TOKENS = 300;
|
|
53
|
+
const MAX_TOOL_ROUNDS = 3;
|
|
54
|
+
const HUDDLE_EVENTS_PORT = parseInt(process.env.HUDDLE_EVENTS_PORT || "3200", 10);
|
|
55
|
+
|
|
56
|
+
// Use Claude Code CLI (Max subscription) instead of API calls.
|
|
57
|
+
// Falls back to API if claude CLI is not available.
|
|
58
|
+
const USE_CLAUDE_CLI = process.env.HUDDLE_USE_API !== "1";
|
|
59
|
+
const anthropic = USE_CLAUDE_CLI ? null : new Anthropic({ apiKey: process.env.ANTHROPIC_API_KEY });
|
|
60
|
+
|
|
61
|
+
// ---------------------------------------------------------------------------
|
|
62
|
+
// Voice-AI tool execution (imported dynamically to handle missing voice-ai)
|
|
63
|
+
// ---------------------------------------------------------------------------
|
|
64
|
+
|
|
65
|
+
let executeAction = null;
|
|
66
|
+
let getToolsForAccessLevel = null;
|
|
67
|
+
let getToolNamesForAccessLevel = null;
|
|
68
|
+
|
|
69
|
+
try {
|
|
70
|
+
const actionMod = await import(join(VOICE_AI_ROOT, "lib/action-executor.js"));
|
|
71
|
+
executeAction = actionMod.executeAction;
|
|
72
|
+
const toolMod = await import(join(VOICE_AI_ROOT, "lib/tool-definitions.js"));
|
|
73
|
+
getToolsForAccessLevel = toolMod.getToolsForAccessLevel;
|
|
74
|
+
getToolNamesForAccessLevel = toolMod.getToolNamesForAccessLevel;
|
|
75
|
+
console.log("[INIT] Voice-AI tool execution loaded");
|
|
76
|
+
} catch (err) {
|
|
77
|
+
console.warn(`[INIT] Voice-AI tools not available (${err.message}) — huddle will be read-only`);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// ---------------------------------------------------------------------------
|
|
81
|
+
// Huddle Session State
|
|
82
|
+
// ---------------------------------------------------------------------------
|
|
83
|
+
|
|
84
|
+
/** @enum {string} */
|
|
85
|
+
const HuddleState = {
|
|
86
|
+
IDLE: "idle",
|
|
87
|
+
JOINING: "joining",
|
|
88
|
+
ACTIVE: "active",
|
|
89
|
+
LEAVING: "leaving",
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* HuddleServer is the top-level orchestrator for Sophie's huddle participation.
|
|
94
|
+
*/
|
|
95
|
+
class HuddleServer extends EventEmitter {
|
|
96
|
+
constructor() {
|
|
97
|
+
super();
|
|
98
|
+
this.controller = new HuddleController();
|
|
99
|
+
// Pass API keys explicitly because ESM import hoisting evaluates
|
|
100
|
+
// audio-bridge.mjs before dotenv.config() runs in this file
|
|
101
|
+
this.bridge = new AudioBridge({
|
|
102
|
+
deepgramKey: process.env.DEEPGRAM_API_KEY,
|
|
103
|
+
elevenLabsKey: process.env.ELEVENLABS_API_KEY,
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
this.state = HuddleState.IDLE;
|
|
107
|
+
this.session = null; // Active huddle session
|
|
108
|
+
this.autoJoin = true; // Auto-join incoming huddle invitations
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
// -------------------------------------------------------------------------
|
|
112
|
+
// Startup
|
|
113
|
+
// -------------------------------------------------------------------------
|
|
114
|
+
|
|
115
|
+
async start() {
|
|
116
|
+
console.log("\n==========================================");
|
|
117
|
+
console.log(" Sophie Huddle Server");
|
|
118
|
+
console.log(" " + new Date().toISOString());
|
|
119
|
+
console.log("==========================================\n");
|
|
120
|
+
|
|
121
|
+
// Verify audio devices
|
|
122
|
+
const devices = await this.bridge.checkDevices();
|
|
123
|
+
if (!devices.capture || !devices.playback) {
|
|
124
|
+
console.error("[INIT] Audio devices missing:");
|
|
125
|
+
console.error(` Capture (BlackHole 2ch): ${devices.capture ? "OK" : "MISSING"}`);
|
|
126
|
+
console.error(` Playback (BlackHole 16ch): ${devices.playback ? "OK" : "MISSING"}`);
|
|
127
|
+
console.error("Run: ./setup-audio.sh to install");
|
|
128
|
+
process.exit(1);
|
|
129
|
+
}
|
|
130
|
+
console.log("[INIT] Audio devices verified");
|
|
131
|
+
console.log(`[INIT] LLM mode: ${USE_CLAUDE_CLI ? "Claude Code CLI (Max subscription)" : "Anthropic API (pay-per-token)"}`);
|
|
132
|
+
|
|
133
|
+
// Connect to Slack via CDP
|
|
134
|
+
this._wireControllerEvents();
|
|
135
|
+
const connected = await this.controller.connect();
|
|
136
|
+
if (!connected) {
|
|
137
|
+
console.error("[INIT] Failed to connect to Slack via CDP");
|
|
138
|
+
console.error("Run: ./launch-slack.sh to start Slack with CDP enabled");
|
|
139
|
+
process.exit(1);
|
|
140
|
+
}
|
|
141
|
+
console.log("[INIT] Connected to Slack via CDP");
|
|
142
|
+
|
|
143
|
+
// Wire audio bridge events
|
|
144
|
+
this._wireBridgeEvents();
|
|
145
|
+
|
|
146
|
+
// Start Events API listener for reliable huddle detection
|
|
147
|
+
this._startEventsListener();
|
|
148
|
+
|
|
149
|
+
console.log("[INIT] Huddle server ready — listening for invitations\n");
|
|
150
|
+
|
|
151
|
+
// Handle CLI arguments
|
|
152
|
+
const args = process.argv.slice(2);
|
|
153
|
+
if (args[0] === "--join" && args[1]) {
|
|
154
|
+
await this.joinHuddle(args[1]);
|
|
155
|
+
} else if (args[0] === "--call" && args[1]) {
|
|
156
|
+
await this.initiateHuddle(args[1]);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
// -------------------------------------------------------------------------
|
|
161
|
+
// Huddle lifecycle
|
|
162
|
+
// -------------------------------------------------------------------------
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Join an existing huddle in a channel or DM.
|
|
166
|
+
* @param {string} channel - Channel name or person name
|
|
167
|
+
*/
|
|
168
|
+
async joinHuddle(channel) {
|
|
169
|
+
if (this.state !== HuddleState.IDLE) {
|
|
170
|
+
console.log(`[HUDDLE] Cannot join — currently ${this.state}`);
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
this.state = HuddleState.JOINING;
|
|
175
|
+
console.log(`[HUDDLE] Joining huddle in: ${channel}`);
|
|
176
|
+
|
|
177
|
+
try {
|
|
178
|
+
const joined = await this.controller.joinHuddle(channel);
|
|
179
|
+
if (!joined) {
|
|
180
|
+
console.error("[HUDDLE] Failed to join huddle");
|
|
181
|
+
this.state = HuddleState.IDLE;
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
await this._startSession(channel, "joined");
|
|
186
|
+
} catch (err) {
|
|
187
|
+
console.error(`[HUDDLE] Join error: ${err.message}`);
|
|
188
|
+
this.state = HuddleState.IDLE;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* Initiate a new huddle with a person or in a channel.
|
|
194
|
+
* @param {string} target - Channel name or person name
|
|
195
|
+
*/
|
|
196
|
+
async initiateHuddle(target) {
|
|
197
|
+
if (this.state !== HuddleState.IDLE) {
|
|
198
|
+
console.log(`[HUDDLE] Cannot initiate — currently ${this.state}`);
|
|
199
|
+
return;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
this.state = HuddleState.JOINING;
|
|
203
|
+
console.log(`[HUDDLE] Initiating huddle with: ${target}`);
|
|
204
|
+
|
|
205
|
+
try {
|
|
206
|
+
const started = await this.controller.initiateHuddle(target);
|
|
207
|
+
if (!started) {
|
|
208
|
+
console.error("[HUDDLE] Failed to start huddle");
|
|
209
|
+
this.state = HuddleState.IDLE;
|
|
210
|
+
return;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
await this._startSession(target, "initiated");
|
|
214
|
+
} catch (err) {
|
|
215
|
+
console.error(`[HUDDLE] Initiate error: ${err.message}`);
|
|
216
|
+
this.state = HuddleState.IDLE;
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* Leave the current huddle.
|
|
222
|
+
*/
|
|
223
|
+
async leaveHuddle() {
|
|
224
|
+
if (this.state !== HuddleState.ACTIVE) return;
|
|
225
|
+
|
|
226
|
+
this.state = HuddleState.LEAVING;
|
|
227
|
+
console.log("[HUDDLE] Leaving huddle...");
|
|
228
|
+
|
|
229
|
+
try {
|
|
230
|
+
await this.controller.leaveHuddle();
|
|
231
|
+
} catch (err) {
|
|
232
|
+
console.error(`[HUDDLE] Leave error: ${err.message}`);
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
await this._endSession();
|
|
236
|
+
this.state = HuddleState.IDLE;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
// -------------------------------------------------------------------------
|
|
240
|
+
// Session management
|
|
241
|
+
// -------------------------------------------------------------------------
|
|
242
|
+
|
|
243
|
+
async _startSession(channel, mode, initiator = null) {
|
|
244
|
+
// Guard: don't start a duplicate session
|
|
245
|
+
if (this.state === HuddleState.ACTIVE && this.session) {
|
|
246
|
+
console.log(`[HUDDLE] Session already active — ignoring duplicate start`);
|
|
247
|
+
return;
|
|
248
|
+
}
|
|
249
|
+
this.state = HuddleState.ACTIVE;
|
|
250
|
+
|
|
251
|
+
// Resolve who initiated the huddle for access control
|
|
252
|
+
const callerInfo = this._resolveHuddleParticipant(initiator || channel);
|
|
253
|
+
|
|
254
|
+
this.session = {
|
|
255
|
+
channel,
|
|
256
|
+
mode, // "joined" or "initiated"
|
|
257
|
+
startedAt: new Date().toISOString(),
|
|
258
|
+
messages: [],
|
|
259
|
+
transcript: [],
|
|
260
|
+
participants: [],
|
|
261
|
+
accessLevel: callerInfo.accessLevel,
|
|
262
|
+
callerSlug: callerInfo.slug,
|
|
263
|
+
callerName: callerInfo.name,
|
|
264
|
+
threadPollTimer: null, // Huddle thread message polling
|
|
265
|
+
lastThreadTs: null, // Last seen thread message timestamp
|
|
266
|
+
};
|
|
267
|
+
|
|
268
|
+
// Load live context from sophie-ai for Claude
|
|
269
|
+
this.session.liveContext = this._loadLiveContext();
|
|
270
|
+
|
|
271
|
+
// In webaudio capture mode, set Slack's speaker to physical output
|
|
272
|
+
// (eliminates AEC echo). Audio is captured directly from the WebRTC
|
|
273
|
+
// stream via CDP, so BlackHole 2ch is not needed for the speaker path.
|
|
274
|
+
if (this.bridge.captureMode === "webaudio") {
|
|
275
|
+
await this._setSlackSpeakerToDefault();
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
// Start audio bridge
|
|
279
|
+
await this.bridge.start();
|
|
280
|
+
|
|
281
|
+
console.log(`[HUDDLE] Session active in ${channel} (${mode})`);
|
|
282
|
+
this._logEvent("session-started", { channel, mode });
|
|
283
|
+
|
|
284
|
+
// Speak a greeting
|
|
285
|
+
const greeting = mode === "initiated"
|
|
286
|
+
? `Hey, do you have a moment?`
|
|
287
|
+
: `Hey, what's up?`;
|
|
288
|
+
|
|
289
|
+
await this.bridge.speak(greeting);
|
|
290
|
+
if (this.session) {
|
|
291
|
+
this.session.messages.push({ role: "assistant", content: greeting });
|
|
292
|
+
this.session.transcript.push({ speaker: "sophie", text: greeting, ts: Date.now() });
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
// Start polling the huddle thread for text messages
|
|
296
|
+
this._startThreadPolling();
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
async _endSession() {
|
|
300
|
+
if (!this.session) return;
|
|
301
|
+
|
|
302
|
+
// Stop thread polling
|
|
303
|
+
if (this.session.threadPollTimer) {
|
|
304
|
+
clearInterval(this.session.threadPollTimer);
|
|
305
|
+
this.session.threadPollTimer = null;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
// Stop audio bridge
|
|
309
|
+
await this.bridge.stop();
|
|
310
|
+
|
|
311
|
+
// Save transcript
|
|
312
|
+
this._saveTranscript();
|
|
313
|
+
|
|
314
|
+
// Log session end
|
|
315
|
+
const duration = Math.round((Date.now() - new Date(this.session.startedAt).getTime()) / 1000);
|
|
316
|
+
const turns = this.session.messages.length;
|
|
317
|
+
console.log(`[HUDDLE] Session ended — ${duration}s, ${turns} turns`);
|
|
318
|
+
this._logEvent("session-ended", {
|
|
319
|
+
channel: this.session.channel,
|
|
320
|
+
duration,
|
|
321
|
+
turns,
|
|
322
|
+
});
|
|
323
|
+
|
|
324
|
+
this.session = null;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
// -------------------------------------------------------------------------
|
|
328
|
+
// Conversation loop (adapted from voice-ai/lib/claude.js)
|
|
329
|
+
// -------------------------------------------------------------------------
|
|
330
|
+
|
|
331
|
+
/**
|
|
332
|
+
* Process a transcript from the huddle and generate Sophie's response.
|
|
333
|
+
* @param {string} userText - What someone said in the huddle
|
|
334
|
+
*/
|
|
335
|
+
async _handleTranscript(userText) {
|
|
336
|
+
if (!this.session || this.state !== HuddleState.ACTIVE) return;
|
|
337
|
+
if (!userText || !userText.trim()) return;
|
|
338
|
+
|
|
339
|
+
console.log(`[SPEECH] "${userText}"`);
|
|
340
|
+
|
|
341
|
+
// Add to conversation history
|
|
342
|
+
this.session.messages.push({ role: "user", content: userText });
|
|
343
|
+
this.session.transcript.push({ speaker: "participant", text: userText, ts: Date.now() });
|
|
344
|
+
|
|
345
|
+
try {
|
|
346
|
+
// Get Claude's response
|
|
347
|
+
const responseText = await this._getClaudeResponse(this.session.messages);
|
|
348
|
+
|
|
349
|
+
if (!responseText || !responseText.trim()) return;
|
|
350
|
+
|
|
351
|
+
console.log(`[SOPHIE] "${responseText}"`);
|
|
352
|
+
|
|
353
|
+
// Check for end signal
|
|
354
|
+
const shouldEnd = responseText.includes("END_HUDDLE");
|
|
355
|
+
const cleanResponse = responseText.replace(/\s*END_HUDDLE\s*/g, "").trim();
|
|
356
|
+
|
|
357
|
+
// Add to history
|
|
358
|
+
this.session.messages.push({ role: "assistant", content: cleanResponse });
|
|
359
|
+
this.session.transcript.push({ speaker: "sophie", text: cleanResponse, ts: Date.now() });
|
|
360
|
+
|
|
361
|
+
// Speak the response via TTS → BlackHole 16ch → Slack mic
|
|
362
|
+
await this.bridge.speak(cleanResponse);
|
|
363
|
+
|
|
364
|
+
if (shouldEnd) {
|
|
365
|
+
// Wait for TTS to finish, then leave
|
|
366
|
+
setTimeout(() => this.leaveHuddle(), 2000);
|
|
367
|
+
}
|
|
368
|
+
} catch (err) {
|
|
369
|
+
console.error(`[CLAUDE] Error: ${err.message}`);
|
|
370
|
+
|
|
371
|
+
const fallback = "Sorry, give me one second — I'm having a brief technical hiccup.";
|
|
372
|
+
await this.bridge.speak(fallback);
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
// -------------------------------------------------------------------------
|
|
377
|
+
// Huddle thread text message monitoring
|
|
378
|
+
// -------------------------------------------------------------------------
|
|
379
|
+
|
|
380
|
+
/**
|
|
381
|
+
* Start polling the huddle thread for text messages via the Slack API.
|
|
382
|
+
* Text messages in the huddle thread are injected into the conversation
|
|
383
|
+
* so Sophie can respond to both voice and text.
|
|
384
|
+
*/
|
|
385
|
+
_startThreadPolling() {
|
|
386
|
+
const slackToken = process.env.SLACK_USER_TOKEN || process.env.SLACK_BOT_TOKEN;
|
|
387
|
+
if (!slackToken) {
|
|
388
|
+
console.log("[THREAD] No Slack token — thread monitoring disabled");
|
|
389
|
+
return;
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
// Determine the huddle channel ID from the current Slack page
|
|
393
|
+
this._resolveHuddleChannelId().then((channelId) => {
|
|
394
|
+
if (!channelId) {
|
|
395
|
+
console.log("[THREAD] Could not resolve huddle channel — thread monitoring disabled");
|
|
396
|
+
return;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
console.log(`[THREAD] Monitoring huddle thread in ${channelId}`);
|
|
400
|
+
this.session.lastThreadTs = String(Date.now() / 1000); // Start from now
|
|
401
|
+
|
|
402
|
+
this.session.threadPollTimer = setInterval(async () => {
|
|
403
|
+
try {
|
|
404
|
+
await this._pollThreadMessages(channelId, slackToken);
|
|
405
|
+
} catch (err) {
|
|
406
|
+
console.error(`[THREAD] Poll error: ${err.message}`);
|
|
407
|
+
}
|
|
408
|
+
}, 5000); // Poll every 5 seconds
|
|
409
|
+
});
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
/**
|
|
413
|
+
* Resolve the current huddle's channel ID from the Slack page via CDP.
|
|
414
|
+
* @returns {Promise<string|null>}
|
|
415
|
+
*/
|
|
416
|
+
async _resolveHuddleChannelId() {
|
|
417
|
+
try {
|
|
418
|
+
const targets = await fetch("http://localhost:9222/json").then((r) => r.json());
|
|
419
|
+
const mainTarget = targets.find(
|
|
420
|
+
(t) => t.type === "page" && t.url?.includes("app.slack.com/client")
|
|
421
|
+
);
|
|
422
|
+
if (!mainTarget) return null;
|
|
423
|
+
|
|
424
|
+
// Extract channel ID from the URL: /client/TEAM_ID/CHANNEL_ID
|
|
425
|
+
const match = mainTarget.url.match(/\/client\/[A-Z0-9]+\/([A-Z0-9]+)/);
|
|
426
|
+
return match ? match[1] : null;
|
|
427
|
+
} catch {
|
|
428
|
+
return null;
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
/**
|
|
433
|
+
* Poll the Slack channel for recent messages in the huddle thread.
|
|
434
|
+
* Only processes text messages from other users (not Sophie's bot).
|
|
435
|
+
*/
|
|
436
|
+
async _pollThreadMessages(channelId, token) {
|
|
437
|
+
if (!this.session) return;
|
|
438
|
+
|
|
439
|
+
const oldest = this.session.lastThreadTs || "0";
|
|
440
|
+
const url = `https://slack.com/api/conversations.history?channel=${channelId}&oldest=${oldest}&limit=10`;
|
|
441
|
+
|
|
442
|
+
const resp = await fetch(url, {
|
|
443
|
+
headers: { Authorization: `Bearer ${token}` },
|
|
444
|
+
});
|
|
445
|
+
const data = await resp.json();
|
|
446
|
+
if (!data.ok || !data.messages || data.messages.length === 0) return;
|
|
447
|
+
|
|
448
|
+
// Sophie's user ID (skip her own messages)
|
|
449
|
+
const sophieUserId = process.env.SLACK_BOT_USER_ID || "U099N1JFPRQ";
|
|
450
|
+
|
|
451
|
+
for (const msg of data.messages.reverse()) { // oldest first
|
|
452
|
+
// Skip bot messages, Sophie's messages, and non-text messages
|
|
453
|
+
if (msg.user === sophieUserId) continue;
|
|
454
|
+
if (msg.subtype) continue; // Skip system messages
|
|
455
|
+
if (!msg.text || !msg.text.trim()) continue;
|
|
456
|
+
|
|
457
|
+
// Update last seen timestamp
|
|
458
|
+
this.session.lastThreadTs = msg.ts;
|
|
459
|
+
|
|
460
|
+
// Handle the text message like a voice transcript
|
|
461
|
+
const senderName = msg.user_profile?.display_name || msg.user || "someone";
|
|
462
|
+
const textContent = `[Text message from ${senderName}]: ${msg.text}`;
|
|
463
|
+
|
|
464
|
+
console.log(`[THREAD] ${textContent}`);
|
|
465
|
+
this.session.transcript.push({ speaker: "text", text: textContent, ts: Date.now() });
|
|
466
|
+
|
|
467
|
+
// Add to conversation and generate response
|
|
468
|
+
await this._handleTranscript(textContent);
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
/**
|
|
473
|
+
* Get a response from Claude given the conversation history.
|
|
474
|
+
* Uses Claude Code CLI (Max subscription) by default, falling back
|
|
475
|
+
* to the Anthropic API if CLI is unavailable or HUDDLE_USE_API=1.
|
|
476
|
+
*
|
|
477
|
+
* @param {Array} messages - Conversation history [{role, content}]
|
|
478
|
+
* @returns {Promise<string>} Response text
|
|
479
|
+
*/
|
|
480
|
+
async _getClaudeResponse(messages) {
|
|
481
|
+
if (USE_CLAUDE_CLI) {
|
|
482
|
+
return this._getClaudeResponseCLI(messages);
|
|
483
|
+
}
|
|
484
|
+
return this._getClaudeResponseAPI(messages);
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
/**
|
|
488
|
+
* Get a response via Claude Code CLI (uses Max subscription).
|
|
489
|
+
* Constructs a prompt from system + conversation history and pipes
|
|
490
|
+
* it through `claude --print`.
|
|
491
|
+
*/
|
|
492
|
+
async _getClaudeResponseCLI(messages) {
|
|
493
|
+
const systemPrompt = this._buildSystemPrompt();
|
|
494
|
+
|
|
495
|
+
// Build a single prompt from system + conversation history
|
|
496
|
+
const parts = [`[System]\n${systemPrompt}\n`];
|
|
497
|
+
for (const msg of messages) {
|
|
498
|
+
const role = msg.role === "assistant" ? "Sophie" : "Participant";
|
|
499
|
+
const content = typeof msg.content === "string"
|
|
500
|
+
? msg.content
|
|
501
|
+
: msg.content?.map((b) => b.text || "").join("") || "";
|
|
502
|
+
if (content.trim()) {
|
|
503
|
+
parts.push(`[${role}]\n${content}`);
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
parts.push("[Sophie]");
|
|
507
|
+
|
|
508
|
+
const prompt = parts.join("\n\n");
|
|
509
|
+
|
|
510
|
+
const { stdout } = await execFileAsync("claude", [
|
|
511
|
+
"--print",
|
|
512
|
+
"--model", "sonnet",
|
|
513
|
+
"-p", prompt,
|
|
514
|
+
], {
|
|
515
|
+
timeout: 30000,
|
|
516
|
+
maxBuffer: 1024 * 1024,
|
|
517
|
+
env: { ...process.env, TERM: "dumb" },
|
|
518
|
+
});
|
|
519
|
+
|
|
520
|
+
return (stdout || "").trim();
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
/**
|
|
524
|
+
* Get a response via Anthropic API (pay-per-token fallback).
|
|
525
|
+
* Supports tool use with multi-round execution.
|
|
526
|
+
*/
|
|
527
|
+
async _getClaudeResponseAPI(messages) {
|
|
528
|
+
const systemPrompt = this._buildSystemPrompt();
|
|
529
|
+
const accessLevel = this.session?.accessLevel || "default";
|
|
530
|
+
const tools = getToolsForAccessLevel ? getToolsForAccessLevel(accessLevel) : [];
|
|
531
|
+
|
|
532
|
+
const apiParams = {
|
|
533
|
+
model: "claude-sonnet-4-20250514",
|
|
534
|
+
max_tokens: MAX_TOKENS,
|
|
535
|
+
system: systemPrompt,
|
|
536
|
+
messages: [...messages],
|
|
537
|
+
};
|
|
538
|
+
|
|
539
|
+
if (tools.length > 0) {
|
|
540
|
+
apiParams.tools = tools;
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
let fullResponse = "";
|
|
544
|
+
let round = 0;
|
|
545
|
+
|
|
546
|
+
while (round < MAX_TOOL_ROUNDS) {
|
|
547
|
+
round++;
|
|
548
|
+
const response = await anthropic.messages.create(apiParams);
|
|
549
|
+
|
|
550
|
+
const textParts = [];
|
|
551
|
+
const toolUseBlocks = [];
|
|
552
|
+
|
|
553
|
+
for (const block of response.content) {
|
|
554
|
+
if (block.type === "text") {
|
|
555
|
+
textParts.push(block.text);
|
|
556
|
+
} else if (block.type === "tool_use") {
|
|
557
|
+
toolUseBlocks.push(block);
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
const roundText = textParts.join("");
|
|
562
|
+
fullResponse += roundText;
|
|
563
|
+
|
|
564
|
+
if (toolUseBlocks.length === 0) break;
|
|
565
|
+
|
|
566
|
+
if (roundText.trim()) {
|
|
567
|
+
const filler = roundText.replace(/\s*END_HUDDLE\s*/g, "").trim();
|
|
568
|
+
if (filler) {
|
|
569
|
+
await this.bridge.speak(filler);
|
|
570
|
+
if (this.session) {
|
|
571
|
+
this.session.transcript.push({ speaker: "sophie", text: filler, ts: Date.now() });
|
|
572
|
+
}
|
|
573
|
+
}
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
const assistantContent = [];
|
|
577
|
+
if (roundText.trim()) {
|
|
578
|
+
assistantContent.push({ type: "text", text: roundText });
|
|
579
|
+
}
|
|
580
|
+
for (const tb of toolUseBlocks) {
|
|
581
|
+
assistantContent.push({ type: "tool_use", id: tb.id, name: tb.name, input: tb.input });
|
|
582
|
+
}
|
|
583
|
+
apiParams.messages.push({ role: "assistant", content: assistantContent });
|
|
584
|
+
|
|
585
|
+
const toolResults = [];
|
|
586
|
+
for (const tb of toolUseBlocks) {
|
|
587
|
+
console.log(`[TOOL] Executing: ${tb.name}`);
|
|
588
|
+
this._logEvent("tool-call", { tool: tb.name, input: tb.input });
|
|
589
|
+
|
|
590
|
+
if (executeAction) {
|
|
591
|
+
const callerInfo = {
|
|
592
|
+
slug: this.session?.callerSlug || "huddle-participant",
|
|
593
|
+
name: this.session?.callerName || "Huddle Participant",
|
|
594
|
+
accessLevel,
|
|
595
|
+
};
|
|
596
|
+
const result = await executeAction(tb.name, tb.input, callerInfo, `huddle-${Date.now()}`);
|
|
597
|
+
toolResults.push({ type: "tool_result", tool_use_id: tb.id, content: result.result });
|
|
598
|
+
console.log(`[TOOL] ${tb.name}: ${result.success ? "OK" : "FAILED"}`);
|
|
599
|
+
} else {
|
|
600
|
+
toolResults.push({
|
|
601
|
+
type: "tool_result",
|
|
602
|
+
tool_use_id: tb.id,
|
|
603
|
+
content: "Tool execution not available in this session.",
|
|
604
|
+
});
|
|
605
|
+
}
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
apiParams.messages.push({ role: "user", content: toolResults });
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
return fullResponse.trim();
|
|
612
|
+
}
|
|
613
|
+
|
|
614
|
+
// -------------------------------------------------------------------------
|
|
615
|
+
// Participant resolution (for access control + personalization)
|
|
616
|
+
// -------------------------------------------------------------------------
|
|
617
|
+
|
|
618
|
+
/**
|
|
619
|
+
* Resolve a huddle participant's identity from sophie-ai contacts/profiles.
|
|
620
|
+
* Used for access control (CEO gets write tools) and personalized greetings.
|
|
621
|
+
*/
|
|
622
|
+
_resolveHuddleParticipant(identifier) {
|
|
623
|
+
// Known mappings — channel names and person names to access levels
|
|
624
|
+
const knownParticipants = {
|
|
625
|
+
"mehran": { slug: "mehran-granfar", name: "Mehran Granfar", accessLevel: "ceo" },
|
|
626
|
+
"mehran-granfar": { slug: "mehran-granfar", name: "Mehran Granfar", accessLevel: "ceo" },
|
|
627
|
+
"hootan": { slug: "hootan-yazhari", name: "Hootan Yazhari", accessLevel: "leadership" },
|
|
628
|
+
"nima": { slug: "nima-masroori", name: "Nima Masroori", accessLevel: "leadership" },
|
|
629
|
+
"#ceo-office": { slug: "ceo-office", name: "CEO Office Channel", accessLevel: "ceo" },
|
|
630
|
+
};
|
|
631
|
+
|
|
632
|
+
const key = (identifier || "").toLowerCase().replace(/^#/, "");
|
|
633
|
+
const match = knownParticipants[key];
|
|
634
|
+
|
|
635
|
+
if (match) return match;
|
|
636
|
+
|
|
637
|
+
// Try loading from contacts.yaml
|
|
638
|
+
try {
|
|
639
|
+
const contactsPath = join(SOPHIE_ROOT, "config/contacts.yaml");
|
|
640
|
+
const contacts = readFileSync(contactsPath, "utf8");
|
|
641
|
+
// Simple search — look for the identifier in the contacts file
|
|
642
|
+
if (contacts.toLowerCase().includes(key)) {
|
|
643
|
+
// If found in contacts, give default access
|
|
644
|
+
return { slug: key, name: identifier, accessLevel: "default" };
|
|
645
|
+
}
|
|
646
|
+
} catch { /* optional */ }
|
|
647
|
+
|
|
648
|
+
return { slug: "unknown", name: identifier || "Unknown", accessLevel: "default" };
|
|
649
|
+
}
|
|
650
|
+
|
|
651
|
+
// -------------------------------------------------------------------------
|
|
652
|
+
// Slack Events API listener (huddle detection)
|
|
653
|
+
// -------------------------------------------------------------------------
|
|
654
|
+
|
|
655
|
+
/**
|
|
656
|
+
* Start a lightweight HTTP server that receives forwarded huddle events
|
|
657
|
+
* from the main slack-events-server.mjs. This provides a more reliable
|
|
658
|
+
* huddle detection path than DOM polling alone.
|
|
659
|
+
*/
|
|
660
|
+
_startEventsListener() {
|
|
661
|
+
this.eventsServer = createServer((req, res) => {
|
|
662
|
+
if (req.method !== "POST" || req.url !== "/huddle-event") {
|
|
663
|
+
res.writeHead(404);
|
|
664
|
+
res.end();
|
|
665
|
+
return;
|
|
666
|
+
}
|
|
667
|
+
|
|
668
|
+
let body = "";
|
|
669
|
+
req.on("data", (chunk) => { body += chunk; });
|
|
670
|
+
req.on("end", () => {
|
|
671
|
+
res.writeHead(200, { "Content-Type": "application/json" });
|
|
672
|
+
res.end('{"ok":true}');
|
|
673
|
+
|
|
674
|
+
try {
|
|
675
|
+
const event = JSON.parse(body);
|
|
676
|
+
this._handleHuddleEvent(event);
|
|
677
|
+
} catch (err) {
|
|
678
|
+
console.error(`[EVENTS] Parse error: ${err.message}`);
|
|
679
|
+
}
|
|
680
|
+
});
|
|
681
|
+
});
|
|
682
|
+
|
|
683
|
+
this.eventsServer.listen(HUDDLE_EVENTS_PORT, "127.0.0.1", () => {
|
|
684
|
+
console.log(`[EVENTS] Huddle event listener on port ${HUDDLE_EVENTS_PORT}`);
|
|
685
|
+
});
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
/**
|
|
689
|
+
* Handle a huddle event forwarded from the Slack Events API.
|
|
690
|
+
* Event shape: { user, huddle_state, channel, channel_type }
|
|
691
|
+
*/
|
|
692
|
+
_handleHuddleEvent(event) {
|
|
693
|
+
const { user, user_name, huddle_state, channel, channel_type } = event;
|
|
694
|
+
|
|
695
|
+
console.log(`[EVENTS] Huddle event: ${user_name || user} → ${huddle_state} in ${channel || "unknown"}`);
|
|
696
|
+
this._logEvent("events-api-huddle", event);
|
|
697
|
+
|
|
698
|
+
// Someone started a huddle and Sophie isn't in one yet
|
|
699
|
+
if (huddle_state === "in_a_huddle" && this.state === HuddleState.IDLE && this.autoJoin) {
|
|
700
|
+
// Determine the channel to join
|
|
701
|
+
const targetChannel = channel || user_name;
|
|
702
|
+
if (targetChannel) {
|
|
703
|
+
console.log(`[EVENTS] Huddle detected — auto-joining ${targetChannel}`);
|
|
704
|
+
this.joinHuddle(targetChannel);
|
|
705
|
+
}
|
|
706
|
+
}
|
|
707
|
+
}
|
|
708
|
+
|
|
709
|
+
// -------------------------------------------------------------------------
|
|
710
|
+
// System prompt (adapted for huddle context)
|
|
711
|
+
// -------------------------------------------------------------------------
|
|
712
|
+
|
|
713
|
+
_buildSystemPrompt() {
|
|
714
|
+
const liveContextBlock = this.session?.liveContext
|
|
715
|
+
? `\n\nLIVE CONTEXT:\n${this.session.liveContext}`
|
|
716
|
+
: "";
|
|
717
|
+
|
|
718
|
+
return `${HUDDLE_SYSTEM_PROMPT}${liveContextBlock}`;
|
|
719
|
+
}
|
|
720
|
+
|
|
721
|
+
// -------------------------------------------------------------------------
|
|
722
|
+
// Live context loader (reads from sophie-ai state files)
|
|
723
|
+
// -------------------------------------------------------------------------
|
|
724
|
+
|
|
725
|
+
_loadLiveContext() {
|
|
726
|
+
const contextParts = [];
|
|
727
|
+
|
|
728
|
+
// Load priorities
|
|
729
|
+
try {
|
|
730
|
+
const priorities = readFileSync(join(SOPHIE_ROOT, "config/priorities.yaml"), "utf8");
|
|
731
|
+
contextParts.push(`PRIORITIES:\n${priorities.slice(0, 2000)}`);
|
|
732
|
+
} catch { /* optional */ }
|
|
733
|
+
|
|
734
|
+
// Load executive summary
|
|
735
|
+
try {
|
|
736
|
+
const summary = readFileSync(join(SOPHIE_ROOT, "state/dashboards/executive-summary.yaml"), "utf8");
|
|
737
|
+
contextParts.push(`EXECUTIVE SUMMARY:\n${summary.slice(0, 3000)}`);
|
|
738
|
+
} catch { /* optional */ }
|
|
739
|
+
|
|
740
|
+
return contextParts.join("\n\n");
|
|
741
|
+
}
|
|
742
|
+
|
|
743
|
+
// -------------------------------------------------------------------------
|
|
744
|
+
// Event wiring
|
|
745
|
+
// -------------------------------------------------------------------------
|
|
746
|
+
|
|
747
|
+
_wireControllerEvents() {
|
|
748
|
+
this.controller.on("connected", () => {
|
|
749
|
+
console.log("[CDP] Connected to Slack");
|
|
750
|
+
});
|
|
751
|
+
|
|
752
|
+
this.controller.on("disconnected", () => {
|
|
753
|
+
console.log("[CDP] Disconnected from Slack — reconnecting...");
|
|
754
|
+
});
|
|
755
|
+
|
|
756
|
+
this.controller.on("huddle:invitation", async (data) => {
|
|
757
|
+
console.log(`[HUDDLE] Incoming invitation from ${data.from} in ${data.channel}`);
|
|
758
|
+
this._logEvent("invitation-received", data);
|
|
759
|
+
|
|
760
|
+
if (this.autoJoin && this.state === HuddleState.IDLE) {
|
|
761
|
+
console.log("[HUDDLE] Auto-joining...");
|
|
762
|
+
await this.controller.acceptInvitation();
|
|
763
|
+
await this._startSession(data.channel, "joined");
|
|
764
|
+
}
|
|
765
|
+
});
|
|
766
|
+
|
|
767
|
+
this.controller.on("huddle:joined", async (data) => {
|
|
768
|
+
console.log(`[HUDDLE] Active huddle detected: ${data.channel}`);
|
|
769
|
+
if (this.state === HuddleState.IDLE) {
|
|
770
|
+
await this._startSession(data.channel, "joined");
|
|
771
|
+
}
|
|
772
|
+
});
|
|
773
|
+
|
|
774
|
+
this.controller.on("huddle:left", async () => {
|
|
775
|
+
if (this.state === HuddleState.ACTIVE) {
|
|
776
|
+
// Debounce: the polling can falsely detect "left" when the huddle
|
|
777
|
+
// runs in a separate window and the main window DOM is temporarily
|
|
778
|
+
// empty. Wait 5 seconds and re-check before ending the session.
|
|
779
|
+
console.log("[HUDDLE] Huddle may have ended — verifying in 5s...");
|
|
780
|
+
await new Promise((r) => setTimeout(r, 5000));
|
|
781
|
+
const stillActive = await this.controller.isInHuddle();
|
|
782
|
+
if (!stillActive && this.state === HuddleState.ACTIVE) {
|
|
783
|
+
console.log("[HUDDLE] Confirmed: huddle ended");
|
|
784
|
+
await this._endSession();
|
|
785
|
+
this.state = HuddleState.IDLE;
|
|
786
|
+
} else {
|
|
787
|
+
console.log("[HUDDLE] False alarm — huddle is still active");
|
|
788
|
+
}
|
|
789
|
+
}
|
|
790
|
+
});
|
|
791
|
+
|
|
792
|
+
this.controller.on("error", (err) => {
|
|
793
|
+
console.error(`[CDP] Error: ${err.message} — ${err.detail || ""}`);
|
|
794
|
+
});
|
|
795
|
+
}
|
|
796
|
+
|
|
797
|
+
_wireBridgeEvents() {
|
|
798
|
+
this.bridge.on("transcript", (data) => {
|
|
799
|
+
// Final transcript — process with Claude
|
|
800
|
+
this._handleTranscript(data.text);
|
|
801
|
+
});
|
|
802
|
+
|
|
803
|
+
this.bridge.on("transcript:interim", (data) => {
|
|
804
|
+
// Interim transcript — show for debugging
|
|
805
|
+
process.stdout.write(`\r[INTERIM] ${data.text} `);
|
|
806
|
+
});
|
|
807
|
+
|
|
808
|
+
this.bridge.on("speech:start", () => {
|
|
809
|
+
// Someone started talking
|
|
810
|
+
});
|
|
811
|
+
|
|
812
|
+
this.bridge.on("speech:end", () => {
|
|
813
|
+
process.stdout.write("\r" + " ".repeat(80) + "\r"); // Clear interim line
|
|
814
|
+
});
|
|
815
|
+
|
|
816
|
+
this.bridge.on("tts:start", async (data) => {
|
|
817
|
+
console.log(`[TTS] Speaking: "${data.text.substring(0, 60)}..."`);
|
|
818
|
+
// Unmute Slack mic so TTS audio reaches the huddle
|
|
819
|
+
await this._setSlackMicMute(false);
|
|
820
|
+
});
|
|
821
|
+
|
|
822
|
+
this.bridge.on("tts:end", async () => {
|
|
823
|
+
// Re-mute Slack mic after TTS to prevent echo
|
|
824
|
+
// Small delay to ensure the last audio samples are transmitted
|
|
825
|
+
setTimeout(() => this._setSlackMicMute(true), 300);
|
|
826
|
+
});
|
|
827
|
+
|
|
828
|
+
this.bridge.on("error", (err) => {
|
|
829
|
+
console.error(`[BRIDGE] ${err.component} error: ${err.message}`);
|
|
830
|
+
});
|
|
831
|
+
}
|
|
832
|
+
|
|
833
|
+
// -------------------------------------------------------------------------
|
|
834
|
+
// Slack mic mute control (half-duplex echo prevention)
|
|
835
|
+
// -------------------------------------------------------------------------
|
|
836
|
+
|
|
837
|
+
/**
|
|
838
|
+
* Toggle Sophie's Slack mic mute via CDP on the huddle window.
|
|
839
|
+
* Keeps mic muted between TTS outputs to prevent echo from the
|
|
840
|
+
* virtual audio loopback.
|
|
841
|
+
* @param {boolean} muted - true to mute, false to unmute
|
|
842
|
+
*/
|
|
843
|
+
async _setSlackMicMute(muted) {
|
|
844
|
+
// In webaudio mode, mic muting for echo prevention is unnecessary —
|
|
845
|
+
// the echo is eliminated at the capture level, not the mic level.
|
|
846
|
+
if (this.bridge.captureMode === "webaudio") return;
|
|
847
|
+
try {
|
|
848
|
+
const targets = await fetch("http://localhost:9222/json").then((r) => r.json());
|
|
849
|
+
const huddleTarget = targets.find(
|
|
850
|
+
(t) => t.type === "page" && (t.title?.includes("Huddle:") || t.title?.includes("🎤"))
|
|
851
|
+
);
|
|
852
|
+
if (!huddleTarget) return;
|
|
853
|
+
|
|
854
|
+
const ws = new (await import("ws")).WebSocket(huddleTarget.webSocketDebuggerUrl);
|
|
855
|
+
await new Promise((resolve, reject) => {
|
|
856
|
+
ws.on("error", reject);
|
|
857
|
+
ws.on("open", () => {
|
|
858
|
+
ws.send(JSON.stringify({
|
|
859
|
+
id: 1,
|
|
860
|
+
method: "Runtime.evaluate",
|
|
861
|
+
params: {
|
|
862
|
+
expression: `(() => {
|
|
863
|
+
const muteBtn = document.querySelector('[data-qa="segmented-mute-button-main"]');
|
|
864
|
+
if (!muteBtn) return "no-mute-btn";
|
|
865
|
+
const label = (muteBtn.getAttribute("aria-label") || "").toLowerCase();
|
|
866
|
+
const currentlyMuted = label.includes("unmute");
|
|
867
|
+
if (currentlyMuted === ${muted}) return "already-${muted ? "muted" : "unmuted"}";
|
|
868
|
+
muteBtn.click();
|
|
869
|
+
return "${muted ? "muted" : "unmuted"}";
|
|
870
|
+
})()`,
|
|
871
|
+
returnByValue: true,
|
|
872
|
+
},
|
|
873
|
+
}));
|
|
874
|
+
});
|
|
875
|
+
ws.on("message", (data) => {
|
|
876
|
+
const msg = JSON.parse(data.toString());
|
|
877
|
+
if (msg.id === 1) {
|
|
878
|
+
const result = msg.result?.result?.value || "unknown";
|
|
879
|
+
if (result !== "already-muted" && result !== "already-unmuted") {
|
|
880
|
+
console.log(`[MIC] ${result}`);
|
|
881
|
+
}
|
|
882
|
+
ws.close();
|
|
883
|
+
resolve();
|
|
884
|
+
}
|
|
885
|
+
});
|
|
886
|
+
});
|
|
887
|
+
} catch {
|
|
888
|
+
// Non-fatal — mute toggle failed silently
|
|
889
|
+
}
|
|
890
|
+
}
|
|
891
|
+
|
|
892
|
+
/**
|
|
893
|
+
* Set Slack's speaker output to "default" (physical speakers) via CDP.
|
|
894
|
+
* Used in webaudio capture mode to eliminate AEC echo — audio is captured
|
|
895
|
+
* directly from the WebRTC stream, so BlackHole 2ch isn't needed.
|
|
896
|
+
*/
|
|
897
|
+
async _setSlackSpeakerToDefault() {
|
|
898
|
+
try {
|
|
899
|
+
const targets = await fetch("http://localhost:9222/json").then((r) => r.json());
|
|
900
|
+
const mainTarget = targets.find(
|
|
901
|
+
(t) => t.type === "page" && t.url?.includes("app.slack.com/client")
|
|
902
|
+
);
|
|
903
|
+
if (!mainTarget) return;
|
|
904
|
+
|
|
905
|
+
const ws = new (await import("ws")).WebSocket(mainTarget.webSocketDebuggerUrl);
|
|
906
|
+
await new Promise((resolve) => {
|
|
907
|
+
ws.on("error", () => resolve());
|
|
908
|
+
ws.on("open", () => {
|
|
909
|
+
ws.send(JSON.stringify({
|
|
910
|
+
id: 1,
|
|
911
|
+
method: "Runtime.evaluate",
|
|
912
|
+
params: {
|
|
913
|
+
expression: `(async () => {
|
|
914
|
+
// Set speaker preference to default (physical speakers)
|
|
915
|
+
const inputId = "9f391a3f2efb9f50f9dc8dea1534700bcc5d4e0478b56438930a2071401b25bb";
|
|
916
|
+
localStorage.setItem("preferred-media-devices",
|
|
917
|
+
JSON.stringify({ audioinput: inputId, audiooutput: "default" }));
|
|
918
|
+
|
|
919
|
+
// Also change the active audio element's output immediately
|
|
920
|
+
for (const audio of document.querySelectorAll("audio")) {
|
|
921
|
+
try { await audio.setSinkId("default"); } catch {}
|
|
922
|
+
}
|
|
923
|
+
return "speaker set to default";
|
|
924
|
+
})()`,
|
|
925
|
+
returnByValue: true,
|
|
926
|
+
awaitPromise: true,
|
|
927
|
+
},
|
|
928
|
+
}));
|
|
929
|
+
});
|
|
930
|
+
ws.on("message", (data) => {
|
|
931
|
+
const msg = JSON.parse(data.toString());
|
|
932
|
+
if (msg.id === 1) {
|
|
933
|
+
console.log(`[AUDIO] Slack speaker → physical (${msg.result?.result?.value})`);
|
|
934
|
+
ws.close();
|
|
935
|
+
resolve();
|
|
936
|
+
}
|
|
937
|
+
});
|
|
938
|
+
});
|
|
939
|
+
} catch {
|
|
940
|
+
// Non-fatal
|
|
941
|
+
}
|
|
942
|
+
}
|
|
943
|
+
|
|
944
|
+
// -------------------------------------------------------------------------
|
|
945
|
+
// Logging & transcript persistence
|
|
946
|
+
// -------------------------------------------------------------------------
|
|
947
|
+
|
|
948
|
+
_logEvent(event, data = {}) {
|
|
949
|
+
const logDir = join(SOPHIE_ROOT, "logs/huddle");
|
|
950
|
+
mkdirSync(logDir, { recursive: true });
|
|
951
|
+
|
|
952
|
+
const date = new Date().toISOString().split("T")[0];
|
|
953
|
+
const logFile = join(logDir, `${date}-huddle-events.jsonl`);
|
|
954
|
+
|
|
955
|
+
const entry = {
|
|
956
|
+
timestamp: new Date().toISOString(),
|
|
957
|
+
event,
|
|
958
|
+
...data,
|
|
959
|
+
};
|
|
960
|
+
|
|
961
|
+
appendFileSync(logFile, JSON.stringify(entry) + "\n");
|
|
962
|
+
}
|
|
963
|
+
|
|
964
|
+
_saveTranscript() {
|
|
965
|
+
if (!this.session || this.session.transcript.length === 0) return;
|
|
966
|
+
|
|
967
|
+
const logDir = join(SOPHIE_ROOT, "logs/huddle");
|
|
968
|
+
mkdirSync(logDir, { recursive: true });
|
|
969
|
+
|
|
970
|
+
const date = new Date().toISOString().split("T")[0];
|
|
971
|
+
const ts = Date.now();
|
|
972
|
+
const channel = (this.session.channel || "unknown").replace(/[^a-zA-Z0-9-]/g, "_");
|
|
973
|
+
const transcriptFile = join(logDir, `${date}-transcript-${channel}-${ts}.jsonl`);
|
|
974
|
+
|
|
975
|
+
for (const entry of this.session.transcript) {
|
|
976
|
+
appendFileSync(transcriptFile, JSON.stringify(entry) + "\n");
|
|
977
|
+
}
|
|
978
|
+
|
|
979
|
+
console.log(`[TRANSCRIPT] Saved to ${transcriptFile}`);
|
|
980
|
+
}
|
|
981
|
+
}
|
|
982
|
+
|
|
983
|
+
// ---------------------------------------------------------------------------
|
|
984
|
+
// Huddle-specific system prompt
|
|
985
|
+
// ---------------------------------------------------------------------------
|
|
986
|
+
|
|
987
|
+
const HUDDLE_SYSTEM_PROMPT = `You are Sophie Nguyen, Chief of Staff to Mehran Granfar, CEO of Adaptic.ai.
|
|
988
|
+
You are participating in a Slack huddle — a real-time voice conversation.
|
|
989
|
+
|
|
990
|
+
PERSONALITY:
|
|
991
|
+
- Natural, conversational, warm — this is a casual voice huddle, not a formal call
|
|
992
|
+
- Concise responses — two to three sentences maximum per turn
|
|
993
|
+
- Use contractions, casual phrasing, natural filler words
|
|
994
|
+
- Match the energy of the other participants — if they are casual, be casual
|
|
995
|
+
- If they are discussing something serious, be appropriately focused
|
|
996
|
+
|
|
997
|
+
ABOUT ADAPTIC:
|
|
998
|
+
- Adaptic is a global AI-native institutional asset management group
|
|
999
|
+
- Headquartered in DIFC, Dubai with entities across seven plus jurisdictions
|
|
1000
|
+
- CEO and founder: Mehran Granfar
|
|
1001
|
+
- Building Adaptic OS, an algorithmic trading platform
|
|
1002
|
+
- Currently in regulatory licensing phase
|
|
1003
|
+
|
|
1004
|
+
HUDDLE RULES:
|
|
1005
|
+
- Huddles are informal — keep responses short and natural
|
|
1006
|
+
- Listen more than you talk — do not dominate the conversation
|
|
1007
|
+
- If asked a direct question, answer it concisely
|
|
1008
|
+
- If you hear a request or action item, confirm it: "Got it, I will take care of that"
|
|
1009
|
+
- If you cannot help with something, say so briefly
|
|
1010
|
+
- If the conversation naturally ends or someone says goodbye, respond with a brief farewell and end your response with END_HUDDLE on its own line
|
|
1011
|
+
|
|
1012
|
+
MULTI-SPEAKER AWARENESS:
|
|
1013
|
+
- Multiple people may be in the huddle
|
|
1014
|
+
- You may not always know who is speaking — that is okay
|
|
1015
|
+
- If someone introduces themselves, use their name
|
|
1016
|
+
- Do not assume all speech is from one person
|
|
1017
|
+
|
|
1018
|
+
SPEECH RULES:
|
|
1019
|
+
- Never use special characters, markdown, bullet points, or formatting
|
|
1020
|
+
- Spell out numbers in words
|
|
1021
|
+
- Keep it conversational — say "yeah" not "yes indeed"
|
|
1022
|
+
- Do not use emojis
|
|
1023
|
+
- When saying email addresses, use "at" and "dot" instead of symbols
|
|
1024
|
+
|
|
1025
|
+
CRITICAL — DO NOT REPEAT YOURSELF:
|
|
1026
|
+
- Never re-introduce yourself after the initial greeting
|
|
1027
|
+
- Each response should add new information or move the conversation forward
|
|
1028
|
+
- If you already answered a question, do not repeat the answer`;
|
|
1029
|
+
|
|
1030
|
+
// ---------------------------------------------------------------------------
|
|
1031
|
+
// Main
|
|
1032
|
+
// ---------------------------------------------------------------------------
|
|
1033
|
+
|
|
1034
|
+
const server = new HuddleServer();
|
|
1035
|
+
|
|
1036
|
+
// Graceful shutdown
|
|
1037
|
+
process.on("SIGINT", async () => {
|
|
1038
|
+
console.log("\n[SHUTDOWN] Shutting down huddle server...");
|
|
1039
|
+
if (server.state === HuddleState.ACTIVE) {
|
|
1040
|
+
await server.bridge.speak("I need to go — talk soon.");
|
|
1041
|
+
await server.leaveHuddle();
|
|
1042
|
+
}
|
|
1043
|
+
await server.controller.disconnect();
|
|
1044
|
+
process.exit(0);
|
|
1045
|
+
});
|
|
1046
|
+
|
|
1047
|
+
process.on("SIGTERM", async () => {
|
|
1048
|
+
if (server.state === HuddleState.ACTIVE) {
|
|
1049
|
+
await server.leaveHuddle();
|
|
1050
|
+
}
|
|
1051
|
+
await server.controller.disconnect();
|
|
1052
|
+
process.exit(0);
|
|
1053
|
+
});
|
|
1054
|
+
|
|
1055
|
+
// Start
|
|
1056
|
+
server.start().catch((err) => {
|
|
1057
|
+
console.error(`[FATAL] ${err.message}`);
|
|
1058
|
+
process.exit(1);
|
|
1059
|
+
});
|