@llm4ts/runner 3.4.0 → 4.0.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/Connectors.d.ts +0 -6
- package/dist/Connectors.d.ts.map +1 -1
- package/dist/Connectors.js +0 -9
- package/dist/Connectors.js.map +1 -1
- package/dist/EventPresentation.d.ts.map +1 -1
- package/dist/EventPresentation.js +0 -1
- package/dist/EventPresentation.js.map +1 -1
- package/dist/FlowRunner.d.ts +10 -3
- package/dist/FlowRunner.d.ts.map +1 -1
- package/dist/FlowRunner.js +20 -2
- package/dist/FlowRunner.js.map +1 -1
- package/dist/NodeGeminiCliExecutor.d.ts.map +1 -1
- package/dist/NodeGeminiCliExecutor.js +1 -0
- package/dist/NodeGeminiCliExecutor.js.map +1 -1
- package/dist/NodeGeminiModelBridge.d.ts.map +1 -1
- package/dist/NodeGeminiModelBridge.js +1 -0
- package/dist/NodeGeminiModelBridge.js.map +1 -1
- package/dist/NodeHttpClient.d.ts.map +1 -1
- package/dist/NodeHttpClient.js +1 -0
- package/dist/NodeHttpClient.js.map +1 -1
- package/dist/Otel.d.ts.map +1 -1
- package/dist/Otel.js +1 -0
- package/dist/Otel.js.map +1 -1
- package/dist/Package.d.ts.map +1 -1
- package/dist/Package.js +1 -0
- package/dist/Package.js.map +1 -1
- package/dist/Terminal.d.ts +1 -2
- package/dist/Terminal.d.ts.map +1 -1
- package/dist/Terminal.js +1 -4
- package/dist/Terminal.js.map +1 -1
- package/dist/WindowsCommand.d.ts.map +1 -1
- package/dist/WindowsCommand.js +1 -0
- package/dist/WindowsCommand.js.map +1 -1
- package/dist/index.d.ts +1 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -2
- package/dist/index.js.map +1 -1
- package/package.json +8 -21
- package/src/Connectors.ts +0 -10
- package/src/EventPresentation.ts +0 -1
- package/src/FlowRunner.ts +26 -6
- package/src/NodeGeminiCliExecutor.ts +1 -0
- package/src/NodeGeminiModelBridge.ts +1 -0
- package/src/NodeHttpClient.ts +1 -0
- package/src/Otel.ts +1 -0
- package/src/Package.ts +1 -0
- package/src/Terminal.ts +1 -5
- package/src/WindowsCommand.ts +1 -0
- package/src/index.ts +0 -2
- package/dist/Costs.d.ts +0 -52
- package/dist/Costs.d.ts.map +0 -1
- package/dist/Costs.js +0 -95
- package/dist/Costs.js.map +0 -1
- package/dist/McpStdio.d.ts +0 -7
- package/dist/McpStdio.d.ts.map +0 -1
- package/dist/McpStdio.js +0 -19
- package/dist/McpStdio.js.map +0 -1
- package/dist/Profile.d.ts +0 -313
- package/dist/Profile.d.ts.map +0 -1
- package/dist/Profile.js +0 -937
- package/dist/Profile.js.map +0 -1
- package/dist/ReviewFingerprint.d.ts +0 -2
- package/dist/ReviewFingerprint.d.ts.map +0 -1
- package/dist/ReviewFingerprint.js +0 -13
- package/dist/ReviewFingerprint.js.map +0 -1
- package/dist/RunReaders.d.ts +0 -70
- package/dist/RunReaders.d.ts.map +0 -1
- package/dist/RunReaders.js +0 -236
- package/dist/RunReaders.js.map +0 -1
- package/dist/StoryReaders.d.ts +0 -16
- package/dist/StoryReaders.d.ts.map +0 -1
- package/dist/StoryReaders.js +0 -107
- package/dist/StoryReaders.js.map +0 -1
- package/dist/Watch.d.ts +0 -68
- package/dist/Watch.d.ts.map +0 -1
- package/dist/Watch.js +0 -261
- package/dist/Watch.js.map +0 -1
- package/src/Costs.ts +0 -148
- package/src/McpStdio.ts +0 -41
- package/src/Profile.ts +0 -1196
- package/src/ReviewFingerprint.ts +0 -13
- package/src/RunReaders.ts +0 -370
- package/src/StoryReaders.ts +0 -157
- package/src/Watch.ts +0 -446
package/dist/Costs.d.ts
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import type * as DateTime from "effect/DateTime";
|
|
2
|
-
import * as Effect from "effect/Effect";
|
|
3
|
-
import * as Schema from "effect/Schema";
|
|
4
|
-
import { CostReport } from "@llm4ts/flow/CostReport";
|
|
5
|
-
import type { PlainFileStoreShape } from "@llm4ts/flow/Persistence";
|
|
6
|
-
/**
|
|
7
|
-
* `llm4ts costs`: the budgeting view over every trace the runner wrote.
|
|
8
|
-
*
|
|
9
|
-
* Traces are the source for timing: a run can span hours and only the trace
|
|
10
|
-
* carries a timestamp per token report, which the hourly buckets need. The
|
|
11
|
-
* cost ledger is the source for each run's total: its line is the run's own
|
|
12
|
-
* summary, and a trace can be short (`CostReport.reconcileWithLedger`). One
|
|
13
|
-
* unreadable trace is reported and skipped rather than failing the whole
|
|
14
|
-
* report — the other runs still answer the question.
|
|
15
|
-
*/
|
|
16
|
-
export declare const TraceDirectoryName = ".llm4ts";
|
|
17
|
-
/** `trace-<timestamp>.jsonl` as the runner writes it, or a prefixed variant like `loop-trace-…`. */
|
|
18
|
-
export declare const isTraceFileName: (name: string) => boolean;
|
|
19
|
-
export declare const nodeListTraces: (directory: string) => ReadonlyArray<string>;
|
|
20
|
-
export interface CostsOptions {
|
|
21
|
-
/** Repositories whose `.llm4ts/` traces are read. */
|
|
22
|
-
readonly repos: ReadonlyArray<string>;
|
|
23
|
-
/** Drop token reports before this epoch millisecond. */
|
|
24
|
-
readonly since?: number;
|
|
25
|
-
readonly timeZone?: DateTime.TimeZone;
|
|
26
|
-
readonly runsPerDay?: number;
|
|
27
|
-
}
|
|
28
|
-
export interface CostsDependencies {
|
|
29
|
-
readonly files: PlainFileStoreShape;
|
|
30
|
-
/** Absolute trace paths under one `.llm4ts/` directory. */
|
|
31
|
-
readonly listTraces: (directory: string) => ReadonlyArray<string>;
|
|
32
|
-
}
|
|
33
|
-
export declare const nodeCostsDependencies: () => CostsDependencies;
|
|
34
|
-
declare const SkippedTrace_base: Schema.Class<SkippedTrace, Schema.Struct<{
|
|
35
|
-
readonly path: Schema.String;
|
|
36
|
-
readonly reason: Schema.String;
|
|
37
|
-
}>, {}>;
|
|
38
|
-
export declare class SkippedTrace extends SkippedTrace_base {
|
|
39
|
-
}
|
|
40
|
-
declare const CostsResult_base: Schema.Class<CostsResult, Schema.Struct<{
|
|
41
|
-
readonly report: typeof CostReport;
|
|
42
|
-
readonly traces: Schema.Int;
|
|
43
|
-
readonly skipped: Schema.$Array<typeof SkippedTrace>;
|
|
44
|
-
/** Runs whose trace was short or missing, completed from their cost ledger line. */
|
|
45
|
-
readonly ledgerRuns: Schema.withDecodingDefaultKey<Schema.withConstructorDefault<Schema.$Array<Schema.String>>, never>;
|
|
46
|
-
}>, {}>;
|
|
47
|
-
export declare class CostsResult extends CostsResult_base {
|
|
48
|
-
}
|
|
49
|
-
export declare const makeCostsProgram: (options: CostsOptions, dependencies?: CostsDependencies | undefined) => Effect.Effect<CostsResult, never, never>;
|
|
50
|
-
export declare const renderCostsResult: (result: CostsResult) => string;
|
|
51
|
-
export {};
|
|
52
|
-
//# sourceMappingURL=Costs.d.ts.map
|
package/dist/Costs.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Costs.d.ts","sourceRoot":"","sources":["../src/Costs.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,QAAQ,MAAM,iBAAiB,CAAA;AAChD,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AAEvC,OAAO,EACL,UAAU,EAMX,MAAM,yBAAyB,CAAA;AAEhC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAInE;;;;;;;;;GASG;AAEH,eAAO,MAAM,kBAAkB,YAAY,CAAA;AAE3C,oGAAoG;AACpG,eAAO,MAAM,eAAe,GAAI,MAAM,MAAM,KAAG,OAAiD,CAAA;AAEhG,eAAO,MAAM,cAAc,GAAI,WAAW,MAAM,KAAG,aAAa,CAAC,MAAM,CAM/D,CAAA;AAER,MAAM,WAAW,YAAY;IAC3B,qDAAqD;IACrD,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC,MAAM,CAAC,CAAA;IACrC,wDAAwD;IACxD,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC,QAAQ,CAAA;IACrC,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAC7B;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,KAAK,EAAE,mBAAmB,CAAA;IACnC,2DAA2D;IAC3D,QAAQ,CAAC,UAAU,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,aAAa,CAAC,MAAM,CAAC,CAAA;CAClE;AAED,eAAO,MAAM,qBAAqB,QAAO,iBAGvC,CAAA;;;;;AAEF,qBAAa,YAAa,SAAQ,iBAGhC;CAAG;;;;;IAMH,oFAAoF;;;AAJtF,qBAAa,WAAY,SAAQ,gBAS/B;CAAG;AAEL,eAAO,MAAM,gBAAgB,mHAgD3B,CAAA;AAEF,eAAO,MAAM,iBAAiB,GAAI,QAAQ,WAAW,KAAG,MAkBvD,CAAA"}
|
package/dist/Costs.js
DELETED
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
import { existsSync, readdirSync } from "node:fs";
|
|
2
|
-
import { join } from "node:path";
|
|
3
|
-
import * as Effect from "effect/Effect";
|
|
4
|
-
import * as Schema from "effect/Schema";
|
|
5
|
-
import { CostLedgerFileName, loadCostLedger } from "@llm4ts/flow/CostLedger";
|
|
6
|
-
import { CostReport, buildCostReport, reconcileWithLedger, renderCostReport, usageSamplesFromTrace } from "@llm4ts/flow/CostReport";
|
|
7
|
-
import { describeFlowError } from "@llm4ts/flow/FlowError";
|
|
8
|
-
import { readTrace } from "@llm4ts/flow/Replay";
|
|
9
|
-
import { nodePlainFileStore } from "./NodePlainFileStore.js";
|
|
10
|
-
/**
|
|
11
|
-
* `llm4ts costs`: the budgeting view over every trace the runner wrote.
|
|
12
|
-
*
|
|
13
|
-
* Traces are the source for timing: a run can span hours and only the trace
|
|
14
|
-
* carries a timestamp per token report, which the hourly buckets need. The
|
|
15
|
-
* cost ledger is the source for each run's total: its line is the run's own
|
|
16
|
-
* summary, and a trace can be short (`CostReport.reconcileWithLedger`). One
|
|
17
|
-
* unreadable trace is reported and skipped rather than failing the whole
|
|
18
|
-
* report — the other runs still answer the question.
|
|
19
|
-
*/
|
|
20
|
-
export const TraceDirectoryName = ".llm4ts";
|
|
21
|
-
/** `trace-<timestamp>.jsonl` as the runner writes it, or a prefixed variant like `loop-trace-…`. */
|
|
22
|
-
export const isTraceFileName = (name) => /(?:^|-)trace-\d+\.jsonl$/u.test(name);
|
|
23
|
-
export const nodeListTraces = (directory) => existsSync(directory)
|
|
24
|
-
? readdirSync(directory)
|
|
25
|
-
.filter(isTraceFileName)
|
|
26
|
-
.sort()
|
|
27
|
-
.map((name) => join(directory, name))
|
|
28
|
-
: [];
|
|
29
|
-
export const nodeCostsDependencies = () => ({
|
|
30
|
-
files: nodePlainFileStore,
|
|
31
|
-
listTraces: nodeListTraces
|
|
32
|
-
});
|
|
33
|
-
export class SkippedTrace extends Schema.Class("SkippedTrace")({
|
|
34
|
-
path: Schema.String,
|
|
35
|
-
reason: Schema.String
|
|
36
|
-
}) {
|
|
37
|
-
}
|
|
38
|
-
export class CostsResult extends Schema.Class("CostsResult")({
|
|
39
|
-
report: CostReport,
|
|
40
|
-
traces: Schema.Int,
|
|
41
|
-
skipped: Schema.Array(SkippedTrace),
|
|
42
|
-
/** Runs whose trace was short or missing, completed from their cost ledger line. */
|
|
43
|
-
ledgerRuns: Schema.Array(Schema.String).pipe(Schema.withConstructorDefault(Effect.succeed([])), Schema.withDecodingDefaultKey(Effect.succeed([])))
|
|
44
|
-
}) {
|
|
45
|
-
}
|
|
46
|
-
export const makeCostsProgram = Effect.fn("@llm4ts/runner/Costs.make")(function* (options, dependencies = nodeCostsDependencies()) {
|
|
47
|
-
const paths = options.repos.flatMap((repo) => dependencies.listTraces(join(repo, TraceDirectoryName)));
|
|
48
|
-
const skipped = [];
|
|
49
|
-
const traced = [];
|
|
50
|
-
for (const path of paths) {
|
|
51
|
-
const lines = yield* readTrace(dependencies.files, path).pipe(Effect.catch((error) => Effect.sync(() => {
|
|
52
|
-
skipped.push(SkippedTrace.make({ path, reason: describeFlowError(error) }));
|
|
53
|
-
return [];
|
|
54
|
-
})));
|
|
55
|
-
traced.push(...usageSamplesFromTrace(lines));
|
|
56
|
-
}
|
|
57
|
-
// An unreadable ledger is no ledger: the traces still answer, uncorrected.
|
|
58
|
-
const records = [];
|
|
59
|
-
for (const repo of options.repos) {
|
|
60
|
-
const path = join(repo, TraceDirectoryName, CostLedgerFileName);
|
|
61
|
-
records.push(...(yield* loadCostLedger(dependencies.files, path).pipe(Effect.catch((error) => Effect.sync(() => {
|
|
62
|
-
skipped.push(SkippedTrace.make({ path, reason: describeFlowError(error) }));
|
|
63
|
-
return [];
|
|
64
|
-
})))));
|
|
65
|
-
}
|
|
66
|
-
const reconciled = reconcileWithLedger(traced, records);
|
|
67
|
-
const samples = reconciled.samples.filter((sample) => options.since === undefined || sample.at >= options.since);
|
|
68
|
-
return CostsResult.make({
|
|
69
|
-
report: buildCostReport(samples, {
|
|
70
|
-
...(options.timeZone === undefined ? {} : { timeZone: options.timeZone }),
|
|
71
|
-
...(options.runsPerDay === undefined ? {} : { runsPerDay: options.runsPerDay })
|
|
72
|
-
}),
|
|
73
|
-
traces: paths.length,
|
|
74
|
-
skipped,
|
|
75
|
-
ledgerRuns: reconciled.filledRuns
|
|
76
|
-
});
|
|
77
|
-
});
|
|
78
|
-
export const renderCostsResult = (result) => {
|
|
79
|
-
const skipped = result.skipped.length === 0
|
|
80
|
-
? []
|
|
81
|
-
: ["", ...result.skipped.map((entry) => `skipped ${entry.path}: ${entry.reason}`)];
|
|
82
|
-
const ledger = result.ledgerRuns.length === 0
|
|
83
|
-
? []
|
|
84
|
-
: [
|
|
85
|
-
`${result.ledgerRuns.length} run${result.ledgerRuns.length === 1 ? "" : "s"} completed from the cost ledger (trace short or missing, remainder at the run's start): ${result.ledgerRuns.join(", ")}`
|
|
86
|
-
];
|
|
87
|
-
return [
|
|
88
|
-
renderCostReport(result.report),
|
|
89
|
-
"",
|
|
90
|
-
`traces read: ${result.traces - result.skipped.length} of ${result.traces}`,
|
|
91
|
-
...ledger,
|
|
92
|
-
...skipped
|
|
93
|
-
].join("\n");
|
|
94
|
-
};
|
|
95
|
-
//# sourceMappingURL=Costs.js.map
|
package/dist/Costs.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Costs.js","sourceRoot":"","sources":["../src/Costs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AACjD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAEhC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAmB,MAAM,yBAAyB,CAAA;AAC7F,OAAO,EACL,UAAU,EACV,eAAe,EACf,mBAAmB,EACnB,gBAAgB,EAChB,qBAAqB,EAEtB,MAAM,yBAAyB,CAAA;AAChC,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAE1D,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAE5D;;;;;;;;;GASG;AAEH,MAAM,CAAC,MAAM,kBAAkB,GAAG,SAAS,CAAA;AAE3C,oGAAoG;AACpG,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,IAAY,EAAW,EAAE,CAAC,2BAA2B,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AAEhG,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,SAAiB,EAAyB,EAAE,CACzE,UAAU,CAAC,SAAS,CAAC;IACnB,CAAC,CAAC,WAAW,CAAC,SAAS,CAAC;SACnB,MAAM,CAAC,eAAe,CAAC;SACvB,IAAI,EAAE;SACN,G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,EAAE,CAAC,CAAC,CAAC,GAAG,2FAA2F,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;SACrM,CAAA;IACP,OAAO;QACL,gBAAgB,CAAC,MAAM,CAAC,MAAM,CAAC;QAC/B,EAAE;QACF,gBAAgB,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,OAAO,MAAM,CAAC,MAAM,EAAE;QAC3E,GAAG,MAAM;QACT,GAAG,OAAO;KACX,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AACd,CAAC,CAAA"}
|
package/dist/McpStdio.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import * as Effect from "effect/Effect";
|
|
2
|
-
import * as Stream from "effect/Stream";
|
|
3
|
-
import { type FlowError } from "@llm4ts/flow/FlowError";
|
|
4
|
-
import { type McpTool } from "@llm4ts/flow/McpServer";
|
|
5
|
-
export declare const mcpStdioResponses: <R>(lines: Stream.Stream<string, FlowError, R>, tools: ReadonlyArray<McpTool>) => Stream.Stream<string, FlowError, R>;
|
|
6
|
-
export declare const runMcpStdio: (tools: ReadonlyArray<McpTool>, write?: (line: string) => void) => Effect.Effect<void, FlowError>;
|
|
7
|
-
//# sourceMappingURL=McpStdio.d.ts.map
|
package/dist/McpStdio.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"McpStdio.d.ts","sourceRoot":"","sources":["../src/McpStdio.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,EAAgB,KAAK,SAAS,EAAE,MAAM,wBAAwB,CAAA;AACrE,OAAO,EAAiB,KAAK,OAAO,EAAE,MAAM,wBAAwB,CAAA;AAEpE,eAAO,MAAM,iBAAiB,GAAI,CAAC,EACjC,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC,EAC1C,OAAO,aAAa,CAAC,OAAO,CAAC,KAC5B,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,EAAE,CAAC,CAIlC,CAAA;AAEH,eAAO,MAAM,WAAW,GACtB,OAAO,aAAa,CAAC,OAAO,CAAC,EAC7B,QAAO,CAAC,IAAI,EAAE,MAAM,KAAK,IAA0C,KAClE,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,SAAS,CAqB7B,CAAA"}
|
package/dist/McpStdio.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { createInterface } from "node:readline";
|
|
2
|
-
import { stdin, stdout } from "node:process";
|
|
3
|
-
import * as Effect from "effect/Effect";
|
|
4
|
-
import * as Stream from "effect/Stream";
|
|
5
|
-
import { ProcessError } from "@llm4ts/flow/FlowError";
|
|
6
|
-
import { handleMcpLine } from "@llm4ts/flow/McpServer";
|
|
7
|
-
export const mcpStdioResponses = (lines, tools) => lines.pipe(Stream.mapEffect((line) => handleMcpLine(line, tools)), Stream.filter((response) => response !== undefined));
|
|
8
|
-
export const runMcpStdio = (tools, write = (line) => stdout.write(`${line}\n`)) => Effect.acquireUseRelease(Effect.sync(() => createInterface({
|
|
9
|
-
input: stdin,
|
|
10
|
-
crlfDelay: Infinity,
|
|
11
|
-
terminal: false
|
|
12
|
-
})), (input) => {
|
|
13
|
-
const lines = Stream.fromAsyncIterable(input, (error) => ProcessError.make({
|
|
14
|
-
message: "MCP stdio input",
|
|
15
|
-
detail: error instanceof Error ? error.message : String(error)
|
|
16
|
-
}));
|
|
17
|
-
return mcpStdioResponses(lines, tools).pipe(Stream.runForEach((line) => Effect.sync(() => write(line))));
|
|
18
|
-
}, (input) => Effect.sync(() => input.close()));
|
|
19
|
-
//# sourceMappingURL=McpStdio.js.map
|
package/dist/McpStdio.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"McpStdio.js","sourceRoot":"","sources":["../src/McpStdio.ts"],"names":[],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D,CAAC,CACH,CAAA;IACD,OAAO,iBAAiB,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,IAAI,CACzC,MAAM,CAAC,UAAU,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAC5D,CAAA;AACH,CAAC,EACD,CAAC,KAAK,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC,CAC5C,CAAA"}
|
package/dist/Profile.d.ts
DELETED
|
@@ -1,313 +0,0 @@
|
|
|
1
|
-
import * as Effect from "effect/Effect";
|
|
2
|
-
import * as Schema from "effect/Schema";
|
|
3
|
-
import { duration, type TreeInput } from "./AgentTree.ts";
|
|
4
|
-
export { duration };
|
|
5
|
-
import { WatchTargetMissing, type TraceChoice, type TraceSources } from "./Watch.ts";
|
|
6
|
-
export declare const ProfileTime: Schema.Struct<{
|
|
7
|
-
readonly model: Schema.Number;
|
|
8
|
-
readonly tools: Schema.Number;
|
|
9
|
-
readonly gates: Schema.Number;
|
|
10
|
-
readonly merge: Schema.Number;
|
|
11
|
-
readonly waiting: Schema.Number;
|
|
12
|
-
readonly unaccounted: Schema.Number;
|
|
13
|
-
}>;
|
|
14
|
-
export type ProfileTime = typeof ProfileTime.Type;
|
|
15
|
-
export declare const TurnStats: Schema.Struct<{
|
|
16
|
-
readonly count: Schema.Int;
|
|
17
|
-
readonly avgMs: Schema.Number;
|
|
18
|
-
readonly maxMs: Schema.Number;
|
|
19
|
-
readonly firstPrompt: Schema.optionalKey<Schema.Int>;
|
|
20
|
-
readonly lastPrompt: Schema.optionalKey<Schema.Int>;
|
|
21
|
-
readonly maxPrompt: Schema.optionalKey<Schema.Int>;
|
|
22
|
-
/** The last prompt is more than three times the first. */
|
|
23
|
-
readonly promptGrowth: Schema.Boolean;
|
|
24
|
-
/** Tool calls per finished turn: each is a model round trip. */
|
|
25
|
-
readonly avgSteps: Schema.Number;
|
|
26
|
-
/** The model's own time per round trip: a turn's time less its tools, over its steps + 1. */
|
|
27
|
-
readonly avgStepMs: Schema.Number;
|
|
28
|
-
}>;
|
|
29
|
-
export type TurnStats = typeof TurnStats.Type;
|
|
30
|
-
/** A stretch of a story's time no `Timed` event covers, named by the events around it. */
|
|
31
|
-
export declare const Gap: Schema.Struct<{
|
|
32
|
-
readonly ms: Schema.Number;
|
|
33
|
-
readonly after: Schema.String;
|
|
34
|
-
readonly before: Schema.String;
|
|
35
|
-
}>;
|
|
36
|
-
export type Gap = typeof Gap.Type;
|
|
37
|
-
/**
|
|
38
|
-
* The coder's tool calls by kind of work (build, install and git count as
|
|
39
|
-
* other). `script` is the ad-hoc Python/Node one-liners, heredocs and scratch
|
|
40
|
-
* files it improvised; profiles saved before it existed decode it as 0.
|
|
41
|
-
*/
|
|
42
|
-
export declare const ToolCalls: Schema.Struct<{
|
|
43
|
-
readonly explore: Schema.Int;
|
|
44
|
-
readonly edit: Schema.Int;
|
|
45
|
-
readonly test: Schema.Int;
|
|
46
|
-
readonly script: Schema.withDecodingDefaultKey<Schema.Int, never>;
|
|
47
|
-
readonly other: Schema.Int;
|
|
48
|
-
}>;
|
|
49
|
-
export type ToolCalls = typeof ToolCalls.Type;
|
|
50
|
-
export declare const StoryProfile: Schema.Struct<{
|
|
51
|
-
readonly id: Schema.String;
|
|
52
|
-
/** What the lane stands for when it is not a story: a roundtable attendee, a taskforce specialist. */
|
|
53
|
-
readonly kind: Schema.optionalKey<Schema.Literals<readonly ["story", "attendee", "specialist"]>>;
|
|
54
|
-
readonly executor: Schema.optionalKey<Schema.String>;
|
|
55
|
-
readonly status: Schema.Literals<readonly ["done", "failed", "running"]>;
|
|
56
|
-
readonly wallMs: Schema.Number;
|
|
57
|
-
/** From the plan being ready to this story starting: dependencies and free coder slots. */
|
|
58
|
-
readonly queuedMs: Schema.optionalKey<Schema.Number>;
|
|
59
|
-
readonly time: Schema.Struct<{
|
|
60
|
-
readonly model: Schema.Number;
|
|
61
|
-
readonly tools: Schema.Number;
|
|
62
|
-
readonly gates: Schema.Number;
|
|
63
|
-
readonly merge: Schema.Number;
|
|
64
|
-
readonly waiting: Schema.Number;
|
|
65
|
-
readonly unaccounted: Schema.Number;
|
|
66
|
-
}>;
|
|
67
|
-
readonly turns: Schema.Struct<{
|
|
68
|
-
readonly count: Schema.Int;
|
|
69
|
-
readonly avgMs: Schema.Number;
|
|
70
|
-
readonly maxMs: Schema.Number;
|
|
71
|
-
readonly firstPrompt: Schema.optionalKey<Schema.Int>;
|
|
72
|
-
readonly lastPrompt: Schema.optionalKey<Schema.Int>;
|
|
73
|
-
readonly maxPrompt: Schema.optionalKey<Schema.Int>;
|
|
74
|
-
/** The last prompt is more than three times the first. */
|
|
75
|
-
readonly promptGrowth: Schema.Boolean;
|
|
76
|
-
/** Tool calls per finished turn: each is a model round trip. */
|
|
77
|
-
readonly avgSteps: Schema.Number;
|
|
78
|
-
/** The model's own time per round trip: a turn's time less its tools, over its steps + 1. */
|
|
79
|
-
readonly avgStepMs: Schema.Number;
|
|
80
|
-
}>;
|
|
81
|
-
/** Its largest untimed stretches, 30 seconds or more: where "unaccounted" sits. */
|
|
82
|
-
readonly gaps: Schema.$Array<Schema.Struct<{
|
|
83
|
-
readonly ms: Schema.Number;
|
|
84
|
-
readonly after: Schema.String;
|
|
85
|
-
readonly before: Schema.String;
|
|
86
|
-
}>>;
|
|
87
|
-
/**
|
|
88
|
-
* A coder turn the trace shows working (tool calls after its last finished
|
|
89
|
-
* call) but not ended: a run still going. Counted as model time so far.
|
|
90
|
-
*/
|
|
91
|
-
readonly openTurnMs: Schema.Number;
|
|
92
|
-
readonly openTurnTools: Schema.Int;
|
|
93
|
-
readonly toolCalls: Schema.Struct<{
|
|
94
|
-
readonly explore: Schema.Int;
|
|
95
|
-
readonly edit: Schema.Int;
|
|
96
|
-
readonly test: Schema.Int;
|
|
97
|
-
readonly script: Schema.withDecodingDefaultKey<Schema.Int, never>;
|
|
98
|
-
readonly other: Schema.Int;
|
|
99
|
-
}>;
|
|
100
|
-
/** Task stages the coder ran on this lane: the tasks it gave itself, plus any revision. */
|
|
101
|
-
readonly tasks: Schema.Int;
|
|
102
|
-
/** From the coder's first task (after setup and planning) to its first edit; absent when it never edited. */
|
|
103
|
-
readonly firstEditMs: Schema.optionalKey<Schema.Number>;
|
|
104
|
-
/** Explore calls (ls, find, grep, read) made before that first edit. */
|
|
105
|
-
readonly exploreBeforeEdit: Schema.Int;
|
|
106
|
-
/** Commands the coder's Findings claimed to have run that no tool call carried (ADR 0027). */
|
|
107
|
-
readonly unverifiedClaims: Schema.Int;
|
|
108
|
-
/** Tasks whose Findings said `confidence: low`. */
|
|
109
|
-
readonly lowConfidenceTasks: Schema.Int;
|
|
110
|
-
/** The largest diff its reviewers read in one round, in lines (ADR 0044). */
|
|
111
|
-
readonly reviewDiffLines: Schema.optionalKey<Schema.Int>;
|
|
112
|
-
}>;
|
|
113
|
-
export type StoryProfile = typeof StoryProfile.Type;
|
|
114
|
-
export declare const ModelRow: Schema.Struct<{
|
|
115
|
-
readonly role: Schema.String;
|
|
116
|
-
readonly executor: Schema.optionalKey<Schema.String>;
|
|
117
|
-
readonly calls: Schema.Int;
|
|
118
|
-
readonly ms: Schema.Number;
|
|
119
|
-
readonly avgMs: Schema.Number;
|
|
120
|
-
readonly avgFirstMs: Schema.optionalKey<Schema.Number>;
|
|
121
|
-
/** As the backend reported them. */
|
|
122
|
-
readonly apiMs: Schema.optionalKey<Schema.Number>;
|
|
123
|
-
readonly toolMs: Schema.optionalKey<Schema.Number>;
|
|
124
|
-
}>;
|
|
125
|
-
export type ModelRow = typeof ModelRow.Type;
|
|
126
|
-
export declare const GateRow: Schema.Struct<{
|
|
127
|
-
readonly command: Schema.String;
|
|
128
|
-
readonly runs: Schema.Int;
|
|
129
|
-
readonly ms: Schema.Number;
|
|
130
|
-
readonly avgMs: Schema.Number;
|
|
131
|
-
readonly failed: Schema.Int;
|
|
132
|
-
}>;
|
|
133
|
-
export type GateRow = typeof GateRow.Type;
|
|
134
|
-
export declare const CountRow: Schema.Struct<{
|
|
135
|
-
readonly label: Schema.String;
|
|
136
|
-
readonly count: Schema.Int;
|
|
137
|
-
readonly ms: Schema.Number;
|
|
138
|
-
}>;
|
|
139
|
-
export type CountRow = typeof CountRow.Type;
|
|
140
|
-
export declare const Finding: Schema.Struct<{
|
|
141
|
-
readonly text: Schema.String;
|
|
142
|
-
readonly ms: Schema.optionalKey<Schema.Number>;
|
|
143
|
-
}>;
|
|
144
|
-
export type Finding = typeof Finding.Type;
|
|
145
|
-
export declare const ProfileReport: Schema.Struct<{
|
|
146
|
-
/** No `Timed` events: model time is estimated from gaps, the rest is unknown. */
|
|
147
|
-
readonly estimated: Schema.Boolean;
|
|
148
|
-
readonly wallMs: Schema.Number;
|
|
149
|
-
readonly stories: Schema.$Array<Schema.Struct<{
|
|
150
|
-
readonly id: Schema.String;
|
|
151
|
-
/** What the lane stands for when it is not a story: a roundtable attendee, a taskforce specialist. */
|
|
152
|
-
readonly kind: Schema.optionalKey<Schema.Literals<readonly ["story", "attendee", "specialist"]>>;
|
|
153
|
-
readonly executor: Schema.optionalKey<Schema.String>;
|
|
154
|
-
readonly status: Schema.Literals<readonly ["done", "failed", "running"]>;
|
|
155
|
-
readonly wallMs: Schema.Number;
|
|
156
|
-
/** From the plan being ready to this story starting: dependencies and free coder slots. */
|
|
157
|
-
readonly queuedMs: Schema.optionalKey<Schema.Number>;
|
|
158
|
-
readonly time: Schema.Struct<{
|
|
159
|
-
readonly model: Schema.Number;
|
|
160
|
-
readonly tools: Schema.Number;
|
|
161
|
-
readonly gates: Schema.Number;
|
|
162
|
-
readonly merge: Schema.Number;
|
|
163
|
-
readonly waiting: Schema.Number;
|
|
164
|
-
readonly unaccounted: Schema.Number;
|
|
165
|
-
}>;
|
|
166
|
-
readonly turns: Schema.Struct<{
|
|
167
|
-
readonly count: Schema.Int;
|
|
168
|
-
readonly avgMs: Schema.Number;
|
|
169
|
-
readonly maxMs: Schema.Number;
|
|
170
|
-
readonly firstPrompt: Schema.optionalKey<Schema.Int>;
|
|
171
|
-
readonly lastPrompt: Schema.optionalKey<Schema.Int>;
|
|
172
|
-
readonly maxPrompt: Schema.optionalKey<Schema.Int>;
|
|
173
|
-
/** The last prompt is more than three times the first. */
|
|
174
|
-
readonly promptGrowth: Schema.Boolean;
|
|
175
|
-
/** Tool calls per finished turn: each is a model round trip. */
|
|
176
|
-
readonly avgSteps: Schema.Number;
|
|
177
|
-
/** The model's own time per round trip: a turn's time less its tools, over its steps + 1. */
|
|
178
|
-
readonly avgStepMs: Schema.Number;
|
|
179
|
-
}>;
|
|
180
|
-
/** Its largest untimed stretches, 30 seconds or more: where "unaccounted" sits. */
|
|
181
|
-
readonly gaps: Schema.$Array<Schema.Struct<{
|
|
182
|
-
readonly ms: Schema.Number;
|
|
183
|
-
readonly after: Schema.String;
|
|
184
|
-
readonly before: Schema.String;
|
|
185
|
-
}>>;
|
|
186
|
-
/**
|
|
187
|
-
* A coder turn the trace shows working (tool calls after its last finished
|
|
188
|
-
* call) but not ended: a run still going. Counted as model time so far.
|
|
189
|
-
*/
|
|
190
|
-
readonly openTurnMs: Schema.Number;
|
|
191
|
-
readonly openTurnTools: Schema.Int;
|
|
192
|
-
readonly toolCalls: Schema.Struct<{
|
|
193
|
-
readonly explore: Schema.Int;
|
|
194
|
-
readonly edit: Schema.Int;
|
|
195
|
-
readonly test: Schema.Int;
|
|
196
|
-
readonly script: Schema.withDecodingDefaultKey<Schema.Int, never>;
|
|
197
|
-
readonly other: Schema.Int;
|
|
198
|
-
}>;
|
|
199
|
-
/** Task stages the coder ran on this lane: the tasks it gave itself, plus any revision. */
|
|
200
|
-
readonly tasks: Schema.Int;
|
|
201
|
-
/** From the coder's first task (after setup and planning) to its first edit; absent when it never edited. */
|
|
202
|
-
readonly firstEditMs: Schema.optionalKey<Schema.Number>;
|
|
203
|
-
/** Explore calls (ls, find, grep, read) made before that first edit. */
|
|
204
|
-
readonly exploreBeforeEdit: Schema.Int;
|
|
205
|
-
/** Commands the coder's Findings claimed to have run that no tool call carried (ADR 0027). */
|
|
206
|
-
readonly unverifiedClaims: Schema.Int;
|
|
207
|
-
/** Tasks whose Findings said `confidence: low`. */
|
|
208
|
-
readonly lowConfidenceTasks: Schema.Int;
|
|
209
|
-
/** The largest diff its reviewers read in one round, in lines (ADR 0044). */
|
|
210
|
-
readonly reviewDiffLines: Schema.optionalKey<Schema.Int>;
|
|
211
|
-
}>>;
|
|
212
|
-
/** Stories merged on an earlier run: this run only skipped them. */
|
|
213
|
-
readonly skipped: Schema.$Array<Schema.String>;
|
|
214
|
-
readonly totals: Schema.Struct<{
|
|
215
|
-
readonly model: Schema.Number;
|
|
216
|
-
readonly tools: Schema.Number;
|
|
217
|
-
readonly gates: Schema.Number;
|
|
218
|
-
readonly merge: Schema.Number;
|
|
219
|
-
readonly waiting: Schema.Number;
|
|
220
|
-
readonly unaccounted: Schema.Number;
|
|
221
|
-
}>;
|
|
222
|
-
readonly models: Schema.$Array<Schema.Struct<{
|
|
223
|
-
readonly role: Schema.String;
|
|
224
|
-
readonly executor: Schema.optionalKey<Schema.String>;
|
|
225
|
-
readonly calls: Schema.Int;
|
|
226
|
-
readonly ms: Schema.Number;
|
|
227
|
-
readonly avgMs: Schema.Number;
|
|
228
|
-
readonly avgFirstMs: Schema.optionalKey<Schema.Number>;
|
|
229
|
-
/** As the backend reported them. */
|
|
230
|
-
readonly apiMs: Schema.optionalKey<Schema.Number>;
|
|
231
|
-
readonly toolMs: Schema.optionalKey<Schema.Number>;
|
|
232
|
-
}>>;
|
|
233
|
-
readonly gates: Schema.$Array<Schema.Struct<{
|
|
234
|
-
readonly command: Schema.String;
|
|
235
|
-
readonly runs: Schema.Int;
|
|
236
|
-
readonly ms: Schema.Number;
|
|
237
|
-
readonly avgMs: Schema.Number;
|
|
238
|
-
readonly failed: Schema.Int;
|
|
239
|
-
}>>;
|
|
240
|
-
readonly tools: Schema.$Array<Schema.Struct<{
|
|
241
|
-
readonly label: Schema.String;
|
|
242
|
-
readonly count: Schema.Int;
|
|
243
|
-
readonly ms: Schema.Number;
|
|
244
|
-
}>>;
|
|
245
|
-
/** Coder tool time by kind of work: explore, edit, test, script, build, install, git, other. */
|
|
246
|
-
readonly toolCategories: Schema.$Array<Schema.Struct<{
|
|
247
|
-
readonly label: Schema.String;
|
|
248
|
-
readonly count: Schema.Int;
|
|
249
|
-
readonly ms: Schema.Number;
|
|
250
|
-
}>>;
|
|
251
|
-
readonly waits: Schema.$Array<Schema.Struct<{
|
|
252
|
-
readonly label: Schema.String;
|
|
253
|
-
readonly count: Schema.Int;
|
|
254
|
-
readonly ms: Schema.Number;
|
|
255
|
-
}>>;
|
|
256
|
-
/** Timed on the run's events, in no story: the run's own planning, or a seat no story owns. */
|
|
257
|
-
readonly outside: Schema.$Array<Schema.Struct<{
|
|
258
|
-
readonly label: Schema.String;
|
|
259
|
-
readonly count: Schema.Int;
|
|
260
|
-
readonly ms: Schema.Number;
|
|
261
|
-
}>>;
|
|
262
|
-
readonly findings: Schema.$Array<Schema.Struct<{
|
|
263
|
-
readonly text: Schema.String;
|
|
264
|
-
readonly ms: Schema.optionalKey<Schema.Number>;
|
|
265
|
-
}>>;
|
|
266
|
-
}>;
|
|
267
|
-
export type ProfileReport = typeof ProfileReport.Type;
|
|
268
|
-
export declare const profileOf: (inputs: ReadonlyArray<TreeInput>) => ProfileReport;
|
|
269
|
-
export declare const renderProfile: (report: ProfileReport) => string;
|
|
270
|
-
/** One line of a before/after comparison (ADR 0029): a count or a duration. */
|
|
271
|
-
export declare const DeltaRow: Schema.Struct<{
|
|
272
|
-
readonly label: Schema.String;
|
|
273
|
-
readonly before: Schema.Number;
|
|
274
|
-
readonly after: Schema.Number;
|
|
275
|
-
readonly unit: Schema.Literals<readonly ["count", "ms"]>;
|
|
276
|
-
/** Which direction is better, for the arrow; `none` for neutral facts. */
|
|
277
|
-
readonly better: Schema.Literals<readonly ["lower", "higher", "none"]>;
|
|
278
|
-
}>;
|
|
279
|
-
export type DeltaRow = typeof DeltaRow.Type;
|
|
280
|
-
export declare const ProfileDelta: Schema.Struct<{
|
|
281
|
-
readonly rows: Schema.$Array<Schema.Struct<{
|
|
282
|
-
readonly label: Schema.String;
|
|
283
|
-
readonly before: Schema.Number;
|
|
284
|
-
readonly after: Schema.Number;
|
|
285
|
-
readonly unit: Schema.Literals<readonly ["count", "ms"]>;
|
|
286
|
-
/** Which direction is better, for the arrow; `none` for neutral facts. */
|
|
287
|
-
readonly better: Schema.Literals<readonly ["lower", "higher", "none"]>;
|
|
288
|
-
}>>;
|
|
289
|
-
}>;
|
|
290
|
-
export type ProfileDelta = typeof ProfileDelta.Type;
|
|
291
|
-
/**
|
|
292
|
-
* The harness-evals comparison (`docs/harness-evals/README.md`), in its
|
|
293
|
-
* order: how much the coders explored before editing, how often review and
|
|
294
|
-
* judgment were called, what the gates said, how honest the claims were,
|
|
295
|
-
* then where the time went. Tokens and cost are `llm4ts costs`' business.
|
|
296
|
-
*/
|
|
297
|
-
export declare const profileDelta: (before: ProfileReport, after: ProfileReport) => ProfileDelta;
|
|
298
|
-
export declare const renderProfileDelta: (delta: ProfileDelta, labels: {
|
|
299
|
-
readonly before: string;
|
|
300
|
-
readonly after: string;
|
|
301
|
-
}) => string;
|
|
302
|
-
export interface ProfileOptions extends TraceChoice {
|
|
303
|
-
readonly json?: boolean;
|
|
304
|
-
/** A trace, or a `--json` report saved earlier, to compare the profiled run against (ADR 0029). */
|
|
305
|
-
readonly against?: string;
|
|
306
|
-
}
|
|
307
|
-
/**
|
|
308
|
-
* The report for a trace, an epic's latest run, or the newest trace: text,
|
|
309
|
-
* or JSON for comparing runs; with `against`, the delta from that earlier
|
|
310
|
-
* run to this one.
|
|
311
|
-
*/
|
|
312
|
-
export declare const makeProfileProgram: (options: ProfileOptions, sources: TraceSources) => Effect.Effect<string, import("@llm4ts/flow/FlowError").PersistenceError | import("@llm4ts/flow/FlowError").PlanParseError | import("@llm4ts/flow/FlowError").UnsupportedSchemaVersion | import("@llm4ts/flow/FlowError").WorkspacePathError | import("@llm4ts/flow/FlowError").WorkspaceLimitError | import("@llm4ts/flow/FlowError").WorkspaceIoError | import("@llm4ts/flow/FlowError").FlowAborted | import("@llm4ts/flow/FlowError").ProcessError | import("@llm4ts/flow/FlowError").FlowLlmError | import("@llm4ts/flow/FlowError").FlowCapabilityDenied | import("@llm4ts/flow/FlowError").ColumnNotFound | import("@llm4ts/flow/FlowError").BudgetExceeded | import("@llm4ts/flow/FlowError").StoryPlanInvalid | import("@llm4ts/flow/FlowError").PerimeterViolation | import("@llm4ts/flow/FlowError").MissingDependency | import("@llm4ts/flow/FlowError").MergeConflict | import("@llm4ts/flow/FlowError").EpicCheckoutDirty | import("@llm4ts/flow/FlowError").RosterExhausted | import("@llm4ts/flow/FlowError").RosterInvalid | import("@llm4ts/flow/FlowError").EpicIncomplete | import("@llm4ts/flow/FlowError").LandingFailed | import("@llm4ts/flow/FlowError").StoryFailed | import("@llm4ts/flow/FlowError").Stalled | import("@llm4ts/flow/FlowError").DecisionsInvalid | import("@llm4ts/flow/FlowError").OpenPointsPending | import("@llm4ts/flow/FlowError").ContractConflict | import("@llm4ts/flow/FlowError").ExtractPackMissing | import("@llm4ts/flow/FlowError").EpicBriefInvalid | import("@llm4ts/flow/FlowError").EpicBriefNotApproved | import("@llm4ts/flow/FlowError").RefineRefused | import("@llm4ts/flow/FlowError").PersonaInvalid | import("@llm4ts/flow/FlowError").MeetingInvalid | import("@llm4ts/flow/FlowError").TurnsInvalid | import("@llm4ts/flow/FlowError").AgendaPending | import("@llm4ts/flow/FlowError").PlanInvalid | import("@llm4ts/flow/FlowError").ReportInvalid | import("@llm4ts/flow/FlowError").PlanPending | WatchTargetMissing, never>;
|
|
313
|
-
//# sourceMappingURL=Profile.d.ts.map
|
package/dist/Profile.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":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