@bububuger/spanory 0.1.16 → 0.1.19
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/index.js +5143 -1594
- package/package.json +11 -7
- package/dist/alert/evaluate.d.ts +0 -3
- package/dist/alert/evaluate.js +0 -197
- package/dist/env.d.ts +0 -2
- package/dist/env.js +0 -54
- package/dist/issue/state.d.ts +0 -39
- package/dist/issue/state.js +0 -151
- package/dist/otlp.d.ts +0 -5
- package/dist/otlp.js +0 -12
- package/dist/report/aggregate.d.ts +0 -21
- package/dist/report/aggregate.js +0 -245
- package/dist/runtime/claude/adapter.d.ts +0 -18
- package/dist/runtime/claude/adapter.js +0 -222
- package/dist/runtime/codex/adapter.d.ts +0 -18
- package/dist/runtime/codex/adapter.js +0 -493
- package/dist/runtime/codex/proxy.d.ts +0 -9
- package/dist/runtime/codex/proxy.js +0 -212
- package/dist/runtime/openclaw/adapter.d.ts +0 -18
- package/dist/runtime/openclaw/adapter.js +0 -380
- package/dist/runtime/shared/capabilities.d.ts +0 -30
- package/dist/runtime/shared/capabilities.js +0 -39
- package/dist/runtime/shared/file-settle.d.ts +0 -19
- package/dist/runtime/shared/file-settle.js +0 -44
- package/dist/runtime/shared/normalize.d.ts +0 -9
- package/dist/runtime/shared/normalize.js +0 -644
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
type FileStat = {
|
|
2
|
-
mtimeMs: number;
|
|
3
|
-
};
|
|
4
|
-
type WaitForFileSettleOptions = {
|
|
5
|
-
filePath: string;
|
|
6
|
-
stableWindowMs?: number;
|
|
7
|
-
timeoutMs?: number;
|
|
8
|
-
pollMs?: number;
|
|
9
|
-
statFn?: (filePath: string) => Promise<FileStat>;
|
|
10
|
-
sleepFn?: (ms: number) => Promise<void>;
|
|
11
|
-
nowFn?: () => number;
|
|
12
|
-
};
|
|
13
|
-
type WaitForFileSettleResult = {
|
|
14
|
-
settled: boolean;
|
|
15
|
-
lastMtimeMs?: number;
|
|
16
|
-
waitedMs: number;
|
|
17
|
-
};
|
|
18
|
-
export declare function waitForFileMtimeToSettle(options: WaitForFileSettleOptions): Promise<WaitForFileSettleResult>;
|
|
19
|
-
export {};
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { stat } from 'node:fs/promises';
|
|
2
|
-
function sleep(ms) {
|
|
3
|
-
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
4
|
-
}
|
|
5
|
-
export async function waitForFileMtimeToSettle(options) {
|
|
6
|
-
const stableWindowMs = options.stableWindowMs ?? 400;
|
|
7
|
-
const timeoutMs = options.timeoutMs ?? 2500;
|
|
8
|
-
const pollMs = options.pollMs ?? 100;
|
|
9
|
-
const statFn = options.statFn ?? (async (filePath) => stat(filePath));
|
|
10
|
-
const sleepFn = options.sleepFn ?? sleep;
|
|
11
|
-
const nowFn = options.nowFn ?? Date.now;
|
|
12
|
-
const startedAt = nowFn();
|
|
13
|
-
const deadline = startedAt + timeoutMs;
|
|
14
|
-
let lastMtimeMs;
|
|
15
|
-
let unchangedSinceMs;
|
|
16
|
-
while (nowFn() <= deadline) {
|
|
17
|
-
const current = await statFn(options.filePath);
|
|
18
|
-
const mtimeMs = Number(current.mtimeMs);
|
|
19
|
-
if (lastMtimeMs === mtimeMs) {
|
|
20
|
-
if (unchangedSinceMs === undefined)
|
|
21
|
-
unchangedSinceMs = nowFn();
|
|
22
|
-
if (nowFn() - unchangedSinceMs >= stableWindowMs) {
|
|
23
|
-
return {
|
|
24
|
-
settled: true,
|
|
25
|
-
lastMtimeMs: mtimeMs,
|
|
26
|
-
waitedMs: nowFn() - startedAt,
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
else {
|
|
31
|
-
lastMtimeMs = mtimeMs;
|
|
32
|
-
unchangedSinceMs = undefined;
|
|
33
|
-
}
|
|
34
|
-
const remainingMs = deadline - nowFn();
|
|
35
|
-
if (remainingMs <= 0)
|
|
36
|
-
break;
|
|
37
|
-
await sleepFn(Math.min(pollMs, remainingMs));
|
|
38
|
-
}
|
|
39
|
-
return {
|
|
40
|
-
settled: false,
|
|
41
|
-
lastMtimeMs,
|
|
42
|
-
waitedMs: nowFn() - startedAt,
|
|
43
|
-
};
|
|
44
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export declare function pickUsage(raw: any): {};
|
|
2
|
-
export declare function groupByTurns(messages: any): any[];
|
|
3
|
-
export declare function normalizeTranscriptMessages({ runtime, projectId, sessionId, messages }: {
|
|
4
|
-
runtime: any;
|
|
5
|
-
projectId: any;
|
|
6
|
-
sessionId: any;
|
|
7
|
-
messages: any;
|
|
8
|
-
}): any[];
|
|
9
|
-
export declare function parseProjectIdFromTranscriptPath(transcriptPath: any, marker: any): any;
|