chat-recall 0.5.6 → 0.5.7
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 +332 -0
- package/dist/cli.js +7013 -4542
- package/dist/cli.js.map +1 -1
- package/dist/code-index-cursor.d.ts +18 -0
- package/dist/code-index-cursor.d.ts.map +1 -0
- package/dist/code-index-cursor.js +89 -0
- package/dist/code-index-cursor.js.map +1 -0
- package/dist/daemon-log.d.ts +44 -0
- package/dist/daemon-log.d.ts.map +1 -0
- package/dist/daemon-log.js +74 -0
- package/dist/daemon-log.js.map +1 -0
- package/dist/derived.d.ts +20 -0
- package/dist/derived.d.ts.map +1 -0
- package/dist/derived.js +106 -0
- package/dist/derived.js.map +1 -0
- package/dist/install-skills.d.ts.map +1 -1
- package/dist/install-skills.js +6 -1
- package/dist/install-skills.js.map +1 -1
- package/dist/log-rotate.d.ts +16 -0
- package/dist/log-rotate.d.ts.map +1 -0
- package/dist/log-rotate.js +50 -0
- package/dist/log-rotate.js.map +1 -0
- package/dist/mcp.d.ts.map +1 -1
- package/dist/mcp.js +5830 -3788
- package/dist/mcp.js.map +1 -1
- package/dist/project-tasks.js +1 -1
- package/dist/project-tasks.js.map +1 -1
- package/dist/redact-deep.d.ts +4 -0
- package/dist/redact-deep.d.ts.map +1 -0
- package/dist/redact-deep.js +26 -0
- package/dist/redact-deep.js.map +1 -0
- package/dist/scan-pool.d.ts +56 -0
- package/dist/scan-pool.d.ts.map +1 -0
- package/dist/scan-pool.js +245 -0
- package/dist/scan-pool.js.map +1 -0
- package/dist/scan-worker.d.ts +78 -0
- package/dist/scan-worker.d.ts.map +1 -0
- package/dist/scan-worker.js +11175 -0
- package/dist/scan-worker.js.map +1 -0
- package/dist/self-restart.d.ts +20 -2
- package/dist/self-restart.d.ts.map +1 -1
- package/dist/self-restart.js +16 -6
- package/dist/self-restart.js.map +1 -1
- package/dist/server-probe.d.ts +76 -0
- package/dist/server-probe.d.ts.map +1 -0
- package/dist/server-probe.js +106 -0
- package/dist/server-probe.js.map +1 -0
- package/dist/sync-client.d.ts +24 -0
- package/dist/sync-client.d.ts.map +1 -1
- package/dist/sync-client.js +496 -151
- package/dist/sync-client.js.map +1 -1
- package/dist/target-breaker.d.ts +61 -0
- package/dist/target-breaker.d.ts.map +1 -0
- package/dist/target-breaker.js +85 -0
- package/dist/target-breaker.js.map +1 -0
- package/dist/telemetry-consent.d.ts +31 -0
- package/dist/telemetry-consent.d.ts.map +1 -0
- package/dist/telemetry-consent.js +115 -0
- package/dist/telemetry-consent.js.map +1 -0
- package/dist/telemetry.d.ts +22 -0
- package/dist/telemetry.d.ts.map +1 -0
- package/dist/telemetry.js +125 -0
- package/dist/telemetry.js.map +1 -0
- package/dist/tick-queue.d.ts +67 -0
- package/dist/tick-queue.d.ts.map +1 -0
- package/dist/tick-queue.js +104 -0
- package/dist/tick-queue.js.map +1 -0
- package/dist/transport-safety.d.ts +43 -0
- package/dist/transport-safety.d.ts.map +1 -0
- package/dist/transport-safety.js +100 -0
- package/dist/transport-safety.js.map +1 -0
- package/dist/verify-repair.js +1 -1
- package/dist/verify-repair.js.map +1 -1
- package/dist/watch.js +8345 -6030
- package/package.json +21 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scan-worker.js","sourceRoot":"","sources":["../src/scan-worker.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,EACL,mBAAmB,EAAE,aAAa,EAAE,qBAAqB,GAE1D,MAAM,6CAA6C,CAAC;AA4DrD,IAAI,oBAAoB,GAAG,EAAE,CAAC;AAE9B,SAAS,OAAO,CAAC,IAAc;IAC7B,IAAI,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,WAAW,KAAK,oBAAoB,EAAE,CAAC;QAC3D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,CAAC,CAAC,CAAC;QACjE,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,UAAU,EAAE,WAAW,CAAC;gBACtB,EAAE,EAAE,IAAI,CAAC,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC;gBACtC,KAAK,EAAE,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC;aAChC,CAAC,CAAC;QAC7B,CAAC;QACD,OAAO;IACT,CAAC;IACD,IAAI,MAAkB,CAAC;IACvB,IAAI,CAAC;QACH,MAAM,GAAG,OAAO,CAAC,IAAgB,CAAC,CAAC;IACrC,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,4EAA4E;QAC5E,kEAAkE;QAClE,MAAM,GAAG;YACP,EAAE,EAAE,IAAI,CAAC,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,UAAU,EAAE,CAAC;YACxC,KAAK,EAAE,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC;SACxD,CAAC;IACJ,CAAC;IACD,UAAU,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;AAClC,CAAC,CAAC,CAAC"}
|
package/dist/self-restart.d.ts
CHANGED
|
@@ -43,12 +43,30 @@ export declare const EXIT_CODE_CODE_CHANGED = 75;
|
|
|
43
43
|
export interface CodeFingerprint {
|
|
44
44
|
path: string;
|
|
45
45
|
size: number;
|
|
46
|
-
|
|
46
|
+
/**
|
|
47
|
+
* SHA-256 of the bundle bytes.
|
|
48
|
+
*
|
|
49
|
+
* mtime is deliberately NOT part of the identity. It was, and it made this
|
|
50
|
+
* guard fire on rebuilds that changed nothing: an `npm i -g` of the SAME
|
|
51
|
+
* version rewrites the file, so the mtime moves while every byte stays equal.
|
|
52
|
+
* The log read `changed on disk (731957 -> 731957 bytes)` 90 times in one
|
|
53
|
+
* day, and each line was a real process exit — 90 restarts that picked up no
|
|
54
|
+
* new code, on top of a daemon that was already crash-looping.
|
|
55
|
+
*
|
|
56
|
+
* The content hash answers the actual question. An identical rebuild is not a
|
|
57
|
+
* change, and a same-size edit still is.
|
|
58
|
+
*/
|
|
59
|
+
hash: string;
|
|
47
60
|
}
|
|
48
61
|
/**
|
|
49
62
|
* Identity of the bundle we are running. The build produces a single bundled
|
|
50
|
-
* `watch.js` (engine included), so one
|
|
63
|
+
* `watch.js` (engine included), so one file answers "did my code change?" —
|
|
51
64
|
* no need to walk node_modules.
|
|
65
|
+
*
|
|
66
|
+
* This reads the bundle (~750 KB) rather than stat-ing it. The caller is a
|
|
67
|
+
* 60-second liveness tick, so the cost is one hash per minute, and correctness
|
|
68
|
+
* here is worth far more than the microseconds: a false positive exits the
|
|
69
|
+
* process, and a false negative leaves a fixed daemon running broken code.
|
|
52
70
|
*/
|
|
53
71
|
export declare function codeFingerprint(entry?: string): CodeFingerprint | null;
|
|
54
72
|
export declare function sameFingerprint(a: CodeFingerprint | null, b: CodeFingerprint | null): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"self-restart.d.ts","sourceRoot":"","sources":["../src/self-restart.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;
|
|
1
|
+
{"version":3,"file":"self-restart.d.ts","sourceRoot":"","sources":["../src/self-restart.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAMH,2EAA2E;AAC3E,eAAO,MAAM,sBAAsB,KAAK,CAAC;AAEzC,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb;;;;;;;;;;;;OAYG;IACH,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAAC,KAAK,SAAkB,GAAG,eAAe,GAAG,IAAI,CAY/E;AAED,wBAAgB,eAAe,CAAC,CAAC,EAAE,eAAe,GAAG,IAAI,EAAE,CAAC,EAAE,eAAe,GAAG,IAAI,GAAG,OAAO,CAG7F;AAED,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,SAAS,GAAG,cAAc,GAAG,MAAM,CAAC;AAEzE;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,EAAE,QAAQ,kBAAmB,GAAG,UAAU,CAK9G;AAED,MAAM,MAAM,aAAa,GACrB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAC9B;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,GAClB;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAErB,yEAAyE;AACzE,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,UAAU,GAAG,aAAa,CAU/D;AAkBD,MAAM,WAAW,kBAAkB;IACjC,oCAAoC;IACpC,IAAI,EAAE,eAAe,GAAG,IAAI,CAAC;IAC7B,GAAG,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1B,iBAAiB;IACjB,GAAG,CAAC,EAAE,MAAM,eAAe,GAAG,IAAI,CAAC;IACnC,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,gDAAgD;IAChD,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAC/B;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,kBAAkB,GAAG,OAAO,CAuBlE"}
|
package/dist/self-restart.js
CHANGED
|
@@ -39,29 +39,39 @@
|
|
|
39
39
|
* re-rendering anyone's unit file.
|
|
40
40
|
*/
|
|
41
41
|
import { spawn } from 'child_process';
|
|
42
|
-
import {
|
|
42
|
+
import { readFileSync } from 'fs';
|
|
43
|
+
import { createHash } from 'crypto';
|
|
43
44
|
/** Non-zero so systemd's `Restart=on-failure` picks it up. EX_TEMPFAIL. */
|
|
44
45
|
export const EXIT_CODE_CODE_CHANGED = 75;
|
|
45
46
|
/**
|
|
46
47
|
* Identity of the bundle we are running. The build produces a single bundled
|
|
47
|
-
* `watch.js` (engine included), so one
|
|
48
|
+
* `watch.js` (engine included), so one file answers "did my code change?" —
|
|
48
49
|
* no need to walk node_modules.
|
|
50
|
+
*
|
|
51
|
+
* This reads the bundle (~750 KB) rather than stat-ing it. The caller is a
|
|
52
|
+
* 60-second liveness tick, so the cost is one hash per minute, and correctness
|
|
53
|
+
* here is worth far more than the microseconds: a false positive exits the
|
|
54
|
+
* process, and a false negative leaves a fixed daemon running broken code.
|
|
49
55
|
*/
|
|
50
56
|
export function codeFingerprint(entry = process.argv[1]) {
|
|
51
57
|
if (!entry)
|
|
52
58
|
return null;
|
|
53
59
|
try {
|
|
54
|
-
const
|
|
55
|
-
return {
|
|
60
|
+
const buf = readFileSync(entry);
|
|
61
|
+
return {
|
|
62
|
+
path: entry,
|
|
63
|
+
size: buf.byteLength,
|
|
64
|
+
hash: createHash('sha256').update(buf).digest('hex'),
|
|
65
|
+
};
|
|
56
66
|
}
|
|
57
67
|
catch {
|
|
58
|
-
return null; // running from a pipe/eval — nothing to
|
|
68
|
+
return null; // running from a pipe/eval, or a half-written bundle — nothing to act on
|
|
59
69
|
}
|
|
60
70
|
}
|
|
61
71
|
export function sameFingerprint(a, b) {
|
|
62
72
|
if (!a || !b)
|
|
63
73
|
return true; // unknown ⇒ don't act
|
|
64
|
-
return a.path === b.path && a.size === b.size && a.
|
|
74
|
+
return a.path === b.path && a.size === b.size && a.hash === b.hash;
|
|
65
75
|
}
|
|
66
76
|
/**
|
|
67
77
|
* Who, if anyone, will restart us. systemd exports INVOCATION_ID (and
|
package/dist/self-restart.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"self-restart.js","sourceRoot":"","sources":["../src/self-restart.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,IAAI,GAAG,IAAI,CAAC,IAAI,IAAI,CAAC,CAAC,IAAY,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IACjE,IAAI,CAAC,MAAM,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC/C,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What is actually wrong with a configured server URL.
|
|
3
|
+
*
|
|
4
|
+
* THE FAILURE THIS EXISTS TO END. `doctor` used to do:
|
|
5
|
+
*
|
|
6
|
+
* fetch(`${base}/api/capabilities`).then((r) => r.json())
|
|
7
|
+
*
|
|
8
|
+
* with no `r.ok` check, inside one try/catch. A host that had been renamed
|
|
9
|
+
* away served an HTML 404 page, `.json()` choked on `<!DO`, and the user was
|
|
10
|
+
* told:
|
|
11
|
+
*
|
|
12
|
+
* ✗ Server reachable unreachable: Unexpected non-whitespace character
|
|
13
|
+
* after JSON at position 4
|
|
14
|
+
*
|
|
15
|
+
* Three different problems with three different fixes — a stale token, a moved
|
|
16
|
+
* server, a server that is down — all arrived as that one sentence. And the
|
|
17
|
+
* "Logged in" row above it printed a green tick, because it only checked that
|
|
18
|
+
* credentials.json had an entry.
|
|
19
|
+
*
|
|
20
|
+
* So: classify, then advise. Every branch names the URL and the command that
|
|
21
|
+
* fixes it.
|
|
22
|
+
*/
|
|
23
|
+
export type ProbeResult =
|
|
24
|
+
/** Spoke to a chat-recall server and understood the answer. */
|
|
25
|
+
{
|
|
26
|
+
kind: 'ok';
|
|
27
|
+
apiVersion: number;
|
|
28
|
+
edition?: string;
|
|
29
|
+
cliVersion?: string;
|
|
30
|
+
}
|
|
31
|
+
/** Reached an HTTP server, but nothing is mounted here. Usually a moved host. */
|
|
32
|
+
| {
|
|
33
|
+
kind: 'moved';
|
|
34
|
+
status: number;
|
|
35
|
+
}
|
|
36
|
+
/** The server is there and refused the credential. */
|
|
37
|
+
| {
|
|
38
|
+
kind: 'unauthorized';
|
|
39
|
+
status: number;
|
|
40
|
+
}
|
|
41
|
+
/** The server is there and broken. */
|
|
42
|
+
| {
|
|
43
|
+
kind: 'server_error';
|
|
44
|
+
status: number;
|
|
45
|
+
}
|
|
46
|
+
/** 2xx, but not a chat-recall API — a proxy, a captive portal, a parked domain. */
|
|
47
|
+
| {
|
|
48
|
+
kind: 'not_api';
|
|
49
|
+
status: number;
|
|
50
|
+
snippet: string;
|
|
51
|
+
}
|
|
52
|
+
/** Never got an HTTP response at all: DNS, TLS, connection, timeout. */
|
|
53
|
+
| {
|
|
54
|
+
kind: 'unreachable';
|
|
55
|
+
error: string;
|
|
56
|
+
};
|
|
57
|
+
/** True when the probe proves a usable chat-recall server. */
|
|
58
|
+
export declare function probeOk(r: ProbeResult): r is Extract<ProbeResult, {
|
|
59
|
+
kind: 'ok';
|
|
60
|
+
}>;
|
|
61
|
+
/**
|
|
62
|
+
* Probe `<base>/api/capabilities`, which is unauthenticated and cheap.
|
|
63
|
+
*
|
|
64
|
+
* `fetchImpl` is injectable so the classification is testable without a server —
|
|
65
|
+
* the whole point of this module is behaviour on responses that are hard to
|
|
66
|
+
* produce on demand (an HTML 404, a parked domain, a 502).
|
|
67
|
+
*/
|
|
68
|
+
export declare function probeServer(base: string, opts?: {
|
|
69
|
+
timeoutMs?: number;
|
|
70
|
+
fetchImpl?: typeof fetch;
|
|
71
|
+
}): Promise<ProbeResult>;
|
|
72
|
+
/**
|
|
73
|
+
* One line the user can act on. Never a stack trace, always the next command.
|
|
74
|
+
*/
|
|
75
|
+
export declare function probeAdvice(r: ProbeResult, base: string): string;
|
|
76
|
+
//# sourceMappingURL=server-probe.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server-probe.d.ts","sourceRoot":"","sources":["../src/server-probe.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;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
+
* THE FAILURE THIS EXISTS TO END. `doctor` used to do:
|
|
5
|
+
*
|
|
6
|
+
* fetch(`${base}/api/capabilities`).then((r) => r.json())
|
|
7
|
+
*
|
|
8
|
+
* with no `r.ok` check, inside one try/catch. A host that had been renamed
|
|
9
|
+
* away served an HTML 404 page, `.json()` choked on `<!DO`, and the user was
|
|
10
|
+
* told:
|
|
11
|
+
*
|
|
12
|
+
* ✗ Server reachable unreachable: Unexpected non-whitespace character
|
|
13
|
+
* after JSON at position 4
|
|
14
|
+
*
|
|
15
|
+
* Three different problems with three different fixes — a stale token, a moved
|
|
16
|
+
* server, a server that is down — all arrived as that one sentence. And the
|
|
17
|
+
* "Logged in" row above it printed a green tick, because it only checked that
|
|
18
|
+
* credentials.json had an entry.
|
|
19
|
+
*
|
|
20
|
+
* So: classify, then advise. Every branch names the URL and the command that
|
|
21
|
+
* fixes it.
|
|
22
|
+
*/
|
|
23
|
+
/** True when the probe proves a usable chat-recall server. */
|
|
24
|
+
export function probeOk(r) {
|
|
25
|
+
return r.kind === 'ok' && r.apiVersion >= 2;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Probe `<base>/api/capabilities`, which is unauthenticated and cheap.
|
|
29
|
+
*
|
|
30
|
+
* `fetchImpl` is injectable so the classification is testable without a server —
|
|
31
|
+
* the whole point of this module is behaviour on responses that are hard to
|
|
32
|
+
* produce on demand (an HTML 404, a parked domain, a 502).
|
|
33
|
+
*/
|
|
34
|
+
export async function probeServer(base, opts = {}) {
|
|
35
|
+
const f = opts.fetchImpl || fetch;
|
|
36
|
+
let res;
|
|
37
|
+
try {
|
|
38
|
+
res = await f(`${base.replace(/\/+$/, '')}/api/capabilities`, {
|
|
39
|
+
signal: AbortSignal.timeout(opts.timeoutMs ?? 10_000),
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
catch (err) {
|
|
43
|
+
return { kind: 'unreachable', error: err instanceof Error ? err.message : String(err) };
|
|
44
|
+
}
|
|
45
|
+
if (res.status === 401 || res.status === 403)
|
|
46
|
+
return { kind: 'unauthorized', status: res.status };
|
|
47
|
+
// 404 and 410 mean "this URL serves HTTP but not us". 404 is what a renamed
|
|
48
|
+
// host, a parked domain or a wrong path all produce.
|
|
49
|
+
if (res.status === 404 || res.status === 410)
|
|
50
|
+
return { kind: 'moved', status: res.status };
|
|
51
|
+
if (res.status >= 500)
|
|
52
|
+
return { kind: 'server_error', status: res.status };
|
|
53
|
+
if (!res.ok)
|
|
54
|
+
return { kind: 'moved', status: res.status };
|
|
55
|
+
// 2xx. Read as TEXT first: .json() on an HTML body throws a parse error that
|
|
56
|
+
// says nothing about the actual problem, which is how this bug shipped.
|
|
57
|
+
let body;
|
|
58
|
+
try {
|
|
59
|
+
body = await res.text();
|
|
60
|
+
}
|
|
61
|
+
catch (err) {
|
|
62
|
+
return { kind: 'unreachable', error: err instanceof Error ? err.message : String(err) };
|
|
63
|
+
}
|
|
64
|
+
let parsed;
|
|
65
|
+
try {
|
|
66
|
+
parsed = JSON.parse(body);
|
|
67
|
+
}
|
|
68
|
+
catch {
|
|
69
|
+
return { kind: 'not_api', status: res.status, snippet: body.trim().slice(0, 60) };
|
|
70
|
+
}
|
|
71
|
+
if (typeof parsed?.apiVersion !== 'number') {
|
|
72
|
+
return { kind: 'not_api', status: res.status, snippet: body.trim().slice(0, 60) };
|
|
73
|
+
}
|
|
74
|
+
return {
|
|
75
|
+
kind: 'ok',
|
|
76
|
+
apiVersion: parsed.apiVersion,
|
|
77
|
+
edition: parsed.edition,
|
|
78
|
+
cliVersion: parsed.cli?.version,
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* One line the user can act on. Never a stack trace, always the next command.
|
|
83
|
+
*/
|
|
84
|
+
export function probeAdvice(r, base) {
|
|
85
|
+
switch (r.kind) {
|
|
86
|
+
case 'ok':
|
|
87
|
+
return r.apiVersion >= 2
|
|
88
|
+
? `apiVersion ${r.apiVersion}${r.edition ? `, edition ${r.edition}` : ''}`
|
|
89
|
+
: `apiVersion ${r.apiVersion} is too old for this CLI — upgrade the server`;
|
|
90
|
+
case 'moved':
|
|
91
|
+
// The case that produced the parse error. Say what it means.
|
|
92
|
+
return `HTTP ${r.status} — nothing is served at ${base}. If the host moved, `
|
|
93
|
+
+ 're-point it: `chat-recall login <new-server-url>`';
|
|
94
|
+
case 'unauthorized':
|
|
95
|
+
return `HTTP ${r.status} — ${base} rejected the credential. Re-login: `
|
|
96
|
+
+ '`chat-recall login ' + base + '`';
|
|
97
|
+
case 'server_error':
|
|
98
|
+
return `HTTP ${r.status} — ${base} is up but failing. Nothing to fix locally; check the server.`;
|
|
99
|
+
case 'not_api':
|
|
100
|
+
return `${base} answered ${r.status} with something that is not the chat-recall API `
|
|
101
|
+
+ `(${JSON.stringify(r.snippet)}) — check the URL, a proxy or a captive portal`;
|
|
102
|
+
case 'unreachable':
|
|
103
|
+
return `no HTTP response from ${base} (${r.error}) — check the URL, DNS, or that the server is running`;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
//# sourceMappingURL=server-probe.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server-probe.js","sourceRoot":"","sources":["../src/server-probe.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAgBH,8DAA8D;AAC9D,MAAM,UAAU,OAAO,CAAC,CAAc;IACpC,OAAO,CAAC,CAAC,IAAI,KAAK,IAAI,IAAI,CAAC,CAAC,UAAU,IAAI,CAAC,CAAC;AAC9C,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,IAAY,EACZ,OAAyD,EAAE;IAE3D,MAAM,CAAC,GAAG,IAAI,CAAC,SAAS,IAAI,KAAK,CAAC;IAClC,IAAI,GAAa,CAAC;IAClB,IAAI,CAAC;QACH,GAAG,GAAG,MAAM,CAAC,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,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B;kBACzE,mDAAmD,CAAC;QAC1D,KAAK,cAAc;YACjB,OAAO,QAAQ,CAAC,CAAC,MAAM,MAAM,IAAI,sCAAsC;kBACnE,qBAAqB,GAAG,IAAI,GAAG,GAAG,CAAC;QACzC,KAAK,cAAc;YACjB,OAAO,QAAQ,CAAC,CAAC,MAAM,MAAM,IAAI,+DAA+D,CAAC;QACnG,KAAK,SAAS;YACZ,OAAO,GAAG,IAAI,aAAa,CAAC,CAAC,MAAM,kDAAkD;kBACjF,IAAI,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,gDAAgD,CAAC;QACpF,KAAK,aAAa;YAChB,OAAO,yBAAyB,IAAI,KAAK,CAAC,CAAC,KAAK,uDAAuD,CAAC;IAC5G,CAAC;AACH,CAAC"}
|
package/dist/sync-client.d.ts
CHANGED
|
@@ -109,6 +109,23 @@ export declare function batchScanExternal(items: Array<{
|
|
|
109
109
|
scanMs: number;
|
|
110
110
|
};
|
|
111
111
|
export declare function _resetCapsCacheForTests(): void;
|
|
112
|
+
/**
|
|
113
|
+
* Learn the tenant-scoped ingest allowance from an authenticated response.
|
|
114
|
+
*
|
|
115
|
+
* `verifyServerApi` sets the same map from /api/capabilities, which is pre-auth
|
|
116
|
+
* and therefore can only report the CLASS ceiling. This overrides it with the
|
|
117
|
+
* number that actually applies to this tenant.
|
|
118
|
+
*/
|
|
119
|
+
export declare function setServerIngestConcurrency(serverUrl: string, n: number): void;
|
|
120
|
+
/** Does this server accept `Content-Encoding: gzip` on a request body? */
|
|
121
|
+
export declare function serverAcceptsGzipBody(serverUrl: string): boolean;
|
|
122
|
+
/**
|
|
123
|
+
* How many uploads may be in flight at once, according to the SERVER.
|
|
124
|
+
*
|
|
125
|
+
* Returns null when the server does not advertise it (older image) — the caller
|
|
126
|
+
* then keeps its own default.
|
|
127
|
+
*/
|
|
128
|
+
export declare function serverIngestConcurrency(serverUrl: string): number | null;
|
|
112
129
|
/**
|
|
113
130
|
* Build the live per-session conversation payload — the THIN-COLLECTOR core.
|
|
114
131
|
* Reads ONLY the raw transcript (via `parseTranscript` + `parseSessionFile`),
|
|
@@ -211,6 +228,13 @@ export declare function buildConversationTail(ref: SessionRef, fromOffset: numbe
|
|
|
211
228
|
newOffset: number;
|
|
212
229
|
findings: BuiltConversation['findings'];
|
|
213
230
|
} | null>;
|
|
231
|
+
/**
|
|
232
|
+
* Per-session derived payload: the four compute kinds the server's deep-dive
|
|
233
|
+
* routes read (diff/outcome/commits/markers) + the outcome-badge row. ALWAYS
|
|
234
|
+
* computed live from the transcript/git (no local compute/outcome cache is
|
|
235
|
+
* read or warmed — thin collector). Everything is deep-redacted — diffs carry
|
|
236
|
+
* file content.
|
|
237
|
+
*/
|
|
214
238
|
/**
|
|
215
239
|
* Incremental sync for the watch daemon and parameterless `chat-recall sync`:
|
|
216
240
|
* push only sessions modified after `settings.sync.lastSyncAt`, then advance
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sync-client.d.ts","sourceRoot":"","sources":["../src/sync-client.ts"],"names":[],"mappings":"AAyCA,OAAO,EAAoF,KAAK,WAAW,EAAE,KAAK,cAAc,EAAE,MAAM,4CAA4C,CAAC;AAWrL,OAAO,EAA+B,KAAK,UAAU,EAAE,MAAM,0CAA0C,CAAC;
|
|
1
|
+
{"version":3,"file":"sync-client.d.ts","sourceRoot":"","sources":["../src/sync-client.ts"],"names":[],"mappings":"AAyCA,OAAO,EAAoF,KAAK,WAAW,EAAE,KAAK,cAAc,EAAE,MAAM,4CAA4C,CAAC;AAWrL,OAAO,EAA+B,KAAK,UAAU,EAAE,MAAM,0CAA0C,CAAC;AA2ExG,OAAO,4CAA4C,CAAC;AAMpD,MAAM,WAAW,WAAW;IAAG,SAAS,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;CAAE;AAElE;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,WAAW,GAAG,IAAI,CAoBpD;AAED,wBAAgB,kBAAkB,I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