@vitest-agent/sdk 1.3.4 → 2.0.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/errors/DataStoreError.js +22 -13
- package/index.d.ts +1032 -1101
- package/index.js +3 -3
- package/layers/ConfigLive.js +8 -9
- package/layers/DataReaderLive.js +2 -2
- package/layers/DataStoreLive.js +2 -2
- package/layers/DiscoveryRegistryLive.js +1 -1
- package/layers/LoggerLive.js +24 -24
- package/layers/PathResolutionLive.js +18 -17
- package/layers/PerClientSessionMapLive.js +1 -1
- package/layers/ProjectDiscoveryLive.js +1 -2
- package/layers/ProjectIdentityLive.js +16 -12
- package/layers/RunContextLive.js +20 -20
- package/migrations/0001_initial.js +1 -1
- package/migrations/registry_0001_initial.js +1 -1
- package/migrations/session_map_0001_initial.js +1 -1
- package/package.json +18 -18
- package/schemas/AgentReport.js +6 -9
- package/schemas/Baselines.js +3 -3
- package/schemas/CacheManifest.js +2 -2
- package/schemas/ChannelEvent.js +30 -3
- package/schemas/Common.js +76 -14
- package/schemas/ConsoleLeaks.js +2 -2
- package/schemas/Coverage.js +8 -8
- package/schemas/CoverageTargets.js +16 -10
- package/schemas/History.js +4 -4
- package/schemas/Identity.js +19 -7
- package/schemas/Options.js +3 -3
- package/schemas/RenderState.js +26 -19
- package/schemas/RunEvent.js +154 -115
- package/schemas/Tdd.js +16 -6
- package/schemas/Thresholds.js +6 -6
- package/schemas/Transport.js +1 -1
- package/schemas/Trends.js +7 -3
- package/schemas/turns/FileEditPayload.js +5 -1
- package/schemas/turns/HookFirePayload.js +15 -1
- package/schemas/turns/index.js +9 -1
- package/services/Config.js +3 -3
- package/services/DataReader.js +1 -1
- package/services/DataStore.js +1 -1
- package/services/DetailResolver.js +1 -1
- package/services/DiscoveryRegistry.js +1 -1
- package/services/EnvironmentDetector.js +1 -1
- package/services/ExecutorResolver.js +1 -1
- package/services/FormatSelector.js +1 -1
- package/services/HistoryTracker.js +1 -1
- package/services/OutputRenderer.js +1 -1
- package/services/PerClientSessionMap.js +2 -2
- package/services/ProjectDiscovery.js +1 -1
- package/services/ProjectIdentity.js +1 -1
- package/services/RunContext.js +1 -1
- package/testing/layers.js +2 -2
- package/testing.d.ts +312 -332
- package/tsdoc-metadata.json +1 -1
- package/utils/build-report.js +16 -1
- package/utils/ensure-migrated.js +3 -3
- package/utils/resolve-data-path.js +3 -3
- package/utils/resolve-workspace-key.js +11 -6
package/errors/DataStoreError.js
CHANGED
|
@@ -19,24 +19,33 @@ var DataStoreError = class extends Data.TaggedError("DataStoreError") {
|
|
|
19
19
|
/**
|
|
20
20
|
* Extract a human-readable reason string from an Effect SqlError or unknown error.
|
|
21
21
|
*
|
|
22
|
-
* SqlError wraps the underlying
|
|
23
|
-
* message (e.g. "SQLITE_BUSY: database is locked", "UNIQUE constraint
|
|
24
|
-
* lives on
|
|
25
|
-
* ("Failed to execute statement").
|
|
22
|
+
* SqlError wraps the underlying `node:sqlite` driver error in `cause`. The actual
|
|
23
|
+
* SQLite message (e.g. "SQLITE_BUSY: database is locked", "UNIQUE constraint
|
|
24
|
+
* failed: ...") lives on the DEEPEST node in the `cause` chain, while the outer
|
|
25
|
+
* `message`s are generic ("Failed to execute statement"). The v4 driver commonly
|
|
26
|
+
* nests two such wrappers, so the real reason sits at `cause.cause.message` — we
|
|
27
|
+
* walk the full chain and return the deepest non-empty message. Guarded against
|
|
28
|
+
* circular `cause` references.
|
|
26
29
|
* @public
|
|
27
30
|
*/
|
|
28
31
|
const extractSqlReason = (e) => {
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
const seen = /* @__PURE__ */ new Set();
|
|
33
|
+
let best;
|
|
34
|
+
let node = e;
|
|
35
|
+
while (node && typeof node === "object" && !seen.has(node)) {
|
|
36
|
+
seen.add(node);
|
|
37
|
+
const n = node;
|
|
38
|
+
if (typeof n.message === "string" && n.message.length > 0) best = n.message;
|
|
39
|
+
if (typeof n.cause === "string") {
|
|
40
|
+
if (n.cause.length > 0) best = n.cause;
|
|
41
|
+
break;
|
|
34
42
|
}
|
|
35
|
-
|
|
36
|
-
try {
|
|
37
|
-
return JSON.stringify(e);
|
|
38
|
-
} catch {}
|
|
43
|
+
node = n.cause;
|
|
39
44
|
}
|
|
45
|
+
if (best !== void 0) return best;
|
|
46
|
+
if (e && typeof e === "object") try {
|
|
47
|
+
return JSON.stringify(e);
|
|
48
|
+
} catch {}
|
|
40
49
|
return String(e);
|
|
41
50
|
};
|
|
42
51
|
|