prismalens 0.2.0 → 0.4.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 +29 -13
- package/dist/bin/prismalens.js +39 -50
- package/dist/chunk-2Z7QZSIS.js +20 -0
- package/dist/chunk-5BT3XQOG.js +2990 -0
- package/dist/chunk-6N4PHBII.js +30 -0
- package/dist/chunk-CTKCK7QT.js +387 -0
- package/dist/chunk-CVSS5JPC.js +130 -0
- package/dist/chunk-HPE5CTO4.js +22 -0
- package/dist/chunk-PTBCAI34.js +34 -0
- package/dist/chunk-PVQVFRIV.js +452 -0
- package/dist/chunk-QDK5PAI3.js +155 -0
- package/dist/chunk-SSEIMBQ2.js +204 -0
- package/dist/chunk-TGP6QTFO.js +156 -0
- package/dist/chunk-V6M6ISKI.js +161 -0
- package/dist/chunk-XH6DIKTA.js +83 -0
- package/dist/src/cli/auth.js +112 -101
- package/dist/src/cli/doctor.js +184 -187
- package/dist/src/cli/flags.js +6 -29
- package/dist/src/cli/grouping.js +16 -227
- package/dist/src/cli/init.js +58 -52
- package/dist/src/cli/investigate.js +23 -465
- package/dist/src/cli/listen.js +550 -286
- package/dist/src/cli/report.js +70 -67
- package/dist/src/cli/serve.js +260 -30
- package/dist/src/cli/status.js +87 -86
- package/package.json +16 -7
- package/dist/bin/prismalens.d.ts +0 -3
- package/dist/bin/prismalens.d.ts.map +0 -1
- package/dist/bin/prismalens.js.map +0 -1
- package/dist/src/cli/auth.d.ts +0 -3
- package/dist/src/cli/auth.d.ts.map +0 -1
- package/dist/src/cli/auth.js.map +0 -1
- package/dist/src/cli/doctor.d.ts +0 -18
- package/dist/src/cli/doctor.d.ts.map +0 -1
- package/dist/src/cli/doctor.js.map +0 -1
- package/dist/src/cli/flags.d.ts +0 -2
- package/dist/src/cli/flags.d.ts.map +0 -1
- package/dist/src/cli/flags.js.map +0 -1
- package/dist/src/cli/grouping.d.ts +0 -18
- package/dist/src/cli/grouping.d.ts.map +0 -1
- package/dist/src/cli/grouping.js.map +0 -1
- package/dist/src/cli/init.d.ts +0 -3
- package/dist/src/cli/init.d.ts.map +0 -1
- package/dist/src/cli/init.js.map +0 -1
- package/dist/src/cli/investigate.d.ts +0 -115
- package/dist/src/cli/investigate.d.ts.map +0 -1
- package/dist/src/cli/investigate.js.map +0 -1
- package/dist/src/cli/listen.d.ts +0 -56
- package/dist/src/cli/listen.d.ts.map +0 -1
- package/dist/src/cli/listen.js.map +0 -1
- package/dist/src/cli/report.d.ts +0 -24
- package/dist/src/cli/report.d.ts.map +0 -1
- package/dist/src/cli/report.js.map +0 -1
- package/dist/src/cli/serve.d.ts +0 -3
- package/dist/src/cli/serve.d.ts.map +0 -1
- package/dist/src/cli/serve.js.map +0 -1
- package/dist/src/cli/status.d.ts +0 -19
- package/dist/src/cli/status.d.ts.map +0 -1
- package/dist/src/cli/status.js.map +0 -1
- package/dist/src/config/loader.d.ts +0 -22
- package/dist/src/config/loader.d.ts.map +0 -1
- package/dist/src/config/loader.js +0 -193
- package/dist/src/config/loader.js.map +0 -1
- package/dist/src/config/schema.d.ts +0 -463
- package/dist/src/config/schema.d.ts.map +0 -1
- package/dist/src/config/schema.js +0 -217
- package/dist/src/config/schema.js.map +0 -1
- package/dist/src/core/caps.d.ts +0 -36
- package/dist/src/core/caps.d.ts.map +0 -1
- package/dist/src/core/caps.js +0 -36
- package/dist/src/core/caps.js.map +0 -1
- package/dist/src/core/db.d.ts +0 -3
- package/dist/src/core/db.d.ts.map +0 -1
- package/dist/src/core/db.js +0 -105
- package/dist/src/core/db.js.map +0 -1
- package/dist/src/core/detect-repo.d.ts +0 -4
- package/dist/src/core/detect-repo.d.ts.map +0 -1
- package/dist/src/core/detect-repo.js +0 -28
- package/dist/src/core/detect-repo.js.map +0 -1
- package/dist/src/core/file-session-store.d.ts +0 -10
- package/dist/src/core/file-session-store.d.ts.map +0 -1
- package/dist/src/core/file-session-store.js +0 -34
- package/dist/src/core/file-session-store.js.map +0 -1
- package/dist/src/core/parse-stdin.d.ts +0 -2
- package/dist/src/core/parse-stdin.d.ts.map +0 -1
- package/dist/src/core/parse-stdin.js +0 -21
- package/dist/src/core/parse-stdin.js.map +0 -1
- package/dist/src/core/run-investigation.d.ts +0 -54
- package/dist/src/core/run-investigation.d.ts.map +0 -1
- package/dist/src/core/run-investigation.js +0 -200
- package/dist/src/core/run-investigation.js.map +0 -1
- package/dist/src/core/session.d.ts +0 -63
- package/dist/src/core/session.d.ts.map +0 -1
- package/dist/src/core/session.js +0 -45
- package/dist/src/core/session.js.map +0 -1
- package/dist/src/core/slack-notify.d.ts +0 -9
- package/dist/src/core/slack-notify.d.ts.map +0 -1
- package/dist/src/core/slack-notify.js +0 -57
- package/dist/src/core/slack-notify.js.map +0 -1
- package/dist/src/core/sqlite-session-store.d.ts +0 -39
- package/dist/src/core/sqlite-session-store.d.ts.map +0 -1
- package/dist/src/core/sqlite-session-store.js +0 -239
- package/dist/src/core/sqlite-session-store.js.map +0 -1
- package/dist/src/http/server.d.ts +0 -31
- package/dist/src/http/server.d.ts.map +0 -1
- package/dist/src/http/server.js +0 -164
- package/dist/src/http/server.js.map +0 -1
- package/dist/src/jsonrpc/server.d.ts +0 -15
- package/dist/src/jsonrpc/server.d.ts.map +0 -1
- package/dist/src/jsonrpc/server.js +0 -244
- package/dist/src/jsonrpc/server.js.map +0 -1
- package/dist/src/jsonrpc/types.d.ts +0 -12
- package/dist/src/jsonrpc/types.d.ts.map +0 -1
- package/dist/src/jsonrpc/types.js +0 -4
- package/dist/src/jsonrpc/types.js.map +0 -1
- package/dist/src/version.d.ts +0 -8
- package/dist/src/version.d.ts.map +0 -1
- package/dist/src/version.js +0 -27
- package/dist/src/version.js.map +0 -1
package/README.md
CHANGED
|
@@ -162,7 +162,7 @@ Preflight checklist that gates a run. Prints pass/fail per check; exits non-zero
|
|
|
162
162
|
a signed-in `~/.claude/.credentials.json`. Doctor reports which layer supplied
|
|
163
163
|
the credential (`source: env | file | stored | none`). (Performs a live
|
|
164
164
|
provider model ping by default, while `--no-ping` skips it.)
|
|
165
|
-
- **SOFT — workspace writable:** `workspace.
|
|
165
|
+
- **SOFT — workspace writable:** `workspace.dir` can be created/written.
|
|
166
166
|
|
|
167
167
|
### `init`
|
|
168
168
|
|
|
@@ -233,7 +233,19 @@ stdout).
|
|
|
233
233
|
```
|
|
234
234
|
|
|
235
235
|
**`investigate`** — `params`: `{ alert?: FiringAlert, query?: string, repo?: string,
|
|
236
|
-
harness?: string, model?: string, config?: string
|
|
236
|
+
harness?: string, model?: string, config?: string, service?: string, mode?: string,
|
|
237
|
+
dangerouslySkipPermissions?: boolean, sandbox?: string, maxTurns?: number }`.
|
|
238
|
+
|
|
239
|
+
CLI-parity params (each falls back to config when absent):
|
|
240
|
+
|
|
241
|
+
- `sandbox` — the isolation boundary (ADR-0020), the CLI's `--sandbox`: one of
|
|
242
|
+
`auto` | `process` | `srt` | `e2b`. Absent ⇒ `agent.sandbox` from config. A
|
|
243
|
+
supplied value that is not a known mode (or a mode the resolved harness cannot
|
|
244
|
+
honour, e.g. `srt` on a non-ACP harness) is a `-32602` error — never a silent
|
|
245
|
+
fall-back to the cooperative floor.
|
|
246
|
+
- `maxTurns` — per-run turn ceiling, the CLI's `--max-turns`: a positive integer.
|
|
247
|
+
A supplied zero, negative, fractional, or non-numeric value is a `-32602` error —
|
|
248
|
+
never a silently-removed cap.
|
|
237
249
|
|
|
238
250
|
Streams a **notification per canonical event** (including the terminal `report`
|
|
239
251
|
event), then **resolves the request** with `{ runId, report }`:
|
|
@@ -263,7 +275,7 @@ concurrently and interleave their notifications — each notification carries it
|
|
|
263
275
|
| `-32700` | Parse error (invalid JSON on a line). |
|
|
264
276
|
| `-32600` | Invalid request (not a well-formed JSON-RPC 2.0 request). |
|
|
265
277
|
| `-32601` | Method not found. |
|
|
266
|
-
| `-32602` | Invalid params (includes `resolveInvestigation` input errors — e.g. no alert/query, unknown or unbuilt harness). |
|
|
278
|
+
| `-32602` | Invalid params (includes an invalid `sandbox` mode or `maxTurns` value, and `resolveInvestigation` input errors — e.g. no alert/query, unknown or unbuilt harness). |
|
|
267
279
|
| `-32603` | Internal error (mid-stream failure; `data` carries `{ runId }`). |
|
|
268
280
|
| `-32000` | No evidence — the harness branch failed and produced no report (`data` carries `{ runId }`). |
|
|
269
281
|
|
|
@@ -292,7 +304,8 @@ var is an error).
|
|
|
292
304
|
# Tier-2 harness backend the supervisor rents (ADR-0008).
|
|
293
305
|
agent:
|
|
294
306
|
default: deepagents # deepagents | claude-code | codex
|
|
295
|
-
# model:
|
|
307
|
+
# model: gpt-oss:120b # bare id — the harness applies its own provider
|
|
308
|
+
# prefix; omit to let the harness default
|
|
296
309
|
sandbox: auto # auto | process | srt — isolation boundary (ADR-0020).
|
|
297
310
|
# auto (default): srt (enforced OS boundary) WHEN its
|
|
298
311
|
# egress bridge is healthy (a self-check catches WSL
|
|
@@ -301,13 +314,13 @@ agent:
|
|
|
301
314
|
|
|
302
315
|
# Read-only telemetry + app endpoints the harness may query.
|
|
303
316
|
telemetry:
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
317
|
+
prometheus_url: http://localhost:9090
|
|
318
|
+
alertmanager_url: http://localhost:9093
|
|
319
|
+
api_url: http://localhost:3000
|
|
307
320
|
|
|
308
321
|
# Where runs, events, and reports are stored.
|
|
309
322
|
workspace:
|
|
310
|
-
|
|
323
|
+
dir: ~/.prismalens
|
|
311
324
|
|
|
312
325
|
# Per-harness native passthrough (ADR-0017) — untyped, forwarded straight to the
|
|
313
326
|
# rented harness. For `deepagents` (the npm `deepagents-acp` binary, driven over
|
|
@@ -321,10 +334,13 @@ harnesses:
|
|
|
321
334
|
```
|
|
322
335
|
|
|
323
336
|
Notes:
|
|
324
|
-
- `agent.model`
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
- `
|
|
337
|
+
- `agent.model` sets the **Tier-2 harness** model only (a bare id, e.g. `gpt-oss:120b`;
|
|
338
|
+
each harness applies its own provider prefix). `--model` overrides it.
|
|
339
|
+
- `synth.model` sets the **Tier-1 reduce** (report-synthesis) model — a separate call
|
|
340
|
+
to a separate provider (ADR-0013/0016). `agent.model` never feeds it, so a harness on
|
|
341
|
+
one provider (e.g. `claude-code`) can't misroute the reduce call to another (ollama).
|
|
342
|
+
- `telemetry.*` keys are snake_case (`prometheus_url`, `alertmanager_url`, `api_url`)
|
|
343
|
+
and default to host-local URLs when unset.
|
|
328
344
|
- There is currently no `agent.timeout_ms`, `budget.*`, or `logging.*` config —
|
|
329
345
|
an overall per-run wall-clock budget and a Tier-1 reduce token/retry budget are
|
|
330
346
|
planned alongside the Phase B.1 Sandbox port's resource limits (ADR-0020), not
|
|
@@ -341,7 +357,7 @@ The resolution precedence for any credential is: **env** (`PROVIDER_API_KEY`)
|
|
|
341
357
|
- `pl auth list` — view saved providers.
|
|
342
358
|
- `pl auth logout <provider>` — remove a saved credential.
|
|
343
359
|
|
|
344
|
-
Stored credentials live in `auth.json` inside the app-data dir (`~/.prismalens` by default, honors `
|
|
360
|
+
Stored credentials live in `auth.json` inside the app-data dir (`~/.prismalens` by default, honors `PRISMALENS_WORKSPACE_DIR`), enforced to mode `0600`.
|
|
345
361
|
|
|
346
362
|
- **Tier-1 reduce + the `deepagents` harness** use an OpenAI-compatible endpoint:
|
|
347
363
|
- `OLLAMA_API_KEY` or `OPENAI_API_KEY` (the API key),
|
package/dist/bin/prismalens.js
CHANGED
|
@@ -1,59 +1,48 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
* a fast `--help` doesn't pull in the engine. Bodies are implemented separately.
|
|
8
|
-
*/
|
|
2
|
+
import {
|
|
3
|
+
cliVersion
|
|
4
|
+
} from "../chunk-HPE5CTO4.js";
|
|
5
|
+
|
|
6
|
+
// bin/prismalens.ts
|
|
9
7
|
import { defineCommand, runMain, showUsage } from "citty";
|
|
10
8
|
import consola from "consola";
|
|
11
|
-
import { cliVersion } from "../src/version.js";
|
|
12
|
-
// The AI SDK's one-time "AI SDK Warning System" banner prints via console.info
|
|
13
|
-
// (STDOUT) mid-run — noise in the live timeline and corruption in piped JSON.
|
|
14
|
-
// Off for the whole CLI; real per-warning notices still reach stderr via
|
|
15
|
-
// process.emitWarning.
|
|
16
9
|
globalThis.AI_SDK_LOG_WARNINGS = false;
|
|
17
|
-
|
|
10
|
+
var originalEmit = process.emit;
|
|
18
11
|
process.emit = ((name, ...args) => {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
return originalEmit.apply(process, [name, ...args]);
|
|
12
|
+
if (name === "warning" && args[0]?.name === "ExperimentalWarning" && args[0]?.message?.includes("SQLite")) {
|
|
13
|
+
return false;
|
|
14
|
+
}
|
|
15
|
+
return originalEmit.apply(process, [name, ...args]);
|
|
25
16
|
});
|
|
26
|
-
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
17
|
+
var lazy = (name) => () => {
|
|
18
|
+
const modulePath = `../src/cli/${name}.js`;
|
|
19
|
+
return import(modulePath).then((m) => m.default);
|
|
20
|
+
};
|
|
21
|
+
var main = defineCommand({
|
|
22
|
+
meta: {
|
|
23
|
+
name: "prismalens",
|
|
24
|
+
version: cliVersion(),
|
|
25
|
+
description: "PrismaLens investigation engine CLI \u2014 drives the two-tier engine (ADR-0008/0010)."
|
|
26
|
+
},
|
|
27
|
+
subCommands: {
|
|
28
|
+
investigate: lazy("investigate"),
|
|
29
|
+
listen: lazy("listen"),
|
|
30
|
+
serve: lazy("serve"),
|
|
31
|
+
doctor: lazy("doctor"),
|
|
32
|
+
init: lazy("init"),
|
|
33
|
+
status: lazy("status"),
|
|
34
|
+
report: lazy("report"),
|
|
35
|
+
auth: lazy("auth")
|
|
36
|
+
}
|
|
44
37
|
});
|
|
45
38
|
runMain(main, {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
consola.info(`See \`${cmdName} --help\` for usage.`);
|
|
56
|
-
}
|
|
57
|
-
},
|
|
39
|
+
showUsage: async (cmd, parent) => {
|
|
40
|
+
const rawArgs = process.argv.slice(2);
|
|
41
|
+
if (rawArgs.includes("--help") || rawArgs.includes("-h") || rawArgs.length === 0) {
|
|
42
|
+
await showUsage(cmd, parent);
|
|
43
|
+
} else {
|
|
44
|
+
const cmdName = `pl${rawArgs[0] && !rawArgs[0].startsWith("-") ? ` ${rawArgs[0]}` : ""}`;
|
|
45
|
+
consola.info(`Run \`${cmdName} --help\` for usage.`);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
58
48
|
});
|
|
59
|
-
//# sourceMappingURL=prismalens.js.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// ../@prismalens/config/dist/utils/app-data.js
|
|
2
|
+
import { mkdirSync } from "node:fs";
|
|
3
|
+
import { homedir } from "node:os";
|
|
4
|
+
import { join } from "node:path";
|
|
5
|
+
function getAppDataDir() {
|
|
6
|
+
if (process.env.PRISMALENS_WORKSPACE_DIR) {
|
|
7
|
+
return process.env.PRISMALENS_WORKSPACE_DIR;
|
|
8
|
+
}
|
|
9
|
+
return join(homedir(), ".prismalens");
|
|
10
|
+
}
|
|
11
|
+
function ensureAppDataDir() {
|
|
12
|
+
const appDataDir = getAppDataDir();
|
|
13
|
+
mkdirSync(appDataDir, { recursive: true, mode: 493 });
|
|
14
|
+
return appDataDir;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export {
|
|
18
|
+
getAppDataDir,
|
|
19
|
+
ensureAppDataDir
|
|
20
|
+
};
|