caveat-cli 0.20.2 → 0.21.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 +8 -0
- package/dist/caveat.js +51 -7
- package/dist/{chunk-JYXVT46B.js → chunk-NH5X6DJE.js} +6313 -1729
- package/dist/chunk-NH5X6DJE.js.map +1 -0
- package/dist/chunk-TWJDSUZ4.js +46 -0
- package/dist/chunk-TWJDSUZ4.js.map +1 -0
- package/dist/factory-private-evidence/capability.v1.schema.json +157 -0
- package/dist/factory-private-evidence/private-frame.v1.schema.json +740 -0
- package/dist/factory-private-evidence/windows-channel.v1.schema.json +38 -0
- package/dist/factory-private-evidence-capabilities.v1.json +10 -0
- package/dist/index.js +8368 -9480
- package/dist/index.js.map +1 -1
- package/dist/privateEvidence/candidate.js +18 -0
- package/dist/privateEvidence/candidate.js.map +1 -0
- package/dist/privateEvidence/origin.js +79 -0
- package/dist/privateEvidence/origin.js.map +1 -0
- package/dist/privateEvidence/validation.js +1078 -0
- package/dist/privateEvidence/validation.js.map +1 -0
- package/dist/{server-XI7ZOMPY.js → server-UQ5OZ2IQ.js} +1484 -1533
- package/dist/server-UQ5OZ2IQ.js.map +1 -0
- package/package.json +4 -2
- package/dist/chunk-JYXVT46B.js.map +0 -1
- package/dist/server-XI7ZOMPY.js.map +0 -1
package/README.md
CHANGED
|
@@ -146,6 +146,14 @@ are `ack <cursor>`, `resolve <fingerprint>`, `reopen <fingerprint>`, and
|
|
|
146
146
|
boolean `true` keeps collection disabled. Runtime state lives under Caveat's
|
|
147
147
|
own state directory, independently of the knowledge index and host hook files.
|
|
148
148
|
|
|
149
|
+
Handled sync cancellation and remote failures retain local input and show a
|
|
150
|
+
non-zero result without automatic app repair registration. Failed recovery is
|
|
151
|
+
still reported. Severity uses observed impact (`warn` for a failed operation,
|
|
152
|
+
`high` for an unavailable feature or failed recovery, `fatal` for confirmed data
|
|
153
|
+
loss); occurrence counts do not raise it. Existing serious unresolved records
|
|
154
|
+
remain unchanged until reviewed. Cause and recovery need diagnostic evidence.
|
|
155
|
+
See the [reporting contract](https://github.com/kitepon/Caveat/blob/main/docs/01_plan.md#通信失敗の報告と重大度).
|
|
156
|
+
|
|
149
157
|
Nothing is sent anywhere by default and the package contains no destination.
|
|
150
158
|
To report to a collector you operate, also set
|
|
151
159
|
`"runtimeErrorReportCredentialFile"` to the absolute path of the credential
|
package/dist/caveat.js
CHANGED
|
@@ -1,10 +1,54 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import { spawn } from 'node:child_process';
|
|
3
|
+
import { fileURLToPath } from 'node:url';
|
|
4
|
+
|
|
5
|
+
// Install the warning handler before loading any SQLite-dependent product module.
|
|
2
6
|
process.removeAllListeners('warning');
|
|
3
|
-
process.on('warning', (
|
|
4
|
-
if (
|
|
5
|
-
process.stderr.write(
|
|
6
|
-
});
|
|
7
|
-
import('./index.js').catch((err) => {
|
|
8
|
-
process.stderr.write('[caveat:fatal] ' + (err && err.stack || err) + '\n');
|
|
9
|
-
process.exit(1);
|
|
7
|
+
process.on('warning', (warning) => {
|
|
8
|
+
if (warning?.name === 'ExperimentalWarning' && warning.message.includes('SQLite')) return;
|
|
9
|
+
process.stderr.write(`(${warning?.name}) ${warning?.message}\n`);
|
|
10
10
|
});
|
|
11
|
+
|
|
12
|
+
// Node 22.5 includes SQLite behind a startup flag. Own that requirement in the
|
|
13
|
+
// shipped launcher, so ordinary npm-bin/MCP/hook commands keep the public floor.
|
|
14
|
+
// Feature detection also covers other supported Node versions before unflagging.
|
|
15
|
+
const hasSqlite = Boolean(process.getBuiltinModule?.('node:sqlite'));
|
|
16
|
+
const flagPattern = /^--(?:no-)?experimental-sqlite(?:=|$)/;
|
|
17
|
+
// Node treats underscores as hyphens in option names, but retains original
|
|
18
|
+
// tokens in execArgv. Normalize comparisons only; forward argv/env unchanged.
|
|
19
|
+
const explicitFlag = process.execArgv.some((arg) => flagPattern.test(arg.replaceAll('_', '-'))) ||
|
|
20
|
+
/(?:^|[\s"'])--(?:no-)?experimental-sqlite(?:$|[\s"'=])/.test((process.env.NODE_OPTIONS ?? '').replaceAll('_', '-'));
|
|
21
|
+
|
|
22
|
+
if (!hasSqlite && !explicitFlag && process.allowedNodeEnvironmentFlags.has('--experimental-sqlite')) {
|
|
23
|
+
const child = spawn(process.execPath, [
|
|
24
|
+
...process.execArgv, '--experimental-sqlite', fileURLToPath(import.meta.url), ...process.argv.slice(2),
|
|
25
|
+
], { stdio: 'inherit', shell: false });
|
|
26
|
+
const forwardInterrupt = () => child.kill('SIGINT');
|
|
27
|
+
const forwardTerminate = () => child.kill('SIGTERM');
|
|
28
|
+
process.on('SIGINT', forwardInterrupt);
|
|
29
|
+
process.on('SIGTERM', forwardTerminate);
|
|
30
|
+
const detachSignals = () => {
|
|
31
|
+
process.removeListener('SIGINT', forwardInterrupt);
|
|
32
|
+
process.removeListener('SIGTERM', forwardTerminate);
|
|
33
|
+
};
|
|
34
|
+
child.once('error', () => {
|
|
35
|
+
detachSignals();
|
|
36
|
+
process.stderr.write('[caveat:fatal] unable to start the SQLite-enabled runtime\n');
|
|
37
|
+
process.exitCode = 1;
|
|
38
|
+
});
|
|
39
|
+
child.once('exit', (code, signal) => {
|
|
40
|
+
detachSignals();
|
|
41
|
+
if (signal) {
|
|
42
|
+
// Preserve signal termination rather than turn a killed child into success.
|
|
43
|
+
try { process.kill(process.pid, signal); }
|
|
44
|
+
catch { process.exitCode = 1; }
|
|
45
|
+
} else process.exitCode = code ?? 1;
|
|
46
|
+
});
|
|
47
|
+
} else {
|
|
48
|
+
// An explicit enable/disable is never overridden. A failed flagged child
|
|
49
|
+
// reaches this branch once, so unavailable SQLite cannot create a retry loop.
|
|
50
|
+
import('./index.js').catch((error) => {
|
|
51
|
+
process.stderr.write('[caveat:fatal] ' + (error?.stack || error) + '\n');
|
|
52
|
+
process.exit(1);
|
|
53
|
+
});
|
|
54
|
+
}
|