gateproof 0.2.4 → 0.5.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/README.md +1447 -153
- package/dist/cloudflare/index.d.ts +4 -6
- package/dist/cloudflare/index.d.ts.map +1 -1
- package/dist/cloudflare/index.js +9 -43
- package/dist/cloudflare/index.js.map +1 -1
- package/dist/index.d.ts +263 -75
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1327 -212
- package/dist/index.js.map +1 -1
- package/package.json +18 -48
- package/dist/act.d.ts +0 -78
- package/dist/act.d.ts.map +0 -1
- package/dist/act.js +0 -47
- package/dist/act.js.map +0 -1
- package/dist/action-executors.d.ts +0 -39
- package/dist/action-executors.d.ts.map +0 -1
- package/dist/action-executors.js +0 -195
- package/dist/action-executors.js.map +0 -1
- package/dist/assert.d.ts +0 -59
- package/dist/assert.d.ts.map +0 -1
- package/dist/assert.js +0 -120
- package/dist/assert.js.map +0 -1
- package/dist/authority.d.ts +0 -34
- package/dist/authority.d.ts.map +0 -1
- package/dist/authority.js +0 -141
- package/dist/authority.js.map +0 -1
- package/dist/cli/gateproof.d.ts +0 -3
- package/dist/cli/gateproof.d.ts.map +0 -1
- package/dist/cli/gateproof.js +0 -548
- package/dist/cli/gateproof.js.map +0 -1
- package/dist/cloudflare/analytics.d.ts +0 -9
- package/dist/cloudflare/analytics.d.ts.map +0 -1
- package/dist/cloudflare/analytics.js +0 -98
- package/dist/cloudflare/analytics.js.map +0 -1
- package/dist/cloudflare/cli-stream.d.ts +0 -7
- package/dist/cloudflare/cli-stream.d.ts.map +0 -1
- package/dist/cloudflare/cli-stream.js +0 -85
- package/dist/cloudflare/cli-stream.js.map +0 -1
- package/dist/cloudflare/polling-backend.d.ts +0 -18
- package/dist/cloudflare/polling-backend.d.ts.map +0 -1
- package/dist/cloudflare/polling-backend.js +0 -53
- package/dist/cloudflare/polling-backend.js.map +0 -1
- package/dist/cloudflare/workers-logs.d.ts +0 -9
- package/dist/cloudflare/workers-logs.d.ts.map +0 -1
- package/dist/cloudflare/workers-logs.js +0 -51
- package/dist/cloudflare/workers-logs.js.map +0 -1
- package/dist/constants.d.ts +0 -11
- package/dist/constants.d.ts.map +0 -1
- package/dist/constants.js +0 -11
- package/dist/constants.js.map +0 -1
- package/dist/filepath-backend.d.ts +0 -64
- package/dist/filepath-backend.d.ts.map +0 -1
- package/dist/filepath-backend.js +0 -126
- package/dist/filepath-backend.js.map +0 -1
- package/dist/filepath-protocol.d.ts +0 -214
- package/dist/filepath-protocol.d.ts.map +0 -1
- package/dist/filepath-protocol.js +0 -239
- package/dist/filepath-protocol.js.map +0 -1
- package/dist/filepath-runtime.d.ts +0 -100
- package/dist/filepath-runtime.d.ts.map +0 -1
- package/dist/filepath-runtime.js +0 -190
- package/dist/filepath-runtime.js.map +0 -1
- package/dist/http-backend.d.ts +0 -32
- package/dist/http-backend.d.ts.map +0 -1
- package/dist/http-backend.js +0 -166
- package/dist/http-backend.js.map +0 -1
- package/dist/observe.d.ts +0 -26
- package/dist/observe.d.ts.map +0 -1
- package/dist/observe.js +0 -84
- package/dist/observe.js.map +0 -1
- package/dist/prd/define-prd.d.ts +0 -7
- package/dist/prd/define-prd.d.ts.map +0 -1
- package/dist/prd/define-prd.js +0 -8
- package/dist/prd/define-prd.js.map +0 -1
- package/dist/prd/index.d.ts +0 -7
- package/dist/prd/index.d.ts.map +0 -1
- package/dist/prd/index.js +0 -8
- package/dist/prd/index.js.map +0 -1
- package/dist/prd/loop.d.ts +0 -160
- package/dist/prd/loop.d.ts.map +0 -1
- package/dist/prd/loop.js +0 -462
- package/dist/prd/loop.js.map +0 -1
- package/dist/prd/runner.d.ts +0 -19
- package/dist/prd/runner.d.ts.map +0 -1
- package/dist/prd/runner.js +0 -253
- package/dist/prd/runner.js.map +0 -1
- package/dist/prd/scope-check.d.ts +0 -28
- package/dist/prd/scope-check.d.ts.map +0 -1
- package/dist/prd/scope-check.js +0 -135
- package/dist/prd/scope-check.js.map +0 -1
- package/dist/prd/scope-defaults.d.ts +0 -75
- package/dist/prd/scope-defaults.d.ts.map +0 -1
- package/dist/prd/scope-defaults.js +0 -235
- package/dist/prd/scope-defaults.js.map +0 -1
- package/dist/prd/types.d.ts +0 -101
- package/dist/prd/types.d.ts.map +0 -1
- package/dist/prd/types.js +0 -2
- package/dist/prd/types.js.map +0 -1
- package/dist/provider.d.ts +0 -6
- package/dist/provider.d.ts.map +0 -1
- package/dist/provider.js +0 -2
- package/dist/provider.js.map +0 -1
- package/dist/report.d.ts +0 -137
- package/dist/report.d.ts.map +0 -1
- package/dist/report.js +0 -234
- package/dist/report.js.map +0 -1
- package/dist/test-helpers.d.ts +0 -12
- package/dist/test-helpers.d.ts.map +0 -1
- package/dist/test-helpers.js +0 -33
- package/dist/test-helpers.js.map +0 -1
- package/dist/types.d.ts +0 -41
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -2
- package/dist/types.js.map +0 -1
- package/dist/utils.d.ts +0 -22
- package/dist/utils.d.ts.map +0 -1
- package/dist/utils.js +0 -49
- package/dist/utils.js.map +0 -1
- package/dist/validation.d.ts +0 -6
- package/dist/validation.d.ts.map +0 -1
- package/dist/validation.js +0 -38
- package/dist/validation.js.map +0 -1
package/dist/filepath-runtime.js
DELETED
|
@@ -1,190 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Cloudflare Sandbox Runtime — real FilepathRuntime for Cloudflare Workers
|
|
3
|
-
*
|
|
4
|
-
* Spawns agent processes inside Cloudflare Sandbox containers,
|
|
5
|
-
* wires NDJSON stdout to a broadcast AsyncIterable (solving the
|
|
6
|
-
* dual-reader problem), and maps stdin/stop to the sandbox process.
|
|
7
|
-
*
|
|
8
|
-
* Usage:
|
|
9
|
-
* ```ts
|
|
10
|
-
* import { getSandbox } from "@cloudflare/sandbox";
|
|
11
|
-
* import { CloudflareSandboxRuntime, setFilepathRuntime } from "gateproof";
|
|
12
|
-
*
|
|
13
|
-
* setFilepathRuntime(new CloudflareSandboxRuntime({
|
|
14
|
-
* getSandbox: (config) => getSandbox(env.Sandbox, `agent-${config.name}-${Date.now()}`),
|
|
15
|
-
* }));
|
|
16
|
-
* ```
|
|
17
|
-
*/
|
|
18
|
-
/**
|
|
19
|
-
* A broadcast AsyncIterable that supports multiple concurrent readers.
|
|
20
|
-
*
|
|
21
|
-
* Each call to `[Symbol.asyncIterator]()` returns an independent iterator
|
|
22
|
-
* that starts from the beginning of the buffer and sees all items,
|
|
23
|
-
* including those pushed after the iterator was created.
|
|
24
|
-
*
|
|
25
|
-
* This solves the dual-reader problem: both the executor (lifecycle drain)
|
|
26
|
-
* and observe layer (log mapping) can read from the same `container.stdout`
|
|
27
|
-
* without interfering with each other.
|
|
28
|
-
*/
|
|
29
|
-
export class BroadcastIterable {
|
|
30
|
-
buffer = [];
|
|
31
|
-
waiters = new Set();
|
|
32
|
-
isDone = false;
|
|
33
|
-
push(item) {
|
|
34
|
-
this.buffer.push(item);
|
|
35
|
-
for (const waiter of this.waiters)
|
|
36
|
-
waiter();
|
|
37
|
-
this.waiters.clear();
|
|
38
|
-
}
|
|
39
|
-
end() {
|
|
40
|
-
this.isDone = true;
|
|
41
|
-
for (const waiter of this.waiters)
|
|
42
|
-
waiter();
|
|
43
|
-
this.waiters.clear();
|
|
44
|
-
}
|
|
45
|
-
[Symbol.asyncIterator]() {
|
|
46
|
-
let index = 0;
|
|
47
|
-
const self = this;
|
|
48
|
-
return {
|
|
49
|
-
next() {
|
|
50
|
-
if (index < self.buffer.length) {
|
|
51
|
-
return Promise.resolve({ value: self.buffer[index++], done: false });
|
|
52
|
-
}
|
|
53
|
-
if (self.isDone) {
|
|
54
|
-
return Promise.resolve({ value: undefined, done: true });
|
|
55
|
-
}
|
|
56
|
-
return new Promise((resolve) => {
|
|
57
|
-
const check = () => {
|
|
58
|
-
if (index < self.buffer.length) {
|
|
59
|
-
resolve({ value: self.buffer[index++], done: false });
|
|
60
|
-
}
|
|
61
|
-
else if (self.isDone) {
|
|
62
|
-
resolve({ value: undefined, done: true });
|
|
63
|
-
}
|
|
64
|
-
else {
|
|
65
|
-
self.waiters.add(check);
|
|
66
|
-
}
|
|
67
|
-
};
|
|
68
|
-
check();
|
|
69
|
-
});
|
|
70
|
-
},
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* Reads a `ReadableStream<Uint8Array>` and pushes complete NDJSON lines
|
|
76
|
-
* to a `BroadcastIterable<string>`.
|
|
77
|
-
*
|
|
78
|
-
* Handles:
|
|
79
|
-
* - Partial line buffering (chunks may split across line boundaries)
|
|
80
|
-
* - Stream completion (signals `end()` on the broadcast)
|
|
81
|
-
* - Stream errors (signals `end()` so readers don't hang)
|
|
82
|
-
*/
|
|
83
|
-
export async function pipeReadableStreamToLines(stream, broadcast) {
|
|
84
|
-
const reader = stream.getReader();
|
|
85
|
-
const decoder = new TextDecoder();
|
|
86
|
-
let buffer = "";
|
|
87
|
-
try {
|
|
88
|
-
while (true) {
|
|
89
|
-
const { value, done } = await reader.read();
|
|
90
|
-
if (done)
|
|
91
|
-
break;
|
|
92
|
-
buffer += decoder.decode(value, { stream: true });
|
|
93
|
-
const lines = buffer.split("\n");
|
|
94
|
-
// Last element is incomplete (or empty if buffer ended with \n)
|
|
95
|
-
buffer = lines.pop();
|
|
96
|
-
for (const line of lines) {
|
|
97
|
-
if (line.length > 0) {
|
|
98
|
-
broadcast.push(line);
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
// Flush any remaining partial line
|
|
103
|
-
const remaining = buffer + decoder.decode();
|
|
104
|
-
if (remaining.length > 0) {
|
|
105
|
-
broadcast.push(remaining);
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
finally {
|
|
109
|
-
broadcast.end();
|
|
110
|
-
reader.releaseLock();
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
/**
|
|
114
|
-
* Builds the environment variables for the sandbox process.
|
|
115
|
-
*/
|
|
116
|
-
function buildEnv(config) {
|
|
117
|
-
return {
|
|
118
|
-
FILEPATH_TASK: config.task,
|
|
119
|
-
FILEPATH_AGENT_TYPE: config.agent,
|
|
120
|
-
FILEPATH_MODEL: config.model,
|
|
121
|
-
FILEPATH_WORKSPACE: "/workspace",
|
|
122
|
-
...config.env,
|
|
123
|
-
};
|
|
124
|
-
}
|
|
125
|
-
/**
|
|
126
|
-
* Real FilepathRuntime backed by Cloudflare Sandbox.
|
|
127
|
-
*
|
|
128
|
-
* Spawns agent processes inside isolated Cloudflare Sandbox containers.
|
|
129
|
-
* Stdout is parsed as NDJSON lines and exposed as a broadcast
|
|
130
|
-
* `AsyncIterable<string>` so both the executor and observe layer
|
|
131
|
-
* can read concurrently.
|
|
132
|
-
*/
|
|
133
|
-
export class CloudflareSandboxRuntime {
|
|
134
|
-
options;
|
|
135
|
-
constructor(options) {
|
|
136
|
-
this.options = options;
|
|
137
|
-
}
|
|
138
|
-
async spawn(config) {
|
|
139
|
-
const sandbox = await this.options.getSandbox(config);
|
|
140
|
-
const command = this.options.command
|
|
141
|
-
? this.options.command(config)
|
|
142
|
-
: [config.agent];
|
|
143
|
-
const env = buildEnv(config);
|
|
144
|
-
const proc = await sandbox.startProcess(command, {
|
|
145
|
-
env,
|
|
146
|
-
cwd: "/workspace",
|
|
147
|
-
});
|
|
148
|
-
const broadcast = new BroadcastIterable();
|
|
149
|
-
// Start piping stdout → broadcast in the background.
|
|
150
|
-
// Errors are swallowed — the broadcast just ends, and readers
|
|
151
|
-
// see the stream close (which the executor treats as container exit).
|
|
152
|
-
pipeReadableStreamToLines(proc.stdout, broadcast).catch(() => {
|
|
153
|
-
broadcast.end();
|
|
154
|
-
});
|
|
155
|
-
const encoder = new TextEncoder();
|
|
156
|
-
return {
|
|
157
|
-
stdout: broadcast,
|
|
158
|
-
async sendInput(line) {
|
|
159
|
-
if (!proc.stdin) {
|
|
160
|
-
throw new Error("Container stdin is not available");
|
|
161
|
-
}
|
|
162
|
-
const writer = proc.stdin.getWriter();
|
|
163
|
-
try {
|
|
164
|
-
await writer.write(encoder.encode(line + "\n"));
|
|
165
|
-
}
|
|
166
|
-
finally {
|
|
167
|
-
writer.releaseLock();
|
|
168
|
-
}
|
|
169
|
-
},
|
|
170
|
-
async stop() {
|
|
171
|
-
// Signal the agent to stop via stdin, then close streams.
|
|
172
|
-
// Cloudflare Sandbox doesn't expose SIGTERM — closing stdin
|
|
173
|
-
// is the convention for requesting graceful shutdown.
|
|
174
|
-
if (proc.stdin) {
|
|
175
|
-
try {
|
|
176
|
-
const writer = proc.stdin.getWriter();
|
|
177
|
-
await writer.write(encoder.encode(JSON.stringify({ type: "signal", action: "stop" }) + "\n"));
|
|
178
|
-
writer.releaseLock();
|
|
179
|
-
await proc.stdin.close();
|
|
180
|
-
}
|
|
181
|
-
catch {
|
|
182
|
-
// stdin may already be closed
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
broadcast.end();
|
|
186
|
-
},
|
|
187
|
-
};
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
//# sourceMappingURL=filepath-runtime.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"filepath-runtime.js","sourceRoot":"","sources":["../src/filepath-runtime.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AA+CH;;;;;;;;;;GAUG;AACH,MAAM,OAAO,iBAAiB;IACpB,MAAM,GAAQ,EAAE,CAAC;IACjB,OAAO,GAAoB,IAAI,GAAG,EAAE,CAAC;IACrC,MAAM,GAAG,KAAK,CAAC;IAEvB,IAAI,CAAC,IAAO;QACV,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACvB,KAAK,MAAM,MAAM,IAAI,IAAI,CAAC,OAAO;YAAE,MAAM,EAAE,CAAC;QAC5C,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;IACvB,CAAC;IAED,GAAG;QACD,IAAI,CAAC,MAAM,GAAG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KAAK,CAAC,kCAAkC,CAAC,CAAC;gBACtD,CAAC;gBACD,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE,CAAC;gBACtC,IAAI,CAAC;oBACH,MAAM,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC;gBAClD,CAAC;wBAAS,CAAC;oBACT,MAAM,CAAC,WAAW,EAAE,CAAC;gBACvB,CAAC;YACH,CAAC;YAED,KAAK,CAAC,IAAI;gBACR,0DAA0D;gBAC1D,4DAA4D;gBAC5D,sDAAsD;gBACtD,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;oBACf,IAAI,CAAC;wBACH,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE,CAAC;wBACtC,MAAM,MAAM,CAAC,KAAK,CAChB,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,GAAG,IAAI,CAAC,CAC1E,CAAC;wBACF,MAAM,CAAC,WAAW,EAAE,CAAC;wBACrB,MAAM,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;oBAC3B,CAAC;oBAAC,MAAM,CAAC;wBACP,8BAA8B;oBAChC,CAAC;gBACH,CAAC;gBACD,SAAS,CAAC,GAAG,EAAE,CAAC;YAClB,CAAC;SACF,CAAC;IACJ,CAAC;CACF"}
|
package/dist/http-backend.d.ts
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { type ObserveResource } from "./observe";
|
|
2
|
-
export interface HttpObserveConfig {
|
|
3
|
-
url: string;
|
|
4
|
-
method?: string;
|
|
5
|
-
headers?: Record<string, string>;
|
|
6
|
-
body?: string;
|
|
7
|
-
pollInterval?: number;
|
|
8
|
-
/**
|
|
9
|
-
* Request timeout in milliseconds. Defaults to 5000.
|
|
10
|
-
*/
|
|
11
|
-
timeoutMs?: number;
|
|
12
|
-
/**
|
|
13
|
-
* Maximum allowed response size in bytes. Defaults to 10MB.
|
|
14
|
-
* If Content-Length exceeds this, the body is not read and an error log is emitted instead.
|
|
15
|
-
*/
|
|
16
|
-
maxResponseSizeBytes?: number;
|
|
17
|
-
/**
|
|
18
|
-
* Max retries per poll on transient network errors (default: 2).
|
|
19
|
-
* Uses exponential backoff: 500ms, 1s, 2s.
|
|
20
|
-
*/
|
|
21
|
-
maxRetries?: number;
|
|
22
|
-
/**
|
|
23
|
-
* Consecutive failures before the circuit breaker opens and slows polling (default: 5).
|
|
24
|
-
*/
|
|
25
|
-
circuitBreakerThreshold?: number;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Creates an observe resource that polls an HTTP endpoint and captures responses as logs.
|
|
29
|
-
* This gives agents visibility into what the endpoint is returning.
|
|
30
|
-
*/
|
|
31
|
-
export declare function createHttpObserveResource(config: HttpObserveConfig): ObserveResource;
|
|
32
|
-
//# sourceMappingURL=http-backend.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"http-backend.d.ts","sourceRoot":"","sources":["../src/http-backend.ts"],"names":[],"mappings":"AAEA,OAAO,EAA4B,KAAK,eAAe,EAAE,MAAM,WAAW,CAAC;AAO3E,MAAM,WAAW,iBAAiB;IAChC,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,uBAAuB,CAAC,EAAE,MAAM,CAAC;CAClC;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,iBAAiB,GAAG,eAAe,CAoMpF"}
|
package/dist/http-backend.js
DELETED
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
import { Effect, Queue } from "effect";
|
|
2
|
-
import { createLogStreamFromQueue } from "./observe";
|
|
3
|
-
import { HTTP_DEFAULT_POLL_INTERVAL_MS, HTTP_DEFAULT_TIMEOUT_MS, HTTP_MAX_RESPONSE_SIZE_BYTES } from "./constants";
|
|
4
|
-
/**
|
|
5
|
-
* Creates an observe resource that polls an HTTP endpoint and captures responses as logs.
|
|
6
|
-
* This gives agents visibility into what the endpoint is returning.
|
|
7
|
-
*/
|
|
8
|
-
export function createHttpObserveResource(config) {
|
|
9
|
-
let queue = null;
|
|
10
|
-
let stopped = false;
|
|
11
|
-
let pollTimer = null;
|
|
12
|
-
const maxRetries = config.maxRetries ?? 2;
|
|
13
|
-
const circuitBreakerThreshold = config.circuitBreakerThreshold ?? 5;
|
|
14
|
-
const baseInterval = config.pollInterval ?? HTTP_DEFAULT_POLL_INTERVAL_MS;
|
|
15
|
-
let consecutiveFailures = 0;
|
|
16
|
-
let circuitOpen = false;
|
|
17
|
-
const fetchOnce = async (timeoutMs) => {
|
|
18
|
-
return fetch(config.url, {
|
|
19
|
-
method: config.method || "GET",
|
|
20
|
-
headers: config.headers,
|
|
21
|
-
body: config.body,
|
|
22
|
-
signal: AbortSignal.timeout(timeoutMs),
|
|
23
|
-
});
|
|
24
|
-
};
|
|
25
|
-
const fetchWithRetry = async (timeoutMs) => {
|
|
26
|
-
let lastError;
|
|
27
|
-
for (let attempt = 0; attempt <= maxRetries; attempt++) {
|
|
28
|
-
try {
|
|
29
|
-
return await fetchOnce(timeoutMs);
|
|
30
|
-
}
|
|
31
|
-
catch (err) {
|
|
32
|
-
lastError = err;
|
|
33
|
-
if (attempt < maxRetries) {
|
|
34
|
-
const backoffMs = 500 * Math.pow(2, attempt); // 500ms, 1s, 2s
|
|
35
|
-
await new Promise((r) => setTimeout(r, backoffMs));
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
throw lastError;
|
|
40
|
-
};
|
|
41
|
-
const poll = async () => {
|
|
42
|
-
if (stopped || !queue)
|
|
43
|
-
return;
|
|
44
|
-
const startTime = Date.now();
|
|
45
|
-
const requestId = crypto.randomUUID();
|
|
46
|
-
const timeoutMs = config.timeoutMs ?? HTTP_DEFAULT_TIMEOUT_MS;
|
|
47
|
-
const maxResponseSizeBytes = config.maxResponseSizeBytes ?? HTTP_MAX_RESPONSE_SIZE_BYTES;
|
|
48
|
-
try {
|
|
49
|
-
const response = await fetchWithRetry(timeoutMs);
|
|
50
|
-
// Reset circuit breaker on success; restore normal interval if recovering
|
|
51
|
-
if (circuitOpen && pollTimer) {
|
|
52
|
-
clearInterval(pollTimer);
|
|
53
|
-
pollTimer = setInterval(() => poll(), baseInterval);
|
|
54
|
-
circuitOpen = false;
|
|
55
|
-
}
|
|
56
|
-
consecutiveFailures = 0;
|
|
57
|
-
const durationMs = Date.now() - startTime;
|
|
58
|
-
const contentType = response.headers.get("content-type") || "";
|
|
59
|
-
let body = null;
|
|
60
|
-
const contentLengthHeader = response.headers.get("content-length");
|
|
61
|
-
const contentLength = contentLengthHeader ? Number(contentLengthHeader) : undefined;
|
|
62
|
-
if (typeof contentLength === "number" && !Number.isNaN(contentLength) && contentLength > maxResponseSizeBytes) {
|
|
63
|
-
const log = {
|
|
64
|
-
requestId,
|
|
65
|
-
timestamp: new Date().toISOString(),
|
|
66
|
-
stage: "http",
|
|
67
|
-
action: `${config.method || "GET"} ${config.url}`,
|
|
68
|
-
status: "error",
|
|
69
|
-
durationMs,
|
|
70
|
-
error: {
|
|
71
|
-
tag: "HttpResponseTooLarge",
|
|
72
|
-
message: `Response size ${contentLength} exceeds limit ${maxResponseSizeBytes}`,
|
|
73
|
-
},
|
|
74
|
-
};
|
|
75
|
-
await Effect.runPromise(Queue.offer(queue, log).pipe(Effect.tapError((error) => Effect.logError("Failed to enqueue HTTP size-limit log", error)), Effect.catchAll(() => Effect.void)));
|
|
76
|
-
return;
|
|
77
|
-
}
|
|
78
|
-
if (contentType.includes("application/json")) {
|
|
79
|
-
body = await response.json().catch(() => null);
|
|
80
|
-
}
|
|
81
|
-
else {
|
|
82
|
-
body = await response.text().catch(() => null);
|
|
83
|
-
}
|
|
84
|
-
const log = {
|
|
85
|
-
requestId,
|
|
86
|
-
timestamp: new Date().toISOString(),
|
|
87
|
-
stage: "http",
|
|
88
|
-
action: `${config.method || "GET"} ${config.url}`,
|
|
89
|
-
status: response.ok ? "success" : "error",
|
|
90
|
-
durationMs,
|
|
91
|
-
data: {
|
|
92
|
-
statusCode: response.status,
|
|
93
|
-
statusText: response.statusText,
|
|
94
|
-
contentType,
|
|
95
|
-
body,
|
|
96
|
-
headers: Object.fromEntries(response.headers.entries()),
|
|
97
|
-
},
|
|
98
|
-
};
|
|
99
|
-
await Effect.runPromise(Queue.offer(queue, log).pipe(Effect.tapError((error) => Effect.logError("Failed to enqueue HTTP log", error)), Effect.catchAll(() => Effect.void)));
|
|
100
|
-
}
|
|
101
|
-
catch (unknownError) {
|
|
102
|
-
consecutiveFailures++;
|
|
103
|
-
const error = unknownError instanceof Error ? unknownError : new Error(String(unknownError));
|
|
104
|
-
const durationMs = Date.now() - startTime;
|
|
105
|
-
const isCircuitOpen = consecutiveFailures >= circuitBreakerThreshold;
|
|
106
|
-
const log = {
|
|
107
|
-
requestId,
|
|
108
|
-
timestamp: new Date().toISOString(),
|
|
109
|
-
stage: "http",
|
|
110
|
-
action: `${config.method || "GET"} ${config.url}`,
|
|
111
|
-
status: "error",
|
|
112
|
-
durationMs,
|
|
113
|
-
error: {
|
|
114
|
-
tag: isCircuitOpen ? "HttpCircuitOpen" : (error.name || "HttpError"),
|
|
115
|
-
message: isCircuitOpen
|
|
116
|
-
? `${consecutiveFailures} consecutive failures, backing off: ${error.message}`
|
|
117
|
-
: (error.message || String(error)),
|
|
118
|
-
stack: error.stack,
|
|
119
|
-
},
|
|
120
|
-
};
|
|
121
|
-
await Effect.runPromise(Queue.offer(queue, log).pipe(Effect.tapError((enqueueError) => Effect.logError("Failed to enqueue HTTP error log", enqueueError)), Effect.catchAll(() => Effect.void)));
|
|
122
|
-
// Circuit breaker: reschedule at a slower rate
|
|
123
|
-
if (isCircuitOpen && !circuitOpen && pollTimer) {
|
|
124
|
-
clearInterval(pollTimer);
|
|
125
|
-
pollTimer = setInterval(() => poll(), baseInterval * 5);
|
|
126
|
-
circuitOpen = true;
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
};
|
|
130
|
-
return {
|
|
131
|
-
start() {
|
|
132
|
-
return Effect.gen(function* () {
|
|
133
|
-
stopped = false;
|
|
134
|
-
consecutiveFailures = 0;
|
|
135
|
-
queue = yield* Queue.bounded(1000);
|
|
136
|
-
// Initial poll
|
|
137
|
-
yield* Effect.promise(() => poll());
|
|
138
|
-
// Start polling loop
|
|
139
|
-
const interval = config.pollInterval ?? HTTP_DEFAULT_POLL_INTERVAL_MS;
|
|
140
|
-
pollTimer = setInterval(() => poll(), interval);
|
|
141
|
-
return createLogStreamFromQueue(queue);
|
|
142
|
-
});
|
|
143
|
-
},
|
|
144
|
-
stop() {
|
|
145
|
-
return Effect.gen(function* () {
|
|
146
|
-
stopped = true;
|
|
147
|
-
if (pollTimer) {
|
|
148
|
-
clearInterval(pollTimer);
|
|
149
|
-
pollTimer = null;
|
|
150
|
-
}
|
|
151
|
-
});
|
|
152
|
-
},
|
|
153
|
-
/**
|
|
154
|
-
* Query historical logs.
|
|
155
|
-
*
|
|
156
|
-
* Note: HTTP backend is forward-only and does not maintain historical logs.
|
|
157
|
-
* This method always returns an empty array because HTTP polling only captures
|
|
158
|
-
* logs as they arrive in real-time. For querying historical logs, use a backend
|
|
159
|
-
* that supports log storage (e.g., Cloudflare Analytics Engine).
|
|
160
|
-
*/
|
|
161
|
-
query(_filter) {
|
|
162
|
-
return Effect.succeed([]);
|
|
163
|
-
},
|
|
164
|
-
};
|
|
165
|
-
}
|
|
166
|
-
//# sourceMappingURL=http-backend.js.map
|
package/dist/http-backend.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"http-backend.js","sourceRoot":"","sources":["../src/http-backend.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAEvC,OAAO,EAAE,wBAAwB,EAAwB,MAAM,WAAW,CAAC;AAC3E,OAAO,EACL,6BAA6B,EAC7B,uBAAuB,EACvB,4BAA4B,EAC7B,MAAM,aAAa,CAAC;AA4BrB;;;GAGG;AACH,MAAM,UAAU,yBAAyB,CAAC,MAAyB;IACjE,IAAI,KAAK,GAA4B,IAAI,CAAC;IAC1C,IAAI,OAAO,GAAG,KAAK,CAAC;IACpB,IAAI,SAAS,GAA0C,IAAI,CAAC;IAE5D,MAAM,UAAU,GAAG,MAAM,CAAC,UAAU,IAAI,CAAC,CAAC;IAC1C,MAAM,uBAAuB,GAAG,MAAM,CAAC,uBAAuB,IAAI,CAAC,CAAC;IACpE,MAAM,YAAY,GAAG,MAAM,CAAC,YAAY,IAAI,6BAA6B,CAAC;IAC1E,IAAI,mBAAmB,GAAG,CAAC,CAAC;IAC5B,IAAI,WAAW,GAAG,KAAK,CAAC;IAExB,MAAM,SAAS,GAAG,KAAK,EAAE,SAAiB,EAAqB,EAAE;QAC/D,OAAO,KAAK,CAAC,MAAM,CAAC,GAAG,EAAE;YACvB,MAAM,EAAE,MAAM,CAAC,MAAM,IAAI,KAAK;YAC9B,OAAO,EAAE,MAAM,CAAC,OAAO;YACvB,IAAI,EAAE,MAAM,CAAC,IAAI;YACjB,MAAM,EAAE,WAAW,CAAC,OAAO,CAAC,SAAS,CAAC;SACvC,CAAC,CAAC;IACL,CAAC,CAAC;IAEF,MAAM,cAAc,GAAG,KAAK,EAAE,SAAiB,EAAqB,EAAE;QACpE,IAAI,SAAkB,CA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|
-
import { Schema } from "@effect/schema";
|
|
4
|
-
declare const ObservabilityError_base: Schema.TaggedErrorClass<ObservabilityError, "ObservabilityError", {
|
|
5
|
-
readonly _tag: Schema.tag<"ObservabilityError">;
|
|
6
|
-
} & {
|
|
7
|
-
cause: typeof Schema.Unknown;
|
|
8
|
-
message: Schema.optional<typeof Schema.String>;
|
|
9
|
-
stack: Schema.optional<typeof Schema.String>;
|
|
10
|
-
}>;
|
|
11
|
-
export declare class ObservabilityError extends ObservabilityError_base {
|
|
12
|
-
}
|
|
13
|
-
export declare function createObservabilityError(cause: unknown): ObservabilityError;
|
|
14
|
-
export interface ObserveResource {
|
|
15
|
-
start(): Effect.Effect<LogStream, ObservabilityError>;
|
|
16
|
-
stop(): Effect.Effect<void, ObservabilityError>;
|
|
17
|
-
query(filter: LogFilter): Effect.Effect<Log[], ObservabilityError>;
|
|
18
|
-
}
|
|
19
|
-
export interface Backend {
|
|
20
|
-
start(): Effect.Effect<LogStream, ObservabilityError>;
|
|
21
|
-
stop(): Effect.Effect<void, ObservabilityError>;
|
|
22
|
-
}
|
|
23
|
-
export declare function createObserveResource(backend: Backend): ObserveResource;
|
|
24
|
-
export declare function createLogStreamFromQueue(queue: Queue.Queue<Log>): LogStream;
|
|
25
|
-
export {};
|
|
26
|
-
//# sourceMappingURL=observe.d.ts.map
|
package/dist/observe.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"observe.d.ts","sourceRoot":"","sources":["../src/observe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,EAAmB,MAAM,QAAQ,CAAC;AACxD,OAAO,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;;;;;;;;AAOxC,qBAAa,kBAAmB,SAAQ,uBAOvC;CAAG;AAEJ,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,OAAO,GAAG,kBAAkB,CAO3E;AAED,MAAM,WAAW,eAAe;IAC9B,KAAK,IAAI,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE,kBAAkB,CAAC,CAAC;IACtD,IAAI,IAAI,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,kBAAkB,CAAC,CAAC;IAChD,KAAK,CAAC,MAAM,EAAE,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,EAAE,kBAAkB,CAAC,CAAC;CACpE;AAED,MAAM,WAAW,OAAO;IACtB,KAAK,IAAI,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE,kBAAkB,CAAC,CAAC;IACtD,IAAI,IAAI,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,kBAAkB,CAAC,CAAC;CACjD;AAED,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,eAAe,CAsBvE;AAkBD,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,GACtB,SAAS,CAqCX"}
|
package/dist/observe.js
DELETED
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import { Effect, Queue, Runtime, Stream } from "effect";
|
|
2
|
-
import { Schema } from "@effect/schema";
|
|
3
|
-
import { QUEUE_DRAIN_LIMIT, QUEUE_DRAIN_TIMEOUT_MS, QUEUE_TAKE_TIMEOUT_MS } from "./constants";
|
|
4
|
-
export class ObservabilityError extends Schema.TaggedError()("ObservabilityError", {
|
|
5
|
-
cause: Schema.Unknown,
|
|
6
|
-
message: Schema.optional(Schema.String),
|
|
7
|
-
stack: Schema.optional(Schema.String)
|
|
8
|
-
}) {
|
|
9
|
-
}
|
|
10
|
-
export function createObservabilityError(cause) {
|
|
11
|
-
const error = cause instanceof Error ? cause : new Error(String(cause));
|
|
12
|
-
return new ObservabilityError({
|
|
13
|
-
cause,
|
|
14
|
-
message: error.message,
|
|
15
|
-
stack: error.stack
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
export function createObserveResource(backend) {
|
|
19
|
-
return {
|
|
20
|
-
start() {
|
|
21
|
-
return backend.start();
|
|
22
|
-
},
|
|
23
|
-
stop() {
|
|
24
|
-
return backend.stop();
|
|
25
|
-
},
|
|
26
|
-
query(filter) {
|
|
27
|
-
return Effect.acquireUseRelease(backend.start(), (stream) => Stream.fromAsyncIterable(stream, () => Effect.void).pipe(Stream.filter((log) => matchesFilter(log, filter)), Stream.runCollect, Effect.map((chunk) => Array.from(chunk)), Effect.catchAll((e) => Effect.fail(createObservabilityError(e)))), () => backend.stop().pipe(Effect.catchAll(() => Effect.void)));
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
function matchesFilter(log, filter) {
|
|
32
|
-
if (filter.requestId && log.requestId !== filter.requestId)
|
|
33
|
-
return false;
|
|
34
|
-
if (filter.stage && log.stage !== filter.stage)
|
|
35
|
-
return false;
|
|
36
|
-
if (filter.action && log.action !== filter.action)
|
|
37
|
-
return false;
|
|
38
|
-
if (filter.status && log.status !== filter.status)
|
|
39
|
-
return false;
|
|
40
|
-
if (filter.since && log.timestamp) {
|
|
41
|
-
const logTime = new Date(log.timestamp).getTime();
|
|
42
|
-
if (logTime < filter.since.getTime())
|
|
43
|
-
return false;
|
|
44
|
-
}
|
|
45
|
-
if (filter.until && log.timestamp) {
|
|
46
|
-
const logTime = new Date(log.timestamp).getTime();
|
|
47
|
-
if (logTime > filter.until.getTime())
|
|
48
|
-
return false;
|
|
49
|
-
}
|
|
50
|
-
return true;
|
|
51
|
-
}
|
|
52
|
-
export function createLogStreamFromQueue(queue) {
|
|
53
|
-
const runtime = Runtime.defaultRuntime;
|
|
54
|
-
return {
|
|
55
|
-
async *[Symbol.asyncIterator]() {
|
|
56
|
-
try {
|
|
57
|
-
while (true) {
|
|
58
|
-
const log = await Runtime.runPromise(runtime)(Queue.take(queue).pipe(Effect.timeout(`${QUEUE_TAKE_TIMEOUT_MS} millis`), Effect.catchAll(() => Effect.succeed(null))));
|
|
59
|
-
if (log === null)
|
|
60
|
-
break;
|
|
61
|
-
yield log;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
finally {
|
|
65
|
-
const remaining = [];
|
|
66
|
-
try {
|
|
67
|
-
for (let i = 0; i < QUEUE_DRAIN_LIMIT; i++) {
|
|
68
|
-
const log = await Runtime.runPromise(runtime)(Queue.take(queue).pipe(Effect.timeout(`${QUEUE_DRAIN_TIMEOUT_MS} millis`), Effect.catchAll(() => Effect.succeed(null))));
|
|
69
|
-
if (log === null)
|
|
70
|
-
break;
|
|
71
|
-
remaining.push(log);
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
catch {
|
|
75
|
-
// Ignore
|
|
76
|
-
}
|
|
77
|
-
for (const log of remaining) {
|
|
78
|
-
yield log;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
};
|
|
83
|
-
}
|
|
84
|
-
//# sourceMappingURL=observe.js.map
|
package/dist/observe.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"observe.js","sourceRoot":"","sources":["../src/observe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAExD,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,EACL,iBAAiB,EACjB,sBAAsB,EACtB,qBAAqB,EACtB,MAAM,aAAa,CAAC;AAErB,MAAM,OAAO,kBAAmB,SAAQ,MAAM,CAAC,WAAW,EAAsB,CAC9E,oBAAoB,EACpB;IACE,KAAK,EAAE,MAAM,CAAC,OAAO;IACrB,OAAO,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC;IACvC,KAAK,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC;CACtC,CACF;CAAG;AAEJ,MAAM,UAAU,wBAAwB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.
|
|
4
|
-
* Preserves literal union types for StoryId.
|
|
5
|
-
*/
|
|
6
|
-
export declare function definePrd<TId extends string>(prd: Prd<TId>): Prd<TId>;
|
|
7
|
-
//# sourceMappingURL=define-prd.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"define-prd.d.ts","sourceRoot":"","sources":["../../src/prd/define-prd.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,SAAS,CAAC;AAEnC;;;GAGG;AACH,wBAAgB,SAAS,CAAC,GAAG,SAAS,MAAM,EAC1C,GAAG,EAAE,GAAG,CAAC,GAAG,CAAC,GACZ,GAAG,CAAC,GAAG,CAAC,CAEV"}
|
package/dist/prd/define-prd.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"define-prd.js","sourceRoot":"","sources":["../../src/prd/define-prd.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,UAAU,SAAS,CACvB,GAAa;IAEb,OAAO,GAAG,CAAC;AACb,CAAC"}
|
package/dist/prd/index.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export type { Prd, Story, GateResult, StoryScope } from "./types";
|
|
2
|
-
export { definePrd } from "./define-prd";
|
|
3
|
-
export { runPrd, type RunPrdResult } from "./runner";
|
|
4
|
-
export { validateScope, getDiffStats, type ScopeViolation } from "./scope-check";
|
|
5
|
-
export { inferScopeDefaults, getScopeDefaults, applyDefaultScope, loadCustomScopeDefaults, DEFAULT_FORBIDDEN_PATHS, COMMON_SRC_PATTERNS, type InferredScopeDefaults, } from "./scope-defaults";
|
|
6
|
-
export { runPrdLoop, createOpenCodeAgent, type PrdLoopOptions, type PrdLoopResult, type AgentContext, type AgentResult, type IterationStatus, } from "./loop";
|
|
7
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/prd/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/prd/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,GAAG,EAAE,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAClE,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,KAAK,YAAY,EAAE,MAAM,UAAU,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,KAAK,cAAc,EAAE,MAAM,eAAe,CAAC;AAGjF,OAAO,EACL,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EACjB,uBAAuB,EACvB,uBAAuB,EACvB,mBAAmB,EACnB,KAAK,qBAAqB,GAC3B,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EACL,UAAU,EACV,mBAAmB,EACnB,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,KAAK,eAAe,GACrB,MAAM,QAAQ,CAAC"}
|
package/dist/prd/index.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export { definePrd } from "./define-prd";
|
|
2
|
-
export { runPrd } from "./runner";
|
|
3
|
-
export { validateScope, getDiffStats } from "./scope-check";
|
|
4
|
-
// Scope defaults (additive feature)
|
|
5
|
-
export { inferScopeDefaults, getScopeDefaults, applyDefaultScope, loadCustomScopeDefaults, DEFAULT_FORBIDDEN_PATHS, COMMON_SRC_PATTERNS, } from "./scope-defaults";
|
|
6
|
-
// Native loop function (additive feature)
|
|
7
|
-
export { runPrdLoop, createOpenCodeAgent, } from "./loop";
|
|
8
|
-
//# sourceMappingURL=index.js.map
|
package/dist/prd/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/prd/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,MAAM,EAAqB,MAAM,UAAU,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,YAAY,EAAuB,MAAM,eAAe,CAAC;AAEjF,oCAAoC;AACpC,OAAO,EACL,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EACjB,uBAAuB,EACvB,uBAAuB,EACvB,mBAAmB,GAEpB,MAAM,kBAAkB,CAAC;AAE1B,0CAA0C;AAC1C,OAAO,EACL,UAAU,EACV,mBAAmB,GAMpB,MAAM,QAAQ,CAAC"}
|