@wrongstack/core 0.73.1 → 0.77.0
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-bridge-C0Ze7Ldm.d.ts → agent-bridge-EWdqs8v6.d.ts} +1 -1
- package/dist/{agent-subagent-runner-BmITbs1Q.d.ts → agent-subagent-runner-D8qW8OSC.d.ts} +2 -2
- package/dist/coordination/index.d.ts +7 -7
- package/dist/coordination/index.js +64 -6
- package/dist/coordination/index.js.map +1 -1
- package/dist/defaults/index.d.ts +11 -11
- package/dist/defaults/index.js +107 -45
- package/dist/defaults/index.js.map +1 -1
- package/dist/{events-BBAlxBuw.d.ts → events-CYaoLN5_.d.ts} +37 -0
- package/dist/execution/index.d.ts +6 -6
- package/dist/extension/index.d.ts +2 -2
- package/dist/{index-yQbZ2NQx.d.ts → index-DIxjTOga.d.ts} +2 -2
- package/dist/{index-BN6i2Nfg.d.ts → index-Dsda0uCn.d.ts} +1 -1
- package/dist/index.d.ts +96 -23
- package/dist/index.js +234 -25
- package/dist/index.js.map +1 -1
- package/dist/infrastructure/index.d.ts +3 -3
- package/dist/infrastructure/index.js +16 -2
- package/dist/infrastructure/index.js.map +1 -1
- package/dist/kernel/index.d.ts +3 -3
- package/dist/kernel/index.js.map +1 -1
- package/dist/{logger-bOzkF5LL.d.ts → logger-BppKxDqZ.d.ts} +9 -0
- package/dist/{multi-agent-coordinator-BSBbZt0e.d.ts → multi-agent-coordinator-DpbG3wiy.d.ts} +1 -1
- package/dist/{null-fleet-bus-BCIRT_nV.d.ts → null-fleet-bus-u5ys3lW_.d.ts} +13 -4
- package/dist/observability/index.d.ts +1 -1
- package/dist/{parallel-eternal-engine-CjAYGaCw.d.ts → parallel-eternal-engine-Dn0P8Pbj.d.ts} +3 -3
- package/dist/{path-resolver-BnqXa9Ze.d.ts → path-resolver-B32v2JIq.d.ts} +1 -1
- package/dist/{plan-templates-DBgrTGPu.d.ts → plan-templates-BcUwLlMQ.d.ts} +7 -2
- package/dist/{provider-runner-n3KkHT_w.d.ts → provider-runner-CSi_7l0h.d.ts} +1 -1
- package/dist/sdd/index.d.ts +3 -3
- package/dist/storage/index.d.ts +3 -3
- package/dist/storage/index.js +22 -6
- package/dist/storage/index.js.map +1 -1
- package/dist/types/index.d.ts +10 -10
- package/dist/types/index.js +16 -2
- package/dist/types/index.js.map +1 -1
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.js +12 -2
- package/dist/utils/index.js.map +1 -1
- package/dist/{wstack-paths-eMXnY1_X.d.ts → wstack-paths-D7evAFWM.d.ts} +8 -1
- package/package.json +1 -1
package/dist/storage/index.js
CHANGED
|
@@ -167,6 +167,16 @@ function isEmptyMessage(msg) {
|
|
|
167
167
|
}
|
|
168
168
|
|
|
169
169
|
// src/storage/session-store.ts
|
|
170
|
+
function sanitizeModel(model) {
|
|
171
|
+
return model.replace(/[^a-zA-Z0-9_-]/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "").slice(0, 40);
|
|
172
|
+
}
|
|
173
|
+
function generateSessionId(startedAt, model) {
|
|
174
|
+
const date = startedAt.slice(0, 10);
|
|
175
|
+
const time = startedAt.slice(11, 19).replace(/:/g, "-");
|
|
176
|
+
const suffix = randomBytes(2).toString("hex");
|
|
177
|
+
const modelPart = model ? `_${sanitizeModel(model)}` : "";
|
|
178
|
+
return `${date}/${time}Z${modelPart}_${suffix}`;
|
|
179
|
+
}
|
|
170
180
|
var DefaultSessionStore = class {
|
|
171
181
|
dir;
|
|
172
182
|
events;
|
|
@@ -180,15 +190,21 @@ var DefaultSessionStore = class {
|
|
|
180
190
|
sessionPath(id, ext) {
|
|
181
191
|
return path14.join(this.dir, `${id}${ext}`);
|
|
182
192
|
}
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
193
|
+
/**
|
|
194
|
+
* Ensure the directory implied by the session ID exists. When the ID
|
|
195
|
+
* contains a date prefix like `2026-06-06/...`, this creates the date
|
|
196
|
+
* subdirectory so sessions group naturally by day.
|
|
197
|
+
*/
|
|
198
|
+
async ensureShardDir(id) {
|
|
199
|
+
const dirPath = path14.dirname(path14.join(this.dir, id));
|
|
200
|
+
await ensureDir(dirPath);
|
|
201
|
+
return dirPath;
|
|
186
202
|
}
|
|
187
203
|
async create(meta) {
|
|
188
204
|
const startedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
189
|
-
const id = meta.id
|
|
205
|
+
const id = meta.id && meta.id.length > 0 ? meta.id : generateSessionId(startedAt, meta.model ?? meta.provider);
|
|
190
206
|
const shardDir = await this.ensureShardDir(id);
|
|
191
|
-
const file = path14.join(shardDir, `${id}.jsonl`);
|
|
207
|
+
const file = path14.join(shardDir, `${path14.basename(id)}.jsonl`);
|
|
192
208
|
let handle;
|
|
193
209
|
try {
|
|
194
210
|
handle = await fsp.open(file, "a", 384);
|
|
@@ -2968,7 +2984,7 @@ async function loadTodosCheckpoint(filePath) {
|
|
|
2968
2984
|
const parsed = JSON.parse(raw);
|
|
2969
2985
|
if (parsed?.version !== 1 || !Array.isArray(parsed.todos)) return null;
|
|
2970
2986
|
return parsed.todos.filter(
|
|
2971
|
-
(t) => !!t && typeof t.id === "string" && typeof t.content === "string" && typeof t.status === "string"
|
|
2987
|
+
(t) => !!t && typeof t.id === "string" && typeof t.content === "string" && typeof t.status === "string" && (t.activeForm === void 0 || typeof t.activeForm === "string")
|
|
2972
2988
|
);
|
|
2973
2989
|
} catch {
|
|
2974
2990
|
return null;
|