@sentry/junior 0.106.0 → 0.107.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{agent-hooks-KR5BCWOK.js → agent-hooks-ICPIJAFY.js} +9 -7
- package/dist/api/conversations/detail.d.ts +1 -1
- package/dist/api/conversations/events.d.ts +14 -0
- package/dist/api/conversations/schema.d.ts +196 -463
- package/dist/api/schema.d.ts +2 -7
- package/dist/api/schema.js +10 -8
- package/dist/api.js +377 -810
- package/dist/app.js +3586 -3614
- package/dist/{catalog-runtime-5CVM2DOF.js → catalog-runtime-FOFNPR3P.js} +3 -2
- package/dist/chat/agent/prompt.d.ts +1 -1
- package/dist/chat/agent/request.d.ts +28 -29
- package/dist/chat/agent/resume.d.ts +7 -7
- package/dist/chat/agent/session.d.ts +5 -6
- package/dist/chat/agent/tools.d.ts +3 -3
- package/dist/chat/agent-dispatch/runner.d.ts +2 -0
- package/dist/chat/config.d.ts +2 -2
- package/dist/chat/conversations/history.d.ts +582 -167
- package/dist/chat/conversations/message-projection.d.ts +6 -0
- package/dist/chat/conversations/message-summaries.d.ts +9 -0
- package/dist/chat/conversations/messages.d.ts +13 -27
- package/dist/chat/conversations/projection.d.ts +30 -53
- package/dist/chat/conversations/provenance.d.ts +42 -0
- package/dist/chat/conversations/search.d.ts +2 -2
- package/dist/chat/conversations/sql/conversation-row.d.ts +1 -1
- package/dist/chat/conversations/sql/event-lock.d.ts +3 -0
- package/dist/chat/conversations/sql/history.d.ts +3 -3
- package/dist/chat/conversations/sql/privacy.d.ts +27 -0
- package/dist/chat/conversations/sql/purge.d.ts +2 -10
- package/dist/chat/conversations/sql/store.d.ts +0 -5
- package/dist/chat/conversations/store.d.ts +8 -13
- package/dist/chat/conversations/turn-lifecycle.d.ts +41 -0
- package/dist/chat/db.d.ts +4 -10
- package/dist/chat/model-profile.d.ts +10 -0
- package/dist/chat/oauth-flow.d.ts +0 -5
- package/dist/chat/pi/conversation-events.d.ts +33 -0
- package/dist/chat/pi/sql-model-usage.d.ts +10 -0
- package/dist/chat/plugins/agent-hooks.d.ts +4 -2
- package/dist/chat/resource-events/ingest.d.ts +0 -13
- package/dist/chat/runtime/delivered-turn-state.d.ts +1 -1
- package/dist/chat/runtime/generated-artifacts.d.ts +1 -1
- package/dist/chat/runtime/reply-executor.d.ts +2 -0
- package/dist/chat/runtime/slack-resume.d.ts +23 -28
- package/dist/chat/runtime/slack-runtime.d.ts +2 -0
- package/dist/chat/runtime/turn.d.ts +14 -1
- package/dist/chat/services/context-compaction-marker.d.ts +0 -1
- package/dist/chat/services/context-compaction.d.ts +1 -0
- package/dist/chat/services/conversation-memory.d.ts +9 -0
- package/dist/chat/services/plugin-auth-orchestration.d.ts +1 -4
- package/dist/chat/services/subscribed-decision.d.ts +1 -1
- package/dist/chat/services/turn-failure-response.d.ts +10 -3
- package/dist/chat/services/turn-result.d.ts +7 -12
- package/dist/chat/services/{turn-reasoning-level.d.ts → turn-router.d.ts} +12 -8
- package/dist/chat/services/turn-session-record.d.ts +15 -16
- package/dist/chat/slack/adapter.d.ts +2 -2
- package/dist/chat/slack/errors.d.ts +2 -0
- package/dist/chat/slack/outbound.d.ts +0 -1
- package/dist/chat/slack/reply.d.ts +2 -8
- package/dist/chat/slack/tools/channel-capabilities.d.ts +2 -2
- package/dist/chat/slack/tools/{send-message.d.ts → send-files.d.ts} +27 -19
- package/dist/chat/state/conversation.d.ts +4 -4
- package/dist/chat/state/turn-id.d.ts +2 -0
- package/dist/chat/state/turn-session-keys.d.ts +6 -0
- package/dist/chat/state/turn-session.d.ts +11 -9
- package/dist/chat/task-execution/state.d.ts +6 -1
- package/dist/chat/task-execution/store.d.ts +1 -1
- package/dist/chat/tool-support/pi-tool-adapter.d.ts +1 -1
- package/dist/chat/tool-support/tool-execution-report.d.ts +1 -0
- package/dist/chat/tools/handoff/tool.d.ts +2 -2
- package/dist/chat/tools/sandbox/file-uploads.d.ts +28 -6
- package/dist/chat/tools/types.d.ts +6 -9
- package/dist/chat/tools/web/image-generate.d.ts +4 -6
- package/dist/{chunk-DDRQ4U7I.js → chunk-4YF7Z6IA.js} +390 -270
- package/dist/{chunk-AZ5OMSN5.js → chunk-AUUOHQAT.js} +2 -2
- package/dist/chunk-B2Z2H66D.js +250 -0
- package/dist/{chunk-4W4O4DCV.js → chunk-CQ7KSO2B.js} +75 -45
- package/dist/{chunk-MJSJAHBW.js → chunk-DY7TRYB5.js} +1 -1
- package/dist/{chunk-GPPUTY5M.js → chunk-EDLNHZH3.js} +861 -891
- package/dist/{chunk-R5BFYK2O.js → chunk-IGHMVDWI.js} +134 -18
- package/dist/chunk-MU6HHZEN.js +99 -0
- package/dist/{chunk-XTKJPSMF.js → chunk-NVOTGWYX.js} +458 -684
- package/dist/{chunk-AEWZ7F65.js → chunk-O24R4DCK.js} +2 -179
- package/dist/{chunk-CCFROYAV.js → chunk-PUAMO4PI.js} +115 -125
- package/dist/{chunk-ZMRLBBD5.js → chunk-RMVOAJRL.js} +30 -13
- package/dist/{chunk-3NYUCBLE.js → chunk-SPUAJVVH.js} +6 -4
- package/dist/{chunk-4UYIRWDW.js → chunk-SS67LUOK.js} +41 -290
- package/dist/{chunk-FXFQNHRU.js → chunk-VFUK3X5B.js} +4 -2
- package/dist/{chunk-3MPPVPGZ.js → chunk-VH6KWKG2.js} +2 -2
- package/dist/chunk-VIXFG2VC.js +182 -0
- package/dist/{chunk-BKM4UXUD.js → chunk-YFQ7CQDE.js} +669 -18
- package/dist/{chunk-77LHNQK4.js → chunk-YIPD3L6L.js} +4 -2
- package/dist/{chunk-3OUSJPR7.js → chunk-YNP2ATQX.js} +6 -4
- package/dist/{chunk-WR7H7VLJ.js → chunk-YT72TOEK.js} +2 -2
- package/dist/cli/chat.js +21 -20
- package/dist/cli/check.js +4 -3
- package/dist/cli/plugins.js +11 -9
- package/dist/cli/snapshot-warmup.js +7 -5
- package/dist/cli/upgrade.js +2041 -105
- package/dist/db/schema/{agent-steps.d.ts → conversation-events.d.ts} +37 -21
- package/dist/db/schema.d.ts +28 -159
- package/dist/{db-S33LFWG2.js → db-DIGO4TGW.js} +6 -8
- package/dist/{runner-HA5XAL6K.js → runner-ACR2HAIC.js} +209 -101
- package/dist/{skills-722AXRV5.js → skills-ITNHBARB.js} +4 -3
- package/dist/{validation-EUI2UFRM.js → validation-AGQ46ZGV.js} +4 -3
- package/migrations/0005_conversation_events.sql +122 -0
- package/migrations/README.md +23 -10
- package/migrations/meta/0005_snapshot.json +948 -0
- package/migrations/meta/_journal.json +7 -0
- package/package.json +5 -5
- package/dist/api/conversations/activity.d.ts +0 -40
- package/dist/api/conversations/detail-projection.d.ts +0 -11
- package/dist/api/conversations/detail.query.d.ts +0 -3
- package/dist/api/conversations/subagent.d.ts +0 -10
- package/dist/api/conversations/transcript.d.ts +0 -28
- package/dist/chat/conversations/legacy-advisor-session.d.ts +0 -7
- package/dist/chat/conversations/legacy-import.d.ts +0 -38
- package/dist/chat/conversations/sql/legacy-history-import.d.ts +0 -55
- package/dist/chat/conversations/sql/messages.d.ts +0 -4
- package/dist/chat/conversations/visible-compactions.d.ts +0 -11
- package/dist/chat/conversations/visible-messages.d.ts +0 -47
- package/dist/chat/services/reply-delivery-plan.d.ts +0 -5
- package/dist/chat/state/session-log.d.ts +0 -384
- package/dist/chunk-P4P7O5WG.js +0 -1072
- package/dist/chunk-XIMUQ4IU.js +0 -147
- package/dist/db/schema/conversation-messages.d.ts +0 -153
- package/dist/handlers/github-webhook/check-suite.d.ts +0 -3
- package/dist/handlers/github-webhook/issue-comment.d.ts +0 -3
- package/dist/handlers/github-webhook/pull-request-review-comment.d.ts +0 -3
- package/dist/handlers/github-webhook/pull-request-review.d.ts +0 -3
- package/dist/handlers/github-webhook/pull-request.d.ts +0 -3
- package/dist/handlers/github-webhook/resource.d.ts +0 -10
- package/dist/handlers/github-webhook.d.ts +0 -15
- package/dist/legacy-import-TMJISRKO.js +0 -18
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentry/junior",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.107.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
"pg": "^8.16.3",
|
|
76
76
|
"yaml": "^2.9.0",
|
|
77
77
|
"zod": "^4.4.3",
|
|
78
|
-
"@sentry/junior-plugin-api": "0.
|
|
78
|
+
"@sentry/junior-plugin-api": "0.107.1"
|
|
79
79
|
},
|
|
80
80
|
"devDependencies": {
|
|
81
81
|
"@emnapi/core": "^1.10.0",
|
|
@@ -92,9 +92,9 @@
|
|
|
92
92
|
"typescript": "^6.0.3",
|
|
93
93
|
"vercel": "^54.4.0",
|
|
94
94
|
"vitest": "^4.1.7",
|
|
95
|
-
"@sentry/junior-github": "0.
|
|
96
|
-
"@sentry/junior-memory": "0.
|
|
97
|
-
"@sentry/junior-scheduler": "0.
|
|
95
|
+
"@sentry/junior-github": "0.107.1",
|
|
96
|
+
"@sentry/junior-memory": "0.107.1",
|
|
97
|
+
"@sentry/junior-scheduler": "0.107.1",
|
|
98
98
|
"@sentry/junior-testing": "0.0.0"
|
|
99
99
|
},
|
|
100
100
|
"scripts": {
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import type { AgentStepEntry, StoredAgentStep } from "@/chat/conversations/history";
|
|
2
|
-
import type { PiMessage } from "@/chat/pi/messages";
|
|
3
|
-
import type { ConversationActivityReport, ConversationActivityStatus, ConversationSubagentActivityReport } from "./schema";
|
|
4
|
-
/**
|
|
5
|
-
* Build the current-run activity timeline from durable agent steps.
|
|
6
|
-
*
|
|
7
|
-
* Tool executions, subagent starts/ends, and their nesting are derived from the
|
|
8
|
-
* conversation's `junior_agent_steps` rows instead of the legacy Redis session
|
|
9
|
-
* log; tool statuses come from the aligned `pi_message` tool results. Redaction
|
|
10
|
-
* stays byte-compatible with the prior session-log path.
|
|
11
|
-
*/
|
|
12
|
-
export declare function buildConversationActivityFromSteps(args: {
|
|
13
|
-
canExposePayload: boolean;
|
|
14
|
-
steps: StoredAgentStep[];
|
|
15
|
-
messages: PiMessage[];
|
|
16
|
-
}): ConversationActivityReport[];
|
|
17
|
-
export type SubagentStartedStep = StoredAgentStep & {
|
|
18
|
-
entry: Extract<AgentStepEntry, {
|
|
19
|
-
type: "subagent_started";
|
|
20
|
-
}>;
|
|
21
|
-
};
|
|
22
|
-
export type SubagentEndedStep = StoredAgentStep & {
|
|
23
|
-
entry: Extract<AgentStepEntry, {
|
|
24
|
-
type: "subagent_ended";
|
|
25
|
-
}>;
|
|
26
|
-
};
|
|
27
|
-
/** Pair durable subagent start and end steps into one activity report. */
|
|
28
|
-
export declare function subagentActivityFromSteps(start: SubagentStartedStep, end: SubagentEndedStep | undefined, options?: {
|
|
29
|
-
canExposeTranscript?: boolean;
|
|
30
|
-
parentStatus?: ConversationActivityStatus;
|
|
31
|
-
}): ConversationSubagentActivityReport;
|
|
32
|
-
/**
|
|
33
|
-
* Read one child-agent transcript through its parent conversation.
|
|
34
|
-
*
|
|
35
|
-
* The parent records `subagent_started`/`subagent_ended` as durable steps that
|
|
36
|
-
* name the child by `childConversationId`; the transcript is the child
|
|
37
|
-
* conversation's own projected Pi messages. `runId` is retained for the route
|
|
38
|
-
* signature but no longer scopes the lookup — subagent steps live on the parent
|
|
39
|
-
* conversation regardless of the run that produced them.
|
|
40
|
-
*/
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { Conversation } from "@/chat/conversations/store";
|
|
2
|
-
import type { ConversationDetailReport, ConversationSubagentTranscriptReport } from "./schema";
|
|
3
|
-
/** Build one conversation REST detail from durable SQL records. */
|
|
4
|
-
export declare function buildConversationDetail(args: {
|
|
5
|
-
conversation: Conversation;
|
|
6
|
-
durationMs: number;
|
|
7
|
-
locationId?: string;
|
|
8
|
-
usage: ConversationDetailReport["cumulativeUsage"];
|
|
9
|
-
}): Promise<ConversationDetailReport>;
|
|
10
|
-
/** Build one child-agent REST detail from durable SQL history. */
|
|
11
|
-
export declare function buildConversationSubagent(conversation: Conversation, subagentId: string): Promise<ConversationSubagentTranscriptReport>;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { ConversationSubagentTranscriptReport } from "./schema";
|
|
2
|
-
/** Load one child-agent transcript from durable SQL conversation history. */
|
|
3
|
-
export declare function readConversationSubagent(conversationId: string, subagentId: string): Promise<ConversationSubagentTranscriptReport>;
|
|
4
|
-
/** Serve one child-agent transcript endpoint. */
|
|
5
|
-
declare const _default: {
|
|
6
|
-
method: "get";
|
|
7
|
-
path: string;
|
|
8
|
-
handler: (c: import("hono").Context<any, any, import("hono/types").BlankInput>) => Promise<Response>;
|
|
9
|
-
};
|
|
10
|
-
export default _default;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import type { PiMessage } from "@/chat/pi/messages";
|
|
2
|
-
import type { ConversationSubagentActivityReport, ConversationSubagentTranscriptReport, TranscriptMessage } from "./schema";
|
|
3
|
-
/** Normalize one provider transcript message into the reporting contract. */
|
|
4
|
-
export declare function normalizeTranscriptMessage(message: PiMessage): TranscriptMessage;
|
|
5
|
-
/** Normalize a stored subagent message, including bounded legacy formats. */
|
|
6
|
-
export declare function normalizeSubagentTranscriptMessage(message: PiMessage, subagentKind: string): TranscriptMessage;
|
|
7
|
-
/** Describe a redacted payload without exposing its contents. */
|
|
8
|
-
export declare function redactedPayloadFields(prefix: "input" | "output", value: unknown): {
|
|
9
|
-
[x: string]: string | number | string[];
|
|
10
|
-
};
|
|
11
|
-
/** Redact transcript payloads while retaining safe structural metadata. */
|
|
12
|
-
export declare function redactTranscriptMessage(message: TranscriptMessage): TranscriptMessage;
|
|
13
|
-
/** Count user-visible conversation messages in a normalized transcript. */
|
|
14
|
-
export declare function countConversationMessages(transcript: TranscriptMessage[]): number;
|
|
15
|
-
/** Read the latest trace identifier carried by a transcript message. */
|
|
16
|
-
export declare function traceIdFromTranscript(transcript: TranscriptMessage[]): string | undefined;
|
|
17
|
-
/** Build a subagent transcript response from its durable activity metadata. */
|
|
18
|
-
export declare function subagentTranscriptReport(activity: ConversationSubagentActivityReport, options?: {
|
|
19
|
-
subagentConversationId?: string;
|
|
20
|
-
subagentSentryConversationUrl?: string;
|
|
21
|
-
transcript?: TranscriptMessage[];
|
|
22
|
-
transcriptMessageCount?: number;
|
|
23
|
-
transcriptRedacted?: boolean;
|
|
24
|
-
transcriptRedactionReason?: "non_public_conversation";
|
|
25
|
-
transcriptExpired?: boolean;
|
|
26
|
-
transcriptExpiredAt?: string;
|
|
27
|
-
unavailableReason?: ConversationSubagentTranscriptReport["unavailableReason"];
|
|
28
|
-
}): ConversationSubagentTranscriptReport;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { type PiMessage } from "@/chat/pi/messages";
|
|
2
|
-
/** Read historical advisor messages during the bounded Redis-to-SQL import. */
|
|
3
|
-
export interface LegacyAdvisorSessionReader {
|
|
4
|
-
load: (conversationId: string) => Promise<PiMessage[]>;
|
|
5
|
-
}
|
|
6
|
-
/** Create the load-only reader for historical advisor session blobs. */
|
|
7
|
-
export declare function createLegacyAdvisorSessionReader(): LegacyAdvisorSessionReader;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { type ConversationCompaction, type ConversationMessage as ThreadConversationMessage } from "@/chat/state/conversation";
|
|
2
|
-
import { type SessionLogStore } from "@/chat/state/session-log";
|
|
3
|
-
import { type LegacyAdvisorSessionReader } from "@/chat/conversations/legacy-advisor-session";
|
|
4
|
-
import type { JuniorSqlDatabase } from "@/db/db";
|
|
5
|
-
import type { ConversationMessageStore } from "./messages";
|
|
6
|
-
import type { Conversation } from "./store";
|
|
7
|
-
/** Legacy source seams used by the one-time migration. */
|
|
8
|
-
export interface LegacyImportDeps {
|
|
9
|
-
executor: JuniorSqlDatabase;
|
|
10
|
-
messageStore: ConversationMessageStore;
|
|
11
|
-
sessionLogStore?: SessionLogStore;
|
|
12
|
-
advisorSessionStore?: LegacyAdvisorSessionReader;
|
|
13
|
-
loadVisibleMessages?: (conversationId: string) => Promise<ThreadConversationMessage[]>;
|
|
14
|
-
legacyCompactions?: ConversationCompaction[];
|
|
15
|
-
/** Conversation metadata used for imported creation and activity clocks. */
|
|
16
|
-
conversationRecord?: Conversation;
|
|
17
|
-
/** Latest activity recovered from the legacy thread-state payload. */
|
|
18
|
-
legacyLastActivityAtMs?: number;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Import one conversation's legacy Redis history into SQL, idempotently.
|
|
22
|
-
*
|
|
23
|
-
* Returns whether an import ran (false when step rows already exist or there is
|
|
24
|
-
* nothing legacy to import).
|
|
25
|
-
*/
|
|
26
|
-
export declare function importConversationFromLegacy(conversationId: string, deps: LegacyImportDeps): Promise<{
|
|
27
|
-
imported: boolean;
|
|
28
|
-
}>;
|
|
29
|
-
/**
|
|
30
|
-
* Lazy first-read import for a straggler the old deployment touched during
|
|
31
|
-
* promotion. Runs under the conversation lease the worker already holds before
|
|
32
|
-
* any turn/resume projection read; idempotent skip-if-rows-exist makes re-entry
|
|
33
|
-
* safe. Missing legacy keys produce empty reads for genuinely new conversations;
|
|
34
|
-
* actual Redis read failures surface through normal worker recovery.
|
|
35
|
-
*/
|
|
36
|
-
export declare function ensureLegacyConversationImport(args: {
|
|
37
|
-
conversationId: string;
|
|
38
|
-
}): Promise<void>;
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import type { JuniorSqlDatabase } from "@/db/db";
|
|
2
|
-
import type { PiMessage } from "@/chat/pi/messages";
|
|
3
|
-
import type { NewConversationMessage } from "../messages";
|
|
4
|
-
import { type SessionLogEntry } from "@/chat/state/session-log";
|
|
5
|
-
import { type AgentStepEntry } from "../history";
|
|
6
|
-
/** A converted legacy step with its explicit order and epoch pinned. */
|
|
7
|
-
export interface ImportedStep {
|
|
8
|
-
seq: number;
|
|
9
|
-
contextEpoch: number;
|
|
10
|
-
entry: AgentStepEntry;
|
|
11
|
-
createdAtMs: number;
|
|
12
|
-
}
|
|
13
|
-
/** Result of converting one conversation's legacy log. */
|
|
14
|
-
export interface ConvertedLegacyLog {
|
|
15
|
-
steps: ImportedStep[];
|
|
16
|
-
/** Deterministic advisor child conversation id, when a subagent was recorded. */
|
|
17
|
-
advisorChildConversationId?: string;
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Convert a legacy session log into ordered step rows with explicit epochs.
|
|
21
|
-
*
|
|
22
|
-
* `fallbackCreatedAtMs` supplies `created_at` for rows without an intrinsic
|
|
23
|
-
* timestamp (epoch markers, provider facts, timestamp-less messages); a real
|
|
24
|
-
* conversation-derived value is always passed so no import-time `now` is used.
|
|
25
|
-
*/
|
|
26
|
-
export declare function convertLegacySessionLog(args: {
|
|
27
|
-
conversationId: string;
|
|
28
|
-
entries: SessionLogEntry[];
|
|
29
|
-
fallbackCreatedAtMs: number;
|
|
30
|
-
}): ConvertedLegacyLog;
|
|
31
|
-
/** Import advisor child rows while decoding the historical request envelope. */
|
|
32
|
-
export declare function convertAdvisorMessages(messages: PiMessage[], fallbackCreatedAtMs: number): ImportedStep[];
|
|
33
|
-
/** One conversation's converted history plus optional advisor child history. */
|
|
34
|
-
export interface LegacyImportWrite {
|
|
35
|
-
conversationId: string;
|
|
36
|
-
fallbackCreatedAtMs: number;
|
|
37
|
-
lastActivityAtMs: number;
|
|
38
|
-
messages?: Array<NewConversationMessage & {
|
|
39
|
-
repliedAtMs?: number;
|
|
40
|
-
}>;
|
|
41
|
-
steps: ImportedStep[];
|
|
42
|
-
child?: {
|
|
43
|
-
conversationId: string;
|
|
44
|
-
steps: ImportedStep[];
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* Write a converted legacy history for one conversation, all-or-nothing.
|
|
49
|
-
*
|
|
50
|
-
* Serialized by a per-conversation advisory lock and skipped when step rows
|
|
51
|
-
* already exist, so a re-run (bulk or lazy) never double-imports. Parent and
|
|
52
|
-
* advisor-child rows land in one transaction; explicit `seq`/`context_epoch`
|
|
53
|
-
* are what make this need a dedicated writer rather than the narrow port.
|
|
54
|
-
*/
|
|
55
|
-
export declare function writeLegacyImport(executor: JuniorSqlDatabase, args: LegacyImportWrite): Promise<boolean>;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { JuniorSqlDatabase } from "@/db/db";
|
|
2
|
-
import type { ConversationMessageStore } from "../messages";
|
|
3
|
-
/** Create a SQL-backed conversation message store. */
|
|
4
|
-
export declare function createSqlConversationMessageStore(executor: JuniorSqlDatabase): ConversationMessageStore;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { ThreadConversationState } from "@/chat/state/conversation";
|
|
2
|
-
/** Hydrate the durable visible-context compaction snapshot from SQL. */
|
|
3
|
-
export declare function hydrateConversationCompactions(args: {
|
|
4
|
-
conversation: ThreadConversationState;
|
|
5
|
-
conversationId: string;
|
|
6
|
-
}): Promise<void>;
|
|
7
|
-
/** Persist a changed visible-context compaction snapshot in SQL agent history. */
|
|
8
|
-
export declare function persistConversationCompactions(args: {
|
|
9
|
-
conversation: ThreadConversationState;
|
|
10
|
-
conversationId: string;
|
|
11
|
-
}): Promise<void>;
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Visible-transcript sync between the in-memory turn working set and SQL.
|
|
3
|
-
*
|
|
4
|
-
* The durable authority for the visible conversation transcript is the
|
|
5
|
-
* `ConversationMessageStore`; `ThreadConversationState.messages` is only the
|
|
6
|
-
* in-memory working set for the current turn. These helpers hydrate that
|
|
7
|
-
* working set from SQL at load boundaries and write new/updated messages back
|
|
8
|
-
* through the store, so no transcript data is persisted to `thread-state`.
|
|
9
|
-
*/
|
|
10
|
-
import type { NewConversationMessage } from "@/chat/conversations/messages";
|
|
11
|
-
import type { ConversationMessage, ThreadConversationState } from "@/chat/state/conversation";
|
|
12
|
-
/**
|
|
13
|
-
* Project the in-memory message onto the store insert shape. This is the single
|
|
14
|
-
* serialization point for visible messages, so both live turn persistence and
|
|
15
|
-
* the one-time legacy import produce identical rows: author display facts and
|
|
16
|
-
* bounded source meta ride in the `meta` JSON so the working set rehydrates with
|
|
17
|
-
* identical rendering, and `replied === true` is not stored in meta because
|
|
18
|
-
* `replied_at` is its authority.
|
|
19
|
-
*/
|
|
20
|
-
export declare function toStoredConversationMessage(message: ConversationMessage): NewConversationMessage;
|
|
21
|
-
/**
|
|
22
|
-
* Replace the in-memory working set with the durable transcript from SQL,
|
|
23
|
-
* excluding messages already folded into a thread-state compaction summary.
|
|
24
|
-
*
|
|
25
|
-
* Hydrate is a first-read boundary, so it must trigger the once-only Redis→SQL
|
|
26
|
-
* lazy import before reading SQL: consumers that hydrate before any step
|
|
27
|
-
* projection read (turn-dedupe, delivered-message redelivery guards,
|
|
28
|
-
* channel-context assembly) would otherwise make correctness decisions on an
|
|
29
|
-
* empty transcript for promotion-window stragglers whose history is still only
|
|
30
|
-
* in legacy Redis. The import is idempotent (skips when SQL step rows exist)
|
|
31
|
-
* and no-ops cheaply when there is nothing legacy to read.
|
|
32
|
-
*/
|
|
33
|
-
export declare function hydrateConversationMessages(args: {
|
|
34
|
-
conversation: ThreadConversationState;
|
|
35
|
-
conversationId: string | undefined;
|
|
36
|
-
}): Promise<void>;
|
|
37
|
-
/**
|
|
38
|
-
* Write the working set back to SQL: record every message idempotently and set
|
|
39
|
-
* the `replied_at` mark for messages the turn has answered. Content columns are
|
|
40
|
-
* insert-only and `meta` merges key-wise on conflict, so repeated calls across
|
|
41
|
-
* a turn's persist points are safe.
|
|
42
|
-
*/
|
|
43
|
-
export declare function persistConversationMessages(args: {
|
|
44
|
-
conversation: ThreadConversationState;
|
|
45
|
-
conversationId: string | undefined;
|
|
46
|
-
repliedAtMs?: number;
|
|
47
|
-
}): Promise<void>;
|