@primusclaw/personal-agent 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/LICENSE +37 -0
- package/dist/index.js +31873 -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,29 @@
|
|
|
1
|
+
/** The event types Claw gives a subscription that asks for none in particular. */
|
|
2
|
+
export declare const SUBSCRIPTION_BASE_TYPES: readonly string[];
|
|
3
|
+
/** `approval.requested`: a run, or a work item's worker, waits for the person's decision or answer. */
|
|
4
|
+
export declare const APPROVAL_EVENT: "approval.requested";
|
|
5
|
+
/** The assistant asks the chat to carry out one of the actions a message declared. */
|
|
6
|
+
export declare const ASSISTANT_ACTION: "assistant.action";
|
|
7
|
+
/** What the assistant says, and a work item that needs the person: the events this worker shows as the assistant's words. */
|
|
8
|
+
export declare const ASSISTANT_SAID_TYPES: readonly string[];
|
|
9
|
+
/** The sources Claw gives a subscription that asks for none in particular (a trigger's runs, a long one's). */
|
|
10
|
+
export declare const RUN_SOURCES: readonly string[];
|
|
11
|
+
/** The source of an `approval.requested` a work item holds for its person. */
|
|
12
|
+
export declare const ITEM_SOURCE: "assistant_item";
|
|
13
|
+
export declare const APPROVAL_SOURCES: readonly string[];
|
|
14
|
+
export declare const ASSISTANT_SUBSCRIPTION_TYPES: readonly string[];
|
|
15
|
+
/** `types_version` of a subscription with the assistant's types; 0 is the base types. */
|
|
16
|
+
export declare const ASSISTANT_TYPES_VERSION = 1;
|
|
17
|
+
/** `types_version` of a subscription that also has the approvals of work items. */
|
|
18
|
+
export declare const APPROVALS_TYPES_VERSION = 2;
|
|
19
|
+
/** One rung of what a subscription asks for: its types, its sources (undefined: whatever it has) and the version recorded. */
|
|
20
|
+
export interface WantedTypes {
|
|
21
|
+
readonly types: readonly string[];
|
|
22
|
+
readonly sources: readonly string[] | undefined;
|
|
23
|
+
readonly version: number;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* What a subscription asks for with the assistant on, best first; the next is taken when Claw refuses one (400): a Claw from before
|
|
27
|
+
* the work items' approvals, or before `assistant.action` (asked only for people whose every message the assistant understands).
|
|
28
|
+
*/
|
|
29
|
+
export declare function wantedTypes(understood: boolean): WantedTypes[];
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** What the subscription keeper needs from the store (W1's repositories) and from Claw (W2's notification subscriptions). */
|
|
2
|
+
import type { ClawNotificationsPort } from "../ports/claw/index.js";
|
|
3
|
+
import type { ConversationRefRepository, LinkRepository, NotifySubscriptionRepository } from "../ports/store/index.js";
|
|
4
|
+
export interface SubscriptionStore {
|
|
5
|
+
readonly notifySubs: Omit<NotifySubscriptionRepository, "notifySubByRoute">;
|
|
6
|
+
readonly links: Pick<LinkRepository, "getKey" | "setClawUserId" | "needsClawUserId" | "linkedUsers">;
|
|
7
|
+
readonly references: Pick<ConversationRefRepository, "getReference">;
|
|
8
|
+
}
|
|
9
|
+
export type ClawSubscriptions = ClawNotificationsPort;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type { Logger } from "../ports/logger.js";
|
|
2
|
+
import type { Random } from "../ports/random.js";
|
|
3
|
+
import type { ClawSubscriptions, SubscriptionStore } from "./ports.js";
|
|
4
|
+
/** Notifications off on Claw, or Claw unreachable: a subscription is tried again at most daily. */
|
|
5
|
+
export declare const RETRY_SECONDS: number;
|
|
6
|
+
/** How often a subscription is looked at in Claw (and mended) with the assistant on. */
|
|
7
|
+
export declare const UPGRADE_RETRY_SECONDS = 600;
|
|
8
|
+
/** Why a person cannot be reached by the events of their work items ("" is reachable). */
|
|
9
|
+
export type Unreachable = "" | "unlinked" | "no_subscription" | "no_user_id" | "no_chat";
|
|
10
|
+
export interface SubscriptionsOptions {
|
|
11
|
+
readonly store: SubscriptionStore;
|
|
12
|
+
readonly claw: ClawSubscriptions;
|
|
13
|
+
readonly random: Random;
|
|
14
|
+
readonly logger: Logger;
|
|
15
|
+
/** NOTIFY_WEBHOOK_URL, e.g. http://<worker service>/claw-events. */
|
|
16
|
+
readonly baseUrl: string;
|
|
17
|
+
/** ASSISTANT_ENABLED: subscriptions also get the assistant's event types. */
|
|
18
|
+
readonly assistant?: boolean;
|
|
19
|
+
/** TEAMS_ASSISTANT_UNDERSTANDING_USERS: whose subscription also asks for `assistant.action`. */
|
|
20
|
+
readonly understood?: (aadId: string) => boolean;
|
|
21
|
+
/** ASSISTANT_USERS: whose subscription gets the assistant's types (an empty list: everybody's). */
|
|
22
|
+
readonly assistantFor?: (aadId: string) => boolean;
|
|
23
|
+
/** (key) -> the Claw user id the key is of; undefined when that could not be read. Absent: ids are not filled in. */
|
|
24
|
+
readonly userIdOf?: (key: string) => Promise<string | undefined>;
|
|
25
|
+
}
|
|
26
|
+
export declare class Subscriptions {
|
|
27
|
+
private readonly store;
|
|
28
|
+
private readonly claw;
|
|
29
|
+
private readonly random;
|
|
30
|
+
private readonly log;
|
|
31
|
+
private readonly base;
|
|
32
|
+
private readonly assistant;
|
|
33
|
+
private readonly understood;
|
|
34
|
+
private readonly assistantFor;
|
|
35
|
+
private readonly userIdOf;
|
|
36
|
+
constructor(options: SubscriptionsOptions);
|
|
37
|
+
/** This person's subscription gets the assistant's events (so the assistant can reach them). */
|
|
38
|
+
hasAssistantTypes(aadId: string): boolean;
|
|
39
|
+
private assistantOnFor;
|
|
40
|
+
/**
|
|
41
|
+
* `ensure` for every linked person the assistant is on for, after filling in every missing Claw user id. Returns how many people
|
|
42
|
+
* were looked at. Never throws.
|
|
43
|
+
*/
|
|
44
|
+
ensureAll(): Promise<number>;
|
|
45
|
+
/** Record the Claw user id of every linked person whose link has none. Returns how many were filled in. Never throws. */
|
|
46
|
+
fillUserIds(): Promise<number>;
|
|
47
|
+
/** `fillUserIds` for one person: true when an id was recorded now. */
|
|
48
|
+
fillUserId(aadId: string): Promise<boolean>;
|
|
49
|
+
/**
|
|
50
|
+
* Whether the events of this person's work items reach their chat: "" when they do, else why not. The subscription is made or
|
|
51
|
+
* mended first and the user id filled in, so what is said is the state after trying. Never throws.
|
|
52
|
+
*/
|
|
53
|
+
reachable(aadId: string): Promise<Unreachable>;
|
|
54
|
+
/** Make sure this linked person has a subscription (with the assistant's types when it is on). Never throws. */
|
|
55
|
+
ensure(aadId: string): Promise<void>;
|
|
56
|
+
private create;
|
|
57
|
+
/**
|
|
58
|
+
* With the assistant on, the recorded subscription must be there in Claw, enabled and asking for the assistant's events: looked
|
|
59
|
+
* at, and mended with one PATCH, at most every UPGRADE_RETRY_SECONDS. One Claw no longer has is forgotten (the caller makes a new
|
|
60
|
+
* one); one Claw refuses even the assistant's types (400, 404) takes the person back to sessions (`types_version` 0).
|
|
61
|
+
*/
|
|
62
|
+
private reconcile;
|
|
63
|
+
/** The best rung the subscription has already, or the best Claw takes; throws Claw's last refusal when it takes none. */
|
|
64
|
+
private mend;
|
|
65
|
+
/** Delete this person's earlier subscriptions to this worker: their secret is unknown here, so they would only be refused. */
|
|
66
|
+
private dropStale;
|
|
67
|
+
/** /unlink: delete the subscription in Claw (best effort) and forget it here. */
|
|
68
|
+
remove(aadId: string, key: string | null): Promise<void>;
|
|
69
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function neutral(text: string, limit?: number): string;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** `" ".join(text.split())` cut to `limit` code points, a cut one ending in "…" (render._clip, approval_view._clip). */
|
|
2
|
+
export declare function clip(text: string, limit: number): string;
|
|
3
|
+
/** `json.dumps(value, ensure_ascii=False)`, with `separators=(",", ":")` when `compact`. */
|
|
4
|
+
export declare function pyJson(value: unknown, options?: {
|
|
5
|
+
readonly compact?: boolean;
|
|
6
|
+
}): string;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** The characters Python calls white space and printable (`str.isspace`, `str.isprintable`). */
|
|
2
|
+
/** The code point at `at` of `text`, which must have one there (`ord(text[at])`). */
|
|
3
|
+
export declare function pointAt(text: string, at?: number): number;
|
|
4
|
+
/**
|
|
5
|
+
* The characters Python's `str.isspace()` is true for, which is also what `\s` matches in a Python `str` pattern
|
|
6
|
+
* (JavaScript's `\s` lacks `\x1c`-`\x1f` and `\x85`, and has `\ufeff`). For a pattern: `new RegExp(`[${PY_SPACE}]`, "u")`.
|
|
7
|
+
*/
|
|
8
|
+
export declare const PY_SPACE = "\\t\\n\\v\\f\\r\\x1c-\\x20\\x85\\xa0\\u1680\\u2000-\\u200a\\u2028\\u2029\\u202f\\u205f\\u3000";
|
|
9
|
+
/** `ch.isspace()` for one code point. */
|
|
10
|
+
export declare function isPySpace(ch: string): boolean;
|
|
11
|
+
/** `ch.isprintable()` for one code point. */
|
|
12
|
+
export declare function isPyPrintable(ch: string): boolean;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `str(value or "")` for a value read from JSON: a falsy value (none, false, 0, "", an empty list or object) is "", a
|
|
3
|
+
* string is itself, `true` is "True", a number is its digits (or float repr), a list or object is Python's `repr`.
|
|
4
|
+
*/
|
|
5
|
+
export declare function pyStr(value: unknown): string;
|
|
6
|
+
/**
|
|
7
|
+
* `repr(value)` for a value parsed from JSON (`None`, `True`, `'text'`, `[1, 2]`, `{'a': 1}`). An object's keys are in
|
|
8
|
+
* its order, which JavaScript keeps for every key but integer-like ones ("2", "10"): those come first, ascending.
|
|
9
|
+
*/
|
|
10
|
+
export declare function pyRepr(value: unknown): string;
|
|
11
|
+
export interface JsonDumpsOptions {
|
|
12
|
+
/** `indent=`: each nesting level on its own lines, this many spaces deeper (items then end in "," alone). */
|
|
13
|
+
readonly indent?: number;
|
|
14
|
+
/** `sort_keys=True`: keys in code-point order, as Python sorts `str`. */
|
|
15
|
+
readonly sortKeys?: boolean;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* `json.dumps(value, ensure_ascii=False, ...)` for a value parsed from JSON: non-ASCII kept (a lone surrogate too);
|
|
19
|
+
* `", "` and `": "` separators, or `","` and newlines with `indent`. A key whose value is undefined is left out.
|
|
20
|
+
* Without `sortKeys`, keys are in the object's order, which JavaScript keeps for every key except integer-like ones
|
|
21
|
+
* ("2", "10"): those come first, ascending (Python would keep them where JSON had them).
|
|
22
|
+
*/
|
|
23
|
+
export declare function pyJsonDumps(value: unknown, options?: JsonDumpsOptions): string;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/** Numbers as Python writes them: `repr(float)`, `str`/`json.dumps` of a parsed JSON number, `f"{x:.{n}f}"`. */
|
|
2
|
+
/**
|
|
3
|
+
* A number as Python writes it, for a value parsed from JSON: a safe integer as the int JSON gave, anything else as
|
|
4
|
+
* Python's float `repr` (`1e-07`, `1e+300`). `str` writes the non-finite as `nan`/`inf`, `json.dumps` as `NaN`/
|
|
5
|
+
* `Infinity`. What JSON cannot tell apart once JavaScript has parsed it is written the likelier way: a float `1.0` was
|
|
6
|
+
* already the number 1 (an int), a negative zero is the float `-0.0` (JSON's `-0` int is rare), an integer beyond 2^53
|
|
7
|
+
* is written as the float it became.
|
|
8
|
+
*/
|
|
9
|
+
export declare function pyNumber(value: number, how: "str" | "json"): string;
|
|
10
|
+
/** Python's `repr(float)`: the shortest digits, positional for exponents -4..15, else `d.ddde±XX`. */
|
|
11
|
+
export declare function floatRepr(value: number): string;
|
|
12
|
+
/**
|
|
13
|
+
* `f"{value:.{digits}f}"`: the exact binary value rounded to `digits` decimals, an exact tie to even, as Python formats
|
|
14
|
+
* it (for any magnitude and any number of digits).
|
|
15
|
+
*/
|
|
16
|
+
export declare function fixedN(value: number, digits: number): string;
|
|
17
|
+
/** `f"{value:.1f}"`. */
|
|
18
|
+
export declare function fixed1(value: number): string;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Python `re` escapes (in a `str` pattern) as JavaScript `u`-mode pattern text: the classes, anchors and character
|
|
3
|
+
* escapes Python knows, each read as Python reads it. An escape Python refuses ("bad escape") is refused here too.
|
|
4
|
+
*/
|
|
5
|
+
/** Python's `\w` (letters, numbers and `_` of any script) as a character class. */
|
|
6
|
+
export declare const PY_W: string;
|
|
7
|
+
/** The inside of `PY_W`, to put in a class of one's own (`[${PY_W_CHARS}.-]`). */
|
|
8
|
+
export declare const PY_W_CHARS: string;
|
|
9
|
+
/** Python's `\d` (a decimal digit of any script), to put in a class. */
|
|
10
|
+
export declare const PY_D: string;
|
|
11
|
+
/** Python's `\b` before a word: not preceded by a word character. */
|
|
12
|
+
export declare const PY_B_START: string;
|
|
13
|
+
/** Python's `\b` after a word: not followed by a word character. */
|
|
14
|
+
export declare const PY_B_END: string;
|
|
15
|
+
export declare const START: string;
|
|
16
|
+
export declare const END: string;
|
|
17
|
+
/** Python folds these four together under IGNORECASE; JavaScript's case folding keeps the dotless and dotted apart. */
|
|
18
|
+
export declare const I_VARIANTS = "iI\u0131\u0130";
|
|
19
|
+
export interface EscapeContext {
|
|
20
|
+
readonly inClass: boolean;
|
|
21
|
+
readonly ignoreCase: boolean;
|
|
22
|
+
}
|
|
23
|
+
export interface Escape {
|
|
24
|
+
/** The JavaScript pattern text. */
|
|
25
|
+
readonly text: string;
|
|
26
|
+
/** How many characters of the Python source it took. */
|
|
27
|
+
readonly length: number;
|
|
28
|
+
}
|
|
29
|
+
/** One character as a JavaScript literal; under IGNORECASE, outside a class, `i`, `I`, `ı`, `İ` are one another. */
|
|
30
|
+
export declare function literal(ch: string, context: EscapeContext): string;
|
|
31
|
+
/** The escape that starts at `source[i]` (a backslash), as JavaScript pattern text. */
|
|
32
|
+
export declare function translateEscape(source: string, i: number, context: EscapeContext): Escape;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export { PY_B_END, PY_B_START, PY_D, PY_W, PY_W_CHARS } from "./py-regex-escapes.js";
|
|
2
|
+
/**
|
|
3
|
+
* Python `re` patterns (on a `str`) as JavaScript regular expressions, for the rules the worker matches text with.
|
|
4
|
+
* Where the two engines read the same pattern differently, the translation makes JavaScript read it as Python does:
|
|
5
|
+
* - `\s` is Python's white space (`\x1c`-`\x1f` and `\x85` in, `\ufeff` out), `\S` the rest;
|
|
6
|
+
* - `\d` is a decimal digit of any script (`\p{Nd}`), `\D` the rest;
|
|
7
|
+
* - `\w` is a letter, a number or `_` of any script, `\W` the rest, and `\b`/`\B` are boundaries of that `\w`;
|
|
8
|
+
* - `^`, `$`, `\A`, `\Z` and `.` are Python's: `$` also matches before a final "\n" (with `m`, before any "\n" only, not
|
|
9
|
+
* "\r"), and `.` is anything but "\n" (with `s`, anything);
|
|
10
|
+
* - `(?P<name>...)` and `(?P=name)` are Python's named groups; a leading `(?ims)` is the flag; `(?#...)` is a comment;
|
|
11
|
+
* - `\-`, `\ `, `\#` (what `re.escape` writes) are the characters themselves, as are `\x..`, `\u....`, `\U........`,
|
|
12
|
+
* octal escapes and `\a`; a `{` or `}` that is no quantifier and a `]` outside a class are literal; `{,n}` is `{0,n}`;
|
|
13
|
+
* - with the `i` flag, `i`, `I`, `ı` and `İ` all match one another, as Python folds them (JavaScript does not).
|
|
14
|
+
* One difference is kept: under `i` JavaScript folds U+0345 (a combining mark) into `\w` through ι, where Python
|
|
15
|
+
* does not. Leaving it out would take a scoped `(?-i:...)`, which in V8 turns off the Unicode case folding of every
|
|
16
|
+
* class in the pattern (the Kelvin sign then no longer matches `[a-z]`): a far larger difference.
|
|
17
|
+
* The `u` flag is always on. What has no JavaScript form is refused when the pattern is built, with an InvariantError:
|
|
18
|
+
* an escape Python refuses, `\N{...}`, a negated class escape inside a class (`[\S]`), inline flags anywhere but at the
|
|
19
|
+
* start or scoped to a group (`(?s:...)`), a backreference (JavaScript matches one to a group that took no part as
|
|
20
|
+
* the empty string, where Python fails), and any
|
|
21
|
+
* other syntax JavaScript cannot read.
|
|
22
|
+
*/
|
|
23
|
+
/** `ch.isalnum()` for one character: a letter or a number of any script. */
|
|
24
|
+
export declare function pyIsAlnum(ch: string): boolean;
|
|
25
|
+
/** Letters A-Z and a-z only, at least one: what `re`'s `[A-Za-z]+` takes (`str.isalpha` would take any script). */
|
|
26
|
+
export declare function isAsciiAlpha(word: string): boolean;
|
|
27
|
+
/**
|
|
28
|
+
* `re.compile(source, flags)` used with `search`: `regex.exec(text)` finds the first match anywhere. `flags`: `i`, `m`,
|
|
29
|
+
* `s`, and JavaScript's `g`/`y` for finding every match.
|
|
30
|
+
*/
|
|
31
|
+
export declare function pyRegExp(source: string, flags?: string): RegExp;
|
|
32
|
+
/**
|
|
33
|
+
* `re.fullmatch(source, text, flags)` as a RegExp: `regex.test(text)` / `regex.exec(text)` match the whole text, the same
|
|
34
|
+
* on every call (`g`/`y` would make it stateful, so they are refused). `flags`: `i`, `m`, `s`.
|
|
35
|
+
*/
|
|
36
|
+
export declare function pyFullmatch(source: string, flags?: string): RegExp;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
export * from "./py-chars.js";
|
|
2
|
+
export * from "./py-json.js";
|
|
3
|
+
export * from "./py-number.js";
|
|
4
|
+
/** `text.split()`: the words between runs of white space, none empty. */
|
|
5
|
+
export declare function pySplit(text: string): string[];
|
|
6
|
+
/** `" ".join(text.split())`: one line, single spaces. */
|
|
7
|
+
export declare function squashSpaces(text: string): string;
|
|
8
|
+
/** `text.strip()`, or `text.strip(chars)`. */
|
|
9
|
+
export declare function pyStrip(text: string, chars?: string): string;
|
|
10
|
+
/** `text.lstrip()`, or `text.lstrip(chars)`. */
|
|
11
|
+
export declare function pyLstrip(text: string, chars?: string): string;
|
|
12
|
+
/** `text.rstrip()`, or `text.rstrip(chars)`. */
|
|
13
|
+
export declare function pyRstrip(text: string, chars?: string): string;
|
|
14
|
+
/**
|
|
15
|
+
* `text.lower()`. JavaScript's `toLowerCase()` is the same full, context-sensitive mapping (final sigma, `İ` to `i̇`),
|
|
16
|
+
* locale-independent as Python's; checked over every code point (they differ only where Node's Unicode is newer).
|
|
17
|
+
*/
|
|
18
|
+
export declare function pyLower(text: string): string;
|
|
19
|
+
/**
|
|
20
|
+
* `text.casefold()`: for comparing without case (`ß` and `ss`, `ſ` and `s` fold together; `ı` stays apart from `i`;
|
|
21
|
+
* no final-sigma context, every `σ`/`ς`/`Σ` folds to `σ`). Per code point, as Python folds.
|
|
22
|
+
*/
|
|
23
|
+
export declare function pyCasefold(text: string): string;
|
|
24
|
+
/** `text.split(None, 1)`: the first word and the rest (its leading white space removed); at most two parts. */
|
|
25
|
+
export declare function splitOnce(text: string): string[];
|
|
26
|
+
/**
|
|
27
|
+
* At least one character, each a decimal digit of any script (`\p{Nd}`: what `\d` matches in Python's `re`, and what
|
|
28
|
+
* `int()` reads). NOT Python's `str.isdigit()`, which also takes
|
|
29
|
+
* superscripts and circled digits (every caller reads ASCII or `\d` input, where the two agree).
|
|
30
|
+
*/
|
|
31
|
+
export declare function isDigits(text: string): boolean;
|
|
32
|
+
/**
|
|
33
|
+
* `int(text)` for a run of decimal digits of any script (`12` is 12, `٣` is 3), exactly, of any size; undefined for
|
|
34
|
+
* anything else.
|
|
35
|
+
*/
|
|
36
|
+
export declare function decimalBigInt(text: string): bigint | undefined;
|
|
37
|
+
/**
|
|
38
|
+
* `int(text)` as a number: exact up to 2^53, which the counts, hours and ids the rules read are far below; NaN for
|
|
39
|
+
* anything that is no run of decimal digits, and refused (RangeError) past 2^53 rather than rounded (use
|
|
40
|
+
* `decimalBigInt` for that).
|
|
41
|
+
*/
|
|
42
|
+
export declare function decimalInt(text: string): number;
|
|
43
|
+
/**
|
|
44
|
+
* `text.isupper()`: at least one uppercase character, and none that is lowercase or titlecase (the Unicode properties
|
|
45
|
+
* Python reads: `ℂ` is upper though it has no lowercase form; `ĸ` and `ª` are lowercase though they have no uppercase).
|
|
46
|
+
*/
|
|
47
|
+
export declare function isUpper(text: string): boolean;
|
|
48
|
+
/** `len(text)`: code points. */
|
|
49
|
+
export declare function cpLength(text: string): number;
|
|
50
|
+
/** `text[start:end]`, counted in code points; a negative bound counts from the end, as in Python. */
|
|
51
|
+
export declare function cpSlice(text: string, start: number, end?: number): string;
|
|
52
|
+
/** `text.rfind(sub)`: the code-point index of the last occurrence, -1 when there is none. */
|
|
53
|
+
export declare function cpRfind(text: string, sub: string): number;
|
|
54
|
+
/** `text if len(text) <= limit else text[: limit - 1].rstrip() + "…"`. */
|
|
55
|
+
export declare function clipLine(text: string, limit: number): string;
|
|
56
|
+
/** `text[:limit]`, without splitting a string that is short enough. */
|
|
57
|
+
export declare function cpHead(text: string, limit: number): string;
|
|
58
|
+
/**
|
|
59
|
+
* `text.splitlines(keepends)`: the lines, without their breaks or (`keepends`) each with its own ("\r\n" is one break);
|
|
60
|
+
* a trailing break makes no empty last line.
|
|
61
|
+
*/
|
|
62
|
+
export declare function pySplitlines(text: string, keepends?: boolean): string[];
|
|
63
|
+
/** Whether `text` holds a control character: U+0000-U+001F or U+007F (Python's `[\x00-\x1f\x7f]`). */
|
|
64
|
+
export declare function hasControl(text: string): boolean;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export declare const MAX_ANSWER_CHARS = 3000;
|
|
2
|
+
/** A long answer: at most this many messages (1:1 and group alike), then the link. */
|
|
3
|
+
export declare const MAX_ANSWER_MESSAGES = 3;
|
|
4
|
+
export declare const WHOLE_CUT_NOTE: "\n\n… (the rest did not fit in three messages)";
|
|
5
|
+
/** The web console's page of a session. */
|
|
6
|
+
export declare function deepLink(publicBaseUrl: string, sessionId: string): string;
|
|
7
|
+
/**
|
|
8
|
+
* The messages that carry a final answer: the whole answer split at paragraph boundaries, at most MAX_ANSWER_MESSAGES
|
|
9
|
+
* messages, and only what is beyond that is left to the link. In a group the link says that only the asker can open it
|
|
10
|
+
* (it opens the asker's own Claw session). `lead` is one line in front of the answer.
|
|
11
|
+
*/
|
|
12
|
+
export declare function answerParts(text: string, link: string, group?: boolean, lead?: string): string[];
|
|
13
|
+
/**
|
|
14
|
+
* `text` as at most `most` messages of at most `limit` characters, each cut at a paragraph or line break when one is near
|
|
15
|
+
* enough, and never shortened when it fits in `most` messages: a cut is taken only where what is left still fits in the
|
|
16
|
+
* messages after it. Only a longer text has its last message end in a note that the rest was cut.
|
|
17
|
+
*/
|
|
18
|
+
export declare function wholeParts(text: string, limit?: number, most?: number): string[];
|
|
19
|
+
/**
|
|
20
|
+
* The messages of the assistant's reply `text` (`wholeParts`), after the words its receipt already shows (`shown`): when
|
|
21
|
+
* they are a longer start of the reply than the first message would be, they are the first message and the rest follows.
|
|
22
|
+
*/
|
|
23
|
+
export declare function replyParts(text: string, shown?: string): string[];
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { Logger } from "../ports/logger.js";
|
|
2
|
+
import type { TurnClaw } from "./ports.js";
|
|
3
|
+
/** One try, then nothing: the answer is already in the chat. */
|
|
4
|
+
export declare const CHANGES_TIMEOUT_SECONDS = 5;
|
|
5
|
+
export interface FileChange {
|
|
6
|
+
readonly path: string;
|
|
7
|
+
/** M modified, A added, D deleted, R renamed, ? untracked or unknown. */
|
|
8
|
+
readonly status: string;
|
|
9
|
+
/** undefined: not counted (binary, or Claw could not say). */
|
|
10
|
+
readonly additions: number | undefined;
|
|
11
|
+
readonly deletions: number | undefined;
|
|
12
|
+
readonly binary: boolean;
|
|
13
|
+
}
|
|
14
|
+
export interface RepoChanges {
|
|
15
|
+
/** "/workspace/<name>". */
|
|
16
|
+
readonly path: string;
|
|
17
|
+
readonly branch: string | undefined;
|
|
18
|
+
/** Short sha. */
|
|
19
|
+
readonly head: string;
|
|
20
|
+
/** Claw listed fewer files than changed. */
|
|
21
|
+
readonly truncated: boolean;
|
|
22
|
+
readonly files: readonly FileChange[];
|
|
23
|
+
/** What Claw counted (at least the files listed). */
|
|
24
|
+
readonly totalFiles: number;
|
|
25
|
+
readonly additions: number;
|
|
26
|
+
readonly deletions: number;
|
|
27
|
+
}
|
|
28
|
+
export interface Changes {
|
|
29
|
+
readonly repos: readonly RepoChanges[];
|
|
30
|
+
readonly truncated: boolean;
|
|
31
|
+
}
|
|
32
|
+
export declare function repoName(repo: RepoChanges): string;
|
|
33
|
+
export declare const totalFiles: (changes: Changes) => number;
|
|
34
|
+
export declare const totalAdditions: (changes: Changes) => number;
|
|
35
|
+
export declare const totalDeletions: (changes: Changes) => number;
|
|
36
|
+
/**
|
|
37
|
+
* The reply as `Changes`, or undefined when it is not a changes reply or nothing changed. Items that are not what the
|
|
38
|
+
* contract says are left out one by one, so a single odd file never hides the rest.
|
|
39
|
+
*/
|
|
40
|
+
export declare function parseChanges(reply: unknown): Changes | undefined;
|
|
41
|
+
/** The session's changes, or undefined for anything that means there is nothing to show. Never rejects. */
|
|
42
|
+
export declare function fetchChanges(claw: TurnClaw, key: string, sessionId: string, log: Logger): Promise<Changes | undefined>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const TITLE_MAX = 120;
|
|
2
|
+
export declare const SUMMARY_MAX = 280;
|
|
3
|
+
/** One line: whitespace collapsed, cut to `limit` characters with an ellipsis. */
|
|
4
|
+
export declare function clip(text: unknown, limit: number): string;
|
|
5
|
+
/** `text` for a card text block, which reads markdown: its markup characters escaped, so `__init__.py` is not bold. */
|
|
6
|
+
export declare function plain(text: string): string;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type JsonObject } from "./json.js";
|
|
2
|
+
export declare const DELIVER_TOOL = "deliver_file";
|
|
3
|
+
export declare const DELIVERY_NAME_MAX = 200;
|
|
4
|
+
/** Files shown for one turn; a turn that delivers more is told to zip them by the tool's own wording. */
|
|
5
|
+
export declare const DELIVERIES_MAX = 5;
|
|
6
|
+
export declare const INLINE_IMAGE_TYPES: readonly string[];
|
|
7
|
+
/** A message of about 28 KB is refused, so an image is shown only as a data URI that fits. */
|
|
8
|
+
export declare const INLINE_IMAGE_MAX_BYTES = 15000;
|
|
9
|
+
export interface Delivery {
|
|
10
|
+
readonly id: string;
|
|
11
|
+
readonly name: string;
|
|
12
|
+
readonly size: number;
|
|
13
|
+
readonly contentType: string;
|
|
14
|
+
readonly caption: string;
|
|
15
|
+
/** A data URI of the image itself, when it came along and is one the chat can show; '' otherwise. */
|
|
16
|
+
readonly image: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* The file a successful `deliver_file` call delivered, from its terminal toolUsed event; undefined for anything else, and
|
|
20
|
+
* for a delivery that does not say what it is (an id that is not one, no name, no size).
|
|
21
|
+
*/
|
|
22
|
+
export declare function deliveryOf(tool: string, status: string, data: JsonObject): Delivery | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* The files an assistant message hands the user (Claw's `files`), as (the worker session the download is under, the file),
|
|
25
|
+
* read as strictly as a turn's `deliver_file` event: a file that does not say what it is, or names no session, is left out.
|
|
26
|
+
*/
|
|
27
|
+
export declare function assistantDeliveries(event: JsonObject): Array<readonly [string, Delivery]>;
|
|
28
|
+
/** A size as a file manager says it: "512 B", "1.5 KB", "12 MB". */
|
|
29
|
+
export declare function sizeText(size: number): string;
|
|
30
|
+
/** A group chat's line for a delivered file: its name and the link, which only the person who asked can open. */
|
|
31
|
+
export declare function deliveryLine(delivery: Delivery, url: string): string;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ClawError, ClawUnreachable } from "../../claw/errors.js";
|
|
2
|
+
/** A Claw call failed in a way the turn survives (an error status, no answer, an answer it could not read). */
|
|
3
|
+
export declare function isClawFailure(err: unknown): boolean;
|
|
4
|
+
/** An error status or no answer at all: Python's `(ClawError, httpx.HTTPError)`. */
|
|
5
|
+
export declare function isClawOrNetwork(err: unknown): err is ClawError | ClawUnreachable;
|
|
6
|
+
/** What a log line says about it: the status, or the kind of failure. */
|
|
7
|
+
export declare function statusOrKind(err: ClawError | ClawUnreachable): string | number;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { StatusMessage } from "../progress/status-message.js";
|
|
2
|
+
import type { Step } from "../step.js";
|
|
3
|
+
import type { TurnState } from "../turn-state.js";
|
|
4
|
+
import { type TurnContext } from "./context.js";
|
|
5
|
+
export declare const STREAM_ATTEMPTS = 4;
|
|
6
|
+
/** A wait longer than this in a request is not believed. */
|
|
7
|
+
export declare const MAX_APPROVAL_WAIT_SECONDS: number;
|
|
8
|
+
/** The tool whose call waits for the answer to a question card (Brain's userQuestion event). */
|
|
9
|
+
export declare const QUESTION_TOOL = "ask_user_question";
|
|
10
|
+
/** The stream dropped STREAM_ATTEMPTS times before the turn ended. */
|
|
11
|
+
export declare class StreamKeptDropping extends Error {
|
|
12
|
+
constructor();
|
|
13
|
+
}
|
|
14
|
+
/** The wait Brain announces in a permissionRequest (`timeout_ms`) in seconds; undefined for anything not a sane number. */
|
|
15
|
+
export declare function waitSeconds(milliseconds: unknown): number | undefined;
|
|
16
|
+
export declare function noteRunning(ctx: TurnContext, state: TurnState, once: {
|
|
17
|
+
called: boolean;
|
|
18
|
+
}): void;
|
|
19
|
+
export interface ConsumeArgs {
|
|
20
|
+
readonly sessionId: string;
|
|
21
|
+
readonly state: TurnState;
|
|
22
|
+
readonly status: StatusMessage<Step>;
|
|
23
|
+
readonly running: {
|
|
24
|
+
called: boolean;
|
|
25
|
+
};
|
|
26
|
+
readonly signal?: AbortSignal | undefined;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Read the stream until the turn ends; reconnects from the last event if it drops. A turn whose message Claw took at once
|
|
30
|
+
* starts after the newest event stored before it was sent, so the history it replays is this turn's. A queued one reads
|
|
31
|
+
* the history Claw sends without `after` (the session's tail): it is told from older turns by coming after the one in
|
|
32
|
+
* front of it. A Claw whose history marker has no `has_more` compares `after` as text: seen on a connection that had an
|
|
33
|
+
* `after`, the stream is read once more from where Claw starts it, and every reconnect starts there too.
|
|
34
|
+
*/
|
|
35
|
+
export declare function consume(ctx: TurnContext, args: ConsumeArgs): Promise<boolean>;
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
/** Everything one turn runs with: who it acts for, what it sends, where it answers, and what it reports back. */
|
|
2
|
+
import type { Lang } from "../../locales/lang.js";
|
|
3
|
+
import type { PullRef } from "../../claw/model.js";
|
|
4
|
+
import type { Integrations } from "../../plugins/integrations.js";
|
|
5
|
+
import type { ModelRefusalPolicy } from "../../plugins/model-refusal-policy.js";
|
|
6
|
+
import type { Clock } from "../../ports/clock.js";
|
|
7
|
+
import type { Logger } from "../../ports/logger.js";
|
|
8
|
+
import type { PublicErrors } from "../../public-error/public-errors.js";
|
|
9
|
+
import type { Envelope, FetchedFile, InboundFile, OutMessage, UserRef } from "../../ports/surface.js";
|
|
10
|
+
import type { GithubOutcome } from "../github-outcome.js";
|
|
11
|
+
import type { TurnClaw, TurnSurface } from "../ports.js";
|
|
12
|
+
import type { ClawError } from "../../claw/errors.js";
|
|
13
|
+
import type { TurnCards } from "../../ports/turn-cards.js";
|
|
14
|
+
/** What the turn is and whom it acts for. Read only by the turn. */
|
|
15
|
+
export interface TurnRequest {
|
|
16
|
+
/** The key of the user this turn acts for, and nobody else. */
|
|
17
|
+
readonly key: string;
|
|
18
|
+
/** What the user wrote (the session's title, the language of the answer). */
|
|
19
|
+
readonly text: string;
|
|
20
|
+
readonly idempotencyKey: string;
|
|
21
|
+
readonly publicBaseUrl: string;
|
|
22
|
+
/** The person's message: a live stream answers it (undefined: the turn is shown by an edited message). */
|
|
23
|
+
readonly streamReplyTo?: string;
|
|
24
|
+
/** A group chat: no tool input on cards, approvals are recorded and owner-only. */
|
|
25
|
+
readonly group?: boolean;
|
|
26
|
+
readonly ownerName?: string;
|
|
27
|
+
/** Claw will push this user a run's end and its approvals. */
|
|
28
|
+
readonly notifies?: boolean;
|
|
29
|
+
/** The model this worker pins its sessions to ('' sends none). */
|
|
30
|
+
readonly model?: string;
|
|
31
|
+
/** The model a turn refused for want of a model key is run again on ('' never). */
|
|
32
|
+
readonly fallbackModel?: string;
|
|
33
|
+
/** The user's client never sends the chat's thumbs on: the answer gets thumbs of our own. */
|
|
34
|
+
readonly ownThumbs?: boolean;
|
|
35
|
+
/** A review turn: the id of the user whose GitHub account the session's tools use (always a new session). */
|
|
36
|
+
readonly actingAs?: string;
|
|
37
|
+
/** A review turn: the one pull request the session is bound to. */
|
|
38
|
+
readonly reviewTarget?: PullRef;
|
|
39
|
+
/** A review turn: the requester's own linked key, sent beside `key` as the model key. Never logged. */
|
|
40
|
+
readonly modelKey?: string;
|
|
41
|
+
/** A review turn: the model its request named. */
|
|
42
|
+
readonly reviewModel?: string;
|
|
43
|
+
/** A review turn that may not merge. */
|
|
44
|
+
readonly reviewOnly?: boolean;
|
|
45
|
+
/** A review Claw made itself: its session has its first message queued, so nothing is sent and the turn is followed. */
|
|
46
|
+
readonly attach?: boolean;
|
|
47
|
+
/** That turn's id when Claw said it ('' when not: it is the session's first turn). */
|
|
48
|
+
readonly attachMessageId?: string;
|
|
49
|
+
/** Shown at the top of the progress message from its first post on (a review's acknowledgement). */
|
|
50
|
+
readonly lead?: string;
|
|
51
|
+
/** A review asked in a group: the asker, whom its answer @mentions (nobody else). */
|
|
52
|
+
readonly mention?: UserRef;
|
|
53
|
+
/** (url, branch) a NEW session is bound to; undefined: no repository. */
|
|
54
|
+
readonly repo?: readonly [string, string];
|
|
55
|
+
/** A card with what the session changed follows a finished answer (1:1 chats). */
|
|
56
|
+
readonly showChanges?: boolean;
|
|
57
|
+
/** The message(s) this one quotes, as text for the model ('' none). */
|
|
58
|
+
readonly quote?: string;
|
|
59
|
+
/** `text` with the address behind each of its links; '' when it is `text` itself. */
|
|
60
|
+
readonly sent?: string;
|
|
61
|
+
/** The language the person is answered in (undefined: the language of `text`). */
|
|
62
|
+
readonly lang?: Lang;
|
|
63
|
+
/** What the user sent with the message. */
|
|
64
|
+
readonly files?: readonly InboundFile[];
|
|
65
|
+
}
|
|
66
|
+
/** What the turn tells its caller as it goes. Each is optional; none of them can fail the turn's answer. */
|
|
67
|
+
export interface TurnHooks {
|
|
68
|
+
/** A fresh credential per call (exchanged tokens expire); without it the request's `key`. */
|
|
69
|
+
readonly keyProvider?: () => Promise<string>;
|
|
70
|
+
/**
|
|
71
|
+
* An approval or question is about to be shown, as `envelope`: false when a card for it is already in a chat (the
|
|
72
|
+
* notification got there first), and the turn then shows none. `expiresIn`: the seconds Brain waits for the answer.
|
|
73
|
+
*/
|
|
74
|
+
readonly onApproval?: (sessionId: string, toolUseId: string, tool: string, expiresIn: number | undefined, envelope: Envelope) => boolean | undefined;
|
|
75
|
+
readonly onApprovalSent?: (sessionId: string, toolUseId: string) => void;
|
|
76
|
+
readonly onApprovalUnsent?: (sessionId: string, toolUseId: string) => void;
|
|
77
|
+
/** (session, "started" | "delivered" | "failed", Claw message id or ''). */
|
|
78
|
+
readonly onTurn?: (sessionId: string, what: "started" | "delivered" | "failed", messageId: string) => void;
|
|
79
|
+
/** Once, when Claw is running this turn's message. */
|
|
80
|
+
readonly onRunning?: () => void;
|
|
81
|
+
/** The "Report a problem" message for a turn that went wrong. */
|
|
82
|
+
readonly reportMessage?: () => OutMessage;
|
|
83
|
+
/**
|
|
84
|
+
* A review turn: (answer, link to the session, model, the GitHub results, inline comments, the PR's one sentence) ->
|
|
85
|
+
* the text posted, the review's one message.
|
|
86
|
+
*/
|
|
87
|
+
readonly shapeAnswer?: (answer: string, link: string, model: string, results: GithubOutcome[], comments: number, prSummary: string) => string;
|
|
88
|
+
/** A review turn: each finished GitHub write as it arrives; the line it returns is shown at the top of the progress. */
|
|
89
|
+
readonly onGithubResult?: (outcome: GithubOutcome, model: string) => string | undefined;
|
|
90
|
+
/** A review asked of someone else that Claw refused as `acting_as_must_be_self`: true when the asker was told. */
|
|
91
|
+
readonly asItem?: () => Promise<boolean>;
|
|
92
|
+
/** Fetches the files the user sent: (the files fetched, [(name, why not)]). */
|
|
93
|
+
readonly fetchFiles?: (files: readonly InboundFile[]) => Promise<readonly [FetchedFile[], Array<readonly [string, string]>]>;
|
|
94
|
+
/** (how many) of the message's files did not reach Claw. */
|
|
95
|
+
readonly onFilesDropped?: (count: number) => void;
|
|
96
|
+
}
|
|
97
|
+
/** The reply style's switches that touch the turn. */
|
|
98
|
+
export interface TurnStyle {
|
|
99
|
+
/** The agent's text is streamed into the answer's bubble (1:1 chats). */
|
|
100
|
+
readonly streamText: boolean;
|
|
101
|
+
/** Suggested replies under a finished 1:1 answer. */
|
|
102
|
+
readonly suggestedReplies: boolean;
|
|
103
|
+
}
|
|
104
|
+
export interface TurnDeps {
|
|
105
|
+
readonly claw: TurnClaw;
|
|
106
|
+
readonly surface: TurnSurface;
|
|
107
|
+
readonly clock: Clock;
|
|
108
|
+
readonly log: Logger;
|
|
109
|
+
readonly refusals: ModelRefusalPolicy;
|
|
110
|
+
/** What a person is told of a failure, and what is kept back for the log. */
|
|
111
|
+
readonly errors: PublicErrors;
|
|
112
|
+
readonly style: TurnStyle;
|
|
113
|
+
/** The approval, question and thumbs cards (the approvals' and the feedback feature's). */
|
|
114
|
+
readonly cards: TurnCards;
|
|
115
|
+
/** A deployment's MCP servers, named in progress lines (none: the public build's). */
|
|
116
|
+
readonly integrations?: Integrations;
|
|
117
|
+
}
|
|
118
|
+
/** What the turn records as it runs, for whoever runs something after it. */
|
|
119
|
+
export interface TurnRecord {
|
|
120
|
+
/** undefined: create a session with this message. */
|
|
121
|
+
sessionId: string | undefined;
|
|
122
|
+
/** The model the session is known to have; a turn updates it. */
|
|
123
|
+
sessionModel: string;
|
|
124
|
+
/** The model the turn ran on: what the gateway said served it, else what the session asks for. */
|
|
125
|
+
ranModel: string;
|
|
126
|
+
/** What the turn left on GitHub. */
|
|
127
|
+
wrote: GithubOutcome[];
|
|
128
|
+
/** A review turn: the sentence of what the pull request does. */
|
|
129
|
+
prSummary: string;
|
|
130
|
+
/** What the turn ended with. */
|
|
131
|
+
finalAnswer: string;
|
|
132
|
+
/** A review turn that Claw answered 401: the asker's credentials were not taken. */
|
|
133
|
+
refusal: ClawError | undefined;
|
|
134
|
+
/** The review was asked for again as the reviewer's item, and the asker told. */
|
|
135
|
+
moved: boolean;
|
|
136
|
+
/** Where the files are, for the model (set once they are in the session). */
|
|
137
|
+
filesNote: string;
|
|
138
|
+
/** The files, once fetched (once per turn). */
|
|
139
|
+
fetched: FetchedFile[] | undefined;
|
|
140
|
+
/** The newest event the session held just before this turn's message was sent: the stream is read after it. */
|
|
141
|
+
streamAfter: string | undefined;
|
|
142
|
+
}
|
|
143
|
+
export interface TurnContext {
|
|
144
|
+
readonly request: TurnRequest;
|
|
145
|
+
readonly hooks: TurnHooks;
|
|
146
|
+
readonly deps: TurnDeps;
|
|
147
|
+
readonly record: TurnRecord;
|
|
148
|
+
}
|
|
149
|
+
export declare function newRecord(sessionId: string | undefined, sessionModel?: string): TurnRecord;
|
|
150
|
+
export declare function credential(ctx: TurnContext): Promise<string>;
|
|
151
|
+
/** The language the turn's own lines are said in: the person's, else that of what they wrote. */
|
|
152
|
+
export declare function langOf(ctx: TurnContext): Lang;
|
|
153
|
+
/**
|
|
154
|
+
* What Claw is sent: the quoted messages, then what the user wrote (with the addresses behind its links), then where the
|
|
155
|
+
* files they sent are. `text` stays the words alone: the session's title, the language of the answer.
|
|
156
|
+
*/
|
|
157
|
+
export declare function messageOf(ctx: TurnContext): string;
|