@kortix/sdk 0.13.46 → 0.13.47
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 +18 -13
- package/dist/browser/session-sync/server-transcript-mirror.d.ts +1 -1
- package/dist/browser/session-sync/server-transcript-mirror.d.ts.map +1 -1
- package/dist/browser/session-sync/session-sync-registry.d.ts +1 -1
- package/dist/browser/session-sync/session-sync-registry.d.ts.map +1 -1
- package/dist/browser/stores/opencode-pending-store.d.ts +1 -1
- package/dist/browser/stores/opencode-pending-store.d.ts.map +1 -1
- package/dist/browser/stores/sync-store/reconcile-parts.d.ts +1 -1
- package/dist/browser/stores/sync-store/reconcile-parts.d.ts.map +1 -1
- package/dist/browser/stores/sync-store/types.d.ts +1 -1
- package/dist/browser/stores/sync-store/types.d.ts.map +1 -1
- package/dist/browser/stores/sync-store.d.ts +1 -1
- package/dist/browser/stores/sync-store.d.ts.map +1 -1
- package/dist/core/agents/composer-agents.d.ts +1 -1
- package/dist/core/agents/composer-agents.d.ts.map +1 -1
- package/dist/core/client/kortix.d.ts +117 -59
- package/dist/core/client/kortix.d.ts.map +1 -1
- package/dist/core/client/kortix.js +59 -14
- package/dist/core/client/kortix.js.map +1 -1
- package/dist/core/models/composer-model.d.ts +1 -1
- package/dist/core/models/composer-model.d.ts.map +1 -1
- package/dist/core/models/model-flatten.d.ts +8 -1
- package/dist/core/models/model-flatten.d.ts.map +1 -1
- package/dist/core/models/model-flatten.js +2 -0
- package/dist/core/models/model-flatten.js.map +1 -1
- package/dist/core/models/model-key.d.ts +11 -0
- package/dist/core/models/model-key.d.ts.map +1 -1
- package/dist/core/models/model-key.js +20 -0
- package/dist/core/models/model-key.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/rest/platform-client/host-boundary.d.ts +14 -19
- package/dist/core/rest/platform-client/host-boundary.d.ts.map +1 -1
- package/dist/core/rest/platform-client/host-boundary.js +7 -38
- package/dist/core/rest/platform-client/host-boundary.js.map +1 -1
- package/dist/core/rest/projects-client/agent-config.d.ts +8 -0
- package/dist/core/rest/projects-client/agent-config.d.ts.map +1 -1
- package/dist/core/rest/projects-client/agent-config.js.map +1 -1
- package/dist/core/rest/projects-client/audit-filter.d.ts +6 -0
- package/dist/core/rest/projects-client/audit-filter.d.ts.map +1 -0
- package/dist/core/rest/projects-client/audit-filter.js +11 -0
- package/dist/core/rest/projects-client/audit-filter.js.map +1 -0
- package/dist/core/rest/projects-client/audit.d.ts +2 -18
- package/dist/core/rest/projects-client/audit.d.ts.map +1 -1
- package/dist/core/rest/projects-client/audit.js +30 -108
- package/dist/core/rest/projects-client/audit.js.map +1 -1
- package/dist/core/rest/projects-client/connectors.d.ts +4 -3
- package/dist/core/rest/projects-client/connectors.d.ts.map +1 -1
- package/dist/core/rest/projects-client/connectors.js.map +1 -1
- package/dist/core/rest/projects-client/iam-roles.d.ts +5 -0
- package/dist/core/rest/projects-client/iam-roles.d.ts.map +1 -1
- package/dist/core/rest/projects-client/iam-roles.js +9 -0
- package/dist/core/rest/projects-client/iam-roles.js.map +1 -1
- package/dist/core/rest/projects-client/projects.d.ts +8 -5
- package/dist/core/rest/projects-client/projects.d.ts.map +1 -1
- package/dist/core/rest/projects-client/projects.js +0 -1
- package/dist/core/rest/projects-client/projects.js.map +1 -1
- package/dist/core/rest/projects-client/secrets.d.ts +17 -8
- package/dist/core/rest/projects-client/secrets.d.ts.map +1 -1
- package/dist/core/rest/projects-client/secrets.js.map +1 -1
- package/dist/core/rest/projects-client/sessions.d.ts +4 -1
- package/dist/core/rest/projects-client/sessions.d.ts.map +1 -1
- package/dist/core/rest/projects-client/sessions.js.map +1 -1
- package/dist/core/rest/projects-client/triggers.d.ts +12 -0
- package/dist/core/rest/projects-client/triggers.d.ts.map +1 -1
- package/dist/core/rest/projects-client/triggers.js.map +1 -1
- package/dist/core/runtime/client.d.ts +12 -11
- package/dist/core/runtime/client.d.ts.map +1 -1
- package/dist/core/runtime/client.js +9 -4
- package/dist/core/runtime/client.js.map +1 -1
- package/dist/core/runtime/runtime-rest-client.d.ts +436 -0
- package/dist/core/runtime/runtime-rest-client.d.ts.map +1 -0
- package/dist/core/runtime/runtime-rest-client.js +291 -0
- package/dist/core/runtime/runtime-rest-client.js.map +1 -0
- package/dist/core/runtime/runtime-types.d.ts +1174 -0
- package/dist/core/runtime/runtime-types.d.ts.map +1 -0
- package/dist/core/runtime/runtime-types.js +2 -0
- package/dist/core/runtime/runtime-types.js.map +1 -0
- package/dist/core/runtime/transcript-types.d.ts +564 -0
- package/dist/core/runtime/transcript-types.d.ts.map +1 -0
- package/dist/core/runtime/transcript-types.js +57 -0
- package/dist/core/runtime/transcript-types.js.map +1 -0
- package/dist/core/session/health.d.ts +2 -1
- package/dist/core/session/health.d.ts.map +1 -1
- package/dist/core/session/health.js.map +1 -1
- package/dist/core/session/index.d.ts +2 -0
- package/dist/core/session/index.d.ts.map +1 -1
- package/dist/core/session/index.js +1 -0
- package/dist/core/session/index.js.map +1 -1
- package/dist/core/session/runtime-sessions.d.ts +26 -0
- package/dist/core/session/runtime-sessions.d.ts.map +1 -0
- package/dist/core/session/runtime-sessions.js +39 -0
- package/dist/core/session/runtime-sessions.js.map +1 -0
- package/dist/core/session/runtime-verbs.d.ts +55 -0
- package/dist/core/session/runtime-verbs.d.ts.map +1 -0
- package/dist/core/session/runtime-verbs.js +124 -0
- package/dist/core/session/runtime-verbs.js.map +1 -0
- package/dist/core/session/wire-message-id.d.ts +55 -12
- package/dist/core/session/wire-message-id.d.ts.map +1 -1
- package/dist/core/session/wire-message-id.js +62 -12
- package/dist/core/session/wire-message-id.js.map +1 -1
- package/dist/core/session-sync/session-sync-controller.d.ts +1 -1
- package/dist/core/session-sync/session-sync-controller.d.ts.map +1 -1
- package/dist/core/stream/event-stream.d.ts +10 -5
- package/dist/core/stream/event-stream.d.ts.map +1 -1
- package/dist/core/stream/event-stream.js +5 -1
- package/dist/core/stream/event-stream.js.map +1 -1
- package/dist/core/turns/classify.d.ts +31 -2
- package/dist/core/turns/classify.d.ts.map +1 -1
- package/dist/core/turns/classify.js +94 -0
- package/dist/core/turns/classify.js.map +1 -1
- package/dist/core/turns/index.d.ts +1 -0
- package/dist/core/turns/index.d.ts.map +1 -1
- package/dist/core/turns/index.js +1 -0
- package/dist/core/turns/index.js.map +1 -1
- package/dist/core/turns/parts.d.ts +2 -1
- package/dist/core/turns/parts.d.ts.map +1 -1
- package/dist/core/turns/parts.js +53 -49
- package/dist/core/turns/parts.js.map +1 -1
- package/dist/core/turns/segments/narration.d.ts.map +1 -1
- package/dist/core/turns/segments/narration.js +40 -130
- package/dist/core/turns/segments/narration.js.map +1 -1
- package/dist/core/turns/tool-kind.d.ts +15 -0
- package/dist/core/turns/tool-kind.d.ts.map +1 -0
- package/dist/core/turns/tool-kind.js +115 -0
- package/dist/core/turns/tool-kind.js.map +1 -0
- package/dist/core/turns/tool-registry.d.ts +6 -7
- package/dist/core/turns/tool-registry.d.ts.map +1 -1
- package/dist/core/turns/tool-registry.js +78 -73
- package/dist/core/turns/tool-registry.js.map +1 -1
- package/dist/core/turns/tools/tool-meta.d.ts +1 -0
- package/dist/core/turns/tools/tool-meta.d.ts.map +1 -1
- package/dist/core/turns/tools/tool-meta.js +7 -6
- package/dist/core/turns/tools/tool-meta.js.map +1 -1
- package/dist/core/turns/view-model.d.ts.map +1 -1
- package/dist/core/turns/view-model.js +19 -12
- package/dist/core/turns/view-model.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/kortix.esm.min.js +42 -41
- package/dist/kortix.global.js +42 -41
- package/dist/node/app-viewer.js +1 -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/node/scoped-client.d.ts +20 -0
- package/dist/node/scoped-client.d.ts.map +1 -0
- package/dist/node/scoped-client.js +170 -0
- package/dist/node/scoped-client.js.map +1 -0
- package/dist/node/server.d.ts +2 -21
- package/dist/node/server.d.ts.map +1 -1
- package/dist/node/server.js +2 -170
- package/dist/node/server.js.map +1 -1
- package/dist/react/index.d.ts +1 -0
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +1 -0
- package/dist/react/index.js.map +1 -1
- package/dist/react/sign-in-with-kortix.d.ts +8 -8
- package/dist/react/use-feature-flag.d.ts +2 -2
- package/dist/react/use-feature-flag.d.ts.map +1 -1
- package/dist/react/use-feature-flag.js +3 -2
- package/dist/react/use-feature-flag.js.map +1 -1
- package/dist/react/use-kortix-master.d.ts +1 -1
- package/dist/react/use-opencode-config.d.ts +7 -1
- package/dist/react/use-opencode-config.d.ts.map +1 -1
- package/dist/react/use-opencode-config.js +9 -1
- package/dist/react/use-opencode-config.js.map +1 -1
- package/dist/react/use-opencode-events/diagnostics.d.ts +1 -1
- package/dist/react/use-opencode-events/diagnostics.d.ts.map +1 -1
- package/dist/react/use-opencode-events/handle-event.d.ts +4 -6
- package/dist/react/use-opencode-events/handle-event.d.ts.map +1 -1
- package/dist/react/use-opencode-events/handle-event.js +43 -594
- package/dist/react/use-opencode-events/handle-event.js.map +1 -1
- package/dist/react/use-opencode-events/handle-interaction-event.d.ts +4 -0
- package/dist/react/use-opencode-events/handle-interaction-event.d.ts.map +1 -0
- package/dist/react/use-opencode-events/handle-interaction-event.js +42 -0
- package/dist/react/use-opencode-events/handle-interaction-event.js.map +1 -0
- package/dist/react/use-opencode-events/handle-message-event.d.ts +4 -0
- package/dist/react/use-opencode-events/handle-message-event.d.ts.map +1 -0
- package/dist/react/use-opencode-events/handle-message-event.js +33 -0
- package/dist/react/use-opencode-events/handle-message-event.js.map +1 -0
- package/dist/react/use-opencode-events/handle-session-event.d.ts +5 -0
- package/dist/react/use-opencode-events/handle-session-event.d.ts.map +1 -0
- package/dist/react/use-opencode-events/handle-session-event.js +243 -0
- package/dist/react/use-opencode-events/handle-session-event.js.map +1 -0
- package/dist/react/use-opencode-events/handle-workspace-event.d.ts +4 -0
- package/dist/react/use-opencode-events/handle-workspace-event.d.ts.map +1 -0
- package/dist/react/use-opencode-events/handle-workspace-event.js +113 -0
- package/dist/react/use-opencode-events/handle-workspace-event.js.map +1 -0
- package/dist/react/use-opencode-events/handler-context.d.ts +29 -0
- package/dist/react/use-opencode-events/handler-context.d.ts.map +1 -0
- package/dist/react/use-opencode-events/handler-context.js +2 -0
- package/dist/react/use-opencode-events/handler-context.js.map +1 -0
- package/dist/react/use-opencode-events/hydrate-core.d.ts +23 -0
- package/dist/react/use-opencode-events/hydrate-core.d.ts.map +1 -0
- package/dist/react/use-opencode-events/hydrate-core.js +126 -0
- package/dist/react/use-opencode-events/hydrate-core.js.map +1 -0
- package/dist/react/use-opencode-events/index.d.ts.map +1 -1
- package/dist/react/use-opencode-events/index.js +25 -143
- package/dist/react/use-opencode-events/index.js.map +1 -1
- package/dist/react/use-opencode-events/use-event-stream-refs.d.ts +1 -1
- package/dist/react/use-opencode-events/use-event-stream-refs.d.ts.map +1 -1
- package/dist/react/use-opencode-local.d.ts +1 -1
- package/dist/react/use-opencode-local.d.ts.map +1 -1
- package/dist/react/use-opencode-sessions/agents.d.ts +1 -1
- package/dist/react/use-opencode-sessions/agents.d.ts.map +1 -1
- package/dist/react/use-opencode-sessions/commands.d.ts +4 -1
- package/dist/react/use-opencode-sessions/commands.d.ts.map +1 -1
- package/dist/react/use-opencode-sessions/commands.js +6 -1
- package/dist/react/use-opencode-sessions/commands.js.map +1 -1
- package/dist/react/use-opencode-sessions/keys.d.ts +1 -1
- package/dist/react/use-opencode-sessions/keys.d.ts.map +1 -1
- package/dist/react/use-opencode-sessions/mcp.d.ts +1 -1
- package/dist/react/use-opencode-sessions/mcp.d.ts.map +1 -1
- package/dist/react/use-opencode-sessions/messages.d.ts.map +1 -1
- package/dist/react/use-opencode-sessions/messages.js +8 -2
- package/dist/react/use-opencode-sessions/messages.js.map +1 -1
- package/dist/react/use-opencode-sessions/parts.d.ts +2 -2
- package/dist/react/use-opencode-sessions/parts.d.ts.map +1 -1
- package/dist/react/use-opencode-sessions/projects.d.ts +1 -1
- package/dist/react/use-opencode-sessions/projects.d.ts.map +1 -1
- package/dist/react/use-opencode-sessions/providers.d.ts +1 -1
- package/dist/react/use-opencode-sessions/sessions.d.ts +3 -3
- package/dist/react/use-opencode-sessions/sessions.d.ts.map +1 -1
- package/dist/react/use-opencode-sessions/sharing.d.ts +1 -1
- package/dist/react/use-opencode-sessions/sharing.d.ts.map +1 -1
- package/dist/react/use-opencode-sessions/vcs.d.ts +1 -1
- package/dist/react/use-opencode-sessions/vcs.d.ts.map +1 -1
- package/dist/react/use-project-gateway.d.ts +28 -0
- package/dist/react/use-project-gateway.d.ts.map +1 -0
- package/dist/react/use-project-gateway.js +120 -0
- package/dist/react/use-project-gateway.js.map +1 -0
- package/dist/react/use-project-secrets.d.ts +6 -6
- package/dist/react/use-session-sync.d.ts +4 -5
- package/dist/react/use-session-sync.d.ts.map +1 -1
- package/dist/react/use-session-working.d.ts +1 -1
- package/dist/react/use-session-working.d.ts.map +1 -1
- package/dist/react/use-session.d.ts +18 -8
- package/dist/react/use-session.d.ts.map +1 -1
- package/dist/react/use-session.js +56 -11
- package/dist/react/use-session.js.map +1 -1
- package/dist/react/use-teams-installations.d.ts +14 -0
- package/dist/react/use-teams-installations.d.ts.map +1 -1
- package/dist/react/use-teams-installations.js.map +1 -1
- package/dist/react/use-visible-agents.d.ts +1 -1
- package/dist/react/use-visible-agents.d.ts.map +1 -1
- package/dist/transcript.d.ts +1 -1
- package/dist/transcript.d.ts.map +1 -1
- package/dist/workspace-search/client.d.ts +20 -0
- package/dist/workspace-search/client.d.ts.map +1 -0
- package/dist/workspace-search/client.js +235 -0
- package/dist/workspace-search/client.js.map +1 -0
- package/dist/workspace-search/core.d.ts.map +1 -1
- package/dist/workspace-search/core.js +9 -2
- package/dist/workspace-search/core.js.map +1 -1
- package/dist/workspace-search/index.d.ts +3 -0
- package/dist/workspace-search/index.d.ts.map +1 -0
- package/dist/workspace-search/index.js +3 -0
- package/dist/workspace-search/index.js.map +1 -0
- package/package.json +7 -5
- package/dist/core/runtime/opencode-v2-event-aliases.d.ts +0 -184
- package/dist/core/runtime/opencode-v2-event-aliases.d.ts.map +0 -1
- package/dist/core/runtime/opencode-v2-event-aliases.js +0 -2
- package/dist/core/runtime/opencode-v2-event-aliases.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hydrate-core.d.ts","sourceRoot":"","sources":["../../../src/react/use-opencode-events/hydrate-core.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,KAAK,EAAE,oBAAoB,IAAI,gCAAgC,EAAE,MAAM,kDAAkD,CAAC;AACjI,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,6CAA6C,CAAC;AAC1F,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAE/D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAI3D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAElE,KAAK,aAAa,GAAG;IACnB,MAAM,EAAE,UAAU,CAAC,OAAO,SAAS,CAAC,CAAC;IACrC,WAAW,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;IAC/C,aAAa,EAAE,UAAU,CAAC,OAAO,sBAAsB,CAAC,QAAQ,CAAC,CAAC,eAAe,CAAC,CAAC;IACnF,WAAW,EAAE,UAAU,CAAC,OAAO,sBAAsB,CAAC,QAAQ,CAAC,CAAC,aAAa,CAAC,CAAC;IAC/E,cAAc,EAAE,UAAU,CAAC,OAAO,YAAY,CAAC,QAAQ,CAAC,CAAC,YAAY,CAAC,CAAC;IACvE,4BAA4B,EAAE,UAAU,CACtC,OAAO,kBAAkB,CAC1B,CAAC,8BAA8B,CAAC,CAAC;IAClC,4BAA4B,EAAE,UAAU,CACtC,OAAO,kBAAkB,CAC1B,CAAC,8BAA8B,CAAC,CAAC;IAClC,oBAAoB,EAAE,OAAO,gCAAgC,CAAC;IAC9D,OAAO,CAAC,EAAE;QAAE,eAAe,CAAC,EAAE,OAAO,CAAC;QAAC,iBAAiB,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC;CACtE,CAAC;AA4FF,wBAAgB,WAAW,CAAC,IAAI,EAAE,aAAa,GAAG,IAAI,CAsCrD"}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { useSyncStore } from '../../browser/stores/sync-store.js';
|
|
2
|
+
import { logger } from '../../core/http/logger.js';
|
|
3
|
+
import { runtimeKeys } from '../use-opencode-sessions/index.js';
|
|
4
|
+
import { releaseMessageRehydrate, reserveMessageRehydrate, shouldSkipStatusFill } from './helpers.js';
|
|
5
|
+
import { sessionsNeedingRehydrate } from './rehydrate-targets.js';
|
|
6
|
+
function hydrateStatuses({ client, applySyncEvent, reconcileMissingBusySessions, }) {
|
|
7
|
+
client.session
|
|
8
|
+
.status()
|
|
9
|
+
.then((res) => {
|
|
10
|
+
// This snapshot is the runtime's COMPLETE set of non-idle sessions,
|
|
11
|
+
// so it carries two facts: what each listed session is doing, and
|
|
12
|
+
// that every UNLISTED one is not busy. The second is the only repair
|
|
13
|
+
// the raw status slot has for a terminal frame this tab never saw,
|
|
14
|
+
// and the surfaces that still read that slot directly — the session
|
|
15
|
+
// panel, and the sub-agent banner for CHILD sessions, which have no
|
|
16
|
+
// Kortix session row for `GET .../turn` to answer about — depend on
|
|
17
|
+
// it. `useSessionWorking` answers for Kortix sessions; this answers
|
|
18
|
+
// for the rest.
|
|
19
|
+
const statuses = res.data ?? {};
|
|
20
|
+
for (const [sessionID, status] of Object.entries(statuses)) {
|
|
21
|
+
// FILL A GAP, NEVER OVERWRITE. This snapshot describes the moment
|
|
22
|
+
// the request was ISSUED and carries no timestamp of its own, so an
|
|
23
|
+
// unconditional write let a `busy` that was true on the way out
|
|
24
|
+
// clobber an `idle` frame that arrived while it was in flight — and
|
|
25
|
+
// because the object identity changed, the store restamped that
|
|
26
|
+
// stale reading as the freshest observation there is. Stop and the
|
|
27
|
+
// turn shimmer came back on a finished turn, and `hydrateCore` runs
|
|
28
|
+
// on every heartbeat-gap rehydrate, so it could land on any turn
|
|
29
|
+
// boundary. While the live stream is delivering (~140ms per frame
|
|
30
|
+
// for a busy session, and this runs on connect) the stream owns this
|
|
31
|
+
// value; the correction for a session that went idle unseen is
|
|
32
|
+
// `reconcileMissingBusySessions` below, which reads ABSENCE from the
|
|
33
|
+
// complete list rather than a per-session reading.
|
|
34
|
+
//
|
|
35
|
+
// Only a FRESH wire frame owns the slot (`shouldSkipStatusFill`).
|
|
36
|
+
// A `'local'` value is the tab's own fabrication (the missing-busy
|
|
37
|
+
// sweep, a synthetic abort) and never blocks — letting it block
|
|
38
|
+
// made a fabrication self-sustaining. A STALE wire frame no longer
|
|
39
|
+
// blocks either: this fill runs on reconnect, a reconnect happens
|
|
40
|
+
// because a stream died, and a dead stream's last frame — a wire
|
|
41
|
+
// idle vetoing the open `/turn` row while a long tool call moves
|
|
42
|
+
// no transcript — is exactly what this read exists to correct
|
|
43
|
+
// (prod, 2026-08-26).
|
|
44
|
+
const slotState = useSyncStore.getState();
|
|
45
|
+
if (shouldSkipStatusFill({
|
|
46
|
+
hasSlot: !!slotState.sessionStatus[sessionID],
|
|
47
|
+
origin: slotState.sessionStatusOrigin[sessionID],
|
|
48
|
+
stampedAtMs: slotState.sessionStatusAt[sessionID],
|
|
49
|
+
nowMs: Date.now(),
|
|
50
|
+
}))
|
|
51
|
+
continue;
|
|
52
|
+
// Locally-synthesized event (this is a REST poll, not an SSE
|
|
53
|
+
// frame) — omits the `id` field every real `Event` union member
|
|
54
|
+
// carries, hence the assertion. `synthetic: true` marks its write
|
|
55
|
+
// `'local'`: a snapshot is a reading ABOUT the runtime taken at
|
|
56
|
+
// issue time, not the runtime speaking on the wire.
|
|
57
|
+
applySyncEvent({
|
|
58
|
+
type: 'session.status',
|
|
59
|
+
synthetic: true,
|
|
60
|
+
properties: { sessionID, status },
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
// The ENUMERATION half is not a per-session reading and does not go
|
|
64
|
+
// stale the same way: a session absent from a complete list was not
|
|
65
|
+
// running when the list was taken, and the repair it drives
|
|
66
|
+
// (`markSessionIdleLocally`) is guarded on its own.
|
|
67
|
+
reconcileMissingBusySessions.current(statuses);
|
|
68
|
+
})
|
|
69
|
+
.catch((err) => {
|
|
70
|
+
logger.error('Failed to hydrate session statuses', {
|
|
71
|
+
error: String(err),
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
function hydrateTails({ reconcileSessionTail }) {
|
|
76
|
+
const syncState = useSyncStore.getState();
|
|
77
|
+
// EVERY held transcript, not only the ones the status slot calls busy
|
|
78
|
+
// — see `sessionsNeedingRehydrate`. The slot is filled by the stream,
|
|
79
|
+
// so a gap wide enough to lose message frames is wide enough to lose
|
|
80
|
+
// the frame that would have marked the session busy.
|
|
81
|
+
for (const sid of sessionsNeedingRehydrate(Object.keys(syncState.messages))) {
|
|
82
|
+
if (!reserveMessageRehydrate(sid))
|
|
83
|
+
continue;
|
|
84
|
+
reconcileSessionTail(sid, 'sse-gap')
|
|
85
|
+
.catch(() => { })
|
|
86
|
+
.finally(() => releaseMessageRehydrate(sid));
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
export function hydrateCore(deps) {
|
|
90
|
+
const { client, queryClient, addPermission, addQuestion, fetchLspDiagnosticsDebounced, options } = deps;
|
|
91
|
+
client.permission
|
|
92
|
+
.list()
|
|
93
|
+
.then((res) => {
|
|
94
|
+
if (Array.isArray(res.data))
|
|
95
|
+
res.data.forEach(addPermission);
|
|
96
|
+
})
|
|
97
|
+
.catch((err) => {
|
|
98
|
+
logger.error('Failed to hydrate pending permissions', {
|
|
99
|
+
error: String(err),
|
|
100
|
+
});
|
|
101
|
+
});
|
|
102
|
+
client.question
|
|
103
|
+
.list()
|
|
104
|
+
.then((res) => {
|
|
105
|
+
if (Array.isArray(res.data))
|
|
106
|
+
res.data.forEach(addQuestion);
|
|
107
|
+
})
|
|
108
|
+
.catch((err) => {
|
|
109
|
+
logger.error('Failed to hydrate pending questions', {
|
|
110
|
+
error: String(err),
|
|
111
|
+
});
|
|
112
|
+
});
|
|
113
|
+
hydrateStatuses(deps);
|
|
114
|
+
// Fetch current LSP diagnostics so errors/warnings show immediately
|
|
115
|
+
// on page load (or reconnect) without waiting for agent tool output.
|
|
116
|
+
fetchLspDiagnosticsDebounced.current();
|
|
117
|
+
if (options?.refetchSessions) {
|
|
118
|
+
queryClient.refetchQueries({
|
|
119
|
+
queryKey: runtimeKeys.sessions(),
|
|
120
|
+
type: 'active',
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
if (options?.rehydrateMessages)
|
|
124
|
+
hydrateTails(deps);
|
|
125
|
+
}
|
|
126
|
+
//# sourceMappingURL=hydrate-core.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hydrate-core.js","sourceRoot":"","sources":["../../../src/react/use-opencode-events/hydrate-core.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAEhD,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,uBAAuB,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AACnG,OAAO,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAmB/D,SAAS,eAAe,CAAC,EACvB,MAAM,EACN,cAAc,EACd,4BAA4B,GACsD;IAClF,MAAM,CAAC,OAAO;SACX,MAAM,EAAE;SACR,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE;QACZ,oEAAoE;QACpE,kEAAkE;QAClE,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ACnB,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEL,MAAM,CAAC,QAAQ;SACZ,IAAI,EAAE;SACN,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE;QACZ,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC;YAAE,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;IAC7D,CAAC,CAAC;SACD,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;QACb,MAAM,CAAC,KAAK,CAAC,qCAAqC,EAAE;YAClD,KAAK,EAAE,MAAM,CAAC,GAAG,CAAC;SACnB,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEL,eAAe,CAAC,IAAI,CAAC,CAAC;IACtB,oEAAoE;IACpE,qEAAqE;IACrE,4BAA4B,CAAC,OAAO,EAAE,CAAC;IAEvC,IAAI,OAAO,EAAE,eAAe,EAAE,CAAC;QAC7B,WAAW,CAAC,cAAc,CAAC;YACzB,QAAQ,EAAE,WAAW,CAAC,QAAQ,EAAE;YAChC,IAAI,EAAE,QAAQ;SACf,CAAC,CAAC;IACL,CAAC;IAED,IAAI,OAAO,EAAE,iBAAiB;QAAE,YAAY,CAAC,IAAI,CAAC,CAAC;AACrD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/react/use-opencode-events/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/react/use-opencode-events/index.ts"],"names":[],"mappings":"AA8BA;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,GAAE;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAO,QA+MxE;AAED;;;;;;GAMG;AACH,wBAAgB,0BAA0B,SAGzC;AAGD,sFAAsF;AACtF,eAAO,MAAM,2BAA2B,mCAA6B,CAAC;AACtE,iFAAiF;AACjF,eAAO,MAAM,sBAAsB,8BAAwB,CAAC"}
|
|
@@ -1,26 +1,25 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { dropClientForUrl, getClient } from '../../core/runtime/client.js';
|
|
2
|
+
import { useQueryClient } from '@tanstack/react-query';
|
|
3
|
+
import { useEffect, useMemo, useRef, useState } from 'react';
|
|
4
|
+
import { noteSessionSyncEvent, reconcileSessionTail as reconcileSessionTailFromRegistry, } from '../../browser/session-sync/session-sync-registry.js';
|
|
6
5
|
import { useDiagnosticsStore } from '../../browser/stores/diagnostics-store.js';
|
|
7
6
|
import { useOpenCodeCompactionStore } from '../../browser/stores/opencode-compaction-store.js';
|
|
8
7
|
import { useRuntimePendingStore } from '../../browser/stores/opencode-pending-store.js';
|
|
9
|
-
import { useSyncStore } from '../../browser/stores/sync-store.js';
|
|
10
8
|
import { noteRuntimeEvidence, useSandboxConnectionStore, } from '../../browser/stores/sandbox-connection-store.js';
|
|
11
9
|
import { useServerStore } from '../../browser/stores/server-store.js';
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
10
|
+
import { useSyncStore } from '../../browser/stores/sync-store.js';
|
|
11
|
+
import { logger } from '../../core/http/logger.js';
|
|
12
|
+
import { dropClientForUrl, getClient } from '../../core/runtime/client.js';
|
|
13
|
+
import { openEventStream } from '../../core/stream/event-stream.js';
|
|
16
14
|
import { useKortixRouteProjectId } from '../route-project.js';
|
|
15
|
+
import { useCurrentRuntime } from '../use-current-runtime.js';
|
|
16
|
+
import { clearConfigOverrides } from '../use-opencode-config.js';
|
|
17
17
|
import { resetPrefetchState } from '../use-session-prefetch.js';
|
|
18
18
|
import { createEventHandler } from './handle-event.js';
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
19
|
+
import { resolveClientEvictionUrl } from './helpers.js';
|
|
20
|
+
import { hydrateCore } from './hydrate-core.js';
|
|
21
21
|
import { createStreamRevival } from './stream-revival.js';
|
|
22
22
|
import { useEventStreamRefs } from './use-event-stream-refs.js';
|
|
23
|
-
import { openEventStream } from '../../core/stream/event-stream.js';
|
|
24
23
|
/**
|
|
25
24
|
* Connects to OpenCode's SSE event stream via the SDK and
|
|
26
25
|
* performs INCREMENTAL cache updates on React Query data.
|
|
@@ -149,141 +148,24 @@ export function useRuntimeEventStream(options = {}) {
|
|
|
149
148
|
normalizeDiagnosticPaths,
|
|
150
149
|
markSessionAbortedLocally,
|
|
151
150
|
fetchLspDiagnosticsDebounced,
|
|
152
|
-
reconcileSessionTail,
|
|
151
|
+
reconcileSessionTail: reconcileSessionTailFromRegistry,
|
|
153
152
|
projectId,
|
|
154
153
|
});
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
.catch((err) => {
|
|
167
|
-
logger.error('Failed to hydrate pending permissions', {
|
|
168
|
-
error: String(err),
|
|
169
|
-
});
|
|
170
|
-
});
|
|
171
|
-
client.question
|
|
172
|
-
.list()
|
|
173
|
-
.then((res) => {
|
|
174
|
-
if (Array.isArray(res.data))
|
|
175
|
-
res.data.forEach(addQuestion);
|
|
176
|
-
})
|
|
177
|
-
.catch((err) => {
|
|
178
|
-
logger.error('Failed to hydrate pending questions', {
|
|
179
|
-
error: String(err),
|
|
180
|
-
});
|
|
181
|
-
});
|
|
182
|
-
client.session
|
|
183
|
-
.status()
|
|
184
|
-
.then((res) => {
|
|
185
|
-
// This snapshot is the runtime's COMPLETE set of non-idle sessions,
|
|
186
|
-
// so it carries two facts: what each listed session is doing, and
|
|
187
|
-
// that every UNLISTED one is not busy. The second is the only repair
|
|
188
|
-
// the raw status slot has for a terminal frame this tab never saw,
|
|
189
|
-
// and the surfaces that still read that slot directly — the session
|
|
190
|
-
// panel, and the sub-agent banner for CHILD sessions, which have no
|
|
191
|
-
// Kortix session row for `GET .../turn` to answer about — depend on
|
|
192
|
-
// it. `useSessionWorking` answers for Kortix sessions; this answers
|
|
193
|
-
// for the rest.
|
|
194
|
-
const statuses = res.data ?? {};
|
|
195
|
-
for (const [sessionID, status] of Object.entries(statuses)) {
|
|
196
|
-
// ONLY where this read is newer than what the live stream has
|
|
197
|
-
// already said. The read is a snapshot of the moment it was ISSUED,
|
|
198
|
-
// it carries no timestamp of its own, and it used to be written in
|
|
199
|
-
// unconditionally — so a `busy` that was true when the request left
|
|
200
|
-
// overwrote an `idle` frame that arrived while it was in flight, and
|
|
201
|
-
// because the object identity changed the store restamped the stale
|
|
202
|
-
// reading as the freshest observation there is. That put the Stop
|
|
203
|
-
// button and the turn shimmer back on a finished turn, and
|
|
204
|
-
// `hydrateCore` runs on every heartbeat-gap rehydrate, so it could
|
|
205
|
-
// land on any turn boundary.
|
|
206
|
-
// FILL A GAP, NEVER OVERWRITE. This snapshot describes the moment
|
|
207
|
-
// the request was ISSUED and carries no timestamp of its own, so an
|
|
208
|
-
// unconditional write let a `busy` that was true on the way out
|
|
209
|
-
// clobber an `idle` frame that arrived while it was in flight — and
|
|
210
|
-
// because the object identity changed, the store restamped that
|
|
211
|
-
// stale reading as the freshest observation there is. Stop and the
|
|
212
|
-
// turn shimmer came back on a finished turn, and `hydrateCore` runs
|
|
213
|
-
// on every heartbeat-gap rehydrate, so it could land on any turn
|
|
214
|
-
// boundary. While the live stream is delivering (~140ms per frame
|
|
215
|
-
// for a busy session, and this runs on connect) the stream owns this
|
|
216
|
-
// value; the correction for a session that went idle unseen is
|
|
217
|
-
// `reconcileMissingBusySessions` below, which reads ABSENCE from the
|
|
218
|
-
// complete list rather than a per-session reading.
|
|
219
|
-
//
|
|
220
|
-
// Only a FRESH wire frame owns the slot (`shouldSkipStatusFill`).
|
|
221
|
-
// A `'local'` value is the tab's own fabrication (the missing-busy
|
|
222
|
-
// sweep, a synthetic abort) and never blocks — letting it block
|
|
223
|
-
// made a fabrication self-sustaining. A STALE wire frame no longer
|
|
224
|
-
// blocks either: this fill runs on reconnect, a reconnect happens
|
|
225
|
-
// because a stream died, and a dead stream's last frame — a wire
|
|
226
|
-
// idle vetoing the open `/turn` row while a long tool call moves
|
|
227
|
-
// no transcript — is exactly what this read exists to correct
|
|
228
|
-
// (prod, 2026-08-26).
|
|
229
|
-
const slotState = useSyncStore.getState();
|
|
230
|
-
if (shouldSkipStatusFill({
|
|
231
|
-
hasSlot: !!slotState.sessionStatus[sessionID],
|
|
232
|
-
origin: slotState.sessionStatusOrigin[sessionID],
|
|
233
|
-
stampedAtMs: slotState.sessionStatusAt[sessionID],
|
|
234
|
-
nowMs: Date.now(),
|
|
235
|
-
}))
|
|
236
|
-
continue;
|
|
237
|
-
// Locally-synthesized event (this is a REST poll, not an SSE
|
|
238
|
-
// frame) — omits the `id` field every real `Event` union member
|
|
239
|
-
// carries, hence the assertion. `synthetic: true` marks its write
|
|
240
|
-
// `'local'`: a snapshot is a reading ABOUT the runtime taken at
|
|
241
|
-
// issue time, not the runtime speaking on the wire.
|
|
242
|
-
applySyncEvent({
|
|
243
|
-
type: 'session.status',
|
|
244
|
-
synthetic: true,
|
|
245
|
-
properties: { sessionID, status },
|
|
246
|
-
});
|
|
247
|
-
}
|
|
248
|
-
// The ENUMERATION half is not a per-session reading and does not go
|
|
249
|
-
// stale the same way: a session absent from a complete list was not
|
|
250
|
-
// running when the list was taken, and the repair it drives
|
|
251
|
-
// (`markSessionIdleLocally`) is guarded on its own.
|
|
252
|
-
reconcileMissingBusySessions.current(statuses);
|
|
253
|
-
})
|
|
254
|
-
.catch((err) => {
|
|
255
|
-
logger.error('Failed to hydrate session statuses', {
|
|
256
|
-
error: String(err),
|
|
257
|
-
});
|
|
258
|
-
});
|
|
259
|
-
// Fetch current LSP diagnostics so errors/warnings show immediately
|
|
260
|
-
// on page load (or reconnect) without waiting for agent tool output.
|
|
261
|
-
fetchLspDiagnosticsDebounced.current();
|
|
262
|
-
if (options?.refetchSessions) {
|
|
263
|
-
queryClient.refetchQueries({
|
|
264
|
-
queryKey: runtimeKeys.sessions(),
|
|
265
|
-
type: 'active',
|
|
266
|
-
});
|
|
267
|
-
}
|
|
268
|
-
if (options?.rehydrateMessages) {
|
|
269
|
-
const syncState = useSyncStore.getState();
|
|
270
|
-
// EVERY held transcript, not only the ones the status slot calls busy
|
|
271
|
-
// — see `sessionsNeedingRehydrate`. The slot is filled by the stream,
|
|
272
|
-
// so a gap wide enough to lose message frames is wide enough to lose
|
|
273
|
-
// the frame that would have marked the session busy.
|
|
274
|
-
for (const sid of sessionsNeedingRehydrate(Object.keys(syncState.messages))) {
|
|
275
|
-
if (!reserveMessageRehydrate(sid))
|
|
276
|
-
continue;
|
|
277
|
-
reconcileSessionTail(sid, 'sse-gap')
|
|
278
|
-
.catch(() => { })
|
|
279
|
-
.finally(() => releaseMessageRehydrate(sid));
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
};
|
|
154
|
+
const hydrate = (options) => hydrateCore({
|
|
155
|
+
client,
|
|
156
|
+
queryClient,
|
|
157
|
+
addPermission,
|
|
158
|
+
addQuestion,
|
|
159
|
+
applySyncEvent,
|
|
160
|
+
reconcileMissingBusySessions,
|
|
161
|
+
fetchLspDiagnosticsDebounced,
|
|
162
|
+
reconcileSessionTail: reconcileSessionTailFromRegistry,
|
|
163
|
+
options,
|
|
164
|
+
});
|
|
283
165
|
// A revived handle has no record of the previous handle's outage. Re-read
|
|
284
166
|
// the held transcripts so a response completed during the park appears
|
|
285
167
|
// without requiring a page refresh.
|
|
286
|
-
|
|
168
|
+
hydrate({ rehydrateMessages: streamGeneration > 0 });
|
|
287
169
|
// Set up SSE via the framework-free event-stream machine. The
|
|
288
170
|
// connect/reconnect/backoff loop, heartbeat watchdog, and event
|
|
289
171
|
// coalescing all live in `openEventStream` — this wrapper only supplies
|
|
@@ -309,7 +191,7 @@ export function useRuntimeEventStream(options = {}) {
|
|
|
309
191
|
noteSessionSyncEvent(event);
|
|
310
192
|
handleEvent(event);
|
|
311
193
|
},
|
|
312
|
-
onGapRehydrate: () =>
|
|
194
|
+
onGapRehydrate: () => hydrate({ rehydrateMessages: true }),
|
|
313
195
|
});
|
|
314
196
|
return () => {
|
|
315
197
|
revival.stop();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/react/use-opencode-events/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/react/use-opencode-events/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC7D,OAAO,EACL,oBAAoB,EACpB,oBAAoB,IAAI,gCAAgC,GACzD,MAAM,kDAAkD,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAC7E,OAAO,EAAE,0BAA0B,EAAE,MAAM,gDAAgD,CAAC;AAC5F,OAAO,EAAE,sBAAsB,EAAE,MAAM,6CAA6C,CAAC;AACrF,OAAO,EACL,mBAAmB,EACnB,yBAAyB,GAC1B,MAAM,+CAA+C,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACxE,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,MA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jB,oEAAoE;gBACpE,qEAAqE;gBACrE,0DAA0D;gBAC1D,mBAAmB,EAAE,CAAC;gBACtB,oBAAoB,CAAC,KAAK,CAAC,CAAC;gBAC5B,WAAW,CAAC,KAAK,CAAC,CAAC;YACrB,CAAC;YACD,cAAc,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,EAAE,iBAAiB,EAAE,IAAI,EAAE,CAAC;SAC3D,CAAC,CAAC;QAEH,OAAO,GAAG,EAAE;YACV,OAAO,CAAC,IAAI,EAAE,CAAC;YACf,MAAM,CAAC,KAAK,EAAE,CAAC;QACjB,CAAC,CAAC;QACF,0EAA0E;QAC1E,mEAAmE;QACnE,oEAAoE;QACpE,yDAAyD;IAC3D,CAAC,EAAE;QACD,WAAW;QACX,aAAa;QACb,gBAAgB;QAChB,WAAW;QACX,cAAc;QACd,YAAY;QACZ,cAAc;QACd,eAAe;QACf,aAAa;QACb,cAAc;QACd,OAAO,CAAC,OAAO;QACf,cAAc;QACd,cAAc;QACd,SAAS;QACT,OAAO;QACP,yEAAyE;QACzE,qCAAqC;QACrC,gBAAgB;KACjB,CAAC,CAAC;AACL,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,0BAA0B;IACxC,qBAAqB,EAAE,CAAC;IACxB,OAAO,IAAI,CAAC;AACd,CAAC;AAED,0EAA0E;AAC1E,sFAAsF;AACtF,MAAM,CAAC,MAAM,2BAA2B,GAAG,0BAA0B,CAAC;AACtE,iFAAiF;AACjF,MAAM,CAAC,MAAM,sBAAsB,GAAG,qBAAqB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type QueryClient } from '@tanstack/react-query';
|
|
2
|
-
import type { Event as OpenCodeSdkEvent } from '
|
|
2
|
+
import type { Event as OpenCodeSdkEvent } from '../../core/runtime/runtime-types.js';
|
|
3
3
|
import { type SessionStatus } from '../use-opencode-sessions/index.js';
|
|
4
4
|
import type { NormalizeDiagnosticPaths } from './types.js';
|
|
5
5
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-event-stream-refs.d.ts","sourceRoot":"","sources":["../../../src/react/use-opencode-events/use-event-stream-refs.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,KAAK,EAAE,KAAK,IAAI,gBAAgB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"use-event-stream-refs.d.ts","sourceRoot":"","sources":["../../../src/react/use-opencode-events/use-event-stream-refs.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,KAAK,EAAE,KAAK,IAAI,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAOlF,OAAO,EAA+B,KAAK,aAAa,EAAe,MAAM,0BAA0B,CAAC;AAExG,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AA+BxD;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE;IACvC,WAAW,EAAE,WAAW,CAAC;IACzB,cAAc,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5C,cAAc,EAAE,CAAC,KAAK,EAAE,gBAAgB,KAAK,IAAI,CAAC;CACnD;0DAY2C,MAAM,KAAG,MAAM;;;qEA+E3C,MAAM;kEA+C8B,MAAM;2EAoCG,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC;EAwBzF"}
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* - Variant persistence via useModelStore
|
|
10
10
|
*/
|
|
11
11
|
import { type FlatModel } from './model-flatten.js';
|
|
12
|
-
import type { Agent, Config, ProviderListResponse } from '
|
|
12
|
+
import type { Agent, Config, ProviderListResponse } from '../core/runtime/runtime-types.js';
|
|
13
13
|
import { type ModelKey } from './use-model-store.js';
|
|
14
14
|
export type { ModelKey };
|
|
15
15
|
export interface UseRuntimeLocalOptions {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-opencode-local.d.ts","sourceRoot":"","sources":["../../src/react/use-opencode-local.ts"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AAEH,OAAO,EAAiC,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAGhF,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,oBAAoB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"use-opencode-local.d.ts","sourceRoot":"","sources":["../../src/react/use-opencode-local.ts"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AAEH,OAAO,EAAiC,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAGhF,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAMzF,OAAO,EAAiB,KAAK,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAEjE,YAAY,EAAE,QAAQ,EAAE,CAAC;AAMzB,MAAM,WAAW,sBAAsB;IACrC,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC;IACjB,SAAS,CAAC,EAAE,oBAAoB,CAAC;IACjC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,+EAA+E;IAC/E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;;;OAMG;IACH,oBAAoB,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,KAAK,QAAQ,GAAG,SAAS,CAAC;CAChF;AAED,MAAM,WAAW,iBAAiB;IAChC,oDAAoD;IACpD,OAAO,EAAE,KAAK,GAAG,SAAS,CAAC;IAC3B,+DAA+D;IAC/D,IAAI,EAAE,KAAK,EAAE,CAAC;IACd,wBA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MAAM,CAAC;IACnB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,GAAG,MAAM,GAAG,SAAS,CAUrB;AAMD,wBAAgB,eAAe,CAAC,EAC9B,MAAM,EAAE,SAAS,EACjB,SAAS,EACT,MAAM,EACN,SAAS,EACT,cAAc,EACd,gBAAgB,EAChB,oBAAoB,GACrB,EAAE,sBAAsB,GAAG,YAAY,CAwYvC;AAGD,kFAAkF;AAClF,MAAM,MAAM,uBAAuB,GAAG,sBAAsB,CAAC;AAC7D,6EAA6E;AAC7E,MAAM,MAAM,kBAAkB,GAAG,iBAAiB,CAAC;AACnD,6EAA6E;AAC7E,MAAM,MAAM,kBAAkB,GAAG,iBAAiB,CAAC;AACnD,wEAAwE;AACxE,MAAM,MAAM,aAAa,GAAG,YAAY,CAAC;AACzC,2EAA2E;AAC3E,eAAO,MAAM,gBAAgB,wBAAkB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Agent } from '
|
|
1
|
+
import type { Agent } from '../../core/runtime/runtime-types.js';
|
|
2
2
|
import { projectConfigAgentsToOpenCodeAgents, projectConfigAgentsToRuntimeAgents } from '../../core/agents/composer-agents.js';
|
|
3
3
|
export { useVisibleAgents } from '../use-visible-agents.js';
|
|
4
4
|
export { projectConfigAgentsToOpenCodeAgents, projectConfigAgentsToRuntimeAgents };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agents.d.ts","sourceRoot":"","sources":["../../../src/react/use-opencode-sessions/agents.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"agents.d.ts","sourceRoot":"","sources":["../../../src/react/use-opencode-sessions/agents.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kCAAkC,CAAC;AAI9D,OAAO,EACL,mCAAmC,EACnC,kCAAkC,EACnC,MAAM,mCAAmC,CAAC;AAK3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD,OAAO,EAAE,mCAAmC,EAAE,kCAAkC,EAAE,CAAC;AAMnF;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,CAAC,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,kEA4D3F;AAED,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,4EAahD;AAGD,4EAA4E;AAC5E,eAAO,MAAM,iBAAiB,yBAAmB,CAAC;AAClD,2EAA2E;AAC3E,eAAO,MAAM,gBAAgB,wBAAkB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Command } from '
|
|
1
|
+
import type { Command } from '../../core/runtime/runtime-types.js';
|
|
2
2
|
/**
|
|
3
3
|
* The session's slash commands.
|
|
4
4
|
*
|
|
@@ -10,6 +10,9 @@ import type { Command } from '@opencode-ai/sdk/v2/client';
|
|
|
10
10
|
* treats a corrupt localStorage placeholder as a miss, so every consumer
|
|
11
11
|
* (`detectCommandFromText`, the slash menu, command attachments) can iterate
|
|
12
12
|
* the result unconditionally.
|
|
13
|
+
*
|
|
14
|
+
* Slash commands are a runtime capability (`session.commands`): a runtime
|
|
15
|
+
* without them (pi) is never asked, and the list stays empty.
|
|
13
16
|
*/
|
|
14
17
|
export declare function useRuntimeCommands(): import("@tanstack/react-query").UseQueryResult<Command[], Error>;
|
|
15
18
|
export interface ExecuteRuntimeCommandInput {
|
|
@@ -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,
|
|
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,kCAAkC,CAAC;AAShE;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,kBAAkB,qEAiBjC;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,6 +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 { useRuntimeSupports } from '../use-runtime-supports.js';
|
|
4
5
|
import { runtimeKeys, useRuntimeReady } from './keys.js';
|
|
5
6
|
import { unwrap, asRuntimeList, cachedRuntimeList, setLSCache, LS_COMMANDS } from './shared.js';
|
|
6
7
|
// ============================================================================
|
|
@@ -17,9 +18,13 @@ import { unwrap, asRuntimeList, cachedRuntimeList, setLSCache, LS_COMMANDS } fro
|
|
|
17
18
|
* treats a corrupt localStorage placeholder as a miss, so every consumer
|
|
18
19
|
* (`detectCommandFromText`, the slash menu, command attachments) can iterate
|
|
19
20
|
* the result unconditionally.
|
|
21
|
+
*
|
|
22
|
+
* Slash commands are a runtime capability (`session.commands`): a runtime
|
|
23
|
+
* without them (pi) is never asked, and the list stays empty.
|
|
20
24
|
*/
|
|
21
25
|
export function useRuntimeCommands() {
|
|
22
26
|
const runtimeReady = useRuntimeReady();
|
|
27
|
+
const supported = useRuntimeSupports('session.commands');
|
|
23
28
|
return useQuery({
|
|
24
29
|
queryKey: runtimeKeys.commands(),
|
|
25
30
|
queryFn: async () => {
|
|
@@ -30,7 +35,7 @@ export function useRuntimeCommands() {
|
|
|
30
35
|
return commands;
|
|
31
36
|
},
|
|
32
37
|
placeholderData: () => cachedRuntimeList(LS_COMMANDS),
|
|
33
|
-
enabled: runtimeReady,
|
|
38
|
+
enabled: runtimeReady && supported,
|
|
34
39
|
staleTime: Infinity,
|
|
35
40
|
gcTime: 10 * 60 * 1000,
|
|
36
41
|
});
|
|
@@ -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,WAAW,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC;AACtD,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,iBAAiB,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAE7F,+EAA+E;AAC/E,gBAAgB;AAChB,+EAA+E;AAE/E
|
|
1
|
+
{"version":3,"file":"commands.js","sourceRoot":"","sources":["../../../src/react/use-opencode-sessions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AI,EACJ,KAAK,EACL,KAAK,EACL,OAAO,GACoB;IAC3B,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;IAC3B,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,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,4 +1,4 @@
|
|
|
1
|
-
import type { Session, Message, Part, Agent, Command, Project, SessionStatus, PermissionRule, Model, McpStatus, Path as PathInfo, ProviderListResponse as SdkProviderListResponse, Worktree, WorktreeCreateInput, WorktreeRemoveInput, WorktreeResetInput } from '
|
|
1
|
+
import type { Session, Message, Part, Agent, Command, Project, SessionStatus, PermissionRule, Model, McpStatus, Path as PathInfo, ProviderListResponse as SdkProviderListResponse, Worktree, WorktreeCreateInput, WorktreeRemoveInput, WorktreeResetInput } from '../../core/runtime/runtime-types.js';
|
|
2
2
|
export type { Session, Message, Part, Agent, Command, Project, SessionStatus, PermissionRule, Model, McpStatus, PathInfo, Worktree, WorktreeCreateInput, WorktreeRemoveInput, WorktreeResetInput, };
|
|
3
3
|
/**
|
|
4
4
|
* Shape returned by `client.session.messages()`:
|
|
@@ -1 +1 @@
|
|
|
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,
|
|
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,kCAAkC,CAAC;AAM1C,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;AAEF;;;GAGG;AACH,MAAM,WAAW,gBAAg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;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,4 +1,4 @@
|
|
|
1
|
-
import type { McpStatus } from '
|
|
1
|
+
import type { McpStatus } from '../../core/runtime/runtime-types.js';
|
|
2
2
|
/** @deprecated Wraps an OpenCode-only runtime route. Removed in the next major. */
|
|
3
3
|
export declare function useOpenCodeMcpStatus(): import("@tanstack/react-query").UseQueryResult<Record<string, McpStatus>, Error>;
|
|
4
4
|
//# sourceMappingURL=mcp.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../../../src/react/use-opencode-sessions/mcp.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../../../src/react/use-opencode-sessions/mcp.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAQlE,mFAAmF;AACnF,wBAAgB,oBAAoB,qFAanC"}
|
|
@@ -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,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,OAAO,GACb,MAAM,GAAG,IAAI,CAef;AAMD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,kBAAkB,CAChC,SAAS,EAAE,MAAM,EACjB,OAAO,GAAE;IACP;;;;;;;OAOG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;CACzB;;;;;;;;EAgDP;AAmED,wBAAgB,WAAW,CAAC,MAAM,GAAE,KAAK,GAAG,KAAa,GAAG,MAAM,
|
|
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,2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AAoB,4BAAsB,CAAC;AACxD,kFAAkF;AAClF,eAAO,MAAM,uBAAuB,+BAAyB,CAAC"}
|
|
@@ -250,8 +250,14 @@ export function ascendingId(prefix = 'msg') {
|
|
|
250
250
|
const hex = encoded.toString(16).padStart(12, '0').slice(0, 12);
|
|
251
251
|
const chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
|
|
252
252
|
let rand = '';
|
|
253
|
-
|
|
254
|
-
|
|
253
|
+
// Rejection sampling keeps the 62 characters uniform (248 = 4 * 62).
|
|
254
|
+
const bytes = new Uint8Array(32);
|
|
255
|
+
while (rand.length < 14) {
|
|
256
|
+
crypto.getRandomValues(bytes);
|
|
257
|
+
for (const b of bytes)
|
|
258
|
+
if (b < 248 && rand.length < 14)
|
|
259
|
+
rand += chars[b % 62];
|
|
260
|
+
}
|
|
255
261
|
return `${prefix}_${hex}${rand}`;
|
|
256
262
|
}
|
|
257
263
|
// ─────────────────────────────────────────────────────────────────────────────
|