@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,49 @@
|
|
|
1
|
+
/** Group onboarding of a member who has not linked yet (tables `onboarding_cards`, `onboarding_dms`,
|
|
2
|
+
* `pending_requests`). */
|
|
3
|
+
import type { JsonObject } from "./json.js";
|
|
4
|
+
export interface OnboardingCard {
|
|
5
|
+
readonly promptId: string;
|
|
6
|
+
/** The member the card is for: the only one who may press its button. */
|
|
7
|
+
readonly userId: string;
|
|
8
|
+
/** The group chat's conversation id. */
|
|
9
|
+
readonly scope: string;
|
|
10
|
+
/** Their channel id (what a mention and a 1:1 conversation need). */
|
|
11
|
+
readonly channelUserId: string;
|
|
12
|
+
readonly name: string;
|
|
13
|
+
readonly createdAt: number;
|
|
14
|
+
}
|
|
15
|
+
export interface PendingRequest {
|
|
16
|
+
readonly userId: string;
|
|
17
|
+
/** The group chat the request was made in. */
|
|
18
|
+
readonly scope: string;
|
|
19
|
+
readonly messageId: string;
|
|
20
|
+
readonly text: string;
|
|
21
|
+
/** Where to post in that chat. */
|
|
22
|
+
readonly reference: JsonObject;
|
|
23
|
+
readonly createdAt: number;
|
|
24
|
+
/** The message(s) it quoted, as text for the model. */
|
|
25
|
+
readonly quote: string;
|
|
26
|
+
/** What it said with the addresses behind its links; '' when that is `text`. */
|
|
27
|
+
readonly sent: string;
|
|
28
|
+
}
|
|
29
|
+
export type NewPendingRequest = Omit<PendingRequest, "createdAt" | "quote" | "sent"> & {
|
|
30
|
+
readonly quote?: string;
|
|
31
|
+
readonly sent?: string;
|
|
32
|
+
};
|
|
33
|
+
export interface OnboardingRepository {
|
|
34
|
+
/** One card per person per group per day: the new card's id, or null when one went out within the day. */
|
|
35
|
+
claimOnboardingCard(userId: string, scope: string, member: {
|
|
36
|
+
readonly channelUserId: string;
|
|
37
|
+
readonly name: string;
|
|
38
|
+
}): string | null;
|
|
39
|
+
/** The claimed card never reached the chat: the allowance is not spent. */
|
|
40
|
+
releaseOnboardingCard(promptId: string): void;
|
|
41
|
+
getOnboardingCard(promptId: string): OnboardingCard | null;
|
|
42
|
+
/** One proactive DM per person per day. */
|
|
43
|
+
claimOnboardingDm(userId: string): boolean;
|
|
44
|
+
releaseOnboardingDm(userId: string): void;
|
|
45
|
+
/** Kept for PENDING_REQUEST_TTL_SECONDS; a newer request replaces it. */
|
|
46
|
+
savePendingRequest(request: NewPendingRequest): void;
|
|
47
|
+
/** Once: gone after this call; null when none or expired. */
|
|
48
|
+
takePendingRequest(userId: string): PendingRequest | null;
|
|
49
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/** Where and how to reach a person, and what is known of them (tables `conversation_refs`, `user_prefs`, `held_events`,
|
|
2
|
+
* `teams_users`, `personal_clicks`). */
|
|
3
|
+
import type { JsonObject } from "./json.js";
|
|
4
|
+
export interface Prefs {
|
|
5
|
+
readonly timezone: string;
|
|
6
|
+
readonly quietEnabled: boolean;
|
|
7
|
+
readonly quietStart: string;
|
|
8
|
+
readonly quietEnd: string;
|
|
9
|
+
/** Epoch seconds notices are paused until; null: not paused. */
|
|
10
|
+
readonly pausedUntil: number | null;
|
|
11
|
+
readonly briefTriggerId: string | null;
|
|
12
|
+
/** 'zh' / 'en' the person is answered in; '' not known yet. */
|
|
13
|
+
readonly lang: string;
|
|
14
|
+
/** They said which (`/lang`): what they write changes nothing. */
|
|
15
|
+
readonly langSet: boolean;
|
|
16
|
+
/** 'card' | 'chat' as the person set it (`/agent mode`); '' not said. */
|
|
17
|
+
readonly remoteWindow: string;
|
|
18
|
+
}
|
|
19
|
+
export interface ConversationRefRepository {
|
|
20
|
+
/** Keep where to post to this person unprompted (the reference's activityId is dropped). */
|
|
21
|
+
saveReference(userId: string, reference: JsonObject): void;
|
|
22
|
+
getReference(userId: string): JsonObject | null;
|
|
23
|
+
/** When the person last wrote in their 1:1 chat or pressed a button there. */
|
|
24
|
+
lastInboundAt(userId: string): number | null;
|
|
25
|
+
}
|
|
26
|
+
export interface PrefsRepository {
|
|
27
|
+
getPrefs(userId: string): Prefs;
|
|
28
|
+
getTimezone(userId: string): string;
|
|
29
|
+
setTimezone(userId: string, timezone: string): void;
|
|
30
|
+
/** A (start, end) wall-clock window in the person's time zone, or null for no quiet hours. */
|
|
31
|
+
setQuiet(userId: string, window: readonly [string, string] | null): void;
|
|
32
|
+
setPausedUntil(userId: string, until: number | null): void;
|
|
33
|
+
/** Ignored unless `window` is 'card' or 'chat'. */
|
|
34
|
+
setRemoteWindowPref(userId: string, window: string): void;
|
|
35
|
+
setBriefTrigger(userId: string, triggerId: string | null): void;
|
|
36
|
+
/** `said` false (`/lang auto`): `lang` is only a starting point that `learnLang` changes again. */
|
|
37
|
+
setLang(userId: string, lang: string, said?: boolean): void;
|
|
38
|
+
/** The language a message was written in: kept unless the person said which. */
|
|
39
|
+
learnLang(userId: string, lang: string): void;
|
|
40
|
+
}
|
|
41
|
+
/** Notices held back by quiet hours or /pause. */
|
|
42
|
+
export interface HeldEventRepository {
|
|
43
|
+
/** `event.event_id` identifies it; the newest MAX_HELD_PER_USER per person are kept, for HELD_TTL_SECONDS. */
|
|
44
|
+
holdEvent(userId: string, event: JsonObject): void;
|
|
45
|
+
usersWithHeld(): string[];
|
|
46
|
+
/** Remove and return the person's held events, oldest first, at once. */
|
|
47
|
+
takeHeld(userId: string): JsonObject[];
|
|
48
|
+
}
|
|
49
|
+
/** A person as the channel's member list reads (`id` the channel id, `objectId` the person id). */
|
|
50
|
+
export interface KnownMember {
|
|
51
|
+
readonly id: string;
|
|
52
|
+
readonly objectId: string;
|
|
53
|
+
readonly name: string;
|
|
54
|
+
readonly email?: string;
|
|
55
|
+
}
|
|
56
|
+
/** A member entry as a group's member list gives it. */
|
|
57
|
+
export interface MemberListEntry {
|
|
58
|
+
readonly id?: unknown;
|
|
59
|
+
readonly email?: unknown;
|
|
60
|
+
readonly userPrincipalName?: unknown;
|
|
61
|
+
}
|
|
62
|
+
/** Which person a channel user id belongs to, as their own messages say. */
|
|
63
|
+
export interface MemberDirectoryRepository {
|
|
64
|
+
/** `email` '' keeps the address already known. */
|
|
65
|
+
rememberMember(channelUserId: string, userId: string, name: string, email?: string): void;
|
|
66
|
+
/** Addresses from a member list, kept only for people already known. */
|
|
67
|
+
rememberMemberEmails(members: readonly MemberListEntry[]): void;
|
|
68
|
+
/** Everyone seen, newest first. */
|
|
69
|
+
knownMembers(limit?: number): KnownMember[];
|
|
70
|
+
userForChannelId(channelUserId: string): string | null;
|
|
71
|
+
/** The channel id this person last wrote with. */
|
|
72
|
+
channelIdOf(userId: string): string | null;
|
|
73
|
+
memberName(userId: string): string | null;
|
|
74
|
+
/** A card click of theirs arrived from their 1:1 chat (the app is installed for them). */
|
|
75
|
+
notePersonalClick(userId: string): void;
|
|
76
|
+
clickedPersonally(userId: string): boolean;
|
|
77
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/** How long a `/link` code minted by the console can be redeemed. */
|
|
2
|
+
export declare const LINK_CODE_TTL_SECONDS: number;
|
|
3
|
+
export declare const CODE_LENGTH = 8;
|
|
4
|
+
/** The alphabet a link code is drawn from: no 0/O/1/I. */
|
|
5
|
+
export declare const CODE_ALPHABET = "ABCDEFGHJKLMNPQRSTUVWXYZ23456789";
|
|
6
|
+
/** Wrong codes per user in the window (TEAMS_LINK_MAX_FAILURES_PER_USER). */
|
|
7
|
+
export declare const MAX_FAILED_ATTEMPTS = 5;
|
|
8
|
+
/** Wrong codes of all users together in the window (TEAMS_LINK_MAX_FAILURES_GLOBAL). */
|
|
9
|
+
export declare const MAX_FAILED_ATTEMPTS_GLOBAL = 100;
|
|
10
|
+
/** TEAMS_LINK_ATTEMPT_WINDOW_SECONDS. */
|
|
11
|
+
export declare const ATTEMPT_WINDOW_SECONDS: number;
|
|
12
|
+
/** An action is carried out for an assistant message this young, at most. */
|
|
13
|
+
export declare const ASSISTANT_MESSAGE_KEEP_SECONDS: number;
|
|
14
|
+
/** A held write's card: Claw keeps the confirmation for a day; a press after that is told so. */
|
|
15
|
+
export declare const CONFIRM_CARD_KEEP_SECONDS: number;
|
|
16
|
+
export declare const PROCESSED_TTL_SECONDS: number;
|
|
17
|
+
/** A Claw event being sent is claimed this long; past it the claim is taken to have died with its process. */
|
|
18
|
+
export declare const EVENT_CLAIM_LEASE_SECONDS: number;
|
|
19
|
+
/** "What went wrong?" waits this long for the user's next message. */
|
|
20
|
+
export declare const FEEDBACK_ASK_TTL_SECONDS: number;
|
|
21
|
+
/** The "include my last question and answer" buttons work this long. */
|
|
22
|
+
export declare const FEEDBACK_OFFER_TTL_SECONDS: number;
|
|
23
|
+
/** An offer row is kept this long. */
|
|
24
|
+
export declare const FEEDBACK_OFFER_KEEP_SECONDS: number;
|
|
25
|
+
/** The "Report a problem" button under a failed message works this long. */
|
|
26
|
+
export declare const FEEDBACK_PROMPT_TTL_SECONDS: number;
|
|
27
|
+
/** Same user + same session within this long: a comment on the same issue. */
|
|
28
|
+
export declare const FEEDBACK_DEDUPE_SECONDS: number;
|
|
29
|
+
/** Delivered reports are kept this long (undelivered ones are never dropped). */
|
|
30
|
+
export declare const FEEDBACK_KEEP_SECONDS: number;
|
|
31
|
+
/** One onboarding card per person per group chat, and one proactive DM per person, in this long. */
|
|
32
|
+
export declare const ONBOARDING_INTERVAL_SECONDS: number;
|
|
33
|
+
/** A group request from someone who is not linked yet waits this long for them to link. */
|
|
34
|
+
export declare const PENDING_REQUEST_TTL_SECONDS: number;
|
|
35
|
+
/** A message a turn answered drops its run's card this long. */
|
|
36
|
+
export declare const ANSWERED_MESSAGE_KEEP_SECONDS: number;
|
|
37
|
+
/** A remote permission row is kept this long after it ran out (stale-click message). */
|
|
38
|
+
export declare const REMOTE_PERMISSION_KEEP_SECONDS: number;
|
|
39
|
+
/** A card for a work item answers its buttons this long; after that /board shows the item again. */
|
|
40
|
+
export declare const ASSISTANT_CARD_KEEP_SECONDS: number;
|
|
41
|
+
export declare const DEFAULT_TIMEZONE = "Asia/Shanghai";
|
|
42
|
+
export declare const DEFAULT_QUIET: readonly [string, string];
|
|
43
|
+
/** 9999-12-31: "until /resume". */
|
|
44
|
+
export declare const PAUSE_FOREVER = 253402300799;
|
|
45
|
+
export declare const MAX_HELD_PER_USER = 100;
|
|
46
|
+
export declare const HELD_TTL_SECONDS: number;
|
|
47
|
+
/** How long an approval row is kept after it expired, for the stale-click message. */
|
|
48
|
+
export declare const APPROVAL_TTL_SECONDS: number;
|
|
49
|
+
/** How long a review session is remembered as one that acts as a user. */
|
|
50
|
+
export declare const ACTING_SESSION_KEEP_SECONDS: number;
|
|
51
|
+
/** The repositories /repo remembers per user (and lists). */
|
|
52
|
+
export declare const RECENT_REPOS = 5;
|
|
53
|
+
/** "My next message is for this repository" is forgotten after this. */
|
|
54
|
+
export declare const PENDING_REPO_TTL_SECONDS: number;
|
|
55
|
+
/** The sessions /sessions lists. */
|
|
56
|
+
export declare const SESSION_LIST = 5;
|
|
57
|
+
/** The sessions a chat remembers per user: more than are listed, so a deletion in Claw leaves some. */
|
|
58
|
+
export declare const SESSION_HISTORY_KEEP = 20;
|
|
59
|
+
/** The session cards of one remote attachment remembered for quote replies. */
|
|
60
|
+
export declare const WINDOW_CARDS_KEPT = 8;
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
/** Remote agents: which session a chat is attached to, how far it has read, and the permission cards it showed
|
|
2
|
+
* (tables `remote_state`, `remote_session_names`, `remote_permissions`). */
|
|
3
|
+
/** 'card': the chat box goes to the assistant and the session card's input to the session; 'chat': all to the session. */
|
|
4
|
+
export type ChatBox = "card" | "chat";
|
|
5
|
+
export interface RemoteState {
|
|
6
|
+
/** null: not attached. */
|
|
7
|
+
readonly sessionId: string | null;
|
|
8
|
+
readonly connectorId: string;
|
|
9
|
+
readonly agentId: string;
|
|
10
|
+
readonly agentLabel: string;
|
|
11
|
+
readonly host: string;
|
|
12
|
+
readonly cwd: string;
|
|
13
|
+
/** Id of the last event of the session handled ('' none). */
|
|
14
|
+
readonly cursor: string;
|
|
15
|
+
/** A prompt was sent and its turn end has not been seen. */
|
|
16
|
+
readonly turnOpen: boolean;
|
|
17
|
+
readonly mode: string;
|
|
18
|
+
readonly modes: readonly string[];
|
|
19
|
+
/** Session ids of the last /agent sessions, in the order shown. */
|
|
20
|
+
readonly listing: readonly string[];
|
|
21
|
+
/** The session does not ask before a step; null: not said. */
|
|
22
|
+
readonly unattended: boolean | null;
|
|
23
|
+
/** mode id -> whether selecting it makes the session unattended. */
|
|
24
|
+
readonly modeFlags: Readonly<Record<string, boolean>>;
|
|
25
|
+
readonly statusCard: string;
|
|
26
|
+
readonly attachedAt: number;
|
|
27
|
+
readonly conversation: string;
|
|
28
|
+
readonly conversationRef: string;
|
|
29
|
+
readonly window: ChatBox | (string & {});
|
|
30
|
+
readonly windowCards: readonly string[];
|
|
31
|
+
}
|
|
32
|
+
export interface RemoteAttachment {
|
|
33
|
+
readonly sessionId: string;
|
|
34
|
+
readonly connectorId: string;
|
|
35
|
+
readonly agentId: string;
|
|
36
|
+
readonly agentLabel: string;
|
|
37
|
+
readonly host: string;
|
|
38
|
+
readonly cwd: string;
|
|
39
|
+
readonly cursor?: string;
|
|
40
|
+
readonly mode?: string;
|
|
41
|
+
readonly modes?: readonly string[] | null;
|
|
42
|
+
readonly unattended?: boolean | null;
|
|
43
|
+
readonly modeFlags?: Readonly<Record<string, boolean>> | null;
|
|
44
|
+
readonly conversation?: string;
|
|
45
|
+
readonly conversationRef?: string;
|
|
46
|
+
readonly window?: string;
|
|
47
|
+
}
|
|
48
|
+
/** What the agent said about its permission modes; an absent part stays as it was. */
|
|
49
|
+
export interface RemoteModes {
|
|
50
|
+
readonly mode?: string | null;
|
|
51
|
+
readonly modes?: readonly string[] | null;
|
|
52
|
+
readonly unattended?: boolean | null;
|
|
53
|
+
readonly modeFlags?: Readonly<Record<string, boolean>> | null;
|
|
54
|
+
}
|
|
55
|
+
export interface RemoteSessionName {
|
|
56
|
+
readonly title: string;
|
|
57
|
+
readonly conversationRef: string;
|
|
58
|
+
}
|
|
59
|
+
export interface RemoteStateRepository {
|
|
60
|
+
getRemote(chatKey: string): RemoteState | null;
|
|
61
|
+
remoteAttachedUsers(): string[];
|
|
62
|
+
attachedRemote(chatKey: string): RemoteState | null;
|
|
63
|
+
/** The last listing and status card survive an attach. */
|
|
64
|
+
attachRemote(chatKey: string, attachment: RemoteAttachment): void;
|
|
65
|
+
setRemoteWindow(chatKey: string, window: string): void;
|
|
66
|
+
/** Remember a replaced session card (the last WINDOW_CARDS_KEPT). */
|
|
67
|
+
noteWindowCard(chatKey: string, cardId: string, kept?: number): void;
|
|
68
|
+
detachRemote(chatKey: string): void;
|
|
69
|
+
/** Only forward, and only for the attached session; a non-numeric cursor is ignored. */
|
|
70
|
+
setRemoteCursor(chatKey: string, sessionId: string, cursor: string): void;
|
|
71
|
+
setRemoteTurn(chatKey: string, sessionId: string, isOpen: boolean): void;
|
|
72
|
+
setRemoteModes(chatKey: string, sessionId: string, modes: RemoteModes): void;
|
|
73
|
+
setRemoteStatusCard(chatKey: string, cardId: string): void;
|
|
74
|
+
setRemoteListing(chatKey: string, sessionIds: readonly string[]): void;
|
|
75
|
+
}
|
|
76
|
+
export interface RemoteSessionNameRepository {
|
|
77
|
+
nameRemoteSession(userId: string, sessionId: string, name?: Partial<RemoteSessionName>): void;
|
|
78
|
+
/** Only a session with no title yet gets one. */
|
|
79
|
+
titleRemoteSession(sessionId: string, title: string): void;
|
|
80
|
+
setRemoteSessionAcp(sessionId: string, acpSessionId: string): void;
|
|
81
|
+
remoteSessionAcps(userId: string): Map<string, string>;
|
|
82
|
+
remoteSessionNames(userId: string): Map<string, RemoteSessionName>;
|
|
83
|
+
}
|
|
84
|
+
export type RemotePermissionState = "pending" | "sending" | "decided" | "expired" | (string & {});
|
|
85
|
+
export interface RemotePermission {
|
|
86
|
+
readonly sessionId: string;
|
|
87
|
+
readonly actionId: string;
|
|
88
|
+
readonly userId: string;
|
|
89
|
+
readonly tool: string;
|
|
90
|
+
/** [{optionId, name, kind}] exactly as the agent offered them. */
|
|
91
|
+
readonly options: readonly unknown[];
|
|
92
|
+
readonly expiresAt: number;
|
|
93
|
+
readonly state: RemotePermissionState;
|
|
94
|
+
}
|
|
95
|
+
export interface NewRemotePermission {
|
|
96
|
+
readonly userId: string;
|
|
97
|
+
readonly sessionId: string;
|
|
98
|
+
readonly actionId: string;
|
|
99
|
+
readonly tool: string;
|
|
100
|
+
readonly options: readonly unknown[];
|
|
101
|
+
readonly expiresAt: number;
|
|
102
|
+
}
|
|
103
|
+
export interface RemotePermissionRepository {
|
|
104
|
+
/** Recorded before it is shown; false when this request already has a row. */
|
|
105
|
+
saveRemotePermission(permission: NewRemotePermission): boolean;
|
|
106
|
+
getRemotePermission(sessionId: string, actionId: string): RemotePermission | null;
|
|
107
|
+
/** Pending and not run out, oldest first. */
|
|
108
|
+
pendingRemotePermissions(userId: string, sessionId: string): RemotePermission[];
|
|
109
|
+
waitingRemoteSessions(userId: string): Set<string>;
|
|
110
|
+
forgetRemotePermission(sessionId: string, actionId: string): void;
|
|
111
|
+
closeRemotePermission(sessionId: string, actionId: string, state: RemotePermissionState, options?: {
|
|
112
|
+
readonly onlyIfPending?: boolean;
|
|
113
|
+
}): boolean;
|
|
114
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/** Which Claw session a chat uses, and what /repo and /sessions remember (tables `sessions`, `recent_repos`,
|
|
2
|
+
* `pending_repo`, `session_history`). Scope '' is the 1:1 chat; a group chat's conversation id is its own scope. */
|
|
3
|
+
export interface ChatSession {
|
|
4
|
+
readonly sessionId: string;
|
|
5
|
+
/** The plugin it was created with ('' none). */
|
|
6
|
+
readonly pluginId: string;
|
|
7
|
+
/** The model it is known to have been given ('' Claw's default). */
|
|
8
|
+
readonly model: string;
|
|
9
|
+
/** Created shared (no memory in it). */
|
|
10
|
+
readonly shared: boolean;
|
|
11
|
+
}
|
|
12
|
+
export interface SessionRepository {
|
|
13
|
+
getSession(userId: string, scope?: string): string | null;
|
|
14
|
+
getSessionPlugin(userId: string, scope?: string): string;
|
|
15
|
+
getSessionModel(userId: string, scope?: string): string;
|
|
16
|
+
getSessionShared(userId: string, scope?: string): boolean;
|
|
17
|
+
setSession(userId: string, session: Partial<ChatSession> & {
|
|
18
|
+
readonly sessionId: string;
|
|
19
|
+
}, scope?: string): void;
|
|
20
|
+
clearSession(userId: string, scope?: string): void;
|
|
21
|
+
}
|
|
22
|
+
export interface RepoChoice {
|
|
23
|
+
/** "owner/name" */
|
|
24
|
+
readonly repo: string;
|
|
25
|
+
/** '' the default branch. */
|
|
26
|
+
readonly branch: string;
|
|
27
|
+
}
|
|
28
|
+
export interface HistorySession {
|
|
29
|
+
readonly sessionId: string;
|
|
30
|
+
/** What the session was started with ('' when never seen to start). */
|
|
31
|
+
readonly title: string;
|
|
32
|
+
readonly repo: string;
|
|
33
|
+
readonly branch: string;
|
|
34
|
+
/** When this chat last used it. */
|
|
35
|
+
readonly lastAt: number;
|
|
36
|
+
}
|
|
37
|
+
export interface NotedSession {
|
|
38
|
+
readonly title?: string;
|
|
39
|
+
readonly repo?: string;
|
|
40
|
+
readonly branch?: string;
|
|
41
|
+
}
|
|
42
|
+
export interface RepoHistoryRepository {
|
|
43
|
+
/** The newest of the person's RECENT_REPOS (same repository, compared without case, and branch: one entry). */
|
|
44
|
+
touchRecentRepo(userId: string, choice: RepoChoice): void;
|
|
45
|
+
/** Newest first. */
|
|
46
|
+
recentRepos(userId: string): RepoChoice[];
|
|
47
|
+
/** The person's next new session is bound to this repository. */
|
|
48
|
+
setPendingRepo(userId: string, choice: RepoChoice): void;
|
|
49
|
+
/** Null when none, or older than PENDING_REPO_TTL_SECONDS. */
|
|
50
|
+
getPendingRepo(userId: string): RepoChoice | null;
|
|
51
|
+
clearPendingRepo(userId: string): void;
|
|
52
|
+
/** The chat used `sessionId` now; a known session keeps its title and repository unless it had none. */
|
|
53
|
+
noteSession(userId: string, sessionId: string, seen?: NotedSession): void;
|
|
54
|
+
/** Newest first. */
|
|
55
|
+
sessionHistory(userId: string, limit?: number): HistorySession[];
|
|
56
|
+
forgetSession(userId: string, sessionId: string): void;
|
|
57
|
+
/** Everything /repo and /sessions remember about the person. */
|
|
58
|
+
forgetRepos(userId: string): void;
|
|
59
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/** Chat turns that answer in the chat, so the run's own notification card is redundant (tables `turn_answers`,
|
|
2
|
+
* `answered_messages`). */
|
|
3
|
+
export type AnsweredInChat = "delivered" | "running" | "lost";
|
|
4
|
+
export interface FinishedRun {
|
|
5
|
+
/** When the run finished (Claw's notification). */
|
|
6
|
+
readonly finishedAt: number;
|
|
7
|
+
/** A turn this process started and younger than this is still running. */
|
|
8
|
+
readonly runningMax: number;
|
|
9
|
+
/** Clock skew allowed between the delivery and the run's end. */
|
|
10
|
+
readonly slack: number;
|
|
11
|
+
/** The run's chat message, when Claw names it. */
|
|
12
|
+
readonly messageId?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface TurnAnswerRepository {
|
|
15
|
+
turnStarted(sessionId: string, turn?: {
|
|
16
|
+
readonly prompt?: string;
|
|
17
|
+
readonly messageId?: string;
|
|
18
|
+
readonly turnId?: string;
|
|
19
|
+
}): void;
|
|
20
|
+
/** With `turnId`, the row is updated only while it is still that turn's. */
|
|
21
|
+
turnDelivered(sessionId: string, turn?: {
|
|
22
|
+
readonly messageId?: string;
|
|
23
|
+
readonly turnId?: string;
|
|
24
|
+
}): void;
|
|
25
|
+
turnNotDelivered(sessionId: string, turnId?: string): void;
|
|
26
|
+
/** Whether a chat turn answered the run of this session that finished at `run.finishedAt`; null if none. */
|
|
27
|
+
answeredInChat(sessionId: string, run: FinishedRun): AnsweredInChat | null;
|
|
28
|
+
/** What was asked in the turn that started the run ('' when no chat turn did). */
|
|
29
|
+
turnPrompt(sessionId: string, finishedAt: number): string;
|
|
30
|
+
}
|