@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,166 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A 1:1 chat that talks to the person's one assistant in Claw instead of to a session (teams_agent/assistant.py, the chat half).
|
|
3
|
+
*
|
|
4
|
+
* With the assistant on for a person, their message goes to the assistant and returns at once: nothing waits for an answer and
|
|
5
|
+
* nothing locks the chat. What the assistant says comes back later as an `assistant.say` notification (proactive). The message
|
|
6
|
+
* opens a receipt under it ("Got it, working on it…") that the turn's steps move and the reply closes.
|
|
7
|
+
*/
|
|
8
|
+
import type { JsonObject } from "../json.js";
|
|
9
|
+
import type { Lang } from "../locales/lang.js";
|
|
10
|
+
import type { ClawAssistantPort, ClawSessionsPort } from "../ports/claw/index.js";
|
|
11
|
+
import type { Clock } from "../ports/clock.js";
|
|
12
|
+
import type { Logger } from "../ports/logger.js";
|
|
13
|
+
import type { Random } from "../ports/random.js";
|
|
14
|
+
import type { StorePort } from "../ports/store/index.js";
|
|
15
|
+
import type { Conversation, InboundFile } from "../ports/surface.js";
|
|
16
|
+
import type { DirectChat } from "../direct-chat/direct-chat.js";
|
|
17
|
+
import { type MessageFiles } from "./files.js";
|
|
18
|
+
import { type StepLabel } from "./follow.js";
|
|
19
|
+
import type { Receipts } from "./receipts.js";
|
|
20
|
+
/** A Claw that answers "no assistant here" is not asked again for this long. */
|
|
21
|
+
export declare const OFF_SECONDS = 60;
|
|
22
|
+
/** Each string of an attached session told to the assistant is at most this long (understanding.CONTEXT_TEXT_MAX). */
|
|
23
|
+
export declare const CONTEXT_TEXT_MAX = 200;
|
|
24
|
+
export type ChatStore = Pick<StorePort, "now" | "prefs" | "sessions" | "remoteState"> & {
|
|
25
|
+
readonly links: Pick<StorePort["links"], "clawUserIdOf">;
|
|
26
|
+
};
|
|
27
|
+
/** The reply style's switches the assistant reads (style.py). */
|
|
28
|
+
export interface AssistantStyle {
|
|
29
|
+
readonly assistantProgress: boolean;
|
|
30
|
+
readonly assistantStreamSay: boolean;
|
|
31
|
+
}
|
|
32
|
+
export interface AssistantChatOptions {
|
|
33
|
+
readonly store: ChatStore;
|
|
34
|
+
readonly claw: {
|
|
35
|
+
readonly assistant: Pick<ClawAssistantPort, "session" | "send">;
|
|
36
|
+
readonly sessions: Pick<ClawSessionsPort, "turn" | "interrupt" | "stream" | "uploadFiles">;
|
|
37
|
+
};
|
|
38
|
+
/** Whether the person's subscription has the assistant's events (`Subscriptions.hasAssistantTypes`); undefined: no notifications. */
|
|
39
|
+
readonly hasAssistantTypes: ((userId: string) => boolean) | undefined;
|
|
40
|
+
readonly receipts: Receipts;
|
|
41
|
+
readonly directChat: DirectChat;
|
|
42
|
+
readonly clock: Clock;
|
|
43
|
+
readonly random: Random;
|
|
44
|
+
readonly logger: Logger;
|
|
45
|
+
readonly stepLabel: StepLabel;
|
|
46
|
+
readonly style: () => AssistantStyle;
|
|
47
|
+
/** ASSISTANT_ENABLED. */
|
|
48
|
+
readonly enabled: boolean;
|
|
49
|
+
/** ASSISTANT_USERS, lower case (empty: everybody the switch is on for). */
|
|
50
|
+
readonly users: ReadonlySet<string>;
|
|
51
|
+
/** TEAMS_ASSISTANT_UNDERSTANDING_USERS, lower case (empty: nobody). */
|
|
52
|
+
readonly understanding: ReadonlySet<string>;
|
|
53
|
+
/** CLAW_PLUGIN_ID: named on each message; undefined for none. */
|
|
54
|
+
readonly pluginId: number | undefined;
|
|
55
|
+
/** A chat turn of the old kind is running for this person: it is let finish. */
|
|
56
|
+
readonly legacyTurn: (userId: string) => boolean;
|
|
57
|
+
readonly files: MessageFiles | undefined;
|
|
58
|
+
readonly onFilesDropped: (path: string, count: number) => void;
|
|
59
|
+
/** The locale of the client the message being handled came from ("" none). */
|
|
60
|
+
readonly clientLocale?: () => string;
|
|
61
|
+
/** `/board` (assistant.py `board`). */
|
|
62
|
+
readonly board: {
|
|
63
|
+
show(userId: string, credential: string, conversation: Conversation): Promise<void>;
|
|
64
|
+
};
|
|
65
|
+
/** The router's reading of commands (commands.py parse_command, command_args). */
|
|
66
|
+
readonly commands: {
|
|
67
|
+
parse(text: string): string | undefined;
|
|
68
|
+
args(text: string, name: string): string | undefined;
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
/** Told (session id, message id; null when Claw queued it) once Claw has taken a message (the Stop card of a phone's message). */
|
|
72
|
+
export type OnSent = (sessionId: string, messageId: string | null) => void;
|
|
73
|
+
export declare class AssistantChat {
|
|
74
|
+
private readonly o;
|
|
75
|
+
private offUntil;
|
|
76
|
+
private readonly switched;
|
|
77
|
+
constructor(o: AssistantChatOptions);
|
|
78
|
+
/** The assistant is on for this person: the switch is on, and they are listed (an empty list is everybody). */
|
|
79
|
+
forUser(userId: string): boolean;
|
|
80
|
+
/**
|
|
81
|
+
* This person's 1:1 chat talks to the assistant: it is on for them, the assistant can reach them, Claw has an assistant, and no
|
|
82
|
+
* turn of the old kind is still running for them.
|
|
83
|
+
*/
|
|
84
|
+
on(userId: string): boolean;
|
|
85
|
+
/** Every 1:1 message of this person that is not an exact command goes to their assistant first. */
|
|
86
|
+
understands(userId: string): boolean;
|
|
87
|
+
/** The assistant can answer this person: their subscription has its events and their Claw user id is known. */
|
|
88
|
+
reachable(userId: string): boolean;
|
|
89
|
+
forget(userId: string): void;
|
|
90
|
+
/** What a message of files and no words says to the assistant. */
|
|
91
|
+
filesOnly(lang: Lang): string;
|
|
92
|
+
private langOf;
|
|
93
|
+
/**
|
|
94
|
+
* A message of a person the assistant understands, with the chat's context. True when the assistant has it; otherwise the
|
|
95
|
+
* person was told it could not be reached and nothing else was done with it.
|
|
96
|
+
*/
|
|
97
|
+
understand(request: {
|
|
98
|
+
userId: string;
|
|
99
|
+
credential: string;
|
|
100
|
+
modelKey: string;
|
|
101
|
+
prompt: string;
|
|
102
|
+
context: JsonObject;
|
|
103
|
+
lang: Lang;
|
|
104
|
+
conversation: Conversation;
|
|
105
|
+
files: readonly InboundFile[];
|
|
106
|
+
onSent?: OnSent;
|
|
107
|
+
}): Promise<boolean>;
|
|
108
|
+
/**
|
|
109
|
+
* A 1:1 message that is not a command. True: the assistant has it (or the person was told it could not be sent). False: it is
|
|
110
|
+
* for a session, as before. `attached` (only where remote agents are on) is told as `channel_context.attached`.
|
|
111
|
+
*/
|
|
112
|
+
route(request: {
|
|
113
|
+
userId: string;
|
|
114
|
+
credential: string;
|
|
115
|
+
prompt: string;
|
|
116
|
+
conversation: Conversation;
|
|
117
|
+
files: readonly InboundFile[];
|
|
118
|
+
attached?: JsonObject | null;
|
|
119
|
+
onSent?: OnSent;
|
|
120
|
+
}): Promise<boolean>;
|
|
121
|
+
/**
|
|
122
|
+
* Does this message go to the assistant? A person's first one does only when the session they had in Claw is not busy (that
|
|
123
|
+
* work finishes where it started); after that it always does. A Claw that cannot say keeps the old path for now.
|
|
124
|
+
*/
|
|
125
|
+
private takes;
|
|
126
|
+
/** Hand the message to the assistant and return: false when this Claw has no assistant (the caller carries on the old way). */
|
|
127
|
+
private sayTo;
|
|
128
|
+
/**
|
|
129
|
+
* Acknowledge the message (receipt or typing), follow its turn into the receipt, and send it with `send` (given the assistant's
|
|
130
|
+
* session id, and `ready`, which `send` awaits just before the message goes to Claw, after its files). The turn in front of
|
|
131
|
+
* the message is read beside the receipt being opened, so that only the message's own turn closes its receipt; `ready` waits
|
|
132
|
+
* for it, then starts following the turn and waits (at most FOLLOW_OPEN_SECONDS) until Claw has answered the stream's request:
|
|
133
|
+
* the requests to Claw come in one order (the turn in front, the stream, the message), and a turn Claw starts at once cannot
|
|
134
|
+
* say its first step before the stream is there. `ok` when the assistant has it; otherwise Claw's refusal (undefined when it
|
|
135
|
+
* did not answer).
|
|
136
|
+
*/
|
|
137
|
+
private handTo;
|
|
138
|
+
/** Tell `onSent` that Claw took a message; what it does with that never fails the message. */
|
|
139
|
+
private tellSent;
|
|
140
|
+
private handOverFiles;
|
|
141
|
+
/** Follow the turn that answers this message into its receipt: undefined without a receipt or with progress off. */
|
|
142
|
+
private follow;
|
|
143
|
+
/**
|
|
144
|
+
* The person sees at once that their message was taken: the receipt under it, or (none can be opened) the typing indicator.
|
|
145
|
+
* Never fails the message. In a chat that is an agent's window the receipt's words start with Clawy's head.
|
|
146
|
+
*/
|
|
147
|
+
private acknowledge;
|
|
148
|
+
private attachedReader;
|
|
149
|
+
/** The message did not reach the assistant: said in the receipt's place when one is open (it closes it), else as a message. */
|
|
150
|
+
private notTaken;
|
|
151
|
+
/**
|
|
152
|
+
* What to say to `/new`, `/sessions` and `/repo`, which the assistant makes needless (it keeps one conversation and a task of its
|
|
153
|
+
* own for each thing asked), in the chat's language (the router's `said_in`); undefined for anything else. Nothing is done.
|
|
154
|
+
*/
|
|
155
|
+
hiddenCommand(said: string, lang: Lang): string | undefined;
|
|
156
|
+
/** `/board`: the person's work items, and a card for each one that waits for them. */
|
|
157
|
+
board(userId: string, credential: string, conversation: Conversation): Promise<void>;
|
|
158
|
+
/**
|
|
159
|
+
* `/stop`: interrupts what the assistant is doing this moment; a task is stopped by name. `onlyMessage`: interrupt only while
|
|
160
|
+
* Claw's running turn answers that message (a Stop card's turn, read just before the interrupt goes); false, with nothing said
|
|
161
|
+
* or interrupted, when it does not.
|
|
162
|
+
*/
|
|
163
|
+
stop(_userId: string, credential: string, conversation: Conversation, onlyMessage?: string): Promise<boolean>;
|
|
164
|
+
}
|
|
165
|
+
/** The session a chat is attached to as the assistant is told it: its text and yes/no fields, each text clipped. */
|
|
166
|
+
export declare function attachedOf(attached: JsonObject | null): JsonObject | null;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export declare const CITATION_NAME_MAX = 80;
|
|
2
|
+
export declare const SOURCE_URL_MAX = 2048;
|
|
3
|
+
/** What of a title is read at all (Claw sends at most 80 code points): bounded work, whatever comes. */
|
|
4
|
+
export declare const SOURCE_TITLE_INPUT_MAX = 1000;
|
|
5
|
+
/** `urlsplit(url).hostname` of an address `sourceUrl` accepted. */
|
|
6
|
+
export declare function hostnameOf(url: string): string | undefined;
|
|
7
|
+
/** `urllib.parse.unquote_plus`: `+` is a space, `%XX` is decoded in each ASCII run, anything else kept. */
|
|
8
|
+
export declare function unquotePlus(text: string): string;
|
|
9
|
+
/**
|
|
10
|
+
* `raw` when it can be a source's link: an absolute http(s) address with a host, no credentials (neither in it as a
|
|
11
|
+
* user nor as a query or fragment parameter), no whitespace, control, format or markup character (`<>"'` and the like),
|
|
12
|
+
* nothing a credential mask would touch, at most SOURCE_URL_MAX characters. Undefined otherwise.
|
|
13
|
+
*/
|
|
14
|
+
export declare function sourceUrl(raw: unknown): string | undefined;
|
|
15
|
+
/**
|
|
16
|
+
* A source's title as a citation shows it: one plain line, without markup, tags, character references, a leading
|
|
17
|
+
* heading, list or quote marker, addresses, token-like runs or hidden characters, at most CITATION_NAME_MAX characters,
|
|
18
|
+
* masked before and after; the host when nothing is left.
|
|
19
|
+
*/
|
|
20
|
+
export declare function sourceName(raw: unknown, host: string): string;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Teams citations of an assistant reply: the `sources` of an `assistant.say` (`[{n, url, title, kind}]`, which Claw
|
|
3
|
+
* sends only from the turn's own lookups) become one source card each for the `[n]` its text writes. The text itself is
|
|
4
|
+
* never changed (its words may already be on screen, streamed).
|
|
5
|
+
*
|
|
6
|
+
* Lengths and cuts count code points, white space is Python's `str.isspace`, and the patterns read Unicode the way the
|
|
7
|
+
* Python worker's `re` does (`\w`, `\d`, `\b` and IGNORECASE over all of Unicode). The address handling follows
|
|
8
|
+
* `urllib.parse.urlsplit` itself rather than the WHATWG `URL`, which normalises (lower-cases, punycodes, resolves dots,
|
|
9
|
+
* percent-encodes) where `urlsplit` only splits; `citation-sources.ts` has it.
|
|
10
|
+
*/
|
|
11
|
+
import type { Citation } from "../ports/surface.js";
|
|
12
|
+
export { CITATION_NAME_MAX, SOURCE_TITLE_INPUT_MAX, SOURCE_URL_MAX, sourceName } from "./citation-sources.js";
|
|
13
|
+
/** Teams shows at most 20 citations on a message. */
|
|
14
|
+
export declare const CITATIONS_MAX = 20;
|
|
15
|
+
export declare const CITATION_ABSTRACT_MAX = 160;
|
|
16
|
+
/** What a source's `kind` is shown as on its card; any other kind is "Source". */
|
|
17
|
+
export declare const SOURCE_KINDS: ReadonlyMap<string, string>;
|
|
18
|
+
/** `text` with markdown's backslash escapes resolved (`\-` is `-`), as a renderer reads it. */
|
|
19
|
+
export declare function unescapeMarkdown(text: string): string;
|
|
20
|
+
/** Whether the text can make a link, read as it is shown: with its backslash escapes resolved (`www\.x` is `www.x`). */
|
|
21
|
+
export declare function makesLink(text: string): boolean;
|
|
22
|
+
/**
|
|
23
|
+
* The numbers the text cites as `[n]` on their own, outside every bracket, and none at all in a text that can make a
|
|
24
|
+
* link (`makesLink`): the router is told to put addresses in `sources` and never in the text, so no `[n]` can be, or be
|
|
25
|
+
* inside, a link to an address of the model's. An escaped bracket is no bracket; an unclosed `[` leaves what follows it
|
|
26
|
+
* uncited. (UTF-16 units: an escape that skips the first half of a surrogate pair lands on the second, which is no
|
|
27
|
+
* bracket, so it skips the same code point Python does.)
|
|
28
|
+
*/
|
|
29
|
+
export declare function citedNumbers(text: string): Set<number>;
|
|
30
|
+
/**
|
|
31
|
+
* The Teams citations of an assistant reply: one per source it carries (`[{n, url, title, kind}]`) whose `[n]` the
|
|
32
|
+
* text has, in number order, at most CITATIONS_MAX. A source that is not well formed, repeats a number or is not cited
|
|
33
|
+
* in the text is left out.
|
|
34
|
+
*
|
|
35
|
+
* One difference from Python, which JSON parsing makes: `{"n": 1.0}` is a float there (refused) and the number 1 here
|
|
36
|
+
* (accepted).
|
|
37
|
+
*/
|
|
38
|
+
export declare function citationsFromSources(text: string, sources: unknown): Citation[];
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Lang } from "../locales/lang.js";
|
|
2
|
+
type Fields = Readonly<Record<string, unknown>>;
|
|
3
|
+
/** An ISO time as the person reads it: their wall clock in the trigger's timezone, `2026-11-07 09:00` (else the text as sent). */
|
|
4
|
+
export declare function localTime(at: unknown, zone: string): string;
|
|
5
|
+
/** What came of a press on a drafted comment's card, or undefined for what every card says alike (answered before, lapsed). */
|
|
6
|
+
export declare function commentOutcome(out: Fields, lang: Lang): string | undefined;
|
|
7
|
+
/** What came of a press on an instruction card (`devenv_send`): sent, as which item, or why not. */
|
|
8
|
+
export declare function devenvSendOutcome(status: string, out: Fields, lang: Lang): string;
|
|
9
|
+
/** What came of a press on a held write's card of `kind`, in one line: Claw's answer said plainly. */
|
|
10
|
+
export declare function confirmOutcome(kind: string, out: Fields, lang: Lang): string;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What an assistant event asks of the chat beyond its words (teams_agent/assistant.py): a command it puts to the person
|
|
3
|
+
* (`confirm_action`), a write Claw holds for them (`confirm_write`), the replies to tap under it (`suggested_replies`), a pull
|
|
4
|
+
* request a result names, and what it says of an agent session on the person's machine (`remote`, proactive.py). Every field is
|
|
5
|
+
* Claw's and is read defensively: anything not of the expected shape is as if absent.
|
|
6
|
+
*/
|
|
7
|
+
import type { Lang } from "../locales/lang.js";
|
|
8
|
+
import type { SuggestedReply } from "../direct-chat/direct-chat.js";
|
|
9
|
+
/** A result's words that link a pull request: its card offers to watch it. */
|
|
10
|
+
export declare const PULL_LINK: RegExp;
|
|
11
|
+
/** Code points of one of Claw's suggested replies (Claw sends at most 30): a button's few words. */
|
|
12
|
+
export declare const SUGGESTED_REPLY_MAX = 30;
|
|
13
|
+
/** Teams shows the first three suggested replies only. */
|
|
14
|
+
export declare const SUGGESTIONS_MAX = 3;
|
|
15
|
+
/** The writes Claw holds for the person that this worker draws as a card. */
|
|
16
|
+
export declare const CONFIRM_KINDS: readonly ["trigger_create", "trigger_cancel", "devenv_send", "github_comment", "devenv_hide"];
|
|
17
|
+
/** The default replies under what the assistant said: (what the button says, what it sends). */
|
|
18
|
+
export declare const ASSISTANT_SUGGESTED_REPLIES: Readonly<Record<Lang, readonly SuggestedReply[]>>;
|
|
19
|
+
type Event = Readonly<Record<string, unknown>>;
|
|
20
|
+
/** A pull request's link as people say it in a chat: #381. */
|
|
21
|
+
export declare function shortPull(url: string): string;
|
|
22
|
+
export interface ConfirmAction {
|
|
23
|
+
readonly channelMessageId: string;
|
|
24
|
+
readonly name: string;
|
|
25
|
+
readonly args: string;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* The command an `assistant.say` puts to the person (the assistant did not run it, since the message was not that command typed
|
|
29
|
+
* whole); undefined when it carries none that could be one. `exactCommand` is the router's test of a command typed whole.
|
|
30
|
+
*/
|
|
31
|
+
export declare function confirmActionOf(event: Event, exactCommand: (text: string) => boolean): ConfirmAction | undefined;
|
|
32
|
+
export interface ConfirmWrite {
|
|
33
|
+
readonly confirmationId: string;
|
|
34
|
+
readonly kind: (typeof CONFIRM_KINDS)[number];
|
|
35
|
+
readonly allowLabel: string;
|
|
36
|
+
}
|
|
37
|
+
/** The write Claw holds for the person (`confirm_write` of an `assistant.say`); undefined when it carries none this worker draws. */
|
|
38
|
+
export declare function confirmWriteOf(event: Event): ConfirmWrite | undefined;
|
|
39
|
+
/**
|
|
40
|
+
* The suggested replies under an `assistant.say` (none under anything else, or with the style off): Claw's own, each one plain
|
|
41
|
+
* line that is no command, else the defaults in the person's language (`lang`; without it, the language of `text`).
|
|
42
|
+
*/
|
|
43
|
+
export declare function suggestedRepliesOf(event: Event, text: string, styleOn: boolean, lang?: Lang): SuggestedReply[];
|
|
44
|
+
export interface RemoteNotice {
|
|
45
|
+
readonly kind: "done" | "needs_you" | "error";
|
|
46
|
+
readonly sessionId: string;
|
|
47
|
+
readonly ask: Event | undefined;
|
|
48
|
+
readonly machine: string;
|
|
49
|
+
readonly agent: string;
|
|
50
|
+
}
|
|
51
|
+
/** What an `assistant.say` says of an agent session on the person's machine, or undefined for any other message. */
|
|
52
|
+
export declare function remoteNoticeOf(event: Event): RemoteNotice | undefined;
|
|
53
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How the assistant's flows tell Claw's failures apart (the Python worker's `except ClawError`, `except httpx.HTTPError`,
|
|
3
|
+
* `except (ValueError, KeyError)`): a refusal with a status, no answer at all, an answer this client does not understand. Anything
|
|
4
|
+
* else is a bug and is not caught.
|
|
5
|
+
*/
|
|
6
|
+
import { ClawError } from "../claw/errors.js";
|
|
7
|
+
/** Claw answered with an error status. */
|
|
8
|
+
export declare function refusal(error: unknown): ClawError | undefined;
|
|
9
|
+
/** No answer at all (the request may or may not have arrived). */
|
|
10
|
+
export declare function unreachable(error: unknown): boolean;
|
|
11
|
+
/** An answer this client does not understand (the Python worker's `ValueError` from reading it). */
|
|
12
|
+
export declare function answerInvalid(error: unknown): boolean;
|
|
13
|
+
/** Any of Claw's failures: refused, unreachable, or an answer not understood. */
|
|
14
|
+
export declare function clawFailure(error: unknown): boolean;
|
|
15
|
+
/** Rethrows anything that is not one of Claw's failures. */
|
|
16
|
+
export declare function onlyClawFailures(error: unknown): void;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { JsonObject } from "../json.js";
|
|
2
|
+
import type { ClawSessionsPort } from "../ports/claw/index.js";
|
|
3
|
+
import type { Logger } from "../ports/logger.js";
|
|
4
|
+
import type { Conversation, InboundFile } from "../ports/surface.js";
|
|
5
|
+
/** Where `ClawPort.sessions.uploadFiles` says an upload is; Claw names it by the rest. */
|
|
6
|
+
export declare const UPLOADS_ROOT = "/workspace/.uploads/";
|
|
7
|
+
export interface FetchedUpload {
|
|
8
|
+
readonly name: string;
|
|
9
|
+
readonly mediaType: string;
|
|
10
|
+
readonly bytes: Uint8Array;
|
|
11
|
+
}
|
|
12
|
+
/** The channel's side of a message's files (W3's inbound): fetching them, and how a failure and a folder are worded. */
|
|
13
|
+
export interface MessageFiles {
|
|
14
|
+
fetch(files: readonly InboundFile[]): Promise<{
|
|
15
|
+
fetched: FetchedUpload[];
|
|
16
|
+
failed: [name: string, why: string][];
|
|
17
|
+
}>;
|
|
18
|
+
/** The folder under .uploads/ one message's files go to. */
|
|
19
|
+
uploadFolder(messageId: string): string;
|
|
20
|
+
/** What the person is told about files that did not reach the agent. */
|
|
21
|
+
failedLine(failed: readonly (readonly [string, string])[]): string;
|
|
22
|
+
}
|
|
23
|
+
export interface HandOverDeps {
|
|
24
|
+
readonly claw: Pick<ClawSessionsPort, "uploadFiles">;
|
|
25
|
+
/** Undefined where this worker takes no files: they are named back. */
|
|
26
|
+
readonly files: MessageFiles | undefined;
|
|
27
|
+
readonly logger: Logger;
|
|
28
|
+
/** (path, how many) of a message's files did not reach Claw: counted for /metrics. */
|
|
29
|
+
readonly onDropped: (path: string, count: number) => void;
|
|
30
|
+
}
|
|
31
|
+
export declare function handOver(deps: HandOverDeps, call: {
|
|
32
|
+
credential: string;
|
|
33
|
+
sessionId: string;
|
|
34
|
+
folder: string;
|
|
35
|
+
files: readonly InboundFile[];
|
|
36
|
+
conversation: Conversation;
|
|
37
|
+
}): Promise<JsonObject[]>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How a press on one of the assistant's cards ends (teams_agent/assistant.py `_finish`): the pressed card is replaced by `edited`
|
|
3
|
+
* (a note when it is text), and `said` (by default the same text) is said as a new message, since Teams on a phone does not redraw
|
|
4
|
+
* an edited card. `said` may be a card of its own, which can be pressed again.
|
|
5
|
+
*/
|
|
6
|
+
import type { CardClick } from "../approvals/click.js";
|
|
7
|
+
import type { OutMessage } from "../ports/surface.js";
|
|
8
|
+
export declare function finish(click: CardClick, edited: OutMessage | string, said?: OutMessage | string): Promise<void>;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The assistant's turn, followed live while it answers a message, so that its receipt moves (teams_agent/assistant_follow.py).
|
|
3
|
+
*
|
|
4
|
+
* The turn's live stream says each tool it calls (`toolUsed`) and the words of its reply as the model writes them
|
|
5
|
+
* (`toolTextDelta`); this shows the step it is on, then the words, in the receipt. The reply itself still comes by notification
|
|
6
|
+
* and closes the receipt. Best effort: a stream that cannot be opened, breaks or says nothing leaves the receipt as it was. Only
|
|
7
|
+
* the live part is read (`LIVE_ONLY`), until the turn has spoken or ended, the receipt is closed, or FOLLOW_SECONDS have passed.
|
|
8
|
+
*/
|
|
9
|
+
import type { SseEvent } from "../claw/model.js";
|
|
10
|
+
import type { Lang } from "../locales/lang.js";
|
|
11
|
+
import type { Clock } from "../ports/clock.js";
|
|
12
|
+
import type { Logger } from "../ports/logger.js";
|
|
13
|
+
import type { Receipt } from "./receipt.js";
|
|
14
|
+
/** An event id later than every id Claw gives: the stream sends no history, only what happens from now on. */
|
|
15
|
+
export declare const LIVE_ONLY = "claw-99999999999999";
|
|
16
|
+
export declare const FOLLOW_SECONDS = 180;
|
|
17
|
+
/** How long a message waits for its turn's stream to open (`TurnFollower.waitOpen`); later, it is sent anyway. */
|
|
18
|
+
export declare const FOLLOW_OPEN_SECONDS = 2;
|
|
19
|
+
export declare const SAY_TOOL = "mcp__assistant__say";
|
|
20
|
+
/** Opens the session's live stream after `after`; closed when `signal` aborts. */
|
|
21
|
+
/** The session's stream from `after`; `onOpen` once Claw has answered its request, before any event. */
|
|
22
|
+
export type OpenStream = (after: string, signal: AbortSignal, onOpen: () => void) => AsyncIterable<SseEvent>;
|
|
23
|
+
/** The step a tool call is, in the person's language (step_labels.lookup_label). */
|
|
24
|
+
export type StepLabel = (tool: string, lang: Lang) => string;
|
|
25
|
+
/**
|
|
26
|
+
* Whether a say's terminal toolUsed event says it was sent: not when the call failed, or Claw answered it with a refusal
|
|
27
|
+
* (`{"ok": false, ...}` as its `description`).
|
|
28
|
+
*/
|
|
29
|
+
export declare function said(data: Readonly<Record<string, unknown>>): boolean;
|
|
30
|
+
export interface FollowerOptions {
|
|
31
|
+
readonly open: OpenStream;
|
|
32
|
+
readonly receipt: Receipt;
|
|
33
|
+
readonly lang: Lang;
|
|
34
|
+
/** Stream the reply's words into the receipt (style `assistant_stream_say`). */
|
|
35
|
+
readonly streamSay: boolean;
|
|
36
|
+
readonly stepLabel: StepLabel;
|
|
37
|
+
readonly clock: Clock;
|
|
38
|
+
readonly logger: Logger;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* One message's turn, followed into its receipt: `start` before the message is handed over, then `answers(messageId)` with the
|
|
42
|
+
* id Claw gave it, or `answers(undefined)` when there is none (then nothing is shown).
|
|
43
|
+
*/
|
|
44
|
+
export declare class TurnFollower {
|
|
45
|
+
private readonly options;
|
|
46
|
+
private messageId;
|
|
47
|
+
private known;
|
|
48
|
+
private readonly early;
|
|
49
|
+
private readonly steps;
|
|
50
|
+
private readonly stop;
|
|
51
|
+
private knownWaiters;
|
|
52
|
+
/** Settles when following has ended (for tests and orderly shutdown). */
|
|
53
|
+
done: Promise<void>;
|
|
54
|
+
private markOpen;
|
|
55
|
+
/** Claw has answered the stream's request (or it could not open at all): the turn's events reach it from now on. */
|
|
56
|
+
private readonly opened;
|
|
57
|
+
constructor(options: FollowerOptions);
|
|
58
|
+
start(): void;
|
|
59
|
+
/**
|
|
60
|
+
* Wait, at most `seconds`, until Claw has answered the stream's request, so that a message sent after it cannot have its turn's
|
|
61
|
+
* first event go by before the stream is there (the stream reads only what comes after it opens: LIVE_ONLY). False when it
|
|
62
|
+
* did not open in time (the receipt then shows what reaches it, as before). A stream that could not open at all ends the wait.
|
|
63
|
+
*/
|
|
64
|
+
waitOpen(seconds: number): Promise<boolean>;
|
|
65
|
+
/** The id of the message the followed turn answers; undefined stops following. */
|
|
66
|
+
answers(messageId: string | undefined): void;
|
|
67
|
+
private run;
|
|
68
|
+
private follow;
|
|
69
|
+
/** Show what `event` says the followed turn did. True when the turn has spoken or ended: nothing more to follow. */
|
|
70
|
+
private apply;
|
|
71
|
+
/** The say's own events: its words as the model writes them, or that they will not be said. */
|
|
72
|
+
private applySay;
|
|
73
|
+
/** A tool call starts: its step joins the steps shown so far. */
|
|
74
|
+
private applyStep;
|
|
75
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** What the assembly wires of the assistant (one line each; the views and work-item text are exported from the package root). */
|
|
2
|
+
export { AssistantActionClicks } from "./action-handler.js";
|
|
3
|
+
export { AssistantActions } from "./actions.js";
|
|
4
|
+
export { Board } from "./board.js";
|
|
5
|
+
export { AssistantChat as AssistantChatService } from "./chat.js";
|
|
6
|
+
export type { AssistantChatOptions } from "./chat.js";
|
|
7
|
+
export type { MessageFiles } from "./files.js";
|
|
8
|
+
export { Receipts } from "./receipts.js";
|
|
9
|
+
export { SayPlanner } from "./say.js";
|
|
10
|
+
export { WatchClicks } from "./watch-clicks.js";
|
|
11
|
+
export { WorkClicks } from "./work-clicks.js";
|
|
12
|
+
export { WorkCardClicks } from "./work-handler.js";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** An informative update is at most 1000 characters and 1 KB. */
|
|
2
|
+
export declare const INFORMATIVE_MAX_CHARS = 1000;
|
|
3
|
+
export declare const INFORMATIVE_MAX_BYTES = 1024;
|
|
4
|
+
export declare const STATUS_JOIN = " \u00B7 ";
|
|
5
|
+
/**
|
|
6
|
+
* The lines joined by " · " (white space collapsed), cut to INFORMATIVE_MAX_CHARS and INFORMATIVE_MAX_BYTES by keeping the END
|
|
7
|
+
* (the newest) after a leading "…", never starting with a combining mark.
|
|
8
|
+
*/
|
|
9
|
+
export declare function informativeText(lines: readonly string[]): string;
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import type { Lang } from "../locales/lang.js";
|
|
2
|
+
import type { Clock } from "../ports/clock.js";
|
|
3
|
+
import type { Logger } from "../ports/logger.js";
|
|
4
|
+
import type { MessageId, OutMessage, StreamRefused, UpdateOptions } from "../ports/surface.js";
|
|
5
|
+
import type { Result } from "../result.js";
|
|
6
|
+
/** Teams closes a stream 10 minutes after its first request; the receipt closes itself before that. */
|
|
7
|
+
export declare const RECEIPT_CLOSE_SECONDS: number;
|
|
8
|
+
/** The reply's words streamed into the receipt stop growing here; the reply itself still comes whole. */
|
|
9
|
+
export declare const STREAM_SAY_MAX = 4000;
|
|
10
|
+
/** What the receipt needs of a live stream (a superset of the Surface's `LiveStream`). */
|
|
11
|
+
export interface ReceiptStream {
|
|
12
|
+
/** Still open: no final was sent and Teams has not closed it. */
|
|
13
|
+
readonly open: boolean;
|
|
14
|
+
/** The text streamed so far ("" none). */
|
|
15
|
+
readonly streamed: string;
|
|
16
|
+
/** The stream's message id once Teams gave one ("" before). */
|
|
17
|
+
readonly streamId: MessageId;
|
|
18
|
+
/** The person's message the stream answers. */
|
|
19
|
+
readonly replyTo: MessageId;
|
|
20
|
+
/** A final may still be refused and then edited into place: the stream has an id and was not closed. */
|
|
21
|
+
readonly closable: boolean;
|
|
22
|
+
/** Seconds since the stream's first request. */
|
|
23
|
+
ageSeconds(): number;
|
|
24
|
+
/** A status update; once `options.signal` aborts it is given up at once (refused). */
|
|
25
|
+
inform(text: string, options?: UpdateOptions): Promise<Result<void, StreamRefused>>;
|
|
26
|
+
/** The reply's words so far; as `inform`. */
|
|
27
|
+
emit(text: string, options?: UpdateOptions): Promise<Result<void, StreamRefused>>;
|
|
28
|
+
final(message: OutMessage): Promise<Result<void, StreamRefused>>;
|
|
29
|
+
/** Replace the posted message `id` (the stream's, once it was closed). */
|
|
30
|
+
update(id: MessageId, message: OutMessage): Promise<void>;
|
|
31
|
+
delete(id: MessageId): Promise<void>;
|
|
32
|
+
}
|
|
33
|
+
/** The words a message carries as text ("" for a view). */
|
|
34
|
+
export declare function messageWords(message: OutMessage): string;
|
|
35
|
+
export declare class Receipt {
|
|
36
|
+
readonly stream: ReceiptStream;
|
|
37
|
+
readonly conversation: string;
|
|
38
|
+
readonly lang: Lang;
|
|
39
|
+
private readonly log;
|
|
40
|
+
/** Closed, or being closed: nothing more is shown in it. */
|
|
41
|
+
done: boolean;
|
|
42
|
+
/** Kept for the answer of a handed-back review. */
|
|
43
|
+
reserved: boolean;
|
|
44
|
+
/** The words shown are known not to be said. */
|
|
45
|
+
voided: boolean;
|
|
46
|
+
/** The line the reply starts with (direct chat: Clawy's head), shown before its words. */
|
|
47
|
+
head: string;
|
|
48
|
+
/**
|
|
49
|
+
* Which turn of the assistant's session answers the message this receipt stands under (`answeredBy`): its id, once Claw gave
|
|
50
|
+
* one; for a message Claw queued (no id), the turn it was queued behind, read just before it was sent. `unsent`: the message
|
|
51
|
+
* is not yet handed to Claw, so no turn there can be answering it.
|
|
52
|
+
*/
|
|
53
|
+
messageId: string | undefined;
|
|
54
|
+
behind: string | undefined;
|
|
55
|
+
unsent: boolean;
|
|
56
|
+
private want;
|
|
57
|
+
private sender;
|
|
58
|
+
private readonly closedWaiters;
|
|
59
|
+
private readonly closer;
|
|
60
|
+
/** Aborted when the receipt is dropped: an update on its way is given up. */
|
|
61
|
+
private readonly updates;
|
|
62
|
+
constructor(stream: ReceiptStream, conversation: string, lang: Lang, log: Logger);
|
|
63
|
+
/** The message is not yet handed to Claw (the assistant opened the receipt): nothing Claw says answers it yet. */
|
|
64
|
+
awaitHandOver(): void;
|
|
65
|
+
/** The message is being handed to Claw now: from here on a turn may answer it, other than `behind` (a queued one runs after it). */
|
|
66
|
+
handingOver(behind: string | undefined): void;
|
|
67
|
+
/** Claw took the message: when it gave the message's id, only the turn of that id answers it (none: it was queued). */
|
|
68
|
+
takenAs(messageId: string | null | undefined): void;
|
|
69
|
+
/**
|
|
70
|
+
* Whether a reply said by the turn `turn` (an `assistant.say`'s `turn_message_id`) may close this receipt: only the message's own
|
|
71
|
+
* turn's may (stream.py `Receipt.answered_by`). Another turn of the same session says something else, and its words under this
|
|
72
|
+
* message would read as the answer to it. Nothing Claw says before the message is handed over answers it, not even a reply that
|
|
73
|
+
* names no turn (Claw's notice of a lost turn names none). After that, a reply that names no turn, or a receipt that knows
|
|
74
|
+
* neither its turn nor the one in front of it, closes it as before.
|
|
75
|
+
*/
|
|
76
|
+
answeredBy(turn: string | undefined): boolean;
|
|
77
|
+
/** Resolves when the receipt is closed (or being closed): what follows the turn stops then. */
|
|
78
|
+
closed(): Promise<void>;
|
|
79
|
+
/** Show `line` as the status, unless words of the reply are shown already. */
|
|
80
|
+
showStep(line: string): void;
|
|
81
|
+
/** Show the reply's words so far: ignored once they no longer grow from what is shown, pass STREAM_SAY_MAX, or are not to be shown. */
|
|
82
|
+
showText(words: string): void;
|
|
83
|
+
/** The words shown are not going to be said: nothing more is streamed, and the receipt is not closed with them. */
|
|
84
|
+
voidText(): void;
|
|
85
|
+
private show;
|
|
86
|
+
/** Send the newest wanted update, then the one wanted meanwhile, until there is none; a refusal ends it. */
|
|
87
|
+
private sendWanted;
|
|
88
|
+
/** Nothing more is shown, and an update already on its way has gone (or failed), so what was shown is final. */
|
|
89
|
+
private settle;
|
|
90
|
+
/**
|
|
91
|
+
* The worker stops: the receipt is dropped, not closed (Python's shutdown cancels its tasks; the channel ends the stream
|
|
92
|
+
* itself). Its close timer is cancelled, an update on its way to the channel is given up, and what follows the turn stops
|
|
93
|
+
* (`closed()` resolves), so nothing keeps the process up.
|
|
94
|
+
*/
|
|
95
|
+
drop(): void;
|
|
96
|
+
/** Close the receipt by itself at RECEIPT_CLOSE_SECONDS unless a reply closed it first. */
|
|
97
|
+
arm(clock: Clock, stillMine: () => boolean, onClose: () => void): void;
|
|
98
|
+
private closeInTime;
|
|
99
|
+
/** The reply's words this receipt shows, final: nothing more is shown in it from now on. */
|
|
100
|
+
shownWords(): Promise<string>;
|
|
101
|
+
/**
|
|
102
|
+
* Send `message` (the assistant's reply; `words` its words as written) as the receipt's final message. False: it was not sent
|
|
103
|
+
* (the caller sends it as a message of its own). Words already streamed are kept (the reply is sent as them, now whole); a view
|
|
104
|
+
* that starts with them closes the stream with the words and is a message of its own; a reply that does not start with them
|
|
105
|
+
* replaces them.
|
|
106
|
+
*/
|
|
107
|
+
deliver(message: OutMessage, words?: string): Promise<boolean>;
|
|
108
|
+
/**
|
|
109
|
+
* Close the stream with `message` in place of the words streamed into it. Should Teams refuse a final that does not contain
|
|
110
|
+
* what was streamed, the stream is closed with those words and that message is edited into `message` (deleted when it cannot be).
|
|
111
|
+
*/
|
|
112
|
+
private closeReplacing;
|
|
113
|
+
}
|