@kortix/sdk 0.13.43 → 0.13.45
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 +36 -12
- package/dist/browser/session-sync/server-transcript-mirror.js +1 -1
- package/dist/browser/session-sync/server-transcript-mirror.js.map +1 -1
- package/dist/browser/session-sync/session-sync-registry.js +1 -1
- package/dist/browser/session-sync/session-sync-registry.js.map +1 -1
- package/dist/browser/stores/opencode-pending-store.d.ts +2 -0
- package/dist/browser/stores/opencode-pending-store.d.ts.map +1 -1
- package/dist/browser/stores/opencode-pending-store.js +4 -1
- package/dist/browser/stores/opencode-pending-store.js.map +1 -1
- package/dist/browser/stores/sandbox-connection-store.d.ts +10 -1
- package/dist/browser/stores/sandbox-connection-store.d.ts.map +1 -1
- package/dist/browser/stores/sandbox-connection-store.js +19 -1
- package/dist/browser/stores/sandbox-connection-store.js.map +1 -1
- package/dist/browser/stores/server-store.d.ts +1 -1
- package/dist/browser/stores/server-store.d.ts.map +1 -1
- package/dist/browser/stores/server-store.js +3 -3
- package/dist/browser/stores/server-store.js.map +1 -1
- package/dist/browser/stores/sync-store.d.ts +5 -4
- package/dist/browser/stores/sync-store.d.ts.map +1 -1
- package/dist/browser/stores/sync-store.js +37 -8
- package/dist/browser/stores/sync-store.js.map +1 -1
- package/dist/core/agents/composer-agents.d.ts +3 -1
- package/dist/core/agents/composer-agents.d.ts.map +1 -1
- package/dist/core/agents/composer-agents.js +4 -1
- package/dist/core/agents/composer-agents.js.map +1 -1
- package/dist/core/auth/app-viewer.d.ts +3 -1
- package/dist/core/auth/app-viewer.d.ts.map +1 -1
- package/dist/core/auth/app-viewer.js +11 -1
- package/dist/core/auth/app-viewer.js.map +1 -1
- package/dist/core/client/kortix.d.ts +20 -6
- package/dist/core/client/kortix.d.ts.map +1 -1
- package/dist/core/client/kortix.js +18 -12
- package/dist/core/client/kortix.js.map +1 -1
- package/dist/core/files/client.d.ts +2 -2
- package/dist/core/files/client.d.ts.map +1 -1
- package/dist/core/files/client.js +5 -5
- package/dist/core/files/client.js.map +1 -1
- package/dist/core/files/types.d.ts +3 -1
- package/dist/core/files/types.d.ts.map +1 -1
- package/dist/core/http/api-client.d.ts.map +1 -1
- package/dist/core/http/api-client.js +5 -4
- package/dist/core/http/api-client.js.map +1 -1
- package/dist/core/http/config.d.ts +13 -5
- package/dist/core/http/config.d.ts.map +1 -1
- package/dist/core/http/config.js.map +1 -1
- package/dist/core/http/runtime-errors.d.ts +57 -0
- package/dist/core/http/runtime-errors.d.ts.map +1 -0
- package/dist/core/http/{opencode-errors.js → runtime-errors.js} +24 -15
- package/dist/core/http/runtime-errors.js.map +1 -0
- package/dist/core/http/transport.d.ts +1 -1
- package/dist/core/http/transport.d.ts.map +1 -1
- package/dist/core/http/transport.js +4 -6
- package/dist/core/http/transport.js.map +1 -1
- package/dist/core/models/model-flatten.d.ts +1 -0
- package/dist/core/models/model-flatten.d.ts.map +1 -1
- package/dist/core/models/model-flatten.js +1 -0
- package/dist/core/models/model-flatten.js.map +1 -1
- package/dist/core/models/provider-selection.d.ts +1 -1
- package/dist/core/models/provider-selection.d.ts.map +1 -1
- package/dist/core/models/provider-selection.js +12 -34
- package/dist/core/models/provider-selection.js.map +1 -1
- package/dist/core/rest/platform-client/auth.d.ts.map +1 -1
- package/dist/core/rest/platform-client/auth.js +4 -6
- package/dist/core/rest/platform-client/auth.js.map +1 -1
- package/dist/core/rest/platform-client/host-boundary.d.ts +8 -0
- package/dist/core/rest/platform-client/host-boundary.d.ts.map +1 -1
- package/dist/core/rest/platform-client/host-boundary.js +7 -10
- package/dist/core/rest/platform-client/host-boundary.js.map +1 -1
- package/dist/core/rest/platform-client/shared.d.ts +2 -0
- package/dist/core/rest/platform-client/shared.d.ts.map +1 -1
- package/dist/core/rest/platform-client/shared.js +7 -6
- package/dist/core/rest/platform-client/shared.js.map +1 -1
- package/dist/core/rest/projects-client/agent-config.d.ts +16 -6
- package/dist/core/rest/projects-client/agent-config.d.ts.map +1 -1
- package/dist/core/rest/projects-client/agent-config.js +1 -32
- package/dist/core/rest/projects-client/agent-config.js.map +1 -1
- package/dist/core/rest/projects-client/agent-connectors.d.ts +8 -0
- package/dist/core/rest/projects-client/agent-connectors.d.ts.map +1 -0
- package/dist/core/rest/projects-client/agent-connectors.js +39 -0
- package/dist/core/rest/projects-client/agent-connectors.js.map +1 -0
- package/dist/core/rest/projects-client/agent-scope.d.ts.map +1 -1
- package/dist/core/rest/projects-client/agent-scope.js +1 -32
- package/dist/core/rest/projects-client/agent-scope.js.map +1 -1
- package/dist/core/rest/projects-client/assignments.d.ts.map +1 -1
- package/dist/core/rest/projects-client/assignments.js +12 -28
- package/dist/core/rest/projects-client/assignments.js.map +1 -1
- package/dist/core/rest/projects-client/audit.d.ts +17 -0
- package/dist/core/rest/projects-client/audit.d.ts.map +1 -1
- package/dist/core/rest/projects-client/audit.js +6 -0
- package/dist/core/rest/projects-client/audit.js.map +1 -1
- package/dist/core/rest/projects-client/billing.d.ts.map +1 -1
- package/dist/core/rest/projects-client/billing.js +21 -35
- package/dist/core/rest/projects-client/billing.js.map +1 -1
- package/dist/core/rest/projects-client/iam-audit.d.ts +97 -0
- package/dist/core/rest/projects-client/iam-audit.d.ts.map +1 -0
- package/dist/core/rest/projects-client/iam-audit.js +22 -0
- package/dist/core/rest/projects-client/iam-audit.js.map +1 -0
- package/dist/core/rest/projects-client/iam-enterprise.d.ts +3 -0
- package/dist/core/rest/projects-client/iam-enterprise.d.ts.map +1 -0
- package/dist/core/rest/projects-client/iam-enterprise.js +16 -0
- package/dist/core/rest/projects-client/iam-enterprise.js.map +1 -0
- package/dist/core/rest/projects-client/iam-grants.d.ts +23 -0
- package/dist/core/rest/projects-client/iam-grants.d.ts.map +1 -0
- package/dist/core/rest/projects-client/iam-grants.js +7 -0
- package/dist/core/rest/projects-client/iam-grants.js.map +1 -0
- package/dist/core/rest/projects-client/iam-groups.d.ts +74 -0
- package/dist/core/rest/projects-client/iam-groups.d.ts.map +1 -0
- package/dist/core/rest/projects-client/iam-groups.js +46 -0
- package/dist/core/rest/projects-client/iam-groups.js.map +1 -0
- package/dist/core/rest/projects-client/iam-policies.d.ts +60 -0
- package/dist/core/rest/projects-client/iam-policies.d.ts.map +1 -0
- package/dist/core/rest/projects-client/iam-policies.js +27 -0
- package/dist/core/rest/projects-client/iam-policies.js.map +1 -0
- package/dist/core/rest/projects-client/iam-probe.d.ts +34 -0
- package/dist/core/rest/projects-client/iam-probe.d.ts.map +1 -0
- package/dist/core/rest/projects-client/iam-probe.js +24 -0
- package/dist/core/rest/projects-client/iam-probe.js.map +1 -0
- package/dist/core/rest/projects-client/iam-query.d.ts +3 -0
- package/dist/core/rest/projects-client/iam-query.d.ts.map +1 -0
- package/dist/core/rest/projects-client/iam-query.js +11 -0
- package/dist/core/rest/projects-client/iam-query.js.map +1 -0
- package/dist/core/rest/projects-client/iam-roles.d.ts +49 -0
- package/dist/core/rest/projects-client/iam-roles.d.ts.map +1 -0
- package/dist/core/rest/projects-client/iam-roles.js +41 -0
- package/dist/core/rest/projects-client/iam-roles.js.map +1 -0
- package/dist/core/rest/projects-client/iam-scim.d.ts +25 -0
- package/dist/core/rest/projects-client/iam-scim.d.ts.map +1 -0
- package/dist/core/rest/projects-client/iam-scim.js +15 -0
- package/dist/core/rest/projects-client/iam-scim.js.map +1 -0
- package/dist/core/rest/projects-client/iam-security.d.ts +41 -0
- package/dist/core/rest/projects-client/iam-security.d.ts.map +1 -0
- package/dist/core/rest/projects-client/iam-security.js +19 -0
- package/dist/core/rest/projects-client/iam-security.js.map +1 -0
- package/dist/core/rest/projects-client/iam-service-accounts.d.ts +28 -0
- package/dist/core/rest/projects-client/iam-service-accounts.d.ts.map +1 -0
- package/dist/core/rest/projects-client/iam-service-accounts.js +15 -0
- package/dist/core/rest/projects-client/iam-service-accounts.js.map +1 -0
- package/dist/core/rest/projects-client/iam-sessions.d.ts +33 -0
- package/dist/core/rest/projects-client/iam-sessions.d.ts.map +1 -0
- package/dist/core/rest/projects-client/iam-sessions.js +26 -0
- package/dist/core/rest/projects-client/iam-sessions.js.map +1 -0
- package/dist/core/rest/projects-client/iam-shared.d.ts +9 -0
- package/dist/core/rest/projects-client/iam-shared.d.ts.map +1 -0
- package/dist/core/rest/projects-client/iam-shared.js +11 -0
- package/dist/core/rest/projects-client/iam-shared.js.map +1 -0
- package/dist/core/rest/projects-client/iam-sso.d.ts +81 -0
- package/dist/core/rest/projects-client/iam-sso.d.ts.map +1 -0
- package/dist/core/rest/projects-client/iam-sso.js +41 -0
- package/dist/core/rest/projects-client/iam-sso.js.map +1 -0
- package/dist/core/rest/projects-client/iam-types.d.ts +67 -0
- package/dist/core/rest/projects-client/iam-types.d.ts.map +1 -0
- package/dist/core/rest/projects-client/iam-types.js +4 -0
- package/dist/core/rest/projects-client/iam-types.js.map +1 -0
- package/dist/core/rest/projects-client/iam.d.ts +13 -595
- package/dist/core/rest/projects-client/iam.d.ts.map +1 -1
- package/dist/core/rest/projects-client/iam.js +14 -335
- package/dist/core/rest/projects-client/iam.js.map +1 -1
- package/dist/core/rest/projects-client/secrets.d.ts +17 -3
- package/dist/core/rest/projects-client/secrets.d.ts.map +1 -1
- package/dist/core/rest/projects-client/secrets.js +5 -0
- package/dist/core/rest/projects-client/secrets.js.map +1 -1
- package/dist/core/rest/projects-client/session-attachments.d.ts.map +1 -1
- package/dist/core/rest/projects-client/session-attachments.js +32 -23
- package/dist/core/rest/projects-client/session-attachments.js.map +1 -1
- package/dist/core/rest/projects-client/session-costs.d.ts +2 -1
- package/dist/core/rest/projects-client/session-costs.d.ts.map +1 -1
- package/dist/core/rest/projects-client/session-costs.js +2 -2
- package/dist/core/rest/projects-client/session-costs.js.map +1 -1
- package/dist/core/rest/projects-client/session-sandbox.d.ts +3 -0
- package/dist/core/rest/projects-client/session-sandbox.d.ts.map +1 -1
- package/dist/core/rest/projects-client/session-sandbox.js +8 -4
- package/dist/core/rest/projects-client/session-sandbox.js.map +1 -1
- package/dist/core/rest/projects-client/sessions.d.ts +55 -12
- package/dist/core/rest/projects-client/sessions.d.ts.map +1 -1
- package/dist/core/rest/projects-client/sessions.js +2 -0
- package/dist/core/rest/projects-client/sessions.js.map +1 -1
- package/dist/core/rest/projects-client/setup-links.d.ts +4 -0
- package/dist/core/rest/projects-client/setup-links.d.ts.map +1 -1
- package/dist/core/rest/projects-client/setup-links.js.map +1 -1
- package/dist/core/runtime/attachment-part.js +2 -2
- package/dist/core/runtime/attachment-part.js.map +1 -1
- package/dist/core/runtime/client.d.ts +12 -6
- package/dist/core/runtime/client.d.ts.map +1 -1
- package/dist/core/runtime/client.js +7 -7
- package/dist/core/runtime/client.js.map +1 -1
- package/dist/core/session/compaction.d.ts +1 -1
- package/dist/core/session/compaction.js +1 -1
- package/dist/core/session/health.d.ts +59 -1
- package/dist/core/session/health.d.ts.map +1 -1
- package/dist/core/session/health.js +22 -3
- package/dist/core/session/health.js.map +1 -1
- package/dist/core/session/server-store/active.d.ts +3 -1
- package/dist/core/session/server-store/active.d.ts.map +1 -1
- package/dist/core/session/server-store/active.js +4 -1
- package/dist/core/session/server-store/active.js.map +1 -1
- package/dist/core/session/session-runtime-registry.d.ts +3 -1
- package/dist/core/session/session-runtime-registry.d.ts.map +1 -1
- package/dist/core/session/session-runtime-registry.js.map +1 -1
- package/dist/core/session/working.d.ts +4 -0
- package/dist/core/session/working.d.ts.map +1 -1
- package/dist/core/session/working.js +11 -1
- package/dist/core/session/working.js.map +1 -1
- package/dist/core/session-sync/saved-copy-store.js +2 -2
- package/dist/core/session-sync/saved-copy-store.js.map +1 -1
- package/dist/core/session-sync/saved-transcript.d.ts.map +1 -1
- package/dist/core/session-sync/saved-transcript.js +2 -3
- package/dist/core/session-sync/saved-transcript.js.map +1 -1
- package/dist/core/session-sync/session-sync-controller.js +1 -1
- package/dist/core/session-sync/session-sync-controller.js.map +1 -1
- package/dist/core/stream/chat-events.d.ts +4 -4
- package/dist/core/stream/chat-events.d.ts.map +1 -1
- package/dist/core/stream/chat-events.js +2 -2
- package/dist/core/stream/chat-events.js.map +1 -1
- package/dist/core/stream/event-stream.d.ts +4 -2
- package/dist/core/stream/event-stream.d.ts.map +1 -1
- package/dist/core/stream/event-stream.js +1 -1
- package/dist/core/stream/event-stream.js.map +1 -1
- package/dist/core/turns/parts.d.ts +1 -1
- package/dist/core/turns/parts.js +1 -1
- package/dist/deprecated/opencode-errors.d.ts +1 -1
- package/dist/deprecated/opencode-errors.d.ts.map +1 -1
- package/dist/deprecated/opencode-errors.js +1 -1
- package/dist/deprecated/opencode-errors.js.map +1 -1
- package/dist/index.d.ts +8 -10
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -8
- package/dist/index.js.map +1 -1
- package/dist/kortix.esm.min.js +37 -37
- package/dist/kortix.global.js +37 -37
- package/dist/node/app-viewer.d.ts.map +1 -1
- package/dist/node/app-viewer.js +0 -1
- package/dist/node/app-viewer.js.map +1 -1
- package/dist/node/auth.js +1 -1
- package/dist/node/auth.js.map +1 -1
- package/dist/platform/auth-core.d.ts +1 -0
- package/dist/platform/auth-core.d.ts.map +1 -1
- package/dist/platform/auth-core.js +3 -6
- package/dist/platform/auth-core.js.map +1 -1
- package/dist/react/index.d.ts +3 -2
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +3 -2
- package/dist/react/index.js.map +1 -1
- package/dist/react/initial-session-pin.js +1 -1
- package/dist/react/initial-session-pin.js.map +1 -1
- package/dist/react/opencode.d.ts +1 -20
- package/dist/react/opencode.d.ts.map +1 -1
- package/dist/react/opencode.js +7 -26
- package/dist/react/opencode.js.map +1 -1
- package/dist/react/provider-refresh.js +2 -2
- package/dist/react/provider-refresh.js.map +1 -1
- package/dist/react/query-keys.d.ts +2 -1
- package/dist/react/query-keys.d.ts.map +1 -1
- package/dist/react/query-keys.js +9 -2
- package/dist/react/query-keys.js.map +1 -1
- package/dist/react/reset-identity-state.js +2 -2
- package/dist/react/reset-identity-state.js.map +1 -1
- package/dist/react/route-project.js +2 -2
- package/dist/react/run-pty-command.js +2 -2
- package/dist/react/run-pty-command.js.map +1 -1
- package/dist/react/runtime-actions.js +6 -6
- package/dist/react/runtime-actions.js.map +1 -1
- package/dist/react/session-stop.js +1 -1
- package/dist/react/session-stop.js.map +1 -1
- package/dist/react/use-canonical-opencode-session.d.ts +10 -4
- package/dist/react/use-canonical-opencode-session.d.ts.map +1 -1
- package/dist/react/use-canonical-opencode-session.js +11 -5
- package/dist/react/use-canonical-opencode-session.js.map +1 -1
- package/dist/react/use-kortix-master.js +1 -1
- package/dist/react/use-model-enablement.js +1 -1
- package/dist/react/use-model-enablement.js.map +1 -1
- package/dist/react/use-opencode-config.d.ts +6 -2
- package/dist/react/use-opencode-config.d.ts.map +1 -1
- package/dist/react/use-opencode-config.js +9 -4
- package/dist/react/use-opencode-config.js.map +1 -1
- package/dist/react/use-opencode-events/handle-event.d.ts +2 -2
- package/dist/react/use-opencode-events/handle-event.d.ts.map +1 -1
- package/dist/react/use-opencode-events/handle-event.js +35 -35
- package/dist/react/use-opencode-events/handle-event.js.map +1 -1
- package/dist/react/use-opencode-events/helpers.d.ts +4 -4
- package/dist/react/use-opencode-events/helpers.d.ts.map +1 -1
- package/dist/react/use-opencode-events/helpers.js +6 -6
- package/dist/react/use-opencode-events/helpers.js.map +1 -1
- package/dist/react/use-opencode-events/index.d.ts +7 -3
- package/dist/react/use-opencode-events/index.d.ts.map +1 -1
- package/dist/react/use-opencode-events/index.js +23 -16
- package/dist/react/use-opencode-events/index.js.map +1 -1
- package/dist/react/use-opencode-events/types.d.ts +1 -1
- package/dist/react/use-opencode-events/types.d.ts.map +1 -1
- package/dist/react/use-opencode-events/use-event-stream-refs.d.ts.map +1 -1
- package/dist/react/use-opencode-events/use-event-stream-refs.js +5 -5
- package/dist/react/use-opencode-events/use-event-stream-refs.js.map +1 -1
- package/dist/react/use-opencode-local.d.ts +17 -7
- package/dist/react/use-opencode-local.d.ts.map +1 -1
- package/dist/react/use-opencode-local.js +3 -1
- package/dist/react/use-opencode-local.js.map +1 -1
- package/dist/react/use-opencode-mcp.d.ts.map +1 -1
- package/dist/react/use-opencode-mcp.js +18 -18
- package/dist/react/use-opencode-mcp.js.map +1 -1
- package/dist/react/use-opencode-pty.d.ts +3 -1
- package/dist/react/use-opencode-pty.d.ts.map +1 -1
- package/dist/react/use-opencode-pty.js +10 -7
- package/dist/react/use-opencode-pty.js.map +1 -1
- package/dist/react/use-opencode-sessions/agents.d.ts +8 -4
- package/dist/react/use-opencode-sessions/agents.d.ts.map +1 -1
- package/dist/react/use-opencode-sessions/agents.js +16 -11
- package/dist/react/use-opencode-sessions/agents.js.map +1 -1
- package/dist/react/use-opencode-sessions/commands.d.ts +12 -4
- package/dist/react/use-opencode-sessions/commands.d.ts.map +1 -1
- package/dist/react/use-opencode-sessions/commands.js +13 -7
- package/dist/react/use-opencode-sessions/commands.js.map +1 -1
- package/dist/react/use-opencode-sessions/files.d.ts +3 -1
- package/dist/react/use-opencode-sessions/files.d.ts.map +1 -1
- package/dist/react/use-opencode-sessions/files.js +4 -1
- package/dist/react/use-opencode-sessions/files.js.map +1 -1
- package/dist/react/use-opencode-sessions/index.d.ts +1 -1
- package/dist/react/use-opencode-sessions/index.d.ts.map +1 -1
- package/dist/react/use-opencode-sessions/index.js +1 -1
- package/dist/react/use-opencode-sessions/index.js.map +1 -1
- package/dist/react/use-opencode-sessions/keys.d.ts +31 -1
- package/dist/react/use-opencode-sessions/keys.d.ts.map +1 -1
- package/dist/react/use-opencode-sessions/keys.js +10 -5
- package/dist/react/use-opencode-sessions/keys.js.map +1 -1
- package/dist/react/use-opencode-sessions/mcp.js +3 -3
- package/dist/react/use-opencode-sessions/mcp.js.map +1 -1
- package/dist/react/use-opencode-sessions/messages.d.ts +30 -14
- package/dist/react/use-opencode-sessions/messages.d.ts.map +1 -1
- package/dist/react/use-opencode-sessions/messages.js +34 -21
- package/dist/react/use-opencode-sessions/messages.js.map +1 -1
- package/dist/react/use-opencode-sessions/no-compaction-model-error.d.ts +1 -1
- package/dist/react/use-opencode-sessions/no-compaction-model-error.js +1 -1
- package/dist/react/use-opencode-sessions/projects.d.ts +6 -2
- package/dist/react/use-opencode-sessions/projects.d.ts.map +1 -1
- package/dist/react/use-opencode-sessions/projects.js +14 -9
- package/dist/react/use-opencode-sessions/projects.js.map +1 -1
- package/dist/react/use-opencode-sessions/providers.d.ts +3 -1
- package/dist/react/use-opencode-sessions/providers.d.ts.map +1 -1
- package/dist/react/use-opencode-sessions/providers.js +7 -4
- package/dist/react/use-opencode-sessions/providers.js.map +1 -1
- package/dist/react/use-opencode-sessions/sessions.d.ts +21 -7
- package/dist/react/use-opencode-sessions/sessions.d.ts.map +1 -1
- package/dist/react/use-opencode-sessions/sessions.js +46 -31
- package/dist/react/use-opencode-sessions/sessions.js.map +1 -1
- package/dist/react/use-opencode-sessions/shared.d.ts +3 -1
- package/dist/react/use-opencode-sessions/shared.d.ts.map +1 -1
- package/dist/react/use-opencode-sessions/shared.js +4 -1
- package/dist/react/use-opencode-sessions/shared.js.map +1 -1
- package/dist/react/use-opencode-sessions/sharing.js +5 -5
- package/dist/react/use-opencode-sessions/sharing.js.map +1 -1
- package/dist/react/use-opencode-sessions/tools.d.ts +3 -1
- package/dist/react/use-opencode-sessions/tools.d.ts.map +1 -1
- package/dist/react/use-opencode-sessions/tools.js +11 -8
- package/dist/react/use-opencode-sessions/tools.js.map +1 -1
- package/dist/react/use-opencode-sessions/vcs.d.ts +3 -1
- package/dist/react/use-opencode-sessions/vcs.d.ts.map +1 -1
- package/dist/react/use-opencode-sessions/vcs.js +7 -4
- package/dist/react/use-opencode-sessions/vcs.js.map +1 -1
- package/dist/react/use-permission-self-heal.js +3 -3
- package/dist/react/use-permission-self-heal.js.map +1 -1
- package/dist/react/use-project-llm-gateway.d.ts +1 -1
- package/dist/react/use-project-llm-gateway.js +1 -1
- package/dist/react/use-project-models.js +1 -1
- package/dist/react/use-project-models.js.map +1 -1
- package/dist/react/use-project-secrets.d.ts +6 -0
- package/dist/react/use-project-secrets.d.ts.map +1 -1
- package/dist/react/use-project-sessions.d.ts +1 -1
- package/dist/react/use-project-sessions.d.ts.map +1 -1
- package/dist/react/use-project-sessions.js +3 -2
- package/dist/react/use-project-sessions.js.map +1 -1
- package/dist/react/use-question-self-heal.d.ts +1 -1
- package/dist/react/use-question-self-heal.js +4 -4
- package/dist/react/use-question-self-heal.js.map +1 -1
- package/dist/react/use-runtime-reconnect.d.ts +1 -1
- package/dist/react/use-runtime-reconnect.d.ts.map +1 -1
- package/dist/react/use-runtime-reconnect.js +8 -5
- package/dist/react/use-runtime-reconnect.js.map +1 -1
- package/dist/react/use-runtime-supports.d.ts +12 -0
- package/dist/react/use-runtime-supports.d.ts.map +1 -0
- package/dist/react/use-runtime-supports.js +15 -0
- package/dist/react/use-runtime-supports.js.map +1 -0
- package/dist/react/use-session-model-selection.d.ts +4 -4
- package/dist/react/use-session-model-selection.d.ts.map +1 -1
- package/dist/react/use-session-model-selection.js +2 -2
- package/dist/react/use-session-model-selection.js.map +1 -1
- package/dist/react/use-session-phase.d.ts +1 -1
- package/dist/react/use-session-phase.js +1 -1
- package/dist/react/use-session-prefetch.d.ts.map +1 -1
- package/dist/react/use-session-prefetch.js +2 -2
- package/dist/react/use-session-prefetch.js.map +1 -1
- package/dist/react/use-session-send.d.ts +10 -8
- package/dist/react/use-session-send.d.ts.map +1 -1
- package/dist/react/use-session-send.js +6 -6
- package/dist/react/use-session-send.js.map +1 -1
- package/dist/react/use-session-sync.js +9 -9
- package/dist/react/use-session-sync.js.map +1 -1
- package/dist/react/use-session-transcript-history.d.ts.map +1 -1
- package/dist/react/use-session-transcript-history.js +5 -2
- package/dist/react/use-session-transcript-history.js.map +1 -1
- package/dist/react/use-session.d.ts +7 -3
- package/dist/react/use-session.d.ts.map +1 -1
- package/dist/react/use-session.js +60 -32
- package/dist/react/use-session.js.map +1 -1
- package/dist/react/use-visible-agents.js +3 -3
- package/dist/react/use-visible-agents.js.map +1 -1
- package/dist/workspace-search/core.d.ts +22 -0
- package/dist/workspace-search/core.d.ts.map +1 -0
- package/dist/workspace-search/core.js +223 -0
- package/dist/workspace-search/core.js.map +1 -0
- package/package.json +2 -2
- package/dist/core/http/opencode-errors.d.ts +0 -44
- package/dist/core/http/opencode-errors.d.ts.map +0 -1
- package/dist/core/http/opencode-errors.js.map +0 -1
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { useQuery, useQueryClient } from '@tanstack/react-query';
|
|
3
3
|
import { getClient } from '../../core/runtime/client.js';
|
|
4
|
-
import {
|
|
4
|
+
import { runtimeKeys, useRuntimeReady } from './keys.js';
|
|
5
5
|
import { unwrap, getLSCache, setLSCache, LS_AGENTS, CACHE_SCOPE_GLOBAL } from './shared.js';
|
|
6
6
|
import { getProjectDetail } from '../../core/rest/projects-client/index.js';
|
|
7
|
-
import { projectConfigAgentsToOpenCodeAgents } from '../../core/agents/composer-agents.js';
|
|
7
|
+
import { projectConfigAgentsToOpenCodeAgents, projectConfigAgentsToRuntimeAgents, } from '../../core/agents/composer-agents.js';
|
|
8
8
|
import { contract } from '../query-contracts.js';
|
|
9
9
|
import { qk } from '../query-keys.js';
|
|
10
10
|
// Re-export filtered agents hook for UI agent selectors
|
|
11
11
|
export { useVisibleAgents } from '../use-visible-agents.js';
|
|
12
12
|
// Framework-free since it moved to core; re-exported so `./react` keeps it.
|
|
13
|
-
export { projectConfigAgentsToOpenCodeAgents };
|
|
13
|
+
export { projectConfigAgentsToOpenCodeAgents, projectConfigAgentsToRuntimeAgents };
|
|
14
14
|
// ============================================================================
|
|
15
15
|
// Agent Hooks
|
|
16
16
|
// ============================================================================
|
|
@@ -20,11 +20,11 @@ export { projectConfigAgentsToOpenCodeAgents };
|
|
|
20
20
|
* projects and OpenCode file discovery for legacy projects. Without `projectId`,
|
|
21
21
|
* this falls back to the sandbox OpenCode runtime.
|
|
22
22
|
*/
|
|
23
|
-
export function
|
|
23
|
+
export function useRuntimeAgents(options) {
|
|
24
24
|
const queryClient = useQueryClient();
|
|
25
25
|
const directory = options?.directory;
|
|
26
26
|
const projectId = options?.projectId ?? null;
|
|
27
|
-
const runtimeReady =
|
|
27
|
+
const runtimeReady = useRuntimeReady();
|
|
28
28
|
const cacheScope = projectId
|
|
29
29
|
? `project:${projectId}`
|
|
30
30
|
: directory
|
|
@@ -42,8 +42,8 @@ export function useOpenCodeAgents(options) {
|
|
|
42
42
|
queryKey: projectId
|
|
43
43
|
? [...qk.project.detail(projectId), 'agents']
|
|
44
44
|
: directory
|
|
45
|
-
? [...
|
|
46
|
-
:
|
|
45
|
+
? [...runtimeKeys.agents(), 'dir', directory]
|
|
46
|
+
: runtimeKeys.agents(),
|
|
47
47
|
queryFn: async () => {
|
|
48
48
|
if (projectId) {
|
|
49
49
|
// Through the CANONICAL entry, not a private fetch. This slot keeps its
|
|
@@ -56,7 +56,7 @@ export function useOpenCodeAgents(options) {
|
|
|
56
56
|
queryFn: () => getProjectDetail(projectId),
|
|
57
57
|
...contract('config'),
|
|
58
58
|
});
|
|
59
|
-
const agents =
|
|
59
|
+
const agents = projectConfigAgentsToRuntimeAgents(detail.config);
|
|
60
60
|
setLSCache(LS_AGENTS, agents, cacheScope);
|
|
61
61
|
return agents;
|
|
62
62
|
}
|
|
@@ -81,10 +81,10 @@ export function useOpenCodeAgents(options) {
|
|
|
81
81
|
gcTime: 10 * 60 * 1000,
|
|
82
82
|
});
|
|
83
83
|
}
|
|
84
|
-
export function
|
|
85
|
-
const runtimeReady =
|
|
84
|
+
export function useRuntimeAgent(agentName) {
|
|
85
|
+
const runtimeReady = useRuntimeReady();
|
|
86
86
|
return useQuery({
|
|
87
|
-
queryKey: [...
|
|
87
|
+
queryKey: [...runtimeKeys.agents(), agentName],
|
|
88
88
|
queryFn: async () => {
|
|
89
89
|
const client = getClient();
|
|
90
90
|
const result = await client.app.agents();
|
|
@@ -95,4 +95,9 @@ export function useOpenCodeAgent(agentName) {
|
|
|
95
95
|
staleTime: Infinity,
|
|
96
96
|
});
|
|
97
97
|
}
|
|
98
|
+
// Pre-W4 names, kept until the next major. The runtime is OpenCode or pi.
|
|
99
|
+
/** @deprecated Renamed to `useRuntimeAgents`. Removed in the next major. */
|
|
100
|
+
export const useOpenCodeAgents = useRuntimeAgents;
|
|
101
|
+
/** @deprecated Renamed to `useRuntimeAgent`. Removed in the next major. */
|
|
102
|
+
export const useOpenCodeAgent = useRuntimeAgent;
|
|
98
103
|
//# sourceMappingURL=agents.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agents.js","sourceRoot":"","sources":["../../../src/react/use-opencode-sessions/agents.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAEtD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"agents.js","sourceRoot":"","sources":["../../../src/react/use-opencode-sessions/agents.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAEtD,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC;AACtD,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AACzF,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EACL,mCAAmC,EACnC,kCAAkC,GACnC,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,EAAE,EAAE,MAAM,eAAe,CAAC;AAEnC,wDAAwD;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,4EAA4E;AAC5E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C,QAAQ,EAAE,CAAC,GAAG,WAAW,CAAC,MAAM,EAAE,EAAE,SAAS,CAAC;QAC9C,OAAO,EAAE,KAAK,IAAI,EAAE;YAClB,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;YAC3B,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC;YACzC,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;YAC9B,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC,CAAQ,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC;QACzD,CAAC;QACD,OAAO,EAAE,YAAY,IAAI,CAAC,CAAC,SAAS;QACpC,SAAS,EAAE,QAAQ;KACpB,CAAC,CAAC;AACL,CAAC;AAED,0EAA0E;AAC1E,4EAA4E;AAC5E,MAAM,CAAC,MAAM,iBAAiB,GAAG,gBAAgB,CAAC;AAClD,2EAA2E;AAC3E,MAAM,CAAC,MAAM,gBAAgB,GAAG,eAAe,CAAC"}
|
|
@@ -11,8 +11,8 @@ import type { Command } from '@opencode-ai/sdk/v2/client';
|
|
|
11
11
|
* (`detectCommandFromText`, the slash menu, command attachments) can iterate
|
|
12
12
|
* the result unconditionally.
|
|
13
13
|
*/
|
|
14
|
-
export declare function
|
|
15
|
-
export interface
|
|
14
|
+
export declare function useRuntimeCommands(): import("@tanstack/react-query").UseQueryResult<Command[], Error>;
|
|
15
|
+
export interface ExecuteRuntimeCommandInput {
|
|
16
16
|
sessionId: string;
|
|
17
17
|
command: string;
|
|
18
18
|
args?: string;
|
|
@@ -20,6 +20,14 @@ export interface ExecuteOpenCodeCommandInput {
|
|
|
20
20
|
model?: string;
|
|
21
21
|
variant?: string;
|
|
22
22
|
}
|
|
23
|
-
export declare function
|
|
24
|
-
export declare function
|
|
23
|
+
export declare function executeRuntimeCommand({ sessionId, command, args, agent, model, variant, }: ExecuteRuntimeCommandInput): Promise<void>;
|
|
24
|
+
export declare function useExecuteRuntimeCommand(): import("@tanstack/react-query").UseMutationResult<void, Error, ExecuteRuntimeCommandInput, unknown>;
|
|
25
|
+
/** @deprecated Renamed to `ExecuteRuntimeCommandInput`. Removed in the next major. */
|
|
26
|
+
export type ExecuteOpenCodeCommandInput = ExecuteRuntimeCommandInput;
|
|
27
|
+
/** @deprecated Renamed to `executeRuntimeCommand`. Removed in the next major. */
|
|
28
|
+
export declare const executeOpenCodeCommand: typeof executeRuntimeCommand;
|
|
29
|
+
/** @deprecated Renamed to `useRuntimeCommands`. Removed in the next major. */
|
|
30
|
+
export declare const useOpenCodeCommands: typeof useRuntimeCommands;
|
|
31
|
+
/** @deprecated Renamed to `useExecuteRuntimeCommand`. Removed in the next major. */
|
|
32
|
+
export declare const useExecuteOpenCodeCommand: typeof useExecuteRuntimeCommand;
|
|
25
33
|
//# sourceMappingURL=commands.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../../src/react/use-opencode-sessions/commands.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAQ1D;;;;;;;;;;;GAWG;AACH,wBAAgB,
|
|
1
|
+
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../../src/react/use-opencode-sessions/commands.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAQ1D;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,qEAgBjC;AAED,MAAM,WAAW,0BAA0B;IACzC,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,wBAAsB,qBAAqB,CAAC,EAC1C,SAAS,EACT,OAAO,EACP,IAAI,EACJ,KAAK,EACL,KAAK,EACL,OAAO,GACR,EAAE,0BAA0B,GAAG,OAAO,CAAC,IAAI,CAAC,CAW5C;AAED,wBAAgB,wBAAwB,wGAWvC;AAGD,sFAAsF;AACtF,MAAM,MAAM,2BAA2B,GAAG,0BAA0B,CAAC;AACrE,iFAAiF;AACjF,eAAO,MAAM,sBAAsB,8BAAwB,CAAC;AAC5D,8EAA8E;AAC9E,eAAO,MAAM,mBAAmB,2BAAqB,CAAC;AACtD,oFAAoF;AACpF,eAAO,MAAM,yBAAyB,iCAA2B,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { useQuery, useMutation } from '@tanstack/react-query';
|
|
3
3
|
import { getClient } from '../../core/runtime/client.js';
|
|
4
|
-
import {
|
|
4
|
+
import { runtimeKeys, useRuntimeReady } from './keys.js';
|
|
5
5
|
import { unwrap, asRuntimeList, cachedRuntimeList, setLSCache, LS_COMMANDS } from './shared.js';
|
|
6
6
|
// ============================================================================
|
|
7
7
|
// Command Hooks
|
|
@@ -18,10 +18,10 @@ import { unwrap, asRuntimeList, cachedRuntimeList, setLSCache, LS_COMMANDS } fro
|
|
|
18
18
|
* (`detectCommandFromText`, the slash menu, command attachments) can iterate
|
|
19
19
|
* the result unconditionally.
|
|
20
20
|
*/
|
|
21
|
-
export function
|
|
22
|
-
const runtimeReady =
|
|
21
|
+
export function useRuntimeCommands() {
|
|
22
|
+
const runtimeReady = useRuntimeReady();
|
|
23
23
|
return useQuery({
|
|
24
|
-
queryKey:
|
|
24
|
+
queryKey: runtimeKeys.commands(),
|
|
25
25
|
queryFn: async () => {
|
|
26
26
|
const client = getClient();
|
|
27
27
|
const result = await client.command.list();
|
|
@@ -35,7 +35,7 @@ export function useOpenCodeCommands() {
|
|
|
35
35
|
gcTime: 10 * 60 * 1000,
|
|
36
36
|
});
|
|
37
37
|
}
|
|
38
|
-
export async function
|
|
38
|
+
export async function executeRuntimeCommand({ sessionId, command, args, agent, model, variant, }) {
|
|
39
39
|
const client = getClient();
|
|
40
40
|
const result = await client.session.command({
|
|
41
41
|
sessionID: sessionId,
|
|
@@ -47,9 +47,9 @@ export async function executeOpenCodeCommand({ sessionId, command, args, agent,
|
|
|
47
47
|
});
|
|
48
48
|
unwrap(result);
|
|
49
49
|
}
|
|
50
|
-
export function
|
|
50
|
+
export function useExecuteRuntimeCommand() {
|
|
51
51
|
return useMutation({
|
|
52
|
-
mutationFn:
|
|
52
|
+
mutationFn: executeRuntimeCommand,
|
|
53
53
|
// CRITICAL: Disable retry for commands. The /command endpoint blocks until
|
|
54
54
|
// the agent finishes, which can take minutes (e.g. onboarding). If a proxy
|
|
55
55
|
// timeout or network error kills the connection, TanStack Query's default
|
|
@@ -59,4 +59,10 @@ export function useExecuteOpenCodeCommand() {
|
|
|
59
59
|
retry: false,
|
|
60
60
|
});
|
|
61
61
|
}
|
|
62
|
+
/** @deprecated Renamed to `executeRuntimeCommand`. Removed in the next major. */
|
|
63
|
+
export const executeOpenCodeCommand = executeRuntimeCommand;
|
|
64
|
+
/** @deprecated Renamed to `useRuntimeCommands`. Removed in the next major. */
|
|
65
|
+
export const useOpenCodeCommands = useRuntimeCommands;
|
|
66
|
+
/** @deprecated Renamed to `useExecuteRuntimeCommand`. Removed in the next major. */
|
|
67
|
+
export const useExecuteOpenCodeCommand = useExecuteRuntimeCommand;
|
|
62
68
|
//# sourceMappingURL=commands.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commands.js","sourceRoot":"","sources":["../../../src/react/use-opencode-sessions/commands.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAEtD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"commands.js","sourceRoot":"","sources":["../../../src/react/use-opencode-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AAC,OAAO,CAAC,OAAO,CAAC;QAC1C,SAAS,EAAE,SAAS;QACpB,OAAO;QACP,SAAS,EAAE,IAAI,IAAI,EAAE;QACrB,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC3B,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC3B,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAChC,CAAC,CAAC;IACH,MAAM,CAAC,MAAM,CAAC,CAAC;AACjB,CAAC;AAED,MAAM,UAAU,wBAAwB;IACtC,OAAO,WAAW,CAAC;QACjB,UAAU,EAAE,qBAAqB;QACjC,2EAA2E;QAC3E,2EAA2E;QAC3E,0EAA0E;QAC1E,yEAAyE;QACzE,oEAAoE;QACpE,+BAA+B;QAC/B,KAAK,EAAE,KAAK;KACb,CAAC,CAAC;AACL,CAAC;AAKD,iFAAiF;AACjF,MAAM,CAAC,MAAM,sBAAsB,GAAG,qBAAqB,CAAC;AAC5D,8EAA8E;AAC9E,MAAM,CAAC,MAAM,mBAAmB,GAAG,kBAAkB,CAAC;AACtD,oFAAoF;AACpF,MAAM,CAAC,MAAM,yBAAyB,GAAG,wBAAwB,CAAC"}
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
export declare function
|
|
1
|
+
export declare function findRuntimeFiles(query: string): Promise<string[]>;
|
|
2
|
+
/** @deprecated Renamed to `findRuntimeFiles`. Removed in the next major. */
|
|
3
|
+
export declare const findOpenCodeFiles: typeof findRuntimeFiles;
|
|
2
4
|
//# sourceMappingURL=files.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"files.d.ts","sourceRoot":"","sources":["../../../src/react/use-opencode-sessions/files.ts"],"names":[],"mappings":"AAqBA,wBAAsB,
|
|
1
|
+
{"version":3,"file":"files.d.ts","sourceRoot":"","sources":["../../../src/react/use-opencode-sessions/files.ts"],"names":[],"mappings":"AAqBA,wBAAsB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAoLvE;AAGD,4EAA4E;AAC5E,eAAO,MAAM,iBAAiB,yBAAmB,CAAC"}
|
|
@@ -5,7 +5,7 @@ import { unwrap } from './shared.js';
|
|
|
5
5
|
// ============================================================================
|
|
6
6
|
let mentionFileIndexCache;
|
|
7
7
|
let mentionDirScanCache;
|
|
8
|
-
export async function
|
|
8
|
+
export async function findRuntimeFiles(query) {
|
|
9
9
|
const client = getClient();
|
|
10
10
|
const normalizedQuery = query.trim();
|
|
11
11
|
const ql = normalizedQuery.toLowerCase();
|
|
@@ -178,4 +178,7 @@ export async function findOpenCodeFiles(query) {
|
|
|
178
178
|
.sort((a, b) => rankFile(a) - rankFile(b) || a.localeCompare(b))
|
|
179
179
|
.slice(0, 20);
|
|
180
180
|
}
|
|
181
|
+
// Pre-W4 names, kept until the next major. The runtime is OpenCode or pi.
|
|
182
|
+
/** @deprecated Renamed to `findRuntimeFiles`. Removed in the next major. */
|
|
183
|
+
export const findOpenCodeFiles = findRuntimeFiles;
|
|
181
184
|
//# sourceMappingURL=files.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"files.js","sourceRoot":"","sources":["../../../src/react/use-opencode-sessions/files.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,+EAA+E;AAC/E,4CAA4C;AAC5C,+EAA+E;AAE/E,IAAI,qBAKS,CAAC;AAEd,IAAI,mBAKS,CAAC;AAEd,MAAM,CAAC,KAAK,UAAU,
|
|
1
|
+
{"version":3,"file":"files.js","sourceRoot":"","sources":["../../../src/react/use-opencode-sessions/files.ts"],"names":[],"mappings":"AAAA,OA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IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;SAC/D,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AAClB,CAAC;AAED,0EAA0E;AAC1E,4EAA4E;AAC5E,MAAM,CAAC,MAAM,iBAAiB,GAAG,gBAAgB,CAAC"}
|
|
@@ -12,5 +12,5 @@ export * from './parts.js';
|
|
|
12
12
|
export * from './files.js';
|
|
13
13
|
export * from './permissions.js';
|
|
14
14
|
export * from './vcs.js';
|
|
15
|
-
export { canQueryOpenCodeSession, clearProjectProviderCache } from './shared.js';
|
|
15
|
+
export { canQueryOpenCodeSession, canQueryRuntimeSession, clearProjectProviderCache } from './shared.js';
|
|
16
16
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/react/use-opencode-sessions/index.ts"],"names":[],"mappings":"AAKA,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,OAAO,CAAC;AACtB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B,cAAc,OAAO,CAAC;AAGtB,OAAO,EAAE,uBAAuB,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/react/use-opencode-sessions/index.ts"],"names":[],"mappings":"AAKA,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,OAAO,CAAC;AACtB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B,cAAc,OAAO,CAAC;AAGtB,OAAO,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC"}
|
|
@@ -18,5 +18,5 @@ export * from './files.js';
|
|
|
18
18
|
export * from './permissions.js';
|
|
19
19
|
export * from './vcs.js';
|
|
20
20
|
// Public session/cache helpers that live in ./shared (otherwise internal).
|
|
21
|
-
export { canQueryOpenCodeSession, clearProjectProviderCache } from './shared.js';
|
|
21
|
+
export { canQueryOpenCodeSession, canQueryRuntimeSession, clearProjectProviderCache } from './shared.js';
|
|
22
22
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/react/use-opencode-sessions/index.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,+EAA+E;AAC/E,gFAAgF;AAChF,2EAA2E;AAC3E,oBAAoB;AACpB,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,OAAO,CAAC;AACtB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B,cAAc,OAAO,CAAC;AAEtB,2EAA2E;AAC3E,OAAO,EAAE,uBAAuB,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/react/use-opencode-sessions/index.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,+EAA+E;AAC/E,gFAAgF;AAChF,2EAA2E;AAC3E,oBAAoB;AACpB,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,OAAO,CAAC;AACtB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B,cAAc,OAAO,CAAC;AAEtB,2EAA2E;AAC3E,OAAO,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC"}
|
|
@@ -73,6 +73,35 @@ export interface ToolListItem {
|
|
|
73
73
|
description: string;
|
|
74
74
|
parameters: unknown;
|
|
75
75
|
}
|
|
76
|
+
export declare const runtimeKeys: {
|
|
77
|
+
all: readonly ["opencode"];
|
|
78
|
+
sessions: (serverId?: string) => readonly ["opencode", "sessions", string];
|
|
79
|
+
session: (id: string) => readonly ["opencode", "session", string];
|
|
80
|
+
messages: (sessionId: string) => readonly ["opencode", "session", string, "messages"];
|
|
81
|
+
runtimeSession: (id: string, serverId?: string) => readonly ["opencode", "session", string, string];
|
|
82
|
+
runtimeMessages: (sessionId: string, serverId?: string) => readonly ["opencode", "session", string, "messages", string];
|
|
83
|
+
agents: () => readonly ["opencode", "agents", string];
|
|
84
|
+
toolIds: () => readonly ["opencode", "tool-ids", string];
|
|
85
|
+
tools: (providerID: string, modelID: string) => readonly ["opencode", "tools", string, string, string];
|
|
86
|
+
skills: () => readonly ["opencode", "skills", string];
|
|
87
|
+
projects: () => readonly ["opencode", "projects", string];
|
|
88
|
+
currentProject: () => readonly ["opencode", "project", "current", string];
|
|
89
|
+
commands: () => readonly ["opencode", "commands", string];
|
|
90
|
+
providers: () => readonly ["opencode", "providers", string];
|
|
91
|
+
pathInfo: () => readonly ["opencode", "path-info", string];
|
|
92
|
+
mcpStatus: () => readonly ["opencode", "mcp-status", string];
|
|
93
|
+
worktrees: () => readonly ["opencode", "worktrees", string];
|
|
94
|
+
/**
|
|
95
|
+
* `GET /vcs/diff` — the session's file changes. ONE key per (mode, sandbox),
|
|
96
|
+
* so the tab badge, the header chip and the diff panel share one cache entry
|
|
97
|
+
* and cannot contradict each other on screen.
|
|
98
|
+
*/
|
|
99
|
+
vcsDiff: (mode: "git" | "branch", serverId?: string) => readonly ["opencode", "vcs-diff", "git" | "branch", string];
|
|
100
|
+
/** Prefix over every mode + sandbox — what the event stream invalidates. */
|
|
101
|
+
vcsDiffAll: () => readonly ["opencode", "vcs-diff"];
|
|
102
|
+
};
|
|
103
|
+
export declare function useRuntimeReady(): boolean;
|
|
104
|
+
/** @deprecated Renamed to `runtimeKeys`. Removed in the next major. */
|
|
76
105
|
export declare const opencodeKeys: {
|
|
77
106
|
all: readonly ["opencode"];
|
|
78
107
|
sessions: (serverId?: string) => readonly ["opencode", "sessions", string];
|
|
@@ -100,5 +129,6 @@ export declare const opencodeKeys: {
|
|
|
100
129
|
/** Prefix over every mode + sandbox — what the event stream invalidates. */
|
|
101
130
|
vcsDiffAll: () => readonly ["opencode", "vcs-diff"];
|
|
102
131
|
};
|
|
103
|
-
|
|
132
|
+
/** @deprecated Renamed to `useRuntimeReady`. Removed in the next major. */
|
|
133
|
+
export declare const useOpenCodeRuntimeReady: typeof useRuntimeReady;
|
|
104
134
|
//# sourceMappingURL=keys.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keys.d.ts","sourceRoot":"","sources":["../../../src/react/use-opencode-sessions/keys.ts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QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC;CACxD,CAAC;AAEN,MAAM,WAAW,kBAAkB;IACjC,KAAK,CAAC,EAAE;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IAChD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;yEACqE;IACrE,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,KAAK;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,OAAO,CAAC;CACrB;AAMD,eAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"keys.d.ts","sourceRoot":"","sources":["../../../src/react/use-opencode-sessions/keys.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACV,OAAO,EACP,OAAO,EACP,IAAI,EACJ,KAAK,EACL,OAAO,EACP,OAAO,EACP,aAAa,EACb,cAAc,EACd,KAAK,EACL,SAAS,EACT,IAAI,IAAI,QAAQ,EAChB,oBAAoB,IAAI,uBAAuB,EAC/C,QAAQ,EACR,mBAAmB,EACnB,mBAAmB,EACnB,kBAAkB,EACnB,MAAM,4BAA4B,CAAC;AAMpC,YAAY,EACV,OAAO,EACP,OAAO,EACP,IAAI,EACJ,KAAK,EACL,OAAO,EACP,OAAO,EACP,aAAa,EACb,cAAc,EACd,KAAK,EACL,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,mBAAmB,EACnB,mBAAmB,EACnB,kBAAkB,GACnB,CAAC;A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,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,OAAO,CAAC;CACrB;AAMD,eAAO,MAAM,WAAW;;0BAEA,MAAM;kBACd,MAAM;0BACE,MAAM;yBACP,MAAM,aAAa,MAAM;iCAEjB,MAAM,aAAa,MAAM;;;wBAIlC,MAAM,WAAW,MAAM;;;;;;;;;IAU3C;;;;OAIG;oBACa,KAAK,GAAG,QAAQ,aAAa,MAAM;IAEnD,4EAA4E;;CAE7E,CAAC;AAEF,wBAAgB,eAAe,YAc9B;AAGD,uEAAuE;AACvE,eAAO,MAAM,YAAY;;0BAhDD,MAAM;kBACd,MAAM;0BACE,MAAM;yBACP,MAAM,aAAa,MAAM;iCAEjB,MAAM,aAAa,MAAM;;;wBAIlC,MAAM,WAAW,MAAM;;;;;;;;;IAU3C;;;;OAIG;oBACa,KAAK,GAAG,QAAQ,aAAa,MAAM;IAEnD,4EAA4E;;CAsBvC,CAAC;AACxC,2EAA2E;AAC3E,eAAO,MAAM,uBAAuB,wBAAkB,CAAC"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { useSandboxConnectionStore } from '../../browser/stores/sandbox-connection-store.js';
|
|
3
|
-
import {
|
|
3
|
+
import { getActiveRuntimeUrl } from '../../core/session/server-store/active.js';
|
|
4
4
|
import { useCurrentRuntime } from '../use-current-runtime.js';
|
|
5
5
|
import { activeServerKey } from './shared.js';
|
|
6
6
|
// ============================================================================
|
|
7
7
|
// Query Keys
|
|
8
8
|
// ============================================================================
|
|
9
|
-
export const
|
|
9
|
+
export const runtimeKeys = {
|
|
10
10
|
all: ['opencode'],
|
|
11
11
|
sessions: (serverId) => ['opencode', 'sessions', serverId ?? activeServerKey()],
|
|
12
12
|
session: (id) => ['opencode', 'session', id],
|
|
@@ -33,17 +33,22 @@ export const opencodeKeys = {
|
|
|
33
33
|
/** Prefix over every mode + sandbox — what the event stream invalidates. */
|
|
34
34
|
vcsDiffAll: () => ['opencode', 'vcs-diff'],
|
|
35
35
|
};
|
|
36
|
-
export function
|
|
36
|
+
export function useRuntimeReady() {
|
|
37
37
|
const connectedHealthy = useSandboxConnectionStore((s) => s.status === 'connected' && s.healthy === true);
|
|
38
38
|
// The health gate can flip true BEFORE the runtime URL is pinned — billing
|
|
39
39
|
// envs seed healthy=true optimistically, ahead of useSession's
|
|
40
40
|
// setCurrentRuntime(). Firing an opencode query in that gap makes getClient()
|
|
41
41
|
// throw "Server URL not ready — sandbox is still loading". So also require a
|
|
42
42
|
// resolved URL: subscribe to the runtime url (recomputes the instant the
|
|
43
|
-
// runtime pins) and fall back to
|
|
43
|
+
// runtime pins) and fall back to getActiveRuntimeUrl(), which covers the
|
|
44
44
|
// self-hosted default-sandbox case where the store url stays null.
|
|
45
45
|
const runtimeUrl = useCurrentRuntime((s) => s.url);
|
|
46
|
-
const hasUrl = !!(runtimeUrl ||
|
|
46
|
+
const hasUrl = !!(runtimeUrl || getActiveRuntimeUrl());
|
|
47
47
|
return connectedHealthy && hasUrl;
|
|
48
48
|
}
|
|
49
|
+
// Pre-W4 names, kept until the next major. The runtime is OpenCode or pi.
|
|
50
|
+
/** @deprecated Renamed to `runtimeKeys`. Removed in the next major. */
|
|
51
|
+
export const opencodeKeys = runtimeKeys;
|
|
52
|
+
/** @deprecated Renamed to `useRuntimeReady`. Removed in the next major. */
|
|
53
|
+
export const useOpenCodeRuntimeReady = useRuntimeReady;
|
|
49
54
|
//# sourceMappingURL=keys.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keys.js","sourceRoot":"","sources":["../../../src/react/use-opencode-sessions/keys.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,yBAAyB,EAAE,MAAM,+CAA+C,CAAC;AAC1F,OAAO,EAAE,
|
|
1
|
+
{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AA8E;IAC9E,6EAA6E;IAC7E,yEAAyE;IACzE,yEAAyE;IACzE,mEAAmE;IACnE,MAAM,UAAU,GAAG,iBAAiB,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IACnD,MAAM,MAAM,GAAG,CAAC,CAAC,CAAC,UAAU,IAAI,mBAAmB,EAAE,CAAC,CAAC;IACvD,OAAO,gBAAgB,IAAI,MAAM,CAAC;AACpC,CAAC;AAED,0EAA0E;AAC1E,uEAAuE;AACvE,MAAM,CAAC,MAAM,YAAY,GAAG,WAAW,CAAC;AACxC,2EAA2E;AAC3E,MAAM,CAAC,MAAM,uBAAuB,GAAG,eAAe,CAAC"}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { useQuery } from '@tanstack/react-query';
|
|
3
3
|
import { getClient } from '../../core/runtime/client.js';
|
|
4
|
-
import {
|
|
4
|
+
import { runtimeKeys, useRuntimeReady } from './keys.js';
|
|
5
5
|
import { unwrap } from './shared.js';
|
|
6
6
|
// ============================================================================
|
|
7
7
|
// MCP Status Hook
|
|
8
8
|
// ============================================================================
|
|
9
9
|
/** @deprecated Wraps an OpenCode-only runtime route. Removed in the next major. */
|
|
10
10
|
export function useOpenCodeMcpStatus() {
|
|
11
|
-
const runtimeReady =
|
|
11
|
+
const runtimeReady = useRuntimeReady();
|
|
12
12
|
return useQuery({
|
|
13
|
-
queryKey:
|
|
13
|
+
queryKey: runtimeKeys.mcpStatus(),
|
|
14
14
|
queryFn: async () => {
|
|
15
15
|
const client = getClient();
|
|
16
16
|
const result = await client.mcp.status();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp.js","sourceRoot":"","sources":["../../../src/react/use-opencode-sessions/mcp.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAEtD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"mcp.js","sourceRoot":"","sources":["../../../src/react/use-opencode-sessions/mcp.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAEtD,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC;AACtD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,+EAA+E;AAC/E,kBAAkB;AAClB,+EAA+E;AAE/E,mFAAmF;AACnF,MAAM,UAAU,oBAAoB;IAClC,MAAM,YAAY,GAAG,eAAe,EAAE,CAAC;IACvC,OAAO,QAAQ,CAA4B;QACzC,QAAQ,EAAE,WAAW,CAAC,SAAS,EAAE;QACjC,OAAO,EAAE,KAAK,IAAI,EAAE;YAClB,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;YAC3B,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC;YACzC,OAAO,MAAM,CAAC,MAAM,CAA8B,CAAC;QACrD,CAAC;QACD,OAAO,EAAE,YAAY;QACrB,SAAS,EAAE,QAAQ;QACnB,MAAM,EAAE,CAAC,GAAG,EAAE,GAAG,IAAI;KACtB,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -8,7 +8,7 @@ export declare function extractSendErrorMessage(error: unknown): string;
|
|
|
8
8
|
* waking from auto-stop and rebinding its port. Match the common "not ready /
|
|
9
9
|
* waking / booting / provisioning" shapes, not just the exact string.
|
|
10
10
|
*/
|
|
11
|
-
export declare function
|
|
11
|
+
export declare function isRuntimeNotReadyError(error: unknown): boolean;
|
|
12
12
|
/**
|
|
13
13
|
* A status the server might recover from on its own: no status (thrown
|
|
14
14
|
* transport error), any 5xx, or a 408/429 backpressure signal. A 4xx is a real
|
|
@@ -39,7 +39,7 @@ export declare function getSendRetryDelayMs(attempt: number, status: number | un
|
|
|
39
39
|
* for backward compatibility with consumers (session-layout, tool-renderers,
|
|
40
40
|
* snapshot-dialog, session-diff-viewer).
|
|
41
41
|
*/
|
|
42
|
-
export declare function
|
|
42
|
+
export declare function useRuntimeMessages(sessionId: string, options?: {
|
|
43
43
|
/**
|
|
44
44
|
* Re-render only when a message is added, removed, or replaced, or when a
|
|
45
45
|
* part that is not `text`/`reasoning` changes. Streamed text alone does not
|
|
@@ -61,7 +61,7 @@ export declare function useOpenCodeMessages(sessionId: string, options?: {
|
|
|
61
61
|
export declare function ascendingId(prefix?: 'msg' | 'prt'): string;
|
|
62
62
|
/**
|
|
63
63
|
* The wire `messageID` for one submission, for a host that does NOT send
|
|
64
|
-
* through `
|
|
64
|
+
* through `promptRuntimeMessage`.
|
|
65
65
|
*
|
|
66
66
|
* The server-side prompt inbox (`createSessionPrompt`) needs the id up front:
|
|
67
67
|
* the control plane cannot mint one, because placing an id correctly means
|
|
@@ -76,7 +76,7 @@ export declare function ascendingId(prefix?: 'msg' | 'prt'): string;
|
|
|
76
76
|
*/
|
|
77
77
|
export declare function mintSessionWireMessageId(sessionId: string, clientMessageId?: string): string;
|
|
78
78
|
/**
|
|
79
|
-
* Abort every in-flight `
|
|
79
|
+
* Abort every in-flight `promptRuntimeMessage` delivery for a session — the
|
|
80
80
|
* primary effect `cancel()`/`stop()` need before the abort even reaches the
|
|
81
81
|
* server: a delivery that has not yet started its next attempt when this
|
|
82
82
|
* runs never starts one, and a delivery mid-network-call gets its underlying
|
|
@@ -86,7 +86,7 @@ export declare function mintSessionWireMessageId(sessionId: string, clientMessag
|
|
|
86
86
|
* flight for the session — not an error, just nothing to do).
|
|
87
87
|
*/
|
|
88
88
|
export declare function abortInFlightDeliveries(sessionId: string): number;
|
|
89
|
-
export interface
|
|
89
|
+
export interface SendRuntimeMessageArgs {
|
|
90
90
|
sessionId: string;
|
|
91
91
|
parts: PromptPart[];
|
|
92
92
|
options?: SendMessageOptions;
|
|
@@ -125,10 +125,10 @@ export interface SendOpenCodeMessageArgs {
|
|
|
125
125
|
*/
|
|
126
126
|
clientMessageId?: string;
|
|
127
127
|
}
|
|
128
|
-
/** Error thrown by `
|
|
128
|
+
/** Error thrown by `promptRuntimeMessage` on a non-2xx response — carries the
|
|
129
129
|
* HTTP status (mirroring `response`/`status` so `parseBillingError` can detect
|
|
130
130
|
* a 402) alongside the raw error payload. */
|
|
131
|
-
export interface
|
|
131
|
+
export interface SendRuntimeMessageError extends Error {
|
|
132
132
|
status?: number;
|
|
133
133
|
response?: {
|
|
134
134
|
status: number;
|
|
@@ -153,18 +153,18 @@ export interface SendOpenCodeMessageError extends Error {
|
|
|
153
153
|
* brand-new session's very first prompt can race — gets the same boot-window
|
|
154
154
|
* retry treatment instead of propagating instantly with zero retries.
|
|
155
155
|
*
|
|
156
|
-
* Extracted from `
|
|
156
|
+
* Extracted from `useSendRuntimeMessage`'s mutationFn so it's a plain async
|
|
157
157
|
* function callable — and unit-testable — without a mutation/hook context.
|
|
158
158
|
*/
|
|
159
|
-
export declare function
|
|
160
|
-
export declare function
|
|
159
|
+
export declare function promptRuntimeMessage({ sessionId, parts, options, messageID, clientMessageId, }: SendRuntimeMessageArgs): Promise<void>;
|
|
160
|
+
export declare function useSendRuntimeMessage(): import("@tanstack/react-query").UseMutationResult<void, Error, SendRuntimeMessageArgs, unknown>;
|
|
161
161
|
/**
|
|
162
162
|
* POST the abort to the runtime for a session, then re-read server status and
|
|
163
163
|
* force-update the store if it still reports busy (the SSE `session.idle`
|
|
164
164
|
* event should arrive on its own; this is the fallback for a missed one).
|
|
165
165
|
*
|
|
166
|
-
* Extracted from `
|
|
167
|
-
* `
|
|
166
|
+
* Extracted from `useAbortRuntimeSession`'s mutationFn — same reasoning as
|
|
167
|
+
* `promptRuntimeMessage`: a plain async function is directly testable
|
|
168
168
|
* without a mutation/hook context, and `awaitAbortSettlement` below calls it
|
|
169
169
|
* (via the mutation's `mutateAsync`, so retry/pending state stay react-query-
|
|
170
170
|
* driven) without needing to render a hook to prove the failure path.
|
|
@@ -173,8 +173,8 @@ export declare function useSendOpenCodeMessage(): import("@tanstack/react-query"
|
|
|
173
173
|
* then `awaitAbortSettlement`) decides what to do with that; this function
|
|
174
174
|
* itself never swallows it.
|
|
175
175
|
*/
|
|
176
|
-
export declare function
|
|
177
|
-
export declare function
|
|
176
|
+
export declare function abortRuntimeSession(sessionId: string): Promise<void>;
|
|
177
|
+
export declare function useAbortRuntimeSession(): import("@tanstack/react-query").UseMutationResult<void, Error, string, unknown>;
|
|
178
178
|
/** How `cancel()`/`stop()`'s abort settled — see `awaitAbortSettlement`. */
|
|
179
179
|
export type AbortSettlement = {
|
|
180
180
|
status: 'aborted';
|
|
@@ -199,4 +199,20 @@ export type AbortSettlement = {
|
|
|
199
199
|
* with nothing to tell a caller whether the server actually agreed.
|
|
200
200
|
*/
|
|
201
201
|
export declare function awaitAbortSettlement(runAbort: () => Promise<void>, timeoutMs?: number): Promise<AbortSettlement>;
|
|
202
|
+
/** @deprecated Renamed to `isRuntimeNotReadyError`. Removed in the next major. */
|
|
203
|
+
export declare const isOpenCodeNotReadyError: typeof isRuntimeNotReadyError;
|
|
204
|
+
/** @deprecated Renamed to `useRuntimeMessages`. Removed in the next major. */
|
|
205
|
+
export declare const useOpenCodeMessages: typeof useRuntimeMessages;
|
|
206
|
+
/** @deprecated Renamed to `SendRuntimeMessageArgs`. Removed in the next major. */
|
|
207
|
+
export type SendOpenCodeMessageArgs = SendRuntimeMessageArgs;
|
|
208
|
+
/** @deprecated Renamed to `SendRuntimeMessageError`. Removed in the next major. */
|
|
209
|
+
export type SendOpenCodeMessageError = SendRuntimeMessageError;
|
|
210
|
+
/** @deprecated Renamed to `promptRuntimeMessage`. Removed in the next major. */
|
|
211
|
+
export declare const promptOpenCodeMessage: typeof promptRuntimeMessage;
|
|
212
|
+
/** @deprecated Renamed to `useSendRuntimeMessage`. Removed in the next major. */
|
|
213
|
+
export declare const useSendOpenCodeMessage: typeof useSendRuntimeMessage;
|
|
214
|
+
/** @deprecated Renamed to `abortRuntimeSession`. Removed in the next major. */
|
|
215
|
+
export declare const abortOpenCodeSession: typeof abortRuntimeSession;
|
|
216
|
+
/** @deprecated Renamed to `useAbortRuntimeSession`. Removed in the next major. */
|
|
217
|
+
export declare const useAbortOpenCodeSession: typeof useAbortRuntimeSession;
|
|
202
218
|
//# sourceMappingURL=messages.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../../src/react/use-opencode-sessions/messages.ts"],"names":[],"mappings":"AAQA,OAAO,EAAgB,KAAK,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAEtF,OAAO,KAAK,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,QAAQ,CAAC;AAiC7D,2EAA2E;AAC3E,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAgB9D;AAED;;;;;GAKG;AACH,wBAAgB,
|
|
1
|
+
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../../src/react/use-opencode-sessions/messages.ts"],"names":[],"mappings":"AAQA,OAAO,EAAgB,KAAK,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAEtF,OAAO,KAAK,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,QAAQ,CAAC;AAiC7D,2EAA2E;AAC3E,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAgB9D;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAI9D;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAEzE;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,KAAK,EAAE,OAA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