@xopcai/xopc 0.0.169 → 0.0.171
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/browser-ext/manifest.json +1 -1
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/gateway/static/root/assets/{activity-store-DumQD8EX.js → activity-store-BLz30jWq.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-CNI1HQdV.js → agent-avatar-dicebear-BKZO0EFn.js} +1 -1
- package/dist/gateway/static/root/assets/agents-ZCIC8mhO.js +2 -0
- package/dist/gateway/static/root/assets/{api-D7eNcGmE.js → api-N2qKY-WI.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-BPbnbnFn.js → app-management-settings-panel-CNZkpXCD.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-WWFCDver.js → appearance-settings-Drf5a563.js} +1 -1
- package/dist/gateway/static/root/assets/{apps-page-B27faKqW.js → apps-page-DJmgBaAm.js} +1 -1
- package/dist/gateway/static/root/assets/{archive-plugin-Cu2dsFtI.js → archive-plugin-ChVwOXE5.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-C9mycbtr.js → attachment-load-BVK3Y2d9.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-suggestion-card-DtHqVViI.js → automation-suggestion-card-DH4N0SYR.js} +1 -1
- package/dist/gateway/static/root/assets/automations-page-Ddot8-Md.js +6 -0
- package/dist/gateway/static/root/assets/{binary-plugins-DqrPRyjm.js → binary-plugins-CeHY6VVP.js} +1 -1
- package/dist/gateway/static/root/assets/block-editor-D3GIllO3.js +184 -0
- package/dist/gateway/static/root/assets/browser-settings-page-DvETvRcg.js +8 -0
- package/dist/gateway/static/root/assets/{browser-workflow-inputs-70k5yvTc.js → browser-workflow-inputs-femCtfpo.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-workflows-page-DBNuaWwR.js → browser-workflows-page-o0GVE_aF.js} +2 -2
- package/dist/gateway/static/root/assets/capabilities-settings-panel-ChXIYbys.js +7 -0
- package/dist/gateway/static/root/assets/{capability-presets-api-CvV4M4Oe.js → capability-presets-api-Bx-JJC0R.js} +1 -1
- package/dist/gateway/static/root/assets/capability-presets-settings-panel-CUekXsJy.js +1 -0
- package/dist/gateway/static/root/assets/{channel-recipient-api-BnLOBd7v.js → channel-recipient-api-CTw3ibx4.js} +1 -1
- package/dist/gateway/static/root/assets/channels-settings-CkhveNsQ.js +1 -0
- package/dist/gateway/static/root/assets/channels-status-swr-DRTb8DBk.js +1 -0
- package/dist/gateway/static/root/assets/{connector-logo-CYQPu4Nn.js → connector-logo-CQznQcd4.js} +1 -1
- package/dist/gateway/static/root/assets/connectors-page-DkSGIxWP.js +2 -0
- package/dist/gateway/static/root/assets/desktop-pet-BtP-xUQ9.js +1 -0
- package/dist/gateway/static/root/assets/{desktop-pet-settings-DHTY5Ku1.js → desktop-pet-settings-CIeH4VyP.js} +1 -1
- package/dist/gateway/static/root/assets/{directory-picker-path-field-cGL2aEB6.js → directory-picker-path-field-Ddgt6c3K.js} +1 -1
- package/dist/gateway/static/root/assets/{dreaming-settings-C2XF2wL4.js → dreaming-settings-gd9W6SLj.js} +3 -3
- package/dist/gateway/static/root/assets/{extension-debug-page-F8AzDx0d.js → extension-debug-page-CJGwUaQX.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-ZrX_Ge87.js → extension-page-B3zHKJAB.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-VypAD6ok.js → extension-settings-page-Cj9rrSr1.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-api-C-UsxEKi.js → gateway-config-api-BdmtlJRP.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-settings-ChG26Coy.js → gateway-settings-C2RwKIsl.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-startup-retry-D73V3EVy.js → gateway-startup-retry-mcMq_uu_.js} +1 -1
- package/dist/gateway/static/root/assets/goal-create-dialog-5Ryd_rx4.js +1 -0
- package/dist/gateway/static/root/assets/goal-detail-page-DizZ6Cpl.js +4 -0
- package/dist/gateway/static/root/assets/{goals-config-api-fv7JLhjy.js → goals-config-api-CAO1J4jn.js} +1 -1
- package/dist/gateway/static/root/assets/goals-page-Dqry_hi2.js +2 -0
- package/dist/gateway/static/root/assets/{goals-settings-DlfyneMz.js → goals-settings-Boj2izKZ.js} +1 -1
- package/dist/gateway/static/root/assets/{heartbeat-settings-BPyFbSbh.js → heartbeat-settings-DbPC9a_y.js} +1 -1
- package/dist/gateway/static/root/assets/{image-generation-api-CSKX7PsM.js → image-generation-api-DrLCLTXn.js} +1 -1
- package/dist/gateway/static/root/assets/index-DEdyUjxM.css +1 -0
- package/dist/gateway/static/root/assets/{index-DJtuKve9.js → index-vHb2z7VS.js} +83 -70
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-BUxrnWH_.js → keyboard-shortcuts-settings-BrxfptgY.js} +1 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-BP0_Ih0e.js +2 -0
- package/dist/gateway/static/root/assets/{local-apps-page-BsZMeDnS.js → local-apps-page-DNCRlfFs.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-DXq-Y8Bi.js → locale-store-CzIfXqm8.js} +1 -1
- package/dist/gateway/static/root/assets/logs-page-mT48mcF4.js +7 -0
- package/dist/gateway/static/root/assets/{markdown-split-Cmaw70yM.js → markdown-split-CIUH9Lor.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-Blqj_oJD.js → media-plugins-DX4AgkCs.js} +1 -1
- package/dist/gateway/static/root/assets/messages-CKZuaOeG.js +3 -0
- package/dist/gateway/static/root/assets/{notes-page-B6Fdlf_s.js → notes-page-D1KprtxL.js} +1 -1
- package/dist/gateway/static/root/assets/notes-workbench-wgt2Osyk.js +4 -0
- package/dist/gateway/static/root/assets/{page-tabs-D6zFoyJY.js → page-tabs-DjZPJGf6.js} +1 -1
- package/dist/gateway/static/root/assets/{preview-open-alternatives-BLoo7Ad8.js → preview-open-alternatives-DNiJTpwZ.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-0-tt2dp7.js → product-open-page-CNfR17-g.js} +1 -1
- package/dist/gateway/static/root/assets/project-detail-page-CDjHvxJm.js +1 -0
- package/dist/gateway/static/root/assets/projects-page-kJZwQXfC.js +1 -0
- package/dist/gateway/static/root/assets/remote-access-hub-MJdI9ek_.js +1 -0
- package/dist/gateway/static/root/assets/{save-bar-controls-9ujl7LRy.js → save-bar-controls-BGZFVO9S.js} +1 -1
- package/dist/gateway/static/root/assets/{schedule-field-e80Mj-0z.js → schedule-field-BAZiHtds.js} +1 -1
- package/dist/gateway/static/root/assets/{schema-form-DYZQD-PL.js → schema-form-CesBcwJH.js} +1 -1
- package/dist/gateway/static/root/assets/sessions-page-BqC7GDC_.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-CYwz8MfF.js +1 -0
- package/dist/gateway/static/root/assets/{settings-form-section-Clt3p-mk.js → settings-form-section-Bxc54BLj.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-loading-skeleton-CTuS66nC.js → settings-loading-skeleton-CYrho7Db.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-CMP_owwc.js → settings-page-C03X5fkh.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-layout-BWUV_wx6.js → settings-page-layout-CZAJbv4E.js} +1 -1
- package/dist/gateway/static/root/assets/setup-status-panel-Jv8_bcOD.js +1 -0
- package/dist/gateway/static/root/assets/{share-preview-page-tISZJtRK.js → share-preview-page-DSC7tKKG.js} +1 -1
- package/dist/gateway/static/root/assets/shares-settings-h8tGDkA3.js +1 -0
- package/dist/gateway/static/root/assets/skill-reload-api-D2DGvRUn.js +1 -0
- package/dist/gateway/static/root/assets/skills-page-vqhjSMhZ.js +2 -0
- package/dist/gateway/static/root/assets/{system-settings-panel-6u0k0wJi.js → system-settings-panel-BO89zw5H.js} +1 -1
- package/dist/gateway/static/root/assets/{theme-store-DSpAOJ9G.js → theme-store-1OkdVC8l.js} +1 -1
- package/dist/gateway/static/root/assets/time-picker-mtD64kFB.js +1 -0
- package/dist/gateway/static/root/assets/{typed-models-lib-CyRCjjGS.js → typed-models-lib-D-_vct_y.js} +1 -1
- package/dist/gateway/static/root/assets/{use-channel-catalog-B_Igd7ec.js → use-channel-catalog-VlFtjlET.js} +1 -1
- package/dist/gateway/static/root/assets/user-context-page-BgF0WxjM.js +1 -0
- package/dist/gateway/static/root/assets/{voice-api-key-field-BanJk_cf.js → voice-api-key-field-BhDk-UV_.js} +1 -1
- package/dist/gateway/static/root/assets/work-discovery-page-CP0Daig-.js +1 -0
- package/dist/gateway/static/root/assets/work-item-detail-page-NEWZPKB_.js +1 -0
- package/dist/gateway/static/root/assets/work-page-BkWntcQh.js +1 -0
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-DCXTQx7p.js → workflow-run-setup-panel-uVw4Yoej.js} +2 -2
- package/dist/gateway/static/root/assets/workflows-page-DRvhNQGe.js +11 -0
- package/dist/gateway/static/root/index.html +7 -7
- package/dist/package.js +1 -1
- package/dist/src/agent/embedded/run-for-session.js +71 -24
- package/dist/src/agent/embedded/run-turn.js +68 -4
- package/dist/src/agent/inbound/inbound-loop.d.ts +0 -2
- package/dist/src/agent/inbound/inbound-loop.js +0 -2
- package/dist/src/agent/memory/compaction-planner.d.ts +16 -0
- package/dist/src/agent/memory/compaction-planner.js +152 -0
- package/dist/src/agent/memory/compaction-policy.d.ts +10 -0
- package/dist/src/agent/memory/compaction-policy.js +24 -0
- package/dist/src/agent/memory/compaction.d.ts +21 -22
- package/dist/src/agent/memory/compaction.js +220 -194
- package/dist/src/agent/memory/context-budget.d.ts +40 -0
- package/dist/src/agent/memory/context-budget.js +106 -0
- package/dist/src/agent/memory/dreaming/config.js +1 -1
- package/dist/src/agent/orchestration/context-overflow.d.ts +1 -0
- package/dist/src/agent/orchestration/context-overflow.js +19 -0
- package/dist/src/agent/orchestration/loop-guard.js +13 -9
- package/dist/src/agent/reply/post-compaction-context.d.ts +4 -0
- package/dist/src/agent/reply/post-compaction-context.js +5 -3
- package/dist/src/agent/service.d.ts +0 -2
- package/dist/src/agent/service.js +13 -44
- package/dist/src/agent/session/session-inspector.js +10 -2
- package/dist/src/agent/workflow/builtins/index.js +2 -2
- package/dist/src/agent-runtime/index.js +1 -1
- package/dist/src/agent-runtime/runtime-profile.js +1 -1
- package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
- package/dist/src/cli/commands/onboard/model.d.ts +2 -0
- package/dist/src/cli/commands/onboard/model.js +16 -3
- package/dist/src/config/agent-profile.js +1 -1
- package/dist/src/config/schema.d.ts +19 -5
- package/dist/src/config/schema.js +1 -2
- package/dist/src/gateway/agents-admin.js +1 -1
- package/dist/src/gateway/hono/lib/config-payload.d.ts +23 -0
- package/dist/src/gateway/hono/lib/config-payload.js +3 -0
- package/dist/src/gateway/hono/routes/config-patch/misc.d.ts +1 -1
- package/dist/src/gateway/hono/routes/config-patch/misc.js +28 -0
- package/dist/src/gateway/hono/routes/sessions.js +30 -44
- package/dist/src/gateway/service/sessions-api.d.ts +2 -3
- package/dist/src/gateway/service/sessions-api.js +6 -9
- package/dist/src/session/index.d.ts +1 -2
- package/dist/src/session/index.js +1 -2
- package/dist/src/session/init-session-turn.d.ts +0 -1
- package/dist/src/session/init-session-turn.js +1 -2
- package/dist/src/session/manager.d.ts +11 -17
- package/dist/src/session/manager.js +11 -14
- package/dist/src/session/reset-policy.js +3 -5
- package/dist/src/session/session-context-for-llm.d.ts +19 -1
- package/dist/src/session/session-context-for-llm.js +87 -129
- package/dist/src/session/store.d.ts +29 -23
- package/dist/src/session/store.js +109 -87
- package/dist/src/session/transcript-format.d.ts +2 -8
- package/dist/src/session/types.d.ts +8 -6
- package/dist/src/session/user-round-delete.d.ts +3 -6
- package/dist/src/session/user-round-delete.js +12 -16
- package/dist/src/storage/sqlite/index.d.ts +1 -1
- package/dist/src/storage/sqlite/index.js +2 -2
- package/dist/src/storage/sqlite/migrations/060_remove_runtime_transcript_messages.sql +45 -0
- package/dist/src/storage/sqlite/migrations/061_drop_compaction_checkpoints.sql +2 -0
- package/dist/src/storage/sqlite/migrations/runner.d.ts +1 -1
- package/dist/src/storage/sqlite/migrations/runner.js +3 -3
- package/dist/src/storage/sqlite/migrations/runner.ts +1 -1
- package/dist/src/storage/sqlite/schema.js +1 -1
- package/dist/src/storage/sqlite/schema.sql +0 -19
- package/dist/src/storage/sqlite/transcript-repository.d.ts +10 -14
- package/dist/src/storage/sqlite/transcript-repository.js +120 -105
- package/dist/src/user-context/config.d.ts +67 -2
- package/dist/src/user-context/config.js +36 -3
- package/dist/src/workflows/domain/result.d.ts +4 -15
- package/dist/src/workflows/engine/workflow-engine.js +5 -14
- package/dist/src/workflows/runtime/graph-workflow-runtime.js +7 -11
- package/dist/src/workflows/service/workflow-session-bridge.js +1 -1
- package/dist/src/workflows/store/run-index-store.js +1 -6
- package/package.json +1 -1
- package/dist/gateway/static/root/assets/agents-DfpeWAnu.js +0 -2
- package/dist/gateway/static/root/assets/automations-page-BoH5grBX.js +0 -6
- package/dist/gateway/static/root/assets/block-editor-B9dc3pqc.js +0 -184
- package/dist/gateway/static/root/assets/browser-settings-page-CK2fnxHY.js +0 -8
- package/dist/gateway/static/root/assets/capabilities-settings-panel-gg9GXU00.js +0 -7
- package/dist/gateway/static/root/assets/capability-presets-settings-panel-A1qGVyll.js +0 -1
- package/dist/gateway/static/root/assets/channels-settings-H4vCzqiD.js +0 -1
- package/dist/gateway/static/root/assets/channels-status-swr-DtswVkDX.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-DphVkloc.js +0 -2
- package/dist/gateway/static/root/assets/desktop-pet-Deb8fsr-.js +0 -1
- package/dist/gateway/static/root/assets/goal-create-dialog-B6aBG2KK.js +0 -1
- package/dist/gateway/static/root/assets/goal-detail-page-B_G9oVL1.js +0 -4
- package/dist/gateway/static/root/assets/goals-page-BQmg_7aD.js +0 -2
- package/dist/gateway/static/root/assets/index-DfE2j0g8.css +0 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-Dzlj4fH8.js +0 -2
- package/dist/gateway/static/root/assets/logs-page-Bg1B-cKU.js +0 -7
- package/dist/gateway/static/root/assets/messages-Cj_n7gUv.js +0 -3
- package/dist/gateway/static/root/assets/notes-workbench-4HYPR6Hb.js +0 -4
- package/dist/gateway/static/root/assets/project-detail-page-CGa68F1d.js +0 -1
- package/dist/gateway/static/root/assets/projects-page-BXmIeErj.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-bxrIHaRt.js +0 -1
- package/dist/gateway/static/root/assets/sessions-page-D_7ms_LG.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-VLuu9WHc.js +0 -1
- package/dist/gateway/static/root/assets/setup-status-panel-CAClgrxi.js +0 -1
- package/dist/gateway/static/root/assets/shares-settings-t-hP0QDv.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-CYRaxTqs.js +0 -1
- package/dist/gateway/static/root/assets/skills-page-C6CXLWnN.js +0 -2
- package/dist/gateway/static/root/assets/time-picker-BF3f8el1.js +0 -1
- package/dist/gateway/static/root/assets/user-context-page-B3zeQLeM.js +0 -1
- package/dist/gateway/static/root/assets/work-discovery-page-BCANmOUS.js +0 -1
- package/dist/gateway/static/root/assets/work-item-detail-page-t5xiIEFv.js +0 -1
- package/dist/gateway/static/root/assets/work-page-CEI3zs-y.js +0 -1
- package/dist/gateway/static/root/assets/workflows-page-B8FRLCHp.js +0 -11
- package/dist/src/agent/lifecycle/handlers/compaction.d.ts +0 -13
- package/dist/src/agent/lifecycle/handlers/compaction.js +0 -18
- package/dist/src/session/compaction-checkpoints.d.ts +0 -8
- package/dist/src/session/compaction-checkpoints.js +0 -19
|
@@ -5,7 +5,6 @@ import { evictEmbeddedSessionRunner } from "../../../agent/embedded/session-runn
|
|
|
5
5
|
import { messagesToClientHistory } from "../../../session/client-history.js";
|
|
6
6
|
import { deleteMediaUrisNoLongerReferenced } from "../../../media/session-references.js";
|
|
7
7
|
import { createGatewayRouteLogger, logRouteError } from "../lib/route-logger.js";
|
|
8
|
-
import { computeUserRoundDeleteRange } from "../../../session/user-round-delete.js";
|
|
9
8
|
import { respondStartupUnavailable } from "../lib/startup-unavailable.js";
|
|
10
9
|
import { randomUUID } from "node:crypto";
|
|
11
10
|
//#region src/gateway/hono/routes/sessions.ts
|
|
@@ -35,6 +34,10 @@ function parseOffset(value) {
|
|
|
35
34
|
const parsed = value ? Number.parseInt(value, 10) : 0;
|
|
36
35
|
return Number.isFinite(parsed) ? Math.max(0, parsed) : 0;
|
|
37
36
|
}
|
|
37
|
+
function isHistoryCursor(value) {
|
|
38
|
+
if (!/^(0|[1-9]\d*)$/.test(value)) return false;
|
|
39
|
+
return Number.isSafeInteger(Number(value));
|
|
40
|
+
}
|
|
38
41
|
function buildDirectSessionMetadata(params) {
|
|
39
42
|
return {
|
|
40
43
|
sourceChannel: params.source,
|
|
@@ -268,7 +271,12 @@ function registerSessionsRoutes(authenticated, deps) {
|
|
|
268
271
|
const limitRaw = c.req.query("limit");
|
|
269
272
|
const parsedLimit = limitRaw ? Number.parseInt(limitRaw, 10) : void 0;
|
|
270
273
|
const limit = parsedLimit !== void 0 && Number.isFinite(parsedLimit) ? Math.min(500, Math.max(1, parsedLimit)) : void 0;
|
|
271
|
-
const
|
|
274
|
+
const beforeRaw = c.req.query("before");
|
|
275
|
+
const before = beforeRaw?.trim();
|
|
276
|
+
if (beforeRaw !== void 0 && (!before || !isHistoryCursor(before))) return c.json({
|
|
277
|
+
ok: false,
|
|
278
|
+
error: "Invalid session history cursor"
|
|
279
|
+
}, 400);
|
|
272
280
|
const offsetRaw = c.req.query("offset");
|
|
273
281
|
const parsedOffset = offsetRaw ? Number.parseInt(offsetRaw, 10) : 0;
|
|
274
282
|
const offset = Number.isFinite(parsedOffset) ? Math.max(0, parsedOffset) : 0;
|
|
@@ -294,7 +302,9 @@ function registerSessionsRoutes(authenticated, deps) {
|
|
|
294
302
|
const key = c.req.param("key");
|
|
295
303
|
const offsetRaw = c.req.query("offset");
|
|
296
304
|
const limitRaw = c.req.query("limit");
|
|
297
|
-
const
|
|
305
|
+
const beforeRaw = c.req.query("before");
|
|
306
|
+
const before = beforeRaw?.trim();
|
|
307
|
+
if (beforeRaw !== void 0 && (!before || !isHistoryCursor(before))) return c.json({ error: "Invalid session history cursor" }, 400);
|
|
298
308
|
const parsedOffset = offsetRaw ? Number.parseInt(offsetRaw, 10) : 0;
|
|
299
309
|
const parsedLimit = limitRaw ? Number.parseInt(limitRaw, 10) : 50;
|
|
300
310
|
const offset = Number.isFinite(parsedOffset) ? Math.max(0, parsedOffset) : 0;
|
|
@@ -448,48 +458,35 @@ function registerSessionsRoutes(authenticated, deps) {
|
|
|
448
458
|
evictEmbeddedSessionRunner(key, "gateway_bash_execution_appended");
|
|
449
459
|
return c.json({ ok: true });
|
|
450
460
|
});
|
|
451
|
-
authenticated.get("/api/sessions/:key/compaction/
|
|
461
|
+
authenticated.get("/api/sessions/:key/compaction/boundaries", async (c) => {
|
|
452
462
|
const key = c.req.param("key");
|
|
453
463
|
if (!await service.sessionIndexInstance.getSessionMetadata(key)) return c.json({
|
|
454
464
|
ok: false,
|
|
455
465
|
error: "Session not found"
|
|
456
466
|
}, 404);
|
|
457
|
-
const
|
|
467
|
+
const boundaries = await service.sessions.listCompactionBoundaries(key);
|
|
458
468
|
return c.json({
|
|
459
469
|
ok: true,
|
|
460
|
-
payload: {
|
|
461
|
-
});
|
|
462
|
-
});
|
|
463
|
-
authenticated.get("/api/sessions/:key/compaction/checkpoints/:checkpointId", async (c) => {
|
|
464
|
-
const key = c.req.param("key");
|
|
465
|
-
const checkpointId = c.req.param("checkpointId");
|
|
466
|
-
const checkpoint = await service.sessions.getCompactionCheckpoint(key, checkpointId);
|
|
467
|
-
if (!checkpoint) return c.json({
|
|
468
|
-
ok: false,
|
|
469
|
-
error: "Checkpoint not found"
|
|
470
|
-
}, 404);
|
|
471
|
-
return c.json({
|
|
472
|
-
ok: true,
|
|
473
|
-
payload: { checkpoint }
|
|
470
|
+
payload: { boundaries }
|
|
474
471
|
});
|
|
475
472
|
});
|
|
476
473
|
authenticated.post("/api/sessions/:key/compaction/restore", async (c) => {
|
|
477
474
|
const key = c.req.param("key");
|
|
478
475
|
const body = await c.req.json().catch(() => ({}));
|
|
479
|
-
const
|
|
480
|
-
if (!
|
|
476
|
+
const compactionId = typeof body.compactionId === "string" ? body.compactionId.trim() : "";
|
|
477
|
+
if (!compactionId) return c.json({
|
|
481
478
|
ok: false,
|
|
482
|
-
error: "
|
|
479
|
+
error: "compactionId required"
|
|
483
480
|
}, 400);
|
|
484
481
|
try {
|
|
485
|
-
await service.sessions.
|
|
482
|
+
await service.sessions.restoreBeforeCompactionBoundary(key, compactionId);
|
|
486
483
|
} catch (err) {
|
|
487
484
|
logRouteError(log, c, err, "gateway.route.sessions", {
|
|
488
|
-
operation: "
|
|
485
|
+
operation: "restoreCompactionBoundary",
|
|
489
486
|
sessionKey: key
|
|
490
487
|
});
|
|
491
488
|
const msg = err instanceof Error ? err.message : String(err);
|
|
492
|
-
if (msg.includes("not found")
|
|
489
|
+
if (msg.includes("not found")) return c.json({
|
|
493
490
|
ok: false,
|
|
494
491
|
error: msg
|
|
495
492
|
}, 404);
|
|
@@ -684,30 +681,19 @@ function registerSessionsRoutes(authenticated, deps) {
|
|
|
684
681
|
authenticated.delete("/api/sessions/:key/messages", async (c) => {
|
|
685
682
|
const key = c.req.param("key");
|
|
686
683
|
const body = await c.req.json().catch(() => ({}));
|
|
687
|
-
const loaded = await service.sessionIndexInstance.loadMessages(key);
|
|
688
|
-
if (!loaded) return c.json({ error: "Session not found" }, 404);
|
|
689
|
-
let startIndex = typeof body.startIndex === "number" ? body.startIndex : -1;
|
|
690
|
-
let count = typeof body.count === "number" ? body.count : 0;
|
|
691
684
|
const userRoundIndex = typeof body.userRoundIndex === "number" ? body.userRoundIndex : void 0;
|
|
692
|
-
if (userRoundIndex
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
startIndex = range.startIndex;
|
|
696
|
-
count = range.count;
|
|
697
|
-
}
|
|
698
|
-
if (startIndex < 0 || count <= 0) return c.json({ error: "Invalid startIndex or count" }, 400);
|
|
699
|
-
if (startIndex >= loaded.length) return c.json({ error: "Index out of range" }, 400);
|
|
700
|
-
const deleteCount = Math.min(count, loaded.length - startIndex);
|
|
701
|
-
const removed = loaded.slice(startIndex, startIndex + deleteCount);
|
|
702
|
-
const next = loaded.slice(0, startIndex).concat(loaded.slice(startIndex + deleteCount));
|
|
703
|
-
await service.sessionIndexInstance.saveMessages(key, next);
|
|
685
|
+
if (userRoundIndex === void 0 || !Number.isInteger(userRoundIndex) || userRoundIndex < 0) return c.json({ error: "userRoundIndex must be a non-negative integer" }, 400);
|
|
686
|
+
const result = await service.sessionIndexInstance.deleteUserRound(key, userRoundIndex);
|
|
687
|
+
if (!result) return c.json({ error: "User round index out of range" }, 400);
|
|
704
688
|
await deleteMediaUrisNoLongerReferenced({
|
|
705
|
-
removed,
|
|
706
|
-
remaining:
|
|
689
|
+
removed: result.removedMessages,
|
|
690
|
+
remaining: result.remainingMessages
|
|
707
691
|
});
|
|
692
|
+
evictEmbeddedSessionRunner(key, "gateway_user_round_deleted");
|
|
693
|
+
service.agentService.evictSessionAgent(key);
|
|
708
694
|
return c.json({
|
|
709
695
|
ok: true,
|
|
710
|
-
deleted:
|
|
696
|
+
deleted: result.deleted
|
|
711
697
|
});
|
|
712
698
|
});
|
|
713
699
|
authenticated.post("/api/sessions/:key/reset", async (c) => {
|
|
@@ -92,9 +92,8 @@ export declare class GatewaySessionsApi {
|
|
|
92
92
|
verboseLevel?: string;
|
|
93
93
|
workingDirectory?: string;
|
|
94
94
|
}): Promise<import("../../agent/session/session-config-service.js").PatchSessionAgentConfigResult>;
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
restoreCompactionCheckpoint(key: string, checkpointId: string): Promise<void>;
|
|
95
|
+
listCompactionBoundaries(key: string): Promise<import("../../session/types.js").CompactionBoundarySummary[]>;
|
|
96
|
+
restoreBeforeCompactionBoundary(key: string, compactionId: string): Promise<void>;
|
|
98
97
|
runCompaction(key: string, options?: {
|
|
99
98
|
instructions?: string;
|
|
100
99
|
force?: boolean;
|
|
@@ -53,11 +53,11 @@ var GatewaySessionsApi = class {
|
|
|
53
53
|
}
|
|
54
54
|
async getTimeline(key) {
|
|
55
55
|
if (!await this.opts.sessionIndex.getSessionMetadata(key)) return null;
|
|
56
|
-
return buildSessionTimeline(await this.opts.sessionIndex.getStore().
|
|
56
|
+
return buildSessionTimeline(await this.opts.sessionIndex.getStore().loadTranscriptHistoryRows(key));
|
|
57
57
|
}
|
|
58
58
|
async getTranscriptWindow(key, options) {
|
|
59
59
|
if (!await this.opts.sessionIndex.getSessionMetadata(key)) return null;
|
|
60
|
-
const rows = await this.opts.sessionIndex.getStore().
|
|
60
|
+
const rows = await this.opts.sessionIndex.getStore().loadTranscriptHistoryRows(key);
|
|
61
61
|
const totalRows = rows.length;
|
|
62
62
|
if (totalRows === 0) return {
|
|
63
63
|
messages: [],
|
|
@@ -93,14 +93,11 @@ var GatewaySessionsApi = class {
|
|
|
93
93
|
patchAgentConfig(sessionKey, body) {
|
|
94
94
|
return this.opts.getAgentService().sessionConfig.patch(sessionKey, body);
|
|
95
95
|
}
|
|
96
|
-
|
|
97
|
-
return this.opts.sessionIndex.
|
|
96
|
+
listCompactionBoundaries(key) {
|
|
97
|
+
return this.opts.sessionIndex.listCompactionBoundaries(key);
|
|
98
98
|
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
}
|
|
102
|
-
async restoreCompactionCheckpoint(key, checkpointId) {
|
|
103
|
-
await this.opts.sessionIndex.restoreCompactionCheckpoint(key, checkpointId);
|
|
99
|
+
async restoreBeforeCompactionBoundary(key, compactionId) {
|
|
100
|
+
await this.opts.sessionIndex.restoreBeforeCompactionBoundary(key, compactionId);
|
|
104
101
|
this.opts.getAgentService().evictSessionAgent(key);
|
|
105
102
|
}
|
|
106
103
|
async runCompaction(key, options) {
|
|
@@ -6,8 +6,7 @@ export { SessionConfigStore, resolveThinkingLevel, resolveReasoningLevel, resolv
|
|
|
6
6
|
export { resolveEffectiveThinkingLevel, resolveEffectiveReasoningLevel } from './thinking-resolve.js';
|
|
7
7
|
export type { SessionAgentConfig } from './config-types.js';
|
|
8
8
|
export { normalizeWorkingDirectoryInput, effectiveWorkspacePathForSession, projectWorkspacePath, } from './session-workspace.js';
|
|
9
|
-
export { SessionStatus, type SessionMetadata, type SessionDetail, type SessionListQuery, type PaginatedResult, type SessionStats, type ExportFormat, type SessionExport, type SessionTranscriptSummary, type
|
|
10
|
-
export { normalizeCompactionCheckpointId } from './compaction-checkpoints.js';
|
|
9
|
+
export { SessionStatus, type SessionMetadata, type SessionDetail, type SessionListQuery, type PaginatedResult, type SessionStats, type ExportFormat, type SessionExport, type SessionTranscriptSummary, type CompactionBoundarySummary, } from './types.js';
|
|
11
10
|
export { shouldSkipWebchatInboundByAbortCutoff } from './abort-cutoff.js';
|
|
12
11
|
export { DEFAULT_RESET_AT_HOUR, DEFAULT_RESET_MODE, DEFAULT_IDLE_MINUTES, evaluateSessionFreshness, resolveDailyResetAtMs, resolveSessionResetPolicy, type SessionFreshness, type SessionResetConfig, type SessionResetMode, type SessionResetPolicy, type SessionResetType, } from './reset-policy.js';
|
|
13
12
|
export { resolveChannelResetConfig, resolveSessionResetType, } from './reset-type.js';
|
|
@@ -3,7 +3,6 @@ import { buildSessionContextForLlm, isTranscriptContextEntry, mergeLlmMessagesPr
|
|
|
3
3
|
import { effectiveWorkspacePathForSession, normalizeWorkingDirectoryInput, projectWorkspacePath } from "./session-workspace.js";
|
|
4
4
|
import { emitSessionTranscriptUpdate, onSessionTranscriptUpdate } from "./transcript-events.js";
|
|
5
5
|
import { fallbackTitleFromMessages, generateSessionTitleFromMessages, getSessionTitleSource, isWebchatSessionKey, maybeRefineSessionTitleWithLlm, maybeSetProvisionalSessionTitle, provisionalTitleFromUserText, sanitizeGeneratedSessionTitle, sanitizeSessionTitle, shouldAutoTitleSessionKey, shouldRefineSessionTitleWithLlm } from "./session-title.js";
|
|
6
|
-
import { normalizeCompactionCheckpointId } from "./compaction-checkpoints.js";
|
|
7
6
|
import { flattenMessageContent, messagesToClientHistory } from "./client-history.js";
|
|
8
7
|
import { SessionStore } from "./store.js";
|
|
9
8
|
import { applySessionPatchToMetadata } from "./patch-metadata.js";
|
|
@@ -18,4 +17,4 @@ import { resolveSession, resolveSessionKeyForRequest } from "./resolve-session.j
|
|
|
18
17
|
import { DEFAULT_RESET_TRIGGERS, RESET_OVERLAP_COMMANDS, bareResetAckMessage, matchResetTriggers, resolveResetTriggers, shouldSkipResetOverlapCommand, stripLeadingEnvelopeTimestamp } from "./reset-triggers.js";
|
|
19
18
|
import { initSessionTurn } from "./init-session-turn.js";
|
|
20
19
|
import { CURRENT_SESSION_TRANSCRIPT_VERSION, XOPC_SESSION_TRANSCRIPT_TYPE } from "./transcript-format.js";
|
|
21
|
-
export { CURRENT_SESSION_TRANSCRIPT_VERSION, DEFAULT_IDLE_MINUTES, DEFAULT_RESET_AT_HOUR, DEFAULT_RESET_MODE, DEFAULT_RESET_TRIGGERS, RESET_OVERLAP_COMMANDS, SessionConfigStore, SessionIndex, SessionStatus, SessionStore, XOPC_SESSION_TRANSCRIPT_TYPE, applySessionPatchToMetadata, bareResetAckMessage, buildSessionContextForLlm, effectiveWorkspacePathForSession, emitSessionTranscriptUpdate, evaluateSessionFreshness, fallbackTitleFromMessages, flattenMessageContent, generateSessionTitleFromMessages, getSessionTitleSource, initSessionTurn, isTranscriptContextEntry, isWebchatSessionKey, matchResetTriggers, maybeRefineSessionTitleWithLlm, maybeSetProvisionalSessionTitle, mergeLlmMessagesPreservingContextRows, messagesToClientHistory,
|
|
20
|
+
export { CURRENT_SESSION_TRANSCRIPT_VERSION, DEFAULT_IDLE_MINUTES, DEFAULT_RESET_AT_HOUR, DEFAULT_RESET_MODE, DEFAULT_RESET_TRIGGERS, RESET_OVERLAP_COMMANDS, SessionConfigStore, SessionIndex, SessionStatus, SessionStore, XOPC_SESSION_TRANSCRIPT_TYPE, applySessionPatchToMetadata, bareResetAckMessage, buildSessionContextForLlm, effectiveWorkspacePathForSession, emitSessionTranscriptUpdate, evaluateSessionFreshness, fallbackTitleFromMessages, flattenMessageContent, generateSessionTitleFromMessages, getSessionTitleSource, initSessionTurn, isTranscriptContextEntry, isWebchatSessionKey, matchResetTriggers, maybeRefineSessionTitleWithLlm, maybeSetProvisionalSessionTitle, mergeLlmMessagesPreservingContextRows, messagesToClientHistory, normalizeWorkingDirectoryInput, onSessionTranscriptUpdate, projectWorkspacePath, provisionalTitleFromUserText, resolveChannelResetConfig, resolveDailyResetAtMs, resolveEffectiveReasoningLevel, resolveEffectiveThinkingLevel, resolveReasoningLevel, resolveResetTriggers, resolveSession, resolveSessionKeyForRequest, resolveSessionLifecycleTimestamps, resolveSessionResetPolicy, resolveSessionResetType, resolveThinkingLevel, resolveVerboseLevel, sanitizeGeneratedSessionTitle, sanitizeSessionTitle, shouldAutoTitleSessionKey, shouldRefineSessionTitleWithLlm, shouldSkipResetOverlapCommand, shouldSkipWebchatInboundByAbortCutoff, stripLeadingEnvelopeTimestamp, transcriptRowsFromJsonArray };
|
|
@@ -50,8 +50,7 @@ async function initSessionTurn(opts) {
|
|
|
50
50
|
now,
|
|
51
51
|
policy: resetPolicy
|
|
52
52
|
}) : { fresh: false };
|
|
53
|
-
const
|
|
54
|
-
const staleRollover = Boolean(sessionMetadata && !skipImplicit && !freshness.fresh);
|
|
53
|
+
const staleRollover = Boolean(sessionMetadata && resetPolicy.configured === true && !freshness.fresh);
|
|
55
54
|
const needsRollover = triggerMatch.resetTriggered || staleRollover;
|
|
56
55
|
let sessionId = sessionMetadata?.sessionId;
|
|
57
56
|
let previousSessionId;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import EventEmitter from 'events';
|
|
2
|
+
import type { Api, Model } from '@earendil-works/pi-ai/compat';
|
|
2
3
|
import { SessionStore } from './store.js';
|
|
3
4
|
import type { SessionMetadata, SessionDetail, SessionListQuery, PaginatedResult, GlobalSessionStats, ExportFormat, SessionStatus } from './types.js';
|
|
4
5
|
import type { SessionMetadataSeed } from '../storage/sqlite/index.js';
|
|
5
6
|
import type { Message } from './types.js';
|
|
6
|
-
import type { CompactionConfig, CompactionResult } from '../agent/memory/compaction.js';
|
|
7
|
+
import type { CompactionConfig, CompactionExecutionOptions, CompactionResult } from '../agent/memory/compaction.js';
|
|
7
8
|
import type { XopcSessionTranscriptV1 } from './transcript-format.js';
|
|
8
9
|
import type { XopcTranscriptContextEntry } from './session-context-for-llm.js';
|
|
9
10
|
import { type SessionPatchBody } from './patch-metadata.js';
|
|
@@ -129,6 +130,11 @@ export declare class SessionIndex extends EventEmitter {
|
|
|
129
130
|
saveMessages(key: string, messages: any[], options?: {
|
|
130
131
|
metadata?: SessionMetadataSeed;
|
|
131
132
|
}): Promise<void>;
|
|
133
|
+
deleteUserRound(key: string, userRoundIndex: number): Promise<{
|
|
134
|
+
deleted: number;
|
|
135
|
+
removedMessages: import("@earendil-works/pi-agent-core").AgentMessage[];
|
|
136
|
+
remainingMessages: import("@earendil-works/pi-agent-core").AgentMessage[];
|
|
137
|
+
}>;
|
|
132
138
|
/**
|
|
133
139
|
* Append `kind: 'context'` transcript row (persisted, excluded from {@link loadMessages} / LLM).
|
|
134
140
|
*/
|
|
@@ -172,29 +178,17 @@ export declare class SessionIndex extends EventEmitter {
|
|
|
172
178
|
tool: number;
|
|
173
179
|
needsTrim: boolean;
|
|
174
180
|
};
|
|
175
|
-
/** Prepare compaction run */
|
|
176
|
-
prepareCompaction(key: string, messages: any[], contextWindow: number): {
|
|
177
|
-
needsCompaction: boolean;
|
|
178
|
-
messages: import("@earendil-works/pi-agent-core").AgentMessage[];
|
|
179
|
-
stats: {
|
|
180
|
-
needed: boolean;
|
|
181
|
-
reason: string;
|
|
182
|
-
usagePercent?: number;
|
|
183
|
-
};
|
|
184
|
-
};
|
|
185
181
|
/** Compact session messages */
|
|
186
|
-
compact(key: string, messages: any[],
|
|
182
|
+
compact(key: string, messages: any[], model: Model<Api>, instructions?: string, force?: boolean, executionOptions?: CompactionExecutionOptions): Promise<CompactionResult>;
|
|
187
183
|
/** Compaction stats for a session */
|
|
188
184
|
getCompactionStats(key: string): Promise<{
|
|
189
185
|
compactionCount: number;
|
|
190
186
|
totalTokensBefore: number;
|
|
191
187
|
totalTokensAfter: number;
|
|
192
|
-
lastCompactionAt:
|
|
188
|
+
lastCompactionAt: string;
|
|
193
189
|
}>;
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
getCompactionCheckpointDetail(key: string, checkpointId: string): Promise<import("./types.js").CompactionCheckpointDetail>;
|
|
197
|
-
restoreCompactionCheckpoint(key: string, checkpointId: string): Promise<void>;
|
|
190
|
+
listCompactionBoundaries(key: string): Promise<import("./types.js").CompactionBoundarySummary[]>;
|
|
191
|
+
restoreBeforeCompactionBoundary(key: string, compactionId: string): Promise<void>;
|
|
198
192
|
/** Estimate token usage for messages */
|
|
199
193
|
estimateTokenUsage(key: string, messages: any[]): Promise<number>;
|
|
200
194
|
}
|
|
@@ -224,6 +224,11 @@ var SessionIndex = class extends EventEmitter$1 {
|
|
|
224
224
|
async saveMessages(key, messages, options) {
|
|
225
225
|
return this.store.saveMessages(key, messages, options);
|
|
226
226
|
}
|
|
227
|
+
async deleteUserRound(key, userRoundIndex) {
|
|
228
|
+
const result = await this.store.deleteUserRound(key, userRoundIndex);
|
|
229
|
+
if (result) this.emit("sessionUpdated", { key });
|
|
230
|
+
return result;
|
|
231
|
+
}
|
|
227
232
|
/**
|
|
228
233
|
* Append `kind: 'context'` transcript row (persisted, excluded from {@link loadMessages} / LLM).
|
|
229
234
|
*/
|
|
@@ -261,27 +266,19 @@ var SessionIndex = class extends EventEmitter$1 {
|
|
|
261
266
|
getWindowStats(messages) {
|
|
262
267
|
return this.store.getWindowStats(messages);
|
|
263
268
|
}
|
|
264
|
-
/** Prepare compaction run */
|
|
265
|
-
prepareCompaction(key, messages, contextWindow) {
|
|
266
|
-
return this.store.prepareCompaction(key, messages, contextWindow);
|
|
267
|
-
}
|
|
268
269
|
/** Compact session messages */
|
|
269
|
-
compact(key, messages,
|
|
270
|
-
return this.store.compact(key, messages,
|
|
270
|
+
compact(key, messages, model, instructions, force, executionOptions) {
|
|
271
|
+
return this.store.compact(key, messages, model, instructions, force, executionOptions);
|
|
271
272
|
}
|
|
272
273
|
/** Compaction stats for a session */
|
|
273
274
|
async getCompactionStats(key) {
|
|
274
275
|
return this.store.getCompactionStats(key);
|
|
275
276
|
}
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
return this.store.listCompactionCheckpoints(key);
|
|
279
|
-
}
|
|
280
|
-
getCompactionCheckpointDetail(key, checkpointId) {
|
|
281
|
-
return this.store.getCompactionCheckpointDetail(key, checkpointId);
|
|
277
|
+
listCompactionBoundaries(key) {
|
|
278
|
+
return this.store.listCompactionBoundaries(key);
|
|
282
279
|
}
|
|
283
|
-
|
|
284
|
-
return this.store.
|
|
280
|
+
restoreBeforeCompactionBoundary(key, compactionId) {
|
|
281
|
+
return this.store.restoreBeforeCompactionBoundary(key, compactionId);
|
|
285
282
|
}
|
|
286
283
|
/** Estimate token usage for messages */
|
|
287
284
|
async estimateTokenUsage(key, messages) {
|
|
@@ -14,12 +14,10 @@ function resolveSessionResetPolicy(params) {
|
|
|
14
14
|
const sessionCfg = params.sessionCfg;
|
|
15
15
|
const baseReset = params.resetOverride ?? sessionCfg?.reset;
|
|
16
16
|
const typeReset = params.resetOverride ? void 0 : sessionCfg?.resetByType?.[params.resetType];
|
|
17
|
-
const
|
|
18
|
-
const
|
|
19
|
-
const configured = Boolean(baseReset || typeReset || legacyIdleMinutes != null);
|
|
20
|
-
const mode = typeReset?.mode ?? baseReset?.mode ?? (!hasExplicitReset && legacyIdleMinutes != null ? "idle" : "daily");
|
|
17
|
+
const configured = Boolean(baseReset || typeReset);
|
|
18
|
+
const mode = typeReset?.mode ?? baseReset?.mode ?? "daily";
|
|
21
19
|
const atHour = normalizeResetAtHour(typeReset?.atHour ?? baseReset?.atHour ?? 4);
|
|
22
|
-
const idleMinutesRaw = typeReset?.idleMinutes ?? baseReset?.idleMinutes
|
|
20
|
+
const idleMinutesRaw = typeReset?.idleMinutes ?? baseReset?.idleMinutes;
|
|
23
21
|
let idleMinutes;
|
|
24
22
|
if (idleMinutesRaw != null) {
|
|
25
23
|
const normalized = Math.floor(idleMinutesRaw);
|
|
@@ -68,6 +68,21 @@ export interface XopcTranscriptCompactionSummaryEntry {
|
|
|
68
68
|
tokensBefore?: number;
|
|
69
69
|
timestamp?: string | number;
|
|
70
70
|
}
|
|
71
|
+
/** Append-only compaction boundary containing the exact LLM context at that point. */
|
|
72
|
+
export interface XopcTranscriptCompactionEntry {
|
|
73
|
+
type: 'compaction';
|
|
74
|
+
at: string;
|
|
75
|
+
baseSeq: number;
|
|
76
|
+
plannerVersion: number;
|
|
77
|
+
summaryModelRef: string;
|
|
78
|
+
qualityAudit: 'passed' | 'disabled';
|
|
79
|
+
summary: string;
|
|
80
|
+
messages: AgentMessage[];
|
|
81
|
+
firstKeptIndex: number;
|
|
82
|
+
tokensBefore: number;
|
|
83
|
+
tokensAfter: number;
|
|
84
|
+
restoredFromCompactionId?: string;
|
|
85
|
+
}
|
|
71
86
|
/** Persisted label change for a transcript entry. */
|
|
72
87
|
export interface XopcTranscriptLabelEntry {
|
|
73
88
|
type: 'label';
|
|
@@ -102,14 +117,17 @@ export interface XopcTranscriptSessionInfoEntry {
|
|
|
102
117
|
name?: string;
|
|
103
118
|
timestamp?: string | number;
|
|
104
119
|
}
|
|
105
|
-
export type TranscriptStoredRow = AgentMessage | XopcTranscriptContextEntry | XopcTranscriptBashExecutionEntry | XopcTranscriptCustomMessageEntry | XopcTranscriptCustomMessageFileEntry | XopcTranscriptCustomStateEntry | XopcTranscriptBranchSummaryEntry | XopcTranscriptCompactionSummaryEntry | XopcTranscriptLabelEntry | XopcTranscriptThinkingLevelChangeEntry | XopcTranscriptModelChangeEntry | XopcTranscriptSessionInfoEntry;
|
|
120
|
+
export type TranscriptStoredRow = AgentMessage | XopcTranscriptContextEntry | XopcTranscriptBashExecutionEntry | XopcTranscriptCustomMessageEntry | XopcTranscriptCustomMessageFileEntry | XopcTranscriptCustomStateEntry | XopcTranscriptBranchSummaryEntry | XopcTranscriptCompactionSummaryEntry | XopcTranscriptCompactionEntry | XopcTranscriptLabelEntry | XopcTranscriptThinkingLevelChangeEntry | XopcTranscriptModelChangeEntry | XopcTranscriptSessionInfoEntry;
|
|
106
121
|
export declare function isTranscriptContextEntry(x: unknown): x is XopcTranscriptContextEntry;
|
|
107
122
|
export declare function isTranscriptBashExecutionEntry(x: unknown): x is XopcTranscriptBashExecutionEntry;
|
|
108
123
|
export declare function isTranscriptCustomMessageEntry(x: unknown): x is XopcTranscriptCustomMessageEntry | XopcTranscriptCustomMessageFileEntry;
|
|
109
124
|
export declare function isTranscriptCustomStateEntry(x: unknown): x is XopcTranscriptCustomStateEntry;
|
|
110
125
|
export declare function isTranscriptSummaryMessageEntry(x: unknown): x is XopcTranscriptBranchSummaryEntry | XopcTranscriptCompactionSummaryEntry;
|
|
126
|
+
export declare function isTranscriptCompactionEntry(x: unknown): x is XopcTranscriptCompactionEntry;
|
|
111
127
|
export declare function isTranscriptLabelEntry(x: unknown): x is XopcTranscriptLabelEntry;
|
|
112
128
|
export declare function isTranscriptMetadataEntry(x: unknown): x is XopcTranscriptThinkingLevelChangeEntry | XopcTranscriptModelChangeEntry | XopcTranscriptSessionInfoEntry;
|
|
129
|
+
/** Runtime-derived messages are never authoritative transcript rows. */
|
|
130
|
+
export declare function isRuntimeOnlyTranscriptMessage(x: unknown): boolean;
|
|
113
131
|
/**
|
|
114
132
|
* Normalize a JSON array from on-disk transcript into stored rows (drops unrecognized objects).
|
|
115
133
|
*/
|