@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,33 @@
|
|
|
1
|
+
import { type Command } from "./names.js";
|
|
2
|
+
/** The command name if `text` is exactly a known command, else null. */
|
|
3
|
+
export declare function parseCommand(text: string): Command | null;
|
|
4
|
+
/** The argument text of `/name ARGS` ("" when there is none), or null when `text` is not that command. */
|
|
5
|
+
export declare function commandArgs(text: string, name: string): string | null;
|
|
6
|
+
/**
|
|
7
|
+
* What Teams' commands menu inserts. Choosing an entry puts the entry's TITLE in the compose box with no slash (`help`,
|
|
8
|
+
* `agent detach`), and a person who types a menu word without a slash means the same: a message that is exactly one of these words
|
|
9
|
+
* is the command, in every state of the chat. `sessions` and `detach` are the remote agent's (`/agent sessions`, `/agent detach`),
|
|
10
|
+
* not Claw's own `/sessions`, which a person still types with its slash. Nothing but an exact match counts: `help me` is a sentence.
|
|
11
|
+
*/
|
|
12
|
+
export declare const MENU_COMMANDS: Readonly<Record<string, string>>;
|
|
13
|
+
/** The entries of the group chat's own menu. */
|
|
14
|
+
export declare const GROUP_MENU_COMMANDS: readonly ["help", "new", "stop", "whoami", "feedback"];
|
|
15
|
+
/**
|
|
16
|
+
* `text` as the command it is when it is exactly a word of the commands menu (case and spacing do not matter), `link CODE` with a
|
|
17
|
+
* code of the console's shape as `/link CODE`, and `text` itself otherwise. `group`: a group chat reads only its own menu's words.
|
|
18
|
+
*/
|
|
19
|
+
export declare function menuCommand(text: string, group?: boolean): string;
|
|
20
|
+
/** The code of a `/link CODE` message, else null. */
|
|
21
|
+
export declare function parseLinkCode(text: string): string | null;
|
|
22
|
+
/** Whether `text` is a /timezone message, and its argument: null for none, "" for more than one word. */
|
|
23
|
+
export declare function parseTimezone(text: string): {
|
|
24
|
+
isTimezone: boolean;
|
|
25
|
+
arg: string | null;
|
|
26
|
+
};
|
|
27
|
+
export declare const MAX_PAUSE_SECONDS: number;
|
|
28
|
+
/** '8:30' to '08:30'; null unless it is a real 24-hour time. */
|
|
29
|
+
export declare function parseClock(text: string): string | null;
|
|
30
|
+
/** '22:00-08:00' to ['22:00', '08:00']; null when malformed or empty (start equals end). */
|
|
31
|
+
export declare function parseQuietWindow(text: string): readonly [string, string] | null;
|
|
32
|
+
/** '2h', '30m', '1d' to seconds, at most 30 days; null when malformed. */
|
|
33
|
+
export declare function parseDurationSeconds(text: string): number | null;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare const REPO_HOST = "https://github.com";
|
|
2
|
+
export interface RepoPick {
|
|
3
|
+
/** "owner/name", as typed. */
|
|
4
|
+
readonly repo: string;
|
|
5
|
+
/** "" is the remote's default branch. */
|
|
6
|
+
readonly branch: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function repoUrl(pick: RepoPick): string;
|
|
9
|
+
export declare function repoLabel(pick: RepoPick): string;
|
|
10
|
+
export declare function validRepo(repo: string): boolean;
|
|
11
|
+
/**
|
|
12
|
+
* A name git accepts for a branch (`git check-ref-format`, narrowed to letters, digits and `._/-`): no leading `-` or `/`, no
|
|
13
|
+
* `..`, no empty (so no leading, trailing or double `/`), dotted or `.lock` component, no trailing `.`. Claw checks it again.
|
|
14
|
+
*/
|
|
15
|
+
export declare function validBranch(branch: string): boolean;
|
|
16
|
+
/** `owner/name` or `owner/name branch` (what follows `/repo`) to a pick; null for anything else. */
|
|
17
|
+
export declare function parseRepo(args: string): RepoPick | null;
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import type { SecretsSourceName } from "../ports/secret-source.js";
|
|
2
|
+
import type { LinkLimits } from "../ports/store/link.js";
|
|
3
|
+
/**
|
|
4
|
+
* The worker's channel-neutral settings, read once at start (the runtime's `readSettings` from the environment; the
|
|
5
|
+
* environment variable each field comes from is named beside it). A channel adds its own (the Teams package: outbound
|
|
6
|
+
* mode, bot token, Service Bus, reply style). Nothing here has a built-in address: a deployment says its own.
|
|
7
|
+
*/
|
|
8
|
+
export interface Settings {
|
|
9
|
+
/** TEAMS_DB_PATH (default /data/state.db). */
|
|
10
|
+
readonly dbPath: string;
|
|
11
|
+
/** TEAMS_ENCRYPTION_KEYS, comma separated Fernet keys: the first encrypts, all decrypt. */
|
|
12
|
+
readonly encryptionKeys: readonly string[];
|
|
13
|
+
/** CLAW_API_URL, without a trailing slash. */
|
|
14
|
+
readonly clawApiUrl: string;
|
|
15
|
+
/** SAFE_API_URL, without a trailing slash (the platform API; its LLM gateway reads review requests). */
|
|
16
|
+
readonly safeApiUrl: string;
|
|
17
|
+
/** PUBLIC_BASE_URL, without a trailing slash: where this deployment is reached. */
|
|
18
|
+
readonly publicBaseUrl: string;
|
|
19
|
+
/** PORT (default 8080): the public listener. */
|
|
20
|
+
readonly listenPort: number;
|
|
21
|
+
/** METRICS_PORT (default 9090), never PORT. */
|
|
22
|
+
readonly metricsPort: number;
|
|
23
|
+
readonly claw: ClawSettings;
|
|
24
|
+
readonly exchange: ExchangeSettings;
|
|
25
|
+
readonly models: ModelSettings;
|
|
26
|
+
readonly githubReview: GithubReviewSettings;
|
|
27
|
+
readonly assistant: AssistantSettings;
|
|
28
|
+
/** TEAMS_CLAW_EVENTS_GONE: an event for a person with no chat is answered 410 Gone instead of 200 `dropped`. */
|
|
29
|
+
readonly clawEventsGone: boolean;
|
|
30
|
+
/** TEAMS_DIRECT_CHAT and TEAMS_DIRECT_CHAT_USERS (lower-cased; empty with `on` is everybody). */
|
|
31
|
+
readonly directChat: {
|
|
32
|
+
readonly enabled: boolean;
|
|
33
|
+
readonly users: ReadonlySet<string>;
|
|
34
|
+
};
|
|
35
|
+
/** TEAMS_ON_BEHALF_USERS: Claw user ids (as written) whose own key may post into their own chat. */
|
|
36
|
+
readonly onBehalfUsers: ReadonlySet<string>;
|
|
37
|
+
/** TEAMS_OBSERVE_USERS (lower-cased): who may turn on observing a group chat. */
|
|
38
|
+
readonly observeUsers: ReadonlySet<string>;
|
|
39
|
+
/** TEAMS_LIMIT_<OPERATION>: the per-person limits of operations that act with someone's authority. */
|
|
40
|
+
readonly sensitiveLimits: ReadonlyMap<string, Limit>;
|
|
41
|
+
/** TEAMS_LINK_MAX_FAILURES_PER_USER (5) / TEAMS_LINK_MAX_FAILURES_GLOBAL (100) / TEAMS_LINK_ATTEMPT_WINDOW_SECONDS (600). */
|
|
42
|
+
readonly linkLimits: LinkLimits;
|
|
43
|
+
readonly userLimits: UserLimits;
|
|
44
|
+
/** SECRETS_SOURCE (env | keyvault). */
|
|
45
|
+
readonly secretsSource: SecretsSourceName;
|
|
46
|
+
}
|
|
47
|
+
/** How this worker talks to Claw. */
|
|
48
|
+
export interface ClawSettings {
|
|
49
|
+
/** CLAW_PLUGIN_ID; null creates plain sessions. */
|
|
50
|
+
readonly pluginId: number | null;
|
|
51
|
+
/** CLAW_RULE_TOOL_ID: the rule tool whose text rides on every message; null none. */
|
|
52
|
+
readonly ruleToolId: number | null;
|
|
53
|
+
/** CLAW_CLIENT_LABEL (default "clawy"): what Claw's audit trail calls this client (`X-Claw-Client`). */
|
|
54
|
+
readonly clientLabel: string;
|
|
55
|
+
}
|
|
56
|
+
/** Token exchange with the identity service (RFC 8693). */
|
|
57
|
+
export interface ExchangeSettings {
|
|
58
|
+
/** TEAMS_EXCHANGE_ENABLED. */
|
|
59
|
+
readonly enabled: boolean;
|
|
60
|
+
/** TEAMS_EXCHANGE_TOKEN_URL (default PUBLIC_BASE_URL/oauth/token); "" when off. */
|
|
61
|
+
readonly tokenUrl: string;
|
|
62
|
+
/** TEAMS_EXCHANGE_CLIENT_ID, required when on. */
|
|
63
|
+
readonly clientId: string;
|
|
64
|
+
/** The secret TEAMS_EXCHANGE_CLIENT_SECRET, required when on. */
|
|
65
|
+
readonly clientSecret: string;
|
|
66
|
+
/** TEAMS_EXCHANGE_ISSUER (default teams.microsoft.com). */
|
|
67
|
+
readonly issuer: string;
|
|
68
|
+
/** TEAMS_EXCHANGE_AUDIENCE (default claw-api). */
|
|
69
|
+
readonly audience: string;
|
|
70
|
+
/** TEAMS_EXCHANGE_SCOPE (default claw.api). */
|
|
71
|
+
readonly scope: string;
|
|
72
|
+
/** TEAMS_EXCHANGE_BINDING_REQUEST_URL (default PUBLIC_BASE_URL/oauth/binding-requests); "" when off. */
|
|
73
|
+
readonly bindingRequestUrl: string;
|
|
74
|
+
/** TEAMS_EXCHANGE_FOR_CHAT: ordinary chats use a bound person's exchanged token instead of their linked key. */
|
|
75
|
+
readonly forChat: boolean;
|
|
76
|
+
}
|
|
77
|
+
/** The models sessions ask for ("" sends none: Claw's default applies). */
|
|
78
|
+
export interface ModelSettings {
|
|
79
|
+
/** CLAWY_MODEL. */
|
|
80
|
+
readonly chat: string;
|
|
81
|
+
/** CLAWY_FALLBACK_MODEL: a turn refused for want of a model key is run again on it, once ("" no second run). */
|
|
82
|
+
readonly fallback: string;
|
|
83
|
+
/** CLAWY_REVIEW_MODEL: a review whose request names none ("" CLAWY_MODEL). */
|
|
84
|
+
readonly review: string;
|
|
85
|
+
}
|
|
86
|
+
/** Reviewing and merging a pull request for a colleague. */
|
|
87
|
+
export interface GithubReviewSettings {
|
|
88
|
+
/** TEAMS_GITHUB_REVIEW_ENABLED (needs the exchange). */
|
|
89
|
+
readonly enabled: boolean;
|
|
90
|
+
/** TEAMS_GITHUB_REVIEW_OWNERS: the GitHub owners whose pull requests are taken; required when on. */
|
|
91
|
+
readonly owners: readonly string[];
|
|
92
|
+
/** TEAMS_REVIEW_INTENT_MODEL (else CLAWY_MODEL) when on; "" requests are read by the rules alone. */
|
|
93
|
+
readonly intentModel: string;
|
|
94
|
+
/** TEAMS_GITHUB_CREDENTIAL_URL (default PUBLIC_BASE_URL/oauth/external-credentials) when on. */
|
|
95
|
+
readonly credentialUrl: string;
|
|
96
|
+
/** TEAMS_GITHUB_CLIENT_ID: the OAuth client of the device flow (default: the GitHub CLI's public client). */
|
|
97
|
+
readonly clientId: string;
|
|
98
|
+
}
|
|
99
|
+
/** A person's assistant in Claw. */
|
|
100
|
+
export interface AssistantSettings {
|
|
101
|
+
/** ASSISTANT_ENABLED. */
|
|
102
|
+
readonly enabled: boolean;
|
|
103
|
+
/** ASSISTANT_USERS (lower-cased; empty: everybody). */
|
|
104
|
+
readonly users: ReadonlySet<string>;
|
|
105
|
+
/** ASSISTANT_REPLY_WINDOW_SECONDS (default 1800). */
|
|
106
|
+
readonly replyWindowSeconds: number;
|
|
107
|
+
/** TEAMS_ASSISTANT_UNDERSTANDING(_USERS): whose every message the assistant understands first (empty: nobody). */
|
|
108
|
+
readonly understandingUsers: ReadonlySet<string>;
|
|
109
|
+
}
|
|
110
|
+
/** How many in a window; `count` 0: no limit. */
|
|
111
|
+
export interface Limit {
|
|
112
|
+
readonly count: number;
|
|
113
|
+
readonly windowSeconds: number;
|
|
114
|
+
}
|
|
115
|
+
/** TEAMS_USER_MESSAGE_LIMIT per TEAMS_USER_MESSAGE_WINDOW_SECONDS, TEAMS_USER_MAX_CONCURRENT_TASKS. */
|
|
116
|
+
export interface UserLimits {
|
|
117
|
+
readonly messageLimit: number;
|
|
118
|
+
readonly messageWindowSeconds: number;
|
|
119
|
+
readonly maxConcurrentTasks: number;
|
|
120
|
+
}
|
|
121
|
+
/** A setting that is missing or malformed: the worker stops at start (a typo must not quietly pick a value). */
|
|
122
|
+
export declare class ConfigError extends Error {
|
|
123
|
+
readonly name = "ConfigError";
|
|
124
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The chat itself as the window of an agent session on the person's machine (TEAMS_DIRECT_CHAT, teams_agent/direct_chat.py).
|
|
3
|
+
*
|
|
4
|
+
* For the people it is on for, a chat attached to an agent session is a plain conversation with that agent: every message says in
|
|
5
|
+
* its first line who speaks (`agentHead`, `CLAWY_HEAD`), a line of the agent's that looks like a head is escaped (`guardHeads`),
|
|
6
|
+
* entering and leaving are one line each, and the way back and forth is a suggested reply. Off (the default) changes nothing.
|
|
7
|
+
*/
|
|
8
|
+
import type { Lang } from "../locales/lang.js";
|
|
9
|
+
/** A suggested reply: (what the button says, what it sends). */
|
|
10
|
+
export type SuggestedReply = readonly [title: string, value: string];
|
|
11
|
+
export declare const CLAWY_HEAD = "\uD83D\uDCAC **Clawy**";
|
|
12
|
+
export declare const NEUTRAL_ICON = "\uD83E\uDD16";
|
|
13
|
+
/** The first line of what an agent writes: its icon, then its name and its machine in bold (`🟠 **Claude Code · dev-pod**`). */
|
|
14
|
+
export declare function agentHead(label: string, host: string): string;
|
|
15
|
+
/** The first line of the second and later messages of one answer: the agent's icon and where it is in the answer. */
|
|
16
|
+
export declare function continuedHead(label: string, n: number, total: number, lang: string): string;
|
|
17
|
+
/** The agent's words with every line that would read as a head escaped (its bold shown as asterisks). */
|
|
18
|
+
export declare function guardHeads(text: string): string;
|
|
19
|
+
/** `text` under `head`, as its own paragraph. */
|
|
20
|
+
export declare function signed(head: string, text: string): string;
|
|
21
|
+
/** The messages of one thing an agent said, each headed: the first with who said it (and `suffix`), the others with where they are. */
|
|
22
|
+
export declare function signedParts(label: string, host: string, parts: readonly string[], lang: string, suffix?: string): string[];
|
|
23
|
+
export declare const OWN_SUFFIX: Readonly<Record<Lang, string>>;
|
|
24
|
+
export declare const TYPED_SUFFIX: Readonly<Record<Lang, string>>;
|
|
25
|
+
export declare const BACK: Readonly<Record<Lang, SuggestedReply>>;
|
|
26
|
+
/** The suggested replies under what the agent said: go on with it, or back to Clawy. */
|
|
27
|
+
export declare function agentReplies(lang: string): SuggestedReply[];
|
|
28
|
+
export declare function backReply(lang: string): SuggestedReply;
|
|
29
|
+
/** The reply that attaches the chat to the agent it last talked to again (`/agent attach MACHINE/AGENT`); undefined when none. */
|
|
30
|
+
export declare function returnReply(label: string, host: string, agentId: string, lang: string): SuggestedReply | undefined;
|
|
31
|
+
export interface EnteredLine {
|
|
32
|
+
readonly label: string;
|
|
33
|
+
readonly host: string;
|
|
34
|
+
readonly cwd: string;
|
|
35
|
+
readonly mode: string;
|
|
36
|
+
readonly lang: string;
|
|
37
|
+
readonly unattended?: boolean;
|
|
38
|
+
readonly lead?: string;
|
|
39
|
+
}
|
|
40
|
+
/** The one line a chat gets when it attaches to (or switches to) a session. */
|
|
41
|
+
export declare function enteredLine(entered: EnteredLine): string;
|
|
42
|
+
/** The one line a chat gets when it leaves the session: its messages go to Clawy again. */
|
|
43
|
+
export declare function leftLine(lang: string): string;
|
|
44
|
+
/** `/agent mode card|chat` while this is on: the chat is the window, for everybody it is on for. */
|
|
45
|
+
export declare function modeUnifiedLine(lang: string): string;
|
|
46
|
+
/** Where a person's chat is attached, as far as Clawy's own words need it. */
|
|
47
|
+
export interface AttachedState {
|
|
48
|
+
readonly sessionId: string;
|
|
49
|
+
readonly agentLabel: string;
|
|
50
|
+
readonly host: string;
|
|
51
|
+
readonly agentId: string;
|
|
52
|
+
}
|
|
53
|
+
/** Reads where a person's chat is attached (the remote-agent state; W6 owns it). */
|
|
54
|
+
export interface AttachedStateReader {
|
|
55
|
+
remoteState(aadId: string): AttachedState | undefined;
|
|
56
|
+
}
|
|
57
|
+
export interface ClawyExtras {
|
|
58
|
+
readonly head: string;
|
|
59
|
+
readonly replies: readonly SuggestedReply[];
|
|
60
|
+
}
|
|
61
|
+
/** The switch: off (undefined), on for everybody (empty set) or on for the people listed (lower-case ids). */
|
|
62
|
+
export declare class DirectChat {
|
|
63
|
+
private readonly users;
|
|
64
|
+
constructor(on: boolean, users?: Iterable<string>);
|
|
65
|
+
/** Whether the chat of this person (or a group binding of theirs: the part before '|') is an agent's window when attached. */
|
|
66
|
+
on(aadId: string): boolean;
|
|
67
|
+
describe(): string;
|
|
68
|
+
/**
|
|
69
|
+
* The head and suggested replies of what Clawy says to this person: attached, `CLAWY_HEAD` and "Back to Clawy"; not attached,
|
|
70
|
+
* no head and the way back to the agent it last talked to; nothing when this is off for them.
|
|
71
|
+
*/
|
|
72
|
+
clawyExtras(state: AttachedStateReader, aadId: string, lang: string): ClawyExtras;
|
|
73
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Errors that are thrown (see `result.ts` for when to throw and when to return a failure).
|
|
3
|
+
*
|
|
4
|
+
* A message of a thrown error may end up in a log line; it never carries user text, a token or a response body.
|
|
5
|
+
* `errorName` is what is logged about an error that came from outside (an exception of a dependency): its type only,
|
|
6
|
+
* the way the Python worker logged `type(err).__name__`.
|
|
7
|
+
*/
|
|
8
|
+
/** A broken invariant of this package: a bug, never a condition a user or a peer can cause. */
|
|
9
|
+
export declare class InvariantError extends Error {
|
|
10
|
+
readonly name = "InvariantError";
|
|
11
|
+
}
|
|
12
|
+
/** The kind of an error, safe to log: its constructor's name, or the type of a non-error value that was thrown. */
|
|
13
|
+
export declare function errorName(error: unknown): string;
|
|
14
|
+
/** Exhaustiveness check for a discriminated union: `default: return unreachable(x)`. */
|
|
15
|
+
export declare function unreachable(value: never): never;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Clock } from "../ports/clock.js";
|
|
2
|
+
/** A step of a report that took longer than it may (Python's `TimeoutError` from `asyncio.timeout`). */
|
|
3
|
+
export declare class DeadlineExceeded extends Error {
|
|
4
|
+
readonly name = "TimeoutError";
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* `work`, given `ms` of `clock`: past that, the returned promise rejects with DeadlineExceeded and `work`'s signal is
|
|
8
|
+
* aborted, so what it waits on (a stream) stops. The clock's timer is cancelled once `work` settles.
|
|
9
|
+
*/
|
|
10
|
+
export declare function withDeadline<T>(clock: Clock, ms: number, work: (signal: AbortSignal) => Promise<T>): Promise<T>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { FeedbackSink, IssueRef } from "../plugins/feedback-sink.js";
|
|
2
|
+
import type { Clock } from "../ports/clock.js";
|
|
3
|
+
import type { Logger } from "../ports/logger.js";
|
|
4
|
+
import type { FeedbackRepository } from "../ports/store/feedback.js";
|
|
5
|
+
import { type IssueWording } from "./issue-text.js";
|
|
6
|
+
export type ReportDeliveryKind = "filed" | "commented" | "unconfigured" | "error";
|
|
7
|
+
export interface ReportDelivery {
|
|
8
|
+
readonly kind: ReportDeliveryKind;
|
|
9
|
+
readonly issue?: IssueRef;
|
|
10
|
+
}
|
|
11
|
+
export interface ReportDeliveryDeps {
|
|
12
|
+
readonly reports: FeedbackRepository;
|
|
13
|
+
/** Undefined: no sink is configured, reports are only recorded. */
|
|
14
|
+
readonly sink: FeedbackSink | undefined;
|
|
15
|
+
readonly clock: Clock;
|
|
16
|
+
readonly log: Logger;
|
|
17
|
+
readonly wording: IssueWording;
|
|
18
|
+
readonly publicBaseUrl: string;
|
|
19
|
+
}
|
|
20
|
+
export declare class FeedbackDelivery {
|
|
21
|
+
private readonly deps;
|
|
22
|
+
private queue;
|
|
23
|
+
constructor(deps: ReportDeliveryDeps);
|
|
24
|
+
get configured(): boolean;
|
|
25
|
+
/** Delivers report `reportId` unless it was already; never throws for a delivery that failed (it is recorded). */
|
|
26
|
+
deliver(reportId: number): Promise<ReportDelivery>;
|
|
27
|
+
/** Files the reports whose retry time has come; how many went out. */
|
|
28
|
+
replayPending(limit?: number): Promise<number>;
|
|
29
|
+
private deliverNow;
|
|
30
|
+
private send;
|
|
31
|
+
/** False when the issue is gone (404, 410): a fresh one is filed instead. */
|
|
32
|
+
private commentOn;
|
|
33
|
+
private failed;
|
|
34
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { SseEvent } from "../claw/model.js";
|
|
2
|
+
import { type HistoryRow } from "./scene.js";
|
|
3
|
+
/**
|
|
4
|
+
* A reporter's last question and the answer to it, as the chat showed them: what they chose to add to their issue.
|
|
5
|
+
* Reading an answer is the turn engine's (`answerOf`: the text a turn's events showed), and so is taking the worker's
|
|
6
|
+
* own additions off a question (`withoutRule`).
|
|
7
|
+
*/
|
|
8
|
+
export interface TurnText {
|
|
9
|
+
/** The text the person typed, without what the worker appended to it (the change summary, the reply-style rule). */
|
|
10
|
+
withoutRule(text: string): string;
|
|
11
|
+
/** The answer a turn's events showed, as the chat showed it. */
|
|
12
|
+
answerOf(turnId: string, events: readonly SseEvent[]): string;
|
|
13
|
+
}
|
|
14
|
+
export interface Exchange {
|
|
15
|
+
readonly question: string;
|
|
16
|
+
readonly answer: string;
|
|
17
|
+
}
|
|
18
|
+
/** The exchange of the turn `turnId` (else the last turn); undefined when there is neither a question nor an answer. */
|
|
19
|
+
export declare function lastExchange(rows: readonly HistoryRow[], turnId: string, text: TurnText): Exchange | undefined;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { Logger } from "../ports/logger.js";
|
|
2
|
+
import type { ClickHandler, MessageInterceptor, MessageRoute } from "../ports/routing.js";
|
|
3
|
+
import type { FeedbackRepository } from "../ports/store/feedback.js";
|
|
4
|
+
import { type OutMessage } from "../ports/surface.js";
|
|
5
|
+
import type { FeedbackReporting } from "./reporting.js";
|
|
6
|
+
import type { FeedbackService, OfferOutcome } from "./service.js";
|
|
7
|
+
/**
|
|
8
|
+
* `/feedback [TEXT]` and the question a bare `/feedback` asks, the Report a problem button, and Yes/No under the offer
|
|
9
|
+
* to add the last question and answer. The thumbs are `thumbs.ts`.
|
|
10
|
+
*/
|
|
11
|
+
export interface FeedbackFlowDeps {
|
|
12
|
+
readonly reports: FeedbackRepository;
|
|
13
|
+
readonly reporting: FeedbackReporting;
|
|
14
|
+
readonly service: FeedbackService;
|
|
15
|
+
readonly log: Logger;
|
|
16
|
+
}
|
|
17
|
+
export declare class FeedbackFlow {
|
|
18
|
+
private readonly deps;
|
|
19
|
+
constructor(deps: FeedbackFlowDeps);
|
|
20
|
+
/** The interceptor of 1:1 and group chats: before the account check, so an unlinked person can report too. */
|
|
21
|
+
readonly interceptor: MessageInterceptor;
|
|
22
|
+
/** Report a problem (both chats) and the offer's Yes/No (1:1, with the person's credential). */
|
|
23
|
+
readonly clicks: ClickHandler;
|
|
24
|
+
/** True when the message was feedback: `/feedback [TEXT]`, or the answer to "What went wrong?". */
|
|
25
|
+
entry(route: MessageRoute): Promise<boolean>;
|
|
26
|
+
/**
|
|
27
|
+
* Report a problem: the same question as a bare /feedback. The button is looked up in the store, so a group member
|
|
28
|
+
* other than the one whose message went wrong cannot use it. Every outcome replaces the clicked card.
|
|
29
|
+
*/
|
|
30
|
+
private reportClick;
|
|
31
|
+
/** Yes or No under the offer: read from the store (its owner, issue and turn), the conversation with the clicker's key. */
|
|
32
|
+
private offerClick;
|
|
33
|
+
}
|
|
34
|
+
export declare function offerOutcomeText(outcome: Exclude<OfferOutcome, "retry">, issueNumber: number): string;
|
|
35
|
+
/** The Report a problem card, as a message. */
|
|
36
|
+
export declare function reportMessage(promptId: string, group: boolean): OutMessage;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { DailyBrief } from "../brief/brief.js";
|
|
2
|
+
import type { Observer } from "../observe/observer.js";
|
|
3
|
+
import type { RouteHandlers } from "../ports/routing.js";
|
|
4
|
+
import type { FeedbackFlow } from "./flow.js";
|
|
5
|
+
import type { FeedbackThumbs } from "./thumbs.js";
|
|
6
|
+
/**
|
|
7
|
+
* What feedback, observation and the daily brief give the router, in the Python worker's order: in a 1:1 chat the
|
|
8
|
+
* feedback answer is read before the account check; in a group `/observe` is read first, then the feedback answer; the
|
|
9
|
+
* buttons of each card by their kind; the channel's own thumbs as a vote (`FeedbackThumbs.onVote`).
|
|
10
|
+
*/
|
|
11
|
+
export declare function w8RouteHandlers(parts: {
|
|
12
|
+
readonly flow: FeedbackFlow;
|
|
13
|
+
readonly thumbs: FeedbackThumbs;
|
|
14
|
+
readonly observer: Observer;
|
|
15
|
+
readonly brief: DailyBrief;
|
|
16
|
+
}): RouteHandlers;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ClawSessionsPort } from "../ports/claw/sessions.js";
|
|
2
|
+
import type { Clock } from "../ports/clock.js";
|
|
3
|
+
import type { Logger } from "../ports/logger.js";
|
|
4
|
+
import type { HistoryRow } from "./scene.js";
|
|
5
|
+
/**
|
|
6
|
+
* The last events of a session, read with the person's own key, for a report: the scene's last turns, and the last
|
|
7
|
+
* exchange a reporter chose to add. Never the whole history: an assistant session runs for weeks (one reached 33,196
|
|
8
|
+
* events, 28.6 MB), so the replay asks for the tail alone and refuses a larger reply unread (an older Claw ignores
|
|
9
|
+
* `tail`); when the replay cannot be used, the stream's history is read event by event and only its tail is kept.
|
|
10
|
+
*/
|
|
11
|
+
export declare const HISTORY_TAIL = 200;
|
|
12
|
+
export declare const HISTORY_MAX_BYTES: number;
|
|
13
|
+
/** Why a session could not be read, as a report's scene says it: never a body or a message. */
|
|
14
|
+
export declare function whyNotRead(err: unknown): string;
|
|
15
|
+
export interface HistoryReader {
|
|
16
|
+
readonly sessions: Pick<ClawSessionsPort, "events" | "stream">;
|
|
17
|
+
readonly clock: Clock;
|
|
18
|
+
readonly log: Logger;
|
|
19
|
+
}
|
|
20
|
+
export declare function readHistory(reader: HistoryReader, key: string, sessionId: string): Promise<HistoryRow[]>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The shapes a value must have to be echoed into a report. Each pattern ends like Python's `re.match(...$)`: a single
|
|
3
|
+
* trailing newline is allowed, as the Python worker allowed it.
|
|
4
|
+
*/
|
|
5
|
+
/** What may be echoed from an event or a log field: an id, a status, a tool name. */
|
|
6
|
+
export declare const TOKEN: RegExp;
|
|
7
|
+
/** An image tag. */
|
|
8
|
+
export declare const TAG: RegExp;
|
|
9
|
+
/** `owner/name` of the repository issues go to. */
|
|
10
|
+
export declare const REPO: RegExp;
|
|
11
|
+
/** A plain email address (nothing else may be written into the markdown). */
|
|
12
|
+
export declare const EMAIL: RegExp;
|
|
13
|
+
/** An image tag as a report shows it: the tag, or "unknown" when it is not one (Python's `_env_tag` after its strip). */
|
|
14
|
+
export declare function tagOf(value: string): string;
|
|
15
|
+
/** A value that may be echoed: a short identifier-shaped string, or an integer; undefined for anything else. */
|
|
16
|
+
export declare function tokenOf(value: unknown): string | undefined;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export * from "./identifiers.js";
|
|
2
|
+
export * from "./issue-text.js";
|
|
3
|
+
export * from "./markdown.js";
|
|
4
|
+
export * from "./scene.js";
|
|
5
|
+
export { FEEDBACK_TEXT, feedbackText } from "../locales/feedback.js";
|
|
6
|
+
export * from "./deadline.js";
|
|
7
|
+
export * from "./delivery.js";
|
|
8
|
+
export * from "./exchange.js";
|
|
9
|
+
export * from "./flow.js";
|
|
10
|
+
export * from "./handlers.js";
|
|
11
|
+
export * from "./history.js";
|
|
12
|
+
export * from "./log-text.js";
|
|
13
|
+
export * from "./reporting.js";
|
|
14
|
+
export * from "./service.js";
|
|
15
|
+
export * from "./thumbs.js";
|
|
16
|
+
export * from "./views.js";
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The words of an issue and its comments: the title, who reported it, the body, the comment of a second report in the
|
|
3
|
+
* same session, and the comment with the conversation the reporter chose to add. Everything a person wrote is masked
|
|
4
|
+
* (`Mask`), bounded, and kept from forming markdown that pings, links or forges the retry marker.
|
|
5
|
+
*/
|
|
6
|
+
/** Credential shapes in a text replaced by a placeholder (the runtime's redaction). */
|
|
7
|
+
export type Mask = (text: string) => string;
|
|
8
|
+
export declare const FEEDBACK_LABEL = "clawy-feedback";
|
|
9
|
+
export declare const LABEL_COLOR = "d93f0b";
|
|
10
|
+
export declare const LABEL_DESCRIPTION = "Reported by a user from Teams through Clawy";
|
|
11
|
+
export declare const MAX_TEXT_CHARS = 4000;
|
|
12
|
+
/** How the deployment names itself and where its users talk to it. */
|
|
13
|
+
export interface IssueWording {
|
|
14
|
+
/** The bot's display name ("Clawy"). */
|
|
15
|
+
readonly botName: string;
|
|
16
|
+
/** The chat channel ("Teams"). */
|
|
17
|
+
readonly channelName: string;
|
|
18
|
+
}
|
|
19
|
+
/** A stored report, as far as its issue text needs it. */
|
|
20
|
+
export interface ReportText {
|
|
21
|
+
readonly id: number;
|
|
22
|
+
/** Seconds since the epoch. */
|
|
23
|
+
readonly createdAt: number;
|
|
24
|
+
readonly text: string;
|
|
25
|
+
/** The scene, as markdown (`sceneMarkdown`). */
|
|
26
|
+
readonly scene: string;
|
|
27
|
+
readonly reporterName: string;
|
|
28
|
+
readonly reporterEmail: string;
|
|
29
|
+
readonly sessionId: string;
|
|
30
|
+
}
|
|
31
|
+
/** One line of printable text, at most `limit` characters (an ellipsis marks a cut). */
|
|
32
|
+
export declare function plainLine(value: string, limit: number): string;
|
|
33
|
+
export declare function reporterName(value: string): string;
|
|
34
|
+
/** The email when it is a plain address, else "": it is written into markdown, so nothing else may pass. */
|
|
35
|
+
export declare function reporterEmail(value: string): string;
|
|
36
|
+
/** The first line of every issue and comment: who reported it, escaped so it cannot format, link, ping or forge. */
|
|
37
|
+
export declare function reporterLine(name: string, email: string): string;
|
|
38
|
+
/** `[<bot> feedback] <what went wrong> — <reporter>`, one line, at most 120 characters; the text gives way first. */
|
|
39
|
+
export declare function issueTitle(wording: IssueWording, text: string, name: string): string;
|
|
40
|
+
/** The reporter's own words with credential shapes masked, bounded. */
|
|
41
|
+
export declare function cleanText(mask: Mask, text: string): string;
|
|
42
|
+
/** Hidden in the issue or comment, so a retry can tell that an earlier attempt got through. */
|
|
43
|
+
export declare function retryMarker(report: Pick<ReportText, "id" | "createdAt">): string;
|
|
44
|
+
/** The web console's page of a session. */
|
|
45
|
+
export declare function sessionLink(publicBaseUrl: string, sessionId: string): string;
|
|
46
|
+
export declare function issueBody(wording: IssueWording, publicBaseUrl: string, report: ReportText): string;
|
|
47
|
+
/** The comment a second report in the same session within the dedupe window becomes. */
|
|
48
|
+
export declare function commentBody(report: ReportText): string;
|
|
49
|
+
/** The reporter's last question and answer, added at their request: masked, bounded, fenced. */
|
|
50
|
+
export declare function conversationComment(mask: Mask, question: string, answer: string): string;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { LogFields, LogLevel } from "../ports/logger.js";
|
|
2
|
+
import type { Mask } from "./issue-text.js";
|
|
3
|
+
export declare function safeLogText(mask: Mask, message: string, fields?: LogFields): string;
|
|
4
|
+
/** One kept line: when, how severe, which part of the worker, and its safe text. */
|
|
5
|
+
export interface KeptLogLine {
|
|
6
|
+
/** Seconds since the epoch. */
|
|
7
|
+
readonly at: number;
|
|
8
|
+
readonly level: LogLevel;
|
|
9
|
+
readonly logger: string;
|
|
10
|
+
readonly text: string;
|
|
11
|
+
}
|
|
12
|
+
/** `<UTC time> <LEVEL> <logger> <text>`, as the scene lists it. */
|
|
13
|
+
export declare function renderLogLine(line: KeptLogLine): string;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** An inline code span: one line, no backtick, no opening of an HTML comment, at most 120 characters. */
|
|
2
|
+
export declare function code(value: string | number): string;
|
|
3
|
+
/** A fenced block whose fence is longer than any run of backticks inside it. */
|
|
4
|
+
export declare function fence(text: string, info?: string): string;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { IdentityLookup } from "../plugins/identity-lookup.js";
|
|
2
|
+
import type { Clock } from "../ports/clock.js";
|
|
3
|
+
import type { Logger } from "../ports/logger.js";
|
|
4
|
+
import type { RouteBase } from "../ports/routing.js";
|
|
5
|
+
import type { SessionRepository } from "../ports/store/sessions.js";
|
|
6
|
+
import { type OutMessage, type UserRef } from "../ports/surface.js";
|
|
7
|
+
import type { FeedbackService, ReportResult } from "./service.js";
|
|
8
|
+
export interface ReportingDeps {
|
|
9
|
+
readonly service: FeedbackService;
|
|
10
|
+
readonly sessions: Pick<SessionRepository, "getSession">;
|
|
11
|
+
/** The person's Claw credential if they have one; never asks them for it (`undefined`: not linked). */
|
|
12
|
+
readonly credential: (sender: UserRef) => Promise<string | undefined>;
|
|
13
|
+
readonly identity: IdentityLookup;
|
|
14
|
+
readonly clock: Clock;
|
|
15
|
+
readonly log: Logger;
|
|
16
|
+
}
|
|
17
|
+
export declare function replyText(result: ReportResult): string;
|
|
18
|
+
export declare class FeedbackReporting {
|
|
19
|
+
private readonly deps;
|
|
20
|
+
constructor(deps: ReportingDeps);
|
|
21
|
+
file(route: RouteBase, text: string): Promise<void>;
|
|
22
|
+
/** What the channel gave, and for what is missing, what the key's platform says; a slow or failed lookup is skipped. */
|
|
23
|
+
private reporterOf;
|
|
24
|
+
}
|
|
25
|
+
export declare function offerMessage(offerId: string, issueNumber: number): OutMessage;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The scene of a report: who and where, the chat's last turns, the worker's last log lines for that chat. Recorded
|
|
3
|
+
* without asking, so it carries ids, states, counts and tool names only, never what anybody wrote: every value taken
|
|
4
|
+
* from an event is an enumerated field or an identifier-shaped token (`tokenOf`).
|
|
5
|
+
*/
|
|
6
|
+
export declare const LAST_TURNS = 2;
|
|
7
|
+
export declare const LOG_LINES = 30;
|
|
8
|
+
/** One event of a session's history, as Claw's replay gives it (the stream's history has no `created_at`). */
|
|
9
|
+
export interface HistoryRow {
|
|
10
|
+
readonly event_id: string;
|
|
11
|
+
readonly event_type: string;
|
|
12
|
+
readonly data: unknown;
|
|
13
|
+
readonly created_at: unknown;
|
|
14
|
+
}
|
|
15
|
+
/** An event of a turn: its id, type, data object and time (seconds since the epoch; undefined when not known). */
|
|
16
|
+
export interface TurnEvent {
|
|
17
|
+
readonly id: string;
|
|
18
|
+
readonly type: string;
|
|
19
|
+
readonly data: Readonly<Record<string, unknown>>;
|
|
20
|
+
readonly at: number | undefined;
|
|
21
|
+
}
|
|
22
|
+
export type TurnStatus = "finished" | "failed" | "stopped" | "stuck" | "running" | "unfinished";
|
|
23
|
+
export interface TurnSummary {
|
|
24
|
+
readonly turnId: string;
|
|
25
|
+
readonly status: TurnStatus;
|
|
26
|
+
readonly seconds: number | undefined;
|
|
27
|
+
readonly tools: readonly string[];
|
|
28
|
+
readonly toolErrors: number;
|
|
29
|
+
readonly errors: readonly string[];
|
|
30
|
+
}
|
|
31
|
+
export interface Scene {
|
|
32
|
+
readonly name: string;
|
|
33
|
+
readonly platformUserId: string;
|
|
34
|
+
/** "1:1" or "group". */
|
|
35
|
+
readonly chat: string;
|
|
36
|
+
/** Seconds since the epoch. */
|
|
37
|
+
readonly at: number;
|
|
38
|
+
readonly sessionId: string;
|
|
39
|
+
readonly pluginId: string;
|
|
40
|
+
readonly workerVersion: string;
|
|
41
|
+
readonly workerImage: string;
|
|
42
|
+
readonly apiImage: string;
|
|
43
|
+
readonly brainImage: string;
|
|
44
|
+
/** Whether the session runs a turn now; undefined when that could not be read. */
|
|
45
|
+
readonly busy: boolean | undefined;
|
|
46
|
+
readonly turns: readonly TurnSummary[];
|
|
47
|
+
/** Why there are no turns, when there are none. */
|
|
48
|
+
readonly turnsNote: string;
|
|
49
|
+
readonly logs: readonly string[];
|
|
50
|
+
}
|
|
51
|
+
export declare function objectOf(value: unknown): Readonly<Record<string, unknown>>;
|
|
52
|
+
/** A timestamp as Claw writes it (epoch seconds or milliseconds, or ISO 8601 as Python reads it), in seconds. */
|
|
53
|
+
export declare function secondsOf(value: unknown): number | undefined;
|
|
54
|
+
/** The session's events grouped by turn: a turn starts at a UserMessage and runs to the next one. */
|
|
55
|
+
export declare function splitTurns(rows: readonly HistoryRow[]): TurnEvent[][];
|
|
56
|
+
/** The id of a turn: the message id of its UserMessage, else that event's id. */
|
|
57
|
+
export declare function turnIdOf(events: readonly TurnEvent[]): string;
|
|
58
|
+
/** Status, duration, tool names and errors of one turn, from event types and a few enumerated fields only. */
|
|
59
|
+
export declare function summarizeTurn(events: readonly TurnEvent[], now: number): TurnSummary;
|
|
60
|
+
/** The last `LAST_TURNS` turns of a history, summarized. */
|
|
61
|
+
export declare function lastTurns(rows: readonly HistoryRow[], now: number): TurnSummary[];
|
|
62
|
+
/** The scene as the issue shows it. */
|
|
63
|
+
export declare function sceneMarkdown(scene: Scene): string;
|
|
64
|
+
/** The newest turn of the scene: what "my last question and answer" means. */
|
|
65
|
+
export declare function lastTurnId(scene: Scene): string;
|