@kortix/sdk 0.13.30 → 0.13.31
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 +9 -1
- package/dist/browser/stores/sync-store/delta-event-window.d.ts +10 -0
- package/dist/browser/stores/sync-store/delta-event-window.d.ts.map +1 -0
- package/dist/browser/stores/sync-store/delta-event-window.js +10 -0
- package/dist/browser/stores/sync-store/delta-event-window.js.map +1 -0
- package/dist/browser/stores/sync-store.d.ts.map +1 -1
- package/dist/browser/stores/sync-store.js +48 -5
- package/dist/browser/stores/sync-store.js.map +1 -1
- package/dist/core/client/kortix.d.ts +1 -0
- package/dist/core/client/kortix.d.ts.map +1 -1
- package/dist/core/client/kortix.js +1 -0
- package/dist/core/client/kortix.js.map +1 -1
- package/dist/core/http/api-client.d.ts.map +1 -1
- package/dist/core/http/api-client.js +26 -1
- package/dist/core/http/api-client.js.map +1 -1
- package/dist/core/rest/platform-client/host-boundary.d.ts +25 -7
- package/dist/core/rest/platform-client/host-boundary.d.ts.map +1 -1
- package/dist/core/rest/platform-client/host-boundary.js.map +1 -1
- package/dist/core/rest/projects-client/audit.d.ts +5 -3
- package/dist/core/rest/projects-client/audit.d.ts.map +1 -1
- package/dist/core/rest/projects-client/audit.js.map +1 -1
- package/dist/core/rest/projects-client/connectors.d.ts +31 -0
- package/dist/core/rest/projects-client/connectors.d.ts.map +1 -1
- package/dist/core/rest/projects-client/connectors.js +15 -0
- package/dist/core/rest/projects-client/connectors.js.map +1 -1
- package/dist/core/rest/projects-client/iam.d.ts +2 -2
- package/dist/core/rest/projects-client/iam.d.ts.map +1 -1
- package/dist/core/rest/projects-client/session-attachments.d.ts +37 -0
- package/dist/core/rest/projects-client/session-attachments.d.ts.map +1 -1
- package/dist/core/rest/projects-client/session-attachments.js +134 -0
- package/dist/core/rest/projects-client/session-attachments.js.map +1 -1
- package/dist/core/runtime/attachment-part.d.ts +1 -1
- package/dist/core/runtime/attachment-part.js +1 -1
- package/dist/core/session/connection.d.ts +1 -1
- package/dist/core/session/project-session-read.d.ts +24 -0
- package/dist/core/session/project-session-read.d.ts.map +1 -0
- package/dist/core/session/project-session-read.js +29 -0
- package/dist/core/session/project-session-read.js.map +1 -0
- package/dist/core/session/single-flight.d.ts +20 -0
- package/dist/core/session/single-flight.d.ts.map +1 -0
- package/dist/core/session/single-flight.js +39 -0
- package/dist/core/session/single-flight.js.map +1 -0
- package/dist/core/session/wake-escalation.d.ts +2 -2
- package/dist/core/session/wake-escalation.js +2 -2
- package/dist/core/session/wire-message-id.d.ts +73 -0
- package/dist/core/session/wire-message-id.d.ts.map +1 -0
- package/dist/core/session/wire-message-id.js +120 -0
- package/dist/core/session/wire-message-id.js.map +1 -0
- package/dist/core/session/working.d.ts +2 -2
- package/dist/core/session-sync/session-sync-controller.d.ts +1 -1
- package/dist/core/session-sync/session-sync-controller.js +2 -2
- package/dist/core/turns/grouping.d.ts.map +1 -1
- package/dist/core/turns/grouping.js +46 -2
- package/dist/core/turns/grouping.js.map +1 -1
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/dist/kortix.esm.min.js +35 -35
- package/dist/kortix.global.js +35 -35
- package/dist/node/app-viewer.js +1 -1
- package/dist/platform/auth-core.d.ts +1 -1
- package/dist/platform/auth-core.js +1 -1
- package/dist/react/bedrock-invokable.d.ts +2 -2
- package/dist/react/bedrock-invokable.js +2 -2
- package/dist/react/opencode.d.ts +2 -0
- package/dist/react/opencode.d.ts.map +1 -1
- package/dist/react/opencode.js +2 -0
- package/dist/react/opencode.js.map +1 -1
- package/dist/react/prefetch-session-open.d.ts +20 -0
- package/dist/react/prefetch-session-open.d.ts.map +1 -0
- package/dist/react/prefetch-session-open.js +54 -0
- package/dist/react/prefetch-session-open.js.map +1 -0
- package/dist/react/provider-refresh.d.ts.map +1 -1
- package/dist/react/provider-refresh.js +24 -14
- package/dist/react/provider-refresh.js.map +1 -1
- package/dist/react/provider-selection.d.ts +4 -0
- package/dist/react/provider-selection.d.ts.map +1 -1
- package/dist/react/provider-selection.js +6 -2
- package/dist/react/provider-selection.js.map +1 -1
- package/dist/react/session-transcript-subscription.d.ts +29 -0
- package/dist/react/session-transcript-subscription.d.ts.map +1 -0
- package/dist/react/session-transcript-subscription.js +94 -0
- package/dist/react/session-transcript-subscription.js.map +1 -0
- package/dist/react/use-model-store.d.ts +1 -1
- package/dist/react/use-model-store.js +1 -1
- package/dist/react/use-opencode-sessions/messages.d.ts +14 -3
- package/dist/react/use-opencode-sessions/messages.d.ts.map +1 -1
- package/dist/react/use-opencode-sessions/messages.js +92 -115
- package/dist/react/use-opencode-sessions/messages.js.map +1 -1
- package/dist/react/use-project-session.d.ts.map +1 -1
- package/dist/react/use-project-session.js +10 -2
- package/dist/react/use-project-session.js.map +1 -1
- package/dist/react/use-session-messages.d.ts +37 -0
- package/dist/react/use-session-messages.d.ts.map +1 -0
- package/dist/react/use-session-messages.js +83 -0
- package/dist/react/use-session-messages.js.map +1 -0
- package/dist/react/use-session-prompts.d.ts.map +1 -1
- package/dist/react/use-session-prompts.js +11 -2
- package/dist/react/use-session-prompts.js.map +1 -1
- package/dist/react/use-session-sync.d.ts +9 -0
- package/dist/react/use-session-sync.d.ts.map +1 -1
- package/dist/react/use-session-sync.js +6 -2
- package/dist/react/use-session-sync.js.map +1 -1
- package/dist/react/use-session-working.d.ts.map +1 -1
- package/dist/react/use-session-working.js +20 -10
- package/dist/react/use-session-working.js.map +1 -1
- package/dist/react/use-session.d.ts +18 -0
- package/dist/react/use-session.d.ts.map +1 -1
- package/dist/react/use-session.js +9 -1
- package/dist/react/use-session.js.map +1 -1
- package/package.json +2 -2
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* Worse, the composer's notice treated the ABSENCE of an answer as an answer.
|
|
16
16
|
* A page reload of a session whose sandbox is up and mid-turn showed "Waking
|
|
17
17
|
* this session up…" for seconds before the runtime replied (screen recording,
|
|
18
|
-
*
|
|
18
|
+
* sampleco 2026-08-24) — a negative claim asserted from having asked nobody.
|
|
19
19
|
*
|
|
20
20
|
* ## The rule
|
|
21
21
|
*
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One read of a Kortix session row, riding the session-open bundle on the
|
|
3
|
+
* open path.
|
|
4
|
+
*
|
|
5
|
+
* The bundle's `session` leg is the row `GET .../sessions/:id` serves (the API
|
|
6
|
+
* builds both with `serializeSession`; the bundle omits `owner_email`, which no
|
|
7
|
+
* single-row reader renders). On a cold open the session page needs the row
|
|
8
|
+
* for the OpenCode root id before it can paint the transcript, so a separate
|
|
9
|
+
* row request sat on that path beside the bundle that already carried it.
|
|
10
|
+
*
|
|
11
|
+
* Same claim rule as `/turn` and `/prompts`: only the FIRST read — no row
|
|
12
|
+
* cached yet — may be answered by the bundle. Anything after that is a read
|
|
13
|
+
* issued because something changed, and it asks the endpoint.
|
|
14
|
+
*
|
|
15
|
+
* Internal: not exported from any public entry point.
|
|
16
|
+
*/
|
|
17
|
+
import { getProjectSession, type ProjectSession } from '../rest/projects-client/sessions.js';
|
|
18
|
+
export declare function readProjectSessionRow(projectId: string, sessionId: string, options: {
|
|
19
|
+
bundle: boolean;
|
|
20
|
+
/** The row endpoint. Injected so a host-level test double of the REST
|
|
21
|
+
* barrel reaches this read too. */
|
|
22
|
+
fetchRow?: typeof getProjectSession;
|
|
23
|
+
}): Promise<ProjectSession>;
|
|
24
|
+
//# sourceMappingURL=project-session-read.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project-session-read.d.ts","sourceRoot":"","sources":["../../../src/core/session/project-session-read.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,iBAAiB,EAAE,KAAK,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAG1F,wBAAsB,qBAAqB,CACzC,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE;IACP,MAAM,EAAE,OAAO,CAAC;IAChB;wCACoC;IACpC,QAAQ,CAAC,EAAE,OAAO,iBAAiB,CAAC;CACrC,GACA,OAAO,CAAC,cAAc,CAAC,CAQzB"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One read of a Kortix session row, riding the session-open bundle on the
|
|
3
|
+
* open path.
|
|
4
|
+
*
|
|
5
|
+
* The bundle's `session` leg is the row `GET .../sessions/:id` serves (the API
|
|
6
|
+
* builds both with `serializeSession`; the bundle omits `owner_email`, which no
|
|
7
|
+
* single-row reader renders). On a cold open the session page needs the row
|
|
8
|
+
* for the OpenCode root id before it can paint the transcript, so a separate
|
|
9
|
+
* row request sat on that path beside the bundle that already carried it.
|
|
10
|
+
*
|
|
11
|
+
* Same claim rule as `/turn` and `/prompts`: only the FIRST read — no row
|
|
12
|
+
* cached yet — may be answered by the bundle. Anything after that is a read
|
|
13
|
+
* issued because something changed, and it asks the endpoint.
|
|
14
|
+
*
|
|
15
|
+
* Internal: not exported from any public entry point.
|
|
16
|
+
*/
|
|
17
|
+
import { getProjectSession } from '../rest/projects-client/sessions.js';
|
|
18
|
+
import { claimOpenBundle } from './open-bundle.js';
|
|
19
|
+
export async function readProjectSessionRow(projectId, sessionId, options) {
|
|
20
|
+
const claimed = options.bundle ? claimOpenBundle(projectId, sessionId) : null;
|
|
21
|
+
if (claimed) {
|
|
22
|
+
const bundle = await claimed;
|
|
23
|
+
if (bundle?.session)
|
|
24
|
+
return bundle.session;
|
|
25
|
+
}
|
|
26
|
+
const fetchRow = options.fetchRow ?? getProjectSession;
|
|
27
|
+
return fetchRow(projectId, sessionId, { showErrors: false });
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=project-session-read.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project-session-read.js","sourceRoot":"","sources":["../../../src/core/session/project-session-read.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,iBAAiB,EAAuB,MAAM,kCAAkC,CAAC;AAC1F,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAEhD,MAAM,CAAC,KAAK,UAAU,qBAAqB,CACzC,SAAiB,EACjB,SAAiB,EACjB,OAKC;IAED,MAAM,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,eAAe,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAC9E,IAAI,OAAO,EAAE,CAAC;QACZ,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC;QAC7B,IAAI,MAAM,EAAE,OAAO;YAAE,OAAO,MAAM,CAAC,OAAO,CAAC;IAC7C,CAAC;IACD,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,IAAI,iBAAiB,CAAC;IACvD,OAAO,QAAQ,CAAC,SAAS,EAAE,SAAS,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC,CAAC;AAC/D,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Same-tick single-flight: callers that ask for the same key inside ONE
|
|
3
|
+
* macrotask share one request.
|
|
4
|
+
*
|
|
5
|
+
* WHY "same tick" and not "while in flight". A read of server truth answers
|
|
6
|
+
* the question as of the instant it was ISSUED. A trigger that arrives while a
|
|
7
|
+
* read is already on the wire — a status frame, a queue drain — is news that
|
|
8
|
+
* read cannot contain, so joining it would hand the new trigger a stale answer.
|
|
9
|
+
* Callers inside the same macrotask were caused by the same event (several
|
|
10
|
+
* components' effects in one React commit), so one read answers all of them.
|
|
11
|
+
*
|
|
12
|
+
* The window closes on the next macrotask (`setTimeout(0)`), not on settle, so
|
|
13
|
+
* a slow request cannot widen it. The entry is dropped on settle either way.
|
|
14
|
+
*
|
|
15
|
+
* Internal: not exported from any public entry point.
|
|
16
|
+
*/
|
|
17
|
+
type Schedule = (callback: () => void) => void;
|
|
18
|
+
export declare function createTickSingleFlight<T>(schedule?: Schedule): (key: string, read: () => Promise<T>) => Promise<T>;
|
|
19
|
+
export {};
|
|
20
|
+
//# sourceMappingURL=single-flight.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"single-flight.d.ts","sourceRoot":"","sources":["../../../src/core/session/single-flight.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,KAAK,QAAQ,GAAG,CAAC,QAAQ,EAAE,MAAM,IAAI,KAAK,IAAI,CAAC;AAW/C,wBAAgB,sBAAsB,CAAC,CAAC,EAAE,QAAQ,GAAE,QAA0B,IAExD,KAAK,MAAM,EAAE,MAAM,MAAM,OAAO,CAAC,CAAC,CAAC,KAAG,OAAO,CAAC,CAAC,CAAC,CAcrE"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Same-tick single-flight: callers that ask for the same key inside ONE
|
|
3
|
+
* macrotask share one request.
|
|
4
|
+
*
|
|
5
|
+
* WHY "same tick" and not "while in flight". A read of server truth answers
|
|
6
|
+
* the question as of the instant it was ISSUED. A trigger that arrives while a
|
|
7
|
+
* read is already on the wire — a status frame, a queue drain — is news that
|
|
8
|
+
* read cannot contain, so joining it would hand the new trigger a stale answer.
|
|
9
|
+
* Callers inside the same macrotask were caused by the same event (several
|
|
10
|
+
* components' effects in one React commit), so one read answers all of them.
|
|
11
|
+
*
|
|
12
|
+
* The window closes on the next macrotask (`setTimeout(0)`), not on settle, so
|
|
13
|
+
* a slow request cannot widen it. The entry is dropped on settle either way.
|
|
14
|
+
*
|
|
15
|
+
* Internal: not exported from any public entry point.
|
|
16
|
+
*/
|
|
17
|
+
const defaultSchedule = (callback) => {
|
|
18
|
+
setTimeout(callback, 0);
|
|
19
|
+
};
|
|
20
|
+
export function createTickSingleFlight(schedule = defaultSchedule) {
|
|
21
|
+
const flights = new Map();
|
|
22
|
+
return function run(key, read) {
|
|
23
|
+
const current = flights.get(key);
|
|
24
|
+
if (current?.joinable)
|
|
25
|
+
return current.promise;
|
|
26
|
+
const flight = { promise: read(), joinable: true };
|
|
27
|
+
flights.set(key, flight);
|
|
28
|
+
schedule(() => {
|
|
29
|
+
flight.joinable = false;
|
|
30
|
+
});
|
|
31
|
+
const drop = () => {
|
|
32
|
+
if (flights.get(key) === flight)
|
|
33
|
+
flights.delete(key);
|
|
34
|
+
};
|
|
35
|
+
flight.promise.then(drop, drop);
|
|
36
|
+
return flight.promise;
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=single-flight.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"single-flight.js","sourceRoot":"","sources":["../../../src/core/session/single-flight.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AASH,MAAM,eAAe,GAAa,CAAC,QAAQ,EAAE,EAAE;IAC7C,UAAU,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;AAC1B,CAAC,CAAC;AAEF,MAAM,UAAU,sBAAsB,CAAI,WAAqB,eAAe;IAC5E,MAAM,OAAO,GAAG,IAAI,GAAG,EAAqB,CAAC;IAC7C,OAAO,SAAS,GAAG,CAAC,GAAW,EAAE,IAAsB;QACrD,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACjC,IAAI,OAAO,EAAE,QAAQ;YAAE,OAAO,OAAO,CAAC,OAAO,CAAC;QAC9C,MAAM,MAAM,GAAc,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;QAC9D,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;QACzB,QAAQ,CAAC,GAAG,EAAE;YACZ,MAAM,CAAC,QAAQ,GAAG,KAAK,CAAC;QAC1B,CAAC,CAAC,CAAC;QACH,MAAM,IAAI,GAAG,GAAG,EAAE;YAChB,IAAI,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,MAAM;gBAAE,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QACvD,CAAC,CAAC;QACF,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAChC,OAAO,MAAM,CAAC,OAAO,CAAC;IACxB,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* "Couldn't start session <id> — The session runtime did not become
|
|
15
15
|
* reachable. Restart the session to try again."
|
|
16
16
|
*
|
|
17
|
-
* Measured on
|
|
17
|
+
* Measured on SampleCo (2026-08-26, box `inqwpv4a1cc1kynlg46k8`): that card
|
|
18
18
|
* painted while the box was SECONDS from ready — its daemon logged
|
|
19
19
|
* `opencode ready` at 06:10:02, right after the budget expired. The card is a
|
|
20
20
|
* dead end with no auto-recovery, and the human's fix is always the same one
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
*
|
|
45
45
|
* ## Why `runtimeReachable` is a separate input from `waking`
|
|
46
46
|
*
|
|
47
|
-
* The session row is NOT proof the runtime is up. Observed on
|
|
47
|
+
* The session row is NOT proof the runtime is up. Observed on SampleCo the same
|
|
48
48
|
* day: `POST …/start` answered 202 and the row stayed `running` for 5+ minutes
|
|
49
49
|
* while the E2B resume had silently failed — the provider reported the sandbox
|
|
50
50
|
* `stopped` and the daemon proxy answered `503 sandbox_not_ready`. A ladder that
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* "Couldn't start session <id> — The session runtime did not become
|
|
15
15
|
* reachable. Restart the session to try again."
|
|
16
16
|
*
|
|
17
|
-
* Measured on
|
|
17
|
+
* Measured on SampleCo (2026-08-26, box `inqwpv4a1cc1kynlg46k8`): that card
|
|
18
18
|
* painted while the box was SECONDS from ready — its daemon logged
|
|
19
19
|
* `opencode ready` at 06:10:02, right after the budget expired. The card is a
|
|
20
20
|
* dead end with no auto-recovery, and the human's fix is always the same one
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
*
|
|
45
45
|
* ## Why `runtimeReachable` is a separate input from `waking`
|
|
46
46
|
*
|
|
47
|
-
* The session row is NOT proof the runtime is up. Observed on
|
|
47
|
+
* The session row is NOT proof the runtime is up. Observed on SampleCo the same
|
|
48
48
|
* day: `POST …/start` answered 202 and the row stayed `running` for 5+ minutes
|
|
49
49
|
* while the E2B resume had silently failed — the provider reported the sandbox
|
|
50
50
|
* `stopped` and the daemon proxy answered `503 sandbox_not_ready`. A ladder that
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The OpenCode wire message-id clock — framework-free.
|
|
3
|
+
*
|
|
4
|
+
* FORMAT. `msg_` + the LOW 48 bits of `Date.now() * 0x1000` as 12 lowercase
|
|
5
|
+
* hex chars + 14 random base62 chars. OpenCode's own `Identifier.ascending`
|
|
6
|
+
* keeps the low 6 bytes, so the clock wraps every 2^36 ms (~2.2 years); the
|
|
7
|
+
* last wrap was 2026-08-14 11:19:55 UTC.
|
|
8
|
+
*
|
|
9
|
+
* WHY IT MATTERS. A user message's id is its POSITION in the transcript:
|
|
10
|
+
* OpenCode ≤ 1.18.14 decides "has this prompt been answered?" by id order, and
|
|
11
|
+
* every host renders placed messages in id order (`compareMessagesForDisplay`).
|
|
12
|
+
* An id minted from the HIGH bits instead (`kortix sessions send` did this from
|
|
13
|
+
* 2026-08-22 until this module existed) lands ~40 days ahead of every id
|
|
14
|
+
* OpenCode mints itself and renders every later turn above it.
|
|
15
|
+
*
|
|
16
|
+
* The same contract lives in `apps/api/src/projects/wire-message-id.ts` (the
|
|
17
|
+
* API has no `@kortix/sdk` dependency). `tests/spec/wire-message-id.vectors.json`
|
|
18
|
+
* is asserted by both, so a divergence fails two suites.
|
|
19
|
+
*/
|
|
20
|
+
/**
|
|
21
|
+
* How far an id's clock may sit from the clock it is compared with and still
|
|
22
|
+
* count as placed by it: 1 hour. Every correct mint is within ~2 minutes of its
|
|
23
|
+
* own server timestamp (the backdate below); the high-bits bug put ids ~40 days
|
|
24
|
+
* out. Shared with the API's `MAX_WIRE_ID_CLOCK_CORRECTION`.
|
|
25
|
+
*/
|
|
26
|
+
export declare const WIRE_ID_CLOCK_TOLERANCE: bigint;
|
|
27
|
+
/**
|
|
28
|
+
* How far back a mint is dated before any transcript lift places it. Too EARLY
|
|
29
|
+
* is self-correcting (the lift raises it above what is on record); too LATE is
|
|
30
|
+
* undetectable downstream, because the next reply is minted from the box clock
|
|
31
|
+
* and would sort above its own prompt.
|
|
32
|
+
*/
|
|
33
|
+
export declare const WIRE_ID_BACKDATE_MS: number;
|
|
34
|
+
/** The 48-bit clock encoded in a wire id, or null when `id` is not one. */
|
|
35
|
+
export declare function wireIdClock(id: string | null | undefined): bigint | null;
|
|
36
|
+
/** The unmasked id clock of wall-clock instant `ms`. */
|
|
37
|
+
export declare function absoluteWireIdClockAt(ms: number): bigint;
|
|
38
|
+
/** The 48-bit id clock of wall-clock instant `ms`, as OpenCode writes it. */
|
|
39
|
+
export declare function wireIdClockAt(ms: number): bigint;
|
|
40
|
+
/**
|
|
41
|
+
* Undo the 48-bit wrap: the absolute clock congruent to `clock` that is
|
|
42
|
+
* nearest to `anchor` (an absolute clock). Two ids unwrapped against anchors
|
|
43
|
+
* within ~1.1 years of each other keep their true order across a wrap.
|
|
44
|
+
*/
|
|
45
|
+
export declare function unwrapWireIdClock(clock: bigint, anchor: bigint): bigint;
|
|
46
|
+
/**
|
|
47
|
+
* Whether `id` claims a clock more than {@link WIRE_ID_CLOCK_TOLERANCE} ahead
|
|
48
|
+
* of `nowMs`. Such an id cannot have been placed against any real transcript;
|
|
49
|
+
* a floor or a lift must skip it rather than let it veto every later mint.
|
|
50
|
+
*/
|
|
51
|
+
export declare function isWireIdAheadOf(id: string, nowMs: number): boolean;
|
|
52
|
+
/** Options for {@link mintWireMessageId}. */
|
|
53
|
+
export interface MintWireMessageIdOptions {
|
|
54
|
+
/** Wall clock to mint at, in ms since epoch. Default: `Date.now()`. */
|
|
55
|
+
nowMs?: number;
|
|
56
|
+
/**
|
|
57
|
+
* Ids already in the transcript. The mint sorts strictly after the newest of
|
|
58
|
+
* them that is within one hour of the clock; ids further ahead than that are
|
|
59
|
+
* ignored, so one bad id cannot drag every later message forward.
|
|
60
|
+
*/
|
|
61
|
+
after?: Iterable<string | null | undefined>;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Mint an OpenCode wire message id for a prompt.
|
|
65
|
+
*
|
|
66
|
+
* Use this — never a hand-rolled `Date.now()` encoding — for the `messageId`
|
|
67
|
+
* of `session.prompts.create()`. It is dated {@link WIRE_ID_BACKDATE_MS} back
|
|
68
|
+
* and lifted just above the newest id in `after`. A caller that cannot read the
|
|
69
|
+
* transcript should also pass `remintOnDelivery: true`, so the control plane
|
|
70
|
+
* places the id against the live transcript before delivery.
|
|
71
|
+
*/
|
|
72
|
+
export declare function mintWireMessageId(options?: MintWireMessageIdOptions): string;
|
|
73
|
+
//# sourceMappingURL=wire-message-id.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wire-message-id.d.ts","sourceRoot":"","sources":["../../../src/core/session/wire-message-id.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AASH;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,QAA8C,CAAC;AAEnF;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,QAAgB,CAAC;AAKjD,2EAA2E;AAC3E,wBAAgB,WAAW,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,CAGxE;AAED,wDAAwD;AACxD,wBAAgB,qBAAqB,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAExD;AAED,6EAA6E;AAC7E,wBAAgB,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAEhD;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAMvE;AAYD;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAIlE;AAED,6CAA6C;AAC7C,MAAM,WAAW,wBAAwB;IACvC,uEAAuE;IACvE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,KAAK,CAAC,EAAE,QAAQ,CAAC,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC,CAAC;CAC7C;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,GAAE,wBAA6B,GAAG,MAAM,CAehF"}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The OpenCode wire message-id clock — framework-free.
|
|
3
|
+
*
|
|
4
|
+
* FORMAT. `msg_` + the LOW 48 bits of `Date.now() * 0x1000` as 12 lowercase
|
|
5
|
+
* hex chars + 14 random base62 chars. OpenCode's own `Identifier.ascending`
|
|
6
|
+
* keeps the low 6 bytes, so the clock wraps every 2^36 ms (~2.2 years); the
|
|
7
|
+
* last wrap was 2026-08-14 11:19:55 UTC.
|
|
8
|
+
*
|
|
9
|
+
* WHY IT MATTERS. A user message's id is its POSITION in the transcript:
|
|
10
|
+
* OpenCode ≤ 1.18.14 decides "has this prompt been answered?" by id order, and
|
|
11
|
+
* every host renders placed messages in id order (`compareMessagesForDisplay`).
|
|
12
|
+
* An id minted from the HIGH bits instead (`kortix sessions send` did this from
|
|
13
|
+
* 2026-08-22 until this module existed) lands ~40 days ahead of every id
|
|
14
|
+
* OpenCode mints itself and renders every later turn above it.
|
|
15
|
+
*
|
|
16
|
+
* The same contract lives in `apps/api/src/projects/wire-message-id.ts` (the
|
|
17
|
+
* API has no `@kortix/sdk` dependency). `tests/spec/wire-message-id.vectors.json`
|
|
18
|
+
* is asserted by both, so a divergence fails two suites.
|
|
19
|
+
*/
|
|
20
|
+
// `BigInt(0x…)`, not `0x…n`: consumers typecheck this package under targets
|
|
21
|
+
// below ES2020, where BigInt literals are a compile error.
|
|
22
|
+
const WIRE_ID_TIME_SCALE = BigInt(0x1000);
|
|
23
|
+
const WIRE_ID_TIME_MASK = BigInt(0xffffffffffff);
|
|
24
|
+
const WIRE_ID_TIME_SPAN = WIRE_ID_TIME_MASK + BigInt(1);
|
|
25
|
+
const HALF_SPAN = WIRE_ID_TIME_SPAN / BigInt(2);
|
|
26
|
+
/**
|
|
27
|
+
* How far an id's clock may sit from the clock it is compared with and still
|
|
28
|
+
* count as placed by it: 1 hour. Every correct mint is within ~2 minutes of its
|
|
29
|
+
* own server timestamp (the backdate below); the high-bits bug put ids ~40 days
|
|
30
|
+
* out. Shared with the API's `MAX_WIRE_ID_CLOCK_CORRECTION`.
|
|
31
|
+
*/
|
|
32
|
+
export const WIRE_ID_CLOCK_TOLERANCE = BigInt(60 * 60 * 1000) * WIRE_ID_TIME_SCALE;
|
|
33
|
+
/**
|
|
34
|
+
* How far back a mint is dated before any transcript lift places it. Too EARLY
|
|
35
|
+
* is self-correcting (the lift raises it above what is on record); too LATE is
|
|
36
|
+
* undetectable downstream, because the next reply is minted from the box clock
|
|
37
|
+
* and would sort above its own prompt.
|
|
38
|
+
*/
|
|
39
|
+
export const WIRE_ID_BACKDATE_MS = 2 * 60 * 1000;
|
|
40
|
+
const WIRE_ID_CLOCK = /^msg_([0-9a-f]{12})/;
|
|
41
|
+
const BASE62 = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
|
|
42
|
+
/** The 48-bit clock encoded in a wire id, or null when `id` is not one. */
|
|
43
|
+
export function wireIdClock(id) {
|
|
44
|
+
const match = WIRE_ID_CLOCK.exec(id ?? '');
|
|
45
|
+
return match ? BigInt(`0x${match[1]}`) : null;
|
|
46
|
+
}
|
|
47
|
+
/** The unmasked id clock of wall-clock instant `ms`. */
|
|
48
|
+
export function absoluteWireIdClockAt(ms) {
|
|
49
|
+
return BigInt(Math.trunc(ms)) * WIRE_ID_TIME_SCALE;
|
|
50
|
+
}
|
|
51
|
+
/** The 48-bit id clock of wall-clock instant `ms`, as OpenCode writes it. */
|
|
52
|
+
export function wireIdClockAt(ms) {
|
|
53
|
+
return absoluteWireIdClockAt(ms) & WIRE_ID_TIME_MASK;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Undo the 48-bit wrap: the absolute clock congruent to `clock` that is
|
|
57
|
+
* nearest to `anchor` (an absolute clock). Two ids unwrapped against anchors
|
|
58
|
+
* within ~1.1 years of each other keep their true order across a wrap.
|
|
59
|
+
*/
|
|
60
|
+
export function unwrapWireIdClock(clock, anchor) {
|
|
61
|
+
const base = anchor - (anchor & WIRE_ID_TIME_MASK);
|
|
62
|
+
let unwrapped = base + clock;
|
|
63
|
+
if (unwrapped - anchor > HALF_SPAN)
|
|
64
|
+
unwrapped -= WIRE_ID_TIME_SPAN;
|
|
65
|
+
else if (anchor - unwrapped > HALF_SPAN)
|
|
66
|
+
unwrapped += WIRE_ID_TIME_SPAN;
|
|
67
|
+
return unwrapped;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Signed distance from `reference` to `clock` on the 48-bit ring: positive
|
|
71
|
+
* when `clock` is ahead. Wrap-safe for distances under ~1.1 years.
|
|
72
|
+
*/
|
|
73
|
+
function ringDelta(clock, reference) {
|
|
74
|
+
let delta = (clock - reference) & WIRE_ID_TIME_MASK;
|
|
75
|
+
if (delta >= HALF_SPAN)
|
|
76
|
+
delta -= WIRE_ID_TIME_SPAN;
|
|
77
|
+
return delta;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Whether `id` claims a clock more than {@link WIRE_ID_CLOCK_TOLERANCE} ahead
|
|
81
|
+
* of `nowMs`. Such an id cannot have been placed against any real transcript;
|
|
82
|
+
* a floor or a lift must skip it rather than let it veto every later mint.
|
|
83
|
+
*/
|
|
84
|
+
export function isWireIdAheadOf(id, nowMs) {
|
|
85
|
+
const clock = wireIdClock(id);
|
|
86
|
+
if (clock === null)
|
|
87
|
+
return false;
|
|
88
|
+
return ringDelta(clock, wireIdClockAt(nowMs)) > WIRE_ID_CLOCK_TOLERANCE;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Mint an OpenCode wire message id for a prompt.
|
|
92
|
+
*
|
|
93
|
+
* Use this — never a hand-rolled `Date.now()` encoding — for the `messageId`
|
|
94
|
+
* of `session.prompts.create()`. It is dated {@link WIRE_ID_BACKDATE_MS} back
|
|
95
|
+
* and lifted just above the newest id in `after`. A caller that cannot read the
|
|
96
|
+
* transcript should also pass `remintOnDelivery: true`, so the control plane
|
|
97
|
+
* places the id against the live transcript before delivery.
|
|
98
|
+
*/
|
|
99
|
+
export function mintWireMessageId(options = {}) {
|
|
100
|
+
const nowMs = options.nowMs ?? Date.now();
|
|
101
|
+
let encoded = wireIdClockAt(nowMs - WIRE_ID_BACKDATE_MS);
|
|
102
|
+
let newest = null;
|
|
103
|
+
for (const id of options.after ?? []) {
|
|
104
|
+
const clock = wireIdClock(id);
|
|
105
|
+
if (clock === null)
|
|
106
|
+
continue;
|
|
107
|
+
const ahead = ringDelta(clock, encoded);
|
|
108
|
+
if (ahead < BigInt(0) || ahead > WIRE_ID_CLOCK_TOLERANCE)
|
|
109
|
+
continue;
|
|
110
|
+
if (newest === null || ringDelta(clock, newest) > BigInt(0))
|
|
111
|
+
newest = clock;
|
|
112
|
+
}
|
|
113
|
+
if (newest !== null)
|
|
114
|
+
encoded = (newest + BigInt(1)) & WIRE_ID_TIME_MASK;
|
|
115
|
+
let tail = '';
|
|
116
|
+
for (let i = 0; i < 14; i++)
|
|
117
|
+
tail += BASE62[Math.floor(Math.random() * 62)];
|
|
118
|
+
return `msg_${encoded.toString(16).padStart(12, '0')}${tail}`;
|
|
119
|
+
}
|
|
120
|
+
//# sourceMappingURL=wire-message-id.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wire-message-id.js","sourceRoot":"","sources":["../../../src/core/session/wire-message-id.ts"],"names":[],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M,KAAK,GAAG,SAAS,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;QACxC,IAAI,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,IAAI,KAAK,GAAG,uBAAuB;YAAE,SAAS;QACnE,IAAI,MAAM,KAAK,IAAI,IAAI,SAAS,CAAC,KAAK,EAAE,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC;YAAE,MAAM,GAAG,KAAK,CAAC;IAC9E,CAAC;IACD,IAAI,MAAM,KAAK,IAAI;QAAE,OAAO,GAAG,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,iBAAiB,CAAC;IACxE,IAAI,IAAI,GAAG,EAAE,CAAC;IACd,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE;QAAE,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC;IAC5E,OAAO,OAAO,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE,GAAG,CAAC,GAAG,IAAI,EAAE,CAAC;AAChE,CAAC"}
|
|
@@ -224,7 +224,7 @@ export interface WorkingStreamInput {
|
|
|
224
224
|
* This one is not an observer. Content arriving is not a report that the
|
|
225
225
|
* runtime is working — it IS the runtime working, and no report outranks it.
|
|
226
226
|
*
|
|
227
|
-
* Reported with a screen recording (
|
|
227
|
+
* Reported with a screen recording (sampleco, 2026-08-23): a tool row with a
|
|
228
228
|
* live spinner and text growing on screen, and a composer showing its send
|
|
229
229
|
* arrow. Every observer had gone quiet; the only thing still speaking was the
|
|
230
230
|
* content, and nothing was listening to it.
|
|
@@ -233,7 +233,7 @@ export interface WorkingStreamInput {
|
|
|
233
233
|
* part off the SSE wire) and PULLED (a liveness-poll tail read whose hydrate
|
|
234
234
|
* shows the transcript moved with its tail still open — `sync-store.hydrate`).
|
|
235
235
|
* The pull path is what answers when the wire itself is the thing that died
|
|
236
|
-
* (
|
|
236
|
+
* (sampleco, 2026-08-26: stream black-holed mid-turn, stale idle frame vetoing
|
|
237
237
|
* the open turn row, transcript minutes behind).
|
|
238
238
|
*/
|
|
239
239
|
export interface WorkingActivityInput {
|
|
@@ -4,7 +4,7 @@ export declare const SESSION_SYNC_PAGE_SIZE = 100;
|
|
|
4
4
|
* The FIRST page — the one the user waits on.
|
|
5
5
|
*
|
|
6
6
|
* Time to first paint is bytes, not messages. Measured on a heavy session
|
|
7
|
-
* (
|
|
7
|
+
* (sampleco, 2026-08-24, a run with hundreds of image reads whose parts carried
|
|
8
8
|
* base64 — BEFORE the attachment bytes were stripped from the list):
|
|
9
9
|
*
|
|
10
10
|
* message?limit=50 -> 8,228 kB 30.39 s
|
|
@@ -20,7 +20,7 @@ export const SESSION_SYNC_PAGE_SIZE = 100;
|
|
|
20
20
|
* The FIRST page — the one the user waits on.
|
|
21
21
|
*
|
|
22
22
|
* Time to first paint is bytes, not messages. Measured on a heavy session
|
|
23
|
-
* (
|
|
23
|
+
* (sampleco, 2026-08-24, a run with hundreds of image reads whose parts carried
|
|
24
24
|
* base64 — BEFORE the attachment bytes were stripped from the list):
|
|
25
25
|
*
|
|
26
26
|
* message?limit=50 -> 8,228 kB 30.39 s
|
|
@@ -316,7 +316,7 @@ export class SessionSyncController {
|
|
|
316
316
|
// message?limit=50&before=.. 200 25,125 kB 29.23 s
|
|
317
317
|
// -> 78,097 kB transferred, finish 3.8 min, NOTHING on screen
|
|
318
318
|
//
|
|
319
|
-
// (
|
|
319
|
+
// (sampleco, 2026-08-24, a run with hundreds of image reads: fifty
|
|
320
320
|
// messages weigh 8-25 MB because the parts carry the image bytes.)
|
|
321
321
|
//
|
|
322
322
|
// There used to be a backward WALK here that kept fetching pages until
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grouping.d.ts","sourceRoot":"","sources":["../../../src/core/turns/grouping.ts"],"names":[],"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{ WIRE_ID_CLOCK_TOLERANCE, absoluteWireIdClockAt, unwrapWireIdClock, wireIdClock, } from '../session/wire-message-id.js';
|
|
11
12
|
// ============================================================================
|
|
12
13
|
// Turn grouping
|
|
13
14
|
// ============================================================================
|
|
@@ -53,8 +54,32 @@ import { isTextPart, isToolPart } from './parts.js';
|
|
|
53
54
|
* it is the latest thing the user did — and two such are a TIE, so the stable
|
|
54
55
|
* sort keeps the order the host handed them over in. Equal timestamps keep id
|
|
55
56
|
* order.
|
|
57
|
+
*
|
|
58
|
+
* AN ID IS A POSITION ONLY WHILE IT AGREES WITH ITS OWN CLOCK. The id encodes
|
|
59
|
+
* the low 48 bits of `Date.now() * 0x1000`, so a placed message is ordered by
|
|
60
|
+
* that clock UNWRAPPED against its own `time.created` — which is what keeps a
|
|
61
|
+
* session spanning the 2026-08-14 wrap in order. Every correct mint sits within
|
|
62
|
+
* minutes of its timestamp. An id more than {@link WIRE_ID_CLOCK_TOLERANCE}
|
|
63
|
+
* (1 hour) away from it was not placed by any transcript — `kortix sessions
|
|
64
|
+
* send` minted the HIGH bits, ~40 days ahead, until 2026-09 — and falls back to
|
|
65
|
+
* the server's own order: `time.created`, then id (`MessageV2.page()`). Without
|
|
66
|
+
* this, every turn sent after such a prompt rendered ABOVE it. A placed message
|
|
67
|
+
* with no timestamp (an optimistic stub keyed by a wire id) is unwrapped
|
|
68
|
+
* against the newest timestamp in the list being sorted — the stub is the
|
|
69
|
+
* newest thing the user did — or, compared pairwise, against the current clock.
|
|
56
70
|
*/
|
|
57
71
|
const WIRE_DISPLAY_ID = /^msg_[0-9a-f]{12}/;
|
|
72
|
+
/** The absolute id clock a placed message is ordered by. */
|
|
73
|
+
function placedDisplayClock(message, untimedAnchor) {
|
|
74
|
+
const clock = wireIdClock(message.info.id) ?? BigInt(0);
|
|
75
|
+
const created = message.info.time?.created;
|
|
76
|
+
if (typeof created !== 'number')
|
|
77
|
+
return unwrapWireIdClock(clock, untimedAnchor);
|
|
78
|
+
const own = absoluteWireIdClockAt(created);
|
|
79
|
+
const unwrapped = unwrapWireIdClock(clock, own);
|
|
80
|
+
const drift = unwrapped > own ? unwrapped - own : own - unwrapped;
|
|
81
|
+
return drift <= WIRE_ID_CLOCK_TOLERANCE ? unwrapped : own;
|
|
82
|
+
}
|
|
58
83
|
/** `0` for a message the server has placed, `1` for one only this tab knows. */
|
|
59
84
|
function displaySegment(id) {
|
|
60
85
|
return WIRE_DISPLAY_ID.test(id) ? 0 : 1;
|
|
@@ -63,14 +88,32 @@ function compareIds(a, b) {
|
|
|
63
88
|
return a < b ? -1 : a > b ? 1 : 0;
|
|
64
89
|
}
|
|
65
90
|
export function compareMessagesForDisplay(a, b) {
|
|
91
|
+
return compareForDisplayAt(a, b, absoluteWireIdClockAt(Date.now()));
|
|
92
|
+
}
|
|
93
|
+
/** The anchor untimed placed ids unwrap against: the list's newest timestamp. */
|
|
94
|
+
function untimedAnchorOf(messages) {
|
|
95
|
+
let newest = null;
|
|
96
|
+
for (const message of messages) {
|
|
97
|
+
const created = message.info.time?.created;
|
|
98
|
+
if (typeof created === 'number' && (newest === null || created > newest))
|
|
99
|
+
newest = created;
|
|
100
|
+
}
|
|
101
|
+
return absoluteWireIdClockAt(newest ?? Date.now());
|
|
102
|
+
}
|
|
103
|
+
function compareForDisplayAt(a, b, untimedAnchor) {
|
|
66
104
|
const segmentA = displaySegment(a.info.id);
|
|
67
105
|
const segmentB = displaySegment(b.info.id);
|
|
68
106
|
if (segmentA !== segmentB)
|
|
69
107
|
return segmentA - segmentB;
|
|
70
108
|
// Placed: the wire id is the position, and it is the only clock that agrees
|
|
71
109
|
// with the loop that produced the messages.
|
|
72
|
-
if (segmentA === 0)
|
|
110
|
+
if (segmentA === 0) {
|
|
111
|
+
const clockA = placedDisplayClock(a, untimedAnchor);
|
|
112
|
+
const clockB = placedDisplayClock(b, untimedAnchor);
|
|
113
|
+
if (clockA !== clockB)
|
|
114
|
+
return clockA < clockB ? -1 : 1;
|
|
73
115
|
return compareIds(a.info.id, b.info.id);
|
|
116
|
+
}
|
|
74
117
|
// Local: the send instant is the only record of what the user did, and it is
|
|
75
118
|
// this tab's own clock for both sides, so it is comparable. Untimed last.
|
|
76
119
|
const at = typeof a.info.time?.created === 'number' ? a.info.time.created : null;
|
|
@@ -102,6 +145,7 @@ export function groupMessagesIntoTurns(input, options) {
|
|
|
102
145
|
// Client-minted wire IDs are not proof of delivery. Keep inbox placeholders
|
|
103
146
|
// after the transcript, in the durable queue's order, until they are released.
|
|
104
147
|
const pendingOrder = new Map([...(options?.pendingMessageIds ?? [])].map((id, index) => [id, index]));
|
|
148
|
+
const untimedAnchor = untimedAnchorOf(input);
|
|
105
149
|
const messages = [...input].sort((a, b) => {
|
|
106
150
|
const aPending = pendingOrder.get(a.info.id);
|
|
107
151
|
const bPending = pendingOrder.get(b.info.id);
|
|
@@ -111,7 +155,7 @@ export function groupMessagesIntoTurns(input, options) {
|
|
|
111
155
|
return 1;
|
|
112
156
|
if (bPending !== undefined)
|
|
113
157
|
return -1;
|
|
114
|
-
return
|
|
158
|
+
return compareForDisplayAt(a, b, untimedAnchor);
|
|
115
159
|
});
|
|
116
160
|
const turns = [];
|
|
117
161
|
const turnsByUserMsgId = new Map();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grouping.js","sourceRoot":"","sources":["../../../src/core/turns/grouping.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"grouping.js","sourceRoot":"","sources":["../../../src/core/turns/grouping.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACjD,OAAO,EACL,uBAAuB,EACvB,qBAAqB,EACrB,iBAAiB,EACjB,WAAW,GACZ,MAAM,4BAA4B,CAAC;AAYpC,+EAA+E;AAC/E,gBAAgB;AAChB,+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AO;YAAE,OAAO,CAAC,CAAC;QAClC,OAAO,QAAQ,GAAG,QAAQ,CAAC;IAC7B,CAAC,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,gBAAgB,CAAC,QAA+B,EAAE,SAAiB;IACjF,MAAM,cAAc,GAAG,QAAQ,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IAC/C,IAAI,CAAC,cAAc,IAAI,cAAc,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAC9D,MAAM,MAAM,GAAa,EAAE,CAAC;IAC5B,KAAK,MAAM,OAAO,IAAI,cAAc,EAAE,CAAC;QACrC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACrB,MAAM,CAAC,IAAI,CAAC,GAAG,gBAAgB,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC;IACtD,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -72,6 +72,12 @@ export type { SessionHealthResponse, SessionHealthResult } from './core/session/
|
|
|
72
72
|
* `ensureReady()` return type without reaching into an internal module path).
|
|
73
73
|
*/
|
|
74
74
|
export type { SessionRuntimeEntry } from './core/session/session-runtime-registry.js';
|
|
75
|
+
/**
|
|
76
|
+
* Mint the OpenCode wire `messageId` for `session.prompts.create()`. The id is
|
|
77
|
+
* the prompt's position in the transcript; a hand-rolled encoding sorts wrong.
|
|
78
|
+
*/
|
|
79
|
+
export { mintWireMessageId } from './core/session/wire-message-id.js';
|
|
80
|
+
export type { MintWireMessageIdOptions } from './core/session/wire-message-id.js';
|
|
75
81
|
/**
|
|
76
82
|
* The framework-free SSE event-stream primitive — connect/reconnect/backoff,
|
|
77
83
|
* heartbeat watchdog, and event coalescing, with ZERO react/react-query
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":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