@fased/fased 0.1.47 → 0.1.49
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/agents/auth-health.js +11 -5
- package/dist/agents/current-model-catalog.js +21 -3
- package/dist/brand.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/canvas-host/a2ui/.bundle.hash +1 -1
- package/dist/commands/doctor-state-integrity.js +25 -2
- package/dist/config/sessions/transcript.js +30 -16
- package/dist/config/sessions.js +2 -2
- package/dist/control-ui/assets/{app-CHqTx3P_.js → app-6iCry787.js} +1274 -1259
- package/dist/control-ui/assets/{chat-model-ref-BbrdMKjQ.js → chat-model-ref-C6CFR-GR.js} +2 -2
- package/dist/control-ui/assets/{config-FFZLTSLS.js → config-CU5Zi8Dh.js} +2 -2
- package/dist/control-ui/assets/{index-CFHfNlLv.js → index-CNFgocD9.js} +3 -3
- package/dist/control-ui/assets/{mining-D_VAMFMY.js → mining-BdhMn18r.js} +3 -3
- package/dist/control-ui/assets/{providers-DqFL6WrJ.js → providers-WTJ1kMKy.js} +14 -3
- package/dist/control-ui/index.html +1 -1
- package/dist/extensions/sat-mining/src/protocol-contract.js +63 -0
- package/dist/extensions/sat-mining/src/solana-submit.js +3 -52
- package/dist/gateway/protocol/schema/agents-models-skills.js +1 -0
- package/dist/gateway/protocol/schema/frames.js +5 -0
- package/dist/gateway/protocol/schema/snapshot.js +1 -0
- package/dist/gateway/server/ws-connection/message-handler.js +2 -1
- package/dist/gateway/server-http.js +1 -0
- package/dist/gateway/server-methods/chat.js +4 -29
- package/dist/infra/system-presence.js +4 -2
- package/dist/light-update-status.js +1 -1
- package/dist/memory/inventory.js +44 -4
- package/dist/mining/mainnet-sync.js +70 -26
- package/dist/plugin-sdk/{accounts-DzLdrOVC.js → accounts-B5fY9hZy.js} +1 -1
- package/dist/plugin-sdk/{actions-PhofTgnO.js → actions-D-9SsSEy.js} +2 -2
- package/dist/plugin-sdk/{active-listener-C8a74qPO.js → active-listener-BH7rDR47.js} +1 -1
- package/dist/plugin-sdk/{audio-preflight-CARAVcz-.js → audio-preflight-4faayz5S.js} +26 -26
- package/dist/plugin-sdk/{audit-ByK45Q1d.js → audit-BQfsboqd.js} +1 -1
- package/dist/plugin-sdk/{channel-access-BEin0yA4.js → channel-access-CDZ-cJPq.js} +1 -1
- package/dist/plugin-sdk/{channel-access-configure-Di_DoR-Q.js → channel-access-configure-DlpuhlH6.js} +1 -1
- package/dist/plugin-sdk/channel-plugin-common.d.ts +2 -2
- package/dist/plugin-sdk/channel-plugin-common.js +4 -4
- package/dist/plugin-sdk/{chunk-CwN3c1Fq.js → chunk-CZuCyS7k.js} +1 -1
- package/dist/plugin-sdk/{chunk-items-DH7ooQBZ.js → chunk-items-Cyc4Kl6A.js} +1 -1
- package/dist/plugin-sdk/command-status.js +26 -26
- package/dist/plugin-sdk/{commands-registry-Bea-V_lR.js → commands-registry-COIbIjGO.js} +2 -2
- package/dist/plugin-sdk/{common-BJPuBxmx.js → common-LMHJe8KW.js} +1 -1
- package/dist/plugin-sdk/{config-BxOWD3gF.js → config-ZMbTT0kM.js} +22 -4
- package/dist/plugin-sdk/{config-schema-ChJcPn7x.js → config-schema-Cku0a8Tm.js} +100 -64
- package/dist/plugin-sdk/device-pair.d.ts +1 -1
- package/dist/plugin-sdk/discord.d.ts +4 -4
- package/dist/plugin-sdk/discord.js +19 -19
- package/dist/plugin-sdk/{handle-action-Bk-L2J84.js → handle-action-C8ZZfORB.js} +13 -13
- package/dist/plugin-sdk/{helpers-0E444CR0.js → helpers-vfzH9tBn.js} +1 -1
- package/dist/plugin-sdk/{image-ops-BYc-Ol7C.js → image-ops-BnOmQA5d.js} +1 -1
- package/dist/plugin-sdk/index.d.ts +9 -9
- package/dist/plugin-sdk/index.js +28 -28
- package/dist/plugin-sdk/{login-B_At7IVI.js → login-C73Wpiw8.js} +3 -3
- package/dist/plugin-sdk/{login-qr-BlSQ8QJF.js → login-qr-CRKHA7i8.js} +3 -3
- package/dist/plugin-sdk/{manager-VNI6sxbG.js → manager-CHYhpKHn.js} +2 -2
- package/dist/plugin-sdk/{markdown-tables-CpNefu6e.js → markdown-tables-B84dPWNG.js} +1 -1
- package/dist/plugin-sdk/{media-QBCmvhBQ.js → media-4daDcNER.js} +2 -2
- package/dist/plugin-sdk/{monitor-BhHlerHI.js → monitor-CChc6bQV.js} +30 -30
- package/dist/plugin-sdk/{monitor-C9UczH5N.js → monitor-DJhU-J5u.js} +31 -31
- package/dist/plugin-sdk/{openresponses-http-CtuFHD5w.js → openresponses-http-Dvyczr35.js} +26 -26
- package/dist/plugin-sdk/{optional-runtime-dependency-BaVO1F3i.js → optional-runtime-dependency-BFpqaCzp.js} +1 -1
- package/dist/plugin-sdk/{outbound-CWrcAWpE.js → outbound-C1xBxfNb.js} +6 -6
- package/dist/plugin-sdk/{outbound-attachment-Dhi2Q-_f.js → outbound-attachment-DvcxPP7b.js} +2 -2
- package/dist/plugin-sdk/{pairing-message-6XVXW554.d.ts → pairing-message-DWXHX-jt.d.ts} +1 -1
- package/dist/plugin-sdk/{pairing-message-D01_6FkJ.js → pairing-message-DpYT614h.js} +1 -1
- package/dist/plugin-sdk/{pairing-store-DADXOv-J.js → pairing-store-CprpGco9.js} +2 -2
- package/dist/plugin-sdk/{pi-model-discovery-D9-CQFS2.js → pi-model-discovery-BQ6fFRBA.js} +1 -1
- package/dist/plugin-sdk/{pi-model-discovery-runtime-DhNNXQgq.js → pi-model-discovery-runtime-BF_89lVj.js} +2 -2
- package/dist/plugin-sdk/provider-web-search-config-contract.d.ts +1 -1
- package/dist/plugin-sdk/{pw-ai-CQG7vp-Y.js → pw-ai-xgpIbHOr.js} +3 -3
- package/dist/plugin-sdk/{replies-C_FeIOF4.js → replies-AzJ6U6Ut.js} +2 -2
- package/dist/plugin-sdk/{resolve-outbound-target-DD8edEdz.js → resolve-outbound-target-COo_TR7B.js} +1 -1
- package/dist/plugin-sdk/{resolve-route-BPkfG5Pg.js → resolve-route-CZFzHOIe.js} +1 -1
- package/dist/plugin-sdk/{retry-policy-C0YsRX_6.js → retry-policy-BSdqqXsI.js} +1 -1
- package/dist/plugin-sdk/{runtime-CyTWeylK.js → runtime-CeoGffDi.js} +31 -18
- package/dist/plugin-sdk/{runtime-dependency-D6tYtvtU.js → runtime-dependency-Cvbs0GXf.js} +2 -2
- package/dist/plugin-sdk/sat-runtime.d.ts +3 -2
- package/dist/plugin-sdk/sat-runtime.js +5 -5
- package/dist/plugin-sdk/{send-CNxLDNQ9.js → send-B_-UtG9F.js} +6 -6
- package/dist/plugin-sdk/{send-Qckp3h4k.js → send-C0Q1u7N1.js} +8 -8
- package/dist/plugin-sdk/{send-BtFuV6zU.js → send-CGE7OgsA.js} +5 -5
- package/dist/plugin-sdk/{send-FcEJfLTd.js → send-DCxAv7bV.js} +6 -6
- package/dist/plugin-sdk/{send-BedQ8ekw.js → send-DVpCBUuL.js} +7 -7
- package/dist/plugin-sdk/{session-C3Ul4abD.js → session-ETYBbhLn.js} +2 -2
- package/dist/plugin-sdk/{skill-commands-C2CnUTPX.js → skill-commands-BQL6TBIv.js} +2 -2
- package/dist/plugin-sdk/{slack-bSeSOI9d.js → slack-Bs_4uivd.js} +38 -38
- package/dist/plugin-sdk/{slack-actions-CLyEd8FK.js → slack-actions-CBPZkfTS.js} +11 -11
- package/dist/plugin-sdk/slack.d.ts +4 -4
- package/dist/plugin-sdk/slack.js +9 -9
- package/dist/plugin-sdk/{sticker-cache-DBnS3hHh.js → sticker-cache-BBZMp-oQ.js} +3 -3
- package/dist/plugin-sdk/{tables-L5mXZ5y_.js → tables-B-G7Bb0l.js} +1 -1
- package/dist/plugin-sdk/{targets-eG595pY0.js → targets-D8UaoWHd.js} +1 -1
- package/dist/plugin-sdk/{telegram-actions-D0Kyqy_e.js → telegram-actions-BARLx9zc.js} +29 -29
- package/dist/plugin-sdk/telegram.d.ts +4 -4
- package/dist/plugin-sdk/telegram.js +8 -8
- package/dist/plugin-sdk/{thread-bindings.lifecycle-C_5BEWmL.js → thread-bindings.lifecycle-DwYKCLLq.js} +3 -3
- package/dist/plugin-sdk/{thread-bindings.state-DRZAbcUu.js → thread-bindings.state-BNWfHA0f.js} +2 -2
- package/dist/plugin-sdk/{tmp-fased-dir-BpMLNd4L.d.ts → tmp-fased-dir-Be1wBhVz.d.ts} +1 -1
- package/dist/plugin-sdk/{types-0CsXVmg8.d.ts → types-CJGVZX6j.d.ts} +1 -1
- package/dist/plugin-sdk/{types-DMLEeE52.d.ts → types-CXLEOrJX.d.ts} +1 -1
- package/dist/plugin-sdk/{wallet-status-2yrXvqSS.js → wallet-status-Coekn_SJ.js} +77 -28
- package/dist/plugin-sdk/{web-CSRe4zy2.js → web-BwolzGVF.js} +31 -31
- package/dist/plugin-sdk/{whatsapp-actions-CkLkpg8M.js → whatsapp-actions-CSvf6eev.js} +13 -13
- package/dist/plugin-sdk/{whatsapp-heartbeat-DuAE9_88.js → whatsapp-heartbeat-Bw7OtTe6.js} +2 -2
- package/dist/plugin-sdk/whatsapp.d.ts +3 -3
- package/dist/plugin-sdk/whatsapp.js +12 -12
- package/dist/plugin-sdk/{wsl-CXVwPntb.js → wsl-By1Mc-oS.js} +3 -3
- package/dist/plugin-sdk/{zod-schema.providers-core-FaYR6KdD.d.ts → zod-schema.providers-core-TI6sL-6B.d.ts} +16 -16
- package/dist/providers/registry.js +1 -1
- package/dist/version.js +11 -1
- package/extensions/acpx/package.json +1 -1
- package/extensions/bluebubbles/package.json +1 -1
- package/extensions/copilot-proxy/package.json +1 -1
- package/extensions/diagnostics-otel/package.json +1 -1
- package/extensions/fased-federation/package.json +1 -1
- package/extensions/google-gemini-cli-auth/package.json +1 -1
- package/extensions/imessage/package.json +1 -1
- package/extensions/irc/package.json +1 -1
- package/extensions/line/package.json +1 -1
- package/extensions/llm-task/package.json +1 -1
- package/extensions/lobster/package.json +1 -1
- package/extensions/matrix/CHANGELOG.md +12 -0
- package/extensions/matrix/package.json +1 -1
- package/extensions/mattermost/package.json +1 -1
- package/extensions/memory-core/package.json +2 -2
- package/extensions/memory-lancedb/package.json +1 -1
- package/extensions/minimax-portal-auth/package.json +1 -1
- package/extensions/msteams/CHANGELOG.md +12 -0
- package/extensions/msteams/package.json +1 -1
- package/extensions/nextcloud-talk/package.json +1 -1
- package/extensions/nostr/CHANGELOG.md +12 -0
- package/extensions/nostr/package.json +1 -1
- package/extensions/open-prose/package.json +1 -1
- package/extensions/sat-mining/index.ts +122 -13
- package/extensions/sat-mining/package.json +1 -1
- package/extensions/sat-mining/src/protocol-contract.ts +64 -0
- package/extensions/sat-mining/src/round-watcher.ts +6 -4
- package/extensions/sat-mining/src/runtime.ts +9 -3
- package/extensions/sat-mining/src/solana-submit.ts +7 -53
- package/extensions/signal/package.json +1 -1
- package/extensions/synology-chat/package.json +1 -1
- package/extensions/tlon/package.json +1 -1
- package/extensions/twitch/CHANGELOG.md +12 -0
- package/extensions/twitch/package.json +1 -1
- package/extensions/voice-call/CHANGELOG.md +12 -0
- package/extensions/voice-call/package.json +1 -1
- package/extensions/zalo/CHANGELOG.md +12 -0
- package/extensions/zalo/package.json +1 -1
- package/extensions/zalouser/CHANGELOG.md +12 -0
- package/extensions/zalouser/package.json +1 -1
- package/package.json +1 -1
- package/scripts/start-managed.sh +21 -1
|
@@ -119,7 +119,7 @@ function buildProfileHealth(params) {
|
|
|
119
119
|
}
|
|
120
120
|
const hasRefreshToken = typeof credential.refresh === "string" && credential.refresh.length > 0;
|
|
121
121
|
const { status: rawStatus, remainingMs } = resolveOAuthStatus(credential.expires, now, warnAfterMs);
|
|
122
|
-
const status = hasRefreshToken && (rawStatus === "expired" || rawStatus === "expiring") ? "
|
|
122
|
+
const status = hasRefreshToken && (rawStatus === "expired" || rawStatus === "expiring") ? "refresh-required" : rawStatus;
|
|
123
123
|
return {
|
|
124
124
|
profileId,
|
|
125
125
|
provider,
|
|
@@ -190,13 +190,19 @@ function buildAuthHealthSummary(params) {
|
|
|
190
190
|
provider.expiresAt = Math.min(...expiryCandidates);
|
|
191
191
|
provider.remainingMs = provider.expiresAt - now;
|
|
192
192
|
}
|
|
193
|
-
const statuses = new Set(
|
|
194
|
-
if (statuses.has("
|
|
195
|
-
provider.status = "
|
|
193
|
+
const statuses = new Set(provider.profiles.map((p) => p.status));
|
|
194
|
+
if (statuses.has("ok")) {
|
|
195
|
+
provider.status = "ok";
|
|
196
|
+
} else if (statuses.has("static")) {
|
|
197
|
+
provider.status = "static";
|
|
196
198
|
} else if (statuses.has("expiring")) {
|
|
197
199
|
provider.status = "expiring";
|
|
200
|
+
} else if (statuses.has("refresh-required")) {
|
|
201
|
+
provider.status = "refresh-required";
|
|
202
|
+
} else if (statuses.has("expired")) {
|
|
203
|
+
provider.status = "expired";
|
|
198
204
|
} else {
|
|
199
|
-
provider.status = "
|
|
205
|
+
provider.status = "missing";
|
|
200
206
|
}
|
|
201
207
|
}
|
|
202
208
|
const providers = Array.from(providersMap.values()).toSorted((a, b) => a.provider.localeCompare(b.provider));
|
|
@@ -152,7 +152,13 @@ const ANTHROPIC_MODELS = [
|
|
|
152
152
|
reasoning: true,
|
|
153
153
|
input: ["text", "image"],
|
|
154
154
|
contextWindow: 1e6,
|
|
155
|
-
maxTokens: 128e3
|
|
155
|
+
maxTokens: 128e3,
|
|
156
|
+
cost: {
|
|
157
|
+
input: 10,
|
|
158
|
+
output: 50,
|
|
159
|
+
cacheRead: 1,
|
|
160
|
+
cacheWrite: 12.5
|
|
161
|
+
}
|
|
156
162
|
}),
|
|
157
163
|
model({
|
|
158
164
|
id: "claude-opus-4-8",
|
|
@@ -160,7 +166,13 @@ const ANTHROPIC_MODELS = [
|
|
|
160
166
|
reasoning: true,
|
|
161
167
|
input: ["text", "image"],
|
|
162
168
|
contextWindow: 1e6,
|
|
163
|
-
maxTokens: 128e3
|
|
169
|
+
maxTokens: 128e3,
|
|
170
|
+
cost: {
|
|
171
|
+
input: 5,
|
|
172
|
+
output: 25,
|
|
173
|
+
cacheRead: .5,
|
|
174
|
+
cacheWrite: 6.25
|
|
175
|
+
}
|
|
164
176
|
}),
|
|
165
177
|
model({
|
|
166
178
|
id: "claude-sonnet-5",
|
|
@@ -168,7 +180,13 @@ const ANTHROPIC_MODELS = [
|
|
|
168
180
|
reasoning: true,
|
|
169
181
|
input: ["text", "image"],
|
|
170
182
|
contextWindow: 1e6,
|
|
171
|
-
maxTokens: 128e3
|
|
183
|
+
maxTokens: 128e3,
|
|
184
|
+
cost: {
|
|
185
|
+
input: 2,
|
|
186
|
+
output: 10,
|
|
187
|
+
cacheRead: .2,
|
|
188
|
+
cacheWrite: 2.5
|
|
189
|
+
}
|
|
172
190
|
}),
|
|
173
191
|
model({
|
|
174
192
|
id: "claude-haiku-4-5",
|
package/dist/brand.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
const FASED_BRAND_NAME = "Fased";
|
|
3
3
|
const FASED_AGENT_NAME = "Fased Agent";
|
|
4
4
|
const FASED_CONTROL_NAME = "Fased Control";
|
|
5
|
-
const FASED_PRODUCT_VERSION = "0.1.
|
|
5
|
+
const FASED_PRODUCT_VERSION = "0.1.49";
|
|
6
6
|
const FASED_DISPLAY_VERSION = `v${FASED_PRODUCT_VERSION}`;
|
|
7
7
|
function formatFasedDisplayLine() {
|
|
8
8
|
return `${FASED_AGENT_NAME} ${FASED_DISPLAY_VERSION}`;
|
package/dist/build-info.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
9cf509e3b9c0634ed2b4329c93173df36581cf8fabf111cea843596bd26a7aea
|
|
@@ -8,6 +8,7 @@ import { formatSessionArchiveTimestamp, isPrimarySessionTranscriptFileName } fro
|
|
|
8
8
|
import { resolveMainSessionKey } from "../config/sessions/main-session.js";
|
|
9
9
|
import { resolveSessionFilePath, resolveSessionFilePathOptions, resolveSessionTranscriptsDirForAgent, resolveStorePath } from "../config/sessions/paths.js";
|
|
10
10
|
import { loadSessionStore } from "../config/sessions/store.js";
|
|
11
|
+
import { ensureSessionTranscriptHeader } from "../config/sessions/transcript.js";
|
|
11
12
|
import "../config/sessions.js";
|
|
12
13
|
import { note } from "../terminal/note.js";
|
|
13
14
|
import syncFs from "node:fs";
|
|
@@ -381,9 +382,31 @@ async function noteStateIntegrity(cfg, prompter, configPath) {
|
|
|
381
382
|
warnings.push([
|
|
382
383
|
`- ${missing.length}/${recentTranscriptCandidates.length} recent sessions are missing transcripts.`,
|
|
383
384
|
` Verify sessions in store: ${formatCliCommand(`fased sessions --store "${absoluteStorePath}"`)}`,
|
|
384
|
-
`
|
|
385
|
-
|
|
385
|
+
` Preserve entries and rebuild empty transcript headers: ${formatCliCommand("fased doctor --fix")}`,
|
|
386
|
+
" Earlier missing transcript content cannot be reconstructed."
|
|
386
387
|
].join("\n"));
|
|
388
|
+
const repairMissing = prompter.shouldRepair === true || await prompter.confirmSkipInNonInteractive({
|
|
389
|
+
message: "Recreate missing transcript headers while preserving session entries?",
|
|
390
|
+
initialValue: true
|
|
391
|
+
});
|
|
392
|
+
if (repairMissing) {
|
|
393
|
+
for (const [, entry] of missing) {
|
|
394
|
+
const sessionId = entry.sessionId;
|
|
395
|
+
if (!sessionId) {
|
|
396
|
+
continue;
|
|
397
|
+
}
|
|
398
|
+
const transcriptPath = resolveSessionFilePath(sessionId, entry, sessionPathOpts);
|
|
399
|
+
const repair = ensureSessionTranscriptHeader({
|
|
400
|
+
sessionFile: transcriptPath,
|
|
401
|
+
sessionId
|
|
402
|
+
});
|
|
403
|
+
if (repair.error) {
|
|
404
|
+
warnings.push(`- Failed to recreate transcript header ${shortenHomePath(transcriptPath)}: ${repair.error}`);
|
|
405
|
+
} else if (repair.created) {
|
|
406
|
+
changes.push(`- Recreated missing transcript header for session ${sessionId}; prior transcript content was unavailable`);
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
}
|
|
387
410
|
}
|
|
388
411
|
const mainKey = resolveMainSessionKey(cfg);
|
|
389
412
|
const mainEntry = store[mainKey];
|
|
@@ -64,22 +64,30 @@ async function resolveSessionTranscriptFile(params) {
|
|
|
64
64
|
activeSessionKey: params.activeSessionKey
|
|
65
65
|
});
|
|
66
66
|
}
|
|
67
|
-
|
|
67
|
+
function ensureSessionTranscriptHeader(params) {
|
|
68
68
|
if (syncFs.existsSync(params.sessionFile)) {
|
|
69
|
-
return;
|
|
69
|
+
return { created: false };
|
|
70
|
+
}
|
|
71
|
+
try {
|
|
72
|
+
syncFs.mkdirSync(path.dirname(params.sessionFile), { recursive: true });
|
|
73
|
+
const header = {
|
|
74
|
+
type: "session",
|
|
75
|
+
version: CURRENT_SESSION_VERSION,
|
|
76
|
+
id: params.sessionId,
|
|
77
|
+
timestamp: new Date().toISOString(),
|
|
78
|
+
cwd: process.cwd()
|
|
79
|
+
};
|
|
80
|
+
syncFs.writeFileSync(params.sessionFile, `${JSON.stringify(header)}\n`, {
|
|
81
|
+
encoding: "utf-8",
|
|
82
|
+
mode: 384
|
|
83
|
+
});
|
|
84
|
+
return { created: true };
|
|
85
|
+
} catch (error) {
|
|
86
|
+
return {
|
|
87
|
+
created: false,
|
|
88
|
+
error: error instanceof Error ? error.message : String(error)
|
|
89
|
+
};
|
|
70
90
|
}
|
|
71
|
-
await syncFs.promises.mkdir(path.dirname(params.sessionFile), { recursive: true });
|
|
72
|
-
const header = {
|
|
73
|
-
type: "session",
|
|
74
|
-
version: CURRENT_SESSION_VERSION,
|
|
75
|
-
id: params.sessionId,
|
|
76
|
-
timestamp: new Date().toISOString(),
|
|
77
|
-
cwd: process.cwd()
|
|
78
|
-
};
|
|
79
|
-
await syncFs.promises.writeFile(params.sessionFile, `${JSON.stringify(header)}\n`, {
|
|
80
|
-
encoding: "utf-8",
|
|
81
|
-
mode: 384
|
|
82
|
-
});
|
|
83
91
|
}
|
|
84
92
|
async function appendAssistantMessageToSessionTranscript(params) {
|
|
85
93
|
const sessionKey = params.sessionKey.trim();
|
|
@@ -126,10 +134,16 @@ async function appendAssistantMessageToSessionTranscript(params) {
|
|
|
126
134
|
reason: err instanceof Error ? err.message : String(err)
|
|
127
135
|
};
|
|
128
136
|
}
|
|
129
|
-
|
|
137
|
+
const ensured = ensureSessionTranscriptHeader({
|
|
130
138
|
sessionFile,
|
|
131
139
|
sessionId: entry.sessionId
|
|
132
140
|
});
|
|
141
|
+
if (ensured.error) {
|
|
142
|
+
return {
|
|
143
|
+
ok: false,
|
|
144
|
+
reason: ensured.error
|
|
145
|
+
};
|
|
146
|
+
}
|
|
133
147
|
const sessionManager = SessionManager.open(sessionFile);
|
|
134
148
|
const message = {
|
|
135
149
|
role: "assistant",
|
|
@@ -171,4 +185,4 @@ async function appendAssistantMessageToSessionTranscript(params) {
|
|
|
171
185
|
}
|
|
172
186
|
|
|
173
187
|
//#endregion
|
|
174
|
-
export { appendAssistantMessageToSessionTranscript, resolveMirroredTranscriptText, resolveSessionTranscriptFile };
|
|
188
|
+
export { appendAssistantMessageToSessionTranscript, ensureSessionTranscriptHeader, resolveMirroredTranscriptText, resolveSessionTranscriptFile };
|
package/dist/config/sessions.js
CHANGED
|
@@ -10,7 +10,7 @@ import { deriveSessionKey, resolveSessionKey } from "./sessions/session-key.js";
|
|
|
10
10
|
import { enforceSessionDiskBudget } from "./sessions/disk-budget.js";
|
|
11
11
|
import { capEntryCount, clearSessionStoreCacheForTest, drainSessionStoreLockQueuesForTest, getActiveSessionMaintenanceWarning, getSessionStoreLockQueueSizeForTest, loadSessionStore, pruneStaleEntries, readSessionUpdatedAt, recordSessionMetaFromInbound, resolveMaintenanceConfig, rotateSessionFile, saveSessionStore, updateLastRoute, updateSessionStore, updateSessionStoreEntry, withSessionStoreLockForTest } from "./sessions/store.js";
|
|
12
12
|
import { resolveAndPersistSessionFile } from "./sessions/session-file.js";
|
|
13
|
-
import { appendAssistantMessageToSessionTranscript, resolveMirroredTranscriptText, resolveSessionTranscriptFile } from "./sessions/transcript.js";
|
|
13
|
+
import { appendAssistantMessageToSessionTranscript, ensureSessionTranscriptHeader, resolveMirroredTranscriptText, resolveSessionTranscriptFile } from "./sessions/transcript.js";
|
|
14
14
|
import { extractDeliveryInfo, parseSessionThreadInfo } from "./sessions/delivery-info.js";
|
|
15
15
|
|
|
16
|
-
export { DEFAULT_IDLE_MINUTES, DEFAULT_RESET_AT_HOUR, DEFAULT_RESET_MODE, DEFAULT_RESET_TRIGGER, DEFAULT_RESET_TRIGGERS, SAFE_SESSION_ID_RE, appendAssistantMessageToSessionTranscript, buildGroupDisplayName, canonicalizeMainSessionAlias, capEntryCount, clearSessionStoreCacheForTest, deriveGroupSessionPatch, deriveSessionKey, deriveSessionMetaPatch, deriveSessionOrigin, drainSessionStoreLockQueuesForTest, enforceSessionDiskBudget, evaluateSessionFreshness, extractDeliveryInfo, formatSessionArchiveTimestamp, getActiveSessionMaintenanceWarning, getSessionStoreLockQueueSizeForTest, isPrimarySessionTranscriptFileName, isSessionArchiveArtifactName, isSessionCompactionCheckpointArtifactName, isSessionTotalTokensFresh, isThreadSessionKey, loadSessionStore, mergeSessionEntry, normalizeSessionRuntimeModelFields, parseSessionArchiveTimestamp, parseSessionThreadInfo, pruneStaleEntries, readSessionUpdatedAt, recordSessionMetaFromInbound, resolveAgentIdFromSessionKey, resolveAgentMainSessionKey, resolveAndPersistSessionFile, resolveChannelResetConfig, resolveDailyResetAtMs, resolveDefaultSessionStorePath, resolveExplicitAgentSessionKey, resolveFreshSessionTotalTokens, resolveGroupSessionKey, resolveMainSessionKey, resolveMainSessionKeyFromConfig, resolveMaintenanceConfig, resolveMirroredTranscriptText, resolveSessionFilePath, resolveSessionFilePathOptions, resolveSessionKey, resolveSessionResetPolicy, resolveSessionResetType, resolveSessionTranscriptFile, resolveSessionTranscriptPath, resolveSessionTranscriptPathInDir, resolveSessionTranscriptsDir, resolveSessionTranscriptsDirForAgent, resolveStorePath, resolveThreadFlag, rotateSessionFile, saveSessionStore, setSessionRuntimeModel, snapshotSessionOrigin, updateLastRoute, updateSessionStore, updateSessionStoreEntry, validateSessionId, withSessionStoreLockForTest };
|
|
16
|
+
export { DEFAULT_IDLE_MINUTES, DEFAULT_RESET_AT_HOUR, DEFAULT_RESET_MODE, DEFAULT_RESET_TRIGGER, DEFAULT_RESET_TRIGGERS, SAFE_SESSION_ID_RE, appendAssistantMessageToSessionTranscript, buildGroupDisplayName, canonicalizeMainSessionAlias, capEntryCount, clearSessionStoreCacheForTest, deriveGroupSessionPatch, deriveSessionKey, deriveSessionMetaPatch, deriveSessionOrigin, drainSessionStoreLockQueuesForTest, enforceSessionDiskBudget, ensureSessionTranscriptHeader, evaluateSessionFreshness, extractDeliveryInfo, formatSessionArchiveTimestamp, getActiveSessionMaintenanceWarning, getSessionStoreLockQueueSizeForTest, isPrimarySessionTranscriptFileName, isSessionArchiveArtifactName, isSessionCompactionCheckpointArtifactName, isSessionTotalTokensFresh, isThreadSessionKey, loadSessionStore, mergeSessionEntry, normalizeSessionRuntimeModelFields, parseSessionArchiveTimestamp, parseSessionThreadInfo, pruneStaleEntries, readSessionUpdatedAt, recordSessionMetaFromInbound, resolveAgentIdFromSessionKey, resolveAgentMainSessionKey, resolveAndPersistSessionFile, resolveChannelResetConfig, resolveDailyResetAtMs, resolveDefaultSessionStorePath, resolveExplicitAgentSessionKey, resolveFreshSessionTotalTokens, resolveGroupSessionKey, resolveMainSessionKey, resolveMainSessionKeyFromConfig, resolveMaintenanceConfig, resolveMirroredTranscriptText, resolveSessionFilePath, resolveSessionFilePathOptions, resolveSessionKey, resolveSessionResetPolicy, resolveSessionResetType, resolveSessionTranscriptFile, resolveSessionTranscriptPath, resolveSessionTranscriptPathInDir, resolveSessionTranscriptsDir, resolveSessionTranscriptsDirForAgent, resolveStorePath, resolveThreadFlag, rotateSessionFile, saveSessionStore, setSessionRuntimeModel, snapshotSessionOrigin, updateLastRoute, updateSessionStore, updateSessionStoreEntry, validateSessionId, withSessionStoreLockForTest };
|