@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,36 @@
|
|
|
1
|
+
import type { Shown } from "./board.js";
|
|
2
|
+
import type { Click, SessionClicks } from "./clicks.js";
|
|
3
|
+
import type { CommandParts } from "./commands.js";
|
|
4
|
+
export declare class StartClicks {
|
|
5
|
+
private readonly p;
|
|
6
|
+
private readonly c;
|
|
7
|
+
constructor(p: CommandParts, c: SessionClicks);
|
|
8
|
+
private now;
|
|
9
|
+
/** The connector and agent a tap names, from the person's own list as Claw gives it now; null (said) when gone. */
|
|
10
|
+
private named;
|
|
11
|
+
/** New session: on an agent the person has, in a folder it reports or a conversation it offers. */
|
|
12
|
+
newSession(click: Click): Promise<void>;
|
|
13
|
+
/**
|
|
14
|
+
* Where a New session tap starts: the conversation it takes over (where it lives is what the agent reported), or the folder the
|
|
15
|
+
* card names; and the kind of session the card asked for when it is not how the agent starts. Or why not.
|
|
16
|
+
*/
|
|
17
|
+
private whereTo;
|
|
18
|
+
/** The watch of this conversation is over: the session that takes it over is the chat's now. */
|
|
19
|
+
private closeWatchOf;
|
|
20
|
+
/** Attach: to one of the person's sessions, as the list showed it. */
|
|
21
|
+
attach(click: Click): Promise<void>;
|
|
22
|
+
/**
|
|
23
|
+
* Take over… on a conversation a terminal has open: the card becomes the confirmation that says what taking it over does;
|
|
24
|
+
* nothing starts until its Take over is tapped. A conversation the terminal let go of meanwhile needs no confirmation.
|
|
25
|
+
*/
|
|
26
|
+
takeover(click: Click): Promise<void>;
|
|
27
|
+
/**
|
|
28
|
+
* What a tap that attached the chat leaves: one line saying which session it is in now, then its status card as a NEW message
|
|
29
|
+
* and the tapped card deleted (a phone does not redraw an edit). Where no new card can be sent, the tapped card becomes the
|
|
30
|
+
* status card in place.
|
|
31
|
+
*/
|
|
32
|
+
becomeStatus(click: Click, card: Shown | null): Promise<void>;
|
|
33
|
+
private post;
|
|
34
|
+
private inPlace;
|
|
35
|
+
private removeTapped;
|
|
36
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { Lang } from "../locales/lang.js";
|
|
2
|
+
import type { RemoteState } from "../ports/store/remote.js";
|
|
3
|
+
import { type Conversation, type OutMessage } from "../ports/surface.js";
|
|
4
|
+
import { type AgentCommands, type CommandParts } from "./commands.js";
|
|
5
|
+
import type { Provider } from "./ended.js";
|
|
6
|
+
import type { Settle } from "./permissions.js";
|
|
7
|
+
import type { Prompts } from "./prompt.js";
|
|
8
|
+
import { type Tap } from "./window/closer.js";
|
|
9
|
+
/** One tap: who, with which credential, on which card, and how it ends. */
|
|
10
|
+
export interface Click extends Tap {
|
|
11
|
+
readonly key: string;
|
|
12
|
+
readonly provider: Provider;
|
|
13
|
+
/** The channel's id of the tap (a Send's idempotency). */
|
|
14
|
+
readonly id: string;
|
|
15
|
+
readonly settle: Settle;
|
|
16
|
+
}
|
|
17
|
+
/** The ops a tap may name; anything else is refused. */
|
|
18
|
+
export declare const CLICK_OPS: readonly ["new", "attach", "detach", "close", "mode", "set_mode", "row", "list", "switch", "stop", "takeover", "send", "full", "pair", "hide", "hidden", "unhide"];
|
|
19
|
+
export type ClickOp = (typeof CLICK_OPS)[number];
|
|
20
|
+
export declare function isClickOp(op: string): op is ClickOp;
|
|
21
|
+
/** The taps that only show something or act on the attached session. */
|
|
22
|
+
export declare class SessionClicks {
|
|
23
|
+
private readonly p;
|
|
24
|
+
private readonly commands;
|
|
25
|
+
private readonly prompts;
|
|
26
|
+
constructor(p: CommandParts, commands: AgentCommands, prompts: Prompts);
|
|
27
|
+
lang(click: Click): Lang;
|
|
28
|
+
end(click: Click, card: OutMessage | string, fallback?: string, announce?: boolean): Promise<boolean>;
|
|
29
|
+
/** End a tap with the card it came from again (the sessions card, or the agents card), `lead` on top. */
|
|
30
|
+
home(click: Click, lead: string): Promise<void>;
|
|
31
|
+
/**
|
|
32
|
+
* A tap on the agents card (or the sessions card) that leaves the chat where it is ends with that card again, sent as a NEW
|
|
33
|
+
* message and the tapped one deleted (or closed down to a line pointing at the new one). The chat's status card is never deleted
|
|
34
|
+
* here: a tap that ends on the list from it is answered in place, and so is any tap whose new card could not be sent.
|
|
35
|
+
*/
|
|
36
|
+
repost(click: Click, card: OutMessage, lead?: string): Promise<void>;
|
|
37
|
+
deleted(to: Conversation, id: string): Promise<boolean>;
|
|
38
|
+
/** A tap that did not go through: the status card again when it was one of its buttons and still the chat's, else the list. */
|
|
39
|
+
back(click: Click, lead: string): Promise<void>;
|
|
40
|
+
/** The chat's attachment when the tap is about it (the card names the session); else the tap is answered and null. */
|
|
41
|
+
ownSession(click: Click): Promise<RemoteState | null>;
|
|
42
|
+
/** Connect a new machine: the command as a message of its own, then the agents card again under it, pointing up to it. */
|
|
43
|
+
pair(click: Click): Promise<void>;
|
|
44
|
+
row(click: Click): Promise<void>;
|
|
45
|
+
/** Switch (and Sessions, Refresh): the card that was tapped becomes the list of every session, with no line in the chat. */
|
|
46
|
+
switch(click: Click): Promise<void>;
|
|
47
|
+
stop(click: Click): Promise<void>;
|
|
48
|
+
private closer;
|
|
49
|
+
/** Send on the session card: the card's text box goes to the session; the tap ends at once with the window showing it. */
|
|
50
|
+
send(click: Click): Promise<void>;
|
|
51
|
+
/** Full output: the output the window holds, whole (masked), as messages after the card. */
|
|
52
|
+
full(click: Click): Promise<void>;
|
|
53
|
+
mode(click: Click): Promise<void>;
|
|
54
|
+
setMode(click: Click): Promise<void>;
|
|
55
|
+
detach(click: Click): Promise<void>;
|
|
56
|
+
close(click: Click): Promise<void>;
|
|
57
|
+
list(click: Click): Promise<void>;
|
|
58
|
+
}
|
|
59
|
+
/** One part of the full output as its fenced block holds it: what the rich text drops taken out first (else `https:\x01//` or a
|
|
60
|
+
* fence split by a bidi override would join once it reads them), every address broken in place, no fence that could close it. */
|
|
61
|
+
export declare function fullBlockText(part: string): string;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { Lang } from "../locales/lang.js";
|
|
2
|
+
import { type Conversation, type OutMessage } from "../ports/surface.js";
|
|
3
|
+
import type { StatusBoard } from "./board.js";
|
|
4
|
+
import type { RemoteContext } from "./context.js";
|
|
5
|
+
import type { Provider } from "./ended.js";
|
|
6
|
+
import type { FollowControl } from "./follow/control.js";
|
|
7
|
+
import { type AgentsAnswer, type Lists } from "./lists.js";
|
|
8
|
+
import type { SessionOps } from "./session-ops.js";
|
|
9
|
+
import type { SessionStarts } from "./sessions.js";
|
|
10
|
+
import { type ChatState } from "./state.js";
|
|
11
|
+
import { type Targets } from "./targets.js";
|
|
12
|
+
import { type Watches } from "./watches.js";
|
|
13
|
+
/** One `/agent` command: the chat, the person's credential, where to answer, and what refreshes the credential. */
|
|
14
|
+
export interface CommandCall {
|
|
15
|
+
readonly chatKey: string;
|
|
16
|
+
readonly key: string;
|
|
17
|
+
readonly to: Conversation;
|
|
18
|
+
readonly provider: Provider;
|
|
19
|
+
}
|
|
20
|
+
/** What the commands work with. */
|
|
21
|
+
export interface CommandParts {
|
|
22
|
+
readonly ctx: RemoteContext;
|
|
23
|
+
readonly state: ChatState;
|
|
24
|
+
readonly board: StatusBoard;
|
|
25
|
+
readonly lists: Lists;
|
|
26
|
+
readonly starts: SessionStarts;
|
|
27
|
+
readonly ops: SessionOps;
|
|
28
|
+
readonly targets: Targets;
|
|
29
|
+
readonly watches: Watches;
|
|
30
|
+
readonly follow: FollowControl;
|
|
31
|
+
}
|
|
32
|
+
/** The sentence for an error a remote-agents call ended in, or null when it is none of the expected ones (it is thrown on). */
|
|
33
|
+
export declare function refusalOf(error: unknown, ctx: RemoteContext, lang: Lang): string | null;
|
|
34
|
+
/** A message for what `/agents` shows. */
|
|
35
|
+
export declare function agentsMessage(answer: AgentsAnswer): OutMessage;
|
|
36
|
+
export declare class AgentCommands {
|
|
37
|
+
private readonly p;
|
|
38
|
+
constructor(p: CommandParts);
|
|
39
|
+
private lang;
|
|
40
|
+
private say;
|
|
41
|
+
/** `/agents`; the reasons it cannot be shown are sentences like everywhere else here. */
|
|
42
|
+
agents(call: CommandCall, lead?: string, machines?: boolean): Promise<void>;
|
|
43
|
+
/** `/agent ARGS`. */
|
|
44
|
+
agent(call: CommandCall, args: string): Promise<void>;
|
|
45
|
+
private run;
|
|
46
|
+
private pair;
|
|
47
|
+
private newSession;
|
|
48
|
+
/** Start a session (taking over its conversation, when there is one), say so, and watch for the agent's first word. */
|
|
49
|
+
private start;
|
|
50
|
+
private sessions;
|
|
51
|
+
private attach;
|
|
52
|
+
private detach;
|
|
53
|
+
private mode;
|
|
54
|
+
/** Ask the agent to switch to `mode` (the watch says when it has): why not, or null. */
|
|
55
|
+
changeMode(call: CommandCall, mode: string): Promise<string | null>;
|
|
56
|
+
private close;
|
|
57
|
+
/** The session a person named by its number in the last listing or by its id; null after saying why not. */
|
|
58
|
+
private pickSession;
|
|
59
|
+
private off;
|
|
60
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { Lang } from "../../locales/lang.js";
|
|
2
|
+
import { Setup } from "./setup.js";
|
|
3
|
+
/** A sentence in both languages: [Chinese, English]. */
|
|
4
|
+
export type Pair = readonly [zh: string, en: string];
|
|
5
|
+
/** The release whose Claude agent runs as root with `approval = "never"`; an older connector there refuses every new session. */
|
|
6
|
+
export declare const FIXED_IN: readonly [number, number, number];
|
|
7
|
+
/** The one upgrade command: it installs the new version and restarts the connector on it, under whichever supervisor it has. */
|
|
8
|
+
export declare const UPGRADE: Pair;
|
|
9
|
+
export declare const SANDBOX: Pair;
|
|
10
|
+
export declare const STATUS: Pair;
|
|
11
|
+
/** Codes an older connector hits on a root machine with `approval = "never"`: an upgrade fixes them (see `FIXED_IN`). */
|
|
12
|
+
export declare const OLD_CONNECTOR: ReadonlySet<string>;
|
|
13
|
+
/** Every code that has a sentence of its own. */
|
|
14
|
+
export declare function knownReasons(): string[];
|
|
15
|
+
/** `0.1.4` (or `v0.1.4`, `0.1.5-rc.1`) as [major, minor, patch]; null for anything else. */
|
|
16
|
+
export declare function parseVersion(value: unknown): [number, number, number] | null;
|
|
17
|
+
export declare function isCode(reason: string): boolean;
|
|
18
|
+
/**
|
|
19
|
+
* [Chinese, English] for one reason code: what happened and what to do. An unknown code gets a generic pair that names it.
|
|
20
|
+
* `setup`: the commands of the address this worker reaches Claw at (the login a revoked connector is given).
|
|
21
|
+
*/
|
|
22
|
+
export declare function explain(code: string, version?: unknown, setup?: Setup): Pair;
|
|
23
|
+
/** A reason as given: trimmed, without the full stops at its end. */
|
|
24
|
+
export declare function bareReason(reason: string | null | undefined): string;
|
|
25
|
+
/**
|
|
26
|
+
* The sentence(s) for a reason a connector gave, in `lang` (null: Chinese, then English on the next line). '' for no reason. A
|
|
27
|
+
* reason that is not a code (words, or an internal error withheld) is kept as it is, as a sentence.
|
|
28
|
+
*/
|
|
29
|
+
export declare function describe(reason: string | null | undefined, lang: Lang | null, version?: unknown, setup?: Setup): string;
|
|
30
|
+
/** `lead` ("the session could not start") with the reason after it, as one paragraph in `lang` (null: both, one per line). */
|
|
31
|
+
export declare function ended(lead: Pair, reason: string | null | undefined, lang: Lang | null, version?: unknown, setup?: Setup): string;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How to connect a machine to PrimusClaw and how to upgrade its connector, as the exact commands a person copies.
|
|
3
|
+
*
|
|
4
|
+
* Claw says what to run (`GET /v1/remote-agents/setup`): the npm package, `claw-connector init`, `claw-connector login` with Claw's
|
|
5
|
+
* public API URL and the identity service it signs in with, and `claw-connector service install`. When that route cannot be read
|
|
6
|
+
* (an older Claw), the same commands are made from the address this worker reaches Claw at, and its host's identity service.
|
|
7
|
+
*
|
|
8
|
+
* Nothing here talks to Claw or to a chat.
|
|
9
|
+
*/
|
|
10
|
+
import type { ConnectSteps, ConnectorSetupWords } from "../setup.js";
|
|
11
|
+
import type { Connector } from "../model.js";
|
|
12
|
+
import type { Lang } from "../../locales/lang.js";
|
|
13
|
+
export declare const CONNECTOR_PACKAGE_NAME = "@primusclaw/connector";
|
|
14
|
+
/**
|
|
15
|
+
* Upgrades the connector and restarts it on the new version: a running connector keeps the old code until it is restarted, and
|
|
16
|
+
* `service install` starts it again under whichever supervisor the machine has. The same as Claw's `upgrade_command`.
|
|
17
|
+
*/
|
|
18
|
+
export declare const UPGRADE_COMMAND = "npm install -g @primusclaw/connector@latest && claw-connector stop && claw-connector service install";
|
|
19
|
+
/** `value` as an address fit for a shell command, without a trailing slash; null when it is anything else. */
|
|
20
|
+
export declare function safeUrl(value: unknown): string | null;
|
|
21
|
+
/** The commands that connect a machine: the server it signs in to and the identity service it signs in with. */
|
|
22
|
+
export declare class Setup {
|
|
23
|
+
readonly server: string;
|
|
24
|
+
readonly identityUrl: string | null;
|
|
25
|
+
constructor(server: string, identityUrl: string | null);
|
|
26
|
+
login(): string;
|
|
27
|
+
commands(): string[];
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* The commands Claw gave (`data`, the route's answer), else the ones made from `baseUrl` (the address this worker reaches Claw at)
|
|
31
|
+
* and its host's identity service. What Claw gave is taken only when its server is on that host over the same scheme, and its
|
|
32
|
+
* identity service too (a different one is replaced by that host's): a person is never sent to sign in somewhere else, nor over
|
|
33
|
+
* plain http.
|
|
34
|
+
*/
|
|
35
|
+
export declare function setupFrom(data: unknown, baseUrl: string): Setup;
|
|
36
|
+
/**
|
|
37
|
+
* The one line that pairs a machine, from Claw's answer: rebuilt from its code (only of the shape Claw issues) and its server (only
|
|
38
|
+
* on the host this worker reaches Claw at, as `setupFrom` takes one), so nothing else reaches a shell. Null when either is not so.
|
|
39
|
+
*/
|
|
40
|
+
export declare function pairCommand(data: unknown, baseUrl: string): string | null;
|
|
41
|
+
/** The connect steps, in the order they are shown: what a message or a card is made from. */
|
|
42
|
+
export declare function connectSteps(setup: Setup, lang: Lang, lead?: string): ConnectSteps;
|
|
43
|
+
/** The connect steps as markdown for a rich message: the commands in one code block a person copies whole. */
|
|
44
|
+
export declare function connectMarkdown(setup: Setup, lang: Lang, lead?: string): string;
|
|
45
|
+
export declare function upgradeText(lang: Lang, command?: string): string;
|
|
46
|
+
/**
|
|
47
|
+
* One line under a machine whose connector Claw says is old (`version_status`), with the command that upgrades it; else null. The
|
|
48
|
+
* command is this module's, never text from the connector list.
|
|
49
|
+
*/
|
|
50
|
+
export declare function versionNote(connector: Pick<Connector, "version" | "versionStatus">, lang?: Lang): string | null;
|
|
51
|
+
/** What brings an offline machine back. */
|
|
52
|
+
export declare function offlineHint(lang?: Lang): string;
|
|
53
|
+
/** What the remote-agent views say about connecting a machine, from the commands of the address this worker reaches Claw at. */
|
|
54
|
+
export declare class ConnectorSetup implements ConnectorSetupWords {
|
|
55
|
+
readonly setup: Setup;
|
|
56
|
+
constructor(setup: Setup);
|
|
57
|
+
connectMarkdown(lang: Lang, lead?: string): string;
|
|
58
|
+
connectSteps(lang: Lang, lead?: string): ConnectSteps;
|
|
59
|
+
versionNote(connector: Connector, lang: Lang): string | null;
|
|
60
|
+
offlineHint(lang: Lang): string;
|
|
61
|
+
login(): string;
|
|
62
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import type { RemoteViews } from "./ports.js";
|
|
2
|
+
import type { DirectChat } from "../direct-chat/direct-chat.js";
|
|
3
|
+
import type { ClawRemoteAgentsPort } from "../ports/claw/remote-agents.js";
|
|
4
|
+
import type { JsonObject } from "../json.js";
|
|
5
|
+
import type { Lang } from "../locales/lang.js";
|
|
6
|
+
import type { PublicErrors } from "../public-error/public-errors.js";
|
|
7
|
+
import type { Clock } from "../ports/clock.js";
|
|
8
|
+
import type { Logger } from "../ports/logger.js";
|
|
9
|
+
import type { Random } from "../ports/random.js";
|
|
10
|
+
import type { ConversationRefRepository, PrefsRepository } from "../ports/store/people.js";
|
|
11
|
+
import type { RemotePermissionRepository, RemoteSessionNameRepository, RemoteStateRepository } from "../ports/store/remote.js";
|
|
12
|
+
import type { Conversation } from "../ports/surface.js";
|
|
13
|
+
import type { ConnectorSetup } from "./connector/setup.js";
|
|
14
|
+
import type { FollowReach } from "./follow/speaker.js";
|
|
15
|
+
import type { FollowTimings } from "./follow/timings.js";
|
|
16
|
+
import type { RefusalErrors } from "./refusals.js";
|
|
17
|
+
import type { WindowMode } from "./window/view.js";
|
|
18
|
+
/** The per-person limits of what a remote agent may do without asking (`guardrails`). */
|
|
19
|
+
export type GuardedOperation = "remote_agent" | "approval";
|
|
20
|
+
export interface GuardRefusal {
|
|
21
|
+
/** The sentence the person is told (English unless asked otherwise). */
|
|
22
|
+
text(): string;
|
|
23
|
+
}
|
|
24
|
+
export interface RemoteGuard {
|
|
25
|
+
/** Count one operation, or refuse it (nothing counted). `ticket` names this count for `giveBack`. */
|
|
26
|
+
take(person: string, operation: GuardedOperation, ticket: object, ids?: Readonly<Record<string, string | null>>): GuardRefusal | null;
|
|
27
|
+
giveBack(person: string, operation: GuardedOperation, ticket: object | null): void;
|
|
28
|
+
}
|
|
29
|
+
/** What a person is told of a failure and what goes to the log instead (`public-error`). */
|
|
30
|
+
export interface RemoteErrors extends PublicErrors, RefusalErrors {
|
|
31
|
+
/** The text with a raw error at its end cut off: what may be shown, and the cut error (for the log). */
|
|
32
|
+
splitErrorTail(text: string): {
|
|
33
|
+
readonly kept: string;
|
|
34
|
+
readonly tail: string;
|
|
35
|
+
};
|
|
36
|
+
/** A fresh reference id for a sentence about a failure. */
|
|
37
|
+
newRef(): string;
|
|
38
|
+
}
|
|
39
|
+
export interface RemoteSettings {
|
|
40
|
+
/** Remote agents are on for this deployment. */
|
|
41
|
+
readonly enabled: boolean;
|
|
42
|
+
/** An attached chat hears its session between turns (REMOTE_PUSH_ENABLED). */
|
|
43
|
+
readonly follow: boolean;
|
|
44
|
+
/** Where the chat box goes when its person never said (REMOTE_WINDOW_DEFAULT). */
|
|
45
|
+
readonly windowDefault: WindowMode;
|
|
46
|
+
readonly timings: FollowTimings;
|
|
47
|
+
/** How a watched conversation is followed. */
|
|
48
|
+
readonly watchTimings: FollowTimings;
|
|
49
|
+
/** The assistant's display name. */
|
|
50
|
+
readonly botName: string;
|
|
51
|
+
/** How long `/agent new` waits for the agent's first word, and `/agent mode` for its answer (defaults: 30 s and 10 s). */
|
|
52
|
+
readonly watchSeconds?: {
|
|
53
|
+
readonly start: number;
|
|
54
|
+
readonly mode: number;
|
|
55
|
+
};
|
|
56
|
+
/** A turn is shown in a live stream answering the person's message (the reply style streams here and the channel can). */
|
|
57
|
+
readonly streaming: boolean;
|
|
58
|
+
}
|
|
59
|
+
export interface RemoteContext {
|
|
60
|
+
readonly settings: RemoteSettings;
|
|
61
|
+
readonly claw: ClawRemoteAgentsPort;
|
|
62
|
+
/** The address this worker reaches Claw at: what the commands for a machine are checked against. */
|
|
63
|
+
readonly clawBaseUrl: string;
|
|
64
|
+
/** The connect commands of that address. */
|
|
65
|
+
readonly setup: ConnectorSetup;
|
|
66
|
+
/** The cards and the live view the remote agents show (the view's `createRemoteViews`, given by the assembly). */
|
|
67
|
+
readonly views: RemoteViews;
|
|
68
|
+
readonly remoteState: RemoteStateRepository;
|
|
69
|
+
readonly sessionNames: RemoteSessionNameRepository;
|
|
70
|
+
readonly permissions: RemotePermissionRepository;
|
|
71
|
+
readonly prefs: PrefsRepository;
|
|
72
|
+
readonly references: ConversationRefRepository;
|
|
73
|
+
/** The conversation a stored reference posts to. */
|
|
74
|
+
conversationFor(reference: JsonObject): Conversation;
|
|
75
|
+
/** What to read Claw with for a person with nobody to ask (null: none; throws `CredentialUnavailable` just now). */
|
|
76
|
+
credentialFor(person: string): Promise<string | null>;
|
|
77
|
+
readonly reach: FollowReach;
|
|
78
|
+
readonly guard: RemoteGuard;
|
|
79
|
+
/** One security event (`approval_answered`). */
|
|
80
|
+
audit(event: "approval_answered", fields: Readonly<Record<string, string | number | null>>): void;
|
|
81
|
+
readonly errors: RemoteErrors;
|
|
82
|
+
readonly clock: Clock;
|
|
83
|
+
/**
|
|
84
|
+
* The clock of the remote agents' own paced waits (a turn's live view, a throttled edit of the session card, a retry): `clock`
|
|
85
|
+
* when not given. Tests give a virtual one, so nothing really waits for them.
|
|
86
|
+
*/
|
|
87
|
+
readonly paceClock?: Clock;
|
|
88
|
+
readonly random: Random;
|
|
89
|
+
readonly logger: Logger;
|
|
90
|
+
/** The hex digest of `text` (UTF-8): an idempotency key, a correlation id. */
|
|
91
|
+
digestHex(algorithm: "sha1" | "sha256", text: string): string;
|
|
92
|
+
/** The language a person is answered in. */
|
|
93
|
+
langOf(person: string): Lang;
|
|
94
|
+
/** TEAMS_DIRECT_CHAT: whose 1:1 chat is the agent's window itself. */
|
|
95
|
+
readonly directChat: DirectChat;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* The per-person limits as a chat key reads them (Python's `_PersonGuard`): a group binding's chat key
|
|
99
|
+
* (`person#conversation`) counts against its binder's own allowance, so binding another group is no new allowance.
|
|
100
|
+
*/
|
|
101
|
+
export declare function perPerson(guard: RemoteGuard): RemoteGuard;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { Agent } from "./model.js";
|
|
2
|
+
/** What a connector says about a conversation: no process runs it, a terminal has it open, a session of the chat's holds it. */
|
|
3
|
+
export type ConversationState = "idle" | "live" | "attached" | "unknown";
|
|
4
|
+
/** What a connector says a terminal is doing with a conversation it has open. */
|
|
5
|
+
export type TerminalActivity = "working" | "waiting" | "idle";
|
|
6
|
+
/** One conversation an agent offers, read defensively. */
|
|
7
|
+
export interface Conversation {
|
|
8
|
+
readonly ref: string;
|
|
9
|
+
/** One inert line, "" when the connector gave none. */
|
|
10
|
+
readonly title: string;
|
|
11
|
+
readonly cwd: string;
|
|
12
|
+
/** Seconds since the epoch, or null. */
|
|
13
|
+
readonly updatedAt: number | null;
|
|
14
|
+
readonly state: ConversationState;
|
|
15
|
+
/** Only for one a terminal has open. */
|
|
16
|
+
readonly activity?: TerminalActivity;
|
|
17
|
+
/** What its terminal waits for (only while `activity` is waiting), one inert line. */
|
|
18
|
+
readonly waitingFor?: string;
|
|
19
|
+
/** Its connector types what is sent into that terminal (only for one a terminal has open). */
|
|
20
|
+
readonly input?: "terminal";
|
|
21
|
+
}
|
|
22
|
+
/** What a connector says about a conversation that may be taken over now. */
|
|
23
|
+
export declare const TAKEOVER_STATES: readonly ConversationState[];
|
|
24
|
+
/** Open in a terminal: it can be watched, read-only (the connector shows it and refuses input). */
|
|
25
|
+
export declare const WATCH_STATE: ConversationState;
|
|
26
|
+
/** The conversations an agent offers (newest first, as reported), at most twelve. An entry without a usable `ref` or `cwd` is
|
|
27
|
+
* dropped, a repeated ref is kept once, and a state that is none of the four is "unknown". */
|
|
28
|
+
export declare function resumableOf(agent: Agent): Conversation[];
|
|
29
|
+
/** Its terminal waits for its person. */
|
|
30
|
+
export declare function needsYou(entry: Conversation): boolean;
|
|
31
|
+
/** A subfolder typed under a root as `a/b` (separators `/` or `\`, `.` parts dropped); "" when nothing was typed; null for anything
|
|
32
|
+
* that is not a plain path below the root: absolute, `~`, a drive, a `..` part, a control character, too long. */
|
|
33
|
+
export declare function cleanSubfolder(text: unknown): string | null;
|
|
34
|
+
/** `root` with `sub` below it, with the separator the root itself uses. */
|
|
35
|
+
export declare function joinPath(root: string, sub: string): string;
|
|
36
|
+
/** The conversations of an agent its owner hid (`hidden: true`, in a listing with them included), read as `resumableOf` reads them. */
|
|
37
|
+
export declare function hiddenOf(agent: Agent): Conversation[];
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type Pair } from "./connector/reasons.js";
|
|
2
|
+
import type { RemoteContext } from "./context.js";
|
|
3
|
+
import type { Lists } from "./lists.js";
|
|
4
|
+
import type { ChatState } from "./state.js";
|
|
5
|
+
/** What reads Claw for a person now: their key, or what a provider gives (an exchanged token). */
|
|
6
|
+
export type Provider = (() => Promise<string>) | undefined;
|
|
7
|
+
export declare function credentialOf(key: string, provider: Provider): Promise<string>;
|
|
8
|
+
export declare class EndedWords {
|
|
9
|
+
private readonly ctx;
|
|
10
|
+
private readonly state;
|
|
11
|
+
private readonly lists;
|
|
12
|
+
constructor(ctx: RemoteContext, state: ChatState, lists: Lists);
|
|
13
|
+
/**
|
|
14
|
+
* The version the machine's connector reports, when the reason is one an upgrade fixes and Claw says it; null otherwise (the
|
|
15
|
+
* sentence then offers the upgrade, which cannot hurt).
|
|
16
|
+
*/
|
|
17
|
+
connectorVersion(key: string, provider: Provider, connectorId: string, reason: string | null): Promise<string | null>;
|
|
18
|
+
/** `lead` with the reason after it, in the chat's language, the version read when an upgrade would fix it. */
|
|
19
|
+
said(chatKey: string, lead: Pair, key: string, provider: Provider, connectorId: string, reason: string): Promise<string>;
|
|
20
|
+
/**
|
|
21
|
+
* The paragraph that says a session ended and why; `follow`: told while the chat was idle (its messages go to the assistant
|
|
22
|
+
* again).
|
|
23
|
+
*/
|
|
24
|
+
sessionEnded(chatKey: string, key: string, provider: Provider, connectorId: string, reason: string, follow?: boolean): Promise<string>;
|
|
25
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type { SseEvent } from "../claw/model.js";
|
|
2
|
+
import type { PublicErrors } from "../public-error/public-errors.js";
|
|
3
|
+
export interface ToolUpdate {
|
|
4
|
+
readonly id: string;
|
|
5
|
+
readonly title: string;
|
|
6
|
+
readonly status: string;
|
|
7
|
+
}
|
|
8
|
+
/** What the runner does after one event. Every field but the flags is null when the event does not say it. */
|
|
9
|
+
export interface RemoteStep {
|
|
10
|
+
readonly chunk: {
|
|
11
|
+
readonly kind: "message" | "thought";
|
|
12
|
+
readonly text: string;
|
|
13
|
+
} | null;
|
|
14
|
+
readonly tool: ToolUpdate | null;
|
|
15
|
+
/** One line saying where the plan stands. */
|
|
16
|
+
readonly plan: string | null;
|
|
17
|
+
/** A permissionRequest's payload, to turn into a card. */
|
|
18
|
+
readonly permission: Readonly<Record<string, unknown>> | null;
|
|
19
|
+
/** A permission_resolved payload: another client answered. */
|
|
20
|
+
readonly resolved: Readonly<Record<string, unknown>> | null;
|
|
21
|
+
readonly mode: string | null;
|
|
22
|
+
readonly modes: readonly string[] | null;
|
|
23
|
+
/** The session, as it is now, does not ask before a step. */
|
|
24
|
+
readonly unattended: boolean | null;
|
|
25
|
+
/** Mode id -> whether selecting it makes the session unattended, for the modes that say. */
|
|
26
|
+
readonly modeFlags: Readonly<Record<string, boolean>> | null;
|
|
27
|
+
/** One line for the view (a resume, a mode change, an error). */
|
|
28
|
+
readonly note: string | null;
|
|
29
|
+
readonly started: boolean;
|
|
30
|
+
/** The turn is over. */
|
|
31
|
+
readonly finished: boolean;
|
|
32
|
+
readonly stopReason: string;
|
|
33
|
+
/** The session ended: the reason, "" when none was given. */
|
|
34
|
+
readonly closed: string | null;
|
|
35
|
+
/** A command the connector refused. */
|
|
36
|
+
readonly rejected: {
|
|
37
|
+
readonly type: string;
|
|
38
|
+
readonly reason: string;
|
|
39
|
+
} | null;
|
|
40
|
+
/** An event of history the agent replayed: never shown as new. */
|
|
41
|
+
readonly replay: boolean;
|
|
42
|
+
/** The session only watches a conversation open in a terminal. */
|
|
43
|
+
readonly readOnly: boolean | null;
|
|
44
|
+
/** The connector restarted and the session is back. */
|
|
45
|
+
readonly recovered: {
|
|
46
|
+
readonly interrupted: boolean;
|
|
47
|
+
readonly continuing: boolean;
|
|
48
|
+
} | null;
|
|
49
|
+
/** A message for a terminal's conversation waits for that terminal (the connector's reason). */
|
|
50
|
+
readonly queued: string | null;
|
|
51
|
+
/** What the person typed at the terminal of a conversation shared with the chat. */
|
|
52
|
+
readonly typed: string | null;
|
|
53
|
+
/** What is sent is typed into a terminal on the machine (`input: "terminal"`). */
|
|
54
|
+
readonly terminal: boolean | null;
|
|
55
|
+
/** That terminal's permission mode as its connector read it at the start. */
|
|
56
|
+
readonly terminalMode: string | null;
|
|
57
|
+
/** The conversation id the agent runs the session under on the machine. */
|
|
58
|
+
readonly acp: string | null;
|
|
59
|
+
}
|
|
60
|
+
export declare const NOTHING: RemoteStep;
|
|
61
|
+
/** A step that says only `fields`. */
|
|
62
|
+
export declare function remoteStep(fields?: Partial<RemoteStep>): RemoteStep;
|
|
63
|
+
/** One SSE frame of a remote session to what the runner does. What cannot be read is skipped (usage_update, history_complete
|
|
64
|
+
* and every type this client does not know are nothing). */
|
|
65
|
+
export declare function decode(event: SseEvent, errors: PublicErrors): RemoteStep;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reading one field of an untrusted JSON object (a connector's report, an agent's event, a card's data) the way the Python worker
|
|
3
|
+
* read its dicts: text is what is there, nothing for a missing, empty, false or zero value.
|
|
4
|
+
*/
|
|
5
|
+
export declare function textOf(value: unknown): string;
|
|
6
|
+
/** An object field as a record, or null for anything else. */
|
|
7
|
+
export declare function recordOf(value: unknown): Readonly<Record<string, unknown>> | null;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { RemoteContext } from "../context.js";
|
|
2
|
+
import type { StatusBoard } from "../board.js";
|
|
3
|
+
import type { ChatState } from "../state.js";
|
|
4
|
+
/** How the follower says a session's end and shows a permission request (the domain's own sentences and cards). */
|
|
5
|
+
export interface FollowHooks {
|
|
6
|
+
describeEnd(chatKey: string, connectorId: string, reason: string): Promise<string>;
|
|
7
|
+
showPermission(chatKey: string, sessionId: string, request: Readonly<Record<string, unknown>>, to: import("../../ports/surface.js").Conversation): Promise<void>;
|
|
8
|
+
}
|
|
9
|
+
export declare class FollowControl {
|
|
10
|
+
private readonly ctx;
|
|
11
|
+
private readonly state;
|
|
12
|
+
private readonly board;
|
|
13
|
+
private readonly hooks;
|
|
14
|
+
constructor(ctx: RemoteContext, state: ChatState, board: StatusBoard, hooks: FollowHooks);
|
|
15
|
+
/** An attached chat hears its session between turns: what the session says shows there by itself. */
|
|
16
|
+
get follows(): boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Make sure an attached chat has its reader, unless a turn or a short watch is reading the session. `active`: the agent was seen
|
|
19
|
+
* at work just now, so `/stop` reaches it before its next event. `steps`, `asks`: the steps still running and the permission
|
|
20
|
+
* requests still waiting at that moment.
|
|
21
|
+
*/
|
|
22
|
+
ensure(chatKey: string, active?: boolean, steps?: readonly string[], asks?: readonly string[]): void;
|
|
23
|
+
/** The chat has left its session (or something else is about to read it): the reader goes, with what it had not said. */
|
|
24
|
+
drop(chatKey: string): void;
|
|
25
|
+
/** Stop the reader before a message goes to the agent, with what it has read delivered: true when there was one to stop. */
|
|
26
|
+
stop(chatKey: string): Promise<boolean>;
|
|
27
|
+
/** The chat leaves its session. */
|
|
28
|
+
detach(chatKey: string): void;
|
|
29
|
+
/** Follow every chat that is attached: a worker that starts delivers what its agents said while it was away, once. */
|
|
30
|
+
resume(): void;
|
|
31
|
+
shutdown(): void;
|
|
32
|
+
/**
|
|
33
|
+
* TEAMS_DIRECT_CHAT is on for this person: an attachment that still has the session card as its window is moved to the chat,
|
|
34
|
+
* here and in the store, so nothing reads it as a card any more (the card itself is left where it is).
|
|
35
|
+
*/
|
|
36
|
+
chatIsWindow(chatKey: string): void;
|
|
37
|
+
/** The chats of a person: their 1:1 chat and every group chat they bound to a session. */
|
|
38
|
+
chatsOf(person: string): string[];
|
|
39
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import type { SseEvent } from "../../claw/model.js";
|
|
2
|
+
import type { RemotePermissionRepository } from "../../ports/store/remote.js";
|
|
3
|
+
import { type RemoteStep } from "../events.js";
|
|
4
|
+
import { type RemoteTurnState } from "../turn-state.js";
|
|
5
|
+
import { type SpeakerDeps } from "./speaker.js";
|
|
6
|
+
/**
|
|
7
|
+
* What the reader reads with could not be had just now (the identity service is down) and there is no other credential: not the
|
|
8
|
+
* same as having none. The reader waits and asks again; a credential that is null is a person who has none (unlinked), and ends it.
|
|
9
|
+
*/
|
|
10
|
+
export declare class CredentialUnavailable extends Error {
|
|
11
|
+
readonly name = "CredentialUnavailable";
|
|
12
|
+
}
|
|
13
|
+
export interface FollowerDeps extends SpeakerDeps {
|
|
14
|
+
readonly permissions: RemotePermissionRepository;
|
|
15
|
+
/** The session's events after a cursor, live; ends when the stream ends; throws `ClawError` or a transport error. */
|
|
16
|
+
stream(key: string, sessionId: string, after: string | undefined, signal: AbortSignal): AsyncIterable<SseEvent>;
|
|
17
|
+
/** What to read with (null: nobody to read for; throws `CredentialUnavailable` when it cannot be had just now). */
|
|
18
|
+
credential(): Promise<string | null>;
|
|
19
|
+
newTurn(): RemoteTurnState;
|
|
20
|
+
}
|
|
21
|
+
/** The event says something of the session's permission modes. */
|
|
22
|
+
export declare function saysModes(step: RemoteStep): boolean;
|
|
23
|
+
/** The reader of one attached chat's session, for as long as no turn reads it. */
|
|
24
|
+
export declare class Follower {
|
|
25
|
+
readonly chatKey: string;
|
|
26
|
+
readonly sessionId: string;
|
|
27
|
+
private readonly deps;
|
|
28
|
+
private readonly speaker;
|
|
29
|
+
private readonly cancel;
|
|
30
|
+
private readonly stopped;
|
|
31
|
+
private flushOnStop;
|
|
32
|
+
private doneTurn;
|
|
33
|
+
private readonly active;
|
|
34
|
+
private readonly asks;
|
|
35
|
+
private cursor;
|
|
36
|
+
private handled;
|
|
37
|
+
private lastEvent;
|
|
38
|
+
private pauseOverAfter;
|
|
39
|
+
private inbox;
|
|
40
|
+
private task;
|
|
41
|
+
private finished;
|
|
42
|
+
constructor(chatKey: string, sessionId: string, deps: FollowerDeps);
|
|
43
|
+
get alive(): boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Begin reading. `active`: the agent was at work a moment ago (`busy` says so until `quiet` has passed with no event). `steps`
|
|
46
|
+
* and `asks`: the steps that had begun and the permission requests nobody had answered when the chat attached: `busy` says so
|
|
47
|
+
* until their own end (or answer) is read. They do not hold back the text that comes after.
|
|
48
|
+
*/
|
|
49
|
+
start(active?: boolean, steps?: Iterable<string>, asks?: Iterable<string>): void;
|
|
50
|
+
/** Stop reading and forget what was waiting: the chat has left the session. */
|
|
51
|
+
drop(): void;
|
|
52
|
+
/**
|
|
53
|
+
* Stop reading, and (`flush`) deliver the text that waits, whoever may be woken: called when the person has just written.
|
|
54
|
+
* Returns when the reader is gone.
|
|
55
|
+
*/
|
|
56
|
+
stop(flush?: boolean): Promise<void>;
|
|
57
|
+
/** The chat left the session: the reader goes, with nothing more said. */
|
|
58
|
+
private cancelled;
|
|
59
|
+
/** The person wrote: the reader stops, with what it read delivered. */
|
|
60
|
+
private stopping;
|
|
61
|
+
/** The agent is, as far as can be told, working on its own now (what `/stop` should reach). */
|
|
62
|
+
busy(): boolean;
|
|
63
|
+
private guarded;
|
|
64
|
+
private run;
|
|
65
|
+
/** The credential; undefined when it cannot be had just now. */
|
|
66
|
+
private readCredential;
|
|
67
|
+
/** One stream, read until it ends, the reader is stopped, or there is nothing left to read. */
|
|
68
|
+
private readOnce;
|
|
69
|
+
/** Wait before reading again, longer for each failure in a row, and no longer than it takes to be stopped. */
|
|
70
|
+
private wait;
|
|
71
|
+
/** The session's events into the inbox, so the reader can also wait for the end of a pause. */
|
|
72
|
+
private pump;
|
|
73
|
+
/** Events and the ends of pauses, until the stream ends ('again'), the reader is stopped ('stop'), or nothing is left ('done'). */
|
|
74
|
+
private consume;
|
|
75
|
+
private failure;
|
|
76
|
+
private dueContext;
|
|
77
|
+
/** Fold one event in. False when the reader has nothing more to do. */
|
|
78
|
+
private handle;
|
|
79
|
+
private askOrResolve;
|
|
80
|
+
/** What is said between two stretches of the agent's text: a prompt typed at the terminal, the connector coming back. */
|
|
81
|
+
private sayBetween;
|
|
82
|
+
private advance;
|
|
83
|
+
private flush;
|
|
84
|
+
private persist;
|
|
85
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Clock } from "../../ports/clock.js";
|
|
2
|
+
/** What `Inbox.next` gives when its wait ran out with nothing in it. */
|
|
3
|
+
export declare const TIMED_OUT: unique symbol;
|
|
4
|
+
/**
|
|
5
|
+
* A queue one reader waits on, for an item or the end of a pause (`next` with a timeout), whichever comes first. A wait that runs
|
|
6
|
+
* out never takes an item away: the next `next` gets it.
|
|
7
|
+
*/
|
|
8
|
+
export declare class Inbox<T> {
|
|
9
|
+
private readonly clock;
|
|
10
|
+
private readonly items;
|
|
11
|
+
private wake;
|
|
12
|
+
constructor(clock: Clock);
|
|
13
|
+
push(item: T): void;
|
|
14
|
+
/** The next item, or `TIMED_OUT` after `timeoutMs` (null: wait for an item however long). */
|
|
15
|
+
next(timeoutMs: number | null): Promise<T | typeof TIMED_OUT>;
|
|
16
|
+
}
|