@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,994 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""Pre-draft fact retrieval module — Memory Enhancement Phase 4.
|
|
3
|
+
|
|
4
|
+
Pulls relevant entity context BEFORE composing any outbound message.
|
|
5
|
+
Closes the gap where Sophie drafts messages without first checking what
|
|
6
|
+
she knows about the recipient and related entities.
|
|
7
|
+
|
|
8
|
+
Integration points — call this script before any of these send scripts:
|
|
9
|
+
- scripts/send-email-threaded.py (email composition)
|
|
10
|
+
- scripts/slack-send.sh (Slack messaging)
|
|
11
|
+
- scripts/send-whatsapp.sh (WhatsApp messaging)
|
|
12
|
+
|
|
13
|
+
Usage:
|
|
14
|
+
python3 scripts/pre-draft-context.py --recipient "Graham Syder"
|
|
15
|
+
python3 scripts/pre-draft-context.py --recipient "Graham Syder" --topic "fitout"
|
|
16
|
+
python3 scripts/pre-draft-context.py --recipient "hootan@adaptic.ai" --format brief
|
|
17
|
+
python3 scripts/pre-draft-context.py --recipient "Nima" --topic "83b election" --format brief
|
|
18
|
+
|
|
19
|
+
Output:
|
|
20
|
+
--format json (default) → Full structured JSON to stdout
|
|
21
|
+
--format brief → 3-5 line summary suitable for prompt injection
|
|
22
|
+
|
|
23
|
+
Performance target: < 500ms (no API calls — file reads only).
|
|
24
|
+
Exit codes: 0 = context found, 1 = recipient not found, 2 = error
|
|
25
|
+
|
|
26
|
+
Created: 2026-04-04 — Memory Enhancement Phase 4
|
|
27
|
+
"""
|
|
28
|
+
import argparse
|
|
29
|
+
import json
|
|
30
|
+
import re
|
|
31
|
+
import sys
|
|
32
|
+
import time
|
|
33
|
+
from pathlib import Path
|
|
34
|
+
|
|
35
|
+
# Try to import PyYAML at module level (avoids repeated import overhead)
|
|
36
|
+
_yaml_mod = None
|
|
37
|
+
_yaml_loader = None
|
|
38
|
+
try:
|
|
39
|
+
import yaml as _yaml_mod
|
|
40
|
+
try:
|
|
41
|
+
_yaml_loader = _yaml_mod.CSafeLoader # C extension — 10x faster
|
|
42
|
+
except AttributeError:
|
|
43
|
+
_yaml_loader = None
|
|
44
|
+
except ImportError:
|
|
45
|
+
pass
|
|
46
|
+
|
|
47
|
+
# ─────────────────────────────────────────────
|
|
48
|
+
# Path resolution
|
|
49
|
+
# ─────────────────────────────────────────────
|
|
50
|
+
SCRIPT_DIR = Path(__file__).resolve().parent
|
|
51
|
+
REPO_ROOT = SCRIPT_DIR.parent
|
|
52
|
+
|
|
53
|
+
ENTITY_INDEX_PATH = REPO_ROOT / "memory" / "indexes" / "entity-relationships.yaml"
|
|
54
|
+
ENTITY_INDEX_CACHE_PATH = REPO_ROOT / "memory" / "indexes" / ".entity-relationships.json"
|
|
55
|
+
USER_PROFILES_DIR = REPO_ROOT / "memory" / "profiles" / "users"
|
|
56
|
+
QUEUES_DIR = REPO_ROOT / "state" / "queues"
|
|
57
|
+
INTERACTIONS_DIR = REPO_ROOT / "memory" / "interactions"
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
# ─────────────────────────────────────────────
|
|
61
|
+
# YAML parser — reused from validate-outbound.py
|
|
62
|
+
# ─────────────────────────────────────────────
|
|
63
|
+
def _parse_yaml(text):
|
|
64
|
+
"""Parse YAML text into nested Python objects.
|
|
65
|
+
|
|
66
|
+
Uses PyYAML with C loader (fastest) if available, then safe_load,
|
|
67
|
+
falls back to built-in recursive parser.
|
|
68
|
+
"""
|
|
69
|
+
if _yaml_mod is not None:
|
|
70
|
+
if _yaml_loader is not None:
|
|
71
|
+
return _yaml_mod.load(text, Loader=_yaml_loader) or {}
|
|
72
|
+
else:
|
|
73
|
+
return _yaml_mod.safe_load(text) or {}
|
|
74
|
+
lines = text.split('\n')
|
|
75
|
+
return _parse_yaml_block(lines, 0, 0)[0]
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
def _parse_yaml_block(lines, start, base_indent):
|
|
79
|
+
"""Recursively parse a YAML block."""
|
|
80
|
+
result = {}
|
|
81
|
+
i = start
|
|
82
|
+
while i < len(lines):
|
|
83
|
+
raw = lines[i]
|
|
84
|
+
stripped = raw.lstrip()
|
|
85
|
+
if not stripped or stripped.startswith('#'):
|
|
86
|
+
i += 1
|
|
87
|
+
continue
|
|
88
|
+
indent = len(raw) - len(raw.lstrip())
|
|
89
|
+
if indent < base_indent and i > start:
|
|
90
|
+
break
|
|
91
|
+
if indent > base_indent and i > start:
|
|
92
|
+
break
|
|
93
|
+
|
|
94
|
+
if stripped.startswith('- '):
|
|
95
|
+
lst, i = _parse_yaml_list(lines, i, indent)
|
|
96
|
+
if not result:
|
|
97
|
+
return lst, i
|
|
98
|
+
break
|
|
99
|
+
|
|
100
|
+
if ':' in stripped and not stripped.startswith('-'):
|
|
101
|
+
key, _, rest = stripped.partition(':')
|
|
102
|
+
key = key.strip()
|
|
103
|
+
rest = rest.strip()
|
|
104
|
+
if rest:
|
|
105
|
+
result[key] = _yaml_scalar(rest)
|
|
106
|
+
i += 1
|
|
107
|
+
else:
|
|
108
|
+
child_indent, child_idx = _next_content_line(lines, i + 1)
|
|
109
|
+
if child_indent is not None and child_indent > indent:
|
|
110
|
+
child_stripped = lines[child_idx].lstrip()
|
|
111
|
+
if child_stripped.startswith('- '):
|
|
112
|
+
value, i = _parse_yaml_list(lines, child_idx, child_indent)
|
|
113
|
+
else:
|
|
114
|
+
value, i = _parse_yaml_block(lines, child_idx, child_indent)
|
|
115
|
+
result[key] = value
|
|
116
|
+
else:
|
|
117
|
+
result[key] = None
|
|
118
|
+
i += 1
|
|
119
|
+
else:
|
|
120
|
+
i += 1
|
|
121
|
+
return result, i
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
def _parse_yaml_list(lines, start, base_indent):
|
|
125
|
+
"""Parse a YAML list."""
|
|
126
|
+
result = []
|
|
127
|
+
i = start
|
|
128
|
+
while i < len(lines):
|
|
129
|
+
raw = lines[i]
|
|
130
|
+
stripped = raw.lstrip()
|
|
131
|
+
if not stripped or stripped.startswith('#'):
|
|
132
|
+
i += 1
|
|
133
|
+
continue
|
|
134
|
+
indent = len(raw) - len(raw.lstrip())
|
|
135
|
+
if indent < base_indent:
|
|
136
|
+
break
|
|
137
|
+
if indent > base_indent:
|
|
138
|
+
break
|
|
139
|
+
if not stripped.startswith('- '):
|
|
140
|
+
break
|
|
141
|
+
|
|
142
|
+
item_content = stripped[2:].strip()
|
|
143
|
+
if ':' in item_content and not item_content.startswith('"') and not item_content.startswith("'"):
|
|
144
|
+
k, _, v = item_content.partition(':')
|
|
145
|
+
k = k.strip()
|
|
146
|
+
v = v.strip()
|
|
147
|
+
item_dict = {k: _yaml_scalar(v) if v else None}
|
|
148
|
+
child_indent, child_idx = _next_content_line(lines, i + 1)
|
|
149
|
+
if child_indent is not None and child_indent > indent:
|
|
150
|
+
extra, i = _parse_yaml_block(lines, child_idx, child_indent)
|
|
151
|
+
if isinstance(extra, dict):
|
|
152
|
+
item_dict.update(extra)
|
|
153
|
+
else:
|
|
154
|
+
i += 1
|
|
155
|
+
result.append(item_dict)
|
|
156
|
+
else:
|
|
157
|
+
result.append(_yaml_scalar(item_content))
|
|
158
|
+
i += 1
|
|
159
|
+
return result, i
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
def _next_content_line(lines, start):
|
|
163
|
+
"""Find next non-blank, non-comment line."""
|
|
164
|
+
i = start
|
|
165
|
+
while i < len(lines):
|
|
166
|
+
stripped = lines[i].lstrip()
|
|
167
|
+
if stripped and not stripped.startswith('#'):
|
|
168
|
+
indent = len(lines[i]) - len(lines[i].lstrip())
|
|
169
|
+
return indent, i
|
|
170
|
+
i += 1
|
|
171
|
+
return None, None
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
def _yaml_scalar(text):
|
|
175
|
+
"""Convert a YAML scalar string to Python type."""
|
|
176
|
+
if not text:
|
|
177
|
+
return None
|
|
178
|
+
if (text.startswith('"') and text.endswith('"')) or \
|
|
179
|
+
(text.startswith("'") and text.endswith("'")):
|
|
180
|
+
return text[1:-1]
|
|
181
|
+
if ' #' in text:
|
|
182
|
+
text = text[:text.index(' #')].strip()
|
|
183
|
+
if text.lower() in ('true', 'yes'):
|
|
184
|
+
return True
|
|
185
|
+
if text.lower() in ('false', 'no'):
|
|
186
|
+
return False
|
|
187
|
+
if text.lower() in ('null', '~', ''):
|
|
188
|
+
return None
|
|
189
|
+
try:
|
|
190
|
+
return int(text)
|
|
191
|
+
except ValueError:
|
|
192
|
+
pass
|
|
193
|
+
try:
|
|
194
|
+
return float(text)
|
|
195
|
+
except ValueError:
|
|
196
|
+
pass
|
|
197
|
+
return text.strip('"').strip("'")
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
# ─────────────────────────────────────────────
|
|
201
|
+
# Entity index loading (mirrors validate-outbound.py)
|
|
202
|
+
# ─────────────────────────────────────────────
|
|
203
|
+
_entity_index_cache = None
|
|
204
|
+
|
|
205
|
+
|
|
206
|
+
def _load_entity_data():
|
|
207
|
+
"""Load raw entity data from YAML, using JSON cache when fresh.
|
|
208
|
+
|
|
209
|
+
The JSON cache is regenerated when the YAML file is newer.
|
|
210
|
+
Returns parsed dict with 'entities' and 'relationships' keys.
|
|
211
|
+
"""
|
|
212
|
+
if not ENTITY_INDEX_PATH.exists():
|
|
213
|
+
return {'entities': [], 'relationships': []}
|
|
214
|
+
|
|
215
|
+
# Check if JSON cache is fresh
|
|
216
|
+
if ENTITY_INDEX_CACHE_PATH.exists():
|
|
217
|
+
yaml_mtime = ENTITY_INDEX_PATH.stat().st_mtime
|
|
218
|
+
json_mtime = ENTITY_INDEX_CACHE_PATH.stat().st_mtime
|
|
219
|
+
if json_mtime >= yaml_mtime:
|
|
220
|
+
try:
|
|
221
|
+
return json.loads(ENTITY_INDEX_CACHE_PATH.read_text(encoding='utf-8'))
|
|
222
|
+
except Exception:
|
|
223
|
+
pass # Fall through to YAML parsing
|
|
224
|
+
|
|
225
|
+
# Parse YAML and write JSON cache
|
|
226
|
+
text = ENTITY_INDEX_PATH.read_text(encoding='utf-8')
|
|
227
|
+
data = _parse_yaml(text)
|
|
228
|
+
if not isinstance(data, dict):
|
|
229
|
+
return {'entities': [], 'relationships': []}
|
|
230
|
+
|
|
231
|
+
# Write cache (best-effort, non-blocking)
|
|
232
|
+
try:
|
|
233
|
+
ENTITY_INDEX_CACHE_PATH.write_text(
|
|
234
|
+
json.dumps(data, default=str, ensure_ascii=False),
|
|
235
|
+
encoding='utf-8'
|
|
236
|
+
)
|
|
237
|
+
except Exception:
|
|
238
|
+
pass
|
|
239
|
+
|
|
240
|
+
return data
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
def load_entity_index():
|
|
244
|
+
"""Load and index entity-relationships.yaml.
|
|
245
|
+
|
|
246
|
+
Returns dict with:
|
|
247
|
+
- entities: list of entity dicts
|
|
248
|
+
- relationships: list of relationship dicts
|
|
249
|
+
- by_name: dict mapping lowercase name/alias -> entity dict
|
|
250
|
+
- by_email: dict mapping lowercase email -> entity dict
|
|
251
|
+
- rels_by_subject: dict mapping entity id -> list of rels
|
|
252
|
+
- rels_by_object: dict mapping entity id -> list of rels
|
|
253
|
+
"""
|
|
254
|
+
global _entity_index_cache
|
|
255
|
+
if _entity_index_cache is not None:
|
|
256
|
+
return _entity_index_cache
|
|
257
|
+
|
|
258
|
+
empty = {
|
|
259
|
+
'entities': [], 'relationships': [],
|
|
260
|
+
'by_name': {}, 'by_email': {},
|
|
261
|
+
'rels_by_subject': {}, 'rels_by_object': {},
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
if not ENTITY_INDEX_PATH.exists():
|
|
265
|
+
_entity_index_cache = empty
|
|
266
|
+
return _entity_index_cache
|
|
267
|
+
|
|
268
|
+
try:
|
|
269
|
+
data = _load_entity_data()
|
|
270
|
+
if not isinstance(data, dict):
|
|
271
|
+
_entity_index_cache = empty
|
|
272
|
+
return _entity_index_cache
|
|
273
|
+
|
|
274
|
+
entities = data.get('entities', []) or []
|
|
275
|
+
relationships = data.get('relationships', []) or []
|
|
276
|
+
|
|
277
|
+
by_name = {}
|
|
278
|
+
by_email = {}
|
|
279
|
+
for entity in entities:
|
|
280
|
+
if not isinstance(entity, dict):
|
|
281
|
+
continue
|
|
282
|
+
name = entity.get('name', '')
|
|
283
|
+
if name and isinstance(name, str):
|
|
284
|
+
by_name[name.lower()] = entity
|
|
285
|
+
parts = name.split()
|
|
286
|
+
if len(parts) >= 2:
|
|
287
|
+
short = f"{parts[0]} {parts[-1]}"
|
|
288
|
+
by_name[short.lower()] = entity
|
|
289
|
+
if len(parts) >= 1:
|
|
290
|
+
first = parts[0].lower()
|
|
291
|
+
if first not in by_name:
|
|
292
|
+
by_name[first] = entity
|
|
293
|
+
|
|
294
|
+
aliases = entity.get('aliases', []) or []
|
|
295
|
+
if isinstance(aliases, list):
|
|
296
|
+
for alias in aliases:
|
|
297
|
+
if alias and isinstance(alias, str):
|
|
298
|
+
by_name[alias.lower()] = entity
|
|
299
|
+
|
|
300
|
+
email = entity.get('email', '')
|
|
301
|
+
if email and isinstance(email, str):
|
|
302
|
+
by_email[email.lower()] = entity
|
|
303
|
+
|
|
304
|
+
rels_by_subject = {}
|
|
305
|
+
rels_by_object = {}
|
|
306
|
+
for rel in relationships:
|
|
307
|
+
if not isinstance(rel, dict):
|
|
308
|
+
continue
|
|
309
|
+
subj = rel.get('subject', '')
|
|
310
|
+
obj = rel.get('object', '')
|
|
311
|
+
if subj:
|
|
312
|
+
rels_by_subject.setdefault(subj, []).append(rel)
|
|
313
|
+
if obj:
|
|
314
|
+
rels_by_object.setdefault(obj, []).append(rel)
|
|
315
|
+
|
|
316
|
+
_entity_index_cache = {
|
|
317
|
+
'entities': entities,
|
|
318
|
+
'relationships': relationships,
|
|
319
|
+
'by_name': by_name,
|
|
320
|
+
'by_email': by_email,
|
|
321
|
+
'rels_by_subject': rels_by_subject,
|
|
322
|
+
'rels_by_object': rels_by_object,
|
|
323
|
+
}
|
|
324
|
+
except Exception:
|
|
325
|
+
_entity_index_cache = empty
|
|
326
|
+
|
|
327
|
+
return _entity_index_cache
|
|
328
|
+
|
|
329
|
+
|
|
330
|
+
def lookup_entity(name_or_email):
|
|
331
|
+
"""Find an entity by name, alias, or email.
|
|
332
|
+
|
|
333
|
+
Returns the entity dict or None.
|
|
334
|
+
"""
|
|
335
|
+
idx = load_entity_index()
|
|
336
|
+
key = name_or_email.lower().strip()
|
|
337
|
+
if not key:
|
|
338
|
+
return None
|
|
339
|
+
|
|
340
|
+
# Try email first
|
|
341
|
+
entity = idx['by_email'].get(key)
|
|
342
|
+
if entity:
|
|
343
|
+
return entity
|
|
344
|
+
|
|
345
|
+
# Try name/alias
|
|
346
|
+
entity = idx['by_name'].get(key)
|
|
347
|
+
if entity:
|
|
348
|
+
return entity
|
|
349
|
+
|
|
350
|
+
# Try first+last from multi-word input
|
|
351
|
+
parts = key.split()
|
|
352
|
+
if len(parts) >= 2:
|
|
353
|
+
short = f"{parts[0]} {parts[-1]}"
|
|
354
|
+
entity = idx['by_name'].get(short)
|
|
355
|
+
if entity:
|
|
356
|
+
return entity
|
|
357
|
+
|
|
358
|
+
# Single name
|
|
359
|
+
if len(parts) == 1:
|
|
360
|
+
entity = idx['by_name'].get(parts[0])
|
|
361
|
+
if entity:
|
|
362
|
+
return entity
|
|
363
|
+
|
|
364
|
+
return None
|
|
365
|
+
|
|
366
|
+
|
|
367
|
+
# ─────────────────────────────────────────────
|
|
368
|
+
# Relationship classification
|
|
369
|
+
# ─────────────────────────────────────────────
|
|
370
|
+
ADAPTIC_IDS = {
|
|
371
|
+
'company:adaptic-group', 'company:adaptic-holdings',
|
|
372
|
+
'company:adaptic-am-difc', 'company:adaptic-technologies',
|
|
373
|
+
'company:adaptic-group-investments', 'company:adaptic-investments',
|
|
374
|
+
'company:adaptic-inc', 'company:adaptic-ai-uk',
|
|
375
|
+
'company:adaptic-am-uk', 'company:adaptic-am-cayman',
|
|
376
|
+
'company:adaptic-am-asia', 'company:adaptic-asia',
|
|
377
|
+
'company:adaptic-am-eu', 'company:adaptic-am-us',
|
|
378
|
+
'company:adaptic-am-ksa', 'company:adaptic-ksa',
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
|
|
382
|
+
def classify_relationship(entity_id):
|
|
383
|
+
"""Classify a person or company's relationship to Adaptic.
|
|
384
|
+
|
|
385
|
+
Returns dict: relationship_type, is_internal, relationships_to_adaptic.
|
|
386
|
+
"""
|
|
387
|
+
idx = load_entity_index()
|
|
388
|
+
rels = idx['rels_by_subject'].get(entity_id, [])
|
|
389
|
+
|
|
390
|
+
adaptic_rels = []
|
|
391
|
+
is_internal = False
|
|
392
|
+
rel_type = 'unknown'
|
|
393
|
+
|
|
394
|
+
for rel in rels:
|
|
395
|
+
obj = rel.get('object', '')
|
|
396
|
+
pred = rel.get('predicate', '')
|
|
397
|
+
if obj in ADAPTIC_IDS or obj.startswith('company:adaptic'):
|
|
398
|
+
adaptic_rels.append(rel)
|
|
399
|
+
if pred in ('employed_by', 'directs'):
|
|
400
|
+
is_internal = True
|
|
401
|
+
rel_type = 'internal'
|
|
402
|
+
elif pred == 'vendor_candidate_for' and rel_type != 'internal':
|
|
403
|
+
rel_type = 'vendor_candidate'
|
|
404
|
+
elif pred == 'vendor_for' and rel_type not in ('internal', 'vendor_candidate'):
|
|
405
|
+
rel_type = 'external_vendor'
|
|
406
|
+
elif pred == 'advises' and rel_type not in ('internal', 'vendor_candidate', 'external_vendor'):
|
|
407
|
+
rel_type = 'external_advisor'
|
|
408
|
+
elif pred == 'invests_in' and rel_type not in ('internal',):
|
|
409
|
+
rel_type = 'investor'
|
|
410
|
+
elif pred == 'regulates' and rel_type not in ('internal',):
|
|
411
|
+
rel_type = 'regulator'
|
|
412
|
+
|
|
413
|
+
if rel_type == 'unknown':
|
|
414
|
+
for rel in rels:
|
|
415
|
+
if rel.get('predicate') == 'employed_by':
|
|
416
|
+
rel_type = 'external'
|
|
417
|
+
break
|
|
418
|
+
|
|
419
|
+
return {
|
|
420
|
+
'relationship_type': rel_type,
|
|
421
|
+
'is_internal': is_internal,
|
|
422
|
+
'relationships_to_adaptic': adaptic_rels,
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
|
|
426
|
+
# ─────────────────────────────────────────────
|
|
427
|
+
# User profile loading
|
|
428
|
+
# ─────────────────────────────────────────────
|
|
429
|
+
def load_user_profile(entity):
|
|
430
|
+
"""Load the full user profile YAML for an entity.
|
|
431
|
+
|
|
432
|
+
Returns parsed dict or None.
|
|
433
|
+
"""
|
|
434
|
+
profile_path = entity.get('profile_path', '')
|
|
435
|
+
if profile_path:
|
|
436
|
+
full_path = REPO_ROOT / profile_path
|
|
437
|
+
if full_path.exists():
|
|
438
|
+
try:
|
|
439
|
+
text = full_path.read_text(encoding='utf-8')
|
|
440
|
+
return _parse_yaml(text)
|
|
441
|
+
except Exception:
|
|
442
|
+
pass
|
|
443
|
+
|
|
444
|
+
# Fallback: try to derive slug from entity name
|
|
445
|
+
name = entity.get('name', '')
|
|
446
|
+
if name:
|
|
447
|
+
slug = name.lower().replace(' ', '-')
|
|
448
|
+
# Remove middle names for slug
|
|
449
|
+
parts = name.lower().split()
|
|
450
|
+
if len(parts) >= 2:
|
|
451
|
+
slug = f"{parts[0]}-{parts[-1]}"
|
|
452
|
+
candidate = USER_PROFILES_DIR / f"{slug}.yaml"
|
|
453
|
+
if candidate.exists():
|
|
454
|
+
try:
|
|
455
|
+
text = candidate.read_text(encoding='utf-8')
|
|
456
|
+
return _parse_yaml(text)
|
|
457
|
+
except Exception:
|
|
458
|
+
pass
|
|
459
|
+
|
|
460
|
+
return None
|
|
461
|
+
|
|
462
|
+
|
|
463
|
+
# ─────────────────────────────────────────────
|
|
464
|
+
# Queue scanning — find active items mentioning a person
|
|
465
|
+
# ─────────────────────────────────────────────
|
|
466
|
+
def scan_queues_for_person(name, entity_id=None, slug=None):
|
|
467
|
+
"""Scan all queue YAML files for items mentioning this person.
|
|
468
|
+
|
|
469
|
+
Uses fast text search to skip files that don't mention the person,
|
|
470
|
+
then parses only matching item blocks to extract structured data.
|
|
471
|
+
|
|
472
|
+
Returns list of dicts with: queue, item_id, title, status, priority.
|
|
473
|
+
"""
|
|
474
|
+
if not QUEUES_DIR.exists():
|
|
475
|
+
return []
|
|
476
|
+
|
|
477
|
+
# Build search terms for initial text-based filtering
|
|
478
|
+
search_terms = set()
|
|
479
|
+
search_terms.add(name.lower())
|
|
480
|
+
if entity_id:
|
|
481
|
+
parts = entity_id.split(':')
|
|
482
|
+
if len(parts) == 2:
|
|
483
|
+
search_terms.add(parts[1].lower())
|
|
484
|
+
if slug:
|
|
485
|
+
search_terms.add(slug.lower())
|
|
486
|
+
|
|
487
|
+
results = []
|
|
488
|
+
for qfile in sorted(QUEUES_DIR.glob('*.yaml')):
|
|
489
|
+
try:
|
|
490
|
+
text = qfile.read_text(encoding='utf-8')
|
|
491
|
+
text_lower = text.lower()
|
|
492
|
+
|
|
493
|
+
# Fast check: skip entire file if no search term appears
|
|
494
|
+
if not any(term in text_lower for term in search_terms):
|
|
495
|
+
continue
|
|
496
|
+
|
|
497
|
+
# Extract queue_name from early lines (avoid full parse)
|
|
498
|
+
queue_name = qfile.stem
|
|
499
|
+
for line in text.split('\n')[:5]:
|
|
500
|
+
if line.startswith('queue_name:'):
|
|
501
|
+
queue_name = line.split(':', 1)[1].strip().strip('"').strip("'")
|
|
502
|
+
break
|
|
503
|
+
|
|
504
|
+
# Parse item blocks using text-based extraction
|
|
505
|
+
# Split on ' - id:' which marks each queue item
|
|
506
|
+
item_blocks = re.split(r'\n - id:', text)
|
|
507
|
+
if len(item_blocks) < 2:
|
|
508
|
+
# Try alternate format
|
|
509
|
+
item_blocks = re.split(r'\n -\s+id:', text)
|
|
510
|
+
|
|
511
|
+
for i, block in enumerate(item_blocks):
|
|
512
|
+
if i == 0:
|
|
513
|
+
continue # Skip preamble before first item
|
|
514
|
+
|
|
515
|
+
block_lower = block.lower()
|
|
516
|
+
|
|
517
|
+
# Check if this block mentions the person
|
|
518
|
+
if not any(term in block_lower for term in search_terms):
|
|
519
|
+
continue
|
|
520
|
+
|
|
521
|
+
# Extract fields with simple regex
|
|
522
|
+
item_id = ''
|
|
523
|
+
id_match = re.match(r'\s*(\S+)', block)
|
|
524
|
+
if id_match:
|
|
525
|
+
item_id = id_match.group(1).strip()
|
|
526
|
+
|
|
527
|
+
def _extract_field(field_name, text_block):
|
|
528
|
+
pattern = rf'^\s*{field_name}:\s*(.+?)$'
|
|
529
|
+
m = re.search(pattern, text_block, re.MULTILINE)
|
|
530
|
+
if m:
|
|
531
|
+
val = m.group(1).strip().strip('"').strip("'")
|
|
532
|
+
return val
|
|
533
|
+
return ''
|
|
534
|
+
|
|
535
|
+
status = _extract_field('status', block)
|
|
536
|
+
# Only include active items
|
|
537
|
+
if status.lower() in ('closed', 'resolved', 'cancelled'):
|
|
538
|
+
continue
|
|
539
|
+
|
|
540
|
+
title = _extract_field('title', block)
|
|
541
|
+
priority = _extract_field('priority', block)
|
|
542
|
+
due = _extract_field('due', block)
|
|
543
|
+
|
|
544
|
+
results.append({
|
|
545
|
+
'queue': queue_name,
|
|
546
|
+
'item_id': item_id,
|
|
547
|
+
'title': title,
|
|
548
|
+
'status': status,
|
|
549
|
+
'priority': priority,
|
|
550
|
+
'due': due if due else None,
|
|
551
|
+
})
|
|
552
|
+
|
|
553
|
+
except Exception:
|
|
554
|
+
continue
|
|
555
|
+
|
|
556
|
+
return results
|
|
557
|
+
|
|
558
|
+
|
|
559
|
+
# ─────────────────────────────────────────────
|
|
560
|
+
# Interaction history — recent communications
|
|
561
|
+
# ─────────────────────────────────────────────
|
|
562
|
+
def get_recent_interactions(entity, max_items=10):
|
|
563
|
+
"""Load recent interaction history for the entity.
|
|
564
|
+
|
|
565
|
+
Checks memory/interactions/{email,slack,meetings}/ for the entity's slug.
|
|
566
|
+
Returns list of interaction summaries (most recent first).
|
|
567
|
+
"""
|
|
568
|
+
name = entity.get('name', '')
|
|
569
|
+
parts = name.lower().split()
|
|
570
|
+
if len(parts) >= 2:
|
|
571
|
+
slug = f"{parts[0]}-{parts[-1]}"
|
|
572
|
+
elif parts:
|
|
573
|
+
slug = parts[0]
|
|
574
|
+
else:
|
|
575
|
+
return []
|
|
576
|
+
|
|
577
|
+
interactions = []
|
|
578
|
+
|
|
579
|
+
def _parse_interaction(entry, channel):
|
|
580
|
+
"""Normalize an interaction entry from any JSONL schema variant."""
|
|
581
|
+
# Handle both timestamp formats: 'timestamp' and 'date'
|
|
582
|
+
ts = entry.get('timestamp', '') or entry.get('date', '') or ''
|
|
583
|
+
# Handle both direction formats: 'direction' and 'type'
|
|
584
|
+
direction = entry.get('direction', '') or entry.get('type', '') or ''
|
|
585
|
+
# Handle summary: 'summary', 'content', or fall back to 'action_taken'
|
|
586
|
+
summary = entry.get('summary', '') or entry.get('content', '') or entry.get('action_taken', '') or ''
|
|
587
|
+
return {
|
|
588
|
+
'channel': channel,
|
|
589
|
+
'timestamp': ts,
|
|
590
|
+
'direction': direction,
|
|
591
|
+
'subject': entry.get('subject', ''),
|
|
592
|
+
'summary': summary,
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
# Check email interactions
|
|
596
|
+
email_dir = INTERACTIONS_DIR / "email" / slug
|
|
597
|
+
if email_dir.exists():
|
|
598
|
+
for f in sorted(email_dir.glob('*.jsonl'), reverse=True):
|
|
599
|
+
try:
|
|
600
|
+
for line in f.read_text(encoding='utf-8').strip().split('\n'):
|
|
601
|
+
line = line.strip()
|
|
602
|
+
if not line:
|
|
603
|
+
continue
|
|
604
|
+
try:
|
|
605
|
+
entry = json.loads(line)
|
|
606
|
+
interactions.append(_parse_interaction(entry, 'email'))
|
|
607
|
+
except json.JSONDecodeError:
|
|
608
|
+
continue
|
|
609
|
+
except Exception:
|
|
610
|
+
continue
|
|
611
|
+
|
|
612
|
+
# Check Slack DM interactions
|
|
613
|
+
slack_dm_dir = INTERACTIONS_DIR / "slack" / "dm" / slug if INTERACTIONS_DIR.exists() else None
|
|
614
|
+
if slack_dm_dir and slack_dm_dir.exists():
|
|
615
|
+
for f in sorted(slack_dm_dir.glob('*.jsonl'), reverse=True):
|
|
616
|
+
try:
|
|
617
|
+
for line in f.read_text(encoding='utf-8').strip().split('\n'):
|
|
618
|
+
line = line.strip()
|
|
619
|
+
if not line:
|
|
620
|
+
continue
|
|
621
|
+
try:
|
|
622
|
+
entry = json.loads(line)
|
|
623
|
+
interactions.append(_parse_interaction(entry, 'slack_dm'))
|
|
624
|
+
except json.JSONDecodeError:
|
|
625
|
+
continue
|
|
626
|
+
except Exception:
|
|
627
|
+
continue
|
|
628
|
+
|
|
629
|
+
# Check meeting interactions
|
|
630
|
+
meetings_dir = INTERACTIONS_DIR / "meetings" / slug if INTERACTIONS_DIR.exists() else None
|
|
631
|
+
if meetings_dir and meetings_dir.exists():
|
|
632
|
+
for f in sorted(meetings_dir.glob('*.jsonl'), reverse=True):
|
|
633
|
+
try:
|
|
634
|
+
for line in f.read_text(encoding='utf-8').strip().split('\n'):
|
|
635
|
+
line = line.strip()
|
|
636
|
+
if not line:
|
|
637
|
+
continue
|
|
638
|
+
try:
|
|
639
|
+
entry = json.loads(line)
|
|
640
|
+
interactions.append(_parse_interaction(entry, 'meeting'))
|
|
641
|
+
except json.JSONDecodeError:
|
|
642
|
+
continue
|
|
643
|
+
except Exception:
|
|
644
|
+
continue
|
|
645
|
+
|
|
646
|
+
# Sort by timestamp descending
|
|
647
|
+
interactions.sort(key=lambda x: x.get('timestamp', ''), reverse=True)
|
|
648
|
+
return interactions[:max_items]
|
|
649
|
+
|
|
650
|
+
|
|
651
|
+
# ─────────────────────────────────────────────
|
|
652
|
+
# Related entities
|
|
653
|
+
# ─────────────────────────────────────────────
|
|
654
|
+
def get_related_entities(entity_id):
|
|
655
|
+
"""Find all entities related to this one via the relationship graph.
|
|
656
|
+
|
|
657
|
+
Returns list of dicts: related_entity_id, related_entity_name,
|
|
658
|
+
predicate, direction ('outgoing'/'incoming'), notes.
|
|
659
|
+
"""
|
|
660
|
+
idx = load_entity_index()
|
|
661
|
+
related = []
|
|
662
|
+
|
|
663
|
+
# Entities we look up by id
|
|
664
|
+
entity_by_id = {}
|
|
665
|
+
for e in idx['entities']:
|
|
666
|
+
if isinstance(e, dict) and e.get('id'):
|
|
667
|
+
entity_by_id[e['id']] = e
|
|
668
|
+
|
|
669
|
+
# Outgoing relationships (this entity is subject)
|
|
670
|
+
for rel in idx['rels_by_subject'].get(entity_id, []):
|
|
671
|
+
obj_id = rel.get('object', '')
|
|
672
|
+
obj_entity = entity_by_id.get(obj_id, {})
|
|
673
|
+
related.append({
|
|
674
|
+
'entity_id': obj_id,
|
|
675
|
+
'entity_name': obj_entity.get('name', obj_id),
|
|
676
|
+
'predicate': rel.get('predicate', ''),
|
|
677
|
+
'direction': 'outgoing',
|
|
678
|
+
'scope': rel.get('scope', ''),
|
|
679
|
+
'status': rel.get('status', ''),
|
|
680
|
+
'notes': rel.get('notes', ''),
|
|
681
|
+
})
|
|
682
|
+
|
|
683
|
+
# Incoming relationships (this entity is object)
|
|
684
|
+
for rel in idx['rels_by_object'].get(entity_id, []):
|
|
685
|
+
subj_id = rel.get('subject', '')
|
|
686
|
+
subj_entity = entity_by_id.get(subj_id, {})
|
|
687
|
+
related.append({
|
|
688
|
+
'entity_id': subj_id,
|
|
689
|
+
'entity_name': subj_entity.get('name', subj_id),
|
|
690
|
+
'predicate': rel.get('predicate', ''),
|
|
691
|
+
'direction': 'incoming',
|
|
692
|
+
'scope': rel.get('scope', ''),
|
|
693
|
+
'status': rel.get('status', ''),
|
|
694
|
+
'notes': rel.get('notes', ''),
|
|
695
|
+
})
|
|
696
|
+
|
|
697
|
+
return related
|
|
698
|
+
|
|
699
|
+
|
|
700
|
+
# ─────────────────────────────────────────────
|
|
701
|
+
# Topic filtering
|
|
702
|
+
# ─────────────────────────────────────────────
|
|
703
|
+
def filter_by_topic(context, topic):
|
|
704
|
+
"""Boost relevance of context items matching the given topic.
|
|
705
|
+
|
|
706
|
+
Adds a 'topic_relevant' flag to queue items and interactions
|
|
707
|
+
that mention the topic.
|
|
708
|
+
"""
|
|
709
|
+
if not topic:
|
|
710
|
+
return context
|
|
711
|
+
|
|
712
|
+
topic_lower = topic.lower()
|
|
713
|
+
topic_words = topic_lower.split()
|
|
714
|
+
|
|
715
|
+
# Tag queue items
|
|
716
|
+
for item in context.get('active_queue_items', []):
|
|
717
|
+
searchable = f"{item.get('title', '')} {item.get('queue', '')}".lower()
|
|
718
|
+
item['topic_relevant'] = any(w in searchable for w in topic_words)
|
|
719
|
+
|
|
720
|
+
# Tag interactions
|
|
721
|
+
for item in context.get('recent_interactions', []):
|
|
722
|
+
searchable = f"{item.get('subject', '')} {item.get('summary', '')}".lower()
|
|
723
|
+
item['topic_relevant'] = any(w in searchable for w in topic_words)
|
|
724
|
+
|
|
725
|
+
# Tag related entities
|
|
726
|
+
for item in context.get('related_entities', []):
|
|
727
|
+
searchable = f"{item.get('entity_name', '')} {item.get('scope', '')} {item.get('notes', '')}".lower()
|
|
728
|
+
item['topic_relevant'] = any(w in searchable for w in topic_words)
|
|
729
|
+
|
|
730
|
+
return context
|
|
731
|
+
|
|
732
|
+
|
|
733
|
+
# ─────────────────────────────────────────────
|
|
734
|
+
# Main retrieval function
|
|
735
|
+
# ─────────────────────────────────────────────
|
|
736
|
+
def retrieve_context(recipient, topic=None):
|
|
737
|
+
"""Retrieve full pre-draft context for a recipient.
|
|
738
|
+
|
|
739
|
+
Args:
|
|
740
|
+
recipient: Name or email of the person to look up.
|
|
741
|
+
topic: Optional topic to filter/boost relevant items.
|
|
742
|
+
|
|
743
|
+
Returns:
|
|
744
|
+
dict with full context, or None if recipient not found.
|
|
745
|
+
"""
|
|
746
|
+
t0 = time.time()
|
|
747
|
+
|
|
748
|
+
# 1. Find entity in index
|
|
749
|
+
entity = lookup_entity(recipient)
|
|
750
|
+
if entity is None:
|
|
751
|
+
return None
|
|
752
|
+
|
|
753
|
+
entity_id = entity.get('id', '')
|
|
754
|
+
entity_name = entity.get('name', '')
|
|
755
|
+
|
|
756
|
+
# 2. Classify relationship
|
|
757
|
+
rel_info = classify_relationship(entity_id)
|
|
758
|
+
|
|
759
|
+
# 3. Load user profile
|
|
760
|
+
profile = load_user_profile(entity)
|
|
761
|
+
|
|
762
|
+
# 4. Extract key profile fields
|
|
763
|
+
standing_instructions = []
|
|
764
|
+
communication_prefs = {}
|
|
765
|
+
last_interaction = None
|
|
766
|
+
interaction_summary_notes = ''
|
|
767
|
+
|
|
768
|
+
if profile:
|
|
769
|
+
si = profile.get('standing_instructions', [])
|
|
770
|
+
if isinstance(si, list):
|
|
771
|
+
standing_instructions = si
|
|
772
|
+
elif isinstance(si, str) and si.strip() in ('[]', ''):
|
|
773
|
+
standing_instructions = []
|
|
774
|
+
else:
|
|
775
|
+
standing_instructions = [si] if si else []
|
|
776
|
+
communication_prefs = profile.get('communication_preferences', {}) or {}
|
|
777
|
+
isummary = profile.get('interaction_summary', {}) or {}
|
|
778
|
+
last_interaction = isummary.get('last_interaction')
|
|
779
|
+
interaction_summary_notes = str(isummary.get('notes', '') or '').strip()
|
|
780
|
+
|
|
781
|
+
# 5. Scan queues for active items about this person
|
|
782
|
+
slug = None
|
|
783
|
+
if entity_id and ':' in entity_id:
|
|
784
|
+
slug = entity_id.split(':')[1]
|
|
785
|
+
queue_items = scan_queues_for_person(entity_name, entity_id, slug)
|
|
786
|
+
|
|
787
|
+
# 6. Get recent interaction history
|
|
788
|
+
interactions = get_recent_interactions(entity)
|
|
789
|
+
|
|
790
|
+
# 7. Get related entities
|
|
791
|
+
related = get_related_entities(entity_id)
|
|
792
|
+
|
|
793
|
+
# 8. Build context object
|
|
794
|
+
context = {
|
|
795
|
+
'recipient': {
|
|
796
|
+
'name': entity_name,
|
|
797
|
+
'entity_id': entity_id,
|
|
798
|
+
'type': entity.get('type', ''),
|
|
799
|
+
'role': entity.get('primary_role', ''),
|
|
800
|
+
'company': entity.get('primary_company', ''),
|
|
801
|
+
'email': entity.get('email', ''),
|
|
802
|
+
'timezone': entity.get('timezone', ''),
|
|
803
|
+
'notes': entity.get('notes', ''),
|
|
804
|
+
},
|
|
805
|
+
'relationship': {
|
|
806
|
+
'type': rel_info['relationship_type'],
|
|
807
|
+
'is_internal': rel_info['is_internal'],
|
|
808
|
+
'adaptic_relationships': [
|
|
809
|
+
{
|
|
810
|
+
'predicate': r.get('predicate', ''),
|
|
811
|
+
'object': r.get('object', ''),
|
|
812
|
+
'status': r.get('status', ''),
|
|
813
|
+
'scope': r.get('scope', ''),
|
|
814
|
+
'notes': r.get('notes', ''),
|
|
815
|
+
}
|
|
816
|
+
for r in rel_info['relationships_to_adaptic']
|
|
817
|
+
],
|
|
818
|
+
},
|
|
819
|
+
'communication': {
|
|
820
|
+
'preferences': communication_prefs,
|
|
821
|
+
'standing_instructions': standing_instructions,
|
|
822
|
+
'last_interaction': str(last_interaction) if last_interaction else None,
|
|
823
|
+
'interaction_notes': interaction_summary_notes,
|
|
824
|
+
},
|
|
825
|
+
'related_entities': related,
|
|
826
|
+
'active_queue_items': queue_items,
|
|
827
|
+
'recent_interactions': interactions,
|
|
828
|
+
'topic': topic,
|
|
829
|
+
'retrieval_time_ms': round((time.time() - t0) * 1000, 1),
|
|
830
|
+
}
|
|
831
|
+
|
|
832
|
+
# 9. Apply topic filtering if provided
|
|
833
|
+
if topic:
|
|
834
|
+
context = filter_by_topic(context, topic)
|
|
835
|
+
|
|
836
|
+
return context
|
|
837
|
+
|
|
838
|
+
|
|
839
|
+
# ─────────────────────────────────────────────
|
|
840
|
+
# Brief format — concise summary for prompt injection
|
|
841
|
+
# ─────────────────────────────────────────────
|
|
842
|
+
def format_brief(context):
|
|
843
|
+
"""Format context as a 3-5 line summary for prompt injection.
|
|
844
|
+
|
|
845
|
+
Returns a string.
|
|
846
|
+
"""
|
|
847
|
+
if context is None:
|
|
848
|
+
return "RECIPIENT NOT FOUND — no entity data available. Verify recipient identity before drafting."
|
|
849
|
+
|
|
850
|
+
r = context['recipient']
|
|
851
|
+
rel = context['relationship']
|
|
852
|
+
comm = context['communication']
|
|
853
|
+
|
|
854
|
+
lines = []
|
|
855
|
+
|
|
856
|
+
# Line 1: Identity + relationship
|
|
857
|
+
rel_label = rel['type'].replace('_', ' ')
|
|
858
|
+
company_name = r.get('company', '')
|
|
859
|
+
if company_name and ':' in company_name:
|
|
860
|
+
# Resolve company entity id to name
|
|
861
|
+
idx = load_entity_index()
|
|
862
|
+
for e in idx['entities']:
|
|
863
|
+
if isinstance(e, dict) and e.get('id') == company_name:
|
|
864
|
+
company_name = e.get('name', company_name)
|
|
865
|
+
break
|
|
866
|
+
role_str = f"{r['role']}, {company_name}" if r['role'] and company_name else r['role'] or ''
|
|
867
|
+
lines.append(f"RECIPIENT: {r['name']} — {role_str} [{rel_label}]")
|
|
868
|
+
|
|
869
|
+
# Line 2: Communication preferences + standing instructions
|
|
870
|
+
prefs = comm.get('preferences', {})
|
|
871
|
+
tone = prefs.get('tone', prefs.get('voice', ''))
|
|
872
|
+
channel = prefs.get('preferred_channel', prefs.get('channel_preference', ''))
|
|
873
|
+
pref_parts = []
|
|
874
|
+
if tone:
|
|
875
|
+
pref_parts.append(f"tone: {tone}")
|
|
876
|
+
if channel:
|
|
877
|
+
pref_parts.append(f"prefers: {channel}")
|
|
878
|
+
instructions = comm.get('standing_instructions', [])
|
|
879
|
+
if instructions and isinstance(instructions, list) and len(instructions) > 0:
|
|
880
|
+
pref_parts.append(f"instructions: {'; '.join(str(i) for i in instructions[:2])}")
|
|
881
|
+
if pref_parts:
|
|
882
|
+
lines.append(f"COMMS: {', '.join(pref_parts)}")
|
|
883
|
+
|
|
884
|
+
# Line 3: Active items
|
|
885
|
+
active = context.get('active_queue_items', [])
|
|
886
|
+
topic = context.get('topic', '')
|
|
887
|
+
if topic:
|
|
888
|
+
topic_items = [i for i in active if i.get('topic_relevant')]
|
|
889
|
+
if topic_items:
|
|
890
|
+
lines.append(f"ACTIVE ({topic}): {len(topic_items)} item(s) — " +
|
|
891
|
+
'; '.join(i['title'][:60] for i in topic_items[:3]))
|
|
892
|
+
elif active:
|
|
893
|
+
lines.append(f"ACTIVE: {len(active)} item(s) — " +
|
|
894
|
+
'; '.join(i['title'][:60] for i in active[:3]))
|
|
895
|
+
elif active:
|
|
896
|
+
lines.append(f"ACTIVE: {len(active)} item(s) — " +
|
|
897
|
+
'; '.join(i['title'][:60] for i in active[:3]))
|
|
898
|
+
|
|
899
|
+
# Line 4: Last interaction
|
|
900
|
+
last = comm.get('last_interaction')
|
|
901
|
+
interactions = context.get('recent_interactions', [])
|
|
902
|
+
# Find the most recent interaction with a non-empty timestamp
|
|
903
|
+
latest_with_ts = None
|
|
904
|
+
for ix in interactions:
|
|
905
|
+
if ix.get('timestamp'):
|
|
906
|
+
latest_with_ts = ix
|
|
907
|
+
break
|
|
908
|
+
if latest_with_ts:
|
|
909
|
+
channel = latest_with_ts.get('channel', '')
|
|
910
|
+
summary = latest_with_ts.get('summary', '') or latest_with_ts.get('subject', '')
|
|
911
|
+
if summary and len(summary) > 80:
|
|
912
|
+
summary = summary[:77] + '...'
|
|
913
|
+
lines.append(f"LAST CONTACT: {latest_with_ts['timestamp']} via {channel} — {summary}")
|
|
914
|
+
elif interactions:
|
|
915
|
+
# Have interactions but none with timestamps — use first one's subject
|
|
916
|
+
latest = interactions[0]
|
|
917
|
+
channel = latest.get('channel', '')
|
|
918
|
+
summary = latest.get('summary', '') or latest.get('subject', '')
|
|
919
|
+
if summary and len(summary) > 80:
|
|
920
|
+
summary = summary[:77] + '...'
|
|
921
|
+
if summary:
|
|
922
|
+
lines.append(f"LAST CONTACT: via {channel} — {summary}")
|
|
923
|
+
elif last:
|
|
924
|
+
lines.append(f"LAST CONTACT: {last}")
|
|
925
|
+
|
|
926
|
+
# Line 5: Key notes/warnings
|
|
927
|
+
notes = r.get('notes', '') or ''
|
|
928
|
+
interaction_notes = comm.get('interaction_notes', '') or ''
|
|
929
|
+
# Prefer interaction notes for internal people (richer context)
|
|
930
|
+
note_text = interaction_notes if (rel['is_internal'] and interaction_notes) else notes
|
|
931
|
+
if not note_text:
|
|
932
|
+
note_text = interaction_notes or notes
|
|
933
|
+
if note_text:
|
|
934
|
+
# Take first sentence if long
|
|
935
|
+
if len(note_text) > 100:
|
|
936
|
+
first_sentence = note_text.split('.')[0].strip()
|
|
937
|
+
if first_sentence and len(first_sentence) < 100:
|
|
938
|
+
note_text = first_sentence + '.'
|
|
939
|
+
else:
|
|
940
|
+
note_text = note_text[:97] + '...'
|
|
941
|
+
lines.append(f"NOTE: {note_text}")
|
|
942
|
+
|
|
943
|
+
return '\n'.join(lines)
|
|
944
|
+
|
|
945
|
+
|
|
946
|
+
# ─────────────────────────────────────────────
|
|
947
|
+
# CLI entry point
|
|
948
|
+
# ─────────────────────────────────────────────
|
|
949
|
+
def main():
|
|
950
|
+
parser = argparse.ArgumentParser(
|
|
951
|
+
description='Pre-draft fact retrieval — retrieve entity context before composing messages.'
|
|
952
|
+
)
|
|
953
|
+
parser.add_argument('--recipient', required=True,
|
|
954
|
+
help='Recipient name or email address')
|
|
955
|
+
parser.add_argument('--topic', default=None,
|
|
956
|
+
help='Optional topic to filter/boost relevant context')
|
|
957
|
+
parser.add_argument('--format', dest='output_format', default='json',
|
|
958
|
+
choices=['json', 'brief'],
|
|
959
|
+
help='Output format: json (full) or brief (3-5 line summary)')
|
|
960
|
+
|
|
961
|
+
args = parser.parse_args()
|
|
962
|
+
|
|
963
|
+
try:
|
|
964
|
+
context = retrieve_context(args.recipient, args.topic)
|
|
965
|
+
|
|
966
|
+
if context is None:
|
|
967
|
+
if args.output_format == 'brief':
|
|
968
|
+
print(format_brief(None))
|
|
969
|
+
else:
|
|
970
|
+
print(json.dumps({
|
|
971
|
+
'status': 'not_found',
|
|
972
|
+
'recipient_query': args.recipient,
|
|
973
|
+
'message': f'No entity found matching "{args.recipient}"',
|
|
974
|
+
}, indent=2))
|
|
975
|
+
sys.exit(1)
|
|
976
|
+
|
|
977
|
+
if args.output_format == 'brief':
|
|
978
|
+
print(format_brief(context))
|
|
979
|
+
else:
|
|
980
|
+
# Sanitize for JSON serialization
|
|
981
|
+
print(json.dumps(context, indent=2, default=str))
|
|
982
|
+
|
|
983
|
+
sys.exit(0)
|
|
984
|
+
|
|
985
|
+
except Exception as e:
|
|
986
|
+
print(json.dumps({
|
|
987
|
+
'status': 'error',
|
|
988
|
+
'message': str(e),
|
|
989
|
+
}), file=sys.stderr)
|
|
990
|
+
sys.exit(2)
|
|
991
|
+
|
|
992
|
+
|
|
993
|
+
if __name__ == '__main__':
|
|
994
|
+
main()
|