@primusclaw/personal-agent 0.0.0-stage → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/LICENSE +37 -0
- package/dist/index.js +31875 -0
- package/dist/types/approvals/approval-view.d.ts +70 -0
- package/dist/types/approvals/click.d.ts +8 -0
- package/dist/types/approvals/decide.d.ts +64 -0
- package/dist/types/approvals/handler.d.ts +22 -0
- package/dist/types/approvals/index.d.ts +9 -0
- package/dist/types/approvals/questions.d.ts +36 -0
- package/dist/types/approvals/records.d.ts +43 -0
- package/dist/types/approvals/sensitive.d.ts +13 -0
- package/dist/types/approvals/turn-cards.d.ts +7 -0
- package/dist/types/approvals/views.d.ts +67 -0
- package/dist/types/assistant/action-handler.d.ts +13 -0
- package/dist/types/assistant/actions.d.ts +63 -0
- package/dist/types/assistant/auto-reply.d.ts +14 -0
- package/dist/types/assistant/board.d.ts +68 -0
- package/dist/types/assistant/chat.d.ts +166 -0
- package/dist/types/assistant/citation-sources.d.ts +20 -0
- package/dist/types/assistant/citations.d.ts +38 -0
- package/dist/types/assistant/confirm-outcome.d.ts +11 -0
- package/dist/types/assistant/devenv-hide-outcome.d.ts +4 -0
- package/dist/types/assistant/events.d.ts +53 -0
- package/dist/types/assistant/failures.d.ts +16 -0
- package/dist/types/assistant/files.d.ts +37 -0
- package/dist/types/assistant/finish.d.ts +8 -0
- package/dist/types/assistant/follow.d.ts +75 -0
- package/dist/types/assistant/index.d.ts +12 -0
- package/dist/types/assistant/informative.d.ts +9 -0
- package/dist/types/assistant/item-of.d.ts +2 -0
- package/dist/types/assistant/receipt.d.ts +113 -0
- package/dist/types/assistant/receipts.d.ts +71 -0
- package/dist/types/assistant/say.d.ts +63 -0
- package/dist/types/assistant/tracked-stream.d.ts +30 -0
- package/dist/types/assistant/turn-in-front.d.ts +25 -0
- package/dist/types/assistant/views.d.ts +80 -0
- package/dist/types/assistant/watch-clicks.d.ts +34 -0
- package/dist/types/assistant/work-clicks.d.ts +53 -0
- package/dist/types/assistant/work-handler.d.ts +23 -0
- package/dist/types/assistant/work-items.d.ts +66 -0
- package/dist/types/branding.d.ts +5 -0
- package/dist/types/brief/brief.d.ts +40 -0
- package/dist/types/brief/index.d.ts +3 -0
- package/dist/types/brief/template.d.ts +8 -0
- package/dist/types/capabilities/capability.d.ts +49 -0
- package/dist/types/capabilities/command-text.d.ts +11 -0
- package/dist/types/capabilities/entries-chat.d.ts +3 -0
- package/dist/types/capabilities/entries-notify.d.ts +3 -0
- package/dist/types/capabilities/entries-settings.d.ts +3 -0
- package/dist/types/capabilities/help.d.ts +24 -0
- package/dist/types/capabilities/natural.d.ts +19 -0
- package/dist/types/capabilities/phrases.d.ts +42 -0
- package/dist/types/capabilities/registry.d.ts +12 -0
- package/dist/types/capabilities/sessions-words.d.ts +9 -0
- package/dist/types/capabilities/spoken.d.ts +19 -0
- package/dist/types/capabilities/visibility.d.ts +32 -0
- package/dist/types/claw/credential.d.ts +8 -0
- package/dist/types/claw/errors.d.ts +61 -0
- package/dist/types/claw/lenient.d.ts +23 -0
- package/dist/types/claw/message-text.d.ts +28 -0
- package/dist/types/claw/model.d.ts +118 -0
- package/dist/types/claw/py-value.d.ts +7 -0
- package/dist/types/claw/remote.d.ts +138 -0
- package/dist/types/claw/requester-view.d.ts +15 -0
- package/dist/types/claw/service-refusal.d.ts +4 -0
- package/dist/types/claw/sse.d.ts +12 -0
- package/dist/types/claw/started-review.d.ts +7 -0
- package/dist/types/claw/work-item.d.ts +25 -0
- package/dist/types/commands/agent-args.d.ts +9 -0
- package/dist/types/commands/names.d.ts +19 -0
- package/dist/types/commands/parse.d.ts +33 -0
- package/dist/types/commands/repo.d.ts +17 -0
- package/dist/types/config/settings.d.ts +124 -0
- package/dist/types/direct-chat/direct-chat.d.ts +73 -0
- package/dist/types/direct-chat/index.d.ts +2 -0
- package/dist/types/errors.d.ts +15 -0
- package/dist/types/feedback/deadline.d.ts +10 -0
- package/dist/types/feedback/delivery.d.ts +34 -0
- package/dist/types/feedback/exchange.d.ts +19 -0
- package/dist/types/feedback/flow.d.ts +36 -0
- package/dist/types/feedback/handlers.d.ts +16 -0
- package/dist/types/feedback/history.d.ts +20 -0
- package/dist/types/feedback/identifiers.d.ts +16 -0
- package/dist/types/feedback/index.d.ts +16 -0
- package/dist/types/feedback/iso-time.d.ts +2 -0
- package/dist/types/feedback/issue-text.d.ts +50 -0
- package/dist/types/feedback/log-text.d.ts +13 -0
- package/dist/types/feedback/markdown.d.ts +4 -0
- package/dist/types/feedback/reporting.d.ts +25 -0
- package/dist/types/feedback/scene.d.ts +65 -0
- package/dist/types/feedback/service.d.ts +74 -0
- package/dist/types/feedback/thumbs.d.ts +59 -0
- package/dist/types/feedback/views.d.ts +35 -0
- package/dist/types/guardrails/correlation.d.ts +8 -0
- package/dist/types/guardrails/guardrails.d.ts +49 -0
- package/dist/types/guardrails/index.d.ts +4 -0
- package/dist/types/guardrails/operations.d.ts +22 -0
- package/dist/types/guardrails/sha256.d.ts +1 -0
- package/dist/types/inbound-text/index.d.ts +9 -0
- package/dist/types/inbound-text/marked-text.d.ts +20 -0
- package/dist/types/inbound-text/quote-block.d.ts +26 -0
- package/dist/types/inbound-text/redact.d.ts +8 -0
- package/dist/types/inbound-text/when.d.ts +2 -0
- package/dist/types/inbound-text/with-links.d.ts +20 -0
- package/dist/types/index.d.ts +73 -0
- package/dist/types/json.d.ts +5 -0
- package/dist/types/language/detect.d.ts +21 -0
- package/dist/types/limits/inbound-stats.d.ts +42 -0
- package/dist/types/limits/index.d.ts +5 -0
- package/dist/types/limits/rate-limiter.d.ts +32 -0
- package/dist/types/limits/user-limits.d.ts +18 -0
- package/dist/types/limits/wait-words.d.ts +3 -0
- package/dist/types/locales/account.d.ts +49 -0
- package/dist/types/locales/approval-decisions.d.ts +28 -0
- package/dist/types/locales/approval.d.ts +31 -0
- package/dist/types/locales/assistant-actions.d.ts +65 -0
- package/dist/types/locales/assistant-board.d.ts +14 -0
- package/dist/types/locales/assistant-cards.d.ts +81 -0
- package/dist/types/locales/assistant-chat.d.ts +13 -0
- package/dist/types/locales/assistant-devenv-hide.d.ts +23 -0
- package/dist/types/locales/assistant-work-clicks.d.ts +98 -0
- package/dist/types/locales/assistant.d.ts +5 -0
- package/dist/types/locales/brief.d.ts +29 -0
- package/dist/types/locales/catalog.d.ts +24 -0
- package/dist/types/locales/claw.d.ts +5 -0
- package/dist/types/locales/commands.d.ts +12 -0
- package/dist/types/locales/connector-reasons.d.ts +95 -0
- package/dist/types/locales/connector-setup.d.ts +20 -0
- package/dist/types/locales/feedback.d.ts +75 -0
- package/dist/types/locales/group.d.ts +33 -0
- package/dist/types/locales/guardrails.d.ts +22 -0
- package/dist/types/locales/help-lead.d.ts +15 -0
- package/dist/types/locales/index.d.ts +16 -0
- package/dist/types/locales/lang.d.ts +9 -0
- package/dist/types/locales/limits.d.ts +19 -0
- package/dist/types/locales/link.d.ts +40 -0
- package/dist/types/locales/observe.d.ts +113 -0
- package/dist/types/locales/proactive-lines.d.ts +12 -0
- package/dist/types/locales/proactive.d.ts +62 -0
- package/dist/types/locales/remote-agents.d.ts +216 -0
- package/dist/types/locales/remote-leads.d.ts +13 -0
- package/dist/types/locales/remote-window-card.d.ts +46 -0
- package/dist/types/locales/remote-window.d.ts +21 -0
- package/dist/types/locales/remote.d.ts +365 -0
- package/dist/types/locales/review-account.d.ts +43 -0
- package/dist/types/locales/review-github.d.ts +19 -0
- package/dist/types/locales/review-receipt.d.ts +45 -0
- package/dist/types/locales/review-request.d.ts +21 -0
- package/dist/types/locales/review-start.d.ts +46 -0
- package/dist/types/locales/routing.d.ts +21 -0
- package/dist/types/locales/sessions.d.ts +38 -0
- package/dist/types/locales/settings.d.ts +46 -0
- package/dist/types/locales/steps.d.ts +42 -0
- package/dist/types/locales/transparency.d.ts +18 -0
- package/dist/types/locales/turn.d.ts +70 -0
- package/dist/types/locales/typed-answer.d.ts +32 -0
- package/dist/types/note/note.d.ts +22 -0
- package/dist/types/observability/ip-address.d.ts +13 -0
- package/dist/types/observability/metrics-catalog.d.ts +17 -0
- package/dist/types/observability/security-events.d.ts +26 -0
- package/dist/types/observability/security-fields.d.ts +8 -0
- package/dist/types/observability/security-log.d.ts +21 -0
- package/dist/types/observe/board.d.ts +18 -0
- package/dist/types/observe/command.d.ts +6 -0
- package/dist/types/observe/index.d.ts +6 -0
- package/dist/types/observe/observer.d.ts +45 -0
- package/dist/types/observe/suggestions.d.ts +16 -0
- package/dist/types/observe/views.d.ts +19 -0
- package/dist/types/own.d.ts +9 -0
- package/dist/types/plugins/feedback-sink.d.ts +31 -0
- package/dist/types/plugins/identity-lookup.d.ts +21 -0
- package/dist/types/plugins/index.d.ts +31 -0
- package/dist/types/plugins/integrations.d.ts +34 -0
- package/dist/types/plugins/key-revoker.d.ts +10 -0
- package/dist/types/plugins/model-refusal-policy.d.ts +25 -0
- package/dist/types/plugins/route-extension.d.ts +27 -0
- package/dist/types/plugins/token-exchange.d.ts +36 -0
- package/dist/types/ports/claw/assistant.d.ts +55 -0
- package/dist/types/ports/claw/index.d.ts +28 -0
- package/dist/types/ports/claw/remote-agents.d.ts +53 -0
- package/dist/types/ports/claw/sessions.d.ts +105 -0
- package/dist/types/ports/claw/settings.d.ts +62 -0
- package/dist/types/ports/claw/work-items.d.ts +32 -0
- package/dist/types/ports/clock.d.ts +17 -0
- package/dist/types/ports/crypto.d.ts +15 -0
- package/dist/types/ports/github.d.ts +97 -0
- package/dist/types/ports/index.d.ts +18 -0
- package/dist/types/ports/logger.d.ts +19 -0
- package/dist/types/ports/metrics.d.ts +21 -0
- package/dist/types/ports/random.d.ts +15 -0
- package/dist/types/ports/request-scope.d.ts +31 -0
- package/dist/types/ports/routing.d.ts +107 -0
- package/dist/types/ports/secret-source.d.ts +21 -0
- package/dist/types/ports/store/approvals.d.ts +47 -0
- package/dist/types/ports/store/assistant.d.ts +104 -0
- package/dist/types/ports/store/feedback.d.ts +80 -0
- package/dist/types/ports/store/github.d.ts +81 -0
- package/dist/types/ports/store/idempotency.d.ts +21 -0
- package/dist/types/ports/store/index.d.ts +65 -0
- package/dist/types/ports/store/json.d.ts +4 -0
- package/dist/types/ports/store/link.d.ts +39 -0
- package/dist/types/ports/store/notify.d.ts +28 -0
- package/dist/types/ports/store/observe.d.ts +53 -0
- package/dist/types/ports/store/onboarding.d.ts +49 -0
- package/dist/types/ports/store/people.d.ts +77 -0
- package/dist/types/ports/store/policy.d.ts +60 -0
- package/dist/types/ports/store/remote.d.ts +114 -0
- package/dist/types/ports/store/sessions.d.ts +59 -0
- package/dist/types/ports/store/turns.d.ts +30 -0
- package/dist/types/ports/surface.d.ts +394 -0
- package/dist/types/ports/turn-cards.d.ts +52 -0
- package/dist/types/proactive/deliver.d.ts +52 -0
- package/dist/types/proactive/deps.d.ts +77 -0
- package/dist/types/proactive/events.d.ts +10 -0
- package/dist/types/proactive/index.d.ts +6 -0
- package/dist/types/proactive/proactive.d.ts +62 -0
- package/dist/types/proactive/quiet.d.ts +27 -0
- package/dist/types/proactive/release.d.ts +24 -0
- package/dist/types/proactive/said-memory.d.ts +21 -0
- package/dist/types/proactive/views.d.ts +67 -0
- package/dist/types/protocol/claw-api/assistant-events.d.ts +223 -0
- package/dist/types/protocol/claw-api/index.d.ts +5 -0
- package/dist/types/protocol/claw-api/notifications.d.ts +85 -0
- package/dist/types/protocol/claw-api/reviews.d.ts +63 -0
- package/dist/types/protocol/claw-api/session-events.d.ts +34 -0
- package/dist/types/protocol/claw-api/work-items.d.ts +75 -0
- package/dist/types/protocol/remote-agents.d.ts +230 -0
- package/dist/types/protocol.d.ts +10 -0
- package/dist/types/public-error/classify.d.ts +21 -0
- package/dist/types/public-error/index.d.ts +4 -0
- package/dist/types/public-error/patterns.d.ts +20 -0
- package/dist/types/public-error/public-error-log.d.ts +15 -0
- package/dist/types/public-error/public-errors.d.ts +20 -0
- package/dist/types/remote/actions.d.ts +36 -0
- package/dist/types/remote/agents.d.ts +37 -0
- package/dist/types/remote/answer.d.ts +9 -0
- package/dist/types/remote/board.d.ts +108 -0
- package/dist/types/remote/cards.d.ts +4 -0
- package/dist/types/remote/chat-key.d.ts +13 -0
- package/dist/types/remote/chats.d.ts +76 -0
- package/dist/types/remote/clicks-machine.d.ts +24 -0
- package/dist/types/remote/clicks-start.d.ts +36 -0
- package/dist/types/remote/clicks.d.ts +61 -0
- package/dist/types/remote/commands.d.ts +60 -0
- package/dist/types/remote/connector/reasons.d.ts +31 -0
- package/dist/types/remote/connector/setup.d.ts +62 -0
- package/dist/types/remote/context.d.ts +101 -0
- package/dist/types/remote/conversations.d.ts +37 -0
- package/dist/types/remote/ended.d.ts +25 -0
- package/dist/types/remote/events.d.ts +65 -0
- package/dist/types/remote/fields.d.ts +7 -0
- package/dist/types/remote/follow/control.d.ts +39 -0
- package/dist/types/remote/follow/follower.d.ts +85 -0
- package/dist/types/remote/follow/inbox.d.ts +16 -0
- package/dist/types/remote/follow/speaker.d.ts +122 -0
- package/dist/types/remote/follow/steps.d.ts +9 -0
- package/dist/types/remote/follow/timings.d.ts +29 -0
- package/dist/types/remote/health.d.ts +20 -0
- package/dist/types/remote/index.d.ts +21 -0
- package/dist/types/remote/inert.d.ts +18 -0
- package/dist/types/remote/limits.d.ts +48 -0
- package/dist/types/remote/lines.d.ts +66 -0
- package/dist/types/remote/links/answer.d.ts +7 -0
- package/dist/types/remote/links/domains.d.ts +19 -0
- package/dist/types/remote/links/hosts.d.ts +2 -0
- package/dist/types/remote/links/scans.d.ts +27 -0
- package/dist/types/remote/listing.d.ts +38 -0
- package/dist/types/remote/lists.d.ts +56 -0
- package/dist/types/remote/machines.d.ts +54 -0
- package/dist/types/remote/marks.d.ts +5 -0
- package/dist/types/remote/model.d.ts +51 -0
- package/dist/types/remote/options.d.ts +20 -0
- package/dist/types/remote/permissions.d.ts +41 -0
- package/dist/types/remote/ports.d.ts +143 -0
- package/dist/types/remote/prompt.d.ts +60 -0
- package/dist/types/remote/refusals.d.ts +40 -0
- package/dist/types/remote/remote-agents.d.ts +84 -0
- package/dist/types/remote/reported.d.ts +8 -0
- package/dist/types/remote/session-ops.d.ts +57 -0
- package/dist/types/remote/sessions.d.ts +80 -0
- package/dist/types/remote/setup.d.ts +26 -0
- package/dist/types/remote/state.d.ts +55 -0
- package/dist/types/remote/tail.d.ts +63 -0
- package/dist/types/remote/targets.d.ts +66 -0
- package/dist/types/remote/tasks.d.ts +20 -0
- package/dist/types/remote/time.d.ts +15 -0
- package/dist/types/remote/turn-state.d.ts +29 -0
- package/dist/types/remote/turns/chat-turn.d.ts +50 -0
- package/dist/types/remote/turns/display.d.ts +18 -0
- package/dist/types/remote/turns/outcome.d.ts +41 -0
- package/dist/types/remote/turns/runner.d.ts +55 -0
- package/dist/types/remote/turns/signer.d.ts +14 -0
- package/dist/types/remote/turns/window-turn.d.ts +29 -0
- package/dist/types/remote/views.d.ts +13 -0
- package/dist/types/remote/watches.d.ts +64 -0
- package/dist/types/remote/window/closer.d.ts +14 -0
- package/dist/types/remote/window/index.d.ts +2 -0
- package/dist/types/remote/window/output.d.ts +28 -0
- package/dist/types/remote/window/view.d.ts +73 -0
- package/dist/types/remote-view/agents-view.d.ts +88 -0
- package/dist/types/remote-view/conversations-view.d.ts +51 -0
- package/dist/types/remote-view/hidden-view.d.ts +20 -0
- package/dist/types/remote-view/index.d.ts +40 -0
- package/dist/types/remote-view/live-view.d.ts +44 -0
- package/dist/types/remote-view/machine-views.d.ts +73 -0
- package/dist/types/remote-view/messages.d.ts +3 -0
- package/dist/types/remote-view/permission-view.d.ts +55 -0
- package/dist/types/remote-view/sessions-view.d.ts +70 -0
- package/dist/types/remote-view/status-view.d.ts +52 -0
- package/dist/types/remote-view/window-view.d.ts +68 -0
- package/dist/types/result.d.ts +31 -0
- package/dist/types/review/connect/connections.d.ts +24 -0
- package/dist/types/review/connect/github-connect.d.ts +50 -0
- package/dist/types/review/connect/questions.d.ts +6 -0
- package/dist/types/review/connect/review-ask.d.ts +1 -0
- package/dist/types/review/consent.d.ts +13 -0
- package/dist/types/review/handoff.d.ts +22 -0
- package/dist/types/review/held.d.ts +15 -0
- package/dist/types/review/index.d.ts +14 -0
- package/dist/types/review/intent-check.d.ts +36 -0
- package/dist/types/review/outcome.d.ts +36 -0
- package/dist/types/review/progress.d.ts +50 -0
- package/dist/types/review/prompts.d.ts +2 -0
- package/dist/types/review/receipt.d.ts +45 -0
- package/dist/types/review/refusals.d.ts +44 -0
- package/dist/types/review/request-parse.d.ts +40 -0
- package/dist/types/review/review-turn.d.ts +83 -0
- package/dist/types/review/service/account.d.ts +52 -0
- package/dist/types/review/service/chat.d.ts +18 -0
- package/dist/types/review/service/confirm.d.ts +49 -0
- package/dist/types/review/service/deps.d.ts +100 -0
- package/dist/types/review/service/follow.d.ts +53 -0
- package/dist/types/review/service/github-review.d.ts +72 -0
- package/dist/types/review/service/handoff-action.d.ts +32 -0
- package/dist/types/review/service/identity.d.ts +27 -0
- package/dist/types/review/service/item-cards.d.ts +39 -0
- package/dist/types/review/service/items.d.ts +57 -0
- package/dist/types/review/service/launch.d.ts +37 -0
- package/dist/types/review/service/notices.d.ts +42 -0
- package/dist/types/review/service/request.d.ts +58 -0
- package/dist/types/review/service/reviewer.d.ts +48 -0
- package/dist/types/review/service/routed-turn.d.ts +20 -0
- package/dist/types/review/service/start.d.ts +65 -0
- package/dist/types/review/service/turns.d.ts +38 -0
- package/dist/types/review/summary.d.ts +11 -0
- package/dist/types/review/views.d.ts +91 -0
- package/dist/types/review-text/asks.d.ts +13 -0
- package/dist/types/review-text/bare-numbers.d.ts +29 -0
- package/dist/types/review-text/index.d.ts +10 -0
- package/dist/types/review-text/markers.d.ts +6 -0
- package/dist/types/review-text/names.d.ts +60 -0
- package/dist/types/review-text/pull-ref.d.ts +25 -0
- package/dist/types/review-text/text/scan.d.ts +19 -0
- package/dist/types/review-text/text/unicode.d.ts +22 -0
- package/dist/types/routing/admission.d.ts +83 -0
- package/dist/types/routing/chat.d.ts +52 -0
- package/dist/types/routing/command-table.d.ts +32 -0
- package/dist/types/routing/commands-account.d.ts +26 -0
- package/dist/types/routing/commands-session.d.ts +40 -0
- package/dist/types/routing/commands-settings.d.ts +17 -0
- package/dist/types/routing/context.d.ts +38 -0
- package/dist/types/routing/credentials.d.ts +53 -0
- package/dist/types/routing/deps.d.ts +116 -0
- package/dist/types/routing/features.d.ts +256 -0
- package/dist/types/routing/group-remote.d.ts +26 -0
- package/dist/types/routing/group-router.d.ts +42 -0
- package/dist/types/routing/identity.d.ts +18 -0
- package/dist/types/routing/index.d.ts +26 -0
- package/dist/types/routing/link-commands.d.ts +26 -0
- package/dist/types/routing/lock.d.ts +5 -0
- package/dist/types/routing/onboarding.d.ts +51 -0
- package/dist/types/routing/personal-router.d.ts +34 -0
- package/dist/types/routing/personal-text.d.ts +62 -0
- package/dist/types/routing/router.d.ts +57 -0
- package/dist/types/routing/show-here.d.ts +18 -0
- package/dist/types/routing/stop-press.d.ts +19 -0
- package/dist/types/routing/time.d.ts +31 -0
- package/dist/types/routing/turn-registry.d.ts +71 -0
- package/dist/types/routing/turn-runner.d.ts +82 -0
- package/dist/types/routing/turn-start.d.ts +81 -0
- package/dist/types/routing/views.d.ts +104 -0
- package/dist/types/security/redact-scan.d.ts +19 -0
- package/dist/types/security/redact-text.d.ts +14 -0
- package/dist/types/security/redact.d.ts +2 -0
- package/dist/types/subscriptions/event-types.d.ts +29 -0
- package/dist/types/subscriptions/index.d.ts +3 -0
- package/dist/types/subscriptions/ports.d.ts +9 -0
- package/dist/types/subscriptions/subscriptions.d.ts +69 -0
- package/dist/types/text/neutral.d.ts +1 -0
- package/dist/types/text/plain.d.ts +6 -0
- package/dist/types/text/py-chars.d.ts +12 -0
- package/dist/types/text/py-json.d.ts +23 -0
- package/dist/types/text/py-number.d.ts +18 -0
- package/dist/types/text/py-regex-escapes.d.ts +32 -0
- package/dist/types/text/py-regex.d.ts +36 -0
- package/dist/types/text/py-text.d.ts +64 -0
- package/dist/types/turn/answer-parts.d.ts +23 -0
- package/dist/types/turn/changes.d.ts +42 -0
- package/dist/types/turn/clip.d.ts +6 -0
- package/dist/types/turn/deliveries.d.ts +31 -0
- package/dist/types/turn/engine/claw-errors.d.ts +7 -0
- package/dist/types/turn/engine/consume.d.ts +35 -0
- package/dist/types/turn/engine/context.d.ts +157 -0
- package/dist/types/turn/engine/extras.d.ts +16 -0
- package/dist/types/turn/engine/fallback.d.ts +17 -0
- package/dist/types/turn/engine/outcome.d.ts +33 -0
- package/dist/types/turn/engine/run-turn.d.ts +22 -0
- package/dist/types/turn/engine/submit.d.ts +23 -0
- package/dist/types/turn/files.d.ts +10 -0
- package/dist/types/turn/github-outcome.d.ts +16 -0
- package/dist/types/turn/index.d.ts +26 -0
- package/dist/types/turn/json.d.ts +10 -0
- package/dist/types/turn/last-answer.d.ts +44 -0
- package/dist/types/turn/live-view.d.ts +67 -0
- package/dist/types/turn/plan.d.ts +31 -0
- package/dist/types/turn/ports.d.ts +15 -0
- package/dist/types/turn/progress/answer-messages.d.ts +20 -0
- package/dist/types/turn/progress/status-message.d.ts +144 -0
- package/dist/types/turn/progress/status-policy.d.ts +66 -0
- package/dist/types/turn/progress/status-text.d.ts +10 -0
- package/dist/types/turn/progress/stream-handle.d.ts +39 -0
- package/dist/types/turn/records.d.ts +10 -0
- package/dist/types/turn/runner.d.ts +106 -0
- package/dist/types/turn/step-labels.d.ts +28 -0
- package/dist/types/turn/step.d.ts +26 -0
- package/dist/types/turn/stop-buttons.d.ts +62 -0
- package/dist/types/turn/task.d.ts +33 -0
- package/dist/types/turn/turn-state.d.ts +70 -0
- package/dist/types/turn/views.d.ts +23 -0
- package/dist/types/typed-answer/index.d.ts +8 -0
- package/dist/types/typed-answer/mode.d.ts +38 -0
- package/dist/types/typed-answer/patterns.d.ts +25 -0
- package/dist/types/typed-answer/prompt.d.ts +5 -0
- package/dist/types/typed-answer/read.d.ts +16 -0
- package/dist/types/understanding/commands.d.ts +14 -0
- package/dist/types/understanding/context.d.ts +49 -0
- package/dist/types/understanding/index.d.ts +11 -0
- package/dist/types/understanding/limits.d.ts +6 -0
- package/dist/types/understanding/people.d.ts +31 -0
- package/dist/types/understanding/record.d.ts +10 -0
- package/dist/types/understanding/review-stop.d.ts +7 -0
- package/dist/types/understanding/sequence-matcher.d.ts +7 -0
- package/dist/types/validate.d.ts +15 -0
- package/package.json +35 -4
- package/README.md +0 -3
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Chat } from "./chat.js";
|
|
2
|
+
import type { RouterContext } from "./context.js";
|
|
3
|
+
/**
|
|
4
|
+
* The person's own settings of when they are reached (the Python `Agent._cmd_timezone`, `_cmd_quiet`, `_cmd_pause`,
|
|
5
|
+
* `_cmd_resume`): every reply in their language, and what quiet hours or a pause held is delivered as soon as nothing
|
|
6
|
+
* mutes them any more.
|
|
7
|
+
*/
|
|
8
|
+
export declare class SettingsCommands {
|
|
9
|
+
private readonly ctx;
|
|
10
|
+
constructor(ctx: RouterContext);
|
|
11
|
+
timezone(chat: Chat, name: string | null): Promise<void>;
|
|
12
|
+
quiet(chat: Chat, arg: string): Promise<void>;
|
|
13
|
+
pause(chat: Chat, arg: string): Promise<void>;
|
|
14
|
+
resume(chat: Chat): Promise<void>;
|
|
15
|
+
/** After a change: when nothing mutes the person any more, what was held is delivered. */
|
|
16
|
+
private releaseIfOpen;
|
|
17
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { Part } from "../capabilities/registry.js";
|
|
2
|
+
import type { ConversationRef, InboundAction, InboundEvent, OutMessage } from "../ports/surface.js";
|
|
3
|
+
import type { ClickRoute, SettleOptions } from "../ports/routing.js";
|
|
4
|
+
import { TaskAdmission } from "./admission.js";
|
|
5
|
+
import { Chat } from "./chat.js";
|
|
6
|
+
import { Credentials } from "./credentials.js";
|
|
7
|
+
import type { RouterDeps } from "./deps.js";
|
|
8
|
+
import { KeyOwners } from "./identity.js";
|
|
9
|
+
import { TurnRegistry } from "./turn-registry.js";
|
|
10
|
+
import { CommandViews } from "./views.js";
|
|
11
|
+
/** What every part of the router shares: its dependencies and the services built from them, once. */
|
|
12
|
+
export declare class RouterContext {
|
|
13
|
+
readonly deps: RouterDeps;
|
|
14
|
+
readonly turns: TurnRegistry;
|
|
15
|
+
readonly views: CommandViews;
|
|
16
|
+
readonly credentials: Credentials;
|
|
17
|
+
readonly admission: TaskAdmission;
|
|
18
|
+
readonly owners: KeyOwners;
|
|
19
|
+
constructor(deps: RouterDeps);
|
|
20
|
+
/** The parts of the worker that are on: what help offers and what the assistant may be asked for. */
|
|
21
|
+
parts(): ReadonlySet<Part>;
|
|
22
|
+
/** The chat an event is answered in: its conversation, as the person who sent it. */
|
|
23
|
+
chatOf(event: InboundEvent, scope: string): Chat;
|
|
24
|
+
/** A chat in another conversation of the same person (their 1:1 chat, a group a request waited in). */
|
|
25
|
+
chatIn(chat: Chat, ref: ConversationRef, scope?: string): Chat;
|
|
26
|
+
/** A click as a feature handler is given it. */
|
|
27
|
+
clickRoute(action: InboundAction, chat: Chat): ClickRoute;
|
|
28
|
+
/** THE way the router ends a click (see `settleClick`). */
|
|
29
|
+
settle(action: InboundAction, chat: Chat, card: OutMessage | string, options?: SettleOptions): Promise<boolean>;
|
|
30
|
+
/** What the turns of stopped work items must know (a review following it ends as stopped, not failed). */
|
|
31
|
+
private readonly stopListeners;
|
|
32
|
+
/** A work item was stopped from its card or a group's "停 825": the review turn following it ends as stopped. */
|
|
33
|
+
itemStopped(itemId: string): void;
|
|
34
|
+
/** The review service hears of a stopped item too (`GithubReview.item_stopped`). */
|
|
35
|
+
onItemStopped(listener: (itemId: string) => void): void;
|
|
36
|
+
/** Whether the person's 1:1 chat (or a group of theirs, `scope`) has a turn this worker follows. */
|
|
37
|
+
hasTurn(userId: string, scope?: string): boolean;
|
|
38
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { OutMessage } from "../ports/surface.js";
|
|
2
|
+
import type { Chat } from "./chat.js";
|
|
3
|
+
import type { RouterDeps } from "./deps.js";
|
|
4
|
+
import type { CredentialProvider } from "./features.js";
|
|
5
|
+
import type { CommandViews } from "./views.js";
|
|
6
|
+
/** The identity service is down for a moment while a person with no key is followed: that is not "no credential". */
|
|
7
|
+
export declare class CredentialUnavailable extends Error {
|
|
8
|
+
readonly name = "CredentialUnavailable";
|
|
9
|
+
}
|
|
10
|
+
type CredentialDeps = Pick<RouterDeps, "store" | "exchange" | "config" | "logger">;
|
|
11
|
+
/**
|
|
12
|
+
* What Claw is called with for a person, and what a person who has none is told (the Python `Agent._credential`,
|
|
13
|
+
* `_unlinked`, `_connect_identity`, `_binding_card`, `_ask_to_link`, `_background_credential`, `_fresh_credential`).
|
|
14
|
+
*
|
|
15
|
+
* A chat runs on the person's linked key; with TEAMS_EXCHANGE_FOR_CHAT on, on a fresh exchanged token when they have a
|
|
16
|
+
* confirmed binding, else their linked key, else they get the card that binds them.
|
|
17
|
+
*/
|
|
18
|
+
export declare class Credentials {
|
|
19
|
+
private readonly deps;
|
|
20
|
+
private readonly views;
|
|
21
|
+
/** What an ordinary chat calls Claw with: the exchange only when it is on for chats. */
|
|
22
|
+
private readonly chatExchange;
|
|
23
|
+
constructor(deps: CredentialDeps, views: CommandViews);
|
|
24
|
+
/** Whether chats run on exchanged tokens. */
|
|
25
|
+
get onExchange(): boolean;
|
|
26
|
+
/** What to call Claw with for this person, or undefined after they were told what to do (`ask`). */
|
|
27
|
+
credential(chat: Chat, ask?: boolean): Promise<string | undefined>;
|
|
28
|
+
/** A fresh credential per call when chats run on exchanged tokens (they expire); undefined: the key as it is. */
|
|
29
|
+
provider(userId: string, key: string): CredentialProvider;
|
|
30
|
+
/** The person's exchanged token, else `fallback` (a turn can outlive a 10-minute token: each Claw call asks again). */
|
|
31
|
+
fresh(userId: string, fallback: string): Promise<string>;
|
|
32
|
+
/**
|
|
33
|
+
* What to read Claw with for a person when nobody is writing (a reader that follows a remote session): no question, no
|
|
34
|
+
* message; undefined when they have no credential. Throws CredentialUnavailable while the identity service is down
|
|
35
|
+
* for a person with no key.
|
|
36
|
+
*/
|
|
37
|
+
background(userId: string): Promise<string | undefined>;
|
|
38
|
+
/**
|
|
39
|
+
* What a chat tells a person who cannot be answered yet; `lead` is a first sentence for a message that arrives unasked
|
|
40
|
+
* (the 1:1 message after an @mention in a group). The key's steps, or the identity binding when chats run on it.
|
|
41
|
+
*/
|
|
42
|
+
unlinked(chat: Chat, lead?: string): Promise<void>;
|
|
43
|
+
/** The card that connects the person's account at the identity service (what `/github` and a review need). */
|
|
44
|
+
connectIdentity(chat: Chat, lead?: string): Promise<void>;
|
|
45
|
+
/**
|
|
46
|
+
* A one-time confirm link from the identity service, opened in a browser and confirmed once. When the service cannot
|
|
47
|
+
* be asked, the older card, whose Confirm button explains the desktop way: the person is never left with nothing.
|
|
48
|
+
*/
|
|
49
|
+
bindingCard(chat: Chat, lead?: string): Promise<OutMessage>;
|
|
50
|
+
/** The `/link` steps, in the person's language (all English after a lead that has no Chinese of its own). */
|
|
51
|
+
askToLink(chat: Chat, lead?: string): Promise<void>;
|
|
52
|
+
}
|
|
53
|
+
export {};
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import type { Integrations } from "../plugins/integrations.js";
|
|
2
|
+
import type { IdentityLookup } from "../plugins/identity-lookup.js";
|
|
3
|
+
import type { KeyRevoker } from "../plugins/key-revoker.js";
|
|
4
|
+
import type { TokenExchange } from "../plugins/token-exchange.js";
|
|
5
|
+
import type { ClawPort } from "../ports/claw/index.js";
|
|
6
|
+
import type { Clock } from "../ports/clock.js";
|
|
7
|
+
import type { Random } from "../ports/random.js";
|
|
8
|
+
import type { RequestScope } from "../ports/request-scope.js";
|
|
9
|
+
import type { Logger, LogValue } from "../ports/logger.js";
|
|
10
|
+
import type { MetricsPort } from "../ports/metrics.js";
|
|
11
|
+
import type { RouteHandlers } from "../ports/routing.js";
|
|
12
|
+
import type { StorePort } from "../ports/store/index.js";
|
|
13
|
+
import type { ConversationRef, OutMessage, Surface } from "../ports/surface.js";
|
|
14
|
+
import type { JsonObject } from "../json.js";
|
|
15
|
+
import type { SecurityEventName } from "../observability/security-events.js";
|
|
16
|
+
import type { AssistantChat, ChannelContextBuilder, ConnectionsText, GithubChat, MessageText, NoteFactory, Observing, RemoteChat, ReviewStopReader, StopCards, Subscriptions } from "./features.js";
|
|
17
|
+
import type { TurnRunner } from "./turn-runner.js";
|
|
18
|
+
/** What a deployment sets for the router (the Python `Agent.__init__` arguments that are settings). */
|
|
19
|
+
export interface RouterConfig {
|
|
20
|
+
/** The console's address, for the links the router gives (`/primus-claw/teams-link`, the memory page). */
|
|
21
|
+
readonly publicBaseUrl: string;
|
|
22
|
+
readonly botName: string;
|
|
23
|
+
/** Sessions are created with this Claw plugin ("" none). */
|
|
24
|
+
readonly pluginId: string;
|
|
25
|
+
/** Sessions are pinned to this model ("" Claw's default). */
|
|
26
|
+
readonly model: string;
|
|
27
|
+
/** What a review for a colleague runs on when its request named no model ("" the chat's model). */
|
|
28
|
+
readonly reviewModel: string;
|
|
29
|
+
/** A turn refused for want of a gateway key runs again on this model ("" never). */
|
|
30
|
+
readonly fallbackModel: string;
|
|
31
|
+
/** Ordinary chats run on exchanged tokens (TEAMS_EXCHANGE_FOR_CHAT) instead of the linked key. */
|
|
32
|
+
readonly exchangeForChat: boolean;
|
|
33
|
+
/** The parts of help that need Claw switches this worker cannot read. */
|
|
34
|
+
readonly briefEnabled: boolean;
|
|
35
|
+
readonly schedulesEnabled: boolean;
|
|
36
|
+
readonly jobWatchEnabled: boolean;
|
|
37
|
+
/** Answers on a phone get thumbs of the worker's own (TEAMS_OWN_THUMBS_MOBILE). */
|
|
38
|
+
readonly ownThumbsMobile: boolean;
|
|
39
|
+
}
|
|
40
|
+
/** The repositories the router reads and writes (the W1 store, as far as routing goes). */
|
|
41
|
+
export type RouterStore = Pick<StorePort, "links" | "references" | "prefs" | "members" | "sessions" | "repoHistory" | "turns" | "onboarding" | "idempotency" | "assistantMessages" | "notifySubs" | "now">;
|
|
42
|
+
/** The per-person limits (Python `limits.py`): messages per window and tasks at the same time. */
|
|
43
|
+
export interface RouterLimits {
|
|
44
|
+
readonly maxConcurrentTasks: number;
|
|
45
|
+
/** How long a message to the assistant may hold a task slot while its work item has not shown on the board. */
|
|
46
|
+
readonly assistantPendingSeconds: number;
|
|
47
|
+
/** Counts a message of `userId`; when refused, whether the person is told this time and when they may write again. */
|
|
48
|
+
checkMessage(userId: string): {
|
|
49
|
+
readonly allowed: true;
|
|
50
|
+
} | RateRefusal;
|
|
51
|
+
/** What a refused message says, in `lang`. */
|
|
52
|
+
rateNotice(lang: "en" | "zh", retryAfterSeconds: number): string;
|
|
53
|
+
/** What a refused task says, in `lang`: `running` tasks, `what` the one refused ("" none named). */
|
|
54
|
+
concurrencyNotice(lang: "en" | "zh", running: number, what: string): string;
|
|
55
|
+
}
|
|
56
|
+
export interface RateRefusal {
|
|
57
|
+
readonly allowed: false;
|
|
58
|
+
readonly notify: boolean;
|
|
59
|
+
readonly retryAfterSeconds: number;
|
|
60
|
+
readonly limit: number;
|
|
61
|
+
readonly windowSeconds: number;
|
|
62
|
+
}
|
|
63
|
+
/** Stored conversation references, as the channel reads and writes them. */
|
|
64
|
+
export interface ChannelRefs {
|
|
65
|
+
/** The reference a stored one is (Teams: the Bot Framework reference the Python worker stored); undefined: not one. */
|
|
66
|
+
refOf(stored: JsonObject): ConversationRef | undefined;
|
|
67
|
+
}
|
|
68
|
+
/** Notices held by quiet hours or a pause (Python `proactive.Proactive`). */
|
|
69
|
+
export interface ProactiveHold {
|
|
70
|
+
/** Why the person is muted now ("quiet" or "paused"); null when nothing mutes them. */
|
|
71
|
+
muted(userId: string): string | null;
|
|
72
|
+
/** Deliver what was held for the person. */
|
|
73
|
+
release(userId: string): Promise<void>;
|
|
74
|
+
}
|
|
75
|
+
/** Everything the router is built with. A feature that is off is given as undefined (GitHub, notifications). */
|
|
76
|
+
export interface RouterDeps {
|
|
77
|
+
readonly config: RouterConfig;
|
|
78
|
+
readonly surface: Surface;
|
|
79
|
+
readonly channel: ChannelRefs;
|
|
80
|
+
readonly store: RouterStore;
|
|
81
|
+
readonly claw: ClawPort;
|
|
82
|
+
readonly clock: Clock;
|
|
83
|
+
/** Where the event being handled is kept for what it starts (none: `noRequestScope`). */
|
|
84
|
+
readonly requestScope?: RequestScope;
|
|
85
|
+
readonly random: Random;
|
|
86
|
+
readonly logger: Logger;
|
|
87
|
+
readonly metrics: MetricsPort;
|
|
88
|
+
readonly securityEvent: (name: SecurityEventName, fields: Readonly<Record<string, LogValue>>) => void;
|
|
89
|
+
readonly identity: IdentityLookup;
|
|
90
|
+
readonly keyRevoker: KeyRevoker;
|
|
91
|
+
readonly exchange: TokenExchange;
|
|
92
|
+
readonly limits: RouterLimits;
|
|
93
|
+
readonly assistant: AssistantChat;
|
|
94
|
+
readonly remote: RemoteChat;
|
|
95
|
+
readonly turns: TurnRunner;
|
|
96
|
+
/** The Stop cards of turns a phone starts. */
|
|
97
|
+
readonly stopCards: StopCards;
|
|
98
|
+
readonly proactive: ProactiveHold;
|
|
99
|
+
readonly observing: Observing;
|
|
100
|
+
readonly github: GithubChat | undefined;
|
|
101
|
+
/** The review-stop words of a group (with the review service on). */
|
|
102
|
+
readonly reviewStop: ReviewStopReader | undefined;
|
|
103
|
+
/** What a chat can hand back to this worker (the review service's `review_for_other`; empty without it). */
|
|
104
|
+
readonly handoffs: readonly string[];
|
|
105
|
+
readonly channelContext: ChannelContextBuilder;
|
|
106
|
+
readonly messageText: MessageText;
|
|
107
|
+
/** `/whoami`'s connection lines (the review service's renderer, which also says them without it). */
|
|
108
|
+
readonly connectionsText: ConnectionsText;
|
|
109
|
+
/** The "Report a problem" card under a message that says something went wrong (feedback's view); undefined: none. */
|
|
110
|
+
readonly reportView: (userId: string, scope: string) => OutMessage | undefined;
|
|
111
|
+
/** The note card a settled click ends as. */
|
|
112
|
+
readonly note: NoteFactory;
|
|
113
|
+
readonly subscriptions: Subscriptions | undefined;
|
|
114
|
+
readonly handlers: RouteHandlers;
|
|
115
|
+
readonly integrations: Integrations;
|
|
116
|
+
}
|
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
import type { GithubConnection } from "../claw/model.js";
|
|
2
|
+
import type { JsonObject } from "../json.js";
|
|
3
|
+
import type { KeyOwner } from "../plugins/identity-lookup.js";
|
|
4
|
+
import type { Lang } from "../locales/lang.js";
|
|
5
|
+
import type { Conversation, InboundFile, InboundMessage, OutMessage, UserRef } from "../ports/surface.js";
|
|
6
|
+
/**
|
|
7
|
+
* What the router asks of the features it hands messages to. Each is implemented by the feature's own module (the
|
|
8
|
+
* assistant, remote agents, the turn engine, the review service, observing, notifications) and given to the router by
|
|
9
|
+
* the assembly; the router never reaches into a feature, and a feature that is off is given as its `off` value.
|
|
10
|
+
*/
|
|
11
|
+
/** A fresh credential per call for a chat that runs on exchanged tokens (they expire); undefined: the key as it is. */
|
|
12
|
+
export type CredentialProvider = (() => Promise<string>) | undefined;
|
|
13
|
+
/** A 1:1 message on the plain route (the Python `Assistant.route`). */
|
|
14
|
+
export interface AssistantRouteRequest {
|
|
15
|
+
readonly userId: string;
|
|
16
|
+
readonly credential: string;
|
|
17
|
+
readonly prompt: string;
|
|
18
|
+
readonly conversation: Conversation;
|
|
19
|
+
readonly files: readonly InboundFile[];
|
|
20
|
+
/** Present only where remote agents are on: what this chat is attached to (null for nothing). */
|
|
21
|
+
readonly attached?: JsonObject | null;
|
|
22
|
+
/** Told (session, message id or null when Claw queued it) once Claw has taken the message (a phone's Stop card). */
|
|
23
|
+
readonly onSent?: OnSent;
|
|
24
|
+
}
|
|
25
|
+
/** Claw took a message to the assistant: its session and the message id its turn answers (null: queued). */
|
|
26
|
+
export type OnSent = (sessionId: string, messageId: string | null) => void;
|
|
27
|
+
/** A message of a person the assistant understands (the Python `Assistant.understand`). */
|
|
28
|
+
export interface UnderstandRequest {
|
|
29
|
+
readonly userId: string;
|
|
30
|
+
/** The exchanged identity token when there is one, else the linked key. */
|
|
31
|
+
readonly credential: string;
|
|
32
|
+
/** The linked key beside an identity token, for the model ("" when `credential` is the key). */
|
|
33
|
+
readonly modelKey: string;
|
|
34
|
+
readonly prompt: string;
|
|
35
|
+
/** The chat's context (`channel_context`). */
|
|
36
|
+
readonly context: JsonObject;
|
|
37
|
+
readonly lang: Lang;
|
|
38
|
+
readonly conversation: Conversation;
|
|
39
|
+
readonly files: readonly InboundFile[];
|
|
40
|
+
readonly onSent?: OnSent;
|
|
41
|
+
}
|
|
42
|
+
/** The person's assistant (Python `assistant.Assistant`). */
|
|
43
|
+
export interface AssistantChat {
|
|
44
|
+
/** A 1:1 chat that talks to the assistant (no sessions of its own). */
|
|
45
|
+
on(userId: string): boolean;
|
|
46
|
+
/** The assistant reads every message of this person (only an exact command is read by the router). */
|
|
47
|
+
understands(userId: string): boolean;
|
|
48
|
+
/** The assistant can be sent a message now. */
|
|
49
|
+
reachable(userId: string): boolean;
|
|
50
|
+
/** The reply, in `lang`, to a command that has no meaning with the assistant on; undefined when `text` is not one. */
|
|
51
|
+
hiddenCommand(text: string, lang: Lang): string | undefined;
|
|
52
|
+
board(userId: string, credential: string, conversation: Conversation): Promise<void>;
|
|
53
|
+
/**
|
|
54
|
+
* What the assistant is doing this moment is stopped. `onlyMessage`: only while Claw's running turn answers that
|
|
55
|
+
* message; false, with nothing said or stopped, when it does not.
|
|
56
|
+
*/
|
|
57
|
+
stop(userId: string, credential: string, conversation: Conversation, onlyMessage?: string): Promise<boolean>;
|
|
58
|
+
/** Forget what is kept for the person (they unlinked). */
|
|
59
|
+
forget(userId: string): void;
|
|
60
|
+
/** True when the assistant took the message. */
|
|
61
|
+
route(request: AssistantRouteRequest): Promise<boolean>;
|
|
62
|
+
/** True when it was sent. */
|
|
63
|
+
understand(request: UnderstandRequest): Promise<boolean>;
|
|
64
|
+
/** What a message of files and no words asks, in `lang`. */
|
|
65
|
+
filesOnly(lang: Lang): string;
|
|
66
|
+
}
|
|
67
|
+
/** What a chat is attached to, as help's first lines say it (each already made safe to show). */
|
|
68
|
+
export interface Attachment {
|
|
69
|
+
readonly label: string;
|
|
70
|
+
readonly host: string;
|
|
71
|
+
/** "" when the session has no folder. */
|
|
72
|
+
readonly cwd: string;
|
|
73
|
+
/** The line that says where the chat box goes while the session card is the window, in the language asked for. */
|
|
74
|
+
readonly cardWindowLine: string;
|
|
75
|
+
}
|
|
76
|
+
/** One turn of an attached agent, as the remote-agent feature follows it: the work that reads it (null: none yet). */
|
|
77
|
+
export interface RemoteTurn {
|
|
78
|
+
readonly task: {
|
|
79
|
+
readonly done: Promise<void>;
|
|
80
|
+
readonly running: boolean;
|
|
81
|
+
} | null;
|
|
82
|
+
}
|
|
83
|
+
export interface RemotePrompt {
|
|
84
|
+
readonly message: InboundMessage;
|
|
85
|
+
/** The chat's own identity (a group binding's chat key, or the person in their 1:1 chat). */
|
|
86
|
+
readonly chat: UserRef;
|
|
87
|
+
readonly credential: string;
|
|
88
|
+
readonly prompt: string;
|
|
89
|
+
readonly conversation: Conversation;
|
|
90
|
+
readonly provider: CredentialProvider;
|
|
91
|
+
}
|
|
92
|
+
export interface RemoteAgentCommand {
|
|
93
|
+
readonly chat: UserRef;
|
|
94
|
+
readonly credential: string;
|
|
95
|
+
/** What follows `/agent`. */
|
|
96
|
+
readonly args: string;
|
|
97
|
+
readonly conversation: Conversation;
|
|
98
|
+
/** Undefined for a command the assistant asked for. */
|
|
99
|
+
readonly message: InboundMessage | undefined;
|
|
100
|
+
readonly provider: CredentialProvider;
|
|
101
|
+
}
|
|
102
|
+
/** Agents on the person's own machines (Python `remote.RemoteAgents`). Keys are chat keys: a person, or a group binding. */
|
|
103
|
+
export interface RemoteChat {
|
|
104
|
+
readonly enabled: boolean;
|
|
105
|
+
attached(chatKey: string): boolean;
|
|
106
|
+
/** The chat is the agent's window itself (direct chat). */
|
|
107
|
+
direct(chatKey: string): boolean;
|
|
108
|
+
windowMode(chatKey: string): "card" | "chat";
|
|
109
|
+
/** The message replies quoting the session's card. */
|
|
110
|
+
quotesWindow(chatKey: string, message: InboundMessage): boolean;
|
|
111
|
+
/** A turn of the attached agent is running for this person. */
|
|
112
|
+
running(userId: string): boolean;
|
|
113
|
+
/** What the chat is attached to, as the assistant is told it (null: nothing). */
|
|
114
|
+
chatContext(userId: string, credential: string): Promise<JsonObject | null>;
|
|
115
|
+
attachment(chatKey: string, lang: Lang): Attachment | undefined;
|
|
116
|
+
prompt(request: RemotePrompt): Promise<void>;
|
|
117
|
+
/**
|
|
118
|
+
* True when the attached agent was the one to stop. `only`: stop only while that turn (`currentTurn`) still runs; false,
|
|
119
|
+
* with nothing said or stopped, when it does not.
|
|
120
|
+
*/
|
|
121
|
+
stop(chat: UserRef, credential: string, conversation: Conversation, only?: RemoteTurn): Promise<boolean>;
|
|
122
|
+
/**
|
|
123
|
+
* The attached agent's turn running for this chat now (undefined: none), compared by identity. Absent on a remote-agent
|
|
124
|
+
* feature that does not follow turns: a phone's message to an agent then gets no Stop card.
|
|
125
|
+
*/
|
|
126
|
+
currentTurn?(chatKey: string): RemoteTurn | undefined;
|
|
127
|
+
/** The chat's session card is the window (it has a Stop of its own). */
|
|
128
|
+
windowed?(chatKey: string): boolean;
|
|
129
|
+
agents(sender: UserRef, credential: string, conversation: Conversation): Promise<void>;
|
|
130
|
+
agent(command: RemoteAgentCommand): Promise<void>;
|
|
131
|
+
forgetPerson(userId: string): void;
|
|
132
|
+
/** The chat key of a person's binding in a group chat. */
|
|
133
|
+
groupChatKey(userId: string, scope: string): string;
|
|
134
|
+
}
|
|
135
|
+
/** The person's notification subscription in Claw (Python `subscriptions.Subscriptions`); undefined when notifications are off. */
|
|
136
|
+
export interface Subscriptions {
|
|
137
|
+
ensure(userId: string): Promise<void>;
|
|
138
|
+
/** Before the key is revoked: Claw needs it to delete the subscription. */
|
|
139
|
+
remove(userId: string, key: string): Promise<void>;
|
|
140
|
+
}
|
|
141
|
+
/** Observing a group for a person's assistant (Python `observe.Observer`). */
|
|
142
|
+
export interface Observing {
|
|
143
|
+
/** A group message not addressed to the bot: to the group's observer, if it has one. */
|
|
144
|
+
forward(message: InboundMessage): Promise<void>;
|
|
145
|
+
mayTurnOn(userId: string): boolean;
|
|
146
|
+
/** The suggestions the observed groups make for the person (`/board`). */
|
|
147
|
+
board(userId: string, credential: string, conversation: Conversation): Promise<void>;
|
|
148
|
+
}
|
|
149
|
+
/** The review service's part in the chat (Python `github_review.GithubReview` and `github_connect.GithubConnect`). */
|
|
150
|
+
export interface GithubChat {
|
|
151
|
+
/** Which channel id is whose, for reading a mention in a group. */
|
|
152
|
+
remember(message: InboundMessage): void;
|
|
153
|
+
/** Help's values of the person's GitHub ("github", "delegation", "confirm_mode"); those it cannot read are left out. */
|
|
154
|
+
helpValues(userId: string, lang: Lang): Promise<Readonly<Record<string, string>>>;
|
|
155
|
+
/**
|
|
156
|
+
* Beside a question about the person's own GitHub while Claw has no token of theirs: the connect card, sent before the
|
|
157
|
+
* question goes on; `again` asks it again once they connect.
|
|
158
|
+
*/
|
|
159
|
+
offerConnect(request: {
|
|
160
|
+
readonly sender: UserRef;
|
|
161
|
+
readonly credential: string;
|
|
162
|
+
readonly text: string;
|
|
163
|
+
readonly lang: Lang;
|
|
164
|
+
readonly conversation: Conversation;
|
|
165
|
+
readonly again: () => Promise<void>;
|
|
166
|
+
}): Promise<void>;
|
|
167
|
+
/** The open confirmations of the person (the assistant's context). */
|
|
168
|
+
pendingConfirmations(userId: string): readonly JsonObject[];
|
|
169
|
+
/**
|
|
170
|
+
* The person's GitHub binding at the identity service, as `/whoami` passes it on to `ConnectionsText` (the review
|
|
171
|
+
* service's own value: bound, none, or not known just now).
|
|
172
|
+
*/
|
|
173
|
+
connectionState(userId: string): Promise<unknown>;
|
|
174
|
+
}
|
|
175
|
+
/** What `/whoami` lists after its first line (the Python `github_connect.connections_text`, the review service's). */
|
|
176
|
+
export interface WhoamiConnections {
|
|
177
|
+
readonly owner: KeyOwner | undefined;
|
|
178
|
+
/** `GithubChat.connectionState`; undefined without the review service. */
|
|
179
|
+
readonly githubState: unknown;
|
|
180
|
+
/** Claw's answer about the person's GitHub tools (undefined: none, or could not be asked). */
|
|
181
|
+
readonly connection: GithubConnection | null | undefined;
|
|
182
|
+
/** Whether Claw could say. */
|
|
183
|
+
readonly connectionKnown: boolean;
|
|
184
|
+
readonly githubPart: boolean;
|
|
185
|
+
/** [enabled, available] of the person's memory in Claw; undefined: not known just now. */
|
|
186
|
+
readonly memory: readonly [boolean, boolean] | undefined;
|
|
187
|
+
readonly memoryPage: string;
|
|
188
|
+
readonly zh: boolean;
|
|
189
|
+
}
|
|
190
|
+
export type ConnectionsText = (connections: WhoamiConnections) => string;
|
|
191
|
+
/** The person's own review-stop words in a group ("停 825"): the pull requests named, as [owner/repo or "", number]. */
|
|
192
|
+
export type ReviewStopReader = (text: string) => readonly (readonly [string, number])[];
|
|
193
|
+
/** What a message to the assistant carries about the chat (the Python `understanding.channel_context`). */
|
|
194
|
+
export interface ChannelContextRequest {
|
|
195
|
+
readonly channelMessageId: string;
|
|
196
|
+
readonly userId: string;
|
|
197
|
+
readonly message: InboundMessage;
|
|
198
|
+
/** The parts of the worker that are on (help's parts): which actions the chat declares. */
|
|
199
|
+
readonly parts: ReadonlySet<string>;
|
|
200
|
+
/** What this chat can be handed back to carry out itself (the review service's `review_for_other`). */
|
|
201
|
+
readonly handoffs: readonly string[];
|
|
202
|
+
/** Present only where remote agents are on: what the chat is attached to (null: nothing). */
|
|
203
|
+
readonly attached?: JsonObject | null;
|
|
204
|
+
/** "on_behalf" for a message this worker posted for the person. */
|
|
205
|
+
readonly via: string;
|
|
206
|
+
}
|
|
207
|
+
export interface ChannelContext {
|
|
208
|
+
readonly context: JsonObject;
|
|
209
|
+
/** The names of the actions it declared. */
|
|
210
|
+
readonly actions: readonly string[];
|
|
211
|
+
/** The Claw user ids of the people it names. */
|
|
212
|
+
readonly people: readonly string[];
|
|
213
|
+
}
|
|
214
|
+
export type ChannelContextBuilder = (request: ChannelContextRequest) => ChannelContext;
|
|
215
|
+
/** Reading what a message carries besides its words (the channel's inbound text, W3: the Python `activity` helpers). */
|
|
216
|
+
export interface MessageText {
|
|
217
|
+
/** The message(s) it quotes, as text for the model ("" none). `group`: as a group chat shows them. */
|
|
218
|
+
quoteBlock(message: InboundMessage, group: boolean): string;
|
|
219
|
+
/** `text` with the address behind each of the message's links. */
|
|
220
|
+
withLinks(text: string, message: InboundMessage): string;
|
|
221
|
+
/** `text` after the quote block it answers. */
|
|
222
|
+
withQuote(text: string, quote: string): string;
|
|
223
|
+
/** The line that names the files the channel gave no way to fetch (undefined: none). */
|
|
224
|
+
unreadable(message: InboundMessage): {
|
|
225
|
+
readonly line: string;
|
|
226
|
+
readonly count: number;
|
|
227
|
+
} | undefined;
|
|
228
|
+
}
|
|
229
|
+
/** A button on a note card: what it says and what pressing it sends back (the card data's verb and fields). */
|
|
230
|
+
export interface NoteButton {
|
|
231
|
+
readonly title: string;
|
|
232
|
+
readonly verb: string;
|
|
233
|
+
readonly data: Readonly<Record<string, string>>;
|
|
234
|
+
readonly style?: "positive" | "destructive";
|
|
235
|
+
}
|
|
236
|
+
/** The note card a settled click ends as (rendered by the channel; the Python `render.note_card`). */
|
|
237
|
+
export type NoteFactory = (text: string, options?: {
|
|
238
|
+
readonly title?: string;
|
|
239
|
+
readonly tone?: string;
|
|
240
|
+
readonly buttons?: readonly NoteButton[];
|
|
241
|
+
}) => OutMessage;
|
|
242
|
+
/** Which kind of turn a phone's Stop card stops. */
|
|
243
|
+
export type StopCardKind = "session" | "assistant" | "remote";
|
|
244
|
+
/** One Stop card's offer (the turn engine's `StopButtons`): whose, which kind, the card, and whether it was used. */
|
|
245
|
+
export interface StopCardOffer {
|
|
246
|
+
readonly kind: StopCardKind;
|
|
247
|
+
readonly alive: (credential: string) => Promise<boolean>;
|
|
248
|
+
cardId: string | undefined;
|
|
249
|
+
used: boolean;
|
|
250
|
+
}
|
|
251
|
+
/** The Stop cards of turns started from a phone, whose own Stop is greyed out (the turn engine's `StopButtons`). */
|
|
252
|
+
export interface StopCards {
|
|
253
|
+
offer(userId: string, kind: StopCardKind, conversation: Pick<Conversation, "post" | "delete">, lang: string, alive: (credential: string) => Promise<boolean>, ended: Promise<unknown>): StopCardOffer;
|
|
254
|
+
/** The offer of a card this person pressed; undefined for an unknown, forgotten or someone else's token. */
|
|
255
|
+
get(token: string, userId: string): StopCardOffer | undefined;
|
|
256
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { InboundMessage } from "../ports/surface.js";
|
|
2
|
+
import type { Chat } from "./chat.js";
|
|
3
|
+
import type { RouterContext } from "./context.js";
|
|
4
|
+
import type { PersonalText } from "./personal-text.js";
|
|
5
|
+
export interface GroupWords {
|
|
6
|
+
readonly text: string;
|
|
7
|
+
readonly quote: string;
|
|
8
|
+
readonly sent: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* A group chat bound to one of the sender's agent sessions (one group, one session at a time; the Python
|
|
12
|
+
* `Agent._group_remote`). "切到 X 上的 claude" (`/agent attach REF`) binds the group for the sender, "回到助理"
|
|
13
|
+
* (`/agent detach`) unbinds it; while bound, the sender's @-messages go to that session and "停掉它" stops its turn. The
|
|
14
|
+
* binding is the sender's own: another member's message is never read by it. False: not a message about the binding.
|
|
15
|
+
*/
|
|
16
|
+
export declare class GroupRemote {
|
|
17
|
+
private readonly ctx;
|
|
18
|
+
private readonly text;
|
|
19
|
+
constructor(ctx: RouterContext, text: PersonalText);
|
|
20
|
+
private chatOf;
|
|
21
|
+
/** The `/agent` arguments a group message asks for: typed, said as a switch, or "回到助理" while bound. */
|
|
22
|
+
private agentArgs;
|
|
23
|
+
route(message: InboundMessage, chat: Chat, key: string, words: GroupWords): Promise<boolean>;
|
|
24
|
+
/** A message of a sender whose binding holds this group. */
|
|
25
|
+
private toBound;
|
|
26
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { MessageInterceptor } from "../ports/routing.js";
|
|
2
|
+
import type { InboundAction, InboundMessage } from "../ports/surface.js";
|
|
3
|
+
import { type Chat } from "./chat.js";
|
|
4
|
+
import type { SessionCommands } from "./commands-session.js";
|
|
5
|
+
import type { RouterContext } from "./context.js";
|
|
6
|
+
import type { GroupRemote } from "./group-remote.js";
|
|
7
|
+
import type { Onboarding } from "./onboarding.js";
|
|
8
|
+
import { type PersonalText } from "./personal-text.js";
|
|
9
|
+
import type { TurnStarter } from "./turn-start.js";
|
|
10
|
+
/**
|
|
11
|
+
* A group chat (the Python `Agent._route_group`). The bot acts on a message only when it is @mentioned, and everything
|
|
12
|
+
* runs as the SENDER: their own key, their own session for this conversation. No other member's credential is read.
|
|
13
|
+
*/
|
|
14
|
+
export declare class GroupRouter {
|
|
15
|
+
private readonly ctx;
|
|
16
|
+
private readonly text;
|
|
17
|
+
private readonly sessions;
|
|
18
|
+
private readonly onboarding;
|
|
19
|
+
private readonly remote;
|
|
20
|
+
private readonly starter;
|
|
21
|
+
constructor(ctx: RouterContext, text: PersonalText, sessions: SessionCommands, onboarding: Onboarding, remote: GroupRemote, starter: TurnStarter);
|
|
22
|
+
route(event: InboundMessage | InboundAction, chat: Chat): Promise<void>;
|
|
23
|
+
/** A button in a group: only those of the presser's own cards that may be pressed there answer. */
|
|
24
|
+
private click;
|
|
25
|
+
private words;
|
|
26
|
+
private message;
|
|
27
|
+
/** Help, and the commands a group does not take (they are a 1:1 chat's). True when the message was answered. */
|
|
28
|
+
private groupOwn;
|
|
29
|
+
/** A command of a 1:1 chat (`/agent attach|detach` binds the group: it stays the group's). */
|
|
30
|
+
private oneToOneOnly;
|
|
31
|
+
private withKey;
|
|
32
|
+
/** Which account, in a group: never the sender's email. */
|
|
33
|
+
private whoami;
|
|
34
|
+
/**
|
|
35
|
+
* "停 825", from a person the assistant understands: their reviews of those pull requests are stopped in Claw at once
|
|
36
|
+
* (not said to the assistant, where it could wait while the merge happens). Placed by the assembly among the group's
|
|
37
|
+
* interceptors (after feedback, before review requests).
|
|
38
|
+
*/
|
|
39
|
+
reviewStopInterceptor(): MessageInterceptor;
|
|
40
|
+
private stopReviews;
|
|
41
|
+
private stopReview;
|
|
42
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { IdentityLookup, KeyOwner } from "../plugins/identity-lookup.js";
|
|
2
|
+
/**
|
|
3
|
+
* What the router asks of the platform that issued a key (the Python `safe.whoami`, `safe.safe_user`, `safe.user_id_of`):
|
|
4
|
+
* one owner lookup, read three ways. A lookup that fails says nothing. Values are stripped as Python strips them (`pyStrip`:
|
|
5
|
+
* a byte-order mark, which JavaScript's trim() takes for whitespace, stays).
|
|
6
|
+
*/
|
|
7
|
+
export declare class KeyOwners {
|
|
8
|
+
private readonly identity;
|
|
9
|
+
constructor(identity: IdentityLookup);
|
|
10
|
+
/** The owner when the platform named them ("" names are no owner, as `safe_user` reads it). */
|
|
11
|
+
owner(key: string): Promise<KeyOwner | undefined>;
|
|
12
|
+
/** [name, email] of the key's owner (`safe.whoami`). */
|
|
13
|
+
whoami(key: string): Promise<readonly [string, string] | undefined>;
|
|
14
|
+
/** The platform's id of the key's owner (`safe.user_id_of`). */
|
|
15
|
+
userIdOf(key: string): Promise<string | undefined>;
|
|
16
|
+
/** " to SaFE user NAME (EMAIL)" for the key, or undefined when the platform cannot say (`Agent._who_line`). */
|
|
17
|
+
whoLine(key: string | undefined, withEmail?: boolean): Promise<string | undefined>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/** The router's public API: what the channel renders, what features implement, what the assembly builds. */
|
|
2
|
+
export * from "./chat.js";
|
|
3
|
+
export * from "./credentials.js";
|
|
4
|
+
export * from "./deps.js";
|
|
5
|
+
export * from "./features.js";
|
|
6
|
+
export * from "./identity.js";
|
|
7
|
+
export * from "./turn-registry.js";
|
|
8
|
+
export type { ReviewRunFields, TurnHooks, TurnOutcome, TurnRunner } from "./turn-runner.js";
|
|
9
|
+
export * from "./views.js";
|
|
10
|
+
export * from "../capabilities/help.js";
|
|
11
|
+
export * from "../capabilities/natural.js";
|
|
12
|
+
export * from "../capabilities/registry.js";
|
|
13
|
+
export * from "../capabilities/visibility.js";
|
|
14
|
+
export * from "../commands/agent-args.js";
|
|
15
|
+
export * from "../commands/names.js";
|
|
16
|
+
export * from "../commands/parse.js";
|
|
17
|
+
export * from "../commands/repo.js";
|
|
18
|
+
export * from "../locales/commands.js";
|
|
19
|
+
export * from "../locales/transparency.js";
|
|
20
|
+
export * from "./admission.js";
|
|
21
|
+
export * from "./command-table.js";
|
|
22
|
+
export * from "./context.js";
|
|
23
|
+
export * from "./onboarding.js";
|
|
24
|
+
export * from "./router.js";
|
|
25
|
+
export * from "./turn-start.js";
|
|
26
|
+
export * from "./time.js";
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { PendingRequest } from "../ports/store/onboarding.js";
|
|
2
|
+
import type { InboundAction } from "../ports/surface.js";
|
|
3
|
+
import type { Chat } from "./chat.js";
|
|
4
|
+
import type { RouterContext } from "./context.js";
|
|
5
|
+
/** Runs a group request that waited for its asker to connect (`GroupRouter.resumeRequest`). */
|
|
6
|
+
export type ResumeRequest = (chat: Chat, pending: PendingRequest, announce: boolean) => Promise<boolean>;
|
|
7
|
+
/**
|
|
8
|
+
* Connecting and disconnecting a chat (the Python `Agent._cmd_link`, `_cmd_unlink`, `_confirm_binding`). The `/link`
|
|
9
|
+
* code is the proof that the same human holds the console session that minted it and this channel account; every
|
|
10
|
+
* attempt goes through the store, which counts it against the limits and records it.
|
|
11
|
+
*/
|
|
12
|
+
export declare class LinkCommands {
|
|
13
|
+
private readonly ctx;
|
|
14
|
+
private readonly resume;
|
|
15
|
+
constructor(ctx: RouterContext, resume: ResumeRequest);
|
|
16
|
+
link(chat: Chat, code: string | null, messageId: string): Promise<void>;
|
|
17
|
+
private linked;
|
|
18
|
+
unlink(chat: Chat): Promise<void>;
|
|
19
|
+
/** A chat that runs on the exchange stays connected through the person's binding, which only they can remove. */
|
|
20
|
+
private stillBound;
|
|
21
|
+
/**
|
|
22
|
+
* The person pressed the button that says they confirmed: the binding is looked for now. The worker cannot make it,
|
|
23
|
+
* only the person can; not there yet, the card comes back with the link that is still open (or a new one).
|
|
24
|
+
*/
|
|
25
|
+
confirmBinding(action: InboundAction, chat: Chat): Promise<void>;
|
|
26
|
+
}
|