@beeuni/sdk 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/README.md +1234 -0
- package/dist/beeuni.esm.min.js +96 -0
- package/dist/beeuni.global.js +96 -0
- package/dist/browser/cache/idb-sync-cache.d.ts +12 -0
- package/dist/browser/cache/idb-sync-cache.js +88 -0
- package/dist/browser/session-sync/mirror-paging.d.ts +7 -0
- package/dist/browser/session-sync/mirror-paging.js +10 -0
- package/dist/browser/session-sync/server-transcript-mirror.d.ts +33 -0
- package/dist/browser/session-sync/server-transcript-mirror.js +112 -0
- package/dist/browser/session-sync/session-cache-ownership.d.ts +8 -0
- package/dist/browser/session-sync/session-cache-ownership.js +36 -0
- package/dist/browser/session-sync/session-sync-registry.d.ts +44 -0
- package/dist/browser/session-sync/session-sync-registry.js +253 -0
- package/dist/browser/session-sync/visibility.d.ts +6 -0
- package/dist/browser/session-sync/visibility.js +21 -0
- package/dist/browser/stores/diagnostics-store.d.ts +61 -0
- package/dist/browser/stores/diagnostics-store.js +216 -0
- package/dist/browser/stores/opencode-compaction-store.d.ts +7 -0
- package/dist/browser/stores/opencode-compaction-store.js +21 -0
- package/dist/browser/stores/opencode-pending-store.d.ts +19 -0
- package/dist/browser/stores/opencode-pending-store.js +65 -0
- package/dist/browser/stores/sandbox-connection-store.d.ts +35 -0
- package/dist/browser/stores/sandbox-connection-store.js +230 -0
- package/dist/browser/stores/server-store.d.ts +4 -0
- package/dist/browser/stores/server-store.js +7 -0
- package/dist/browser/stores/session-working-store.d.ts +21 -0
- package/dist/browser/stores/session-working-store.js +106 -0
- package/dist/browser/stores/sync-store/ascending-id.d.ts +1 -0
- package/dist/browser/stores/sync-store/ascending-id.js +17 -0
- package/dist/browser/stores/sync-store/binary.d.ts +6 -0
- package/dist/browser/stores/sync-store/binary.js +17 -0
- package/dist/browser/stores/sync-store/delta-event-window.d.ts +1 -0
- package/dist/browser/stores/sync-store/delta-event-window.js +1 -0
- package/dist/browser/stores/sync-store/reconcile-parts.d.ts +12 -0
- package/dist/browser/stores/sync-store/reconcile-parts.js +53 -0
- package/dist/browser/stores/sync-store/types.d.ts +20 -0
- package/dist/browser/stores/sync-store/types.js +1 -0
- package/dist/browser/stores/sync-store.d.ts +65 -0
- package/dist/browser/stores/sync-store.js +1336 -0
- package/dist/core/agents/composer-agents.d.ts +19 -0
- package/dist/core/agents/composer-agents.js +57 -0
- package/dist/core/attachments/limits.d.ts +3 -0
- package/dist/core/attachments/limits.js +3 -0
- package/dist/core/attachments/prompt-attachments.d.ts +37 -0
- package/dist/core/attachments/prompt-attachments.js +377 -0
- package/dist/core/auth/app-viewer.d.ts +43 -0
- package/dist/core/auth/app-viewer.js +104 -0
- package/dist/core/auth/beeuni-member.d.ts +31 -0
- package/dist/core/auth/beeuni-member.js +168 -0
- package/dist/core/auth/session.d.ts +24 -0
- package/dist/core/auth/session.js +145 -0
- package/dist/core/cache/persisted-query-cache.d.ts +55 -0
- package/dist/core/cache/persisted-query-cache.js +220 -0
- package/dist/core/client/beeuni.d.ts +1216 -0
- package/dist/core/client/beeuni.js +96 -0
- package/dist/core/client/binding-types.d.ts +1 -0
- package/dist/core/client/binding-types.js +1 -0
- package/dist/core/client/facade-accounts.d.ts +51 -0
- package/dist/core/client/facade-accounts.js +53 -0
- package/dist/core/client/facade-catalog.d.ts +54 -0
- package/dist/core/client/facade-catalog.js +53 -0
- package/dist/core/client/facade-commerce.d.ts +39 -0
- package/dist/core/client/facade-commerce.js +40 -0
- package/dist/core/client/facade-iam.d.ts +43 -0
- package/dist/core/client/facade-iam.js +45 -0
- package/dist/core/client/facade-identity.d.ts +103 -0
- package/dist/core/client/facade-identity.js +33 -0
- package/dist/core/client/facade-preview.d.ts +3 -0
- package/dist/core/client/facade-preview.js +30 -0
- package/dist/core/client/project-access-resources.d.ts +65 -0
- package/dist/core/client/project-access-resources.js +54 -0
- package/dist/core/client/project-access-security.d.ts +109 -0
- package/dist/core/client/project-access-security.js +33 -0
- package/dist/core/client/project-connections.d.ts +32 -0
- package/dist/core/client/project-connections.js +18 -0
- package/dist/core/client/project-connectors.d.ts +15 -0
- package/dist/core/client/project-connectors.js +34 -0
- package/dist/core/client/project-core.d.ts +74 -0
- package/dist/core/client/project-core.js +25 -0
- package/dist/core/client/project-membership.d.ts +62 -0
- package/dist/core/client/project-membership.js +24 -0
- package/dist/core/client/project-operations-admin.d.ts +125 -0
- package/dist/core/client/project-operations-admin.js +26 -0
- package/dist/core/client/project-operations-review.d.ts +35 -0
- package/dist/core/client/project-operations-review.js +24 -0
- package/dist/core/client/project-operations-workspace.d.ts +94 -0
- package/dist/core/client/project-operations-workspace.js +36 -0
- package/dist/core/client/project-operations.d.ts +237 -0
- package/dist/core/client/project-operations.js +41 -0
- package/dist/core/client/project-platform-resources.d.ts +34 -0
- package/dist/core/client/project-platform-resources.js +27 -0
- package/dist/core/client/project-platform-security.d.ts +76 -0
- package/dist/core/client/project-platform-security.js +31 -0
- package/dist/core/client/project-platform-settings.d.ts +53 -0
- package/dist/core/client/project-platform-settings.js +23 -0
- package/dist/core/client/session-actions-resources.d.ts +7 -0
- package/dist/core/client/session-actions-resources.js +13 -0
- package/dist/core/client/session-actions-security.d.ts +22 -0
- package/dist/core/client/session-actions-security.js +38 -0
- package/dist/core/client/session-actions-services.d.ts +39 -0
- package/dist/core/client/session-actions-services.js +34 -0
- package/dist/core/client/session-context.d.ts +21 -0
- package/dist/core/client/session-context.js +1 -0
- package/dist/core/client/session-defaults.d.ts +8 -0
- package/dist/core/client/session-defaults.js +35 -0
- package/dist/core/client/session-files.d.ts +20 -0
- package/dist/core/client/session-files.js +18 -0
- package/dist/core/client/session-handle.d.ts +207 -0
- package/dist/core/client/session-handle.js +53 -0
- package/dist/core/client/session-lifecycle-resources.d.ts +76 -0
- package/dist/core/client/session-lifecycle-resources.js +44 -0
- package/dist/core/client/session-lifecycle-security.d.ts +42 -0
- package/dist/core/client/session-lifecycle-security.js +31 -0
- package/dist/core/client/session-preview.d.ts +7 -0
- package/dist/core/client/session-preview.js +11 -0
- package/dist/core/client/session-readiness.d.ts +10 -0
- package/dist/core/client/session-readiness.js +54 -0
- package/dist/core/client/session-runtime.d.ts +21 -0
- package/dist/core/client/session-runtime.js +15 -0
- package/dist/core/client/session-shared.d.ts +20 -0
- package/dist/core/client/session-shared.js +22 -0
- package/dist/core/client/session-start.d.ts +2 -0
- package/dist/core/client/session-start.js +39 -0
- package/dist/core/files/client.d.ts +68 -0
- package/dist/core/files/client.js +491 -0
- package/dist/core/files/types.d.ts +75 -0
- package/dist/core/files/types.js +1 -0
- package/dist/core/http/abort-error.d.ts +5 -0
- package/dist/core/http/abort-error.js +74 -0
- package/dist/core/http/abort.d.ts +3 -0
- package/dist/core/http/abort.js +34 -0
- package/dist/core/http/api/errors.d.ts +68 -0
- package/dist/core/http/api/errors.js +132 -0
- package/dist/core/http/api-client.d.ts +44 -0
- package/dist/core/http/api-client.js +121 -0
- package/dist/core/http/auth.d.ts +12 -0
- package/dist/core/http/auth.js +37 -0
- package/dist/core/http/authenticated-request.d.ts +5 -0
- package/dist/core/http/authenticated-request.js +11 -0
- package/dist/core/http/config.d.ts +35 -0
- package/dist/core/http/config.js +23 -0
- package/dist/core/http/env.d.ts +1 -0
- package/dist/core/http/env.js +8 -0
- package/dist/core/http/feature-flags.d.ts +8 -0
- package/dist/core/http/feature-flags.js +41 -0
- package/dist/core/http/fresh-sessions.d.ts +3 -0
- package/dist/core/http/fresh-sessions.js +17 -0
- package/dist/core/http/impersonation.d.ts +14 -0
- package/dist/core/http/impersonation.js +110 -0
- package/dist/core/http/instance-routes.d.ts +16 -0
- package/dist/core/http/instance-routes.js +99 -0
- package/dist/core/http/logger.d.ts +10 -0
- package/dist/core/http/logger.js +29 -0
- package/dist/core/http/request.d.ts +2 -0
- package/dist/core/http/request.js +194 -0
- package/dist/core/http/response-error.d.ts +2 -0
- package/dist/core/http/response-error.js +92 -0
- package/dist/core/http/runtime-errors.d.ts +32 -0
- package/dist/core/http/runtime-errors.js +116 -0
- package/dist/core/http/session-stopped.d.ts +2 -0
- package/dist/core/http/session-stopped.js +16 -0
- package/dist/core/http/transport.d.ts +20 -0
- package/dist/core/http/transport.js +133 -0
- package/dist/core/models/bedrock-invokable.d.ts +3 -0
- package/dist/core/models/bedrock-invokable.js +22 -0
- package/dist/core/models/composer-model.d.ts +20 -0
- package/dist/core/models/composer-model.js +57 -0
- package/dist/core/models/model-flatten.d.ts +43 -0
- package/dist/core/models/model-flatten.js +73 -0
- package/dist/core/models/model-key.d.ts +8 -0
- package/dist/core/models/model-key.js +18 -0
- package/dist/core/models/model-lookup.d.ts +2 -0
- package/dist/core/models/model-lookup.js +3 -0
- package/dist/core/models/model-visibility.d.ts +28 -0
- package/dist/core/models/model-visibility.js +110 -0
- package/dist/core/models/provider-selection.d.ts +72 -0
- package/dist/core/models/provider-selection.js +307 -0
- package/dist/core/rest/platform-client/auth.d.ts +139 -0
- package/dist/core/rest/platform-client/auth.js +92 -0
- package/dist/core/rest/platform-client/backups.d.ts +18 -0
- package/dist/core/rest/platform-client/backups.js +12 -0
- package/dist/core/rest/platform-client/connector-setup.d.ts +35 -0
- package/dist/core/rest/platform-client/connector-setup.js +105 -0
- package/dist/core/rest/platform-client/github-app.d.ts +45 -0
- package/dist/core/rest/platform-client/github-app.js +54 -0
- package/dist/core/rest/platform-client/host-boundary.d.ts +140 -0
- package/dist/core/rest/platform-client/host-boundary.js +188 -0
- package/dist/core/rest/platform-client/index.d.ts +12 -0
- package/dist/core/rest/platform-client/index.js +12 -0
- package/dist/core/rest/platform-client/instance-admin.d.ts +53 -0
- package/dist/core/rest/platform-client/instance-admin.js +20 -0
- package/dist/core/rest/platform-client/invites.d.ts +31 -0
- package/dist/core/rest/platform-client/invites.js +11 -0
- package/dist/core/rest/platform-client/lifecycle.d.ts +27 -0
- package/dist/core/rest/platform-client/lifecycle.js +80 -0
- package/dist/core/rest/platform-client/members.d.ts +14 -0
- package/dist/core/rest/platform-client/members.js +28 -0
- package/dist/core/rest/platform-client/shared.d.ts +18 -0
- package/dist/core/rest/platform-client/shared.js +99 -0
- package/dist/core/rest/platform-client/ssh.d.ts +21 -0
- package/dist/core/rest/platform-client/ssh.js +6 -0
- package/dist/core/rest/platform-client/types.d.ts +47 -0
- package/dist/core/rest/platform-client/types.js +10 -0
- package/dist/core/rest/platform-client/updates.d.ts +77 -0
- package/dist/core/rest/platform-client/updates.js +54 -0
- package/dist/core/rest/platform-client/urls.d.ts +3 -0
- package/dist/core/rest/platform-client/urls.js +16 -0
- package/dist/core/rest/projects-client/access.d.ts +226 -0
- package/dist/core/rest/projects-client/access.js +82 -0
- package/dist/core/rest/projects-client/account-lifecycle.d.ts +21 -0
- package/dist/core/rest/projects-client/account-lifecycle.js +25 -0
- package/dist/core/rest/projects-client/account-secret-resources.d.ts +60 -0
- package/dist/core/rest/projects-client/account-secret-resources.js +40 -0
- package/dist/core/rest/projects-client/accounts.d.ts +240 -0
- package/dist/core/rest/projects-client/accounts.js +82 -0
- package/dist/core/rest/projects-client/admin-providers.d.ts +131 -0
- package/dist/core/rest/projects-client/admin-providers.js +39 -0
- package/dist/core/rest/projects-client/agent-config.d.ts +72 -0
- package/dist/core/rest/projects-client/agent-config.js +39 -0
- package/dist/core/rest/projects-client/agent-connectors.d.ts +6 -0
- package/dist/core/rest/projects-client/agent-connectors.js +32 -0
- package/dist/core/rest/projects-client/agent-scope.d.ts +13 -0
- package/dist/core/rest/projects-client/agent-scope.js +7 -0
- package/dist/core/rest/projects-client/apps-fleet.d.ts +82 -0
- package/dist/core/rest/projects-client/apps-fleet.js +45 -0
- package/dist/core/rest/projects-client/apps.d.ts +356 -0
- package/dist/core/rest/projects-client/apps.js +126 -0
- package/dist/core/rest/projects-client/assignments.d.ts +73 -0
- package/dist/core/rest/projects-client/assignments.js +45 -0
- package/dist/core/rest/projects-client/audit-filter.d.ts +4 -0
- package/dist/core/rest/projects-client/audit-filter.js +9 -0
- package/dist/core/rest/projects-client/audit.d.ts +125 -0
- package/dist/core/rest/projects-client/audit.js +49 -0
- package/dist/core/rest/projects-client/billing.d.ts +390 -0
- package/dist/core/rest/projects-client/billing.js +257 -0
- package/dist/core/rest/projects-client/change-requests.d.ts +116 -0
- package/dist/core/rest/projects-client/change-requests.js +50 -0
- package/dist/core/rest/projects-client/channels.d.ts +131 -0
- package/dist/core/rest/projects-client/channels.js +112 -0
- package/dist/core/rest/projects-client/connector-run.d.ts +62 -0
- package/dist/core/rest/projects-client/connector-run.js +155 -0
- package/dist/core/rest/projects-client/connectors.d.ts +721 -0
- package/dist/core/rest/projects-client/connectors.js +421 -0
- package/dist/core/rest/projects-client/drives.d.ts +149 -0
- package/dist/core/rest/projects-client/drives.js +88 -0
- package/dist/core/rest/projects-client/files.d.ts +45 -0
- package/dist/core/rest/projects-client/files.js +69 -0
- package/dist/core/rest/projects-client/gateway.d.ts +257 -0
- package/dist/core/rest/projects-client/gateway.js +72 -0
- package/dist/core/rest/projects-client/git-backend.d.ts +15 -0
- package/dist/core/rest/projects-client/git-backend.js +15 -0
- package/dist/core/rest/projects-client/git-history.d.ts +78 -0
- package/dist/core/rest/projects-client/git-history.js +47 -0
- package/dist/core/rest/projects-client/github.d.ts +128 -0
- package/dist/core/rest/projects-client/github.js +54 -0
- package/dist/core/rest/projects-client/iam-audit.d.ts +81 -0
- package/dist/core/rest/projects-client/iam-audit.js +21 -0
- package/dist/core/rest/projects-client/iam-enterprise.d.ts +2 -0
- package/dist/core/rest/projects-client/iam-enterprise.js +11 -0
- package/dist/core/rest/projects-client/iam-grants.d.ts +21 -0
- package/dist/core/rest/projects-client/iam-grants.js +6 -0
- package/dist/core/rest/projects-client/iam-groups.d.ts +65 -0
- package/dist/core/rest/projects-client/iam-groups.js +42 -0
- package/dist/core/rest/projects-client/iam-policies.d.ts +53 -0
- package/dist/core/rest/projects-client/iam-policies.js +26 -0
- package/dist/core/rest/projects-client/iam-probe.d.ts +27 -0
- package/dist/core/rest/projects-client/iam-probe.js +16 -0
- package/dist/core/rest/projects-client/iam-query.d.ts +1 -0
- package/dist/core/rest/projects-client/iam-query.js +9 -0
- package/dist/core/rest/projects-client/iam-roles.d.ts +47 -0
- package/dist/core/rest/projects-client/iam-roles.js +43 -0
- package/dist/core/rest/projects-client/iam-scim.d.ts +22 -0
- package/dist/core/rest/projects-client/iam-scim.js +14 -0
- package/dist/core/rest/projects-client/iam-security.d.ts +28 -0
- package/dist/core/rest/projects-client/iam-security.js +17 -0
- package/dist/core/rest/projects-client/iam-service-accounts.d.ts +26 -0
- package/dist/core/rest/projects-client/iam-service-accounts.js +14 -0
- package/dist/core/rest/projects-client/iam-sessions.d.ts +27 -0
- package/dist/core/rest/projects-client/iam-sessions.js +25 -0
- package/dist/core/rest/projects-client/iam-shared.d.ts +6 -0
- package/dist/core/rest/projects-client/iam-shared.js +8 -0
- package/dist/core/rest/projects-client/iam-sso.d.ts +60 -0
- package/dist/core/rest/projects-client/iam-sso.js +28 -0
- package/dist/core/rest/projects-client/iam-types.d.ts +52 -0
- package/dist/core/rest/projects-client/iam-types.js +1 -0
- package/dist/core/rest/projects-client/iam.d.ts +13 -0
- package/dist/core/rest/projects-client/iam.js +13 -0
- package/dist/core/rest/projects-client/index.d.ts +55 -0
- package/dist/core/rest/projects-client/index.js +54 -0
- package/dist/core/rest/projects-client/marketplace-catalog.d.ts +74 -0
- package/dist/core/rest/projects-client/marketplace-catalog.js +41 -0
- package/dist/core/rest/projects-client/model-access.d.ts +13 -0
- package/dist/core/rest/projects-client/model-access.js +8 -0
- package/dist/core/rest/projects-client/model-defaults.d.ts +28 -0
- package/dist/core/rest/projects-client/model-defaults.js +15 -0
- package/dist/core/rest/projects-client/model-enablement.d.ts +4 -0
- package/dist/core/rest/projects-client/model-enablement.js +5 -0
- package/dist/core/rest/projects-client/notifications.d.ts +95 -0
- package/dist/core/rest/projects-client/notifications.js +61 -0
- package/dist/core/rest/projects-client/oauth-clients.d.ts +41 -0
- package/dist/core/rest/projects-client/oauth-clients.js +24 -0
- package/dist/core/rest/projects-client/policies.d.ts +26 -0
- package/dist/core/rest/projects-client/policies.js +8 -0
- package/dist/core/rest/projects-client/presentations.d.ts +11 -0
- package/dist/core/rest/projects-client/presentations.js +8 -0
- package/dist/core/rest/projects-client/project-agents.d.ts +10 -0
- package/dist/core/rest/projects-client/project-agents.js +22 -0
- package/dist/core/rest/projects-client/projects.d.ts +376 -0
- package/dist/core/rest/projects-client/projects.js +237 -0
- package/dist/core/rest/projects-client/prompt-attachments.d.ts +31 -0
- package/dist/core/rest/projects-client/prompt-attachments.js +294 -0
- package/dist/core/rest/projects-client/provider-connections.d.ts +54 -0
- package/dist/core/rest/projects-client/provider-connections.js +28 -0
- package/dist/core/rest/projects-client/public-session-shares.d.ts +49 -0
- package/dist/core/rest/projects-client/public-session-shares.js +35 -0
- package/dist/core/rest/projects-client/referrals.d.ts +52 -0
- package/dist/core/rest/projects-client/referrals.js +19 -0
- package/dist/core/rest/projects-client/review-items.d.ts +139 -0
- package/dist/core/rest/projects-client/review-items.js +217 -0
- package/dist/core/rest/projects-client/review.d.ts +56 -0
- package/dist/core/rest/projects-client/review.js +23 -0
- package/dist/core/rest/projects-client/sandbox-shares.d.ts +21 -0
- package/dist/core/rest/projects-client/sandbox-shares.js +19 -0
- package/dist/core/rest/projects-client/sandbox.d.ts +144 -0
- package/dist/core/rest/projects-client/sandbox.js +35 -0
- package/dist/core/rest/projects-client/secrets.d.ts +187 -0
- package/dist/core/rest/projects-client/secrets.js +79 -0
- package/dist/core/rest/projects-client/session-attachments.d.ts +22 -0
- package/dist/core/rest/projects-client/session-attachments.js +166 -0
- package/dist/core/rest/projects-client/session-costs.d.ts +193 -0
- package/dist/core/rest/projects-client/session-costs.js +87 -0
- package/dist/core/rest/projects-client/session-prompt-actions.d.ts +10 -0
- package/dist/core/rest/projects-client/session-prompt-actions.js +4 -0
- package/dist/core/rest/projects-client/session-reminders.d.ts +58 -0
- package/dist/core/rest/projects-client/session-reminders.js +50 -0
- package/dist/core/rest/projects-client/session-sandbox.d.ts +85 -0
- package/dist/core/rest/projects-client/session-sandbox.js +113 -0
- package/dist/core/rest/projects-client/sessions.d.ts +670 -0
- package/dist/core/rest/projects-client/sessions.js +321 -0
- package/dist/core/rest/projects-client/setup-links.d.ts +54 -0
- package/dist/core/rest/projects-client/setup-links.js +22 -0
- package/dist/core/rest/projects-client/shared.d.ts +51 -0
- package/dist/core/rest/projects-client/shared.js +29 -0
- package/dist/core/rest/projects-client/skills.d.ts +11 -0
- package/dist/core/rest/projects-client/skills.js +8 -0
- package/dist/core/rest/projects-client/starter-suggestions.d.ts +17 -0
- package/dist/core/rest/projects-client/starter-suggestions.js +5 -0
- package/dist/core/rest/projects-client/templates.d.ts +47 -0
- package/dist/core/rest/projects-client/templates.js +7 -0
- package/dist/core/rest/projects-client/tokens.d.ts +94 -0
- package/dist/core/rest/projects-client/tokens.js +46 -0
- package/dist/core/rest/projects-client/triggers.d.ts +175 -0
- package/dist/core/rest/projects-client/triggers.js +29 -0
- package/dist/core/runtime/attachment-part.d.ts +3 -0
- package/dist/core/runtime/attachment-part.js +18 -0
- package/dist/core/runtime/beeuni-master.d.ts +477 -0
- package/dist/core/runtime/beeuni-master.js +264 -0
- package/dist/core/runtime/client.d.ts +30 -0
- package/dist/core/runtime/client.js +124 -0
- package/dist/core/runtime/env.d.ts +8 -0
- package/dist/core/runtime/env.js +42 -0
- package/dist/core/runtime/pty.d.ts +43 -0
- package/dist/core/runtime/pty.js +117 -0
- package/dist/core/runtime/runtime-rest-client.d.ts +414 -0
- package/dist/core/runtime/runtime-rest-client.js +296 -0
- package/dist/core/runtime/runtime-types.d.ts +1094 -0
- package/dist/core/runtime/runtime-types.js +1 -0
- package/dist/core/runtime/transcript-types.d.ts +507 -0
- package/dist/core/runtime/transcript-types.js +31 -0
- package/dist/core/runtime/triggers.d.ts +1 -0
- package/dist/core/runtime/triggers.js +18 -0
- package/dist/core/session/compaction.d.ts +10 -0
- package/dist/core/session/compaction.js +22 -0
- package/dist/core/session/connection.d.ts +20 -0
- package/dist/core/session/connection.js +52 -0
- package/dist/core/session/control-stream.d.ts +62 -0
- package/dist/core/session/control-stream.js +329 -0
- package/dist/core/session/current-runtime.d.ts +14 -0
- package/dist/core/session/current-runtime.js +34 -0
- package/dist/core/session/health.d.ts +41 -0
- package/dist/core/session/health.js +53 -0
- package/dist/core/session/host-signals.d.ts +3 -0
- package/dist/core/session/host-signals.js +16 -0
- package/dist/core/session/index.d.ts +15 -0
- package/dist/core/session/index.js +14 -0
- package/dist/core/session/message-queue.d.ts +43 -0
- package/dist/core/session/message-queue.js +101 -0
- package/dist/core/session/open-bundle.d.ts +24 -0
- package/dist/core/session/open-bundle.js +135 -0
- package/dist/core/session/poll-owner.d.ts +5 -0
- package/dist/core/session/poll-owner.js +58 -0
- package/dist/core/session/presentation.d.ts +11 -0
- package/dist/core/session/presentation.js +70 -0
- package/dist/core/session/preview-auth.d.ts +6 -0
- package/dist/core/session/preview-auth.js +36 -0
- package/dist/core/session/preview-config.d.ts +5 -0
- package/dist/core/session/preview-config.js +54 -0
- package/dist/core/session/preview-options.d.ts +9 -0
- package/dist/core/session/preview-options.js +12 -0
- package/dist/core/session/preview-origin-trust.d.ts +7 -0
- package/dist/core/session/preview-origin-trust.js +64 -0
- package/dist/core/session/preview-probe.d.ts +7 -0
- package/dist/core/session/preview-probe.js +36 -0
- package/dist/core/session/preview.d.ts +3 -0
- package/dist/core/session/preview.js +66 -0
- package/dist/core/session/project-session-read.d.ts +5 -0
- package/dist/core/session/project-session-read.js +12 -0
- package/dist/core/session/rewind.d.ts +29 -0
- package/dist/core/session/rewind.js +53 -0
- package/dist/core/session/runtime-gone.d.ts +5 -0
- package/dist/core/session/runtime-gone.js +14 -0
- package/dist/core/session/runtime-sessions.d.ts +7 -0
- package/dist/core/session/runtime-sessions.js +26 -0
- package/dist/core/session/runtime-verbs.d.ts +34 -0
- package/dist/core/session/runtime-verbs.js +94 -0
- package/dist/core/session/server-store/active.d.ts +7 -0
- package/dist/core/session/server-store/active.js +35 -0
- package/dist/core/session/server-store/types.d.ts +4 -0
- package/dist/core/session/server-store/types.js +1 -0
- package/dist/core/session/server-store/url-helpers.d.ts +5 -0
- package/dist/core/session/server-store/url-helpers.js +25 -0
- package/dist/core/session/session-runtime-registry.d.ts +9 -0
- package/dist/core/session/session-runtime-registry.js +28 -0
- package/dist/core/session/single-flight.d.ts +3 -0
- package/dist/core/session/single-flight.js +22 -0
- package/dist/core/session/static-file-preview.d.ts +10 -0
- package/dist/core/session/static-file-preview.js +34 -0
- package/dist/core/session/status-vocabulary.d.ts +23 -0
- package/dist/core/session/status-vocabulary.js +59 -0
- package/dist/core/session/turn-end-cause.d.ts +22 -0
- package/dist/core/session/turn-end-cause.js +41 -0
- package/dist/core/session/turn-end-settle.d.ts +1 -0
- package/dist/core/session/turn-end-settle.js +1 -0
- package/dist/core/session/url.d.ts +49 -0
- package/dist/core/session/url.js +415 -0
- package/dist/core/session/wake-escalation.d.ts +37 -0
- package/dist/core/session/wake-escalation.js +104 -0
- package/dist/core/session/wire-id-unwrap.d.ts +2 -0
- package/dist/core/session/wire-id-unwrap.js +15 -0
- package/dist/core/session/wire-message-id.d.ts +27 -0
- package/dist/core/session/wire-message-id.js +88 -0
- package/dist/core/session/working-evidence.d.ts +13 -0
- package/dist/core/session/working-evidence.js +25 -0
- package/dist/core/session/working-project.d.ts +2 -0
- package/dist/core/session/working-project.js +145 -0
- package/dist/core/session/working-runtime.d.ts +3 -0
- package/dist/core/session/working-runtime.js +16 -0
- package/dist/core/session/working-server.d.ts +20 -0
- package/dist/core/session/working-server.js +57 -0
- package/dist/core/session/working-time.d.ts +1 -0
- package/dist/core/session/working-time.js +6 -0
- package/dist/core/session/working.d.ts +58 -0
- package/dist/core/session/working.js +48 -0
- package/dist/core/session-sync/fragment.d.ts +4 -0
- package/dist/core/session-sync/fragment.js +3 -0
- package/dist/core/session-sync/saved-copy-store.d.ts +23 -0
- package/dist/core/session-sync/saved-copy-store.js +232 -0
- package/dist/core/session-sync/saved-transcript.d.ts +20 -0
- package/dist/core/session-sync/saved-transcript.js +35 -0
- package/dist/core/session-sync/session-sync-controller.d.ts +111 -0
- package/dist/core/session-sync/session-sync-controller.js +440 -0
- package/dist/core/stream/chat-events.d.ts +96 -0
- package/dist/core/stream/chat-events.js +95 -0
- package/dist/core/stream/event-stream.d.ts +52 -0
- package/dist/core/stream/event-stream.js +372 -0
- package/dist/core/stream/fetch-sse.d.ts +20 -0
- package/dist/core/stream/fetch-sse.js +136 -0
- package/dist/core/stream/keepalive.d.ts +4 -0
- package/dist/core/stream/keepalive.js +6 -0
- package/dist/core/stream/platform-event-transport.d.ts +2 -0
- package/dist/core/stream/platform-event-transport.js +20 -0
- package/dist/core/turns/classify.d.ts +131 -0
- package/dist/core/turns/classify.js +306 -0
- package/dist/core/turns/errors.d.ts +24 -0
- package/dist/core/turns/errors.js +355 -0
- package/dist/core/turns/grouping.d.ts +47 -0
- package/dist/core/turns/grouping.js +247 -0
- package/dist/core/turns/index.d.ts +13 -0
- package/dist/core/turns/index.js +12 -0
- package/dist/core/turns/open-turn.d.ts +13 -0
- package/dist/core/turns/open-turn.js +17 -0
- package/dist/core/turns/parts.d.ts +60 -0
- package/dist/core/turns/parts.js +414 -0
- package/dist/core/turns/segments/burst-summary.d.ts +9 -0
- package/dist/core/turns/segments/burst-summary.js +45 -0
- package/dist/core/turns/segments/compaction-state.d.ts +19 -0
- package/dist/core/turns/segments/compaction-state.js +42 -0
- package/dist/core/turns/segments/group-steps.d.ts +11 -0
- package/dist/core/turns/segments/group-steps.js +65 -0
- package/dist/core/turns/segments/index.d.ts +12 -0
- package/dist/core/turns/segments/index.js +12 -0
- package/dist/core/turns/segments/merge-steps.d.ts +21 -0
- package/dist/core/turns/segments/merge-steps.js +100 -0
- package/dist/core/turns/segments/message-time.d.ts +12 -0
- package/dist/core/turns/segments/message-time.js +82 -0
- package/dist/core/turns/segments/narration.d.ts +9 -0
- package/dist/core/turns/segments/narration.js +573 -0
- package/dist/core/turns/segments/segment-turn.d.ts +15 -0
- package/dist/core/turns/segments/segment-turn.js +32 -0
- package/dist/core/turns/segments/session-activity-groups.d.ts +20 -0
- package/dist/core/turns/segments/session-activity-groups.js +56 -0
- package/dist/core/turns/segments/show-group.d.ts +23 -0
- package/dist/core/turns/segments/show-group.js +101 -0
- package/dist/core/turns/segments/step-label.d.ts +10 -0
- package/dist/core/turns/segments/step-label.js +85 -0
- package/dist/core/turns/segments/turn-busy-visibility.d.ts +6 -0
- package/dist/core/turns/segments/turn-busy-visibility.js +9 -0
- package/dist/core/turns/segments/working-turn.d.ts +70 -0
- package/dist/core/turns/segments/working-turn.js +98 -0
- package/dist/core/turns/shell.d.ts +5 -0
- package/dist/core/turns/shell.js +21 -0
- package/dist/core/turns/state.d.ts +24 -0
- package/dist/core/turns/state.js +364 -0
- package/dist/core/turns/text-scan.d.ts +21 -0
- package/dist/core/turns/text-scan.js +347 -0
- package/dist/core/turns/tool-kind.d.ts +3 -0
- package/dist/core/turns/tool-kind.js +99 -0
- package/dist/core/turns/tool-registry.d.ts +8 -0
- package/dist/core/turns/tool-registry.js +87 -0
- package/dist/core/turns/tools/agent-helpers.d.ts +9 -0
- package/dist/core/turns/tools/agent-helpers.js +53 -0
- package/dist/core/turns/tools/file-verb.d.ts +10 -0
- package/dist/core/turns/tools/file-verb.js +22 -0
- package/dist/core/turns/tools/index.d.ts +14 -0
- package/dist/core/turns/tools/index.js +14 -0
- package/dist/core/turns/tools/memory-helpers.d.ts +15 -0
- package/dist/core/turns/tools/memory-helpers.js +50 -0
- package/dist/core/turns/tools/patch-summary.d.ts +6 -0
- package/dist/core/turns/tools/patch-summary.js +21 -0
- package/dist/core/turns/tools/presentation-helpers.d.ts +15 -0
- package/dist/core/turns/tools/presentation-helpers.js +17 -0
- package/dist/core/turns/tools/question-helpers.d.ts +9 -0
- package/dist/core/turns/tools/question-helpers.js +12 -0
- package/dist/core/turns/tools/read-helpers.d.ts +7 -0
- package/dist/core/turns/tools/read-helpers.js +24 -0
- package/dist/core/turns/tools/search-query.d.ts +1 -0
- package/dist/core/turns/tools/search-query.js +73 -0
- package/dist/core/turns/tools/show-availability.d.ts +11 -0
- package/dist/core/turns/tools/show-availability.js +38 -0
- package/dist/core/turns/tools/skill-helpers.d.ts +5 -0
- package/dist/core/turns/tools/skill-helpers.js +61 -0
- package/dist/core/turns/tools/tool-meta.d.ts +30 -0
- package/dist/core/turns/tools/tool-meta.js +146 -0
- package/dist/core/turns/tools/tool-outcome.d.ts +15 -0
- package/dist/core/turns/tools/tool-outcome.js +147 -0
- package/dist/core/turns/tools/tool-output-format.d.ts +17 -0
- package/dist/core/turns/tools/tool-output-format.js +124 -0
- package/dist/core/turns/tools/web-helpers.d.ts +34 -0
- package/dist/core/turns/tools/web-helpers.js +229 -0
- package/dist/core/turns/types.d.ts +110 -0
- package/dist/core/turns/types.js +1 -0
- package/dist/core/turns/view-model.d.ts +76 -0
- package/dist/core/turns/view-model.js +300 -0
- package/dist/deprecated/api-client.d.ts +1 -0
- package/dist/deprecated/api-client.js +1 -0
- package/dist/deprecated/auth.d.ts +1 -0
- package/dist/deprecated/auth.js +1 -0
- package/dist/deprecated/config.d.ts +1 -0
- package/dist/deprecated/config.js +1 -0
- package/dist/deprecated/event-stream.d.ts +1 -0
- package/dist/deprecated/event-stream.js +1 -0
- package/dist/deprecated/feature-flags.d.ts +1 -0
- package/dist/deprecated/feature-flags.js +1 -0
- package/dist/deprecated/files.d.ts +1 -0
- package/dist/deprecated/files.js +1 -0
- package/dist/deprecated/fresh-sessions.d.ts +1 -0
- package/dist/deprecated/fresh-sessions.js +1 -0
- package/dist/deprecated/idb-sync-cache.d.ts +1 -0
- package/dist/deprecated/idb-sync-cache.js +1 -0
- package/dist/deprecated/instance-routes.d.ts +1 -0
- package/dist/deprecated/instance-routes.js +1 -0
- package/dist/deprecated/opencode-client.d.ts +1 -0
- package/dist/deprecated/opencode-client.js +1 -0
- package/dist/deprecated/opencode-errors.d.ts +1 -0
- package/dist/deprecated/opencode-errors.js +1 -0
- package/dist/deprecated/opencode-pending-store.d.ts +1 -0
- package/dist/deprecated/opencode-pending-store.js +1 -0
- package/dist/deprecated/platform-client.d.ts +1 -0
- package/dist/deprecated/platform-client.js +1 -0
- package/dist/deprecated/projects-client.d.ts +1 -0
- package/dist/deprecated/projects-client.js +1 -0
- package/dist/deprecated/sandbox-connection-store.d.ts +1 -0
- package/dist/deprecated/sandbox-connection-store.js +1 -0
- package/dist/deprecated/server-store.d.ts +1 -0
- package/dist/deprecated/server-store.js +1 -0
- package/dist/deprecated/session-url.d.ts +1 -0
- package/dist/deprecated/session-url.js +1 -0
- package/dist/deprecated/session.d.ts +1 -0
- package/dist/deprecated/session.js +1 -0
- package/dist/deprecated/sync-store.d.ts +1 -0
- package/dist/deprecated/sync-store.js +1 -0
- package/dist/deprecated/turns.d.ts +1 -0
- package/dist/deprecated/turns.js +1 -0
- package/dist/index.d.ts +61 -0
- package/dist/index.js +53 -0
- package/dist/internal/diagnostics-store.d.ts +1 -0
- package/dist/internal/diagnostics-store.js +1 -0
- package/dist/internal/idb-sync-cache.d.ts +1 -0
- package/dist/internal/idb-sync-cache.js +1 -0
- package/dist/internal/managed-storage.d.ts +1 -0
- package/dist/internal/managed-storage.js +1 -0
- package/dist/internal/opencode-pending-store.d.ts +1 -0
- package/dist/internal/opencode-pending-store.js +1 -0
- package/dist/internal/sandbox-connection-store.d.ts +1 -0
- package/dist/internal/sandbox-connection-store.js +1 -0
- package/dist/internal/server-store.d.ts +1 -0
- package/dist/internal/server-store.js +1 -0
- package/dist/internal/sync-store.d.ts +1 -0
- package/dist/internal/sync-store.js +1 -0
- package/dist/node/app-guard.d.ts +36 -0
- package/dist/node/app-guard.js +118 -0
- package/dist/node/app-viewer.d.ts +30 -0
- package/dist/node/app-viewer.js +113 -0
- package/dist/node/auth.d.ts +52 -0
- package/dist/node/auth.js +387 -0
- package/dist/node/scoped-client.d.ts +9 -0
- package/dist/node/scoped-client.js +106 -0
- package/dist/node/server.d.ts +8 -0
- package/dist/node/server.js +5 -0
- package/dist/platform/auth-core.d.ts +10 -0
- package/dist/platform/auth-core.js +44 -0
- package/dist/platform/config-node.d.ts +4 -0
- package/dist/platform/config-node.js +13 -0
- package/dist/platform/session-id.d.ts +1 -0
- package/dist/platform/session-id.js +15 -0
- package/dist/platform/storage/managed-storage.d.ts +25 -0
- package/dist/platform/storage/managed-storage.js +215 -0
- package/dist/platform/strings.d.ts +1 -0
- package/dist/platform/strings.js +6 -0
- package/dist/platform/ui.d.ts +5 -0
- package/dist/platform/ui.js +16 -0
- package/dist/react/agent-selection-scope.d.ts +7 -0
- package/dist/react/agent-selection-scope.js +3 -0
- package/dist/react/bedrock-invokable.d.ts +1 -0
- package/dist/react/bedrock-invokable.js +1 -0
- package/dist/react/chat/index.d.ts +2 -0
- package/dist/react/chat/index.js +3 -0
- package/dist/react/chat/render-parts.d.ts +11 -0
- package/dist/react/chat/render-parts.js +10 -0
- package/dist/react/chat/use-chat-turns.d.ts +9 -0
- package/dist/react/chat/use-chat-turns.js +9 -0
- package/dist/react/connector-setup.d.ts +21 -0
- package/dist/react/connector-setup.js +130 -0
- package/dist/react/file-keys.d.ts +16 -0
- package/dist/react/file-keys.js +16 -0
- package/dist/react/hold-live-start.d.ts +3 -0
- package/dist/react/hold-live-start.js +27 -0
- package/dist/react/human-presence.d.ts +15 -0
- package/dist/react/human-presence.js +62 -0
- package/dist/react/identity-reset-registry.d.ts +2 -0
- package/dist/react/identity-reset-registry.js +14 -0
- package/dist/react/index.d.ts +62 -0
- package/dist/react/index.js +63 -0
- package/dist/react/initial-session-pin.d.ts +14 -0
- package/dist/react/initial-session-pin.js +28 -0
- package/dist/react/invalidate-project.d.ts +22 -0
- package/dist/react/invalidate-project.js +26 -0
- package/dist/react/model-flatten.d.ts +1 -0
- package/dist/react/model-flatten.js +1 -0
- package/dist/react/opencode.d.ts +43 -0
- package/dist/react/opencode.js +43 -0
- package/dist/react/prefetch-session-open.d.ts +5 -0
- package/dist/react/prefetch-session-open.js +48 -0
- package/dist/react/prefetch-session-start.d.ts +2 -0
- package/dist/react/prefetch-session-start.js +9 -0
- package/dist/react/provider-refresh.d.ts +9 -0
- package/dist/react/provider-refresh.js +72 -0
- package/dist/react/provider-selection.d.ts +1 -0
- package/dist/react/provider-selection.js +1 -0
- package/dist/react/pty-query-state.d.ts +2 -0
- package/dist/react/pty-query-state.js +6 -0
- package/dist/react/query-contracts.d.ts +49 -0
- package/dist/react/query-contracts.js +63 -0
- package/dist/react/query-keys.d.ts +105 -0
- package/dist/react/query-keys.js +115 -0
- package/dist/react/reset-identity-state.d.ts +2 -0
- package/dist/react/reset-identity-state.js +19 -0
- package/dist/react/retired-endpoint.d.ts +3 -0
- package/dist/react/retired-endpoint.js +15 -0
- package/dist/react/route-project.d.ts +6 -0
- package/dist/react/route-project.js +9 -0
- package/dist/react/run-pty-command.d.ts +4 -0
- package/dist/react/run-pty-command.js +41 -0
- package/dist/react/runtime-actions.d.ts +31 -0
- package/dist/react/runtime-actions.js +87 -0
- package/dist/react/self-heal-poll-gate.d.ts +8 -0
- package/dist/react/self-heal-poll-gate.js +5 -0
- package/dist/react/session-agent-name-guard.d.ts +1 -0
- package/dist/react/session-agent-name-guard.js +5 -0
- package/dist/react/session-cache-write.d.ts +8 -0
- package/dist/react/session-cache-write.js +116 -0
- package/dist/react/session-start-giveup.d.ts +4 -0
- package/dist/react/session-start-giveup.js +5 -0
- package/dist/react/session-start-stash.d.ts +17 -0
- package/dist/react/session-start-stash.js +146 -0
- package/dist/react/session-stop.d.ts +20 -0
- package/dist/react/session-stop.js +63 -0
- package/dist/react/session-title-sync.d.ts +12 -0
- package/dist/react/session-title-sync.js +88 -0
- package/dist/react/session-transcript-subscription.d.ts +7 -0
- package/dist/react/session-transcript-subscription.js +71 -0
- package/dist/react/sign-in-with-beeuni.d.ts +330 -0
- package/dist/react/sign-in-with-beeuni.js +51 -0
- package/dist/react/teams-install-polling.d.ts +3 -0
- package/dist/react/teams-install-polling.js +4 -0
- package/dist/react/use-accounts.d.ts +47 -0
- package/dist/react/use-accounts.js +31 -0
- package/dist/react/use-admin-accounts.d.ts +236 -0
- package/dist/react/use-admin-accounts.js +287 -0
- package/dist/react/use-admin-activity-analytics.d.ts +48 -0
- package/dist/react/use-admin-activity-analytics.js +47 -0
- package/dist/react/use-admin-analytics.d.ts +331 -0
- package/dist/react/use-admin-analytics.js +85 -0
- package/dist/react/use-admin-billing.d.ts +26 -0
- package/dist/react/use-admin-billing.js +13 -0
- package/dist/react/use-admin-feedback.d.ts +118 -0
- package/dist/react/use-admin-feedback.js +46 -0
- package/dist/react/use-admin-projects.d.ts +31 -0
- package/dist/react/use-admin-projects.js +27 -0
- package/dist/react/use-admin-providers.d.ts +20 -0
- package/dist/react/use-admin-providers.js +45 -0
- package/dist/react/use-admin-role.d.ts +4 -0
- package/dist/react/use-admin-role.js +15 -0
- package/dist/react/use-admin-sandboxes.d.ts +156 -0
- package/dist/react/use-admin-sandboxes.js +52 -0
- package/dist/react/use-authenticated-preview-url.d.ts +3 -0
- package/dist/react/use-authenticated-preview-url.js +96 -0
- package/dist/react/use-beeuni-app-viewer.d.ts +12 -0
- package/dist/react/use-beeuni-app-viewer.js +19 -0
- package/dist/react/use-beeuni-master.d.ts +333 -0
- package/dist/react/use-beeuni-master.js +845 -0
- package/dist/react/use-can.d.ts +35 -0
- package/dist/react/use-can.js +129 -0
- package/dist/react/use-canonical-opencode-session.d.ts +21 -0
- package/dist/react/use-canonical-opencode-session.js +44 -0
- package/dist/react/use-change-requests.d.ts +291 -0
- package/dist/react/use-change-requests.js +31 -0
- package/dist/react/use-connector-query.d.ts +7 -0
- package/dist/react/use-connector-query.js +23 -0
- package/dist/react/use-current-runtime.d.ts +2 -0
- package/dist/react/use-current-runtime.js +6 -0
- package/dist/react/use-feature-flag.d.ts +6 -0
- package/dist/react/use-feature-flag.js +25 -0
- package/dist/react/use-gateway-catalog-sync.d.ts +1 -0
- package/dist/react/use-gateway-catalog-sync.js +40 -0
- package/dist/react/use-gateway-routing-policy.d.ts +8 -0
- package/dist/react/use-gateway-routing-policy.js +36 -0
- package/dist/react/use-impersonation.d.ts +20 -0
- package/dist/react/use-impersonation.js +55 -0
- package/dist/react/use-model-access.d.ts +9 -0
- package/dist/react/use-model-access.js +46 -0
- package/dist/react/use-model-defaults.d.ts +23 -0
- package/dist/react/use-model-defaults.js +115 -0
- package/dist/react/use-model-enablement.d.ts +8 -0
- package/dist/react/use-model-enablement.js +69 -0
- package/dist/react/use-model-store.d.ts +47 -0
- package/dist/react/use-model-store.js +234 -0
- package/dist/react/use-notifications.d.ts +618 -0
- package/dist/react/use-notifications.js +104 -0
- package/dist/react/use-opencode-config.d.ts +12 -0
- package/dist/react/use-opencode-config.js +69 -0
- package/dist/react/use-opencode-events/diagnostics.d.ts +4 -0
- package/dist/react/use-opencode-events/diagnostics.js +42 -0
- package/dist/react/use-opencode-events/handle-event.d.ts +23 -0
- package/dist/react/use-opencode-events/handle-event.js +57 -0
- package/dist/react/use-opencode-events/handle-interaction-event.d.ts +3 -0
- package/dist/react/use-opencode-events/handle-interaction-event.js +41 -0
- package/dist/react/use-opencode-events/handle-message-event.d.ts +3 -0
- package/dist/react/use-opencode-events/handle-message-event.js +32 -0
- package/dist/react/use-opencode-events/handle-session-event.d.ts +4 -0
- package/dist/react/use-opencode-events/handle-session-event.js +240 -0
- package/dist/react/use-opencode-events/handle-workspace-event.d.ts +3 -0
- package/dist/react/use-opencode-events/handle-workspace-event.js +112 -0
- package/dist/react/use-opencode-events/handler-context.d.ts +28 -0
- package/dist/react/use-opencode-events/handler-context.js +1 -0
- package/dist/react/use-opencode-events/helpers.d.ts +27 -0
- package/dist/react/use-opencode-events/helpers.js +126 -0
- package/dist/react/use-opencode-events/hydrate-core.d.ts +22 -0
- package/dist/react/use-opencode-events/hydrate-core.js +78 -0
- package/dist/react/use-opencode-events/index.d.ts +9 -0
- package/dist/react/use-opencode-events/index.js +181 -0
- package/dist/react/use-opencode-events/rehydrate-targets.d.ts +1 -0
- package/dist/react/use-opencode-events/rehydrate-targets.js +3 -0
- package/dist/react/use-opencode-events/runtime-stream-signals.d.ts +19 -0
- package/dist/react/use-opencode-events/runtime-stream-signals.js +22 -0
- package/dist/react/use-opencode-events/stream-revival.d.ts +11 -0
- package/dist/react/use-opencode-events/stream-revival.js +60 -0
- package/dist/react/use-opencode-events/types.d.ts +2 -0
- package/dist/react/use-opencode-events/types.js +1 -0
- package/dist/react/use-opencode-events/use-event-stream-refs.d.ts +16 -0
- package/dist/react/use-opencode-events/use-event-stream-refs.js +129 -0
- package/dist/react/use-opencode-local.d.ts +72 -0
- package/dist/react/use-opencode-local.js +306 -0
- package/dist/react/use-opencode-mcp.d.ts +29 -0
- package/dist/react/use-opencode-mcp.js +149 -0
- package/dist/react/use-opencode-pty.d.ts +39 -0
- package/dist/react/use-opencode-pty.js +61 -0
- package/dist/react/use-opencode-sessions/agents.d.ts +11 -0
- package/dist/react/use-opencode-sessions/agents.js +57 -0
- package/dist/react/use-opencode-sessions/commands.d.ts +16 -0
- package/dist/react/use-opencode-sessions/commands.js +42 -0
- package/dist/react/use-opencode-sessions/files.d.ts +2 -0
- package/dist/react/use-opencode-sessions/files.js +144 -0
- package/dist/react/use-opencode-sessions/index.d.ts +15 -0
- package/dist/react/use-opencode-sessions/index.js +15 -0
- package/dist/react/use-opencode-sessions/keys.d.ts +102 -0
- package/dist/react/use-opencode-sessions/keys.js +38 -0
- package/dist/react/use-opencode-sessions/mcp.d.ts +2 -0
- package/dist/react/use-opencode-sessions/mcp.js +19 -0
- package/dist/react/use-opencode-sessions/messages.d.ts +57 -0
- package/dist/react/use-opencode-sessions/messages.js +342 -0
- package/dist/react/use-opencode-sessions/no-compaction-model-error.d.ts +3 -0
- package/dist/react/use-opencode-sessions/no-compaction-model-error.js +6 -0
- package/dist/react/use-opencode-sessions/parts.d.ts +12 -0
- package/dist/react/use-opencode-sessions/parts.js +31 -0
- package/dist/react/use-opencode-sessions/permissions.d.ts +5 -0
- package/dist/react/use-opencode-sessions/permissions.js +44 -0
- package/dist/react/use-opencode-sessions/projects.d.ts +6 -0
- package/dist/react/use-opencode-sessions/projects.js +49 -0
- package/dist/react/use-opencode-sessions/provider-load-plan.d.ts +5 -0
- package/dist/react/use-opencode-sessions/provider-load-plan.js +3 -0
- package/dist/react/use-opencode-sessions/providers.d.ts +10 -0
- package/dist/react/use-opencode-sessions/providers.js +98 -0
- package/dist/react/use-opencode-sessions/sessions.d.ts +34 -0
- package/dist/react/use-opencode-sessions/sessions.js +330 -0
- package/dist/react/use-opencode-sessions/shared.d.ts +10 -0
- package/dist/react/use-opencode-sessions/shared.js +36 -0
- package/dist/react/use-opencode-sessions/sharing.d.ts +3 -0
- package/dist/react/use-opencode-sessions/sharing.js +51 -0
- package/dist/react/use-opencode-sessions/tools.d.ts +5 -0
- package/dist/react/use-opencode-sessions/tools.js +48 -0
- package/dist/react/use-opencode-sessions/vcs.d.ts +7 -0
- package/dist/react/use-opencode-sessions/vcs.js +24 -0
- package/dist/react/use-ops-overview.d.ts +63 -0
- package/dist/react/use-ops-overview.js +15 -0
- package/dist/react/use-permission-self-heal.d.ts +10 -0
- package/dist/react/use-permission-self-heal.js +114 -0
- package/dist/react/use-poll-owner.d.ts +1 -0
- package/dist/react/use-poll-owner.js +14 -0
- package/dist/react/use-project-apps.d.ts +879 -0
- package/dist/react/use-project-apps.js +185 -0
- package/dist/react/use-project-config.d.ts +2 -0
- package/dist/react/use-project-config.js +16 -0
- package/dist/react/use-project-files.d.ts +87 -0
- package/dist/react/use-project-files.js +109 -0
- package/dist/react/use-project-gateway.d.ts +26 -0
- package/dist/react/use-project-gateway.js +111 -0
- package/dist/react/use-project-llm-gateway.d.ts +6 -0
- package/dist/react/use-project-llm-gateway.js +20 -0
- package/dist/react/use-project-models.d.ts +4 -0
- package/dist/react/use-project-models.js +31 -0
- package/dist/react/use-project-name.d.ts +4 -0
- package/dist/react/use-project-name.js +35 -0
- package/dist/react/use-project-secrets.d.ts +279 -0
- package/dist/react/use-project-secrets.js +34 -0
- package/dist/react/use-project-session.d.ts +4 -0
- package/dist/react/use-project-session.js +18 -0
- package/dist/react/use-project-sessions.d.ts +447 -0
- package/dist/react/use-project-sessions.js +86 -0
- package/dist/react/use-project-starter-suggestions.d.ts +2 -0
- package/dist/react/use-project-starter-suggestions.js +13 -0
- package/dist/react/use-project-triggers.d.ts +221 -0
- package/dist/react/use-project-triggers.js +53 -0
- package/dist/react/use-prompt-attachments.d.ts +3 -0
- package/dist/react/use-prompt-attachments.js +34 -0
- package/dist/react/use-provider-secrets.d.ts +229 -0
- package/dist/react/use-provider-secrets.js +38 -0
- package/dist/react/use-question-self-heal.d.ts +7 -0
- package/dist/react/use-question-self-heal.js +81 -0
- package/dist/react/use-reminders.d.ts +501 -0
- package/dist/react/use-reminders.js +51 -0
- package/dist/react/use-runtime-boot-stalled.d.ts +2 -0
- package/dist/react/use-runtime-boot-stalled.js +18 -0
- package/dist/react/use-runtime-phase.d.ts +2 -0
- package/dist/react/use-runtime-phase.js +13 -0
- package/dist/react/use-runtime-reconnect.d.ts +52 -0
- package/dist/react/use-runtime-reconnect.js +248 -0
- package/dist/react/use-runtime-supports.d.ts +2 -0
- package/dist/react/use-runtime-supports.js +5 -0
- package/dist/react/use-sandbox-image.d.ts +33 -0
- package/dist/react/use-sandbox-image.js +119 -0
- package/dist/react/use-session-audit.d.ts +4 -0
- package/dist/react/use-session-audit.js +25 -0
- package/dist/react/use-session-message-authors.d.ts +1 -0
- package/dist/react/use-session-message-authors.js +14 -0
- package/dist/react/use-session-messages.d.ts +11 -0
- package/dist/react/use-session-messages.js +62 -0
- package/dist/react/use-session-model-selection.d.ts +8 -0
- package/dist/react/use-session-model-selection.js +20 -0
- package/dist/react/use-session-model-usage.d.ts +1 -0
- package/dist/react/use-session-model-usage.js +13 -0
- package/dist/react/use-session-participants.d.ts +4 -0
- package/dist/react/use-session-participants.js +13 -0
- package/dist/react/use-session-phase.d.ts +8 -0
- package/dist/react/use-session-phase.js +9 -0
- package/dist/react/use-session-picks.d.ts +13 -0
- package/dist/react/use-session-picks.js +65 -0
- package/dist/react/use-session-prefetch.d.ts +6 -0
- package/dist/react/use-session-prefetch.js +22 -0
- package/dist/react/use-session-prompts.d.ts +53 -0
- package/dist/react/use-session-prompts.js +378 -0
- package/dist/react/use-session-send.d.ts +97 -0
- package/dist/react/use-session-send.js +233 -0
- package/dist/react/use-session-start-give-up.d.ts +19 -0
- package/dist/react/use-session-start-give-up.js +59 -0
- package/dist/react/use-session-stream.d.ts +17 -0
- package/dist/react/use-session-stream.js +181 -0
- package/dist/react/use-session-sync.d.ts +43 -0
- package/dist/react/use-session-sync.js +252 -0
- package/dist/react/use-session-transcript-history.d.ts +6 -0
- package/dist/react/use-session-transcript-history.js +38 -0
- package/dist/react/use-session-working.d.ts +37 -0
- package/dist/react/use-session-working.js +217 -0
- package/dist/react/use-session.d.ts +201 -0
- package/dist/react/use-session.js +893 -0
- package/dist/react/use-sessions-needing-input.d.ts +5 -0
- package/dist/react/use-sessions-needing-input.js +23 -0
- package/dist/react/use-static-file-preview.d.ts +9 -0
- package/dist/react/use-static-file-preview.js +72 -0
- package/dist/react/use-system-status.d.ts +38 -0
- package/dist/react/use-system-status.js +5 -0
- package/dist/react/use-teams-installations.d.ts +41 -0
- package/dist/react/use-teams-installations.js +95 -0
- package/dist/react/use-tunnel.d.ts +165 -0
- package/dist/react/use-tunnel.js +186 -0
- package/dist/react/use-visible-agents.d.ts +9 -0
- package/dist/react/use-visible-agents.js +12 -0
- package/dist/react/use-wake-escalation.d.ts +31 -0
- package/dist/react/use-wake-escalation.js +82 -0
- package/dist/transcript.d.ts +50 -0
- package/dist/transcript.js +93 -0
- package/dist/workspace-search/client.d.ts +19 -0
- package/dist/workspace-search/client.js +229 -0
- package/dist/workspace-search/core.d.ts +21 -0
- package/dist/workspace-search/core.js +259 -0
- package/dist/workspace-search/index.d.ts +2 -0
- package/dist/workspace-search/index.js +2 -0
- package/package.json +178 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { SessionTurnEndError, SessionTurnEnded, SessionTurnFailure } from '../rest/projects-client/sessions.js';
|
|
2
|
+
export interface SessionTurnOutcome {
|
|
3
|
+
last_ended?: SessionTurnEnded;
|
|
4
|
+
recent_failures?: SessionTurnFailure[];
|
|
5
|
+
atMs?: number;
|
|
6
|
+
}
|
|
7
|
+
export declare function turnEndCause(outcome: SessionTurnOutcome | undefined, messageId: string | null | undefined): SessionTurnEndError | null;
|
|
8
|
+
export type TurnEndNotice = {
|
|
9
|
+
kind: 'sandbox-memory';
|
|
10
|
+
usedPct: number | null;
|
|
11
|
+
detail: string | null;
|
|
12
|
+
} | {
|
|
13
|
+
kind: 'cause';
|
|
14
|
+
name: string | null;
|
|
15
|
+
message: string;
|
|
16
|
+
} | {
|
|
17
|
+
kind: 'unexplained';
|
|
18
|
+
};
|
|
19
|
+
export declare function turnEndNotice(outcome: SessionTurnOutcome | undefined, messageId: string | null | undefined, transcript: {
|
|
20
|
+
hasError: boolean;
|
|
21
|
+
isAbort: boolean;
|
|
22
|
+
}): TurnEndNotice | null;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { isAbortError } from '../http/abort-error.js';
|
|
2
|
+
import { TURN_END_SETTLE_MS } from './turn-end-settle.js';
|
|
3
|
+
export function turnEndCause(outcome, messageId) {
|
|
4
|
+
if (!outcome || !messageId)
|
|
5
|
+
return null;
|
|
6
|
+
const listed = outcome.recent_failures?.find((failure) => failure.message_id === messageId);
|
|
7
|
+
const lastEnded = outcome.last_ended;
|
|
8
|
+
const error = listed?.error ??
|
|
9
|
+
(lastEnded?.message_id === messageId && lastEnded.end_reason === 'failed'
|
|
10
|
+
? lastEnded.error
|
|
11
|
+
: undefined);
|
|
12
|
+
if (!error?.message)
|
|
13
|
+
return null;
|
|
14
|
+
if (isAbortError({ name: error.name ?? undefined, message: error.message }))
|
|
15
|
+
return null;
|
|
16
|
+
return error;
|
|
17
|
+
}
|
|
18
|
+
const SANDBOX_MEMORY_GUARD = 'SandboxMemoryGuard';
|
|
19
|
+
export function turnEndNotice(outcome, messageId, transcript) {
|
|
20
|
+
if (!outcome || !messageId)
|
|
21
|
+
return null;
|
|
22
|
+
if (transcript.hasError && !transcript.isAbort)
|
|
23
|
+
return null;
|
|
24
|
+
const cause = turnEndCause(outcome, messageId);
|
|
25
|
+
if (cause?.message) {
|
|
26
|
+
if (cause.name !== SANDBOX_MEMORY_GUARD) {
|
|
27
|
+
return { kind: 'cause', name: cause.name, message: cause.message };
|
|
28
|
+
}
|
|
29
|
+
const pct = cause.message.match(/(\d{1,3})%/)?.[1];
|
|
30
|
+
const detail = cause.message.split(':')[0]?.trim() || null;
|
|
31
|
+
return { kind: 'sandbox-memory', usedPct: pct ? Number(pct) : null, detail };
|
|
32
|
+
}
|
|
33
|
+
const listed = outcome.recent_failures?.find((failure) => failure.message_id === messageId);
|
|
34
|
+
if (!listed)
|
|
35
|
+
return null;
|
|
36
|
+
const endedMs = listed.ended_at ? Date.parse(listed.ended_at) : Number.NaN;
|
|
37
|
+
const provisional = Number.isFinite(endedMs) &&
|
|
38
|
+
typeof outcome.atMs === 'number' &&
|
|
39
|
+
outcome.atMs - endedMs < TURN_END_SETTLE_MS;
|
|
40
|
+
return provisional ? null : { kind: 'unexplained' };
|
|
41
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const TURN_END_SETTLE_MS = 2500;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const TURN_END_SETTLE_MS = 2_500;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
export interface DetectedLocalhostUrl {
|
|
2
|
+
originalUrl: string;
|
|
3
|
+
port: number;
|
|
4
|
+
path: string;
|
|
5
|
+
startIndex: number;
|
|
6
|
+
endIndex: number;
|
|
7
|
+
inCodeBlock: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface ParsedLocalhostUrl {
|
|
10
|
+
originalUrl: string;
|
|
11
|
+
port: number;
|
|
12
|
+
path: string;
|
|
13
|
+
}
|
|
14
|
+
export interface SubdomainUrlOptions {
|
|
15
|
+
sandboxId: string;
|
|
16
|
+
backendPort: number;
|
|
17
|
+
apiBaseUrl: string;
|
|
18
|
+
previewUrlTemplate?: string | null;
|
|
19
|
+
}
|
|
20
|
+
export declare function isAppRouteUrl(rawUrl: string | undefined): boolean;
|
|
21
|
+
export declare function parseLocalhostUrl(rawUrl: string | undefined): ParsedLocalhostUrl | null;
|
|
22
|
+
export declare function detectLocalhostUrls(text: string): DetectedLocalhostUrl[];
|
|
23
|
+
export declare function hasLocalhostUrls(text: string): boolean;
|
|
24
|
+
export declare function stripTrailingSlashes(value: string): string;
|
|
25
|
+
export declare function hasPreviewTarget(subdomainOpts: SubdomainUrlOptions): boolean;
|
|
26
|
+
export declare function rewriteLocalhostUrl(port: number, path: string, subdomainOpts: SubdomainUrlOptions): string;
|
|
27
|
+
export declare function buildStaticFilePreviewUrl(filePath: string | undefined, options: SubdomainUrlOptions): string | undefined;
|
|
28
|
+
export declare function buildStaticFileServicePath(filePath: string): string;
|
|
29
|
+
export declare function buildStaticFileLocalUrl(filePath: string): string;
|
|
30
|
+
export declare function getStaticFileHealthPath(): string;
|
|
31
|
+
export declare function buildStaticFileHealthPreviewUrl(options: SubdomainUrlOptions): string;
|
|
32
|
+
export declare function getProxyBaseUrl(port: number, subdomainOpts: SubdomainUrlOptions): string;
|
|
33
|
+
export declare function isProxiableLocalhostUrl(url: string): boolean;
|
|
34
|
+
export declare function proxyLocalhostUrl(url: string | undefined, subdomainOpts: SubdomainUrlOptions): string | undefined;
|
|
35
|
+
export declare function toInternalUrl(port: number, path?: string): string;
|
|
36
|
+
export declare function parseSubdomainUrl(url: string): {
|
|
37
|
+
port: number;
|
|
38
|
+
sandboxId: string;
|
|
39
|
+
backendPort: number;
|
|
40
|
+
path: string;
|
|
41
|
+
} | null;
|
|
42
|
+
export declare function proxyUrlToInternal(proxyUrl: string): string | null;
|
|
43
|
+
export declare function isPreviewUrl(url: string): boolean;
|
|
44
|
+
export declare function isInternalLocalhostUrl(url: string): boolean;
|
|
45
|
+
export declare function buildWebProxyUrl(targetUrl: string, subdomainOpts: SubdomainUrlOptions): string | null;
|
|
46
|
+
export declare function parseWebProxyUrl(proxyUrl: string): string | null;
|
|
47
|
+
export declare function isWebProxyUrl(url: string): boolean;
|
|
48
|
+
export declare function isExternalUrl(rawUrl: string): boolean;
|
|
49
|
+
export declare function normalizeExternalInput(input: string): string | null;
|
|
@@ -0,0 +1,415 @@
|
|
|
1
|
+
import { SANDBOX_PORTS } from '../rest/platform-client/types.js';
|
|
2
|
+
const LOCALHOST_URL_REGEX = /https?:\/\/(?:localhost|127\.0\.0\.1):\d{1,5}[^\s)"'<>]*/g;
|
|
3
|
+
const SUBDOMAIN_URL_REGEX = /^https?:\/\/p(\d+)-([^.]+)\.localhost(?::(\d+))?(\/.*)?$/;
|
|
4
|
+
const PREVIEW_ORIGIN_URL_REGEX = /^https?:\/\/(?:dev|staging|prod|preview)-p(\d+)-([a-z0-9-]+)\.[^/]+?(?::(\d+))?(\/.*)?$/i;
|
|
5
|
+
const EXCLUDED_PORTS = new Set([
|
|
6
|
+
22,
|
|
7
|
+
4096,
|
|
8
|
+
parseInt(SANDBOX_PORTS.BEEUNI_MASTER, 10),
|
|
9
|
+
]);
|
|
10
|
+
function isSubdomainUrl(url) {
|
|
11
|
+
return SUBDOMAIN_URL_REGEX.test(url);
|
|
12
|
+
}
|
|
13
|
+
function normalizePath(path) {
|
|
14
|
+
if (!path)
|
|
15
|
+
return '/';
|
|
16
|
+
let normalized = path;
|
|
17
|
+
const markdownBoundary = normalized.indexOf('](');
|
|
18
|
+
if (markdownBoundary !== -1) {
|
|
19
|
+
normalized = normalized.slice(0, markdownBoundary);
|
|
20
|
+
}
|
|
21
|
+
const encodedBoundary = normalized.toLowerCase().indexOf('%5d(');
|
|
22
|
+
if (encodedBoundary !== -1) {
|
|
23
|
+
normalized = normalized.slice(0, encodedBoundary);
|
|
24
|
+
}
|
|
25
|
+
if (!normalized)
|
|
26
|
+
return '/';
|
|
27
|
+
return normalized.startsWith('/') ? normalized : `/${normalized}`;
|
|
28
|
+
}
|
|
29
|
+
function stripMarkdownArtifacts(url) {
|
|
30
|
+
const markerIndex = url.indexOf('](');
|
|
31
|
+
if (markerIndex === -1)
|
|
32
|
+
return url;
|
|
33
|
+
return url.slice(0, markerIndex);
|
|
34
|
+
}
|
|
35
|
+
const LEADING_WRAPPERS = new Set(["'", '"', '`', '<', '(', '[']);
|
|
36
|
+
const TRAILING_WRAPPERS = new Set(['>', "'", '"', '`', ')', ']', ',', ';', '.', '!', '?']);
|
|
37
|
+
function stripUrlWrappers(url) {
|
|
38
|
+
let start = 0;
|
|
39
|
+
let end = url.length;
|
|
40
|
+
while (start < end && (url[start] === ' ' || url[start] === '\t'))
|
|
41
|
+
start++;
|
|
42
|
+
while (end > start && (url[end - 1] === ' ' || url[end - 1] === '\t'))
|
|
43
|
+
end--;
|
|
44
|
+
while (start < end && LEADING_WRAPPERS.has(url[start]))
|
|
45
|
+
start++;
|
|
46
|
+
while (end > start && TRAILING_WRAPPERS.has(url[end - 1]))
|
|
47
|
+
end--;
|
|
48
|
+
return url.slice(start, end);
|
|
49
|
+
}
|
|
50
|
+
function extractLocalhostCandidate(text) {
|
|
51
|
+
const match = text.match(/https?:\/\/(?:localhost|127\.0\.0\.1):\d{1,5}[^\s"'<>)]*/i);
|
|
52
|
+
return match?.[0] ?? null;
|
|
53
|
+
}
|
|
54
|
+
const BEEUNI_MASTER_PROXY_REGEX = /^\/proxy\/(\d{1,5})(\/.*)?$/;
|
|
55
|
+
const APP_ROUTE_PREFIXES = /^\/(connectors|settings|dashboard|projects|agents|skills|tools|commands|support|changelog|files|p|browser|desktop|terminal|sessions|services|workspace|channels|scheduled-tasks|marketplace|templates|tunnel|admin|auth)(\/|$|\?)/;
|
|
56
|
+
export function isAppRouteUrl(rawUrl) {
|
|
57
|
+
if (!rawUrl)
|
|
58
|
+
return false;
|
|
59
|
+
try {
|
|
60
|
+
const parsed = new URL(rawUrl);
|
|
61
|
+
if (parsed.hostname !== 'localhost' && parsed.hostname !== '127.0.0.1')
|
|
62
|
+
return false;
|
|
63
|
+
return APP_ROUTE_PREFIXES.test(parsed.pathname);
|
|
64
|
+
}
|
|
65
|
+
catch {
|
|
66
|
+
return false;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
export function parseLocalhostUrl(rawUrl) {
|
|
70
|
+
if (!rawUrl)
|
|
71
|
+
return null;
|
|
72
|
+
const candidate = stripUrlWrappers(stripMarkdownArtifacts(rawUrl.trim()));
|
|
73
|
+
const subdomain = parseSubdomainUrl(candidate);
|
|
74
|
+
if (subdomain) {
|
|
75
|
+
const path = normalizePath(subdomain.path || '/');
|
|
76
|
+
return {
|
|
77
|
+
originalUrl: `http://localhost:${subdomain.port}${path}`,
|
|
78
|
+
port: subdomain.port,
|
|
79
|
+
path,
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
try {
|
|
83
|
+
const parsed = new URL(candidate);
|
|
84
|
+
if (parsed.protocol !== 'http:' && parsed.protocol !== 'https:')
|
|
85
|
+
return null;
|
|
86
|
+
if (parsed.hostname !== 'localhost' && parsed.hostname !== '127.0.0.1')
|
|
87
|
+
return null;
|
|
88
|
+
if (!parsed.port)
|
|
89
|
+
return null;
|
|
90
|
+
let port = parseInt(parsed.port, 10);
|
|
91
|
+
if (!Number.isInteger(port) || port < 1 || port > 65535)
|
|
92
|
+
return null;
|
|
93
|
+
let pathStr = `${parsed.pathname || '/'}${parsed.search}${parsed.hash}`;
|
|
94
|
+
const beeuniMasterPort = parseInt(SANDBOX_PORTS.BEEUNI_MASTER, 10);
|
|
95
|
+
if (port === beeuniMasterPort) {
|
|
96
|
+
const proxyMatch = parsed.pathname.match(BEEUNI_MASTER_PROXY_REGEX);
|
|
97
|
+
if (proxyMatch) {
|
|
98
|
+
const realPort = parseInt(proxyMatch[1], 10);
|
|
99
|
+
if (realPort >= 1 && realPort <= 65535) {
|
|
100
|
+
port = realPort;
|
|
101
|
+
pathStr = normalizePath(`${proxyMatch[2] || '/'}${parsed.search}${parsed.hash}`);
|
|
102
|
+
return {
|
|
103
|
+
originalUrl: `http://localhost:${port}${pathStr}`,
|
|
104
|
+
port,
|
|
105
|
+
path: pathStr,
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
const path = normalizePath(pathStr);
|
|
111
|
+
return {
|
|
112
|
+
originalUrl: `${parsed.protocol}//${parsed.hostname}:${port}${path}`,
|
|
113
|
+
port,
|
|
114
|
+
path,
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
catch {
|
|
118
|
+
const extracted = extractLocalhostCandidate(rawUrl);
|
|
119
|
+
if (extracted && extracted !== rawUrl) {
|
|
120
|
+
return parseLocalhostUrl(extracted);
|
|
121
|
+
}
|
|
122
|
+
return null;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
function getCodeRanges(text) {
|
|
126
|
+
const ranges = [];
|
|
127
|
+
const fencedRegex = /```[\s\S]*?```/g;
|
|
128
|
+
let m;
|
|
129
|
+
while ((m = fencedRegex.exec(text)) !== null) {
|
|
130
|
+
ranges.push([m.index, m.index + m[0].length]);
|
|
131
|
+
}
|
|
132
|
+
const inlineRegex = /`[^`\n]+`/g;
|
|
133
|
+
while ((m = inlineRegex.exec(text)) !== null) {
|
|
134
|
+
const start = m.index;
|
|
135
|
+
const end = start + m[0].length;
|
|
136
|
+
const insideFenced = ranges.some(([rs, re]) => start >= rs && end <= re);
|
|
137
|
+
if (!insideFenced) {
|
|
138
|
+
ranges.push([start, end]);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
return ranges;
|
|
142
|
+
}
|
|
143
|
+
function isInsideCodeBlock(index, ranges) {
|
|
144
|
+
return ranges.some(([start, end]) => index >= start && index < end);
|
|
145
|
+
}
|
|
146
|
+
export function detectLocalhostUrls(text) {
|
|
147
|
+
const results = [];
|
|
148
|
+
const seen = new Set();
|
|
149
|
+
const codeRanges = getCodeRanges(text);
|
|
150
|
+
LOCALHOST_URL_REGEX.lastIndex = 0;
|
|
151
|
+
let match;
|
|
152
|
+
while ((match = LOCALHOST_URL_REGEX.exec(text)) !== null) {
|
|
153
|
+
const parsed = parseLocalhostUrl(match[0]);
|
|
154
|
+
if (!parsed)
|
|
155
|
+
continue;
|
|
156
|
+
const { originalUrl, port, path } = parsed;
|
|
157
|
+
if (port < 1 || port > 65535 || EXCLUDED_PORTS.has(port))
|
|
158
|
+
continue;
|
|
159
|
+
if (seen.has(originalUrl))
|
|
160
|
+
continue;
|
|
161
|
+
seen.add(originalUrl);
|
|
162
|
+
results.push({
|
|
163
|
+
originalUrl,
|
|
164
|
+
port,
|
|
165
|
+
path,
|
|
166
|
+
startIndex: match.index,
|
|
167
|
+
endIndex: match.index + originalUrl.length,
|
|
168
|
+
inCodeBlock: isInsideCodeBlock(match.index, codeRanges),
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
return results;
|
|
172
|
+
}
|
|
173
|
+
export function hasLocalhostUrls(text) {
|
|
174
|
+
return detectLocalhostUrls(text).length > 0;
|
|
175
|
+
}
|
|
176
|
+
function isBackendOnLocalhost(apiBaseUrl) {
|
|
177
|
+
try {
|
|
178
|
+
const { hostname } = new URL(apiBaseUrl);
|
|
179
|
+
return hostname === 'localhost' || hostname === '127.0.0.1';
|
|
180
|
+
}
|
|
181
|
+
catch {
|
|
182
|
+
return false;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
function sandboxHostLabel(sandboxId) {
|
|
186
|
+
return sandboxId.trim().toLowerCase().split('_').join('-');
|
|
187
|
+
}
|
|
188
|
+
export function stripTrailingSlashes(value) {
|
|
189
|
+
let end = value.length;
|
|
190
|
+
while (end > 0 && value.charCodeAt(end - 1) === 47)
|
|
191
|
+
end--;
|
|
192
|
+
return value.slice(0, end);
|
|
193
|
+
}
|
|
194
|
+
function previewOriginUrl(port, safePath, opts) {
|
|
195
|
+
const template = opts.previewUrlTemplate;
|
|
196
|
+
if (!template || !template.includes('{port}') || !template.includes('{sandbox}'))
|
|
197
|
+
return null;
|
|
198
|
+
const origin = template
|
|
199
|
+
.split('{port}')
|
|
200
|
+
.join(String(port))
|
|
201
|
+
.split('{sandbox}')
|
|
202
|
+
.join(sandboxHostLabel(opts.sandboxId));
|
|
203
|
+
return `${stripTrailingSlashes(origin)}${safePath}`;
|
|
204
|
+
}
|
|
205
|
+
export function hasPreviewTarget(subdomainOpts) {
|
|
206
|
+
return subdomainOpts.sandboxId.trim().length > 0;
|
|
207
|
+
}
|
|
208
|
+
export function rewriteLocalhostUrl(port, path, subdomainOpts) {
|
|
209
|
+
const safePath = normalizePath(path);
|
|
210
|
+
if (!hasPreviewTarget(subdomainOpts))
|
|
211
|
+
return toInternalUrl(port, safePath);
|
|
212
|
+
const originUrl = previewOriginUrl(port, safePath, subdomainOpts);
|
|
213
|
+
if (originUrl)
|
|
214
|
+
return originUrl;
|
|
215
|
+
if (!isBackendOnLocalhost(subdomainOpts.apiBaseUrl)) {
|
|
216
|
+
const base = stripTrailingSlashes(subdomainOpts.apiBaseUrl);
|
|
217
|
+
return `${base}/p/${subdomainOpts.sandboxId}/${port}${safePath}`;
|
|
218
|
+
}
|
|
219
|
+
return `http://p${port}-${sandboxHostLabel(subdomainOpts.sandboxId)}.localhost:${subdomainOpts.backendPort}${safePath}`;
|
|
220
|
+
}
|
|
221
|
+
export function buildStaticFilePreviewUrl(filePath, options) {
|
|
222
|
+
if (!filePath)
|
|
223
|
+
return undefined;
|
|
224
|
+
const relativePath = filePath.replace(/^\/workspace\//, '').replace(/^\/+/, '');
|
|
225
|
+
const encodedPath = relativePath
|
|
226
|
+
.split('/')
|
|
227
|
+
.filter(Boolean)
|
|
228
|
+
.map((segment) => encodeURIComponent(segment))
|
|
229
|
+
.join('/');
|
|
230
|
+
return rewriteLocalhostUrl(3211, `/open?path=/workspace/${encodedPath}`, options);
|
|
231
|
+
}
|
|
232
|
+
export function buildStaticFileServicePath(filePath) {
|
|
233
|
+
const absolutePath = filePath.startsWith('/workspace')
|
|
234
|
+
? filePath
|
|
235
|
+
: `/workspace/${filePath.replace(/^\/+/, '')}`;
|
|
236
|
+
const encodedPath = absolutePath
|
|
237
|
+
.split('/')
|
|
238
|
+
.filter(Boolean)
|
|
239
|
+
.map((segment) => encodeURIComponent(segment))
|
|
240
|
+
.join('/');
|
|
241
|
+
return `/open?path=/${encodedPath}`;
|
|
242
|
+
}
|
|
243
|
+
export function buildStaticFileLocalUrl(filePath) {
|
|
244
|
+
return `http://localhost:3211${buildStaticFileServicePath(filePath)}`;
|
|
245
|
+
}
|
|
246
|
+
export function getStaticFileHealthPath() {
|
|
247
|
+
return '/health';
|
|
248
|
+
}
|
|
249
|
+
export function buildStaticFileHealthPreviewUrl(options) {
|
|
250
|
+
return rewriteLocalhostUrl(3211, getStaticFileHealthPath(), options);
|
|
251
|
+
}
|
|
252
|
+
export function getProxyBaseUrl(port, subdomainOpts) {
|
|
253
|
+
return rewriteLocalhostUrl(port, '/', subdomainOpts);
|
|
254
|
+
}
|
|
255
|
+
export function isProxiableLocalhostUrl(url) {
|
|
256
|
+
const parsed = parseLocalhostUrl(url);
|
|
257
|
+
if (!parsed)
|
|
258
|
+
return false;
|
|
259
|
+
if (EXCLUDED_PORTS.has(parsed.port))
|
|
260
|
+
return false;
|
|
261
|
+
if (isAppRouteUrl(url))
|
|
262
|
+
return false;
|
|
263
|
+
return true;
|
|
264
|
+
}
|
|
265
|
+
export function proxyLocalhostUrl(url, subdomainOpts) {
|
|
266
|
+
if (!url)
|
|
267
|
+
return url;
|
|
268
|
+
const parsed = parseLocalhostUrl(url);
|
|
269
|
+
if (!parsed)
|
|
270
|
+
return url;
|
|
271
|
+
if (!isProxiableLocalhostUrl(parsed.originalUrl))
|
|
272
|
+
return parsed.originalUrl;
|
|
273
|
+
return rewriteLocalhostUrl(parsed.port, parsed.path, subdomainOpts);
|
|
274
|
+
}
|
|
275
|
+
export function toInternalUrl(port, path = '/') {
|
|
276
|
+
return `http://localhost:${port}${path}`;
|
|
277
|
+
}
|
|
278
|
+
const PATH_PROXY_URL_REGEX = /^https?:\/\/[^/]+\/v1\/p\/([^/]+)\/(\d+)(\/.*)?$/;
|
|
279
|
+
export function parseSubdomainUrl(url) {
|
|
280
|
+
const subMatch = url.match(SUBDOMAIN_URL_REGEX);
|
|
281
|
+
if (subMatch) {
|
|
282
|
+
return {
|
|
283
|
+
port: parseInt(subMatch[1], 10),
|
|
284
|
+
sandboxId: subMatch[2],
|
|
285
|
+
backendPort: subMatch[3] ? parseInt(subMatch[3], 10) : 80,
|
|
286
|
+
path: subMatch[4] || '/',
|
|
287
|
+
};
|
|
288
|
+
}
|
|
289
|
+
const originMatch = url.match(PREVIEW_ORIGIN_URL_REGEX);
|
|
290
|
+
if (originMatch) {
|
|
291
|
+
let backendPort = 443;
|
|
292
|
+
try {
|
|
293
|
+
const parsed = new URL(url);
|
|
294
|
+
backendPort = parsed.port
|
|
295
|
+
? parseInt(parsed.port, 10)
|
|
296
|
+
: parsed.protocol === 'https:'
|
|
297
|
+
? 443
|
|
298
|
+
: 80;
|
|
299
|
+
}
|
|
300
|
+
catch {
|
|
301
|
+
return null;
|
|
302
|
+
}
|
|
303
|
+
return {
|
|
304
|
+
port: parseInt(originMatch[1], 10),
|
|
305
|
+
sandboxId: originMatch[2],
|
|
306
|
+
backendPort,
|
|
307
|
+
path: originMatch[4] || '/',
|
|
308
|
+
};
|
|
309
|
+
}
|
|
310
|
+
const pathMatch = url.match(PATH_PROXY_URL_REGEX);
|
|
311
|
+
if (pathMatch) {
|
|
312
|
+
try {
|
|
313
|
+
const parsed = new URL(url);
|
|
314
|
+
return {
|
|
315
|
+
port: parseInt(pathMatch[2], 10),
|
|
316
|
+
sandboxId: pathMatch[1],
|
|
317
|
+
backendPort: parseInt(parsed.port, 10) || (parsed.protocol === 'https:' ? 443 : 80),
|
|
318
|
+
path: pathMatch[3] || '/',
|
|
319
|
+
};
|
|
320
|
+
}
|
|
321
|
+
catch {
|
|
322
|
+
return null;
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
return null;
|
|
326
|
+
}
|
|
327
|
+
export function proxyUrlToInternal(proxyUrl) {
|
|
328
|
+
try {
|
|
329
|
+
const subdomain = parseSubdomainUrl(proxyUrl);
|
|
330
|
+
if (subdomain) {
|
|
331
|
+
return `http://localhost:${subdomain.port}${subdomain.path}`;
|
|
332
|
+
}
|
|
333
|
+
return null;
|
|
334
|
+
}
|
|
335
|
+
catch {
|
|
336
|
+
return null;
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
export function isPreviewUrl(url) {
|
|
340
|
+
return (isSubdomainUrl(url)
|
|
341
|
+
|| PREVIEW_ORIGIN_URL_REGEX.test(url)
|
|
342
|
+
|| PATH_PROXY_URL_REGEX.test(url));
|
|
343
|
+
}
|
|
344
|
+
export function isInternalLocalhostUrl(url) {
|
|
345
|
+
try {
|
|
346
|
+
const { hostname, port } = new URL(url);
|
|
347
|
+
return (hostname === 'localhost' || hostname === '127.0.0.1') && port !== '';
|
|
348
|
+
}
|
|
349
|
+
catch {
|
|
350
|
+
return false;
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
const WEB_PROXY_PATH_PREFIX = '/web-proxy/';
|
|
354
|
+
export function buildWebProxyUrl(targetUrl, subdomainOpts) {
|
|
355
|
+
try {
|
|
356
|
+
const parsed = new URL(targetUrl);
|
|
357
|
+
if (parsed.protocol !== 'http:' && parsed.protocol !== 'https:')
|
|
358
|
+
return null;
|
|
359
|
+
const scheme = parsed.protocol.replace(':', '');
|
|
360
|
+
const proxyPath = `${WEB_PROXY_PATH_PREFIX}${scheme}/${parsed.host}${parsed.pathname}${parsed.search}${parsed.hash}`;
|
|
361
|
+
const kmPort = parseInt(SANDBOX_PORTS.BEEUNI_MASTER, 10);
|
|
362
|
+
const baseUrl = rewriteLocalhostUrl(kmPort, '/', subdomainOpts);
|
|
363
|
+
return `${baseUrl.replace(/\/$/, '')}${proxyPath}`;
|
|
364
|
+
}
|
|
365
|
+
catch {
|
|
366
|
+
return null;
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
export function parseWebProxyUrl(proxyUrl) {
|
|
370
|
+
try {
|
|
371
|
+
const url = new URL(proxyUrl);
|
|
372
|
+
const wpIdx = url.pathname.indexOf(WEB_PROXY_PATH_PREFIX);
|
|
373
|
+
if (wpIdx === -1)
|
|
374
|
+
return null;
|
|
375
|
+
const remainder = url.pathname.slice(wpIdx + WEB_PROXY_PATH_PREFIX.length);
|
|
376
|
+
const match = remainder.match(/^(https?)\/([\w.\-]+(?::\d+)?)(\/.*)?$/);
|
|
377
|
+
if (!match)
|
|
378
|
+
return null;
|
|
379
|
+
const scheme = match[1];
|
|
380
|
+
const host = match[2];
|
|
381
|
+
const path = match[3] || '/';
|
|
382
|
+
return `${scheme}://${host}${path}${url.search}${url.hash}`;
|
|
383
|
+
}
|
|
384
|
+
catch {
|
|
385
|
+
return null;
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
export function isWebProxyUrl(url) {
|
|
389
|
+
try {
|
|
390
|
+
return new URL(url).pathname.includes(WEB_PROXY_PATH_PREFIX);
|
|
391
|
+
}
|
|
392
|
+
catch {
|
|
393
|
+
return url.includes(WEB_PROXY_PATH_PREFIX);
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
export function isExternalUrl(rawUrl) {
|
|
397
|
+
if (!rawUrl)
|
|
398
|
+
return false;
|
|
399
|
+
const trimmed = rawUrl.trim();
|
|
400
|
+
if (/^https?:\/\/(?!localhost|127\.0\.0\.1)/i.test(trimmed))
|
|
401
|
+
return true;
|
|
402
|
+
if (/^[a-z0-9][\w.-]*\.[a-z]{2,}/i.test(trimmed))
|
|
403
|
+
return true;
|
|
404
|
+
return false;
|
|
405
|
+
}
|
|
406
|
+
export function normalizeExternalInput(input) {
|
|
407
|
+
const trimmed = input.trim();
|
|
408
|
+
if (!trimmed)
|
|
409
|
+
return null;
|
|
410
|
+
if (/^https?:\/\//i.test(trimmed))
|
|
411
|
+
return trimmed;
|
|
412
|
+
if (/^[a-z0-9][\w.-]*\.[a-z]{2,}/i.test(trimmed))
|
|
413
|
+
return `https://${trimmed}`;
|
|
414
|
+
return null;
|
|
415
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export declare const WAKE_NO_PROGRESS_MS = 75000;
|
|
2
|
+
export declare const WAKE_MAX_RESTARTS = 2;
|
|
3
|
+
export declare const WAKE_ESCALATION_COOLDOWN_MS = 20000;
|
|
4
|
+
export type WakeEscalationStep = 'retry-start' | 'restart';
|
|
5
|
+
export type WakeEscalationDispatch = 'none' | WakeEscalationStep;
|
|
6
|
+
export type WakeEscalationStatus = 'idle' | 'waking' | 'escalating' | 'exhausted';
|
|
7
|
+
export interface WakeAttempt {
|
|
8
|
+
step: WakeEscalationStep;
|
|
9
|
+
atMs: number;
|
|
10
|
+
}
|
|
11
|
+
export interface WakeEscalationState {
|
|
12
|
+
status: WakeEscalationStatus;
|
|
13
|
+
dispatch: WakeEscalationDispatch;
|
|
14
|
+
fingerprint: string | null;
|
|
15
|
+
lastProgressAtMs: number | null;
|
|
16
|
+
lastDispatchAtMs: number | null;
|
|
17
|
+
attempts: readonly WakeAttempt[];
|
|
18
|
+
msSinceProgress: number;
|
|
19
|
+
settled: boolean;
|
|
20
|
+
}
|
|
21
|
+
export interface WakeObservation {
|
|
22
|
+
nowMs: number;
|
|
23
|
+
waking: boolean;
|
|
24
|
+
runtimeReachable: boolean;
|
|
25
|
+
progress: string;
|
|
26
|
+
serverGaveUp: boolean;
|
|
27
|
+
}
|
|
28
|
+
export interface WakeEscalationLimits {
|
|
29
|
+
noProgressMs?: number;
|
|
30
|
+
maxRestarts?: number;
|
|
31
|
+
cooldownMs?: number;
|
|
32
|
+
}
|
|
33
|
+
export declare function initialWakeEscalationState(): WakeEscalationState;
|
|
34
|
+
export declare function wakeProgressFingerprint(parts: readonly (string | number | boolean | null | undefined)[]): string;
|
|
35
|
+
export declare function advanceWakeEscalation(state: WakeEscalationState, observation: WakeObservation, limits?: WakeEscalationLimits): WakeEscalationState;
|
|
36
|
+
export declare function wakeEscalationNote(state: WakeEscalationState): string | null;
|
|
37
|
+
export declare function wakeEscalationAttemptSummary(state: WakeEscalationState): string | null;
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
export const WAKE_NO_PROGRESS_MS = 75_000;
|
|
2
|
+
export const WAKE_MAX_RESTARTS = 2;
|
|
3
|
+
export const WAKE_ESCALATION_COOLDOWN_MS = 20_000;
|
|
4
|
+
export function initialWakeEscalationState() {
|
|
5
|
+
return {
|
|
6
|
+
status: 'idle',
|
|
7
|
+
dispatch: 'none',
|
|
8
|
+
fingerprint: null,
|
|
9
|
+
lastProgressAtMs: null,
|
|
10
|
+
lastDispatchAtMs: null,
|
|
11
|
+
attempts: [],
|
|
12
|
+
msSinceProgress: 0,
|
|
13
|
+
settled: false,
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export function wakeProgressFingerprint(parts) {
|
|
17
|
+
return parts.filter((part) => part !== null && part !== undefined).join('|');
|
|
18
|
+
}
|
|
19
|
+
function nextStep(attempts, maxRestarts) {
|
|
20
|
+
if (attempts.length === 0)
|
|
21
|
+
return 'retry-start';
|
|
22
|
+
const restarts = attempts.filter((attempt) => attempt.step === 'restart').length;
|
|
23
|
+
return restarts < maxRestarts ? 'restart' : null;
|
|
24
|
+
}
|
|
25
|
+
export function advanceWakeEscalation(state, observation, limits = {}) {
|
|
26
|
+
const noProgressMs = limits.noProgressMs ?? WAKE_NO_PROGRESS_MS;
|
|
27
|
+
const maxRestarts = limits.maxRestarts ?? WAKE_MAX_RESTARTS;
|
|
28
|
+
const cooldownMs = limits.cooldownMs ?? WAKE_ESCALATION_COOLDOWN_MS;
|
|
29
|
+
if (observation.runtimeReachable) {
|
|
30
|
+
return { ...initialWakeEscalationState(), settled: true };
|
|
31
|
+
}
|
|
32
|
+
if (!observation.waking) {
|
|
33
|
+
return { ...state, dispatch: 'none', fingerprint: null, lastProgressAtMs: null, msSinceProgress: 0 };
|
|
34
|
+
}
|
|
35
|
+
if (state.settled)
|
|
36
|
+
return { ...initialWakeEscalationState(), settled: true };
|
|
37
|
+
const previousProgressAtMs = state.lastProgressAtMs;
|
|
38
|
+
const first = previousProgressAtMs === null;
|
|
39
|
+
const changed = observation.progress !== state.fingerprint;
|
|
40
|
+
const lastProgressAtMs = previousProgressAtMs === null || changed ? observation.nowMs : previousProgressAtMs;
|
|
41
|
+
const msSinceProgress = Math.max(0, observation.nowMs - lastProgressAtMs);
|
|
42
|
+
const base = {
|
|
43
|
+
...state,
|
|
44
|
+
dispatch: 'none',
|
|
45
|
+
fingerprint: observation.progress,
|
|
46
|
+
lastProgressAtMs,
|
|
47
|
+
msSinceProgress,
|
|
48
|
+
status: state.attempts.length > 0 ? 'escalating' : 'waking',
|
|
49
|
+
};
|
|
50
|
+
if (state.status === 'exhausted')
|
|
51
|
+
return { ...base, status: 'exhausted' };
|
|
52
|
+
const stalled = !first && !changed && msSinceProgress >= noProgressMs;
|
|
53
|
+
if (!observation.serverGaveUp && !stalled)
|
|
54
|
+
return base;
|
|
55
|
+
if (state.lastDispatchAtMs !== null &&
|
|
56
|
+
observation.nowMs - state.lastDispatchAtMs < cooldownMs) {
|
|
57
|
+
return base;
|
|
58
|
+
}
|
|
59
|
+
const step = nextStep(state.attempts, maxRestarts);
|
|
60
|
+
if (!step)
|
|
61
|
+
return { ...base, status: 'exhausted' };
|
|
62
|
+
return {
|
|
63
|
+
...base,
|
|
64
|
+
status: 'escalating',
|
|
65
|
+
dispatch: step,
|
|
66
|
+
attempts: [...state.attempts, { step, atMs: observation.nowMs }],
|
|
67
|
+
lastDispatchAtMs: observation.nowMs,
|
|
68
|
+
lastProgressAtMs: observation.nowMs,
|
|
69
|
+
msSinceProgress: 0,
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
const STEP_VERB = {
|
|
73
|
+
'retry-start': 'retrying',
|
|
74
|
+
restart: 'restarting',
|
|
75
|
+
};
|
|
76
|
+
export function wakeEscalationNote(state) {
|
|
77
|
+
if (state.status !== 'escalating')
|
|
78
|
+
return null;
|
|
79
|
+
const last = state.attempts[state.attempts.length - 1];
|
|
80
|
+
if (!last)
|
|
81
|
+
return null;
|
|
82
|
+
return `Still waking — ${STEP_VERB[last.step]} the runtime (attempt ${state.attempts.length + 1})`;
|
|
83
|
+
}
|
|
84
|
+
function countWord(count) {
|
|
85
|
+
if (count === 1)
|
|
86
|
+
return 'once';
|
|
87
|
+
if (count === 2)
|
|
88
|
+
return 'twice';
|
|
89
|
+
return `${count} times`;
|
|
90
|
+
}
|
|
91
|
+
export function wakeEscalationAttemptSummary(state) {
|
|
92
|
+
if (state.status !== 'exhausted')
|
|
93
|
+
return null;
|
|
94
|
+
const restarts = state.attempts.filter((attempt) => attempt.step === 'restart').length;
|
|
95
|
+
const retried = state.attempts.some((attempt) => attempt.step === 'retry-start');
|
|
96
|
+
if (!retried && restarts === 0)
|
|
97
|
+
return null;
|
|
98
|
+
const parts = [];
|
|
99
|
+
if (retried)
|
|
100
|
+
parts.push('re-issuing the wake');
|
|
101
|
+
if (restarts > 0)
|
|
102
|
+
parts.push(`restarting the session ${countWord(restarts)}`);
|
|
103
|
+
return `Tried: ${parts.join(', then ')}.`;
|
|
104
|
+
}
|